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

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.

sha256:3d749fd3b483ce4c7d658fbc9f21ed09b47ad84fdccaffec1c2d8a27ae89f12b sha
sha256:af1f419a5ae67cb2e5b1fdb7528b64fd15b17d906a95f40261c68371d5cfc565 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:3d749fd3b483ce4c7d658fbc9f21ed09b47ad84fdccaffec1c2d8a27ae89f12b --body "your comment"