Skip to content

fix(core): fill a filtered vector window instead of stopping at rejected neighbours - #1575

Merged
phernandez merged 1 commit into
mainfrom
feat/1558-scoped-search-4b-filtered-window
Sep 16, 2026
Merged

phernandez merged 1 commit into
mainfrom
feat/1558-scoped-search-4b-filtered-window

Conversation

@phernandez

Copy link
Copy Markdown
Member

Summary

Same branch and commit as #1570, opened against main now that #1574 has landed. GitHub refuses to retarget a PR that is part of a stack. See #1570 for the full description and test plan.

A vector or hybrid search that carries structured filters now fills its candidate window: the reader re-reads the ranking with a bounded geometric overfetch until the window holds enough admitted rows, the ranking is exhausted, or its tail falls below the similarity threshold. Unfiltered searches read their window once, as before.

Refs #1558, #1570

🤖 Generated with Claude Code

https://claude.ai/code/session_019YW9ysxugGGBCNEGzsxtFV

…ted neighbours

The vector index ranks by similarity alone and cannot evaluate structured
filters (note types, dates, categories, metadata, path prefixes, valid time).
Vector and hybrid retrieval took one window of `candidate_limit` chunks from
that ranking and asked the full-text pass which of them the filters admitted.
When the nearest chunks belonged to rows the filter rejects, the window held
few admitted rows while more sat just past it, and the page came back short
although matches existed.

`vector_only` now resolves its window through `_candidate_window`, which
re-reads the ranking with a bounded geometric overfetch until the window holds
`candidate_limit` admitted rows, the ranking is exhausted (a short read, no
growth, or the scan cap), or its tail has fallen below the similarity
threshold, past which nothing further can qualify. A query without filters
resolves its window once, as before. The chunk-to-row resolution (keys,
threshold, row fetch, filter) moves into `_resolve_rows`, returning a frozen
`CandidateWindow`; `_run_vector_query` and the trace stage are unchanged, and
each round replaces the previous round's rejection lists so the trace reads
the final window.

Refs #1558

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_019YW9ysxugGGBCNEGzsxtFV
Signed-off-by: phernandez <[email protected]>
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@phernandez
phernandez merged commit a936020 into main Sep 16, 2026
14 of 15 checks passed
@phernandez
phernandez deleted the feat/1558-scoped-search-4b-filtered-window branch September 16, 2026 00:00
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