KB-529B

F-4 Seam Commit — commit SQL

3 min read Revision 1
one-roofphase1f4sqlcommit

-- F-4 SEAM COMMIT (TEST_MODE_OPERATOR_AUTHORIZATION) — 2026-06-02 -- Persists ONLY two read-only seam views onto real collection_registry. -- Self-guarding DO-block aborts the whole transaction if ceilings deviate (35/35). -- Reversible in one statement per seam. NO data inserts. NO table/function/trigger/event/DOT/worker changes.

\set ON_ERROR_STOP on \timing on BEGIN;

CREATE OR REPLACE VIEW v_governance_object_inventory AS SELECT 'collection'::text AS object_type, cr.collection_name::text AS object_ref, (cr.governance_role IN ('governed','locked')) AS requires_owner, (cr.coverage_status = 'BIRTH_REQUIRED') AS born FROM collection_registry cr WHERE cr.governance_role = 'governed' AND cr.coverage_status = 'BIRTH_REQUIRED';

COMMENT ON VIEW v_governance_object_inventory IS 'F-4 test-mode seam A (2026-06-02): governed BIRTH_REQUIRED collection inventory; read-only projection of collection_registry; activation NO-GO; ratification deferred.';

CREATE OR REPLACE VIEW v_governance_object_containment AS SELECT 'collection'::text AS object_type, cr.collection_name::text AS object_ref, 'group'::text AS parent_type, cr."group"::text AS parent_ref FROM collection_registry cr WHERE cr.governance_role = 'governed' AND cr.coverage_status = 'BIRTH_REQUIRED' AND cr."group" IS NOT NULL AND cr."group" <> '';

COMMENT ON VIEW v_governance_object_containment IS 'F-4 test-mode seam B (2026-06-02): collection->group containment edges (acyclic, depth-1); read-only projection of collection_registry."group"; activation NO-GO; ratification deferred.';

DO $$ DECLARE a int; b int; BEGIN SELECT count() INTO a FROM v_governance_object_inventory; SELECT count() INTO b FROM v_governance_object_containment; RAISE NOTICE 'F-4 in-txn: seamA=% seamB=% gap_ceiling=%', a, b, a6; IF a <> 35 THEN RAISE EXCEPTION 'ABORT: Seam A ceiling breach got % expected 35', a; END IF; IF b <> 35 THEN RAISE EXCEPTION 'ABORT: Seam B edge breach got % expected 35', b; END IF; IF a6 > 210 THEN RAISE EXCEPTION 'ABORT: gap ceiling % exceeds 210', a*6; END IF; END $$;

COMMIT;

SELECT 'seamA' AS seam, count() AS rows FROM v_governance_object_inventory UNION ALL SELECT 'seamB', count() FROM v_governance_object_containment;

Back to Knowledge Hub knowledge/dev/reports/architecture/one-roof-phase1-coverage-dry-run-f4-seam-commit-test-mode-2026-06-02/sql/f4_seam_commit.sql