screen-locker/scripts
Krzysztof kuhy Rudnicki dd8a39ade5 Record which log entries are two recordings of one workout
The counting fix made the numbers right; the history still read as though
2026-08-24 held two gym sessions. This annotates the pairs instead of
deleting one of each, for two independent reasons.

Deleting is self-undoing: every re-ingest path dedups against log.json's
own contents rather than a remote ledger, so _session_sync re-pulls a
removed pc_workout_verified from the CRDT store on the next 15-minute tick
and re-applies its shutdown credit on the way in. And mutating signed
history is against the position revoke_sick_day.py already states -- the
correction belongs beside the record, not on top of it.

Scanning the real log found six shared credits, not the three spotted by
hand: 2026-07-17, 07-27, 08-10, 08-21, 08-24, 08-28. This has been
happening since July.

check_ledger_agrees refuses to write a ledger whose arithmetic disagrees
with count_day_credits, so the ledger cannot come to describe a rule the
locker does not use. The file is gitignored with the other state JSONs --
it names workout dates.

The guard's test needs a fixture restoring sys.exit. conftest's autouse
_block_real_tk_and_exit patches "screen_locker.screen_lock.sys.exit", and
that attribute path resolves to the global sys module, so sys.exit is
stubbed process-wide for every test in the suite.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Fcwu78wk17FWMHbbfbyicc
2026-08-29 22:31:32 +02:00
..
__init__.py Finish the Python side: scripts, conftest, and the last test modules 2026-08-15 20:57:29 +02:00
_popup_form_check.py Fix the popup-safety check: pinned gatelock API, and its own empty log 2026-08-27 21:53:18 +02:00
_xvfb_reexec.py Finish the Python side: scripts, conftest, and the last test modules 2026-08-15 20:57:29 +02:00
add_scheduled_skip.py Grade against 3.14 too, not just run on it 2026-08-29 11:42:47 +02:00
annotate_duplicate_credits.py Record which log entries are two recordings of one workout 2026-08-29 22:31:32 +02:00
check_dependency_freshness.sh Latest stable dependencies, and the gate that keeps them there 2026-08-28 15:13:11 +02:00
check_enforcement_armed.py Grade against 3.14 too, not just run on it 2026-08-29 11:42:47 +02:00
check_file_length.py Enforce the 250-line cap for real, and on Dart 2026-08-15 22:42:57 +02:00
check_flutter_coverage.sh workout_app: add Google sign-in support for the Firebase sync account 2026-08-14 10:56:16 +02:00
check_md_naming.sh Adopt the four markdown namespaces and gate them 2026-08-24 15:53:42 +02:00
check_no_crdt_sync_override.sh Add a pre-commit gate against a local crdt_sync dependency_override 2026-08-12 19:18:21 +02:00
check_requirements_sync.py Add CI-mirror pre-push gate + requirements-sync check 2026-07-11 17:42:45 +02:00
check_silent_failures_dart.py Split storage_service.dart (781) into part extensions 2026-08-15 21:12:08 +02:00
check_silent_failures.py Re-arm the locker, and make a disarmed enforcer impossible to miss 2026-08-17 16:47:25 +02:00
ci_mirror.sh Add CI-mirror pre-push gate + requirements-sync check 2026-07-11 17:42:45 +02:00
demo_workout_handoff.py Put the demo's escape hatch inside the app, the only place it can be received 2026-08-22 12:41:07 +02:00
disarm_guard.sh Make disarming survive the install scripts, not just systemd 2026-08-22 12:54:13 +02:00
finish_2026_08_24.sh Tell "could not check" apart from "no workout", and stop double-granting bonuses 2026-08-24 13:07:20 +02:00
fix_2026_07_26_sport.py Grade against 3.14 too, not just run on it 2026-08-29 11:42:47 +02:00
refresh_refactor_todo.py Add refresh_refactor_todo.py: self-correcting violations table 2026-08-15 19:05:31 +02:00
restore_and_bonus.py Make the recovery scripts say why they failed, not just print it 2026-08-24 13:10:53 +02:00
revoke_sick_day.py Grade against 3.14 too, not just run on it 2026-08-29 11:42:47 +02:00
setup_mcp.sh Add read-only MCP server exposing workout/lock status 2026-07-10 21:28:09 +02:00
split_dart_test.py Add todo_finish_dart_250_prompt.md and the Dart test splitter 2026-08-15 21:49:15 +02:00
verify_lock_popup_safety.py Finish the Python side: scripts, conftest, and the last test modules 2026-08-15 20:57:29 +02:00
verify_screen_fits.py Queue behind stronger lockers, single-instance guard, fix budget-crash in fit check 2026-08-21 13:04:54 +02:00
verify_workout_credited.py Make the recovery scripts say why they failed, not just print it 2026-08-24 13:10:53 +02:00