The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.
Rust agent-orchestrationai-agentsai-assistantdesktopllmlocal-firstmcppersonal-aiprivacyrustsecond-braintauri
Apply prettier to plan-5560.md\n
shanud717abb36651
diff --git a/plan-5560.md b/plan-5560.mdindex e88e39b792..6b003083cc 100644--- a/plan-5560.md+++ b/plan-5560.md@@ -1,7 +1,7 @@# openhuman#5560 — remaining work, host side**Audience:** whoever finishes `#5560` in the **openhuman** repo.-**Boundary:** the upstream half (tinycortex + tinymemory) is **written, tested and pushed** — see *Upstream, not yours* below. What is left upstream is two merges and a release tag, none of which is code. Everything in "Your work" assumes those have happened.+**Boundary:** the upstream half (tinycortex + tinymemory) is **written, tested and pushed** — see _Upstream, not yours_ below. What is left upstream is two merges and a release tag, none of which is code. Everything in "Your work" assumes those have happened.Every file:line in this document was verified against the trees on 2026-08-25. Where a claim was inherited from an earlier session and turned out to be wrong, it is corrected here and marked.@@ -11,33 +11,33 @@ Every file:line in this document was verified against the trees on 2026-08-25. W`#5560`'s own acceptance criteria, measured at `0410ce73a` + the two commits after it:-| # | Criterion | Status |-|---|---|---|-| 1 | `grep -r 'tinymemory_core::' src/` clean outside the seam | ❌ **236 non-comment refs across 113 files** |-| 2 | Crate out of the build (`cargo tree -i tinymemory-core`) | ❌ still resolves at the product feature set |-| 3 | Kernel floor ratcheted down | ❌ blocked on 2 |-| 4 | cargo-machete `ignored` entries removed | ❌ `Cargo.toml:35` |-| 5 | Behaviour unchanged + coverage on the bus path | ✅ for everything migrated so far |-| 6 | `AGENTS.md` memory section updated | ❌ — and **currently wrong**: line 941 claims "~71 lines across 38 production files"; actual is 236/113 |+| # | Criterion | Status |+| --- | --------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- |+| 1 | `grep -r 'tinymemory_core::' src/` clean outside the seam | ❌ **236 non-comment refs across 113 files** |+| 2 | Crate out of the build (`cargo tree -i tinymemory-core`) | ❌ still resolves at the product feature set |+| 3 | Kernel floor ratcheted down | ❌ blocked on 2 |+| 4 | cargo-machete `ignored` entries removed | ❌ `Cargo.toml:35` |+| 5 | Behaviour unchanged + coverage on the bus path | ✅ for everything migrated so far |+| 6 | `AGENTS.md` memory section updated | ❌ — and **currently wrong**: line 941 claims "~71 lines across 38 production files"; actual is 236/113 |**1 of 6.** Criteria 2–4 are one gate: they all fall together on the day the last reference goes, and not before. Progress before that day does not move the table, which is why the count dropping 285 → 236 shows up nowhere above.### What is already done (do not redo)-Every call site whose fix was *"add a contract member and route the caller"* is migrated, and this is now proven rather than asserted — all 86 distinct engine symbols were classified: **15 EXACT** (migrated), **9 SHAPE_DIFFERS**, **44 NO_MEMBER** (they hand out a handle, not data). The `SeamExpressible` bucket in the ratchet is empty.+Every call site whose fix was _"add a contract member and route the caller"_ is migrated, and this is now proven rather than asserted — all 86 distinct engine symbols were classified: **15 EXACT** (migrated), **9 SHAPE_DIFFERS**, **44 NO_MEMBER** (they hand out a handle, not data). The `SeamExpressible` bucket in the ratchet is empty.Shipped: the diagnostics seam, recency recall, reset/flush, the archivist's episodic pivot, preferences, the safety scrubbers, the CLI read paths, and the type/alias surface.### The remaining 236, by bucket-| Bucket | Refs | Nature |-|---|---|---|-| chunk-store (`store::chunks`, `content`, `fts5`, `segments`, `profile`, `namespace_store`) | 93 | the big one — needs the new members below |-| engine-handle (`global::*`, `MemoryClient`, `UnifiedMemory`, `factories`) | 27 | **structurally last** — they *construct* the engine |-| tree / ingest (`tree`, `ingest_pipeline`, `ingestion`) | 22 | partly covered by #99's `summary_forest` / `recent_leaves` |-| chat-seam (`chat::`) | 19 | host-side provider construction; mostly `#[cfg(test)]` |-| sync-pipeline (`sync::`, `tinycortex::`) | 12 | composio sync + sources registry |-| queue (`queue::start`, `drain_until_idle`) | 5 | see H3 — cannot go until the module owns a pool |+| Bucket | Refs | Nature |+| ------------------------------------------------------------------------------------------ | ---- | ---------------------------------------------------------- |+| chunk-store (`store::chunks`, `content`, `fts5`, `segments`, `profile`, `namespace_store`) | 93 | the big one — needs the new members below |+| engine-handle (`global::*`, `MemoryClient`, `UnifiedMemory`, `factories`) | 27 | **structurally last** — they _construct_ the engine |+| tree / ingest (`tree`, `ingest_pipeline`, `ingestion`) | 22 | partly covered by #99's `summary_forest` / `recent_leaves` |+| chat-seam (`chat::`) | 19 | host-side provider construction; mostly `#[cfg(test)]` |+| sync-pipeline (`sync::`, `tinycortex::`) | 12 | composio sync + sources registry |+| queue (`queue::start`, `drain_until_idle`) | 5 | see H3 — cannot go until the module owns a pool |Top production files: `memory/host_impls.rs` (15 — the host→engine seam, **never leaves**), `memory/sources/rpc.rs` (10), `memory/store_golden.rs` (7, allowlisted fixture), `agent/experience/ops.rs` (5), `memory/tree/retrieval/rpc.rs` (4, all `#[cfg(test)]`), `memory/ops/sync.rs` (4).@@ -49,12 +49,12 @@ In flight, being finished separately. **Do not start Phase E until Phase D is do**All upstream code is written, verified and pushed as of 2026-08-25.** Nothing below is left to implement. Three non-code steps remain, and the first one needs a permission the author of this branch does not have.-| Repo | PR / artifact | State |-|---|---|---|+| Repo | PR / artifact | State |+| ------------------------ | ----------------------------------------------------- | ------------------------------------------------------------------------------------------------- || tinycortex (`neocortex`) | **#157** `feat/5560-filtered-chunk-count` @ `ef09f09` | open, **all checks green**, review threads answered and resolved, ⛔ **needs a maintainer merge** |-| tinymemory | **#99** `feat/5560-close-every-gap` @ `38e03fb` | open, CI green, gitlink points at #157 @ `ef09f09` |-| tinymemory | v1.4.0 (`346fe4e`) | released |-| tinymemory | **v1.5.0** (`1a4cba8f48` pins `d722d36e9fc3`) | ✅ pinned by this PR |+| tinymemory | **#99** `feat/5560-close-every-gap` @ `38e03fb` | open, CI green, gitlink points at #157 @ `ef09f09` |+| tinymemory | v1.4.0 (`346fe4e`) | released |+| tinymemory | **v1.5.0** (`1a4cba8f48` pins `d722d36e9fc3`) | ✅ pinned by this PR |> ⛔ **The one hard blocker.** `gh pr merge 157 -R tinyhumansai/tinycortex` is refused —> the branch author's permissions on that repo are `{"admin":false,"maintain":false,"pull":true,"push":false}`.@@ -66,21 +66,21 @@ In flight, being finished separately. **Do not start Phase E until Phase D is do**Everything below is LANDED** on the two branches above. It is listed so you can code against the real names without reading the diffs.-*Group 1 — unblocks Phase E.* ✅ landed in #99 + #157. Reduced from an original ~14 asks down to **4 new bus methods + 1 amendment + 6 additive `ChunkQuery` fields**:+_Group 1 — unblocks Phase E._ ✅ landed in #99 + #157. Reduced from an original ~14 asks down to **4 new bus methods + 1 amendment + 6 additive `ChunkQuery` fields**:-- `MemoryChunks::list_chunk_details(query, scope) -> Vec<ChunkListRow>` — one SELECT; explicitly *not* `chunk_detail` in a loop (that is 5 engine reads per chunk → a 1000-row page would be 5000 queries)+- `MemoryChunks::list_chunk_details(query, scope) -> Vec<ChunkListRow>` — one SELECT; explicitly _not_ `chunk_detail` in a loop (that is 5 engine reads per chunk → a 1000-row page would be 5000 queries)- `MemoryChunks::source_totals(limit, scope) -> Vec<SourceTotal>`- `MemorySourceSink::forget_matching(&ForgetSelector) -> ForgetOutcome` — one door, four selectors (Chunk / Source / SourcePrefix / Owner)- `MemoryMaintenance::purge_all() -> PurgeOutcome`- **amend** `MemoryEntities::chunk_entities` to take `chunk_ids: &[String]` + `kinds` (legitimate only because #99 is unreleased; the `METHODS` sequence is untouched)- `ChunkQuery` gains `ids`, `source_kinds`, `source_ids`, `entity_ids`, `entity_kinds`, `content_contains` — all six land in one place (`append_filters`), so page / total / detail-list inherit them and cannot drift-*Group 2 — unblocks Phase F.* ✅ landed in #99. Without these, deleting the host's second engine would be **data-loss-adjacent**, not merely incomplete (see H3):+_Group 2 — unblocks Phase F._ ✅ landed in #99. Without these, deleting the host's second engine would be **data-loss-adjacent**, not merely incomplete (see H3):-- **the module starts its own queue worker pool.** *(Done — `tinymemory-module/src/lib.rs`, `start_queue_pool`.)* `services.rs:256` in the host was the only caller of `queue::worker::start` in any tree; the module owns one now. It also carries `claim_queue_pool`, because `queue::start`'s `Once` is process-global while a pool is bound to one workspace — a second workspace in one process is not a second pool, it is a store with nothing draining its queue, and that now logs as an error instead of being invisible.+- **the module starts its own queue worker pool.** _(Done — `tinymemory-module/src/lib.rs`, `start_queue_pool`.)_ `services.rs:256` in the host was the only caller of `queue::worker::start` in any tree; the module owns one now. It also carries `claim_queue_pool`, because `queue::start`'s `Once` is process-global while a pool is bound to one workspace — a second workspace in one process is not a second pool, it is a store with nothing draining its queue, and that now logs as an error instead of being invisible.- Known degradation, stated rather than hidden: the pool consults the scheduler gate and registers a shutdown hook, and the module serves neither seam. So in module mode it runs **unthrottled** (ignores battery/CPU pressure) and its graceful lock-release hook is dropped — locks are recovered by lease expiry at startup instead, which `worker.rs` already documents as the hard-kill path. If throttling matters to the product, that needs a real `SchedulerGate` bus interface, which is a separate piece of work.-- **`tinycortex/contacts` enabled in the module** *(Done — it replaces `people`, since upstream declares `contacts = ["people", ...]`.)* Otherwise Phase F silently loses macOS address-book seeding (H4b). Verified live: the locked release build links `objc2-contacts`.-- **the two silently-degrading seams made loud** — `scheduler_gate` and `shutdown` now report once per process through the already-installed `ErrorReporter` instead of quietly doing nothing. *(Done.)*+- **`tinycortex/contacts` enabled in the module** _(Done — it replaces `people`, since upstream declares `contacts = ["people", ...]`.)_ Otherwise Phase F silently loses macOS address-book seeding (H4b). Verified live: the locked release build links `objc2-contacts`.+- **the two silently-degrading seams made loud** — `scheduler_gate` and `shutdown` now report once per process through the already-installed `ErrorReporter` instead of quietly doing nothing. _(Done.)_### 2a. The as-landed contract — code against these exact names@@ -131,10 +131,10 @@ async fn chunk_entities(&self, chunk_ids: &[String], kinds: Option<&[String]>)Five things about this surface that will save you a debugging session:-- **An empty `Vec` predicate means UNFILTERED, not match-nothing.** Forced by `Default` + `#[serde(default)]`. The footgun is real: a caller that *computed* a candidate set and got nothing must short-circuit and skip the query, because the query will happily return everything.-- **`entity_ids` and `entity_kinds` are two independent `EXISTS` clauses.** Setting both asks for a chunk with some listed entity *and* some entity of a listed kind — not for one index row satisfying both.-- **`ChunkListRow` has no body, on purpose.** `ChunkDetail::body`'s docs promise `None` means the vault read *failed*; a listing can only honour that by reading every file or by lying. If you need bodies, that is `chunk_detail`, per row, knowingly.-- **`content_contains` folds case for ASCII only** and scans the text the driver holds *inline* — for a chunk whose body went to the content vault that is the stored preview, not the whole document. It narrows a browse; it does not replace `MemoryRecall`.+- **An empty `Vec` predicate means UNFILTERED, not match-nothing.** Forced by `Default` + `#[serde(default)]`. The footgun is real: a caller that _computed_ a candidate set and got nothing must short-circuit and skip the query, because the query will happily return everything.+- **`entity_ids` and `entity_kinds` are two independent `EXISTS` clauses.** Setting both asks for a chunk with some listed entity _and_ some entity of a listed kind — not for one index row satisfying both.+- **`ChunkListRow` has no body, on purpose.** `ChunkDetail::body`'s docs promise `None` means the vault read _failed_; a listing can only honour that by reading every file or by lying. If you need bodies, that is `chunk_detail`, per row, knowingly.+- **`content_contains` folds case for ASCII only** and scans the text the driver holds _inline_ — for a chunk whose body went to the content vault that is the stored preview, not the whole document. It narrows a browse; it does not replace `MemoryRecall`.- **`chunk_entities` rows each name their own chunk.** Group by `row.chunk_id`; never index the result by position against the ids you sent.**`PurgeOutcome::rows_deleted` is a cross-table sum, matching what `wipe_all_rpc` already reports.** This was a real disagreement between the engine and the contract during implementation and it was settled in favour of the host's existing wire shape: `WipeAllResponse.rows_deleted` has always been the sum over its nine tables, so returning only chunk rows would have shrunk a number the user already reads without anything having changed about what was forgotten. The engine's scoped deletes still return chunk counts — that asymmetry is deliberate and documented at `purge_all`.@@ -185,7 +185,7 @@ the by-id delete arm, and `purge_all`. Merging #99 without it does not compile.## 4. Hazards — verified, with evidence-### H1 — a version mismatch is not caught by anything *(mechanism corrected)*+### H1 — a version mismatch is not caught by anything _(mechanism corrected)_The earlier framing was "bind refused → silent empty." That is **wrong, and the truth is worse**: `is_compatible` (`tinymemory-bus/src/version.rs:86`) is major-equality as documented, but it has **zero call sites in the entire graph** — every hit is a re-export. The host's `PeerManifest` never declares the memory interface.@@ -195,7 +195,7 @@ CI would not catch it either: `modules/memory_tests.rs:237-254` compares a versi**Consequence:** Phase C is not a formality. The release must exist before the host learns the new contract.-### H2 — the host boots two engines *(confirmed verbatim)*+### H2 — the host boots two engines _(confirmed verbatim)_`src/core/runtime/context.rs:608` calls `global::init(cfg.workspace_dir)`, and `:621` binds the module driver — same `if plan.memory` block, and both resolve to `<workspace>/memory/memory.db`. Two live `MemoryClient`s over one SQLite file.@@ -205,7 +205,7 @@ CI would not catch it either: `modules/memory_tests.rs:237-254` compares a versiThe deletion is already the tree's stated intent — `binding.rs:16-24` and `context.rs:310-319` both argue the workspace-keyed map supersedes the global slot. It was argued and never executed.-### H3 — deleting the second engine breaks the queue *(this is the sequencing crux)*+### H3 — deleting the second engine breaks the queue _(this is the sequencing crux)_`flush_pending` is **not** a no-op today — the host starts the only worker pool that exists (`services.rs:256`, the sole caller of `queue::worker::start` in any tree).@@ -215,14 +215,14 @@ This cannot be fixed by any host change. **The module must start its own pool**Accept the two degradations that come with it, or fix them first: in module mode the pool runs **unthrottled** and its shutdown hook is dropped. Both are stated at the function and in §2 — neither loses work, but the first is a real battery/CPU behaviour change on desktop.-### H3b — the composio sync loop has no home once the engine goes *(found 2026-08-25; NOT in the original plan)*+### H3b — the composio sync loop has no home once the engine goes _(found 2026-08-25; NOT in the original plan)_Same class as H3, found the same way, and it is on the critical path for criteria 1 and 2.The engine reaches its host through nine seam traits installed as process globals. In modulemode the module installs **seven** (`error_reporter`, `event_sink`, `nlp_host`,`scheduler_gate`, `shutdown_host`, `chat_host`, `embedding_host`). The host installs **eight**-(`memory/host_impls.rs`). The two the module does *not* install are **`ComposioHost`** and+(`memory/host_impls.rs`). The two the module does _not_ install are **`ComposioHost`** and**`ConfigLoader`**.That is not academic, because composio sync is **engine code running in the host process**:@@ -233,7 +233,7 @@ integrations/composio/mod.rs:66 → memory::sync::composio::periodicmemory/sync/composio/mod.rs:8 → pub use tinymemory_core::sync::composio::*```-So the host starts the *engine's* periodic loop against the host's own engine handle. Delete+So the host starts the _engine's_ periodic loop against the host's own engine handle. Deletethat engine and the loop has no engine to run against; keep the loop and the engine crate cannever leave the build — which is criterion 2.@@ -243,7 +243,7 @@ when unset. Nothing panics, nothing logs by default: composio sync would simplyfirst symptom is a user noticing their Slack or Gmail memory went stale.**Being fixed upstream now**, in the same PR (#99) and following the pattern that already-works: `ChatHost` and `EmbeddingHost` are served *by the host* over the bus+works: `ChatHost` and `EmbeddingHost` are served _by the host_ over the bus(`modules/memory_host.rs`) and consumed by the module (`chat.rs`, `embedding.rs`).`ComposioHost` gets the same treatment — 4 methods, small trait. `ConfigLoader` is answeredmodule-side from the `ModuleConfig` the module is already handed, because proxying it would@@ -257,13 +257,13 @@ before. Removing them earlier stops composio sync in a tree that still boots tha### H4a — a build break nobody has hit yet-The host resolves tinycortex through `[patch.crates-io] tinycortex = { path = "vendor/tinycortex" }` (`Cargo.toml:1237`) — its **own** top-level submodule, currently `b7cf121`, *not* the copy inside `vendor/tinymemory`. `Cargo.toml:223-225` says so explicitly.+The host resolves tinycortex through `[patch.crates-io] tinycortex = { path = "vendor/tinycortex" }` (`Cargo.toml:1237`) — its **own** top-level submodule, currently `b7cf121`, _not_ the copy inside `vendor/tinymemory`. `Cargo.toml:223-225` says so explicitly.`git show b7cf121:src/memory/chunks/store_list.rs | grep -c count_chunks_matching` → **0**. So bumping only `vendor/tinymemory` fails to compile. Both gitlinks move in Phase D or neither does.-### H4b — `contacts` was off in the module *(fixed upstream — keep reading, the reason still matters)*+### H4b — `contacts` was off in the module _(fixed upstream — keep reading, the reason still matters)_-`crates/tinymemory-module/Cargo.toml:39` enabled `people` but not `contacts`. #99 now enables `contacts` there (it supersedes `people`, which upstream declares as a subset), and the locked release build was checked to link `objc2-contacts`. The reason is worth keeping in front of you anyway, because it is the shape of every remaining Phase F hazard: the shipping desktop build turns `contacts` **on** (`app/src-tauri/Cargo.toml:186` → `Cargo.toml:975` → `tinymemory-core/Cargo.toml:129`), and the whole people domain is a glob re-export of the in-process engine (`memory/people/mod.rs:8`). macOS address-book seeding works today *because* the second engine exists. Phase F must not land before a **released** module carries `contacts` — the code is on #99, so this closes when v1.5.0 ships, not when #99 merges.+`crates/tinymemory-module/Cargo.toml:39` enabled `people` but not `contacts`. #99 now enables `contacts` there (it supersedes `people`, which upstream declares as a subset), and the locked release build was checked to link `objc2-contacts`. The reason is worth keeping in front of you anyway, because it is the shape of every remaining Phase F hazard: the shipping desktop build turns `contacts` **on** (`app/src-tauri/Cargo.toml:186` → `Cargo.toml:975` → `tinymemory-core/Cargo.toml:129`), and the whole people domain is a glob re-export of the in-process engine (`memory/people/mod.rs:8`). macOS address-book seeding works today _because_ the second engine exists. Phase F must not land before a **released** module carries `contacts` — the code is on #99, so this closes when v1.5.0 ships, not when #99 merges.### H4c — the tree's own tripwires fire during the cutover@@ -271,8 +271,8 @@ Defuse them **in the commit that causes them**, never after:1. `direct_engine_refs_tests.rs:730-742` `direct_reference_scanner_is_not_vacuous` asserts `found.len() > 20` and that `memory/mod.rs` is in the set — the final cutover drives both to zero **by design**. Rewrite it with the last removal.2. `:825-841` `the_blocked_set_matches_the_engine_still_being_linked` is the deliberate "day the engine leaves" tripwire, **and its failure message is the closing checklist**: drop the path deps (`Cargo.toml:241-260` + the dev-dep at `:657`), remove the machete `ignored` entry (`:35`), ratchet `scripts/kernel-floor.limits`, rewrite the module docs.-3. `:804-816` `nothing_is_left_migratable` fails on **any** `Verdict::SeamExpressible`. `ALLOWED` is currently 22 `HostSide` + 56 `NeedsWiderSeam` + 0 `SeamExpressible`; the new members make some of those 56 seam-expressible. The test's own doc calls re-labelling-to-silence *"the one edit that would make the lint lie."* **Strike each routed file from `ALLOWED` in the commit that routes it.**-4. Same discipline on `bypass_allowlist_tests.rs:544-557` and `:567-578` — and `docs/specs/memory-guard-allowlist.md` moves in step. That allowlist's rule is *may shrink, never grow*; if you need a test-only fixture, put it under a `test_support/` directory, which the scanner skips by path.+3. `:804-816` `nothing_is_left_migratable` fails on **any** `Verdict::SeamExpressible`. `ALLOWED` is currently 22 `HostSide` + 56 `NeedsWiderSeam` + 0 `SeamExpressible`; the new members make some of those 56 seam-expressible. The test's own doc calls re-labelling-to-silence _"the one edit that would make the lint lie."_ **Strike each routed file from `ALLOWED` in the commit that routes it.**+4. Same discipline on `bypass_allowlist_tests.rs:544-557` and `:567-578` — and `docs/specs/memory-guard-allowlist.md` moves in step. That allowlist's rule is _may shrink, never grow_; if you need a test-only fixture, put it under a `test_support/` directory, which the scanner skips by path.---@@ -280,29 +280,29 @@ Defuse them **in the commit that causes them**, never after:Each row is one migration. The RPC response fields are listed because **wire shape must not change** — these are read by `MemoryControls`, `OverviewPanel` and `MedullaDemoGraph`.-| Site | Operation | Member to use |-|---|---|---|-| `read_rpc/chunks.rs:54` `list_chunks_blocking` | paged list + unpaged total | `list_chunk_details` + `count_chunks`, with the six new `ChunkQuery` fields |-| `read_rpc/chunks.rs:208` `list_sources_blocking` | `GROUP BY source_kind, source_id` | `source_totals` (`display_name` stays host-side) |-| `read_rpc/chunks.rs:268` `search_rpc` | content search | `list_chunk_details` with `content_contains` only |-| `read_rpc/chunks.rs:354` `recall_rpc` hydrate | N ids → rows | `list_chunk_details` with `ids` — one call, re-map by id to preserve leaf order |-| `read_rpc/entities.rs:30` `entity_index_for` | entities of a chunk | `chunk_entities(&[id], None)` — **already available from #99** |-| `read_rpc/entities.rs:74` `chunks_for_entity` | chunk ids for an entity | `entity_chunk_ids` — **#99**. Note it *requires* a limit; the SQL has none. Use `MAX_LIST_LIMIT` (`read_rpc/types.rs`) |-| `read_rpc/entities.rs:110` `top_entities` | ranked entities | `top_entities` — **#99**. ⚠️ behaviour delta: the member returns `MemoryError::Invalid` for an unknown kind; the RPC currently returns an empty list |-| `read_rpc/entities.rs:236` `delete_chunk_rpc` | delete + side rows | `forget_matching(ForgetSelector::Chunk)` |-| `read_rpc/graph.rs:109,:250` `collect_tree_graph` | summary forest + leaves | `summary_forest` + `recent_leaves` — **#99**, field-for-field |-| `read_rpc/graph.rs:352` `collect_contacts_graph` | person-kind chunks + edges | `ChunkQuery.entity_kinds` + amended `chunk_entities(ids, kinds)` — **one call, not 1500** |-| `read_rpc/admin.rs:33` `wipe_all` | truncate 9 tables | `purge_all` (host keeps the content-dir removal and `dirs_removed`) |-| `read_rpc/admin.rs:110` `clear_composio_sync_state` | raw `Connection::open` | `kv_list` + `kv_delete` — this is a **second unpoliced door** beside `with_connection` |-| `read_rpc/admin.rs` `delete_source_rpc` | chunks + orphan tree | `forget_matching(Source)` — returns `trees_cleaned`, so `DeleteSourceResponse` keeps its shape |-| `read_rpc/vault.rs:5` | Obsidian registration | **move the code host-side**; do not widen the contract |-| `platform/doctor/core.rs:834` | `SELECT COUNT(*)` | `store_stats().chunks` — the file's own comment already says so; the blocker is that `run` is sync and `store_stats` is async, so hoist the probe into the caller |-| `channels/controllers/ops/connect.rs:240` | clear channel memory | `forget_matching(Source + SourcePrefix, Chat)` |-| `integrations/composio/ops/memory_cleanup.rs:21,:24,:31` | exact / prefix / owner deletes | `forget_matching`, all three arms |+| Site | Operation | Member to use |+| -------------------------------------------------------- | --------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |+| `read_rpc/chunks.rs:54` `list_chunks_blocking` | paged list + unpaged total | `list_chunk_details` + `count_chunks`, with the six new `ChunkQuery` fields |+| `read_rpc/chunks.rs:208` `list_sources_blocking` | `GROUP BY source_kind, source_id` | `source_totals` (`display_name` stays host-side) |+| `read_rpc/chunks.rs:268` `search_rpc` | content search | `list_chunk_details` with `content_contains` only |+| `read_rpc/chunks.rs:354` `recall_rpc` hydrate | N ids → rows | `list_chunk_details` with `ids` — one call, re-map by id to preserve leaf order |+| `read_rpc/entities.rs:30` `entity_index_for` | entities of a chunk | `chunk_entities(&[id], None)` — **already available from #99** |+| `read_rpc/entities.rs:74` `chunks_for_entity` | chunk ids for an entity | `entity_chunk_ids` — **#99**. Note it _requires_ a limit; the SQL has none. Use `MAX_LIST_LIMIT` (`read_rpc/types.rs`) |+| `read_rpc/entities.rs:110` `top_entities` | ranked entities | `top_entities` — **#99**. ⚠️ behaviour delta: the member returns `MemoryError::Invalid` for an unknown kind; the RPC currently returns an empty list |+| `read_rpc/entities.rs:236` `delete_chunk_rpc` | delete + side rows | `forget_matching(ForgetSelector::Chunk)` |+| `read_rpc/graph.rs:109,:250` `collect_tree_graph` | summary forest + leaves | `summary_forest` + `recent_leaves` — **#99**, field-for-field |+| `read_rpc/graph.rs:352` `collect_contacts_graph` | person-kind chunks + edges | `ChunkQuery.entity_kinds` + amended `chunk_entities(ids, kinds)` — **one call, not 1500** |+| `read_rpc/admin.rs:33` `wipe_all` | truncate 9 tables | `purge_all` (host keeps the content-dir removal and `dirs_removed`) |+| `read_rpc/admin.rs:110` `clear_composio_sync_state` | raw `Connection::open` | `kv_list` + `kv_delete` — this is a **second unpoliced door** beside `with_connection` |+| `read_rpc/admin.rs` `delete_source_rpc` | chunks + orphan tree | `forget_matching(Source)` — returns `trees_cleaned`, so `DeleteSourceResponse` keeps its shape |+| `read_rpc/vault.rs:5` | Obsidian registration | **move the code host-side**; do not widen the contract |+| `platform/doctor/core.rs:834` | `SELECT COUNT(*)` | `store_stats().chunks` — the file's own comment already says so; the blocker is that `run` is sync and `store_stats` is async, so hoist the probe into the caller |+| `channels/controllers/ops/connect.rs:240` | clear channel memory | `forget_matching(Source + SourcePrefix, Chat)` |+| `integrations/composio/ops/memory_cleanup.rs:21,:24,:31` | exact / prefix / owner deletes | `forget_matching`, all three arms |**Not gaps — do not touch:** `read_rpc/mod.rs:54` (the `with_connection` re-export is `#[cfg(test)]`-gated at `:53`), `tree/retrieval/rpc.rs:510-534` (all inside `#[cfg(test)]`), `store_golden.rs` (deliberately outside the contract; its module doc explains the escape hatches).-**Stale comments to delete as you go:** `read_rpc/entities.rs:13-20` claims those three handlers have no member — #99 added all three. And the `ALLOWED` verdicts for all eleven target files say *"MemoryChunks is read-only … with no write or transaction door"*, which still holds for the write sites but not the reads.+**Stale comments to delete as you go:** `read_rpc/entities.rs:13-20` claims those three handlers have no member — #99 added all three. And the `ALLOWED` verdicts for all eleven target files say _"MemoryChunks is read-only … with no write or transaction door"_, which still holds for the write sites but not the reads.---@@ -326,7 +326,7 @@ Also: `crates/tinymemory-module` is its own workspace with its own lockfile; the**One local-only caveat:** `cargo test --lib` hangs on `tree_e2e_tests::full_pipeline_ingest_to_retrieval`. It does not set `embeddings_provider = "none"` the way its sibling does, so it calls the live embedding service. Pre-existing, unrelated to this work, fine in CI.-**Module-backed tests** need `TINYMEMORY_TEST_MODULE` pointing at a built cdylib, and must run **one process per test** — tinybus binds broker tasks to the creating runtime and never unloads, so a second module-loading test in one process *hangs rather than fails*.+**Module-backed tests** need `TINYMEMORY_TEST_MODULE` pointing at a built cdylib, and must run **one process per test** — tinybus binds broker tasks to the creating runtime and never unloads, so a second module-loading test in one process _hangs rather than fails_.---@@ -344,6 +344,6 @@ The closing checklist is not this document's invention — it is the failure mes**Honest estimate:** Phase D is an afternoon. Phase E is a few days. **Phase F is the long one** — 18 `global::` consumers plus the sync, chat and queue seams, each its own migration, and it is the phase that actually flips the checkboxes. Its upstream gate (module-owned pool + `contacts`) is being closed now, so it is no longer blocked, but it is not a day's work either. Anyone promising #5560 closes this week has not read §4.-**Scope note:** every upstream dependency in §2 is **already written and pushed** — both groups. If you hit something that needs a *new* contract member, that is a bug in this plan; say so rather than widening the contract yourself, because a member added host-side cannot ship (the host pins a released, digest-verified artifact, and §4 H1 explains why the mismatch would be silent rather than loud).+**Scope note:** every upstream dependency in §2 is **already written and pushed** — both groups. If you hit something that needs a _new_ contract member, that is a bug in this plan; say so rather than widening the contract yourself, because a member added host-side cannot ship (the host pins a released, digest-verified artifact, and §4 H1 explains why the mismatch would be silent rather than loud).**Housekeeping:** a stray copy of the tinymemory branch was pushed to `tinyhumansai/tinymemory` as `feat/5560-close-every-gap` before being pushed to the fork where PR #99 actually lives. It is byte-identical to the fork branch and harmless, but it should be deleted — `git push origin --delete feat/5560-close-every-gap` from a checkout whose `origin` is upstream.