Solution for long term memory for agent coding CLIs and to facilitate handoff between different agent vendors
Rust
Merge commit 'bf448977c5eb7365a0ae2dbba7845bfdc26d77a1' into audit/pr-316
AkitaOnRails8075ada0d4a5
diff --cc docs/ARCHITECTURE.mdindex cd9d9305,6515e5bb..3cb2f555--- a/docs/ARCHITECTURE.md+++ b/docs/ARCHITECTURE.md@@@ -327,11 -329,11 +329,11 @@@ invariants below| `memory_handoff_begin` | destructive | Open a handoff for the next agent. Optional `workspace` + `project` targets a named sibling workspace/project. || `memory_handoff_accept` | destructive | Fetch + ack the latest open handoff (auto-cwd-matched by default). Optional `workspace` + `project` targets a named sibling workspace/project. || `memory_handoff_cancel` | destructive | Mark an exact open handoff id expired when it was created by mistake. |-| `memory_consolidate` | destructive | LLM-driven page rewrite. `multi_page=true` for atomic fan-out. |+| `memory_consolidate` | destructive | LLM-driven page rewrite. `multi_page=true` for atomic fan-out. Consolidation prompts append the body of the reserved `_prompts/consolidation.md` page (per-project operator guidance, sanitized + ~2000-char cap, injected into the user message so the schema rules stay authoritative); a per-call `instructions` argument overrides the page for one call. || `memory_auto_improve` | write | Manually review a completed session and apply or stage validated wiki edits through the auto-improvement approval path. Defaults to the latest completed session in the resolved current project; the server also schedules review for new sessions; `[auto_improve] require_approval = true` leaves proposals pending for manual review. |- | `memory_write_page` | destructive | Write durable wiki knowledge when the user explicitly asks to remember/annotate something permanent. `scope: "global"` writes into the reserved `_global` preferences scope instead of the current project. |+ | `memory_write_page` | destructive | Write durable wiki knowledge when the user explicitly asks to remember/annotate it. `scope: "global"` writes into the reserved `_global` preferences scope; optional `expires_at` sets an RFC3339 or date-only TTL. || `memory_delete_page` | destructive | Delete a single page by exact `path`. Fires the admission chain (op=delete); idempotent. |- | `memory_forget_sweep` | destructive | M8 retention pass. `dry_run=true` for preview. |+ | `memory_forget_sweep` | destructive | Retention pass: soft-delete cold pages, purge aged tombstones, and hard-delete TTL-expired pages through the wiki layer. `dry_run=true` for preview. || `memory_lint` | destructive | Rule-based + LLM contradiction findings → `wiki/_lint/`. || `memory_install_self_routing` | read-only | Return the canonical slim routing snippet plus managed Agent Skill payloads and target hints for CLAUDE.md / AGENTS.md installs. |