import { Deferral } from '../types.js'; /** * Storage for deferred decisions using markdown files with YAML frontmatter. * Each deferral is stored as a single file in .spec-workflow/deferrals/ * * The on-disk .md files are the SOURCE OF TRUTH — there is no separate index. * Reads scan the directory directly and tolerate frontmatter quoting variation * (double-quoted, single-quoted, or unquoted scalars) so files written by older * versions or by hand are never silently dropped. */ export declare class DeferralStorage { private deferralsDir; /** Titles with similarity >= this (within the same originSpec) are flagged as likely duplicates. */ static readonly DUPLICATE_THRESHOLD = 0.7; constructor(projectPath: string); private ensureDir; private generateId; private filePath; private serializeFrontmatter; private toMarkdown; /** Split a frontmatter block into a key -> raw-value map (top-level keys only). */ private static parseFrontmatter; /** Interpret a raw frontmatter value as a scalar, tolerating quoting variation. */ private static scalar; /** Interpret a raw frontmatter value as an inline array, tolerating quoting variation. */ private static arrayValue; private parseMarkdown; /** Distinguish a missing file from one that exists but cannot be parsed. */ private read; /** Load a deferral for a write operation, throwing actionable errors. */ private loadForWrite; private static normalizeTitle; /** Token-set Dice coefficient on normalized titles (0..1). */ static titleSimilarity(a: string, b: string): number; create(deferral: Omit, supersedes?: string): Promise; get(id: string): Promise; list(filters?: { status?: string; originSpec?: string; tag?: string; }): Promise; resolve(id: string, resolution: string, resolvedInSpec?: string): Promise; update(id: string, updates: { title?: string; revisitTrigger?: string; tags?: string[]; context?: string; decision?: string; revisitCriteria?: string; }): Promise; delete(id: string): Promise; /** * Fold a duplicate deferral (`fromId`) into a canonical one (`intoId`): * the duplicate is marked superseded by the canonical record, and the * canonical record absorbs the duplicate's tags. No data is deleted — the * superseded file is preserved with its full context. */ merge(fromId: string, intoId: string): Promise; /** * Find existing deferred deferrals with the same originSpec and a title * similar to the given one. Used to warn about likely duplicates on add. */ findDuplicates(title: string, originSpec: string | null, excludeId?: string): Promise>; /** * Cluster currently-deferred records into groups of likely duplicates * (same originSpec + high title similarity). Used by the dashboard. */ findDuplicateGroups(): Promise; }>>; /** * Rebuild the store from the on-disk files: re-serialize every parseable * deferral with canonical frontmatter (uniform quoting) while preserving the * body verbatim. Idempotent; safe to run on legacy stores after an upgrade. */ reindex(): Promise<{ total: number; rewritten: number; unparseable: string[]; }>; fileExists(id: string): Promise; } //# sourceMappingURL=deferral-storage.d.ts.map