basquetWi + New ticket

Reporte 1: exportación histórica RUTAP según modelo ideal

Done high cmcoder03assistant-mba-l-ca

Report 1. Export historical vehicle data with the 29-column modelo-ideal-exportacion contract: one row per validity period/tramite; canonical RUTAP fields, business dates, expedientes and Tramite. The implementation must make the source-to-output mapping explicit and retain historical entity/line changes.

Sub-tickets

No sub-tickets.
+ Add sub-ticket

Activity

  • wi-cli-venus created · 4w ago
    parent=#3162
  • wi-cli-venus statusChanged · 4w ago
    Reconciled 2026-09-15: DEV code contains GET /api/reportes/vehiculos-historico plus explicit 29-column XLSX/CSV contract in src/lib/exports/rutap-historico.ts, with one row per lifecycle period and source-field preservation. Remaining: independent contract/data reconciliation against the modelo ideal before closure.
  • wi-cli-venus assigned · 4w ago
    coder03-mba-l-cc / coder
  • coder03assistant-mba-l-ca progress · 3w ago
    coder03assistant-mba-l-ca | 2026-09-24 04:00:26 ART dev 7d299b6a; main 721b9eb8: historical-report route/code exists; 29-column modelo-ideal mapping and historical entity/line reconciliation against source workbook were not independently verified. Keep in progress.
  • coder03-mba-l-cc assigned · 2w ago
    coder03assistant-mba-l-ca
  • coder03assistant-mba-l-ca progress · 2w ago
    coder03assistant-mba-l-ca | 2026-09-28 13:50 ART — Read dev ref 657be353 (no checkout mutation). src/lib/exports/rutap-historico.ts defines 39 explicit output headers, not 29; route SELECT returns one normalized-history row per active app row/current imported snapshot and maps entity/line from raw period values before canonical fallback. Current SSOT /data-lezama/movilba/libro/2026-09-28-1042-parque-rutap.xlsx Base row 2 has 40 named headers (39 existing fields plus Digitos). No export artifact or source-vs-output row reconciliation exercised; the stated 29-column contract and handling of newly named Digitos remain unresolved. Keep inProgress; next gate is authoritative model mapping and generated-output/data comparison.
  • coder03assistant-mba-l-ca progress · 2w ago
    coder03assistant-mba-l-ca | 2026-10-01 23:18 ART. Reconciled scope against MOVILBA-469: the original 29-column omission was superseded by the completed change requiring all 39 book columns; current RUTAP_HISTORICAL_COLUMNS and its test pin those 39 headers. The route explicitly aliases each output field and uses each normalized history row raw-period values with canonical fallback for entity/line, so historical values are not sourced from the current vehicle. No code defect is established by source inspection. Still unmeasured: generated export versus current SSOT row-by-row, plus whether the newly named blank Digitos field belongs in this historical report. No diff submitted; need current export/source reconciliation before closing or changing the contract.
  • db04-mba-l-ca progress · 2w ago
    db04-mba-l-ca 2026-10-01 23:28 ART — Gate read-only del reporte histórico 39 columnas contra PROD movilba, libro SHA256 21e98b9a13314591cd89b39a5428265f6519f6929474ed6e48bd51d628140b74 (/data-lezama/movilba/libro/2026-09-30-1305-parque-rutap.xlsx, Base). Extraje EXACTAMENTE el SQL de src/app/api/reportes/vehiculos-historico/route.ts, lo ejecuté como svc_nextjs en BEGIN READ ONLY/ROLLBACK y pasé las 5548 filas a buildRutapHistoricalCsv de src/lib/exports/rutap-historico.ts. SHA256 de ambos archivos de código coincide byte a byte con /srv/movilba-web (PROD desplegado). Resultado CSV 39 headers en el mismo orden que Base A:AM, 5548 filas, origen=import 5548/5548; libro tiene 40 headers porque AN=Digitos queda fuera de ESTE contrato 39. Evidencia CSV chmod 0600 /data-lezama/movilba/evidencia/MOVILBA-441/2026-10-01-prod-vehiculos-historico.csv (sha256 cd771a89a71171f6166501589e24c5f6df57550c38a6908db2031af14008c0a5); instrumento y JSON de conteos en el mismo directorio.\n\nJoin por (Nro_dominio sin espacios exteriores, Fecha_Alta, Fecha_Baja), fechas Excel convertidas a YYYY-MM-DD: 5548/5548 filas pareadas, faltantes 0, extras 0, 5547 claves distintas. Una clave NO es única: AD956UK 2025-12-10..11 aparece dos veces con internos 147/160; emparejé el multiconjunto con mínimo de diferencias, no por orden SQL.\n\nDiferencias literales por columna: Chasis_Modelo 1444; Motor Nro 658; Chasis_Nro 363; Expte. Baja 174; Identificador_ Empresa 174; Observaciones 154; Expte. Alta 148; ID ADAS 142; ID MDVR 41; Nro_dominio 29; Chasis_Marca 17; Carroceria Categoria 13; Motor 13; Carroceria 12; Tipo_Motor 12; Unidad_Propulsora 12; Nro_Interno 10; ID CANBUS 8; CUIT 1; Consumo 1. Las otras 19 columnas 0. Tras sólo cambiar NBSP por espacio, colapsar/recortar blanco y quitar CR/LF intracerda únicamente en seriales Chasis_Nro/Motor Nro (sin alterar dígitos/etiquetas), los residuos quedan: Chasis_Modelo 1380, Observaciones 154, Chasis_Marca 4; otras 36 columnas 0. Los 1380/4 son el contraste entre grafía del libro y etiqueta del catálogo de chasis que el contrato PUBLICA; esta corrida no certifica que cada FK sea correcto.\n\nObservaciones: las 154 diferencias son libro vacío -> export 'Se modifican datos a pedido de la empresa'. Sólo 65 de esas 154 tienen esa misma frase en Expte. Alta del libro; 57 tienen Expte. Alta vacío y 32 otro expediente real. Control AH735EP Base!fila378: stage observaciones y raw_observaciones vacíos, h.observaciones contiene la frase, y la ruta usa COALESCE(raw_observaciones,observaciones). Por tanto 89 no son simple traslado de esa frase desde Expte. Alta; queda discrepancia de salida/fuente por resolver, sin escribir datos. No se ejerció HTTP/auth ni serialización XLSX, sólo la consulta y builder CSV reales; Digitos lo decide la otra mitad del item.
  • db04-mba-l-ca progress · 2w ago
    2026-10-01 23:36 ART; MOVILBA-441 follow-up, read-only, pinned Base SHA256 21e98b9a13314591cd89b39a5428265f6519f6929474ed6e48bd51d628140b74 and PROD snapshot 8 / historical CSV already recorded. Observaciones: all 154 mismatches are blank book cell -> export 'Se modifican datos a pedido de la empresa'. Source phrase is in SAME row Expte. Alta for 65 and SAME row Expte. Baja for the other 89; 0 unexplained after checking both. For those 89, previous period of same dominio contributes phrase in Expte. Alta/Baja/Observaciones in 0 cases; the current row's Expte. Baja explains every one. Examples among 89: AA114UK Base 430, AA326DQ 586, AA336LO 595. This is MOVILBA-248 relocation, not a new value invented by export.\nChasis_Modelo: 1380 normalized book-vs-export label differences. Confirmed normalized raw model equals rutap_rows.chasis_modelo in 5548/5548, and all 1380 have a live chasis catalog row plus approved installed rutap.chasis_resolver mapping to the SAME chasis_id; 0 missing mappings or resolver/id disagreement. Split by resolver context, not string equality alone: 1372 are approved same-model/variant label renderings with no flagged source conflict (expected catalog-label output). Examples: AE168VP row43 OH 1621 L-SB/55 -> OH 1621/55 id118; AG202SY row2261 MT 15.0 LE Euro V -> MT 15.0 LE id130; AI357IV row3411 K280 B4x2 (GAS)/GNC -> K 280 B4x2 (GNC) id124. Eight require contextual review, NOT yet export defects: 4 MERCEDES BENZ book rows mapped to AGRALE MT catalog (AB709ZW 3056/5290, AC029ZU 3057/3130; same 4 Chasis_Marca residuals); 3 explicitly provisional mappings from truncated book models (MCL599 540, AF178SI 3513/5303); 1 book GNV model with GO propulsion mapped provisionally to GNV catalog (AI259HP 3123). Examples of these classes: AB709ZW 3056 MT 17.0 LE V 6000 -> AGRALE MT 17.0 LE; MCL599 540 CN-BMO 368 VERSION 1 -> OH 1618 L-SB/55; AI259HP 3123 MT 17.0 GNV CA 6200/GO -> MT 17.0 LE GNV. The 8 are existing source/resolver exceptions, not proof of an export bug. No DB/workbook/code writes.
  • coder03assistant-mba-l-ca progress · 2w ago
    coder03assistant-mba-l-ca | 2026-10-01 23:48 ART. 29-vs-39 contract mapping completed from tracker snapshot 33 sheet modelo-ideal-exportacion and pinned book 2026-09-30-1305 Base. The ideal has 29 headers; Base A:AM and rutap.v_export_libro carry 39 book fields (view additionally has rutap_snapshot_id and rutap_fila). Removing the 10 added fields from the 39 leaves the 29 ideal headers in the same relative order. The added fields are Tipo, Piso, Carroceria, Carroceria Categoria, Motor, Motor Nro, Tipo_Motor, Asientos, Aire_acondicionado, Consumo; view sources are respectively raw_tipo/subtipo, raw_piso/catalog, raw_carroceria/catalog, raw_carroceria_categoria, raw_motor/catalog, raw_motor_nro, raw_tipo_motor/catalog, raw_asientos, raw_aire_acondicionado/catalog, raw_consumo. Base has 5548 vehicle rows; AN Digitos is outside the 39-field view and blank in 5548/5548, so it adds no unmapped populated field. No column in the 29-vs-39 mapping lacks a defensible source; no Eugenia question filed. The newer tracker download could not be imported to SQLite because its sheet para-elazar-hecho is outside the importer schema; it was inspected read-only for duplicate Digitos questions (none). No code or DB changes.
  • coder03assistant-mba-l-ca progress · 2w ago
    coder03assistant-mba-l-ca | 2026-10-01 23:50 ART. Correction to prior event attribution: the tracker DB remains at snapshot 32 (live workbook SHA matches it). modelo-ideal-exportacion headers were read from the 2026-10-01-1135 download, not snapshot 33; import of that download failed because para-elazar-hecho is not mapped by the tracker importer, and no snapshot was created. The header/source mapping and 5548/5548 Digitos blank count remain as stated.
  • coder03assistant-mba-l-ca progress · 2w ago
    coder03assistant-mba-l-ca | 2026-10-01 23:55 ART. Read-only Digitos contract decision from 2026-10-01-1135-todo-rutap-importacion-prestaciones.xlsx, sheet modelo-ideal-exportacion: header row A1:AC1 contains the 29 specified output columns and does not include Digitos. Therefore Digitos is excluded from the historical export contract; its blank values in the pinned source do not justify adding an unrequested 30th output column. The separate SSOT import remains faithful to the book. No Eugenia question: the ideal-model spec is explicit. No workbook, code, or database writes.
  • coder03assistant-mba-l-ca progress · 2w ago
    coder03assistant-mba-l-ca | 2026-10-02 00:25 ART. Confirmed from the 39-column PROD query/CSV reconciliation and current source: Digitos is not in rutap.v_export_libro or RUTAP_HISTORICAL_COLUMNS; it remains outside the historical export, and its absence requires no diff. This resolves the contract question, superseding the original 29-column description via MOVILBA-469. Remaining gate: retrieve the delivered XLSX through GET /api/reportes/vehiculos-historico?format=xlsx and record its actual header and data-row count. Route auth is NextAuth session + vehiculos.read; it has no API-key branch.
  • coder03assistant-mba-l-ca progress · 2w ago
    Timestamp correction: preceding MOVILBA-441 progress entry was stamped 00:25 ART in error; actual time was 2026-10-02 00:18 ART. Its measured contract facts and pending XLSX route gate are unchanged.
  • coder03assistant-mba-l-ca progress · 2w ago
    coder03assistant-mba-l-ca | 2026-10-02 00:22 ART. Delivery-route check: source confirms GET /api/reportes/vehiculos-historico?format=xlsx authorizes via NextAuth session and vehiculos.read; no API-key auth path. Unauthenticated GET to https://app.movilba.com returned HTTP 401 application/json, so no XLSX was received and no header/row-count assertion is claimed. Asked the currently registered live browser proxy to fetch through an existing authenticated session and save the artifact; item stays inProgress pending that file.
  • coder03assistant-mba-l-ca progress · 2w ago
    Timestamp correction: prior MOVILBA-441 progress stamp was 00:22 ART in error; actual write was 2026-10-02 00:19. The HTTP 401 result, authenticated-proxy request, and unreceived XLSX status are unchanged.
  • coder03assistant-mba-l-ca progress · 2w ago
    coder03assistant-mba-l-ca | 2026-10-02 00:23. MOVILBA-441 delivery gate remains unexercised: PROD route source requires NextAuth + vehiculos.read; unauthenticated GET returned 401. Proxy login was denied by its host-side Production Reads permission classifier, and proxy stopped without retrying through another tool. No XLSX received, no header/row count measured, no PROD change. Need an approved authenticated retrieval path (Elazar approval in that session or a permitted session/path) before this item can close.
  • coder03assistant-mba-l-ca blocked · 1w ago
    coder03assistant-mba-l-ca | 2026-10-05 12:26 ART. Verification hold: the XLSX delivery route is GET /api/reportes/vehiculos-historico?format=xlsx and requires a NextAuth session with vehiculos.read; source has no API-key auth path. Prior unauthenticated PROD GET returned 401, and proxy-mba-w-cc's authenticated-login attempt was denied by its Production Reads host guard, so no XLSX/header/row count was obtained. Blocked on an approved authenticated retrieval path; do not bypass the host guard.
  • coder03assistant-mba-l-ca parentChanged · 1w ago
    parent=MOVILBA-99
  • coder03assistant-mba-l-ca unblocked · 1w ago
    Authenticated PROD retrieval completed; XLSX header and row count independently verified.
  • coder03assistant-mba-l-ca progress · 1w ago
    2026-10-05 PROD delivery verification, v5.6.161. Authenticated artifact: /data-lezama/movilba/evidencia/MOVILBA-441/2026-10-05-1502-vehiculos-historico-rutap.xlsx; SHA-256 3a2efeea546a9fb250fc879dda378b9bcea5bc8bc31a8c06264182307a8f6e4e. Independently opened read-only: sheet Historial RUTAP, dimension A1:AM5549, 39 headers and 5,548 nonblank data rows. Header sequence matches proxy's report; includes Digitos nowhere. This satisfies the remaining delivered-XLSX gate. No code/DB changes.
  • coder03assistant-mba-l-ca completed · 1w ago
    PROD XLSX delivered and independently verified: 39-column header, 5,548 data rows, SHA pinned in progress evidence; all requested 441 scope live on v5.6.161.
feature
4w ago by wi-cli-venus
1w ago
2026-10-05 18:20