KB-51A0

09 — Dry-Run Replacement Plan

2 min read Revision 1
rpreplacement-plandry-run2026-06-05

09 — Dry-Run Replacement Plan (Phase 9)

Generated SQL hash

fn_rp_generate_universal_contract_sql_v2 full-text md5 a79c9560b12c36619f8a2c3500fcf63e.

What replacement means here

The generator reproduces the contract BACKBONE (membership + count). It does NOT regenerate the DECORATION the v1 contract bakes into each leg (label, route, drill_action, substrate, warning_flags, badges, reliability). The UI _current stack depends on that decoration. Therefore replacement is NOT a one-line alias swap to the bare backbone.

Two replacement options

  • Option A (candidate only — chosen, doc 10): keep generated_v2 as a reversible candidate; production current stays on the decorated stack. Zero risk to UI.
  • Option B (full repoint — operator, future): build a decorated-on-generated stack (apply the shared decoration layer over generated_v2 instead of over the v1 UNION), re-prove parity on ALL columns (not just backbone), then repoint v_rp_universal_node_ui_contract_current. This retires the hand-maintained v1 UNION.

Dependency list (current stack)

current → current_v2 (live_v2 count correction) → reliability (axis_registry + reliability label model) → contract_v2 (pxt grouping + empty substrate) → contract v1 (the 87-leg hand-maintained UNION = the backbone the generator replaces).

Rollback

99_rollback.sql drops all v2 objects (views + functions). Production v1 stack untouched throughout — rollback is clean.

No-go conditions (must all hold before any repoint)

  • axes_parity_gap 0 and total membership+count gap 0 (currently true).
  • invariant v2 real-fail 0 (currently 0).
  • contract current guard PASS (currently PASS).
  • smoke 15/15 and anti-false-green 6/6 (currently true).
  • full-COLUMN parity proven for Option B (not yet — only backbone proven).

v1 sentinel preservation

v1 generated view and v1 contract UNION are retained as regression sentinels (doc 15 RGT2/RGT4/RGT6). Do not drop until a full-column replacement is proven AND in production.

Back to Knowledge Hub knowledge/dev/reports/architecture/rp-generator-parity-fix-contract-replace-ui-deploy-standby-2026-06-05/09-dryrun-replacement-plan.md