v0.3.0 — Concurrency safety & robustness
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(atomicO_CREAT|O_EXCLcreation, 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 applyis a transaction — validation and supersede writes happen under one lock; a vault changed mid-apply is refused with zero side effects.
Performance & robustness
memory_queryno longer rebuilds the index once per hit — one rebuild per query regardless oftop_k.- Stray non-lesson
.mdfiles dropped intoLearnings/(e.g. a README) are ignored instead of polluting the index. memory_ingestconfidence is clamped to[0, 1]; unknownmodevalues fall back toindex.- 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.