KB-4250

11 · Next T1 Implementation Order (ordered backlog with DDL sketches)

7 min read Revision 1
terminal2t1-implementation-orderbacklogddl-sketchp0p1p22026-06-05

11 · Next T1 Implementation Order

Ordered, dependency-respecting backlog. Each item: birth-free, reversible (CREATE OR REPLACE + 99_rollback.sql), no authority unless marked P3. Build in this order so each step is independently verifiable.


STEP 1 (P0) — Canonical _current + guard [doc 02]

CREATE OR REPLACE VIEW v_rp_universal_node_ui_contract_current AS
  SELECT * FROM v_rp_universal_node_ui_contract_reliability;
-- + v_rp_contract_version_registry (lifecycle SSOT, seed 4 rows)
-- + v_rp_contract_current_guard (rowcount==87, col superset, 0 null route/action → PASS/FAIL)
-- + v_rp_dynamic_drill_proof_matrix_current, v_rp_dynamic_drill_ui_acceptance_dashboard_current

Verify: _current = 87 rows; guard = PASS. Author-Ready Follow-up (law §4F): reuse the reliability view as-is; do NOT re-author it.

STEP 2 (P0) — Full-population drill invariant [doc 04]

CREATE OR REPLACE VIEW v_rp_full_population_drill_invariant AS
  WITH pop AS (SELECT … FROM v_rp_universal_node_ui_contract_current
               UNION ALL SELECT … FROM v_rp_pxt_grouping_surface /*child groups*/)
  SELECT *, <R0..W3 CASE ladder> AS drill_integrity FROM pop;
-- substrate_represents_count via v_rp_node_final_substrate_contract (declared) or cardinality probe
-- + v_rp_drill_invariant_coverage (rowcount + no-uncovered)

Verify (regression): with _current→reliability ⇒ 0 FAIL_*; temporarily pointing the invariant at v1 ⇒ 12 FAIL_* (10 PXT + 2 empty). Wire v_rp_contract_current_guard to FAIL on any FAIL_*.

STEP 3 (P0) — Computed proof matrix [doc 05A]

CREATE OR REPLACE VIEW v_rp_dynamic_drill_proof_matrix_computed AS
  SELECT node_code AS case_id, axis_code, scenario_label, …,
         drill_integrity AS verdict   -- COMPUTED; no 'PASS' literal, no hardcoded node list
  FROM v_rp_full_population_drill_invariant;
-- keep curated 26-case matrix as examples; add agreement guard (curated_expectation==invariant_verdict)

Verify: grep shows no verdict string-literal; flipping bound contract to v1 surfaces ≥1 FAIL in the computed proof.

STEP 4 (P1) — axis_registry binding + governance columns [doc 03/06]

ALTER TABLE axis_registry
  ADD COLUMN source_kind text, ADD COLUMN governance_class text,
  ADD COLUMN route_prefix text, ADD COLUMN count_semantics text,
  ADD COLUMN reliability_source text, ADD COLUMN child_grouping_policy_ref text,
  ADD COLUMN ui_render_kind text, ADD COLUMN derived_from jsonb;
-- backfill AX-TOPIC, AX-PROCESS
-- propose 3 candidate/derived rows: AX-BASE(DERIVED_STRUCTURAL), AX-PXT(DERIVED_CROSS, derived_from),
--                                   AX-TRIGGER(CANDIDATE)  -- status NOT active; owner ratifies

Verify: v_rp_synthetic_axis_register_gap shows 0 unlabeled synthetic; DDL is additive/birth-free; rows are candidate (no auto-active).

STEP 5 (P1) — Full reliability field contract + gov_sync [doc 05B/07]

  • Rebuild reliability decorator joining the 5 detectors (static_literal, synthetic_gap/governance_class, lane_split, adapter_coverage, dedup_gap).
  • Emit final fields: reliability_label(15-vocab precedence), source_scope(4-value), confidence_score(composite), lane_code(real lane), count_semantics(additivity), warning_flags(node∪detectors), blocker_type(+operator), next_action(ledger-style), gov_sync_state.
  • Repoint _current to the rebuilt decorator (still a superset → STEP 1 alias unchanged). Verify: stale-literal node ⇒ reliability_label=STALE; AX-PXT ⇒ source_scope=DERIVED; no node has gov_sync_state=RP_VISIBLE_NOT_GOVERNED; no bare count without scope+label.

STEP 6 (P1) — Registry-driven base (kill the UNION) [doc 03]

  • fn_rp_axis_nodes(axis_code) + v_rp_universal_node_base iterating axis_registry.
  • Repoint decorator chain onto the new base; output columns byte-identical to current v1 (surgical-drift only).
  • Retire v1/v2/reliability → SUPERSEDED; _current resolves to the registry-driven view.
  • Move grouping threshold → rp_grouping_policy; route prefixes → route_prefix. Verify: _current still 87 nodes, identical node_codes; a test registry row makes a new axis appear with zero view/UI edits; grep shows no axis-code literal in the base except the registry iteration.

STEP 7 (P2) — Adapter freshness + scanner heartbeat [doc 08]

  • v_rp_adapter_freshness (SLA), v_rp_scanner_heartbeat (reconcile adapter/scanner logs + miss alert, birth-free).
  • Propagate PARTIAL_SOURCE/STALE_ADAPTER to nodes. Verify: kb_sop nodes flagged PARTIAL; heartbeat shows a successful run within SLA.

STEP 8 (P2) — Data-debt cleanup [doc 05/07]

  • Refactor PXT ledger static literals → live subqueries (residual 8→2, job_queue 8→13).
  • Label/segregate MTX-TEST + PIV-020 out of AX-BASE headline counts; resolve phantom PIV-301/302/303/310 (label or remove from referenced-not-built). Verify: v_rp_static_literal_detector stale=0; referenced_not_built resolved/labeled.

STEP 9 (P1, when UI source access) — UI binding + badges [doc 09]

  • Repoint all RP pass-through routes to _current; grep gate (0 _vN refs).
  • Extend drill.vue render model: badges (reliability/governance/source_scope/warning_flags) + drill_integrity render branch; lint "no axis_code switch". Verify: grep 0 _vN; FAIL never renders green; synthetic test axis renders with no new component. (Operator deploy is P3.)

STEP 10 (P3 — NOT T1; authority/operator)

President votes PROC-OWN-01..05 → official RP; AX-TRIGGER (Điều-39) + AX-PROCESS (GOV-MOW) owners; REAL_RUN/event flips; UI operator push/PR/merge/deploy; kb_sop full adapter.


Dependency graph

STEP1 ─▶ STEP2 ─▶ STEP3
  │        └────────────▶ (guard wired)
STEP4 ─▶ STEP5 ─▶ STEP6
STEP4 ─▶ STEP6
STEP7, STEP8  (independent, after STEP5)
STEP9  (after STEP1; needs UI source access)
STEP10 (authority; after engineering)

STEP 1–3 are the trust-critical P0 trio (deployable today, ~half-day). STEP 4–6 are the registry/reliability P1 core. STEP 7–9 are hardening. STEP 10 is authority-gated.

Guardrails for every step (law)

  • CREATE OR REPLACE only; ship a paired 99_rollback.sql.
  • birth-free: never INSERT into birth-triggered tables; axis_registry rows are candidate/derived, owner-gated.
  • dual-path verify (query_pg RO == ssh→docker→psql); confirm birth_registry before==after.
  • no-fake: official RP stays 0; authority untouched; divergences labeled.
Back to Knowledge Hub knowledge/dev/reports/architecture/parallel-terminal2-rp-canonical-contract-design-alignment-technical-spec-2026-06-05/11-next-t1-implementation-order.md