Skip to content

feat: persistent cache - #42

Merged
SizzleUnrlsd merged 2 commits into
mainfrom
feat/persistent-cache
Sep 4, 2026
Merged

SizzleUnrlsd merged 2 commits into
mainfrom
feat/persistent-cache

Conversation

@SizzleUnrlsd

Copy link
Copy Markdown
Contributor

Summary

Phase 10 opens with the persistent cache of docs/architecture.md §11: a directory check keeps per-module results on disk and, on the next run, re-analyses only the modules whose inputs changed.

  • Acceptance tests first (test: define persistent cache behavior), implementation follows.
  • cache.py (root module, like engine): CachedModule (functions, summaries, call sites, findings), a JSON codec for summaries, external calls, call sites and findings, and ProjectCache, a directory of entries written atomically and read leniently: a corrupt, foreign or older-format entry is a miss. Entries are data, never code.
  • Keys: a configuration fingerprint (engine, HIR, finding and plugin API versions; each loaded plugin's manifest and the digest of its code; the model table; the advisories; the dependency graph) combined with the module's identity and text, then with the keys of the project modules it imports transitively. A change anywhere below a module misses for that module; a change in a leaf leaves its importers cached.
  • engine.analyze_project(..., cache=): cached modules never reach lowering. Their summaries seed the project index before the fixpoint, so incremental summaries come with the cache; their call sites are rebuilt into a CallGraph handed to ProjectContext, so the project plugins and the correlation keep working over a mix of fresh and cached modules. ProjectAnalysis exposes keys and reused.
  • --cache DIR on the CLI, valid with --check on a directory.

Not in this PR, tracked on #41: incremental parsing (every file is still parsed each run, which is what the module graph needs), parallel analysis, memory eviction.

Refs #41

@SizzleUnrlsd SizzleUnrlsd self-assigned this Sep 4, 2026
@SizzleUnrlsd
SizzleUnrlsd merged commit e9d546a into main Sep 4, 2026
6 checks passed
@SizzleUnrlsd
SizzleUnrlsd deleted the feat/persistent-cache branch September 4, 2026 00:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant