/** * Cross-encoder reranking via the embsearch daemon. * * The deterministic reranker in `rerank.ts` scores candidates with lexical * evidence — term coverage, path affinity, whether the window declares a query * term. That took Recall@1 from 0.10 to 0.24 and then stopped paying: a * term-proximity signal aimed at the classes it still handles worst moved * nothing (p = 1.00 on every metric). * * What is left is a ranking problem the lexical view cannot see. Across the * 62-query gold set the right span reaches the fused top-50 far more often * than the top-10, so the candidates are in hand and merely ordered badly. A * cross-encoder reads the query and the candidate *together*, which is exactly * the evidence term counting lacks. * * It is also far more expensive — one model pass per candidate, with no * precomputation possible — so it runs over a shortlist and its depth is * capped separately from the fused window. */ import type { EmbsearchService } from "../embsearch/embsearch-service.js"; import type { FusedCandidate } from "./types.js"; /** * Candidates sent to the cross-encoder per query. * * Each one is a model pass, so this is a latency dial, not a quality dial: * every candidate past here keeps its fused order rather than being scored. */ export declare const CROSS_ENCODER_DEPTH = 30; export interface CrossRerankResult { candidates: FusedCandidate[]; latencyMs: number; /** How many candidates the model actually scored. */ scored: number; } /** * Reorder `candidates` by cross-encoder relevance. * * Only the first {@link CROSS_ENCODER_DEPTH} are scored; the remainder keep * their incoming order and follow. Candidates whose window cannot be read are * left unscored for the same reason — there is no text to give the model, and * inventing one would score a fiction. */ export declare function crossEncoderRerank(query: string, candidates: readonly FusedCandidate[], cwd: string, service: EmbsearchService): Promise; //# sourceMappingURL=cross-rerank.d.ts.map