movilba
MOVILBA-552
Cambio de numero de dominio: da 404, deja 8 vehiculos con el mismo dominio y hace desaparecer el dominio original
Done urgent
cmcoder03assistant-mba-l-ca
Reported by Lean and Fabri in the Para Elazar tracker, item 17, and item 18 is the same incident. Editing a vehicle's dominio from LB500EP to LB501EP produced three failures at once: the request ended on a 404 page, eight vehicles were created carrying the same dominio, and the original LB500EP disappeared from the list. Item 18 adds that neither the original nor the edited dominio appears in the Reporte afterwards, so the rows are not merely mislabelled - they are unreachable from the export. Two distinct defects are bundled here on purpose because one action produced both: the write path fans out instead of updating in place, and nothing in the database refuses a duplicate dominio. Fixing only the code leaves the second one armed.
Activity
-
db04, SELECT-only, 2026-09-23 14:00 ART. BOTH DEV and PROD already carry uq_vehiculos_dominio_active UNIQUE(dominio) WHERE borrado_en IS NULL, indisvalid and indisready true. Zero duplicate base-table dominios in either base (DEV 2423, PROD 2413), including an upper(trim) check across all rows. No new index is needed and no DDL is required. The reported duplication is PROJECTION FAN-OUT, not duplicate vehicles: DEV public.vehiculos holds ONE LB501EP (id 6779, origin app_dev) while public.v_vehiculos_list returns EIGHT rows for that same id. LB500EP is currently absent. Evidence under /data-lezama/movilba/evidencia/MOVILBA-552/2026-09-23-db04-*. Reclassified to the app lane: the defect is the join in v_vehiculos_list, not the constraint.
-
DB04 SELECT-only 2026-09-23 14:00-14:02 ART: DEV2423/PROD2413 vehicle rows, zero duplicate dominios even all rows or upper(trim). Both bases already have valid/ready UNIQUE uq_vehiculos_dominio_active(dominio) WHERE borrado_en IS NULL. DEV has ONE LB501EP id6779, but v_vehiculos_list emits EIGHT rows. Current history partitions by (vehiculo_id,dominio), with rank1 LB500EP and LB501EP for same id6779. Three independent vehicle-id joins (entidad_actual,linea_actual,hist_ultimo) each match2 => 8. Proposal retain index; fix projection identity with coder, preserve legitimate separate replate histories. 404/write sequence unmeasured. No DDL/data/code changes. Reproducible SQL/results /data-lezama/movilba/evidencia/MOVILBA-552/2026-09-23-db04-*.
-
Pre-ship SELECT-only census Sep23 14:20 ART. DEV affected vehicle_ids6765,6777,6779; each current-history2/list8/detalle8/export4/api_public16. DEV totals history2426/list2444/detalle2444/export2432/api_public2468, each2423 distinct vehicle IDs. PROD all five2413 rows/2413 IDs, zero duplicates. Full14 base-history rows across three DEV vehicles saved (including closed rows); ALL origen app, no import, none soft-deleted. 6765 LB333EP/LB332EP;6777 LP680EG/LP680FF;6779 LB500EP/LB501EP. Important:6777 has open LP680EG but closed future LP680FF winner3050-01-01..3051-09-22, so two rank1 does NOT always mean two open rows. Read-only CTE simulation dropping dominio from installed partition gives2423 DEV and2413 PROD winners, BUT differs from both TS lateral orderings on DEV6777: candidate286433 LP680FF versus TS286430 LP680EG (open-first). PROD0 winner mismatches. Count invariant passes but DEV winner-equality gate FAILS. No DDL/scratch schema created or deployed code/output verification. Exact SQL/full history/results /data-lezama/movilba/evidencia/MOVILBA-552/2026-09-23-db04-blast-radius* and 2026-09-23-db04-winner-check*. Coder must settle tie-break before scratch-schema test/shipping.
-
Read-only canonical re-simulation Sep23 14:22 ART, no DDL/schema/data changes. PARTITION BY vehiculo_id with exact open-first TS ORDER BY yields DEV2424 candidate rows=2424 current distinct IDs; ficha mismatches0, API mismatches0. PROD2413=2413; ficha0/API0. DEV denominator changed from2423 at14:20 to2424 at14:22; each comparison is internally repeatable-read consistent. Named DEV winners:6765 history286442 LB332EP OPEN since2026-09-23;6777 history286430 LP680EG OPEN since2026-09-22;6779 history286436 LB501EP OPEN since2026-09-22. Those IDs absent from PROD current view. Candidate ranked full eligible source history; comparator used each existing lateral over current rank1 view, not candidate rows. Exact SQL/results /data-lezama/movilba/evidencia/MOVILBA-552/2026-09-23-db04-canonical-winner-check.sql and -DEV.txt/-PROD.txt. This passes row-count and current winner-equivalence gates only, not deployed consumer/output validation.
-
DDL applied DEV+PROD: rutap.v_vehiculo_historial_actual current_rank partition by vehiculo_id + canonical tie-break. PROD 2413=2413, DEV 2424=2424, 0 period changes via canonical lateral, owner/ACL/57 deps unchanged. Artifact docs/migrations/2026-09-23-movilba-552-*.sql md5 e6da7bd8834b944b7b2bf18dae13a0ea, untracked for coder03.
-
coder03assistant-mba-l-ca
-
Started code-lane reproduction and fix; DEV only. Database view correction and unique-index verification already recorded in ticket history.
-
AUDIT PASS — current final implementation, not the intermediate chain as originally described. The supplied evidence reproduces the pre-fix defect in DEV: vehiculo 6779 had base dominio LB501EP, open APP history under LB500EP and LB501EP, a valid and ready unique active-domain index, zero base duplicates, and 8 rows in v_vehiculos_list. Commit 09cbff77 correctly removes dominio from the close predicate; 29d79724 makes the APP boundary explicit; 83726ebe adds the replate and source controls. REQUIRED RECORD CORRECTION: the PARTITION BY vehiculo_id introduced by bb1a4341 is valid, but its open-first ORDER BY was not canonical and caused MOVILBA-559. The final chain is complete only with 44dcbae5, which preserves the vehicle-only partition and restores the MOVILBA-344 five-key ordering. Current focused control pnpm exec tsx --test src/repositories/vehiculos.line-transfer.test.ts passed with exit 0 and 33 assertions. No code finding at current HEAD.
-
audit-mba-l-ca | 2026-09-23 20:54:15 ART SIGNATURE CORRECTION for the preceding AUDIT PASS event. The preceding verdict body is mine and remains unchanged: current final implementation passes; bb1a4341 open-first ordering was not canonical, caused MOVILBA-559, and the completed chain requires 44dcbae5.
-
audit-mba-l-ca | 2026-09-23 20:57:32 -03 PASS — re-audit of the remaining redirect half. The uncommitted two-file diff changes the successful changed-save route in src/app/vehiculos/[dominio]/editar/colectivo/page.tsx from the pre-edit dominioRuta to normalizeDominio(String(submitData.dominio)), after result.success and after the unchanged early return. submitData is built from formData, so dominio is present; failure and unchanged paths do not redirect. The paired source controls require the submitted-domain redirect and reject the prior dominioRuta redirect. Independently rerun: pnpm exec tsx --test src/repositories/vehiculos.line-transfer.test.ts => exit 0, 35 assertions; targeted eslint for both files => exit 0; git diff --check => exit 0. Diff is limited to the page redirect/comment and two assertions plus count update. Coverage limitation: source-level behavioral pin only; browser navigation was not exercised end to end. Earlier chain wording remains corrected: bb1a4341 supplied vehicle-only partition but its open-first ordering regressed MOVILBA-559; the complete valid chain includes 44dcbae5 restoring the five-key MOVILBA-344 order.
-
coder03assistant-mba-l-ca — 2026-09-23 20:57:53 ART REPORT MOVILBA-552 Observed failure and control: - DEV vehiculo 6779 had one base row at dominio LB501EP, zero duplicate base dominios, and a valid/ready partial unique index uq_vehiculos_dominio_active. Its normalized history had open APP rows under LB500EP and LB501EP. Three two-row joins produced 8 v_vehiculos_list rows for that single vehicle (and 4 export rows), proving projection fan-out rather than eight inserted vehicles. - The writer defect was the open-period close predicate matching vehiculo_id plus the current dominio after the base-row update; it could not close the predecessor stored under the old dominio. - The remaining 404 was independently reproduced at source level before this lane's patch: an assertion requiring successful save navigation to normalizeDominio(String(submitData.dominio)) failed exit 1 because the handler routed with dominioRuta, the plate captured when the page loaded. Implementation: - 09cbff77 removes dominio from the APP-period close predicate; 29d79724 makes origen='app' structural. The database-side vehicle-only current-row partition is the valid part of bb1a4341; 44dcbae5 is required after it because it restores the canonical MOVILBA-344 five-key ordering that bb1a4341's open-first ordering broke. 83726ebe adds the DEV replate/source controls. The existing unique active-domain index is retained; no replacement index was needed. - Current uncommitted lane diff changes src/app/vehiculos/[dominio]/editar/colectivo/page.tsx so a successful changed save routes to the normalized submitted dominio, while failure and unchanged paths still return first. - src/repositories/vehiculos.line-transfer.test.ts adds controls requiring the submitted-domain route and rejecting the stale dominioRuta success route; focused assertions increase 33 to 35. Validation: - Pre-fix redirect control: exit 1 on the stale dominioRuta route. - pnpm exec tsx --test src/repositories/vehiculos.line-transfer.test.ts: exit 0, 35 assertions. - pnpm run test:source: 33/33 test files passed. - Targeted ESLint on both changed files: exit 0. - pnpm run typecheck: exit 0. - pnpm run build: exit 0. - git diff --check and lockfiles:check: exit 0. - Repository-wide lint:strict remains red on 8,104 pre-existing findings from broad scanning of agent artifacts and public/vendor/scalar; neither changed file has a targeted lint finding. - Audit recorded its signed PASS verdict directly in this item's verified event. Audit notes that redirect coverage is source-level and browser navigation remains unexercised. Files for coder review: - src/app/vehiculos/[dominio]/editar/colectivo/page.tsx - src/repositories/vehiculos.line-transfer.test.ts No commit or push was performed by this lane.
-
coder03assistant-mba-l-ca — 2026-09-23 20:57:53 ART Completed after audit PASS: writer and projection chain verified, stale post-replate redirect corrected, regression controls and validation recorded in the preceding signed REPORT event.
-
audit-mba-l-ca | 2026-09-23 20:58:58 -03 POST-AUDIT COVERAGE ADDENDUM (reported by coder03assistant-mba-l-ca; not independently rerun by audit): full WARN Unsupported engine: wanted: {"node":"24.14.1"} (current: {"node":"v24.21.0","pnpm":"10.15.0"}) > movilba-web@5.6.43 test:source /home/rob/Documents/work/gcaba/movilba-web > tsx --test 'src/**/*.test.ts' 'src/**/*.test.tsx' fecha alta history source: all assertions passed ✔ src/actions/vehiculos-fecha-alta-history-source.test.ts (502.817344ms) dropdown batch: all assertions passed ✔ src/app/api/dropdowns/dropdowns-batch.test.ts (1039.582192ms) health probes: all assertions passed ✔ src/app/health/health-probes.test.ts (902.732029ms) MOVILBA-440 stale bundle recovery screen: 3 assertions passed ✔ src/components/ErrorBoundary.bundle-version.test.ts (428.983207ms) history renderer: 30 assertions passed ✔ src/components/HistoryPeriodContent.test.tsx (681.106086ms) validator association details: 10 assertions passed ✔ src/components/ValidadoraAssociationDetails.test.tsx (603.056187ms) subtype generated SQL: colliding id remains qualified; dropdown reads view codigo directly ✔ src/db/vehiculo-subtipo-label.test.ts (765.393374ms) ✔ el reporte historico emite las 39 columnas del libro, en el orden del libro (2.59ms) ✔ ninguna columna comparte key con otra (0.391792ms) ✔ el xlsx replica hoja Base, fila vacia y encabezado del libro en fila 2 (26.0544ms) ✔ las celdas salen tipadas: fecha, numero y texto segun la columna (9.265368ms) ✔ el csv conserva las mismas 39 columnas y una fila por tramite (0.698719ms) ok - un periodo que abre y cierra el mismo dia es de largo cero ok - un periodo normal no es de largo cero ok - un periodo abierto no puede ser de largo cero ok - consecutivo: la alta cae el dia siguiente al cierre, no hay salto ok - cerrar y reabrir EL MISMO DIA no es un hueco ok - un hueco de 19 dias se cuenta como 19 ok - una alta anterior al cierre previo es un solape, no un salto ok - un periodo anterior ABIERTO no genera salto ni solape ok - el alta de la cadena no se compara contra nada ok - una fecha con formato distinto se trata como ausencia ok - cruza fin de mes y de anio sin contar de mas 11 casos OK ✔ src/lib/historial-vehiculo.anomalias.test.ts (408.74354ms) origen ingreso app environment guard: passed ✔ src/lib/origen-ingreso.test.ts (401.901593ms) password-reset-request: todas las aserciones OK ✔ src/lib/password-reset-request.test.ts (427.265418ms) ok - un Date de medianoche local se convierte a YYYY-MM-DD ok - el mes y el dia van con cero a la izquierda ok - el 1 de enero no se cae al anio anterior ok - null y undefined pasan como ausencia ok - un Date invalido es ausencia, no la cadena 'Invalid Date' ok - una cadena ya normalizada pasa intacta ok - una cadena ISO larga se recorta a la fecha ok - lo que no empieza por una fecha pasa verbatim ok - el orden de la cadena sale por fecha, no por nombre de dia 9 casos OK ✔ src/lib/rutap-fecha.test.ts (437.258871ms) rutap-history-diff: OK ✔ src/lib/rutap-history-diff.test.ts (426.138485ms) history presentation: import and typed app regressions passed ✔ src/lib/rutap-history-presentation.test.ts (453.70398ms) periodHistoryValues: 20 assertions passed ✔ src/lib/rutap-history-values.test.ts (491.197697ms) rutap-modification-subtype: todas las aserciones OK ✔ src/lib/rutap-modification-subtype.test.ts (472.650682ms) vehicle PDF original validity: all assertions passed ✔ src/lib/vehiculo-pdf-vigencia.test.ts (377.833262ms) Vehicle transaction classification: 7 assertions passed ✔ src/lib/vehiculo-tramite.test.ts (406.804579ms) origen ingreso create paths: passed ✔ src/repositories/origen-ingreso-create-paths.test.ts (337.696363ms) ✔ vehicle API publishes raw and resolved state IDs without replacing the legacy field (1.868161ms) ✔ estado_id filtering remains anchored to the stored value (0.36387ms) ✔ service returns the typed repository projection without dropping either state ID (0.304723ms) ✔ OpenAPI and written contract require and explain both state IDs (0.672872ms) ✔ el export lee v_export_libro, ordenado por rutap_fila, sin fallback (1.470303ms) ✔ solo la descarga interna cambia al libro; la API externa conserva compatibilidad (0.321613ms) MOVILBA-399 current-period chassis query contract: 7 assertions passed ✔ src/repositories/vehiculos.chasis-marca.test.ts (293.831045ms) MOVILBA-439 create colectivo Alta trámite contract: 6 assertions passed ✔ src/repositories/vehiculos.create-colectivo-tramite.test.ts (289.014886ms) Vehicle line-transfer transaction: 35 assertions passed ✔ src/repositories/vehiculos.line-transfer.test.ts (316.470935ms) vehiculo collective subtype admission: all service paths guarded ✔ src/services/vehiculos-subtipo-canonico-source.test.ts (306.430026ms) ℹ tests 33 ℹ suites 0 ℹ pass 33 ℹ fail 0 ℹ cancelled 0 ℹ skipped 0 ℹ todo 0 ℹ duration_ms 1071.113664 passed 33/33 test files, including the 35-assertion focused redirect test, and WARN Unsupported engine: wanted: {"node":"24.14.1"} (current: {"node":"v24.21.0","pnpm":"10.15.0"}) > movilba-web@5.6.43 build /home/rob/Documents/work/gcaba/movilba-web > next build ▲ Next.js 16.2.10 (Turbopack) - Environments: .env.local Creating an optimized production build ... ✓ Compiled successfully in 7.4s Running TypeScript ... Finished TypeScript in 22.6s ... Collecting page data using 19 workers ... Generating static pages using 19 workers (0/83) ... Generating static pages using 19 workers (20/83) Generating static pages using 19 workers (41/83) Generating static pages using 19 workers (62/83) ✓ Generating static pages using 19 workers (83/83) in 307ms Finalizing page optimization ... Route (app) ┌ ƒ / ├ ƒ /_not-found ├ ƒ /admin ├ ƒ /admin/analisis-importacion ├ ƒ /admin/audit-log ├ ƒ /admin/carrocerias ├ ƒ /admin/carrocerias/[id] ├ ƒ /admin/carrocerias/[id]/editar ├ ƒ /admin/carrocerias/agregar ├ ƒ /admin/chasis ├ ƒ /admin/chasis/[id] ├ ƒ /admin/chasis/[id]/editar ├ ƒ /admin/chasis/agregar ├ ƒ /admin/fabricantes ├ ƒ /admin/fabricantes/[id] ├ ƒ /admin/fabricantes/[id]/editar ├ ƒ /admin/fabricantes/agregar ├ ƒ /admin/opciones ├ ƒ /admin/opciones/[id] ├ ƒ /admin/opciones/agregar ├ ƒ /admin/users ├ ƒ /admin/users/[id] ├ ƒ /admin/users/agregar ├ ƒ /api ├ ƒ /api/admin/audit-log ├ ƒ /api/admin/carrocerias ├ ƒ /api/admin/carrocerias/[id] ├ ƒ /api/admin/chasis ├ ƒ /api/admin/chasis/[id] ├ ƒ /api/admin/fabricantes ├ ƒ /api/admin/fabricantes/[id] ├ ƒ /api/admin/opciones ├ ƒ /api/admin/opciones/[id] ├ ƒ /api/admin/opciones/grupos-campos ├ ƒ /api/admin/users ├ ƒ /api/admin/users/[id] ├ ƒ /api/admin/users/last-login ├ ƒ /api/auth/[...nextauth] ├ ƒ /api/auth/change-password ├ ƒ /api/auth/federated-logout ├ ƒ /api/auth/password-status ├ ƒ /api/auth/reset-password ├ ƒ /api/auth/verify-email ├ ƒ /api/diagnostics/fiscalizacion-connectivity ├ ƒ /api/docs ├ ƒ /api/dropdowns ├ ƒ /api/entidades ├ ƒ /api/entidades/[id] ├ ƒ /api/export ├ ƒ /api/health ├ ƒ /api/lineas ├ ƒ /api/lineas/[id] ├ ƒ /api/log-error ├ ƒ /api/navigation ├ ƒ /api/paradas ├ ƒ /api/paradas/[id] ├ ƒ /api/personas ├ ƒ /api/personas/[id] ├ ƒ /api/personas/[id]/edit ├ ƒ /api/postman ├ ƒ /api/ramales ├ ƒ /api/ramales/[id] ├ ƒ /api/recorridos ├ ƒ /api/recorridos/[id] ├ ƒ /api/rendiciones/v1/colectivos ├ ƒ /api/rendiciones/v1/colectivos/[dominio] ├ ƒ /api/rendiciones/v1/empresas ├ ƒ /api/rendiciones/v1/empresas/[cuit] ├ ƒ /api/rendiciones/v1/lineas/[numero] ├ ƒ /api/rendiciones/v1/lineas/[numero]/colectivos ├ ƒ /api/reportes/liquidacion ├ ƒ /api/reportes/vehiculos-historico ├ ƒ /api/user/profile ├ ƒ /api/v1 ├ ƒ /api/v1/exports/vehiculos ├ ƒ /api/v1/openapi.json ├ ƒ /api/v1/parque/choferes/[id] ├ ƒ /api/v1/parque/choferes/search ├ ƒ /api/v1/parque/entidades ├ ƒ /api/v1/parque/estados-colectivo ├ ƒ /api/v1/parque/instalaciones/search ├ ƒ /api/v1/parque/lineas ├ ƒ /api/v1/parque/vehiculos/[id] ├ ƒ /api/v1/parque/vehiculos/search ├ ƒ /api/vehiculos ├ ƒ /api/vehiculos/[id] ├ ƒ /api/vehiculos/[id]/entidad ├ ƒ /api/vehiculos/[id]/entidad/history ├ ƒ /api/vehiculos/[id]/historia ├ ƒ /api/vehiculos/[id]/linea ├ ƒ /api/vehiculos/[id]/linea/current ├ ƒ /api/vehiculos/[id]/linea/history ├ ƒ /api/vehiculos/detail-dropdowns ├ ƒ /api/vpn-probe ├ ƒ /auth/change-password ├ ƒ /auth/error ├ ƒ /auth/verify-email ├ ƒ /entidades ├ ƒ /entidades/[id] ├ ƒ /entidades/[id]/editar ├ ƒ /entidades/agregar ├ ƒ /health/liveness ├ ƒ /health/readiness ├ ƒ /instalaciones ├ ƒ /instalaciones/[id] ├ ƒ /instalaciones/[id]/editar ├ ƒ /instalaciones/agregar ├ ƒ /lineas ├ ƒ /lineas/[id] ├ ƒ /lineas/[id]/editar ├ ƒ /lineas/agregar ├ ƒ /logs ├ ƒ /paradas ├ ƒ /paradas/[id] ├ ƒ /paradas/[id]/editar ├ ƒ /paradas/agregar ├ ƒ /perfil ├ ƒ /personas ├ ƒ /personas/[id] ├ ƒ /personas/[id]/editar ├ ƒ /personas/agregar ├ ƒ /ramales ├ ƒ /ramales/[id] ├ ƒ /ramales/[id]/editar ├ ƒ /ramales/agregar ├ ƒ /recorridos ├ ƒ /recorridos/[id] ├ ƒ /recorridos/[id]/editar ├ ƒ /recorridos/agregar ├ ƒ /reportes ├ ƒ /reportes/liquidacion ├ ƒ /reset-password ├ ƒ /soporte-tecnico ├ ƒ /user/login ├ ƒ /user/login/no-provisionado ├ ƒ /validadoras ├ ƒ /validadoras/[id] ├ ƒ /validadoras/[id]/editar ├ ƒ /validadoras/agregar ├ ƒ /vehiculos ├ ƒ /vehiculos/[dominio] ├ ƒ /vehiculos/[dominio]/editar ├ ƒ /vehiculos/[dominio]/editar/colectivo ├ ƒ /vehiculos/agregar └ ƒ /vehiculos/agregar/colectivo ƒ Proxy (Middleware) ƒ (Dynamic) server-rendered on demand completed successfully. Targeted ESLint on both changed files was clean. Repository-wide remains baseline-red from its broad scan of pre-existing agent artifacts/vendor content; this is not represented as a clean gate for MOVILBA-552.
-
audit pass: Historical audit verdict from 2026-09-23: MOVILBA-552 post-replate redirect diff; audit predates the bwi audit command.
payload
{"scope":"Historical audit verdict from 2026-09-23: MOVILBA-552 post-replate redirect diff; audit predates the bwi audit command.","outcome":"pass","evidence":"At audit time: focused source test passed 35 assertions with exit 0; targeted ESLint exited 0; git diff --check exited 0. Browser navigation remained unexercised.","reportRef":"MOVILBA-552 verified event 2026-09-23T23:57:35.021Z"} -
audit-mba-l-ca | 2026-09-23 23:04:47 ART CORRECTION: disregard the malformed verified event at 2026-09-23T23:59:36.554Z. Audit accidentally allowed shell command substitution while composing that event, so raw test/build output was embedded in its body and the event does not constitute a valid audit assertion. The valid audit verdict remains the signed PASS at 2026-09-23T23:57:35.021Z and the structured audited pass at 2026-09-24T02:03:23.372Z. Full-suite/build coverage belongs to the lane report at 2026-09-23T23:58:37.662Z and was not independently rerun for the audit verdict.
-
coder03assistant-mba-l-ca | 2026-09-23 23:07:51 -03 Lane reconciliation after the audit correction: MOVILBA-552 remains done. Treat the structured audited PASS at 2026-09-24T02:03:23.372Z and the signed lane REPORT at 2026-09-23T23:58:37.662Z as authoritative. The malformed verified event at 2026-09-23T23:59:36.554Z is superseded by audit’s correction and supplies no audit evidence. No implementation, validation, assignment, or status change is pending on this item.
bug
3w ago by wi-cli-venus
3w ago
2026-09-23 23:58