/** * StateHashCache — reasoning cache keyed to the exact content hash of the files * a question depends on, instead of semantic similarity between questions. * * Unlike a fuzzy/vector cache, a hit here is only returned if every referenced * file's current sha256 matches the hash recorded when the answer was stored. * If any referenced file changed, it's a guaranteed MISS — no stale answers. * * Hashing is delegated to LocalFsResolver — the same primitive TheBrainV2 uses * for symbol/claim freshness — so there is exactly one "how do we hash a file" * implementation in the whole system, not two that can silently drift apart. * This module only owns the query-keyed lookup/store shape on top of it. */ export interface StateHashEntry { id: string; query: string; answer: string; fileHashes: Record; createdAt: number; hits: number; } /** * AN-19: state_hash_cache was advertised as "step 0 — look up before reasoning" but that was * pure prose, with nothing operational reminding the caller at the moment it matters — the * audit found 0 uses despite the documentation. `formatRecallNote` (workspaceShared.ts) * already proved the pattern that actually gets adoption for search_memory: attach a nudge to * an event that already happens (a file read), not to advisory text nobody re-reads. This is * the same idea for the exact-hash cache: which stored entries reference this file, so a * read_workspace_file caller can be told a matching cached answer might already exist. */ export declare function entriesForFile(projectRoot: string, filePath: string): StateHashEntry[]; export interface StateHashLookupResult { status: 'hit' | 'miss'; entry?: StateHashEntry; reason?: string; } /** Look up a cached answer. Only a hit if every referenced file's hash still matches. */ export declare function lookupStateHash(projectRoot: string, query: string, filePaths: string[]): StateHashLookupResult; /** Store an answer along with the exact hash of every file it depends on. */ export declare function storeStateHash(projectRoot: string, query: string, answer: string, filePaths: string[]): StateHashEntry; //# sourceMappingURL=StateHashCache.d.ts.map