basquetWi + New ticket
movilba MOVILBA-797

Converge manual chassis catalog IDs across PROD and DEV

In progress normal dmdb04-mba-l-ca

Elazar corrected the MOVILBA-728 conclusion on 2026-10-14: catalog IDs are intentionally manual and must denote the same item in PROD and DEV. Prior read-only census found 8 chassis names with different IDs, including ID 143 mapping to different chassis; those values are not harmless surrogate drift. Refresh exact current PROD/DEV catalog and FK/resolver census after later imports, choose canonical PROD IDs per PROD-first policy, design fail-closed DEV convergence preserving FK references and user-created/edited rows, rehearse under ROLLBACK, request focused audit, then apply only within the approved scope. Do not treat matching names or per-base literals as closure. Coordinate with MOVILBA-796 deploy; no catalog write while it ships.

Sub-tickets

No sub-tickets.
+ Add sub-ticket

Activity

  • coder03-mba-l-ca created · 2d ago
  • db04-mba-l-ca statusChanged · 2d ago
    Fresh PROD/DEV SELECT-only census underway; no catalog or reference writes while MOVILBA-796 deploy is in flight.
  • db04-mba-l-ca progress · 2d ago
    2026-10-14 11:10 ART, SELECT-only after snapshot PROD12/DEV22. Both have 33 live public.chasis semantic rows, no name-only differences, and 101 rutap.chasis_resolver keys with identical status and semantic target; 20 resolver IDs differ. Nine chassis IDs differ (new ninth from 795): DEV->canonical PROD 140->134 AGRALE MT15; 143->135 AGRALE MT17; 138->136 KING LONG XMQ6127E; 145->138 MB BMO1621; 142->139 MB BMO1721; 136->140 MB O500U; 1000000001->146 MB OH1621/62; 139->142 SCANIA 280 B4X2; 146->143 SCANIA K250 B4X2. Seven same numeric IDs currently mean different chassis across bases. In DEV these nine carry 279 public.vehiculos refs (14 app-created), 608 normalized-history refs (59 app-origin), 20 resolver refs, and 598 public.vehiculos_archive logical refs; three live FK constraints to chasis are NOT DEFERRABLE. Since MOVILBA-9 log purge, audit_log can establish only 1 retained UPDATE among 265 import-origin affected vehicles, not whether others were edited historically. No writes. Safe plan: DEV-only one transaction, exact semantic/preimage gates, backup; temporarily defer the three FKs, stage the nine PKs through unused negative IDs, set PROD IDs, remap all three FK tables and archive, assert unchanged non-ID row images, semantic joins and zero orphans, restore FK modes; default ROLLBACK plus negative mutants, focused audit, then apply only after decision. Vehicle UPDATE invokes archive trigger (279 new preimages expected) and rewrites 598 pre-existing archive numeric refs; no vehicle/history/resolver row deletion. Decision needed: Elazar must explicitly allow semantic-preserving FK remap of protected DEV user-created/edited rows and archive ID rewrite; literal DEV no-touch rule otherwise conflicts with physical ID convergence. Root recurrence: applied 795 inserted chasis without explicit id, yielding PROD146 vs DEV1e9; chasis.id still DEFAULT nextval in both. Future shared catalog rows must carry PROD ID explicitly into DEV; sequence/default safeguard needs scope before declaring convergence durable.
task
2d ago by coder03-mba-l-ca
2d ago