Solution for long term memory for agent coding CLIs and to facilitate handoff between different agent vendors
Rust
docs: clarify session usage and interrupted recovery
Aldo Junior0a5ca6f2877a
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 41eddd9d..a3a6626b 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -13,24 +13,24 @@ version in [`docs/changelog/`](docs/changelog/):### Added-- The read-only web home now has a memory dashboard built on sanitized data:+- Added a memory dashboard to the read-only web home, using sanitized data:projects, sessions, sanitized capture events, compiled pages, open-sessioncontinuity signals and last activity. Project cards separate captured workfrom compiled pages, so an active hook no longer looks empty just becauseits sessions have not ended (#1803).-- The web dashboard now shows hook-health counters: accepted, policy-dropped,+- Added dashboard hook-health counters for accepted, policy-dropped,capacity-shed and rate-limited events. They count events since the processstarted, and prompt, command, path and payload data is neither persisted norrendered (#1803).-- The project overview page now shows which agent CLIs produced a project's- memory. The stats card has an "Agents" badge row with session counts per+- Added agent CLI attribution to the project overview to show which harnesses+ produced a project's memory. The stats card has an "Agents" badge row with session counts perharness, and each Recent Activity entry shows the harness whose session lastcontributed evidence to that page version. Both are best effort: a page orproject with no session evidence shows no badge (#1803).-- Added per-session token cost. At `session-end` the native hook (Claude Code+- Added per-session token accounting. At `session-end` the native hook (Claude Codeand Codex) reads the harness's own transcript and reports cumulative input,output, cache-write and cache-read totals. It scans Claude Code's JSONL infull and reads only the tail of Codex's rollout file, since both can reach@@ -41,9 +41,9 @@ version in [`docs/changelog/`](docs/changelog/):sessions. A session whose harness never reported usage, an unsupportedharness or an older client shows no number, never a zero (#1803).-- A session that never gets a graceful `session-end` no longer stays open- without tokens forever. This usually happens when a paid quota runs out- mid-task and the operator switches to another agent. When a new session+- Added recovery of usage and closure for sessions missing a graceful+ `session-end`, which previously stayed open without tokens. This usually+ happens when a paid quota runs out mid-task and the operator switches agents. When a new sessionstarts in the same scope and finds one quiet for at least 15 minutes, theclient looks for the old session's own transcript (Claude Code and Codex),reports its usage and closes it with a normal synthetic `session-end`. That@@ -56,8 +56,8 @@ version in [`docs/changelog/`](docs/changelog/):### Fixed-- A new agent session now gets a read-only recovery snapshot when the previous- substantive session in the project vanished without a `SessionEnd` (quota+- Added a read-only recovery snapshot at agent startup when the previous+ substantive session in the project ended without a `SessionEnd` (quotaexhaustion, a killed process, a machine restart). The snapshot is built ondemand from at most 64 sanitized observations and capped at 6,000characters, so no rolling copy of the transcript exists. It is scoped to thediff --git a/docs/ARCHITECTURE.md b/docs/ARCHITECTURE.mdindex 88014a86..0729d029 100644--- a/docs/ARCHITECTURE.md+++ b/docs/ARCHITECTURE.md@@ -144,7 +144,7 @@ from hook paths.created, and nothing from other project scopes is loaded. When assistant`Stop` excerpts are enabled (they pass a privacy gate), the excerpt is thepreferred latest checkpoint. Otherwise recent prompts and lifecycle or- tool metadata give the continuation trail.+ tool metadata provide context for resuming work.4. When `AI_MEMORY_LLM_PROVIDER` is set, `memory_consolidate` rewritesthat summary into a richer durable page or fans out into amulti-page batch under `concepts/`, `decisions/`, `gotchas/`. Consolidation@@ -287,7 +287,7 @@ from hook paths.narrower than a real end (see the session-usage row below).A session that is continued, meaning a new session starts in the samescope while the old one has been quiet for 15 minutes or more, is closed- sooner and more completely on the client. Past that stricter threshold the+ sooner on the client, including usage recovery. After that threshold theread-only recovery packet that `render_interrupted_session_context`(`ai-memory-hooks/src/router.rs`) builds also carries a machine-parsedmarker. The client uses it to find the old session's transcript, report