Imported open RUTAP period carries BAJA absent from source (AG202SZ)
DEV snapshot 18 row rutap.vehiculo_historial_normalizado id 274367, AG202SZ, import-origin, maps to Base row 4145. Source row has Tramite=Alta, Fecha_Baja blank, and the workbook has no Estado column; therefore BAJA is not present in source. Persisted history has catalog estado BAJA (117) with trámite ALTA (317). Before the separate MOVILBA-555 app repair, the measured canonical BAJA/ALTA shape was 2 rows total: 1 app-origin and 1 import-origin. The app-origin LB500EG row was repaired separately; AG202SZ remains. Locate which import, projection, materialization, reconciliation, or later-write path introduced BAJA and verify with read-only source-to-row evidence. Current location of the state change is unproven. Do not repair AG202SZ until cause and a single safe instrument are established. Parent MOVILBA-155.
Activity
-
parent=#3153
-
db04-mba-l-ca 2026-09-28 ART: Located the state writer in INSTALLED rutap.proyectar_snapshot(bigint), prosrc md5 5736de89901d9e49faa008d609df545c in DEV and PROD. Its open-import UPDATE sets h.estado_id=dc.estado_id where h.estado_id IS NULL, copying the PRE-reconciliation VDC state rather than a book field. DEV snapshot 18 AG202SZ history id 274367 (Base row 4145, Tramite Alta, Fecha_Baja blank) was normalized 2026-09-20 03:46:26.214455; vehiculos_datos_colectivos_archive for vehicle 4433 contains old estado_id 117=BAJA at that exact timestamp, while current VDC estado_id 116=ALTA. This pins the mechanism: projector copied BAJA, reconciliation later corrected VDC, history remained stale. Same shape also affects DEV AC098EJ history id 270131 (row 3495, open Modif), archived VDC BAJA at the same timestamp; exact cohort 2 in DEV snapshot18. PROD snapshot7 has 0 imported open BAJA history rows where current VDC is ALTA; AG202SZ current open history id 117992 is ALTA. Current source book has no Estado column. docs/reference/rutap-transform-rules.md section 4 says imported history estado_id is NOT backfilled when the book does not say it; the installed projector contradicts that rule. No DB write; a future-function correction and DEV two-row repair need audited scope before apply.
-
db04-mba-l-ca 2026-09-28 ART — Correction to my 15:59 progress: the proposed removal of rutap.proyectar_snapshot W5 is NOT justified. docs/reference/rutap-transform-rules.md §4 is older than completed MOVILBA-333 (2026-09-08), which expressly requires estado_id on imported OPEN normalized periods from the live ficha and NULL on closed periods; current W5 enforces that design. The observed defect remains DEV AG202SZ and AC098EJ imported open rows with stale BAJA while current VDC is ALTA. W5 writes only where h.estado_id IS NULL and therefore cannot repair existing wrong non-NULL state. Audit has been asked to assess safe repair and prevention; no DB write.
-
db04-mba-l-ca 2026-09-28 ART — Source-of-authority check: MOVILBA-333 events --full records Elazar GO 2026-09-08 00:20 ART for UPDATE on latest-snapshot imported OPEN rows, estado from ficha; 333 completed 00:50 with rutap.proyectar_snapshot W5 setting estado_id=dc.estado_id and G1 requiring 0 NULL open/0 non-NULL closed. That postdates docs/reference/rutap-transform-rules.md §4 (2026-08-24), which says no historial estado backfill. Audit initially recommended removing W5 from the older paragraph; I escalated the explicit conflict to audit and coder03 before any DDL/data. No write.
-
db04-mba-l-ca 2026-09-28 ART — Draft for audit, NOT RUN: docs/migrations/2026-09-28-movilba-579-estado-historial-post-reconcile-DEV-Y-PROD.sql. Installed reconciler prosrc md5 24188245f695b4c7255b15c13ed5fd35 in PROD movilba and DEV movilba_dev; same one-occurrence insertion anchor in both installed definitions. The importer runs projector before reconciler; W5 copies pre-reconcile VDC state. Draft adds post-VDC-update synchronization of this snapshot's imported open history plus a zero-divergence assertion. PROD positive control temporarily changes AG202SZ history id117992 ALTA->BAJA, invokes old and candidate real reconciler with each subtransaction intentionally rolled back; old must leave BAJA, new must restore ALTA. DEV does not invoke reconciler; it repairs only ids274367 AG202SZ and270131 AC098EJ, guarded BAJA history / ALTA current VDC / snapshot18. Default transaction ROLLBACK, apply=true required. Audit PASS required before any run/apply.
-
audit pass: reconciler post-reconcile history sync (W5/333-compatible), real old-vs-new PROD control (rolled back), 2-row DEV repair w/o invoking DEV reconciler
payload
{"scope":"reconciler post-reconcile history sync (W5/333-compatible), real old-vs-new PROD control (rolled back), 2-row DEV repair w/o invoking DEV reconciler","outcome":"pass","evidence":"independently verified: param names, reconciler md5 24188245..., PROD snapshot7 pins, control row 117992 live ALTA/ALTA; DEV repair scoped to exact (id,dominio) pairs, no reconciler invoked per DEV provenance rule","reportRef":null} -
db04-mba-l-ca 2026-09-28 ART — DEV provenance check (SELECT-only, movilba_dev): both target history rows are origen=import and their roots have origen_ingreso=ssot_import (vehicle3530 AC098EJ; vehicle4433 AG202SZ), which proves how the roots were inserted, NOT that they were never edited. public.audit_log id940 records a user UPDATE to vehiculos id4433 on 2026-09-15 12:13 ART, fields dominio/subtipo/serial/model/motor/chasis/carroceria/asientos; no audit_log row was found for vehicle3530 or either history-row id. The user root edit predates the 09-20 snapshot18 normalization. Neither row's post-insert user-edit absence is established by origen_ingreso. Scope question sent to coder03/audit; draft not run/applied.
-
db04-mba-l-ca 2026-09-28 ART — Uncommitted draft relocated per shared-checkout promotion rule from docs/migrations/ to /data-lezama/movilba/migration-evidence/2026-09-28-movilba-579-estado-historial-post-reconcile-DEV-Y-PROD.sql; SHA256 unchanged 7494c93d9928599e212d9decb646d5bb9961ee48595f2b87d92456f348458100. Repo source path is now absent/untracked status clear for this item. Artifact remains NOT RUN/APPLIED and is held pending PROD-prevention/DEV-provenance scope ruling. Audit PASS on the earlier bytes remains recorded but no apply until scope is settled.
-
db04-mba-l-ca 2026-09-28 ART — PROD movilba function leg APPLIED after audit PASS and rollback rehearsal. Audited artifact SHA256 7494c93d9928599e212d9decb646d5bb9961ee48595f2b87d92456f348458100 run with -v apply=true; old-vs-new real reconciler control returned old BAJA 117, new ALTA 116, both control invocations rolled back; outer transaction COMMIT. Installed rutap.reconciliar_snapshot(integer,boolean) prosrc md5 now 316757ebb51531c3bddff4e2fbec02b7, owner movilba_owner. Read-only postcheck: 1602 open imported rows in snapshot7, 0 divergent vs live VDC, 0 NULL; AG202SZ history id117992 remains ALTA116. No PROD data repair. Evidence: /data-lezama/movilba/evidencia/MOVILBA-579/prod-rehearsal.log, prod-apply.log, prod-postcheck.log. DEV leg pending.
-
db04-mba-l-ca 2026-09-28 ART — Audited artifact SHA256 7494c93d9928599e212d9decb646d5bb9961ee48595f2b87d92456f348458100 APPLIED PROD then DEV under exact-resource locks; both default-ROLLBACK rehearsals passed first. PROD real-function control: old 117 BAJA, new 116 ALTA, both subtransactions rolled back; COMMIT changed function only. DEV COMMIT changed function and imported open history ids270131 AC098EJ and274367 AG202SZ from BAJA117 to current VDC ALTA116; no DEV reconciler invocation. Both installed prosrc md5 316757ebb51531c3bddff4e2fbec02b7. In both current snapshots, imported open BAJA-history/ALTA-ficha cohort now 0. DEV broader parity 1599 open imported rows, 1 divergence remains: AF894KE history ALTA116 vs VDC BAJA117; audit_log id1248 shows user changed estadoId in VDC on 09-23, and archive has prior ALTA116 at same timestamp. Preserved this DEV test edit; not MOVILBA-579's stale-BAJA defect. Evidence /data-lezama/movilba/evidencia/MOVILBA-579/{prod,dev}-*.log. Final migration still awaiting repository SHIP/commit.
-
db04-mba-l-ca 2026-09-28 ART — Provenance clarification per coder03: DEV AG202SZ's app audit_log id940 is an UPDATE of public.vehiculos id4433 on 2026-09-15 12:13 ART, changes array excludes estadoId; the imported normalized history row id274367 has source fecha_alta 2026-09-17 and was created/normalized 2026-09-20, after that vehicle edit. This audit event does not modify the target history row. AC098EJ target is imported history id270131, created/normalized 2026-09-20. origen_ingreso=ssot_import on both roots proves INSERT provenance only, not absence of later edits. audit_log sees the app path; direct psql writes by any lane leave no audit_log row, so absence is not proof of no direct writes. The applied migration's discriminator WAS exercised in PROD: under rolled-back subtransactions, old reconciler left temporary witness history BAJA117 and new reconciler restored it to ALTA116 (prod-rehearsal.log and prod-apply.log). DEV two-row repair was separately guarded and rollback-rehearsed. No claim of universal untouched provenance.
-
db04-mba-l-ca 2026-09-28 ART — VERIFIED DONE and SHIPPED. Commit d6fe6dda (v5.6.90) tracks the audited migration at docs/migrations/2026-09-28-movilba-579-estado-historial-post-reconcile-DEV-Y-PROD.sql, SHA256 7494c93d9928599e212d9decb646d5bb9961ee48595f2b87d92456f348458100; checkout clean. Fresh SELECT-only checks against PROD movilba and DEV movilba_dev: installed rutap.reconciliar_snapshot(integer,boolean) prosrc md5 316757ebb51531c3bddff4e2fbec02b7 in both; imported open BAJA history with ALTA ficha = 0 in each current snapshot. DEV ids270131 AC098EJ and274367 AG202SZ are import-origin and estado_id116 ALTA. PROD data had no repair; only preventive DDL there. PROD old/new real-function control was exercised in rolled-back subtransactions and the DEV two-row write in a rollback rehearsal before apply. AF894KE's separate DEV user-changed ficha BAJA remains deliberately preserved and is documented in the item. A later full SSOT import was not exercised by this migration.