mirror of
https://github.com/kuhyx/screen-locker.git
synced 2026-11-10 21:07:14 +01:00
A manual workout logged at 00:02 CEST on 2026-09-13 was filed under 2026-09-12: every day-key derivation used datetime.now(tz=UTC), and at that instant UTC was still yesterday. The 09:18 lock check looked for 2026-09-13, found nothing, and locked the PC — for a workout that was on disk. The budget counter (a trailing window) counted it fine, which is why the status showed 1/2 used while the locker still locked. Any log between local midnight and 02:00 CEST hit this; it had happened before. - New screen_locker/_day.py: today_str() is the one definition of "what day is it" — the local calendar day the user sees on the clock, which is also what the phone app, RunnerUp verification, the status window and the freedays pool already used. All 14 UTC sites (log writer, lock predicates, explain chain, early-bird, wake state, shutdown/sick state, sick budget, manual CLI, phone verification) now go through it, writers and readers together so no new midnight window opens between them. - write_signed_entry dedups by workout_id across ALL days: a workout id is globally unique, and an entry moved to its correct day must not let its synced twin (still stamped with the old day) re-ingest as a duplicate. - scripts/rekey_log_entry.py: move a wrongly-filed entry to its real day (the HMAC never covered the day key, so it still verifies). - test_local_day_key.py freezes the clock at the exact failing instant. Replayed the real timeline (log at 00:02:35, evaluate at 09:18:53, weekly 3/5) against HEAD in a throwaway worktree vs this tree: HEAD -> logged under 2026-09-12, LOCK fixed -> logged under 2026-09-13, no lock (already_logged) Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FcU5dCcUNHMAMzUNChdrrJ |
||
|---|---|---|
| .. | ||
| __init__.py | ||
| _popup_form_check.py | ||
| _xvfb_reexec.py | ||
| add_scheduled_skip.py | ||
| annotate_duplicate_credits.py | ||
| check_dependency_freshness.sh | ||
| check_enforcement_armed.py | ||
| check_file_length.py | ||
| check_flutter_coverage.sh | ||
| check_md_naming.sh | ||
| check_no_crdt_sync_override.sh | ||
| check_requirements_sync.py | ||
| check_silent_failures_dart.py | ||
| check_silent_failures.py | ||
| ci_mirror.sh | ||
| demo_workout_handoff.py | ||
| disarm_guard.sh | ||
| finish_2026_08_24.sh | ||
| fix_2026_07_26_sport.py | ||
| migrate_scheduled_skips.py | ||
| refresh_refactor_todo.py | ||
| rekey_log_entry.py | ||
| restore_and_bonus.py | ||
| revoke_sick_day.py | ||
| setup_mcp.sh | ||
| split_dart_test.py | ||
| verify_lock_popup_safety.py | ||
| verify_screen_fits.py | ||
| verify_workout_credited.py | ||