feat: Phase 6 — MsgpackCache ABC eliminates duplicated load/save boilerplate
Introduces muse/core/cache_base.py with MsgpackCache, an abstract base class that owns all Pattern-A disk I/O (mkstemp + os.replace) and dirty-flag tracking. SymbolCache, CallGraphCache, ImplicitEdgeCache, and _InvariantFileCache now inherit from it — each provides only _CACHE_FILENAME, _CACHE_VERSION, _TEMP_PREFIX, _deserialize_entries(), and _serialize_entries(). All load/save/get/put/prune/ size/empty implementations are shared.
_InvariantFileCache overrides load() to keep its repo_root signature; all other caches use the inherited muse_dir signature unchanged.
Adds tests/test_cache_base.py with 21 tests (Tiers 1/2/5/6/7) via a minimal _TestCache concrete subclass. All 175 cache tests pass (21 new + 154 existing per-cache tests with zero modifications — the regression gate holds).
Plan doc updated: Phase 6 marked complete, write pattern table corrected to reflect all four caches now on Pattern A since Phase 5.
0 comments
muse hub commit comment sha256:3d749fd3b483ce4c7d658fbc9f21ed09b47ad84fdccaffec1c2d8a27ae89f12b --body "your comment"
No comments yet. Be the first to start the discussion.