/** * ADR Backfill Walker — T1829 * * One-time idempotent script that parses every `.cleo/adrs/*.md` (and the 9 * unique ADRs in `docs/adr/`) and creates a `brain_decisions` row for each one. * * ## Usage * * ```bash * # Dry-run (no writes): * node packages/core/dist/tools/adr-backfill-walker.js --dry-run * * # Apply (writes to brain.db): * node packages/core/dist/tools/adr-backfill-walker.js --apply * ``` * * ## Idempotency * * Rows are skipped when an existing `brain_decisions` row already has * `adrNumber` populated for that ADR number. The check is transactional: * `SELECT … WHERE adr_number = ?`. * * ## Collisions (ADR-051..054) * * The four ADR numbers 051–054 each have two conflicting files in two * different directories. This walker uses `.cleo/adrs/` as the canonical * SSoT (per Epsilon audit decision) and SKIPS the `docs/adr/` versions. * A note is written to the report for each skipped collision. * * ## Duplicates (ADR-031/033, ADR-032/034) * * ADR-033 duplicates ADR-031 and ADR-034 duplicates ADR-032. The first * number is kept as canonical; the second is inserted with * `supersededBy = ` and `confirmationState = 'superseded'`. * * @task T1829 * @epic T1824 */ interface WalkerResult { adrNumber: number; filename: string; filePath: string; action: 'inserted' | 'skipped-exists' | 'skipped-collision' | 'skipped-error'; note?: string; decisionId?: string; supersedureTo?: string; } /** * Main walker function. * * @param projectRoot - Absolute path to the project root. * @param dryRun - When true, no writes are performed. * @returns Array of results per ADR file processed. */ export declare function runAdrBackfillWalker(projectRoot: string, dryRun: boolean): Promise; export {}; //# sourceMappingURL=adr-backfill-walker.d.ts.map