Skip to content

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

docs(audit, modules): add README files for audit and modules

Steven Enamakel80a1e1a5871b
diff --git a/crates/openhuman-core/src/mcp/audit/README.md b/crates/openhuman-core/src/mcp/audit/README.md
index 37d3e3ddfc..10aea0868f 100644
--- a/crates/openhuman-core/src/mcp/audit/README.md
+++ b/crates/openhuman-core/src/mcp/audit/README.md
@@ -19,19 +19,20 @@ more.
| File | Role |
| --- | --- |
| `mod.rs` | Facade: re-exports the payload types (`types` module, from `tinymcp_bus`), `record_write`/`list_writes` (delegating to the `mcp::host` service's `AuditStore`), and the schema re-exports. |
-| `schemas.rs` / `schemas_tests.rs` | The `mcp_audit.list` controller: schema (`limit`/`offset`/`since_ms`/`client_filter`/`tool_filter`/`success_only` inputs, `records` output) and its handler. |
+| `schemas.rs` / `schemas_tests.rs` | The `mcp_audit.list` controller: schema (`limit`/`offset`/`since_ms`/`client_filter`/`tool_filter`/`success_only` inputs, `records` output) and its handler, which loads the config, deserializes the params into `McpWriteListQuery`, and calls `list_writes`. |
| `stub.rs` | The `mcp`-less mirror: `record_write` is a no-op returning `Ok(0)`, `list_writes` returns `Ok(vec![])`. |
## RPC surface
-`mcp_audit.list` is the only controller, registered as **internal-only**
-(`all_mcp_audit_internal_controllers`, used by the desktop UI/CLI, not the
-public schema) at `core/all.rs` (~lines 1015-1020). Its filter and limit
-semantics (`limit` default 50 / max 500, `offset`, `since_ms`,
-`client_filter`, `tool_filter`, `success_only`) are enforced by the handler
-in `schemas.rs` against the query it hands `list_writes`; whether the
-underlying `tinymcp::AuditStore` applies those same bounds internally is the
-contract's concern, not this layer's.
+`mcp_audit.list` is the only controller, registered through
+`all_mcp_audit_internal_controllers` in `build_internal_only_controllers`
+(`core/all.rs`, ~line 1020): routable over RPC for the desktop UI/CLI, but
+not exposed to agents. The handler deserializes its params straight into
+`tinymcp_bus::McpWriteListQuery` and hands them to `list_writes`; the
+filter and limit semantics (`limit` default 50 / max 500 via
+`resolved_limit`, `offset`, `since_ms`, `client_filter`, `tool_filter`,
+`success_only`) are the contract's and the store's, not this layer's. The
+schema's field comments repeat them for `/schema` readers only.
## Compile-time gate (`mcp` feature)
@@ -48,17 +49,18 @@ appears never to have happened, rather than erroring.
- `tinymcp_bus` — `McpWriteListQuery`, `McpWriteRecord`, `NewMcpWriteRecord`.
- `crate::mcp::host` — resolves the per-workspace `AuditStore` via
`for_config`.
-- `crate::core::all` — `ControllerSchema`, `RegisteredController` types for
- the internal-controller registration.
-- `crate::rpc::RpcOutcome` — the response envelope other RPC domains use;
- `mcp_audit.list`'s handler returns a raw JSON object rather than
- `RpcOutcome` (see `schemas.rs::handle_list`).
+- `crate::core::all` (`RegisteredController`, `ControllerFuture`) and
+ `crate::core` (`ControllerSchema`, `FieldSchema`, `TypeSchema`) — the
+ controller registration types. Unlike the other RPC domains the handler
+ returns a raw `{ "records": [...] }` object, not an `RpcOutcome`.
## Used by
-- `crates/openhuman-core/src/mcp/server/write_dispatch.rs` — calls
- `audit::record_write` for every MCP write-tool attempt (success and
- rejection), which opens the per-workspace `mcp::host` service and writes
- through its `AuditStore`.
+- `crates/openhuman-core/src/mcp/server/write_dispatch.rs` — `audit_write`
+ / `audit_write_rejection[_without_config]` call `audit::record_write` off
+ the hot path (`spawn_blocking`, or a thread when no runtime is current)
+ for every MCP write-tool attempt, success and rejection; `record_write`
+ resolves the per-workspace `mcp::host` service and writes through its
+ `AuditStore`.
- `crates/openhuman-core/src/core/all.rs` — registers
`all_mcp_audit_internal_controllers()`.
diff --git a/crates/openhuman-core/src/modules/README.md b/crates/openhuman-core/src/modules/README.md
index 46564cf24f..5cb14ef489 100644
--- a/crates/openhuman-core/src/modules/README.md
+++ b/crates/openhuman-core/src/modules/README.md
@@ -13,15 +13,17 @@ argument; this file is the navigation layer over it.
Feature-gated as `modules`, and unusually load-bearing for a feature: it is ON
in both the contributor default set and the shipped product set, because the
memory subsystem's module-backed driver is not optional at test time (see the
-Cargo.toml comment beside `modules = ["tinybus/modules"]`). `documents`,
-`web3`, and `voice` each turn a per-module host half on inside this directory
-(`documents.rs`, `wallet.rs`, `voice.rs`) but do not gate the directory itself.
+comment above `default = [...]` in `crates/openhuman-core/Cargo.toml`).
+`documents`, `web3`, and `voice` each imply `modules` and each turn a
+per-module host half on inside this directory (`documents.rs`, `wallet.rs`,
+`voice.rs`) but do not gate the directory itself; `lib.rs` gates the whole
+directory on `modules`.
## Layout
| Path | Purpose |
| --- | --- |
-| `mod.rs` | Crate-level rustdoc for the whole loading model; re-exports |
+| `mod.rs` | Module rustdoc for the whole loading model; re-exports |
| `registry.rs` (+ `registry_part_01.rs`, `registry_part_02.rs`) | The compiled-in table: every `ModuleRecord`, its per-platform digests, and `find`/`ALL` |
| `platform.rs` | Which published artifact (`ubuntu-24.04-x86_64`, `macos-15-arm64`, ...) belongs to this host, newest-compatible first |
| `types.rs` | `LoadPolicy`, `ModuleRecord`, `ModuleSource`, `ModuleState`, `ModuleStatus`, `PlatformAsset` |
@@ -34,7 +36,7 @@ Cargo.toml comment beside `modules = ["tinybus/modules"]`). `documents`,
| `wallet.rs` | Host half of `tinywallet` (feature `web3`): confidential and split transaction-signing flows |
| `voice.rs` | Host half of `tinyvoice` (feature `voice`): the voice primitives |
| `memory.rs` (+ `memory_part_01..04.rs`) | `ModuleMemoryProvider`, forwarding `MemoryProvider` calls to the loaded `tinymemory` module via `tinymemory-api` |
-| `memory_host.rs` | Host-owned callbacks served *to* the TinyMemory module (embedding, chat compute, event publishing, Composio); sole survivor of the `host_impls` pair after the in-process engine left (openhuman#6161) |
+| `memory_host.rs` | Host-owned callbacks served *to* the TinyMemory module: `EmbeddingHost`, `ChatHost`, `ComposioHost`, and `RuntimeHost` (event publishing, error reporting, scheduler policy, spaCy); sole survivor of the `host_impls` pair after the in-process engine left (openhuman#6161) |
| `runtime.rs` | Host half of `tinyruntime`: resolving a language runtime (via `tinyruntime-nodejs`/`-python`) and running code on it |
| `connectors.rs` | Reaching `tinyconnectors`; egress policy, route selection, and webhook delivery stay in this crate even though scope enforcement moved into the module |
| `tokenjuice_host.rs` | Host-owned ML callback served to the `tinyjuice` module |
@@ -52,18 +54,22 @@ Cargo.toml comment beside `modules = ["tinybus/modules"]`). `documents`,
the release cache.
4. `platform::host_candidates()` picks the ordered list of artifact keys this
host can run; `ops::load_cached` tries each until one is admitted.
-5. The release cache downloads (if `modules.allow_download`), verifies the
- archive's SHA-256 against the digest pinned in `registry.rs`, extracts, and
- `dlopen`s — all off the module runtime's worker thread so a cold download
+5. The release cache (`tinybus::module::CachedRelease`) downloads if
+ `modules.allow_download`, fetches the release's own `checksum.toml`, checks
+ it against the digest pinned in `registry.rs`, hashes the archive, extracts,
+ and `dlopen`s — on the module runtime's blocking pool so a cold download
never stalls another task.
-6. tinybus's ABI descriptor, manifest, and digest gates decide whether the
- artifact is *admitted*; a faulted or refused module is cached as
- `LoadError::Failed` and never retried in this process — restart is the only
- recovery, because tinybus never unloads a library.
-
-`boot::load_declared_modules` runs steps 3–6 at startup only for search-path
-artifacts and `LoadPolicy::Eager` records (currently `tinymemory`, when the
-memory driver actually selected the module-backed binding). Everything else is
+6. tinybus's ABI descriptor, manifest, and dependency gates decide whether the
+ artifact is *admitted*; a faulted or refused module is recorded as
+ `Resolution::Failed` in the resolution table (surfaced as
+ `LoadError::Failed`) and never retried in this process — restart is the
+ only recovery, because tinybus never unloads a library.
+
+`boot::load_declared_modules` does two things at startup: it loads search-path
+artifacts directly through the host, then calls `ensure_loaded` for every
+`LoadPolicy::Eager` record (currently only `tinymemory`, and only when
+`memory::binding::admit` selects the module-backed driver; its host callbacks
+are installed first). It never fails the boot. Everything else is
`LoadPolicy::Lazy` and resolves on first `ensure_loaded` call — deliberately
not eager, so a user who never touches a feature never pays its download.
@@ -82,6 +88,8 @@ method constants, request/response types, and its contract version:
| `tinymcp-bus` | `mcp` |
| `tinychannels-bus` | channel vocabulary |
| `tinymemory-api` | memory (selectively re-exported as `crate::memory::api`, not copied or widened) |
+| `tinymemory-bus` | memory method names (`names::methods`, used by `memory_part_01.rs`) |
+| `tinyconnectors-bus` | `tinyconnectors` names and the Composio types `memory_host.rs` forwards |
Rules: never redeclare a contract type in OpenHuman; call members through
contract constants, not string literals; contract crates stay synchronous and
@@ -112,12 +120,18 @@ sandbox boundary. From `AGENTS.md`, do not weaken these:
## Used by
-- `crate::runtime::client` — the ungated facade over
- [`crate::modules::runtime`] for resolving/calling `tinyruntime`.
+- `crate::runtime::client` — the ungated facade re-exporting `resolve`,
+ `execute`, `pool_stats`, and `RuntimeCallError` from `modules::runtime`, so
+ a build without `modules` still compiles.
- `memory::binding` — binds `ModuleMemoryProvider` when the memory driver
selects the module-backed class.
- `core::all::all_registered_controllers` — wires the `modules` RPC namespace
(`crate::modules::all_registered_controllers()`).
- `config::schema::modules::ModulesConfig` — `enabled`, `allow_download`,
- `install_dir`, and `overrides` control only whether the compiled-in modules
- in this directory load, never what is loadable.
+ `install_dir`, and `overrides` control only whether (and from where) the
+ compiled-in modules in this directory load, never what is loadable.
+- The per-module host halves are called from their domains:
+ `web3/wallet/chains/*` and `web3/x402` (`wallet.rs`),
+ `tools/impl/{document,presentation}` (`documents.rs`), `voice/` and
+ `inference/voice` (`voice.rs`), `integrations/composio/module_client.rs`
+ (`connectors.rs`), and `inference/tokenjuice` (`tokenjuice_host.rs`).