Solution for long term memory for agent coding CLIs and to facilitate handoff between different agent vendors
Rust
Merge remote-tracking branch 'origin/main' into release/2.2
AkitaOnRailsf1246d2e915a
diff --cc CHANGELOG.mdindex 4c9d8247,d5be5dcc..48508ab3--- a/CHANGELOG.md+++ b/CHANGELOG.md@@@ -7,36 -7,54 +7,83 @@@ and this project adheres to [Semantic V## [Unreleased]+### Added+- `[retrieval]` section with two opt-in ranking signals, both off by default+ so unconfigured stores rank exactly as before. `query_intent` routes+ lexically session-recall queries ("上次 / 之前那次…的会话 / last time /+ yesterday …") past the default session-page authority penalty+ (×0.77 combined kind/tier), with `session_recall_bonus` (default 0.25)+ sizing the lift; `abstract_vectors` adds a fifth RRF stream over the new+ `page_abstract_embeddings` table (V61) — the L0 layer: a page's+ frontmatter `abstract:` line is embedded on its own, at write time when an+ embedder is attached and by the same backfill as the body otherwise+ (a one-line summary embeds far more sharply than a+ multi-thousand-character body). Measured on a 138-query golden set over a+ production two-year wiki (FTS5 + entity + vector + graph, mis-tei+ Qwen3-Embedding-8B): hit@1 0.609 → 0.746 (+22%), NDCG@10 0.782 → 0.879+ (+12%) with both enabled; every unrouted category keeps its exact+ baseline ordering. Cross-checked on an independently built 99-query+ golden set against the same store: hit@1 0.556 → 0.626, NDCG@10+ 0.712 → 0.779 (+9.4%). Both signals are visible per hit in+ `memory_query(explain=true)` (`intent`, `intent_boost`,+ `abstract_rank`, `rrf.abstract`). (#672)+- `memory_handoff_list` lets no-stdout and MCP-only clients inspect open+ project handoffs without claiming or expiring them, then+ `memory_handoff_accept` can claim that exact `handoff_id` once. Grok,+ Zero, and other clients that discard SessionStart stdout no longer have+ to recover a baton by blindly accepting the latest row. Listing is+ owner-filtered like accept (own plus shared; root-only `any_owner`);+ it is not a second claim path, and Grok SessionStart still does not+ fetch `/handoff`. (#664)+### Fixed+ - Wiki auto-commits stage what the wiki wrote instead of walking the+ whole tree, keep the repository open between commits, and no longer+ drop the commit when another session is writing a file at the same+ time. A session end now costs what it wrote, not the size of the wiki,+ and the git history no longer silently misses snapshots under+ concurrent sessions (#674).++ ## [2.1.1] - 2026-09-07++ ### Changed+ - The managed routing snippet now states that ai-memory is the cross-harness+ memory of record: when the surrounding harness has its own local memory+ feature, durable project facts should be captured in ai-memory rather than+ duplicated in a harness-local store that other agents cannot see (#671).++ ### Fixed+ - A nested `.ai-memory.toml` marker whose only content is a `[capture]`+ section (e.g. one that just sets `ignore_paths`) no longer resets scope+ resolution to `default` / basename. The native binary, the POSIX shell+ hooks, and the generated TypeScript integrations all used to resolve+ `workspace`/`project` and the other forwarded root-level settings+ (`project_strategy`, `drop_subagent_captures`, `[recall] default_global`,+ `[briefing]` keys) from the single nearest marker — the same one that+ decided `[capture]`/`ignore_paths` — so a capture-only marker in a+ subdirectory silently shadowed an ancestor marker's declared+ workspace/project and captures landed in the wrong scope. Scope and the+ other forwarded settings now resolve from the nearest marker that+ declares more than `[capture]`, while `[capture]`/`ignore_paths` keeps+ reading the nearest marker unchanged — a marker that declares nothing+ else is scope/settings-transparent. Applies to the native `ai-memory`+ binary, the POSIX shell hooks (`hooks/_lib.sh`), and the generated+ TypeScript integrations for every adapter that resolves scope client-side+ (OpenCode, OpenCode2, pi, OMP, OpenClaw); outputs remain byte-identical+ otherwise. (#668)+ - Wiki auto-commits no longer re-hash the whole tree. Since the #594 guard,+ every commit cleared the git index and re-read every page, so a session+ end cost the size of the wiki and grew with it; the LongMemEval harness+ saw its ingest rate fall from 141 to 50 session ends a minute as the tree+ grew. Staging now goes through libgit2's stat cache and re-hashes the tree+ only when the tree write fails, which is the #594 case and is now covered+ by a test that removes a blob from the object store. Commits on one wiki+ are also serialized: two session ends at once used to collide on the index+ lock, and the losing snapshot was dropped with a warning. (#665)+ - Preserved typed relation edges in multi-page consolidation. Batch updates+ now include the same closed `causes` / `fixes` / `contradicts` schema as+ single-page consolidation and carry non-empty relations into wiki+ frontmatter and the link index, instead of silently discarding them. (#667)- OKF-conformed event ledgers are skipped by the indexer again, so a migratedstore stops growing without bound. The reserved-file check treated any`log.md` / `log-YYYY-MM.md` carrying YAML frontmatter as an ordinary page,