Cadena de expedientes RUTAP: 152 bajas cuyo expediente no es el alta del tramite siguiente
Post MOVILBA-36 (backfill de expediente_baja), medido en prod sobre las 2293 filas escritas: 204 sin sucesor | 1937 coinciden comparando NORMALIZADO | 1851 coinciden comparando crudo | 152 DIFIEREN de verdad. La regla del libro RUTAP es que el expte_baja de un tramite es el expte_alta del siguiente; esas 152 rompen la cadena, o porque el periodo cerro sin abrir sucesor con otro expediente, o porque la cadena esta mal armada en el libro. NO es gate de nada: un periodo puede cerrar legitimamente sin abrir otro. TRAMPA para quien lo arregle: comparar NORMALIZADO pero NO reescribir el valor crudo - 928 expedientes tienen espacios internos multiples que son dato fiel del libro, y 86 de las 238 divergencias del cruce original eran solo eso, mismo expediente con distinto espaciado. Medicion de db02-mba-l-cc.
Activity
-
parent=MOVILBA-39
-
db04-mba-l-ca
-
db04-mba-l-ca 2026-09-24 04:05 ART — SELECT-only installed-object check in DEV movilba_dev and PROD movilba: to_regclass('public.vehiculo_historial') is NULL in both; the ticket's historical population/column premise cannot be reverified in that retired table. Current replacement rutap.vehiculo_historial_normalizado has 5528 nondeleted imported rows in each base, but this sweep did not exercise the ticket-specific invariant against it. Status unchanged; do not apply an old-table repair.
-
Selected as next independent DB item while 752 waits on 282/751 and 764/746 await audit. SELECT-only schema check on PROD movilba snapshot 11 and DEV movilba_dev snapshot 21: rutap.vehiculo_historial_normalizado holds 5558 nondeleted imported rows in each base with expte_alta/expte_baja; retired public.vehiculo_historial premise is not reusable. A provisional per-dominio/date adjacent-row comparison yields 439 differing pairs in each base, but this is NOT the ticket invariant or a replacement for its old 152: it omits replates/chain semantics and population changed from 2293 to 5558. Next: validate successor identity and normalization against installed chain/book rules before grading any mismatch. No DB write.
-
SELECT-only replate positive control, 2026-10-09T00:06Z: PROD movilba snapshot 11 and DEV movilba_dev snapshot 21 each have 5558 nondeleted imported normalized-history rows. Grouping by upper(btrim(numero_serie_chasis)) finds 153 chassis groups spanning 304 dominios. Date/fila-adjacent cross-dominio transitions within these groups: 153 pairs; 151 have both expediente values and all 151 match after trim/uppercase/whitespace normalization; 2 lack an expediente side, 0 differ. The provisional 439 was computed PARTITIONED BY dominio, so exactly 0 cross-dominio replate-boundary pairs can enter it by construction; 2 of its 439 internal comparisons happen on a dominio participating in a replate, not at its boundary. Thus 439 is not inflated by counting known replate boundaries, but the original instrument is blind to them. The positive-control extension sees and discriminates the known replate shape. Still not a defect denominator: successor ordering and the changed 5558-row population must be validated against the installed chain/book rule before classifying 439.
-
Correction to my prior 'positive control' wording, per coder03: a comparison PARTITIONED BY dominio necessarily excludes every cross-dominio replate boundary. The separate chassis-group read (153 boundaries, 151 comparable/151 matching, 2 missing a side) describes a known book shape, but does NOT test whether the per-dominio 439 instrument discriminates good from bad successor pairs. It neither validates nor changes 439. The only open measurement is successor-order validation on the installed current history before 439 can be called a denominator. No repair authorized from the provisional count.
-
Successor-order validation replaces provisional 439. The applied MOVILBA-36 source defines successor as SAME vehiculo_id with successor.fecha_alta = predecessor.fecha_baja, not next row by date. SELECT-only on current imported, nondeleted normalized history (PROD snapshot 11, DEV snapshot 21; 5558 rows each), 2026-10-09 00:14Z: 3481 predecessors have expte_baja; 827 have no successor at exact boundary; 2649 have exactly one; 5 have multiple same-day successors with conflicting expte_alta values and require separate attribution. Of 2649 unique pairs, 2295 expediente values match after NBSP/whitespace-collapse/uppercase normalization, 354 differ, 0 successor blanks. All 354/354 differing pairs ALSO differ in raw_expte_baja versus raw_expte_alta; 0 raw-same and 0 stored-vs-raw discrepancy. Thus the 354 are carried from the current book, not introduced by the projector; identical counts in both bases reflect identical source values, not an instrument that happened to fail twice. The old 152 came from a retired 2293-row population and must not be reused. This is informational, not an abort criterion or authorization to rewrite raw book data. Next: inspect the five ambiguous same-day successors and route true source contradictions through the stakeholder tracker rather than a DB repair.
-
Five same-day ambiguous successors inspected in PROD snapshot 11 (AH850FS, AI023DC, AH850GK, AI058QM, AI024HE; same shape in DEV count). Each predecessor has TWO candidates with the exact same vehiculo_id and fecha_alta=fecha_baja; one candidate's expte_alta matches the predecessor's expte_baja and the other differs. Example AH850FS predecessor fila 2167 -> matching fila 2168, alternative fila 3007, all dated 2026-03-02. Matching by expediente would select one but is circular if the purpose is to detect expediente mismatches; date identity alone cannot adjudicate these five. Keep them separate from the 354 unambiguous source-value differences, not silently included or treated as errors.
-
Tracker reconciliation, 2026-10-09: the five same-day two-successor domains AH850FS, AI023DC, AH850GK, AI058QM, AI024HE are ALREADY in the 15-domain MOVILBA-727 Eugenia question, live tracker todo-rutap-importacion-prestaciones.xlsx Pendientes!D8 (also identical in latest online download 2026-10-08-1713...xlsx Pendientes!D8). F8 answer empty and J8 Pendiente in both; BWI-727 status blocked waiting for Eugenia. The existing question asks whether the zero-duration row sharing the real period's start date is a duplicate, correction or intentional administrative record. No second tracker question or row should be created. The five are a measured subcase: exact-date successor lookup finds one matching-expediente candidate and one differing candidate, so matching on expediente to choose the successor would be circular. Add this evidence to the existing MOVILBA-727 context; keep MOVILBA-38 as the separate current-book expediente census.
-
Parked after SELECT-only successor-order census. The 354 apparent differences are faithful book shape, not DB repair; five same-day two-successor cases are already in MOVILBA-727 Pendientes!D8, awaiting Eugenia. No further repair decision is available until that answer.