feat: add MsgpackCache.from_root() — eliminates repeated is_dir guard in loaders
Adds from_root(root) classmethod to MsgpackCache. Takes a repo root, checks for .muse/, returns load(muse_dir) on hit or empty() on miss. Replaces the identical 3-line guard that load_symbol_cache / load_callgraph_cache / load_implicit_edge_cache each duplicated.
_InvariantFileCache overrides from_root to delegate to its load(repo_root), which already performs the is_dir check internally.
The four convenience loaders become one-liners: return XxxCache.from_root(root). The 20+ CLI command callers are unchanged.
Adds TestFromRoot (4 tests) to test_cache_base.py. Total cache tests: 179. Plan doc updated with from_root spec, tests, and wiring notes.
sha256:8dfc71bd41425032b28f57428f129a29a9967ceee0026b8d9eb49ad4ecfcb4f1
sha
sha256:57b85305f4dc8b69462bf867ece4b9967ef2ca83210b4a2c10bc5eeb9b1d3f96
snapshot
0 comments
To add a comment, use the Muse CLI:
muse hub commit comment sha256:8dfc71bd41425032b28f57428f129a29a9967ceee0026b8d9eb49ad4ecfcb4f1 --body "your comment"
No comments yet. Be the first to start the discussion.