El reporte historico emite tramite con el texto crudo del libro primero y el catalogo como respaldo, que es al reves de lo que pide la regla 2 del 24/09
Hallazgo de coder04-mba-l-ca el 24/09, adyacente a MOVILBA-574 y deliberadamente NO metido ahi, que solo cubre marca y modelo de chasis. src/app/api/reportes/vehiculos-historico/route.ts:99 emite la columna tramite como coalesce(h.raw_tramite, h.tramite, initcap(lower(op_tramite.valor_opcion))). O sea: primero el texto crudo del libro, y el catalogo recien como tercer respaldo. tramite ES un campo con catalogo detras - opciones, grupo_nombre vehiculo_historial, campo_nombre tramite, joineado calificado en :107-110 - asi que la regla 2 del 24/09 ('nowhere there should be text, that is why we have catalogs') lo alcanza de lleno y el orden actual es exactamente el que la regla saca. LO QUE NO HAY QUE ROMPER AL DARLO VUELTA, y esta escrito en el comentario de :87-98: este reporte es el contrato de 29 columnas de RUTAP y habla el vocabulario del libro, asi que el respaldo se toma de valor_opcion y NO de nombre_mostrable. Eso no choca con la regla: valor_opcion es justamente el literal del libro, no una segunda opinion nuestra. Resolver por catalogo conserva el vocabulario Y cumple la regla al mismo tiempo. EL initcap PROBABLEMENTE SOBRA DESPUES DEL CAMBIO, y hay que medirlo antes de sacarlo. Existe porque el TEXTO CRUDO sale con cuatro grafias (medido en DEV 2026-09-17: Modif 3010, Alta 2501, MODIF 46, ALTA 2) y el filtro por mes del item 27 de Eugenia partia las altas en dos entradas. El catalogo tiene UNA grafia por id, asi que si la columna sale del catalogo el problema de las cuatro grafias desaparece por construccion y el initcap deja de compensar nada. Confirmarlo contando las grafias distintas que produce el catalogo, en las DOS bases, antes de borrar la normalizacion. ALCANCE QUE HAY QUE CENSAR ANTES DE TOCAR: el mismo SELECT dice tener 'las otras ocho columnas' con la misma forma coalesce(raw, normalizado). Hay que separar cuales de esas ocho tienen catalogo detras - esas caen bajo la regla - de las que son texto libre sin catalogo, como observaciones y los dos expedientes de :84-86, que NO caen. Un cambio a ciegas sobre las nueve convierte texto libre en un hueco. Regresion que el cambio NO puede reintroducir: MOVILBA-463. raw_tramite y tramite son texto que solo llena el import, asi que un periodo escrito por la app salia con la columna VACIA aunque tuviera tramite_id resuelto (medido en DEV: AI563JM y AI563JL). Resolver por catalogo primero arregla eso mas fuerte todavia, pero el test tiene que seguir cubriendo una fila escrita por la app.
Activity
-
db03-mba-l-cc 2026-09-24 10:57 ART: measurement for coder04 (SELECT-only, query /data-lezama/movilba/evidencia/MOVILBA-574/596-tramite-spellings.sql, outputs 596-*.out). Both bases: opciones grupo_nombre=vehiculo_historial, campo_nombre=tramite has exactly 2 rows, none deleted: id 317 valor_opcion ALTA, id 318 valor_opcion MODIF (nombre_mostrable Alta / Modificacion). DEV historial rows with borrado_en IS NULL: import 5528, all with tramite_id, 5528 resolve to the qualified option, 0 do not, 2 distinct ids; app 55, 34 with tramite_id (all 34 resolve to the qualified option: 13 ALTA, 21 MODIF), 21 with tramite_id NULL (text column tramite also NULL). PROD: import 5538, all resolve, 0 unresolved, 2 distinct ids; no app-origin rows. Spellings: valor_opcion is always upper case (ALTA/MODIF); the book text column is Alta/Modif in all import rows, so initcap(lower(valor_opcion)) reproduces the book text exactly for these 2 values ('Modificacion' in nombre_mostrable is not the book spelling). Redundant only if the emitted value is meant to be upper case; not redundant if it must equal the book's Alta/Modif. Not exercised: app rows with NULL tramite_id (21 in DEV) - what a consumer should emit for them is not measured here.
-
coder04-mba-l-ca | 2026-09-24 10:59 ART — Source review: vehiculos-historico route resolves tramite_id through the correctly qualified vehiculo_historial/tramite join, but emits raw_tramite/tramite before initcap(lower(valor_opcion)). Added a source regression requiring catalog-only projection and the qualified join (3 assertions; not run per handoff rule). Census identified other option-backed outputs plus free-text observations/expedientes; they are not included in this edit. Waiting on db03's PROD/DEV catalog spelling and FK-coverage counts before removing initcap or changing the query.
-
coder04-mba-l-ca | 2026-09-24 10:59 ART — SELECT census in route.ts: other raw-first/catalog outputs are unidadPropulsora, piso, tipoMotor, aireAcondicionado, cabinaAntivandalica, adas, mdvr, pantallas, wifi, conexionesUsb and identidad; tipo instead resolves through the separate vehiculos_subtipos_transporte table. The raw/current fallbacks for cuit, identificador_empresa, tipo_servicio, linea, dominio, interno, model year, serials, carroceria/motor text, asientos, consumo, equipment identifiers, dates, observaciones and expte_alta/expte_baja are free text/scalars, not option-backed labels; no blanket replacement applied. Catalog-only chasis is already part of separate MOVILBA-574 work. Waiting on db03's catalog spelling and tramite_id coverage measurements.
-
coder04-mba-l-ca | 2026-09-24 10:__ ART. Measured DB evidence from db03's SELECT-only outputs: DEV movilba_dev has exactly 2 nondeleted qualified vehiculo_historial/tramite options (317 ALTA, 318 MODIF); 34/34 nonnull app tramite_id and 5528/5528 import IDs resolve, zero unresolved; 21 app rows have no tramite_id. PROD movilba has the same 2 options; 5538/5538 import IDs resolve, zero unresolved. Output files: /data-lezama/movilba/evidencia/MOVILBA-574/596-DEV_DATABASE_URL.out and 596-SUPERUSER_ELAZAR_URL.out; query 596-tramite-spellings.sql. Source change replaces raw-first/initcap fallback with qualified op_tramite.valor_opcion for every row, retaining canonical RUTAP vocabulary and one spelling; adds static regression requiring catalog-only projection and qualified group+field. Assertion count 20→23. No gates run by coder04. DEV's 21 app rows without tramite_id will produce NULL and remain a data follow-up.
-
coder04-mba-l-ca | 2026-09-24 11:06 ART. Timestamp correction for prior progress event: its 10:__ placeholder was malformed; this is the valid measurement record. db03 SELECT-only outputs: DEV movilba_dev has 2 nondeleted qualified vehiculo_historial/tramite options (317 ALTA, 318 MODIF); 34/34 nonnull app tramite_id and 5528/5528 import IDs resolve, 0 unresolved; 21 app rows lack tramite_id. PROD movilba has the same 2 options; 5538/5538 import IDs resolve, 0 unresolved. Evidence: /data-lezama/movilba/evidencia/MOVILBA-574/596-DEV_DATABASE_URL.out and 596-SUPERUSER_ELAZAR_URL.out; query 596-tramite-spellings.sql. Code replaces raw-first/initcap fallback with qualified op_tramite.valor_opcion for all rows and adds catalog-only/qualification source assertions; printed assertion count 20→23. No gates run by coder04. DEV's 21 app rows without tramite_id will project NULL.
-
audit pass: historico route tramite projection (op_tramite.valor_opcion, qualified vehiculo_historial/tramite join) + 3 assertions in rutap-history-values.test.ts. Clean tree HEAD 63063f66 + route + test (route also carries 574 chassis edits): typecheck, eslint, test:source 38/38. Not run: DB, generated report.
payload
{"scope":"historico route tramite projection (op_tramite.valor_opcion, qualified vehiculo_historial/tramite join) + 3 assertions in rutap-history-values.test.ts. Clean tree HEAD 63063f66 + route + test (route also carries 574 chassis edits): typecheck, eslint, test:source 38/38. Not run: DB, generated report.","outcome":"pass","evidence":"audit-mba-l-cc 2026-09-24. Seen to fail: HEAD route + new test throws on /op_tramite\\.valor_opcion\\s+AS \"tramite\"/. Assertions are source-regex, they prove the query text not the emitted cells. Output changes from initcap (Modif) to valor_opcion (canonical); unmatched id now NULL.","reportRef":null} -
audit fail: Candidate route.ts tramite = initcap(lower(op_tramite.valor_opcion)) + values.test on 67087802+overlay. Clean-tree typecheck.
payload
{"scope":"Candidate route.ts tramite = initcap(lower(op_tramite.valor_opcion)) + values.test on 67087802+overlay. Clean-tree typecheck.","outcome":"fail","evidence":"typecheck: route.ts(89,40) TS1005 ',' expected - backticks around Alta/Modif in a SQL comment inside the sql template literal terminate it. test:source 38/38 stays green (regex reads file text), eslint 1 error on route.ts. Remove the backticks.","reportRef":null} -
audit fail: Re-audit 11:57 candidate: route.ts tramite initcap + comment, values.test (23). Base 67087802+overlay. Clean-tree typecheck+eslint.
payload
{"scope":"Re-audit 11:57 candidate: route.ts tramite initcap + comment, values.test (23). Base 67087802+overlay. Clean-tree typecheck+eslint.","outcome":"fail","evidence":"Same defect persists: route.ts(89,40/44/47) TS1005, backticks around Alta/Modif inside the sql template comment; eslint 1 error. test:source 38/38 (regex-only). Test fails on HEAD route (good). Replace the backticks with plain quotes.","reportRef":null} -
audit pass: route.ts tramite = initcap(lower(op_tramite.valor_opcion)) with backtick-free comment; values.test (23). Base 67087802 + all 7 dirty src files. DB/render, 21 NULL-tramite_id app rows unexercised.
payload
{"scope":"route.ts tramite = initcap(lower(op_tramite.valor_opcion)) with backtick-free comment; values.test (23). Base 67087802 + all 7 dirty src files. DB/render, 21 NULL-tramite_id app rows unexercised.","outcome":"pass","evidence":"Clean tree: test:source 38/38, typecheck 0, eslint 0 on all dirty src files. Prior FAIL (TS1005 backticks) cleared. values.test tramite assertion fails on HEAD route. Casing Alta/Modif rests on db03 measurement, not on a run by me.","reportRef":null} -
coder03-mba-l-cc - shipped en dev v5.6.71 (b678ff5f), 2026-09-24. Va junto con los hunks de MOVILBA-574 (mismo commit, 7 archivos de src). Sobre el PASS: el vigente es el de audit-mba-l-cc de las 15:01:07Z, sobre base 67087802 + los 7 archivos sucios. Supersede al FAIL de las 14:58:04Z y al de las 14:53:47Z, que eran el MISMO defecto: los backticks alrededor de Alta/Modif en el comentario SQL de route.ts:89 terminaban el template sql abierto en :21, TS1005 x3 y 1 error de eslint. Lo corregi yo (comillas simples) porque un arbol rojo bloquea el ship de TODOS los carriles y era la tercera vuelta sobre lo mismo; el resto del hunk es de coder04-mba-l-ca y no se toco. SIN EJERCITAR, del PASS: base de datos y render del reporte; las 21 filas app con tramite_id NULL; la grafia Alta/Modif descansa en la medicion de db03, no en una corrida del reporte. TRAMPA QUE DEJA: el comentario que documenta un campo de catalogo es justo donde se quiere citar la grafia con backticks, y ahi adentro el backtick no es tipografia - cierra el template de JS. La advertencia ya estaba en src/repositories/parque-movil.ts y el defecto volvio igual en otro archivo.
-
audit pass: Rebind to committed b678ff5f (v5.6.71): route.ts tramite initcap + values.test, 7 src files byte-identical (cmp) to gated copies. DB/render, 21 NULL-tramite_id rows unexercised.
payload
{"scope":"Rebind to committed b678ff5f (v5.6.71): route.ts tramite initcap + values.test, 7 src files byte-identical (cmp) to gated copies. DB/render, 21 NULL-tramite_id rows unexercised.","outcome":"pass","evidence":"Gates from clean tree on same bytes: test:source 38/38, typecheck 0, eslint 0. Earlier FAILs (TS1005 backticks) cleared.","reportRef":null} -
coder03-mba-l-cc 2026-09-24 - shipped en dev v5.6.71 (b678ff5f) con el PASS de audit rebindeado a ese sha (15:04:16.900Z, 7 archivos byte-identicos por cmp). El reporte historico emite initcap(lower(op_tramite.valor_opcion)) sin respaldo de texto crudo. SIN EJERCITAR: base, render del reporte, las 21 filas app con tramite_id NULL.