import { type ReflectionLayer } from "./config.js"; export type Evidence = "user-correction" | "repeated-process-failure" | "review-artifact-defect" | "retry-policy-violation"; export type EntryStatus = "active" | "promotable" | "promoted"; export interface ReflectionEntry { id: string; scope: string; trigger: string; cause: string; prevention: string; evidence: Evidence; evidenceRef: string; hits: number; firstSeen: string; lastSeen: string; status: EntryStatus; promotedRef?: string; promotedAtVersion?: string; } export interface ReflectionBucket { v: 1; updatedAt: string; entries: ReflectionEntry[]; } export interface ReflectionStoreOptions { now?: () => number; sleep?: (ms: number) => Promise; warn?: (code: string) => void; processAlive?: (pid: number) => boolean; } export declare class ReflectionError extends Error { readonly code: string; constructor(code: string); } export declare function normalizeField(value: unknown, max: number, scope?: boolean): string; export declare function estimateInjectionTokens(text: string): number; export declare class ReflectionStore { private readonly root; private readonly projectRoot; private readonly warned; private readonly now; private readonly sleep; private readonly warn; private readonly processAlive; constructor(root: string, projectRoot: string, options?: ReflectionStoreOptions); private file; private warning; private artifacts; private temps; private load; private validEntry; private owner; private live; private heartbeat; private acquire; private stale; private recoveryClaims; private recoverGuard; private recoverStale; cleanupStaleLocks(): Promise; private lock; private pathGuard; private releaseGuard; private withOwnership; private release; private save; read(layer: ReflectionLayer, run?: string, currentVersion?: string): Promise; private transaction; record(layer: ReflectionLayer, run: string | undefined, input: Record, currentVersion: string): Promise; list(layer: ReflectionLayer, run: string | undefined, currentVersion: string): Promise; replace(layer: ReflectionLayer, run: string | undefined, id: unknown, input: Record, currentVersion: string): Promise; forget(layer: ReflectionLayer, run: string | undefined, id: unknown, currentVersion: string): Promise; promote(layer: ReflectionLayer, run: string | undefined, id: string, ref: string, currentVersion: string): Promise; clear(layer: ReflectionLayer, run: string | undefined, confirmation: string, currentVersion: string): Promise; deleteRun(run: string): Promise; inject(layer: ReflectionLayer, run: string | undefined, max: number, tokenBudget: number, currentVersion: string): Promise; injectBuckets(buckets: readonly { layer: ReflectionLayer; run?: string; }[], max: number, tokenBudget: number, currentVersion?: string): Promise; }