basquetWi + New ticket
movilba MOVILBA-125

RUTAP full-history refactor

Backlog high dmdb04-mba-l-ca

Replace the lossy single-current-row RUTAP projection with a wide, typed vehicle-history model built from the sole current authorized workbook. PostgreSQL raw staging retains exactly that one workbook, whose Base sheet already contains the complete history. Normalize every Base row into queryable history with source provenance and conflict/status fields on the same row; never skip, quarantine, or park source rows. Replacing the raw workbook replaces its normalized mirror. Resolve catalog values through canonical views, derive one deterministic current event without discarding conflicting history, cut UI/PDF/API consumers to typed columns, and retire legacy cambios JSONB/VDC projection only after reconciliation. Children implement DB schema/view, writer/reconciliation, consumer cutover, typed manual updates, interval semantics, and modification subtype derivation.

Sub-tickets — 22/23 done

MOVILBA-129 Done high
cmcoder-mba-l-ca
MOVILBA-432 Done high
cmcoder-mba-l-ca
+ Add sub-ticket

Activity

  • wi-cli-venus created · 7w ago
  • wi-cli-venus assigned · 7w ago
    coder02-mba-l-ca / coder
  • wi-cli-venus statusChanged · 7w ago
    Starting Phase A: consolidate completed child evidence, identify remaining read-only inventory/mapping gates, and coordinate the explicit DB/audit approval required before DDL or importer work.
  • wi-cli-venus progress · 7w ago
    Phase A inventory: MOVILBA-42 append-only selector foundation is already shipped/audited; MOVILBA-112's 1,037 closed rows remain explicitly deferred to this epic; MOVILBA-89 has the persistent-quarantine design but only temporary rehearsal worklists exist. First remaining implementation gate is the field-mapping matrix plus a writer/migration design that preserves raw snapshot/fila provenance for every row and separates history retention from current-projection eligibility. No DDL/import write has started.
  • wi-cli-venus progress · 7w ago
    Added docs/design/movilba-125-phase-a-inventory.md: non-volatile live-inventory queries, raw-to-history mapping obligations, and hard provenance/persistent-quarantine/event-key/idempotency/rehearsal gates. Sent to db02, db03, and audit for review before any writer or DDL design.
  • wi-cli-venus progress · 7w ago
    db03 Phase-A review applied to docs/design/movilba-125-phase-a-inventory.md: provenance key is now an asserted/declared gate, inventory covers constraints/indexes/triggers/grants/archive and transitive dependencies, current-selection/quarantine is explicit, raw labels stay raw, and backup plus zero-unexplained-diff gates are mandatory. No DDL/writer started.
  • wi-cli-venus progress · 7w ago
    Applied db02/db03 Phase-A revisions: snapshot pin/provenance metadata and null-safe uniqueness; both raw row fields; trigger-function/RLS/archive/transitive code inventory; explicit unresolved-catalogue NULL+conflict semantics and re-plate chain rule; deterministic write-set/collision report, readable backup, and apply=true-in-transaction ROLLBACK rehearsal. No DDL/writer started.
  • wi-cli-venus verified · 7w ago
    db03 PASS: revised Phase-A inventory/mapping gate covers required provenance/snapshot evidence, archive-trigger-RLS-transitive-consumer inventory, conflict and physical-chain handling, deterministic write-set/collision report, backup validation, and real rollback rehearsal. It remains read-only; no DDL is approved.
  • wi-cli-venus progress · 7w ago
    Added complete proposed mapping for every nonblank RUTAP Base-sheet header to docs/design/movilba-125-phase-a-inventory.md. It maps each raw field to additive history target/resolver/projection behavior, including the canonical estandar_emisiones mapping for tipo_motor and explicit conflict-coded NULL handling. Sent DB/audit review; no DDL/writer started.
  • wi-cli-venus progress · 7w ago
    Revised raw-field matrix per db03: explicit additive scalar/FK contracts and scoped lookups replace alternatives; observations is text NOT NULL with blank→'' reconciliation; tipo_motor scope is active motor/estandar_emisiones name matching; and VDC projection now explicitly covers all RUTAP-fed VDC fields, Phase-C date rename, derived state, and untouched validadora fields. Re-review requested; no DDL/writer started.
  • wi-cli-venus progress · 7w ago
    Final Phase-A matrix revision requested for DB/audit verdict: all catalogue scopes/FKs and fixed unidad_propulsora map explicit; selection grain is current vehicle/domain (re-plate-safe), entity/line rebuild feeds canonical current views, and literal 0 plus ADAS/MDVR contradictions remain retained evidence. No DDL/writer started.
  • wi-cli-venus progress · 7w ago
    db02 Phase-A gate APPROVED. Applied db03 final CUIT normalization correction: uses PostgreSQL-safe regexp_replace(raw, '[^0-9]', '', 'g'), not a double-backslash \D pattern. Final db03 PASS requested; DDL/writer may be drafted only after it.
  • wi-cli-venus verified · 7w ago
    FINAL PHASE-A PASS from db02 and db03. The matrix/gate is approved for additive schema and writer design. Binding conditions remain: fresh DEV+PROD inventory, collision report, source/provenance retention, DB read-only review, and rehearsal before any apply=true. No DDL/writer has begun or is authorized by this review.
  • wi-cli-venus progress · 7w ago
    Drafted docs/design/movilba-125-additive-schema-writer-design.md: additive history/provenance/quarantine schema shape, deterministic event-key precondition, staged writer transaction, domain-safe current selection, current VDC/entity/line projection, and review/rehearsal sequence. Sent for peer review; no executable DDL or writer exists.
  • wi-cli-venus progress · 7w ago
    Revised additive design per db02: added durable rutap.normalized_vehicle_events holding relation for source events without resolvable non-null vehiculo_id, provenance-preserving idempotent promotion path, and source-keyed rutap.normalization_conflicts distinct from projection quarantine. Explicitly classifies projection-blocking versus retained source-quality conflicts. Re-review requested; no executable DDL/writer.
  • wi-cli-venus progress · 7w ago
    Applied db03 additive-design corrections: explicit composite raw-row FK on both normalized destinations, normalizado_en/normalizado_por contract, and one-current-domain-per-vehiculo/VDC selection rule. The db02 unresolved-event holding/conflict revision is included. Re-review requested; no executable DDL/writer.
  • wi-cli-venus progress · 7w ago
    Added executable-design provenance hardening: nullable normalizado fields with RUTAP conditional CHECK, MATCH FULL composite raw FKs plus per-destination UNIQUEs, and rutap.normalized_event_ownership exclusive registry/serialized promotion protocol with deferred exactly-one cardinality gate and reconciliation coverage. Re-review requested; no executable DDL/writer.
  • wi-cli-venus verified · 7w ago
    FINAL implementation-design PASS from db02 and db03. Authorized next step: draft executable additive DEV DDL and writer for read-only DB review only. The PASS does not authorize apply; fresh inventory, measured reports, reviews, and DEV rollback rehearsal remain mandatory.
  • wi-cli-venus blocked · 7w ago
    Executable additive DDL/writer draft is gated on fresh DEV+PROD read-only inventory and measured selected-snapshot provenance/event-key/current-selection reports. Requested from db03-mba-l-ca; no schema guesswork or DDL draft until those inputs arrive.
  • wi-cli-venus unblocked · 7w ago
    db03 delivered fresh DEV/PROD inventory and current-selection measurements. The next pre-DLL task is to specify and measure the deterministic cross-snapshot event-key candidate; raw provenance, real terminal-tie quarantine workset, trigger/archive/dependency and per-environment grant facts are now recorded.
  • wi-cli-venus progress · 7w ago
    Specified the deterministic event-key candidate in additive design: versioned length-delimited hash of resolved/unresolved identity key, business dates/expedientes/tramite, and canonical typed Base-field fingerprint with NULL markers, excluding snapshot/row position. Requested db03 collision measurement on runtime-pinned sources before any UNIQUE/DDL.
  • wi-cli-venus blocked · 7w ago
    Event-key collision gate cannot run honestly: missing (1) executable ordered canonical serialization for every typed source field and T1-T7/NULL encoding, (2) queryable physical-identity resolver with resolved/unresolved key, and (3) comparison representation for existing narrow vehiculo_historial. Raw duplicate proxy is explicitly non-authorizing. Need resolver ownership/design before UNIQUE, executable DDL, or writer.
  • wi-cli-venus unblocked · 7w ago
    PM assigned physical-continuity resolver design to MOVILBA-125 owner. Drafting it for specific db02/db03 PASS; no event-key UNIQUE, executable DDL, or writer resumes before that review.
  • wi-cli-venus progress · 7w ago
    Drafted docs/design/movilba-125-physical-continuity-resolver.md: fail-closed ordered chassis/validated-bridge/domain-provisional/unresolved resolution, re-plate-safe domain-state boundary, and required deterministic read-only measurement report. Sent db02/db03 for specific resolver PASS; no UNIQUE/DDL/writer.
  • wi-cli-venus progress · 7w ago
    Revised physical-continuity resolver per db02/db03: exact normalized live-domain vehiculo_id predicate and holding outcome, immutable versioned resolver basis, chassis-chain versus vehicle distinction, exact bridge predicates/normalization, consistent unresolved key, and no-fallback ambiguity rule. Specific re-review requested; no UNIQUE/DDL/writer.
  • wi-cli-venus progress · 7w ago
    Revised physical-continuity resolver design after DB review: rejects unusable chassis sentinels/scientific corruption; adds fail-closed reviewed new-vehicle candidate for unique, complete zero-match SSOT domains; defines domain-key idempotency and transaction re-resolution; corrects re-plate evidence report. Requested final db02/db03 review. No DDL, writer, constraint, or import executed.
  • wi-cli-venus verified · 7w ago
    db03 PASS: resolver design may drive event-key measurement and writer drafting. Required implementation parameters recorded: exact versioned SQL usable_chasis_key predicates and byte-reproducible ordered-output digest serialization. Awaiting db02 final review; no DDL/writer/import executed.
  • wi-cli-venus progress · 7w ago
    Applied db02 measurement-safety conditions to resolver design: each report branch now needs denominator and had_input status; bridge-shaped versus gated-in bridge populations are distinct; non-deleted is explicitly borrado_en rather than estado_id; scientific notation is documented as defensive legacy input, not pinned-source observation. Requested final db02 confirmation. No DDL/writer/import executed.
  • wi-cli-venus verified · 7w ago
    db02 FINAL PASS on physical-continuity resolver design. Gate cleared for read-only executable measurement drafting. Measurement must use full pinned-snapshot denominator for chassis exclusions and report bridge-shaped pairs even if gated-in candidates are zero. No DDL/writer/import executed.
  • wi-cli-venus progress · 7w ago
    Corrected resolver control flow after db02 re-review: exact-one live domain resolves, zero-match alone reaches reviewed new-vehicle candidate, and multiple-match holds. Re-requested db02 confirmation. No executable measurement, DDL, writer, or import has run.
  • wi-cli-venus verified · 7w ago
    db02 final PASS after control-flow correction. Resolver is approved for read-only event-key/resolver measurement. Measurement report must runtime-pin and label DEV/PROD snapshots separately, report full-population denominators and had_input coverage, and preserve bridge-shaped counts independently of gated candidates. No DDL, writer, UNIQUE, or import executed.
  • wi-cli-venus assigned · 6w ago
    coder02-mba-l-cc / coder
  • wi-cli-venus assigned · 6w ago
    coder-mba-l-ca / coder
  • wi-cli-venus decision · 6w ago
    Elazar 2026-09-03 supersedes snapshot-retention and quarantine assumptions: DEV/PROD retain one current raw RUTAP workbook only; that workbook contains the complete vehicle history. Every Base row must be normalized into queryable wide history. Conflicts stay in that history with explicit status/error fields and remain visible; no row is skipped or parked in a separate quarantine/holding destination. The legacy narrow vehiculo_historial/VDC projection must not run. Implement the additive wide-history path first, then cut consumers over after reconciliation.
  • wi-cli-venus progress · 6w ago
    Created executable child split: MOVILBA-202 DB schema/view (db03), MOVILBA-203 writer/reconciliation, MOVILBA-204 UI/PDF/API cutover, MOVILBA-205 typed manual internal-number changes. Separate confirmed auth defect is MOVILBA-201. Typecheck and targeted lint pass for current MOVILBA-201/205 code.
  • wi-cli-venus descriptionChanged · 6w ago
    was: Consolidating epic for the RUTAP full-history refactor: replaces the one-live-row vehiculo_historial model with an explicit wide-snapshot append-only table, retires cambios jsonb in favor of typed columns + comparison views, adds v_vehiculo_historial_actual as the sanctioned current-row selector, and renames VDC vigencia columns to fecha_alta/fecha_baja. Full spec: docs/design/rutap-full-history-refactor-plan.md. Children below were filed independently before the plan was written and measure/scope pieces of the same refactor; consolidated here for traceability, not closed.
  • wi-cli-venus decision · 6w ago
    Only Base is an operational source. Hoja1/Hoja2 and every other workbook sheet are reported but not imported; no current application consumer or approved contract exists for them. The canonical importer and documentation were updated accordingly.
  • wi-cli-venus decision · 6w ago
    Elazar, 2026-09-03: 'table should track all'. vehiculo_historial tiene que seguir TODAS las columnas del vehiculo, no solo entidad/linea/estado/observaciones. Deja de ser una opcion del refactor y pasa a ser el requisito: la tabla ancha es el camino, no una alternativa. Contexto: MOVILBA-168 pregunto que hacer cuando alguien edita solo equipamiento y llena la constancia - escribir una fila que no puede describir el cambio, o no escribir nada y perder el expediente. Elazar rechazo las dos y ordeno que la tabla siga todo.
  • wi-cli-venus decision · 5w ago
    Elazar, 2026-09-04 (via db02, CLI): 'I want this done now, in an orderly fashion, no deferring any more.' Reaffirms the 09-03 decisions: vehiculo_historial must track ALL vehicle columns (everything VDC has plus whatever else is needed); the legacy narrow projection must not run. Measured state on DEV at this time: legacy public.vehiculo_historial has 18 columns and lacks 22 of VDC's 32; it is still the only table the app writes and the UI reads; today's loader run (472 updates, 85 duplicate inserts) and the MOVILBA-238 source-key DDL both target it. Wide rutap.vehiculo_historial_normalizado holds snapshot 9 only, nothing writes to it, nothing reads it, and lacks by name: estado_id, sube_id_validadora, sube_mounting_kit, openpass_id_validadora, openpass_mounting_kit (conexiones_usb exists as conexiones_usb_id). MOVILBA-203/204/206 inProgress with no event since 09-03 14:39. docs/design/rutap-full-history-refactor-plan.md is not on origin/dev. coder02-mba-l-cc stopped the 238 package at 20:56 for exactly this conflict.
  • wi-cli-venus progress · 5w ago
    PM correction to the 00:28 measured state (coder02, 21:35 ART): the wide table holds SNAPSHOT 10 only (db03 MOVILBA-203 refresh tonight, 5370/5370 vehiculo_id resolved, 0 dup (vehiculo_id,rutap_fila_excel)); and it HAS a reader since v5.4.154/155: src/repositories/rutap-historial.ts -> getVehiculoHistorial -> ficha Historial del Vehiculo (chain walk via v_vehiculo_cadena, typed diff per row, latest snapshot only). Legacy vehiculo_historial is no longer read by the ficha. Still true: writer is ON CONFLICT DO NOTHING (no replace-on-snapshot), wide table lacks VDC columns estado_id, sube_id_validadora, sube_mounting_kit, openpass_id_validadora, openpass_mounting_kit. Sequence GO'd now: (1) db03 DDL adding the missing VDC columns to rutap.vehiculo_historial_normalizado on DEV (additive, nullable, migration file, gates); (2) coder-ca 203 writer replace-on-snapshot + vehiculo_id re-resolution; (3) 238 key applies to the wide table, legacy stops being written; (4) 204 PDF/API remainder.
  • wi-cli-venus decision · 5w ago
    PM 21:36: step-1 DDL scope narrowed per db02 column diff (/data-lezama/import-reports/2026-09-04-vdc-vs-wide-column-diff.txt): add sube_id_validadora, sube_mounting_kit, openpass_id_validadora, openpass_mounting_kit, estado_id (nullable FK opciones). NOT added: fecha_vigencia_* (= fecha_alta/fecha_baja, 2405/2406 identical), borrado_*/creado_* (audit columns). estado_id source rule: loader never writes it; only 206 edit path and 219; NULL = not asserted by the book. db02 pre-reviews the file, db03 applies on DEV. db02 also confirmed the 238 key computes clean from raw_* on snapshot 10 (5370/5370, control isolates AD956UK) and retracted its own no-snapshot-filter finding on v_vehiculo_historial_actual.
  • wi-cli-venus progress · 5w ago
    db03 21:34: step-1 DDL applied DEV-only, docs/migrations/2026-09-04-movilba-125-wide-history-vdc-columns-DEV.sql - estado_id (FK opciones), sube_id_validadora, sube_mounting_kit, openpass_id_validadora, openpass_mounting_kit, all nullable; rollback tested first; VDC business-column diff = 0 after apply; movilba_user SELECT ok. Pending: estado_id source-rule comment amendment, README/pending-prod-changes index, db02 post-review. coder-ca 203 writer replace-on-snapshot still open.
  • wi-cli-venus verified · 5w ago
    db02 post-review step 1: PASS on applied DEV state (5 columns, types match VDC, FK opciones, 0 data, legacy untouched, grants ok). Deviation on record: estado_id nullable here vs NOT NULL in VDC (PM decision, history row). Gate fixes sent to db03 for the file: type+nullability compare, positive control, no-op GRANT, DOWN section.
  • wi-cli-venus progress · 5w ago
    Step 1 CLOSED: a43df6ca (v5.4.160) commits docs/migrations/2026-09-04-movilba-125-wide-history-vdc-columns-DEV.sql (md5 358d8be4, db02 final PASS) + README + pending-prod-changes. Pattern for next migration (db02): a positive control must run the gate's own query against a forced-fail state, not a literal EXCEPT. Step 2 open: coder-ca 203 writer replace-on-snapshot.
  • wi-cli-venus decision · 5w ago
    Elazar, 2026-09-04, via db02 CLI, verbatim: 'are legacy fields not to be used, we will use canonical names as closely as possible related to ssot excel files'. Dicho sobre fecha_vigencia_desde/hasta, pero es una regla general de nombres: el nombre canonico de una columna en MovilBA sigue al header de la hoja Base del libro RUTAP lo mas de cerca posible. Consecuencia inmediata: la decision del paso 1 de NO agregar fecha_vigencia_* a la tabla ancha queda confirmada por la regla de nombres, no solo por evitar una fecha de negocio duplicada - fecha_alta/fecha_baja ES el nombre canonico porque es como el libro los llama. La tabla ancha ya cumple: fecha_alta/fecha_baja mas 39 columnas raw_* nombradas por el header del Excel. El retiro del par legacy en vehiculos_datos_colectivos se sigue en MOVILBA-242.
  • wi-cli-venus note · 5w ago
    db02 22:15, dated finding on LEGACY public.vehiculo_historial: today's loader run inserted a second live row beside an existing one in 85 book periods (87 dup periods / 174 rows, 85 straddle today's id window 16096-17832, 2 fully older; both twins creado_por=system_import). Run 2 idempotent vs run 1; run 1 not idempotent vs pre-existing state => identity-key DEFINITION changed between runs (238 class), not a duplicate-row problem. Wide table unaffected (1 snapshot, 5370, 0 dup) so ficha/PDF do not double-render. Exposed: 26 views on vehiculo_historial via pg_depend (11 direct incl v_vehiculo_cadena, v_vehiculos_detalle, v_vehiculos_export, v_vehiculos_hist_ultimo; 15 transitive incl v_vehiculos_list*, v_vehiculos_api_public, v_vehiculo_lookup). 87 vehicles. Gate 'every book period matches exactly one live row' fires (87) - proven failing state. Asked db03 for the match predicate of today's run vs the 2025-12 run and confirmation the legacy loader does not run again. No cleanup: which twin survives is a data decision after the key answer; baja is a state, never DELETE.
  • wi-cli-venus progress · 5w ago
    Step 2 (203 writer replace-on-snapshot) reported complete by coder-ca 22:53: DEV wide table is a current-snapshot mirror, double-run identical (5370 rows, 0 dup vehiculo/source pairs, new VDC columns NULL). a0558f98 (v5.4.174) = fixtures; writer commit hash + audit verdict + db03 gate reference requested before the step is marked closed here. coder-ca moves to MOVILBA-243 next.
  • wi-cli-venus verified · 5w ago
    Step 2 CLOSED on evidence (audit 22:54): the writer IS docs/migrations/2026-09-04-movilba-203-wide-refresh-snapshot10-DEV.sql at a0558f98 (v5.4.174), file object dcc97e31; 79805704 aborted at parse time and is superseded, never cite it. Audit whole-file re-audit CLEARED. db03 double-run: two COMMITs from that object, identical - 5370 rows, snapshots {10}, 0 dup (vehiculo_id, rutap_fila_excel), VDC-only columns 0 non-null, eligible 5048, content signature 7c6bc9f0, states 25 resuelto / 5023 pendiente / 322 conflicto. Not proven by this run: fidelity to the BOOK (separate gate, tools/rutap-fidelidad.py); PROD untouched. Defective preflight raw-columns fixture (both branches raise) assigned to coder-ca for repair before 243. Next: step 3 cutover of the 26 legacy-dependent views; step 4 238 key on the wide table.
  • wi-cli-venus verified · 5w ago
    BOOK FIDELITY of the wide table (db02, DEV, SELECT only, report /data-lezama/import-reports/2026-09-04-wide-vs-book-fidelity.txt md5 f79a5317; book 2026-09-04-1154-parque-rutap.xlsx md5 f7e9ead4 = snapshots id 10). Cardinality 5370 both sides: 0 book rows missing, 0 table rows without book row, 0 duplicate fila_excel; the 14 headerless sheet columns are empty on all 5370. raw_* verbatim 209430 cells: 50 differ, ALL in ID ADAS (49) + ID MDVR (1) and NOT a loader defect - those cells are numeric in the xlsx holding 2.51616442111e+55, precision died inside the book. Typed derivations 5370 evaluated, 0 inconsistent (dominio via trigger expression, fechas ISO, interno/linea digits-only else NULL); FKs checked by RESOLVED LABEL: tramite 5364/0 mismatch, entidad 5230/0/140 sin id, linea 5195/0/175. Positive control fires. Step 2 now has both legs: clean rebuild AND fidelity to the book. Not covered: PROD, narrow table, clean()'s own cell interpretation (db02 reused the loader's reader).
  • wi-cli-venus verified · 5w ago
    Fidelity closers done (db02, report md5 98b8c42f, 151 lines): (1) reader-blindness promoted to the SCOPE block governing all 209430 cells; closed on a sample with a SECOND reader written from raw openpyxl, no loader imports, NBSP/trim deliberately NOT folded - every 13th row, 413 rows x 39 = 16107 cells, 0 real differences (one ID ADAS cell of the known IEEE754 class). Blindness now theoretical over 7.7% of rows; a reader defect living outside the sample is still not excluded. (2) tramite is empty-source, no fourth bucket: 5364 with id + 6 with NULL raw + 0 with text = 5370; the six named by fila_excel/dominio. (3) positive control now symmetric, book-side and table-side alterations both fire.
  • wi-cli-venus note · 5w ago
    db02 09-05 02:01, legacy table: v_vehiculo_historial returns 6074 cards, 502 duplicated periods over 313 vehicles (1004 cards), 2262 cards with no cambios. KEY CORRECTION from db02: the view does NOT filter vehiculo_historial.borrado_en by design, because on that table borrado_en marks a CLOSED PERIOD and periodo_hasta = COALESCE(fecha_baja, borrado_en::date); so soft-deleted rows are rendered on purpose and the 502 split into 87 live-live pairs (the figure already on record) plus 415 live+soft-deleted twins. Any count of this taken on live rows only understates it by 415 periods. coder02 correction on reach: the ficha and PDF have read rutap.vehiculo_historial_normalizado since v5.4.154/155, not this view, so none of it is user-facing today - measured: AG358KX chain has 6 rows in the wide table (filas 1204/1177/1178/1044/1045/1046), and the whole wide table has ONE duplicated (vehiculo_id, fecha_alta, fecha_baja) pair, the legitimate one the book itself carries twice. The legacy duplication is scope for step 3 (26 dependent views) and for whatever still WRITES that table.
  • wi-cli-venus assigned · 5w ago
    unassigned
  • wi-cli-venus assigned · 5w ago
    db03-mba-l-ca
  • wi-cli-venus verified · 5w ago
    DEV, 2026-09-05, db03-mba-l-ca (filed por coder02 porque wi no esta en el PATH de esa sesion). PARIDAD DEL PREDICADO ALTA entre la tabla ancha y la legacy. DEFINICION, para que sea re-derivable: el ID de ALTA se resuelve VIVO contra opciones(grupo_nombre='vehiculo_historial', campo_nombre='tramite', valor_opcion='ALTA', borrado_en IS NULL) - no se congela. Lado ancho: max(fecha_alta) por vehiculo_id sobre rutap.vehiculo_historial_normalizado con tramite_id=ALTA_ID AND fecha_alta IS NOT NULL. Lado legacy: max(fecha_expediente) por vehiculo_id sobre public.v_vehiculo_historial con el mismo tramite_id y el mismo predicado de fecha no nula. FULL OUTER JOIN por vehiculo_id; desacuerdo = wide_fecha IS DISTINCT FROM legacy_fecha. RESULTADO: 2280 de 2406 dominios entran a la comparacion, 0 desacuerdos, 0 solo-ancha, 0 solo-legacy. Los 126 excluidos son 121 con solo Modificacion y 5 sin ningun tramite - o sea que la exclusion es POR AUSENCIA DE FILA ALTA, no por diferencia. LO QUE ESTO NO DICE, dicho por el que lo midio: es acuerdo del predicado ALTA en DEV y en el estado de HOY. No cubre la preocupacion de la pantalla unica sobre dos relaciones, y PROD no se midio.
  • wi-cli-venus progress · 5w ago
    Step 3 read-only cutover inventory written: docs/design/movilba-125-step3-view-cutover.md. It lists 11 direct/26 transitive legacy-view dependents, contract gaps, and safe cutover order; no DDL authorized.
  • wi-cli-venus assigned · 4w ago
    db03-mba-l-cc
  • wi-cli-venus assigned · 4w ago
    db02-mba-l-cc
  • wi-cli-venus note · 4w ago
    PROPUESTA DE CORTE - db02-mba-l-cc, 2026-09-12. El item pide decidir si se parte o se cierra. Mi lectura, con lo medido hoy: el epic esta HECHO EN DEV y NO EXISTE EN PROD, y esa asimetria es lo unico que le queda adentro. LO QUE YA ESTA: el modelo ancho y tipado existe y esta poblado en DEV (rutap.vehiculo_historial_normalizado, 5388 filas del snapshot 12), con procedencia por fila (origen, normalizado_por) que es exactamente lo que el epic pedia. Los hijos de esquema (202), writer (203), UI (204) y derivacion de subtipo (97) estan cerrados. LO QUE NO ESTA, y no es un detalle de implementacion sino el objetivo del epic: PROD no tiene el modelo. Medido hoy - public.vehiculo_historial en PROD tiene exactamente UNA fila viva por vehiculo (1740 filas vivas, 1740 vehiculos), o sea sigue corriendo el modelo de una-fila-vigente que este epic dice reemplazar, y ademas 667 de sus 2407 vehiculos vivos no tienen ninguna fila de historial. Y rutap.vehiculo_historial_normalizado en PROD esta poblada por el BACKFILL de la migracion 202, no por el proyector, que en PROD ni siquiera esta instalado. Detalle en MOVILBA-294 y en MOVILBA-269. PROPUESTA, en tres piezas y no una: 1. CERRAR 125 como epic de construccion. Lo que definia se construyo y esta andando en DEV. 2. ABRIR UN ITEM NUEVO, que es el unico trabajo grande que queda: 'PROD pasa al modelo ancho append-only'. No es un hijo mas de este epic - es una migracion de datos de PROD con su propio ensayo y su propio GO, y arrastra la pregunta de los 667 vehiculos sin historial, que hay que contestar ANTES y no durante. 3. LOS HIJOS ABIERTOS SE REPARENTAN, no se cierran con el padre: 299 (retirar el jsonb) y 12 (que fila es la vigente) son del modelo y siguen vivos; 219 (estado como estado guardado) es una decision de modelo aparte; 71 es UI; 89 y 112 estan bloqueados y hay que decir contra que. No propongo cerrarlo sin abrir el 2: cerrar el epic sin nombrar la brecha de PROD deja el trabajo mas grande sin fila.
  • wi-cli-venus assigned · 3w ago
    db04-mba-l-ca
  • db04-mba-l-ca progress · 3w ago
    db04-mba-l-ca 2026-09-24 04:03 -03 — SELECT-only current-state check: DEV movilba_dev snapshot 18 and PROD movilba snapshot 5 both identify 2026-09-19-0648-parque-rutap-corrected.xlsx with 5528 source rows. The full-history refactor plan's complete acceptance gates were not exercised. Status unchanged; no DB write.
  • db04-mba-l-ca progress · 1w ago
    2026-10-05: MOVILBA-89 remains the writer acceptance gap. Installed PROD materializer/projector/reconciler have three distinct current-selection points: domain-only materializer, per-(vehiculo_id,dominio) W4, per-(vehiculo_id,dominio) row_number reconciler. None enforces one open event per normalized chassis. A correct single-writer change must separate raw/normalized history retention from current-projection eligibility and count quarantined chains separately; a standalone SQL gate that aborts the transaction would discard raw staging. Exact body md5s and control requirements posted on 89. No DB or code write yet.
  • db04-mba-l-ca progress · 1w ago
    2026-10-06 live PROD code trace: no external blocker; MOVILBA-89 is the implementable writer slice. Projector INSERT retains all raw rows (W1, vehiculo_id nullable); materializer creates roots/VDC for all source domains; projector W4 marks only per-(vehiculo_id,dominio) duplicate opens. Reconciler builds rutap_reconcile_source from all normalized rows with row_number, ignoring elegible_actual/quarantine, and rutap_reconcile_borrar would delete an excluded chain unless separately protected. v_vehiculo_historial_actual contains elegible_actual as an output column but WHERE only current_rank=1, so marking false alone does not withhold a current event. Consequently an importer-only check or a standalone abort is insufficient. Next implementation must atomically register per-domain quarantine for both domains of a duplicate open normalized chassis, preserve all raw+normalized rows, filter current reader and reconcile source, exclude quarantined roots from delete, and add old/new mutant controls. No PROD/DEV write performed in this investigation.
  • db04-mba-l-ca progress · 1w ago
    2026-10-08 SELECT-only acceptance census, PROD then DEV: each base retains exactly one authorized raw snapshot (PROD 11/DEV 21), 5558 raw rows and 5558 live normalized import rows, unique (snapshot,fila_excel) on both, 0 missing/extra normalized keys, 0 ineligible and 0 nonempty conflict rows. Evidence /data-lezama/movilba/evidencia/MOVILBA-125/2026-10-08-current-history-acceptance-census.md. This proves current-book row preservation, not ambiguous-future-book negative control or full epic closure. Open children 219 saved state periods and 99 interval readers remain; retired legacy consumer cutover also needs confirmation. Referenced docs/design/rutap-full-history-refactor-plan.md is absent from current checkout. No DB write.
  • db04-mba-l-ca titleChanged · 1w ago
    RUTAP full-history refactor
  • db04-mba-l-ca progress · 1w ago
    Corrected title to remove docs/design/rutap-full-history-refactor-plan.md. Coder03 checked git log --all: that path was never committed on any branch, so this was a false reference, not a deleted plan. The dated 2026-10-08 source-row preservation census remains evidence, not a replacement design document. Open 219/99 acceptance remains separate. Evidence note updated at /data-lezama/movilba/evidencia/MOVILBA-125/2026-10-08-current-history-acceptance-census.md.
  • db04-mba-l-ca statusChanged · 1w ago
    Current-book source-row acceptance census completed on PROD snapshot 11 and DEV snapshot 21: 5558/5558 raw-to-normalized rows, 0 missing/extra keys, 0 ineligible/conflicts (evidence 2026-10-08-current-history-acceptance-census.md). Epic remains open but is not an active db04 implementation: child MOVILBA-219 saved-state periods is db03 backlog, MOVILBA-99 interval readers is coder04 blocked, and legacy-consumer retirement still needs confirmation after those. No new 125 DB change in flight; db04 turns to MOVILBA-461 priority 1.
  • db04-mba-l-ca progress · 1w ago
    Scope amendment already present and re-verified for MOVILBA-219: docs/design/rutap-full-history-refactor-plan.md SHA256 2b6fd1636eab6455fe0266cee73b6d2eb1640c3a3b7c7a88468bf4bae58620f1 (15 explicit estado mentions). It defines estado as stored dated periods in the common wide history, ALTA/BAJA source rule, same deterministic current-period rank as linea/entidad, prior states retained, no standalone estado_historial, and acceptance across ficha/history/export/API. Document is currently untracked; shared checkout lock was empty. Scope is available to db03; coder lane still needs to commit it.
  • db04-mba-l-ca statusChanged · 1w ago
    Estado scope amendment committed/shipped (13d9e65f DEV, 977b6cc9 PROD); MOVILBA-219 blocker cleared. No new DB implementation active; remaining epic closure depends on child 219/99 and legacy-consumer cutover evidence.
epic
7w ago by wi-cli-venus
1w ago