import type { CortexStore, ParsedMemoryItem, ParsedMemoryReference } from '../db/store.js'; export interface MovedReference { from: string; to: string; } export interface MemoryReferenceValidation { references: ParsedMemoryReference[]; exists: number; missing: number; moved: number; unknown: number; external: number; stale: boolean; missingReferences: string[]; movedReferences: MovedReference[]; label: string | null; } export interface ReferenceValidatorOptions { /** Overrides `os.homedir()` when expanding home-relative references. */ homeDir?: string | null; } /** * Validates memory references against the current checkout with caching that * holds for one retrieval pass: app graphs become Sets, filesystem checks and * rename lookups are memoized, and status updates are queued for a single * batched flush instead of one write per candidate. */ export declare class ReferenceValidator { private readonly store; private readonly graphCache; private readonly pathExistsCache; private readonly renameCache; private readonly worktreeCache; private readonly itemCache; private pendingUpdates; private readonly checkedAt; private readonly homeDir; constructor(store: CortexStore, options?: ReferenceValidatorOptions); validate(item: ParsedMemoryItem): MemoryReferenceValidation; /** Persist queued status changes in one transaction. Safe to call repeatedly. */ flush(): void; private resolveStatus; private scopeEntry; private pathExists; private resolveRename; private resolveWorktree; } /** One-shot validation with immediate flush; prefer ReferenceValidator for batch passes. */ export declare function validateMemoryReferences(store: CortexStore, item: ParsedMemoryItem, options?: ReferenceValidatorOptions): MemoryReferenceValidation; /** * Score current-truth validity for retrieval ranking. Missing references * demote with a graduated, capped penalty so stale memory stays reachable and * labeled instead of buried; moved references count as locatable. */ export declare function referenceValidationScore(validation: MemoryReferenceValidation, historicalIntent: boolean): number; //# sourceMappingURL=reference-validation.d.ts.map