Skip to content

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

docs(TEST-COVERAGE-MATRIX): restructure Memory System section for Memory v2

Steven Enamakel036c302c43df
diff --git a/docs/TEST-COVERAGE-MATRIX.md b/docs/TEST-COVERAGE-MATRIX.md
index 7f393a82ec..8b26d41e93 100644
--- a/docs/TEST-COVERAGE-MATRIX.md
+++ b/docs/TEST-COVERAGE-MATRIX.md
@@ -177,7 +177,7 @@ Local inference runs against a runtime the user installs, starts, and pulls mode
| ----- | ---------------------- | ----- | ---------------------------------------------------------------- | ------ | ------------------------------------- |
| 4.1.1 | Session Creation | WD | `conversations-web-channel-flow.spec.ts` | ✅ | |
| 4.1.2 | Session Persistence | WD | `conversations-web-channel-flow.spec.ts` | ✅ | |
-| 4.1.3 | Multi-Session Handling | RU+WD | `crates/openhuman-core/src/memory/conversations/store/store_concurrency_tests.rs`, `agent-review.spec.ts`, `conversations-web-channel-flow.spec.ts` | 🟡 | 100 concurrent transcript writers use independent per-thread locks without loss/corruption; no dedicated frontend multi-thread switch test |
+| 4.1.3 | Multi-Session Handling | RU+WD | `vendor/tinyagents/crates/tinyagents-session/src/threads/` (vendored `tinyagents`), `agent-review.spec.ts`, `conversations-web-channel-flow.spec.ts` | 🟡 | 100 concurrent transcript writers use independent per-thread locks without loss/corruption; no dedicated frontend multi-thread switch test |
### 4.2 Messaging
@@ -340,60 +340,45 @@ End-to-end coverage of the agent harness via the web-chat RPC surface against an
---
-## 8. Memory System (Persistent AI Memory)
+## 8. Memory System (Memory v2: Recall, Fetch, Store)
+
+Spec: `docs/specs/memory-v2.md` (host) and `vendor/tinymemory/docs/specs/memory-v2.md` (engine contract). Core unit tests sit beside each module in `crates/openhuman-core/src/memory/` (`*_tests.rs`).
### 8.1 Memory Operations
-| ID | Feature | Layer | Test path(s) | Status | Notes |
-| ----- | ------------- | ----- | ------------------------------------------------------------------------------ | ------ | ------ |
-| 8.1.1 | Store Memory | RI+WD | `tests/memory_roundtrip_e2e.rs`, `app/test/e2e/specs/memory-roundtrip.spec.ts` | ✅ | Was ❌ |
-| 8.1.2 | Recall Memory | RI+WD | same | ✅ | Was ❌ |
-| 8.1.3 | Forget Memory | RI+WD | same | ✅ | Was ❌ |
-
-### 8.2 Memory Handling
-
-| ID | Feature | Layer | Test path(s) | Status | Notes |
-| ----- | -------------------------------- | ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| 8.2.2 | Memory Consistency | RI | `tests/in_process/worker_c_modules_e2e.rs` | ✅ | Worker C RPC E2E verifies memory-tree ingest is reflected by `memory_sync_status_list` |
-| 8.2.3 | Memory Scaling | RU | `vendor/tinymemory/crates/tinymemory-core/src/ingest_pipeline_tests.rs`, `vendor/tinymemory/crates/tinymemory-core/src/ingestion/queue_tests.rs` (vendored `tinymemory`) | 🟡 | Ingestion moved into the `tinymemory` module; soak/scale benchmark not asserted |
-| 8.2.4 | Raw-archive sync reconcile | RU+RI | `crates/openhuman-core/src/memory/sources/reconcile_tests.rs`, `crates/openhuman-core/src/memory/sources/sync_tests.rs`, `vendor/tinymemory/crates/tinymemory-core/src/sync/workspace/periodic_tests.rs` (vendored `tinymemory`), `tests/json_rpc_e2e.rs` (`json_rpc_memory_sources_reconcile_reports_pending_raw_files`), `tests/in_process/memory_sources_e2e.rs` | ✅ | Coverage gate + incremental rebuild + workspace periodic scheduler + `memory_sources_reconcile` RPC |
-| 8.2.5 | Coding-session persona ingestion | RU+RI+VU+WD | `vendor/tinymemory/crates/tinymemory-core/src/engine/persona_tests.rs` (vendored `tinymemory`), `crates/openhuman-core/src/memory/sources/rpc_tests.rs`, `tests/json_rpc_e2e.rs`, `app/src/components/intelligence/__tests__/CodingSessionsCard.test.tsx`, `app/src/services/memorySourcesService.test.ts`, `app/test/e2e/specs/coding-session-memory.spec.ts`, `app/test/playwright/specs/coding-session-memory.spec.ts` | ✅ | Discovers Codex and Claude Code histories, excludes machine-authored turns, exposes status/ingest RPCs, and surfaces incremental ingestion on Brain > Sources |
-| 8.2.6 | Folder-source path picker | RU+VU | `crates/openhuman-app/src/directory_picker.rs`, `app/src/utils/tauriCommands/directoryPicker.test.ts`, `app/src/components/intelligence/FolderField.test.tsx` | ✅ | Browse resolves an absolute path through the OS-native chooser and refuses to store a non-resolvable value (bare directory name) when none is available (#5831) |
-| 8.2.7 | Sync History and live sync activity | RU+RI+VU | `crates/openhuman-core/src/memory/sources/run_history_tests.rs`, `crates/openhuman-core/src/memory/sources/rpc/driver_run_tests.rs`, `crates/openhuman-core/src/memory/sources/rpc_monthly_summary_tests_tests.rs`, `crates/openhuman-core/src/integrations/composio/ops/connector_runs_tests.rs`, `crates/openhuman-core/src/integrations/composio/ops/source_rows_tests.rs`, `crates/openhuman-core/src/memory/sync_activity_tests.rs`, `tests/in_process/memory_sources_e2e.rs` (`sources_sync_dispatches_to_the_module_rather_than_refusing_the_capability`), `app/src/components/intelligence/SyncAuditPanel.test.tsx`, `app/src/components/intelligence/SyncActivityCard.test.tsx`, `app/src/components/intelligence/__tests__/memorySyncActivityStore.test.ts`, `app/src/components/intelligence/MemorySourceRow.test.tsx`, `app/src/components/intelligence/MemoryTreeStatusPanel.test.tsx` | ✅ | Every host-driven run (Sync button, Apply all, Composio) leaves one history row merged with the driver's audit log; manual driver runs end in `completed` or `failed`; a late per-document stage cannot reopen a finished row; Brain > Sync shows what is syncing and the job queue, and re-reads the history when a run ends (#6257) |
-| 8.2.8 | Selectable memory engines and migration | RU+RI+VU | `crates/openhuman-core/src/memory/ops/engine_migrate_tests.rs`, `crates/openhuman-core/src/memory/ops/engine_tests.rs`, `tests/memory_engine_e2e.rs`, `tests/memory_engine_migrate_e2e.rs`, `tests/memory_hosted_surface_e2e.rs`, `app/src/components/settings/panels/MemoryEnginePanel.test.tsx`, `app/src/components/settings/panels/MemoryEngineErrorAlert.test.tsx`, `app/src/components/intelligence/MemoryFamilyGate.test.tsx`, `app/src/pages/__tests__/Brain.test.tsx` | ✅ | Engine selection, migration copy/cancel/failure behavior, hosted and external drivers, and capability gating; on the hosted engine a 403 reads `MEMORY_FORBIDDEN:` (never a sign-out), an outage `MEMORY_UNREACHABLE:`, and Brain's sync panels say "Not available" (#6718). The hosted engine serves goals, tool rules, documents, the source sink and maintenance (`memory_hosted_surface_e2e.rs::the_hosted_engine_serves_documents_and_tool_rules`), draws the Brain graph from the server's derived facts (`::the_hosted_engine_draws_the_brain_graph_from_its_understanding`), and takes a local folder synced by the host (`::a_local_folder_syncs_into_hosted_memory`, `memory/sources/hosted_sync_tests.rs`), forgetting a file deleted from the folder (`hosted_sync_tests.rs::a_deleted_file_is_forgotten_by_the_id_the_sink_gave_it`); Brain gates coding sessions on their own family and local-store controls on `chunks`. A copy carries document details, goals, the profile, the conversation history and re-sent content, reporting each step and naming what the new engine cannot take (`engine_migrate_tests.rs`, `MemoryEnginePanel.test.tsx`; the steps themselves are tinymemory's `migrate::copy_all`). On hosted memory the learning rebuild writes only facets that changed (`agent/learning/stability_detector_tests.rs::skipped_writes_track_a_detector_that_writes_every_cycle`) and segment recaps fold with the host's model (`agent/harness/archivist/recap_tests.rs::the_host_model_folds_a_segment_the_driver_cannot`) |
-
-### 8.3 Memory Retrieval Benchmarks
-
-| ID | Feature | Layer | Test path(s) | Status | Notes |
-| ----- | ------------------------------------ | ----- | ----------------------------------------------------------------------------------------------- | ------ | --------------------------------------------------------------------------------------------- |
-| 8.3.2 | Cross-Chat Entity Discoverability | RU | `vendor/tinymemory/crates/tinymemory-core/src/tree/retrieval/benchmarks.rs::bench_cross_chat_entity_discoverable` | ✅ | Verifies entity canonicalisation across multiple chats |
-| 8.3.3 | Citation Bundle Provenance | RU | `vendor/tinymemory/crates/tinymemory-core/src/tree/retrieval/benchmarks.rs::bench_citation_bundle_provenance` | 🟡 | Verifies source_ref and tree_scope are populated in retrieval hits **Vacuity risk, 2026-09-24.** `bench_config()` sets `embedding_endpoint`/`embedding_model` to `None`, and this benchmark guards every assertion behind `if source_resp.total == 0 { return; }`. A test that returns before its assertions reports PASS, so it cannot distinguish "this works" from "the fixture produced nothing", and reverting the feature would not turn it red. Whether the guard actually fires on a default run is UNRESOLVED — it needs one `cargo test` inside `vendor/tinymemory`, which was deliberately not run because dirtying a submodule risks a pin rewind in the parent. Fix is a tinymemory PR: assert `total > 0` as a fixture precondition, then the real claim. |
-| 8.3.4 | Citation Fetch Leaves Hydration | RU | `vendor/tinymemory/crates/tinymemory-core/src/tree/retrieval/benchmarks.rs::bench_citation_fetch_leaves_hydrates` | ✅ | Verifies fetch_leaves returns content for exact chunk IDs |
-| 8.3.7 | Long-Source Exact Leaf Retrieval | RU | `vendor/tinymemory/crates/tinymemory-core/src/tree/retrieval/benchmarks.rs::bench_long_source_retrieves_exact_leaf` | 🟡 | Embedder required for seal + chunking; test runs in inert mode but assertions are conditional **Vacuity risk, 2026-09-24.** `bench_config()` sets `embedding_endpoint`/`embedding_model` to `None`, and this benchmark guards every assertion behind `if source_resp.total == 0 { return; }`. A test that returns before its assertions reports PASS, so it cannot distinguish "this works" from "the fixture produced nothing", and reverting the feature would not turn it red. Whether the guard actually fires on a default run is UNRESOLVED — it needs one `cargo test` inside `vendor/tinymemory`, which was deliberately not run because dirtying a submodule risks a pin rewind in the parent. Fix is a tinymemory PR: assert `total > 0` as a fixture precondition, then the real claim. |
-| 8.3.9 | Scale Ingest 20 Sources No Real Data | RU | `vendor/tinymemory/crates/tinymemory-core/src/tree/retrieval/benchmarks.rs::bench_scale_ingest_20_sources_no_real_data` | 🟡 | Verifies retrieval correctness at scale with synthetic data **Vacuity risk, 2026-09-24.** `bench_config()` sets `embedding_endpoint`/`embedding_model` to `None`, and this benchmark guards every assertion behind `if source_resp.total == 0 { return; }`. A test that returns before its assertions reports PASS, so it cannot distinguish "this works" from "the fixture produced nothing", and reverting the feature would not turn it red. Whether the guard actually fires on a default run is UNRESOLVED — it needs one `cargo test` inside `vendor/tinymemory`, which was deliberately not run because dirtying a submodule risks a pin rewind in the parent. Fix is a tinymemory PR: assert `total > 0` as a fixture precondition, then the real claim. |
-
-### 8.4 Explicit User Preferences (Two-Lane)
-
-| ID | Feature | Layer | Test path(s) | Status | Notes |
-| ----- | ------------------------------------------ | ----- | -------------------------------------------------------------------------------------------------------------- | ------ | ----------------------------------------------------------------------- |
-| 8.4.1 | Save Preference (general / situational) | RU | `crates/openhuman-core/src/agent/tools/save_preference_tests.rs` | ✅ | `save_preference` tool → `user_pref_{general,situational}`, topic-keyed |
-| 8.4.2 | Lane A — Standing Prefs in System Prompt | RU | `crates/openhuman-core/src/agent/learning/prompt_sections.rs`, `crates/openhuman-core/src/agent/session_host/turn_tests.rs` | ✅ | General prefs rendered into the system prompt at thread start |
-| 8.4.3 | Lane B — Situational Recall (vector-gated) | RU | `crates/openhuman-core/src/agent/session_host/turn_learned_context_and_announcements_tests.rs::situational_preference_reaches_the_model_through_driver_memory`, `crates/openhuman-core/src/agent/experience/ops_tests.rs::recall_relevant_by_vector_*`, `crates/openhuman-core/src/memory/preferences/preferences_tests.rs` | ✅ | Per-turn through the production `DriverMemory` handle (#6041); relevant query injects, below-floor suppresses |
-| 8.4.4 | Same-Topic Contradiction (replace) | RU | `crates/openhuman-core/src/agent/tools/save_preference_tests.rs::recategorising_moves_pref_between_namespaces` | ✅ | `ON CONFLICT REPLACE`; a topic lives in exactly one scope |
-| 8.4.5 | Cross-Topic Contradiction Surfacing | RU | `crates/openhuman-core/src/agent/tools/save_preference_tests.rs::save_surfaces_related_preference_for_contradiction_check` | ✅ | Related prefs surfaced in the tool result for the chat agent to resolve |
-| 8.4.6 | vector_chunks Model-Signature Recall Guard | RU | `vendor/tinymemory/crates/tinymemory-core/src/store/namespace_store/query_tests.rs::vector_recall_excludes_other_model_signature` (vendored `tinymemory`) | ✅ | Excludes cross-model vectors; dim-guards legacy rows |
-| 8.4.7 | Lane C — Auto-recall of User Facts (gated) | RU | `crates/openhuman-core/src/memory/auto_recall/{gate_tests,auto_recall_tests}.rs`, `crates/openhuman-core/src/agent/session_host/turn_auto_recall_tests.rs::auto_recall_*` | ✅ | #6040: lexical gate, bounded `fast_retrieve` via the guard, block rides the user message; `hooks.auto_recall` switch |
-| 8.4.8 | Lane C Boot Warm-up | RU | `crates/openhuman-core/src/memory/auto_recall/warm_tests.rs` | ✅ | One bounded retrieval after the memory module loads; failure/timeout are log-only |
-| 8.4.9 | Memory-Access Instruction (ungated) | RU | `crates/openhuman-core/src/agent/learning/prompt_sections_tests_2_tests.rs` | ✅ | Added whenever a retrieval tool is visible, independent of `learning.enabled`; forbids claiming absence unsearched |
-| 8.4.10 | Memory-Write Instruction + `memory_store` defaults | RU | `crates/openhuman-core/src/agent/learning/prompt_sections_tests_2_tests.rs::memory_write_*`, `crates/openhuman-core/src/agent/learning/prompt_sections_tests_2_tests.rs::write_tool_gate_*`, `crates/openhuman-core/src/agent/session_host/builder/builder_tests_memory_write_instruction_tests.rs::memory_write_instruction_*`, `crates/openhuman-core/src/memory/tools/store_tests.rs::resolve_*` | ✅ | #6048: "remember X" must be a write before the reply; section keyed on write-tool visibility, not `learning.enabled`; `memory_store` namespace/key optional |
-| 8.4.11 | Lane C — Notes leg (`global` namespace) + hint | RU | `crates/openhuman-core/src/memory/auto_recall/notes_lane_tests.rs` (all), `crates/openhuman-core/src/memory/auto_recall/unscored_lane_tests.rs` (all), `crates/openhuman-core/src/memory/auto_recall/refusal_tests.rs` (all), `crates/openhuman-core/src/memory/auto_recall/auto_recall_tests.rs::from_guard_reads_through_the_guarded_retrieval_family`, `crates/openhuman-core/src/agent/session_host/turn_auto_recall_tests.rs::auto_recall_injects_a_note_written_by_memory_store_when_the_tree_is_empty` | ✅ | #6063: a fact `memory_store` filed in `global` is recalled through `recall_namespace_scored` beside the tree walk (per-leg budget, absolute 0.35 floor, notes render first, `ExternalSync`/connector-keyed notes wrapped); block opens with the "pre-fetched, not a search" hint; an engine that ranks without scoring (hosted CortexDB) contributes its first three notes, and a refused lookup names its reason in the block (#6718) |
-
-### 8.5 Long-term Goals
-
-| ID | Feature | Test | Source / Test File | Status | Notes |
-| ----- | --------------------------------- | ----- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ | ------------------------------------------------------------------------------------------------- |
-| 8.5.1 | Goals CRUD (list/add/edit/delete) | RU+VU | `crates/openhuman-core/src/memory/goals/doc_tests.rs`, `crates/openhuman-core/src/memory/goals/ops_tests.rs`, `crates/openhuman-core/src/memory/goals/schemas_tests.rs`, `crates/openhuman-core/src/memory/tools/goals_tests.rs`, `app/src/services/api/goalsApi.test.ts`, `app/src/components/intelligence/GoalsPanel.test.tsx` | ✅ | Editable `MEMORY_GOALS.md` list over `memory_goals_*` RPC + Brain > Goals UI |
-| 8.5.2 | Goals enrichment (reflect) | RU+VU | `crates/openhuman-core/src/memory/goals/enrich.rs`, `crates/openhuman-core/src/memory/goals/schemas.rs`, `app/src/components/intelligence/GoalsPanel.test.tsx` | 🟡 | Turn-based `goals_agent` enrichment; prompt/registry/error paths unit-tested, live LLM run manual |
+| ID | Feature | Layer | Test path(s) | Status | Notes |
+| ----- | -------------------------------- | ----- | ------------ | ------ | ----- |
+| 8.1.1 | Learn / store a learning | RU+RI+WD | `crates/openhuman-core/src/memory/ops_tests.rs`, `crates/openhuman-core/src/memory/tools_tests.rs`, `tests/memory_v2_e2e.rs` (`learn_list_fetch_recall_and_forget_round_trip`), `app/test/playwright/specs/memory-v2.spec.ts` | ✅ | `memory` tool `learn` action and `openhuman.memory_learn` |
+| 8.1.2 | Recall (answer with citations) | RU+RI+WD | `crates/openhuman-core/src/memory/ops_tests.rs`, `tests/memory_v2_e2e.rs`, `app/test/playwright/specs/memory-v2.spec.ts` | ✅ | Ask chip |
+| 8.1.3 | Fetch and list | RU+RI | `crates/openhuman-core/src/memory/ops_tests.rs`, `tests/memory_v2_e2e.rs` | ✅ | Hybrid only on both launch engines; other modes answer `UNSUPPORTED` |
+| 8.1.4 | Forget | RU+RI+WD | `crates/openhuman-core/src/memory/ops_tests.rs`, `tests/memory_v2_e2e.rs`, `app/test/playwright/specs/memory-v2.spec.ts` | ✅ | By id |
+| 8.1.5 | Agent `memory` tool | RU | `crates/openhuman-core/src/memory/tools_tests.rs` | ✅ | Actions `recall`, `fetch`, `learn`, `forget`; not registered when memory is off |
+
+### 8.2 Engines, Ingestion and Context
+
+| ID | Feature | Layer | Test path(s) | Status | Notes |
+| ----- | ---------------------------------------- | ----- | ------------ | ------ | ----- |
+| 8.2.1 | Engine list, select, status; memory off | RU+RI+WD | `crates/openhuman-core/src/memory/engine_tests.rs`, `crates/openhuman-core/src/memory/status_tests.rs`, `crates/openhuman-core/src/memory/error_tests.rs`, `tests/memory_v2_e2e.rs` (`memory_is_off_when_signed_out`, `signing_in_turns_memory_on`, `engines_list_get_and_set`, `engine_failures_surface_as_structured_errors`), `app/test/playwright/specs/memory-v2.spec.ts` | ✅ | TinyHumans and CortexDB |
+| 8.2.2 | Per-account isolation | RI | `tests/memory_v2_e2e.rs` (`memory_is_isolated_per_account`) | ✅ | |
+| 8.2.3 | Conversation batching | RU+RI | `crates/openhuman-core/src/memory/conversations/buffer_tests.rs`, `crates/openhuman-core/src/memory/conversations/mod_tests.rs`, `crates/openhuman-core/src/memory/bus_tests.rs`, `tests/memory_v2_e2e.rs` (`conversations_get_and_set_round_trip`) | ✅ | `batch_turns` / `idle_secs`; tool call names and ids only |
+| 8.2.4 | Exit flush of buffered turns | RU | `crates/openhuman-core/src/memory/exit_tests.rs` | ✅ | 2 second budget |
+| 8.2.5 | Document sources: add, sync, list, remove | RU+RI+WD | `crates/openhuman-core/src/memory/sources/sync_tests.rs`, `crates/openhuman-core/src/memory/sources/composio_tests.rs`, `crates/openhuman-core/src/memory/sources/mod_tests.rs`, `tests/memory_v2_e2e.rs` (`sources_add_sync_list_and_remove`), `app/test/playwright/specs/memory-v2.spec.ts` | ✅ | folder, file, link, github, rss, composio |
+| 8.2.6 | Folder-source path picker | RU+VU | `crates/openhuman-app/src/directory_picker.rs`, `app/src/utils/tauriCommands/directoryPicker.test.ts` | ✅ | |
+| 8.2.7 | `context.md` compile, read, injection | RU+RI+WD | `crates/openhuman-core/src/memory/context_tests.rs`, `tests/memory_v2_e2e.rs`, `app/test/playwright/specs/memory-v2.spec.ts` | ✅ | First user message of new sessions only |
+| 8.2.8 | One-time import of previous (v1) memory | RU+RI+WD | `crates/openhuman-core/src/memory/import_tests.rs`, `tests/memory_v2_e2e.rs`, `app/test/playwright/specs/memory-v2.spec.ts` (`importing previous memory needs explicit consent`) | ✅ | Refused without consent |
+| 8.2.9 | MCP memory tools | RU | `crates/openhuman-core/src/mcp/server/tools/` | ✅ | `memory.recall`, `memory.fetch`, `memory.list`, `memory.learn`, `memory.forget` |
+| 8.2.10 | Memory UI chips and legacy redirects | VU+WD | `app/src/components/memory/*.test.tsx`, `app/test/playwright/specs/memory-v2.spec.ts` | ✅ | Engine, Ask, Learnings, Conversations, Documents, Context; `/brain` and `/settings/memory-engine` redirect |
+
+### 8.3 TinyMemory Engine Contract
+
+| ID | Feature | Layer | Test path(s) | Status | Notes |
+| ----- | ----------------------------- | ----- | ------------ | ------ | ----- |
+| 8.3.1 | Conformance suite | RU | `vendor/tinymemory/crates/tinymemory-conformance/` (vendored `tinymemory`) | ✅ | Reference engine and both CortexDB wires through an HTTP double |
+| 8.3.2 | Sources, documents, safety, context, import crates | RU | `vendor/tinymemory/crates/tinymemory-{sources,documents,safety,context,import}/` (vendored `tinymemory`) | ✅ | SSRF guard, scrubbing, budgeted context, legacy reader |
+
+### 8.4 Chat Thread Store (not memory)
+
+The thread JSONL store moved to `tinyagents_session::threads` (`vendor/tinyagents`); the host wrapper is `crates/openhuman-core/src/threads/store/`. See 4.1.
---