KB-193E

96 — Phase 1 Preflight Live Re-Verify Checklist (read-only, 2026-06-01 baseline)

10 min read Revision 1
one-roof-governanceimplementation-indexphase1preflightreverifychecklistread-onlybaseline2026-06-01

96 — Phase 1 Preflight Live Re-Verify Checklist

Mission §7 (Branch D). Tier: the read-only checklist the build-agent runs immediately before each build step (and again after, for the delta). Mutation footprint: ZERO — every query is read-only; no live mutation in this checklist. Rule: if any MUST assertion fails, STOP — do not "work around." The master gate (os_proposal_approvals > 0 for THIS step) is the first and hardest check. Channels: independent read-only query_pg (preferred for verification) and/or the write-session run read-only before the BEGIN. Both must agree.


96.1 Captured baseline (live, read-only, 2026-06-01)

This is the point-in-time reference. Organic-growth tables (birth_registry, event_outbox totals) drift via unrelated production traffic — only the governance-scoped subsets are residue/authorization-relevant.

Check Baseline value Meaning
os_proposal_approvals 0 M-1 OPEN ⇒ COMMIT_FORBIDDEN
apr_action_types 6 SB-1 not built (expect 6 until STEP 6)
birth_registry WHERE collection_name='apr_action_types' 0 F-83-1 root evidence (trigger never fired here)
approval_requests 211 no governed APR created
apr_approvals 42 no approval row
governance_relations 8 not widened
governance_registry 9 owner registry intact
event_type_registry WHERE event_domain='governance' 0 SB-11 not built
event_outbox WHERE event_domain='governance' 0 nothing emitted
dot_tools 309 no GCOS DOT registered
dot_domains 46 no GCOS subdomain
dot_coverage_required 11 no GCOS coverage row
normative_registry 47 no law change
law_catalog 5 no law change
governance_object_ownership ABSENT (null) SB-2 not built
governance_responsibility_scope ABSENT (null) SB-2 not built
governance_ruleset ABSENT (null) SB-12 not built
gov_worker_cursor ABSENT (null) SB-13 not built
governance_candidate_state ABSENT (null) SB-10 not built
candidate_scan_run ABSENT (null) SB-10 not built
idle_in_transaction (directus) 0 no stuck session

Interpretation: the substrate is greenfield; everything Phase 1 would build is ABSENT; the master gate is shut. Any deviation at build time (e.g. a target table already present, or os_proposal_approvals>0 without a matching sovereign record for the step) → STOP and reconcile.


96.2 Universal preflight block (run before EVERY step)

-- A. MASTER GATE (M-1) — the hard stop
SELECT count(*) AS os_proposal_approvals FROM os_proposal_approvals;       -- MUST be > 0 with a row for THIS step; if 0 → STOP
-- (the build agent must additionally confirm the row scopes to THIS step and was sovereign-created)

-- B. Substrate presence (expect ABSENT until the step that builds it)
SELECT to_regclass('public.governance_ruleset')            AS sb12_ruleset,
       to_regclass('public.gov_worker_cursor')             AS sb13_cursor,
       to_regclass('public.governance_candidate_state')    AS sb10_candidate,
       to_regclass('public.candidate_scan_run')            AS sb10_scanrun,
       to_regclass('public.governance_object_ownership')   AS sb2_ownership,
       to_regclass('public.governance_responsibility_scope') AS sb2_scope;

-- C. Vocabulary / approval surface
SELECT count(*) FROM apr_action_types;                                     -- 6 until SB-1 built
SELECT count(*) FROM apr_action_types
  WHERE action_code IN ('assign_governance_owner','grant_governance_exception','delegate_authority','assign_axis_owner'); -- 0 until SB-1
SELECT count(*) FROM birth_registry WHERE collection_name='apr_action_types'; -- 0 until SB-1 (F-83-1)
SELECT count(*) FROM approval_requests;                                    -- 211 unless a real governed APR ran
SELECT count(*) FROM apr_approvals;                                        -- 42 unless an approval row was written

-- D. Birth trigger wiring for apr_action_types (the F-83-1 surface)
SELECT pg_get_triggerdef(oid) FROM pg_trigger
  WHERE tgname='trg_birth_apr_action_types' AND NOT tgisinternal;          -- no-arg fn_birth_registry_auto() until SB-1 fix

-- E. Governance registries / relations / law
SELECT count(*) FROM governance_registry;                                  -- 9
SELECT count(*) FROM governance_relations;                                 -- 8 (MUST NOT be widened)
SELECT count(*) FROM normative_registry;                                   -- 47 (no law change)
SELECT count(*) FROM law_catalog;                                          -- 5

-- F. Event / DOT surfaces
SELECT count(*) FROM event_type_registry WHERE event_domain='governance';  -- 0 until SB-11
SELECT count(*) FROM event_outbox       WHERE event_domain='governance';   -- MUST stay 0 (no emit)
SELECT count(*) FROM dot_domains;        -- 46
SELECT count(*) FROM dot_tools;          -- 309
SELECT count(*) FROM dot_coverage_required; -- 11

-- G. Hygiene
SELECT count(*) FROM pg_stat_activity WHERE datname='directus' AND state='idle in transaction'; -- MUST be 0

MUST-pass before any COMMIT step: A>0 (for this step) · F event_outbox governance = 0 · G idle-in-tx = 0 · E governance_relations unchanged · the step's own target ABSENT (B) or vocabulary unchanged (C). Plus: a pg_dump of the touched reuse-tables exists; the rollback script is staged (doc 97).


96.3 Per-step add-on assertions

STEP 1 — SB-12

  • sb12_ruleset ABSENT (B). After commit: present; ruleset row(s) status='draft'; evolution_snapshots +1 row keyed to origin.

STEP 2 — SB-13

  • sb13_cursor ABSENT (B). Confirm intended last_watermark_id column will be text (design, doc 39). After commit: present; any queue_heartbeat gov rows executor_kind='PG_worker', metadata='{}'.

STEP 3 — SB-10

  • Precondition MUST: sb12_ruleset PRESENT (FK parent). If ABSENT → STOP.
  • sb10_candidate, sb10_scanrun ABSENT (B). After commit: present; 0 candidate rows; FK→governance_ruleset enforced (negative test rejects bad ruleset_version).

STEP 4 — SB-11

-- enum surface (confirm CHECK domains before INSERT)
SELECT conname, pg_get_constraintdef(oid) FROM pg_constraint
  WHERE conrelid='event_type_registry'::regclass AND contype='c';
SELECT count(*) FROM event_type_registry WHERE event_domain='governance'; -- 0 before; 5 after, all active=false
SELECT count(*) FROM event_outbox       WHERE event_domain='governance'; -- 0 before AND after (MUST)

STEP 5 — SB-2

  • Council MUST: C-1 build record exists (out-of-band confirm). sb2_ownership, sb2_scope ABSENT (B).
  • governance_relations = 8 before AND after (MUST NOT widen). After commit: 2 tables + 2 views present; 6 seed scopes; 5 negative tests reject (dup-accountable / phantom FK / bad scope / bad kind / delegated-no-TTL).
-- confirm no trigger was added to the new tables
SELECT tgname FROM pg_trigger WHERE tgrelid IN ('governance_object_ownership'::regclass,'governance_responsibility_scope'::regclass) AND NOT tgisinternal; -- expect 0

STEP 6 — SB-1 (special)

  • Council MUST: C-2 build record exists. apr_action_types = 6 (C); the 4 codes absent; birth_apr_rows = 0 (D root evidence).
  • Trigger def (D) is the no-arg fn_birth_registry_auto() before the step (confirms the fix is still needed).
  • Expect a WARNING-level [TRIGGER-GUARD] on the DROP/CREATE TRIGGER (F-83-2). If it is ERROR-level → STOP (route per doc 98).
  • In the BEGIN..ROLLBACK rehearsal: after the fix, birth_apr_rows 0→4 (entity_code=action_code); apr_action_types 6→10; on ROLLBACK back to 6/0 and trigger restored to no-arg def.
  • After the real COMMIT: apr_action_types=10; birth_apr_rows=4; approval_requests=211 and apr_approvals=42 unchanged; trigger def now fn_birth_registry_auto('action_code').

96.4 Backup & rollback-staging checks (before COMMIT)

  • pg_dump of the touched reuse-tables taken and path recorded (per step: SB-12→evolution_snapshots; SB-13→queue_heartbeat; SB-11→event_type_registry; SB-1→apr_action_types; greenfield tables need no dump but record the DROP rollback).
  • Rollback SQL for the step staged and reviewed (doc 97).
  • BEGIN..ROLLBACK rehearsal of the step passed entry==exit this session.
  • The COMMIT transaction is a single reviewed transaction with the three timeouts set.

96.5 Stop-condition quick list (any one → STOP)

  1. os_proposal_approvals = 0, or no row scoping to THIS step.
  2. Required council record (C-1 for SB-2, C-2 for SB-1) absent.
  3. The step's target table already PRESENT (someone else built it) — reconcile, don't overwrite.
  4. governance_relations ≠ 8, or event_outbox governance ≠ 0, or idle_in_transaction > 0.
  5. SB-10 attempted while governance_ruleset ABSENT.
  6. SB-1 TRIGGER-GUARD at ERROR level, or the rehearsal INSERT still NULL-violates after the fix.
  7. Live counts contradict this checklist in a way implying out-of-band mutation.

Branch D verdict: the preflight checklist is complete — a universal read-only block (master gate, substrate presence, vocabulary, birth-trigger wiring, registries/relations, event/DOT, hygiene) plus per-step add-on assertions and backup/rollback-staging checks, anchored to the live 2026-06-01 baseline. All checks read-only; no live mutation; M-1=0 ⇒ every step currently resolves to STOP/REHEARSAL-ONLY.

Back to Knowledge Hub knowledge/dev/reports/architecture/one-roof-governance-technical-addendum-and-implementation-index-2026-06-01/96-phase1-preflight-live-reverify-checklist.md