gabriel / muse public
fix BREAKING dev
AI Agent gabriel · 47 days ago · Apr 25, 2026 · Diff

fix: migrate Pattern B caches from fixed .tmp to mkstemp (Phase 5)

Eliminates concurrent-save race condition in symbol_cache, callgraph_cache, implicit_edge_cache, and _InvariantFileCache. Each now uses tempfile.mkstemp with a unique per-cache prefix so two parallel writers never collide on the same temp filename.

Write pattern changes: symbol_cache.py: .symbols_*.tmp (was symbols.msgpack.tmp) callgraph_cache.py: .callgraph_*.tmp (was callgraph.msgpack.tmp) implicit_edge_cache.py:.implicit_edges_*.tmp _invariants.py: .invariants_*.tmp

repo.py: add all four new prefixes to _MUSE_TEMP_PREFIXES so orphaned temps from crashed saves are swept on next startup.

TDD: 4 new orphaned-sweep tests (red before repo.py change, green after). Updated fixed-filename .tmp assertions to glob pattern. Added missing atomic-write test to symbol_cache. 188 cache tests + 84 regression tests all pass.

sha256:54a266e734569229e06919ddea3ebdbb10106c1fbf9581ef76b91ea1fbb59242 sha
sha256:3c17d505aa6d14a9b0298c3d9aa9e949c7812b376314adc4968b09b485aa80de snapshot
← Older Oldest on dev
All commits
Newer → Latest on dev

0 comments

No comments yet. Be the first to start the discussion.

To add a comment, use the Muse CLI: muse hub commit comment sha256:54a266e734569229e06919ddea3ebdbb10106c1fbf9581ef76b91ea1fbb59242 --body "your comment"