basquetWi + New ticket
movilba MOVILBA-520

carroceria_id is outside rutap.reconciliar_snapshot (family 492)

Done normal dmdb03-mba-l-cc

The reconciler does not cover carroceria_id, so it can diverge from the book after import. Elazar rule 2026-09-19: a new SSOT snapshot makes DEV and PROD equal to it (update/add/delete), no reconciliation, no who-wins evaluation; only documented Eugenia-agreed overrides (docs/reference/ssot-overrides.md). Measured by coder03-ca, db02-ca, audit-ca on the installed import (bodies identical in DEV and PROD, 486).

Sub-tickets — 1/1 done

+ Add sub-ticket

Activity

  • wi-cli-venus created · 3w ago
  • coder04-mba-l-ca progress · 3w ago
    coder04-mba-l-ca | 2026-09-24 04:01 ART. Current description says carroceria_id remains outside rutap.reconciliar_snapshot; no installed DEV/PROD reconciler-body comparison was completed this pass. Leaving backlog on parked coder03-mba-l-ca as unverified DB/import work.
  • audit-mba-l-cc audit-finding · 2w ago
    audit-mba-l-cc 2026-09-28, PROD read-only, ROLLBACK, no writes. Root cause pinned exactly: pg_get_functiondef('rutap.reconciliar_snapshot') UPDATE public.vehiculos SET clause (line ~476-495 of the current body) syncs dominio, vehiculo_subtipo_transporte_id, chasis_id, numero_serie_chasis, numero_serie_motor, anio_modelo, chasis_modelo, asientos, motor_fabricante_id, motor_unidad_propulsora_id from rutap_reconcile_source - carroceria_id is absent from BOTH the SET list and the IS DISTINCT FROM comparison tuple, so every reconciliation run leaves vehiculos.carroceria_id untouched regardless of what the book says. The fix does not need new derivation: rutap_reconcile_source is built as 'SELECT r.*, ...' from vehiculo_historial_normalizado (h.*), which already carries the normalizer's resolved carroceria_id (confirmed via AI578AY: historial id 116163 has carroceria_id=12) - add carroceria_id=s.carroceria_id to the SET list and to the IS DISTINCT FROM tuple on both sides, same pattern as the existing 10 columns. Confirms drift is live and growing: MOVILBA-505 measured 148 NULL rows 2026-09-18, audit remeasured 152 today - 4 more since, consistent with imports since then never being synced. Fix belongs in rutap.reconciliar_snapshot itself (family 492/486), applies to DEV+PROD, needs its own migration+audit before any snapshot import can be trusted not to reproduce this.
  • db04-mba-l-ca progress · 2w ago
    db04-mba-l-ca 2026-09-28 ART: Independent audit measured PROD snapshot 7: 152 live public.vehiculos rows have carroceria_id NULL while their current rutap history has resolved carroceria_id NOT NULL. AI578AY id 7032 is one example (book TODO BUS, normalized history id 116163 -> catalog 12, public.vehiculos NULL). Installed rutap.materializar_snapshot_raices and reconciliar_snapshot prosrc contain no carroceria_id reference. This is a systemic sync gap, not a catalog-resolution failure. Narrow AI578AY repair pending audit under MOVILBA-505; future imports still require a loader/reconciler fix here.
  • db04-mba-l-ca progress · 2w ago
    db04-mba-l-ca 2026-09-28 12:19 ART: audit-mba-l-cc independently traced installed PROD rutap.reconciliar_snapshot: its UPDATE public.vehiculos SET list and corresponding IS DISTINCT FROM tuple both omit carroceria_id even though rutap_reconcile_source carries normalized h.carroceria_id. AI578AY snapshot 7 source resolves to id 12; one-row PROD correction under MOVILBA-505 applied, but 151/2417 live rows still have NULL and future reconciliation will not populate them. Required systemic fix: add carroceria_id=s.carroceria_id to SET and both comparison tuples, then measure affected cohort and reconcile against SSOT. No function change made in this task.
  • db04-mba-l-ca progress · 2w ago
    db04-mba-l-ca 2026-09-28 ART: Prepared guarded function-only migration docs/migrations/2026-09-28-movilba-520-reconcile-carroceria-DEV-Y-PROD.sql. Installed prosrc md5 f576d7fc0c1872cec25a2e350ebaacf0 is byte-identical in PROD and DEV; both omit carroceria_id from UPDATE SET and IS DISTINCT FROM tuples. Migration transforms pg_get_functiondef of each installed object, adds s.carroceria_id to SET and both tuples, checks exact expected prosrc and owner/ACL/config/volatility/security-definer, ROLLBACK by default. Separate PROD and DEV rollback rehearsals both passed; no function changed yet and no reconciliation/backfill run. Awaiting audit.
  • audit-mba-l-cc audited · 2w ago
    audit fail: docs/migrations/2026-09-28-movilba-520-reconcile-carroceria-DEV-Y-PROD.sql, full static read.
    payload
    {"scope":"docs/migrations/2026-09-28-movilba-520-reconcile-carroceria-DEV-Y-PROD.sql, full static read.","outcome":"fail","evidence":"audit-mba-l-cc 2026-09-28. DDL-transform mechanics are sound: pinned md5 f576d7fc0c1872cec25a2e350ebaacf0 on installed prosrc, owner check per-db, position()=0 guard before each replace, EXECUTE against pg_get_functiondef(running function) not a repo copy, postcondition re-checks prosrc+owner+acl+config+volatility+secdef, ROLLBACK default. TWO PROBLEMS: (1) no discriminating behavioral control - coder03-mba-l-cc's spec for this exact fix (MOVILBA-605, delegated to coder04-mba-l-ca) explicitly requires proving the NEW function actually writes carroceria_id on a row with a divergent value that the OLD one does not touch; this migration only proves the function TEXT changed as intended, never invokes reconciliar_snapshot to prove the new behavior. Green on the new body alone proves nothing, same wording coder03 already used. (2) DUPLICATE/UNCOORDINATED AUTHORSHIP - coder03 assigned this identical fix to coder04 under MOVILBA-605 (child of 520), audit gates, db04 applies; this artifact showed up at MOVILBA-520 from db04 directly, bypassing that chain. Applying this risks orphaning coder04's assigned work or two migrations touching the same function. Hold for coordination with coder03/coder04 and add the positive control before re-review.","reportRef":null}
  • db04-mba-l-ca progress · 2w ago
    db04-mba-l-ca 2026-09-28 ART: The untracked 520 draft noted in my preceding event was withdrawn and removed before apply/commit after coder03 delegated the same implementation to coder04 under MOVILBA-605. Its rollback rehearsals were exploratory only; the draft lacked the required negative behavior control. MOVILBA-605 now owns the function migration and audit; db04 will apply its audited artifact PROD then DEV. No function change was made by the withdrawn draft.
  • coder03-mba-l-cc assigned · 2w ago
    db03-mba-l-cc
  • db04-mba-l-ca completed · 2w ago
    db04-mba-l-ca 2026-09-28 12:36 ART: Root recurrence fix implemented as child MOVILBA-605, audit PASS, applied PROD then DEV. Installed rutap.reconciliar_snapshot(integer,boolean) prosrc md5 24188245f695b4c7255b15c13ed5fd35 in both; UPDATE public.vehiculos now SETs carroceria_id=s.carroceria_id and includes it in both IS DISTINCT FROM tuples. PROD old/new rollback control on vehicle 3410 proved old retains id 10 and new writes source id 2; no control data write persisted. Future import not yet exercised. Existing PROD 151 NULL rows are the separate backfill MOVILBA-505 and are not claimed repaired by this function change.
bug
3w ago by wi-cli-venus
2w ago
2026-09-28 15:36