/** * The one definition of a task-id collision between a legacy `tasks.db` and * the live `cleo.db` (T13172), shared by the reconcile (which renumbers them) * and the read-only `cleo doctor superseded-store` survey (which must never * call a file safe to archive while one of its tasks is only shadowed). * * Kept import-free so the survey can use it without loading the store stack. * * @module * @task T13172 */ /** * Legacy tasks whose id a live task with a different creation instant holds. * Run on the live store with the legacy file attached as `legacy`. * * Columns: * - `legacyId`, `legacyTitle`, `legacyCreatedAt`, `liveTitle`; * - `decision`: `collision` when both creation times parse and differ (a * different task), `undecided` when either does not parse (`julianday` is * NULL) and the raw values differ: the rows cannot be told apart, so the * reconcile reports them and never renumbers or duplicates; * - `recoveredAs`: for a `collision`, the live task an earlier run recovered * it as, else `NULL`. A candidate has the same title and creation instant * and an id that is NOT a legacy id (so it is not the legacy row's own copy * or another legacy task). Twins (same title and instant, however the * instant is spelled) are paired with candidates in id order, one to one, * so no candidate is claimed twice. * * A recovery an earlier run recorded (its receipt's remap, loaded into * `temp.cleo_prior_recoveries` by `loadPriorRecoveries`, T13183) wins over the * title match when the recorded task still exists with the legacy creation * instant and type, so a recovered task retitled since is still recognised (a * hand-edited receipt cannot aim a legacy id at an unrelated same-instant * task of another type), and its id leaves the candidate pool. * * A different title alone is the same task edited since the cutover. */ export declare const TASK_ID_COLLISIONS_SQL: string; /** * {@link TASK_ID_COLLISIONS_SQL} against any legacy task table: the live * store's own bare `tasks` (`main.tasks`, a partial strand, T13225) as well as * an attached legacy file's. * * @param legacyTasks - Schema-qualified legacy task table, e.g. `legacy.tasks`. */ export declare function taskIdCollisionsSql(legacyTasks: string): string; /** * The TEMP table {@link TASK_ID_COLLISIONS_SQL} reads earlier recoveries from. * Create it on the connection before running the query (empty is fine). */ export declare const PRIOR_RECOVERIES_TABLE_SQL = "CREATE TEMP TABLE IF NOT EXISTS cleo_prior_recoveries (\n seq INTEGER NOT NULL, legacy_id TEXT NOT NULL, new_id TEXT NOT NULL\n)"; //# sourceMappingURL=task-id-collision-sql.d.ts.map