Solution for long term memory for agent coding CLIs and to facilitate handoff between different agent vendors
Rust
docs: document the Windows transient file-error policy; update the benchmark gate note
AkitaOnRails5c68046d6723
diff --git a/docs/ARCHITECTURE.md b/docs/ARCHITECTURE.mdindex 28f844ec..6c8a304f 100644--- a/docs/ARCHITECTURE.md+++ b/docs/ARCHITECTURE.md@@ -883,7 +883,16 @@ that touch the relevant area.client instead: the server snapshots SQLite with its online backup API whilethe writer remains live. (basic-memory #765.)10. **Atomic file writes** (tmp + rename + fsync). Watcher ignores- own writes by filename prefix.+ own writes by filename prefix. On Windows, an antivirus scanner, the+ indexer or a concurrent process can hold a file for a moment, so file+ operations that race with them treat specific Windows errors as+ transient: a bounded retry or a skip, never an unbounded wait, and never+ a weaker check for a file that stays inaccessible. Each site keeps its+ own policy because their deadlines differ (the hook path stays inside its+ 200 ms budget); the sites are listed in+ [design-windows-ci.md](design-windows-ci.md#windows-transient-file-errors).+ New file-I/O code with the same race follows the same pattern, with a+ test that injects the error so it also runs off Windows.11. **Absolute canonical data dir** default; logged loudly onstartup. (agentmemory #303.)12. **No global singletons / `lazy_static` configs.** All depsdiff --git a/docs/benchmarks/README.md b/docs/benchmarks/README.mdindex 3bfc0852..a9aeaf61 100644--- a/docs/benchmarks/README.md+++ b/docs/benchmarks/README.md@@ -100,6 +100,8 @@ baseline-vs-baseline determinism check is clean (all accuracy/token deltas `0.00LLM answers from retrieved context and an LLM judges the answer; those area different metric from `hit@5`. [comparison.md](../comparison.md) listseach setup.-- **Regression gate.** Roadmap items 2-6 re-run this benchmark; a change- that lowers a slice materially is a regression to fix, not a note to- publish.+- **Release policy.** A release that touches retrieval re-runs this+ benchmark once, on the final release candidate, and compares every slice+ with the previous release (AGENTS.md, project maintenance rules). A drop+ does not block the release: the numbers are published and an issue opens+ for the next release to decide whether it is a regression.diff --git a/docs/design-windows-ci.md b/docs/design-windows-ci.mdindex bbe3de5c..77b47ac8 100644--- a/docs/design-windows-ci.md+++ b/docs/design-windows-ci.md@@ -467,3 +467,21 @@ toolchain, 8 vCPU / 8 GB, Defender disabled).provisioning + runs via the QEMU monitor (3), and prefer focused per-crate invocations.- **Option D (`windows.yml`) stays** the authoritative, licence-clean, fork-safe pre-tag gateregardless. The VM is the belt; `windows.yml` remains the suspenders.++## Windows transient file errors++Where a Windows file operation can race with an antivirus scan, the indexer+or another process, the code treats the specific error as transient. Each site+has its own bound (invariant 10 in [ARCHITECTURE.md](ARCHITECTURE.md)):++| Site | Operation | Windows error | Policy |+|---|---|---|---|+| `crates/ai-memory-wiki/src/atomic.rs` `persist_with_retry` | atomic rename of a page write | `ERROR_SHARING_VIOLATION` (32), `ERROR_LOCK_VIOLATION` (33) | up to 5 attempts, 10 ms base backoff |+| `crates/ai-memory-wiki/src/confinement.rs` `is_transient_churn` | stat of an entry during a confinement walk | sharing violation (`PermissionDenied`), `ERROR_DELETE_PENDING` (303) | skip the entry, as for `NotFound`; an entry that does stat still faces the link checks |+| `crates/ai-memory-cli/src/commands/hook_spool.rs` `is_drain_lock_busy_error` | spool drain lock | `ERROR_LOCK_VIOLATION` (33) | treated as "lock busy", like `WouldBlock`; the drain runs later |+| `crates/ai-memory-cli/src/commands/hook_drain_process.rs` `should_retry_without_breakaway` | spawning the detached drain process | `ERROR_ACCESS_DENIED` (5) | retry once without `CREATE_BREAKAWAY_FROM_JOB` |+| `companions/ai-memory-relay/src/fsguard.rs` `read_settled` | metadata read of a queue file (SQLite deletes its rollback journal at each commit) | access denied (delete pending) | up to 5 retries, 20 ms apart, then refused |++The relay is a separate workspace, so the policy is not shared code. A new+site follows the same rules: name the exact error, bound the retry, keep+refusing a file that stays inaccessible, and test it with an injected error.