/** * Deterministic reranker over the fused top-50 * (docs/hybrid-retrieval-design.md, step 7 of the shipping order). * * The eval gate showed fused Recall@50 well above Recall@5/10 — the right * candidates survive fusion but sit too deep. This reranker re-orders them * using evidence that is only cheap to compute *after* fusion, when there * are ≤50 candidates instead of thousands of lines: * * - term coverage: how many distinct query terms appear in the candidate's * actual expanded window (read from disk); * - path affinity: query terms appearing in the candidate's file path — * this is what lets a query like `core/search/hybrid-search.ts` rank the * file itself first, which content grep alone cannot do; * - fused prior: the RRF ordering, so retriever consensus still counts. * * Not every signal suits every query. A query that names something and a query * that describes behaviour want different evidence, so the name-matching * signal is gated on {@link queryIsProse} — see its comment for the numbers. * * Purely lexical-statistical and deterministic — no model, no I/O beyond * reading candidate windows. A cross-encoder can later replace the scoring * function behind the same signature; that model work belongs to * `kolisachint/embeddingsearchtools`, not here. */ import type { FusedCandidate } from "./types.js"; /** * Is `query` a sentence rather than a name? * * A quoted segment is never prose regardless of its words: the plan collapses * it to one literal term, so the declaration bonus cannot fire on it anyway, * and its path-token split is what lets `"Theme not initialized…"` find * `core/theme.ts`. */ export declare function queryIsProse(query: string): boolean; export interface RerankResult { candidates: FusedCandidate[]; latencyMs: number; } /** * The exact source text each candidate stands for, as the model should see it. * * Shared with the cross-encoder path so both rerankers score identical text — * otherwise a comparison between them would partly measure which one got a * better view of the candidate. */ export declare function readCandidateWindows(candidates: readonly FusedCandidate[], cwd: string): Array; export declare function rerankCandidates(query: string, candidates: readonly FusedCandidate[], cwd: string): RerankResult; //# sourceMappingURL=rerank.d.ts.map