screen-locker/screen_locker
Krzysztof kuhy Rudnicki 8f911585c1 Serve the lock decision, its history and its health at 127.0.0.1:8770
The only status surface was a GTK tray icon, commented out of ~/.config/i3
on 2026-08-21. So when the weekly count went wrong, nothing on the machine
said so for two weeks -- the same silence that let a deleted timer job stop
enforcement for thirteen days in August.

Three read-only endpoints, and a React 19 UI over them:

  /api/status     the decision, the week, and whether today has a workout
  /api/decisions  the recorded trail, newest first
  /api/health     timers armed, disarm marker, log and trail freshness

The Why view is the one that matters: it renders the run of
"weekly_minimum_met 5/5" ticks that hid this week's bug, without anyone
having to reach for journalctl.

/api/status also carries gaming.workout_today, which is the fact
steam-backlog-enforcer will cut the daily budget on. Deliberately just the
fact -- the enforcer owns the hour values, so the two repos cannot come to
disagree about what a workout day is. It is derived from count_day_credits,
the same rule the locker enforces with.

_compliance_state_word moves from status_view (tkinter) into
_status_projection, and the systemd arming check moves from
scripts/check_enforcement_armed.py into screen_locker/_armed_state.py, so
the server can answer "is enforcement armed" without a second copy of the
logic that would be free to disagree with the gate.

web/ mirrors steam-backlog-enforcer/web but tightens it: that config has no
"strict" in any tsconfig, extends only tseslint recommended (no type-aware
rules at all), and gates neither lint nor typecheck in pre-commit. Here all
three run, on strictTypeChecked + stylisticTypeChecked, with
noUncheckedIndexedAccess and exactOptionalPropertyTypes. 44 tests, 100% of
statements, branches, functions and lines.

typescript stays pinned at 6.0.3: 7.0.2 is out, but every published
typescript-eslint -- stable, canary and rc-v8 -- declares
typescript ">=4.8.4 <6.1.0". The fleet allowlist already carries that entry.

The 250-line cap now covers ts/tsx. It was python/shell/dart only, which
would have made web/ exempt from the gate the rest of the repo lives under
-- the same omission that exempted the whole Flutter app until 2026-08-15.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Fcwu78wk17FWMHbbfbyicc
2026-08-29 22:50:19 +02:00
..
tests Serve the lock decision, its history and its health at 127.0.0.1:8770 2026-08-29 22:50:19 +02:00
__init__.py Fix test discovery and coverage for python_pkg modules 2025-12-02 22:33:34 +01:00
_adb_transport.py Split _shutdown, _phone_verification and _status_data 2026-08-15 20:11:28 +02:00
_armed_state.py Serve the lock decision, its history and its health at 127.0.0.1:8770 2026-08-29 22:50:19 +02:00
_auto_upgrade.py Say every reason a lock decision had, not just the first one 2026-08-23 07:02:41 +02:00
_cli.py Log manual workouts headlessly, with the form's rules intact 2026-08-27 20:50:52 +02:00
_compliance_predicates.py Grade against 3.14 too, not just run on it 2026-08-29 11:42:47 +02:00
_compliance_state.py Grade against 3.14 too, not just run on it 2026-08-29 11:42:47 +02:00
_compliance_trace.py Detect a Firebase credential the server rejects, not just one that fails to build 2026-08-27 21:32:39 +02:00
_constants.py Queue behind stronger lockers, single-instance guard, fix budget-crash in fit check 2026-08-21 13:04:54 +02:00
_credential_recovery.py Detect a Firebase credential the server rejects, not just one that fails to build 2026-08-27 21:32:39 +02:00
_decision_log.py Grade against 3.14 too, not just run on it 2026-08-29 11:42:47 +02:00
_decision_reasons.py Say every reason a lock decision had, not just the first one 2026-08-23 07:02:41 +02:00
_degraded_sources.py Detect a Firebase credential the server rejects, not just one that fails to build 2026-08-27 21:32:39 +02:00
_device.py Push under a persisted per-install uuid, not a fixed role id 2026-08-09 17:31:15 +02:00
_early_bird.py Grade against 3.14 too, not just run on it 2026-08-29 11:42:47 +02:00
_extra_benefits.py Grade against 3.14 too, not just run on it 2026-08-29 11:42:47 +02:00
_heat_skip.py Stop the relaxed-day popup from re-firing every 30 minutes after Skip 2026-08-18 21:55:59 +02:00
_http_workout_fetch.py Split _shutdown, _phone_verification and _status_data 2026-08-15 20:11:28 +02:00
_instance.py Queue behind stronger lockers, single-instance guard, fix budget-crash in fit check 2026-08-21 13:04:54 +02:00
_log_io.py Stop the relaxed-day popup from re-firing every 30 minutes after Skip 2026-08-18 21:55:59 +02:00
_log_mixin.py Grade against 3.14 too, not just run on it 2026-08-29 11:42:47 +02:00
_manual_cli.py Grade against 3.14 too, not just run on it 2026-08-29 11:42:47 +02:00
_manual_push.py Grade against 3.14 too, not just run on it 2026-08-29 11:42:47 +02:00
_manual_sync.py Stop the relaxed-day popup from re-firing every 30 minutes after Skip 2026-08-18 21:55:59 +02:00
_manual_workout_dialog.py Split _manual_workout_dialog.py and _manual_workout.py 2026-08-15 20:16:33 +02:00
_manual_workout_sport_fields.py Split _manual_workout_dialog.py and _manual_workout.py 2026-08-15 20:16:33 +02:00
_manual_workout_types.py Grade against 3.14 too, not just run on it 2026-08-29 11:42:47 +02:00
_manual_workout_widgets.py Split _manual_workout_dialog.py and _manual_workout.py 2026-08-15 20:16:33 +02:00
_manual_workout.py Grade against 3.14 too, not just run on it 2026-08-29 11:42:47 +02:00
_mcp.py Serve the lock decision, its history and its health at 127.0.0.1:8770 2026-08-29 22:50:19 +02:00
_phone_verification.py Grade against 3.14 too, not just run on it 2026-08-29 11:42:47 +02:00
_push_outcome.py Detect a Firebase credential the server rejects, not just one that fails to build 2026-08-27 21:32:39 +02:00
_runnerup_backfill.py Grade against 3.14 too, not just run on it 2026-08-29 11:42:47 +02:00
_runnerup_db.py Retry RunnerUp verification every 15 min, and stop hiding why it fails 2026-08-12 19:17:29 +02:00
_runnerup_tcx.py Split _runnerup_verification, _ui_widgets and _sick_dialog 2026-08-15 20:37:15 +02:00
_runnerup_verification.py Grade against 3.14 too, not just run on it 2026-08-29 11:42:47 +02:00
_session_sync.py Credit StrongLifts sessions from the headless sync, as pc_workout_verified 2026-08-22 11:26:20 +02:00
_shutdown_base.py Grade against 3.14 too, not just run on it 2026-08-29 11:42:47 +02:00
_shutdown_sick_state.py Grade against 3.14 too, not just run on it 2026-08-29 11:42:47 +02:00
_shutdown.py Grade against 3.14 too, not just run on it 2026-08-29 11:42:47 +02:00
_sick_budget.py Grade against 3.14 too, not just run on it 2026-08-29 11:42:47 +02:00
_sick_commitment.py Split _runnerup_verification, _ui_widgets and _sick_dialog 2026-08-15 20:37:15 +02:00
_sick_dialog.py Split _runnerup_verification, _ui_widgets and _sick_dialog 2026-08-15 20:37:15 +02:00
_sick_tracker.py Grade against 3.14 too, not just run on it 2026-08-29 11:42:47 +02:00
_source_health.py Grade against 3.14 too, not just run on it 2026-08-29 11:42:47 +02:00
_startup_checks.py Detect a Firebase credential the server rejects, not just one that fails to build 2026-08-27 21:32:39 +02:00
_status_data.py Count one StrongLifts session once, not once per ingestion path 2026-08-29 22:23:17 +02:00
_status_projection.py Serve the lock decision, its history and its health at 127.0.0.1:8770 2026-08-29 22:50:19 +02:00
_status_sections.py Split _compliance_state.py and status_view.py 2026-08-15 20:01:12 +02:00
_status_types.py Split _shutdown, _phone_verification and _status_data 2026-08-15 20:11:28 +02:00
_status_view_verify.py Make Check Phone week-aware; add RunnerUp GPS tolerance; fix CLI weekly count 2026-07-18 06:55:55 +02:00
_status.py Grade against 3.14 too, not just run on it 2026-08-29 11:42:47 +02:00
_surface_group.py Grade against 3.14 too, not just run on it 2026-08-29 11:42:47 +02:00
_sync_client.py Grade against 3.14 too, not just run on it 2026-08-29 11:42:47 +02:00
_sync_mixin.py Credit StrongLifts sessions from the headless sync, as pc_workout_verified 2026-08-22 11:26:20 +02:00
_sync_records.py Apply sync tombstones across the device union, not per device log 2026-08-21 13:38:52 +02:00
_sync_retry.py Grade against 3.14 too, not just run on it 2026-08-29 11:42:47 +02:00
_sync_status.py Grade against 3.14 too, not just run on it 2026-08-29 11:42:47 +02:00
_temperature_status_mixin.py Stop the relaxed-day popup from re-firing every 30 minutes after Skip 2026-08-18 21:55:59 +02:00
_temperature.py Add phone-workout GitHub sync via shared crdt_sync (Workstream C) 2026-07-11 00:06:59 +02:00
_time_check.py Support multiple workouts per day; fix the dead sync; ban silent failures 2026-07-17 09:22:31 +02:00
_ui_flows_lockout.py Split _ui_flows.py into sick-day and lockout flow mixins 2026-08-15 19:56:16 +02:00
_ui_flows_relaxed.py Stop the relaxed-day popup from re-firing every 30 minutes after Skip 2026-08-18 21:55:59 +02:00
_ui_flows_sick.py Split _ui_flows.py into sick-day and lockout flow mixins 2026-08-15 19:56:16 +02:00
_ui_flows.py Tell "could not check" apart from "no workout", and stop double-granting bonuses 2026-08-24 13:07:20 +02:00
_ui_form_fields.py Split _runnerup_verification, _ui_widgets and _sick_dialog 2026-08-15 20:37:15 +02:00
_ui_widgets.py Split _runnerup_verification, _ui_widgets and _sick_dialog 2026-08-15 20:37:15 +02:00
_unlock_view.py Stop the lock screen scrolling itself, and make every screen fit 768px 2026-08-03 15:57:48 +02:00
_wake_alarm.py Grade against 3.14 too, not just run on it 2026-08-29 11:42:47 +02:00
_wake_state.py Grade against 3.14 too, not just run on it 2026-08-29 11:42:47 +02:00
_web_payload.py Serve the lock decision, its history and its health at 127.0.0.1:8770 2026-08-29 22:50:19 +02:00
_web_server.py Serve the lock decision, its history and its health at 127.0.0.1:8770 2026-08-29 22:50:19 +02:00
_weekly_check.py Count one StrongLifts session once, not once per ingestion path 2026-08-29 22:23:17 +02:00
_window_setup.py Queue behind stronger lockers, single-instance guard, fix budget-crash in fit check 2026-08-21 13:04:54 +02:00
_workout_app.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
_workout_credit.py Credit StrongLifts sessions from the headless sync, as pc_workout_verified 2026-08-22 11:26:20 +02:00
_workout_handoff.py Make the demo escapable, and stop claiming the blocking was deliberate 2026-08-22 12:33:07 +02:00
_workout_ready.py Supervise the workout app as the lock surface, on a deadline that holds 2026-08-22 11:52:02 +02:00
_workout_session.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
_workout_sync.py Credit StrongLifts sessions from the headless sync, as pc_workout_verified 2026-08-22 11:26:20 +02:00
adjust_shutdown_schedule.sh Cap --restore at 23:00 so it is a reward, not an off switch 2026-08-28 19:59:43 +02:00
screen_lock.py Opt in to preempting a weaker gatelock holder 2026-08-21 13:31:57 +02:00
status_view.py Serve the lock decision, its history and its health at 127.0.0.1:8770 2026-08-29 22:50:19 +02:00