basquetWi + New ticket
movilba MOVILBA-764

El espejo drizzle/schema.ts acumulo 13 hunks de atraso contra movilba_dev, y solo uno es de MOVILBA-367

Done normal dmdb04-mba-l-ca

Medido por mi en el arbol 2026-10-08: drizzle/schema.ts regenerado por db04 con mba-introspect.sh queda en SHA256 b6029b4923e99e7b4da3f21dd4af391ce427407a890ed65b26621e2cdda117d3, 123 insertions / 123 deletions en 13 hunks. UNO es de 367 - el swap de FROM en rutap.v_rutap_chasis_resuelto, linea 3823. Los otros 12 son atraso acumulado del espejo contra la base: v_vehiculo_historial 2214, v_vehiculos_detalle 2321, v_vehiculo_cadena 2370, v_admin_entidades_search 2707, v_rutap_ultima_alta_por_dominio y v_rutap_latest_projection_eligible 2900/2986 (relocacion), v_snapshot_catalog_preflight 3220, v_asociaciones_entidad_persona 3262, v_direcciones_postales 3338, v_entidades_export 3400, v_instalaciones 3435, v_vehiculos_export 3787. NO SE SHIPEA con 367: meter 12 hunks sin veredicto bajo el nombre de un item es exactamente lo que el alcance por hunk prohibe. Trabajo: separar los 13 por scope y conseguir veredicto por hunk, o declarar el espejo regenerable y no versionarlo mas - esa segunda es una decision, no una tarea. LIMITE DEL INSTRUMENTO, y es la razon de que esto no se pueda leer como deriva PROD/DEV: mba-introspect.sh lee SOLO movilba_dev, asi que un hunk que aparece al regenerar no distingue deriva de la base contra archivo vencido. Varios de los 12 son relocaciones de bloque por orden de introspeccion, no cambios de tipo - hay que decir por cada uno cual es cual antes de pedir cualquier veredicto. Dato de db04: 117/117 vistas verificadas en movilba_dev, 4 literales lossy ya baselineados, relations.ts SIN cambios en 19650192.

Sub-tickets

No sub-tickets.
+ Add sub-ticket

Activity

  • coder03-mba-l-cc created · 1w ago
  • coder03-mba-l-cc note · 1w ago
    coder03-mba-l-cc 2026-10-08 22:01Z - el archivo regenerado YA NO esta en el arbol: db04 lo descarto bajo lock y drizzle/schema.ts volvio al blob de HEAD ffc1f76c. Yo habia pedido lo contrario, parkearlo intacto, asi que el SHA256 b6029b49 que cita este item no se puede verificar por ruta - se reproduce corriendo ./mba-introspect.sh de nuevo contra movilba_dev, que es lo que hay que hacer antes de censar. No se perdio nada porque el archivo es generado, pero el censo arranca por regenerarlo, no por leerlo. CONTEO RESUELTO por audit, sin censo: 13 contra 15 era un instrumento en dos configuraciones - 'git diff' con el -U3 por defecto junta hunks adyacentes y da 13 headers, 'git diff -U0' da 15. Los dos numeros estaban bien. El censo se hace con -U0 y cuenta 15, porque un hunk juntado esconde justo el borde entre un cambio ajeno y el de 367.
  • db04-mba-l-ca assigned · 1w ago
    db04-mba-l-ca
  • db04-mba-l-ca statusChanged · 1w ago
    DEV mirror regenerated under checkout lock; -U0 census and evidence report underway.
  • db04-mba-l-ca progress · 1w ago
    Regenerated ./mba-introspect.sh against verified movilba_dev: 117 installed/117 mirrored, 4 baseline lossy literals, no new typecheck/lint errors; schema.ts HEAD sha256 f34b4bea -> generated b6029b49, 123+/123-, relations.ts unchanged 19650192. git diff -U0 = 15 headers, -U3 = 13; zero projected column/type changes. Object-level: 13 changed SQL bodies (12 installed MOVILBA-737 deleted-option suffix views, 1 MOVILBA-367 chassis FROM swap), 7 declarations relocated by introspection order (5 also body-changed, 2 relocation-only). Full per-hunk ledger: /data-lezama/movilba/evidencia/MOVILBA-764/2026-10-08-drizzle-dev-mirror-hunk-census.md. Generated schema.ts left modified but unstaged; no commit, and no PROD inference from DEV introspection.
  • db04-mba-l-ca note · 1w ago
    Audit correction before verdict (audit-mba-l-cc, 2026-10-08 20:41 ART): v_fabricantes has NO change. The earlier claimed FROM swap and fabricante/nombre/observaciones projection there were word-diff boundary artifacts crossing declaration edges; same for phantom td.id join reorder. Name-keyed census finds ordered column identifier lists identical for all 13 affected views; 0 UNRESOLVED. Exact diff: 123 added + 123 removed = 246 changed lines; 12 view bodies trace to MOVILBA-123 deleted-option suffix, 1 to MOVILBA-367 FROM v_rutap_latest -> rutap_rows in rutap.v_rutap_chasis_resuelto; 6 declarations relocate by DEV introspection ordering. Audit independently checked PROD SELECT-only: 15/15 relevant views agree PROD, DEV, mirror for suffix count and chassis FROM; no column-list changes. DEV mirror alone was not used to infer PROD parity. Verdict still owed; generated schema.ts b6029b49 remains unstaged.
  • audit-mba-l-cc audited · 1w ago
    audit pass: drizzle/schema.ts b6029b49 ONLY, re-hashed before/after my gates. All 246 changed lines classified name-keyed: 12 views 123-suffix, 1 view 367-FROM, 6 relocated, 0 UNRESOLVED. PROD/DEV suffix counts and view census SELECT-only. NO DDL, no row read through any view, no app surface.
    payload
    {"scope":"drizzle/schema.ts b6029b49 ONLY, re-hashed before/after my gates. All 246 changed lines classified name-keyed: 12 views 123-suffix, 1 view 367-FROM, 6 relocated, 0 UNRESOLVED. PROD/DEV suffix counts and view census SELECT-only. NO DDL, no row read through any view, no app surface.","outcome":"pass","evidence":"audit-mba-l-cc, 2026-10-08T23:46Z. PASS on drizzle/schema.ts b6029b4923e99e7b4da3f21dd4af391ce427407a890ed65b26621e2cdda117d3, HEAD 78124caf (f34b4bea). numstat 123 added / 123 removed = 246 changed lines, NOT 248.\n\nINSTRUMENT: a word diff of this file is not one - it gave me two false positives (a v_fabricantes projection change, a td.id JOIN reorder) because a word-run crosses declaration edges. vFabricantes is byte-identical. What works is name-keyed, both directions: split into top-level export const blocks, hash each, diff the maps. HEAD 189 declarations, TREE 189, 0 only-in-HEAD, 0 only-in-TREE, 13 changed bodies. Preamble 3 lines, compared in full, identical.\n\nCLASSIFICATION, 0 UNRESOLVED: 12 views are 123's (borrado) suffix; 1 is 367's FROM rutap.v_rutap_latest -> rutap.rutap_rows on rutap.v_rutap_chasis_resuelto; 6 declarations relocated, 113 of the 123 lines per side. Both classes traced to a HEADER, not shape: the 123 file names all 15 affected views, says MOVILBA-123 33 times, uses 12 CREATE OR REPLACE and 0 DROP VIEW; 367's PROD-Y-DEV file does that exact replace at :23 on the view named at :26. NO column list changed either way - ordered column identifiers identical on all 13.\n\nPROD MEASURED, NOT DISCLAIMED: mba-introspect.sh reads DEV only, so this file is no evidence about PROD. PROD 17.6 vs DEV 15.17 means a body diff measures the deparser, so the instrument is an occurrence count of ' (borrado)' in pg_get_viewdef. 15 of 15 views agree PROD = DEV = mirror (1,1,1,6,6,1,1,8,1,3,8,12,1,1,1). rutap_rows present and v_rutap_latest absent in both. Census 89 public + 15 rutap views per base vs exactly 89 pgView + 15 rutap.view declared. Instrument SEEN to discriminate twice: 0 on three views outside 123's scope, 0 or lower on HEAD's mirror.\n\nRELOCATION is NOT the DROP VIEW grant-loss path: CREATE OR REPLACE preserves the oid and all 104 PROD views still carry their ACL. It is DEV oid ordering, no database meaning. Four non-blocking findings in the note.","reportRef":null}
  • audit-mba-l-cc audit-finding · 1w ago
    # MOVILBA-764 — audit verdict: PASS on the regenerated mirror. audit-mba-l-cc, 2026-10-08 drizzle/schema.ts b6029b4923e99e7b4da3f21dd4af391ce427407a890ed65b26621e2cdda117d3 Re-hashed before and after my gate run, still `b6029b49`. HEAD is `78124caf`, where the file is `f34b4bea`. `git diff --numstat` is **123 added / 123 removed = 246 changed lines**, not 248. The symmetry is the first result: every change here is a replacement, nothing is a net insertion or deletion. ## 1. The instrument, because a line diff of this file cannot answer the question This is one long machine-emitted file in which declarations **move**, so a line-oriented diff mixes relocation with substance. Two readings of mine were wrong before I fixed the instrument. Both are recorded because I put the first on the wire and a lane began carrying it as an open question: - A `--word-diff=porcelain` pass suggested `v_fabricantes`' body had changed - a new `fabricante`/`nombre`/`observaciones` projection and `FROM rutap.v_rutap_latest` -> `rutap.rutap_rows`. **It had not.** Extracted whole, `vFabricantes` is byte-identical on both sides. The `v_rutap_latest` change belongs to `rutap.v_rutap_chasis_resuelto`. - The same pass showed `-direcciones_postales dp LEFT JOIN opciones td ON td.id = dp.tipo_direccion_id` with no `+` counterpart, which read like a JOIN-predicate reordering. **There is no such change.** Both are the same artifact: **a word-run crosses declaration edges, so it is not attributable to the view it appears to sit in.** A word diff of this file is not an instrument. What works is **name-keyed and diffed in both directions**: split both files into top-level `export const <ident> = ...` declarations, hash each block, compare the two maps. Relocation cannot register, because the key is the name and not the offset. declarations HEAD 189 TREE 189 only in HEAD 0 only in TREE 0 changed body 13 The file's preamble is **3 lines and identical in full** - compared entirely, not by its first lines, because "all 246 lines classified" depends on nothing changing outside the blocks. ## 2. All 246 changed lines classified. UNRESOLVED = 0 | class | count | what | |---|---|---| | MOVILBA-123 `(borrado)` suffix | **12 views** | `v_admin_entidades_search`, `v_asociaciones_entidad_persona_detalle`, `v_entidades`, `v_entidades_detalle`, `v_entidades_detalle_all`, `v_entidades_export`, `v_instalaciones`, `v_personas_completas`, `v_vehiculo_cadena`, `v_vehiculo_historial`, `v_vehiculos_detalle`, `v_vehiculos_export` | | MOVILBA-367 `FROM` operand | **1 view** | `rutap.v_rutap_chasis_resuelto`: `FROM rutap.v_rutap_latest r` -> `FROM rutap.rutap_rows r`, rest of the body byte-identical | | relocation, content-neutral | **6 declarations**, 113 block lines | §4 | | UNRESOLVED | **0** | | **Both classes are traced to a migration header, not inferred from shape** - the same bar coder03 set for me, applied to my own classes: - `docs/migrations/2026-10-08-movilba-123-sufijo-borrado-vistas-PROD-Y-DEV.sql` names all 12 views above plus the three of §3 that were already suffixed, and says `MOVILBA-123` 33 times. It also states why there is **no `DROP VIEW`** in it (`:78-82`): `CREATE OR REPLACE` refuses to change an output column's type, so the cast to `character varying(50)` is what makes the REPLACE legal and preserves the grants. 12 `CREATE OR REPLACE VIEW`, 0 actual `DROP VIEW` - the one `DROP VIEW` grep hit is that comment. - `docs/migrations/2026-10-08-movilba-367-snapshot-scoped-chasis-PROD-Y-DEV.sql:23` performs exactly `replace(..., 'FROM rutap.v_rutap_latest r', 'FROM rutap.rutap_rows r')` on `rutap.v_rutap_chasis_resuelto`, named at `:26`. Every suffix change is the same shape, `X.nombre_mostrable AS y` -> `CASE WHEN X.borrado_en IS NOT NULL THEN (("left"(X.nombre_mostrable::text, 40) || ' (borrado)'::text))::character varying(50) ELSE X.nombre_mostrable END AS y`. I did not take that on the diff's word: for the four removed runs that carry text past the column (`FROM v_vehiculo_historial vh ...`, `FROM licencias_choferes lc ...`, `ORDER BY vh.fecha_alta DESC NULLS LAST`, `ORDER BY ce.es_primario DESC`) I matched the `+` counterpart and confirmed the JOIN, WHERE and ORDER BY tails are byte-identical. **No predicate moved.** **No projected column list changed, in either direction.** Measured per view over the declaration half of each block: all 13 have the same ordered list of column identifiers on both sides - 9, 14, 15, 15, 16, 6, 15, 27, 13, 12, 29, 59, 45. That matters because a view's projected column list is a structural object under the PROD->DEV rule, and a mirror that silently narrowed one would strip columns from readers. ## 3. The mirror is a DEV read, so I measured PROD rather than disclaiming it `./mba-introspect.sh` reads **DEV only**, so this file mirrors `movilba_dev` and **cannot, by construction, be evidence about PROD**. Saying that is not a measurement, so I took one, SELECT-only, in both bases. PROD is `movilba` on **pg 17.6** as `svc_nextjs`, DEV is `movilba_dev` on **pg 15.17** as `movilba_user`. Across two majors the deparser rewrites bodies, so **I did not diff bodies across bases.** The instrument is an **occurrence count of the literal `' (borrado)'`** in `pg_get_viewdef(oid, true)` - a count, not a text comparison, so not deparser-sensitive the way a diff is. view PROD DEV mirror v_admin_entidades_search 1 1 1 v_asociaciones_entidad_persona_detalle 1 1 1 v_entidades 1 1 1 v_entidades_detalle 6 6 6 v_entidades_detalle_all 6 6 6 v_entidades_export 1 1 1 v_instalaciones 1 1 1 v_personas_completas 8 8 8 v_vehiculo_cadena 1 1 1 v_vehiculo_historial 3 3 3 v_vehiculos_detalle 8 8 8 v_vehiculos_export 12 12 12 v_admin_opciones_list 1 1 1 v_personas_list 1 1 1 v_vehiculos_list 1 1 1 15 of 15 agree across both bases and with the mirror. `rutap.v_rutap_chasis_resuelto` contains `rutap_rows` and **not** `v_rutap_latest` in both. View census: **89 public + 15 rutap views in PROD, the same 89 + 15 in DEV, and the mirror declares exactly 89 `pgView` + 15 `rutap.view`** - on this axis the mirror over- or under-reports neither base. **The count instrument was seen to discriminate, twice, rather than reported green.** Control A: over three views outside 123's scope (`v_fabricantes`, `v_instalacion_lineas`, `v_opciones`) it returns **0** in both bases, so it can report absence. Control B: over HEAD's mirror it returns **0** for 9 of the 12 and a lower number for the other 3 - `v_personas_completas` 6, `v_vehiculos_detalle` 1, `v_vehiculos_export` 1, against the tree's 8, 8 and 12 - so it was seen to produce a different number before the change. ## 4. The relocation, measured instead of asserted Six declarations moved, not one. Diffing the ordered list of declaration names: `vPersonasCompletas`, `vAsociacionesEntidadPersonaDetalle`, `vEntidades`, `vEntidadesDetalle`, `vEntidadesDetalleAll`, `vEntidadesExport`. `vInstalacionLineas` changes index because those move around it; its block is byte-identical. The six moved blocks plus it are **113 lines** of the 123 per side. All six are also among the 13 with a changed body, which looks like the `DROP VIEW` grant-loss path `docs/migrations/README.md:19` warns about - so I checked rather than assumed. **It is not that path.** 123 used `CREATE OR REPLACE` throughout, which preserves the oid, and `relacl` is unchanged: all 104 views in PROD still carry their ACL. The mirror emits in **DEV oid order**, and DEV's current oid order for these is exactly the tree's order, so HEAD's file was emitted from a DEV state whose oids differed. The relocation is a **file-ordering artifact with no database meaning**, which the name-keyed census proves independently: 0 declarations added, 0 removed, every column list identical. ## 5. Findings - none blocks the PASS 1. **Three views already carried the suffix at HEAD and are absent from this diff** (`v_admin_opciones_list`, `v_personas_list`, `v_vehiculos_list`, 1 each on both sides). 123 landed in more than one leg and this regen is its tail. Live counts match in both bases, so nothing is wrong - but **this diff is not a census of 123's footprint** and must not be cited as one. 2. **A word diff of this file is not an instrument** (§1). It produced two false positives in a row, one of which I put on the wire. Anything read off `drizzle/schema.ts` by line or by word-run should be re-measured name-keyed before it is reported. 3. **DEV/PROD divergence in ownership and grants, for MOVILBA-585 and not for this item.** In DEV all 104 views are owned by `movilba_user` with `relacl` NULL on 92 of them; in PROD they are owned by `movilba_owner` (71) and `postgres` (33) with an explicit ACL on 95 of 104. DEV works because the app role is the owner. The consequence worth recording is about a control already shipped: 123's grant-preservation check compares `coalesce(relacl::text,'~NULL~')` before and after and raises only a `WARNING` on NULL (`:130-131`), so **in DEV it compared NULL to NULL for 11 of its 12 views and could not have failed.** Real in PROD, inert in DEV. 4. **A regenerated mirror is not a migration record.** Nothing in the file says which migration installed which body. Fine as committed; worth not treating the file as intent. ## 6. NOT EXERCISED - **No DDL, no writes, nothing applied.** Every statement I ran was `SELECT` / `pg_get_viewdef` against both bases. I installed, replaced and dropped nothing. - **No `SELECT` through any of the 13 views**, in either base. I measured their *definitions*; I read no row, so the rendered label of a soft-deleted option is unverified by execution here. - **No app surface opened.** The suffix's effect on the ficha, the XLSX, the PDF and the JSON API is outside this file and unmeasured in this item. - **Parity beyond the suffix, the 367 `FROM`, the column lists, the view census and `relacl` is NOT measured.** The count instrument answers one question per view; a PROD/DEV difference elsewhere in these bodies would not appear in it, and the 17.6/15.17 deparser gap is what rules out a general body diff. Full parity is MOVILBA-585 / MOVILBA-731. - **Nothing was regenerated by me.** I did not run `./mba-introspect.sh`; a re-run reads DEV again and so could not distinguish real drift from a stale file. - The whole-tree gates covered this file as compiled TypeScript (`typecheck` rc=0) together with ~20 files belonging to other lanes.
  • db04-mba-l-ca completed · 1w ago
    Regenerated DEV mirror drizzle/schema.ts b6029b49 was audited PASS at 23:44:49Z and committed as 89f3baba; 12 MOVILBA-123 suffix bodies, 1 MOVILBA-367 FROM body, 6 declaration relocations, zero unresolved and no projected column/type changes. PROD was measured separately by audit; DEV-only introspection was not used to infer PROD. The current working-tree schema.ts hash 2d0e74a9 differs from the committed b6029b49 and is not part of this closed scope; do not stage it under 764. MOVILBA-59 mirror addition must be separately re-censused and verdicted before ship.
task
1w ago by coder03-mba-l-cc
1w ago
2026-10-09 02:08