/** * WorkGraph scaffold apply engine — applies validated scaffold proposals to storage. * * Takes a validated scaffold proposal (saga/epic/tasks + edges/relations) and * writes them to the SQLite database in a single transaction. Idempotent — * re-applying the same scaffold does not create duplicates. * * @task T10633 * @saga T10538 * @epic T10547 */ import type { WorkGraphScaffoldApplyParams, WorkGraphScaffoldApplyResult } from '@cleocode/contracts'; /** Stable error code for apply failures where the scaffold is invalid. */ export declare const E_WORKGRAPH_SCAFFOLD_APPLY_INVALID = "E_WORKGRAPH_SCAFFOLD_APPLY_INVALID"; /** Stable error code for apply failures where a referenced parent does not exist. */ export declare const E_WORKGRAPH_SCAFFOLD_APPLY_MISSING_PARENT = "E_WORKGRAPH_SCAFFOLD_APPLY_MISSING_PARENT"; /** Stable error code for apply failures where the database is not initialized. */ export declare const E_WORKGRAPH_SCAFFOLD_APPLY_NO_DB = "E_WORKGRAPH_SCAFFOLD_APPLY_NO_DB"; /** * Apply a validated WorkGraph scaffold proposal to storage. * * Runs validation first using {@link validateWorkGraphScaffold}. When the * scaffold is valid and `params.apply` is `true`, all nodes and edges are * written to the database inside a single transaction. * * **AC1 — transactional**: all writes succeed or none do. If any insert * fails, the entire transaction is rolled back. * * **AC2 — idempotency**: uses `ON CONFLICT DO NOTHING` for task, dependency, * and relation inserts. Re-applying the same scaffold produces the same * result without duplicates. * * **AC3 — docs and relations created consistently**: all task rows (docs) * and their dependency/relation edges are written in the same atomic * transaction, so consumers never see a partially-applied scaffold. * * @param params - Scaffold payload to apply. Must include `apply: true` to * perform writes; omit or set `false` for dry-run preview. * @returns Structured apply result with validity, applied status, and change * counts. */ export declare function applyWorkGraphScaffold(params: WorkGraphScaffoldApplyParams): Promise; //# sourceMappingURL=scaffold-apply.d.ts.map