10 — Reuse-First Assembly Plan
10 — Reuse-First Assembly Plan
How to make official lists live / auto-counted / pivot-based / IU-KG-connected / birth-governed / DOT-refreshable / UI-visible by reusing what exists. Each action classified: REUSE / EXTEND / WRAP / RECONCILE / DEFER / NEW. Rules: NEW requires proof nothing covers it; WRAP > duplicate table; RECONCILE > blind single-source; IU holds semantic profile not duplicate SoT; pivot counts (not manual); DOT refreshes (not hand-edit). This is a plan only — no implementation, no mutation.
The reference pattern (already live, copy it)
The Collection/Meta list (doc 07 #13) is the working template of a living list:
birth_registry (govern birth) → meta_catalog (SoT + denormalized counts) → pivot_definitions+refresh_pivot_results+refresh_meta_catalog_from_pivot (auto-count) → v_registry_counts (read) → table_registry/ui_pages (UI render) → approval_requests/apr_approvals (govern changes) → universal_edges/iu_relation (KG/semantic). Every immature list should be lifted onto this same chain — not given a new engine.
Action register
A. Counting / pivot (Điều 26)
- REUSE
pivot_count()/pivot_query()+pivot_definitions/pivot_resultsas the only counting method for every list. Adding a list = INSERT apivot_definitionsrow (governed), never a manual count. - EXTEND pivot coverage: add pivots for lists lacking one (law/normative_registry, IU/edges, users/roles, event_type_registry). Additive rows.
- RECONCILE counting integrity: re-enable
trg_auto_sync_registry_counts(reported disabled); resolve cross_check LỆCH on CAT-006/007/ALL/MOL/CMP/MAT/023; fix dot-pivot-health cron PATH. (Runtest_counting_contract()after — read-only harness.)
B. DOT registry (Điều 23/35) — pilot 1
- RECONCILE dual count CAT-006 vs CAT-DOT → one canonical CAT + one pivot.
- EXTEND (fix) PIV-104 filter
published→includeactive. - REUSE dot-metadata-fill DOT to fill
operation(50/309),coverage_status(103 null),tier(19 null). - EXTEND Đ35 §11 paired-test retrofit for 178 unpaired DOTs (governed).
- WRAP dot_iu_command_catalog with a test/paired view (no new table).
C. UI Preview Master (Điều 28) — pilot 2
- RECONCILE
ui_pages(37 shipped) ↔ manifest (61 designed): define surface→page mapping; no blind pick of one source. - EXTEND to PG-backed: either birth a
ui_surfacecollection (meta_catalog managed) or adddesign_statustoui_pages; manifest.json becomes a render of a PG query (Đ28 thin-shell). Prefer EXTEND ui_pages over NEW table if surfaces and pages converge. - NEW pivot over the PG surface source (proof: no pivot counts design-surfaces today; ui_pages PIV-008 counts shipped routes only) → replaces hand-baked 61/36/25.
- DEFER IU representation of surfaces (
unit_kind='ui_surface') until Đ44 enacted. - KB-only fix now: correct stale review-log.md (19/4 → 61/16).
D. Workflow design / MOWD (Điều 7/37)
- EXTEND
workflows/workflow_stepswithiu_ref/owner_gov_code/design columns (additive ALTER, dress-rehearsed in prior packs). NOT a 5th Mother — sub-registry under GOV-MOW. - REUSE
workflow_change_requests(dsl_diff) + approval spine for design changes. - NEW
workflow_trigger_designtable (proof:trigger_registryis physical DB triggers — collision; absent today). Await Đ32.
E. Birth & collection (Điều 0-G/36)
- REUSE
fn_pre_birth_check+fn_birth_gate+birth_registryfor any new list/registry. Mechanism proven + reversible. - REUSE DOT-COLLECTION-CREATE (9-step) for collection birth.
F. Approval / governance (Điều 32/37)
- REUSE
approval_requests+apr_approvals(≥2 cross-sign, ai_council+human) + (empty, available)table_proposalsas the universal change-governance spine for ALL list mutations. No new approval system.
G. Event / notification (Điều 45)
- REUSE
event_outboxsingle substrate +iu_outbound_route; flipdry_run=falseper route only via the sovereignfn_iu_route_delivermacro when activation approved. - EXTEND populate empty retry/idempotency policies on routes (config, not new table).
- Note: 99.8% of event_outbox is system/issue_opened — consider a retention/archival pivot, not a schema change.
H. IU / KG (Điều 38/39/44)
- REUSE
information_unit+iu_relation+universal_edges+v_kg_edges_allas the semantic/profile + relationship layer. IU holds narrative/profile; PG registries remain the count/data SoT (no duplication). - EXTEND edges to connect list items (e.g., DOT→law, surface→registry) via universal_edges (enrich in place; no 2nd graph SoT; vector stays OFF).
I. Law / normative (Điều 38/23/45)
- RECONCILE register Đ23 and Đ45 into
normative_registry(they are enacted but absent) — closes the "law no PG query sees" gap. Await Đ38/Đ32 process. - RECONCILE/DEFER deprecate or realign stale
law_catalog(5 rows) vsnormative_registry. - NEW count pivot for normative_registry (none today).
J. Candidate registries (field/input_form/tier) — Điều 32 gated
- DEFER commit until human Đ32 (already dress-rehearsed BEGIN..ROLLBACK, fn_pre_birth_check 5/5). When committed: RECONCILE field_registry vs live
directus_fields(1,482) — field truth stays in directus_fields; field_registry = governance overlay, not a copy.
Classification tally
REUSE: counting engine, birth gate, approval spine, event substrate, IU/KG, DOT scanners, meta_catalog pattern. EXTEND: pivot coverage, workflow iu_ref, ui_pages design_status, route policies, KG edges. RECONCILE: dot dual-count, ui inventories, law_catalog vs normative_registry, Đ23/45 registration, candidate-vs-directus_fields. WRAP: dot_iu_command_catalog test view. NEW (proven-uncovered): workflow_trigger_design, ui_surface pivot, normative count pivot, candidate registries (gated). DEFER: workflow runtime, surface-as-IU, candidate commits, dry_run flip.
Anti-duplication guardrail
Before any NEW: check this package's doc 04 (PG inventory) + doc 06 (ledger). The only justified NEW items are those explicitly proven absent here. Everything an official list needs to be "live" already exists as a reusable mechanism.