La app deja cerrar por BAJA un periodo que el libro tiene ABIERTO y no avisa: en DEV es dato de prueba, en PROD seria deriva silenciosa del SSOT
Evidencia de coder-mba-l-ca, read-only en DEV, 2026-09-10. AA013AD (vehiculo 3346 / VDC 3705) paso de ALTA(116) a BAJA(117) por el usuario autenticado qa-editor@movilba.test el 2026-09-08 05:39 y de nuevo 05:42 ART. Requests 8dd95252-f428-44e6-8dce-bbe933ffa1d5 y 8946e992-f3fe-4aa9-afc9-706c2789b679; audit 722/725 con estadoId. El segundo request cerro el periodo normalizado 177665 con operation close-period-baja y creo el evento 177666. NO fue el importador y NO fue MOVILBA-431: verificado leyendo el predicado shipeado en origin/dev, el UPDATE de 431 lleva isNull(rutapSnapshotId) y por lo tanto solo cierra periodos de origen app. EL HALLAZGO no es el dato, es la BRECHA: el libro tiene ese periodo ABIERTO en los snapshots 10, 11, 12 y en el libro del 2026-09-10 -cuatro libros seguidos- y la app igual dejo registrar una baja encima, sin advertencia, sin bloqueo y sin dejar nada que un lector note. Recien lo caza el gate W5 de rutap.proyectar_snapshot, que ABORTA en vez de elegir un ganador en silencio: W5 esta haciendo exactamente lo que tiene que hacer y NO SE DEBILITA. En DEV esto es dato de prueba (la cuenta es qa-editor@movilba.test) y por regla de Elazar los datos de prueba en dev NO son deriva, asi que reconciliar a ALTA desde el unico periodo abierto del SSOT es rutina y lo ejecuta el carril db. Lo que hay que decidir es el comportamiento de PROD: hoy la app puede contradecir al libro y el unico que se entera es un import posterior que se cae. Opciones a plantear, sin implementar ninguna sin Elazar: (a) la UI avisa y pide confirmacion cuando el periodo del libro esta abierto; (b) se bloquea y se manda a corregir el libro primero; (c) se permite y queda registrado como excepcion ATRIBUIDA, que es la forma que Elazar viene pidiendo para toda regla nueva. Ojo: una regla de este tipo NO se implementa como RAISE en la base sin decision suya.
Sub-tickets — 1/1 done
Activity
-
Resolved by SSOT-authoritative reconciliation in the import transaction. DB rehearsal passed with pre-mutation named-domain capture, dynamic denominators, hard catalog/identity guards, unchanged projector W5 as post-condition, and rollback verification. DEV database function installed; app/importer/docs shipped in commit 2a9c2c2f, DEV v5.5.142. Wrapper typecheck passed and external /api/health returned 200 at patch 142. Reproduction recipe preserved under evidencia/MOVILBA-435/.
-
Delivered in DEV v5.5.142: valid unique app-vs-SSOT state contradictions are captured by domain, reconciled to the workbook in the database transaction, and independently checked by unchanged W5 before projection; invalid/ambiguous cases still abort.
-
Reopened after post-ship review: commit 2a9c2c2f fixes import-time reconciliation only. The authenticated editor write path under src/ remains unchanged and can still record BAJA over an SSOT-open period. Evidence: AA013AD/3705, AC213TA/3901, AC363OK/5621. Loader portion PASS; remaining scope is app-side prevention (warn, block, or attributed exception).
-
Reopened after source review: v5.5.142 repairs contradictions during import but does not prevent the authenticated editor from creating them. App write-path fix remains.
-
coder-mba-l-ca / coder
-
Closure corrected: commit 2a9c2c2f contains zero src/ changes. Current DEV evidence has three app-created contradictions: AA013AD/3705, AC213TA/3901, AC363OK/5621. The editor writes BAJA/history over an SSOT-open period while expte_baja and fecha_vigencia_hasta remain NULL. Implement the SSOT-authoritative behavior in the app write path: block the contradictory BAJA with a clear Spanish message directing the user to correct/import the RUTAP workbook first; keep the import reconciliation as defense-in-depth.
-
2026-09-10 16:27 ART implementation handoff: dedicated rutap.estado_abierto_excepciones keyed by vehiculo_id + dominio_norm/fecha_alta, with required motivo/creator timestamps and revocation fields; reconciler/projector skip only active exact matches and report attribution. coder has a 3-file app draft and is finishing atomic server gate+override; db03 assigned the migration and DB function changes.
-
2026-09-10 16:29 ART db03 delivered the exact exception contract at /data-lezama/movilba/handoffs/2026-09-10-movilba-435-exception-contract.md: fecha_alta DATE; active key vehiculo_id+fecha_alta with dominio_norm match; reconciler keeps its 4-column signature and counts only actionable mismatches; details JSON attributes skipped exceptions; W5 excludes only exact active BAJA exceptions; app create/revoke is atomic with state/history. Relayed to coder for immediate integration. No DB changes applied.
-
2026-09-10 16:32 ART db03 blocked apply of the current draft: hard SQL syntax error from a premature semicolon before AND t.excepcion_id IS NULL; projector W5 still lacks the exact active BAJA-exception exclusion; runtime table/identity-sequence grants are missing. Relayed to coder. Do not apply until all three are corrected and db03 finishes review.
-
2026-09-10 16:38 ART db03 final static audit PASS: corrected reconciliation SQL satisfies the attributed-exception contract; syntax fixed; checks and svc_nextjs table/identity-sequence grants added; exact projector W5 replacement matches the currently installed DEV definition at offset 23673. Cleared for integration. Runtime DEV migration apply remains pending fresh direct approval for that DB write.
-
coder-mba-l-cc
-
coder03-mba-l-cc / coder
-
2026-09-17 22:39 ART decision relayed by proxy-mba-w-cc (tag proxy-mba-w-cc-mu6ai93ugn0l) for the rotated-out coder-mba-l-ca request: approve preservation - the import/materializer must NOT reactivate soft-deleted entidades/lineas; skip soft-deleted rows, leave borrado_por and cascade-deleted children untouched; deleted stays deleted unless a task names un-deleting a specific row; catalog reactivation is outside the import GO scope and needs separate explicit authorization. Current state: docs/migrations/2026-09-17-movilba-442-latest-ssot-catalog-reactivation-evidence.md records the projector gate already retains historical soft-deleted IDs by design and the two reactivation artifacts were withdrawn unapplied; commits 66c5d77c/5a1bab39 keep closed catalog history soft-deleted. No code change required by this decision; it is the standing constraint for any future materializer change.
-
2026-09-17 22:49 ART db02 (read-only, DEV): the installed rutap.reconciliar_estado_abierto_snapshot has exactly two write statements - INSERT into rutap_estado_reconcile_targets and UPDATE public.vehiculos_datos_colectivos. It never writes rutap.vehiculo_historial_normalizado, so it cannot remove or close an app closure row; it repairs the live ficha only, pre-projection, and hard-aborts if the snapshot is already projected. Observed consequence on dev01 v5.5.215 (proxy, live browser): AA013AD shows top-level "Estado actual: Alta" (VDC estado_id=116 after reconciliation) while the Estado Actual card shows Baja registrada el 08/09/2026 because v_vehiculos_ciclo_actual resolves baja_historial_id=177666, still alive (borrado_en NULL), as is 177665. Spec gap of 435: the reconciler resets estado but leaves the contradictory app closure event, so the two surfaces of the same page disagree. Underlying data conflict the reconciler was not built to resolve: book row 233005 open vs app closure 2026-09-08 (same family as AC098EJ, different cause). In DEV 177665/177666 are qa-editor test data (recreatable) - soft-deleting them is routine for the db lane under the recreatable-DEV-test-data rule; the PROD behaviour (what a reconciliation does with an app closure row that contradicts the book) is the open 435 question, options a/b/c unchanged.
-
Superseded (Elazar 2026-09-19): 486 dropped reconciliar_estado_abierto_snapshot; rule is snapshot equals DB. W5 veto removal moved to MOVILBA-518. Child MOVILBA-445 unaffected.