Skip to content

rfc: RFC 0047, search plan truth on engine v2 - #791

Merged
azimafroozeh merged 10 commits into
mainfrom
rfc/0047-search-plan-truth
Sep 30, 2026
Merged

azimafroozeh merged 10 commits into
mainfrom
rfc/0047-search-plan-truth

Conversation

@ragnorc

@ragnorc ragnorc commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

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 at b14c22c5 and checked again in code at baf10c94.

The problems

The proposal

  1. Every refusal carries a code, a position or stage, what was expected, and one fix. A refusal by design is a 400 on every path.
  2. Full-text search on a property without @index is a type error (T27); a declared index that is not built is refused at planning (FullTextIndexRequired).
  3. The ranked binding becomes the root of its traversal component, so declaration order stops mattering on both engines.
  4. Every search order sorts by score, then the remaining keys, then ids, and limit cuts rows. The fused rrf() score becomes a column you can return.
  5. Reads report their retrievals and what each score column measures, derived from the plan that ran.
  6. Served reads report time per phase.

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 has main merged in.

Related

Checks: python3 scripts/check-docs.py, bash scripts/check-agents-md.sh, typos.

@ragnorc
ragnorc marked this pull request as ready for review September 29, 2026 21:32
@azimafroozeh
azimafroozeh added this pull request to the merge queue Sep 30, 2026
Merged via the queue into main with commit b50f549 Sep 30, 2026
29 checks passed
@azimafroozeh
azimafroozeh deleted the rfc/0047-search-plan-truth branch September 30, 2026 21:36
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.

2 participants