Repository navigation
fix(search): scope rerank cache fallback to the scoring query - #1043
Open
andrewloux wants to merge 1 commit into
Open
andrewloux wants to merge 1 commit into
andrewloux wants to merge 1 commit into
Conversation
An intent-prefixed query receives its own score when the legacy cache contains a score for the bare query. Bare and empty-intent queries retain legacy cache reuse; current-format keys keep priority.
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.
QMD prepends caller-supplied
intentto the query before reranking. The compatibility fallback can reuse a score for the bare query, bypassing scoring with that intent.For example, a caller reranks a passage from
doc.mdwith querycacheand intentconfiguration commands. QMD's scoring input is:Assume a previous file-scoped entry holds a score for
doc.md, this passage, the same model, and barecache. The current key has no entry for the input above.The fallback now requires the formatted query to equal the bare query. Missing and empty intents retain compatibility reuse; current-key entries retain priority.
formatRerankQuery()extracts the existing formatting; productionrerank()calls it to build the scoring input.The regression installs
LegacyCacheReranker, a model fake that records the already-formatted query and returns0.99. The test seeds a file-scoped score of0.11, then checks one intent-aware model call, repeat reuse, and bare/empty-intent compatibility. All324store tests pass on Node and Bun (13integration tests skipped per runtime). Types, lint, and compiled-package smoke pass.