Repository navigation
fix(status): recommend a re-index when package.json alone adds or drops a framework - #3005
Open
inth3shadows wants to merge 2 commits into
Open
inth3shadows wants to merge 2 commits into
inth3shadows wants to merge 2 commits into
Conversation
…ps a framework A sync detects frameworks again only when it extracts a file, so adding express or @sveltejs/kit to package.json with no source file edited recorded nothing, and status stayed silent while the files indexed before it lacked the framework's routes and links. The full index now stamps the resolver's framework set, and status compares it with the set the resolver detects on open.
… the changelog note into its unreleased entry
inth3shadows
added a commit
to inth3shadows/codegraph
that referenced
this pull request
Oct 29, 2026
inth3shadows
added a commit
to inth3shadows/codegraph
that referenced
this pull request
Oct 29, 2026
…rried changes
This branch has not been deployed
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.
Fixes #3007.
codegraph statusnow recommends a re-index when a framework comes or goes throughpackage.jsonalone, with no source file changed.The bug
#2941 (the #2516 fix, unreleased) has a sync detect frameworks again when what detection read changed. It records the difference from the last full index, and status recommends a re-index. But a sync detects again only when it extracts a file:
So adding
expressor@sveltejs/kittopackage.jsonwith no source file edited records nothing. Status stays silent while the files indexed before the edit lack the framework:+layout.svelte'sgoto('/login')stays unlinked.Repro (Express): index with
{"dependencies":{}}and anapp.get('/hello', …)server, addexpresstopackage.json, runcodegraph sync, thencodegraph status --json. Before:frameworksChangedSinceIndex: null,reindexRecommended: false. With this change:{ added: ['express'] },true.I found it with a differential harness that replays a repo's git history and compares each sync against a fresh index. It came up on a SvelteKit app.
The fix
The status hint gets a second source:
resolver_frameworks_at_index).getFrameworkChangesSinceIndex()merges what syncs recorded, as before, with a comparison of that stamp against the set the resolver detects now. The resolver already detects on every open (createResolver→initialize), so status pays nothing extra.Since status is a fresh process, it sees a manifest-only change whether or not a sync ran.
Known limits
resolver_frameworks_at_index. The new half of the hint starts after their next full index.Tests
__tests__/framework-hint-resolver-only.test.tshas 4 cases:goto;On
main: 3 failed, 1 passed (the silent case). With this change: 4/4.sync-framework-detection.test.ts: 8/8.tsc --noEmitis clean. Full suite:Tests 8768 passed | 417 skipped, 0 failed.False positives (a hint right after a full index):