Remove excluded-file FTS residuals from scoped exports - #5285
Merged
Conversation
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.
Scoped exports could retain excluded-file terms in live FTS5 segments even after deleting their rows and running VACUUM. Rebuild ordinary and available trigram FTS indexes from retained chunks in the private export snapshot before final compaction, hashing, and atomic publication. Legacy databases without trigram support retain their schema; unfiltered full exports keep their existing behavior.
Scoped snapshots also use unpooled SQLite connections, so cancellation and reconstruction failures close the native handle before deleting the private DB, sidecars, and directory. This prevents Windows file-lock failures during cleanup.
Fixes #5274
Validation:
origin/main(7fb126a2b), Release export/import and incoming Shell regressions pass: 90 on net8.0 and 90 on net9.0, zero failures/skips. The strengthened interruption theory verifies native-handle closure, complete snapshot cleanup, and destination/source preservation for cancellation and reconstruction exceptions. All four cases failed against the previous implementation on macOS, exposing the same retained-handle cause as Windows CI.1ddf9b2d7passed: net8.0 12,268 passed / 9 skipped; net9.0 11,779 passed / 435 skipped. This follow-up reran the affected and merged-area tests; Windows validation is delegated to the updated CI run.indexed_trigram.git diff --check, changelog validation, and root/workspace index checks pass.origin/main..HEAD: "No blocking/actionable issues found."Updated the English and Japanese sections of
USER_GUIDE.md,DEVELOPER_GUIDE.md, andTESTING_GUIDE.md. Changelog fragment:changelog.d/unreleased/5274.security.md. No CLI flags or JSON/MCP contracts changed. Agent instruction files are unchanged.Follow-up issues: none discovered within this scope.