movilba
MOVILBA-665
dev01: 'Creado por' figura 'Sistema - Importacion' en dominios dados de alta por los agentes; la ultima alta (AI357EG) si muestra el nombre
Done high
amaudit-mba-l-cc
Reported by Lean in the online tracker, Para Elazar new row 48 (download 2026-10-02-1248, tagged MOVILBA-632 there): '"Creado por" figura como "Sistema - Importacion" en dominios creados por agentes. La ultima alta (AI357EG) figura correctamente el nombre del agente.' Where: https://dev01.movilba.com/vehiculos/AI357EG. Measure first: candidate causes are the MOVILBA-649 restore of 118 app-origin rows (12:2x today), the reconciler, or the history view's creator resolution. Check PROD too.
Activity
-
Investigated 3 candidate causes, all refuted at code/DB level: (1) app write paths (crearColectivo -> vehiculos.ts:631,943 and historial inserts at 648/686/962/1009/1049/1238/1261/1615/1645) all correctly stamp creadoPor=String(session.user.id); no hardcoded system-user fallback in src/. (2) MOVILBA-649 DEV restore byte-preserved 118 origen=app rows with no field rewrite - db03 confirmed zero system_import hits on per-vehiculo_id earliest-alta query across all 50 affected dominios. (3) chain-wide-earliest-event-via-v_vehiculo_cadena hypothesis (replate inheriting an older dominio's import-origin Alta) - db03 confirmed 46/47 have no chain partner at all, and the one that does (LB100EG/LB500EG) resolves to a real app user, not system_import. No 'Sistema - Importacion' literal exists anywhere in src/ now or in git history (git log --all -S checked). DB clean on both tested angles via db03's independent queries (per-vehiculo_id earliest-alta; chain-wide-earliest via v_vehiculo_cadena). Cannot reproduce at code or DB level. Recommend: verify live reproduction on dev01 right now (observation is from 2026-10-02, several deploys since); if still reproducible, check actual API response/network tab, not static code - may be stale ISR/CDN cache serving pre-fix HTML, or the original observation no longer applies.
-
ROOT CAUSE (34/35 cases): correct business-order resolution, not a bug. getRutapHistorialByChain (rutap-historial.ts) + compareBusinessOrder (rutap-history-diff.ts) label a chain's EARLIEST fecha_alta row (filtered to origen=app OR origen=import+latest snapshot=21) as 'Alta' via anteriorId=null. 34 dev01 vehiculo_ids have BOTH app-origin rows (agent-created) AND import-origin rows (book, snapshot 21) in the same chain, with the import row's fecha_alta predating the app row's by months. Per MOVILBA-518 business-order semantics the earlier book row legitimately wins the Alta label -> creado_por=system_import ('Sistema - Importacion'), by design, same logic for both PDF export (vehiculos/[dominio]/page.tsx handleExportPDF) and on-screen (getVehiculoHistorial -> same getRutapHistorialByChain, confirmed identical, no separate filtering in ExpedienteForm/HistoryPeriodContent's data source). UNRESOLVED CONTRADICTION: AI357EG (reported as the ONE case that displays correctly, i.e. agent name not Sistema) has the IDENTICAL shape - its earliest row under the live filter (snapshot_id=21, origen=app OR import) is id=360134, origen=import, creado_por=system_import, fecha_alta=2026-07-06, predating its app rows (320006/320021, 2026-10-01). Per the code's own compareBusinessOrder/anteriorId=null logic this chain's Alta should ALSO resolve to system_import, same as the other 34. Static code+DB analysis cannot reconcile this with the report of AI357EG displaying correctly - either the reporter's observation was about a different field/location (e.g. 'Creado por' on the most-recent list row, not the Alta-labeled row) or there is a UI-level difference not reachable from read-only DB/code review. RECOMMENDATION: not a data defect in the 34 cases - correct per current business-order design. Before any fix, need a live screenshot/export confirming exactly which field/row AI357EG shows the agent name on, vs. one of the 34 (e.g. AC736PL), to settle whether there's a genuine code path difference or the report's framing was imprecise.
-
BLOCKED on infra: live-check request to confirm AI357EG vs the 34-dominio pattern cannot run - proxy-mba-w-cc's GCABA VPN tunnel (whey ppp0) down, dev01 unreachable. Not audit's/coder's to fix. Re-request live check once tunnel confirmed up. Root-cause analysis (business-order resolution, correct for 34/35; AI357EG contradiction unresolved) stands as logged.
-
Correction from coder03: not infra-blocked - app.movilba.com/dev01/PROD postgres all run on lezama, no VPN needed. Real gate is AD/NextAuth login, same from any location. coder03 is asking Elazar directly for the live AI357EG/AC736PL check. Awaiting that result before closing the AI357EG contradiction.
-
researcher 2026-10-08 13:17 ART: not a decision item - blocked on a live click-through only Elazar can supply (AI357EG vs the 34-dominio pattern on dev01/PROD), not on a choice between options. coder03 already corrected the earlier 'infra-blocked' framing (no VPN needed, same AD/NextAuth login from any location) and is asking Elazar directly for that one live check. Nothing further to add until that result lands.
-
Blocked on Elazar's live click-through (AI357EG vs the 34-dominio pattern). Root cause for 34 settled per MOVILBA-518; AI357EG contradicts and needs his screenshot/export.
-
AI357EG historial pulled via proxy-mba-w-cc (Elazar's live dev01 session), 2026-10-09 12:14 ART: per-period Creado por, newest first - Lautaro Perez (Administrativo), Leandro Baez (Administrativo), then 3x Sistema - Importacion (Alta+Interno, MDVR Mod, Alta 06/07/2026). Not a contradiction of MOVILBA-518's pattern: the two newest periods are app-created with real names, the three import-origin periods correctly show Sistema - Importacion. Resolved - AI357EG matches expectation per-period.
-
Independently verified AI357EG on DEV: rutap.vehiculo_historial_normalizado ordered by fecha_alta ASC, rutap_fila_excel ASC gives 360134(import,2026-07-06)->360135(import,2026-07-08)->360133(import,2026-10-01,fila5557)->320006(app,2026-10-01)->320021(app,2026-10-01). Newest-first display: the two app-origin rows (real agent user ids) are most recent, the three import-origin rows (system_import) are older. Matches coder03's reported per-period breakdown exactly. Resolves the AI357EG contradiction I flagged 2026-10-07: the report's 'last alta shows agent name correctly' referred to the two newest per-period rows, not the single earliest Alta-labeled row (which is and remains import-origin per compareBusinessOrder/anteriorId=null, same as the 34-dominio pattern). Not a bug, consistent with MOVILBA-518. Audit does not write the XLSX tracker or close bwi items - that belongs to whoever owns those actions.
-
audit pass: AI357EG per-period creado_por chain re-derived independently from rutap.vehiculo_historial_normalizado on DEV
payload
{"scope":"AI357EG per-period creado_por chain re-derived independently from rutap.vehiculo_historial_normalizado on DEV","outcome":"pass","evidence":"query output matches coder03's reported breakdown exactly; resolves prior unresolved-contradiction flag","reportRef":null} -
Written to tracker Resueltos, archived copy 2026-10-09-1215. Closing.
-
cleared: Blocked on Elazar's live click-through (AI357EG vs the 34-dominio pattern). Root cause for 34 settled per MOVILBA-518; AI357EG contradicts and needs his screenshot/export.
-
completed
bug
2w ago by coder03-mba-l-cc
1w ago
2026-10-09 15:16