Solution for long term memory for agent coding CLIs and to facilitate handoff between different agent vendors
Rust
docs: clarify staged auto-improvement
AkitaOnRails6e745bac0679
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex d86e8ce0..12e906f5 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0## [Unreleased]+### Fixed+- Clarified architecture and auto-improvement design docs so CLI/admin+ auto-improvement is described as dry-run by default with explicit staging and+ pending-writes approval, while only the MCP tool remains dry-run-only.+## [1.0.8] - 2026-06-15### Addeddiff --git a/docs/ARCHITECTURE.md b/docs/ARCHITECTURE.mdindex 8c7828bc..d88bdb6d 100644--- a/docs/ARCHITECTURE.md+++ b/docs/ARCHITECTURE.md@@ -29,8 +29,9 @@ background reconciliation or provider-backed maintenance. The core invariant isunchanged: the markdown wiki is the source of truth, and SQLite is the derivedindex for search, sessions, observations, handoffs, audit, and embeddings.Auto-improvement sits on the provider-backed maintenance side: it reviews a-completed session and returns validated proposals, but the shipped mode is-dry-run-only and writes no wiki files or pending proposal pages.+completed session and returns validated proposals. CLI/admin dry-run writes+nothing; CLI/admin stage mode stores pending proposal rows plus non-indexed+sidecars for later approval. MCP remains dry-run-only.**Steady-state loop:**@@ -54,12 +55,13 @@ dry-run-only and writes no wiki files or pending proposal pages.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/`.-5. On explicit CLI/admin/MCP request, `auto-improve --dry-run` /- `memory_auto_improve` reviews one completed session with the configured LLM,- validates proposed `concepts/`, `decisions/`, `gotchas/`, `procedures/`, and- `_rules/` edits, and returns a report. It does not run on SessionEnd by- default and does not write durable pages, pending proposals, handoffs, or- audit rows in the current release.+5. On explicit CLI/admin request, `auto-improve --dry-run` previews one+ completed session with the configured LLM, while `auto-improve --stage`+ stores validated `concepts/`, `decisions/`, `gotchas/`, `procedures/`, and+ `_rules/` proposals in the pending-writes queue. The MCP+ `memory_auto_improve` tool remains dry-run-only. Auto-improvement does not+ run on SessionEnd by default and staged proposals do not become durable wiki+ pages until an explicit pending-writes approval.6. `memory_query` answers via FTS5 + link-neighbour RRF; when anembedder is configured, vector cosine over `page_embeddings` joinsthe same RRF. If compiled wiki pages miss entirely, bounded raw@@ -373,10 +375,9 @@ LLM_API_KEY accepted for openai embeddings only with a custom* **Scheduled consolidation queue.** Forget sweep and lint already runon the server's maintenance schedule; a future queue can compilesession summaries outside hook latency.-* **Auto-improvement staging.** The shipped reviewer is dry-run-only; future- work is durable pending proposal storage under `_pending/auto-improve/` plus- list/diff/approve/reject flows that keep autonomous proposal attribution- separate from the approving human or agent.+* **Richer curator actions.** The shipped curator stages only one report page;+ future work can add individual merge/supersession/link-fix proposals while+ keeping deletes and semantic rewrites review-gated.* **Multi-workspace UI / web dashboard.** Out of scope for v1; revisitonce the headless server has been load-tested.* **Real LongMemEval-S harness.** The recall-eval framework existsdiff --git a/docs/auto-improvement-loop.md b/docs/auto-improvement-loop.mdindex b86a944e..cdbfb0ca 100644--- a/docs/auto-improvement-loop.md+++ b/docs/auto-improvement-loop.md@@ -235,19 +235,19 @@ Any implementation should preserve these invariants:Default-available auto-improvement must not surprise existing installs:1. Dry-run review may be exposed by default, but it must not write wiki files,- pending proposal pages, handoffs, or audit rows.+ pending proposals, handoffs, or audit rows. Staging must remain an explicit+ operator action.2. Session-end triggering stays off until a bounded background scheduler andproposal storage exist; hooks must not gain LLM latency as a side effect ofupgrade.-3. No database migration is required for the dry-run-only phase. Future pending- proposal storage must use additive, idempotent migrations that preserve all- existing wiki files and session/observation rows.+3. Pending proposal storage must use additive, idempotent migrations that+ preserve all existing wiki files and session/observation rows.4. Existing installed `CLAUDE.md`/`AGENTS.md` blocks remain valid. Operators pickup newer proactive retrieval guidance by running `ai-memory install-instructions`or asking an agent to refresh the ai-memory routing block. The marker-basedreplacement must remain idempotent.-5. Future staged/apply modes must default to reviewable staging before any- mutation and must keep approval attribution separate from the autonomous+5. Staged/apply modes must default to reviewable staging before any mutation+ and must keep approval attribution separate from the autonomous`auto_improve` proposal actor.## Configuration Sketch@@ -370,12 +370,13 @@ pages.### Phase 1: Dry-Run Reviewer-Status: implemented for explicit CLI/admin/MCP dry-runs.+Status: implemented for explicit CLI/admin/MCP dry-runs; CLI/admin can also+stage validated proposals for pending-writes review.Add a library-level reviewer that consumes one completed session plus existing-wiki context and returns validated proposals. No writes except an optional run-report. The initial shipped surface requires `--dry-run` and an explicit-`--session-id`; it refuses staging/apply until pending proposal storage exists.+wiki context and returns validated proposals. Dry-run writes nothing. Stage mode+requires an explicit `--session-id`, stores pending proposal rows plus sidecars,+and still does not write durable wiki target pages until pending-writes approval.The implemented reviewer is designed for existing projects with large histories:it treats the consolidated `sessions/<id>.md` page as the primary source when it