KB-2140

08 — Live-PG Compatibility Check (Branch H) (2026-06-01)

9 min read Revision 1
one-roof-governanceround4branch-hlive-pgsubstrate-blockerscheck-constraintmissing-action-typemissing-event-typeaxis-envelopestale-registryschema-driftread-only2026-06-01

08 — Live-PG Compatibility Check (Branch H)

Verifies the hardened model against the live substrate (read-only, role context_pack_readonly, db directus, 2026-06-01). Output = the exact substrate blockers (SB-1..SB-9), each with live evidence, the design it blocks, and a non-mutating remediation path. No DDL was rehearsed (read-only inspection only, per mission §12 preference).


8.1 Substrate readiness by component

Component Live state Compatible with model? Note
governance_registry (9) 5 active + 4 draft mothers; no GOV-IU; capability NULL on actives Partial OP-B (no IU owner); capability JSON empty + not in enacted Đ37 (drift).
governance_relations (8) all agency→law; CHECK {law,agency} No (object/axis) SB-2 — object/axis edges impossible.
governance_audit_log (1) stale 2026-04-24 meta-note, relation_id=null Dormant SB-7 — Đ37 §5.5 audit loop not closing; activate (reuse), don't replace.
apr_action_types (6) add_field, amend_law*, create_item, enact_nrm*, patch_ops_code, update_item (* unimplemented) No (governance) SB-1 — no owner/exception/axis action-types; SB-5 — enact handlers unimplemented.
apr_request_types (14) reclassify/rule_change/schema_*/new_dot/retire reusable; free-text entity_type (no CHECK) Reusable any object targetable without enum patch.
approval_requests / apr_approvals (42) / os_proposal_approvals (0) all DOT-repair/birth/reclassify/schema; no sovereign sign-off No (commit) SB-6 — COMMIT_FORBIDDEN; enactment = separate human phase (H-1).
event_type_registry (40) iu.*(16) active; mother.*(9) governance/proposal active=false (bare names) No (governance) SB-4 — no governance/coverage/axis/orphan/anarchy/island/exception event domain; H1 naming.
system_issues (~190k) template_gap 182,378 open; orphan thiếu_quan_hệ(606)/thiếu_mã_định_danh(9); drift(2); issue_type free-text (no CHECK) Partial reuse orphan+drift types; SB-4 new types must register (Đ45 register-first, not a DB CHECK); anti-spam mandatory at this scale.
dot_coverage_required (11) birth.*/collection/governance.approval/monitoring.dot No (coverage) SB-8 — no classification/pivot/governance-coverage/IU/axis coverage row; scanner absent.
information_unit (219) owner_ref free-text (not FK); conformance_status='open' all No (IU owner) OP-B; conformance gate never closes.
iu_three_axis_envelope (216) columns hardcode 3 axes (axis_a/b/c) No (open-axis) SB-3 — 4th axis needs DDL.
dot_iu_command_catalog (54) standalone, not in dot_tools(309) No (DOT SSOT) IU DOT island.
normative_registry (47) Đ37 enacted; Đ20/23/44/45 absent; Đ36/45 drift Partial SB-9 / L-2 — law-registration gap + drift.
law_jurisdiction (law_code, domain, coverage_type, ...); classification/pivot agency-orphaned Partial object ownership currently only law/domain-grain.

8.2 The substrate blockers (SB-1..SB-9)

SB-1 — Missing governance APR action-types (blocks PROPOSE)

  • Evidence: apr_action_types = 6; none is assign_governance_owner / grant_governance_exception / delegate_authority / assign_axis_owner.
  • Blocks: the GAP-PROPOSE step (owner-assign / exception-grant / axis-owner) — PROPOSE returns proposal_blocked (red-team #13/#36).
  • Remediation (non-mutating design): add 4 apr_action_types rows + handler (assign_governance_owner) / council-review (others). Interim exception home = admin_fallback_log. Decision: C-2.

SB-2 — Object/axis ownership edge un-expressible (blocks APPLY)

  • Evidence: chk_relations_source_type & chk_relations_target_type both CHECK (… = ANY {law, agency}); 8 live edges all agency→law.
  • Blocks: writing an agency→object / agency→axis owner edge — APPLY returns apply_blocked: object_edge_unexpressible (red-team #14/#45).
  • Remediation: new additive table governance_object_ownership(owner_gov_code, object_type, object_ref, scope, ...) (preferred — no CHECK migration) OR widen the CHECK. Decision: C-1.

SB-3 — IU axis envelope hardcodes 3 axes (blocks true open-axis at IU substrate) — NEW Round 4

  • Evidence: iu_three_axis_envelope DDL columns = exactly axis_a_*, axis_b_*, axis_c_*; 216 rows; a 4th axis ⇒ ALTER TABLE.
  • Blocks: honoring "no fixed axis array" for IU; a future IU axis silently requires schema change.
  • Remediation: Axis Registry = ground truth; generic iu_axis_value(unit_id, axis_code, value, ...) store; envelope demoted to a hot-cache projection. Decision: IU technical design (after OP-B).

SB-4 — No governance event/issue types (blocks detection routing)

  • Evidence: event_type_registry has no governance/coverage/axis/orphan/anarchy/island/exception domain; mother.governance.*/proposal.* are active=false and bare-named. system_issues.issue_type is free-text (no CHECK), so register-before-emit must be enforced by Đ45, not a DB constraint.
  • Blocks: emitting coverage/axis/orphan issues+events per Đ45.
  • Remediation: register new types under a GOV-SIV governance/integrity domain (OQ-H1); reuse thiếu_quan_hệ/sai_lệch_dữ_liệu for orphan/drift; enforce register-before-emit. Decision: OQ-H1.

SB-5 — Law-enact handlers unimplemented (blocks auto-enactment)

  • Evidence: amend_law & enact_nrm handler_ref='unimplemented' (risk high); live enact-via-APR (id 204–210) all rejected.
  • Blocks: auto-applying any law clause through APR.
  • Remediation: none at design time — enactment is council_review + manual/admin-fallback enact (the live corpus bootstrap path). Decision: H-1 (separate human phase).

SB-6 — No sovereign sign-off (COMMIT_FORBIDDEN)

  • Evidence: os_proposal_approvals = 0; apr_approvals = 42 all S178 DOT-repair; zero approvals on any governance/IU/axis/coverage artifact.
  • Blocks: any commit/enactment. Remediation: human ratification phase. Decision: H-1.

SB-7 — Governance audit loop dormant

  • Evidence: governance_audit_log = 1 stale row (relation_id=null, codex meta-note).
  • Blocks: central audit of governance relation/coverage changes.
  • Remediation: activate the Đ37 §5.5 audit DOTs (reuse the table + registry_changelog(68k)/event_outbox(180k)); do not replace. Decision: implementation (defer-safe).

SB-8 — No coverage-required rows for the new scanner

  • Evidence: dot_coverage_required = 11 (birth/collection/governance.approval/monitoring.dot only).
  • Blocks: the governance-coverage scanner has no declared coverage domain.
  • Remediation: add dot_coverage_required rows for governance.coverage/classification/pivot/axis/iu (scan/propose/apply/audit). Decision: scanner design (Đ23/Đ35).

SB-9 — Law-registration gap + drift (blocks clean law patch)

  • Evidence: normative_registry lacks Đ20/23/44/45; Đ36 v4.0/v5.0 ambiguity; Đ45 ban_hanh=false leftover; Đ37 v3.3 text vs live columns; law_catalog(5) stale; governance_docs(12) drifted UI index.
  • Blocks: a law patch that references these laws.
  • Remediation: GOV-NRM-SYS registers Đ20/23/44/45 + content-only drift fixes. Decision: L-1 / L-2 (content-only, does not block design patch).

8.3 What the substrate CAN do today (so design isn't over-blocked)

  • Law/domain-grain ownership works now (agency→law edge + law_jurisdiction + inheritance) → law-mode APPLY is operable.
  • Reuse-ready spines: system_issues (coalesce_key/occurrence_count for anti-spam), event_outbox(180k)/event_read, registry_changelog(68k), admin_fallback_log(22), vps_deploy_log(18), apr_request_types(free-text entity → any object targetable), dot_tools(309)/paired_dot, the orphan (thiếu_quan_hệ) + drift (sai_lệch_dữ_liệu) issue types.
  • IU machinery (vector_sync_point/qdrant_registry/sql_link/structure_operation/reconstruct fn) is live and can be bound without being rebuilt.

8.4 Answers to Success-Target Q17, Q18

  • Q17 (aligns with live substrate) → YES — every clause family checked against live PG; the model deliberately resolves ownership relationally (no per-table gov columns), matching the substrate's actual shape.
  • Q18 (exact remaining substrate gaps) → YESSB-1..SB-9, each with live evidence + a non-mutating remediation. The hard apply-blockers are SB-1, SB-2, SB-3 (action-types, object edge, axis envelope); the rest are content-only (SB-9), dormant-reuse (SB-7/SB-8), or human-phase (SB-5/SB-6).
Back to Knowledge Hub knowledge/dev/reports/architecture/one-roof-governance-law-hardening-finalization-round4-2026-06-01/08-live-pg-compatibility-check.md