Skip to content

fix(cli): sync warns about an index from an older engine, and still runs - #3121

Merged
colbymchenry merged 1 commit into
mainfrom
claude/pr-1842-sync-stale-warning
Oct 31, 2026
Merged

colbymchenry merged 1 commit into
mainfrom
claude/pr-1842-sync-stale-warning

Conversation

@colbymchenry

Copy link
Copy Markdown
Owner

Summary

codegraph sync no longer says "Already up to date" on an index an older engine built. It syncs changed files as before, then warns that a full codegraph index is what picks up the new engine. It still exits 0, and --quiet stays 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 status already 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:

  • sync warns and still runs, with exit 0;
  • the stale case says "No files changed" in place of "Already up to date";
  • --quiet prints nothing, as cli-sync.test.ts already 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

Lands #1842 by @bompus

🤖 Generated with Claude Code

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>
@colbymchenry
colbymchenry merged commit 0603ad9 into main Oct 31, 2026
@colbymchenry
colbymchenry deleted the claude/pr-1842-sync-stale-warning branch October 31, 2026 00:07
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.

2 participants