/** * Serving a retrieval answer over the working tree, not only over the index * (change: overlay-dirty-files-at-query-time). * * The handler-level half of the overlay: given a ranked result set and the stale files * the freshness check already identified, re-read those files and reconcile the answer * with what is on disk — drop rows for symbols that no longer exist, and surface symbols * the index has never seen. * * SCOPE, stated because it is the interesting part: symbols added in a dirty file are * NOT ranked against the index's corpus. Ranking them would mean re-scoring the whole * BM25 corpus on the query path, and a fabricated score would be worse than none. They * are returned after the ranked rows, labelled with their provenance and with no score, * so a caller can tell "the ranker put this here" from "this exists on disk and matches * your terms". */ import { type OverlayDisclosure } from '../../analyzer/working-tree-overlay.js'; /** Find bounded working-tree candidates when the index has no symbol to cite. */ export declare function dirtySourcePaths(rootPath: string): Promise; export interface OverlayableResult { name: string; filePath: string; [key: string]: unknown; } export interface OverlayAddition { name: string; filePath: string; className?: string; startLine?: number; language: string; signature?: string; /** Provenance, not decoration: read from the working tree, never ranked. */ source: 'working-tree-overlay'; } export interface OverlayedAnswer { results: T[]; additions: OverlayAddition[]; /** Symbols dropped because the working tree no longer has them. */ removed: string[]; disclosure?: OverlayDisclosure; } /** * Reconcile a ranked answer with the working tree. * * Returns the answer unchanged when there is no stale set, when the overlay was skipped * for exceeding a bound, or when no stale file could be read — the fallback is always * exactly today's behavior. */ export declare function overlayResults(rootPath: string, query: string, results: readonly T[], staleFiles: readonly string[]): Promise>; //# sourceMappingURL=overlay-results.d.ts.map