Skip to content

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

Merge branch 'crate-chain-p3' into crate-chain-p4

Steven Enamakel16b72695e926
diff --cc .github/ci-paths-filter.yml
index f8e91fa7c5,d6ebe4db2b..3a2c5ea41d
--- a/.github/ci-paths-filter.yml
+++ b/.github/ci-paths-filter.yml
@@@ -69,9 -69,10 +69,11 @@@ rust-core
- 'scripts/ci/assert-coverage-presence.sh'
- 'scripts/ci/coverage-presence-allowlist.txt'
- 'scripts/ci/check-openhuman-rust-layout.mjs'
+ - 'scripts/ci/check-crate-chain.mjs'
- 'scripts/ci/check-agent-runtime-boundary.mjs'
- 'scripts/ci/agent-runtime-boundary-baseline.json'
+ - 'scripts/ci/check-saas-ambient.mjs'
+ - 'scripts/ci/saas-ambient-baseline.json'
# The ignored-test ratchet lives in rust-quality. Its checker and
# its baseline must arm that lane themselves, or a PR that raises
# the baseline skips the only gate that reads it.
diff --cc AGENTS.md
index e93be375ea,4ed855ae70..a8b76b8a58
--- a/AGENTS.md
+++ b/AGENTS.md
@@@ -17,11 -17,11 +17,11 @@@ Architecture: [overview](gitbooks/devel
| `crates/openhuman-core/` | Package `openhuman`: business domains under `src/<domain>/`, the controller contract, dispatch and auth under `src/core/` |
| `crates/openhuman-core/src/<domain>/` | Flat business-domain modules (agent, memory, tools, security, channels, ...) |
| `crates/openhuman-core/src/core/` | CLI, controller contract (`Outcome`, schemas) and in-process dispatch, controller registry, event bus, runtime composition; no business logic and no JSON-RPC server |
-| `crates/openhuman-cli/` | The `openhuman-core` binary (`src/main.rs`), the developer bins (`src/bin/`), and every root `tests/*.rs` / `examples/*.rs` target; depends on `openhuman-tinyhumans` for the backend transport the core does not carry |
-| `crates/openhuman-embed/` | Typed library facade for embedding the core in another product |
-| `crates/openhuman-rpc/` | JSON-RPC 2.0 over the core: envelopes, HTTP client, and the server (router, Socket.IO, listener, `run_server*`) used by app, CLI and TUI; plus `session_store` (`session-store` feature), the on-disk session store (`session_raw/`, `session_db/`, `tinyagents_store/`, turn states) behind TinyAgents' session store port, which the app, CLI and TUI install. Core and embed reach session state through the port (`agent::session_store`); a few legacy paths still fall back to workspace files when no store is installed. With a storage URL (`OPENHUMAN_STORAGE_URL` / `[storage] url`), `install_for_host` installs TinyAgents' `DriverSessionStores` over that backend instead (core `storage` domain) |
-| `crates/openhuman-tinyhumans/` | The TinyHumans layer above embed: SDK-backed backend transport, a `RuntimeBuilder` that boots connected, and the host-side login/session owner (login-token exchange, `/auth/me`, current-user cache, credential handoff) used by app and TUI |
-| `crates/openhuman-tui/` | Standalone terminal frontend |
+| `crates/openhuman-cli/` | The `openhuman-core` binary (`src/main.rs`, `openhuman_rpc::host::cli`), the ops bins (`src/bin/`: `openhuman-fleet`, `test-mcp-stub`), and every root `tests/*.rs` / `examples/*.rs` target. Normal dependency: `openhuman-rpc` only; the tests reach core, embed and tinyhumans through `[dev-dependencies]`. The benchmark bins live in the openhuman-benchmarks repository |
+| `crates/openhuman-embed/` | Library facade over the core (depends on core only): `Runtime`/`RuntimeBuilder` with host presets, `embed::process` (tokio runtime, logging, dotenv, master key, Sentry options), and the curated facades hosts use (`config`, `artifacts`, `chat_surface`, `modules`, `identity`). Its doc-hidden `__host` list is for tinyhumans and rpc only |
- | `crates/openhuman-rpc/` | Top of the library chain (depends on tinyhumans only). JSON-RPC 2.0 over the core: envelopes, HTTP client, and the server (router, Socket.IO, listener, `run_server*`); `host::{cli, desktop, tui}`, the shared host boot; re-exports `embed` and `tinyhumans` as the hosts' curated facade; plus `session_store` (`session-store` feature), the on-disk session store (`session_raw/`, `session_db/`, `tinyagents_store/`, turn states) behind TinyAgents' session store port, which the app, CLI and TUI install. Core and embed reach session state through the port (`agent::session_store`); a few legacy paths still fall back to workspace files when no store is installed |
++| `crates/openhuman-rpc/` | Top of the library chain (depends on tinyhumans only). JSON-RPC 2.0 over the core: envelopes, HTTP client, and the server (router, Socket.IO, listener, `run_server*`); `host::{cli, desktop, tui}`, the shared host boot; re-exports `embed` and `tinyhumans` as the hosts' curated facade; plus `session_store` (`session-store` feature), the on-disk session store (`session_raw/`, `session_db/`, `tinyagents_store/`, turn states) behind TinyAgents' session store port, which the app, CLI and TUI install. Core and embed reach session state through the port (`agent::session_store`); a few legacy paths still fall back to workspace files when no store is installed. With a storage URL (`OPENHUMAN_STORAGE_URL` / `[storage] url`), `install_for_host` installs TinyAgents' `DriverSessionStores` over that backend instead (core `storage` domain) |
+| `crates/openhuman-tinyhumans/` | The TinyHumans layer above embed (depends on embed only): SDK-backed backend transport, a `RuntimeBuilder` that boots connected, and the host-side login/session owner (login-token exchange, `/auth/me`, current-user cache, credential handoff) used by app and TUI |
+| `crates/openhuman-tui/` | Standalone terminal frontend; depends on `openhuman-rpc` only and boots with `openhuman_rpc::host::tui` |
| `tests/` | Rust integration and JSON-RPC tests |
| `gitbooks/` | Public product and contributor documentation |
| `docs/` | Internal maintainer documentation |
diff --cc crates/README.md
index a24cb73521,19c2b443a3..17bf152450
--- a/crates/README.md
+++ b/crates/README.md
@@@ -22,27 -22,30 +22,27 @@@ with `--manifest-path crates/openhuman-
## How they layer
Arrows point from a crate to what it depends on (normal `[dependencies]`,
- taken from each `Cargo.toml`). It is a strict chain: each crate names only the
- layer directly below it.
-taken from each [`Cargo.toml`](../Cargo.toml)).
++taken from each [`Cargo.toml`](../Cargo.toml)). It is a strict chain: each crate
++names only the layer directly below it.
```text
- openhuman-app openhuman-tui openhuman-cli (executables)
+ openhuman-app openhuman-tui openhuman-cli (hosts)
| | |
+------------------+------------------+
- | each of the three depends on all three crates below
- |
- +-----------------------+-------------------------+
- | | |
- v v |
- openhuman-tinyhumans openhuman-rpc |
- | | (server, client, |
- | | session store) |
- | v | |
- | vendor/tinyhumans-sdk | |
- v | |
- openhuman-embed | |
- | | |
- v v v
- +--------------------------------------------------------------+
- | openhuman-core |
- | (domains, controller registry, BackendTransport port) |
- +--------------------------------------------------------------+
+ | openhuman-rpc only
+ v
+ openhuman-rpc host::{cli, desktop, tui}, server,
+ | client, session store
+ v
+ openhuman-tinyhumans SDK transport, hosted proxies,
+ | session owner, Jev ranker
+ | (+ vendor/tinyhumans-sdk)
+ v
+ openhuman-embed Runtime/RuntimeBuilder, presets,
+ | process helpers, facades
+ v
+ openhuman-core domains, controller registry,
+ BackendTransport port
```
The same edges as a list:
@@@ -51,19 -54,16 +51,19 @@@
| --- | --- |
| `openhuman-core` | none |
| `openhuman-embed` | `openhuman-core` |
- | `openhuman-tinyhumans` | `openhuman-embed` (plus `vendor/tinyhumans-sdk`) |
-| `openhuman-rpc` | `openhuman-core` |
-| `openhuman-tinyhumans` | `openhuman-embed`, `openhuman-core` (plus [`vendor/tinyhumans-sdk`](../vendor/tinyhumans-sdk/)) |
-| `openhuman-cli` | `openhuman-core`, `openhuman-tinyhumans`, `openhuman-rpc` (`server`) |
-| `openhuman-tui` | `openhuman-core`, `openhuman-rpc` (`session-store`), `openhuman-tinyhumans` |
-| `openhuman-app` | `openhuman-core`, `openhuman-rpc` (`http-client`, `server`), `openhuman-tinyhumans` (`jev`) |
-
-Every executable depends on the core directly as well as through the layers,
-because each names `openhuman_core::` paths. `openhuman-tinyhumans` also
-depends on the core directly for surfaces embed does not re-export
-(`backend::transport`, `core::all`).
++| `openhuman-tinyhumans` | `openhuman-embed` (plus [`vendor/tinyhumans-sdk`](../vendor/tinyhumans-sdk/)) |
+| `openhuman-rpc` | `openhuman-tinyhumans` |
+| `openhuman-cli` | `openhuman-rpc` (`server`) |
+| `openhuman-tui` | `openhuman-rpc` (`session-store`) |
+| `openhuman-app` | `openhuman-rpc` (`http-client`, `server`, `jev`, the product gates) |
+
- `scripts/ci/check-crate-chain.mjs` (run by `pnpm rust:layout`) fails on any
++[`scripts/ci/check-crate-chain.mjs`](../scripts/ci/check-crate-chain.mjs) (run by `pnpm rust:layout`) fails on any
+other edge, and on a host `src/` that names `__host`, `core_host` or
+`openhuman_core::`. The layers above embed reach core internals through
+embed's doc-hidden `__host` list; the hosts use the curated facade re-exported
+by rpc (`openhuman_rpc::embed`, `openhuman_rpc::tinyhumans`). Dev-dependencies
+are exempt: `openhuman-cli`'s root tests and examples take the core, embed and
+tinyhumans as dev-dependencies, which never reach the shipped binary.
## Why it is split this way
@@@ -89,13 -87,11 +89,13 @@@ empty, and the core must not depend on
## Features
Cargo default features define the contributor build;
- `scripts/ci/product-features.txt` defines the shipped product. A core gate is
+ [`scripts/ci/product-features.txt`](../scripts/ci/product-features.txt) defines the shipped product. A core gate is
forwarded along the library chain (`openhuman-embed`, then
-`openhuman-tinyhumans`, then `openhuman-cli`), and the desktop app, which
-builds with `default-features = false`, forwards product gates explicitly.
+`openhuman-tinyhumans`, then `openhuman-rpc`, then the `openhuman-cli` and
+`openhuman-tui` hosts), and the desktop app, which builds with
+`default-features = false`, forwards product gates explicitly on its
+`openhuman-rpc` dependency.
- `scripts/ci/check-feature-forwarding.mjs` checks both.
+ [`scripts/ci/check-feature-forwarding.mjs`](../scripts/ci/check-feature-forwarding.mjs) checks both.
## Build and test
diff --cc crates/openhuman-app/README.md
index 801c30f30c,c062a83c15..ba31d956f2
--- a/crates/openhuman-app/README.md
+++ b/crates/openhuman-app/README.md
@@@ -196,11 -195,11 +196,11 @@@ Updates, reset and diagnostics
| Path | What it does |
| --- | --- |
- | `src/app_update.rs` | Bounded retry policy for the updater download. The update commands themselves are in `lib.rs`. |
- | `src/local_data_reset.rs` | `reset_local_data`: asks the core which paths to remove, shuts the core down so its file handles close, removes the active user's local data, and starts the core again. |
- | `src/reset_reboot_schedule.rs` | Windows: schedules deletion at next reboot when files are locked during a reset. |
- | `src/file_logging.rs` | Resolves the data dir and calls `openhuman_rpc::embed::process::init_for_embedded`; `reveal_logs_folder`, `logs_folder_path`. |
- | `src/stderr_panic_hook.rs` | Stops a closed parent stderr pipe from turning log writes into panics. |
+ | [`src/app_update.rs`](src/app_update.rs) | Bounded retry policy for the updater download. The update commands themselves are in `lib.rs`. |
+ | [`src/local_data_reset.rs`](src/local_data_reset.rs) | `reset_local_data`: asks the core which paths to remove, shuts the core down so its file handles close, removes the active user's local data, and starts the core again. |
+ | [`src/reset_reboot_schedule.rs`](src/reset_reboot_schedule.rs) | Windows: schedules deletion at next reboot when files are locked during a reset. |
-| [`src/file_logging.rs`](src/file_logging.rs) | Resolves the data dir and calls `openhuman_core::core::logging::init_for_embedded`; `reveal_logs_folder`, `logs_folder_path`. |
++| [`src/file_logging.rs`](src/file_logging.rs) | Resolves the data dir and calls `openhuman_rpc::embed::process::init_for_embedded`; `reveal_logs_folder`, `logs_folder_path`. |
+ | [`src/stderr_panic_hook.rs`](src/stderr_panic_hook.rs) | Stops a closed parent stderr pipe from turning log writes into panics. |
Other commands:
@@@ -214,12 -213,12 +214,12 @@@ Configuration and packaging
| Path | What it does |
| --- | --- |
- | `tauri.conf.json` | Windows, bundle resources (agent prompts and `bundled-modules`), updater and installer settings. |
- | `capabilities/` | The capability granted to the `main` and `overlay` windows. See [`capabilities/`](capabilities/README.md). |
- | `permissions/` | App permission sets referenced by the capability. See [`permissions/`](permissions/README.md). |
- | `bundled-modules/` | Installer resource directory for native module releases. Empty in git (only `.gitkeep`; everything else is ignored). Release builds fill it with `scripts/release/stage-modules.mjs`, laid out as `<id>/<version>/<host_key>/<archive>`, and `setup()` hands it to `openhuman_rpc::embed::modules::set_bundled_releases_dir`. Its contents still pass the core's digest and TinyBus admission checks. On macOS, `scripts/release/macos-bundled-modules.sh` signs and checks it. |
- | `build.rs` | Runs `tauri_build`, and empties `bundle.resources` for non-release builds. |
- | `profiling/` | Standalone CPU and RAM profiler for a running app. See [`profiling/`](profiling/README.md). |
+ | [`tauri.conf.json`](tauri.conf.json) | Windows, bundle resources (agent prompts and `bundled-modules`), updater and installer settings. |
+ | [`capabilities/`](capabilities/) | The capability granted to the `main` and `overlay` windows. See [`capabilities/`](capabilities/README.md). |
+ | [`permissions/`](permissions/) | App permission sets referenced by the capability. See [`permissions/`](permissions/README.md). |
-| [`bundled-modules/`](bundled-modules/) | Installer resource directory for native module releases. Empty in git (only `.gitkeep`; everything else is ignored). Release builds fill it with [`scripts/release/stage-modules.mjs`](../../scripts/release/stage-modules.mjs), laid out as `<id>/<version>/<host_key>/<archive>`, and `setup()` hands it to `openhuman_core::modules::ops::set_bundled_releases_dir`. Its contents still pass the core's digest and TinyBus admission checks. On macOS, [`scripts/release/macos-bundled-modules.sh`](../../scripts/release/macos-bundled-modules.sh) signs and checks it. |
++| [`bundled-modules/`](bundled-modules/) | Installer resource directory for native module releases. Empty in git (only `.gitkeep`; everything else is ignored). Release builds fill it with [`scripts/release/stage-modules.mjs`](../../scripts/release/stage-modules.mjs), laid out as `<id>/<version>/<host_key>/<archive>`, and `setup()` hands it to `openhuman_rpc::embed::modules::set_bundled_releases_dir`. Its contents still pass the core's digest and TinyBus admission checks. On macOS, [`scripts/release/macos-bundled-modules.sh`](../../scripts/release/macos-bundled-modules.sh) signs and checks it. |
+ | [`build.rs`](build.rs) | Runs `tauri_build`, and empties `bundle.resources` for non-release builds. |
+ | [`profiling/`](profiling/) | Standalone CPU and RAM profiler for a running app. See [`profiling/`](profiling/README.md). |
| `Info.plist`, `entitlements.sidecar.plist`, `nsis-hooks.nsh`, `main.desktop`, `postinst`, `postrm` | Platform packaging files for macOS, the Windows installer, and Linux packages. |
## IPC commands
@@@ -288,13 -285,12 +288,13 @@@ compares the list with [`scripts/ci/pro
`HTTP_SERVER_COMPILED_IN`) that fail the build if `voice` or `http-server` is
dropped.
-Other dependencies: `openhuman-rpc` with `http-client` and `server` (the
-embedded server and the relay), `openhuman-tinyhumans` with `jev` (backend
-transport and the session owner), and the `tinybox-*` crates behind
-`gateways`.
+The same line turns on rpc's own `http-client` and `server` (the relay and the
+embedded server) and `jev` (the Jev ranker). The session owner, the embed
+facades and the backend transport come through it as
+`openhuman_rpc::tinyhumans` and `openhuman_rpc::embed`. The `tinybox-*` crates
+sit behind `gateways`.
- The `[patch]` tables mirror the root `Cargo.toml` for `tinytools`, the
+ The `[patch]` tables mirror the root [`Cargo.toml`](Cargo.toml) for `tinytools`, the
`tinyinference-*` crates, `tinyflows` and `tinychannels`. Keep them in sync:
drift makes Cargo resolve two copies of the same crate, and their types stop
being interchangeable (a shell `dyn Tool` would no longer be the core's).
@@@ -308,9 -304,9 +308,9 @@@ These are shell-local and unrelated to
| Feature | Meaning |
| --- | --- |
- | `gateways` (default) | Compiles in `src/gateway/` and the `tinybox-*` crates. Off, the gateway commands are absent and `active_rpc_endpoint` always answers with the embedded core. |
+ | `gateways` (default) | Compiles in [`src/gateway/`](src/gateway/) and the `tinybox-*` crates. Off, the gateway commands are absent and `active_rpc_endpoint` always answers with the embedded core. |
| `custom-protocol` | Serves the bundled `frontendDist` from `tauri://localhost` instead of the Vite `devUrl`. `cargo tauri build` turns it on; never add it to `default`. |
- | `e2e-test-support` | Forwards `openhuman-rpc/e2e-test-support` (down the chain to the core) to expose `openhuman.test_reset`. The E2E build (`app/scripts/e2e-build.sh`) enables it. |
-| `e2e-test-support` | Forwards `openhuman_core/e2e-test-support` to expose `openhuman.test_reset`. The E2E build ([`app/scripts/e2e-build.sh`](../../app/scripts/e2e-build.sh)) enables it. |
++| `e2e-test-support` | Forwards `openhuman-rpc/e2e-test-support` (down the chain to the core) to expose `openhuman.test_reset`. The E2E build ([`app/scripts/e2e-build.sh`](../../app/scripts/e2e-build.sh)) enables it. |
## Boundaries
diff --cc crates/openhuman-app/profiling/README.md
index f720cf13d1,c14b90708b..5c07080534
--- a/crates/openhuman-app/profiling/README.md
+++ b/crates/openhuman-app/profiling/README.md
@@@ -82,8 -82,12 +82,13 @@@ pnpm profile:tauri --pid <PID> --durati
| `--stacks`, `--no-stacks` | on for macOS | Turn the `/usr/bin/sample` capture on or off. |
For the smaller embedded-core-only Linux RSS and PSS benchmark, use the
- `rss-bench` binary in the openhuman-benchmarks repository (#6944); it no
- longer builds from `crates/openhuman-cli`.
+ `rss-bench` binary in the `profile/` crate of
-[openhuman-benchmarks](https://github.com/tinyhumansai/openhuman-benchmarks), from a checkout of that repository:
++[openhuman-benchmarks](https://github.com/tinyhumansai/openhuman-benchmarks) (#6944); it no longer builds from
++`crates/openhuman-cli`. From a checkout of that repository:
+
+ ```bash
+ ./profile/scripts/rss-bench.sh
+ ```
## Layout
diff --cc crates/openhuman-cli/Cargo.toml
index dfdc6b5e8b,8a355f295f..0ac094e803
--- a/crates/openhuman-cli/Cargo.toml
+++ b/crates/openhuman-cli/Cargo.toml
@@@ -281,46 -289,35 +296,50 @@@ urlencoding = "2.1
wiremock = "0.6"
[features]
-# Same contributor set as the core's `default`, forwarded. The product lanes
-# pass `--features "$(scripts/ci/product-features.sh)"`; every product gate
-# name resolves here so `cargo test --workspace --features ...` keeps working.
-default = ["openhuman-core/default", "openhuman-tinyhumans/default", "jev"]
-# The Jev-backed `tool_search` ranker; `openhuman-tinyhumans`'s own gate.
-jev = ["openhuman-tinyhumans/jev"]
-http-server = ["openhuman-core/http-server", "openhuman-tinyhumans/http-server"]
-inference = ["openhuman-core/inference", "openhuman-tinyhumans/inference"]
-documents = ["openhuman-core/documents", "openhuman-tinyhumans/documents"]
-hosting = ["openhuman-core/hosting", "openhuman-tinyhumans/hosting"]
-modules = ["openhuman-core/modules", "openhuman-tinyhumans/modules"]
-voice = ["openhuman-core/voice", "openhuman-tinyhumans/voice"]
-web3 = ["openhuman-core/web3", "openhuman-tinyhumans/web3"]
+# The contributor set: the core's `[features] default` gates (listed, because
+# `openhuman-rpc`'s own default carries only its server and client) plus the
+# Jev ranker. The product lanes pass `--features
+# "$(scripts/ci/product-features.sh)"`; every product gate name resolves here.
+default = [
+ "media",
+ "skills",
+ "flows",
+ "mcp",
+ "channels",
+ "http-server",
+ "scheduler-gate",
+ "file-logging",
+ "modules",
+ "jev",
+]
+# Every gate forwards to `openhuman-rpc` alone (chain: rpc -> tinyhumans ->
+# embed -> core); `scripts/ci/check-feature-forwarding.mjs` checks the link.
+# The Jev-backed `tool_search` ranker.
+jev = ["openhuman-rpc/jev"]
+http-server = ["openhuman-rpc/http-server"]
+inference = ["openhuman-rpc/inference"]
+documents = ["openhuman-rpc/documents"]
+hosting = ["openhuman-rpc/hosting"]
+modules = ["openhuman-rpc/modules"]
+voice = ["openhuman-rpc/voice"]
+web3 = ["openhuman-rpc/web3"]
+ # Storage drivers for `[storage] url` (see the core `storage` domain).
-storage-sqlite = ["openhuman-core/storage-sqlite", "openhuman-tinyhumans/storage-sqlite"]
-storage-mongodb = ["openhuman-core/storage-mongodb", "openhuman-tinyhumans/storage-mongodb"]
-storage-file = ["openhuman-core/storage-file", "openhuman-tinyhumans/storage-file"]
-runtime-node = ["openhuman-core/runtime-node", "openhuman-tinyhumans/runtime-node"]
-media = ["openhuman-core/media", "openhuman-tinyhumans/media"]
-flows = ["openhuman-core/flows", "openhuman-tinyhumans/flows"]
-skills = ["openhuman-core/skills", "openhuman-tinyhumans/skills"]
-mcp = ["openhuman-core/mcp", "openhuman-tinyhumans/mcp"]
-channels = ["openhuman-core/channels", "openhuman-tinyhumans/channels"]
-whatsapp-web = ["openhuman-core/whatsapp-web", "openhuman-tinyhumans/whatsapp-web"]
-e2e-test-support = ["openhuman-core/e2e-test-support"]
-file-logging = ["openhuman-core/file-logging", "openhuman-tinyhumans/file-logging"]
-scheduler-gate = ["openhuman-core/scheduler-gate", "openhuman-tinyhumans/scheduler-gate"]
-# Sentry init in `main.rs` plus the `observability_smoke` test target.
-crash-reporting = ["dep:sentry", "openhuman-core/crash-reporting", "openhuman-tinyhumans/crash-reporting"]
++storage-sqlite = ["openhuman-rpc/storage-sqlite"]
++storage-mongodb = ["openhuman-rpc/storage-mongodb"]
++storage-file = ["openhuman-rpc/storage-file"]
+runtime-node = ["openhuman-rpc/runtime-node"]
+media = ["openhuman-rpc/media"]
+flows = ["openhuman-rpc/flows"]
+skills = ["openhuman-rpc/skills"]
+mcp = ["openhuman-rpc/mcp"]
+channels = ["openhuman-rpc/channels"]
+whatsapp-web = ["openhuman-rpc/whatsapp-web"]
+e2e-test-support = ["openhuman-rpc/e2e-test-support"]
+file-logging = ["openhuman-rpc/file-logging"]
+scheduler-gate = ["openhuman-rpc/scheduler-gate"]
+# Sentry init in `main.rs` (through `embed::process::sentry`) plus the
+# `observability_smoke` test target.
+crash-reporting = ["openhuman-rpc/crash-reporting"]
# CLI argument parsing + logger init for `openhuman-fleet`.
bin-tools = ["dep:clap"]
diff --cc crates/openhuman-cli/README.md
index d90940ce8b,fdea27dece..84be2686bb
--- a/crates/openhuman-cli/README.md
+++ b/crates/openhuman-cli/README.md
@@@ -1,8 -1,8 +1,8 @@@
# openhuman-cli
-This crate builds the `openhuman-core` binary, a handful of developer and
-benchmark binaries, and every root `tests/*.rs` and `examples/*.rs` target in
-the repository. The core ([`crates/openhuman-core`](../openhuman-core/), package `openhuman`) is a
+This crate builds the `openhuman-core` binary, two ops binaries
+(`openhuman-fleet`, `test-mcp-stub`), and every root `tests/*.rs` and
- `examples/*.rs` target in the repository. The core (`crates/openhuman-core`, package `openhuman`) is a
++`examples/*.rs` target in the repository. The core ([`crates/openhuman-core`](../openhuman-core/), package `openhuman`) is a
library with no backend client and no JSON-RPC server, and it declares no
bin, test or example targets of its own. Anything that must run as a process
against the hosted backend, or test the core the way a host boots it, lives
@@@ -122,8 -128,8 +122,8 @@@ targets: `observability_smoke` (`crash-
(`media`).
In-process suites that reach the (mock) backend call
- `tinyhumans_boot::boot()` from `tests/support/tinyhumans_boot.rs` first, which
+ `tinyhumans_boot::boot()` from [`tests/support/tinyhumans_boot.rs`](../../tests/support/tinyhumans_boot.rs) first, which
-runs `openhuman_tinyhumans::install`. Without it every backend call answers
+runs `openhuman_tinyhumans::install` (a dev-dependency here). Without it every backend call answers
`BACKEND_UNAVAILABLE:`. Suites that spawn the `openhuman-core` binary get the
transport from `main.rs`.
@@@ -131,11 -137,11 +131,11 @@@
| Path | What it does |
| --- | --- |
- | `Cargo.toml` | All `[[bin]]`, `[[test]]` and `[[example]]` targets, feature forwarding. |
- | `src/main.rs` | The `openhuman-core` binary entry point described above. |
- | [`src/bin/`](src/bin/README.md) | Ops binaries: `test-mcp-stub`, `openhuman-fleet`. The benchmark binaries moved to openhuman-benchmarks (#6944). |
+ | [`Cargo.toml`](Cargo.toml) | All `[[bin]]`, `[[test]]` and `[[example]]` targets, feature forwarding. |
+ | [`src/main.rs`](src/main.rs) | The `openhuman-core` binary entry point described above. |
-| [`src/bin/`](src/bin/README.md) | Developer binaries: `test-mcp-stub`, `openhuman-fleet`. The benchmark binaries live in [openhuman-benchmarks](https://github.com/tinyhumansai/openhuman-benchmarks) (`profile/`). |
++| [`src/bin/`](src/bin/README.md) | Ops binaries: `test-mcp-stub`, `openhuman-fleet`. The benchmark binaries live in [openhuman-benchmarks](https://github.com/tinyhumansai/openhuman-benchmarks) (`profile/`, #6944). |
| `../../tests/*.rs` | 27 `[[test]]` targets, including the two aggregators. See [`tests/README.md`](../../tests/README.md). |
-| `../../examples/*.rs` | 2 `[[example]]` targets: `embed_headless` and `embed_kernel`. |
+| `../../examples/*.rs` | 2 `[[example]]` targets on the `openhuman_embed::Runtime` API: `embed_headless` and `embed_kernel`. |
| `../../build.rs` | Shared build script: generates the `raw_coverage_all` and `in_process_all` module lists and exports `OPENHUMAN_REPOSITORY_ROOT`. |
## Targets
@@@ -148,14 -154,14 +148,15 @@@
## Features
-The default set mirrors the core's contributor default plus
-`openhuman-tinyhumans/default` and `jev`. Every core gate (`http-server`,
-`inference`, `voice`, `web3`, `channels`, `media`, `modules`, and the rest) is
-forwarded to both `openhuman-core` and `openhuman-tinyhumans`, so the product
-lanes' feature list resolves here unchanged; [`scripts/ci/check-feature-forwarding.mjs`](../../scripts/ci/check-feature-forwarding.mjs)
-checks the chain. `e2e-test-support` forwards to the core only; `rss-bench` is
-not forwarded, since the benchmark crate that uses it enables it on the core directly.
-Gates local to this crate:
+The default set is the core's contributor default (listed by name, because
+`openhuman-rpc`'s own default carries only its server and client) plus
- `jev`. Every gate (`http-server`, `inference`, `voice`, `web3`, `channels`,
- `media`, `modules`, `e2e-test-support`, and the rest) forwards to
++`jev`. Every gate (`http-server`, `inference`, `voice`, `web3`, `storage-*`,
++`channels`, `media`, `modules`, `e2e-test-support`, and the rest) forwards to
+`openhuman-rpc/<gate>`, which forwards it down the chain, so the product
+lanes' feature list resolves here unchanged;
- `scripts/ci/check-feature-forwarding.mjs` checks the link. Gates local to this
- crate:
++[`scripts/ci/check-feature-forwarding.mjs`](../../scripts/ci/check-feature-forwarding.mjs) checks the link. `rss-bench` is
++not forwarded, since the benchmark crate that uses it enables it on the core
++directly. Gates local to this crate:
| Feature | Purpose |
| --- | --- |
@@@ -168,15 -176,11 +169,15 @@@
functionality is a controller registered in `core/all.rs`, reached through
the generic namespace dispatch, not a new branch in `cli.rs`.
- The JSON-RPC server, Socket.IO and the listener belong to
- `crates/openhuman-rpc`. The backend transport and login belong to
- `crates/openhuman-tinyhumans`.
- - The terminal UI is `crates/openhuman-tui`; the desktop host is
- `crates/openhuman-app`. Both are hosts on `openhuman-rpc` like this one and
+ [`crates/openhuman-rpc`](../openhuman-rpc/). The backend transport and login belong to
+ [`crates/openhuman-tinyhumans`](../openhuman-tinyhumans/).
+ - The terminal UI is [`crates/openhuman-tui`](../openhuman-tui/); the desktop host is
- [`crates/openhuman-app`](../openhuman-app/), which embeds the core directly and does not use
- this binary.
++ [`crates/openhuman-app`](../openhuman-app/). Both are hosts on `openhuman-rpc` like this one and
+ do not use this binary (the app's `core` subcommand runs the same
+ `host::cli`).
+- The binary never names the core, embed or tinyhumans directly; reach new
+ core behavior through embed's facade (re-exported as
+ `openhuman_rpc::embed`).
## Gotchas
@@@ -199,5 -203,14 +200,14 @@@ pnpm test:rust # scripts/test-
pnpm debug rust <filter>
```
-`main_tests.rs` (built with `crash-reporting`) covers the secret scrubbing
-that `before_send` applies (bearer tokens and provider API keys).
+`main_tests.rs` (built with `crash-reporting`) covers the environment and
+release resolution, and pins that the shared chain still scrubs secrets.
+
+ ## Further reading
+
+ - [`gitbooks/developing/building-rust-core.md`](../../gitbooks/developing/building-rust-core.md): building the Rust core.
+ - [`gitbooks/developing/testing-strategy.md`](../../gitbooks/developing/testing-strategy.md): testing strategy.
+ - [`gitbooks/developing/performance.md`](../../gitbooks/developing/performance.md): performance.
+ - [`crates/README.md`](../README.md): crates overview.
+ - [`crates/openhuman-core/README.md`](../openhuman-core/README.md): the openhuman-core crate README.
+ - [`tests/README.md`](../../tests/README.md): root tests.
diff --cc crates/openhuman-cli/src/bin/README.md
index e4f9fd6aec,6e03ae11cf..0402d721ad
--- a/crates/openhuman-cli/src/bin/README.md
+++ b/crates/openhuman-cli/src/bin/README.md
@@@ -1,19 -1,14 +1,20 @@@
# bin
Auxiliary binaries declared as `[[bin]]` targets in
- `crates/openhuman-cli/Cargo.toml`, next to the primary `openhuman-core`
- binary (`src/main.rs`, described in the [crate README](../../README.md)). One
- is a test fixture and one is an experimental multi-tenant supervisor. Neither
- ships in the desktop product, and neither names an OpenHuman crate: the CLI's
- normal dependencies stop at `openhuman-rpc`.
-
- The benchmark binaries that used to live here (`tool-search-bench`,
- `tool-dialect-bench`, `rss-bench`, `library-profile`) reached deep into core
- internals (`agent::harness`, `platform::proc_metrics`, `flows`, provider
- factories) that the curated facade does not expose. They were dropped along
- with their `rss-bench` / `rss-bench-dhat` gates and the `scripts/profile/`
- drivers; the bench rig lives in the separate openhuman-benchmarks repository
- (#6944).
+ [`crates/openhuman-cli/Cargo.toml`](../../Cargo.toml), next to the primary `openhuman-core`
+ binary ([`src/main.rs`](../main.rs), described in the [crate README](../../README.md)). One
+ is a test fixture and the other an experimental multi-tenant supervisor.
-Neither ships in the desktop product. The benchmark and profiling binaries
-that used to live here (`tool-search-bench`, `tool-dialect-bench`,
-`rss-bench`, `library-profile`) moved to the `profile/` crate of
-[openhuman-benchmarks](https://github.com/tinyhumansai/openhuman-benchmarks), which builds them against a vendored checkout
-of this workspace.
++Neither ships in the desktop product, and neither names an OpenHuman crate:
++the CLI's normal dependencies stop at `openhuman-rpc`.
++
++The benchmark and profiling binaries that used to live here
++(`tool-search-bench`, `tool-dialect-bench`, `rss-bench`, `library-profile`)
++reached deep into core internals (`agent::harness`, `platform::proc_metrics`,
++`flows`, provider factories) that the curated facade does not expose. They
++moved, with their `scripts/profile/` drivers, to the `profile/` crate of
++[openhuman-benchmarks](https://github.com/tinyhumansai/openhuman-benchmarks) (#6944), which builds them against a vendored
++checkout of this workspace; the `rss-bench` / `rss-bench-dhat` gates went
++with them.
## How it works
@@@ -97,9 -92,9 +98,9 @@@ cargo build -p openhuman-cli --feature
- The manifest sets `autobins = false`, so a `.rs` file in this directory is
a binary only when it has a `[[bin]]` entry. That is what lets
- `fleet_tests.rs` sit here beside its binary without Cargo trying to build
- it as an executable. A new binary needs both the file and the manifest
- entry.
+ [`fleet_tests.rs`](fleet_tests.rs) sit here beside its binary
- without Cargo trying to build them as executables. A new binary needs both
++ without Cargo trying to build it as an executable. A new binary needs both
+ the file and the manifest entry.
## Tests
diff --cc crates/openhuman-embed/README.md
index 3bc9dbae82,38eb157e56..e5566d8c6b
--- a/crates/openhuman-embed/README.md
+++ b/crates/openhuman-embed/README.md
@@@ -541,7 -584,17 +578,17 @@@ cargo test -p openhuman-embed --feature
cargo test -p openhuman-embed --features inference,mcp,skills --test runtime_agents
```
- The repository-root `examples/embed_headless.rs` and `examples/embed_kernel.rs`
+ The repository-root [`examples/embed_headless.rs`](../../examples/embed_headless.rs) and [`examples/embed_kernel.rs`](../../examples/embed_kernel.rs)
-drive `CoreBuilder` directly, without this crate. They are `[[example]]`
-targets of `openhuman-cli`:
+use this crate's `Runtime` (`Runtime::builder()`, then `core_runtime().invoke`
+for raw RPC methods). They are `[[example]]` targets of `openhuman-cli`:
`cargo run -p openhuman-cli --example embed_headless`.
+
+ ## Further reading
+
+ - [`crates/openhuman-embed/examples/README.md`](examples/README.md): the examples module README.
+ - [`gitbooks/developing/embedding.md`](../../gitbooks/developing/embedding.md): embedding the core in another product.
+ - [`gitbooks/developing/tinyhumans-api-key.md`](../../gitbooks/developing/tinyhumans-api-key.md): running on a TinyHumans API key.
+ - [`gitbooks/developing/architecture.md`](../../gitbooks/developing/architecture.md): architecture overview.
+ - [`gitbooks/developing/architecture/agent-harness.md`](../../gitbooks/developing/architecture/agent-harness.md): the agent harness.
+ - [`gitbooks/developing/loadable-modules.md`](../../gitbooks/developing/loadable-modules.md): loadable modules.
+ - [`crates/README.md`](../README.md): crates overview.
diff --cc crates/openhuman-rpc/Cargo.toml
index 7c29067181,262c1e42ad..2bfe3a0822
--- a/crates/openhuman-rpc/Cargo.toml
+++ b/crates/openhuman-rpc/Cargo.toml
@@@ -52,6 -52,6 +52,11 @@@ hosting = ["openhuman-tinyhumans/hostin
modules = ["openhuman-tinyhumans/modules"]
voice = ["openhuman-tinyhumans/voice"]
web3 = ["openhuman-tinyhumans/web3"]
++# Storage drivers for `[storage] url` (see the core `storage` domain and
++# `session_store::install_for_host`).
++storage-sqlite = ["openhuman-tinyhumans/storage-sqlite"]
++storage-mongodb = ["openhuman-tinyhumans/storage-mongodb"]
++storage-file = ["openhuman-tinyhumans/storage-file"]
runtime-node = ["openhuman-tinyhumans/runtime-node"]
media = ["openhuman-tinyhumans/media"]
flows = ["openhuman-tinyhumans/flows"]
diff --cc crates/openhuman-rpc/README.md
index 23cf7d2b5e,4dd9b90805..b51c062c94
--- a/crates/openhuman-rpc/README.md
+++ b/crates/openhuman-rpc/README.md
@@@ -156,25 -155,22 +156,25 @@@ gate must forward to the same gate on `
The root workspace declares this crate with `default-features = false`, so
each consumer names what it needs. `openhuman-cli` enables `server`,
`openhuman-tui` enables `session-store` only (it runs the core without a
- server), and `crates/openhuman-app/Cargo.toml`, outside the workspace,
+ server), and [`crates/openhuman-app/Cargo.toml`](../openhuman-app/Cargo.toml), outside the workspace,
-enables `http-client` and `server`.
+enables `http-client`, `server`, `jev` and the product gates. Each host also
- forwards its own feature gates here, 1:1, so `e2e-test-support` and every
- product gate reach the core through this crate.
++forwards its own feature gates here, 1:1, so `e2e-test-support`, the
++`storage-*` drivers and every product gate reach the core through this crate.
## Consumers
- - `crates/openhuman-app`: `core_process.rs` runs the embedded server
+ - [`crates/openhuman-app`](../openhuman-app/): `core_process.rs` runs the embedded server
- (`run_server_embedded_with_ready`) and reads its `EmbeddedReadySignal`;
+ (`host::desktop`) and reads its `EmbeddedReadySignal`;
`core_rpc.rs` wraps `post_json_rpc` to reach the embedded core and
self-hosted runtimes (#3865); `session/link.rs` and `local_data_reset.rs`
build requests with `request_body` and decode with `decode_response`;
- `lib.rs` calls `install_cli_server` before `run_core_from_args`.
-- [`crates/openhuman-cli`](../openhuman-cli/): `main.rs` calls `install_cli_server`; root
+ `lib.rs::run_core_from_args` calls `host::cli`; the rest of the shell uses
+ the `embed` and `tinyhumans` re-exports.
- - `crates/openhuman-cli`: `main.rs` calls `host::cli`; root
++- [`crates/openhuman-cli`](../openhuman-cli/): `main.rs` calls `host::cli`; root
`tests/*.rs` suites (for example `json_rpc_e2e.rs`) build the router with
`build_core_http_router`.
- - `crates/openhuman-tui`: `unwrap_rpc` is its decode point, and
+ - [`crates/openhuman-tui`](../openhuman-tui/): `unwrap_rpc` is its decode point, and
- `runner.rs` calls `session_store::install()`.
+ `runner.rs` boots with `host::tui()`.
## Boundaries
diff --cc crates/openhuman-rpc/src/host.rs
index e6fd212f0c,e6fd212f0c..21ddb06383
--- a/crates/openhuman-rpc/src/host.rs
+++ b/crates/openhuman-rpc/src/host.rs
@@@ -5,7 -5,7 +5,7 @@@
//! |---|---|---|
//! | [`cli`] | `tinyhumans::install` → `server::install_cli_server` → `run_core_from_args` | [`cli_builder`]: the `cli` preset, connected, with the server launcher and the `http_host` controllers |
//! | [`desktop`] | `tinyhumans::install` + `server::run_server_embedded_with_ready` | [`desktop_builder`]: the `desktop` preset, connected, with the bearer, listener, services, server launcher and `http_host` controllers |
--//! | [`tui`] | `tinyhumans::install` + `session_store::install` + `CoreBuilder(full, none)` | [`tui_builder`]: the `tui` preset, connected, with the on-disk session store |
++//! | [`tui`] | `tinyhumans::install` + `session_store::install_for_host` + `CoreBuilder(full, none)` | [`tui_builder`]: the `tui` preset, connected, with the on-disk session store ([`tui`] swaps in the configured storage URL's store) |
//!
//! Each `*_builder` returns a [`tinyhumans::RuntimeBuilder`] so a host can
//! adjust it (product identity, hooks, a different ranker) before handing it
@@@ -20,7 -20,7 +20,9 @@@
//! - The desktop and CLI servers install the on-disk session store for the
//! life of the process (see `server::shims::build_and_serve`), exactly as the
//! `run_server*` shims do; the TUI hands it to the builder, which restores
--//! the previous provider when its runtime drops at exit.
++//! the previous provider when its runtime drops at exit. Both honour a
++//! storage URL (`OPENHUMAN_STORAGE_URL`, else `[storage] url`): with one,
++//! conversations live in that backend instead of the on-disk layout.
//! - Builder seams follow embed's install/restore rules: the hosted and
//! `http_host` controllers and the server launcher stay for the process; the
//! Jev ranker is restored when the runtime drops. A desktop server that
@@@ -183,14 -183,14 +185,27 @@@ pub fn tui_builder() -> RuntimeBuilder
/// core for the session; `Runtime::core_runtime` hands the TUI its
/// `CoreRuntime`.
///
++/// Conversations stay in the classic on-disk layout, as the desktop keeps
++/// them, unless a storage URL (`OPENHUMAN_STORAGE_URL` / `[storage] url`) is
++/// set: then [`tui_builder`]'s on-disk store is replaced with the storage-backed
++/// one ([`crate::session_store::provider_for_host`]).
++///
/// # Errors
///
--/// The transport or runtime could not be built.
++/// A configured storage URL could not be opened, or the transport or runtime
++/// could not be built.
#[cfg(feature = "session-store")]
--pub async fn tui(
--) -> Result<openhuman_tinyhumans::embed::Runtime, openhuman_tinyhumans::RuntimeError> {
++pub async fn tui() -> anyhow::Result<openhuman_tinyhumans::embed::Runtime> {
log::debug!("[rpc:host] tui: building connected runtime");
-- let runtime = tui_builder().build().await?;
++ let session_store = crate::session_store::provider_for_host().await?;
++ let runtime = tui_builder()
++ .session_store(session_store)
++ .build()
++ .await
++ .map_err(|error| {
++ log::warn!("[rpc:host] tui: runtime build failed: {error}");
++ anyhow::Error::new(error)
++ })?;
log::info!("[rpc:host] tui: core built (DomainSet::full, ServiceSet::none)");
Ok(runtime)
}
diff --cc crates/openhuman-rpc/src/session_store/README.md
index 9142365a07,16258e05a7..e9fc263e5a
--- a/crates/openhuman-rpc/src/session_store/README.md
+++ b/crates/openhuman-rpc/src/session_store/README.md
@@@ -39,8 -39,9 +39,9 @@@ run-ledger rows a dead process left run
shims in [`../server/`](../server/README.md) (and so `host::desktop`) call it
for the life of the process. `provider()` returns the same provider for a
runtime builder's `session_store` option, which installs it on build and
- restores the previous one on drop; `host::tui` uses that, and the TUI
- (`crates/openhuman-tui/src/runner.rs`) boots through `host::tui`.
-restores the previous one on drop; `host::tui` uses that. The TUI itself
-still calls `install()` from [`crates/openhuman-tui/src/runner.rs`](../../../openhuman-tui/src/runner.rs) until it
-moves to `host::tui`.
++restores the previous one on drop; `host::tui` uses that (through
++`provider_for_host()`, below), and the TUI
++([`crates/openhuman-tui/src/runner.rs`](../../../openhuman-tui/src/runner.rs)) boots through `host::tui`.
`install()` builds the provider with `resolving(context_workspace_dir)`,
so the workspace is looked up on every `for_agent` call rather than fixed at
@@@ -66,11 -67,37 +67,40 @@@ tinyagents_store/{kv,journal}
turn journal
```
+ ## A storage-backed store instead
+
-`install_for_host()` is what the server shims and the TUI call. With no
++`install_for_host()` is what the server shims call; `host::tui` calls
++`provider_for_host()`, which resolves the same URL and returns the provider
++for its runtime builder instead of installing it process-wide. With no
+ storage URL configured (`OPENHUMAN_STORAGE_URL`, else `[storage] url` in
+ `config.toml`) it is `install()` above, unchanged. With one, it opens that
+ backend (`openhuman_core::storage::open`), makes it the process's storage
+ backend, and installs TinyAgents' `DriverSessionStores` over it instead:
+
+ ```text
+ install_for_host()
+ storage URL? no -> install() (the layout above)
+ yes -> storage::open(url) -> storage::install(backend)
+ DriverSessionStores::new(backend)
+ .recover_on_open(driver != "mongodb")
+ -> agent::session_store::install(provider)
+ ```
+
+ Every agent then gets its own storage scope (its id, or `sha256:` of an id
+ that is not a valid scope), so agents sharing one MongoDB database never see
+ each other's transcripts, turn states, records or journals. A single-process
+ backend (SQLite, memory, files) interrupts an agent's in-flight turns the
+ first time it is opened; MongoDB does not, because another process may own
+ them. A URL that cannot be parsed or opened fails the boot rather than
-falling back to local files. `install_for_url` is the same with the URL
-already resolved, for tests and hosts that read it themselves.
++falling back to local files. `install_for_url` / `provider_for_url` are the
++same with the URL already resolved, for tests and hosts that read it
++themselves.
+
## Layout
| File | What it does |
| --- | --- |
- | `mod.rs` | `SqliteSessionStores` (`at`, `resolving`), its `SessionStoreProvider` impl (`for_agent`, `recover`, `destination_key`, `workspace_dir`), and `install()`. |
-| [`mod.rs`](mod.rs) | `SqliteSessionStores` (`at`, `resolving`), its `SessionStoreProvider` impl (`for_agent`, `recover`, `destination_key`, `workspace_dir`), `install()`, and `install_for_host()` / `install_for_url()`, which install `DriverSessionStores` when a storage URL is configured. |
++| [`mod.rs`](mod.rs) | `SqliteSessionStores` (`at`, `resolving`), its `SessionStoreProvider` impl (`for_agent`, `recover`, `destination_key`, `workspace_dir`), `install()`, `install_for_host()` / `install_for_url()`, which install `DriverSessionStores` when a storage URL is configured, and `provider_for_host()` / `provider_for_url()`, which return that provider for a runtime builder. |
## Key types and entry points
diff --cc crates/openhuman-rpc/src/session_store/mod.rs
index a8d2adb602,bd5b8cfecd..b59a6ccabf
--- a/crates/openhuman-rpc/src/session_store/mod.rs
+++ b/crates/openhuman-rpc/src/session_store/mod.rs
@@@ -148,6 -148,79 +148,115 @@@ pub fn provider() -> Arc<dyn SessionSto
))
}
+ /// Installs the session store the host's configuration asks for, before the
+ /// core boots.
+ ///
+ /// With no storage URL (`OPENHUMAN_STORAGE_URL`, else `[storage] url`) this is
+ /// [`install`]: the classic on-disk layout, unchanged. With one, the backend is
+ /// opened, made the process's storage backend
+ /// ([`crate::core_host::storage::install`]), and TinyAgents'
+ /// `DriverSessionStores` is installed over it: every agent's transcripts, turn
+ /// states, records and journal in that backend, one storage scope per agent.
+ ///
+ /// A single-process backend (SQLite, memory, files) also interrupts an
+ /// agent's in-flight turns the first time it is opened, since only an earlier
+ /// process can have left them. MongoDB does not: several processes may share
+ /// that database, and another one may own those turns.
+ ///
+ /// # Errors
+ ///
+ /// When a URL is configured but cannot be parsed or opened. A deployment that
+ /// asked for a backend must not quietly fall back to local files.
+ pub async fn install_for_host() -> anyhow::Result<()> {
- let url = match std::env::var(crate::core_host::storage::STORAGE_URL_VAR) {
++ install_for_url(configured_storage_url().await).await
++}
++
++/// The session store the host's configuration asks for, as a provider a
++/// runtime builder's `session_store` option takes (what [`crate::host::tui`]
++/// wires). [`install_for_host`] installs the same provider process-wide
++/// instead.
++///
++/// Resolves the storage URL exactly as [`install_for_host`] does and has the
++/// same side effect on the process's storage backend: a configured backend is
++/// opened and installed, and with no URL any earlier backend is cleared.
++///
++/// # Errors
++///
++/// When a URL is configured but cannot be parsed or opened.
++pub async fn provider_for_host() -> anyhow::Result<Arc<dyn SessionStoreProvider>> {
++ provider_for_url(configured_storage_url().await).await
++}
++
++/// The storage URL the host asks for: `OPENHUMAN_STORAGE_URL`, else
++/// `[storage] url` from the config, else `None` (the classic layout).
++async fn configured_storage_url() -> Option<String> {
++ match std::env::var(crate::core_host::storage::STORAGE_URL_VAR) {
+ Ok(url) if !url.trim().is_empty() => Some(url.trim().to_string()),
+ _ => match crate::core_host::config::rpc::load_config_with_timeout().await {
+ Ok(config) => crate::core_host::storage::configured_url(&config),
+ // An unreadable config keeps the desktop booting on the classic
+ // layout, as it always has. Remote deployments pin the backend
+ // with `OPENHUMAN_STORAGE_URL`, which never reads the config.
+ Err(error) => {
- tracing::warn!(
- "[session_store] config unavailable ({error}); keeping the on-disk layout"
++ log::warn!(
++ "[rpc:session_store] config unavailable ({error}); keeping the on-disk layout"
+ );
+ None
+ }
+ },
- };
- install_for_url(url).await
++ }
+ }
+
+ /// [`install_for_host`] with the URL already resolved: `None` installs the
+ /// classic on-disk store, a URL opens that backend and installs
+ /// `DriverSessionStores` over it.
+ ///
+ /// # Errors
+ ///
+ /// When `url` cannot be parsed or opened.
+ pub async fn install_for_url(url: Option<String>) -> anyhow::Result<()> {
++ let provider = provider_for_url(url).await?;
++ log::debug!("[rpc:session_store] installing process-wide (host configuration)");
++ crate::core_host::agent::session_store::install(provider);
++ Ok(())
++}
++
++/// [`provider_for_host`] with the URL already resolved: `None` is the classic
++/// on-disk [`provider`] (any earlier storage backend cleared), a URL opens
++/// that backend, makes it the process's storage backend and returns
++/// `DriverSessionStores` over it.
++///
++/// # Errors
++///
++/// When `url` cannot be parsed or opened.
++pub async fn provider_for_url(
++ url: Option<String>,
++) -> anyhow::Result<Arc<dyn SessionStoreProvider>> {
+ use anyhow::Context as _;
+
+ let Some(url) = url else {
+ // Drop a backend an earlier call installed, so storage operations do
+ // not keep writing to it while the classic layout is in force.
+ crate::core_host::storage::clear();
- install();
- return Ok(());
++ log::debug!("[rpc:session_store] no storage url; classic on-disk layout");
++ return Ok(provider());
+ };
+ let backend = crate::core_host::storage::open(&url)
+ .await
+ .context("opening the configured storage backend")?;
+ let single_process = !crate::core_host::storage::driver_is_shared(backend.driver());
+ let provider = tinyagents_session::DriverSessionStores::new(Arc::clone(&backend))
+ .context("starting the session store bridge")?
+ .recover_on_open(single_process);
+ // Only a fully working bridge makes the backend the process's storage.
+ crate::core_host::storage::install(backend);
- tracing::info!(
- target: "openhuman_rpc::session_store",
- recover_on_open = single_process,
- "[session_store] installed the storage-backed session store"
++ log::info!(
++ "[rpc:session_store] opened the storage-backed session store \
++ recover_on_open={single_process}"
+ );
- crate::core_host::agent::session_store::install(Arc::new(provider));
- Ok(())
++ Ok(Arc::new(provider))
+ }
+
#[cfg(test)]
#[path = "mod_tests.rs"]
mod tests;
diff --cc crates/openhuman-rpc/src/session_store/mod_tests.rs
index 009c79c204,106f03bf42..d0d1db7d4f
--- a/crates/openhuman-rpc/src/session_store/mod_tests.rs
+++ b/crates/openhuman-rpc/src/session_store/mod_tests.rs
@@@ -48,3 -48,121 +48,184 @@@ fn recovery_interrupts_turns_left_in_fl
Some(TurnLifecycle::Interrupted)
);
}
+
+ /// The provider and storage slots are process-wide; these tests take turns.
+ static SLOTS: tokio::sync::Mutex<()> = tokio::sync::Mutex::const_new(());
+
+ /// Puts the process-global storage backend back as a test found it.
+ fn restore_backend(previous: Option<Arc<dyn crate::core_host::storage::StorageBackend>>) {
+ match previous {
+ Some(backend) => {
+ crate::core_host::storage::install(backend);
+ }
+ None => {
+ crate::core_host::storage::clear();
+ }
+ }
+ }
+
+ #[tokio::test]
+ async fn a_storage_url_installs_the_driver_backed_store() {
+ let _turn = SLOTS.lock().await;
+ let previous = crate::core_host::agent::session_store::installed();
+ let previous_backend = crate::core_host::storage::installed();
+ install_for_url(Some("memory".into())).await.unwrap();
+
+ let provider = crate::core_host::agent::session_store::installed().unwrap();
+ assert!(
+ provider
+ .destination_key()
+ .is_some_and(|key| key.starts_with("memory://")),
+ "{:?}",
+ provider.destination_key()
+ );
+ assert_eq!(
+ crate::core_host::storage::installed().map(|b| b.driver()),
+ Some("memory")
+ );
+ // Agents are kept apart in the shared backend.
+ let alice = provider.for_agent("alice");
+ alice
+ .turn_states
+ .put(&TurnState::started("t", "r", 8, "2026-01-01T00:00:00Z"))
+ .unwrap();
+ assert!(provider
+ .for_agent("bob")
+ .turn_states
+ .get("t")
+ .unwrap()
+ .is_none());
+
+ restore_backend(previous_backend);
+ crate::core_host::agent::session_store::restore(previous);
+ }
+
+ #[tokio::test]
+ async fn no_url_keeps_the_classic_layout() {
+ let _turn = SLOTS.lock().await;
+ let previous = crate::core_host::agent::session_store::installed();
+ let previous_backend = crate::core_host::storage::installed();
+ install_for_url(None).await.unwrap();
+ let provider = crate::core_host::agent::session_store::installed().unwrap();
+ assert!(
+ provider.workspace_dir().is_some(),
+ "the file layout is installed"
+ );
+ assert!(crate::core_host::storage::installed().is_none());
+ restore_backend(previous_backend);
+ crate::core_host::agent::session_store::restore(previous);
+ }
+
+ #[tokio::test]
+ async fn an_unusable_url_fails_the_boot() {
+ let _turn = SLOTS.lock().await;
+ let previous = crate::core_host::agent::session_store::installed();
+ let error = install_for_url(Some("ftp://nowhere".into()))
+ .await
+ .unwrap_err();
+ assert!(format!("{error:#}").contains("storage"), "{error:#}");
+ crate::core_host::agent::session_store::restore(previous);
+ }
+
+ #[tokio::test]
+ async fn restoring_the_classic_layout_clears_a_previous_backend() {
+ let _turn = SLOTS.lock().await;
+ let previous = crate::core_host::agent::session_store::installed();
+ let previous_backend = crate::core_host::storage::installed();
+ install_for_url(Some("memory".into())).await.unwrap();
+ assert!(crate::core_host::storage::installed().is_some());
+ install_for_url(None).await.unwrap();
+ assert!(crate::core_host::storage::installed().is_none());
+ restore_backend(previous_backend);
+ crate::core_host::agent::session_store::restore(previous);
+ }
+
+ #[tokio::test]
+ async fn the_host_reads_the_storage_url_from_the_environment() {
+ let _turn = SLOTS.lock().await;
+ let previous = crate::core_host::agent::session_store::installed();
+ let previous_backend = crate::core_host::storage::installed();
+ let var = crate::core_host::storage::STORAGE_URL_VAR;
+ let old = std::env::var_os(var);
+
+ std::env::set_var(var, " memory ");
+ let booted = install_for_host().await;
+ let driver = crate::core_host::storage::installed().map(|b| b.driver());
+
+ std::env::set_var(var, "ftp://nowhere");
+ let refused = install_for_host().await;
+
+ match old {
+ Some(value) => std::env::set_var(var, value),
+ None => std::env::remove_var(var),
+ }
+ restore_backend(previous_backend);
+ crate::core_host::agent::session_store::restore(previous);
+
+ booted.unwrap();
+ assert_eq!(driver, Some("memory"));
+ assert!(refused.is_err(), "an unusable env URL fails the boot");
+ }
++
++#[tokio::test]
++async fn provider_for_url_returns_the_store_without_installing_it() {
++ let _turn = SLOTS.lock().await;
++ let previous = crate::core_host::agent::session_store::installed();
++ let previous_backend = crate::core_host::storage::installed();
++ crate::core_host::agent::session_store::restore(None);
++
++ let backed = provider_for_url(Some("memory".into())).await.unwrap();
++ let backed_key = backed.destination_key();
++ let backend_driver = crate::core_host::storage::installed().map(|b| b.driver());
++ let left_uninstalled = crate::core_host::agent::session_store::installed().is_none();
++
++ let classic = provider_for_url(None).await.unwrap();
++ let cleared = crate::core_host::storage::installed().is_none();
++
++ restore_backend(previous_backend);
++ crate::core_host::agent::session_store::restore(previous);
++
++ assert!(
++ backed_key
++ .as_deref()
++ .is_some_and(|key| key.starts_with("memory://")),
++ "{backed_key:?}"
++ );
++ assert_eq!(backend_driver, Some("memory"), "the backend is installed");
++ assert!(
++ left_uninstalled,
++ "the provider is handed back, not installed"
++ );
++ assert!(
++ classic.workspace_dir().is_some(),
++ "no URL is the file layout"
++ );
++ assert!(cleared, "no URL clears an earlier backend");
++}
++
++#[tokio::test]
++async fn provider_for_host_reads_the_storage_url_from_the_environment() {
++ let _turn = SLOTS.lock().await;
++ let previous_backend = crate::core_host::storage::installed();
++ let var = crate::core_host::storage::STORAGE_URL_VAR;
++ let old = std::env::var_os(var);
++
++ std::env::set_var(var, "memory");
++ let booted = provider_for_host().await.map(|p| p.destination_key());
++ std::env::set_var(var, "ftp://nowhere");
++ let refused = provider_for_host().await;
++
++ match old {
++ Some(value) => std::env::set_var(var, value),
++ None => std::env::remove_var(var),
++ }
++ restore_backend(previous_backend);
++
++ let key = booted.unwrap();
++ assert!(
++ key.as_deref()
++ .is_some_and(|key| key.starts_with("memory://")),
++ "{key:?}"
++ );
++ assert!(refused.is_err(), "an unusable env URL fails the TUI boot");
++}
diff --cc crates/openhuman-tinyhumans/src/jev/README.md
index f8240eb994,c15b37fff6..46c40c3abd
--- a/crates/openhuman-tinyhumans/src/jev/README.md
+++ b/crates/openhuman-tinyhumans/src/jev/README.md
@@@ -123,11 -123,11 +123,12 @@@ default is 3 s
## Tests
- `ranker_tests.rs`, `route_tests.rs` and `evaluator_tests.rs` sit beside their
+ [`ranker_tests.rs`](ranker_tests.rs), [`route_tests.rs`](route_tests.rs) and [`evaluator_tests.rs`](evaluator_tests.rs) sit beside their
modules and use the config and env seams rather than the process
-environment. The ranker comparison harness is a separate binary, `tool-search-bench`, in
-the `profile/` crate of [openhuman-benchmarks](https://github.com/tinyhumansai/openhuman-benchmarks)
+environment. The ranker comparison harness (`tool-search-bench`) moved out of
- `openhuman-cli` with the other benchmarks, to the openhuman-benchmarks
- repository (#6944).
++`openhuman-cli` with the other benchmarks (#6944), to the `profile/` crate of
++[openhuman-benchmarks](https://github.com/tinyhumansai/openhuman-benchmarks)
+ (`cargo run --manifest-path profile/Cargo.toml --bin tool-search-bench`).
```bash
cargo test -p openhuman-tinyhumans jev::
diff --cc crates/openhuman-tui/Cargo.toml
index f01aa00480,af4605dbe7..91052d788b
--- a/crates/openhuman-tui/Cargo.toml
+++ b/crates/openhuman-tui/Cargo.toml
@@@ -7,44 -7,9 +7,48 @@@ license.workspace = tru
repository.workspace = true
publish = false
+# Every gate forwards to `openhuman-rpc` alone (chain: core -> embed ->
+# tinyhumans -> rpc -> app/cli/tui); `scripts/ci/check-feature-forwarding.mjs`
+# checks the link. `default` is the set the TUI ships with, named explicitly:
+# the core's contributor gates minus `http-server` (the TUI drives the core
+# in-process and never serves it), plus Sentry. It used to arrive implicitly
+# through a bare workspace `openhuman-core` dependency, which turned on the
+# core's whole `default`.
[features]
-default = ["crash-reporting"]
-crash-reporting = ["dep:dotenvy", "dep:sentry", "openhuman-core/crash-reporting"]
+default = [
+ "crash-reporting",
+ "media",
+ "skills",
+ "flows",
+ "mcp",
+ "channels",
+ "scheduler-gate",
+ "file-logging",
+ "modules",
+]
+crash-reporting = ["openhuman-rpc/crash-reporting"]
+jev = ["openhuman-rpc/jev"]
+http-server = ["openhuman-rpc/http-server"]
+inference = ["openhuman-rpc/inference"]
+documents = ["openhuman-rpc/documents"]
+hosting = ["openhuman-rpc/hosting"]
+modules = ["openhuman-rpc/modules"]
+voice = ["openhuman-rpc/voice"]
+web3 = ["openhuman-rpc/web3"]
++# Storage drivers for `[storage] url` / `OPENHUMAN_STORAGE_URL`.
++storage-sqlite = ["openhuman-rpc/storage-sqlite"]
++storage-mongodb = ["openhuman-rpc/storage-mongodb"]
++storage-file = ["openhuman-rpc/storage-file"]
+runtime-node = ["openhuman-rpc/runtime-node"]
+media = ["openhuman-rpc/media"]
+flows = ["openhuman-rpc/flows"]
+skills = ["openhuman-rpc/skills"]
+mcp = ["openhuman-rpc/mcp"]
+channels = ["openhuman-rpc/channels"]
+whatsapp-web = ["openhuman-rpc/whatsapp-web"]
+file-logging = ["openhuman-rpc/file-logging"]
+scheduler-gate = ["openhuman-rpc/scheduler-gate"]
+e2e-test-support = ["openhuman-rpc/e2e-test-support"]
[[bin]]
name = "openhuman-tui"
diff --cc crates/openhuman-tui/src/runner.rs
index 5a488d1aa4,8bfe6664a9..59939a204c
--- a/crates/openhuman-tui/src/runner.rs
+++ b/crates/openhuman-tui/src/runner.rs
@@@ -161,15 -168,26 +161,16 @@@ async fn async_main
prefer_existing: bool,
options: super::app::LaunchOptions,
) -> anyhow::Result<()> {
- // The core reaches the hosted backend (login, billing, integrations) only
- // through the transport `openhuman-tinyhumans` installs; bind it to the
- // runtime explicitly rather than relying on the process global.
- let backend_transport =
- openhuman_tinyhumans::install(openhuman_tinyhumans::InstallOptions::default())?;
-
- // In-process core: full domains (channel.web_chat needs DomainGroup::Channels,
- // so harness() is not enough), no RPC transport, no background services.
- // Conversations in the classic on-disk layout, as the desktop keeps them,
- // unless a storage URL (`OPENHUMAN_STORAGE_URL` / `[storage] url`) is set.
- openhuman_rpc::session_store::install_for_host().await?;
- let runtime = Arc::new(
- CoreBuilder::new(HostKind::detect_standalone())
- .domains(DomainSet::full())
- .services(ServiceSet::none())
- .backend_transport(backend_transport)
- .build()
- .await?,
- );
- log::info!("[tui] core built (DomainSet::full, ServiceSet::none)");
+ // In-process core, connected to the TinyHumans backend (login, billing,
+ // integrations): full domains (channel.web_chat needs the channels family,
+ // so harness() is not enough), no RPC transport, no background services,
+ // and conversations in the classic on-disk layout, as the desktop keeps
- // them. `host` owns the core for the whole session: it must outlive the
++ // them, unless a storage URL (`OPENHUMAN_STORAGE_URL` / `[storage] url`)
++ // is set. `host` owns the core for the whole session: it must outlive the
+ // event loop below, so it is held until `app::run` returns.
+ let host = openhuman_rpc::host::tui().await?;
+ let runtime = Arc::clone(host.core_runtime());
+ log::debug!("[tui] runtime ready runtime_id={}", host.runtime_id());
// ServiceSet::none intentionally skips channel startup. The TUI is itself
// an interactive surface, so bridge approval, plan-review, artifact, and
diff --cc gitbooks/developing/architecture.md
index daf03c1faa,2370715f8a..d5965a26de
--- a/gitbooks/developing/architecture.md
+++ b/gitbooks/developing/architecture.md
@@@ -15,62 -19,21 +19,62 @@@ OpenHuman ships for desktop only: Windo
| Path | Contents |
| --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
- | **`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; depends on `openhuman-rpc` only and hosts the core as an in-process tokio task (`src/core_process.rs`, `openhuman_rpc::host::desktop`). |
- | **`crates/openhuman-core/`** | Cargo package **`openhuman`**: library **`openhuman_core`**, with no `tinyhumans-sdk` dependency — the hosted backend is reached through the `backend::transport::BackendTransport` port, except hosted memory, which `vendor/tinymemory`'s own HTTP client calls (see `memory/engine.rs`). Flat domain modules directly under `src/` (`agent`, `backend`, `channels`, `config`, `cron`, `desktop`, `flows`, `hooks`, `hosting`, `inference`, `integrations`, `mcp`, `media`, `memory`, `modules`, `platform`, `runtime`, `sandbox`, `search`, `security`, `skills`, `threads`, `tools`, `util`, `voice`, `web3`, `web_chat`, …). `src/core/` holds the 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). The core does **not** depend on this crate and does not re-export it: the controller contract (`Outcome`, `ControllerSchema`, `StructuredRpcError`, params rules, in-process dispatch) lives in `crates/openhuman-core/src/core/`, and this crate sits above it. Behind `server` it also owns the `http_host` static-directory file server and registers its controllers as a core extension. |
- | **`crates/openhuman-embed/`** | Typed library facade (`Runtime`/`RuntimeBuilder` → `Agent`, host presets, `embed::process`, and the `config` / `artifacts` / `chat_surface` / `modules` facades) 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/`, all on the SDK's typed clients through one `hosted::client::HostedClient`: billing, team and usage, referral, announcements, webhook tunnels, managed Telegram/Discord linking, and backend-brokered OAuth — registered into the core's controller registry as an extension, some sharing the core's `auth` / `channels` / `webhooks` namespaces), and the host-side login/session owner (`session/`). A user without a TinyHumans account gets the core's `BACKEND_UNAVAILABLE:` sentinel from these without a request. |
- | **`crates/openhuman-cli/`** | The `openhuman-core` binary (`openhuman_rpc::host::cli`), the ops bins, and every root `tests/*.rs` / `examples/*.rs` target (which reach the core through dev-dependencies). |
- | **`crates/openhuman-tui/`** | Standalone ratatui terminal frontend. Boots the core in-process via `openhuman_rpc::host::tui` (every domain, no background services), 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). |
- | **`crates/openhuman-core/src/skills/`** | Skill metadata and run orchestration (`ops_create`, `ops_discover`, `ops_install`, `ops_parse`, `catalog/`, `registry`, `runtime/`, `schemas/`, `types`, `bundled/`, `webhooks/`). The legacy QuickJS / `rquickjs` skill execution runtime was removed; skills contribute metadata + tool descriptors that get injected into agent prompts, while tool execution flows through native Rust handlers and Node-backed helpers via `runtime::node` (Cargo feature `runtime-node`). |
- | **`gitbooks/`** | This book (public product and contributor documentation). |
- | **`docs/`** | Internal maintainer documentation (test-coverage matrix, release smoke checklist, library benchmarking notes). |
- | **`vendor/`** | Recursive git submodules for the `tiny*` crate family (`tinyagents`, `tinyflows`, `tinychannels`, `tinyjuice`, `tinymemory`, `tinymcp`, `tinybus`, `tinybox`, `tinycomputer`, `tinyruntime`, `tinydocs`, `tinysearch`, `tinyskills`, `tinyvoice`, `tinywallet`, `tinyhosts`, `tinyconnectors`, `tinyhumans-sdk`) plus `motosan-ai-oauth`. |
-
- The desktop app **WebView** loads the UI from `app/`; RPC, agents and skills run in the **`openhuman_core`** core, hosted in-process as a tokio task by the Tauri shell (`crates/openhuman-app/src/core_process.rs`, `openhuman_rpc::host::desktop`) and reachable over loopback HTTP. The renderer's `coreRpcClient` `fetch()`es `http://127.0.0.1:<port>/rpc` directly; the `relay_http_rpc` Tauri command (backed by `openhuman_rpc::post_json_rpc`) is only the fallback for non-loopback plain-`http://` runtimes that the webview would block as mixed content. The standalone `openhuman-core serve` binary is the CLI/debug path.
+ | `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-app/` | Thin Tauri v2 desktop host (Cargo package `openhuman-app`). Built from its own manifest and lockfile, excluded from the root workspace; depends on `openhuman-rpc` only and hosts the core as an in-process tokio task (`src/core_process.rs`, `openhuman_rpc::host::desktop`). |
+ | `crates/openhuman-core/` | Cargo package `openhuman`, library `openhuman_core`, with no `tinyhumans-sdk` dependency. The hosted backend is reached through the `backend::transport::BackendTransport` port, except hosted memory, which `vendor/tinymemory`'s own HTTP client calls (see `memory/engine.rs`). Flat domain modules directly under `src/` (`agent`, `backend`, `channels`, `config`, `cron`, `desktop`, `flows`, `hooks`, `hosting`, `inference`, `integrations`, `mcp`, `media`, `memory`, `modules`, `platform`, `runtime`, `sandbox`, `search`, `security`, `skills`, `threads`, `tools`, `util`, `voice`, `web3`, `web_chat`, …). `src/core/` holds the CLI (`cli.rs`), dispatch, controller registry (`all.rs`), event bus (`bus.rs`), `runtime/` (`CoreBuilder`/`CoreRuntime`) and `subsystem/`. |
+ | `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). The core does not depend on this crate and does not re-export it: the controller contract (`Outcome`, `ControllerSchema`, `StructuredRpcError`, params rules, in-process dispatch) lives in `crates/openhuman-core/src/core/`, and this crate sits above it. Behind `server` it also owns the `http_host` static-directory file server and registers its controllers as a core extension. |
-| `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/`, all on the SDK's typed clients through one `hosted::client::HostedClient`: billing, team and usage, referral, announcements, webhook tunnels, managed Telegram/Discord linking, and backend-brokered OAuth), registered into the core's controller registry as an extension, some sharing the core's `auth` / `channels` / `webhooks` namespaces), and the host-side login/session owner (`session/`). A user without a TinyHumans account gets the core's `BACKEND_UNAVAILABLE:` sentinel from these without a request. |
-| `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. |
++| `crates/openhuman-embed/` | Typed library facade (`Runtime`/`RuntimeBuilder` → `Agent`, host presets, `embed::process`, and the `config` / `artifacts` / `chat_surface` / `modules` facades) 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/`, all on the SDK's typed clients through one `hosted::client::HostedClient`: billing, team and usage, referral, announcements, webhook tunnels, managed Telegram/Discord linking, and backend-brokered OAuth; registered into the core's controller registry as an extension, some sharing the core's `auth` / `channels` / `webhooks` namespaces), and the host-side login/session owner (`session/`). A user without a TinyHumans account gets the core's `BACKEND_UNAVAILABLE:` sentinel from these without a request. |
++| `crates/openhuman-cli/` | The `openhuman-core` binary (`openhuman_rpc::host::cli`), the ops bins, and every root `tests/*.rs` / `examples/*.rs` target (which reach the core through dev-dependencies). The benchmark bins live in [openhuman-benchmarks](https://github.com/tinyhumansai/openhuman-benchmarks). |
++| `crates/openhuman-tui/` | Standalone ratatui terminal frontend. Boots the core in-process via `openhuman_rpc::host::tui` (every domain, no background services), 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. |
+ | `crates/openhuman-core/src/skills/` | Skill metadata and run orchestration (`ops_create`, `ops_discover`, `ops_install`, `ops_parse`, `catalog/`, `registry`, `runtime/`, `schemas/`, `types`, `bundled/`, `webhooks/`). Skills contribute metadata and tool descriptors that are injected into agent prompts. Tool execution flows through native Rust handlers and Node-backed helpers via `runtime::node` (Cargo feature `runtime-node`). |
+ | `gitbooks/` | This book (public product and contributor documentation). |
+ | `docs/` | Internal maintainer documentation (test-coverage matrix, release smoke checklist, library benchmarking notes). |
+ | `vendor/` | Recursive git submodules for the `tiny*` crate family (`tinyagents`, `tinyflows`, `tinychannels`, `tinyjuice`, `tinymemory`, `tinymcp`, `tinybus`, `tinybox`, `tinycomputer`, `tinyruntime`, `tinydocs`, `tinysearch`, `tinyskills`, `tinyvoice`, `tinywallet`, `tinyhosts`, `tinyconnectors`, `tinyhumans-sdk`) plus `motosan-ai-oauth`. |
+
-The desktop app's webview loads the UI from `app/`. RPC, agents and skills run in the `openhuman_core` core, hosted in-process as a tokio task by the Tauri shell (`crates/openhuman-app/src/core_process.rs`, `run_server_embedded_with_ready`) and reachable over loopback HTTP. The renderer's `coreRpcClient` `fetch()`es `http://127.0.0.1:<port>/rpc` directly. The `relay_http_rpc` Tauri command (backed by `openhuman_rpc::post_json_rpc`) is only the fallback for non-loopback plain-`http://` runtimes that the webview would block as mixed content. The standalone `openhuman-core serve` binary is the CLI/debug path.
++The desktop app's webview loads the UI from `app/`. RPC, agents and skills run in the `openhuman_core` core, hosted in-process as a tokio task by the Tauri shell (`crates/openhuman-app/src/core_process.rs`, `openhuman_rpc::host::desktop`) and reachable over loopback HTTP. The renderer's `coreRpcClient` `fetch()`es `http://127.0.0.1:<port>/rpc` directly. The `relay_http_rpc` Tauri command (backed by `openhuman_rpc::post_json_rpc`) is only the fallback for non-loopback plain-`http://` runtimes that the webview would block as mixed content. The standalone `openhuman-core serve` binary is the CLI/debug path.
+
+### Crate layering
+
+The Rust crates form a strict chain. Each crate's normal dependencies name only
+the layer directly below it, and the three hosts name `openhuman-rpc` alone:
+
+```text
+ openhuman-app openhuman-cli openhuman-tui
+ (desktop shell) (openhuman-core) (terminal UI)
+ \ | /
+ +-------------------+-------------------+
+ |
+ v
+ openhuman-rpc host::{desktop, cli, tui},
+ | JSON-RPC server + client,
+ | session store
+ v
+ openhuman-tinyhumans SDK transport, hosted
+ | proxies, session owner
+ v
+ openhuman-embed Runtime/RuntimeBuilder,
+ | process helpers, facades
+ v
+ openhuman-core domains, registry, ports
+```
+
+- **Hosts boot through `openhuman_rpc::host`.** `host::desktop` is the shell's
+ embedded server, `host::cli` the `openhuman-core` binary (and the shell's
+ `core` / `mcp` subcommands), `host::tui` the terminal UI's runtime. Each one
+ connects the TinyHumans layer and builds an embed `Runtime`; there is one per
+ process.
+- **Hosts reach the core only through the curated facade** rpc re-exports
+ (`openhuman_rpc::embed`, `openhuman_rpc::tinyhumans`). The layers above embed
+ use embed's doc-hidden `__host` list for the server and transport internals;
+ hosts never do.
+- **Enforced in CI.** `scripts/ci/check-crate-chain.mjs` (part of
+ `pnpm rust:layout`) fails on any other normal-dependency edge and on a host
+ `src/` naming `__host`, `core_host` or `openhuman_core::`.
+ `scripts/ci/check-feature-forwarding.mjs` checks that every gate travels the
+ same chain. Dev-dependencies are exempt, so the root tests still reach into
+ the core.
---
diff --cc gitbooks/developing/architecture/tauri-shell.md
index ce1c1368c2,a949a413a5..27f8d4045c
--- a/gitbooks/developing/architecture/tauri-shell.md
+++ b/gitbooks/developing/architecture/tauri-shell.md
@@@ -5,55 -5,17 +5,55 @@@ description: >
icon: desktop
---
- # Tauri Shell
+ # Tauri shell
- `crates/openhuman-app/` is the desktop host for OpenHuman: Tauri v2 and WebView, IPC commands, window management, and the bridge to the embedded `openhuman-core` Rust runtime over core JSON-RPC. It does **not** duplicate the full domain stack; that lives in `crates/openhuman-core` (library `openhuman_core`; the `openhuman-core` binary is `crates/openhuman-cli/src/main.rs`).
+ `crates/openhuman-app/` is the desktop host for OpenHuman. It provides the Tauri v2 webview, IPC commands and window management, and bridges to the embedded `openhuman-core` Rust runtime over core JSON-RPC. It does not duplicate the domain stack. That lives in `crates/openhuman-core` (library `openhuman_core`; the `openhuman-core` binary is `crates/openhuman-cli/src/main.rs`).
+### Where the shell sits
+
+The shell is one of three hosts on top of a strict crate chain, and
+`openhuman-rpc` is the only OpenHuman crate in its `Cargo.toml`:
+
+```text
+ openhuman-app (this crate)
+ | [dependencies] openhuman-rpc (http-client, server, jev + the product gates)
+ v
+ openhuman-rpc ----------> host::desktop / host::cli, server, client
+ | re-exports `embed` and `tinyhumans`
+ v
+ openhuman-tinyhumans ---> SDK transport, session owner (`session/` uses it)
+ |
+ v
+ openhuman-embed --------> Runtime, process helpers (tokio runtime, logging,
+ | Sentry options), config/artifacts/modules facades
+ v
+ openhuman-core
+```
+
+| Shell code | Goes through |
+| --- | --- |
+| Embedded server (`core_process.rs`) | `openhuman_rpc::host::desktop(DesktopOptions { port, rpc_token, .. }, shutdown, ready_tx)` |
+| `OpenHuman core …` / `mcp` subcommands (`lib.rs::run_core_from_args`) | `openhuman_rpc::host::cli(args)` |
+| Tauri async runtime sizing (`lib.rs::run`) | `openhuman_rpc::embed::process::tokio_runtime()` |
+| Sentry client (`lib.rs::run`) | `openhuman_rpc::embed::process::sentry::client_options` (the shared `before_send` chain; fallback user id from `session::peek_user_id`) |
+| File logging (`file_logging.rs`), data reset log handle | `openhuman_rpc::embed::process::{init_for_embedded, log_directory, shutdown_file_guard}` |
+| Config / workspace paths, artifacts, bundled modules | `openhuman_rpc::embed::{config, artifacts, modules}` |
+| Session owner (`session/`) | `openhuman_rpc::tinyhumans` |
+| Compile-time asserts | `openhuman_rpc::embed::{VOICE_COMPILED_IN, HTTP_SERVER_COMPILED_IN}` |
+
+`scripts/ci/check-crate-chain.mjs` fails if the shell's manifest names
+another OpenHuman crate or its `src/` names `__host`, `core_host` or
+`openhuman_core::`. One embed runtime exists per process: when the shell
+restarts its embedded server, `CoreProcessHandle` waits for the old task (and
+the runtime it owns) to drop before it spawns the next one.
+
## Responsibilities
- 1. **Web UI**. Load the Vite build from `app/dist` (or dev server on port 1420).
- 2. **IPC**. Expose an explicit set of Tauri commands (see [Commands](#tauri-ipc-commands-cratesopenhuman-app)).
- 3. **Core lifecycle**. Run the core JSON-RPC server as an in-process tokio task (`core_process.rs`) and hand the renderer its URL/bearer via `core_rpc_url` / `core_rpc_token`.
- 4. **Window + tray**. Desktop window behavior (main, mascot, notch, overlay windows) and system tray (see `lib.rs`).
- 5. **Session ownership**. Log the user in and keep the current user fresh (`session/`, backed by `openhuman_tinyhumans::session`): exchange the login token, validate the JWT against `GET /auth/me`, cache `/auth/me`, and hand the resulting credential to the core with `auth.set_credential`. The core never talks to the backend's auth endpoints itself.
+ 1. Web UI. Load the Vite build from `app/dist` (or dev server on port 1420).
+ 2. IPC. Expose an explicit set of Tauri commands (see [Tauri IPC commands](#tauri-ipc-commands-cratesopenhuman-app)).
+ 3. Core lifecycle. Run the core JSON-RPC server as an in-process tokio task (`core_process.rs`) and hand the renderer its URL/bearer via `core_rpc_url` / `core_rpc_token`.
+ 4. Window and tray. Desktop window behavior (main, mascot, notch, overlay windows) and system tray (see `lib.rs`).
+ 5. Session ownership. Log the user in and keep the current user fresh (`session/`, backed by `openhuman_tinyhumans::session`): exchange the login token, validate the JWT against `GET /auth/me`, cache `/auth/me`, and hand the resulting credential to the core with `auth.set_credential`. The core never talks to the backend's auth endpoints itself.
## Core process model
@@@ -126,9 -81,9 +119,9 @@@ React (fetch
→ embedded openhuman core server (tokio task in this process)
```
- The renderer talks to the local core **directly over HTTP**: `app/src/services/coreRpcClient.ts` invokes `core_rpc_url` / `core_rpc_token` once, then issues plain `fetch()` calls. The `relay_http_rpc` Tauri command is a host-side fallback used only when the RPC URL is **not** a trustworthy origin for the secure `tauri://localhost` webview (e.g. a self-hosted runtime on a LAN IP, blocked as mixed content, #3865). In that case the Rust host delegates to `openhuman_rpc::post_json_rpc` from the shared `crates/openhuman-rpc` crate (feature `http-client`): 30 s timeout, redirects disabled when a bearer is present, status + body mirrored back verbatim as `HttpRpcResponse`. The shell adds only the gateway transport guard (`validate_remote_transport`, feature `gateways`) before delegating.
+ The renderer talks to the local core directly over HTTP: `app/src/services/coreRpcClient.ts` invokes `core_rpc_url` / `core_rpc_token` once, then issues plain `fetch()` calls. The `relay_http_rpc` Tauri command is a host-side fallback used only when the RPC URL is not a trustworthy origin for the secure `tauri://localhost` webview (for example a self-hosted runtime on a LAN IP, blocked as mixed content). In that case the Rust host delegates to `openhuman_rpc::post_json_rpc` from the shared `crates/openhuman-rpc` crate (feature `http-client`): 30 s timeout, redirects disabled when a bearer is present, status + body mirrored back verbatim as `HttpRpcResponse`. The shell adds only the gateway transport guard (`validate_remote_transport`, feature `gateways`) before delegating.
-`CoreProcessHandle` in `core_process.rs` owns the embedded server task (started via `openhuman_rpc::server::run_server_embedded_with_ready` with a per-launch random bearer token) and handles stale-listener/port-conflict recovery.
+`CoreProcessHandle` in `core_process.rs` owns the embedded server task (started via `openhuman_rpc::host::desktop` with a per-launch random bearer token) and handles stale-listener/port-conflict recovery.
### Window and tray behavior
@@@ -204,13 -159,13 +197,13 @@@ install's data, and *this* machine's au
wrong rather than incomplete.
Gated by the shell-local `gateways` Cargo feature (default on). That gate is unrelated to
-the feature-forwarding rules in `AGENTS.md`, which govern which `openhuman_core` gates the
-shell forwards; nothing here belongs in `scripts/ci/product-features.txt`.
+the feature-forwarding rules in `AGENTS.md`, which govern which core gates the shell
+forwards on its `openhuman-rpc` dependency; nothing here belongs in `scripts/ci/product-features.txt`.
- Frontend: **`app/src/services/gatewayService.ts`**, surfaced in Settings → Core connection
+ Frontend: `app/src/services/gatewayService.ts`, surfaced in Settings → Core connection
(`components/settings/panels/core/GatewaySection.tsx`).
- ### Core & app lifecycle
+ ### Core and app lifecycle
| Command | Purpose |
| ------------------------------------------------- | --------------------------------------------- |
@@@ -346,9 -301,9 +339,9 @@@ The Tauri crate does not embed a duplic
### `CoreProcessHandle` (`core_process.rs`)
- - Runs the core's HTTP/JSON-RPC server as a **tokio task inside the Tauri host** via `openhuman_rpc::host::desktop`: no sidecar binary. The runtime the task builds is dropped when the task ends; `shutdown` and the startup-timeout abort wait for that before a respawn, because a process holds one embed runtime at a time.
-- Runs the core's HTTP/JSON-RPC server as a tokio task inside the Tauri host via `openhuman_rpc::server::run_server_embedded_with_ready`: no sidecar binary.
++- Runs the core's HTTP/JSON-RPC server as a tokio task inside the Tauri host via `openhuman_rpc::host::desktop`: no sidecar binary. The runtime the task builds is dropped when the task ends; `shutdown` and the startup-timeout abort wait for that before a respawn, because a process holds one embed runtime at a time.
- Generates a per-launch 256-bit hex bearer token (`generate_rpc_token`) and hands it to the embedded server; the renderer reads it via the `core_rpc_token` command.
- - Stale-listener policy (#1130): if the core port is already occupied, probes whether the listener is an old OpenHuman core (terminate + respawn) or something foreign (surface the conflict). `OPENHUMAN_CORE_REUSE_EXISTING=1` opts back into attach-to-existing for debugging.
+ - Stale-listener policy: if the core port is already occupied, probes whether the listener is an old OpenHuman core (terminate + respawn) or something foreign (surface the conflict). `OPENHUMAN_CORE_REUSE_EXISTING=1` opts back into attach-to-existing for debugging.
- Managed as Tauri state in `lib.rs` (`app.manage(core_handle)`).
### `core_rpc` (`core_rpc.rs`)
diff --cc scripts/ci/README.md
index 86fa87aa27,40009e736f..a756855e86
--- a/scripts/ci/README.md
+++ b/scripts/ci/README.md
@@@ -6,17 -6,17 +6,18 @@@ authoritative spec; this is an index s
| File | Checks |
| --- | --- |
- | `check-openhuman-rust-layout.mjs` (`pnpm rust:layout`) | Every file under `crates/openhuman-core/src` stays under a 750-line ceiling, warning (without failing) past 725; oversized files are pinned at their exact size in `LEGACY_LIMIT_ENTRIES`, once each, and a pinned file that shrinks must lower or drop its pin; forbids inline `#[cfg(test)] mod` blocks and `tests.rs`/`test.rs` filenames; and asserts every root `tests/*.rs` / `examples/*.rs` has a matching `[[test]]`/`[[example]]` entry in `crates/openhuman-core/Cargo.toml`. |
- | `check-feature-forwarding.mjs` | The Tauri shell (`crates/openhuman-app/Cargo.toml`, which sets `default-features = false`) forwards exactly the gates in `product-features.txt` — no more, no less — and the library chain that re-declares the core's gates (`openhuman-embed` → `openhuman-tinyhumans` → `openhuman-rpc` → `openhuman-cli` / `openhuman-tui`) forwards every one of them, by target and not just by name. The shell's list is read from its `openhuman-rpc` dependency. Logic lives in `scripts/lib/feature-forwarding.mjs` (openhuman#4919, openhuman#6364). |
- | `check-crate-chain.mjs` | The crate chain holds: each OpenHuman crate's normal dependencies name only the layer below it (core: none; embed: core; tinyhumans: embed; rpc: tinyhumans; app/cli/tui: rpc), and host `src/` never names `__host`, `core_host` or `openhuman_core::`. Dev-dependencies are exempt. Runs as part of `pnpm rust:layout`. |
- | `product-features.txt` / `product-features.sh` | Source of truth for the shipped desktop product's Cargo feature gates, distinct from `[features] default` (the contributor build). The `.sh` prints them comma-separated for `cargo --features "$(scripts/ci/product-features.sh)"`. |
- | `check-module-pins.mjs` + `module-pin-exemptions.json` | A loadable module's registry pin (`crates/openhuman-core/src/modules/registry.rs`) and its `vendor/*` submodule pin must describe the same release (openhuman#5727). The exemptions file records known, expected drift — not a way to silence the gate. Logic lives in `scripts/lib/module-pins.mjs`. |
- | `check-submodule-monotonic.mjs` | A `vendor/*` submodule pin may never move backwards onto a commit that is an ancestor of what the base branch already has. |
- | `check-toolchain-image.mjs` | The CI image's toolchain, the version-pinned `dtolnay/rust-toolchain@<version>` workflow steps, and `.github/Dockerfile` all match the channel pinned in `rust-toolchain.toml`. |
- | `rust-coverage.sh` | Runs the complete product-feature Rust suite under `cargo-llvm-cov`, including every core integration target and the root Rust support crates. |
- | `assert-coverage-presence.sh` + `coverage-presence-allowlist.txt` | Fails when an eligible Rust source file produced no lcov records at all, meaning the full product suite never compiled it (openhuman#5593). Allowlist entries must document, inline, which gate excludes the file and why that's intended. |
- | `list-feature-gated-rust-tests.mjs` | Prints every file under `crates/openhuman-core/src` that carries tests behind a product feature gate (`voice`, `media`, `web3`, `meet`, `mcp`, `skills`, `flows`, `channels`, `contacts`). `ci-lite.yml`'s `rust-feature-gate-smoke` job diffs the output against a checked-in EXPECTED list so a new gated test file forces the gate-contract test filters to be reviewed (#5022). |
- | `orch-ip-gate.sh` | Blocks the server-side orchestration "brain" (reasoning/wake graph, its prompts, per-agent model-selection metadata) from re-entering this open client repo. |
+ | [`check-openhuman-rust-layout.mjs`](check-openhuman-rust-layout.mjs) (`pnpm rust:layout`) | Every file under `crates/openhuman-core/src` stays under a 750-line ceiling, warning (without failing) past 725; oversized files are pinned at their exact size in `LEGACY_LIMIT_ENTRIES`, once each, and a pinned file that shrinks must lower or drop its pin; forbids inline `#[cfg(test)] mod` blocks and `tests.rs`/`test.rs` filenames; and asserts every root `tests/*.rs` / `examples/*.rs` has a matching `[[test]]`/`[[example]]` entry in `crates/openhuman-cli/Cargo.toml`, and that the core manifest declares no target tables. |
-| [`check-feature-forwarding.mjs`](check-feature-forwarding.mjs) | The Tauri shell ([`crates/openhuman-app/Cargo.toml`](../../crates/openhuman-app/Cargo.toml), which sets `default-features = false`) forwards exactly the gates in `product-features.txt`, no more, no less, and the library chain that re-declares the core's gates (`openhuman-embed` → `openhuman-tinyhumans` → `openhuman-cli`) forwards every one of them, by target and not just by name. Logic lives in [`scripts/lib/feature-forwarding.mjs`](../lib/feature-forwarding.mjs) (openhuman#4919, openhuman#6364). |
++| [`check-feature-forwarding.mjs`](check-feature-forwarding.mjs) | The Tauri shell ([`crates/openhuman-app/Cargo.toml`](../../crates/openhuman-app/Cargo.toml), which sets `default-features = false`) forwards exactly the gates in `product-features.txt`, no more, no less, and the library chain that re-declares the core's gates (`openhuman-embed` → `openhuman-tinyhumans` → `openhuman-rpc` → `openhuman-cli` / `openhuman-tui`) forwards every one of them, by target and not just by name. The shell's list is read from its `openhuman-rpc` dependency. Logic lives in [`scripts/lib/feature-forwarding.mjs`](../lib/feature-forwarding.mjs) (openhuman#4919, openhuman#6364). |
++| [`check-crate-chain.mjs`](check-crate-chain.mjs) | The crate chain holds: each OpenHuman crate's normal dependencies name only the layer below it (core: none; embed: core; tinyhumans: embed; rpc: tinyhumans; app/cli/tui: rpc), and host `src/` never names `__host`, `core_host` or `openhuman_core::`. Dev-dependencies are exempt. Runs as part of `pnpm rust:layout`. |
+ | [`product-features.txt`](product-features.txt) / [`product-features.sh`](product-features.sh) | Source of truth for the shipped desktop product's Cargo feature gates, distinct from `[features] default` (the contributor build). The `.sh` prints them comma-separated for `cargo --features "$(scripts/ci/product-features.sh)"`. |
+ | [`check-module-pins.mjs`](check-module-pins.mjs) + [`module-pin-exemptions.json`](module-pin-exemptions.json) | A loadable module's registry pin ([`crates/openhuman-core/src/modules/registry.rs`](../../crates/openhuman-core/src/modules/registry.rs)) and its `vendor/*` submodule pin must describe the same release (openhuman#5727). The exemptions file records known, expected drift, not a way to silence the gate. Logic lives in [`scripts/lib/module-pins.mjs`](../lib/module-pins.mjs). |
+ | [`check-submodule-monotonic.mjs`](check-submodule-monotonic.mjs) | A `vendor/*` submodule pin may never move backwards onto a commit that is an ancestor of what the base branch already has. |
+ | [`check-toolchain-image.mjs`](check-toolchain-image.mjs) | The CI image's toolchain, the version-pinned `dtolnay/rust-toolchain@<version>` workflow steps, and [`.github/Dockerfile`](../../.github/Dockerfile) all match the channel pinned in [`rust-toolchain.toml`](../../rust-toolchain.toml). |
+ | [`rust-coverage.sh`](rust-coverage.sh) | Runs the complete product-feature Rust suite under `cargo-llvm-cov`, including every core integration target and the root Rust support crates. |
+ | [`assert-coverage-presence.sh`](assert-coverage-presence.sh) + [`coverage-presence-allowlist.txt`](coverage-presence-allowlist.txt) | Fails when an eligible Rust source file produced no lcov records at all, meaning the full product suite never compiled it (openhuman#5593). Allowlist entries must document, inline, which gate excludes the file and why that's intended. |
+ | [`list-feature-gated-rust-tests.mjs`](list-feature-gated-rust-tests.mjs) | Prints every file under `crates/openhuman-core/src` that carries tests behind a product feature gate (`voice`, `media`, `web3`, `meet`, `mcp`, `skills`, `flows`, `channels`, `contacts`). `ci-lite.yml`'s `rust-feature-gate-smoke` job diffs the output against a checked-in EXPECTED list so a new gated test file forces the gate-contract test filters to be reviewed (#5022). |
+ | [`check-saas-ambient.mjs`](check-saas-ambient.mjs) + [`saas-ambient-baseline.json`](saas-ambient-baseline.json) (`pnpm saas:ambient`) | Ratchets code in `crates/openhuman-core/src` that reaches past a SaaS user agent's `CoreContext`: bare `tokio::spawn` / `spawn_blocking` / `std::thread::spawn` (use `core::runtime::spawn_scoped`), direct `Config::load_or_init`, `env::set_var` / `remove_var`, and `home_dir()`. Each existing site is baselined exactly; a new one fails, and a fixed one must be removed with `--write-baseline`. |
+ | [`orch-ip-gate.sh`](orch-ip-gate.sh) | Blocks the server-side orchestration "brain" (reasoning/wake graph, its prompts, per-agent model-selection metadata) from re-entering this open client repo. |
The complete Rust and frontend coverage suites feed the PR CI Gate's
changed-line diff-cover check (>= 80%) in `ci-lite.yml`.
diff --cc scripts/lib/feature-forwarding.mjs
index 73dce9e5ad,bf54b770d3..f5f05a51bd
--- a/scripts/lib/feature-forwarding.mjs
+++ b/scripts/lib/feature-forwarding.mjs
@@@ -463,8 -433,14 +463,8 @@@ export function formatReport(result, {
*/
export const CHAIN_GATES_NOT_FORWARDED = {
'openhuman-embed': {
- 'e2e-test-support':
- 'Exposes the destructive `openhuman.test_reset` RPC for the E2E build only. An embedder must never be able to turn a data wipe on.',
'rss-bench':
- 'Library-side hook for the embedded-RSS benchmark (#5046). Its binaries moved to the openhuman-benchmarks repository (#6944), which builds the core directly; no host in this repository turns it on.',
- 'Library-side hook for the embedded-RSS benchmark (#5046). Its binaries live in tinyhumansai/openhuman-benchmarks (`profile/`), which enables the core gate directly.',
- },
- 'openhuman-cli': {
- 'rss-bench':
- 'The benchmark binaries that used it moved to tinyhumansai/openhuman-benchmarks (`profile/`), which enables the core gate directly.',
++ 'Library-side hook for the embedded-RSS benchmark (#5046). Its binaries live in tinyhumansai/openhuman-benchmarks (`profile/`, #6944), which enables the core gate directly; no host in this repository turns it on.',
},
};
diff --cc tests/README.md
index 00f9178433,2001012055..e8309e1869
--- a/tests/README.md
+++ b/tests/README.md
@@@ -21,11 -21,9 +21,11 @@@ member, don't add one
## Registering a new target (read this before adding a file)
- These targets belong to **`crates/openhuman-cli`** — the crate that owns the
+ These targets belong to **[`crates/openhuman-cli`](../crates/openhuman-cli/README.md)**: the crate that owns the
-`openhuman-core` binary and depends on `openhuman-tinyhumans` for the backend
-transport the core library does not carry. Its manifest sets
+`openhuman-core` binary. The binary depends on `openhuman-rpc` alone; the
+tests reach the core, `openhuman-embed` and `openhuman-tinyhumans` (the
+backend transport the core library does not carry) through that crate's
+**dev-dependencies**, so none of them becomes an edge of the shipped binary. Its manifest sets
`autotests = false` and `autoexamples = false`, because Cargo's autodiscovery
only scans beside the manifest and the tests live at the repo root instead.
That means `cargo test` silently runs **nothing** for a new `tests/<name>.rs`