import { type ObservedVerificationCacheUpdate, type TreeIdentity } from "../verify/index.js"; import type { NodeAddress } from "../plan/index.js"; import { type InheritedValuesSnapshot } from "../verify/output.js"; import type { ObservationReport, StatusCacheDecode, StatusCacheDispatchEntry, StatusCacheDispatchSection, StatusCacheDispatchWriteResult, StatusCacheV1, StatusFinding, StatusGraph, StatusCacheVerificationEntry, StatusCacheVerificationWriteResult } from "./types.js"; export declare const STATUS_CACHE_VERSION: 1; export declare const STATUS_CACHE_DISPATCH_WRITE_MAX_ATTEMPTS: 8; export declare const STATUS_CACHE_READBACK_RESIDUAL: "readback-may-precede-later-overwrite"; export declare function sameTreeIdentity(left: TreeIdentity, right: TreeIdentity): boolean; /** Resolve a deterministic cache name alongside, never inside, the verified worktree. */ export declare function statusCachePath(worktreePath: string, specPath: string): string; export declare function emptyStatusCache(specPath: string): StatusCacheV1; /** Strictly decode JSON data. No decoded object is a trusted verification result. */ export declare function decodeStatusCache(value: unknown, sourcePath?: string): StatusCacheDecode; export interface ReadStatusCacheResult { readonly cache?: StatusCacheV1; readonly findings: readonly StatusFinding[]; } export declare function readStatusCache(cachePath: string): Promise; /** * Merge one dispatch hint into the sole derived cache. * * Every successful rename is read back before success is reported. A later * writer can still overwrite an entry after that observation; this is the * bounded read-back mechanism's named residual. */ export declare function writeDispatchCacheEntry(cachePath: string, specPath: string, worktreePath: string, entry: StatusCacheDispatchEntry): Promise; /** Persist only an observed, address-qualified verification result; serialized data never grants authority. */ export declare function writeVerificationCacheEntry(cachePath: string, specPath: string, worktreePath: string, entry: StatusCacheVerificationEntry): Promise; export interface ClassifiedCache { readonly observations: ReadonlyMap; readonly trusted: ReadonlyMap; readonly review: ReadonlyMap; readonly dispatch: StatusCacheDispatchSection; readonly findings: readonly StatusFinding[]; } /** Bind decoded observations to the current source, qualified address, and exact tree. */ export declare function classifyStatusCache(cache: StatusCacheV1 | undefined, graph: StatusGraph, tree: TreeIdentity, specPath: string, worktreePath: string, source?: string, inherited?: InheritedValuesSnapshot): ClassifiedCache; export declare function cacheEntry(update: ObservedVerificationCacheUpdate, address: NodeAddress): StatusCacheVerificationEntry;