feat(store): the index knows its embedding space — search refuses to mix - #46
Merged
Conversation
Every file row already carried the embed fingerprint in its signature (that is what drives clean re-embeds), but SEARCH never checked: swap to a same-dimension model and the query lands in a different vector space than the corpus — silently garbage ranking until the next index run. Now a clean index pass records provider/model/dim in a meta table, and recall_search compares before embedding: on mismatch it skips KNN entirely and returns the FTS path with an honest degraded note naming both spaces and the fix. The marker moves only after a CLEAN pass — a failed file keeps rolled-back old-space vectors, so the corpus stays officially mixed until healed. Existing indexes have no marker and behave exactly as before until their next index run. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
AbsoluteMode
added a commit
that referenced
this pull request
Aug 3, 2026
…roadmap item (#49) Lead, How it works, CLI reference and the Russian intro now say three sources; Roadmap marks Cursor shipped; Troubleshooting gains the 'embedder changed' degraded row (#46's guard deserves a doc line). Co-authored-by: max <niceizzy1337@gmail.com> Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
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.
Maxim asked: «у данных есть мета флаг каким эмбеддером они собраны?» — per-file, yes (the fingerprint inside every
indexed_files.sig, e.g.v2:voyage/voyage-4-large/1024:…). But the question exposed the hole: search never checked. A same-dimension model swap passes the schema check, and until the nextindexrun every query lands in a different vector space than the corpus — silently garbage ranking.index_corpuspass recordsprovider/model/dimin a newmetatable (one k/v table; rides the existing transaction discipline).recall_searchcompares before embedding: on mismatch it skips KNN entirely (no embed call at all — asserted in the test) and returns the FTS path with a degraded note naming both spaces and the fix.Suite 329 passed.
🤖 Generated with Claude Code