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 review/pr-239
AkitaOnRailsa63233d63d14
diff --cc CHANGELOG.mdindex f5c5dbb2,6a927ada..528e2da2--- a/CHANGELOG.md+++ b/CHANGELOG.md@@@ -14,19 -14,59 +14,71 @@@ and this project adheres to [Semantic Vthe local SQLite index directly, so every CLI command is a thin HTTPclient of the running server; the command now requires a reachableserver and no longer works against an offline data directory.+ - Managed workstream support for Grok Build CLI: `ai-memory run grok` (alias+ `grok-build`) creates fresh sessions with a wrapper-generated `--session-id`,+ resumes linked sessions with `--resume`, maps wrapper `--yolo` onto Grok's+ native `--yolo`/`--always-approve`, and delivers the bounded workstream+ context packet through Grok's native `--rules` flag (system-prompt append,+ acknowledged only after the child spawns). Transcript import reads+ `$GROK_HOME/sessions/*/*/chat_history.jsonl` read-only with a+ prefix-validated cursor and content-hash event ids so rewind-driven journal+ rewrites cannot duplicate history; system prompts and encrypted reasoning+ are excluded as loss annotations, as are the harness-injected `<user_info>`+ and `<system-reminder>` blocks Grok stores inside `user` records (project+ instructions, the skills catalogue, and connected MCP servers), which would+ otherwise leak harness internals into the portable ledger and evict real+ conversation from the startup packet budget. Discovery+ matches checkouts through `summary.json`'s recorded `info.cwd` and honors+ `GROK_HOME`. Grok stays out of the bare-mode automatic pool. Verified+ against Grok Build CLI v0.2.111 ([#237]).++ ### Changed+ - Single-page, batch, and bootstrap consolidation prompts now ask the model+ to connect related wiki pages with path-based wikilinks and to mirror the+ dominant natural language of the source material while preserving code,+ identifiers, paths, commands, error strings, and JSON field names. (#238)++ ### Fixed+ - `install-mcp --client claude-desktop` now detects an MSIX-packaged+ Claude Desktop on Windows and writes to its virtualized+ `AppData\Local\Packages\Claude_<id>\LocalCache\Roaming\Claude\claude_desktop_config.json`+ instead of the plain `%APPDATA%\Claude\` path. Previously this+ silently wrote a config file the running app ignored, so the MCP+ server never appeared after restart. The detector uses Windows'+ resolved local and roaming app-data roots, prefers an existing config+ when multiple package directories exist, and fails with an explicit+ `--config-file` recovery instruction when the active package is+ ambiguous. Unpackaged installs keep resolving to the plain path.+ (#250)++ - The Docker wrappers (`bin/ai-memory`, `bin/ai-memory.ps1`) kept stdin+ attached only on a real terminal, so every piped or redirected+ invocation reached the container with a closed stdin. `ai-memory+ write-page --body -` therefore stored a page with frontmatter and an+ empty body while still reporting a successful write, and the same+ applied to any other stdin reader (hooks fed by a pipe). The wrappers+ now always pass `-i`, while `-t` is added only when stdin and stdout are+ both terminals. `AI_MEMORY_NO_TTY=1` disables only TTY allocation and+ no longer disconnects stdin. (#243)+ - Managed `SessionStart` delivery now includes a pending single-use+ handoff before the portable workstream ledger and optional project+ brief. Handoff and ledger acknowledgements are claimed together only+ after the complete response has been assembled; a failed or racing+ ledger claim cannot consume the handoff or suppress retry delivery.+ (#235)+### Changed+- The M8 access-counter reinforcement is now throttled: a page's+ `access_count` / `last_accessed_at` is bumped at most once per minute+ instead of on every search that returns it. `memory_query` previously+ spawned a writer command per hit on each of its three search paths, so+ repeated or overlapping queries flooded the single writer actor with+ redundant reinforcement writes. A page's first sighting still bumps+ immediately, and a continuously-hot page keeps earning one bump per+ window, so recency ordering is unaffected; only the magnitude of+ `access_count` grows more slowly under bursty search. The cooldown map+ self-prunes, staying bounded by the pages searched within the window.+## [1.18.0] - 2026-07-23### Added