Skip to content

Fix interrupted rebuild rollback preserving index - #2669

Merged
Widthdom merged 5 commits into
mainfrom
codex/fix-issue2642
May 25, 2026
Merged

Fix interrupted rebuild rollback preserving index#2669
Widthdom merged 5 commits into
mainfrom
codex/fix-issue2642

Conversation

@Widthdom

Copy link
Copy Markdown
Owner

Summary

  • Move the full-scan batch marker into the same rollback boundary as readiness demotion and file writes so interrupted scans preserve the previous healthy index state.
  • Stop --rebuild from dropping the existing database before the transactional write phase, while still deleting rows for files that become non-indexable during a successful rebuild.
  • Add regression coverage for interrupted full scans, interrupted rebuilds, and rebuild cleanup of formerly indexed binary files.

Validation

  • dotnet build
  • dotnet test tests/CodeIndex.Tests/CodeIndex.Tests.csproj --filter "FullyQualifiedName~IndexCommandRunnerTests.Run_FullScan_CancelledAfterReadinessDemotion_RollsBackExistingIndex|FullyQualifiedName~IndexCommandRunnerTests.Run_Rebuild_CancelledAfterReadinessDemotion_PreservesExistingIndex|FullyQualifiedName~IndexCommandRunnerTests.Run_Rebuild_WhenIndexedFileBecomesBinary_RemovesStaleRow"
  • dotnet run --project tools/CodeIndex.Changelog -- check
  • dotnet ./src/CodeIndex/bin/Debug/net8.0/cdidx.dll index . --commits bfe49ab86771948c6885d46035f5dff686dbda6b --json
  • adversarial review: No blocking/actionable issues found.

Changelog

  • changelog.d/unreleased/2642.fixed.md

Fixes #2642

@Widthdom
Widthdom merged commit 9abf29b into main May 25, 2026
10 checks passed
@Widthdom
Widthdom deleted the codex/fix-issue2642 branch May 25, 2026 00:32
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.

cdidx index can self-interrupt during full rebuild and leave the local index empty

1 participant