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: update module READMEs to reflect current public API
Steven Enamakeldcecdabe3ee8
diff --git a/crates/openhuman-core/src/agent/README.md b/crates/openhuman-core/src/agent/README.mdindex f578400266..11136f4481 100644--- a/crates/openhuman-core/src/agent/README.md+++ b/crates/openhuman-core/src/agent/README.md@@ -4,14 +4,14 @@ Multi-agent orchestration domain. Owns the LLM tool-calling loop, sub-agent disp## Public surface-- `pub struct OpenHumanSessionHost` / `pub struct SessionHostBuilder` / `pub struct TurnOverrides` (`session_host/types.rs`, re-exported from `agent`): top-level conversation runtime, the entry point for any chat turn. Constructors live in `session_host/builder/factory.rs`; `run_single` / `run_interactive` in `session_host/runtime/run_loop.rs`. The `builder/`, `runtime/`, and `turn/` submodules are private.+- `pub struct OpenHumanSessionHost` / `pub struct SessionHostBuilder` / `pub struct TurnOverrides` (`session_host/types.rs`, re-exported from `agent`): top-level conversation runtime, the entry point for any chat turn. Constructors live in `session_host/builder/factory.rs`; `run_single` in `session_host/runtime/run_loop.rs`. The `builder/`, `runtime/`, and `turn/` submodules are private.- `pub fn run_subagent` / `pub struct SubagentRunOptions` / `pub enum SubagentRunError` (`subagent_host/`): OpenHuman policy adapters around the neutral TinyAgents sub-agent lifecycle.- `pub struct AgentDefinition` / `pub struct AgentDefinitionRegistry` / `pub enum SandboxMode` / `pub enum ToolScope` (`harness/definition/`: `agent_definition.rs`, `registry.rs`, `source.rs`, `tier.rs`, `execution_spec.rs`, `prompt_source.rs`, `subagents.rs`): sub-agent archetypes loaded from built-ins and workspace TOML.- `pub mod harness::fork_context`: task-local parent context for KV-cache reuse.- `tinytools_agent::dialect::ToolDialect` / `tinytools_agent::ParsedToolCall` / `tinytools_agent::dialect::ToolOutcome`: canonical tool-call vocabulary; `message_convert.rs` performs only concrete durable/provider conversions.- `pub mod triage` (`run_triage`, `apply_decision`, `TriggerEnvelope`, `TriageDecision`, `TriageAction`, in `triage/mod.rs`): classifies external triggers and escalates to sub-agents.- `pub mod prompts::SystemPromptBuilder` (`prompts/`): system-prompt section composer.-- `pub struct ChatMessage` / `pub enum ConversationMessage` / `pub struct ToolResultMessage` (`messages.rs`): transcript wire types; `inference/provider/types.rs::ChatRequest` borrows `&[ChatMessage]` from here.+- `pub struct ChatMessage` / `pub enum ConversationMessage` / `pub struct ToolResultMessage` (`messages.rs`): transcript wire types.- `pub fn bus::register_agent_handlers` (`bus.rs`): registers the `agent.run_turn` native request handler (`AgentTurnRequest` -> `AgentTurnResponse`) on `BUS.native()`; called from `channels/runtime/startup/start_channels.rs`.- Built-in archetypes live in `crates/openhuman-core/src/agent/registry/agents/`; this module stays focused on harness/runtime behavior.- RPC `agent.{chat, chat_simple, server_status, list_definitions, get_definition, reload_definitions, triage_evaluate, graph_topologies, registry_snapshot}`: `schemas.rs`.@@ -56,7 +56,7 @@ Flat files: `bus.rs` (`agent.run_turn` native request handler), `context_breakdo- `crates/openhuman-core/src/inference/provider/`: `factory::{provider_for_role, create_chat_model_with_model_id}` build the crate-native `ChatModel`s that `tinyagents::TurnModelSource` runs each turn against; `ChatResponse` / `ToolCall` / `UsageInfo` DTOs cross this boundary. There is no `Provider` trait; the harness names crate model types only.- `crates/openhuman-core/src/tools/`: `Tool` / `ToolSpec` execution surface invoked from the tool loop.-- `crates/openhuman-core/src/memory/`: episodic indexing + memory-loader context injection (`harness/memory_context.rs`).+- `crates/openhuman-core/src/memory/`: episodic indexing.- `crates/openhuman-core/src/inference/local/`: `agent_chat` / `agent_chat_simple` execution backend.- `crates/openhuman-core/src/config/`: runtime config load via `config::rpc::load_config_with_timeout` (`config::rpc` is `pub use ops as rpc`).- `crates/openhuman-core/src/core/bus.rs` (`BUS.publish`/`BUS.subscribe`/`BUS.native()`) and `crates/openhuman-core/src/core/events.rs` (`DomainEvent`): emits `AgentTurnStarted` / `AgentTurnCompleted` / `AgentError`, `AgentOrchestration*`, and `TriggerEvaluated`; subscribers live in `orchestration/{background_delivery,run_ledger_finalize}.rs` and `learning/`, not in `agent/bus.rs`.diff --git a/crates/openhuman-core/src/agent/artifacts/README.md b/crates/openhuman-core/src/agent/artifacts/README.mdindex a95079e892..5d4896a7dc 100644--- a/crates/openhuman-core/src/agent/artifacts/README.md+++ b/crates/openhuman-core/src/agent/artifacts/README.md@@ -118,6 +118,4 @@ event.- `create_artifact` rejects empty titles/extensions and extensionscontaining `/`, `\`, or `.`. Filename stems are lowercased ASCII`[a-z0-9_-]`, capped at 80 chars, fallback `artifact`.-- `store.rs` keeps a dead-code `_assert_status_used` helper so- `ArtifactStatus` is referenced outside tests.- Log prefix is `[artifacts]` (`[tool][artifacts]` in `tools.rs`).diff --git a/crates/openhuman-core/src/agent/context/README.md b/crates/openhuman-core/src/agent/context/README.mdindex 7fb1655c1d..4f64e57016 100644--- a/crates/openhuman-core/src/agent/context/README.md+++ b/crates/openhuman-core/src/agent/context/README.md@@ -17,7 +17,7 @@ Global context management for agent sessions: system-prompt assembly, per-sessio| File | Role || --- | --- || `crates/openhuman-core/src/agent/context/mod.rs` | Module docstring, `pub mod` decls, `pub use` re-exports, and the three shared constants (`DEFAULT_TOOL_RESULT_BUDGET_BYTES`, `CLEARED_PLACEHOLDER`, `DEFAULT_KEEP_RECENT_TOOL_RESULTS`). No other logic. |-| `crates/openhuman-core/src/agent/context/manager.rs` | `ContextManager`: per-session handle agents hold. Owns the default prompt builder, `ContextStatsState`, and the `ContextConfig`-derived knobs. Surfaces `build_system_prompt` / `build_system_prompt_tiered` / `build_system_prompt_with`, `stats()`, the getters the tinyagents turn reads (`tool_result_budget_bytes`, `compaction_enabled`, `microcompact_keep_recent`, `autocompact_enabled`, `prefer_markdown_tool_output`), and the session-memory trigger/mark methods. |+| `crates/openhuman-core/src/agent/context/manager.rs` | `ContextManager`: per-session handle agents hold. Owns the default prompt builder, `ContextStatsState`, and the `ContextConfig`-derived knobs. Surfaces `build_system_prompt` / `build_system_prompt_tiered`, `stats()`, the getters the tinyagents turn reads (`tool_result_budget_bytes`, `compaction_enabled`, `microcompact_keep_recent`, `autocompact_enabled`, `prefer_markdown_tool_output`), and the session-memory trigger/mark methods. || `crates/openhuman-core/src/agent/context/stats.rs` | `ContextStatsState`: last provider usage, context-window utilisation, and the shared `SessionMemoryHandle` (`Arc<Mutex<SessionMemoryState>>`). Pure state; issues no LLM calls and does not mutate history. || `crates/openhuman-core/src/agent/context/session_memory.rs` | `SessionMemoryState` / `SessionMemoryConfig`: threshold-gated `should_extract` decision (token growth, tool calls, and turns must all cross) and extraction bookkeeping. Holds `ARCHIVIST_EXTRACTION_PROMPT`. State-tracking only; does not spawn the archivist. || `crates/openhuman-core/src/agent/context/channels_prompt.rs` | Bespoke free functions `build_system_prompt(...)` / `build_system_prompt_with_identity(...)` (plus `PromptIdentityOverride`, `ProjectContextPlacement`, `render_project_context`) for channel runtimes (Discord/Slack/Telegram/…). Byte-stable for prefix-cache hits; injects workspace bootstrap files (`SOUL.md`, `IDENTITY.md`, optional `PROFILE.md`/`MEMORY.md`, with profile overrides for `SOUL.md`/`MEMORY.md`), tools, safety, skills, runtime, and channel-capabilities sections. |diff --git a/crates/openhuman-core/src/agent/harness/README.md b/crates/openhuman-core/src/agent/harness/README.mdindex 48c6bb2e19..f429a5f8a3 100644--- a/crates/openhuman-core/src/agent/harness/README.md+++ b/crates/openhuman-core/src/agent/harness/README.md@@ -46,7 +46,7 @@ used here (not defined here) by `agent_graph.rs` and `fork_context.rs`.| `archivist/` | `ArchivistHook` (`types.rs`, `PostTurnHook` impl in `hook_impl.rs`): post-turn episodic insert, segment boundary detection and lifecycle, LLM recap with heuristic fallback, lesson extraction from tool failures, and raw-prose ingestion into the memory tree when `config.learning.chat_to_tree_enabled` (`boundary.rs`, `lifecycle.rs`, `recap.rs`, `resummarise.rs`, `store.rs`, `tree_ingest.rs`, `events_heuristic.rs`). || `artifact_offload/` | The `outputs/` / `workspace/` convention under `action_dir`: prompt half (`contract.rs`) and host policy half (`policy.rs`); mechanics (thresholds, path resolution, pointer rendering, the writer) live in `tinyagents_harness::artifacts` and are re-exported here. || `tool_result_artifacts/` | Wiring only: `new_tool_result_store` hands `tinyagents_harness::artifacts::tool_results` OpenHuman's redactor (`SanitizingRedactor`), `file_read`/`use_skill` names and `FileReadTool::MAX_FILE_SIZE_BYTES`. The store, `[tool_result_preview]` envelope, budgets and paged reads live in the crate. |-| `memory_context.rs`, `memory_context_safety.rs` | Working-memory and `[Cross-chat context]` lines surfaced into the prompt (capped by `WORKING_MEMORY_LIMIT`); trust-tier wrapping of recalled entries that came from connectors (`wrap_untrusted_for_agent`). The read-index, dedupe, write, update-index enforcement state machine for memory-mutating tools (issue #4116) now lives in `tinyagents_harness::middleware` (`MemoryProtocolTracker`). |+| `memory_context_safety.rs` | Trust-tier wrapping of recalled entries that came from connectors (`wrap_untrusted_for_agent`). The read-index, dedupe, write, update-index enforcement state machine for memory-mutating tools (issue #4116) now lives in `tinyagents_harness::middleware` (`MemoryProtocolTracker`). || `required_output.rs` | Pure validate/repair/synthesize primitives (issue #4117) that guarantee a required structured-output block (for example a `thoughts` JSON block) on every accepted turn. The orchestration that calls these lives on the session in `../session_host/turn/`. || `parse_wire_tests.rs` | Test-only fixtures for OpenHuman's own wire vocabulary (`inference::provider::ToolCall`, native-history JSON, OpenAI function-calling payloads). The actual `<tool_call>` parsing (tags, fenced blocks, bare JSON, `<invoke>` XML, GLM grammar, p-format) moved to the vendored `tinytools_agent` crate; nothing about recovering a tool call from model text stayed here. || `credentials.rs` | `scrub_credentials`: regex scrubbing of credential-shaped text (key/value secrets, AWS access-key IDs, `sk-...` keys). Applied to every tool result by `CredentialScrubMiddleware` in `agent/tinyagents/middleware/credential_scrub.rs`, installed as the innermost tool wrap so nothing downstream sees the raw secret. |@@ -59,8 +59,7 @@ What `harness/mod.rs` actually re-exports:`ModelSpec`, `PromptSource`, `SandboxMode`, `ToolScope`,`TriggerMemoryAgent`: the sub-agent archetype data model.- `ParentExecutionContext` and its accessors (`current_parent`,- `with_parent_context`, `current_agent_context_prepared_sources`,- `with_agent_context_prepared_sources`, `AgentContextPreparedSource`):+ `with_parent_context`, `AgentContextPreparedSource`):parent runtime context for spawned tools.- `current_sandbox_mode`/`with_current_sandbox_mode`,`current_task_recency_window`/`with_task_recency_window`: the other@@ -89,7 +88,7 @@ turn lifecycle are in `../session_host/`; `run_subagent`,bundles loaded by `definition_loader`/`builtin_definitions`.- `crate::security::SecurityPolicy`: workspace containment policy plumbedinto `artifact_offload::new_artifact_offload`.-- `crate::memory`: context injection (`memory_context*`) and text+- `crate::memory`: trust-tier wrapping (`memory_context_safety`) and textsanitization (`artifact_offload::SanitizingRedactor` wraps `memory::safety::sanitize_text` for both artifact stores).- `crate::config::AgentConfig`, `crate::skills::Workflow`,`crate::tools::{Tool, ToolSpec}`: runtime context carried throughdiff --git a/crates/openhuman-core/src/agent/learning/README.md b/crates/openhuman-core/src/agent/learning/README.mdindex 2310f00a04..c170594406 100644--- a/crates/openhuman-core/src/agent/learning/README.md+++ b/crates/openhuman-core/src/agent/learning/README.md@@ -21,7 +21,7 @@ The subsystem is organised in phases (issue #566): **Phase 1** the candidate tax| `mod.rs` | Export-focused module root; phase docstrings + `pub use` re-exports. || `startup.rs` | Registers the always-on Phase 2/3/4 subscribers (signature producer, rebuild trigger + 30-min loop, `ProfileMdRenderer`) on the global event bus; idempotent, `OnceLock`-guarded (#5003). || `candidate.rs` | Phase 1 taxonomy re-exported from the contract crate (`tinymemory_api::learning::{FacetClass, CueFamily, LearningCandidate}`, `tinymemory_api::host::EvidenceRef`), plus the bounded FIFO `Buffer` with a `global()` singleton (cap 1024). |-| `cache.rs` | `FacetCache`: typed wrapper over `user_profile_facets`; class↔key helpers (`class_from_key`, `key_with_class`, `class_prefix`). Delegates to the `MemoryProfile` family via `crate::memory::guard::MemoryGuard`. |+| `cache.rs` | `FacetCache`: typed wrapper over `user_profile_facets`; class↔key helpers (`class_from_key`, `class_prefix`). Delegates to the `MemoryProfile` family via `crate::memory::guard::MemoryGuard`. || `stability_detector.rs` | Phase 3 `StabilityDetector::rebuild`: the scoring/budget/state-assignment cycle; thresholds, half-lives, budgets, and the `stability()` formula. Publishes `CacheRebuilt`. || `scheduler.rs` | Periodic rebuild loop (`spawn_rebuild_loop`, default 30 min) + event-driven debounced trigger (`register_event_trigger`) subscribing to memory/tree-summarizer events. || `schemas.rs` + `schemas/` | `schemas.rs` holds the controller schema list and `RegisteredController` table; `schemas/profile_handlers.rs` has the `linkedin_enrichment` / `save_profile` / `rebuild_cache` / `cache_stats` handlers, `schemas/cache_helpers.rs` has the `get_cache()` helper, and `schemas/facet_handlers.rs` has the facet handlers (`list_facets`, `get_facet`, `update_facet`, `pin_facet`, `unpin_facet`, `forget_facet`, `reset_cache`) for the `learning.*` namespace. |diff --git a/crates/openhuman-core/src/agent/orchestration/README.md b/crates/openhuman-core/src/agent/orchestration/README.mdindex f97ad43dd1..f21e4fba68 100644--- a/crates/openhuman-core/src/agent/orchestration/README.md+++ b/crates/openhuman-core/src/agent/orchestration/README.md@@ -135,7 +135,7 @@ name:`Deferred` tools on the orchestrator's own belt, found through`tool_search` and called directly (`tools/orchestrator_tools.rs`).-`dispatch.rs` (`dispatch_subagent`, the shared spawn path every tool above+`dispatch.rs` (the shared spawn path every tool abovecalls), `awaiting_user.rs` (the awaiting-user envelope), and`worker_thread.rs` (worker thread creation) are `pub(crate)` helpers, nottools. Live harness registrations use typed `ToolDispatch<(),diff --git a/crates/openhuman-core/src/agent/session_host/README.md b/crates/openhuman-core/src/agent/session_host/README.mdindex f3c3b48483..055a1d9275 100644--- a/crates/openhuman-core/src/agent/session_host/README.md+++ b/crates/openhuman-core/src/agent/session_host/README.md@@ -17,7 +17,7 @@ run after each turn commits.| `builder/` | `SessionHostBuilder` fluent API and the `from_config` factory || `factory.rs` | `OpenHumanSessionFactory` || `runtime_session.rs` | Runtime session composition and the public `turn()` |-| `runtime/` | Public accessors, `run_single`, `run_interactive` |+| `runtime/` | Public accessors, `run_single` || `session_api.rs` | Start, read back, and list the generations of a durable session || `driver.rs` | The OpenHuman `SessionDriver` that runs the model and tools || `hooks.rs` | Product prepare, commit, and terminal hooks |diff --git a/crates/openhuman-core/src/agent/triage/README.md b/crates/openhuman-core/src/agent/triage/README.mdindex f9f2adff78..26eb07d0c0 100644--- a/crates/openhuman-core/src/agent/triage/README.md+++ b/crates/openhuman-core/src/agent/triage/README.md@@ -44,7 +44,7 @@ notification ingest); those build a `TriggerEnvelope` and call in.(`TriggerEvaluated`, `TriggerEscalated`, `TriggerEscalationFailed`) so thefield list lives in one place.-`routing.rs` resolves the arms. `resolve_provider` resolves the+`routing.rs` resolves the arms. `resolve_provider_with_config` resolves the`chat` workload role and forces the managed backend whenever thatrole points at a local runtime, a local CLI delegate, or an incomplete BYOKroute, so the initial attempt never depends on a local model being up.@@ -54,8 +54,7 @@ otherwise the chain skips straight to `Deferred`.Only the local arm takes the `cron::scheduler_gate::wait_for_capacity`permit (held for the duration of that turn); cloud attempts do not wait on-the gate. `run_triage_with_arms` is the same chain with pre-resolved arms;-tests use a `_for_test` variant that skips the permit.+the gate. Tests use a `_for_test` variant that skips the permit.## Not routed through triage@@ -76,10 +75,10 @@ Re-exported from `mod.rs`:`decision.rs`.- `run_triage(&envelope) -> anyhow::Result<TriageOutcome>`, `TriageOutcome`,`TriageRun`, `TriageResolutionPath`: `evaluator*.rs`. Also `pub` on the- module: `run_triage_with_arms`, `TRIGGER_TRIAGE_AGENT_ID`.+ module: `TRIGGER_TRIAGE_AGENT_ID`.- `apply_decision(run, &envelope) -> anyhow::Result<()>`: `escalation.rs`.- `local_trigger_origin()`, `remote_trigger_origin(&envelope)`: `origin.rs`.-- `resolve_provider()`, `build_local_provider_with_config(&config)`,+- `build_local_provider_with_config(&config)`,`ResolvedProvider`: `routing.rs`. Also `pub` on the module:`resolve_provider_with_config`.diff --git a/crates/openhuman-core/src/channels/README.md b/crates/openhuman-core/src/channels/README.mdindex 70a1ea0040..b616571e75 100644--- a/crates/openhuman-core/src/channels/README.md+++ b/crates/openhuman-core/src/channels/README.md@@ -23,7 +23,7 @@ The domain lives behind the `channels` feature (default-ON, #4801), except two d| Path | Purpose || -------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- || `providers/` | Per-provider re-exports from `tinychannels` ([README](providers/README.md)) |-| `host/` | `build_channel_host` / `build_provider_context`, the OpenHuman implementation of `tinychannels::host` that ported providers call back into (adapters in `host/adapters.rs`: `VoiceTranscriber`, `VoiceSynthesizer`, `CoreApprovalGate`, `ConversationHistoryStore`, `OpenHumanEventSink`, `CoreShutdownRegistry`, `ConfigAllowlistStore`); `host/remote_control.rs` (`RemoteControlHost` behind `/status`, `/sessions`, `/new`) and `host/channel_events.rs` (`ChannelApprovalSurfaceSubscriber`, `ChannelTurnStateSubscriber`), which give every capable provider in-chat approvals and remote control |+| `host/` | `build_channel_host`, the OpenHuman implementation of `tinychannels::host` that ported providers call back into (adapters in `host/adapters.rs`: `VoiceTranscriber`, `VoiceSynthesizer`, `CoreApprovalGate`, `ConversationHistoryStore`, `OpenHumanEventSink`, `CoreShutdownRegistry`, `ConfigAllowlistStore`); `host/remote_control.rs` (`RemoteControlHost` behind `/status`, `/sessions`, `/new`) and `host/channel_events.rs` (`ChannelApprovalSurfaceSubscriber`, `ChannelTurnStateSubscriber`), which give every capable provider in-chat approvals and remote control || `runtime/` | Startup, supervision, and the inbound dispatch loop into the agent ([README](runtime/README.md)) || `controllers/` | `channels.*` RPC namespace, `OpenHumanChannelBackend`, provider definitions ([README](controllers/README.md)) || `tests/` | Cross-channel integration test suite (`#[cfg(all(feature = "channels", test))]`) |diff --git a/crates/openhuman-core/src/channels/controllers/README.md b/crates/openhuman-core/src/channels/controllers/README.mdindex c101479358..22a1de9bd2 100644--- a/crates/openhuman-core/src/channels/controllers/README.md+++ b/crates/openhuman-core/src/channels/controllers/README.md@@ -19,7 +19,7 @@ Owns the `channels.*` RPC namespace: provider metadata, connect/disconnect lifec| Path | Purpose || ------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |-| `connect.rs` (+ `connect/`: `catalog.rs`, `connect_channel.rs`, `disconnect.rs`, `email.rs`, `memory.rs`, `shared.rs`, `status.rs`, `test_channel.rs`) | `list_channels`, `describe_channel`, `connect_channel`, `disconnect_channel`, `channel_status`, `test_channel`, `get_default_channel`/`set_default_channel`, email config persistence (`email.rs`; building and verifying email and Yuanbao configs is `tinychannels::controllers::build_email_config`, `tinychannels::providers::verify_email_credentials` and `tinychannels::providers::yuanbao::connect`), `connected_channel_slugs`, `merge_listener_health` (`pub(crate)`, re-exported from `ops/mod.rs` under `#[cfg(test)]`) |+| `connect.rs` (+ `connect/`: `connect_channel.rs`, `disconnect.rs`, `email.rs`, `memory.rs`, `shared.rs`, `status.rs`, `test_channel.rs`) | `connect_channel`, `disconnect_channel`, `channel_status`, `test_channel`, `get_default_channel`/`set_default_channel`, email config persistence (`email.rs`; building and verifying email and Yuanbao configs is `tinychannels::controllers::build_email_config`, `tinychannels::providers::verify_email_credentials` and `tinychannels::providers::yuanbao::connect`), `connected_channel_slugs`, `merge_listener_health` (`pub(crate)`, re-exported from `ops/mod.rs` under `#[cfg(test)]`) || `discord.rs` | Discord OAuth link flow and guild/channel/permission listing || `messaging.rs` | `channel_send_message`, `channel_send_reaction`, `channel_create_thread`, `channel_update_thread`, `channel_list_threads` — all call the TinyHumans backend REST API (`crate::backend::BackendClient`); the only path that reaches the relay transport registry (`tinychannels::relay::runtime`) is `OpenHumanChannelBackend::send_outbound_intent` in `backend.rs` || `types.rs` | Re-exports of `tinychannels::controllers` result/snapshot types used by the ops layer |diff --git a/crates/openhuman-core/src/channels/providers/README.md b/crates/openhuman-core/src/channels/providers/README.mdindex 335dc1a09f..f959fcfca2 100644--- a/crates/openhuman-core/src/channels/providers/README.md+++ b/crates/openhuman-core/src/channels/providers/README.md@@ -33,7 +33,7 @@ What a provider can do beyond send/receive is declared once, upstream, in `tinyc- `host/channel_events.rs::ChannelTurnStateSubscriber` records busy state for `/status`.- `bus/`'s progressive reply shows draft, thinking and filler bubbles only where `progressive_edits` is set.-Ported providers reach host capabilities (voice, approvals, conversation history, shutdown, event sink) through the `tinychannels::host::ProviderContext` built by `channels::host::build_provider_context` instead of calling OpenHuman internals directly; see `channels/host/mod.rs`.+Ported providers reach host capabilities (voice, approvals, conversation history, shutdown, event sink) through the `tinychannels::host::ProviderContext` built in `channels::host` instead of calling OpenHuman internals directly; see `channels/host/mod.rs`.## Adding a providerdiff --git a/crates/openhuman-core/src/core/README.md b/crates/openhuman-core/src/core/README.mdindex 7fc771b03f..8fd0ab0432 100644--- a/crates/openhuman-core/src/core/README.md+++ b/crates/openhuman-core/src/core/README.md@@ -34,7 +34,7 @@ logic. Every controller it exposes is implemented by a domain module under| `mod.rs` | `ControllerSchema`/`FieldSchema`/`TypeSchema`: the controller contract; module declarations. || `all.rs` | The controller registry: `RegisteredController`, `RegisteredCliAdapter`, `DomainGroup`, `all_registered_controllers()`, `all_controller_schemas()`, `rpc_method_name()`, `validate_params()`, `all_http_method_schemas()`. || `dispatch.rs` | `dispatch()`: the 4-tier RPC router. |-| `bus.rs` | The `BUS: OnceBus<DomainEvent>` singleton, `EVENTS_ROOT`/`EVENTS_INTERFACE`/`EVENTS_VERSION`, `init`/`init_over_socket`. |+| `bus.rs` | The `BUS: OnceBus<DomainEvent>` singleton, `EVENTS_ROOT`/`EVENTS_INTERFACE`/`EVENTS_VERSION`, `init`. || `events.rs` | `DomainEvent`: the full event catalog, `domain()` routing. || `outcome.rs` | `Outcome<T>`, `apply_log_envelope`, `unwrap_rpc`: the controller result and its wire shape. || `structured_error.rs` | `StructuredRpcError`: typed error envelope sentinel-encoded into a controller's `Err(String)`. |diff --git a/crates/openhuman-core/src/cron/scheduler_gate/README.md b/crates/openhuman-core/src/cron/scheduler_gate/README.mdindex 717d07d9f9..60e0693084 100644--- a/crates/openhuman-core/src/cron/scheduler_gate/README.md+++ b/crates/openhuman-core/src/cron/scheduler_gate/README.md@@ -16,7 +16,7 @@ Gates background AI work (memory-tree digests, embeddings, summarisation, triage| File | Role || --- | --- || `crates/openhuman-core/src/cron/scheduler_gate/mod.rs` | Module docstring + re-exports of the public surface. |-| `crates/openhuman-core/src/cron/scheduler_gate/gate.rs` | The host's wiring of `tinymemory-gate`: the process-wide `SharedCore`, the signed-out override, the resume `Notify`, the single-slot LLM semaphore, `init_global(SchedulerGateConfig)`/`update_config`/`current_policy`/`current_signals`/`wait_for_capacity`, and the per-tokio-runtime test-state scaffolding. |+| `crates/openhuman-core/src/cron/scheduler_gate/gate.rs` | The host's wiring of `tinymemory-gate`: the process-wide `SharedCore`, the signed-out override, the resume `Notify`, the single-slot LLM semaphore, `init_global(SchedulerGateConfig)`/`update_config`/`current_policy`/`wait_for_capacity`, and the per-tokio-runtime test-state scaffolding. || `tinymemory-gate` (vendored) | The machinery: `GateCore` (config + signals + policy), the 30s `spawn_sampler` task, `wait_for_capacity` over a host-owned semaphore, the `LlmPermit` RAII guard, and `signals::sample(&SignalEnv)` which probes battery (via `starship_battery`, its `battery` feature), CPU usage (via `sysinfo`, two-refresh delta), and detects server/container mode. || `tinymemory-api` (`host::scheduler_gate_decide`, vendored) | Pure decision logic: `decide(signals, cfg) -> Policy`, the `Signals` snapshot, with `Policy` / `PauseReason` beside `SchedulerGateConfig` in `host::scheduler_gate`. Evaluation order: user mode override → server mode → power-aware stand-down → hard CPU ceiling → battery/CPU headroom. || `SIGNAL_ENV` in `gate.rs` | The env-override names the host hands `tinymemory-gate`: `OPENHUMAN_ON_AC_POWER`, `OPENHUMAN_BATTERY_CHARGE`, `OPENHUMAN_DEPLOYMENT` (plus the crate's Kubernetes / `/.dockerenv` heuristics). |@@ -25,7 +25,7 @@ Gates background AI work (memory-tree digests, embeddings, summarisation, triageFrom `mod.rs`:-- Functions (`gate`): `init_global(SchedulerGateConfig)`, `current_policy() -> Policy`, `current_signals() -> Signals`, `wait_for_capacity() -> Option<LlmPermit>`, `is_signed_out() -> bool`, `set_signed_out(bool)`.+- Functions (`gate`): `init_global(SchedulerGateConfig)`, `current_policy() -> Policy`, `wait_for_capacity() -> Option<LlmPermit>`, `is_signed_out() -> bool`, `set_signed_out(bool)`.- Types: `LlmPermit` (RAII semaphore guard, `#[must_use]`), `Policy` (`Aggressive` / `Normal` / `Throttled` / `Paused { reason }`), `PauseReason` (`UserDisabled` / `OnBattery` / `CpuPressure` / `SignedOut` / `Unknown`), `Signals`.- Not re-exported but `pub` on `gate`: `update_config(SchedulerGateConfig)`.- Test-only: `SignedOutTestGuard` (RAII flag snapshot/restore), `try_acquire_llm_permit`, `available_llm_permits`.diff --git a/crates/openhuman-core/src/inference/README.md b/crates/openhuman-core/src/inference/README.mdindex 8111b651e5..778b1938de 100644--- a/crates/openhuman-core/src/inference/README.md+++ b/crates/openhuman-core/src/inference/README.md@@ -38,7 +38,7 @@ compatibility aliases in `crates/openhuman-core/src/core/legacy_aliases.rs`.| `config/ops/local_ai_presets.rs` | OpenHuman `LocalAiConfig` mapping for `tinyinference_local::presets`; reusable tiers, recommendations, and preset data live upstream. || `paths.rs` | Host-owned on-disk model artifact paths. Completion and sentiment parsing live in `tinyinference`. || `local/` | Local runtime manager (was `local_ai/`). See `local/README.md`. |-| `local/core.rs` | `LocalAiService` singleton (`global`/`try_global`), `model_artifact_path`. |+| `local/core.rs` | `LocalAiService` singleton (`global`/`try_global`). || `local/ops.rs` + `local/ops/` (`runtime_ops.rs`, `chat.rs`, `agent_chat.rs`, `turn_guards.rs`) | Local RPC entrypoints (`local_ai_status/prompt/summarize/vision_prompt/embed`); re-exported as `local::rpc`. || `local/schemas.rs` | Local-runtime `inference.*` controller schemas + handlers. || `tinyinference_local` | Ollama/LM Studio wire types, URL handling, model requirements, runtime profiles, provider selection, process flags, spawn-marker persistence, Ollama installation, and Piper binary/voice installation. |@@ -73,7 +73,7 @@ From `mod.rs` re-exports:- `local::all_local_inference_controller_schemas` / `local::all_local_inference_registered_controllers` (legacy export names; registered schemas are in the `inference` namespace)- `rpc` (alias for `ops`) and `all_inference_controller_schemas` / `all_inference_registered_controllers`-Provider-layer (via `provider::`): `ChatRequest`, `ChatResponse`, `ProviderDelta`, `ToolCall`, `UsageInfo`, `create_chat_model*`, `provider_for_role`, `BYOK_INCOMPLETE_SENTINEL`, `OpenHumanBackendModel`, plus error classifiers. Local runtime: `local::{global, try_global}` → `Arc<LocalAiService>`.+Provider-layer (via `provider::`): `ChatResponse`, `ProviderDelta`, `ToolCall`, `UsageInfo`, `create_chat_model*`, `provider_for_role`, `BYOK_INCOMPLETE_SENTINEL`, `OpenHumanBackendModel`, plus error classifiers. Local runtime: `local::{global, try_global}` → `Arc<LocalAiService>`.## RPC / controllers@@ -95,7 +95,7 @@ Also exposes a non-RPC HTTP router (`http::router()`) nested at `/v1` by `crates- `openai_oauth/store.rs` persists OAuth tokens via the credentials auth-profile store (`AuthProfilesStore`, `auth-profiles.json`, encrypted at rest) under profile key `provider:openai` / profile `oauth`.- `LocalAiService` holds in-process runtime state (status, owned `ollama serve` child) via the `local::global` `OnceCell` singleton, process-lifetime, not durably persisted.-- Model artifacts live under `<root>/models/local-ai/` (`local/core.rs::model_artifact_path`); OpenHuman selects the Piper root and passes it to `tinyinference_local::piper::PiperInstall`.+- Model artifacts live under `<root>/models/local-ai/`; OpenHuman selects the Piper root and passes it to `tinyinference_local::piper::PiperInstall`.- Routing/provider/local settings persisted through `config` (no dedicated `store.rs`).## Dependenciesdiff --git a/crates/openhuman-core/src/inference/provider/README.md b/crates/openhuman-core/src/inference/provider/README.mdindex 7c5ed157e5..9e7a28a3e9 100644--- a/crates/openhuman-core/src/inference/provider/README.md+++ b/crates/openhuman-core/src/inference/provider/README.md@@ -25,7 +25,7 @@ previously `providers/` (pre-consolidation single-crate layout); see- **Models**: `OpenHumanBackendModel` + `PROVIDER_LABEL`(`openhuman_backend_model.rs`); OpenAI-compatible and Anthropic builders livein `tinyinference_llm::providers` and are called directly.-- **DTOs** (`types.rs`): `ChatRequest`, `ChatResponse`, `ProviderDelta`,+- **DTOs** (`types.rs`): `ChatResponse`, `ProviderDelta`,`ToolCall`, `UsageInfo`, `AGENT_TURN_MAX_OUTPUT_TOKENS`.- **Error classifiers**: reusable classifiers live in`tinyinference_llm::classification`; this directory retains OpenHuman managed-backend and telemetry policy.@@ -87,7 +87,7 @@ consumers: the agent harness (`agent/session_host/builder/factory.rs`,- `ops/`: `http_error` (HTTP errorclassification, Sentry routing, `api_error`), `models`(`list_configured_models`), `provider_factory` (`ProviderRuntimeOptions`,- `list_providers`, `is_qwen_alias`-style China-provider alias helpers).+ `list_providers`).Preserves the original `pub use ops::*` contract split out of a single `ops.rs`.- Claude Code CLI provider: `tinyagents_harness::providers::claude_code` in `vendor/tinyagents`; see the [Claude Code provider guide](../../../../../gitbooks/developing/providers/claude-code.md).- `schemas.rs`: a `providers.list_models` controller that is **not**diff --git a/crates/openhuman-core/src/mcp/registry/README.md b/crates/openhuman-core/src/mcp/registry/README.mdindex fdb69fc0c1..4aff25b37d 100644--- a/crates/openhuman-core/src/mcp/registry/README.md+++ b/crates/openhuman-core/src/mcp/registry/README.md@@ -44,14 +44,11 @@ keep working. The Rust module path is `crate::mcp::registry`.- `connections`: a thin view over the live connection map the `mcp::host`service holds: `connected_overview[_for_config]`,`all_connected_tools[_for_config]`, `tools_for`/`server_tools_for_config`,- `is_connected[_for_config]`, `auth_hint_for[_config]`, `connect`,- `disconnect[_for_config]`, `last_error_for[_config]`. Every lookup answers+ `is_connected_for_config`, `auth_hint_for_config`, `connect`,+ `disconnect_for_config`, `last_error_for_config`. Every lookup answers"nothing" (empty list / `false` / `None`) when the workspace has no openhost yet, rather than erroring; only `connect` returns an error in thatcase.-- `store`: the one direct reach into the registry's store that outlived the- extraction: `set_cached`, used by an end-to-end test to seed the upstream- response cache without a real catalog call.- `boot`: `spawn_installed_servers`, connecting every enabled installedserver at startup; never fails (a broken third-party server is logged andskipped).diff --git a/crates/openhuman-core/src/platform/cost/README.md b/crates/openhuman-core/src/platform/cost/README.mdindex f3e48b256f..763804a90f 100644--- a/crates/openhuman-core/src/platform/cost/README.md+++ b/crates/openhuman-core/src/platform/cost/README.md@@ -17,7 +17,7 @@ Local API-usage cost tracking for the agent. Records per-call token usage and co| File | Role || ------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- || `crates/openhuman-core/src/platform/cost/mod.rs` | Export-focused module root; re-exports tracker, types, global helpers, and the `all_cost_*` controller schema/registry pair. |-| `crates/openhuman-core/src/platform/cost/types.rs` | Serde domain types: `TokenUsage`, `CostSource`, `CostRecord`, `UsagePeriod`, `CostSummary`, `ModelStats`, `DailyCostEntry`, `BudgetStatus`, `CostDashboard`. Cost-calc logic lives in `TokenUsage::new`. |+| `crates/openhuman-core/src/platform/cost/types.rs` | Serde domain types: `TokenUsage`, `CostSource`, `CostRecord`, `CostSummary`, `ModelStats`, `DailyCostEntry`, `BudgetStatus`, `CostDashboard`. Cost-calc logic lives in `TokenUsage::new`. || `crates/openhuman-core/src/platform/cost/tracker.rs` | `CostTracker` (recording, summaries, daily history, dashboard build) plus the private `CostStorage` JSONL persistence + aggregate-cache layer. Functions as both `ops` and `store`. || `crates/openhuman-core/src/platform/cost/global.rs` | Process-global `OnceCell<Arc<CostTracker>>` singleton: `init_global`, `try_global`, `record_provider_usage`, and `build_token_usage` (provider `UsageInfo` → `TokenUsage`). || `crates/openhuman-core/src/platform/cost/rpc.rs` | RPC-facing handlers (`dashboard`, `daily_history`, `summary`) returning `Outcome<Value>`; DTO types; `resolve_tracker` with a cached fallback tracker + error-replay TTL. |@@ -34,7 +34,7 @@ From `mod.rs` re-exports:- `CostTracker`: the tracker (`tracker`).- `init_global`, `rebind_global`, `try_global`, `record_provider_usage` (`global`).- `all_cost_controller_schemas`, `all_cost_registered_controllers` (`schemas`).-- Types: `BudgetStatus`, `CostDashboard`, `CostRecord`, `CostSource`, `CostSummary`, `DailyCostEntry`, `ModelStats`, `TokenUsage`, `UsagePeriod`.+- Types: `BudgetStatus`, `CostDashboard`, `CostRecord`, `CostSource`, `CostSummary`, `DailyCostEntry`, `ModelStats`, `TokenUsage`.Notable `CostTracker` methods: `new`, `session_id`, `record_usage`, `record_usage_unconditional`, `get_summary`, `get_daily_cost`, `get_monthly_cost`, `get_daily_history`, `get_dashboard`.diff --git a/crates/openhuman-core/src/runtime/pool/README.md b/crates/openhuman-core/src/runtime/pool/README.mdindex fdfcc55a61..0d067a9932 100644--- a/crates/openhuman-core/src/runtime/pool/README.md+++ b/crates/openhuman-core/src/runtime/pool/README.md@@ -38,7 +38,7 @@ and post-dispatch, move a failure out of the default.| File | Role || --- | --- |-| `mod.rs` | `PoolRunError`, the shared `run_inline` dispatch, `classify`, and `all_stats`. |+| `mod.rs` | `PoolRunError`, the shared `run_inline` dispatch, and `classify`. || `node.rs` / `python.rs` | Per-language `enabled()` and `run_inline()`; they differ only in which language they name. || `types.rs` | `PoolExecOutcome` (with `queue_wait` kept apart from `elapsed`), `PoolLang`, `PoolSettings`. |@@ -69,8 +69,6 @@ state across jobs). Set `enabled` explicitly per language to override.- **`queue_wait` is reported separately from `elapsed` on purpose.** A host thatcannot tell a slow job from a busy pool will tune the wrong knob.-- **`all_stats` returns empty rather than failing** when the module is not- loaded. A status surface wants to render "nothing running", not an error.- **A worker is still a child of this process.** A TinyBus module is a `cdylib`loaded in-process, so the resident cost and the process-tree shape the`library-profile skill-run` gate asserts on are unchanged by the move.diff --git a/crates/openhuman-core/src/security/devices/README.md b/crates/openhuman-core/src/security/devices/README.mdindex 829c246f4d..d8f0446d8d 100644--- a/crates/openhuman-core/src/security/devices/README.md+++ b/crates/openhuman-core/src/security/devices/README.md@@ -81,7 +81,7 @@ SQLite DB at `{workspace_dir}/devices/devices.db`, table `paired_devices`:DDL is created idempotently on every connection open (`with_connection`). `peer_online` is **not** persisted; it lives only in the in-memory `PEER_STATUS` map.-Separately, encrypted X25519 private keys are persisted as `enc2:` strings (via `keyring::SecretStore`, ChaCha20-Poly1305) keyed by `channel_id` in the in-memory `PERSISTED_KEYPAIRS` map, allowing keypair reconstruction (`load_keypair_from_store`) for reconnect handshakes.+Separately, encrypted X25519 private keys are persisted as `enc2:` strings (via `keyring::SecretStore`, ChaCha20-Poly1305) keyed by `channel_id` in the in-memory `PERSISTED_KEYPAIRS` map, allowing keypair reconstruction for reconnect handshakes.## Dependenciesdiff --git a/crates/openhuman-core/src/security/keyring/README.md b/crates/openhuman-core/src/security/keyring/README.mdindex d484734184..45f73eae5b 100644--- a/crates/openhuman-core/src/security/keyring/README.md+++ b/crates/openhuman-core/src/security/keyring/README.md@@ -20,7 +20,7 @@ OS-keychain-backed secret storage with pluggable test and debug backends, plus a| `crates/openhuman-core/src/security/keyring/ops.rs` | Core operations: `get`/`set`/`delete`/`is_available`/`get_or_create_random`/`migrate_from_file`, the `MigrationOutcome` enum, the `namespaced_key` helper, the cached availability probe, and `force_backend_for_test`. || `crates/openhuman-core/src/security/keyring/store.rs` | Backend selection and global state. Owns the `WORKSPACE_DIR` and `BACKEND` `OnceLock`s, `init_workspace`, `backend()`, `build_backend()`/`build_backend_at()`, and `workspace_dir_for_file_backend()` path derivation. Also the `cfg(test)`-only `test_scope` module (thread-scoped test workspaces). || `crates/openhuman-core/src/security/keyring/backend.rs` | `KeyringBackend` trait plus `OsBackend` (native keychain via the `keyring` crate, service name `"openhuman"`), `FileBackend` (plaintext `dev-keychain.json`, test/debug only), and test-only `MockBackend`. |-| `crates/openhuman-core/src/security/keyring/encrypted_file_backend.rs` | `EncryptedFileBackend`: all secrets in one ChaCha20-Poly1305 `secrets.enc` file keyed by an app master key; `init_master_key`/`is_master_key_available`; legacy `dev-keychain.json` migration; corrupt-file quarantine. |+| `crates/openhuman-core/src/security/keyring/encrypted_file_backend.rs` | `EncryptedFileBackend`: all secrets in one ChaCha20-Poly1305 `secrets.enc` file keyed by an app master key; `init_master_key`; legacy `dev-keychain.json` migration; corrupt-file quarantine. || `crates/openhuman-core/src/security/keyring/encrypted_store.rs` | `SecretStore`: config-field encryption (`enc2:` ChaCha20-Poly1305, legacy `enc:` XOR migration), keychain-backed master key with legacy `.secret_key` file migration, process-wide key cache, Windows ACL repair (`icacls`). || `crates/openhuman-core/src/security/keyring/file_store.rs` | Shared secrets-file primitives for both file backends: the cross-process advisory write lock (`lock_for_write`, on a sidecar `<path>.lock`), the `0600` unique-temp-then-rename `write_atomic`, and `quarantine_corrupt`. || `crates/openhuman-core/src/security/keyring/crypto.rs` | Shared ChaCha20-Poly1305 helpers (`chacha20_encrypt`/`chacha20_decrypt`), random-byte generation, hex encode/decode. Used by both `encrypted_store` and `encrypted_file_backend`. |@@ -34,7 +34,7 @@ OS-keychain-backed secret storage with pluggable test and debug backends, plus aRe-exported from `mod.rs`:- `KeyringBackend`: backend trait (`get`/`set`/`delete`/`name`).-- `SecretStore`: config-field encrypt/decrypt; `encrypt`/`decrypt`/`decrypt_and_migrate`/`needs_migration`/`is_encrypted`/`is_secure_encrypted`/`new`.+- `SecretStore`: config-field encrypt/decrypt; `encrypt`/`decrypt`/`decrypt_and_migrate`/`needs_migration`/`is_encrypted`/`new`.- `KeyringError`: error enum with `diagnostic()`.- `init_master_key`: load the app master key from the OS keychain at startup (staging/prod only).- `init_workspace`: register the workspace dir for file and encrypted-file backends.diff --git a/crates/openhuman-core/src/skills/README.md b/crates/openhuman-core/src/skills/README.mdindex efbf2ad2b1..e997f00ba9 100644--- a/crates/openhuman-core/src/skills/README.md+++ b/crates/openhuman-core/src/skills/README.md@@ -72,7 +72,7 @@ Plus the sub-domain namespaces: `skill_registry.*` (`browse`, `search`, `sources- `tinytools`: supplies the shared `ToolResult`/`ToolContent` shape directly.- `crates/openhuman-core/src/agent/harness/fork_context.rs`: fork context propagates injected skills.-- `crates/openhuman-core/src/agent/session_host/turn/context.rs` and `.../turn/tools.rs`: the per-turn `workflows` list handed to `PromptContext`; `refresh_workflows` reloads it from the workspace when a `WorkflowsChanged` event is drained.+- `crates/openhuman-core/src/agent/session_host/turn/context.rs` and `.../turn/tools.rs`: the per-turn `workflows` list handed to `PromptContext`.- `crates/openhuman-core/src/agent/tools/run_workflow.rs`: the separate `run_workflow`/`AwaitWorkflowTool` launch path.- `crates/openhuman-core/src/core/all.rs`: controller registry wiring for `skills`, `skill_registry`, and `skill_runtime`.@@ -82,7 +82,6 @@ Behavior tests live beside their modules as `*_tests.rs` (for example `ops_tests`e2e_plumbing_tests.rs` and `e2e_run_tests.rs` are mock-LLM end-to-end tests: plumbing (create then registry round-trip, an orchestrator turn calling `list_workflows`/`run_workflow`, `await_run_outcome` polling) and run execution (`spawn_workflow_run_background` through a terminal `DONE` to `await_run_outcome`, marked `#[ignore]` and run serially because they set the process-global `OPENHUMAN_WORKSPACE`).-Catalog refresh in a live session (`refresh_workflows`) is covered by `crates/openhuman-core/src/agent/session_host/session_builder_and_listener_tests.rs`.## Notesdiff --git a/crates/openhuman-core/src/skills/webhooks/README.md b/crates/openhuman-core/src/skills/webhooks/README.mdindex 014fed0f40..068a0ed899 100644--- a/crates/openhuman-core/src/skills/webhooks/README.md+++ b/crates/openhuman-core/src/skills/webhooks/README.md@@ -33,7 +33,7 @@ Re-exported from `mod.rs`:- `all_webhooks_controller_schemas`, `all_webhooks_registered_controllers` (from `schemas`).- Types: `TunnelRegistration`, `WebhookActivityEntry`, `WebhookDebugEvent`, `WebhookDebugLogEntry`, `WebhookDebugLogListResult`, `WebhookDebugLogsClearedResult`, `WebhookDebugRegistrationsResult`, `WebhookRequest`, `WebhookResponseData`.-Key `WebhookRouter` methods: `new(persist_path)`, `register` / `register_echo` / `register_agent`, `unregister`, `unregister_skill`, `route`, `registration`, `list_for_skill`, `list_all`, `record_request` / `record_parse_error` / `record_response`, `list_logs`, `clear_logs`, `subscribe_debug_events`. `ops::build_echo_response` is also public for the bus.+Key `WebhookRouter` methods: `new(persist_path)`, `register` / `register_echo` / `register_agent`, `unregister`, `unregister_skill`, `route`, `registration`, `list_all`, `record_request` / `record_parse_error` / `record_response`, `list_logs`, `clear_logs`, `subscribe_debug_events`. `ops::build_echo_response` is also public for the bus.## RPC / controllersdiff --git a/crates/openhuman-core/src/test_support/README.md b/crates/openhuman-core/src/test_support/README.mdindex d6a9ae75b3..b43dcebbec 100644--- a/crates/openhuman-core/src/test_support/README.md+++ b/crates/openhuman-core/src/test_support/README.md@@ -28,7 +28,7 @@ From `mod.rs`:- `all_test_support_registered_controllers()`: `Vec<RegisteredController>` (schema + handler pairs).From `rpc` / `introspect` (used by handlers, also `pub`):-- `rpc::reset() -> Outcome<ResetSummary>`, `rpc::reset_json()` (raw JSON envelope convenience; currently `#[allow(dead_code)]`, no caller).+- `rpc::reset() -> Outcome<ResetSummary>`.- `introspect::workspace_root()`, `list_workspace_files(rel_root, max_depth)`, `read_workspace_file(rel_path, max_bytes)`, `in_flight_chats()`, `wallet_prepared_quotes()`.- Result types: `ResetSummary`, `WorkspaceRoot`, `ListEntry`/`ListResult`, `ReadFileResult`, `InFlightEntryView`/`InFlightResult`, `PreparedQuotesResult`.diff --git a/crates/openhuman-core/src/tools/README.md b/crates/openhuman-core/src/tools/README.mdindex d7ba04b03e..c8989c7c7a 100644--- a/crates/openhuman-core/src/tools/README.md+++ b/crates/openhuman-core/src/tools/README.md@@ -14,7 +14,7 @@ The agent tool layer. Defines the core [`Tool`] trait every agent-callable capab- Filter the registry by user tool-toggle preferences (`user_filter`).- Own tool-call lifecycle state and failure classification (`status`), on-demand schema disclosure (`toolpacks`), the process-wide tool execution timeout (`timeout`), the read-only cross-surface discovery registry (`registry`), and per-session tool-boundary policy (`agent_policy`): each documented in its own sibling README.- Expose a JSON-RPC `tools` controller allowlist (`openhuman.tools_*` on the wire) for Tauri-driven flows (onboarding-style orchestration in the renderer).-- Browser-allowlist derivation: narrow the browser host list from the unified fetch allowlist (`browser_allowed_domains`, strips `"*"`).+- Browser-allowlist derivation: narrow the browser host list from the unified fetch allowlist (strips `"*"`).## Key files@@ -22,7 +22,7 @@ The agent tool layer. Defines the core [`Tool`] trait every agent-callable capab| --- | --- || `crates/openhuman-core/src/tools/mod.rs` | Export hub. Declares submodules, re-exports the built-in impls and every domain-owned tool set, and the `all_tools_*` controller pair. || `crates/openhuman-core/src/tools/host_extensions.rs` | OpenHuman-only readers over erased `host_extension` slots: `pack_registry_handle`, `delegation_target`, and `generated_runtime_context`. Import the shared `Tool` vocabulary from `tinytools` directly. |-| `crates/openhuman-core/src/tools/ops.rs` | Registry assembly: `default_tools`, `default_tools_with_runtime`, `all_tools`, `all_tools_with_runtime`, `browser_allowed_domains`. All config-gating logic lives here. |+| `crates/openhuman-core/src/tools/ops.rs` | Registry assembly: `default_tools`, `default_tools_with_runtime`, `all_tools`, `all_tools_with_runtime`. All config-gating logic lives here. || `crates/openhuman-core/src/tools/schemas.rs` (thin shell over the `schemas/` submodule: `apify.rs`, `composio.rs`, `registry.rs`, `web_search.rs`) | JSON-RPC `tools` namespace controllers + `handle_*` fns. `all_controller_schemas` / `all_registered_controllers` (re-exported as `all_tools_*`). || `crates/openhuman-core/src/tools/orchestrator_tools.rs` | Synthesizes named per-subagent tools from the orchestrator's `subagents = [...]` definition; expands the skills wildcard into one `Deferred` `ComposioActionTool` per connected action (reached through `tool_search`, no delegate). || [`crates/openhuman-core/src/mcp/registry/action_tool.rs`](../mcp/registry/action_tool.rs) | Registers connected MCP server actions as deferred tools for the orchestrator. Their searchable schemas use the same `tool_search` catalogue and JEV ranker as other deferred tools. |@@ -121,7 +121,7 @@ None. No `store.rs`; the module holds no persisted state. Tools that persist (me- Ownership rule: only genuinely cross-cutting tool families (filesystem, browser, generic system/network, meta, and the `documents`-gated document/presentation tools) belong in `impl/`. New domain tools go in the owning domain's `tools.rs` and are re-exported via `mod.rs`: do not add them under `impl/`.- One unified `ToolResult`: every tool imports it from `tinytools`, so every tool uses the same type.-- Browser allowlist is fail-safe: the browser shares `http_request.allowed_domains` but `browser_allowed_domains` strips the `"*"` wildcard: unifying can only narrow browser reach. Allow-all stays behind `OPENHUMAN_BROWSER_ALLOW_ALL`.+- Browser allowlist is fail-safe: the browser shares `http_request.allowed_domains` but strips the `"*"` wildcard: unifying can only narrow browser reach. Allow-all stays behind `OPENHUMAN_BROWSER_ALLOW_ALL`.- Node tools are co-gated: `shell`, `node_exec`, and `npm_exec` share one memoised `NodeBootstrap`; with `node.enabled = false` (or the `runtime-node` feature off), node/npm tools are not registered and shell skips PATH injection.- `external_effect_with_args` is the hook the harness checks at the gate-decision point, not the arg-less variant. Override it for per-call gating (e.g. composio `execute` vs `list`).- `PermissionLevel` ordering is load-bearing: the runtime compares `<` to reject tools above a channel's max; `permission_level()` should return the *minimum* level across a multi-action tool, with `permission_level_with_args` doing the per-call check.diff --git a/crates/openhuman-core/src/tools/timeout/README.md b/crates/openhuman-core/src/tools/timeout/README.mdindex 64696b01b0..728052d7d9 100644--- a/crates/openhuman-core/src/tools/timeout/README.md+++ b/crates/openhuman-core/src/tools/timeout/README.md@@ -12,7 +12,7 @@ Highest precedence first:## Responsibilities-- Hold the effective timeout in a process-global vendored `tinyagents_harness::tool::ToolTimeoutSettings` (atomic inside), seeded lazily from env or default on first read. Deadline/budget resolution (`resolve_tool_deadline`) delegates to that vendor type; env/config parsing stays here.+- Hold the effective timeout in a process-global vendored `tinyagents_harness::tool::ToolTimeoutSettings` (atomic inside), seeded lazily from env or default on first read. Env/config parsing stays here.- Bound every candidate value to `1..=3600` seconds, falling back to the `120`s default on missing, non-numeric, zero, negative, or out-of-range input.- Let the persisted config drive the value at runtime while keeping the operator env var as an always-wins override.- Provide the timeout to callers in two shapes: raw seconds (for logging and matching frontend timeouts) and `Duration` (for `tokio::time::timeout`-style wrapping).@@ -31,7 +31,6 @@ Highest precedence first:- `set_tool_timeout_secs(config_secs: u64) -> u64`: pushes a config-sourced value into the runtime atomic, honoring the env override. Returns the effective value stored. Called at startup and on each config update.- `env_override_active() -> bool`: true when `OPENHUMAN_TOOL_TIMEOUT_SECS` is set to a valid override, so UI changes are ignored. Surfaced to the settings panel.- `tool_execution_timeout_secs() -> u64`: effective timeout in seconds, read fresh each call.-- `tool_execution_timeout_duration() -> Duration`: same effective value as a `Duration`.- `explicit_call_timeout_secs(requested: Option<u64>, cap: u64) -> Option<u64>`: resolves an explicit per-call timeout for an otherwise-unbounded scripting tool. `None` or `Some(0)` means `None` (run unbounded); any positive value clamps to `MIN_TIMEOUT_SECS..=cap`. Callers pass their own ceiling (`MAX_TIMEOUT_SECS` for `shell`, `1800` for `node_exec`/`npm_exec`/`python_exec`).- `explicit_call_timeout_duration(requested: Option<u64>, cap: u64) -> Option<Duration>`: same as a `Duration`, `None` for unbounded.- `resolve_tool_deadline(policy: tinytools::ToolTimeout) -> (Option<Duration>, u64)`: resolves a tool's `ToolTimeout` policy (`Inherit`, `Millis(req)`, or `Unbounded`) into the `(deadline, timeout_secs)` pair the agent tool-execution loop enforces, padding an explicit millisecond request with `TOOL_TIMEOUT_GRACE_SECS` before the hard deadline fires.@@ -52,7 +51,7 @@ The global timeout governs non-scripting tools only, since a hung network or MCP## Used by-- `crates/openhuman-core/src/agent/tinyagents/tools.rs`: OpenHuman tools execute through `execute_with_options`, which applies each tool's `Tool::timeout_policy` via `resolve_tool_deadline`.+- `crates/openhuman-core/src/agent/tinyagents/tools.rs`: OpenHuman tools execute through `execute_with_options`, which applies each tool's `Tool::timeout_policy`.- `crates/openhuman-core/src/tools/impl/system/{shell,node_exec,npm_exec,python_exec}.rs`: scripting tools, unbounded by default, explicit `timeout_secs` via `explicit_call_timeout_*`.- `crates/openhuman-core/src/agent/tools/delegate.rs`: bounds the delegated provider chat call with `tool_execution_timeout_secs`.- `crates/openhuman-core/src/config/ops/agent.rs`: `apply_agent_settings` calls `set_tool_timeout_secs` after persisting; `get_agent_settings` reports `effective_timeout_secs`/`env_override`.diff --git a/crates/openhuman-core/src/util/README.md b/crates/openhuman-core/src/util/README.mdindex 07d05bba98..c1d4d81894 100644--- a/crates/openhuman-core/src/util/README.md+++ b/crates/openhuman-core/src/util/README.md@@ -16,7 +16,7 @@ six-line copy rather than an engine link.| `redact.rs` | `redact()`: SHA-256 to 8 hex chars for source ids, entity ids, and content paths in log lines. Same helper as `tinymemory_core::util::redact`, kept as a local copy so the host does not link the memory engine for a log formatter; the two copies never need to agree. || `retry.rs` | `retry_with_backoff` / `retry_with_backoff_async` (`base_ms * 2^i` backoff, `warn!` per retry) and `is_transient_fs_error`, for Windows mandatory-locking errors (`ERROR_SHARING_VIOLATION`, `ERROR_ACCESS_DENIED`) on a tree another handle still holds. || `sanitize.rs` | Pure re-export of `tinymcp_bus::sanitize` (`sanitize_for_llm`, `strip_control_chars`, `strip_instruction_fences`, `truncate_utf8_safe`, `MAX_DESCRIPTION_BYTES`, `MAX_TITLE_BYTES`) at the path callers already use. The rule lives in `tinymcp_bus` so MCP tool descriptions and the orchestrator prompt builder's skill descriptions get the same stripping; do not fork it back here. |-| `text.rs` | `truncate_with_ellipsis` / `truncate_with_suffix` (char-count truncation), `truncate_at_byte_boundary` (byte-cap with `…`), `floor_char_boundary` / `ceil_char_boundary` / `utf8_safe_prefix_at_byte_boundary` (byte-index rounding), `provenance_tag` (`chat:xxxxxxxx` hash of a session id for the cross-chat context block, so the raw `client_id` never reaches a prompt). |+| `text.rs` | `truncate_with_ellipsis` / `truncate_with_suffix` (char-count truncation), `truncate_at_byte_boundary` (byte-cap with `…`), `floor_char_boundary` / `ceil_char_boundary` / `utf8_safe_prefix_at_byte_boundary` (byte-index rounding). || `types.rs` | `MaybeSet<T>`: `Set(T)` / `Unset` / `Null`, distinguishing "field absent" from "field explicitly null" in partial-update payloads (see `tools/impl/system/proxy_config.rs`). || `tls/` | `tls_client_builder()`: platform-conditional TLS backend for `reqwest` clients. See [tls/README.md](tls/README.md). |diff --git a/crates/openhuman-core/src/voice/audio_toolkit/README.md b/crates/openhuman-core/src/voice/audio_toolkit/README.mdindex c64e2c6f00..956ba878c8 100644--- a/crates/openhuman-core/src/voice/audio_toolkit/README.md+++ b/crates/openhuman-core/src/voice/audio_toolkit/README.md@@ -27,7 +27,7 @@ Text-to-speech "podcast" toolkit. Synthesizes text into a workspace audio file vFrom `mod.rs`:- ops: `generate_podcast`, `email_podcast`, `generate_and_email_podcast`, `resolve_email_capture_dir`. All take `&Config` and return `Result<Outcome<T>, String>` (except `resolve_email_capture_dir`, which returns `Option<PathBuf>`).-- schemas: `all_audio_toolkit_controller_schemas`, `all_audio_toolkit_registered_controllers`.+- schemas: `all_audio_toolkit_registered_controllers`.- types: `AudioFormat` (`Mp3`/`Wav`, with `extension()` / `mime()`), `AudioGenerateRequest`, `EmailPodcastRequest`, `AudioGeneratedArtifact`, `AudioEmailDeliveryResult`, `AudioToolkitGenerateAndEmailResult`.- **tools** (`pub mod tools`): `AudioGeneratePodcastTool`, `AudioEmailPodcastTool`, `AudioGenerateAndEmailPodcastTool`.@@ -41,7 +41,7 @@ Namespace `audio_toolkit` (invoked as `openhuman.audio_toolkit_<function>`):| `audio_toolkit_email_podcast` | `to`, `subject`, `body`, `audio_path` (req); optional `attachment_name` | `email` (delivery JSON) || `audio_toolkit_generate_and_email_podcast` | `text`, `to`, `subject`, `body` (req); optional `title`, `output_path`, `provider`, `voice`, `format`, `attachment_name` | `result` (combined JSON) |-Registered into the global controller registry via `crates/openhuman-core/src/core/all.rs` (both `all_audio_toolkit_registered_controllers` and `all_audio_toolkit_controller_schemas`).+Registered into the global controller registry via `crates/openhuman-core/src/core/all.rs` (`all_audio_toolkit_registered_controllers`).## Agent toolsdiff --git a/crates/openhuman-core/src/web3/wallet/README.md b/crates/openhuman-core/src/web3/wallet/README.mdindex 2ae1b62708..b4b45e40df 100644--- a/crates/openhuman-core/src/web3/wallet/README.md+++ b/crates/openhuman-core/src/web3/wallet/README.md@@ -68,7 +68,7 @@ Signatures must match the real ones exactly; `cargo check| `crates/openhuman-core/src/web3/wallet/execution.rs` | `Outcome` adapters over the process-wide engine: `balances`/`network_defaults`/`supported_assets`/`chain_status`, `prepare_transfer`/`execute_prepared`, `tx_status`/`tx_receipt`/`lookup_tx`, `prepared_quotes_for_test`. Re-exports the engine's wire types. || `crates/openhuman-core/src/web3/wallet/endpoints.rs` | The `OPENHUMAN_WALLET_RPC_*` / `OPENHUMAN_SOLANA_CLUSTER` environment resolution, and `HostEndpoints`, the `RpcEndpoints` seam. The static defaults are in the crate. || `crates/openhuman-core/src/web3/wallet/schemas.rs` | RPC controller schemas and `handle_*` dispatchers delegating to `ops`/`execution`; `all_wallet_controller_schemas` / `all_wallet_registered_controllers`. |-| `crates/openhuman-core/src/web3/wallet/rpc.rs` | Network transport, not RPC controllers: shared `reqwest::Client`, JSON-RPC POST (`rpc_call`, `rpc_call_to`), REST GET/POST helpers, URL redaction for logs. |+| `crates/openhuman-core/src/web3/wallet/rpc.rs` | Network transport, not RPC controllers: shared `reqwest::Client`, JSON-RPC POST (`rpc_call_to`), REST GET/POST helpers, URL redaction for logs. || `crates/openhuman-core/src/web3/wallet/transport.rs` | OpenHuman's implementation of the `tinywallet_bus::rpc::Transport` seam: resolves a `tinywallet_bus::rpc::NetworkId` to an endpoint (including `OPENHUMAN_WALLET_RPC_<CHAIN>` overrides), redacts URLs for logs, and reuses `rpc.rs`'s shared `reqwest` client. Classifies errors conservatively: anything it cannot prove is a transport failure is reported as `TransportError::Rpc` (authoritative) rather than `Unreachable` (retryable), so an unclassifiable error stops a failover loop instead of risking a double broadcast. || `crates/openhuman-core/src/web3/wallet/tools.rs` | Re-exports the six agent tool structs from `tinywallet_web3::tools::wallet`. || `crates/openhuman-core/src/web3/wallet/stub.rs` | Disabled-wallet facade compiled when `web3` is off; mirrors the subset of the real surface that always-on or other-gated callers need, with no-op or disabled-error bodies. See the Compile-time gate section. |diff --git a/crates/openhuman-core/src/web3/x402/README.md b/crates/openhuman-core/src/web3/x402/README.mdindex 8e0049aa22..bca93dbac1 100644--- a/crates/openhuman-core/src/web3/x402/README.md+++ b/crates/openhuman-core/src/web3/x402/README.md@@ -40,7 +40,7 @@ and does not need a stub. Signatures must match the real ones exactly;| File | Role || --- | --- |-| `mod.rs` | Facade root: feature gate; re-exports from `tinywallet_x402` (`X402Client`, `X402Error`, `X402PaymentResult`, `handle_402`, the ledger and wire types); `init_ledger`, `handle_402_and_pay`, `try_paid_request` and `request_tool`, which supply the seams; the `store` accessors used by `http_request`. |+| `mod.rs` | Facade root: feature gate; re-exports from `tinywallet_x402` (`X402Client`, `X402Error`, `X402PaymentResult`, `handle_402`, the ledger and wire types); `init_ledger`, `handle_402_and_pay` and `request_tool`, which supply the seams; the `store` accessors used by `http_request`. || `seams.rs` | `WalletPaymentSigner` (the crate's `PaymentSigner`: keyring secret, decrypt, `modules::wallet::{derive_account, sign_message}`), `RuntimeProxyPolicy` (`ProxyPolicy` over `config::apply_runtime_proxy_to_builder`), and the `payments()` / `request_tool()` constructors that pair them with the wallet's `OpenHumanTransport`. || `budget.rs` | The spending limits: the crate's defaults plus the `OPENHUMAN_X402_*` overrides. || `records.rs` | `pending_record`: the `Pending` ledger record for the `http_request` fallback (ledger session + chat thread). |diff --git a/docs/specs/agent-runtime-upstream-boundary.md b/docs/specs/agent-runtime-upstream-boundary.mdindex 2863a33d20..eef49a1f85 100644--- a/docs/specs/agent-runtime-upstream-boundary.md+++ b/docs/specs/agent-runtime-upstream-boundary.md@@ -313,7 +313,7 @@ all consumers import the owner directly, not that behavior is dropped.| `artifact_offload/` | Split | Move size/chunk/handoff policy mechanics to harness; keep action-dir authorization and OpenHuman artifact store callbacks. || `run_queue/` | `tinyagents-harness::run_queue` | Delete the OpenHuman copy/facade after parity tests and direct imports. || `tool_result_artifacts/` | Keep host store | OpenHuman action-dir artifact persistence implementing the upstream artifact callback/store seam. |-| `credentials.rs`, `memory_context.rs`, `memory_context_safety.rs` | Keep host policy/adapters | Feed explicit context/capability requests; move only host-free formatting/traversal helpers. |+| `credentials.rs`, `memory_context_safety.rs` | Keep host policy/adapters | Feed explicit context/capability requests; move only host-free formatting/traversal helpers. || `fork_context.rs`, `sandbox_context.rs`, `spawn_depth_context.rs`, `task_recency_context.rs` | explicit `RunContext`/child context | Delete task-local shells. || `subagent_runner/` | Delete | The complete legacy tree is replaced by direct `agent/subagent_host` adapters over `tinyagents-orchestration::subagent`; generic lifecycle ordering, coalescing and mutually exclusive persistence are upstream. || `subagent_host/` | Keep host adapter | OpenHuman implements `SubagentPlanner`, `SubagentExecutor` and `SubagentPersistence`: definitions, policy, provider/model selection, tool narrowing, workspace/security, progress, artifacts and durable product checkpoint/session projection remain host-owned. |