Repository navigation
fix(cli): sync warns about an index from an older engine, and still runs - #3121
Merged
Merged
Conversation
An index built by an older extraction version made `codegraph sync` print "Already up to date" while `codegraph status` said to re-index. Sync re-reads changed files only and never advances the extraction stamp, so that message was false however little had changed. Sync now says "No files changed" in that case and ends with a warning that names `codegraph index`, after syncing changed files as before. It exits 0. Refusing, as the PR first did, would have stopped the installed git hooks: they run sync in the background with its output discarded, so every index behind a hook would quietly stop following commits on the next upgrade. `--quiet` stays silent, as cli-sync.test.ts already pins. Validation: the new cli-sync-stale-index.test.ts has 6 cases for an old stamp and a missing one, unchanged and changed files, quiet and not, a current index, and the rebuild clearing the warning. 3 fail on main, 6 pass here. A real commit through the installed post-commit hook on a stale index put the new file in the index in about a second. Original PR #1842 by @bompus. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Summary
codegraph syncno longer says "Already up to date" on an index an older engine built. It syncs changed files as before, then warns that a fullcodegraph indexis what picks up the new engine. It still exits 0, and--quietstays silent.Root cause
Sync re-reads changed files only and never advances the extraction stamp, so an index from an older engine stays out of date however little changed.
codegraph statusalready said so; sync said the opposite.What came from the contributor, and what changed
The PR's detection and its test matrix stand: old stamp and missing stamp, unchanged and changed files, quiet and not, a current index, and the rebuild clearing the condition.
Its behaviour changed, by the maintainer's decision. The PR refused the sync with exit 1. The installed git hooks run sync in the background with output discarded, so a refusal would quietly stop every hooked index from following commits on the next upgrade, with nothing to tell the user why. So:
--quietprints nothing, ascli-sync.test.tsalready pins. The PR's stderr line existed to explain a failed exit, and there is no failure now.No automatic rebuild here. That stays #1798.
Validation
cli-sync-stale-index.test.ts, 6 cases. 3 fail on main (the warning cases), the 3 that pin unchanged behaviour pass on both, and all 6 pass here.git commitput the new file in the index in about a second, and a manual sync printed the warning and exited 0.owning-package.test.ts, which pins thefiles --jsonkeys and needed the new field from feat(cli): expose test-file classification #1960; that fix is in feat(cli): expose test-file classification #1960's commit. This commit also ran alone at f9b7997b on Vitest 2: 839 files, 9966 tests, 9879 passed, 0 failed, 87 skipped.Lands #1842 by @bompus
🤖 Generated with Claude Code