Skip to content

atlas search: query-understanding front-end — spell correction + LLM query planner/rewriter as toggleable stages, dual submission with provenance (extends #5741) #5773

Open

Description

@dezren39

Extends #5741 (SPLADE investigation + eval harness + adaptive weighting). Design commitments from Drew's direction 2026-11-04.

What this adds

Two NEW front-end stages in front of retrieval, each independently toggleable (off / deprioritized / on), in pipeline order:

spell correction → query planner/rewriter → signal weighting (#5741) → fan-out

Stage 1 — spell correction

Neither BM25 nor SPLADE tolerates typos: both match on exact terms. The mechanism is classical, not learned:

  • Candidate generation by Damerau–Levenshtein edit distance (a transposition — flipped letters — counts as 1 edit) plus character-trigram similarity (set overlap over character 3-grams; the Jaccard family already in the stack per Atlas search: Jaccard as a third signal (rescore + ingest dedup); SPLADE as a triggered follow-on #5733).
  • Candidates are drawn from a corpus-vocabulary dictionary with term frequencies, so corrections prefer terms the corpus actually contains.
  • Correction is conservative — high-confidence only. The original query is always retained as a variant; a correction is never silently substituted. The raw and corrected forms can both fan out and merge like any other variant (see dual submission below).

Stage 2 — query planner / rewriter

A small, fast model rephrases/expands the query into a retrieval-shaped variant: vocabulary the corpus would use, expansions of abbreviations, decomposed compound questions.

Hard exclusions

Evaluation

Planner on/off and spell on/off are ablation axes in #5741's eval harness, alongside the signal ablations. A stage stays only if measured gains (recall@10 / MRR per query class) justify its latency. The harness's held-out real queries are the deciding vote, as with every signal in this stack.

Open questions

  • Planner model choice: a Jev-class small local model vs a hosted small model — latency, cost, and the query-embed cache hit rate decide.
  • Rewrite count: a single variant vs N variants (and if N, how provenance tags and fan-out budget scale).
  • Provenance-aware rescore weighting: should "found by both raw and rewritten" boost a result? Intuition says yes; measure it.
  • Interaction with spell correction ordering: correct-then-rewrite vs rewrite-then-correct — the pipeline order above is the starting position, not a settled answer.

Related: #5733 (Jaccard signals + rescore), #5668 (query-embed cache + flags — the parameter surface for this issue's toggles is designed in the companion issue on query-time knobs), #5667 (shard design), #5669 (shard implementation).

Acceptance criteria

  • Spell correction and the LLM query planner/rewriter exist as pipeline stages in front of retrieval, each independently toggleable (off / deprioritized / on), in the order stated in the body.
  • Stage behaviour matches the design commitments in the body (candidate generation, corpus-vocabulary dictionary, and the hard exclusions respected).
  • The evaluation harness from Atlas search: SPLADE investigation — third retrieval signal, eval harness, query-adaptive weighting #5741 shows the stages' effect (improvement or measured no-harm) on the eval corpus before either stage defaults to on.

Activity

  1. developing-today commented on Nov 5, 2026

    @developing-today
    Contributor
  2. dezren39 commented on Nov 5, 2026

    @dezren39
    MemberAuthor

    Companion issue: #5774 — the query-time parameter surface carries this issue's stage toggles (planner/spell off / deprioritized / on), variant selection, and hint override as per-query flags/fields.

  3. added
    queue/queued
    task/triage
    work/assigned
    queue/claimed
    status/in-progress
    and removed
    queue/queued
    on Nov 5, 2026
  4. dezren39 commented on Nov 5, 2026

    @dezren39
    MemberAuthor

    agent-note:v1

    • task: 10179
    • state: done (triaged)
    • lane: code-h (direct)

    Triage 2026-11-05 (task 10179): design is complete and self-contained; implementation is correctly gated on measurement infrastructure that is still open. No decision needed from Drew — the design commitments are already his (2026-11-04, per the issue body), and the open questions (planner model, rewrite count, provenance boost, stage ordering) are explicitly measurement-decided by #5741's harness, not taste calls.

    Dependency states verified fresh at triage (all OPEN unless noted):

    Scoped implementation order once #5741's harness exists:

    1. Spell correction first — classical mechanism (Damerau-Levenshtein candidates + char-trigram similarity over a corpus-vocabulary dictionary), no model choice to settle, and its shape-rule gates (error-pastes / code identifiers / quoted strings never corrected) are already specified.
    2. Planner/rewriter second — dual submission with provenance tags (raw-only / rewritten-only / both) through the Atlas search: Jaccard as a third signal (rescore + ingest dedup); SPLADE as a triggered follow-on #5733 rescore; planner model choice settled by the harness's latency/cache measurements.
    3. Ablations run per query class; any stage without measured gains stays off — that is the design's own acceptance shape.

    This issue stays open as the design record; it becomes actionable as a small_fix/implementation when #5741 closes.

  5. removed
    status/in-progress
    queue/claimed
    work/assigned
    on Nov 5, 2026
  6. dezren39 commented on Nov 8, 2026

    @dezren39
    MemberAuthor

    Partial verification — staying open (2026-11-07 done-task-only audit, tracking: #7016).

    Queue task(s) [10179] were marked done, and some work did land:

    No merged change closes this issue's full scope, so the done status is not treated as completion. Remainder re-queued as triage task 11751.

  7. 41 remaining items

  8. added
    status/blocked
    on Nov 13, 2026
  9. dezren39 commented on Nov 16, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · picked up — lane code-f, task 13019

  10. dezren39 commented on Nov 16, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · blocked (dependency) — lane code-f, task 13019

  11. dezren39 commented on Nov 17, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · triaged — duplicate of the standing triage; one dependency gate has since cleared

    • Agent: repo-worker-code (Muse lane any-l)
    • Session / ID: queue task 18369 (bulk-intake triage)

    This issue is already owned: fix task 13019 holds it, dep-blocked on 2026-11-16 (lane code-f) with the resume condition "#5774 + #5668 + #5733 close". That triage stands; this note only refreshes the gate state, verified fresh this run:

    Updated resume condition for task 13019: implement when #5774 and #5733 close (ordered slices per the existing packet: spell correction → planner/rewriter → ablation axes in #5741's harness; stages off by default without measured recall@10/MRR gain). No new packet created; no duplicate escalation. The status/blocked / queue/blocked labels on this issue remain accurate.

  12. removed their assignment
    on Nov 20, 2026
  13. developing-today-fleet commented on Nov 25, 2026

    @developing-today-fleet
    Contributor

    agent-note:v1
    Agent: felix (Muse lane, 2026-11-25)
    State: verified-blocked — graph hygiene audit #14863, slice 6

    Fresh gate check against the standing triage record (fix task 13019's resume condition: '#5774 + #5668 + #5733 close'):

    The remaining dependency was prose-only; a native blocked_by edge to #5774 has been added (verified via the dependencies API). status/blocked + queue/blocked stay correct while #5774 is open. Refs #14863

  14. added
    priority/normal
    kind/feature
    on Nov 29, 2026
  15. dezren39 commented on Nov 29, 2026

    @dezren39
    MemberAuthor

    🤖 Census note — 2026-11-29 (lane CEN-C04, full-census pass)

    Verdict: blocked on exactly one remaining gate. Rechecked firsthand. Original gates: #5774 + #5668 + #5733. Since then: #5668 CLEARED (closed 2026-11-17; cache slices #9941/#9942/#9943 landed) and #5733 CLEARED (closed). Sole blocker: #5774 (query-time parameter surface — Stage 2's toggles live there), still OPEN. A native blocked_by edge to #5774 is already in place. On #5774 closing, implement in order: spell correction → planner/rewriter with dual submission → ablation axes in the eval harness.

    Census actions: added labels priority/normal, kind/feature.

  16. developing-today-fleet commented on Nov 29, 2026

    @developing-today-fleet
    Contributor

    Census 2026-11-29 (Felix):

  17. added
    effort/m
    area/infra
    on Nov 29, 2026
  18. developing-today-fleet commented on Nov 29, 2026

    @developing-today-fleet
    Contributor

    Issue census — 2026-11-29

    Gaps found: no effort/* and no app//area/ label; no acceptance criteria section (the body has stage designs, hard exclusions, evaluation, and open questions).
    Strengths: pipeline order and toggleability are design commitments, not options (each stage independently off / deprioritized / on); the spell-correction mechanism is specified classically (Damerau–Levenshtein + trigram similarity) with its corpus-vocabulary source; parentage clear (#5741, #5733).
    Blocker recorded: the blocked labels stand — this front-end builds on the #5741 SPLADE/eval-harness line, and its own Evaluation section makes the harness the judge of both stages.
    Actions: added labels effort/m and area/infra; appended a ## Acceptance criteria section derived from the body's own commitments (original text untouched). Priority unchanged (normal).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/infraeffort/mepic/atlas-programkind/featurepriority/normalqueue/blockedstatus/blockedtask/fixwork/assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions