Solution for long term memory for agent coding CLIs and to facilitate handoff between different agent vendors
Rust
docs: align response context migration notes with main
Aldo Juniorded27f166c45
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 47320511..dcebb550 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -17,7 +17,7 @@ version in [`docs/changelog/`](docs/changelog/):can be filtered by UTC period, exact model, harness, session, turn and tool,with complete pagination, filtered token totals and bounded native turn andtool provenance. The context lives in extra `token_calls` columns and a- `token_call_tools` table (migration V94). A response from an older hook keeps+ `token_call_tools` table (migration V92). A response from an older hook keepsits provenance unknown instead of guessed. Filters apply after projectauthorization and the session-owner check and before counting, ranking andpagination (#NNN).diff --git a/docs/ARCHITECTURE.md b/docs/ARCHITECTURE.mdindex c5611cd0..2b49f61c 100644--- a/docs/ARCHITECTURE.md+++ b/docs/ARCHITECTURE.md@@ -613,7 +613,7 @@ prunable rather than only after it ages in place.| `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` | V91 optional registered harness recipient; NULL keeps the shared project inbox. Both claim guards enforce addressed delivery. |-| `token_calls` context and `token_call_tools` | V94 nullable native turn/response coordinates and response time, plus bounded tool references keyed by session/response. One writer transaction persists counters, provenance and session totals; tools cascade with their response. Missing context stays unknown. Server-side UTC/model/harness/session/turn/tool filters run after scope/owner checks and before pagination. |+| `token_calls` context and `token_call_tools` | V92 nullable native turn/response coordinates and response time, plus bounded tool references keyed by session/response. One writer transaction persists counters, provenance and session totals; tools cascade with their response. Missing context stays unknown. Server-side UTC/model/harness/session/turn/tool filters run after scope/owner checks and before pagination. || `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. |