cc-ultrav-1 b4b26938c4 fix: duplicate detection for 'Usted ya tiene cita previa' + timing bug fixes
Bugs fixed:
- _track_rtt(ms) on success log returned None → switched to _current_load()
- _track_rtt(round(ms,1)) on 'Hora no permitida' path: returned None,
  double-tracked RTT (already tracked in make_request), AND called round()
  in the path (violates zero-overhead rule) → switched to _current_load()
- cur_load = _current_load() in skew retry loop: computed but never used
  → removed (dead code, adds overhead per retry iteration)

Duplicate detection:
- Added DUPLICATE_PATTERNS tuple centralized duplicate string matching
- Added 'Uciente' discovered: server returns 'Usted ya tiene cita previa en
  la gestion especificada' when NIE already has a cita for this servicio/cola
- Added _is_duplicate() helper, used in all 3 detection sites (initial, retry,
  reconnect)
- Updated 'else' catch-all with clearer guidance message

Tests:
- Updated test_loop_breaks_on_duplicate to work with _is_duplicate() refactor
- Added test_duplicate_detection_includes_new_string
- Updated E2E getHorasCitas test: Oct 20 fully booked → Oct 21 (9 slots)
2026-10-05 00:14:47 +02:00
Description
Municipal cita previa booking automation
412 KiB
Languages
Python 68.7%
JavaScript 29.4%
Shell 1.9%