Skip to content

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

docs(core): add README for openhuman-core crate

Steven Enamakel66a26fc859ca
diff --git a/crates/openhuman-core/README.md b/crates/openhuman-core/README.md
index 1133f1080b..fa1e5d6c21 100644
--- a/crates/openhuman-core/README.md
+++ b/crates/openhuman-core/README.md
@@ -1,134 +1,292 @@
-# `openhuman-core`
+# openhuman-core
-Cargo package `openhuman`, library `openhuman_core`. Owns business rules,
-persistence, execution policy, the JSON-RPC/Socket.IO server, and the CLI
-dispatcher for OpenHuman. The `openhuman-core` binary itself lives in
-`crates/openhuman-cli` (it needs the `openhuman-tinyhumans` backend transport
-this library does not carry). Hosted in-process by `crates/openhuman-app`
-(the Tauri shell), `crates/openhuman-embed` (the typed facade for third-party
-embedders such as OpenCompany), `crates/openhuman-tui`, and
-`crates/openhuman-cli`.
+Cargo package `openhuman`, library `openhuman_core`. This is the in-process
+Rust core of OpenHuman: business rules, persistence, execution policy, the
+agent loop's host side, the controller registry, the event bus, and the CLI
+dispatcher. It is a library only. Every process that runs OpenHuman links it:
+the Tauri desktop app, the `openhuman-core` CLI binary, the TUI, and
+third-party embedders through `openhuman-embed`.
-See `crates/openhuman-core/src/lib.rs` for the crate-level doc comment and
-AGENTS.md ("Rust domain structure") for the preferred per-domain module shape.
+The core does not carry a JSON-RPC server or a backend client. Those live in
+crates above it, which install themselves into the core at startup. Reusable
+behavior (the agent loop, memory engines, channels, wallets, search providers)
+lives in vendored `tiny*` crates below it. The core composes them and applies
+OpenHuman's policy.
-## Layout
+## How it works
+
+### Layering
+
+```text
+ +-----------------+ +---------------+ +--------------+ +----------------+
+ | openhuman-app | | openhuman-cli | | openhuman-tui| | embedders |
+ | (Tauri shell) | | (bin: | | (terminal) | | (OpenCompany..)|
+ | | | openhuman- | | | | |
+ | | | core, benches| | | | |
+ +--------+--------+ +-------+-------+ +------+-------+ +-------+--------+
+ | | | |
+ | +---------------+-----------------+ |
+ | | |
+ v v v
+ +----------------------+ +-------------------------------------------+
+ | openhuman-rpc | | openhuman-tinyhumans |
+ | JSON-RPC envelopes, | | SdkBackendTransport, RuntimeBuilder, |
+ | HTTP client, axum | | login/session owner, hosted RPC proxies |
+ | server, Socket.IO, | | +-------------------------------------+ |
+ | session store | | | openhuman-embed | |
+ +----------+-----------+ | | Runtime -> Agent, Harness, Auth | |
+ | | +-------------------------------------+ |
+ | +---------------------+---------------------+
+ | |
+ v v
+ +-------------------------------------------------------------------------+
+ | openhuman-core (this crate) |
+ | core/: Outcome, ControllerSchema, registry (all.rs), invoke, BUS, |
+ | CoreBuilder -> CoreRuntime, CLI |
+ | src/<domain>/: agent, memory, tools, security, inference, channels... |
+ | backend/transport: BackendTransport port (implemented above) |
+ +-------------------------------------------------------------------------+
+ |
+ v
+ +-------------------------------------------------------------------------+
+ | vendor/tiny* |
+ | tinyagents (+ tinytools, tinyinference) tinymemory (+ tinycortex) |
+ | tinybus tinychannels tinyflows tinymcp tinyskills tinybox |
+ | tinyconnectors tinycomputer tinydocs tinysearch tinyjuice |
+ | tinyruntime tinyvoice tinywallet tinyhosts |
+ +-------------------------------------------------------------------------+
+```
+
+Arrows point at what a crate depends on. Two seams let the upper crates plug
+into the core without the core naming them:
+
+- The backend transport port (`backend/transport/`: `BackendTransport`,
+ `BackendRequest`, `BackendTransportError`). `openhuman-tinyhumans`
+ implements it with the TinyHumans SDK and installs it once per process
+ (`openhuman_tinyhumans::install`, `RuntimeBuilder`, or
+ `CoreBuilder::backend_transport`). With no transport installed, agents,
+ memory, tools, and RPC still run, and backend calls answer
+ `BACKEND_UNAVAILABLE:`. The core never depends on `tinyhumans-sdk`.
+- The controller extension hook (`core::all::register_controller_extension`).
+ `openhuman-tinyhumans` registers the hosted proxies (`billing`, `team`,
+ `referral`, `announcements`, `webhooks`, `channel_link`, `oauth`) under
+ `DomainGroup::Hosted`, and `openhuman-rpc` registers its `http_host.*`
+ controllers the same way.
+
+### The controller spine
+
+Every domain operation follows one contract, defined in `core/`:
+
+```text
+ transport (openhuman-rpc /rpc or Socket.IO, CLI, device tunnel,
+ CoreRuntime::invoke)
+ |
+ v
+ core::invoke::invoke_method(state, "openhuman.<ns>_<fn>", params)
+ | schema_for_rpc_method + validate_params (core/all.rs)
+ | DomainSet filter from the ambient CoreContext
+ v
+ RegisteredController { schema: ControllerSchema, handler }
+ | handler lives in src/<domain>/schemas.rs, stays thin
+ v
+ src/<domain>/ops.rs -> Outcome<T> (value + logs)
+ |
+ v
+ JSON result, or StructuredRpcError
+```
+
+Each domain exposes `all_<domain>_registered_controllers()` from its
+`schemas.rs`. `core/all.rs` collects them in `build_registered_controllers`
+(public) and `build_internal_only_controllers` (callable by the shell, hidden
+from agent tool listings), tagging each with one `DomainGroup`. RPC method
+names are `openhuman.<namespace>_<function>`, and namespace strings are wire
+contracts that do not follow directory renames. `GET /schema` on the RPC
+server dumps the live registry.
+
+### The event bus
+
+`core/bus.rs` owns the process-wide `BUS` (a `tinybus` bus over
+`DomainEvent`, defined in `core/events.rs`). Domains publish with
+`BUS.publish` and subscribe with an `EventHandler` in their own `bus.rs`,
+named `<domain>::<purpose>`. Subscribers are registered at startup in
+`core/runtime/subscribers.rs`. `BUS.native()` carries typed in-process
+request and response calls whose values cannot be serialized. Adding an event
+means adding the variant, extending `domain()`, registering the subscriber,
+and bumping `EVENTS_VERSION`.
+
+### Runtime composition
-Business logic lives one directory per domain under `src/<domain>/`. `*` marks
-modules whose `pub mod` declaration in `lib.rs` is itself `#[cfg(feature)]`-
-gated (feature of the same name unless noted). `channels`, `mcp`,
-`skills`, `voice` and `web3` are always declared but gate most of their
-contents inside `mod.rs` behind the feature of the same name. See the
-`[features]` block in `Cargo.toml` for what each gate pulls in.
+`CoreBuilder` (`core/runtime/builder.rs`) builds a `CoreRuntime`. Three knobs
+narrow what runs, and they can only narrow:
-| Domain | Purpose | README |
+| Knob | Selects | Presets |
| --- | --- | --- |
-| `agent` | Multi-agent orchestration, tool execution, session management | [README](src/agent/README.md) |
-| `backend` | The backend port: `BackendTransport`, `BackendClient`, error classification and budget-exhaustion detection. Holds no hosted URL, header policy or product identity of its own | [README](src/backend/README.md) |
-| `channels` | Channel implementations and runtime orchestration | [README](src/channels/README.md) |
-| `config` | Configuration management for the core | [README](src/config/README.md) |
-| `core` | Transport, dispatch, controller registry (`core::all`), auth, CLI, event bus, runtime composition (`core::runtime`); not a domain | [README](src/core/README.md) |
-| `cron` | Scheduled-job runtime: cron/human-delay parsing, job + run store, polling scheduler, output delivery | [README](src/cron/README.md) |
-| `desktop` | Desktop-shell-facing surfaces | |
-| `flows`* | Saved automation workflows (tinyflows graphs) | [README](src/flows/README.md) |
-| `hooks` | User-authored scripts that observe and gate the agent | [README](src/hooks/README.md) |
-| `hosting`* | Putting a workspace on the internet | [README](src/hosting/README.md) |
-| `inference` | Unified inference domain | [README](src/inference/README.md) |
-| `integrations` | Agent integration tools | [README](src/integrations/README.md) |
-| `mcp` | Host half of Model Context Protocol support | [README](src/mcp/README.md) |
-| `media`* | Media generation and image tool contracts | [README](src/media/README.md) |
-| `memory` | Memory v2: engine binding, the `memory` tool, conversations, sources, `context.md`, import | [README](src/memory/README.md) |
-| `modules`* | Loadable native modules: capabilities that live outside this binary | [README](src/modules/README.md) |
-| `platform` | Host-platform services: process lifecycle, self-update, diagnostics, local transport surfaces | |
-| `runtime` | Code-execution runtimes, client side (toolchain download/warm workers live in the `tinyruntime` module) | |
-| `sandbox` | Sandbox execution backends for agent tool isolation | [README](src/sandbox/README.md) |
-| `search` | Unified search domain | [README](src/search/README.md) |
-| `security` | Autonomy/risk policy, sandbox selection, audit log, secret store | [README](src/security/README.md) |
-| `skills` | Skills metadata: discovery, parse, install, run | [README](src/skills/README.md) |
-| `test_support`* (feature `e2e-test-support`) | Wipe-and-reset hooks for E2E specs | [README](src/test_support/README.md) |
-| `threads` | Conversation thread and message management | [README](src/threads/README.md) |
-| `tools` | Agent tool implementations and policy | [README](src/tools/README.md) |
-| `util` | Utility functions | [README](src/util/README.md) |
-| `voice` | Speech-to-text and text-to-speech (local piper / hosted) | [README](src/voice/README.md) |
-| `web3` | High-level web3 surface built on the wallet layer | [README](src/web3/README.md) |
-| `web_chat` | Web/desktop channel turn runner (`channel.web_*` RPC, `WebChannelEvent` bus) | [README](src/web_chat/README.md) |
-
-The controller contract (`core::Outcome`, `core::StructuredRpcError`, the
-params rules in `core::params`, the schema types) and in-process dispatch
-(`core::invoke::invoke_method`) live in this crate. The JSON-RPC protocol,
-client and server that expose them live in `crates/openhuman-rpc`, which
-depends on this crate.
-
-The `inference` domain is where the pluggable LLM and embedding providers
-live; see
-[`gitbooks/developing/engines.md`](../../gitbooks/developing/engines.md) for
-the full provider list. Tool selection under `agent` includes the Jev
-ranker's core-side integration point; see
-[`gitbooks/developing/jev.md`](../../gitbooks/developing/jev.md).
-
-## Binaries
-
-None. This package is the library only; `crates/openhuman-cli` declares the
-`openhuman-core` binary, `test-mcp-stub`, `openhuman-fleet`, `rss-bench` and
-`library-profile`, plus every root `tests/*.rs` / `examples/*.rs` target.
-
-`openhuman-fleet` is a process-per-user supervisor and reverse proxy, part of
-the pluggable-core work (see `src/core/runtime/`). `test-mcp-stub` is the
-stdio MCP server `tests/mcp_registry_e2e.rs` spawns. `rss-bench` and
-`library-profile` are dev-only profiling harnesses; see `scripts/profile/`.
-Details for each are in
-[`../openhuman-cli/src/bin/README.md`](../openhuman-cli/src/bin/README.md).
-
-## Feature flags
-
-`[features] default` in `Cargo.toml` is the **contributor set**: what a bare
-`cargo check`/`cargo test`/rust-analyzer compile builds, and deliberately
-smaller than what the desktop app ships. The **product set** lives in
-`scripts/ci/product-features.txt` and is forwarded by
-`crates/openhuman-app/Cargo.toml`; `scripts/ci/check-feature-forwarding.mjs`
-asserts the two stay in sync. Slim or headless-embedding builds use
-`--no-default-features --features "<explicit list>"`.
-
-Gate names (see `Cargo.toml` for the full rationale behind each): `http-server`,
-`inference`, `documents`, `hosting`, `modules`, `voice`, `web3`,
-`runtime-node`, `contacts`, `media`, `flows`, `skills`, `mcp`,
-`crash-reporting`, `channels`,
-`sandbox-bubblewrap`, `browser-native`, `fantoccini`,
-`whatsapp-web`, `e2e-test-support`, `rss-bench`,
-`rss-bench-dhat`, `file-logging`, `scheduler-gate`, `bin-tools`. Read the
-policy comments above `[features]` in `Cargo.toml` before changing either
-feature list.
+| `ServiceSet` | Background services and transports: HTTP RPC, Socket.IO, cron, channels, login-gated services, update checker, memory queue, MCP boot, integration sync | `desktop`, `headless_api`, `embedded`, `none` |
+| `DomainSet` | Which `DomainGroup` families are live: controllers, tools, stores, subscribers | `full`, `harness`, `embedded`, `kernel`, `none` |
+| `ToolGroups` | Tool visibility for agents | (see `tools/toolpacks`) |
+
+`CoreRuntime::invoke` dispatches through the same `invoke_method` the RPC
+server uses. `CoreContext::derive_with` gives an embedded agent its own
+context, clamped to what the parent registered. Boot order (config,
+migrations, cost ledger, socket manager, subscribers, services) is in
+`core/runtime/bootstrap.rs` and `services.rs`; see
+[`src/core/runtime/README.md`](src/core/runtime/README.md).
+
+`run_core_from_args` (`lib.rs`) is the CLI entry point used by
+`crates/openhuman-cli/src/main.rs` and the desktop binary's `core` and `mcp`
+subcommands. It loads dotenv, applies the startup restart delay, initializes
+the keyring master key, and dispatches to `core::cli`. A host that serves RPC
+calls `openhuman_rpc::server::install_cli_server()` first.
+
+## Layout
+
+`src/core/` is infrastructure, not a domain. Everything else under `src/` is
+one domain family, with the module shape described in `AGENTS.md` ("Rust
+domain structure": `mod.rs`, `types.rs`, `store.rs`, `ops.rs`, `schemas.rs`,
+`tools.rs`, `bus.rs`). A `*` marks a module whose `pub mod` in `lib.rs` is
+feature-gated by the feature of the same name.
+
+### Infrastructure
+
+| Path | What it does |
+| --- | --- |
+| [`src/core/`](src/core/README.md) | Controller contract (`Outcome`, `ControllerSchema`, `StructuredRpcError`, `params`), registry (`all.rs`), in-process dispatch (`invoke.rs`, `dispatch.rs`), `BUS` and `DomainEvent`, CLI, logging and observability, runtime composition (`runtime/`). |
+| [`src/backend/`](src/backend/README.md) | The backend port and `BackendClient` (authenticated JSON, error classification). Holds no URL, header policy, or product identity; it asks the installed transport. |
+| [`src/config/`](src/config/README.md) | Config schema (`config/schema/`), load and save, settings RPC. |
+| [`src/util/`](src/util/README.md) | Self-contained helpers. Always compiled. |
+| [`src/test_support/`](src/test_support/README.md)* | Wipe-and-reset hooks for E2E specs (feature `e2e-test-support`). |
+
+### Agent and conversation
+
+| Path | What it does |
+| --- | --- |
+| [`src/agent/`](src/agent/README.md) | Turns a user message into model and tool calls: agent definitions, prompts, tool visibility, approvals, budgets, progress events, sub-agent delegation, and the session host around the TinyAgents loop. |
+| [`src/inference/`](src/inference/README.md) | Turns config into working models: provider selection per workload (managed, BYOK, local, CLI), the `/v1` OpenAI-compatible router, embeddings. |
+| [`src/memory/`](src/memory/README.md) | Host side of TinyMemory: engine binding, acting-identity scope, the turn lifecycle, queues, sources, import. |
+| [`src/threads/`](src/threads/README.md) | Thread lifecycle and per-thread messages, goals, and todos. |
+| [`src/web_chat/`](src/web_chat/README.md) | The in-app chat turn runner and the `channel.web_*` namespace. |
+| [`src/commands/`](src/commands/README.md) | The chat composer's slash-command listing. |
+| [`src/hooks/`](src/hooks/README.md) | User-authored scripts that observe and gate the agent. |
+
+### Tools and execution
+
+| Path | What it does |
+| --- | --- |
+| [`src/tools/`](src/tools/README.md) | Assembles each session's tool list (`tools/ops.rs`), cross-cutting built-in tools, and tool policy. Domain tools live with their domain and are re-exported here. |
+| [`src/security/`](src/security/README.md) | The trust boundary: autonomy policy, approvals, credentials and secrets, redaction, egress and local-only mode, listener guard. |
+| [`src/sandbox/`](src/sandbox/README.md) | Sandbox backends for tool isolation (platform jail, Docker via `tinybox`). |
+| [`src/runtime/`](src/runtime/README.md) | Client side of code execution: `node_exec`, `npm_exec`, `python_exec`, `shell`, worker pools over the `tinyruntime` module. |
+| [`src/modules/`](src/modules/README.md)* | Loadable native modules: the `tinybus` module host, registry, attestation, and per-module clients (search, wallet, documents, computer, voice, ...). |
+| [`src/skills/`](src/skills/README.md) | SKILL.md discovery, install, and run over `tinyskills`. |
+| [`src/mcp/`](src/mcp/README.md) | Host half of MCP: configuration, lifecycle, and the MCP server surface over `tinymcp`. |
+| [`src/flows/`](src/flows/README.md)* | Saved automation workflows (tinyflows graphs) in SQLite. |
+| [`src/cron/`](src/cron/README.md) | Scheduled jobs: parsing, store, scheduler, delivery into agent or channel pipelines. |
+
+### Reaching the outside world
+
+| Path | What it does |
+| --- | --- |
+| [`src/channels/`](src/channels/README.md) | Messaging channels (Telegram, Discord, Slack, WhatsApp, iMessage, ...) and their runtime, over `tinychannels`. |
+| [`src/integrations/`](src/integrations/README.md) | `IntegrationClient` for `/agent-integrations/*`, Composio, and managed integration tools. |
+| [`src/search/`](src/search/README.md) | Host policy over the TinySearch module: provider usability, rendering, the search tool bridge. |
+| [`src/media/`](src/media/README.md)* | Image and video generation tools through the backend's OpenRouter proxy. |
+| [`src/hosting/`](src/hosting/README.md)* | Deploying a workspace to a hosting provider through `tinyhosts`. |
+| [`src/web3/`](src/web3/README.md) | Wallet, swaps, bridges, dapp calls, and x402 payments, as a host adapter over `tinywallet`. |
+| [`src/voice/`](src/voice/README.md) | Speech-to-text and text-to-speech, dictation, live voice sessions. |
+
+### Process and desktop
+
+| Path | What it does |
+| --- | --- |
+| [`src/platform/`](src/platform/README.md) | Health, doctor, cost, connectivity, OS service install, self-restart, self-update, the backend Socket.IO client, startup migrations. |
+| [`src/desktop/`](src/desktop/README.md) | Desktop-shell surfaces: app-state snapshot, notifications, overlay, model-health dashboard, provider respond queue, native desktop control. |
+
+## Feature gates
+
+`[features] default` in `Cargo.toml` is the contributor set: what a bare
+`cargo check`, `cargo test`, or rust-analyzer builds. It is deliberately
+smaller than the product set in `scripts/ci/product-features.txt`, which the
+desktop app forwards from `crates/openhuman-app/Cargo.toml` (it disables
+default features). `scripts/ci/check-feature-forwarding.mjs` checks that
+forwarding, and the library chain (`openhuman-embed`, then
+`openhuman-tinyhumans`, then `openhuman-cli`).
+
+| Gate | Default | Product | What it gates |
+| --- | --- | --- | --- |
+| `media` | yes | yes | `openhuman::media` (via `tinyagents-harness/media`) |
+| `skills` | yes | yes | Most of `skills/` |
+| `flows` | yes | yes | `openhuman::flows` and the tinyflows crates |
+| `mcp` | yes | yes | Most of `mcp/` |
+| `channels` | yes | yes | Most of `channels/` and the `tinychannels` crate |
+| `http-server` | yes | yes | Domain-owned HTTP handlers (`inference::http`, dictation WebSocket, MCP HTTP) |
+| `scheduler-gate` | yes | yes | Battery-aware scheduler gate |
+| `file-logging` | yes | yes | Rolling file logs |
+| `modules` | yes | yes | `openhuman::modules` and the tinybus module loader |
+| `inference` | no | yes | Local audio-device probe and related inference surface |
+| `voice` | no | yes | The voice stack |
+| `web3` | no | yes | Real `web3`, `wallet`, `x402` (stubs otherwise) |
+| `documents` | no | yes | Document tools over the `tinydocs` module |
+| `runtime-node` | no | yes | Managed Node.js runtime and its tools |
+| `hosting` | no | yes | `openhuman::hosting` |
+| `crash-reporting` | no | yes | Sentry |
+| `whatsapp-web` | no | no | WhatsApp Web channel provider |
+| `e2e-test-support` | no | no | `openhuman::test_support` |
+| `rss-bench` | no | no | Hooks for the `rss-bench` profiling bin |
+
+Gates come in two shapes. A leaf gate removes the module (`hosting`, `media`,
+`flows`, `modules`). A facade gate keeps the module declared and swaps in a
+`stub.rs` with matching signatures, so always-on callers need no `#[cfg]`
+(`web3`, `channels`, `skills`, `mcp`, `voice`, `runtime-node`). Stub drift is
+only caught by `cargo check --no-default-features`. Every compile-time gate
+composes with the matching runtime `DomainSet` flag. The kernel floor profile
+is `--no-default-features --features flows`. Read the policy comments above
+`[features]` in `Cargo.toml` before changing either list, and test both the
+enabled and disabled builds.
+
+## Boundaries
+
+- No binaries. `crates/openhuman-cli` declares `openhuman-core`,
+ `test-mcp-stub`, `openhuman-fleet`, `rss-bench`, `library-profile`, and the
+ tool benches, plus every root `tests/*.rs` and `examples/*.rs` target. See
+ [`../openhuman-cli/src/bin/README.md`](../openhuman-cli/src/bin/README.md).
+- No JSON-RPC server, no HTTP client for RPC, no session store:
+ `crates/openhuman-rpc`.
+- No backend URLs, SDK, login, or `/auth/*` calls: `crates/openhuman-tinyhumans`.
+ The core only accepts a credential through `auth.set_credential`.
+- No windows or native shell integration: `crates/openhuman-app`.
+- Agent loop, tool-call parsing, sessions and transcripts, the `Tool` trait,
+ provider wire formats, memory engines, channel backends, wallet signing,
+ search providers, and hosting providers belong to their `vendor/tiny*`
+ submodule. Change them upstream first, then move the gitlink. Never
+ redeclare a `*-bus` contract type here.
## Build and test
```bash
cargo check --manifest-path Cargo.toml
-cargo build --manifest-path Cargo.toml -p openhuman-cli --bin openhuman-core
-cargo test -p openhuman
+cargo check -p openhuman --features "$(scripts/ci/product-features.sh)"
+cargo check -p openhuman --no-default-features # stub drift
+cargo test -p openhuman [filter]
pnpm debug rust [filter]
-scripts/test-rust-with-mock.sh # tests that need the shared mock backend
+scripts/test-rust-with-mock.sh # tests needing the mock backend
```
-Auto-discovery (`autotests`, `autoexamples`, `autobins`) is off. Integration
-tests and examples live at the repo root (`../../tests/*.rs`,
-`../../examples/*.rs`) with explicit `[[test]]`/`[[example]]` targets in
-`Cargo.toml`. `tests/raw_coverage/*.rs` is the one exception: `../../build.rs`
-globs those files into the single `raw_coverage_all` target instead of one
-target per file. Four product-gated targets (`json_rpc_e2e`,
-`observability_smoke`, `raw_coverage_all`, `x402_twit_sh_live`) declare
-`required-features` and are silently skipped, not failed, under the
-contributor default set. Run them with the product feature set to exercise
-what ships.
-
-## Public entry points
-
-- [`run_core_from_args`](src/lib.rs): the CLI entry point used by both
- `crates/openhuman-cli/src/main.rs` and the desktop shell binary's `core`
- and `mcp` subcommands.
- Order: load dotenv, apply the startup restart delay, initialize the keyring
- master key, then dispatch to `core::cli`.
-- [`CoreBuilder` to `CoreRuntime`](src/core/runtime/builder.rs): the
- embeddable composition API. `openhuman-embed` layers a typed facade over
- it; see [`gitbooks/developing/embedding.md`](../../gitbooks/developing/embedding.md).
-- `openhuman-core serve` (alias `run`): the standalone JSON-RPC/Socket.IO
- server. Public endpoints: `GET /health`, `GET /schema`, `GET /events`.
+Unit tests sit beside their modules in `<module>_tests.rs` files (never
+inline, never `tests.rs`); `pnpm rust:layout` enforces that. Integration tests
+and examples live at the repo root and are targets of `crates/openhuman-cli`
+with explicit `[[test]]` and `[[example]]` entries, except
+`tests/raw_coverage/*.rs`, which the root `build.rs` folds into the single
+`raw_coverage_all` target. Several product-gated targets declare
+`required-features` and are skipped, not failed, under the contributor set;
+run them with the product features. A suite that boots the core in-process
+and reaches the mock backend must call `tinyhumans_boot::boot()` from
+`tests/support/tinyhumans_boot.rs` first.
+
+Further reading:
+[`gitbooks/developing/architecture.md`](../../gitbooks/developing/architecture.md),
+[`gitbooks/developing/engines.md`](../../gitbooks/developing/engines.md)
+(inference providers),
+[`gitbooks/developing/jev.md`](../../gitbooks/developing/jev.md) (the Jev
+ranker), and
+[`gitbooks/developing/embedding.md`](../../gitbooks/developing/embedding.md)
+(embedding the core).