/** * Cache invalidation per §6.2. * * v3: the catalog is content-keyed via three signals: * 1. language — adapter id; mismatch invalidates immediately. * 2. cacheKey — opaque per-adapter invalidation key; mismatch * invalidates (e.g. TS upgrade or tsconfig change). * 3. filesFingerprint — per-file mtime + size agreement; any source * file change re-runs stages 1+2. * * Per-file fingerprinting uses mtime + size to keep the cost low. * * Wave 4 layered an "incremental" verdict on top: when language + * cacheKey agree but some files have changed mtimes, the orchestrator * can re-walk only the changed files (plus their transitive edge- * dependents) instead of rebuilding everything. See `classifyCatalog` * and the orchestrator's incremental path. */ import type { Catalog } from '../types.js'; export interface ValidationContext { readonly currentLanguage: string; readonly currentCacheKey: string; readonly currentFiles: readonly string[]; } /** * Wave 4 verdict — three states: * - 'valid': cached catalog matches current file set on every axis; * orchestrator returns it untouched. * - 'incremental': language + cacheKey agree, but some files changed. * `changedFiles` lists the absolute paths whose cached entries * must be re-walked. Orchestrator builds the program over all * current files and only walks/resolves the changed set. * - 'invalid': structural mismatch (language, cacheKey, missing * fingerprint). Orchestrator does a full rebuild. */ export type CatalogVerdict = { readonly kind: 'valid'; } | { readonly kind: 'incremental'; readonly changedFiles: readonly string[]; } | { readonly kind: 'invalid'; readonly reason: string; }; export declare function classifyCatalog(cached: Catalog, ctx: ValidationContext): CatalogVerdict; /** * Compute a fingerprint over the project's source files. Uses mtime * (nanosecond resolution) per file plus the file count; cheap to * compute and stable for unchanged trees. */ export declare function computeFilesFingerprint(files: readonly string[]): string; /** * Diff two fingerprints (computed by `computeFilesFingerprint`) and * return the absolute file paths that differ. A file appears in the * result if it was added, removed, or had its mtime/size change. The * leading file-count line is ignored. Used by the incremental * rebuild path. */ export declare function diffFingerprints(cachedFingerprint: string, currentFingerprint: string): readonly string[]; //# sourceMappingURL=invalidate.d.ts.map