screen-locker/screen_locker
Krzysztof kuhy Rudnicki 0921146044 Tests can no longer write the live desktop Firebase credential
`flutter test` runs on a Linux host, so credentialStore()'s Platform.isLinux
branch wrote $HOME/.config/screen_locker/firebase_auth.json -- the refresh
token the screen-locker daemon signs in with. firebase_backend_google_test's
"stores the account under the email Firebase reports" case overwrote it with
the fixture token 'refresh' on every local run; the daemon only survived by
self-healing from a cached token.

Dart:
- lib/services/desktop_config_dir.dart: one resolver, desktopConfigRoot(),
  for every desktop path (the credential file's read/write/delete and the
  ~/.config/crdt-sync account read). @visibleForTesting override; under
  FLUTTER_TEST it throws StateError if the root is, or is inside, the real
  $HOME/.config -- so a test that bypasses the override fails loudly instead
  of writing. HOME unset now yields null instead of a cwd-relative .config.
- The crdt-sync read resolves the root outside its catch-all, so the guard
  cannot be swallowed as "not connected".
- test/flutter_test_config.dart gives every test its own temp config root.
- The Google sign-in test now asserts the token landed in that temp root.
- path_provider is unbound under flutter test (MissingPluginException), so
  the getApplicationSupportDirectory callers cannot reach live dirs.

Python (tests only): isolate_sync_token now patches every import-time
binding of SYNC_TOKEN_FILE (_constants, _manual_push, _sync_status were
missed), and test_home_isolation scans all runtime modules for any Path
still bound inside the real ~/.config/screen_locker.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KFwA9nymhUdTrVF65kigTV
2026-09-27 08:35:18 +02:00
..
tests Tests can no longer write the live desktop Firebase credential 2026-09-27 08:35:18 +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 Close the four gaps that let a decided lock never reach the screen 2026-08-30 15:24:45 +02:00
_auto_upgrade.py The early-bird window is the wake-alarm carrot, not a clock 2026-09-20 08:39:44 +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 The early-bird window is the wake-alarm carrot, not a clock 2026-09-20 08:39:44 +02:00
_compliance_state.py The early-bird window is the wake-alarm carrot, not a clock 2026-09-20 08:39:44 +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 Lose Tue/Wed/Thu leniency when wake-alarm signals a missed prior-day ring 2026-09-23 21:23:31 +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
_day.py Key every workout day on the LOCAL calendar day, not UTC 2026-09-13 09:50:06 +02:00
_decision_log.py Close the four gaps that let a decided lock never reach the screen 2026-08-30 15:24:45 +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
_decision_trail.py Close the four gaps that let a decided lock never reach the screen 2026-08-30 15:24:45 +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 The early-bird window is the wake-alarm carrot, not a clock 2026-09-20 08:39:44 +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 Take gatelock 0.8.1: nested LockConfig 2026-09-12 19:52:38 +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
_leetcode_bonus.py Reading hour from book-guard: +1h shutdown; base 20->19 from 2026-10-01 2026-09-26 19:02:24 +02:00
_lock_invariant.py Refuse to build a lock screen over a workout already logged today 2026-09-18 09:58:13 +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 Key every workout day on the LOCAL calendar day, not UTC 2026-09-13 09:50:06 +02:00
_manual_cli.py Key every workout day on the LOCAL calendar day, not UTC 2026-09-13 09:50:06 +02:00
_manual_push.py Tombstone sync records durably: a ledger the PC re-pushes every tick 2026-09-13 20:20:06 +02:00
_manual_sync_draft.py Count the manual budget per workout, keep a synced twin's id, and let a logged workout outrank an expired early bird 2026-09-18 09:44:28 +02:00
_manual_sync.py Count the manual budget per workout, keep a synced twin's id, and let a logged workout outrank an expired early bird 2026-09-18 09:44:28 +02:00
_manual_workout_dialog.py Take gatelock 0.8.1: nested LockConfig 2026-09-12 19:52:38 +02:00
_manual_workout_sport_fields.py Take gatelock 0.8.1: nested LockConfig 2026-09-12 19:52:38 +02:00
_manual_workout_types.py Count the manual budget per workout, keep a synced twin's id, and let a logged workout outrank an expired early bird 2026-09-18 09:44:28 +02:00
_manual_workout_widgets.py Take gatelock 0.8.1: nested LockConfig 2026-09-12 19:52:38 +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 Re-point paths for the ~ reorganisation (home-tidy) 2026-09-11 18:46:28 +02:00
_morning_session.py The early-bird window is the wake-alarm carrot, not a clock 2026-09-20 08:39:44 +02:00
_phone_verification.py Key every workout day on the LOCAL calendar day, not UTC 2026-09-13 09:50:06 +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
_queue_state.py Close the four gaps that let a decided lock never reach the screen 2026-08-30 15:24:45 +02:00
_queue_wait.py Close the four gaps that let a decided lock never reach the screen 2026-08-30 15:24:45 +02:00
_reading_bonus.py Reading hour from book-guard: +1h shutdown; base 20->19 from 2026-10-01 2026-09-26 19:02:24 +02:00
_runnerup_backfill.py Credit RunnerUp runs by the day rule, from the WebDAV drop dir, and never twice 2026-09-16 21:14:17 +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 Credit RunnerUp runs by the day rule, from the WebDAV drop dir, and never twice 2026-09-16 21:14:17 +02:00
_runnerup_verification.py Credit RunnerUp runs by the day rule, from the WebDAV drop dir, and never twice 2026-09-16 21:14:17 +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 Reading hour from book-guard: +1h shutdown; base 20->19 from 2026-10-01 2026-09-26 19:02:24 +02:00
_shutdown_sick_state.py Key every workout day on the LOCAL calendar day, not UTC 2026-09-13 09:50:06 +02:00
_shutdown.py Replay today's earned shutdown credit in the daily base reset 2026-09-13 20:00:05 +02:00
_sick_budget.py Key every workout day on the LOCAL calendar day, not UTC 2026-09-13 09:50:06 +02:00
_sick_commitment.py Take gatelock 0.8.1: nested LockConfig 2026-09-12 19:52:38 +02:00
_sick_dialog.py The early-bird window is the wake-alarm carrot, not a clock 2026-09-20 08:39:44 +02:00
_sick_tracker.py The early-bird window is the wake-alarm carrot, not a clock 2026-09-20 08:39:44 +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 Reading hour from book-guard: +1h shutdown; base 20->19 from 2026-10-01 2026-09-26 19:02:24 +02:00
_status_data.py The early-bird window is the wake-alarm carrot, not a clock 2026-09-20 08:39:44 +02:00
_status_projection.py Reading hour from book-guard: +1h shutdown; base 20->19 from 2026-10-01 2026-09-26 19:02:24 +02:00
_status_sections.py Take gatelock 0.8.1: nested LockConfig 2026-09-12 19:52:38 +02:00
_status_types.py Split _shutdown, _phone_verification and _status_data 2026-08-15 20:11:28 +02:00
_status_view_verify.py Credit RunnerUp runs by the day rule, from the WebDAV drop dir, and never twice 2026-09-16 21:14:17 +02:00
_status.py Credit RunnerUp runs by the day rule, from the WebDAV drop dir, and never twice 2026-09-16 21:14:17 +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 Reading hour from book-guard: +1h shutdown; base 20->19 from 2026-10-01 2026-09-26 19:02:24 +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
_sync_tombstones.py Tombstone sync records durably: a ledger the PC re-pushes every tick 2026-09-13 20:20:06 +02:00
_temperature_status_mixin.py Take gatelock 0.8.1: nested LockConfig 2026-09-12 19:52:38 +02:00
_temperature.py Close the four gaps that let a decided lock never reach the screen 2026-08-30 15:24:45 +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 Take gatelock 0.8.1: nested LockConfig 2026-09-12 19:52:38 +02:00
_ui_flows_relaxed.py Take gatelock 0.8.1: nested LockConfig 2026-09-12 19:52:38 +02:00
_ui_flows_sick.py Take gatelock 0.8.1: nested LockConfig 2026-09-12 19:52:38 +02:00
_ui_flows.py Take gatelock 0.8.1: nested LockConfig 2026-09-12 19:52:38 +02:00
_ui_form_fields.py Take gatelock 0.8.1: nested LockConfig 2026-09-12 19:52:38 +02:00
_ui_widgets.py Take gatelock 0.8.1: nested LockConfig 2026-09-12 19:52:38 +02:00
_unlock_view.py Take gatelock 0.8.1: nested LockConfig 2026-09-12 19:52:38 +02:00
_wake_alarm.py Grade against 3.14 too, not just run on it 2026-08-29 11:42:47 +02:00
_web_decisions.py Close the four gaps that let a decided lock never reach the screen 2026-08-30 15:24:45 +02:00
_web_payload.py Close the four gaps that let a decided lock never reach the screen 2026-08-30 15:24:45 +02:00
_web_server.py Close the four gaps that let a decided lock never reach the screen 2026-08-30 15:24:45 +02:00
_weekly_check.py Lose Tue/Wed/Thu leniency when wake-alarm signals a missed prior-day ring 2026-09-23 21:23:31 +02:00
_window_setup.py Take gatelock 0.8.1: nested LockConfig 2026-09-12 19:52:38 +02:00
_workday_penalty.py Lose Tue/Wed/Thu leniency when wake-alarm signals a missed prior-day ring 2026-09-23 21:23:31 +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 Replay today's earned shutdown credit in the daily base reset 2026-09-13 20:00:05 +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 Re-point paths for the ~ reorganisation (home-tidy) 2026-09-11 18:46:28 +02:00
screen_lock.py Take gatelock 0.8.1: nested LockConfig 2026-09-12 19:52:38 +02:00
status_view.py Take gatelock 0.8.1: nested LockConfig 2026-09-12 19:52:38 +02:00