/** * The live store's own bare legacy family as a reconcile source. * * A `cleo.db` from before consolidation can hold rows in bare tables * (`tasks`, `task_labels`, `sessions`, …) that the runtime no longer reads. * Two reconcile modes carry them into the prefixed tables: * * - full mode, while `tasks_tasks` is still EMPTY (the project never ran on * the consolidated store): every bare row (T12346); * - bare-strands mode (T13309), once `tasks_tasks` is populated: only bare * rows whose key the prefixed twin lacks, plus bare tasks whose id a * DIFFERENT live task took (renumbered by the caller). A row that is, or * refers to, a task the live store recorded as deleted is skipped and named, * never resurrected, and so is a row referring to a task neither side holds. * * @module * @task T12346 * @task T13309 */ import type { SupersededStoreBareAccount, SupersededStoreConflict } from '@cleocode/contracts'; import type { TargetResolver } from './runtime-targets.js'; import { type TaskIdRemapResult } from './task-id-remap.js'; import { type LegacyDbDescriptor } from './types.js'; /** * The live store's own dead bare task-core family as a reconcile source — item * 2 of T12319, found real by the T12346 sweep: a stranded `cleo.db` can hold * rows in bare tables the runtime no longer reads that exist in NO legacy file * (llmtxt: 1,972 `task_labels`; versionguard: 20 `task_dependencies`). * * Offered ONLY while the prefixed `tasks_tasks` is still empty — i.e. the * project never ran on the consolidated store. Once it has, a bare row missing * from the prefixed family may be one the runtime deliberately removed; the * bare-strands mode ({@link bareStrandSource}) handles that case. * * @returns The descriptor (path = the materialised file), or `null`. */ export declare function bareTaskCoreSource(liveStorePath: string, resolveTarget: TargetResolver, outDir: string): Promise; /** Result of {@link bareStrandSource}. */ export interface BareStrandSource { /** The materialised stranded rows, or `null` when none is left to copy. */ readonly source: LegacyDbDescriptor | null; /** Rows deliberately left uncopied, per table and reason. */ readonly skipped: SupersededStoreConflict[]; /** Every bare table with rows, as the run found it (recorded on success). */ readonly accounted: SupersededStoreBareAccount[]; /** `false` when the live task graph is empty: full mode's case, not this one. */ readonly populated: boolean; /** * The renumbering of bare tasks a different live task shadows, applied * BEFORE any row was judged present or skipped (T13333), so each row is * judged by the key it is copied under. Its `sources` is `source`. */ readonly remap: TaskIdRemapResult; /** * Every stranded row the run did NOT list in `skipped`, renumbered: the * rows it copies plus those it judged already present. Each must be in the * live store once the run is over, or the run is refused (T13333). * `null` when the live task graph is empty or no bare table holds rows. */ readonly accountingPath: string | null; } /** * The live store's stranded bare rows as a reconcile source (T13309): for a * project already running on the consolidated store, the bare rows whose key * the prefixed twin lacks, and the bare tasks a different live task shadows by * id (kept so the caller's renumbering recovers them). * * The shadowed tasks are renumbered first, with every reference re-pointed, * so a child row is judged by the key it is copied under, never by the key of * the live holder's child (T13333). An undecided collision is not renumbered: * the caller withholds the task graph. * * Skipped, and named in `skipped`: a row that is, or whose task reference * points at, a task the live store recorded as deleted (`tasks_audit_log` * action `task_deleted`), a row whose task reference neither the live store * nor the copy holds (`parent-absent`), and, to a fixed point, a row whose * task reference is a bare task this run skipped (`parent-skipped`, T13334). * A deletion record of a shadowed id, or of a fresh id a renumbering took, * belongs to another task and skips nothing. A table whose twin key the bare * table cannot produce keeps every row, and the post-copy verification judges * it. * * @param liveStorePath - The live project `cleo.db` (read only). * @param resolveTarget - Runtime target resolver. * @param outDir - Scratch directory for the materialised file. * @param cleoDir - The project's `.cleo`, where earlier receipts live. */ export declare function bareStrandSource(liveStorePath: string, resolveTarget: TargetResolver, outDir: string, cleoDir: string): Promise; /** * Task references in the copied strands source that the live store cannot * resolve after the copy: `table.column -> id` for each (T13334). Empty when * every reference a copied row carries names a live task. * * Only scalar references are judged. A JSON array of task ids (a session's * `tasks_completed_json`, `tasks_created_json`) is history: an id in it whose * task is gone is valid, as the runtime keeps it (deleting a task leaves it * listed) and the sync wire drops it rather than rejecting the row (T12798). * A copied session listing a deleted task is therefore copied (T13377). * * @param liveStorePath - The live project `cleo.db` (read only). * @param sourcePath - The strands source the run copied from. */ export declare function danglingStrandReferences(liveStorePath: string, sourcePath: string): string[]; //# sourceMappingURL=bare-family.d.ts.map