screen-locker/scripts
Krzysztof kuhy Rudnicki aa2776a45e Cap live bonuses at the day's ceiling
The by-minutes bonus path clamped at 24:00 (_MIDNIGHT) and relied on
adjust_shutdown_schedule.sh's RESTORE_CEILING (23:00). It now clamps at
earned_time.shutdown_ceiling_for(day) via the new _ceiling.ceiling, so a
moved WAKE_MINUTES cannot be passed by a bonus. The shell's 1380 stays
the hard upper bound; ceiling() is min()'d with it, and a test pins the
Python constant to the script's value. _preview_sim and the invariant
test reuse that constant instead of a second 23 * 60.

Failure mode: if the earned_time lookup raises (ArithmeticError,
LookupError, TypeError, ValueError), ceiling() falls back to 23:00
loudly (logger.warning), never silently and never above the helper's
bound. That is fail-open relative to a lowered ceiling, bounded by the
shell clamp; an earned_time without the API (0.3.0) uses its constant.

Red first: new tests (21:00 ceiling, failing lookup, caps-at-ceiling)
failed on c3a5d14, pass now. 14-day replay of the real ledgers
(2026-10-18..31) through old and new code, plus an all-done-at-22:30
counterfactual: identical, every day 23:00; live files unchanged.

TODO-cap-bonus-at-day-ceiling.md removed (done).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WzxdWYdwRAtMg7ki6TKxuU
2026-11-01 20:04:14 +01:00
..
__init__.py Finish the Python side: scripts, conftest, and the last test modules 2026-08-15 20:57:29 +02:00
_fit_extra_screens.py Lock screen: "choose lockers…" opens sickdays' KeepPanel in the lock 2026-10-17 14:06:22 +02:00
_popup_form_check.py Take gatelock 0.8.1: nested LockConfig 2026-09-12 19:52:38 +02:00
_preview_sim.py Cap live bonuses at the day's ceiling 2026-11-01 20:04:14 +01:00
_xvfb_reexec.py Commit gate: pytest 67.7 s serial -> 9.4 s, screens-fit hook 3.6 s -> 0.7 s 2026-11-01 17:27:27 +01:00
add_scheduled_skip.py Re-point paths for the ~ reorganisation (home-tidy) 2026-09-11 18:46:28 +02:00
annotate_duplicate_credits.py sick days: one shared sickdays pool, 20:00 shutdown floor, one-tap lock button 2026-10-16 13:30:39 +02:00
check_dependency_freshness.sh Re-point paths for the ~ reorganisation (home-tidy) 2026-09-11 18:46:28 +02:00
check_enforcement_armed.py Serve the lock decision, its history and its health at 127.0.0.1:8770 2026-08-29 22:50:19 +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 Split the Flutter coverage gate into per-tree shard hooks plus a merge hook 2026-11-01 18:18:25 +01:00
check_gate_stamp.sh pre-push is a 1-second stamp check; the suites moved to the manual stage 2026-09-20 19:35:35 +02:00
check_md_naming.sh Re-point paths for the ~ reorganisation (home-tidy) 2026-09-11 18:46:28 +02:00
check_no_crdt_sync_override.sh Re-point paths for the ~ reorganisation (home-tidy) 2026-09-11 18:46:28 +02:00
check_repo_contract.sh repo contract: CLAUDE.md commands, test_changed, CI gate 2026-10-04 17:15:50 +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 ci-mirror: split into ci-venv / ci-precommit / ci-pytest, pytest under xdist 2026-10-17 16:46:38 +02:00
demo_workout_handoff.py Take gatelock 0.8.1: nested LockConfig 2026-09-12 19:52:38 +02:00
disarm_guard.sh shutdown bonus: apply the moment a gate writes its ledger (earner-bonus.path) 2026-10-06 20:42:13 +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
flutter_coverage_lib.sh Split the Flutter coverage gate into per-tree shard hooks plus a merge hook 2026-11-01 18:18:25 +01:00
migrate_scheduled_skips.py Replace scheduled skips with the shared free-day pool 2026-09-07 15:42:41 +02:00
migrate_sick_history.py sick days: one shared sickdays pool, 20:00 shutdown floor, one-tap lock button 2026-10-16 13:30:39 +02:00
pair_phone.sh workout-poke: instant phone credit over LAN (signed POST :8773) and Firebase stream 2026-10-09 19:05:51 +02:00
poke_selftest.py workout poke moves to tcp/8774: 8773 is book-guard's desktop wrapper, whose window the poke server had been answering since 2026-10-09 (phone app rebuilt, selftest default, contract doc) 2026-10-10 09:38:21 +02:00
preview_shutdown.py late credits: a credit at/after tonight's shutdown sets it to min(23:00, its own time + reward); grace floor removed (also on sick days) 2026-10-17 18:14:04 +02:00
refresh_refactor_todo.py deps: ruff 0.17.0 (CPY001 ignored: no copyright policy) 2026-10-09 22:05:02 +02:00
rekey_log_entry.py Key every workout day on the LOCAL calendar day, not UTC 2026-09-13 09:50:06 +02:00
runnerup_watch.sh Credit: one reward per workout slot, desktop notification, --help, runnerup-watch ignores re-pulls 2026-10-09 19:05:08 +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
test_changed.sh repo contract: CLAUDE.md commands, test_changed, CI gate 2026-10-04 17:15:50 +02:00
tombstone_sync_record.py Sync: Firebase only — drop the GitHub transport (kuhyx/syncs stays a frozen archive) 2026-10-09 19:18:56 +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 Lock screen: "choose lockers…" opens sickdays' KeepPanel in the lock 2026-10-17 14:06:22 +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
workout_poke_keygen.sh workout-poke: instant phone credit over LAN (signed POST :8773) and Firebase stream 2026-10-09 19:05:51 +02:00