Skip to content

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

docs: add module-level doc comments and cross-reference updates

Steven Enamakel3eacad84a1e9
diff --git a/crates/openhuman-core/src/channels/tests/mod.rs b/crates/openhuman-core/src/channels/tests/mod.rs
index 4f852d2005..73f15583d6 100644
--- a/crates/openhuman-core/src/channels/tests/mod.rs
+++ b/crates/openhuman-core/src/channels/tests/mod.rs
@@ -1,3 +1,39 @@
+//! Cross-channel integration suite, declared as
+//! `#[cfg(all(feature = "channels", test))] mod tests` in `channels/mod.rs`
+//! (see AGENTS.md — unit tests otherwise stay beside their modules as
+//! `*_tests.rs`; this tree is the deliberate exception for tests that
+//! exercise more than one channel submodule end-to-end).
+//!
+//! `common.rs` holds the shared fixtures every file below builds on: a fake
+//! `ChatModel` per scenario (`DummyModel`, `SlowModel`, `ToolCallingModel`,
+//! `IterativeToolModel`, `HistoryCaptureModel`, `ModelCaptureModel`), fake
+//! `Channel` implementations that record or replay sends
+//! (`RecordingChannel`, `TelegramRecordingChannel`, `AlwaysFailChannel`), a
+//! `NoopMemory`, a `MockPriceTool`, and `make_workspace` for identity-file
+//! fixtures.
+//!
+//! * `context.rs` — channel runtime-context helpers: timeout clamping,
+//! history compaction, memory-context skip rules.
+//! * `discord_integration.rs` — end-to-end dispatch through the Discord
+//! channel with every cross-module boundary (agent runtime, memory,
+//! provider) substituted, proving the domain stays encapsulated.
+//! * `health.rs` — supervised-listener health classification when a channel
+//! listener keeps failing.
+//! * `identity.rs` — `build_system_prompt` inlining workspace identity
+//! markdown into the Project Context section.
+//! * `memory.rs` — conversation-history and memory-context wiring through
+//! `process_channel_message`.
+//! * `personality.rs` — acceptance coverage for #6027/#6028 (channel turns
+//! carry the active personality; identity edits reach the next turn
+//! without a restart).
+//! * `prompt.rs` — system-prompt section assembly and bootstrap truncation.
+//! * `runtime_dispatch.rs` — the dispatch loop and `RuntimeChannelMessage`
+//! plumbing via `runtime::test_support`.
+//! * `runtime_tool_calls.rs` — tool-call routing through
+//! `process_channel_message`.
+//! * `telegram_integration.rs` — Telegram reactions, reply/thread roundtrip,
+//! and typing-indicator lifecycle against a recording channel.
+
mod common;
mod discord_integration;
mod health;
diff --git a/crates/openhuman-core/src/inference/local/mod.rs b/crates/openhuman-core/src/inference/local/mod.rs
index a6fc19fdff..2e26a35e96 100644
--- a/crates/openhuman-core/src/inference/local/mod.rs
+++ b/crates/openhuman-core/src/inference/local/mod.rs
@@ -1,6 +1,7 @@
//! Local AI runtime — Ollama, LM Studio, Piper sub-process management.
//!
-//! This module was previously `crates/openhuman-core/src/local_ai/`. It now lives under
+//! This module was previously `local_ai/` (in the pre-consolidation,
+//! single-crate `src/openhuman/` layout). It now lives under
//! `inference/local/` so all inference concerns share a single domain root.
#[cfg(test)]
diff --git a/crates/openhuman-core/src/platform/service/README.md b/crates/openhuman-core/src/platform/service/README.md
index d4f8c3af61..97008fbc3f 100644
--- a/crates/openhuman-core/src/platform/service/README.md
+++ b/crates/openhuman-core/src/platform/service/README.md
@@ -96,7 +96,7 @@ Both subscribers are registered idempotently from `crates/openhuman-core/src/cor
- `crates/openhuman-core/src/core/jsonrpc.rs` — registers the restart/shutdown event-bus subscribers at startup.
- `crates/openhuman-core/src/platform/doctor/core.rs` — reads `service::daemon::state_file_path`.
- `crates/openhuman-core/src/platform/update/ops.rs`, `crates/openhuman-core/src/config/ops/loader_part_01.rs` — reference `crate::platform::service` (restart/mock-agent-running paths).
-- `crates/openhuman-core/src/core/all.rs` and `lib.rs` — module wiring.
+- `lib.rs` — module wiring.
## Notes / gotchas
diff --git a/crates/openhuman-core/src/runtime/client/mod.rs b/crates/openhuman-core/src/runtime/client/mod.rs
index ccb8c89067..503e77fa56 100644
--- a/crates/openhuman-core/src/runtime/client/mod.rs
+++ b/crates/openhuman-core/src/runtime/client/mod.rs
@@ -1,6 +1,6 @@
//! The one way the runtime clients reach the `tinyruntime` module.
//!
-//! `openhuman::modules` is behind the `modules` feature, but this directory is
+//! `crate::modules` is behind the `modules` feature, but this directory is
//! not: `ShellTool` holds an `Option<Arc<NodeBootstrap>>` as a field and is
//! kernel, so the toolchain clients are always compiled. Importing
//! `modules::runtime` directly would therefore break every build with the gate
diff --git a/crates/openhuman-core/src/security/policy/mod.rs b/crates/openhuman-core/src/security/policy/mod.rs
index b4d4d155ed..7cb207cc39 100644
--- a/crates/openhuman-core/src/security/policy/mod.rs
+++ b/crates/openhuman-core/src/security/policy/mod.rs
@@ -1,3 +1,7 @@
+//! `SecurityPolicy` and the autonomy/risk gate. See [`README.md`](README.md)
+//! for the invariants this module enforces (workspace-internal path
+//! protection, fail-closed command classification, always-forbidden paths).
+
mod command_checks;
mod enforcement;
mod path_checks;
diff --git a/crates/openhuman-core/src/web3/README.md b/crates/openhuman-core/src/web3/README.md
index 64a14240d2..1e68a4e3dc 100644
--- a/crates/openhuman-core/src/web3/README.md
+++ b/crates/openhuman-core/src/web3/README.md
@@ -87,12 +87,19 @@ deBridge uses real EVM chain ids (1 ETH, 10 Optimism, 56 BNB, 137 Polygon,
maps a deBridge id to the local signer family; ids we can't sign for are
rejected at quote time.
+## Wiring
+
+- `crates/openhuman-core/src/core/all.rs`: `crate::web3::wallet::all_wallet_registered_controllers()` (~line 884), `crate::web3::all_web3_registered_controllers()` (~line 890), `crate::web3::x402::all_x402_registered_controllers()` (~line 569) — each pushed onto the controller registry under `DomainGroup::Web3`.
+- `crates/openhuman-core/src/tools/mod.rs` lines 59-60: `#[cfg(feature = "web3")] pub use crate::web3::wallet::tools::*;` re-exports the wallet agent tool structs.
+- `crates/openhuman-core/src/tools/ops.rs`: calls `crate::web3::all_web3_agent_tools()` to register the swap/bridge/dapp agent tools, alongside the wallet and x402 tool registrations.
+
## Dependencies
- [`crate::web3::wallet`] — `sign_and_broadcast_evm` / `sign_and_broadcast_solana` (crate-internal), `status` for address resolution, `EvmNetwork` / `WalletChain`.
- [`crate::integrations`] (`IntegrationClient`, `build_client`) — backend auth + transport.
- `crate::security::approval::APPROVAL_CHAT_CONTEXT` — quote-owner binding.
- `crate::core::all` / `crate::core` — RPC controller registry wiring.
+- `tinywallet-bus` (`crates/openhuman-core/Cargo.toml` ~line 864, optional, gated by the `web3` feature; features `btc`, `evm`, `solana`, `tron`, `keccak`, `net`, `wire`, `eip712`, `abi`, `tx-codec`) — the contract crate the wallet's signing primitives (and the x402 payment path's EIP-712/ERC-20 encoders) build on: address formats, wire types crossing the `Transport` seam, and the Tron verifier.
## Notes / gotchas
diff --git a/crates/openhuman-core/src/web_chat/web_errors.rs b/crates/openhuman-core/src/web_chat/web_errors.rs
index dc3ede2215..af0f866497 100644
--- a/crates/openhuman-core/src/web_chat/web_errors.rs
+++ b/crates/openhuman-core/src/web_chat/web_errors.rs
@@ -1,3 +1,7 @@
+//! Classifies raw provider error strings into user-facing copy: budget
+//! exhaustion, non-retryable rate limits, and fallback-chain exhaustion.
+//! Split across `web_errors_part_01..03.rs` and `include!`d here.
+
include!("web_errors_part_01.rs");
include!("web_errors_part_02.rs");
include!("web_errors_part_03.rs");