/** * Default floor for the search top-N, on the [0,1]-normalized score the * caller sees in `relevance_score`. Tuned against the A1 fixture: the * near-zero tail (0.0097 / 0.0003) drops, on-topic results (post-rerank-fold * tier-1 ≥ 0.5, or strong tier-0) stay. Low enough that the keyless * deterministic path (min normalized score ~0.13 in practice) is untouched — * the floor only bites the reranker's tier-0 near-zero band. */ export declare const DEFAULT_SEARCH_SCORE_FLOOR = 0.05; export interface ScoreFloorResult { kept: T[]; dropped: T[]; } export interface ScoreFloorOptions { /** * Per-engine keep guarantee. When set (>0), any contributing engine that the * query-wide floor would otherwise floor out ENTIRELY (kept-0) keeps up to * this many of its highest-scored results. Guards the cross-engine keep from * being like-unlike: a dominant vertical whose pages share the query's * doc-phrase tokens (high lexical alignment) scores high and monopolises the * kept set, while a general engine's correct-entity results score low on that * same lexical axis and fall below the query-wide floor. The guarantee keys * on `engine` PER-RESULT and only rescues engines with no above-floor * survivor, so an engine already represented above the floor is never given a * second below-floor slot. Budget-bounded to `perEngineKeep` rescues per * engine so a floored engine can't refill the whole slice with junk. * * The rescue is ALSO gated on a minimum relevance: an engine's best * below-floor result is only rescued when it is plausibly-relevant-just- * below-floor, i.e. `best >= floor * RESCUE_MIN_FLOOR_FRACTION`. An engine * that returned only genuine far-below-floor junk stays dropped — on the * fast/none path there is no rerank guard to damp junk first, so the floor's * own rescue must refuse it. */ perEngineKeep?: number; /** * Set when the engine pool degraded during this dispatch (all-but-one engine * down under burst). Combined with `lexicalAlignmentOf`, it withdraws both the * top-1 exemption AND the per-engine rescue from a ZERO-lexical result — the * live-incident junk shape where a lone degraded survivor returns an off-topic * page that shares no query token. A pool that is entirely zero-lexical under * degradation therefore returns EMPTY rather than surfacing junk as the top * answer. Inert without `lexicalAlignmentOf` (fails open) and inert on a * healthy pool (`degraded` unset/false) — never a query-wide floor change. */ degraded?: boolean; /** * Per-result lexical-alignment accessor. Supplies the [0,1] query/text overlap * signal the degraded gate keys on, without coupling this pure module to the * RawSearchResult shape (the caller reads it from * `evidence_score.components.lexical_alignment`). Only consulted when * `degraded` is true. */ lexicalAlignmentOf?: (r: T) => number; } /** * Partition a ranked result set by a relevance-score floor. * * - `floor <= 0` is a no-op: everything is kept (preserves legacy behaviour * when no floor is configured). * - The single highest-scored result is ALWAYS kept, even if it sits below the * floor — returning nothing is worse than returning the best candidate when * the reranker has damped every result into the junk band. * - Input order is preserved in both `kept` and `dropped` (the caller already * ranked the set; this only trims). * - `opts.perEngineKeep` adds the cross-engine keep guarantee described on * `ScoreFloorOptions`. * * The "always keep the top" guard keys off the maximum score, not array * position, so it is correct even if the caller hands an unsorted set. */ export declare function applyScoreFloor(results: T[], floor: number, opts?: ScoreFloorOptions): ScoreFloorResult; //# sourceMappingURL=score-floor.d.ts.map