Solution for long term memory for agent coding CLIs and to facilitate handoff between different agent vendors
Rust
docs: align addressed-message migration notes with main
Aldo Junior05f018d88d03
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 8a39de4e..b829d0ba 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -22,7 +22,7 @@ version in [`docs/changelog/`](docs/changelog/):destination project can also queue a message for a registered harness of thatproject. The text goes through the configured sanitizer and admission beforethe single writer, and the browser never claims mail or starts an agent.- Messages can now be addressed to one harness (`to_agent`, migration V93).+ Messages can now be addressed to one harness (`to_agent`, migration V91).`memory_message_pop` and `ai-memory message pop` take an optional `agent`,and only that harness can claim the message, even by id. Existing shared mail(`to_agent = NULL`) behaves as before. A claim from a session-aware clientdiff --git a/docs/ARCHITECTURE.md b/docs/ARCHITECTURE.mdindex 24130e68..319379b6 100644--- a/docs/ARCHITECTURE.md+++ b/docs/ARCHITECTURE.md@@ -612,7 +612,7 @@ prunable rather than only after it ages in place.| `pages.compacted_at` | V65 nullable A2 tier-down marker (`docs/design-memory-aging.md` §A2). Set when the forget-sweep extractively compacts a cold episodic page (opt-in `[decay] compact_cold_episodic`) instead of evicting it; derived at the single page-upsert choke point from a `compacted: true` frontmatter mirror, so the marker and compacted body land in one transaction. Additive `ADD COLUMN`, no backfill; the sweep populates it lazily. The sweep and curator skip a marked page so it is never re-compacted, re-evicted, or re-reported as cold. Reversible: the full pre-compaction body stays in git + the supersession chain. || `session_usage` | V89 one row per session: cumulative input/output/cache-write/cache-read tokens the harness's own transcript reported at `session-end`, plus the last-seen model name. Written client-side (`ai-memory-cli`'s `session_usage` module reads the transcript; `hook.rs` splices it into the session-end body as `_ai_memory_usage`; the writer upserts with `MAX(existing, reported)` per column). Cascades with its session on purge/delete. Surfaced on the /web project page's Tokens stat and Sessions table; `None` (not zero) for a session whose harness never reported usage. || `token_calls` | V90 per-session native response identities with content-free input, output and cache counters. Live hooks merge partial/replayed responses with column-wise maxima in one writer transaction, then refresh cumulative session usage. Project reads authorize the project and apply session ownership before counting or ranking. V90 also converts historical Codex input totals to fresh input, excluding cache reads. |-| `agent_messages.to_agent` | V93 optional registered harness recipient; NULL keeps the shared project inbox. Both claim guards enforce addressed delivery. |+| `agent_messages.to_agent` | V91 optional registered harness recipient; NULL keeps the shared project inbox. Both claim guards enforce addressed delivery. || `client_activity` | Server-wide MCP tool-call counters split into reads/writes and bucketed by UTC day. The MCP request choke point flushes buffered calls on a one-minute background interval; failed batches retry from bounded memory. Each day stores at most 128 sanitized client labels plus `other`, so an untrusted `clientInfo.name` cannot create traffic-proportional rows. || `auto_improve_proposals` | Staged learning and maintenance edits with immutable target snapshots and append-only decision events. Pending-target uniqueness is scoped by the qualified staging identity; unattributed proposals retain the historical shared bucket. || `entities`, `entity_page_links` | V38 noun index derived from canonical frontmatter. Names are normalized and unique per project; links target immutable page versions while retrieval filters to the latest version. Scope-pairing triggers prevent cross-project links. Powers the fourth RRF retrieval stream. |