Skip to content

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

docs(crates): document the strict crate dependency chain

Steven Enamakela4931948dffd
diff --git a/crates/README.md b/crates/README.md
index 15982745db..a24cb73521 100644
--- a/crates/README.md
+++ b/crates/README.md
@@ -12,72 +12,74 @@ with `--manifest-path crates/openhuman-app/Cargo.toml`.
| Crate | Package / lib | What it is |
| --- | --- | --- |
| [`openhuman-core`](openhuman-core/README.md) | package `openhuman`, lib `openhuman_core` | The core library: every business domain under `src/<domain>/`, the controller contract and registry, in-process dispatch, the event bus and the CLI dispatcher. No JSON-RPC server, no backend client, no binary targets. |
-| [`openhuman-embed`](openhuman-embed/README.md) | `openhuman-embed` | The typed library facade for running the core in-process in another product (`Runtime` then `Agent`). |
-| [`openhuman-rpc`](openhuman-rpc/README.md) | `openhuman-rpc` | JSON-RPC 2.0 over the core: envelopes, the HTTP client (`http-client`), the server with Socket.IO and the `run_server*` entry points (`server`), and the on-disk session store (`session-store`). |
+| [`openhuman-embed`](openhuman-embed/README.md) | `openhuman-embed` | The typed library facade for running the core in-process in another product (`Runtime` then `Agent`), plus the host presets, `embed::process` lifecycle helpers and the curated facades the hosts use. |
+| [`openhuman-rpc`](openhuman-rpc/README.md) | `openhuman-rpc` | JSON-RPC 2.0 over the core: envelopes, the HTTP client (`http-client`), the server with Socket.IO and the `run_server*` entry points (`server`), the on-disk session store (`session-store`), and `host::{cli, desktop, tui}`, the shared host boot. Re-exports `embed` and `tinyhumans`: the one dependency a host needs. |
| [`openhuman-tinyhumans`](openhuman-tinyhumans/README.md) | `openhuman-tinyhumans` | The hosted-backend layer: the SDK-backed `BackendTransport`, `install()`, a `RuntimeBuilder` that boots connected, the hosted RPC proxies, the login and session owner, and the Jev ranker. The only crate allowed to depend on `tinyhumans-sdk`. |
-| [`openhuman-cli`](openhuman-cli/README.md) | `openhuman-cli` | The `openhuman-core` binary, the developer and benchmark binaries, and every root `tests/*.rs` and `examples/*.rs` target. |
+| [`openhuman-cli`](openhuman-cli/README.md) | `openhuman-cli` | The `openhuman-core` binary, the `openhuman-fleet` and `test-mcp-stub` ops binaries, and every root `tests/*.rs` and `examples/*.rs` target. |
| [`openhuman-tui`](openhuman-tui/README.md) | `openhuman-tui` | The standalone terminal client, embedding the core in-process. |
| [`openhuman-app`](openhuman-app/README.md) | `openhuman-app` (lib `openhuman`) | The thin Tauri v2 desktop host. Runs the core and its JSON-RPC server as a tokio task. Outside the root workspace. |
## How they layer
Arrows point from a crate to what it depends on (normal `[dependencies]`,
-taken from each `Cargo.toml`).
+taken from each `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:
-| Crate | Depends on (first-party) |
+| Crate | Depends on (first-party, normal) |
| --- | --- |
| `openhuman-core` | none |
| `openhuman-embed` | `openhuman-core` |
-| `openhuman-rpc` | `openhuman-core` |
-| `openhuman-tinyhumans` | `openhuman-embed`, `openhuman-core` (plus `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`) |
+| `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
+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
The core runs agents, memory, tools and controllers without any hosted
backend. It reaches the backend only through the `BackendTransport` port and
knows nothing of JSON-RPC, so it can be embedded with neither. The layers
-above add those pieces, and each host installs what it needs at startup:
+above add those pieces, and each host boots through one `openhuman_rpc::host`
+entry that connects them:
```text
- host main()
- openhuman_tinyhumans::install(..) backend transport, hosted
- proxies, Jev ranker
- openhuman_rpc::server::install_cli_server() (CLI: run/serve)
- boot the core (run_core_from_args, CoreBuilder, embedded server)
+ openhuman-core binary openhuman_rpc::host::cli(args)
+ desktop app (GUI) openhuman_rpc::host::desktop(options, shutdown, ready_tx)
+ desktop app core/mcp openhuman_rpc::host::cli(args)
+ terminal UI openhuman_rpc::host::tui()
+ each: tinyhumans RuntimeBuilder::connect (transport, hosted proxies,
+ Jev ranker) -> embed Runtime (one per process) -> serve / dispatch
```
A core with no transport installed answers backend calls with
@@ -89,8 +91,10 @@ empty, and the core must not depend on `openhuman-rpc`.
Cargo default features define the contributor build;
`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.
## Build and test