Files
Jyotisha/frontend/tests/rectification-declared-uncertainty-migration.test.ts
T
Jesse_Chen 8e31680b45 fix(rectification): honor declared birth-time uncertainty and split windows over two hours (BUG-571–573)
Intake stores how sure the user is; rectification now searches that range, offers a one-click widen when event fit is low at the edge, and trisects windows longer than two hours before the minute grid.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-07 12:18:50 +08:00

22 lines
1.2 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/20260907020000_rectification_declared_uncertainty.sql", import.meta.url),
"utf8",
);
test("declared-uncertainty migration stays additive and service_role-only", () => {
assert.match(migration, /add column if not exists widen_declined_at_fingerprint text/);
assert.match(migration, /add column if not exists date_reliability text/);
assert.match(migration, /create or replace function public\.widen_agentic_rectification_case_window/);
assert.match(migration, /create or replace function public\.set_agentic_rectification_widen_declined/);
assert.match(migration, /create or replace function public\.set_agentic_rectification_evidence_date_reliability/);
assert.match(migration, /grant execute on function public\.widen_agentic_rectification_case_window\(uuid, uuid, text, text\)\s+to service_role/);
assert.match(migration, /v_span > 120 and v_rounds < 3/);
assert.match(migration, /v_new_width > 241/);
assert.doesNotMatch(migration, /adopted_credible_range = v_range/);
assert.doesNotMatch(migration, /create table public\.agentic_rectification_cases/);
});