/** * The recoveries earlier reconciles made, read back from their receipts * (T13183). * * `cleo doctor superseded-store --reconcile` recovers a legacy task whose id a * newer task holds under a fresh id (T13172), and its receipt * (`.cleo/exodus-reconcile-/reconcile-receipt.json`) records each remap. * Later runs match on those records before they fall back to the title, so a * recovered task retitled since is still known as recovered, and * `cleo show ` can say where the legacy task went. * * The record lives in the receipt rather than in the synced display-id alias * table: an alias names a row by its uid, and row uids stay off by default * until their release gate passes (`CLEO_ROW_UID_FILL`, T12341). * * A leaf (filesystem and SQL text only), so the read-only survey and * `cleo show` use it without loading the store stack. * * @module * @task T13183 */ import type { DatabaseSync } from 'node:sqlite'; /** A legacy task an earlier reconcile recovered under a new id. */ export interface PriorRecovery { /** The legacy display id. */ readonly legacyId: string; /** The id the legacy task was recovered as. */ readonly newId: string; /** The receipt that records it. */ readonly receiptPath: string; /** The legacy creation time, when the receipt records it. */ readonly legacyCreatedAt: string | null; /** The legacy type, when the receipt records it. */ readonly legacyType: string | null; } /** * Every recovery recorded by a `reconciled` full-mode or bare-strands receipt * under `cleoDir`, oldest receipt first (receipt directories sort by their ISO * timestamp). * Unreadable or malformed receipts are skipped. * * @param cleoDir - The project's `.cleo` directory. * @returns The recoveries; empty when no receipt records one. * @example * ```ts * priorRecoveries('/p/.cleo'); // [{ legacyId: 'T001', newId: 'T004', receiptPath }] * ``` */ export declare function priorRecoveries(cleoDir: string): PriorRecovery[]; /** * Load `recoveries` into `temp.cleo_prior_recoveries` on `db`, where the * collision query reads them (later receipts rank first). * * @param db - The connection that runs the collision query. * @param recoveries - From {@link priorRecoveries}. * @example * ```ts * loadPriorRecoveries(db, priorRecoveries(cleoDir)); * ``` */ export declare function loadPriorRecoveries(db: DatabaseSync, recoveries: readonly PriorRecovery[]): void; /** * Whether the live store still holds `recovery`'s task as the recovered legacy * task: the new id exists, and, when the receipt records them, with the legacy * creation instant and type (the checks the collision query applies). * * @param db - The project `cleo.db` handle. * @param recovery - From {@link priorRecoveries}. * @returns `true` when the record can be trusted. * @example * ```ts * priorRecoveries(cleoDir).filter((r) => recoveryStands(db, r)); * ``` */ export declare function recoveryStands(db: DatabaseSync, recovery: PriorRecovery): boolean; //# sourceMappingURL=prior-recoveries.d.ts.map