feat(code-test): audit cache internals, add cache_hit/--cache-status, close 5 invalidation test gaps (muse#49)
Phase 1-5 of muse#49: - Audit SymbolCache/CallGraphCache: content-addressed per-file memoization, not snapshot-keyed — documented in docs/code-test-internals.md, including a deliberate departure from the ticket's imagined cache_snapshot_id/ head_snapshot_id staleness schema (the data model doesn't support it without a cache redesign, out of scope). - build_forward_graph/symbols_for_snapshot gain an optional stats= dict to observe per-file hit/miss counts without touching their return types or ~30 existing call sites. - SelectionResult gains cache_hit/cache_misses; select_tests emits a warning on the cold-rebuild path. CLI --json surfaces cache_hit. - 5 new regression tests close real cache-invalidation gaps (new-commit invalidation, unchanged-snapshot reuse via read_object/parse_symbols call-count spying, new-import call-graph rebuild, new-test-file not busting unrelated cache, index-rebuild non-interference). - New `muse code test --cache-status [--json]` reports per-file warmth for HEAD without ever parsing anything. - Found and fixed a real pre-existing bug while building --cache-status: `muse code test`'s CLI path never persisted SymbolCache to disk (only CallGraphCache was ever saved), so every real invocation silently re-parsed every file's symbol tree from scratch. - docs/code-test.md: new user-facing reference; select_tests docstring cross-references both docs.
All new/changed behavior TDD-verified with genuine RED/GREEN cycles (mechanism-level assertions, not output-only) and confirmed live via muse-dev against a disposable /tmp repo.
Co-Authored-By: Claude Sonnet 5 <[email protected]>
Semantic Changes
113 symbols
Files Changed
+5
~5
1247 in snapshot
0 comments
muse hub commit comment sha256:ce542c4d0f6dacc9520c02d0e3378bf96bc377d118a7402f2bbc8af1749b08e0 --body "your comment"
No comments yet. Be the first to start the discussion.