Skip to content

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

docs: standardize punctuation style in README documentation

Steven Enamakela9a9b584dcac
diff --git a/crates/openhuman-core/src/agent/context/README.md b/crates/openhuman-core/src/agent/context/README.md
index e8d9af5e8c..7143370549 100644
--- a/crates/openhuman-core/src/agent/context/README.md
+++ b/crates/openhuman-core/src/agent/context/README.md
@@ -1,8 +1,8 @@
# context
-Global context management for agent sessions: system-prompt assembly, per-session context bookkeeping (utilisation stats, budget configuration, session-memory triggers), and the shared microcompact constants. Agents hold one `ContextManager` per session. This is a **pure logic / state-tracking domain** — no RPC controllers, no agent tools, no event-bus subscribers, no persisted store.
+Global context management for agent sessions: system-prompt assembly, per-session context bookkeeping (utilisation stats, budget configuration, session-memory triggers), and the shared microcompact constants. Agents hold one `ContextManager` per session. This is a **pure logic / state-tracking domain**: no RPC controllers, no agent tools, no event-bus subscribers, no persisted store.
-> **Status (#4249): live history reduction/summarization moved out of this directory.** The in-turn compaction that used to live here (`ContextManager::reduce_before_call`, the `Summarizer` trait, `ProviderSummarizer`, `SegmentRecapSummarizer`, `microcompact.rs`, `pipeline.rs`, `guard.rs`) is gone — see [History](#history-4249). Folding an over-budget transcript into a summary now runs as the vendored `tinyagents_harness::middleware::ContextCompressionMiddleware` (with the seam-owned `ImageAwareMessageTrimMiddleware` as the deterministic backstop) inside `run_turn_via_tinyagents_shared` (`agent/tinyagents/turn_runner.rs`), backed by `agent/tinyagents/summarize.rs::ModelSummarizer`. Tool-result body clearing runs in `tinyagents_harness::middleware::MicrocompactMiddleware`. `stats.rs` keeps the data model behind `ContextManager::stats()` and session-memory bookkeeping.
+> **Status (#4249): live history reduction/summarization moved out of this directory.** The in-turn compaction that used to live here (`ContextManager::reduce_before_call`, the `Summarizer` trait, `ProviderSummarizer`, `SegmentRecapSummarizer`, `microcompact.rs`, `pipeline.rs`, `guard.rs`) is gone: see [History](#history-4249). Folding an over-budget transcript into a summary now runs as the vendored `tinyagents_harness::middleware::ContextCompressionMiddleware` (with the seam-owned `ImageAwareMessageTrimMiddleware` as the deterministic backstop) inside `run_turn_via_tinyagents_shared` (`agent/tinyagents/turn_runner.rs`), backed by `agent/tinyagents/summarize.rs::ModelSummarizer`. Tool-result body clearing runs in `tinyagents_harness::middleware::MicrocompactMiddleware`. `stats.rs` keeps the data model behind `ContextManager::stats()` and session-memory bookkeeping.
## Responsibilities
@@ -10,16 +10,16 @@ Global context management for agent sessions: system-prompt assembly, per-sessio
- Track context-window utilisation per session (`ContextStatsState`).
- Expose the configured per-tool-result byte budget and the compaction/microcompact/autocompact toggles the tinyagents turn reads; enforcement lives in `agent/tinyagents` (`ToolOutputMiddleware`, `MicrocompactMiddleware`, `ContextCompressionMiddleware`) and in `agent/harness/tool_result_artifacts`.
- Expose the microcompact placeholder/keep-recent constants consumed by the microcompact middleware.
-- Track session-memory extraction thresholds (token growth, tool calls, turns) and report when a background archivist extraction should fire — without spawning it itself (`session_memory.rs`).
+- Track session-memory extraction thresholds (token growth, tool calls, turns) and report when a background archivist extraction should fire: without spawning it itself (`session_memory.rs`).
## Key files
| File | Role |
| --- | --- |
| `crates/openhuman-core/src/agent/context/mod.rs` | Module docstring, `pub mod` decls, `pub use` re-exports, and the three shared constants (`DEFAULT_TOOL_RESULT_BUDGET_BYTES`, `CLEARED_PLACEHOLDER`, `DEFAULT_KEEP_RECENT_TOOL_RESULTS`). No other logic. |
-| `crates/openhuman-core/src/agent/context/manager.rs` | `ContextManager` — per-session handle agents hold. Owns the default prompt builder, `ContextStatsState`, and the `ContextConfig`-derived knobs. Surfaces `build_system_prompt` / `build_system_prompt_tiered` / `build_system_prompt_with`, `stats()`, the getters the tinyagents turn reads (`tool_result_budget_bytes`, `compaction_enabled`, `microcompact_keep_recent`, `autocompact_enabled`, `prefer_markdown_tool_output`), and the session-memory trigger/mark methods. |
-| `crates/openhuman-core/src/agent/context/stats.rs` | `ContextStatsState` — last provider usage, context-window utilisation, and the shared `SessionMemoryHandle` (`Arc<Mutex<SessionMemoryState>>`). Pure state; issues no LLM calls and does not mutate history. |
-| `crates/openhuman-core/src/agent/context/session_memory.rs` | `SessionMemoryState` / `SessionMemoryConfig` — threshold-gated `should_extract` decision (token growth, tool calls, and turns must all cross) and extraction bookkeeping. Holds `ARCHIVIST_EXTRACTION_PROMPT`. State-tracking only; does not spawn the archivist. |
+| `crates/openhuman-core/src/agent/context/manager.rs` | `ContextManager`: per-session handle agents hold. Owns the default prompt builder, `ContextStatsState`, and the `ContextConfig`-derived knobs. Surfaces `build_system_prompt` / `build_system_prompt_tiered` / `build_system_prompt_with`, `stats()`, the getters the tinyagents turn reads (`tool_result_budget_bytes`, `compaction_enabled`, `microcompact_keep_recent`, `autocompact_enabled`, `prefer_markdown_tool_output`), and the session-memory trigger/mark methods. |
+| `crates/openhuman-core/src/agent/context/stats.rs` | `ContextStatsState`: last provider usage, context-window utilisation, and the shared `SessionMemoryHandle` (`Arc<Mutex<SessionMemoryState>>`). Pure state; issues no LLM calls and does not mutate history. |
+| `crates/openhuman-core/src/agent/context/session_memory.rs` | `SessionMemoryState` / `SessionMemoryConfig`: threshold-gated `should_extract` decision (token growth, tool calls, and turns must all cross) and extraction bookkeeping. Holds `ARCHIVIST_EXTRACTION_PROMPT`. State-tracking only; does not spawn the archivist. |
| `crates/openhuman-core/src/agent/context/channels_prompt.rs` | Bespoke free functions `build_system_prompt(...)` / `build_system_prompt_with_identity(...)` (plus `PromptIdentityOverride`, `ProjectContextPlacement`, `render_project_context`) for channel runtimes (Discord/Slack/Telegram/…). Byte-stable for prefix-cache hits; injects workspace bootstrap files (`SOUL.md`, `IDENTITY.md`, optional `PROFILE.md`/`MEMORY.md`, with profile overrides for `SOUL.md`/`MEMORY.md`), tools, safety, skills, runtime, and channel-capabilities sections. |
| `crates/openhuman-core/src/agent/context/manager_tests.rs`, `channels_prompt_tests.rs`, `session_memory_tests.rs` | Sibling test files wired via `#[cfg(test)] #[path = "..."] mod tests;` from their source file (the layout check rejects inline test modules). |
@@ -27,13 +27,13 @@ Global context management for agent sessions: system-prompt assembly, per-sessio
Live history reduction/summarization moved out of this directory into the tinyagents turn path:
-- `pipeline.rs` — removed; live context reduction moved to tinyagents middleware, stats/session-memory state lives in `stats.rs`.
-- `guard.rs` — removed; the live 0.90 compression threshold is `SUMMARIZE_THRESHOLD_FRACTION` in `agent/tinyagents/summarize.rs`.
-- `microcompact.rs` — removed; live tool-result body clearing is owned by `tinyagents_harness::middleware::MicrocompactMiddleware`, only the shared constants remain in `mod.rs`.
-- `tool_result_budget.rs` — removed; UTF-8-safe per-result truncation moved next to action-workspace artifact preview/fallback handling in `agent/harness/tool_result_artifacts`.
-- `summarizer.rs` — removed; live summarization moved to `agent/tinyagents/summarize.rs` (`ModelSummarizer`, which also carries the summarizer system prompt).
-- `segment_recap_summarizer.rs` — removed; the archivist-recap-backed compaction wrapper is gone, the archivist still produces durable segment recaps on its own post-turn path.
-- `summarizer_tests.rs` / `segment_recap_summarizer_tests.rs` — removed along with the files above.
+- `pipeline.rs`: removed; live context reduction moved to tinyagents middleware, stats/session-memory state lives in `stats.rs`.
+- `guard.rs`: removed; the live 0.90 compression threshold is `SUMMARIZE_THRESHOLD_FRACTION` in `agent/tinyagents/summarize.rs`.
+- `microcompact.rs`: removed; live tool-result body clearing is owned by `tinyagents_harness::middleware::MicrocompactMiddleware`, only the shared constants remain in `mod.rs`.
+- `tool_result_budget.rs`: removed; UTF-8-safe per-result truncation moved next to action-workspace artifact preview/fallback handling in `agent/harness/tool_result_artifacts`.
+- `summarizer.rs`: removed; live summarization moved to `agent/tinyagents/summarize.rs` (`ModelSummarizer`, which also carries the summarizer system prompt).
+- `segment_recap_summarizer.rs`: removed; the archivist-recap-backed compaction wrapper is gone, the archivist still produces durable segment recaps on its own post-turn path.
+- `summarizer_tests.rs` / `segment_recap_summarizer_tests.rs`: removed along with the files above.
## Public surface
@@ -70,25 +70,25 @@ The durable substrate session-memory targets is the workspace `MEMORY.md` file,
## Dependencies
-- `crate::config` — `ContextConfig` (`config/schema/context.rs`): `enabled`, `microcompact_enabled` / `microcompact_keep_recent`, `autocompact_enabled`, `compaction_enabled`, `tool_result_budget_bytes`, `prefer_markdown_tool_output`, `summarizer_model`, and the embedded `session_memory: SessionMemoryConfig`.
-- `crate::inference::provider::UsageInfo` — fed into `record_usage`.
-- `crate::agent::prompts` — owns prompt rendering; `channels_prompt.rs` uses `inject_inline_content`.
-- `crate::skills::Workflow` — `channels_prompt.rs` renders the available-skills section from a `&[Workflow]`.
+- `crate::config`: `ContextConfig` (`config/schema/context.rs`): `enabled`, `microcompact_enabled` / `microcompact_keep_recent`, `autocompact_enabled`, `compaction_enabled`, `tool_result_budget_bytes`, `prefer_markdown_tool_output`, `summarizer_model`, and the embedded `session_memory: SessionMemoryConfig`.
+- `crate::inference::provider::UsageInfo`: fed into `record_usage`.
+- `crate::agent::prompts`: owns prompt rendering; `channels_prompt.rs` uses `inject_inline_content`.
+- `crate::skills::Workflow`: `channels_prompt.rs` renders the available-skills section from a `&[Workflow]`.
## Used by
-- **`agent::harness`** — the primary consumer: `session/builder/builder_build.rs` constructs the `ContextManager`; `session/turn/core_turn.rs` drives the session-memory counters and spawns the archivist extraction when `should_extract_session_memory` says so; `session/turn/core/harness_turn.rs` reads the budget/compaction getters into the tinyagents turn config; `session/turn/session_io/{transcript_persist,background_tasks}.rs` read `stats()`; `fork_context.rs` and `../subagent_host/` consume prompt types.
-- **`agent::tinyagents`** — `harness_assembly.rs` reads `CLEARED_PLACEHOLDER` when configuring `MicrocompactMiddleware`; `payload_summarizer.rs` and `host/context_composer.rs` build `PromptContext`s through `agent::prompts`.
-- **`agent::registry::agents/*/prompt.rs`**, `flows/agents/*/prompt.rs`, `memory/agent/agent/prompt.rs`, `skills/*/agent/*/prompt.rs` — archetype prompt modules pull prompt sections/builder through `agent::prompts`.
-- **`channels`** — `channels/system_prompt.rs` (`ChannelSystemPrompt`, used by `channels/runtime/startup/start_channels.rs`) calls `channels_prompt::build_system_prompt_with_identity`; `channels/mod.rs` re-exports `build_system_prompt`; the `channels/tests/*` prompt/identity tests call it directly.
-- **`agent::triage`, `agent::debug`, `agent::orchestration::tools` (spawn_subagent and friends), `agent::learning::prompt_sections`, `memory::tool_memory::prompt`, `tools::orchestrator_tools`, `integrations::composio`** — consume prompt types (`PromptContext`, `PromptSection`, `ToolCallFormat`, `ConnectedIntegration`, …) via `agent::prompts`.
-- **`config::schema`** — `context.rs` embeds `SessionMemoryConfig`.
+- **`agent::harness`**: the primary consumer: `session/builder/builder_build.rs` constructs the `ContextManager`; `session/turn/core_turn.rs` drives the session-memory counters and spawns the archivist extraction when `should_extract_session_memory` says so; `session/turn/core/harness_turn.rs` reads the budget/compaction getters into the tinyagents turn config; `session/turn/session_io/{transcript_persist,background_tasks}.rs` read `stats()`; `fork_context.rs` and `../subagent_host/` consume prompt types.
+- **`agent::tinyagents`**: `harness_assembly.rs` reads `CLEARED_PLACEHOLDER` when configuring `MicrocompactMiddleware`; `payload_summarizer.rs` and `host/context_composer.rs` build `PromptContext`s through `agent::prompts`.
+- **`agent::registry::agents/*/prompt.rs`**, `flows/agents/*/prompt.rs`, `memory/agent/agent/prompt.rs`, `skills/*/agent/*/prompt.rs`: archetype prompt modules pull prompt sections/builder through `agent::prompts`.
+- **`channels`**: `channels/system_prompt.rs` (`ChannelSystemPrompt`, used by `channels/runtime/startup/start_channels.rs`) calls `channels_prompt::build_system_prompt_with_identity`; `channels/mod.rs` re-exports `build_system_prompt`; the `channels/tests/*` prompt/identity tests call it directly.
+- **`agent::triage`, `agent::debug`, `agent::orchestration::tools` (spawn_subagent and friends), `agent::learning::prompt_sections`, `memory::tool_memory::prompt`, `tools::orchestrator_tools`, `integrations::composio`**: consume prompt types (`PromptContext`, `PromptSection`, `ToolCallFormat`, `ConnectedIntegration`, …) via `agent::prompts`.
+- **`config::schema`**: `context.rs` embeds `SessionMemoryConfig`.
## Notes / gotchas
- **The context stats state issues no LLM calls and does not mutate history.** Live reduction is owned by the tinyagents middleware stack.
- **Tool-result budgeting is not a context pipeline stage.** The tinyagents path applies per-result budgets in `ToolOutputMiddleware` (`agent/tinyagents/middleware/tool_output.rs`), and artifact-preview fallback truncation lives in `agent/harness/tool_result_artifacts`.
-- **`autocompact_enabled()` is `config.enabled && config.autocompact_enabled`**, and `microcompact_keep_recent()` is `0` when `microcompact_enabled` is off — the manager folds the config gates so the turn reads one value per knob.
+- **`autocompact_enabled()` is `config.enabled && config.autocompact_enabled`**, and `microcompact_keep_recent()` is `0` when `microcompact_enabled` is off: the manager folds the config gates so the turn reads one value per knob.
- **Session memory is separate from compaction**: it does not mutate in-flight history; it gates a *persistent* `MEMORY.md` extraction. All three thresholds (token growth, tool calls, turns) must be crossed and no extraction may be in flight. `mark_extraction_failed` keeps deltas so the next turn retries; `mark_extraction_complete` resets them. The handle is `Arc`-cloned so a detached background task can flip completion state after the synchronous borrow is released.
- Prompt rendering does not belong in this module; add it to `agent::prompts`.
- **`channels_prompt::build_system_prompt` deliberately bypasses `SystemPromptBuilder`** to keep production channel prompt bytes stable for prefix-cache hits; it is a standalone free function despite living under `context/`.
diff --git a/crates/openhuman-core/src/agent/experience/README.md b/crates/openhuman-core/src/agent/experience/README.md
index 90dfe50900..f9ba2ef861 100644
--- a/crates/openhuman-core/src/agent/experience/README.md
+++ b/crates/openhuman-core/src/agent/experience/README.md
@@ -48,7 +48,7 @@ Namespace `agent_experience` (registered into `crates/openhuman-core/src/core/al
## Events
-None — no `bus.rs`; this module does not publish or subscribe to `DomainEvent`s.
+None: no `bus.rs`; this module does not publish or subscribe to `DomainEvent`s.
## Persistence
@@ -59,19 +59,19 @@ Records are stored through the `Memory` trait (no dedicated DB), served by `Driv
## Dependencies
-- `crate::memory` — `Memory` trait, `MemoryCategory`, `memory::binding::{for_config, for_subtree}` (driver binding behind `DriverMemory`), `memory::api::{provider, recall, types, health}` (the provider contract `DriverMemory` adapts), `memory::safety::sanitize_text` (store-time scrub), `memory::source_scope::as_bus_scope` (explicit recall scope), `memory::preferences::recall_by_vector_over`.
-- `crate::config` — `Config::load_or_init` for `workspace_dir` and `subsystems.memory` when the RPC handlers bind a store.
-- `crate::core::all` — `ControllerFuture`, `RegisteredController` for RPC registration.
-- `crate::core` — `ControllerSchema`, `FieldSchema`, `TypeSchema` (schema types); `crate::rpc::RpcOutcome`.
-- `crate::memory::tool_memory::test_helpers::MockMemory` and `crate::memory::guard::test_support::RecordingProvider` — tests only.
+- `crate::memory`: `Memory` trait, `MemoryCategory`, `memory::binding::{for_config, for_subtree}` (driver binding behind `DriverMemory`), `memory::api::{provider, recall, types, health}` (the provider contract `DriverMemory` adapts), `memory::safety::sanitize_text` (store-time scrub), `memory::source_scope::as_bus_scope` (explicit recall scope), `memory::preferences::recall_by_vector_over`.
+- `crate::config`: `Config::load_or_init` for `workspace_dir` and `subsystems.memory` when the RPC handlers bind a store.
+- `crate::core::all`: `ControllerFuture`, `RegisteredController` for RPC registration.
+- `crate::core`: `ControllerSchema`, `FieldSchema`, `TypeSchema` (schema types); `crate::rpc::RpcOutcome`.
+- `crate::memory::tool_memory::test_helpers::MockMemory` and `crate::memory::guard::test_support::RecordingProvider`: tests only.
## Used by
-- `crates/openhuman-core/src/core/all.rs` — registers controllers/schemas and the namespace description.
-- `crates/openhuman-core/src/agent/mod.rs` — declares `pub mod experience`.
-- `crates/openhuman-core/src/agent/session_host/turn/core/experience_context.rs` — defines `Agent::inject_agent_experience_context`, which queries the session store plus the shared store with `retrieve_across_stores` (max 3 hits, 2048-byte block, gated on `learning_enabled`) and prepends the block to the enriched user message. Called from `turn/core_turn.rs`.
-- `crates/openhuman-core/src/agent/tinyagents/host/experience_store.rs` — host adapter implementing `tinyagents_harness::host::ExperienceStore` over `AgentExperienceStore`.
-- `crates/openhuman-core/src/config/migration_helpers/core.rs` — uses `DriverMemory::for_config` to bind the import target.
+- `crates/openhuman-core/src/core/all.rs`: registers controllers/schemas and the namespace description.
+- `crates/openhuman-core/src/agent/mod.rs`: declares `pub mod experience`.
+- `crates/openhuman-core/src/agent/session_host/turn/core/experience_context.rs`: defines `Agent::inject_agent_experience_context`, which queries the session store plus the shared store with `retrieve_across_stores` (max 3 hits, 2048-byte block, gated on `learning_enabled`) and prepends the block to the enriched user message. Called from `turn/core_turn.rs`.
+- `crates/openhuman-core/src/agent/tinyagents/host/experience_store.rs`: host adapter implementing `tinyagents_harness::host::ExperienceStore` over `AgentExperienceStore`.
+- `crates/openhuman-core/src/config/migration_helpers/core.rs`: uses `DriverMemory::for_config` to bind the import target.
## Notes / gotchas
diff --git a/crates/openhuman-core/src/config/schema/README.md b/crates/openhuman-core/src/config/schema/README.md
index 429fd55626..37beb39dbb 100644
--- a/crates/openhuman-core/src/config/schema/README.md
+++ b/crates/openhuman-core/src/config/schema/README.md
@@ -34,7 +34,7 @@ is mounted as a submodule of `load/dirs.rs` via `#[path]`.
| `[hosting]` | `hosting.rs` | `HostingConfig` |
| `[learning]` | `learning.rs` | `LearningConfig`, `ReflectionSource` |
| `[local_ai]` | `local_ai.rs` | `LocalAiConfig`, `LocalAiUsage` |
-| `[modules]` | `modules.rs` | `ModulesConfig`, `ModuleOverride` — controls only whether compiled-in modules load; the loadable *set* is fixed by `crate::modules::registry` |
+| `[modules]` | `modules.rs` | `ModulesConfig`, `ModuleOverride`: controls only whether compiled-in modules load. The loadable *set* is fixed by `crate::modules::registry` |
| `[node]` | `node.rs` | `NodeConfig` (managed Node.js toolchain for skills) |
| `[observability]` | `observability.rs` | `ObservabilityConfig`, `AgentTracingConfig` |
| `[privacy]` | `privacy.rs` | `PrivacyConfig`, `PrivacyMode` |
@@ -49,7 +49,7 @@ is mounted as a submodule of `load/dirs.rs` via `#[path]`.
| `[subsystems]` | `subsystems.rs` | `SubsystemsConfig`, `MemorySubsystemConfig` |
| `[task_sources]` | `task_sources.rs` | `TaskSourcesConfig` |
| `[tokenjuice]` | `tokenjuice.rs` | `TokenjuiceConfig` |
-| tool-related sections (see below) | `tools/` | — |
+| tool-related sections (see below) | `tools/` | (multiple structs) |
| `[update]` | `update.rs` | `UpdateConfig`, `UpdateRestartStrategy` |
| `[voice_server]` | `voice_server.rs` | `VoiceServerConfig`, `SttEngine`, `VoiceActivationMode` |
| `[[voice_providers]]`, `stt_provider` / `tts_provider` | `voice_providers.rs` | `VoiceProviderCreds`, `BuiltinVoiceProvider`, `BUILTIN_VOICE_PROVIDERS` |