Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

Classify holdSchemaMigrationLock and pin it in the export, RLS-scope and SQL-text goldens (GST-2501)

garrytane6fd7de1cc85
diff --git a/test/fixtures/goldens/exports/runtime.json b/test/fixtures/goldens/exports/runtime.json
index 1e5aa2fe3c..330c1b62e0 100644
--- a/test/fixtures/goldens/exports/runtime.json
+++ b/test/fixtures/goldens/exports/runtime.json
@@ -313,6 +313,7 @@
"getTimelineForDate",
"getUnverifiedExtractionPageIds",
"getVersions",
+ "holdSchemaMigrationLock",
"initSchema",
"insertFact",
"insertFacts",
diff --git a/test/fixtures/goldens/exports/types.json b/test/fixtures/goldens/exports/types.json
index de6aec8239..b5abd85478 100644
--- a/test/fixtures/goldens/exports/types.json
+++ b/test/fixtures/goldens/exports/types.json
@@ -138,6 +138,7 @@
"getTimelineForDate: (date: string, opts?: ChronicleTimelineOpts) => Promise<ChronicleTimelineRow[]>",
"getUnverifiedExtractionPageIds: (pageIds: number[], opts?: PageReadScope) => Promise<Map<number, { unverified: boolean; status: string; }>>",
"getVersions: <B extends boolean = true>(slug: string, opts?: GetVersionsOpts<B>) => Promise<PageVersionRows<B>>",
+ "holdSchemaMigrationLock?: (<T>(fn: (assertHeld: () => Promise<void>) => Promise<T>) => Promise<T>) | undefined",
"initSchema: () => Promise<void>",
"insertFact: (input: NewFact, ctx: { source_id: string; supersedeId?: number; }) => Promise<{ id: number; status: FactInsertStatus; }>",
"insertFacts: (rows: Array<NewFact & { row_num: number; source_markdown_slug: string; superseded_by_row?: number; }>, ctx: { source_id: string; }, opts?: { deleteForPageFirst?: { slug: string; excludeSourcePrefixes?: string[]; preserveExpiredLegacy?: boolean; }; }) => Promise<{ inserted: number; ids: number[]; warnings: string[]; deleted: number; }>",
@@ -1155,6 +1156,7 @@
"getTimelineForDate: (date: string, opts?: ChronicleTimelineOpts) => Promise<ChronicleTimelineRow[]>",
"getUnverifiedExtractionPageIds: (pageIds: number[], opts?: PageReadScope) => Promise<Map<number, { unverified: boolean; status: string; }>>",
"getVersions: <B extends boolean = true>(slug: string, opts?: GetVersionsOpts<B>) => Promise<PageVersionRows<B>>",
+ "holdSchemaMigrationLock: <T>(fn: (assertHeld: () => Promise<void>) => Promise<T>) => Promise<T>",
"initSchema: (opts?: { embedding?: { dimensions: number; model: string; }; }) => Promise<void>",
"insertFact: (input: NewFact, ctx: { source_id: string; supersedeId?: number; }) => Promise<{ id: number; status: FactInsertStatus; }>",
"insertFacts: (rows: Array<NewFact & { row_num: number; source_markdown_slug: string; superseded_by_row?: number; }>, ctx: { source_id: string; }, opts?: { deleteForPageFirst?: { slug: string; excludeSourcePrefixes?: string[]; preserveExpiredLegacy?: boolean; }; }) => Promise<{ inserted: number; ids: number[]; warnings: string[]; deleted: number; }>",
@@ -3704,6 +3706,7 @@
"getTimelineForDate: (date: string, opts?: ChronicleTimelineOpts) => Promise<ChronicleTimelineRow[]>",
"getUnverifiedExtractionPageIds: (pageIds: number[], opts?: PageReadScope) => Promise<Map<number, { unverified: boolean; status: string; }>>",
"getVersions: <B extends boolean = true>(slug: string, opts?: GetVersionsOpts<B>) => Promise<PageVersionRows<B>>",
+ "holdSchemaMigrationLock?: (<T>(fn: (assertHeld: () => Promise<void>) => Promise<T>) => Promise<T>) | undefined",
"initSchema: () => Promise<void>",
"insertFact: (input: NewFact, ctx: { source_id: string; supersedeId?: number; }) => Promise<{ id: number; status: FactInsertStatus; }>",
"insertFacts: (rows: Array<NewFact & { row_num: number; source_markdown_slug: string; superseded_by_row?: number; }>, ctx: { source_id: string; }, opts?: { deleteForPageFirst?: { slug: string; excludeSourcePrefixes?: string[]; preserveExpiredLegacy?: boolean; }; }) => Promise<{ inserted: number; ids: number[]; warnings: string[]; deleted: number; }>",
diff --git a/test/fixtures/goldens/rls-scope-inventory.json b/test/fixtures/goldens/rls-scope-inventory.json
index 231976b58f..bb89cec20a 100644
--- a/test/fixtures/goldens/rls-scope-inventory.json
+++ b/test/fixtures/goldens/rls-scope-inventory.json
@@ -3739,6 +3739,7 @@
"getTimelineForDate": "none",
"getUnverifiedExtractionPageIds": "none",
"getVersions": "none",
+ "holdSchemaMigrationLock": "none",
"initSchema": "none",
"insertFact": "none",
"insertFacts": "none",
diff --git a/test/fixtures/goldens/sql-text/_classification.json b/test/fixtures/goldens/sql-text/_classification.json
index 961e53beed..64916b3a6f 100644
--- a/test/fixtures/goldens/sql-text/_classification.json
+++ b/test/fixtures/goldens/sql-text/_classification.json
@@ -12,7 +12,7 @@
"out-of-scope:eval-capture": 5,
"out-of-scope:ingest-log": 2,
"out-of-scope:internal-helper (private; exercised through public callers)": 20,
- "out-of-scope:lifecycle (connection, pool, transaction, raw seams)": 17,
+ "out-of-scope:lifecycle (connection, pool, transaction, raw seams)": 18,
"out-of-scope:no-sql-stub": 1,
"out-of-scope:page-body (Wave B segmented storage, born in engine-sql/page-body.ts; pinned by test/engine-sql-page-body.test.ts)": 14,
"out-of-scope:raw-data": 2,
@@ -125,6 +125,7 @@
"getTimelineForDate": "timeline",
"getUnverifiedExtractionPageIds": "out-of-scope:shared-read-enrichment (already one SQL copy in search/read-enrichment.ts)",
"getVersions": "pages",
+ "holdSchemaMigrationLock": "out-of-scope:lifecycle (connection, pool, transaction, raw seams)",
"initSchema": "out-of-scope:lifecycle (connection, pool, transaction, raw seams)",
"insertFact": "facts",
"insertFacts": "facts",
diff --git a/test/helpers/postgres-engine-sql-cases.ts b/test/helpers/postgres-engine-sql-cases.ts
index bb41975a6e..951eb2f53b 100644
--- a/test/helpers/postgres-engine-sql-cases.ts
+++ b/test/helpers/postgres-engine-sql-cases.ts
@@ -60,6 +60,7 @@ export const DOMAIN_OF: Record<string, string> = {
'disconnect': OOS.lifecycle,
'disconnectInternal': OOS.helper,
'initSchema': OOS.lifecycle,
+ 'holdSchemaMigrationLock': OOS.lifecycle,
'applyForwardReferenceBootstrap': OOS.helper,
'transaction': OOS.lifecycle,
'transactionDirect': OOS.lifecycle,