@cat-factory/node-server 0.90.10 → 0.91.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,14 @@
1
1
  import { Pool } from 'pg';
2
- declare function makeDbClient(connectionString: string): {
2
+ /** The default Postgres schema the app's (unqualified) tables live in. */
3
+ export declare const DEFAULT_DB_SCHEMA = "public";
4
+ /** The default schema for the drizzle migration ledger (`__drizzle_migrations`). */
5
+ export declare const DEFAULT_MIGRATIONS_SCHEMA = "drizzle";
6
+ /**
7
+ * Validate + normalise a configured schema name, falling back to `fallback` when unset.
8
+ * `label` names the env var in the error so a bad value is actionable.
9
+ */
10
+ export declare function resolveDbSchema(schema: string | undefined, fallback?: string, label?: string): string;
11
+ declare function makeDbClient(connectionString: string, schema?: string): {
3
12
  db: import("drizzle-orm/node-postgres").NodePgDatabase<import("drizzle-orm").EmptyRelations> & {
4
13
  $client: Pool;
5
14
  };
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/db/client.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,IAAI,CAAA;AAKzB,iBAAS,YAAY,CAAC,gBAAgB,EAAE,MAAM;;;;;EAY7C;AAED,mFAAmF;AACnF,MAAM,MAAM,QAAQ,GAAG,UAAU,CAAC,OAAO,YAAY,CAAC,CAAA;AACtD,MAAM,MAAM,SAAS,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAA;AAEtC,eAAO,MAAM,cAAc,qBAAe,CAAA"}
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/db/client.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,IAAI,CAAA;AAEzB,0EAA0E;AAC1E,eAAO,MAAM,iBAAiB,WAAW,CAAA;AACzC,oFAAoF;AACpF,eAAO,MAAM,yBAAyB,YAAY,CAAA;AAWlD;;;GAGG;AACH,wBAAgB,eAAe,CAC7B,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,QAAQ,GAAE,MAA0B,EACpC,KAAK,SAAc,GAClB,MAAM,CASR;AAWD,iBAAS,YAAY,CAAC,gBAAgB,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM;;;;;EAqB9D;AAED,mFAAmF;AACnF,MAAM,MAAM,QAAQ,GAAG,UAAU,CAAC,OAAO,YAAY,CAAC,CAAA;AACtD,MAAM,MAAM,SAAS,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAA;AAEtC,eAAO,MAAM,cAAc,qBAAe,CAAA"}
package/dist/db/client.js CHANGED
@@ -1,11 +1,51 @@
1
1
  import { logger } from '@cat-factory/server';
2
2
  import { drizzle } from 'drizzle-orm/node-postgres';
3
3
  import { Pool } from 'pg';
4
+ /** The default Postgres schema the app's (unqualified) tables live in. */
5
+ export const DEFAULT_DB_SCHEMA = 'public';
6
+ /** The default schema for the drizzle migration ledger (`__drizzle_migrations`). */
7
+ export const DEFAULT_MIGRATIONS_SCHEMA = 'drizzle';
8
+ // Postgres identifier guard for the configurable schemas. Schema names are interpolated into
9
+ // SQL that is NOT parameterizable (the libpq `options=-c search_path=…` connection string and
10
+ // `CREATE SCHEMA`/`to_regclass` DDL), so we restrict them to a plain identifier to keep them
11
+ // injection-safe. Lowercase only, deliberately: we quote the name in `CREATE SCHEMA "x"` (case
12
+ // preserving) but the libpq `search_path` option is unquoted (Postgres folds it to lowercase),
13
+ // so a mixed-case name would create one schema and point the connection at a differently-cased
14
+ // one. Restricting to lowercase keeps the two in step. (Mirrored in scripts/db-reset.mjs.)
15
+ const SCHEMA_IDENTIFIER = /^[a-z_][a-z0-9_]*$/;
16
+ /**
17
+ * Validate + normalise a configured schema name, falling back to `fallback` when unset.
18
+ * `label` names the env var in the error so a bad value is actionable.
19
+ */
20
+ export function resolveDbSchema(schema, fallback = DEFAULT_DB_SCHEMA, label = 'DB_SCHEMA') {
21
+ const value = schema?.trim();
22
+ if (!value)
23
+ return fallback;
24
+ if (!SCHEMA_IDENTIFIER.test(value)) {
25
+ throw new Error(`Invalid ${label} "${value}": must be a plain lowercase Postgres identifier ([a-z_][a-z0-9_]*).`);
26
+ }
27
+ return value;
28
+ }
4
29
  // Create a Drizzle client over a node-postgres pool. We use only the core query
5
30
  // builder (db.select().from(table)), not the relational query API, so no `schema`
6
31
  // option is passed (that's only needed for db.query.* in drizzle 1.0).
7
- function makeDbClient(connectionString) {
8
- const pool = new Pool({ connectionString });
32
+ //
33
+ // When `schema` is a non-default value, every connection in the pool is opened with its
34
+ // `search_path` set to it, so the unqualified table refs the app + migrations use resolve
35
+ // there instead of `public` — the seam for deployments where the `public` schema is
36
+ // unavailable. The explicitly-namespaced schemas (`telemetry`/`sandbox`/`provisioning`) are
37
+ // always qualified, so they are unaffected.
38
+ function makeDbClient(connectionString, schema) {
39
+ const resolved = resolveDbSchema(schema);
40
+ const pool = new Pool({
41
+ connectionString,
42
+ // Only override search_path off the default: a stock `public` deployment keeps the exact
43
+ // prior behaviour (no connection options set). We keep `public` on the path as a fallback so
44
+ // shared objects (extensions, types installed there) still resolve; a non-existent `public`
45
+ // in search_path is silently ignored by Postgres, so this is safe even where `public` was the
46
+ // reason to relocate. `resolved` is first, so the migrator's unqualified CREATEs land there.
47
+ ...(resolved === DEFAULT_DB_SCHEMA ? {} : { options: `-c search_path=${resolved},public` }),
48
+ });
9
49
  // node-postgres emits 'error' on an IDLE client when the backend drops the
10
50
  // connection (Postgres restart, failover, idle timeout). An unhandled 'error' on
11
51
  // the pool's EventEmitter would throw and crash the whole process — defeating the
@@ -1 +1 @@
1
- {"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/db/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAA;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,IAAI,CAAA;AAEzB,gFAAgF;AAChF,kFAAk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  import type { Pool } from 'pg';
2
- import type { DrizzleDb } from './client.js';
2
+ import { type DrizzleDb } from './client.js';
3
+ /**
4
+ * The database's recorded migration history disagrees with its actual schema: the migrator
5
+ * ledger says migrations were applied, but the tables they create are missing. This is the
6
+ * classic drizzle-kit 1.0 footgun — the ledger lives in the `drizzle` schema, so dropping
7
+ * `public` (a hand `DROP SCHEMA public CASCADE`, a stray test run) leaves the ledger behind
8
+ * claiming everything is current. `migrate()` then tries to apply the next migration onto
9
+ * tables that no longer exist and dies with an opaque `42P01`. We detect it up front and
10
+ * fail with an actionable message instead.
11
+ */
12
+ export declare class DbSchemaInconsistentError extends Error {
13
+ constructor(message: string);
14
+ }
15
+ /** A migration failed to apply. Wraps the raw driver error with a human cause + recovery hint. */
16
+ export declare class MigrationFailedError extends Error {
17
+ readonly code: string | undefined;
18
+ constructor(message: string, options: {
19
+ cause: unknown;
20
+ code: string | undefined;
21
+ });
22
+ }
23
+ /**
24
+ * Turn a raw migration failure into a `MigrationFailedError` with a mapped, actionable cause.
25
+ * Exported for unit testing the code→message mapping without a live database.
26
+ */
27
+ export declare function explainMigrationFailure(err: unknown): MigrationFailedError;
3
28
  /**
4
29
  * Run any pending migrations. Safe to call on every boot, including concurrently from
5
30
  * multiple replicas: a session-level advisory lock (held on a dedicated connection for
@@ -7,6 +32,22 @@ import type { DrizzleDb } from './client.js';
7
32
  * at once can't both try to create the same objects and collide. The migrator is
8
33
  * idempotent against its `__drizzle_migrations` ledger, so the loser of the lock race
9
34
  * simply finds nothing to apply.
35
+ *
36
+ * Before applying, we ensure the configured schema exists (so a non-`public` deployment can
37
+ * boot against an empty database — the `search_path`-relocated tables land there), probe for
38
+ * the ledger↔schema split (see {@link assertSchemaConsistent}), and, on any apply failure,
39
+ * rethrow a {@link MigrationFailedError} whose message names the likely cause and the recovery
40
+ * path — so a wedged DB reports what to do instead of a bare Postgres error deep inside an
41
+ * `ALTER TABLE`.
42
+ *
43
+ * `opts.schema` (default `public`, the deployment's `DB_SCHEMA`) is where the unqualified app
44
+ * tables live; `opts.migrationsSchema` (default `drizzle`, the deployment's
45
+ * `DB_MIGRATIONS_SCHEMA`) is where the migration ledger lives — set it to a service-dedicated
46
+ * name on a SHARED database so cat-factory's ledger can't collide with another drizzle-using
47
+ * service's `drizzle.__drizzle_migrations`. The migrator creates the migrations schema itself.
10
48
  */
11
- export declare function migrate(db: DrizzleDb, pool: Pool): Promise<void>;
49
+ export declare function migrate(db: DrizzleDb, pool: Pool, opts?: {
50
+ schema?: string;
51
+ migrationsSchema?: string;
52
+ }): Promise<void>;
12
53
  //# sourceMappingURL=migrate.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"migrate.d.ts","sourceRoot":"","sources":["../../src/db/migrate.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,IAAI,CAAA;AAC9B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAkB5C;;;;;;;GAOG;AACH,wBAAsB,OAAO,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAYtE"}
1
+ {"version":3,"file":"migrate.d.ts","sourceRoot":"","sources":["../../src/db/migrate.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,IAAI,CAAA;AAC9B,OAAO,EAGL,KAAK,SAAS,EAEf,MAAM,aAAa,CAAA;AAsCpB;;;;;;;;GAQG;AACH,qBAAa,yBAA0B,SAAQ,KAAK;IAClD,YAAY,OAAO,EAAE,MAAM,EAG1B;CACF;AAED,kGAAkG;AAClG,qBAAa,oBAAqB,SAAQ,KAAK;IAC7C,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAAA;IACjC,YAAY,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE;QAAE,KAAK,EAAE,OAAO,CAAC;QAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAAA;KAAE,EAIjF;CACF;AAsDD;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,OAAO,GAAG,oBAAoB,CA4B1E;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAsB,OAAO,CAC3B,EAAE,EAAE,SAAS,EACb,IAAI,EAAE,IAAI,EACV,IAAI,GAAE;IAAE,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,gBAAgB,CAAC,EAAE,MAAM,CAAA;CAAO,GACxD,OAAO,CAAC,IAAI,CAAC,CA6Bf"}
@@ -1,5 +1,6 @@
1
1
  import { fileURLToPath } from 'node:url';
2
2
  import { migrate as drizzleMigrate } from 'drizzle-orm/node-postgres/migrator';
3
+ import { DEFAULT_DB_SCHEMA, DEFAULT_MIGRATIONS_SCHEMA, resolveDbSchema, } from './client.js';
3
4
  // Apply the drizzle-kit migration lineage in `../drizzle` on boot. The schema's single
4
5
  // source of truth is `./schema.ts`; `pnpm db:generate` diffs it and emits the next SQL
5
6
  // migration there. The drizzle migrator records applied migrations in its own
@@ -14,6 +15,109 @@ import { migrate as drizzleMigrate } from 'drizzle-orm/node-postgres/migrator';
14
15
  const migrationsFolder = fileURLToPath(new URL('../../drizzle', import.meta.url));
15
16
  // A fixed key for the advisory lock that serialises concurrent boots (see migrate).
16
17
  const MIGRATION_LOCK_KEY = 776_712_001;
18
+ // The drizzle-kit 1.0 migrator records applied migrations in the `__drizzle_migrations` table
19
+ // of its migrations schema (configurable via `migrationsSchema`, default `drizzle` — NOT
20
+ // `public`). Crucially, dropping the app schema (a hand `DROP SCHEMA … CASCADE`, a stray test
21
+ // run) leaves this ledger intact, so the ledger can outlive the very tables it claims to have
22
+ // created — see `assertSchemaConsistent`.
23
+ const ledgerRef = (migrationsSchema) => `"${migrationsSchema}"."__drizzle_migrations"`;
24
+ // Tables that MUST exist once the baseline migration is recorded as applied. If the ledger
25
+ // is non-empty but these are gone, the database is in the split state described above and
26
+ // cannot be migrated forward (the next `ALTER TABLE`/FK migration would fail with a bare
27
+ // `42P01`). We probe a couple of stable, early-created anchors rather than the full set. They
28
+ // are qualified with the configured schema (default `public`) since they are the tables the
29
+ // `search_path`-relocated default schema holds.
30
+ const ANCHOR_TABLES = ['accounts', 'workspaces'];
31
+ const RESET_HINT = 'Recover with `pnpm --filter @cat-factory/node-server db:reset` ' +
32
+ '(experimental installs only — this DROPS ALL DATA), then restart.';
33
+ /**
34
+ * The database's recorded migration history disagrees with its actual schema: the migrator
35
+ * ledger says migrations were applied, but the tables they create are missing. This is the
36
+ * classic drizzle-kit 1.0 footgun — the ledger lives in the `drizzle` schema, so dropping
37
+ * `public` (a hand `DROP SCHEMA public CASCADE`, a stray test run) leaves the ledger behind
38
+ * claiming everything is current. `migrate()` then tries to apply the next migration onto
39
+ * tables that no longer exist and dies with an opaque `42P01`. We detect it up front and
40
+ * fail with an actionable message instead.
41
+ */
42
+ export class DbSchemaInconsistentError extends Error {
43
+ constructor(message) {
44
+ super(message);
45
+ this.name = 'DbSchemaInconsistentError';
46
+ }
47
+ }
48
+ /** A migration failed to apply. Wraps the raw driver error with a human cause + recovery hint. */
49
+ export class MigrationFailedError extends Error {
50
+ code;
51
+ constructor(message, options) {
52
+ super(message, { cause: options.cause });
53
+ this.name = 'MigrationFailedError';
54
+ this.code = options.code;
55
+ }
56
+ }
57
+ function asPgError(err) {
58
+ // node-postgres surfaces the driver error as the `cause` of drizzle's wrapper; fall back
59
+ // to the error itself so we read the pg code/detail whichever layer carries it.
60
+ const cause = err?.cause;
61
+ const candidate = (cause && typeof cause === 'object' ? cause : err);
62
+ return candidate ?? {};
63
+ }
64
+ /**
65
+ * Guard against the ledger↔schema split BEFORE handing off to the migrator. Skips silently
66
+ * on a fresh database (no ledger table, or an empty ledger) — there is nothing to apply
67
+ * onto yet, so a missing `<schema>.accounts` is expected and the migrator will create it. The
68
+ * anchors are probed in the configured schema (default `public`) — the schema the
69
+ * `search_path`-relocated default tables live in.
70
+ */
71
+ async function assertSchemaConsistent(pool, schema, migrationsSchema) {
72
+ const ledger = ledgerRef(migrationsSchema);
73
+ const ledgerExists = await pool.query(`SELECT to_regclass('${ledger}') AS reg`);
74
+ if (!ledgerExists.rows[0]?.reg)
75
+ return; // fresh DB: migrator will bootstrap the ledger + tables
76
+ const { rows } = await pool.query(`SELECT count(*)::int AS n FROM ${ledger}`);
77
+ const applied = rows[0]?.n ?? 0;
78
+ if (applied === 0)
79
+ return; // ledger present but empty — still a clean slate
80
+ const qualified = ANCHOR_TABLES.map((t) => `${schema}.${t}`);
81
+ const anchors = await pool.query(`SELECT ${qualified.map((t, i) => `to_regclass($${i + 1}) AS a${i}`).join(', ')}`, qualified);
82
+ const missing = qualified.filter((_, i) => !anchors.rows[0]?.[`a${i}`]);
83
+ if (missing.length === 0)
84
+ return;
85
+ throw new DbSchemaInconsistentError(`Database is inconsistent: the migration ledger (${ledger}) records ${applied} applied ` +
86
+ `migration(s) but expected table(s) ${missing.join(', ')} are missing. This usually means ` +
87
+ `the ledger's own schema survived a \`DROP SCHEMA … CASCADE\` (or a stray test run), ` +
88
+ `leaving the recorded history ahead of the actual schema. The database cannot be migrated ` +
89
+ `forward in this state. ${RESET_HINT}`);
90
+ }
91
+ /**
92
+ * Turn a raw migration failure into a `MigrationFailedError` with a mapped, actionable cause.
93
+ * Exported for unit testing the code→message mapping without a live database.
94
+ */
95
+ export function explainMigrationFailure(err) {
96
+ const pg = asPgError(err);
97
+ const where = pg.where ? ` (at: ${pg.where})` : '';
98
+ let cause;
99
+ switch (pg.code) {
100
+ case '42P01': // undefined_table
101
+ cause =
102
+ `a migration referenced a table that does not exist (${pg.message ?? 'undefined table'}). ` +
103
+ `The migration ledger is ahead of the actual schema — a partial or manual reset. ${RESET_HINT}`;
104
+ break;
105
+ case '23503': // foreign_key_violation
106
+ cause =
107
+ `existing rows violate a constraint a migration adds: ${pg.detail ?? pg.message ?? 'foreign key violation'}. ` +
108
+ `For experimental installs, ${RESET_HINT} Otherwise, remove the offending row(s) named above and retry.`;
109
+ break;
110
+ case '42P07': // duplicate_table
111
+ case '42710': // duplicate_object
112
+ cause =
113
+ `a migration tried to create an object that already exists (${pg.message ?? 'duplicate object'}). ` +
114
+ `The migration ledger is behind the actual schema. ${RESET_HINT}`;
115
+ break;
116
+ default:
117
+ cause = pg.message ?? String(err);
118
+ }
119
+ return new MigrationFailedError(`Database migration failed${pg.code ? ` [${pg.code}]` : ''}${where}: ${cause}`, { cause: err, code: pg.code });
120
+ }
17
121
  /**
18
122
  * Run any pending migrations. Safe to call on every boot, including concurrently from
19
123
  * multiple replicas: a session-level advisory lock (held on a dedicated connection for
@@ -21,12 +125,39 @@ const MIGRATION_LOCK_KEY = 776_712_001;
21
125
  * at once can't both try to create the same objects and collide. The migrator is
22
126
  * idempotent against its `__drizzle_migrations` ledger, so the loser of the lock race
23
127
  * simply finds nothing to apply.
128
+ *
129
+ * Before applying, we ensure the configured schema exists (so a non-`public` deployment can
130
+ * boot against an empty database — the `search_path`-relocated tables land there), probe for
131
+ * the ledger↔schema split (see {@link assertSchemaConsistent}), and, on any apply failure,
132
+ * rethrow a {@link MigrationFailedError} whose message names the likely cause and the recovery
133
+ * path — so a wedged DB reports what to do instead of a bare Postgres error deep inside an
134
+ * `ALTER TABLE`.
135
+ *
136
+ * `opts.schema` (default `public`, the deployment's `DB_SCHEMA`) is where the unqualified app
137
+ * tables live; `opts.migrationsSchema` (default `drizzle`, the deployment's
138
+ * `DB_MIGRATIONS_SCHEMA`) is where the migration ledger lives — set it to a service-dedicated
139
+ * name on a SHARED database so cat-factory's ledger can't collide with another drizzle-using
140
+ * service's `drizzle.__drizzle_migrations`. The migrator creates the migrations schema itself.
24
141
  */
25
- export async function migrate(db, pool) {
142
+ export async function migrate(db, pool, opts = {}) {
143
+ const resolved = resolveDbSchema(opts.schema);
144
+ const migrationsSchema = resolveDbSchema(opts.migrationsSchema, DEFAULT_MIGRATIONS_SCHEMA, 'DB_MIGRATIONS_SCHEMA');
26
145
  const lock = await pool.connect();
27
146
  try {
28
147
  await lock.query('SELECT pg_advisory_lock($1)', [MIGRATION_LOCK_KEY]);
29
- await drizzleMigrate(db, { migrationsFolder });
148
+ // Ensure the target schema exists before the migrator's unqualified `CREATE TABLE`s run
149
+ // (the pool's search_path points here). Skipped for `public`, which always exists — and
150
+ // avoids needing CREATE-on-public privilege on a stock deployment.
151
+ if (resolved !== DEFAULT_DB_SCHEMA) {
152
+ await lock.query(`CREATE SCHEMA IF NOT EXISTS "${resolved}"`);
153
+ }
154
+ await assertSchemaConsistent(pool, resolved, migrationsSchema);
155
+ try {
156
+ await drizzleMigrate(db, { migrationsFolder, migrationsSchema });
157
+ }
158
+ catch (err) {
159
+ throw explainMigrationFailure(err);
160
+ }
30
161
  }
31
162
  finally {
32
163
  try {
@@ -1 +1 @@
1
- {"version":3,"file":"migrate.js","sourceRoot":"","sources":["../../src/db/migrate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AACxC,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,oCAAoC,CAAA;AAI9E,uFAAuF;AACvF,uFAAuF;AACvF,8EAA8E;AAC9E,wFAAwF;AACxF,sFAAsF;AACtF,wFAAwF;AACxF,kCAAkC;AAClC,EAAE;AACF,sFAAsF;AACtF,oFAAoF;AACpF,gDAAgD;AAChD,MAAM,gBAAgB,GAAG,aAAa,CAAC,IAAI,GAAG,CAAC,eAAe,EAAE,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,CAAA;AAEjF,oFAAoF;AACpF,MAAM,kBAAkB,GAAG,WAAW,CAAA;AAEtC;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,OAAO,CAAC,EAAa,EAAE,IAAU;IACrD,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,OAAO,EAAE,CAAA;IACjC,IAAI,CAAC;QACH,MAAM,IAAI,CAAC,KAAK,CAAC,6BAA6B,EAAE,CAAC,kBAAkB,CAAC,CAAC,CAAA;QACrE,MAAM,cAAc,CAAC,EA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F,wFAAwF;QACxF,mEAAmE;QACnE,IAAI,QAAQ,KAAK,iBAAiB,EAAE,CAAC;YACnC,MAAM,IAAI,CAAC,KAAK,CAAC,gCAAgC,QAAQ,GAAG,CAAC,CAAA;QAC/D,CAAC;QACD,MAAM,sBAAsB,CAAC,IAAI,EAAE,QAAQ,EAAE,gBAAgB,CAAC,CAAA;QAC9D,IAAI,CAAC;YACH,MAAM,cAAc,CAAC,EAAE,EAAE,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,CAAC,CAAA;QAClE,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,MAAM,uBAAuB,CAAC,GAAG,CAAC,CAAA;QACpC,CAAC;IACH,CAAC;YAAS,CAAC;QACT,IAAI,CAAC;YACH,MAAM,IAAI,CAAC,KAAK,CAAC,+BAA+B,EAAE,CAAC,kBAAkB,CAAC,CAAC,CAAA;QACzE,CAAC;gBAAS,CAAC;YACT,IAAI,CAAC,OAAO,EAAE,CAAA;QAChB,CAAC;IACH,CAAC;AACH,CAAC"}
@@ -7468,6 +7468,21 @@ export declare const riskPolicies: import("drizzle-orm/pg-core").PgTableWithColu
7468
7468
  identity: undefined;
7469
7469
  generated: undefined;
7470
7470
  }>;
7471
+ fork_decision: import("drizzle-orm/pg-core").PgBuildColumn<"merge_threshold_presets", import("drizzle-orm/pg-core").PgTextBuilder<[string, ...string[]]>, {
7472
+ name: string;
7473
+ tableName: "merge_threshold_presets";
7474
+ dataType: "string";
7475
+ data: string;
7476
+ driverParam: string;
7477
+ notNull: false;
7478
+ hasDefault: false;
7479
+ isPrimaryKey: false;
7480
+ isAutoincrement: false;
7481
+ hasRuntimeDefault: false;
7482
+ enumValues: undefined;
7483
+ identity: undefined;
7484
+ generated: undefined;
7485
+ }>;
7471
7486
  version: import("drizzle-orm/pg-core").PgBuildColumn<"merge_threshold_presets", import("drizzle-orm/pg-core").PgIntegerBuilder, {
7472
7487
  name: string;
7473
7488
  tableName: "merge_threshold_presets";
@@ -1 +1 @@
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAYzB,CAAA;AAED,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgB3B,CAAA;AAID,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAW7B,CAAA;AAKD,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwB3B,CAAA;AAMD,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAG9B,CAAA"}
package/dist/db/schema.js CHANGED
@@ -1021,6 +1021,9 @@ export const riskPolicies = pgTable('merge_threshold_presets', {
1021
1021
  human_review_grace_minutes: integer('human_review_grace_minutes').notNull().default(10),
1022
1022
  // When 0 the `merger` step never auto-merges — every PR is routed to human review.
1023
1023
  auto_merge_enabled: integer('auto_merge_enabled').notNull().default(1),
1024
+ // Estimate gating for the implementation-fork decision phase, a JSON `StepGating` blob
1025
+ // (mirror of D1's `fork_decision` TEXT column). NULL ⇒ off in `auto` mode.
1026
+ fork_decision: text('fork_decision'),
1024
1027
  // Monotonic catalog version for a built-in preset (NULL on custom; treated as 0).
1025
1028
  version: integer('version'),
1026
1029
  is_default: integer('is_default').notNull().default(0),