Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

merge: upstream/main into jsonrpc-split

Steven Enamakel01b464418852
diff --cc crates/openhuman-core/README.md
index 9e2bfa7bc9,a95b42c09c..6585e089b1
--- a/crates/openhuman-core/README.md
+++ b/crates/openhuman-core/README.md
@@@ -55,9 -55,16 +55,16 @@@ contents inside `mod.rs` behind the fea
| `web3` | High-level web3 surface built on the wallet layer | [README](src/web3/README.md) |
| `web_chat` | Web/desktop channel turn runner (`channel.web_*` RPC, `WebChannelEvent` bus) | [README](src/web_chat/README.md) |
-RPC contract types (`RpcOutcome`, `StructuredRpcError`, the HTTP client) live
+RPC contract types (`Outcome`, `StructuredRpcError`, the HTTP client) live
- in `crates/openhuman-rpc` and are re-exported here as `openhuman_core::rpc` —
- they are not redefined in this crate.
+ in `crates/openhuman-rpc` and are re-exported here as `openhuman_core::rpc`.
+ They are not redefined in this crate.
+
+ The `inference` domain is where the pluggable LLM and embedding providers
+ live; see
+ [`gitbooks/developing/engines.md`](../../gitbooks/developing/engines.md) for
+ the full provider list. Tool selection under `agent` includes the Jev
+ ranker's core-side integration point; see
+ [`gitbooks/developing/jev.md`](../../gitbooks/developing/jev.md).
## Binaries
diff --cc crates/openhuman-core/src/agent/artifacts/README.md
index 62bfa9355e,bee3fd7274..a95079e892
--- a/crates/openhuman-core/src/agent/artifacts/README.md
+++ b/crates/openhuman-core/src/agent/artifacts/README.md
@@@ -16,9 -16,9 +16,9 @@@ renders artifact content itself
| `mod.rs` | `mod` decls and re-exports: `ArtifactKind` / `ArtifactMeta` / `ArtifactStatus`, the producer API (`create_artifact`, `finalize_artifact`, `fail_artifact`, `read_artifact_bytes`), and `all_artifacts_controller_schemas` / `all_artifacts_registered_controllers`. |
| `types.rs` | `ArtifactKind` (presentation/document/image/other), `ArtifactStatus` (pending/ready/failed), `ArtifactMeta`. Enums serialize lowercase; `parse` is case-insensitive and never errors (unknown kind → `Other`, unknown status → `Pending`). `ArtifactMeta.error` and `.thread_id` are optional, `skip_serializing_if` none. |
| `store.rs` | All filesystem I/O over `tokio::fs`: `artifacts_root`, `create_artifact`, `finalize_artifact`, `fail_artifact`, `read_artifact_bytes` (`pub`); `save_artifact_meta`, `save_artifact_args`, `read_artifact_args`, `list_artifacts`, `get_artifact`, `delete_artifact` (`pub(crate)`); `validate_artifact_id` / `assert_within_root` sandboxing; the `REGENERATE_TARGET_ID` task-local; `sanitize_filename_stem`. |
-| `ops.rs` | RPC business logic returning `RpcOutcome<Value>`: `ai_list_artifacts`, `ai_get_artifact`, `ai_delete_artifact`, `ai_regenerate`. `DEFAULT_LIMIT = 50`, `MAX_LIMIT = 200`. The regenerate path that re-runs `PresentationTool` is `#[cfg(feature = "documents")]`; without the feature `ai_regenerate` returns an error. |
+| `ops.rs` | RPC business logic returning `Outcome<Value>`: `ai_list_artifacts`, `ai_get_artifact`, `ai_delete_artifact`, `ai_regenerate`. `DEFAULT_LIMIT = 50`, `MAX_LIMIT = 200`. The regenerate path that re-runs `PresentationTool` is `#[cfg(feature = "documents")]`; without the feature `ai_regenerate` returns an error. |
| `schemas.rs` | `ControllerSchema`s and `handle_*` fns for the four `ai.*` controllers; param helpers `read_required`, `read_optional_u64`, `read_optional_string` (whitespace-only → absent), `type_name`. |
- | `tools.rs` | `ArtifactListTool`, `ArtifactGetTool`, `ArtifactDeleteTool` — shims over `ops` that unwrap the `Outcome` and return `outcome.value` as the `ToolResult` string. |
-| `tools.rs` | `ArtifactListTool`, `ArtifactGetTool`, `ArtifactDeleteTool`: shims over `ops` that unwrap the `RpcOutcome` and return `outcome.value` as the `ToolResult` string. |
++| `tools.rs` | `ArtifactListTool`, `ArtifactGetTool`, `ArtifactDeleteTool`: shims over `ops` that unwrap the `Outcome` and return `outcome.value` as the `ToolResult` string. |
| `*_tests.rs` | Sibling test files for each of the above (`#[path]`). |
## Public surface
diff --cc crates/openhuman-core/src/agent/experience/README.md
index 311c3aaf9a,fe972c4cf0..36908b8e3e
--- a/crates/openhuman-core/src/agent/experience/README.md
+++ b/crates/openhuman-core/src/agent/experience/README.md
@@@ -59,11 -59,11 +59,11 @@@ Records are stored through the `Memory
## Dependencies
- - `crate::memory` — `Memory` trait, `MemoryCategory`, `memory::binding::{for_config, for_subtree}` (driver binding behind `DriverMemory`), `memory::api::{provider, recall, types, health}` (the provider contract `DriverMemory` adapts), `memory::safety::sanitize_text` (store-time scrub), `memory::source_scope::as_bus_scope` (explicit recall scope), `memory::preferences::recall_by_vector_over`.
- - `crate::config` — `Config::load_or_init` for `workspace_dir` and `subsystems.memory` when the RPC handlers bind a store.
- - `crate::core::all` — `ControllerFuture`, `RegisteredController` for RPC registration.
- - `crate::core` — `ControllerSchema`, `FieldSchema`, `TypeSchema` (schema types); `crate::core::Outcome`.
- - `crate::memory::tool_memory::test_helpers::MockMemory` and `crate::memory::guard::test_support::RecordingProvider` — tests only.
+ - `crate::memory`: `Memory` trait, `MemoryCategory`, `memory::binding::{for_config, for_subtree}` (driver binding behind `DriverMemory`), `memory::api::{provider, recall, types, health}` (the provider contract `DriverMemory` adapts), `memory::safety::sanitize_text` (store-time scrub), `memory::source_scope::as_bus_scope` (explicit recall scope), `memory::preferences::recall_by_vector_over`.
+ - `crate::config`: `Config::load_or_init` for `workspace_dir` and `subsystems.memory` when the RPC handlers bind a store.
+ - `crate::core::all`: `ControllerFuture`, `RegisteredController` for RPC registration.
-- `crate::core`: `ControllerSchema`, `FieldSchema`, `TypeSchema` (schema types); `crate::rpc::RpcOutcome`.
++- `crate::core`: `ControllerSchema`, `FieldSchema`, `TypeSchema` (schema types); `crate::rpc::Outcome`.
+ - `crate::memory::tool_memory::test_helpers::MockMemory` and `crate::memory::guard::test_support::RecordingProvider`: tests only.
## Used by
diff --cc crates/openhuman-core/src/agent/learning/README.md
index d065b368e3,82a4d25289..4f14922341
--- a/crates/openhuman-core/src/agent/learning/README.md
+++ b/crates/openhuman-core/src/agent/learning/README.md
@@@ -97,17 -97,17 +97,17 @@@ These are subscriber registrations rath
## Dependencies
- - `tinymemory_api` — `provider::{MemoryProfile, ProfileFacet, FacetState, FacetType, UserState}` behind `FacetCache`, and the candidate taxonomy re-exported by `candidate.rs` (`learning::{CueFamily, FacetClass, LearningCandidate}`, `host::EvidenceRef`).
- - `crate::memory` — the `Memory` trait + `MemoryCategory` for KV persistence (hooks, transcript ingest), `guard::MemoryGuard` and `ops::guard::active_memory_guard` for the facet store, and `memory::api::provider::MemoryProvider` / `api::types` for the enrichment document upsert.
- - `crate::agent::hooks` — `PostTurnHook` / `TurnContext` / `ToolCallRecord` implemented by the three hooks.
- - `tinyagents_session::transcript` — `SessionTranscript` parsing for transcript ingestion.
+ - `tinymemory_api`: `provider::{MemoryProfile, ProfileFacet, FacetState, FacetType, UserState}` behind `FacetCache`, and the candidate taxonomy re-exported by `candidate.rs` (`learning::{CueFamily, FacetClass, LearningCandidate}`, `host::EvidenceRef`).
+ - `crate::memory`: the `Memory` trait + `MemoryCategory` for KV persistence (hooks, transcript ingest), `guard::MemoryGuard` and `ops::guard::active_memory_guard` for the facet store, and `memory::api::provider::MemoryProvider` / `api::types` for the enrichment document upsert.
+ - `crate::agent::hooks`: `PostTurnHook` / `TurnContext` / `ToolCallRecord` implemented by the three hooks.
+ - `tinyagents_session::transcript`: `SessionTranscript` parsing for transcript ingestion.
- `crate::inference::provider::create_chat_model_from_string_with_model_id` (profile summarisation) and `crate::inference::host_runtime::global` (local reflection route); `ReflectionHook` also accepts an optional `tinyinference_llm::model::ChatModel` for the cloud fallback.
- - `crate::config` — `Config` / `LearningConfig` / `ReflectionSource` feature flags and `config::rpc` loader.
- - `crate::agent::prompts` — `PromptContext` / `PromptSection` / `LearnedContextData` for prompt injection.
- - `crate::integrations::composio` — `composio::client` (Gmail fetch for enrichment) and `composio::profile_md` (`replace_managed_block` for `PROFILE.md`).
- - `crate::integrations` — `build_client` / `IntegrationClient` for the Apify scrape call.
- - `crate::core::bus` / `crate::core::events` / `tinybus` — `BUS.publish` / `BUS.subscribe`, `DomainEvent::CacheRebuilt`, and `tinybus::{EventHandler, SubscriptionHandle}`.
- - `crate::core::all` / `crate::rpc` — controller registry types (`RegisteredController`, `ControllerFuture`) and `Outcome` (the latter re-exported from the `openhuman-rpc` crate via `pub use openhuman_rpc as rpc` in `lib.rs`).
+ - `crate::config`: `Config` / `LearningConfig` / `ReflectionSource` feature flags and `config::rpc` loader.
+ - `crate::agent::prompts`: `PromptContext` / `PromptSection` / `LearnedContextData` for prompt injection.
+ - `crate::integrations::composio`: `composio::client` (Gmail fetch for enrichment) and `composio::profile_md` (`replace_managed_block` for `PROFILE.md`).
+ - `crate::integrations`: `build_client` / `IntegrationClient` for the Apify scrape call.
+ - `crate::core::bus` / `crate::core::events` / `tinybus`: `BUS.publish` / `BUS.subscribe`, `DomainEvent::CacheRebuilt`, and `tinybus::{EventHandler, SubscriptionHandle}`.
-- `crate::core::all` / `crate::rpc`: controller registry types (`RegisteredController`, `ControllerFuture`) and `RpcOutcome` (the latter re-exported from the `openhuman-rpc` crate via `pub use openhuman_rpc as rpc` in `lib.rs`).
++- `crate::core::all` / `crate::rpc`: controller registry types (`RegisteredController`, `ControllerFuture`) and `Outcome` (the latter re-exported from the `openhuman-rpc` crate via `pub use openhuman_rpc as rpc` in `lib.rs`).
## Used by
diff --cc crates/openhuman-core/src/channels/controllers/README.md
index 744e098720,036ad515cb..550693e756
--- a/crates/openhuman-core/src/channels/controllers/README.md
+++ b/crates/openhuman-core/src/channels/controllers/README.md
@@@ -6,10 -6,10 +6,10 @@@ Owns the `channels.*` RPC namespace: pr
| Path | Purpose |
| --- | --- |
- | `backend.rs` | `OpenHumanChannelBackend` — the OpenHuman implementation of `tinychannels::ChannelBackend`; `tinychannels::ChannelManager` calls back into it, and each method forwards to the matching `ops` function. `send_outbound_intent` first tries `channels::relay_runtime::send_outbound_intent` when `relay_runtime_fronts_channel` says the relay-websocket transport fronts the channel, then falls back to `ops::channel_send_message` |
+ | `backend.rs` | `OpenHumanChannelBackend`, the OpenHuman implementation of `tinychannels::ChannelBackend`. `tinychannels::ChannelManager` calls back into it, and each method forwards to the matching `ops` function. `send_outbound_intent` first tries `channels::relay_runtime::send_outbound_intent` when `relay_runtime_fronts_channel` says the relay-websocket transport fronts the channel, then falls back to `ops::channel_send_message` |
| `definitions.rs` | Re-exports provider metadata (`ChannelDefinition`, `ChannelAuthMode`, `ChannelCapability`, `AuthModeSpec`, `FieldRequirement`, `all_channel_definitions`, `find_channel_definition`) from `tinychannels::controllers` |
| `ops/` | Business logic behind each RPC handler, grouped by concern (connect, discord, messaging, telegram, yuanbao) |
-| `schemas.rs` | `all_registered_controllers` / `all_controller_schemas` and the thin RPC handlers: deserialize params, build a `ChannelManager<OpenHumanChannelBackend>` over the loaded config, call the manager, and shape the `RpcOutcome`. Field schemas come from `tinychannels::controllers::channel_controller_schema`, converted by `from_channel_controller_schema` |
+| `schemas.rs` | `all_registered_controllers` / `all_controller_schemas` and the thin RPC handlers: deserialize params, build a `ChannelManager<OpenHumanChannelBackend>` over the loaded config, call the manager, and shape the `Outcome`. Field schemas come from `tinychannels::controllers::channel_controller_schema`, converted by `from_channel_controller_schema` |
## RPC surface
diff --cc crates/openhuman-core/src/config/migration_helpers/README.md
index 175ea33be3,5c8118f1c4..0841926467
--- a/crates/openhuman-core/src/config/migration_helpers/README.md
+++ b/crates/openhuman-core/src/config/migration_helpers/README.md
@@@ -60,11 -60,11 +60,11 @@@ No own store. It writes imported entrie
## Dependencies
- - `crate::config::Config` — source of `workspace_dir` and `memory` config; `config::rpc::load_config_with_timeout` in handlers.
- - `crate::memory` (`Memory`, `MemoryCategory`) — target backend trait + category enum entries are mapped into.
- - `crate::memory::store` — `create_memory_for_migration` constructs the target memory backend.
- - `crate::core::all` (`ControllerFuture`, `RegisteredController`) and `crate::core::{ControllerSchema, FieldSchema, TypeSchema}` — controller registry/schema types.
- - `crate::core::Outcome` — RPC response envelope.
+ - `crate::config::Config`: source of `workspace_dir` and `memory` config; `config::rpc::load_config_with_timeout` in handlers.
+ - `crate::memory` (`Memory`, `MemoryCategory`): target backend trait plus the category enum entries are mapped into.
+ - `crate::memory::store`: `create_memory_for_migration` constructs the target memory backend.
+ - `crate::core::all` (`ControllerFuture`, `RegisteredController`) and `crate::core::{ControllerSchema, FieldSchema, TypeSchema}`: controller registry/schema types.
-- `crate::rpc::RpcOutcome`: RPC response envelope.
++- `crate::rpc::Outcome`: RPC response envelope.
- External crates: `rusqlite` (read OpenClaw `brain.db`), `directories::UserDirs` (home dir), `anyhow`, `serde`/`serde_json`.
## Used by
diff --cc crates/openhuman-core/src/config/workspace/README.md
index 594713e369,ceec18627c..df35539bd1
--- a/crates/openhuman-core/src/config/workspace/README.md
+++ b/crates/openhuman-core/src/config/workspace/README.md
@@@ -17,8 -17,10 +17,10 @@@ Owns workspace layout bootstrap and th
| --- | --- |
| `crates/openhuman-core/src/config/workspace/mod.rs` | Export-focused. Re-exports `ops::*` and the RPC controller-schema pair (`all_workspace_controller_schemas` / `all_workspace_registered_controllers`). |
| `crates/openhuman-core/src/config/workspace/ops.rs` | `init_workspace(force)` bootstrap logic, the `BOOTSTRAP_FILES` table (`SOUL.md`, `IDENTITY.md`), `bundled_default_contents` (the editable allowlist + reset source of truth), and `ensure_workspace_file`. |
-| `crates/openhuman-core/src/config/workspace/rpc.rs` | Pure-domain persona file API: `WorkspaceFile` type, `read_workspace_file` / `write_workspace_file` / `reset_workspace_file`, `MAX_WORKSPACE_FILE_BYTES`, allowlist enforcement (`ensure_editable`). Returns `RpcOutcome<WorkspaceFile>`. |
+| `crates/openhuman-core/src/config/workspace/rpc.rs` | Pure-domain persona file API: `WorkspaceFile` type, `read_workspace_file` / `write_workspace_file` / `reset_workspace_file`, `MAX_WORKSPACE_FILE_BYTES`, allowlist enforcement (`ensure_editable`). Returns `Outcome<WorkspaceFile>`. |
| `crates/openhuman-core/src/config/workspace/schemas.rs` | Controller schemas + `handle_*` fns delegating to `rpc.rs`; loads config to resolve `workspace_dir`. |
+ | `crates/openhuman-core/src/config/workspace/tools.rs` | LLM-callable wrappers over the persona-file RPCs: `WorkspaceReadPersonaTool` (default-on), `WorkspaceUpdatePersonaTool`, `WorkspaceResetPersonaTool`, and `WorkspaceInitTool` (all three mutators default-off, gated by the `workspace_manage` toggle in `tools/user_filter.rs`). |
+ | `crates/openhuman-core/src/config/workspace/state.rs` | `WatcherStateStore`, a SQLite-backed `path -> last_mtime_secs` table for a vault file watcher, so it can skip re-ingesting unchanged files after a restart. Not otherwise wired to the persona/bootstrap concerns above; currently has no other caller in the tree. |
## Public surface
@@@ -53,12 -55,14 +55,14 @@@ The editable surface is restricted to t
## Dependencies
- - `crate::config::rpc` — loads `Config` (timeout-bounded) to resolve `workspace_dir` and `config_path` in both `ops.rs` and `schemas.rs`.
- - `crate::skills::init_skills_dir` — seeds the `skills/` directory README during `init_workspace`.
- - `crate::subconscious::heartbeat::engine::HeartbeatEngine::ensure_heartbeat_file` — ensures `HEARTBEAT.md` during `init_workspace`.
- - `crate::core::all` (`ControllerFuture`, `RegisteredController`) and `crate::core::{ControllerSchema, FieldSchema, TypeSchema}` — controller registry types.
- - `crate::core::Outcome` — uniform RPC return type.
+ - `crate::config::rpc`: loads `Config` (timeout-bounded) to resolve `workspace_dir` and `config_path` in both `ops.rs` and `schemas.rs`.
+ - `crate::skills::init_skills_dir`: seeds the `skills/` directory README during `init_workspace`.
+ - `crate::subconscious::heartbeat::engine::HeartbeatEngine::ensure_heartbeat_file`: ensures `HEARTBEAT.md` during `init_workspace`.
+ - `crate::core::all` (`ControllerFuture`, `RegisteredController`) and `crate::core::{ControllerSchema, FieldSchema, TypeSchema}`: controller registry types.
-- `crate::rpc::RpcOutcome`: uniform RPC return type.
++- `crate::rpc::Outcome`: uniform RPC return type.
- Bundled prompt assets via `include_str!("../../agent/prompts/SOUL.md" | "IDENTITY.md")`.
+ - `tinytools` (`PermissionLevel`, `Tool`, `ToolResult`) for the agent tools in `tools.rs`.
+ - `rusqlite` for `state.rs`'s watcher-state database.
## Used by
diff --cc crates/openhuman-core/src/core/README.md
index 77d01a1263,e61916297c..64f9b790ca
--- a/crates/openhuman-core/src/core/README.md
+++ b/crates/openhuman-core/src/core/README.md
@@@ -213,7 -213,7 +213,7 @@@ expected to reuse the same registry rat
## `crate::rpc`
`crate::rpc` is `pub use openhuman_rpc as rpc;` (see `lib.rs`), so
- `crate::core::Outcome`, `StructuredRpcError`, and `apply_log_envelope` are
-`crate::rpc::RpcOutcome`, `StructuredRpcError`, and `apply_log_envelope` are
++`crate::rpc::Outcome`, `StructuredRpcError`, and `apply_log_envelope` are
the same types `crates/openhuman-rpc` exposes to `openhuman-app` and
`openhuman-tui`. There is no separate RPC contract layer under `core/`.
diff --cc crates/openhuman-core/src/core/jsonrpc/server.rs
index a428855e01,0000000000..d11a32aa33
mode 100644,000000..100644
--- a/crates/openhuman-core/src/core/jsonrpc/server.rs
+++ b/crates/openhuman-core/src/core/jsonrpc/server.rs
@@@ -1,164 -1,0 +1,178 @@@
+//! Server entry points kept for the hosts that predate
+//! [`CoreBuilder`](crate::core::runtime::CoreBuilder).
+//!
+//! Each `run_server*` function is a thin shim that composes a `CoreBuilder`
+//! and calls [`CoreRuntime::serve`](crate::core::runtime::CoreRuntime::serve).
+
+use tokio_util::sync::CancellationToken;
+
+/// Resolves the port for the core server from environment variables or defaults.
+#[cfg(feature = "http-server")]
+pub(crate) fn core_port() -> u16 {
+ std::env::var("OPENHUMAN_CORE_PORT")
+ .ok()
+ .and_then(|v| v.parse::<u16>().ok())
+ .unwrap_or(7788)
+}
+
+/// Resolves the bind address host for the core server from environment variables or defaults.
+#[cfg(feature = "http-server")]
+pub(crate) fn core_host() -> String {
+ std::env::var("OPENHUMAN_CORE_HOST")
+ .ok()
+ .filter(|s| !s.is_empty())
+ .unwrap_or_else(|| "127.0.0.1".to_string())
+}
+
+/// Metadata sent back to the Tauri host once the embedded core has selected
+/// and bound its listen port.
+#[derive(Debug, Clone)]
+pub struct EmbeddedReadySignal {
+ pub port: u16,
+ pub fallback_from: Option<u16>,
+}
+
+/// Runs the HTTP/JSON-RPC server.
+///
+/// This function binds to the specified host and port, initializes the router,
+/// bootstraps long-lived runtime infrastructure, and starts serving requests.
+pub async fn run_server(
+ host: Option<&str>,
+ port: Option<u16>,
+ socketio_enabled: bool,
+) -> anyhow::Result<()> {
+ run_server_inner(host, port, socketio_enabled, false, None, None, None).await
+}
+
+/// Runs the request/response-only HTTP API without detached background jobs.
+pub async fn run_server_headless(host: Option<&str>, port: Option<u16>) -> anyhow::Result<()> {
+ let services = crate::core::runtime::ServiceSet::headless_api();
+ run_server_with_services(host, port, services, false, None, None, None).await
+}
+
+/// Like [`run_server`] but marks the instance as embedded.
+pub async fn run_server_embedded(
+ host: Option<&str>,
+ port: Option<u16>,
+ socketio_enabled: bool,
+ shutdown_token: CancellationToken,
+) -> anyhow::Result<()> {
+ run_server_inner(
+ host,
+ port,
+ socketio_enabled,
+ true,
+ Some(shutdown_token),
+ None,
+ None,
+ )
+ .await
+}
+
+/// Embedded entrypoint with an explicit readiness callback.
+///
+/// When the caller already holds the per-launch RPC bearer in memory (the
+/// Tauri shell now that the core runs in-process — PR #1061), it should
+/// pass `Some(token)` so the embedded server can seed its auth subsystem
+/// via [`crate::core::auth::init_rpc_token_with_value`] without ever
+/// reading `OPENHUMAN_CORE_TOKEN` from the process environment. Passing
+/// `None` preserves the env-as-config fallback (CLI / docker / cloud).
+pub async fn run_server_embedded_with_ready(
+ host: Option<&str>,
+ port: Option<u16>,
+ socketio_enabled: bool,
+ shutdown_token: CancellationToken,
+ ready_tx: tokio::sync::oneshot::Sender<EmbeddedReadySignal>,
+ rpc_token: Option<std::sync::Arc<String>>,
+) -> anyhow::Result<()> {
+ run_server_inner(
+ host,
+ port,
+ socketio_enabled,
+ true,
+ Some(shutdown_token),
+ Some(ready_tx),
+ rpc_token,
+ )
+ .await
+}
+
+/// Internal server entrypoint.
+async fn run_server_inner(
+ host: Option<&str>,
+ port: Option<u16>,
+ socketio_enabled: bool,
+ embedded_core: bool,
+ shutdown_token: Option<CancellationToken>,
+ ready_tx: Option<tokio::sync::oneshot::Sender<EmbeddedReadySignal>>,
+ rpc_token: Option<std::sync::Arc<String>>,
+) -> anyhow::Result<()> {
+ let mut services = crate::core::runtime::ServiceSet::desktop();
+ services.socketio = socketio_enabled;
+ run_server_with_services(
+ host,
+ port,
+ services,
+ embedded_core,
+ shutdown_token,
+ ready_tx,
+ rpc_token,
+ )
+ .await
+}
+
+async fn run_server_with_services(
+ host: Option<&str>,
+ port: Option<u16>,
+ services: crate::core::runtime::ServiceSet,
+ embedded_core: bool,
+ shutdown_token: Option<CancellationToken>,
+ ready_tx: Option<tokio::sync::oneshot::Sender<EmbeddedReadySignal>>,
+ rpc_token: Option<std::sync::Arc<String>>,
+) -> anyhow::Result<()> {
+ // `run_server_inner` is now a thin shim over the CoreBuilder/CoreRuntime
+ // composition (Phase 1). It reproduces the legacy behavior exactly: all
+ // background services on (`ServiceSet::desktop`), Socket.IO per the caller
+ // flag, and the legacy `embedded_core` → `HostKind` mapping (embedded ==
+ // Tauri shell; standalone splits CLI / Docker via `detect_standalone`).
+ // See the pluggable-core work (`core::runtime`).
+ let host_kind = if embedded_core {
+ crate::core::types::HostKind::TauriShell
+ } else {
+ crate::core::types::HostKind::detect_standalone()
+ };
+ let token = match rpc_token {
+ Some(token) => crate::core::runtime::TokenSource::Fixed(token),
+ None => crate::core::runtime::TokenSource::EnvOrFile,
+ };
+ let mut builder = crate::core::runtime::CoreBuilder::new(host_kind)
+ .token(token)
+ .services(services);
++ // The browser E2E harness scripts direct tool calls through its mock model.
++ // Keep production's fail-closed packed default, while making those calls
++ // visible in the deterministic test core without changing library hosts.
++ builder = apply_e2e_tool_groups(builder);
+ if let Some(host) = host {
+ builder = builder.host(host);
+ }
+ if let Some(port) = port {
+ builder = builder.port(port);
+ }
+
+ let runtime = builder.build().await?;
+ runtime.serve(ready_tx, shutdown_token).await
+}
+
++fn apply_e2e_tool_groups(
++ builder: crate::core::runtime::CoreBuilder,
++) -> crate::core::runtime::CoreBuilder {
++ if std::env::var_os("OPENHUMAN_E2E").is_some() {
++ builder.tool_groups(crate::tools::toolpacks::ToolGroups::advertised())
++ } else {
++ builder
++ }
++}
++
+#[cfg(test)]
+#[path = "server_tests.rs"]
+mod tests;
diff --cc crates/openhuman-core/src/core/jsonrpc/server_tests.rs
index 72ba870288,0000000000..2a49bfbc54
mode 100644,000000..100644
--- a/crates/openhuman-core/src/core/jsonrpc/server_tests.rs
+++ b/crates/openhuman-core/src/core/jsonrpc/server_tests.rs
@@@ -1,109 -1,0 +1,116 @@@
+use std::ffi::OsString;
+use std::time::Duration;
+
+use tokio_util::sync::CancellationToken;
+
+use crate::core::jsonrpc::testing::EnvVarGuard;
+
++#[test]
++fn e2e_environment_enables_advertised_tool_groups() {
++ let _guard = EnvVarGuard::set_many(vec![("OPENHUMAN_E2E", "1".into())]);
++ let builder = crate::core::runtime::CoreBuilder::new(crate::core::types::HostKind::Cli);
++ let _ = super::apply_e2e_tool_groups(builder);
++}
++
+async fn wait_until_port_accepts(port: u16) {
+ let deadline = tokio::time::Instant::now() + Duration::from_secs(2);
+ loop {
+ if tokio::net::TcpStream::connect(("127.0.0.1", port))
+ .await
+ .is_ok()
+ {
+ return;
+ }
+ assert!(
+ tokio::time::Instant::now() < deadline,
+ "server did not start accepting on port {port}"
+ );
+ tokio::time::sleep(Duration::from_millis(25)).await;
+ }
+}
+
+async fn wait_until_port_released(port: u16) {
+ let deadline = tokio::time::Instant::now() + Duration::from_secs(2);
+ loop {
+ if tokio::net::TcpStream::connect(("127.0.0.1", port))
+ .await
+ .is_err()
+ {
+ return;
+ }
+ assert!(
+ tokio::time::Instant::now() < deadline,
+ "server did not release port {port}"
+ );
+ tokio::time::sleep(Duration::from_millis(25)).await;
+ }
+}
+
+/// Regression test for issue #920 — the embedded server's `axum::serve`
+/// accept loop must stop within the cancellation timeout when its
+/// `CancellationToken` is fired.
+///
+/// **Ignored by default.** This test calls `run_server_embedded`,
+/// which triggers the full production bootstrap (`bootstrap_core_runtime`
+/// → `register_domain_subscribers` → `scheduler_gate::init_global` +
+/// `memory::tree::jobs::start` + `composio::start_periodic_sync` +
+/// cron scheduler). Those code paths spawn detached `tokio::spawn`
+/// background tasks and write to several process-global statics
+/// (`STATE: OnceLock`, `SIGNED_OUT: AtomicBool`, `LLM_PERMITS`
+/// semaphore, `GLOBAL_REGISTRY` agent.run_turn handler, `STARTED`
+/// `std::sync::Once`s, …) — *none of which have teardown semantics*.
+/// In a unit-test binary the leaked tasks then race with every other
+/// test, multiplying CI wall time by 10–20× (PR #1552 thread). The
+/// right shape for this regression is an integration test in a
+/// dedicated `tests/` binary where global pollution doesn't affect
+/// siblings — tracked as a follow-up.
+///
+/// To run manually: `cargo test --lib -p openhuman -- --ignored
+/// shutdown_token`.
+#[tokio::test]
+#[ignore = "calls full server bootstrap; leaks process-global state into sibling tests (#1552). Re-cover via integration test."]
+async fn shutdown_token_stops_axum_listener_within_timeout() {
+ let _signed_out_restore = crate::cron::scheduler_gate::SignedOutTestGuard::set(false);
+
+ let workspace = tempfile::tempdir().expect("workspace tempdir");
+
+ // Pin scheduler-gate policy to Aggressive while this test runs so
+ // the bootstrap's `init_global` snapshot can't capture transient
+ // CPU pressure and freeze the cached policy at Paused.
+ std::fs::write(
+ workspace.path().join("config.toml"),
+ "[scheduler_gate]\nmode = \"always_on\"\n",
+ )
+ .expect("seed scheduler_gate=always_on config.toml");
+ let _env = EnvVarGuard::set_many(vec![
+ (
+ "OPENHUMAN_WORKSPACE",
+ workspace.path().as_os_str().to_os_string(),
+ ),
+ ("OPENHUMAN_DISABLE_CHANNEL_LISTENERS", OsString::from("1")),
+ (
+ "OPENHUMAN_CORE_TOKEN",
+ OsString::from("test-token-shutdown"),
+ ),
+ ]);
+
+ let probe = std::net::TcpListener::bind("127.0.0.1:0").expect("allocate test port");
+ let port = probe.local_addr().expect("local addr").port();
+ drop(probe);
+
+ let shutdown_token = CancellationToken::new();
+ let server_token = shutdown_token.clone();
+ let server = tokio::spawn(async move {
+ super::run_server_embedded(Some("127.0.0.1"), Some(port), false, server_token).await
+ });
+
+ wait_until_port_accepts(port).await;
+ shutdown_token.cancel();
+
+ let result = tokio::time::timeout(Duration::from_secs(2), server)
+ .await
+ .expect("embedded server task should stop within timeout")
+ .expect("embedded server task should not panic");
+ result.expect("embedded server should shut down cleanly");
+ wait_until_port_released(port).await;
+}
diff --cc crates/openhuman-core/src/desktop/app_state/README.md
index d71ce75a37,240cf9693a..a3f896d4a6
--- a/crates/openhuman-core/src/desktop/app_state/README.md
+++ b/crates/openhuman-core/src/desktop/app_state/README.md
@@@ -20,13 -20,13 +20,13 @@@ The snapshot never talks to the backend
## Public surface
- - `AppStateSnapshot` — composite payload: `auth` (`AuthStateResponse`: `isAuthenticated`, `userId`, `user`, `profileId`, `credential`, `expiresAt`), `session_token`, `current_user` (= `auth.user`), `onboarding_completed`, `chat_onboarding_completed`, `analytics_enabled`, `local_state`, `keyring_status`, `runtime` (`RuntimeSnapshot { local_ai: LocalAiStatus, service: ServiceStatus }`), `health`, `config_recovered`.
- - `StoredAppState` — disk schema persisted to `<workspace_dir>/state/app-state.json` (`encryption_key`, `onboarding_tasks`, `keyring_consent`). `StoredOnboardingTasks` holds the shell-tracked onboarding flags plus `enabled_tools` and `connected_sources`.
- - `StoredAppStatePatch` — partial update (`Option<Option<_>>` per field) applied by `update_local_state`.
- - `pub async fn snapshot() -> Result<Outcome<AppStateSnapshot>, String>` — full snapshot; one auth-profile load per call, no network.
- - `pub async fn update_local_state(StoredAppStatePatch) -> Result<Outcome<StoredAppState>, String>` — merge under `APP_STATE_FILE_LOCK` and save atomically.
- - `pub(crate) fn load_stored_app_state(&Config)` / `pub fn save_app_state(&Config, &StoredAppState)` — direct disk access; a corrupt file is renamed to `app-state.json.corrupted.<ts>` and replaced with defaults.
- - `latch_from_config(&Config)` / `config_recovered_this_session()` — recovery latch.
+ - `AppStateSnapshot`: composite payload: `auth` (`AuthStateResponse`: `isAuthenticated`, `userId`, `user`, `profileId`, `credential`, `expiresAt`), `session_token`, `current_user` (= `auth.user`), `onboarding_completed`, `chat_onboarding_completed`, `analytics_enabled`, `local_state`, `keyring_status`, `runtime` (`RuntimeSnapshot { local_ai: LocalAiStatus, service: ServiceStatus }`), `health`, `config_recovered`.
+ - `StoredAppState`: disk schema persisted to `<workspace_dir>/state/app-state.json` (`encryption_key`, `onboarding_tasks`, `keyring_consent`). `StoredOnboardingTasks` holds the shell-tracked onboarding flags plus `enabled_tools` and `connected_sources`.
+ - `StoredAppStatePatch`: partial update (`Option<Option<_>>` per field) applied by `update_local_state`.
-- `pub async fn snapshot() -> Result<RpcOutcome<AppStateSnapshot>, String>`: full snapshot; one auth-profile load per call, no network.
-- `pub async fn update_local_state(StoredAppStatePatch) -> Result<RpcOutcome<StoredAppState>, String>`: merge under `APP_STATE_FILE_LOCK` and save atomically.
++- `pub async fn snapshot() -> Result<Outcome<AppStateSnapshot>, String>`: full snapshot; one auth-profile load per call, no network.
++- `pub async fn update_local_state(StoredAppStatePatch) -> Result<Outcome<StoredAppState>, String>`: merge under `APP_STATE_FILE_LOCK` and save atomically.
+ - `pub(crate) fn load_stored_app_state(&Config)` / `pub fn save_app_state(&Config, &StoredAppState)`: direct disk access; a corrupt file is renamed to `app-state.json.corrupted.<ts>` and replaced with defaults.
+ - `latch_from_config(&Config)` / `config_recovered_this_session()`: recovery latch.
- RPC `app_state.{snapshot, update_local_state}` via `all_app_state_controller_schemas` / `all_app_state_registered_controllers`.
The signed-in identity for prompts and Sentry is `security::credentials::identity::peek_credential_user_identity()`, seeded from the same stored payload.
diff --cc crates/openhuman-core/src/desktop/dashboard/README.md
index 851e918523,9983739ff9..b92e7d02e1
--- a/crates/openhuman-core/src/desktop/dashboard/README.md
+++ b/crates/openhuman-core/src/desktop/dashboard/README.md
@@@ -21,8 -21,8 +21,8 @@@ Aggregate, operator-facing views over l
## Public surface
- - `ops::model_health` — `fn model_health(config: &Config) -> Result<Outcome<ModelHealthResponse>, String>`.
- - `schemas::all_dashboard_controller_schemas`, `schemas::all_dashboard_registered_controllers`, `schemas::dashboard_schemas` — controller-registry entry points.
-- `ops::model_health`: `fn model_health(config: &Config) -> Result<RpcOutcome<ModelHealthResponse>, String>`.
++- `ops::model_health`: `fn model_health(config: &Config) -> Result<Outcome<ModelHealthResponse>, String>`.
+ - `schemas::all_dashboard_controller_schemas`, `schemas::all_dashboard_registered_controllers`, `schemas::dashboard_schemas`: controller-registry entry points.
- `types::ModelHealthEntry`, `types::ModelHealthConfigView`, `types::ModelHealthResponse`.
## RPC / controllers
@@@ -42,10 -42,10 +42,10 @@@ None. The module reads from in-memory `
## Dependencies
- - `crate::config` (`Config`, `config::rpc::load_config_with_timeout`) — source of the model registry and `dashboard.model_health` thresholds. `DashboardConfig` / `ModelHealthConfig` are defined in `crates/openhuman-core/src/config/schema/dashboard.rs`.
- - `crate::core::all` (`ControllerFuture`, `RegisteredController`) and `crate::core` (`ControllerSchema`, `FieldSchema`, `TypeSchema`) — controller registry types.
- - `crate::core::Outcome` — standard RPC result wrapper.
- - `serde` / `serde_json` — wire (de)serialization and handler params.
+ - `crate::config` (`Config`, `config::rpc::load_config_with_timeout`), source of the model registry and `dashboard.model_health` thresholds. `DashboardConfig` / `ModelHealthConfig` are defined in `crates/openhuman-core/src/config/schema/dashboard.rs`.
+ - `crate::core::all` (`ControllerFuture`, `RegisteredController`) and `crate::core` (`ControllerSchema`, `FieldSchema`, `TypeSchema`), controller registry types.
-- `crate::rpc::RpcOutcome`: standard RPC result wrapper.
++- `crate::rpc::Outcome`: standard RPC result wrapper.
+ - `serde` / `serde_json`: wire (de)serialization and handler params.
## Used by
diff --cc crates/openhuman-core/src/desktop/notifications/README.md
index 1946c2125d,b2e16b7e4e..db98833556
--- a/crates/openhuman-core/src/desktop/notifications/README.md
+++ b/crates/openhuman-core/src/desktop/notifications/README.md
@@@ -88,10 -88,10 +88,10 @@@ SQLite DB at `{workspace_dir}/notificat
## Dependencies
- `crate::core::bus::BUS` and `crate::core::events::DomainEvent` (`BUS.subscribe` for the bridge, `BUS.publish` for triage results); the `EventHandler` trait comes from `tinybus`.
- - `crate::core::all` (`ControllerFuture`, `RegisteredController`) and `crate::core` (`ControllerSchema`, `FieldSchema`, `TypeSchema`) — controller registry contract.
- - `crate::config` — `Config` (workspace dir for the DB path), `config::rpc::load_config_with_timeout` in handlers, `active_workspace_snapshot` / `workspace_handle` for the workspace gate.
- - `crate::agent::triage` — `run_triage`, `apply_decision`, `TriageOutcome`, `TriggerEnvelope`, `TriggerSource`, `TriageAction` for the background scoring/routing pipeline; `crate::agent::turn_origin::with_origin` scopes the routing turn.
- - `crate::core::Outcome` — RPC response shaping.
+ - `crate::core::all` (`ControllerFuture`, `RegisteredController`) and `crate::core` (`ControllerSchema`, `FieldSchema`, `TypeSchema`), controller registry contract.
+ - `crate::config`: `Config` (workspace dir for the DB path), `config::rpc::load_config_with_timeout` in handlers, `active_workspace_snapshot` / `workspace_handle` for the workspace gate.
+ - `crate::agent::triage`: `run_triage`, `apply_decision`, `TriageOutcome`, `TriggerEnvelope`, `TriggerSource`, `TriageAction` for the background scoring/routing pipeline; `crate::agent::turn_origin::with_origin` scopes the routing turn.
-- `crate::rpc::RpcOutcome`: RPC response shaping.
++- `crate::rpc::Outcome`: RPC response shaping.
- External crates: `rusqlite` (store), `chrono`, `uuid`, `serde_json`, `tokio`, `once_cell`, `async_trait`.
## Used by
diff --cc crates/openhuman-core/src/desktop/provider_surfaces/README.md
index 83a3898b21,a97aa2339d..f3434fa3db
--- a/crates/openhuman-core/src/desktop/provider_surfaces/README.md
+++ b/crates/openhuman-core/src/desktop/provider_surfaces/README.md
@@@ -22,11 -22,11 +22,11 @@@ Local assistive surfaces for third-part
## Public surface
- - `types::ProviderEvent` — inbound normalized provider event (`#[serde(deny_unknown_fields)]`).
- - `types::RespondQueueItem` — queue entry (adds `id` and `status`, default `"pending"`).
- - `types::RespondQueueListResponse` — `{ items, count }`.
- - `ops::ingest_event(ProviderEvent)` / `ops::list_queue(EmptyRequest)` — async handlers returning `Outcome<ApiEnvelope<T>>`.
- - `store::{upsert_queue_item, list_queue_items}` — internal to `ops.rs`; no external caller reads the store directly today.
+ - `types::ProviderEvent`: inbound normalized provider event (`#[serde(deny_unknown_fields)]`).
+ - `types::RespondQueueItem`: queue entry (adds `id` and `status`, default `"pending"`).
+ - `types::RespondQueueListResponse`: `{ items, count }`.
-- `ops::ingest_event(ProviderEvent)` / `ops::list_queue(EmptyRequest)`: async handlers returning `RpcOutcome<ApiEnvelope<T>>`.
++- `ops::ingest_event(ProviderEvent)` / `ops::list_queue(EmptyRequest)`: async handlers returning `Outcome<ApiEnvelope<T>>`.
+ - `store::{upsert_queue_item, list_queue_items}`: internal to `ops.rs`; no external caller reads the store directly today.
- Re-exported from `mod.rs`: `all_provider_surfaces_controller_schemas`, `all_provider_surfaces_registered_controllers`.
## RPC / controllers
@@@ -54,10 -54,10 +54,10 @@@ In-memory only. State lives in a proces
## Dependencies
- - `crate::memory` — `ApiEnvelope`, `ApiMeta`, `EmptyRequest` (response envelope shape + empty-request type).
- - `crate::core::Outcome` — RPC return contract.
- - `crate::core::all` — `RegisteredController`, `ControllerFuture` (controller registry wiring).
- - `crate::core::{ControllerSchema, FieldSchema, TypeSchema}` — controller schema types.
+ - `crate::memory`: `ApiEnvelope`, `ApiMeta`, `EmptyRequest` (response envelope shape + empty-request type).
-- `crate::rpc::RpcOutcome`: RPC return contract.
++- `crate::rpc::Outcome`: RPC return contract.
+ - `crate::core::all`: `RegisteredController`, `ControllerFuture` (controller registry wiring).
+ - `crate::core::{ControllerSchema, FieldSchema, TypeSchema}`: controller schema types.
- External crates: `serde` / `serde_json`, `uuid` (request ids), `tracing` (debug logging with `[provider-surfaces]` prefix).
## Used by
diff --cc crates/openhuman-core/src/http_host/README.md
index ae41e7d9d9,cf0dba81df..eeff580cde
--- a/crates/openhuman-core/src/http_host/README.md
+++ b/crates/openhuman-core/src/http_host/README.md
@@@ -29,9 -29,9 +29,9 @@@ Static directory hosting over ad-hoc, i
## Public surface
- - `all_http_host_controller_schemas()` / `all_http_host_registered_controllers()` — re-exported from `schemas`; wired into the core controller registry.
- - `pub mod ops` — `start_hosted_dir_server`, `list_hosted_dir_servers`, `get_hosted_dir_server`, `stop_hosted_dir_server`, `stop_all_hosted_dir_servers`.
- - `pub mod rpc` — async `start`/`stop`/`get`/`list` returning `Outcome<...>`.
+ - `all_http_host_controller_schemas()` / `all_http_host_registered_controllers()`: re-exported from `schemas`; wired into the core controller registry.
+ - `pub mod ops`: `start_hosted_dir_server`, `list_hosted_dir_servers`, `get_hosted_dir_server`, `stop_hosted_dir_server`, `stop_all_hosted_dir_servers`.
-- `pub mod rpc`: async `start`/`stop`/`get`/`list` returning `RpcOutcome<...>`.
++- `pub mod rpc`: async `start`/`stop`/`get`/`list` returning `Outcome<...>`.
(`auth`, `handlers`, `path_utils`, `types` are private to the module.)
@@@ -52,12 -52,12 +52,12 @@@ None on disk. Running servers are held
## Dependencies
- - `crate::config` — `load_config_with_timeout` to resolve the active config when deriving the default Basic-auth username (`auth.rs`).
- - `crate::security::credentials::session_support` — `build_session_state` to read the active user identity for the default auth username (`auth.rs`).
- - `crate::core::shutdown` — `register` a one-time hook so all hosted servers stop when the core shuts down (`ops.rs`).
- - `crate::core::all` — `ControllerFuture`, `RegisteredController` for controller registration (`schemas.rs`).
- - `crate::core::{ControllerSchema, FieldSchema, TypeSchema}` — controller schema types (`schemas.rs`).
- - `crate::core::Outcome` — RPC response envelope (`rpc.rs`); `crate::rpc` is the `openhuman-rpc` crate re-exported from `crates/openhuman-core/src/lib.rs`.
+ - `crate::config`: `load_config_with_timeout` to resolve the active config when deriving the default Basic-auth username (`auth.rs`).
+ - `crate::security::credentials::session_support`: `build_session_state` to read the active user identity for the default auth username (`auth.rs`).
+ - `crate::core::shutdown`: `register` a one-time hook so all hosted servers stop when the core shuts down (`ops.rs`).
+ - `crate::core::all`: `ControllerFuture`, `RegisteredController` for controller registration (`schemas.rs`).
+ - `crate::core::{ControllerSchema, FieldSchema, TypeSchema}`: controller schema types (`schemas.rs`).
-- `crate::rpc::RpcOutcome`: RPC response envelope (`rpc.rs`); `crate::rpc` is the `openhuman-rpc` crate re-exported from `crates/openhuman-core/src/lib.rs`.
++- `crate::rpc::Outcome`: RPC response envelope (`rpc.rs`); `crate::rpc` is the `openhuman-rpc` crate re-exported from `crates/openhuman-core/src/lib.rs`.
- External crates: `axum` (HTTP server/router), `tokio` (`TcpListener`, tasks), `tokio_util` (`CancellationToken`, `ReaderStream`), `uuid`, `base64`, `rand`, `urlencoding`, `serde`/`serde_json`.
## Used by
diff --cc crates/openhuman-core/src/inference/README.md
index 2fbddd6985,1586485348..16aa3ccf92
--- a/crates/openhuman-core/src/inference/README.md
+++ b/crates/openhuman-core/src/inference/README.md
@@@ -27,7 -27,7 +27,7 @@@ compatibility aliases in `crates/openhu
| File / dir | Role |
| --------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `mod.rs` | Domain root; module decls + re-exports; wires `inference.*` controller schemas/controllers. |
- | `ops.rs` | Canonical handler file — `inference_*` business logic returning `Outcome<T>`; delegates to `local`, `provider`, `sentiment`, `device`, `presets`, `openai_oauth`. Includes Sentry-noise suppression for expected provider/user-config failures. |
-| `ops.rs` | Canonical handler file, `inference_*` business logic returning `RpcOutcome<T>`; delegates to `local`, `provider`, `sentiment`, `device`, `presets`, `openai_oauth`. Includes Sentry-noise suppression for expected provider/user-config failures. |
++| `ops.rs` | Canonical handler file, `inference_*` business logic returning `Outcome<T>`; delegates to `local`, `provider`, `sentiment`, `device`, `presets`, `openai_oauth`. Includes Sentry-noise suppression for expected provider/user-config failures. |
| `schemas.rs` + `schemas/` (`catalog.rs`, `prompt_handlers.rs`, `oauth_handlers.rs`, `claude_code_handlers.rs`, `settings_handlers.rs`) | `inference.*` controller schemas + `handle_*` fns + param DTOs. |
| `tinyinference_llm::{classification,completion,sentiment}` | Reusable language-model parsing and classification called directly by the host. |
| `tinyinference_local::device`; `tinyinference_core::sanitize` | Shared hardware detection and credential-safe diagnostic formatting. |
diff --cc crates/openhuman-core/src/integrations/composio/README.md
index 9cc9293e08,05334a9548..08194f9d6d
--- a/crates/openhuman-core/src/integrations/composio/README.md
+++ b/crates/openhuman-core/src/integrations/composio/README.md
@@@ -164,22 -164,22 +164,22 @@@ Published from `ops/` via `crate::core:
## Dependencies
- - `crate::integrations` — shared `IntegrationClient` (Bearer JWT, timeouts, envelope parsing, proxy) backing backend-mode calls.
- - `crate::config` — `Config` / `ComposioConfig` (`mode`, `entity_id`), `config::rpc` config loading.
- - `crate::modules` — loads the `tinyconnectors` native module that `module_client.rs` calls into (behind the `modules` feature).
- - `tinyconnectors_bus` — the wire contract (member names, payload types) for the `tinyconnectors` module call surface; a plain dependency, not feature-gated.
- - `tinymemory_api::composio` — curated catalogs, scope verdicts, identity vocabulary, and task-fetch types (`providers/mod.rs`, `identity_store.rs`, `profile_md.rs`).
- - `crate::memory::binding` — the workspace's bound memory driver. Connection-scoped cleanup deletes through `MemorySourceSink::forget_matching`; identity facets and user-scope prefs are also read/written through this binding.
- - `crate::memory::sync::composio` — still owns the trigger/config-change bus subscribers (this module re-exports them via `bus.rs`) and the `slack` RPC layer re-exported from `providers/mod.rs`.
- - `crate::agent::harness` — sandbox mode (`current_sandbox_mode` / `SandboxMode`) for tool gating; `current_task_recency_window` consumed by `task_window.rs`.
- - `tinytools` — `Tool`, `ToolResult`, `ToolCategory`, `PermissionLevel`, `ToolCallOptions`.
- - `crate::security` — `SecurityPolicy` / `ToolOperation` for direct-tool gating.
- - `crate::security::credentials` — encrypted store for the direct-mode API key.
- - `crate::agent::prompts`, `agent::prompts` — prompt/profile injection of connected identities.
- - `crate::core::all` — `ControllerFuture` / `RegisteredController` registry types.
- - `crate::core::bus` (`BUS`) / `crate::core::events::DomainEvent` — event publish/subscribe.
- - `crate::core::observability` — Sentry error classification/reporting.
- - `crate::rpc` — `Outcome<T>`.
+ - `crate::integrations`: shared `IntegrationClient` (Bearer JWT, timeouts, envelope parsing, proxy) backing backend-mode calls.
+ - `crate::config`: `Config` / `ComposioConfig` (`mode`, `entity_id`), `config::rpc` config loading.
+ - `crate::modules`: loads the `tinyconnectors` native module that `module_client.rs` calls into (behind the `modules` feature).
+ - `tinyconnectors_bus`: the wire contract (member names, payload types) for the `tinyconnectors` module call surface; a plain dependency, not feature-gated.
+ - `tinymemory_api::composio`: curated catalogs, scope verdicts, identity vocabulary, and task-fetch types (`providers/mod.rs`, `identity_store.rs`, `profile_md.rs`).
+ - `crate::memory::binding`: the workspace's bound memory driver. Connection-scoped cleanup deletes through `MemorySourceSink::forget_matching`; identity facets and user-scope prefs are also read/written through this binding.
+ - `crate::memory::sync::composio`: still owns the trigger/config-change bus subscribers (this module re-exports them via `bus.rs`) and the `slack` RPC layer re-exported from `providers/mod.rs`.
+ - `crate::agent::harness`: sandbox mode (`current_sandbox_mode` / `SandboxMode`) for tool gating; `current_task_recency_window` consumed by `task_window.rs`.
+ - `tinytools`: `Tool`, `ToolResult`, `ToolCategory`, `PermissionLevel`, `ToolCallOptions`.
+ - `crate::security`: `SecurityPolicy` / `ToolOperation` for direct-tool gating.
+ - `crate::security::credentials`: encrypted store for the direct-mode API key.
+ - `crate::agent::prompts`, `agent::prompts`: prompt/profile injection of connected identities.
+ - `crate::core::all`: `ControllerFuture` / `RegisteredController` registry types.
+ - `crate::core::bus` (`BUS`) / `crate::core::events::DomainEvent`: event publish/subscribe.
+ - `crate::core::observability`: Sentry error classification/reporting.
-- `crate::rpc`: `RpcOutcome<T>`.
++- `crate::rpc`: `Outcome<T>`.
## Used by
diff --cc crates/openhuman-core/src/integrations/task_sources/README.md
index 12c5bd8afb,f21201fb45..5f1af24071
--- a/crates/openhuman-core/src/integrations/task_sources/README.md
+++ b/crates/openhuman-core/src/integrations/task_sources/README.md
@@@ -20,15 -20,15 +20,15 @@@ Proactive ingestion of work items from
| `crates/openhuman-core/src/integrations/task_sources/mod.rs` | Export-only: module docstring, `mod`/`pub mod` decls, `pub use` re-exports, and the `all_task_sources_*` controller registry pair. |
| `crates/openhuman-core/src/integrations/task_sources/types.rs` | Serde domain types: `ProviderSlug`, `FilterSpec` (provider-tagged enum), `SourceTarget`, `FetchReason`, `TaskSource`, `TaskSourcePatch`, `EnrichedTask`, `FetchOutcome`. |
| `crates/openhuman-core/src/integrations/task_sources/store.rs` | SQLite persistence (`<workspace>/task_sources/sources.db`): `task_sources` + `ingested_tasks` tables, dedup `content_hash`, migrate-on-open. |
-| `crates/openhuman-core/src/integrations/task_sources/ops.rs` | RPC-facing business logic returning `RpcOutcome<T>`: `list`/`get`/`add`/`update`/`remove`/`fetch`/`sync`/`list_tasks`/`preview_filter`/`list_databases`/`status`. |
+| `crates/openhuman-core/src/integrations/task_sources/ops.rs` | RPC-facing business logic returning `Outcome<T>`: `list`/`get`/`add`/`update`/`remove`/`fetch`/`sync`/`list_tasks`/`preview_filter`/`list_databases`/`status`. |
| `crates/openhuman-core/src/integrations/task_sources/schemas.rs` | `task_sources` controller schemas + `all_controller_schemas` / `all_registered_controllers` + thin `handle_*` param parsers delegating to `ops.rs`. |
- | `crates/openhuman-core/src/integrations/task_sources/pipeline.rs` | `run_source_once` — the infallible fetch → dedup → enrich → route pass shared by poll, manual RPC, and connection hook; publishes domain events. Holds the `fetch_tasks_unavailable` stub and its rationale doc comment. |
- | `crates/openhuman-core/src/integrations/task_sources/filter.rs` | `to_fetch_filter` — flattens a `FilterSpec` variant into the shared `TaskFetchFilter`. |
+ | `crates/openhuman-core/src/integrations/task_sources/pipeline.rs` | `run_source_once`: the infallible fetch → dedup → enrich → route pass shared by poll, manual RPC, and connection hook; publishes domain events. Holds the `fetch_tasks_unavailable` stub and its rationale doc comment. |
+ | `crates/openhuman-core/src/integrations/task_sources/filter.rs` | `to_fetch_filter`: flattens a `FilterSpec` variant into the shared `TaskFetchFilter`. |
| `crates/openhuman-core/src/integrations/task_sources/enrich.rs` | Deterministic, dependency-free `enrich_task`: urgency heuristic, summary, linked assignee, agent prompt. No LLM call. |
- | `crates/openhuman-core/src/integrations/task_sources/route.rs` | `route_enriched` — dispatches a scheduler-gated triage turn for proactive sources; collect-only sources are a no-op past the ledger. |
- | `crates/openhuman-core/src/integrations/task_sources/periodic.rs` | `start_periodic_poll` — global tick scheduler; per-source due-timing in a process-global map; `run_one_tick` is `pub(crate)` for tests. |
- | `crates/openhuman-core/src/integrations/task_sources/bus.rs` | `TaskSourcesConnectionSubscriber` + `register_task_sources_subscriber` — one-shot fetch on `ComposioConnectionCreated`. |
- | `crates/openhuman-core/src/integrations/task_sources/tools.rs` | LLM-callable wrappers over `ops.rs` — see [Agent tools](#agent-tools) below. |
+ | `crates/openhuman-core/src/integrations/task_sources/route.rs` | `route_enriched`: dispatches a scheduler-gated triage turn for proactive sources; collect-only sources are a no-op past the ledger. |
+ | `crates/openhuman-core/src/integrations/task_sources/periodic.rs` | `start_periodic_poll`: global tick scheduler; per-source due-timing in a process-global map; `run_one_tick` is `pub(crate)` for tests. |
+ | `crates/openhuman-core/src/integrations/task_sources/bus.rs` | `TaskSourcesConnectionSubscriber` + `register_task_sources_subscriber`: one-shot fetch on `ComposioConnectionCreated`. |
+ | `crates/openhuman-core/src/integrations/task_sources/tools.rs` | LLM-callable wrappers over `ops.rs`: see [Agent tools](#agent-tools) below. |
| `crates/openhuman-core/src/integrations/task_sources/store_tests.rs` | Sibling test suite for `store.rs`. |
| `crates/openhuman-core/src/integrations/task_sources/pipeline_tests.rs` | Sibling test suite for `pipeline.rs`. |
| `crates/openhuman-core/src/integrations/task_sources/tools_tests.rs` | Sibling test suite for `tools.rs`. |
@@@ -64,8 -64,8 +64,8 @@@ Handlers parse params and delegate to `
## Agent tools
- `tools.rs` wraps `ops.rs` as thin LLM-callable shims — each parses args,
+ `tools.rs` wraps `ops.rs` as thin LLM-callable shims, each parses args,
-calls the matching `ops` function, and emits its `RpcOutcome::value` as JSON.
+calls the matching `ops` function, and emits its `Outcome::value` as JSON.
Read/observe tools are default-enabled; the persistent-config mutators are
default-OFF and must be explicitly allowlisted via `tools/user_filter.rs`
(the `task_source_manage` filter group covers `add`/`update`/`remove`).
diff --cc crates/openhuman-core/src/mcp/audit/README.md
index b71451bcb7,3892d83482..a545d330ef
--- a/crates/openhuman-core/src/mcp/audit/README.md
+++ b/crates/openhuman-core/src/mcp/audit/README.md
@@@ -44,15 -44,15 +44,15 @@@ appears never to have happened, rather
## Dependencies
- - `tinymcp` (`AuditStore`) — the write-audit store, opened per workspace by
+ - `tinymcp` (`AuditStore`): the write-audit store, opened per workspace by
`crate::mcp::host`.
- - `tinymcp_bus` — `McpWriteListQuery`, `McpWriteRecord`, `NewMcpWriteRecord`.
- - `crate::mcp::host` — resolves the per-workspace `AuditStore` via
+ - `tinymcp_bus`: `McpWriteListQuery`, `McpWriteRecord`, `NewMcpWriteRecord`.
+ - `crate::mcp::host`: resolves the per-workspace `AuditStore` via
`for_config`.
- `crate::core::all` (`RegisteredController`, `ControllerFuture`) and
- `crate::core` (`ControllerSchema`, `FieldSchema`, `TypeSchema`) — the
+ `crate::core` (`ControllerSchema`, `FieldSchema`, `TypeSchema`): the
controller registration types. Unlike the other RPC domains the handler
- returns a raw `{ "records": [...] }` object, not an `RpcOutcome`.
+ returns a raw `{ "records": [...] }` object, not an `Outcome`.
## Used by
diff --cc crates/openhuman-core/src/memory/ops/README.md
index b926cac207,4ba34518ba..692b25036a
--- a/crates/openhuman-core/src/memory/ops/README.md
+++ b/crates/openhuman-core/src/memory/ops/README.md
@@@ -1,7 -1,7 +1,7 @@@
# ops
- RPC handlers for the memory system — each returns `Outcome<T>`
- (`crate::core::Outcome`, `openhuman_rpc::Outcome` re-exported through
-RPC handlers for the memory system: each returns `RpcOutcome<T>`
-(`crate::rpc::RpcOutcome`, `openhuman_rpc::RpcOutcome` re-exported through
++RPC handlers for the memory system: each returns `Outcome<T>`
++(`crate::rpc::Outcome`, `openhuman_rpc::Outcome` re-exported through
`pub use openhuman_rpc as rpc;` in `crates/openhuman-core/src/lib.rs`).
`memory::ops` is re-exported flat from `crate::memory::mod` (`pub use
ops::*;`), and `memory::rpc` is an alias of this module (`pub use ops as
diff --cc crates/openhuman-core/src/platform/about_app/README.md
index 3e04893421,37cdada279..3739e70bb2
--- a/crates/openhuman-core/src/platform/about_app/README.md
+++ b/crates/openhuman-core/src/platform/about_app/README.md
@@@ -28,9 -28,9 +28,9 @@@ The single source of truth for the Open
Re-exported from `mod.rs`:
- **Catalog reads** (`catalog`): `all_capabilities()`, `capabilities_by_category(CapabilityCategory)`, `lookup(&str)`, `search(&str)`.
-- **Ops** (`ops`): `list_capabilities(Option<CapabilityCategory>) -> RpcOutcome<Vec<Capability>>`, `lookup_capability(&str) -> Result<RpcOutcome<Capability>, String>`, `search_capabilities(&str) -> RpcOutcome<Vec<Capability>>`.
+- **Ops** (`ops`): `list_capabilities(Option<CapabilityCategory>) -> Outcome<Vec<Capability>>`, `lookup_capability(&str) -> Result<Outcome<Capability>, String>`, `search_capabilities(&str) -> Outcome<Vec<Capability>>`.
- **Schema registry** (`schemas`): `about_app_schemas(&str)`, `all_about_app_controller_schemas()`, `all_about_app_registered_controllers()`.
- - **Types**: `Capability`, `CapabilityCategory`, `CapabilityPrivacy`, `CapabilityStatus`, `PrivacyDataKind`.
+ - Types: `Capability`, `CapabilityCategory`, `CapabilityPrivacy`, `CapabilityStatus`, `PrivacyDataKind`.
## RPC / controllers
@@@ -58,11 -58,11 +58,11 @@@ None. No `store.rs`. The catalog is a c
## Dependencies
- - `crate::core::Outcome` — return-type contract for ops/handlers.
- - `crate::core::all::{ControllerFuture, RegisteredController}` — controller registration types (schemas.rs).
- - `crate::core::{ControllerSchema, FieldSchema, TypeSchema}` — controller schema definitions (schemas.rs).
-- `crate::rpc::RpcOutcome`: return-type contract for ops/handlers.
++- `crate::rpc::Outcome`: return-type contract for ops/handlers.
+ - `crate::core::all::{ControllerFuture, RegisteredController}`: controller registration types (schemas.rs).
+ - `crate::core::{ControllerSchema, FieldSchema, TypeSchema}`: controller schema definitions (schemas.rs).
- No dependencies on other `openhuman` domains — capability metadata for other domains is hand-authored text in `catalog.rs`, not imports.
+ No dependencies on other `openhuman` domains: capability metadata for other domains is hand-authored text in `catalog.rs`, not imports.
## Used by
diff --cc crates/openhuman-core/src/platform/connectivity/README.md
index 8533100d46,625d693d53..7cb7b42a97
--- a/crates/openhuman-core/src/platform/connectivity/README.md
+++ b/crates/openhuman-core/src/platform/connectivity/README.md
@@@ -22,10 -22,10 +22,10 @@@ Diagnostics for the local core's reacha
## Public surface
- - `connectivity::all_connectivity_controller_schemas()` / `all_connectivity_registered_controllers()` — registry entry points (re-exported from `schemas.rs`).
+ - `connectivity::all_connectivity_controller_schemas()` / `all_connectivity_registered_controllers()`: registry entry points (re-exported from `schemas.rs`).
- `connectivity::ops::is_port_in_use(port: u16) -> bool`.
- - `connectivity::rpc::ConnectivityDiagResponse` — serialized diag payload (`socket_state`, `last_ws_error`, `socket_loop_active`, `socket_loop_stopped_on_failure`, `sidecar_pid`, `listen_port`, `listen_port_in_use`). The two booleans are the core's own statement of whether its backend reconnect loop is running and, if not, whether it stopped on a terminal failure (no usable session token); the frontend's connectivity chip keys "no link wanted" vs "down, retrying" vs "stopped, sign in again" off them rather than inferring liveness from `socket_state` (#6256, #6270).
+ - `connectivity::rpc::ConnectivityDiagResponse`: serialized diag payload (`socket_state`, `last_ws_error`, `socket_loop_active`, `socket_loop_stopped_on_failure`, `sidecar_pid`, `listen_port`, `listen_port_in_use`). The two booleans are the core's own statement of whether its backend reconnect loop is running and, if not, whether it stopped on a terminal failure (no usable session token); the frontend's connectivity chip keys "no link wanted" vs "down, retrying" vs "stopped, sign in again" off them rather than inferring liveness from `socket_state` (#6256, #6270).
-- `connectivity::rpc::snapshot() -> ConnectivityDiagResponse` and `connectivity::rpc::diag() -> Result<RpcOutcome<Value>, String>`.
+- `connectivity::rpc::snapshot() -> ConnectivityDiagResponse` and `connectivity::rpc::diag() -> Result<Outcome<Value>, String>`.
- `connectivity::rpc::pick_listen_port(preferred)` / `pick_listen_port_for_host(host, preferred)` → `Result<PickListenPortResult, PickListenPortError>`.
- `connectivity::rpc::PickListenPortResult` (`listener`, `port`, `fallback_from`) and `PickListenPortError` (`WouldTakeOver` / `NoAvailablePort` / `BindFailed`).
@@@ -41,10 -41,10 +41,10 @@@ None: the module holds no state. The di
## Dependencies
- - `crate::platform::socket::manager::global_socket_manager` — read the live backend Socket.IO `ConnectionStatus` and last error for the diag snapshot.
- - `crate::core::all::{ControllerFuture, RegisteredController}` — controller registration types.
- - `crate::core::{ControllerSchema, FieldSchema, TypeSchema}` — controller schema shape.
- - `crate::core::Outcome` — RPC return envelope (`Outcome::single_log`).
+ - `crate::platform::socket::manager::global_socket_manager`: read the live backend Socket.IO `ConnectionStatus` and last error for the diag snapshot.
+ - `crate::core::all::{ControllerFuture, RegisteredController}`: controller registration types.
+ - `crate::core::{ControllerSchema, FieldSchema, TypeSchema}`: controller schema shape.
-- `crate::rpc::RpcOutcome`: RPC return envelope (`RpcOutcome::single_log`).
++- `crate::rpc::Outcome`: RPC return envelope (`Outcome::single_log`).
- External crates: `reqwest` (HTTP fingerprint probe of a listener's `GET /` root), `tokio` (async `TcpListener`, retry backoff), `serde`/`serde_json`, `url`, `tracing`/`log`.
## Used by
diff --cc crates/openhuman-core/src/platform/cost/README.md
index fff708b29a,0abc4defd6..8f246f9a2c
--- a/crates/openhuman-core/src/platform/cost/README.md
+++ b/crates/openhuman-core/src/platform/cost/README.md
@@@ -64,11 -64,11 +64,11 @@@ None. The module has no `bus.rs` and n
## Dependencies
- - `crate::config` — `CostConfig` / `Config` (legacy display target, dashboard currency/enabled, `workspace_dir`); `config::rpc::load_config_with_timeout` in schemas.
- - `crate::inference::provider::types::UsageInfo` (re-exported as `crate::inference::provider::UsageInfo`) — provider usage payload translated into `TokenUsage` in `global.rs`.
- - `crate::core::all` — `ControllerFuture`, `RegisteredController` for controller registration.
- - `crate::core` — `ControllerSchema`, `FieldSchema`, `TypeSchema`.
- - `crate::core::Outcome` — RPC return wrapper.
+ - `crate::config`: `CostConfig` / `Config` (legacy display target, dashboard currency/enabled, `workspace_dir`); `config::rpc::load_config_with_timeout` in schemas.
+ - `crate::inference::provider::types::UsageInfo` (re-exported as `crate::inference::provider::UsageInfo`): provider usage payload translated into `TokenUsage` in `global.rs`.
+ - `crate::core::all`: `ControllerFuture`, `RegisteredController` for controller registration.
+ - `crate::core`: `ControllerSchema`, `FieldSchema`, `TypeSchema`.
-- `crate::rpc::RpcOutcome`: RPC return wrapper.
++- `crate::rpc::Outcome`: RPC return wrapper.
- External: `chrono`, `serde`/`serde_json`, `uuid`, `parking_lot`, `once_cell`, `anyhow`, `tempfile` (tests).
## Used by
diff --cc crates/openhuman-core/src/platform/doctor/README.md
index ef7a5724f2,0a5d617772..a740ec4068
--- a/crates/openhuman-core/src/platform/doctor/README.md
+++ b/crates/openhuman-core/src/platform/doctor/README.md
@@@ -63,14 -63,14 +63,14 @@@ None of its own (no `store.rs`). It onl
## Dependencies
- - `crate::config::{Config, rpc}` — reads the live config for all probes; `config_rpc::load_config_with_timeout` in the handlers.
- - `crate::platform::service::daemon` — `state_file_path` for the daemon heartbeat/component snapshot.
- - `crate::memory::binding` — resolves the workspace's bound memory driver so `ops::memory_chunk_count` can ask `MemoryMaintenance::store_stats` for the chunk count. The engine crate is no longer named here (#5560).
- - `crate::inference::embedding_host::effective_embedding_settings` — resolves the intended embedding provider/model.
- - `crate::inference::{provider, local}` — `provider::list_providers` (model targets) and `local::ollama_base_url` (embedding probe).
- - `crate::api::{config, jwt}` — `effective_api_url` fallback resolution and `get_session_token` for sign-in state.
- - `crate::core::all::{ControllerFuture, RegisteredController}`, `crate::core::{ControllerSchema, FieldSchema, TypeSchema}` — controller/schema plumbing.
- - `crate::core::Outcome` — handler return contract.
+ - `crate::config::{Config, rpc}`: reads the live config for all probes; `config_rpc::load_config_with_timeout` in the handlers.
+ - `crate::platform::service::daemon`: `state_file_path` for the daemon heartbeat/component snapshot.
+ - `crate::memory::binding`: resolves the workspace's bound memory driver so `ops::memory_chunk_count` can ask `MemoryMaintenance::store_stats` for the chunk count. The engine crate is no longer named here (#5560).
+ - `crate::inference::embedding_host::effective_embedding_settings`: resolves the intended embedding provider/model.
+ - `crate::inference::{provider, local}`: `provider::list_providers` (model targets) and `local::ollama_base_url` (embedding probe).
+ - `crate::api::{config, jwt}`: `effective_api_url` fallback resolution and `get_session_token` for sign-in state.
+ - `crate::core::all::{ControllerFuture, RegisteredController}`, `crate::core::{ControllerSchema, FieldSchema, TypeSchema}`: controller/schema plumbing.
-- `crate::rpc::RpcOutcome`: handler return contract.
++- `crate::rpc::Outcome`: handler return contract.
- External: `reqwest` (blocking client + URL parse), `serde`/`serde_json`, `chrono`, `anyhow`.
## Used by
diff --cc crates/openhuman-core/src/platform/health/README.md
index 50d0c8e0ed,06950891ed..b37dea62a6
--- a/crates/openhuman-core/src/platform/health/README.md
+++ b/crates/openhuman-core/src/platform/health/README.md
@@@ -28,10 -28,10 +28,10 @@@ From `core.rs` (re-exported via `pub us
- Types: `ComponentHealth`, `HealthSnapshot`, `HealthVerdict`.
- Functions: `mark_component_ok(component)`, `mark_component_error(component, error)`, `bump_component_restart(component)`, `snapshot() -> HealthSnapshot`, `snapshot_json() -> serde_json::Value`, `verdict(&HealthSnapshot) -> HealthVerdict`, `is_critical_component(name) -> bool`.
- The HTTP `GET /health` handler (`core::jsonrpc::health_handler`) uses `verdict()` for its status code (200 unless a critical component is unhealthy) and adds `healthy` / `degraded` / `critical_unhealthy` / `degraded_components` fields alongside the `components` map in the body. The `components` map shape is unchanged — the new fields are additive.
+ The HTTP `GET /health` handler (`core::jsonrpc::health_handler`) uses `verdict()` for its status code (200 unless a critical component is unhealthy) and adds `healthy` / `degraded` / `critical_unhealthy` / `degraded_components` fields alongside the `components` map in the body. The `components` map shape is unchanged: the new fields are additive.
From `ops.rs` (re-exported via `pub use ops::*`, also aliased `pub use ops as rpc`):
-- `health_snapshot() -> RpcOutcome<serde_json::Value>`, `system_info() -> RpcOutcome<SystemInfo>`, and the `SystemInfo` struct.
+- `health_snapshot() -> Outcome<serde_json::Value>`, `system_info() -> Outcome<SystemInfo>`, and the `SystemInfo` struct.
From `bus.rs`: `HealthSubscriber`, `register_health_subscriber()`.
@@@ -68,9 -68,9 +68,9 @@@ None on disk. State lives in a process-
## Dependencies
- - `crate::core::bus::BUS.subscribe` (`crate::core::events::DomainEvent`, `tinybus::SubscriptionHandle`) — to receive system/channel events.
- - `crate::core::all` (`ControllerFuture`, `RegisteredController`) and `crate::core::{ControllerSchema, FieldSchema, TypeSchema}` — controller registry wiring.
- - `crate::core::Outcome` — RPC handler return contract.
+ - `crate::core::bus::BUS.subscribe` (`crate::core::events::DomainEvent`, `tinybus::SubscriptionHandle`): to receive system/channel events.
+ - `crate::core::all` (`ControllerFuture`, `RegisteredController`) and `crate::core::{ControllerSchema, FieldSchema, TypeSchema}`: controller registry wiring.
-- `crate::rpc::RpcOutcome`: RPC handler return contract.
++- `crate::rpc::Outcome`: RPC handler return contract.
- External crates: `chrono` (RFC3339 timestamps), `parking_lot::Mutex`, `serde`/`serde_json`, `async_trait`.
## Used by
diff --cc crates/openhuman-core/src/platform/service/README.md
index 5fc0c1394d,b21e1a086d..fa5520b292
--- a/crates/openhuman-core/src/platform/service/README.md
+++ b/crates/openhuman-core/src/platform/service/README.md
@@@ -85,10 -85,10 +85,10 @@@ Both subscribers are registered idempot
## Dependencies
- - `crate::config` — `Config` (paths, config dir) for every lifecycle/path operation; `config::rpc::load_config_with_timeout` in the schema handlers.
- - `crate::core::bus::BUS` (`tinybus::OnceBus<DomainEvent>`) — `publish` / `subscribe` for restart/shutdown orchestration; `crate::core::events::DomainEvent` for the event catalog.
- - `crate::core` (`ControllerSchema`, `FieldSchema`, `TypeSchema`) and `crate::core::all` (`ControllerFuture`, `RegisteredController`) — controller schema/registration contract.
- - `crate::core::Outcome` — standard RPC result envelope.
+ - `crate::config`: `Config` (paths, config dir) for every lifecycle/path operation; `config::rpc::load_config_with_timeout` in the schema handlers.
+ - `crate::core::bus::BUS` (`tinybus::OnceBus<DomainEvent>`): `publish` / `subscribe` for restart/shutdown orchestration; `crate::core::events::DomainEvent` for the event catalog.
+ - `crate::core` (`ControllerSchema`, `FieldSchema`, `TypeSchema`) and `crate::core::all` (`ControllerFuture`, `RegisteredController`): controller schema/registration contract.
-- `crate::rpc::RpcOutcome`: standard RPC result envelope.
++- `crate::rpc::Outcome`: standard RPC result envelope.
- External: `anyhow`, `serde`/`serde_json`, `tokio`, `async_trait`, plus OS CLIs (`launchctl`, `systemctl`, `schtasks`).
## Used by
diff --cc crates/openhuman-core/src/platform/update/README.md
index 432b7ede7d,65c48fd185..868153502c
--- a/crates/openhuman-core/src/platform/update/README.md
+++ b/crates/openhuman-core/src/platform/update/README.md
@@@ -25,8 -25,8 +25,8 @@@ Self-update domain for the `openhuman-c
## Public surface
- Types (`types.rs`): `UpdateInfo`, `VersionInfo`, `UpdateRunResult`, `UpdateApplyResult`, `GitHubRelease`, `GitHubAsset`.
- Core fns (`core.rs`, re-exported via `core::*`): `current_version() -> &'static str`, `platform_triple() -> &'static str`, `check_available() -> Result<UpdateInfo, String>`, `download_and_stage(...)`, `download_and_stage_with_version(...)`.
- - `update::rpc` (alias of `ops`): `update_version`, `update_check`, `update_apply`, `update_run` — all returning `Outcome<Value>`.
- - `update::scheduler::run(UpdateConfig)` — background loop entry point.
-- `update::rpc` (alias of `ops`): `update_version`, `update_check`, `update_apply`, `update_run`: all returning `RpcOutcome<Value>`.
++- `update::rpc` (alias of `ops`): `update_version`, `update_check`, `update_apply`, `update_run`: all returning `Outcome<Value>`.
+ - `update::scheduler::run(UpdateConfig)`: background loop entry point.
- `all_update_controller_schemas()` / `all_update_registered_controllers()`.
## RPC / controllers
@@@ -51,17 -51,17 +51,17 @@@ No `bus.rs`. The scheduler *publishes*
It also calls `crate::core::bus::init()` (idempotent against an already-initialised bus) and `health::bus::register_health_subscriber()` on start.
## Persistence
- None. No `store.rs` — staged binaries are written to the filesystem (current-exe dir by default), but the domain holds no persisted state of its own. Configuration is read from `config.update`.
+ None. No `store.rs`: staged binaries are written to the filesystem (current-exe dir by default), but the domain holds no persisted state of its own. Configuration is read from `config.update`.
## Dependencies
- - `crate::config` — reads `UpdateConfig` (`enabled`, `interval_minutes`, `rpc_mutations_enabled`, `restart_strategy`) and `UpdateRestartStrategy`; `ops` loads it via `config::rpc::load_config_with_timeout`.
- - `crate::platform::service` — `service::rpc::service_restart` to publish the self-restart for `SelfReplace`.
- - `crate::platform::health` — `health::bus::register_health_subscriber` in the scheduler.
- - `crate::util` — `utf8_safe_prefix_at_byte_boundary` for safe error-body truncation.
- - `crate::core::bus` — `BUS.publish`, `crate::core::events::DomainEvent`, and `bus::init()` to bring up the in-process broker.
- - `crate::core::observability` — Sentry reporting + transient-failure classifiers (`report_error`, `is_updater_transient_message`, `is_updater_transient_http_status`).
- - `crate::core::all` — `ControllerFuture`, `RegisteredController` (schemas wiring); `crate::core::{ControllerSchema, FieldSchema, TypeSchema}`.
- - `crate::core::Outcome` — RPC return contract.
+ - `crate::config`: reads `UpdateConfig` (`enabled`, `interval_minutes`, `rpc_mutations_enabled`, `restart_strategy`) and `UpdateRestartStrategy`; `ops` loads it via `config::rpc::load_config_with_timeout`.
+ - `crate::platform::service`: `service::rpc::service_restart` to publish the self-restart for `SelfReplace`.
+ - `crate::platform::health`: `health::bus::register_health_subscriber` in the scheduler.
+ - `crate::util`: `utf8_safe_prefix_at_byte_boundary` for safe error-body truncation.
+ - `crate::core::bus`: `BUS.publish`, `crate::core::events::DomainEvent`, and `bus::init()` to bring up the in-process broker.
+ - `crate::core::observability`: Sentry reporting + transient-failure classifiers (`report_error`, `is_updater_transient_message`, `is_updater_transient_http_status`).
+ - `crate::core::all`: `ControllerFuture`, `RegisteredController` (schemas wiring); `crate::core::{ControllerSchema, FieldSchema, TypeSchema}`.
-- `crate::rpc::RpcOutcome`: RPC return contract.
++- `crate::rpc::Outcome`: RPC return contract.
- External crates: `reqwest` (HTTP), `url` (URL validation), `serde`/`serde_json`, `tokio`.
## Used by
diff --cc crates/openhuman-core/src/security/README.md
index 8d55d8a91c,b24e4b085f..f9772ee97d
--- a/crates/openhuman-core/src/security/README.md
+++ b/crates/openhuman-core/src/security/README.md
@@@ -60,18 -61,18 +61,18 @@@ AppContainer backend. The two domains a
see [pii/README.md](pii/README.md).
- `pub struct AuditLogger` / `pub enum AuditEventType` / `pub struct AuditEvent`
/ `pub struct Actor` / `pub struct Action` / `pub struct ExecutionResult` /
- `pub struct SecurityContext` / `pub struct CommandExecutionLog` — `audit.rs`
- — append-only audit trail.
+ `pub struct SecurityContext` / `pub struct CommandExecutionLog`, defined in
+ `audit.rs`: the append-only audit trail.
- `pub fn is_public_bind` / `pub fn ensure_core_rpc_token_for_bind` /
- `CORE_TOKEN_ENV_VAR` / `CoreBindTokenError` — `pairing.rs` — refuse a
- non-loopback RPC bind without a core token. `PairingGuard`,
+ `CORE_TOKEN_ENV_VAR` / `CoreBindTokenError`, defined in `pairing.rs`, refuse
+ a non-loopback RPC bind without a core token. `PairingGuard`,
`constant_time_eq`, and the token helpers are re-exported from
`tinychannels_bus::security`.
- - `pub fn redact(value: &str) -> String` — `core.rs` — uniform 4-char-prefix
- redaction for logs.
- - `pub use ops as rpc` — `ops.rs`'s `security_policy_info_for_config(&Config)`
+ - `pub fn redact(value: &str) -> String`, defined in `core.rs`: uniform
+ 4-char-prefix redaction for logs.
+ - `pub use ops as rpc`: `ops.rs`'s `security_policy_info_for_config(&Config)`
and `load_and_get_security_policy_info()` return
- `RpcOutcome<serde_json::Value>` and back the `security.policy_info` RPC
+ `Outcome<serde_json::Value>` and back the `security.policy_info` RPC
function; `tools.rs` exposes the same read to the agent.
## The policy is off by default
diff --cc crates/openhuman-core/src/security/approval/README.md
index 3745c50e0a,815f7ac0cd..3f8fb6b2d9
--- a/crates/openhuman-core/src/security/approval/README.md
+++ b/crates/openhuman-core/src/security/approval/README.md
@@@ -74,12 -74,12 +74,12 @@@ SQLite DB at `{workspace_dir}/approval/
## Dependencies
- `crate::core::bus::BUS` + `crate::core::events::DomainEvent` to surface approval prompts/decisions.
- - `crate::core::all` — `ControllerFuture` / `RegisteredController` for the controller registry.
- - `crate::core` (`ControllerSchema`, `FieldSchema`, `TypeSchema`) — schema definitions.
- - `crate::core::Outcome` — RPC return contract.
- - `crate::config::Config` — workspace dir (DB path) + the boot-time `autonomy.auto_approve` snapshot; `config::ops::add_auto_approve_tool` to persist "Always allow".
- - `crate::security` — `live_policy::current()` for the live "Always allow" list and `POLICY_DENIED_MARKER` for deny reasons.
- - `tinymemory_core::store::safety::sanitize_text` — scrub secrets out of stored execution-error strings.
+ - `crate::core::all`: `ControllerFuture` / `RegisteredController` for the controller registry.
+ - `crate::core` (`ControllerSchema`, `FieldSchema`, `TypeSchema`): schema definitions.
-- `crate::rpc::RpcOutcome`: RPC return contract.
++- `crate::rpc::Outcome`: RPC return contract.
+ - `crate::config::Config`: workspace dir (DB path) plus the boot-time `autonomy.auto_approve` snapshot; `config::ops::add_auto_approve_tool` persists "Always allow".
+ - `crate::security`: `live_policy::current()` for the live "Always allow" list and `POLICY_DENIED_MARKER` for deny reasons.
+ - `tinymemory_core::store::safety::sanitize_text`: scrub secrets out of stored execution-error strings.
## Used by
diff --cc crates/openhuman-core/src/security/credentials/README.md
index 4e5b517fde,da8cec5727..47d96d0797
--- a/crates/openhuman-core/src/security/credentials/README.md
+++ b/crates/openhuman-core/src/security/credentials/README.md
@@@ -21,10 -21,10 +21,10 @@@ Credential management for the backend c
| File | Role |
| --- | --- |
| `mod.rs` | Export-focused. Re-exports `core::*`, `ops` (also as `rpc`), Composio-direct helpers, schema controllers (`all_credentials_controller_schemas` / `all_credentials_registered_controllers`), and backend OAuth REST types from `crate::api::rest`. |
- | `core.rs` | `AuthService` facade over `AuthProfilesStore` — store/get/remove/set-active profiles, resolve bearer token, profile-id selection logic (override → active → default → any-for-provider), provider normalization, state-dir derivation. |
- | `profiles.rs` | The persistence engine. `AuthProfile` / `TokenSet` / `AuthProfileKind` / `AuthProfilesData` types and `AuthProfilesStore` — atomic JSON read/write, keychain vs encrypted-JSON secret handling, legacy migration, corrupt-store quarantine, PID-aware stale-lock recovery. |
+ | `core.rs` | `AuthService` facade over `AuthProfilesStore`: store/get/remove/set-active profiles, resolve bearer token, profile-id selection logic (override, then active, then default, then any-for-provider), provider normalization, state-dir derivation. |
+ | `profiles.rs` | The persistence engine. `AuthProfile` / `TokenSet` / `AuthProfileKind` / `AuthProfilesData` types and `AuthProfilesStore`: atomic JSON read/write, keychain vs encrypted-JSON secret handling, legacy migration, corrupt-store quarantine, PID-aware stale-lock recovery. |
| `api_key.rs` | The `api-key` profile: `store_api_key[_in]`, `get_api_key[_in]`, `has_api_key[_in]`, `clear_api_key`. |
-| `ops.rs` + `ops/` | Business logic + RPC entry points (returns `RpcOutcome<T>`). `ops/credential.rs` (`set_credential` / `clear_credential`, plus the historical `store_session` / `clear_session` names), `ops/user_scope.rs` (user-dir activation and process-global rebinding), `ops/gated_services.rs` (credential-gated services), `ops/boot_env.rs` (env seeding), `ops/session_query.rs` (`auth_get_state`, `auth_get_session_token_json`), `ops/login_tokens.rs` (channel link tokens), `ops/oauth.rs`, `ops/provider_credentials.rs`, `ops/composio.rs`, `ops/secrets.rs`. Re-exported as `rpc`. |
+| `ops.rs` + `ops/` | Business logic + RPC entry points (returns `Outcome<T>`). `ops/credential.rs` (`set_credential` / `clear_credential`, plus the historical `store_session` / `clear_session` names), `ops/user_scope.rs` (user-dir activation and process-global rebinding), `ops/gated_services.rs` (credential-gated services), `ops/boot_env.rs` (env seeding), `ops/session_query.rs` (`auth_get_state`, `auth_get_session_token_json`), `ops/login_tokens.rs` (channel link tokens), `ops/oauth.rs`, `ops/provider_credentials.rs`, `ops/composio.rs`, `ops/secrets.rs`. Re-exported as `rpc`. |
| `schemas.rs` | `auth.*` controller schemas + `handle_*` dispatchers delegating to `ops`. Defines `all_controller_schemas` / `all_registered_controllers`. |
| `session_support.rs` | `CredentialKind`, `BackendCredential`, `resolve_backend_credential`, `require_live_session_token`, `has_backend_credential`, `build_session_state`, `get_session_token`, `load_app_session_profile`, `user_id_from_jwt_claims`, local-session detection/slug, field parsing. Shared by RPC and the HTTP host. |
| `identity.rs` | The signed-in user's identity slot (`peek_credential_user_identity`), seeded from the host-supplied payload for prompts and Sentry. |
@@@ -88,14 -88,14 +88,14 @@@ Note: `list_provider_credentials_by_pre
## Dependencies
- - `crate::config` — `Config`, config load (`load_config_with_timeout`), user-dir activation (`default_root_openhuman_dir`, `user_openhuman_dir`, `read/write/clear_active_user`, `pre_login_user_dir`), onboarding state.
- - `crate::security::keyring` — `SecretStore` (encrypt/decrypt) and OS keychain `get`/`set`/`delete`/`is_available`.
- - `crate::cron::scheduler_gate` — signed-out override flipped on install/removal/expiry.
- - `crate::memory::conversations` — purge pre-login threads, bind conversation persistence after activation.
- - `crate::memory` — bind memory client to the active workspace after activation.
- - `crate::inference::host_runtime`, `crate::voice::{server,dictation_listener,always_on}` — credential-gated services started/stopped.
- - `crate::api::config`, `::jwt`, `::rest` — backend API URL, JWT `exp` decode, `BackendOAuthClient` + OAuth/handoff types.
- - `crate::core::all` (`ControllerFuture`, `RegisteredController`), `crate::core` (`ControllerSchema`/`FieldSchema`/`TypeSchema`), `crate::core::events::DomainEvent` + `tinybus::EventHandler`, `crate::core::Outcome` — controller registry + RPC envelope + event bus.
+ - `crate::config`: `Config`, config load (`load_config_with_timeout`), user-dir activation (`default_root_openhuman_dir`, `user_openhuman_dir`, `read/write/clear_active_user`, `pre_login_user_dir`), onboarding state.
+ - `crate::security::keyring`: `SecretStore` (encrypt/decrypt) and OS keychain `get`/`set`/`delete`/`is_available`.
+ - `crate::cron::scheduler_gate`: signed-out override flipped on install/removal/expiry.
+ - `crate::memory::conversations`: purge pre-login threads, bind conversation persistence after activation.
+ - `crate::memory`: bind memory client to the active workspace after activation.
+ - `crate::inference::host_runtime`, `crate::voice::{server,dictation_listener,always_on}`: credential-gated services started/stopped.
+ - `crate::api::config`, `::jwt`, `::rest`: backend API URL, JWT `exp` decode, `BackendOAuthClient` plus OAuth/handoff types.
-- `crate::core::all` (`ControllerFuture`, `RegisteredController`), `crate::core` (`ControllerSchema`/`FieldSchema`/`TypeSchema`), `crate::core::events::DomainEvent` plus `tinybus::EventHandler`, `crate::rpc::RpcOutcome`: controller registry, RPC envelope, and event bus.
++- `crate::core::all` (`ControllerFuture`, `RegisteredController`), `crate::core` (`ControllerSchema`/`FieldSchema`/`TypeSchema`), `crate::core::events::DomainEvent` plus `tinybus::EventHandler`, `crate::rpc::Outcome`: controller registry, RPC envelope, and event bus.
## Used by
diff --cc crates/openhuman-core/src/security/devices/README.md
index 143441daba,e1dce26bf0..ca3fa33faf
--- a/crates/openhuman-core/src/security/devices/README.md
+++ b/crates/openhuman-core/src/security/devices/README.md
@@@ -85,12 -85,12 +85,12 @@@ Separately, encrypted X25519 private ke
## Dependencies
- - `crate::config` (`Config`, `config::rpc::load_config_with_timeout`) — workspace paths and config loading for handlers.
- - `crate::security::keyring::SecretStore` — encrypt/decrypt the X25519 private key at rest.
- - `crate::platform::socket::global_socket_manager` — reuse the shared backend Socket.IO connection to emit `tunnel:*` events (no second WebSocket).
- - `crate::core::bus::BUS` (`.publish`, `.subscribe`) + `crate::core::events::DomainEvent` + `tinybus::EventHandler` — pub/sub for device tunnel events.
- - `crate::core::all` (`ControllerFuture`, `RegisteredController`) and `crate::core::{ControllerSchema, FieldSchema, TypeSchema}` — controller registry contract.
- - `crate::core::Outcome` — RPC handler return type.
+ - `crate::config` (`Config`, `config::rpc::load_config_with_timeout`): workspace paths and config loading for handlers.
+ - `crate::security::keyring::SecretStore`: encrypt/decrypt the X25519 private key at rest.
+ - `crate::platform::socket::global_socket_manager`: reuse the shared backend Socket.IO connection to emit `tunnel:*` events (no second WebSocket).
+ - `crate::core::bus::BUS` (`.publish`, `.subscribe`) plus `crate::core::events::DomainEvent` and `tinybus::EventHandler`: pub/sub for device tunnel events.
+ - `crate::core::all` (`ControllerFuture`, `RegisteredController`) and `crate::core::{ControllerSchema, FieldSchema, TypeSchema}`: controller registry contract.
-- `crate::rpc::RpcOutcome`: RPC handler return type.
++- `crate::rpc::Outcome`: RPC handler return type.
- External crates: `rusqlite`, `chacha20poly1305`, `x25519-dalek`, `base64`, `sha2`, `chrono`, `once_cell`, `tokio`, `async_trait`, `anyhow`.
## Used by
diff --cc crates/openhuman-core/src/security/encryption/README.md
index 4b1cc4d6d4,e2b95360a5..4db37e500f
--- a/crates/openhuman-core/src/security/encryption/README.md
+++ b/crates/openhuman-core/src/security/encryption/README.md
@@@ -4,13 -4,13 +4,13 @@@ AES-256-GCM at-rest crypto for AI memor
## Public surface
- - `pub struct EncryptedPayload` — `core.rs:18-26` — `{ ciphertext, nonce, salt }` triple persisted to disk.
- - `pub struct EncryptionKey` — `core.rs:29-32` — `[u8; 32]` AES-256 key wrapper.
- - `impl EncryptionKey::derive(password: &str, salt: &[u8]) -> Result<Self, String>` — `core.rs:35` — Argon2id with parameters `m=65536, t=3, p=1`.
- - `pub fn get_data_dir() -> Result<PathBuf, String>` — `core.rs` — resolve the encrypted-data directory under the openhuman workspace.
- - `pub async fn encrypt_secret(config: &Config, plaintext: &str) -> Result<Outcome<String>, String>` — `ops.rs:6` — RPC handler, delegates to `credentials::rpc::encrypt_secret`.
- - `pub async fn decrypt_secret(config: &Config, ciphertext: &str) -> Result<Outcome<String>, String>` — `ops.rs:13` — RPC handler, delegates to `credentials::rpc::decrypt_secret`.
- - RPC `encryption.{encrypt_secret, decrypt_secret}` — `schemas.rs` (re-exported via `all_encryption_controller_schemas` / `all_encryption_registered_controllers`).
+ - `pub struct EncryptedPayload` (`core.rs:18-26`): `{ ciphertext, nonce, salt }` triple persisted to disk.
+ - `pub struct EncryptionKey` (`core.rs:29-32`): `[u8; 32]` AES-256 key wrapper.
+ - `impl EncryptionKey::derive(password: &str, salt: &[u8]) -> Result<Self, String>` (`core.rs:35`): Argon2id with parameters `m=65536, t=3, p=1`.
+ - `pub fn get_data_dir() -> Result<PathBuf, String>` (`core.rs`): resolve the encrypted-data directory under the openhuman workspace.
-- `pub async fn encrypt_secret(config: &Config, plaintext: &str) -> Result<RpcOutcome<String>, String>` (`ops.rs:6`): RPC handler, delegates to `credentials::rpc::encrypt_secret`.
-- `pub async fn decrypt_secret(config: &Config, ciphertext: &str) -> Result<RpcOutcome<String>, String>` (`ops.rs:13`): RPC handler, delegates to `credentials::rpc::decrypt_secret`.
++- `pub async fn encrypt_secret(config: &Config, plaintext: &str) -> Result<Outcome<String>, String>` (`ops.rs:6`): RPC handler, delegates to `credentials::rpc::encrypt_secret`.
++- `pub async fn decrypt_secret(config: &Config, ciphertext: &str) -> Result<Outcome<String>, String>` (`ops.rs:13`): RPC handler, delegates to `credentials::rpc::decrypt_secret`.
+ - RPC `encryption.{encrypt_secret, decrypt_secret}`, defined in `schemas.rs` (re-exported via `all_encryption_controller_schemas` / `all_encryption_registered_controllers`).
- Constants: `SALT_LENGTH = 16`, `NONCE_LENGTH = 12`, `KEY_LENGTH = 32` (private but stable parameters).
## Calls into
diff --cc crates/openhuman-core/src/skills/webhooks/README.md
index 3b83287065,51585e0419..56a462a5b9
--- a/crates/openhuman-core/src/skills/webhooks/README.md
+++ b/crates/openhuman-core/src/skills/webhooks/README.md
@@@ -19,10 -19,10 +19,10 @@@ Client-side webhook tunnel routing for
| --- | --- |
| `crates/openhuman-core/src/skills/webhooks/mod.rs` | Export-only: module docstring, `pub mod` decls, re-exports of `WebhookRouter`, types, and the `all_webhooks_*` controller pair. |
| `crates/openhuman-core/src/skills/webhooks/types.rs` | Serde domain types: `WebhookRequest`, `WebhookResponseData`, `TunnelRegistration`, `WebhookActivityEntry`, `WebhookDebugLogEntry`, debug result wrappers, `WebhookDebugEvent`. |
- | `crates/openhuman-core/src/skills/webhooks/router.rs` | `WebhookRouter` — route map + ownership rules, disk persistence (generation-counter, spawn_blocking offload), bounded debug log ring (`MAX_DEBUG_LOG_ENTRIES = 250`), debug-event broadcast channel. |
+ | `crates/openhuman-core/src/skills/webhooks/router.rs` | `WebhookRouter`: route map + ownership rules, disk persistence (generation-counter, spawn_blocking offload), bounded debug log ring (`MAX_DEBUG_LOG_ENTRIES = 250`), debug-event broadcast channel. |
-| `crates/openhuman-core/src/skills/webhooks/ops.rs` | RPC handler logic returning `RpcOutcome<T>`: local routing ops (`list_registrations`, `list_logs`, `clear_logs`, `register_echo`, `unregister_echo`, `register_agent`, `trigger_agent`), `build_echo_response`, and backend-proxied tunnel CRUD (`list/create/get/update/delete_tunnel`, `get_bandwidth`). |
+| `crates/openhuman-core/src/skills/webhooks/ops.rs` | RPC handler logic returning `Outcome<T>`: local routing ops (`list_registrations`, `list_logs`, `clear_logs`, `register_echo`, `unregister_echo`, `register_agent`, `trigger_agent`), `build_echo_response`, and backend-proxied tunnel CRUD (`list/create/get/update/delete_tunnel`, `get_bandwidth`). |
| `crates/openhuman-core/src/skills/webhooks/schemas.rs` | Controller schemas + `handle_*` fns + `all_controller_schemas` / `all_registered_controllers`; deserializes params, delegates to `ops.rs`. |
- | `crates/openhuman-core/src/skills/webhooks/bus.rs` | `WebhookRequestSubscriber` (`EventHandler`) — the incoming-request routing flow; helpers `decode_webhook_body`, `run_agent_trigger`, `build_agent_response`. |
+ | `crates/openhuman-core/src/skills/webhooks/bus.rs` | `WebhookRequestSubscriber` (`EventHandler`): the incoming-request routing flow; helpers `decode_webhook_body`, `run_agent_trigger`, `build_agent_response`. |
| `crates/openhuman-core/src/skills/webhooks/{webhooks_tests,bus_tests,ops_tests,router_tests,schemas_tests,types_tests}.rs` | Test suites, each pulled into its sibling source file via `#[cfg(test)] #[path = "..."] mod tests;` (no inline test modules). |
## Public surface
@@@ -80,15 -80,15 +80,15 @@@ Note that nothing in the production sta
## Dependencies
- - `crate::core::bus::BUS` and `crate::core::events::DomainEvent` — publishing and subscribing; the `EventHandler` trait comes from `tinybus`.
- - `crate::core::all` — `ControllerFuture`, `RegisteredController` for controller registration.
- - `crate::core::{ControllerSchema, FieldSchema, TypeSchema}` — RPC schema types.
- - `crate::core::observability::report_error` — error reporting for body-decode / agent-trigger failures.
- - `crate::platform::socket::global_socket_manager` — obtain the `WebhookRouter` (stored on the socket manager) and `emit` responses over the socket.
- - `crate::agent::triage` — `TriggerEnvelope`, `run_triage`, `apply_decision`, `TriageOutcome` for agent-tunnel routing and `trigger_agent`.
- - `crate::config::{Config, rpc::load_config_with_timeout}` — config for backend-proxy RPCs.
- - `crate::api::{BackendOAuthClient, config::effective_backend_api_url, jwt::get_session_token}` — authenticated backend tunnel CRUD/bandwidth calls.
- - `crate::core::Outcome` — handler return contract.
+ - `crate::core::bus::BUS` and `crate::core::events::DomainEvent`: publishing and subscribing; the `EventHandler` trait comes from `tinybus`.
+ - `crate::core::all`: `ControllerFuture`, `RegisteredController` for controller registration.
+ - `crate::core::{ControllerSchema, FieldSchema, TypeSchema}`: RPC schema types.
+ - `crate::core::observability::report_error`: error reporting for body-decode / agent-trigger failures.
+ - `crate::platform::socket::global_socket_manager`: obtain the `WebhookRouter` (stored on the socket manager) and `emit` responses over the socket.
+ - `crate::agent::triage`: `TriggerEnvelope`, `run_triage`, `apply_decision`, `TriageOutcome` for agent-tunnel routing and `trigger_agent`.
+ - `crate::config::{Config, rpc::load_config_with_timeout}`: config for backend-proxy RPCs.
+ - `crate::api::{BackendOAuthClient, config::effective_backend_api_url, jwt::get_session_token}`: authenticated backend tunnel CRUD/bandwidth calls.
-- `crate::rpc::RpcOutcome`: handler return contract.
++- `crate::rpc::Outcome`: handler return contract.
## Used by
diff --cc crates/openhuman-core/src/test_support/README.md
index 04c332997a,a6e59afcb8..c0118a2da2
--- a/crates/openhuman-core/src/test_support/README.md
+++ b/crates/openhuman-core/src/test_support/README.md
@@@ -24,11 -24,11 +24,11 @@@ Test-support domain: wipe-and-reset plu
## Public surface
From `mod.rs`:
- - `all_test_support_controller_schemas()` — `Vec<ControllerSchema>` for the six controllers.
- - `all_test_support_registered_controllers()` — `Vec<RegisteredController>` (schema + handler pairs).
+ - `all_test_support_controller_schemas()`: `Vec<ControllerSchema>` for the six controllers.
+ - `all_test_support_registered_controllers()`: `Vec<RegisteredController>` (schema + handler pairs).
From `rpc` / `introspect` (used by handlers, also `pub`):
-- `rpc::reset() -> RpcOutcome<ResetSummary>`, `rpc::reset_json()` (raw JSON envelope convenience; currently `#[allow(dead_code)]`, no caller).
+- `rpc::reset() -> Outcome<ResetSummary>`, `rpc::reset_json()` (raw JSON envelope convenience; currently `#[allow(dead_code)]`, no caller).
- `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`.
@@@ -55,14 -55,14 +55,14 @@@ This module owns no state of its own. I
## Dependencies
- - `crate::config` — `Config::load_or_init`/`save`, `workspace_dir`, `clear_active_user`, `default_root_openhuman_dir`; config is the source of truth for the workspace root and the fields reset wipes.
- - `crate::cron` — `clear_all_jobs` to wipe scheduled jobs during reset.
- - `crate::memory::read_rpc` — `wipe_all_rpc` to clear memory-tree rows, content dirs, and sync state.
- - `crate::web_chat` — `in_flight_entries_for_test` to snapshot the live `IN_FLIGHT` chat map.
- - `crate::web3::wallet` — `prepared_quotes_for_test` and `PreparedTransaction` to snapshot prepared quotes.
- - `crate::core::all` — `ControllerFuture`, `RegisteredController` for handler wiring.
- - `crate::core::{ControllerSchema, FieldSchema, TypeSchema}` — controller schema types.
- - `crate::core::Outcome` — standard RPC result envelope; `crate::rpc` is the `openhuman-rpc` crate re-exported by `pub use openhuman_rpc as rpc;` in `crates/openhuman-core/src/lib.rs`.
+ - `crate::config`: `Config::load_or_init`/`save`, `workspace_dir`, `clear_active_user`, `default_root_openhuman_dir`; config is the source of truth for the workspace root and the fields reset wipes.
+ - `crate::cron`: `clear_all_jobs` to wipe scheduled jobs during reset.
+ - `crate::memory::read_rpc`: `wipe_all_rpc` to clear memory-tree rows, content dirs, and sync state.
+ - `crate::web_chat`: `in_flight_entries_for_test` to snapshot the live `IN_FLIGHT` chat map.
+ - `crate::web3::wallet`: `prepared_quotes_for_test` and `PreparedTransaction` to snapshot prepared quotes.
+ - `crate::core::all`: `ControllerFuture`, `RegisteredController` for handler wiring.
+ - `crate::core::{ControllerSchema, FieldSchema, TypeSchema}`: controller schema types.
-- `crate::rpc::RpcOutcome`: standard RPC result envelope; `crate::rpc` is the `openhuman-rpc` crate re-exported by `pub use openhuman_rpc as rpc;` in `crates/openhuman-core/src/lib.rs`.
++- `crate::rpc::Outcome`: standard RPC result envelope; `crate::rpc` is the `openhuman-rpc` crate re-exported by `pub use openhuman_rpc as rpc;` in `crates/openhuman-core/src/lib.rs`.
## Used by
diff --cc crates/openhuman-core/src/tools/registry/README.md
index 032a9a1e5d,7fc8c322c4..304d672f8e
--- a/crates/openhuman-core/src/tools/registry/README.md
+++ b/crates/openhuman-core/src/tools/registry/README.md
@@@ -49,13 -49,13 +49,13 @@@ No owned persistence. `diagnostics()` r
## Dependencies
- - `crate::core::all` — `rpc_method_name()` for controller route metadata and `all_controller_schemas()` for the `security.` / `approval.` policy-surface scan. Registry *entries* for controllers come from `crate::tools::all_tools_controller_schemas()`, not the whole controller set.
- - `crate::core::{ControllerSchema, FieldSchema, TypeSchema}` and `core::all::{ControllerFuture, RegisteredController}` — schema model and controller registration contract.
- - `crate::config` (`Config`, `config::schema::CapabilityProviderTrustState`) — autonomy posture, MCP client allowlists, capability-provider config.
- - `crate::mcp::server` (`McpToolSpec`, `tool_specs()`) — MCP stdio tool source for registry entries.
- - `crate::mcp::registry::connections` (`all_connected_tools()` / `all_connected_tools_for_config()`, defined inside `mcp/registry/mod.rs`; empty-returning stubs in `mcp/registry/stub.rs` when the `mcp` feature is disabled) — live MCP client server tools, fetched via `block_in_place` only on the multi-thread runtime.
- - `crate::mcp::audit` (`list_writes`, `McpWriteListQuery`; stubbed under `mcp/audit/stub.rs` without the `mcp` feature) — write-audit health.
- - `crate::core::Outcome` — RPC result envelope.
+ - `crate::core::all`: `rpc_method_name()` for controller route metadata and `all_controller_schemas()` for the `security.` / `approval.` policy-surface scan. Registry *entries* for controllers come from `crate::tools::all_tools_controller_schemas()`, not the whole controller set.
+ - `crate::core::{ControllerSchema, FieldSchema, TypeSchema}` and `core::all::{ControllerFuture, RegisteredController}`: schema model and controller registration contract.
+ - `crate::config` (`Config`, `config::schema::CapabilityProviderTrustState`): autonomy posture, MCP client allowlists, capability-provider config.
+ - `crate::mcp::server` (`McpToolSpec`, `tool_specs()`): MCP stdio tool source for registry entries.
+ - `crate::mcp::registry::connections` (`all_connected_tools()` / `all_connected_tools_for_config()`, defined inside `mcp/registry/mod.rs`; empty-returning stubs in `mcp/registry/stub.rs` when the `mcp` feature is disabled): live MCP client server tools, fetched via `block_in_place` only on the multi-thread runtime.
+ - `crate::mcp::audit` (`list_writes`, `McpWriteListQuery`; stubbed under `mcp/audit/stub.rs` without the `mcp` feature): write-audit health.
-- `crate::rpc::RpcOutcome`: RPC result envelope.
++- `crate::rpc::Outcome`: RPC result envelope.
## Used by
diff --cc crates/openhuman-core/src/voice/README.md
index 9befa84a5f,4679a4bd34..3ce0daaf4f
--- a/crates/openhuman-core/src/voice/README.md
+++ b/crates/openhuman-core/src/voice/README.md
@@@ -139,12 -139,12 +139,12 @@@ transcription count, rolling recent-tra
## Dependencies
- - `tinyinference-voice` — hosted STT transport, Piper execution, transcription cleanup, and streaming PCM mechanics; `crate::inference` supplies the local runtime and provider policy.
- - `crate::config` — `Config`, `config::rpc::load_config_with_timeout`, voice-server / dictation config sections, and `config::schema::voice_providers` (`VoiceProviderCreds`, capability/auth/API-style enums).
- - `crate::desktop::accessibility` (macOS only) — focused-text inspection (`focused_text_context_verbose`) and the Swift globe-key listener (`globe_listener_start` / `globe_listener_poll`) used in place of rdev for the Fn key.
- - `crate::api` — `BackendOAuthClient`, `effective_backend_api_url`, `get_session_token` for backend-proxied reply-speech and the realtime signed-URL bootstrap.
- - `crate::modules::voice` (`tinyvoice`) — see Contract crates above.
- - `crate::core::all` (`ControllerFuture`, `RegisteredController`), `crate::core::{ControllerSchema, FieldSchema, TypeSchema}`, `crate::core::bus::BUS` + `crate::core::events` (event publishing), `crate::core::logging` (CLI run init), and `crate::core::Outcome`.
+ - `tinyinference-voice`: hosted STT transport, Piper execution, transcription cleanup, and streaming PCM mechanics; `crate::inference` supplies the local runtime and provider policy.
+ - `crate::config`: `Config`, `config::rpc::load_config_with_timeout`, voice-server / dictation config sections, and `config::schema::voice_providers` (`VoiceProviderCreds`, capability/auth/API-style enums).
+ - `crate::desktop::accessibility` (macOS only): focused-text inspection (`focused_text_context_verbose`) and the Swift globe-key listener (`globe_listener_start` / `globe_listener_poll`) used in place of rdev for the Fn key.
+ - `crate::api`: `BackendOAuthClient`, `effective_backend_api_url`, `get_session_token` for backend-proxied reply-speech and the realtime signed-URL bootstrap.
+ - `crate::modules::voice` (`tinyvoice`): see Contract crates above.
-- `crate::core::all` (`ControllerFuture`, `RegisteredController`), `crate::core::{ControllerSchema, FieldSchema, TypeSchema}`, `crate::core::bus::BUS` + `crate::core::events` (event publishing), `crate::core::logging` (CLI run init), and `crate::rpc::RpcOutcome`.
++- `crate::core::all` (`ControllerFuture`, `RegisteredController`), `crate::core::{ControllerSchema, FieldSchema, TypeSchema}`, `crate::core::bus::BUS` + `crate::core::events` (event publishing), `crate::core::logging` (CLI run init), and `crate::rpc::Outcome`.
- External crates: `cpal` (capture), `rdev` (hotkeys), `enigo` + `arboard` (paste insertion), `reqwest` (external provider HTTP + realtime bootstrap), `tokio`/`tokio-util`, `once_cell`.
## Used by
diff --cc crates/openhuman-core/src/voice/audio_toolkit/README.md
index 0e19687923,28a057067c..426c20c8c2
--- a/crates/openhuman-core/src/voice/audio_toolkit/README.md
+++ b/crates/openhuman-core/src/voice/audio_toolkit/README.md
@@@ -26,9 -26,9 +26,9 @@@ Text-to-speech "podcast" toolkit. Synth
From `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 → Option<PathBuf>`).
- - **schemas**: `all_audio_toolkit_controller_schemas`, `all_audio_toolkit_registered_controllers`.
- - **types**: `AudioFormat` (`Mp3`/`Wav`, with `extension()` / `mime()`), `AudioGenerateRequest`, `EmailPodcastRequest`, `AudioGeneratedArtifact`, `AudioEmailDeliveryResult`, `AudioToolkitGenerateAndEmailResult`.
-- ops: `generate_podcast`, `email_podcast`, `generate_and_email_podcast`, `resolve_email_capture_dir`. All take `&Config` and return `Result<RpcOutcome<T>, String>` (except `resolve_email_capture_dir`, which returns `Option<PathBuf>`).
++- 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`.
+ - types: `AudioFormat` (`Mp3`/`Wav`, with `extension()` / `mime()`), `AudioGenerateRequest`, `EmailPodcastRequest`, `AudioGeneratedArtifact`, `AudioEmailDeliveryResult`, `AudioToolkitGenerateAndEmailResult`.
- **tools** (`pub mod tools`): `AudioGeneratePodcastTool`, `AudioEmailPodcastTool`, `AudioGenerateAndEmailPodcastTool`.
## RPC / controllers
@@@ -64,13 -64,13 +64,13 @@@ No durable domain store. Side effects a
## Dependencies
- - `crate::voice` — `create_tts_provider`, `DEFAULT_PIPER_VOICE`; actual speech synthesis.
- - `crate::channels::email_channel::EmailChannel` — SMTP delivery of the built message.
- - `crate::config::Config` / `config::rpc` — workspace dir, `local_ai.tts_provider`, `channels_config.email`; `load_config_with_timeout` in RPC handlers.
- - `crate::security` — `SecurityPolicy` / `ToolOperation` to gate the agent tools.
- - `tinytools` — `Tool`, `ToolResult`, `PermissionLevel`.
- - `crate::core::all` / `crate::core` — `RegisteredController`, `ControllerFuture`, `ControllerSchema`, `FieldSchema`, `TypeSchema` for RPC registration.
- - `crate::core::Outcome` — controller/op return contract.
+ - `crate::voice`: `create_tts_provider`, `DEFAULT_PIPER_VOICE`; actual speech synthesis.
+ - `crate::channels::email_channel::EmailChannel`: SMTP delivery of the built message.
+ - `crate::config::Config` / `config::rpc`: workspace dir, `local_ai.tts_provider`, `channels_config.email`; `load_config_with_timeout` in RPC handlers.
+ - `crate::security`: `SecurityPolicy` / `ToolOperation` to gate the agent tools.
+ - `tinytools`: `Tool`, `ToolResult`, `PermissionLevel`.
+ - `crate::core::all` / `crate::core`: `RegisteredController`, `ControllerFuture`, `ControllerSchema`, `FieldSchema`, `TypeSchema` for RPC registration.
-- `crate::rpc::RpcOutcome`: controller/op return contract.
++- `crate::rpc::Outcome`: controller/op return contract.
- External crates: `lettre` (email message + attachment), `base64`, `chrono`, `uuid`.
## Used by
diff --cc crates/openhuman-core/src/web3/wallet/README.md
index 51526b6420,8d439932e5..bbfd43f89f
--- a/crates/openhuman-core/src/web3/wallet/README.md
+++ b/crates/openhuman-core/src/web3/wallet/README.md
@@@ -111,15 -129,15 +129,15 @@@ None. The module publishes or subscribe
## Dependencies
- - `crate::config` (`Config`, `config::rpc::load_config_with_timeout`) — resolves workspace dir and config for state paths, keychain user id, and decryption.
- - `crate::security::keyring` (`is_available`/`get`/`set`) — OS keychain storage for the encrypted mnemonic.
- - `crate::security::encryption::rpc` (`encrypt_secret`/`decrypt_secret`) — chain executors decrypt the recovery phrase before handing it to the wallet module.
- - `crate::modules::wallet` (`derive_account`, `sign_transaction_in_module`, `sign_message`) — the loaded `tinywallet` native module does every derivation and signature; the phrase is only sent after the module passes the attestation check (`modules::wallet::attested_proxy`).
- - `crate::security::approval::APPROVAL_CHAT_CONTEXT` — task-local chat owner (`thread_id`/`client_id`) used to bind quotes to their originating thread.
- - `tinytools` — `Tool`/`ToolResult`/`ToolCallOptions` for the agent tools.
- - `crate::core::all` (`ControllerFuture`, `RegisteredController`) and `crate::core` (`ControllerSchema`, `FieldSchema`, `TypeSchema`) — RPC controller registry wiring.
- - `crate::core::Outcome` — standard RPC return shape.
- - `tinywallet-bus` (`vendor/tinywallet/crates/tinywallet-bus`, optional, gated by the `web3` feature; features `btc`, `evm`, `solana`, `tron`, `keccak`, `net`, `wire`, `eip712`, `abi`, `tx-codec`) — the contract crate. It owns address formats (parsing/validation/conversion) and the wire types crossing the `Transport` seam (`SecretMaterial`, `TransactionSpec`, `NetworkId`), the ERC-20/EIP-712 encoders, and the Tron verifier. Per Cargo.toml's own rationale: taken as the contract crate and NOT the root `tinywallet` crate — key derivation, transaction building, signing and the chain clients (including the `bitcoin` crate and its native secp256k1 build) live inside that loaded module now, so this binary links none of it. The root `tinywallet` crate is still a dev-dependency, used only so test fixtures can derive a known account from a BIP-39 vector phrase.
+ - `crate::config` (`Config`, `config::rpc::load_config_with_timeout`): resolves workspace dir and config for state paths, keychain user id, and decryption.
+ - `crate::security::keyring` (`is_available`/`get`/`set`): OS keychain storage for the encrypted mnemonic.
+ - `crate::security::encryption::rpc` (`encrypt_secret`/`decrypt_secret`): chain executors decrypt the recovery phrase before handing it to the wallet module.
+ - `crate::modules::wallet` (`derive_account`, `sign_transaction_in_module`, `sign_message`): the loaded `tinywallet` native module does every derivation and signature; the phrase is only sent after the module passes the attestation check (`modules::wallet::attested_proxy`).
+ - `crate::security::approval::APPROVAL_CHAT_CONTEXT`: task-local chat owner (`thread_id`/`client_id`) used to bind quotes to their originating thread.
+ - `tinytools`: `Tool`/`ToolResult`/`ToolCallOptions` for the agent tools.
+ - `crate::core::all` (`ControllerFuture`, `RegisteredController`) and `crate::core` (`ControllerSchema`, `FieldSchema`, `TypeSchema`): RPC controller registry wiring.
-- `crate::rpc::RpcOutcome`: standard RPC return shape.
++- `crate::rpc::Outcome`: standard RPC return shape.
+ - `tinywallet-bus` (`vendor/tinywallet/crates/tinywallet-bus`, optional, gated by the `web3` feature; features `btc`, `evm`, `solana`, `tron`, `keccak`, `net`, `wire`, `eip712`, `abi`, `tx-codec`): the contract crate. It owns address formats (parsing/validation/conversion) and the wire types crossing the `Transport` seam (`SecretMaterial`, `TransactionSpec`, `NetworkId`), the ERC-20/EIP-712 encoders, and the Tron verifier. Per Cargo.toml's own rationale, this is taken as the contract crate and not the root `tinywallet` crate: key derivation, transaction building, signing and the chain clients (including the `bitcoin` crate and its native secp256k1 build) live inside that loaded module now, so this binary links none of it. The root `tinywallet` crate is still a dev-dependency, used only so test fixtures can derive a known account from a BIP-39 vector phrase.
- Other external crates: `curve25519-dalek` (optional, pulled in by the `web3` feature; Solana off-curve ATA check), `bs58` (Solana base58 program ids/addresses), `sha2` (Solana ATA/PDA derivation), `hex`, `reqwest`, `serde`/`serde_json`, `tempfile`, `parking_lot`, `once_cell`. `k256`, `coins-bip39`, `ed25519-dalek` and the root `tinywallet` crate are test-only here (the `web3` feature does not enable `k256`/`coins-bip39`): they back the `cfg(test)` local signers in `chains/solana.rs`, `execution.rs` and the test fixtures, so unit tests can run without a loaded module.
## Used by
diff --cc crates/openhuman-embed/README.md
index 40aaa1d40d,66b168d6f8..a7da70262d
--- a/crates/openhuman-embed/README.md
+++ b/crates/openhuman-embed/README.md
@@@ -318,9 -325,9 +325,9 @@@ time. Run them with `cargo test -p open
## Relationship to other crates
Its only in-repo dependency is `openhuman-core` (package `openhuman`) with
- `default-features = false` — every capability comes from a feature forwarded
+ `default-features = false`: every capability comes from a feature forwarded
above. It does not depend on `openhuman-rpc` directly; the shared
-`RpcOutcome` and `StructuredRpcError` types reach it through
+`Outcome` and `StructuredRpcError` types reach it through
`openhuman_core::rpc`. `openhuman-app` and `openhuman-tui` depend on
`openhuman-rpc` for its HTTP client and on `openhuman-core`; neither uses
`openhuman-embed`.
diff --cc crates/openhuman-tinyhumans/src/hosted/announcements/README.md
index 51238713cf,4c8ac8b9c7..f41c950acf
--- a/crates/openhuman-tinyhumans/src/hosted/announcements/README.md
+++ b/crates/openhuman-tinyhumans/src/hosted/announcements/README.md
@@@ -43,16 -43,16 +43,16 @@@ anything. Dismissal is tracked client-s
## Dependencies
- - `crate::security::credentials::session_support::require_live_session_token`
- — rejects an expired token locally instead of firing a doomed backend 401
+ - `crate::security::credentials::session_support::require_live_session_token`:
+ rejects an expired token locally instead of firing a doomed backend 401
(same guard as `billing/ops.rs`).
- - `crate::api::config::effective_backend_api_url`, `crate::api::BackendOAuthClient`
- — resolve the backend base URL and issue the authed JSON request, carrying
+ - `crate::api::config::effective_backend_api_url`, `crate::api::BackendOAuthClient`:
+ resolve the backend base URL and issue the authed JSON request, carrying
the sanitized `x-sdk-name` product identity (`crate::api::product`) on every
call.
- - `crate::api::flatten_authed_error` — flattens any non-404 backend/session
+ - `crate::api::flatten_authed_error`: flattens any non-404 backend/session
error for the RPC caller.
- - `crate::core::Outcome` (re-export of `openhuman_rpc`) — return wrapper
-- `crate::rpc::RpcOutcome` (re-export of `openhuman_rpc`): return wrapper
++- `crate::rpc::Outcome` (re-export of `openhuman_rpc`): return wrapper
carrying value + log line.
## Gating
diff --cc crates/openhuman-tinyhumans/src/hosted/billing/README.md
index 1bccbc93b3,a8eb8052fc..c525cfc9a2
--- a/crates/openhuman-tinyhumans/src/hosted/billing/README.md
+++ b/crates/openhuman-tinyhumans/src/hosted/billing/README.md
@@@ -25,8 -25,8 +25,8 @@@ Thin RPC adapter domain over the hoste
From `mod.rs`:
- - `ops::*` — async handlers: `get_summary`, `get_current_plan`, `get_balance`, `get_transactions`, `get_auto_recharge`, `update_auto_recharge`, `get_cards`, `create_setup_intent`, `update_card`, `delete_card`, `purchase_plan`, `create_portal_session`, `top_up_credits`, `create_coinbase_charge`, `redeem_coupon`, `get_user_coupons`. Each takes `&Config` (plus typed params) and returns `Result<Outcome<Value>, String>`.
- - `all_billing_controller_schemas()`, `all_billing_registered_controllers()`, `billing_schemas(function: &str)` — registry wiring.
-- `ops::*`: async handlers: `get_summary`, `get_current_plan`, `get_balance`, `get_transactions`, `get_auto_recharge`, `update_auto_recharge`, `get_cards`, `create_setup_intent`, `update_card`, `delete_card`, `purchase_plan`, `create_portal_session`, `top_up_credits`, `create_coinbase_charge`, `redeem_coupon`, `get_user_coupons`. Each takes `&Config` (plus typed params) and returns `Result<RpcOutcome<Value>, String>`.
++- `ops::*`: async handlers: `get_summary`, `get_current_plan`, `get_balance`, `get_transactions`, `get_auto_recharge`, `update_auto_recharge`, `get_cards`, `create_setup_intent`, `update_card`, `delete_card`, `purchase_plan`, `create_portal_session`, `top_up_credits`, `create_coinbase_charge`, `redeem_coupon`, `get_user_coupons`. Each takes `&Config` (plus typed params) and returns `Result<Outcome<Value>, String>`.
+ - `all_billing_controller_schemas()`, `all_billing_registered_controllers()`, `billing_schemas(function: &str)`: registry wiring.
## RPC / controllers
@@@ -67,12 -67,12 +67,12 @@@ None of its own; stateless adapter. Th
## Dependencies
- - `crate::api::config::effective_backend_api_url` — resolves the backend base URL from `config.api_url`.
- - `crate::api::jwt::get_session_token` — reads the stored app-session JWT.
- - `crate::api::BackendOAuthClient` — performs the authenticated JSON HTTP request (`authed_json`).
- - `crate::config::Config` — config struct (`api_url`); `config::rpc::load_config_with_timeout` in handlers.
- - `crate::core::Outcome` — standard RPC return/logging wrapper.
- - `crate::core::all::{ControllerFuture, RegisteredController}` and `crate::core::{ControllerSchema, FieldSchema, TypeSchema}` — controller registry types.
+ - `crate::api::config::effective_backend_api_url`: resolves the backend base URL from `config.api_url`.
+ - `crate::api::jwt::get_session_token`: reads the stored app-session JWT.
+ - `crate::api::BackendOAuthClient`: performs the authenticated JSON HTTP request (`authed_json`).
+ - `crate::config::Config`: config struct (`api_url`); `config::rpc::load_config_with_timeout` in handlers.
-- `crate::rpc::RpcOutcome`: standard RPC return/logging wrapper.
++- `crate::rpc::Outcome`: standard RPC return/logging wrapper.
+ - `crate::core::all::{ControllerFuture, RegisteredController}` and `crate::core::{ControllerSchema, FieldSchema, TypeSchema}`: controller registry types.
- External crates: `reqwest` (`Method`), `serde`/`serde_json`, `urlencoding` (path-segment encoding for `paymentMethodId`).
## Used by
diff --cc crates/openhuman-tinyhumans/src/hosted/referral/README.md
index d8ee309225,6766796383..d513fc93fb
--- a/crates/openhuman-tinyhumans/src/hosted/referral/README.md
+++ b/crates/openhuman-tinyhumans/src/hosted/referral/README.md
@@@ -47,12 -47,12 +47,12 @@@ None of its own. The domain is stateles
## Dependencies
- - `crate::api::config::effective_backend_api_url` — resolves the effective backend API base URL from `config.api_url`.
- - `crate::api::jwt::get_session_token` — reads the stored backend session token.
- - `crate::api::BackendOAuthClient` — issues authenticated JSON requests (`authed_json`) to the backend.
- - `crate::config::Config` — config struct passed into ops; `config::rpc::load_config_with_timeout` is used by the schema handlers.
- - `crate::core::all::{ControllerFuture, RegisteredController}` and `crate::core::{ControllerSchema, FieldSchema, TypeSchema}` — controller registry types.
- - `crate::core::Outcome` — return wrapper carrying value + logs.
+ - `crate::api::config::effective_backend_api_url`: resolves the effective backend API base URL from `config.api_url`.
+ - `crate::api::jwt::get_session_token`: reads the stored backend session token.
+ - `crate::api::BackendOAuthClient`: issues authenticated JSON requests (`authed_json`) to the backend.
+ - `crate::config::Config`: config struct passed into ops; `config::rpc::load_config_with_timeout` is used by the schema handlers.
+ - `crate::core::all::{ControllerFuture, RegisteredController}` and `crate::core::{ControllerSchema, FieldSchema, TypeSchema}`: controller registry types.
-- `crate::rpc::RpcOutcome`: return wrapper carrying value + logs.
++- `crate::rpc::Outcome`: return wrapper carrying value + logs.
- Test-only: `crate::security::credentials::{AuthService, APP_SESSION_PROVIDER, DEFAULT_AUTH_PROFILE_NAME}` for seeding session tokens in unit tests.
## Used by
diff --cc crates/openhuman-tinyhumans/src/hosted/team/README.md
index 7c95046d34,57832e8706..083f093979
--- a/crates/openhuman-tinyhumans/src/hosted/team/README.md
+++ b/crates/openhuman-tinyhumans/src/hosted/team/README.md
@@@ -17,7 -17,7 +17,7 @@@ Team management RPC adapters. This doma
| File | Role |
| --- | --- |
| `crates/openhuman-tinyhumans/src/hosted/team/mod.rs` | Export-only: declares `ops`/`schemas`, re-exports all ops fns and the controller-schema pair. |
- | `crates/openhuman-tinyhumans/src/hosted/team/ops.rs` | Business logic — async fns that build a path, attach the session JWT, call the backend, and wrap the response in `Outcome::single_log`. Contains URL-path builder + id-normalization helpers and their unit tests. |
-| `crates/openhuman-tinyhumans/src/hosted/team/ops.rs` | Business logic: async fns that build a path, attach the session JWT, call the backend, and wrap the response in `RpcOutcome::single_log`. Contains URL-path builder + id-normalization helpers and their unit tests. |
++| `crates/openhuman-tinyhumans/src/hosted/team/ops.rs` | Business logic: async fns that build a path, attach the session JWT, call the backend, and wrap the response in `Outcome::single_log`. Contains URL-path builder + id-normalization helpers and their unit tests. |
| `crates/openhuman-tinyhumans/src/hosted/team/schemas.rs` | Controller schemas (`all_team_controller_schemas`, `all_team_registered_controllers`, `team_schemas`), param structs, and `handle_*` adapters that load config, deserialize params, and delegate to `ops`. |
| `crates/openhuman-tinyhumans/src/hosted/team/schemas_tests.rs` | Sibling test module for `schemas.rs` (wired via `#[path]`). |
@@@ -25,7 -25,7 +25,7 @@@
Re-exported from `mod.rs`:
- - **Ops (all `async fn(... ) -> Result<Outcome<Value>, String>`):** `get_usage` (re-exported from `integrations::client::budget_gate`, which owns the `/teams/me/usage` probe, its failure backoff and the managed-tool budget gate — the integrations client is its main consumer), `list_members`, `list_teams`, `get_team`, `create_team`, `update_team`, `delete_team`, `switch_team`, `leave_team`, `join_team`, `create_invite`, `remove_member`, `change_member_role`, `list_invites`, `revoke_invite`.
-- **Ops (all `async fn(... ) -> Result<RpcOutcome<Value>, String>`):** `get_usage` (re-exported from `integrations::client::budget_gate`, which owns the `/teams/me/usage` probe, its failure backoff and the managed-tool budget gate: the integrations client is its main consumer), `list_members`, `list_teams`, `get_team`, `create_team`, `update_team`, `delete_team`, `switch_team`, `leave_team`, `join_team`, `create_invite`, `remove_member`, `change_member_role`, `list_invites`, `revoke_invite`.
++- **Ops (all `async fn(... ) -> Result<Outcome<Value>, String>`):** `get_usage` (re-exported from `integrations::client::budget_gate`, which owns the `/teams/me/usage` probe, its failure backoff and the managed-tool budget gate: the integrations client is its main consumer), `list_members`, `list_teams`, `get_team`, `create_team`, `update_team`, `delete_team`, `switch_team`, `leave_team`, `join_team`, `create_invite`, `remove_member`, `change_member_role`, `list_invites`, `revoke_invite`.
- **Schemas:** `all_team_controller_schemas`, `all_team_registered_controllers`, `team_schemas`.
Internal helpers in `ops.rs` (`require_token`, `normalize_id`, `build_api_path`, `get_authed_value`) are private.
@@@ -68,12 -68,12 +68,12 @@@ None local. State lives in the hosted b
## Dependencies
- - `crate::api::config::effective_backend_api_url` — resolves the backend base URL from `Config.api_url`.
- - `crate::api::jwt::get_session_token` — pulls the session JWT used to authenticate every request.
- - `crate::api::BackendOAuthClient` — HTTP client; `authed_json(token, method, path, body)` performs the authed call.
- - `crate::config::Config` — config passed into every op; `config::rpc::load_config_with_timeout` loads it inside each `handle_*`.
- - `crate::core::all::{ControllerFuture, RegisteredController}` and `crate::core::{ControllerSchema, FieldSchema, TypeSchema}` — controller registry types.
- - `crate::core::Outcome` — return wrapper (`single_log`).
+ - `crate::api::config::effective_backend_api_url`: resolves the backend base URL from `Config.api_url`.
+ - `crate::api::jwt::get_session_token`: pulls the session JWT used to authenticate every request.
+ - `crate::api::BackendOAuthClient`: HTTP client; `authed_json(token, method, path, body)` performs the authed call.
+ - `crate::config::Config`: config passed into every op; `config::rpc::load_config_with_timeout` loads it inside each `handle_*`.
+ - `crate::core::all::{ControllerFuture, RegisteredController}` and `crate::core::{ControllerSchema, FieldSchema, TypeSchema}`: controller registry types.
-- `crate::rpc::RpcOutcome`: return wrapper (`single_log`).
++- `crate::rpc::Outcome`: return wrapper (`single_log`).
- `reqwest` (`Method`, `Url`) for HTTP + path building; `serde` / `serde_json` for params and bodies.
## Used by
diff --cc gitbooks/developing/architecture.md
index caccfd8857,8bd7adadc1..a1d832c851
--- a/gitbooks/developing/architecture.md
+++ b/gitbooks/developing/architecture.md
@@@ -17,10 -17,10 +17,10 @@@ OpenHuman is a cross-platform communica
| --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **`app/`** | pnpm workspace **`openhuman-app`**: Vite/React UI (`app/src/`), Vitest and WDIO tests. The Tauri shell itself is the Rust crate `crates/openhuman-app/` (below). |
| **`crates/openhuman-app/`** | Thin Tauri v2 desktop host (Cargo package `openhuman-app`). Built from its own manifest and lockfile, excluded from the root workspace; hosts the core as an in-process tokio task (`src/core_process.rs`). |
- | **`crates/openhuman-core/`** | Cargo package **`openhuman`**: library **`openhuman_core`**, with no `tinyhumans-sdk` dependency — the hosted backend is reached only through the `api::transport::BackendTransport` port. Flat domain modules directly under `src/` (`agent`, `api`, `channels`, `config`, `cron`, `desktop`, `flows`, `hooks`, `hosting`, `http_host`, `inference`, `integrations`, `json_schema`, `mcp`, `media`, `memory`, `modules`, `platform`, `runtime`, `sandbox`, `search`, `security`, `skills`, `threads`, `tools`, `util`, `voice`, `web3`, `web_chat`, …). `src/core/` holds the JSON-RPC server (`jsonrpc/`), CLI (`cli.rs`), dispatch, controller registry (`all.rs`), event bus (`bus.rs`), `runtime/` (`CoreBuilder`/`CoreRuntime`) and `subsystem/`. There is no `src/rpc/` or `src/embed/` inside this crate any more. |
+ | **`crates/openhuman-core/`** | Cargo package **`openhuman`**: library **`openhuman_core`**, with no `tinyhumans-sdk` dependency (the hosted backend is reached only through the `api::transport::BackendTransport` port). Flat domain modules directly under `src/` (`agent`, `api`, `channels`, `config`, `cron`, `desktop`, `flows`, `hooks`, `hosting`, `http_host`, `inference`, `integrations`, `json_schema`, `mcp`, `media`, `memory`, `modules`, `platform`, `runtime`, `sandbox`, `search`, `security`, `skills`, `threads`, `tools`, `util`, `voice`, `web3`, `web_chat`, …). `src/core/` holds the JSON-RPC server (`jsonrpc.rs`), CLI (`cli.rs`), dispatch, controller registry (`all.rs`), event bus (`bus.rs`), `runtime/` (`CoreBuilder`/`CoreRuntime`) and `subsystem/`. There is no `src/rpc/` or `src/embed/` inside this crate any more. |
-| **`crates/openhuman-rpc/`** | Shared JSON-RPC contracts: `RpcOutcome`, `unwrap_rpc`, `apply_log_envelope`, `StructuredRpcError`. The `http-client` feature (default on; off for root-workspace consumers) adds `post_json_rpc`, `bearer_header`, `redact_url_for_log`, `HttpRpcResponse`. Used by the Tauri shell (`core_rpc.rs` → `relay_http_rpc`) and the TUI (envelope decoding); re-exported by the core as `openhuman_core::rpc`. |
+| **`crates/openhuman-rpc/`** | Shared JSON-RPC contracts: `Outcome`, `unwrap_rpc`, `apply_log_envelope`, `StructuredRpcError`. The `http-client` feature (default on; off for root-workspace consumers) adds `post_json_rpc`, `bearer_header`, `redact_url_for_log`, `HttpRpcResponse`. Used by the Tauri shell (`core_rpc.rs` → `relay_http_rpc`) and the TUI (envelope decoding); re-exported by the core as `openhuman_core::rpc`. |
- | **`crates/openhuman-embed/`** | Typed library facade (`openhuman_embed::{Harness, Core, CoreBuilder, DomainSet, ServiceSet, HostKind}`) for embedding the core in another product; forwards the core's feature gates. Installs no backend transport itself. |
- | **`crates/openhuman-tinyhumans/`** | The TinyHumans layer above embed: `SdkBackendTransport` (the only crate that depends on the vendored `tinyhumans-sdk`), `install()` for hosts that boot the core themselves, a `RuntimeBuilder` that boots an embed runtime connected, the hosted RPC proxies (`hosted/`: billing, team, referral, announcements — registered into the core's controller registry as an extension), and the host-side login/session owner (`session/`). |
+ | **`crates/openhuman-embed/`** | Typed library facade with two ways in: `openhuman_embed::Runtime` -> `Agent` (the public library API: one runtime per process, any number of independently configured agents on it, with `Harness` as a one-agent shorthand) and `Core` (a typed facade over a `CoreRuntime` the host built itself with `CoreBuilder`). Forwards the core's feature gates. Installs no backend transport itself. |
+ | **`crates/openhuman-tinyhumans/`** | The TinyHumans layer above embed: `SdkBackendTransport` (the only crate that depends on the vendored `tinyhumans-sdk`), `install()` for hosts that boot the core themselves, a `RuntimeBuilder` that boots an embed runtime connected, the hosted RPC proxies (`hosted/`: billing, team, referral, announcements, registered into the core's controller registry as an extension), and the host-side login/session owner (`session/`). |
| **`crates/openhuman-cli/`** | The `openhuman-core` binary (installs the tinyhumans transport, then `run_core_from_args`), the developer/benchmark bins, and every root `tests/*.rs` / `examples/*.rs` target. |
| **`crates/openhuman-tui/`** | Standalone ratatui terminal frontend. Boots the core in-process via `CoreBuilder` (`DomainSet::full()`, `ServiceSet::none()`), no HTTP. |
| **`Cargo.toml`** (root) | Virtual workspace for `openhuman-core`, `openhuman-embed`, `openhuman-rpc`, `openhuman-tinyhumans`, `openhuman-cli`, and `openhuman-tui` (`cargo build -p openhuman-cli --bin openhuman-core` builds the standalone CLI/server); `vendor/`, `worktrees/`, `crates/openhuman-app`, `app/src-tauri-mobile`, and `packages/tauri-plugin-ptt` are excluded. Holds the `[patch]` tables for vendored crates. There is no sidecar: the desktop bundle links the core in-process (`app/package.json` `core:stage` is a documented no-op). |
diff --cc gitbooks/developing/architecture/README.md
index fbb797e54f,21ad3435c8..87942d1af8
--- a/gitbooks/developing/architecture/README.md
+++ b/gitbooks/developing/architecture/README.md
@@@ -40,17 -40,19 +40,19 @@@ OpenHuman is a **React + Tauri v2 deskt
**Where logic lives:**
- - **Rust core**. all business logic. Memory Tree, integrations, model routing, tools, voice. Authoritative.
- - **Tauri shell**. windowing, process lifecycle, IPC. A delivery vehicle, not where features live.
+ - **Rust core**. All business logic: Memory Tree, integrations, model routing, tools, voice. Authoritative.
+ - **Tauri shell**. Windowing, process lifecycle, IPC. A delivery vehicle, not where features live.
- **React frontend**. UI and orchestration. Calls into core via JSON-RPC: `coreRpcClient` `fetch()`es `http://127.0.0.1:<port>/rpc` directly; only non-loopback plain-`http://` runtimes go through the shell's `relay_http_rpc` command (the `openhuman-rpc` HTTP client).
+ Running the core in-process instead of behind a socket is also why it's cheap to run many agents at once: no per-agent OS process, no per-agent socket. See [Performance](../performance.md) for the measurements and [Embedding OpenHuman](../embedding.md) for using the same core as a library outside the desktop app.
+
## Crates
- - `crates/openhuman-app/` — Tauri v2 desktop host; excluded from the root workspace, built from its own manifest.
- - `crates/openhuman-core/` — Cargo package `openhuman`: business domains, JSON-RPC server, CLI, `CoreBuilder`/`CoreRuntime`.
- - `crates/openhuman-embed/` — typed library facade (`openhuman_embed::Harness`) for embedding the core in another product.
- - `crates/openhuman-rpc/` — shared RPC contracts (`Outcome`, `unwrap_rpc`, `StructuredRpcError`) and the HTTP client used by the app and TUI.
- - `crates/openhuman-tui/` — standalone terminal frontend that boots the core in-process.
+ - `crates/openhuman-app/` - Tauri v2 desktop host; excluded from the root workspace, built from its own manifest.
+ - `crates/openhuman-core/` - Cargo package `openhuman`: business domains, JSON-RPC server, CLI, `CoreBuilder`/`CoreRuntime`.
+ - `crates/openhuman-embed/` - typed library facade (`openhuman_embed::Runtime` / `Agent`, with `Harness` as a one-agent shorthand) for embedding the core in another product.
-- `crates/openhuman-rpc/` - shared RPC contracts (`RpcOutcome`, `unwrap_rpc`, `StructuredRpcError`) and the HTTP client used by the app and TUI.
++- `crates/openhuman-rpc/` - shared RPC contracts (`Outcome`, `unwrap_rpc`, `StructuredRpcError`) and the HTTP client used by the app and TUI.
+ - `crates/openhuman-tui/` - standalone terminal frontend that boots the core in-process.
The full table is under "Repository layout" in the [deep architecture reference](../architecture.md).
diff --cc gitbooks/developing/architecture/mcp-registry.md
index 00c66a6882,872181a640..519cb5d5e7
--- a/gitbooks/developing/architecture/mcp-registry.md
+++ b/gitbooks/developing/architecture/mcp-registry.md
@@@ -61,10 -61,10 +61,10 @@@ Installed servers are connected as the
| ---------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `mod.rs` | Module docs, `types`/`connections` re-export shims over `tinymcp_bus`/`super::host`, the reconnect-supervisor loop, the OAuth-callback completion helper, and `tools_safe_for_agent` (the prompt-injection scan applied to every remote tool definition). |
| `host.rs` (parent `mcp/`) | One `tinymcp` service per workspace, opened on first use; proxy resolution for MCP traffic (`proxy_for_mcp`). |
-| `helpers.rs` | Shared RPC-handler plumbing: `RpcOutcome` encoding, identifier guards, workspace-service resolution, credential-name injection. |
+| `helpers.rs` | Shared RPC-handler plumbing: `Outcome` encoding, identifier guards, workspace-service resolution, credential-name injection. |
| `ops.rs` | `mcp_clients_*` RPC handler implementations (uninstall, list, browse, connect/disconnect, tool call, `update_env`, registry settings). One-to-one with `schemas.rs` handlers; publishes `DomainEvent`s `tinymcp` does not. |
| `config_doc.rs` | The `mcp.json` contract: `render` (store → document, credential names only), `parse` (document → declarations, refusing what the store cannot carry), `same_dial`, `to_installed`, `merge_credentials`. |
- | `config_ops.rs` | `mcp_clients_config_get` / `config_set`: replace the store with what the document declares — add, rewrite in place under the same `server_id`, or uninstall — merging write-only credentials and connecting new enabled servers in the background. |
+ | `config_ops.rs` | `mcp_clients_config_get` / `config_set`: replace the store with what the document declares (add, rewrite in place under the same `server_id`, or uninstall), merging write-only credentials and connecting new enabled servers in the background. |
| `schemas/` (`mod.rs`, `registry.rs`, `handlers.rs`, `params.rs`) | Controller schemas + handler dispatch. Re-exported from `mod.rs` as `all_mcp_registry_controller_schemas` / `all_mcp_registry_registered_controllers`. |
| `bus.rs` | `DomainEvent` subscriber (`McpClientEventSubscriber`) that logs `McpServer*` / `McpClientToolExecuted` lifecycle events. |
| `supervisor_events.rs` | Turns a `tinymcp::Supervisor` tick report into this domain's `DomainEvent`s, stamped with the workspace whose host was ticked. |