Bump GRAPH_VERSION so the tree-sitter fix reaches existing caches - #50
Merged
Conversation
…g caches #48 made tree-sitter load in a packaged install. It did not bump GRAPH_VERSION, so nothing re-parsed and the fix was invisible to anyone with an existing graph — including the install used to verify it. Reconciliation skips a file when its content hash is unchanged: if (restored && this.graph.getFileHash(relativePath) === hash) return; and `restore()` accepts any cache whose version matches. Swapping the extractor changes no file's content, so an upgraded install restored its regex-built graph at v5, matched every hash, re-parsed nothing, and kept serving symbols produced by the parser that was just replaced. Measured after installing the fixed build and reloading — the live cache was still regex-shaped, and the `method` kind is the unambiguous tell: kind tree-sitter regex live cache method 1487 0 absent function 2275 4468 4432 class 201 214 214 enum 9 19 19 This is the same reasoning the v4 and v5 bumps were written for, applied to a change that swaps the entire extractor rather than one mapping — a larger invalidation than either, and the one I failed to make. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
✅ All checks passed
Posted by SideCarAI-Bot |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Defect in #48, found while verifying #48.
What happened
#48 made tree-sitter load in a packaged install. I did not bump
GRAPH_VERSION, so nothing re-parsed and the fix was invisible to anyonewith an existing graph — including the install used to verify it.
Reconciliation skips a file whose content hash is unchanged:
and
restore()accepts any cache whose version matches. Swapping the extractorchanges no file's content, so an upgraded install restores its regex-built graph
at v5, matches every hash, re-parses nothing, and keeps serving symbols from the
parser that was just replaced.
Measured, after installing the fixed build and reloading
The
methodkind is the unambiguous tell — the regex analyzer emits none at all:Everything matched regex. Meanwhile
createTreeSitterAnalyzerpointed at theinstalled extension's grammars loads fine — 28 extensions, and it correctly
emits
m:method. So the module, the grammars and the loader were all working;the graph simply was never rebuilt.
Why this is the same lesson twice
v4 bumped for variable symbols and v5 for generators, both with the reasoning
written into the comment: the affected files do not change, reconciliation is by
content hash, so without a bump the cache serves stale extraction forever.
Replacing the entire extractor is a strictly larger invalidation than either,
and it is the one I missed.
For anyone testing locally
Deleting
.sidecar/cache/symbol-graph.jsonand reloading achieves the samething without this change — but that is not available to users upgrading, which
is what the version field is for.
npm run check: 8622 passed, 2 skipped.🤖 Generated with Claude Code