Restores inspect cache and scanner accuracy: stale or damaged cached findings are now fenced by a cache epoch (42), and freshness checks hash the analyzed source buffer so metadata-only matches cannot hide edits.
Bug fixes
Dead-code rows that fail to decode become explicit coverage gaps that quick reuse and cached project reads preserve until a rescan repairs them, instead of silently missing findings.
Partially parsed files keep valid nested functions; field identifiers like or no longer count as short-circuit operators.
TODO memo paths resolve relative to each scan root, and debug read counters are opt-in per root.
Refactors
Cache epoch invalidation is atomic for writers; read-only usage returns misses without modifying the store. Oversized projections drop themselves instead of evicting other roots.
Confidence Score: 5/5
The changes since the last review appear safe to merge; no new actionable issue was found.
Summary
Updates inspect caching and scanner accuracy.
Inspection results stay tied to the source text that produced them.
Old inspection caches are cleared, and damaged dead-code facts remain visible as gaps.
Complexity and cycle scans keep valid findings from partly broken source and graphs.
Dead-code rollups group and rank findings with less repeated work.
TODO findings use paths relative to the root being scanned.
Scoped inspection results and project projections stay within their memory budgets.
Debug file-read counts only track roots that were explicitly registered.
Inspection test fixtures check that diagnostic reports match notified edits.
Since the last review, only tests changed. They now match equivalent file paths and confirm that recomputation scans the changed manifest without rescanning the unchanged source.
The previous cache-damage thread was manually resolved by ualtinok without explanation. Existing tests explicitly preserve saved findings when damage occurs after rollup, until recomputation reads the damaged row. No duplicate finding is posted.
Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Open inspect cache] --> B{Epoch is current?}
B -->|No, writable| C[Clear old facts and findings atomically]
B -->|No, read-only| D[Return cache miss]
B -->|Yes| E[Check source freshness]
C --> E
E --> F[Reuse findings or rescan changed files]
F --> G[Roll up file facts]
G --> H[Keep decode failures as coverage gaps]