KB-76A8

CHECKPOINT — RP Generator Parity Fix + Contract Replace-Ready + UI Deploy Standby (2026-06-05)

12 min read Revision 1
checkpointrpgenerator-paritycontract-replaceui-deploydeploy-guardautoscaleoom-incident2026-06-05

CHECKPOINT — RP Generator Parity Fix + Contract Replace-Ready + UI Deploy Standby

Date: 2026-06-05 · 20-phase Program Macro executed.

Final status: PARTIAL

Verdict: GENERATOR_BACKBONE_PARITY_PASS__CONTRACT_REPLACE_READY_OPERATOR_GATED__UI_DEPLOY_STANDBY_BLOCKED_BY_GIT. Both generator parity gaps root-caused and fixed; generated contract backbone now reproduces the current contract at 87/87 (membership and count, zero gap); parity/autoscale/deploy dashboards built; replacement decision made safely (candidate applied, production current NOT repointed). Remaining = operator (git push of UI branch; optional contract-backbone repoint) + authority (synthetic-axis official registration, president vote). No engineering blocker remains in the supervision/generator layer.

Execution mode

EXECUTION. Live DB mutation = YES but birth-free (11 additive objects: 9 views + 1 function for generator/validation/autoscale/regression/synthetic + 1 crash-safe deploy-guard function & view; birth_registry 1,200,161 equal before and after the additive apply). No source-IU edit, no canon, no birth, no event activation, no REAL_RUN, no UI push/deploy.

Live mutation: YES (additive/reversible/birth-free)

New objects: v_rp_contract_generator_manifest_v2, fn_rp_generate_universal_contract_sql_v2, v_rp_universal_node_ui_contract_generated_v2, v_rp_universal_node_ui_contract_generated_current_candidate, v_rp_contract_generator_validation_v2, v_rp_contract_generator_validation_summary_v2, v_rp_autoscale_generator_readiness_dashboard_v2, v_rp_generator_parity_regression_v2, v_rp_synthetic_axis_generator_relation, fn_rp_ui_deploy_final_readiness_guard, v_rp_ui_deploy_final_readiness_guard. Rollback: 99_rollback.sql. v1 generator/manifest/contract/aliases untouched (sentinel retained).

OPERATIONAL INCIDENT — 4 OOM crashes of production Postgres (auto-recovered, no data loss)

During Phase 14 deploy-guard development, the first deploy-guard view combined guard + smoke-probe + anti-false-green + autoscale in ONE statement. The smoke probe references the deep contract view-stack ~15x; autoscale pulls summary plus md5(generator-function) plus the manifest chain. In a single statement the PLANNER expanded the deep contract stack dozens of times, exhausting memory; the Linux OOM killer sent signal 9 to the backend, which the postmaster treated as a crash and triggered crash recovery. Reproduced four times (including under EXPLAIN, which only plans — confirming the cost is planner-side, not execution). Each crash dropped all production connections (directus, nuxt) for a few seconds; Postgres auto-replayed WAL and recovered cleanly each time. NO data loss (birth_registry, axis_registry, ownership, trigger_guard all intact; committed DDL survived). Root cause: this VPS cannot plan one statement that references the deep contract stack alongside another deep-contract view. FIX: the deploy guard is now a plpgsql function (fn_rp_ui_deploy_final_readiness_guard) that runs each gate as a SEPARATE, independently-planned statement and aggregates the scalars; a function-scan in FROM is opaque so the caller never builds one giant plan. The naive single-statement guard (section 7 of 01_apply.sql) was neutralized/SUPERSEDED so no operator can recreate the landmine. Verified safe: the function-based guard returns cleanly with no crash.

Dual-path verification

PASS. query_pg read-only matched ssh to docker to psql (statement_timeout disabled for composite views). Baseline and post-fix headline identical on both paths: guard PASS, current 87, generated v2 87, validation per-axis all PASS (0 membership gap, 0 count diff), invariant v2 83/4/0, smoke 15/15, anti-false-green 6/6.

AX-PROCESS generator fix (Phases 2-3)

Root cause: the v1 generated leg bound only wf_process_candidate (19 rows); the current contract adds three verified workflow nodes the leg never emitted — job:cut (count 8, from job_queue distinct job_kind matching the cut prefix), and WF-001 (10) / WF-002 (60) from the workflows table (process_code as node, workflow_steps count). Fix: generated_v2 unions the candidate leg with a job:cut leg and a workflows leg, using the SAME count expressions the current v1 legs use. AX-PROCESS generated now = 22 (19 + 1 + 2), matching current 22. Manifest_v2 carries the corrected AX-PROCESS leg SQL.

AX-PXT generator fix (Phases 4-5)

Root cause: the v1 generated leg bound v_process_trigger_actionability_ledger (the OLD ledger, residual_reconcile object_count 8); the current contract overrides via v_process_trigger_actionability_ledger_live_v2 (residual_reconcile 2). A full side-by-side of the two ledgers showed the ONLY divergence is gap_code PROC:residual_reconcile (8 vs 2); the other 11 gap_codes are identical, so membership stays 12 and only the one count corrects. Fix: generated_v2 binds the live_v2 ledger directly (no static literal). AX-PXT count diff now 0.

Generated contract v2 (Phase 6)

v_rp_universal_node_ui_contract_generated_v2 = 87 rows. BASE/TOPIC/TRIGGER legs identical to v1 (already parity-PASS); AX-PROCESS and AX-PXT legs corrected. Carries provenance columns (source_view, leg_kind, is_registry_backed, is_synthetic). Generated full-text md5 a79c9560b12c36619f8a2c3500fcf63e (was 2a9c1f00 for v1). Applied also as v_rp_universal_node_ui_contract_generated_current_candidate (explicit replacement candidate; NOT repointed into production current).

Parity validation (Phases 7)

v_rp_contract_generator_validation_v2 (per axis) and v_rp_contract_generator_validation_summary_v2: axes_parity_pass 5/5, axes_parity_gap 0, membership gap 0 both directions, count diffs 0. Decoration coverage on the 87 matched nodes: route 87/87, action 87/87, reliability 87/87. invariant_parity true (all 87 generated nodes map to invariant v2 with 0 FAIL). substrate_parity = FALSE and surfaced honestly (not hidden): some current nodes have NULL final_substrate_ref by design (empty-by-design WPC bootstrap/unclassified and a few synthetic nodes) — a decoration-coverage observation, not a backbone parity break. safe_to_replace_v1_backbone = TRUE. Verdict GENERATOR_BACKBONE_PARITY_PASS__REPLACE_READY_BACKBONE.

Autoscale dashboard v2 (Phase 8)

v_rp_autoscale_generator_readiness_dashboard_v2: 5 axes (2 registry-backed, 3 synthetic), membership gap 0, count gap 0, route/action/reliability/invariant parity true, safe_to_replace_v1_backbone true, guard PASS. Verdict GENERATOR_PARITY_PASS_OPERATOR_REPLACE_REQUIRED.

Replacement decision (Phases 9-10)

SAFE DECISION = apply generated_v2 as a reversible candidate; DO NOT repoint the production current alias. Rationale: the generator reproduces the backbone (membership + count) but does NOT regenerate the decoration layer (label/route/substrate/badges/reliability), which the v1 contract bakes into each leg and which the UI _current stack depends on. Repointing the current alias to the bare backbone would lose decoration and break the UI package. Full-contract repoint is an operator step: rebuild the decorated stack on top of the generated backbone, re-prove parity on ALL columns, then repoint — with 99_rollback staged. v1 sentinel preserved. No authority/policy blocker on the backbone itself.

Post-replacement invariant proof (Phase 11)

No production replacement was performed (candidate only), so the production stack is unchanged: invariant v2 83/4/0, proof computed v2 ALL_AXES fail 0, acceptance v3 RP_FULLPOP_DRILL_PASS_WITH_EXPECTED_BLOCKERS, deploy guard PASS, smoke 15/15, anti-false-green 6/6 — all re-confirmed post-DDL.

UI standby status (Phases 12-13)

UI unchanged; rides _current (decorated), NEVER binds the generated view. Branch feat/rp-current-supervision @ d04d8e5624f92d26b868c93adc50fca5e2f07b7f present in worktree /opt/incomex/docker/nuxt-repo/web-rp-current; committed tree at that SHA matches SSOT. Untracked files in the worktree (.eslintrc.js, .prettierignore, app.config.ts, etc.) are the gitignored lint-toolchain configs copied in for lint, not committed-tree drift. NOT pushed/deployed (divergent git, no agent creds). Operator deploy = apply patch / push branch, rebuild incomex-nuxt, curl the 11 routes.

Deploy readiness guard (Phase 14)

v_rp_ui_deploy_final_readiness_guard (function-backed, crash-safe): verdict UI_DEPLOY_BLOCKED_BY_GIT, db_side_ready true (guard PASS, smoke 15/15, anti-false-green 6/6, generated_v2 cardinality 87/87), generator_verdict GENERATOR_PARITY_PASS_OPERATOR_REPLACE_REQUIRED. Generator is NOT a UI blocker (UI binds _current, not generated).

Synthetic axis relation (Phase 15)

v_rp_synthetic_axis_generator_relation: the generator BACKBONE binds the synthetic source views directly (AX-BASE pivot contract, AX-PXT live_v2 ledger, AX-TRIGGER trigger surface) and does NOT require official axis registration. Only the full registryization (the 58 requires_view_edit reduction) and official RP depend on authority (AX-PXT candidate-register + live-ledger refactor; AX-TRIGGER owner + president register; president PROC-OWN vote). generator_backbone_ready_now = true for all 5 axes.

Regression tests v2 (Phase 16)

v_rp_generator_parity_regression_v2: 6/6 PASS with teeth — RGT1 AX-PROCESS 22==22; RGT2 TEETH (v1 generator still misses 3, gap 3 — rule can fail); RGT3 AX-PXT residual corrected to live 2; RGT4 TEETH (v1 generator still emits stale 8 — rule can fail); RGT5 anti-false-green 6/6; RGT6 v1 generated sentinel retained.

Safety / no-fake audit (Phase 17, UNCHANGED)

official AX-PROCESS RP 0 (axis_assignment AX-PROCESS 0) · governance_object_ownership 0 · axis_registry 2 (0 active; AX-TRIGGER still synthetic, no canon) · axis_assignment 25 · PROC-OWN 5 requests / 0 votes · process_dot_runtime.real_run_enabled false (dry_run_only true, execute_enabled false, emit_enabled false, operator_runtime_enabled false) · event_type active 30 (no event activation) · trigger_guard_alerts 129 · all DDL birth-free · v1 sentinel retained · no source-IU edit · no UI push/deploy. birth_registry 1,200,161 at apply (before==after); later reads 1,200,292 = background drift (entity_labels/system_issues/changelog, some plausibly from the 4 crash-recovery cycles); DDL-attributable births = 0.

Final verdict

PARTIAL — generator backbone parity PASS (membership+count 87/87, 0 gap), contract replacement candidate apply-ready (production current preserved on decorated stack), all validation/autoscale/regression/deploy dashboards built and green, UI standby intact. Safe-engineering exhausted; operator + authority remain.

Exact blockers

  1. Operator/git: push feat/rp-current-supervision (d04d8e5) or apply patch, rebuild incomex-nuxt, post-deploy curl smoke. No agent creds; divergent git.
  2. Operator/contract repoint (optional, safe-eng-ready): build decorated-on-generated stack, re-prove full-column parity, repoint current alias, then NO_HARDCODE backbone. Backbone parity already proven; only the decoration-equivalence rebuild + repoint remain.
  3. Authority: president PROC-OWN vote (official RP); AX-PXT candidate-register + live-ledger refactor; AX-TRIGGER owner + president register (unlocks the 58 view-edit registryization).

Next macro

RP_UI_CURRENT_OPERATOR_DEPLOY_AND_GENERATOR_CONTRACT_REPLACE_THEN_FINAL_ACCEPTANCE — operator pushes the UI branch and (optionally) applies the generated backbone via the decorated-on-generated rebuild; then final RP acceptance. Authority track (president vote, synthetic-axis registration) proceeds in parallel.

Artifacts

SQL and docs at /opt/incomex/docs/mcp-writes/rp-generator-parity-fix-2026-06-05/ (01_apply.sql with section 7 neutralized, 02_verify.sql, 04_deploy_guard_fn.sql = canonical crash-safe guard, 99_rollback.sql). Report docs: knowledge/dev/reports/architecture/rp-generator-parity-fix-contract-replace-ui-deploy-standby-2026-06-05/00..19. Prior SSOT: checkpoint-rp-ui-current-productionization-autoscale-generator-smoke-2026-06-05.md.

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