PROD: 148 de 2413 vehiculos vivos con carroceria_id NULL (backfill de datos, distinto de 492)
MEDIDO 2026-09-18 (coder02, SELECT only): PROD tiene 148 de 2413 vehiculos vivos con vehiculos.carroceria_id NULL (DEV 2 de 2430). 142 son origen_ingreso legacy_unknown y 6 ssot_import. Re-medido por db03 el mismo dia: el libro nombra carroceria para los 148 y cada uno tiene exactamente 1 candidato vivo en carrocerias. Es OTRA poblacion que MOVILBA-492/366 (esos son el resolver del proyector sobre rutap.vehiculo_historial_normalizado); no se cierra al shipear 492. Es un backfill de datos en PROD: necesita GO fresco de Elazar, superuser y mecanismo declarado (memoria project_carroceria_id_null_prod_gap_2026_09_18). Ruling de Elazar 09-18: PROD se lleva al estado resuelto de DEV. Depende de MOVILBA-501/504 solo si el match usa texto normalizado (id 71 'YUTONG ' con espacio final).
Sub-tickets — 1/1 done
Activity
-
db04-mba-l-ca 2026-09-28 ART: PROD movilba, current snapshot 7 (2026-09-28-1042-parque-rutap.xlsx): AI578AY public.vehiculos id 7032 has carroceria_id NULL; normalized history id 116163, Excel row 5541, resolves raw TODO BUS to live catalog id 12. Installed rutap.materializar_snapshot_raices and reconciliar_snapshot prosrc both omit carroceria_id. Narrow PROD-only guarded repair instrument: docs/migrations/2026-09-28-movilba-505-ai578ay-carroceria-PROD.sql. ROLLBACK rehearsal passed: 1 row updated in transaction, detail view exposed TODO BUS, then rolled back. Awaiting audit before apply. The other NULL rows and systemic importer gap remain open (MOVILBA-520).
-
audit pass: one-row PROD repair artifact only, docs/migrations/2026-09-28-movilba-505-ai578ay-carroceria-PROD.sql, static read + independent PROD ROLLBACK rehearsal of the same statements.
payload
{"scope":"one-row PROD repair artifact only, docs/migrations/2026-09-28-movilba-505-ai578ay-carroceria-PROD.sql, static read + independent PROD ROLLBACK rehearsal of the same statements.","outcome":"pass","evidence":"audit-mba-l-cc 2026-09-28. Guards verified: current_database()='movilba' RAISE-gated; snapshot pinned by id=7 + exact filename + md5; source historial row pinned by vehiculo_id+dominio+snapshot+fila_excel+raw_carroceria+normalizacion_estado='resuelto', independently confirmed carroceria_id=12; catalog target re-verified live (carrocerias.id=12, modelo=TODO BUS, not borrado); UPDATE scoped to id+dominio+origen_ingreso='ssot_import'+borrado_en IS NULL+carroceria_id IS NULL, ROW_COUNT forced =1; postcondition re-reads v_vehiculos_detalle for the repaired value; ROLLBACK is the default, apply requires -v apply=true. No DDL, single UPDATE. Scope is exactly what it claims: this vehicle only, does not touch the other 151 NULL rows or the importer.","reportRef":null} -
db04-mba-l-ca 2026-09-28 12:19 ART: Audit PASS recorded by audit-mba-l-cc for the one-row SQL. Under hub lock movilba_prod.public.vehiculos, applied docs/migrations/2026-09-28-movilba-505-ai578ay-carroceria-PROD.sql with -v apply=true to verified database movilba as postgres; transaction COMMIT. PROD post-query public.v_vehiculos_detalle for AI578AY returns carroceria_id=12, carroceria_modelo=TODO BUS, carroceria_fabricante=TODO BUS. Live public.vehiculos NULL count moved 152/2417 to 151/2417. Source normalized history remains id 116163 with catalog id 12; DEV was not touched. This is a partial fix; item remains open for 151 other rows.
-
db04-mba-l-ca / db
-
db04-mba-l-ca 2026-09-28 ART: PROD snapshot 7 exact reconcile source has 151 rows for the 151 live vehiculos.carroceria_id NULL rows, 151 distinct IDs, all source IDs non-NULL and live in carrocerias. Prepared PROD-only guarded migration docs/migrations/2026-09-28-movilba-505-carroceria-backfill-restantes-PROD.sql. ROLLBACK rehearsal updated exactly 151 vehicles and trigger-archived 151 old rows, detail control AA836QY -> TODO BUS, then rolled back; installed NULL cohort remained 151/2417. Initial postcheck found 18 OTHER vehicles with non-NULL but wrong carroceria_id; scoped postcheck to the 151-row cohort and re-ran successfully. Those 18 are not changed by this artifact and need separate tracking. Awaiting audit PASS before apply.
-
audit pass: PROD backfill of 151 live NULL carroceria_id rows from snapshot 7 via audited MOVILBA-605 reconciler; scope excludes 18 non-NULL wrong-value rows (reported, no write)
payload
{"scope":"PROD backfill of 151 live NULL carroceria_id rows from snapshot 7 via audited MOVILBA-605 reconciler; scope excludes 18 non-NULL wrong-value rows (reported, no write)","outcome":"pass","evidence":"independently verified live: 151 NULL count, snapshot 7 md5, reconciler prosrc md5 all match pins; positive controls AA836QY/AI578AY; archive-count gate; zero-delete preflight","reportRef":null} -
db04-mba-l-ca 2026-09-28 ART: The 18 non-NULL carroceria mismatches encountered by the first broad postcheck are now separately tracked as child MOVILBA-606 with all plate/id mappings. The 505 backfill artifact checks only its pinned 151-row NULL cohort and passed a second PROD ROLLBACK rehearsal; no database change committed. Audit review requested.
-
db04-mba-l-ca 2026-09-28 12:50 ART: Audit PASS verified in BWI, applied guarded PROD-only docs/migrations/2026-09-28-movilba-505-carroceria-backfill-restantes-PROD.sql under hub lock movilba_prod.public.vehiculos to current database movilba as postgres with -v apply=true; transaction COMMIT. Script reported 151 vehicle rows updated and 151 old rows archived by the existing trigger. Post-query: 0 of 2417 live vehicles have carroceria_id NULL; v_vehiculos_detalle AA836QY and AI578AY both show id 12 / TODO BUS. Non-NULL mismatches AA814GR id 10 and AE335EU id 2 remained untouched. Earlier AI578AY one-row fix plus this 151-row backfill completes the NULL cohort. Separate child MOVILBA-606 remains open for 18 non-NULL wrong IDs; no claim of full field convergence.