fix(cache): scope semantic cache writes to extracted files#1835
Conversation
|
Landed on v8 ( One gap I fixed on top: the guard covered the final CLI write, but the per-chunk incremental checkpoint in |
The #1835 fix scoped save_semantic_cache's final CLI write to an allowed_source_files allowlist, but the per-chunk incremental checkpoint in llm.py `_checkpoint_chunk` — the write that actually runs on every `graphify extract`/`update` via extract_corpus_parallel — still called save_semantic_cache with no allowlist. A chunk whose model result mis-attributes a node's source_file to another corpus file would merge that stray fragment into the victim's cache entry (merge_existing=True). Scope the checkpoint write to the chunk's own dispatched files (FileSlice -> .rel, bare Path -> the relative source_file). Also hoist the `import warnings` in cache.py to module level. Adds an extract_corpus_parallel integration test: a chunk dispatching only A.py that returns a node attributed to already-cached B.py must leave B.py's cache entry untouched. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Summary
allowed_source_filesboundary tosave_semantic_cache.Validation
3117 passed, 30 skippedruff checkpassedtools.skillgen --checkpassedgraphify update .completed successfullyCloses #1757