/** * fold-legacy-register.ts, move the workspace register from the pre-split * location into the shared tier, once, without losing a row. * * ── The merge, and its tie-break ────────────────────────────────────────── * * Both halves of the document are keyed lists, so the merge is an id-keyed * union: `workspaces` keyed on `root` (already normalized, coverage flows down * that subtree, so the normalized path IS the identity), `declines` likewise. * * THE TIE-BREAK IS THE LATER `registeredAt`, and where they tie the destination * copy wins. Two reasons it is that and not something cleverer: * * - `registeredAt` is the only ordering the record carries. Preferring the * legacy copy wholesale would resurrect a stale label or origin; preferring * the shared copy wholesale would drop a registration made after an updated * product had already written the shared file. * - Field-wise merging is specifically WRONG for `checkpointEligible`. Its * own contract is "absent means false … one surface's self-recording must * never silently widen another consumer's checkpoint scope" (see * registration/types.ts), so OR-ing eligibility across two copies would * widen the automatic-checkpoint boundary behind the operator's back. Whole * records win or lose together. * * Idempotent: a second fold over the same pair produces the same document, so * re-running it on every boot is free. */ export interface FoldLegacyRegisterResult { /** Rows in the destination that were not there before this fold. */ readonly added: number; /** Rows the legacy copy replaced because its `registeredAt` was later. */ readonly updated: number; /** Total rows in the destination afterwards. */ readonly total: number; } /** * Fold `legacyPath` into `sharedPath`. Both may be absent; an absent legacy * file is a no-op, and an absent destination is created from the legacy rows. * The legacy file is NOT removed here, retiring it is the sweep's job, and it * only does so after this has succeeded. */ export declare function foldLegacyWorkspaceRegister(input: { readonly legacyPath: string; readonly sharedPath: string; }): Promise; //# sourceMappingURL=fold-legacy-register.d.ts.map