Skip to content

fix/index: preserve category when merging shards#1072

Merged
keegancsmith merged 1 commit into
k/shardbuilder-category-before-languagefrom
k/preserve-category-when-merging-shards
Jun 17, 2026
Merged

fix/index: preserve category when merging shards#1072
keegancsmith merged 1 commit into
k/shardbuilder-category-before-languagefrom
k/preserve-category-when-merging-shards

Conversation

@keegancsmith

@keegancsmith keegancsmith commented Jun 17, 2026

Copy link
Copy Markdown
Member

Merged shards reconstruct documents through ShardBuilder, so relying on category inference can discard metadata that the original indexer already stored. This is especially fragile for skipped generated files where the content used for categorization may not survive reconstruction. This change carries the stored category into the rebuilt document so merging remains metadata-preserving.\n\nThis PR is stacked on top of #1073 because it exercises the skipped-file categorization behavior fixed there, but the merge preservation itself is a separate fix.\n\n## Test Plan\n\n- go test ./index -run 'TestMergePreservesStoredCategoryForSkippedGeneratedFile|TestExplode'

Merged shards reconstruct documents through ShardBuilder, so relying on category inference can discard metadata that the original indexer already stored. This is especially fragile for skipped generated files where the content used for categorization may not survive reconstruction. Carry the stored category into the rebuilt document so merging remains metadata-preserving.

Amp-Thread-ID: https://ampcode.com/threads/T-019ed48e-abd7-73cc-877e-1866db891594
Co-authored-by: Amp <amp@ampcode.com>
@keegancsmith keegancsmith merged commit 7450c05 into k/shardbuilder-category-before-language Jun 17, 2026
8 checks passed
@keegancsmith keegancsmith deleted the k/preserve-category-when-merging-shards branch June 17, 2026 10:45
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