/** * 0.19.0-α.18 (closes #109 — migration gate in recon). * * Pre-brew structural gate. Reads the story's spec, extracts the * `proposals.schema.sql` block (if any), and checks that every table / * column the spec proposes is covered by at least one migration file * on disk. * * Why this gate matters: the rewo story-005 / story-006 incident class * — brew ships green tests against mocked DBs while the consumer's * `supabase/migrations/` (or `packages/postgres/src/migrations/`) * never gets the matching DDL. Test-time green; production-time broken. * * Pure structural check. No LLM. Sees both Supabase SQL (`*.sql`) and * TypeORM TS (`*.ts`) migrations via `scanMigrations`'s auto-discovery. * * Wiring: `recon` calls `checkMigrationGate` after the per-test * structural checks; emitted gaps share the `missing_migration` kind so * they roll up into the same `escalate` exit path that already exists. */ import { type MigrationEntry } from "../refine/history-index.js"; export interface MigrationGap { /** Source location pointer (which spec section flagged this). */ source: string; /** Table the spec proposes. */ table: string; /** Columns the spec proposes that are not covered by any migration. */ missing_columns: string[]; /** Whether the table itself is uncovered (no migration creates it at all). */ table_missing: boolean; } export interface MigrationGateResult { /** True if the spec touches schema at all (proposals.schema.sql present + non-empty). */ spec_proposes_schema: boolean; /** Total migration files scanned (across all auto-discovered dirs). */ migrations_scanned: number; /** Per-table gaps. Empty array → gate is clean. */ gaps: MigrationGap[]; /** Diagnostic notes (e.g., "spec not found", "no schema proposal"). */ notes: string[]; } /** * Run the gate. `migrationsOverride` is for tests / explicit-dir callers; * normal callers pass undefined and let the scanner auto-discover. * * Returns a structured result even when there are no gaps so callers can * log how much was scanned. `gaps.length === 0` is the clean signal. */ export declare function checkMigrationGate(repoRoot: string, storyId: string, migrationsOverride?: MigrationEntry[]): MigrationGateResult; /** * Render a single migration gap into recon's `detail` + `recommendation` * shape. Pulled out as its own helper so the recon entry point and tests * can both consume it. */ export declare function formatMigrationGap(g: MigrationGap): { detail: string; recommendation: string; }; //# sourceMappingURL=migration-gate.d.ts.map