/** * Query-time overlay of the files the index is behind on * (change: overlay-dirty-files-at-query-time). * * OpenLore already knows, per query, exactly which files the index has not caught up * with — it computes the stale set and discloses it — and then answers from the stale * index anyway. The disclosure is honest and inert: the symbols most likely to matter * are the ones the caller just edited. * * Re-extracting those files is bounded, cacheable work rather than a re-analysis: Pass-1 * extraction is a pure function of `(language, content)`, which is what makes the fact * cache sound and this overlay affordable. * * SCOPE, and the limit that comes with it: the overlay is SYMBOL-level. Re-reading a * file gives its own symbols, signatures and spans soundly. It does NOT re-resolve call * edges INTO those symbols from files outside the stale set — that is a whole-graph * operation and belongs to the watcher's incremental update. Callers of an overlaid * symbol therefore remain as the index recorded them, and every consumer discloses that * rather than implying otherwise. */ import type { FunctionNode } from './call-graph.js'; /** * Bounds. Exceeding any of them means "do exactly what we do today": answer from the * index and disclose the staleness. Keeping the worst case equal to the status quo is * what makes the overlay safe to run by default. */ export declare const OVERLAY_MAX_FILES = 25; export declare const OVERLAY_MAX_BYTES = 2000000; export declare const OVERLAY_TIME_BUDGET_MS = 750; /** Why an overlay produced nothing, or less than the whole stale set. */ export type OverlaySkipReason = 'no-stale-files' | 'too-many-files' | 'byte-budget-exceeded' | 'time-budget-exceeded'; export interface OverlayFileOutcome { filePath: string; status: 'overlaid' | 'unparsable' | 'unreadable' | 'unsupported-language'; } export interface WorkingTreeOverlay { /** Symbols read from the working tree, replacing the indexed rows for these files. */ nodes: FunctionNode[]; /** Files whose current contents were read and extracted. */ coveredFiles: string[]; /** Stale files still served from the index, with the reason each was not overlaid. */ uncoveredFiles: OverlayFileOutcome[]; /** Set when the overlay was skipped or truncated, naming why. */ skipped?: OverlaySkipReason; /** * Always true when any file was overlaid: incoming call edges are the index's, and a * consumer must say so rather than imply the answer is fully current. */ edgesFromIndex: boolean; } /** Test-only: clear the overlay memo so a test can observe a cold extraction. */ export declare function _resetOverlayMemoForTesting(): void; /** Test-only: how many distinct extractions the memo currently holds. */ export declare function _overlayMemoSizeForTesting(): number; /** * Re-extract the stale set from the working tree. * * Fails soft everywhere: an unreadable file, a file whose current contents do not parse, * and a language with no extractor are each reported as not overlaid, never raised. A * query must always be answerable. */ export declare function buildWorkingTreeOverlay(rootPath: string, staleFiles: readonly string[], options?: { now?: () => number; }): Promise; /** The disclosure a consumer attaches when it served an overlay. */ export interface OverlayDisclosure { overlaidFiles: string[]; /** Stale files still answered from the index. */ indexedFiles: string[]; skipped?: OverlaySkipReason; note: string; } export declare function buildOverlayDisclosure(overlay: WorkingTreeOverlay): OverlayDisclosure | undefined; //# sourceMappingURL=working-tree-overlay.d.ts.map