KB-1807

F-2 Rollback-Only Coverage Dry-Run — 03 Seam & Ruleset Test Results

4 min read Revision 1
one-roofphase-1f2seamrulesetcandidate-path

03 — Seam & Ruleset Test Results

Live output of S1–S6 (seam wiring, inventory, pre-ownership gap, draft ruleset, candidate path). All inside the rolled-back transaction.

3.1 S1/S2 — seam wiring onto the real source

Both CREATE OR REPLACE VIEW succeeded inside the transaction:

  • v_governance_object_inventory rewired from inert WHERE false to collection-grain over collection_registry, restricted to the 3-collection subset.
  • v_governance_object_containment rewired from inert to a single edge: collection:apr_action_typescollection:approval_requests (so the inherited-owner case has a real containment path to climb).

This is the F-2 advance over F-1: the seams are now real view objects resolving the dependent views (v_object_effective_owner, v_object_owner_gap), not inline SQL.

3.2 S3 — inventory output (expect 3)

 object_type |    object_ref     | requires_owner | born
-------------+-------------------+----------------+------
 collection  | agents            | t              | t
 collection  | approval_requests | t              | t
 collection  | apr_action_types  | t              | t
(3 rows)

Exactly 3 bounded rows, all requires_owner=t (governed) and born=t (BIRTH_REQUIRED) — identical to F-1's inline result, now produced by the wired view.

3.3 S4 — gap BEFORE ownership (expect 18)

 gap_before
------------
         18

18 = 3 objects × 6 active scopes. This is the F-DR-1 corrected per-scope ceiling, now confirmed against the real view object (F-1 reproduced it from inline SQL). With ownership still empty, the wired path returns the maximal honest gap set. 18 ≤ 18 ceiling ⇒ no abort.

3.4 Type-compatibility note (the one fix during execution)

The live seam columns are text; collection_registry.collection_name is varchar(255). The first execution attempt failed at S1 with cannot change data type of view column "object_ref" from text to character varying(255)CREATE OR REPLACE VIEW forbids changing a column's type. Fix: cast cr.collection_name::text AS object_ref. This is a faithful, non-semantic correction (keeps the documented text shape) and the re-run passed cleanly. Folded into doc 07 as finding F2-1 and into the F-4 wiring guidance.

3.5 S5 — transient draft ruleset

INSERT 0 1
 ruleset_version | status | owner_gov_code
-----------------+--------+----------------
 REH-F2-DRAFT    | draft  | GOV-COUNCIL

A status='draft' ruleset, never activated (activated_at/activated_by NULL). Drafting a ruleset version is operational config — no law/version bump, no activation. Rolled back.

3.6 S6 — candidate path (scan_run + candidate_state)

INSERT 0 1   -- candidate_scan_run  RUN-F2-DRY  (periodic_full / completed / snapshot 1 / REH-F2-DRAFT)
INSERT 0 1   -- governance_candidate_state
          group_key           | candidate_verdict | ruleset_version | last_run_id
------------------------------+-------------------+-----------------+-------------
 collection:approval_requests | needs_input       | REH-F2-DRAFT    | RUN-F2-DRY

The full candidate path is exercised end-to-end inside the txn: a scan-run ledger row links the SB-12 ruleset + SB-12 snapshot; a group-grain governance_candidate_state row (verdict needs_input, dirty=false, risk_class='low', coverage_required=true) references the draft ruleset (FK) and snapshot id=1 (FK) and back-links the run (last_run_id). The candidate FK chain is fail-closed: a candidate cannot exist without a registered ruleset (proven negatively in N6, doc 05). All rolled back.

3.7 Seam & ruleset verdict

PASS. Seam wiring works against the real collection_registry source as live view objects (3 bounded inventory rows, 18-row pre-ownership gap = F-DR-1 ceiling). The draft-ruleset and candidate (scan-run + state) path is structurally complete and fail-closed. One benign type-cast fix (F2-1). Nothing persisted.

Back to Knowledge Hub knowledge/dev/reports/architecture/one-roof-phase1-coverage-dry-run-f2-rollback-only-2026-06-02/03-seam-and-ruleset-test-results.md