Repository navigation
rfc: RFC 0047, search plan truth on engine v2 - #791
Merged
Merged
Conversation
This was referenced Sep 28, 2026
Closed
Open
ragnorc
marked this pull request as ready for review
September 29, 2026 21:32
3 tasks done
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.
What this is
RFC 0047 is the correctness part of the search work. It removes every search query shape that gives a silent wrong answer, makes every search order a single total order, and makes every refused query explain itself.
It replaces the RFC 0047 text in #606. That text was written against engine v1. Since then engine v2 and the shared expression model landed on
main, and since #795 engine v2 is the only query engine. This version is written from scratch against engine v2: every behavior it calls a defect was reproduced atb14c22c5and checked again in code atbaf10c94.The problems
query name {without(), getsparse error --> 1:1 … expected query_file."deep"and"Deep"match different rows (Unindexed full-text search is case-sensitive #747).rrf()ignores the order keys after it (Order keys after rrf() are silently ignored #787), and a search-ordered aggregate applies no order, solimitkeeps random groups (A search-ordered aggregate applies no order, so limit keeps arbitrary groups #788).The proposal
@indexis a type error (T27); a declared index that is not built is refused at planning (FullTextIndexRequired).limitcuts rows. The fusedrrf()score becomes a column you can return.Update (2026-09-29)
#795 made engine v2 the only query engine, with v1 kept only as a frozen reference for tests. So the RFC no longer asks engine v1 to refuse anything: the v1-door steps, the
V…code group and the open question about them are removed, and the RFC has no unresolved questions. The rule that a planner refusal by design is a 400 with a diagnostic (step 2) stays. The branch also hasmainmerged in.Related
Checks:
python3 scripts/check-docs.py,bash scripts/check-agents-md.sh,typos.