screen-locker/screen_locker/tests
Krzysztof kuhy Rudnicki e25d806742 Fix silent skip-credit bypass; replace with weekly shutdown-time bonus
The screen locker skipped enforcement on 2026-07-03 without ever showing
a lock: a banked skip credit (earned from a prior 5+/week streak) was
consumed automatically with no confirmation and no visible log. Reworked
the whole reward mechanic instead of just gating it, since banking a
"skip a future workout" credit works against maximizing weekly workouts:

- Removed skip credits entirely (has_skip_credit/consume_skip_credit and
  the confirmation dialog built to gate them). The only same-day skip
  paths left are heat_skip and sick_day, both requiring a genuine reason.
- Extra workouts (5+/week) now bank shutdown-time-later hours for the
  following week instead — comfort, not reduced enforcement. Reuses the
  existing _adjust_shutdown_time_by and reset_to_base_if_new_day's
  previously-discarded return value as the once-per-day gate.
- early_bird and sick_day no longer pollute workout_log.json. early_bird
  is a same-day pending marker now stored in its own self-expiring,
  HMAC-signed file; sick_day is sourced entirely from sick_history.json
  (already the real source of truth). Fixes an accidental-safety gap
  where "already took a sick day today" only halted startup by luck.
- Cleaned up 3 stale non-workout entries already in workout_log.json.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QdTccgbK7624kfoaV6CtXS
2026-07-03 15:27:08 +02:00
..
__init__.py Add comprehensive tests for stockfish_analysis (100% coverage) 2025-12-02 22:58:06 +01:00
conftest.py Fix silent skip-credit bypass; replace with weekly shutdown-time bonus 2026-07-03 15:27:08 +02:00
test_adb_and_phone.py Restore consistency with WORKOUT_APP_JSON_REMOTES rename in _constants.py 2026-06-22 07:05:07 +02:00
test_early_bird_part2.py Fix silent skip-credit bypass; replace with weekly shutdown-time bonus 2026-07-03 15:27:08 +02:00
test_early_bird.py Fix silent skip-credit bypass; replace with weekly shutdown-time bonus 2026-07-03 15:27:08 +02:00
test_extra_benefits.py Fix silent skip-credit bypass; replace with weekly shutdown-time bonus 2026-07-03 15:27:08 +02:00
test_init_and_log_part2.py Add auto-fill RunnerUp scan, carrot bonuses, and --status interface 2026-06-28 08:08:35 +02:00
test_init_and_log.py Add auto-fill RunnerUp scan, carrot bonuses, and --status interface 2026-06-28 08:08:35 +02:00
test_phone_check_unlock_part2.py chore: set up as standalone repo 2026-05-28 07:43:06 +02:00
test_phone_check_unlock_part3.py Add auto-fill RunnerUp scan, carrot bonuses, and --status interface 2026-06-28 08:08:35 +02:00
test_phone_verification_part2.py chore: set up as standalone repo 2026-05-28 07:43:06 +02:00
test_phone_verification_part3.py Restore consistency with WORKOUT_APP_JSON_REMOTES rename in _constants.py 2026-06-22 07:05:07 +02:00
test_phone_verification_part4.py Restore consistency with WORKOUT_APP_JSON_REMOTES rename in _constants.py 2026-06-22 07:05:07 +02:00
test_runnerup_verification_part1.py Add auto-fill RunnerUp scan, carrot bonuses, and --status interface 2026-06-28 08:08:35 +02:00
test_runnerup_verification_part2.py Add auto-fill RunnerUp scan, carrot bonuses, and --status interface 2026-06-28 08:08:35 +02:00
test_runnerup_verification_part3.py Add auto-fill RunnerUp scan, carrot bonuses, and --status interface 2026-06-28 08:08:35 +02:00
test_runnerup_verification_part4.py Add auto-fill RunnerUp scan, carrot bonuses, and --status interface 2026-06-28 08:08:35 +02:00
test_runnerup_verification_part5.py Add auto-fill RunnerUp scan, carrot bonuses, and --status interface 2026-06-28 08:08:35 +02:00
test_scheduled_skip.py Add auto-fill RunnerUp scan, carrot bonuses, and --status interface 2026-06-28 08:08:35 +02:00
test_screen_lock_coverage_part1.py Fix silent skip-credit bypass; replace with weekly shutdown-time bonus 2026-07-03 15:27:08 +02:00
test_screen_lock_coverage_part2.py Add auto-fill RunnerUp scan, carrot bonuses, and --status interface 2026-06-28 08:08:35 +02:00
test_shutdown_base.py Add auto-fill RunnerUp scan, carrot bonuses, and --status interface 2026-06-28 08:08:35 +02:00
test_shutdown_part2.py refactor: enforce 400-line file limit with pre-commit hook and split outliers 2026-05-28 21:19:18 +02:00
test_shutdown_part3.py chore: set up as standalone repo 2026-05-28 07:43:06 +02:00
test_shutdown_part4.py Add auto-fill RunnerUp scan, carrot bonuses, and --status interface 2026-06-28 08:08:35 +02:00
test_sick_features_part2.py refactor: enforce 400-line file limit with pre-commit hook and split outliers 2026-05-28 21:19:18 +02:00
test_sick_features.py refactor: enforce 400-line file limit with pre-commit hook and split outliers 2026-05-28 21:19:18 +02:00
test_sick_tracker.py chore: set up as standalone repo 2026-05-28 07:43:06 +02:00
test_status_part2.py Fix silent skip-credit bypass; replace with weekly shutdown-time bonus 2026-07-03 15:27:08 +02:00
test_status.py Fix silent skip-credit bypass; replace with weekly shutdown-time bonus 2026-07-03 15:27:08 +02:00
test_time_check.py chore: set up as standalone repo 2026-05-28 07:43:06 +02:00
test_ui_and_timers_part2.py chore: set up as standalone repo 2026-05-28 07:43:06 +02:00
test_ui_and_timers.py chore: set up as standalone repo 2026-05-28 07:43:06 +02:00
test_ui_flows_part2.py Add auto-fill RunnerUp scan, carrot bonuses, and --status interface 2026-06-28 08:08:35 +02:00
test_verify_workout.py Fix silent skip-credit bypass; replace with weekly shutdown-time bonus 2026-07-03 15:27:08 +02:00
test_vt_switching.py Migrate to the shared gatelock backend 2026-06-21 20:11:16 +02:00
test_wake_shutdown.py chore: set up as standalone repo 2026-05-28 07:43:06 +02:00
test_wake_skip.py Add auto-fill RunnerUp scan, carrot bonuses, and --status interface 2026-06-28 08:08:35 +02:00
test_wake_state.py fix: apply pre-commit formatting fixes to unblock CI 2026-05-28 20:59:35 +02:00
test_weekly_check.py chore: set up as standalone repo 2026-05-28 07:43:06 +02:00
test_weekly_logic_part2.py Fix silent skip-credit bypass; replace with weekly shutdown-time bonus 2026-07-03 15:27:08 +02:00
test_weekly_logic.py Fix silent skip-credit bypass; replace with weekly shutdown-time bonus 2026-07-03 15:27:08 +02:00