814c924e4a
Keep askable cards after exhaustion, explain each probe, read the adopted credible range in reports and chat, and compare declared periods before the minute grid when the clock is unknown. Co-authored-by: Cursor <cursoragent@cursor.com>
24 lines
1.5 KiB
TypeScript
24 lines
1.5 KiB
TypeScript
import assert from "node:assert/strict";
|
|
import { readFileSync } from "node:fs";
|
|
import test from "node:test";
|
|
|
|
const migration = readFileSync(
|
|
new URL("../supabase/migrations/20260906030000_rectification_block_scan_stage.sql", import.meta.url),
|
|
"utf8",
|
|
);
|
|
|
|
test("block_scan stage columns and service_role RPCs stay additive", () => {
|
|
assert.match(migration, /add column if not exists stage text not null default 'minute'/);
|
|
assert.match(migration, /add column if not exists block_scan jsonb/);
|
|
assert.match(migration, /check \(stage in \('minute', 'block_scan'\)\)/);
|
|
assert.match(migration, /create or replace function public\.set_agentic_rectification_case_stage/);
|
|
assert.match(migration, /create or replace function public\.write_agentic_rectification_block_scan/);
|
|
assert.match(migration, /create or replace function public\.advance_agentic_rectification_case_from_block_scan/);
|
|
assert.match(migration, /grant execute on function public\.set_agentic_rectification_case_stage\(uuid, uuid, text\)\s+to service_role/);
|
|
assert.match(migration, /grant execute on function public\.write_agentic_rectification_block_scan\(uuid, uuid, jsonb\)\s+to service_role/);
|
|
assert.match(migration, /grant execute on function public\.advance_agentic_rectification_case_from_block_scan\(uuid, uuid, text, text\)\s+to service_role/);
|
|
assert.match(migration, /'stage', coalesce\(v_case\.stage, 'minute'\)/);
|
|
assert.match(migration, /invalidated_at = pg_catalog\.now\(\)/);
|
|
assert.doesNotMatch(migration, /create table public\.agentic_rectification_cases/);
|
|
});
|