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.
0 comments
muse hub commit comment sha256:54a266e734569229e06919ddea3ebdbb10106c1fbf9581ef76b91ea1fbb59242 --body "your comment"
No comments yet. Be the first to start the discussion.