No description
The mtime-based cache (state.bin) was causing data loss under concurrent writes. Multiple processes (dream loop journal writes, link audit agents, journal enrichment agents) would each: 1. Load state.bin (stale - missing other processes' recent writes) 2. Make their own changes 3. Save state.bin, overwriting entries from other processes This caused 48 nodes to be lost from tonight's dream session - entries were in the append-only capnp log but invisible to the index because a later writer's state.bin overwrote the version that contained them. Fix: always replay from the capnp log (the source of truth). Cost: ~10ms extra at 2K nodes (36ms vs 26ms). The cache saved 10ms but introduced a correctness bug that lost real data. The append-only log design was correct - the cache layer violated its invariant by allowing stale reads to silently discard writes. |
||
|---|---|---|
| prompts | ||
| schema | ||
| scripts | ||
| src | ||
| .gitignore | ||
| build.rs | ||
| Cargo.lock | ||
| Cargo.toml | ||