Skip to content

fix(cli): require full rebuild for stale extraction indexes#1256

Open
Adam0120 wants to merge 1 commit into
colbymchenry:mainfrom
Adam0120:fix/stale-extraction-reindex-guidance
Open

fix(cli): require full rebuild for stale extraction indexes#1256
Adam0120 wants to merge 1 commit into
colbymchenry:mainfrom
Adam0120:fix/stale-extraction-reindex-guidance

Conversation

@Adam0120

Copy link
Copy Markdown

Summary

  • require a full codegraph index rebuild when an index predates the current extraction version
  • stop suggesting incremental codegraph sync for extraction-version staleness
  • avoid the unnecessary -f safety override in the post-upgrade advisory
  • cover both the upgrade advisory and the built CLI status output

Reproduction and root cause

A full index stamps indexed_with_extraction_version, while sync deliberately does not advance that stamp because it only revisits changed files. When extraction behavior improves, unchanged files built by an older engine can therefore remain incomplete after sync.

Both codegraph status and the post-upgrade advisory previously offered codegraph sync as a recovery command, which could leave the index stale while implying the extraction improvements had been applied.

Behavior boundary

This only changes public guidance. It does not automatically rebuild indexes during upgrade and does not change sync or indexing behavior.

codegraph index already recreates the database and performs the required full rebuild. Its -f flag only bypasses unsafe-root protection, so the general advisory should not recommend it.

Verification

  • npm run build
  • npx vitest run __tests__/upgrade.test.ts --reporter=dot --pool=threads --fileParallelism=false (50 passed)
  • focused red/green test for status requires a full rebuild when the extraction version is stale
  • focused red/green test for reindexAdvisory requires a full rebuild for extraction improvements
  • git diff --check
  • GoLand inspections on all four changed files: no errors

On this Windows environment, the complete status-json.test.ts file has a pre-existing process-exit hang that reproduced before the change; the new CLI regression test passes independently after build.

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.

1 participant