Skip to content

fix(knowledge): recover short exact-name atoms without an ANN index - #2383

Draft
ohdearquant wants to merge 1 commit into
knowledge/search-score-provenancefrom
knowledge/search-exact-name-probe
Draft

fix(knowledge): recover short exact-name atoms without an ANN index#2383
ohdearquant wants to merge 1 commit into
knowledge/search-score-provenancefrom
knowledge/search-exact-name-probe

Conversation

@ohdearquant

Copy link
Copy Markdown
Owner

Recovers short exact-name atoms when no ANN index is available.

  • A raw query made only of short or stop-word terms probes for an exact-name atom before the lexical path; a hit is loaded as a candidate, a miss falls through, and an expired deadline reports as timed_out rather than as a miss.
  • The probe result is a closed enum (Hit, Miss, TimedOut) so a timeout is never mistaken for absence.
  • Tests cover the role-qualified arm and the expired-deadline arm.

Stacked on the score-provenance change; targets that branch until it merges.

A query where every token falls below the minimum scoreable length (e.g.
"AI") never reaches full-text search as anything but the raw phrase, and
the trigram tokenizer can't match a phrase that short either. That left
such atoms unreachable by knowledge.search unless an embedder and ANN
index were configured.

When the lexical stage finds nothing and no query token was scoreable,
probe the unique (namespace, slug) index with the query normalized
through the same slugification the pack's own import path already uses.
A hit reports candidate_provenance.lexical: "exact_name"; a read-deadline
expiry inside the probe degrades the same way any other lexical timeout
does, rather than surfacing as a miss.
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