02 — Seam Mapping to Real Sources (2 inert SB-2 seams → exact source wiring spec; axis layer fake/test-only; build-prep only; 2026-06-02)
02 — Seam Mapping to Real Sources
The two committed SB-2 integration seams currently resolve
WHERE false. This doc maps each to the exact real source tables/views that should feed it later, with the exact column wiring. No wiring is performed here — this is the build-prep spec for a future ratifiedCREATE OR REPLACE.
2.0 Why this is a ratified decision, not pure engineering
A non-empty inventory seam makes the substrate begin to see governed objects — i.e. it crosses inert→active for coverage purposes. Per the deferred-substrate build (doc 03 §3.2), wiring these catalogs is a coverage/coupling decision owned by governance, not an engineering default. This doc therefore produces a spec to be ratified, not a change to apply.
2.1 Seam A — v_governance_object_inventory (governed-object inventory)
Current shape (live pg_get_viewdef):
SELECT NULL::text AS object_type, NULL::text AS object_ref,
false AS requires_owner, false AS born
WHERE false;
Consumers: v_object_owner_gap (inventory LEFT JOIN effective-owner ⇒ owner IS NULL = gap); coverage detectors iu_object_orphan, inventory_gap.
Real-source wiring (proposed, ratified follow-up):
| Output col | Source | Derivation |
|---|---|---|
object_type |
collection_registry / birth_registry |
collection grain → 'collection'; born-row grain → 'entity' (or the collection name as type) |
object_ref |
collection_registry.collection_name / birth_registry key |
collection name, or collection:entity_code for object grain |
requires_owner |
collection_registry.governance_role |
governance_role IN ('governed','locked') ⇒ true; observed/excluded ⇒ false |
born |
collection_registry.coverage_status / birth_registry |
coverage_status='BIRTH_REQUIRED' and a corresponding birth_registry row exists ⇒ true |
Two valid grains (pick at ratification):
- Collection grain (recommended for first dry-run): one inventory row per
collection_registryrow WHEREgovernance_role IN ('governed','locked') AND coverage_status='BIRTH_REQUIRED'. ≤ ~38 rows. Bounded, auditable. - Object grain (deferred): join
birth_registry(born=true) filtered to governed collections. 1.08M-row source ⇒ must be cursor-tailed (SB-13), never full-swept in a dry-run.
Drift cross-check: meta_catalog.orphan_count > 0 flags collections drifting out of coverage (Σ=161 today) — an inventory_gap / iu_object_orphan input, not part of the inventory row itself.
2.2 Seam B — v_governance_object_containment (containment tree)
Current shape (live):
SELECT NULL::text AS object_type, NULL::text AS object_ref,
NULL::text AS parent_type, NULL::text AS parent_ref
WHERE false;
Consumer: recursive v_object_effective_owner — climbs containment through is_inherited_anchor=true ancestors (nearest-ancestor, anti-hiding, 64-depth guard). With an empty seam it yields direct owners only.
Real-source wiring (proposed, ratified follow-up) — union of the live containment edges:
| Edge family | Source | parent derivation |
|---|---|---|
| Pivot hierarchy | pivot_definitions.parent_code (37 rows) |
(pivot, code) → (pivot, parent_code) |
| IU containment | information_unit container ref + iu_relation (60 edges) |
container/parent relation rows where relation type = containment |
| Topic hierarchy | taxonomy.facet_id → taxonomy_facets (58 nodes / 10 facets) |
FAC-08 node → parent node / facet |
| Object→collection | collection_registry / meta_catalog |
entity collection:entity_code → 'collection' parent |
Caution: the union must be acyclic for the recursive view (it has a 64-depth cycle guard but a true cycle would saturate it). A containment_cycle detector (doc 08 of the hardening pkg) must pre-screen; the dry-run must assert depth ≤ small bound.
2.3 Axis / topic / relation / assignment coverage sources
| Coverage target | Real source(s) | Status |
|---|---|---|
| Topic (FAC-08 nodes) | taxonomy (status='active', facet_id) + taxonomy_facets (FAC-08) → owner via v_object_effective_owner |
sources LIVE (58/10 rows); detector wireable once containment seam fed |
| Axis surfaces | taxonomy_facets, entity_labels, pivot_definitions, KG edge types |
sources LIVE, but comparison target axis_registry is ABSENT |
| Axis registration | axis_registry (NOT BUILT) |
fake/test-only until axis substrate ratified+built |
| Assignment (zone/confidence/stale) | axis_assignment (NOT BUILT), coverage_rule (NOT BUILT) |
fake/test-only |
| Label reconcile | entity_labels (795,841) ⇄ axis_assignment |
half-live; needs axis_assignment |
| UI-visible-unapproved | v_ui_exposed_objects helper view (NOT BUILT) |
fake/test-only |
2.4 Which seams remain fake / test-only
- All axis-layer coverage (
axis_unregistered,axis_owner_gap,axis_vocab_unowned,ui_visible_unapproved,wrong_topic/topic_stale) — depend onaxis_registry/axis_assignment/coverage_rule/v_axis_surfaces/v_ui_exposed_objects, none of which exist. The axis substrate (hardening pkg docs 04/05) is design-only. - Object-grain inventory — wireable in principle but deliberately deferred (1.08M source; cursor-only).
2.5 Exact future wiring (the only DDL a ratified follow-up needs)
Two CREATE OR REPLACE VIEW statements (Seam A, Seam B) — additive, no migration, instantly reversible to the WHERE false form (the SB-2 rollback script already restores the inert version). Not authored here; specified so the future macro is a fill-in-the-blanks, not a design exercise.
-- Seam A (collection-grain, recommended): CREATE OR REPLACE VIEW v_governance_object_inventory AS
-- SELECT 'collection', collection_name,
-- governance_role IN ('governed','locked'),
-- coverage_status='BIRTH_REQUIRED'
-- FROM collection_registry
-- WHERE governance_role IN ('governed','locked','observed');
-- Seam B: CREATE OR REPLACE VIEW v_governance_object_containment AS
-- <UNION of pivot_definitions / iu_relation / taxonomy / collection edges, acyclic-screened>
(Shown as a comment block — prepared, not applied.)
2.6 Seam mapping verdict
CONCRETE. Both seams map to enumerable, live sources with exact column derivations. The inventory seam is wireable at collection grain (≤~38 rows) the moment it is ratified. The containment seam is wireable from 4 live edge families subject to acyclic screening. Everything axis-related is correctly classified fake/test-only pending the unbuilt axis substrate.