Skip to content

v0.3.0 — Concurrency safety & robustness

Choose a tag to compare

@2672243194 2672243194 released this 20 Aug 10:57
· 17 commits to main since this release

Highlights

Concurrency safety (multi-agent ready)

Several agents (TRAE, Claude Code, Codex, ...) writing the same vault at the same time no longer corrupt state:

  • Vault write lock — cross-process and cross-thread mutual exclusion via a transient .vault.lock (atomic O_CREAT|O_EXCL creation, re-entrant within a thread, stale locks auto-reclaimed after 60 s).
  • Atomic writes — every file write goes through temp-file + os.replace, so concurrent readers never see torn Markdown.
  • agentbrain apply is a transaction — validation and supersede writes happen under one lock; a vault changed mid-apply is refused with zero side effects.

Performance & robustness

  • memory_query no longer rebuilds the index once per hit — one rebuild per query regardless of top_k.
  • Stray non-lesson .md files dropped into Learnings/ (e.g. a README) are ignored instead of polluting the index.
  • memory_ingest confidence is clamped to [0, 1]; unknown mode values fall back to index.
  • Same-second profile suggestions no longer overwrite each other.

Verification

  • 54 unit/integration tests (10 new: lock re-entrancy, thread serialization, timeout & stale-reclaim, concurrent ingest, single-rebuild queries, stray-file skipping, input clamping)
  • Cross-process smoke: 4 parallel CLI processes ingesting into one vault — all succeeded, zero lost lessons/log entries, lock cleaned up
  • MCP stdio smoke against a live vault: 6 tools + 3 resources registered and callable

Full changelog: see Changelog section in README.md.