The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.
Rust agent-orchestrationai-agentsai-assistantdesktopllmlocal-firstmcppersonal-aiprivacyrustsecond-braintauri
docs(tinyagents, skills/catalog): update READMEs to reflect current module structure and behaviour
Steven Enamakelf37560b64049
diff --git a/crates/openhuman-core/src/agent/tinyagents/README.md b/crates/openhuman-core/src/agent/tinyagents/README.mdindex fcd8e7e719..5488711d71 100644--- a/crates/openhuman-core/src/agent/tinyagents/README.md+++ b/crates/openhuman-core/src/agent/tinyagents/README.md@@ -1,68 +1,64 @@# tinyagents-The **adapter seam** between OpenHuman and the vendored [`tinyagents`](../../../../../vendor/tinyagents/) crate family (issue #4249). OpenHuman's agent turn no longer runs a hand-rolled tool-call loop; it drives the published `tinyagents` `AgentHarness` (LangGraph/LangChain-style durable graphs plus an agent-loop harness with model/tool registries, middleware, retry/fallback, and limits). This module bridges OpenHuman's `Provider`, `Tool`, and `ChatMessage` types onto the crate's `ChatModel`, `Tool`, and `Message` traits and enforces every OpenHuman-specific policy (approval, taint, redaction, budget) on the way in and out.--The chat/channel/sub-agent routes all call [`run_turn_via_tinyagents_shared`] (default ON in production) and are therefore guaranteed not to drift from each other. It is at functional parity with the legacy in-house engine: [`observability::OpenhumanEventBridge`] mirrors the harness event stream onto `AgentProgress` (live tool timeline, incremental text deltas, cost footer), native model streaming forwards true token streaming, multimodal markers are expanded, and history is trimmed/summarized to the context window. Mid-flight steering, sub-agent child-progress deltas (including thinking), and the `ask_user_clarification` early-exit pause are all re-wired onto the tinyagents harness.+The **adapter seam** between OpenHuman and the vendored [`tinyagents`](../../../../../vendor/tinyagents/) crate family (issue #4249). Every agent turn runs on the crate's `AgentHarness` loop; this module bridges OpenHuman's `Provider`, `Tool`, and `ChatMessage` types onto the crate's `ChatModel`, `Tool`, and `Message` traits, assembles the per-turn harness, and enforces the OpenHuman-specific policy (approval, tool scope, budgets, credential scrubbing, compaction) as harness middleware on the way in and out. The chat, channel/CLI, and sub-agent routes all enter through one function, `run_turn_via_tinyagents_shared`, so they cannot drift from each other.## Responsibilities-- Assemble a per-turn harness ([`assemble_turn_harness`] in `mod_part_04.rs`): register the turn's `ChatModel`(s), every shared tool, and the full middleware stack, then drive it via `AgentHarness::invoke`.-- Convert between OpenHuman and crate types: `Provider` → `ChatModel` (`model.rs`), `Tool` → crate `Tool` (`tools.rs`, `convert.rs`), `ChatMessage`/`ConversationMessage` ↔ crate `Message` (via `crate::agent::message_convert`).-- Enforce cross-cutting policy as harness middleware: approval/security gating, tool allow-listing and CLI/RPC-only denial, cost budgets, context compaction/summarization, credential scrubbing, malformed-argument recovery, and the repeated-tool-failure circuit breaker (`middleware*.rs`).+- Assemble a per-turn harness (`assemble_turn_harness` in `mod_part_04.rs`): register the turn's `ChatModel`s, every shared tool, and the full middleware stack, then drive it via `AgentHarness::invoke_stream_in_context` (`mod_part_02.rs`).+- Convert between OpenHuman and crate types: tiered `ChatModel` bundles from `(role, config)` (`mod_part_03.rs`, `model.rs`), `Tool` → crate `Tool` (`tools.rs`, `convert.rs`), and `ChatMessage`/`ConversationMessage` ↔ crate `Message` via `crate::agent::message_convert`.+- Enforce cross-cutting policy as harness middleware: approval/security gating, tool policy and CLI/RPC-only denial, cost budgets, context compaction/summarization, credential scrubbing, malformed-argument recovery, and the repeated-tool-failure circuit breaker (`middleware*.rs`).- Route workloads to model tiers and record the resolved provider/model for audit (`routes.rs`, `resolved_route.rs`).-- Make turns durable and replayable: a JSONL event journal + status store (`journal.rs`) and a read-only RPC surface over it (`replay/`).-- Provide graph-layer helpers for multi-stage sub-agent orchestration (`orchestration.rs`, `delegation.rs`) and expose their structure for debugging (`topology.rs`).-- Host adapters (`host/`) for the crate's ten pluggable host-capability traits — not yet wired into the live turn path (see [Status](#host-adapters) below).+- Make turns durable and replayable: a JSONL event journal plus status store (`journal.rs`), a startup sweep for orphaned runs (`reaper.rs`), and a read-only RPC surface over both (`replay/`).+- Provide graph-layer helpers for multi-stage sub-agent orchestration (`orchestration.rs`, `delegation.rs`) and expose graph structure for debugging (`topology.rs`).+- Host adapters (`host/`) for the crate's ten host-capability traits. Not yet wired into the live turn path; see [Host adapters](#host-adapters) below.## Key files| File / group | Role || --- | --- |-| `mod.rs` + `mod_part_01..05.rs` | Module root (`include!`-assembled). `mod_part_01.rs`: imports and re-exports (`SharedToolAdapter`, `TurnContextMiddleware`, `HandoffConfig`, …). `mod_part_02.rs`: `run_turn_via_tinyagents_shared`, the shared harness-drive entry point every caller uses. `mod_part_03.rs`: `TurnModelSource`/`TurnModels` — the per-turn crate `ChatModel` bundle built by `build_turn_models`. `mod_part_04.rs`: `assemble_turn_harness` — registers models, tools, and middleware in order. `mod_part_05.rs`: `record_unobserved_turn_usage`, the cost-tracker fallback for fire-and-forget turns. |-| `run_turn_via_tinyagents` | Legacy/simple entry point (see `mod_part_01.rs`); production traffic goes through `run_turn_via_tinyagents_shared`. |-| `host/` | OpenHuman's implementations of the crate's ten host-capability traits: `agent_memory`, `budget_gate`, `context_composer`, `definition_registry`, `experience_store`, `learning_sink`, `model_resolver`, `progress_sink`, `security_gate`, `tool_outcome_classifier`. Each file adapts one trait onto the OpenHuman domain that actually implements it. |-| `replay/` | Read-only agent-run replay/status RPC (`mod.rs`, `ops.rs`, `schemas.rs`) — three `agent`-namespace controllers over `journal.rs`. |-| `journal.rs` | Durable per-run event journal (`StoreEventJournal`) and status store (`HarnessStatusStore`) under `{workspace}/tinyagents_store`; runs alongside the live `observability` bridge, best-effort and non-fatal. |-| `reaper.rs` | Startup sweep that marks orphaned (non-terminal) runs `Cancelled` in the durable status store; the only *writer* over the status seam replay reads. |-| `middleware.rs` + `middleware_part_01..07.rs` | The named OpenHuman middleware stack. Parts hold, in rough order: tool-output/context budget middleware, `ToolPolicyMiddleware` (policy/permission enforcement), cost-budget pre-checks, inference/delegation failure-envelope detection, the `FinalCallWrapUpMiddleware` (issue #6014) and `CredentialScrubMiddleware`/`ToolPolicyMiddleware` split-outs (issue #4453, credential scrubbing on every tool result). |-| `model.rs` | OpenHuman wrappers over the crate `ChatModel` trait (streaming, usage translation, route recording). |-| `convert.rs` | Tool-schema conversion (`ToolSpec` → crate `ToolSchema`); durable message conversion lives in `crate::agent::message_convert`. |-| `tools.rs` | `SharedToolAdapter` — wraps `Arc<dyn crate::tools::Tool>` as a crate `Tool` so the harness invokes the exact tools the legacy loop ran. |-| `routes.rs` / `resolved_route.rs` / `topology.rs` | Workload-tier routing middleware, per-turn resolved provider/model bookkeeping, and graph topology export for debug/inspection. |-| `observability.rs` + `observability_part_01/02.rs` | `OpenhumanEventBridge` — translates crate `AgentEvent`s into `AgentProgress` and feeds per-call usage into the cost tracker. |-| `orchestration.rs` | Shared seam onto `tinyagents_graph::orchestration` task primitives for the detached-sub-agent control plane. |-| `delegation.rs` | OpenHuman-facing seam onto `tinyagents_graph::delegation`'s plan→execute⇄review→finalize graph. |-| `payload_summarizer.rs` | `PayloadSummarizer` trait + default sub-agent-backed impl; compresses oversized tool results instead of hard-truncating them. Public since issue #6014 so embedders can supply their own. |-| `policy_denial.rs` | Renders structured, actionable denial messages (what was blocked, why, workaround) for policy/permission-blocked tool calls; records into `crate::tools::registry::denials`. |-| `abort_guard.rs` | RAII `AbortOnDrop` guard tying a detached streaming-producer task's lifetime to its consumer stream, so cancellation actually stops the provider call. |+| `mod.rs` + `mod_part_01..05.rs` | Module root (`include!`-assembled). `mod_part_01.rs`: imports and re-exports (`TurnContextMiddleware`, `HandoffConfig`, `TranscriptSnapshotSink`, `SubagentScope`, `resolved_route::*`), `ToolPolicyEnforcement`, `TinyagentsTurnOutcome`, run-policy and wall-clock helpers, and the `#[cfg(test)]`-only `run_turn_via_tinyagents`. `mod_part_02.rs`: `run_turn_via_tinyagents_shared`, the single entry point every production caller uses. `mod_part_03.rs`: `TurnModels` (primary + tier routes + summarizer) and `TurnModelSource`, whose `build`/`build_summarizer` construct crate-native models from `(role, config)` via `build_turn_models_crate`. `mod_part_04.rs`: `assemble_turn_harness`, which registers models, tools, and middleware in order. `mod_part_05.rs`: `record_unobserved_turn_usage`, the cost-tracker fallback for turns with no `on_progress` observer. |+| `host/` | OpenHuman's implementations of the crate's ten host-capability traits: `agent_memory`, `budget_gate`, `context_composer`, `definition_registry`, `experience_store`, `learning_sink`, `model_resolver`, `progress_sink`, `security_gate`, `tool_outcome_classifier`. Each file adapts one trait onto the OpenHuman domain that implements it. |+| `replay/` | Read-only agent-run replay/status RPC (`mod.rs`, `ops.rs`, `schemas.rs`): three `agent`-namespace controllers over `journal.rs`. |+| `journal.rs` | `TurnJournal` and `FileStatusStore`: a crate `StoreEventJournal` over a JSONL append store plus a `HarnessStatusStore` writer under `{workspace}/tinyagents_store`. Attached alongside the live `observability` bridge as an independent `EventSink` subscriber, wrapped in `RedactingSink`; best-effort and non-fatal. |+| `reaper.rs` | `reap_orphaned_runs`: startup sweep that marks non-terminal runs `Cancelled` in the durable status store. The only writer over the status seam that `replay/` reads. |+| `middleware.rs` + `middleware_part_01..07.rs` | The named OpenHuman middleware stack. `part_01`: `TurnContextMiddleware` (bundles config and installs the enabled hooks), `TranscriptSnapshotMiddleware`, `HandoffConfig`/`HandoffMiddleware` (oversized sub-agent results stashed for `extract_from_result`), `PromptCacheSegmentMiddleware`, `ToolOutputMiddleware` (per-result byte cap and optional payload summarizer). `part_02`: `ApprovalSecurityMiddleware`, `CliRpcOnlyMiddleware`. `part_03`: the `ToolPolicyMiddleware` impl (records blocks into `crate::tools::registry::denials`), `ToolOutcomeCaptureMiddleware`, `EmbedderToolHooksMiddleware`, `ArgRecoveryMiddleware`, `MemoryProtocolMiddleware`. `part_04`: `CostBudgetMiddleware`, `RepeatedToolFailureMiddleware`, `TerminalInferenceFailure`. `part_05`: inference/delegation failure-envelope markers, `RepeatProgressMiddleware`, `ImageAwareMessageTrimMiddleware`. `part_06`: `FinalCallWrapUpMiddleware` and `ArtifactIndexTocMiddleware` (issue #6014). `part_07`: `CredentialScrubMiddleware` (issue #4453) and the `ToolPolicyMiddleware` struct. |+| `model.rs` | Helpers and wrappers over native crate `ChatModel` values: message/response translation, usage merging, stream-delta forwarding, `MaxTokensModel`, `ProfileOverrideModel`, `RouteRecordingModel`. |+| `convert.rs` | `spec_to_schema`: OpenHuman `ToolSpec` → crate `ToolSchema`. Message conversion lives in `crate::agent::message_convert`. |+| `tools.rs` | `SharedToolAdapter` / `ToolAdapter`: wrap `Arc<dyn crate::tools::Tool>` as a crate `Tool`; `EarlyExitHook` for `ask_user_clarification`-style pauses; `execute_openhuman_tool`. |+| `routes.rs` | `WORKLOAD_ROUTE_TIERS` (the tier inventory projected into the model registry), `RequiredCapabilitiesMiddleware`, `FallbackObserverMiddleware`, `UsageCarryMiddleware`, and the per-model fallback policy. |+| `resolved_route.rs` | Task-local slot recording the provider/model that actually served the latest call (`ResolvedProviderRoute`, `with_resolved_provider_route_scope`, `record_resolved_provider_route`). |+| `topology.rs` | `all_graph_topologies`: behaviour-free `GraphTopology` exports of every custom OpenHuman graph for debug/inspection. |+| `observability.rs` + `observability_part_01/02.rs` | `OpenhumanEventBridge`: translates crate `AgentEvent`s into `AgentProgress` and feeds per-call usage into `crate::platform::cost`. Also `CapPauser`, `SubagentScope`, and `GraphTracingSink`. |+| `orchestration.rs` | Re-exports the `tinyagents_graph::orchestration` task primitives and owns the shared `SteeringRegistry` for detached sub-agents. |+| `delegation.rs` | Thin wrappers (`run_delegation`, `run_delegation_durable`, `resume_delegation`, `run_or_resume_delegation`) over `tinyagents_graph::delegation`'s plan → execute ⇄ review → finalize graph, attaching `GraphTracingSink`. |+| `payload_summarizer.rs` | `PayloadSummarizer` trait, `SummarizeOutcome`/`UnavailableReason`, and the default `SubagentPayloadSummarizer` that compresses oversized tool results through the `summarizer` sub-agent instead of hard-truncating them. |+| `policy_denial.rs` | `maybe_enrich_policy_block`: rewrites `[policy-blocked]` tool results into structured what/why/workaround messages that tell the model to relay the denial rather than fabricate output. Called from `ToolOutcomeCaptureMiddleware`. |+| `abort_guard.rs` | `AbortOnDrop`: ties a detached streaming-producer task's lifetime to its consumer stream so a dropped turn aborts the in-flight provider call (issue #4460). || `run_cancellation_context.rs` | Task-local carrier for the current run's `CancellationToken`, for tools that fan out nested graph work. |-| `steering_forwarder.rs` | Forwards OpenHuman's `RunQueue` steer/collect messages into the harness `SteeringHandle`; abort-on-drop so cancellation (drop-based, not just normal return) always deregisters it. |-| `stop_hooks.rs` | `StopHookMiddleware` — runs OpenHuman's `StopHook`s (budget cap, thread-goal budget, iteration ceiling) between model calls, pausing the run via steering on the first `Stop` decision. |-| `summarize.rs` | LLM-backed `Summarizer` + context-window-aware policy driving the crate's `ContextCompressionMiddleware`, replacing lossy front-trim-only truncation. |-| `embeddings.rs` | `ProviderEmbeddingModel` — adapts OpenHuman's `EmbeddingProvider` onto the crate's `EmbeddingModel` trait. |-| `retriever.rs` | Retrieval seam wrapping `Memory::recall`, projecting onto the crate's `ScoredDoc` shape and applying the `path_scope` dedupe rule. |-| `thread_context.rs` | Task-local ambient `thread_id` so the OpenAI-compatible provider can thread it into request bodies without touching every call site. |-| `todos.rs` | Opens the durable crate `Store` backing per-thread task boards (`tinyagents_graph::todos`). |-| `config.rs` | Maps OpenHuman's `Config` (including per-team/per-agent model pins) onto `tinyagents_harness::config` structs. |+| `steering_forwarder.rs` | `SteeringForwarderGuard`: forwards `RunQueue` steer/collect messages into the harness `SteeringHandle`; abort-on-drop so drop-based cancellation always deregisters it (issue #4456). |+| `stop_hooks.rs` | `StopHookMiddleware`: evaluates OpenHuman `StopHook`s after each model call and pauses the run via steering on the first `Stop` decision. |+| `summarize.rs` | `ModelSummarizer` / `FaultTolerantCachingSummarizer` plus a context-window-aware `SummarizationPolicy` driving the crate's `ContextCompressionMiddleware`. |+| `embeddings.rs` | `ProviderEmbeddingModel`: adapts `crate::inference::embeddings::EmbeddingProvider` onto the crate's `EmbeddingModel` trait. |+| `retriever.rs` | `recall_through_facade` / `build_retriever`: wraps `Memory::recall`, projects onto the crate's `ScoredDoc`, applies the `path_scope` dedupe rule, emits `MemoryLoaded`. |+| `thread_context.rs` | Task-local ambient `thread_id` (`with_thread_id`, `current_thread_id`) read by the OpenAI-compatible provider when serialising request bodies. |+| `todos.rs` | `todos_store` / `scratch_todos_store` (the crate `Store` behind per-thread task boards, `tinyagents_graph::todos`) and `migrate_legacy_task_boards`, the one-shot import run at startup. |+| `config.rs` | Maps OpenHuman's `Config` (including model pins) onto `tinyagents_harness::config` structs. || `*_tests.rs` | Sibling test suites for each file/part group above. |## Public surface-Selected `pub`/`pub(crate)` items re-exported or defined at the module root (see `mod.rs` for the full `pub mod` list):+Most of the module is `pub(crate)` or private. The `pub` items, per `mod.rs`:-- **Turn entry points**: `run_turn_via_tinyagents`, `run_turn_via_tinyagents_shared`, `TurnModels`, `TurnModelSource`.-- **Config mapping**: `config::*` (public — the host half of the generic-harness config seam).-- **Payload summarization**: `payload_summarizer::*` — `pub` since issue #6014 so an embedder can supply `AgentBuilder::payload_summarizer` with its own `Arc<dyn PayloadSummarizer>` (the default dispatches a sub-agent, which some embedders cannot do).-- **Route metadata**: `resolved_route::ResolvedProviderRoute` (public — read by the agent bus after a turn to persist the actually-used provider/model).-- **Thread context**: `thread_context::*`.-- **Task boards**: `todos::todos_store`.-- **Host adapters**: `host::*` (`pub mod host`), all ten `OpenHuman*` adapter structs.+- `config::*`: the host half of the generic-harness config seam.+- `payload_summarizer::*`: `pub` since issue #6014 so an embedder can pass its own `Arc<dyn PayloadSummarizer>` to `AgentBuilder::payload_summarizer` (the default dispatches a sub-agent, which some embedders cannot do).+- `resolved_route::*`: read by `agent/bus.rs` after a turn to persist the provider/model actually used.+- `thread_context::*`, `todos::*`, `host::*` (all ten `OpenHuman*` adapter structs), and `TurnModelSource`.-Everything else (`middleware`, `model`, `tools`, `journal`, `observability`, `orchestration`, `replay`, `reaper`, …) is `pub(crate)` or private — internal to the seam.+Within the crate the entry point is `run_turn_via_tinyagents_shared` (`pub(crate)`); `run_turn_via_tinyagents` is `#[cfg(test)]` only.## RPC (`replay/`)-Namespace `agent`, three read-only controllers (workstream 05.x) wired through the standard registry, all over the durable journal/status stores in `journal.rs`:+Namespace `agent`, three read-only controllers registered in `core/all.rs` through `all_agent_replay_registered_controllers`, all over the durable stores in `journal.rs`:| Method | Purpose || --- | --- |@@ -70,32 +66,37 @@ Namespace `agent`, three read-only controllers (workstream 05.x) wired through t| `openhuman.agent_run_status` | Latest `HarnessRunStatus` for a run, or `null` if unknown. || `openhuman.agent_runs_active` | Active runs, optionally filtered by `thread_id` and/or `root_run_id`. |-Responses project the crate's own `AgentObservation` and `HarnessRunStatus` serde shapes directly — no bespoke DTO — since both are already what the durable store persists as JSON. Neither carries prompt text, tool arguments, or provider payloads.+Responses project the crate's own `AgentObservation` and `HarnessRunStatus` serde shapes directly, with no bespoke DTO, since both are already what the store persists as JSON. Neither carries prompt text, tool arguments, or provider payloads.## Dependencies-- The vendored `tinyagents` crate family under `vendor/tinyagents/crates/` (`tinyagents-harness`, `tinyagents-graph`, `tinyagents-registry`, `tinyagents-session`, plus `tinyinference` message/model/tool types) — patched via a git submodule so upstream changes can be tested in-tree before being PR'd. Per AGENTS.md, use this vendored copy; a second path to the same types creates incompatible Rust types.-- `crate::agent::message_convert` — durable `ChatMessage` ↔ crate `Message` conversion.-- `crate::agent::harness::{run_queue, tool_result_artifacts}` and `crate::agent::messages` / `crate::agent::progress` — the OpenHuman-side turn plumbing this seam plugs into.-- `crate::tools` — the `Tool` trait wrapped by `SharedToolAdapter`, and `tools::registry::denials` recording policy blocks.-- `crate::platform::cost` — the global cost tracker fed by `observability.rs` and `mod_part_05.rs`.-- `crate::config` — model-tier constants and the `Config` mapped by `config.rs`.+- The vendored crates under `vendor/tinyagents/`: `tinyagents-harness`, `tinyagents-graph`, `tinyagents-registry`, and (through `vendor/tinyagents/vendor/tinyinference`) `tinyinference` and `tinytools`, all declared as path dependencies in `crates/openhuman-core/Cargo.toml`. Per AGENTS.md, use this vendored copy; a second path to the same crates creates incompatible Rust types.+- `crate::agent::message_convert` for `ChatMessage` ↔ crate `Message` conversion.+- `crate::agent::harness::{run_queue, tool_result_artifacts, subagent_runner}` and `crate::agent::{messages, progress, stop_hooks, cost, hooks}`: the OpenHuman-side turn plumbing this seam plugs into.+- `crate::tools`: the `Tool` trait wrapped by `SharedToolAdapter`, and `tools::registry::denials` for recording policy blocks.+- `crate::platform::cost`: the global cost tracker fed by `observability.rs` and `mod_part_05.rs`.+- `crate::config` and `crate::inference`: tier constants, `Config`, providers, and embedding providers.## Used by-- `crates/openhuman-core/src/agent/harness/session/turn/graph.rs` — the chat-turn route into `run_turn_via_tinyagents_shared`.-- `crates/openhuman-core/src/agent/harness/graph.rs` — the channel/CLI bus turn route.-- `crates/openhuman-core/src/agent/harness/subagent_runner/ops/graph.rs` — the sub-agent spawn route (also uses `tinyagents::summarize` for context-window summarization ahead of front-trim).-- `crates/openhuman-core/src/tools/README.md` — documents `SharedToolAdapter` and `ToolPolicyMiddleware` as the primary tinyagents-side tool consumers.-- `crates/openhuman-core/src/flows/tinyflows/` — flow tool/checkpoint compatibility code references this seam.+- `agent/harness/session/turn/graph.rs`: the chat-turn route into `run_turn_via_tinyagents_shared`.+- `agent/harness/graph.rs`: the channel/CLI bus turn route.+- `agent/harness/subagent_runner/ops/graph.rs`: the sub-agent spawn route. It and the session route both build their context-window summarizer through `TurnModelSource::build_summarizer`.+- `agent/harness/session/builder/setters.rs`, `agent/harness/subagent_runner/ops/{provider,runner}.rs`, `channels/`: construct `TurnModelSource`.+- `agent/bus.rs`: reads `resolved_route` after a turn.+- `core/all.rs` (replay controllers), `core/runtime/builder.rs` (`reaper::reap_orphaned_runs`), `core/runtime/services.rs` (`todos::migrate_legacy_task_boards`).+- `threads/todos/` and `agent/task_board.rs`: `todos::*` stores.+- `memory/tools/{recall,store}.rs` and `memory/auto_recall/`: `host::agent_memory::DEFAULT_AGENT_MEMORY_NAMESPACE`.+- `flows/tinyflows/caps/{llm,prompt}.rs`: the message-conversion re-exports and `model::usage_info_from_response`.+- `tools/README.md` names `SharedToolAdapter` and `ToolPolicyMiddleware` as the primary tinyagents-side tool consumers.-## Host adapters — status+## Host adapters-`host/` implements ten crate host-capability traits (`docs/specs/plan-agents.md` Phase 4), each collapsing what used to be direct calls into ~45 OpenHuman domains down to ten seams. The adapters are implemented and tested, but **`agent/` does not call them yet** — repointing the live call sites is the remaining half of Phase 4 and is gated on other in-flight work (the session still holds `AgentConfig` until Phase 2's reader flip; `builder/factory.rs` is split rather than repointed). Some adapter methods carry `TODO(phase4)` where a domain surface was not yet reachable; these are documented gaps, not silent stubs.+`host/` implements the crate's ten host-capability traits (Phase 4 of the agents plan described in `host/mod.rs`), so that `agent/` can ask ten capabilities instead of reaching into ~45 domains directly. The adapters are implemented and tested, but **no live turn path calls them yet**. The session exposes `host_agent_memory()` and `host_experience_store()` accessors (`agent/harness/session/runtime_impl_01_part_01.rs`) that construct two of the adapters, and only tests call those. Repointing the call sites is the remaining half of Phase 4. Several adapter methods carry `TODO(phase4)` where a domain surface was not yet reachable; they are documented gaps, not silent stubs.## Notes-- The taint/scope/redaction/approval/egress-budget guarantees the crate deliberately does not know about are enforced entirely in `host/` and `middleware*.rs`. Widening a permission or dropping a scope filter to make an adapter signature fit would silently disable a guarantee the rest of the system assumes.-- `journal.rs` and `reaper.rs` are best-effort: journal writes and the startup sweep swallow errors behind a `[journal]` log line rather than failing a turn.-- `defer_turn_completed_to_caller` (a `run_turn_via_tinyagents_shared` parameter) exists because the chat/session path emits its own post-run `TurnCompleted` after streaming a checkpoint; callers without that extra step (channel/CLI) rely on this seam's own emit.-- [gitbooks/developing/architecture/agent-harness.md](../../../../../gitbooks/developing/architecture/agent-harness.md) is the narrative overview of the whole turn lifecycle and where this seam sits in it; as of this writing it still references a `SqlRunLedgerCheckpointer` at `tinyagents/checkpoint.rs`, which no longer exists in this directory — that page needs a follow-up fix.+- The taint/scope/redaction/approval/budget guarantees the crate deliberately does not know about are enforced in `host/` and `middleware*.rs`. Widening a permission or dropping a scope filter to make an adapter signature fit would silently disable a guarantee the rest of the system assumes.+- `journal.rs` is best-effort: store opening and every write swallow errors behind a `[journal]` log line rather than failing a turn. `reaper.rs` logs its sweep under `[agent] startup run sweep`.+- `defer_turn_completed_to_caller` (a `run_turn_via_tinyagents_shared` parameter, issue #4457) exists because the chat/session path emits its own `TurnCompleted` after streaming a post-run checkpoint; callers without that step (channel/CLI) pass `false` and rely on this seam's emit.+- [gitbooks/developing/architecture/agent-harness.md](../../../../../gitbooks/developing/architecture/agent-harness.md) is the narrative overview of the turn lifecycle and where this seam sits in it.diff --git a/crates/openhuman-core/src/skills/catalog/README.md b/crates/openhuman-core/src/skills/catalog/README.mdindex b3954cd66e..4b443460d0 100644--- a/crates/openhuman-core/src/skills/catalog/README.md+++ b/crates/openhuman-core/src/skills/catalog/README.md@@ -1,15 +1,20 @@# skills/catalogModule path: `crate::skills::catalog`. RPC namespace: `skill_registry` — a-stable wire contract left unchanged by the module rename (JSON-RPC method-names and CLI subcommands still read `skill_registry_*`).+stable wire contract left unchanged by the module rename (JSON-RPC methods are+still `openhuman.skill_registry_<function>`, the CLI namespace is still+`skill_registry`; see `tests/skill_registry_e2e.rs`).Owns remote skill catalogs and installed-skill lifecycle:- Fetch and cache registry catalogs.- Refresh the remote catalog asynchronously on core load.- Browse/search registry entries.-- Derive install URLs for Hermes bundled and optional skills.+- Derive `SKILL.md` download URLs: Hermes bundled/optional skills from+ `docsPath`, GitHub-hosted community skills from `sourceUrl` (blob/tree+ rewritten to `raw.githubusercontent.com`); portal-only sources+ (ClawHub/LobeHub/skills.sh) get no URL and `install` returns an actionable+ error instead of a 404.- Install catalog entries into the user skills directory.- Uninstall user-scope skills.- Host the built-in `skill_setup` agent.@@ -19,10 +24,10 @@ Owns remote skill catalogs and installed-skill lifecycle:| File | Purpose || --- | --- || `mod.rs` | Feature gate (`skills` Cargo feature) and module wiring; re-exports the controller aggregators |-| `ops.rs` | Catalog fetch/cache, browse/search/install/uninstall business logic |-| `store.rs` | On-disk catalog cache persistence |-| `tools.rs` | LLM-callable tools: `skill_registry_browse`, `skill_registry_search`, `skill_registry_install`, and friends |-| `types.rs` | Catalog entry and wire types |+| `ops.rs` | Catalog fetch/cache, boot refresh, browse/search/sources/categories, download-URL derivation, `install_from_catalog` |+| `store.rs` | Catalog cache at `~/.openhuman/skill-registry/cache.json`, 1-hour TTL, kept past TTL for stale-while-revalidate; `OPENHUMAN_SKILL_REGISTRY_CACHE_DIR` relocates it (tests) |+| `tools.rs` | LLM-callable tools `skill_registry_browse`, `skill_registry_search`, `skill_registry_sources`, `skill_registry_install`, `skill_registry_uninstall` |+| `types.rs` | `CatalogEntry` || `schemas/controller_schemas.rs` | `skill_registry_*` `ControllerSchema` definitions and the registered-controller table || `schemas/handlers.rs` | Thin RPC handlers dispatching into `ops.rs` || `schemas/wire_types.rs` | Request/response payload types for the handlers |@@ -44,15 +49,20 @@ all under the `skill_registry` namespace:## Agent tools and the `skill_setup` agent-`tools.rs` exposes the browse/search/install/uninstall operations as-LLM-callable tools (`SkillRegistryBrowseTool`, `SkillRegistrySearchTool`, and-so on) so agents can discover and manage skills directly.--`agent/skill_setup/` is a built-in agent specializing in skill discovery and-installation; it is registered in-`crates/openhuman-core/src/agent/registry/agents/loader.rs`, which embeds-`agent/skill_setup/agent.toml` and wires `agent/skill_setup/prompt.rs::build`-as its prompt builder.+`tools.rs` exposes the browse/search/sources/install/uninstall operations as+LLM-callable tools (`SkillRegistryBrowseTool`, `SkillRegistrySearchTool`,+`SkillRegistrySourcesTool`, `SkillRegistryInstallTool`,+`SkillRegistryUninstallTool`), re-exported through the+`#[cfg(feature = "skills")]` glob in `crates/openhuman-core/src/tools/mod.rs`.++`agent/skill_setup/` is a built-in agent (id `skill_setup`, delegate name+`setup_skills`) whose tool belt is the five tools above plus+`list_workflows`, `describe_workflow`, `install_workflow_from_url`,+`uninstall_workflow`, and `ask_user_clarification`. It is registered in+`crates/openhuman-core/src/agent/registry/agents/loader.rs` behind+`#[cfg(feature = "skills")]`, which embeds `agent/skill_setup/agent.toml` via+`include_str!` and wires `agent/skill_setup/prompt.rs::build` as its prompt+builder.## Disabled build@@ -93,6 +103,10 @@ openhuman-core skill_registry uninstall --name git-helperSecurity notes:-- Production installs still go through `skills::ops_install` (the hardened- URL installer shared with the `workflows` domain).+- `install` and `uninstall` do not implement their own file handling:+ `ops::install_from_catalog` calls+ `skills::ops_install::install_workflow_from_url` and the uninstall handler+ calls `skills::ops_install::uninstall_workflow`, so the parent module's+ hardened URL installer (HTTPS-only, size cap, private-IP rejection,+ `SKILL.md` requirement) applies to catalog installs too.- HTTP localhost installs require `OPENHUMAN_SKILL_INSTALL_ALLOW_LOCAL_HTTP=1` and are intended for local fixtures only.