KB-1973
QT-001 Apply DOT Harden — 01 Codex Blocker Reverification
3 min read Revision 1
birth-gatewayqt-001stage2.5codex-reverify2026-06-06
01 — Codex Blocker Reverification (Supertrack A)
Started from Codex (NOT_SAFE_NEEDS_FIX), not from T1 optimism. Every blocker re-reproduced against LIVE evidence before fixing. Live view: v_qt001_codex_blocker_reverification. Master safety guard: v_qt001_not_safe_guard (7/7 pass).
Reproduced live, then hardened
| # | Codex blocker | Live reproduction (2026-06-06) | Hardening |
|---|---|---|---|
| B1 | apply procedure absent / pseudocode | sp_dot_birth_qt001_apply/fn_dot_birth_qt001_* ABSENT in pg_proc; 05_..._apply_SOURCE.sql apply loop is a commented Pseudocode body |
Real fn_dot_birth_qt001_apply writer + sp_ driver now live |
| B2 | source false-completes ledger done with 0 births |
source sets applied_rows=v_applied(=0), status='done', RAISEs "apply done" |
structural CHECK bbl2_no_false_done (status=done ⇒ actual=expected) + writer RAISE on mismatch + integrity real==counted |
| B3 | readiness false-passes | v_birth_qt001_apply_dot_readiness asserted 3 hardcoded trues, never checked the procedure exists |
patched to require procedure-exists + not-pseudocode + false-done-CHECK + reaudit; v_qt001_apply_readiness_guard_v2 gates on live runtime + rehearsal |
| B4 | permit no enforced expiry/max_rows | v1 permit expires_at/max_rows nullable; GATE accepted expires_at IS NULL; max_rows never checked |
birth_admission_permit_v2: expires_at/max_rows/expected_delta NOT NULL + CHECK(max_rows≥expected) + CHECK(expires_at>created) + partial-unique one-open-execute-per-collection |
| B5 | ledger can't prove one scoped resumable apply | v1 ledger keyed by collection_name AND status='planned' LIMIT 1; no run_id/batch_id/FK/status-CHECK |
birth_backfill_ledger_v2: run_id+batch_id+UNIQUE(run,coll,batch)+FK(permit)+status enum+resume_marker+error_message |
| B6 | cross-collection collision silently skips | fn_birth_register existence check is WHERE entity_code=... only (no collection qualifier) ⇒ returns skipped/idempotent |
sanctioned writer pre-checks each code for a DIFFERENT collection and RAISEs; core patch staged (v_birth_register_collision_patch_plan) |
| B7 | no committed-batch compensation/resume | pseudocode COMMIT per batch with no record | per-batch ledger rows + COMMIT boundary + failed/rolled_back status + idempotent resume by anti-join |
| B8 | one stale gate text | v_birth_stage2_qt001_readiness_dashboard.qt001_gate hardcoded BLOCKED_UNTIL_43_IDENTITIES... while live unclassified=4 |
gate recomputed from live unclassified count |
Live posture confirmed during reverification
open_permits=0 · done_ledgers=0 · target_births=8 (all apr_action_types, origin PG:sb1-gov-vocab) · QT-001-apply-origin births=0 · 5 targets delta 137 unchanged · gateway norm-md5 c022f849 · Stage 0 freeze 5/5 · danger DOTs frozen 2/2. Every Codex blocker reproduced — none was a false alarm.