From a0731c496cd411b841a9f8598b3fa008e0ac869c Mon Sep 17 00:00:00 2001 From: Krzysztof kuhy Rudnicki Date: Fri, 9 Oct 2026 19:11:50 +0200 Subject: [PATCH] Sync: stop reading screen-locker's sync_token (screen-locker is Firebase-only now) screen-locker's PC sync went Firebase-only on 2026-10-09 and nothing maintains ~/.config/screen_locker/sync_token any more. The GitHub-fallback token list now holds only diet_guard's repo-scoped PAT. Drop the stale note about shutdown-wrapper.sh mirroring the list (the wrapper was removed on 2026-08-30). Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_018RHwVPyiiQMPh4M3JQwQku --- AGENTS.md | 3 ++- wake_alarm/_constants.py | 9 ++++----- wake_alarm/_sync_transport.py | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 6d6cd30..09c93db 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -121,7 +121,8 @@ systemd-sleep hook: a suspended or just-booted machine still fires. is checked **before** anything is constructed, so an unconfigured machine never touches the network. - GitHub token (fallback only): `~/.config/wake_alarm/sync.json` key `token`, - else a sibling app's raw `~/.config/{diet_guard,screen_locker}/sync_token`. + else diet_guard's raw `~/.config/diet_guard/sync_token` (screen-locker is + Firebase-only since 2026-10-09; its `sync_token` is no longer read). Needs `repo` scope — the repo is private, so a token without access returns **404, not 403**. - `crdt_sync` is imported at module scope but **guarded by diff --git a/wake_alarm/_constants.py b/wake_alarm/_constants.py index 5d16f7a..9d75d61 100644 --- a/wake_alarm/_constants.py +++ b/wake_alarm/_constants.py @@ -38,13 +38,12 @@ WAKE_STATE_FILE: Path = Path(__file__).resolve().parent / "wake_state.json" SYNC_CONFIG_FILE: Path = Path.home() / ".config" / "wake_alarm" / "sync.json" # Fallback token locations, tried in order when SYNC_CONFIG_FILE is absent. -# The sibling companion apps already store a repo-scoped PAT for this same -# kuhyx/syncs repo as a raw single-line file, so reusing one means a single -# token to rotate instead of three copies drifting out of sync. -# shutdown-wrapper.sh reads the same list — keep the two in step. +# diet_guard already stores a repo-scoped PAT for this same kuhyx/syncs repo as +# a raw single-line file; reusing it means one token to rotate, not two. +# screen-locker's sync_token is gone: its PC sync is Firebase-only since +# 2026-10-09 and nothing maintains that file any more. SYNC_TOKEN_FALLBACK_FILES: tuple[Path, ...] = ( Path.home() / ".config" / "diet_guard" / "sync_token", - Path.home() / ".config" / "screen_locker" / "sync_token", ) # Where a successful read is cached, so a network blip can't cost a wake-up. diff --git a/wake_alarm/_sync_transport.py b/wake_alarm/_sync_transport.py index dd4b979..a345ce7 100644 --- a/wake_alarm/_sync_transport.py +++ b/wake_alarm/_sync_transport.py @@ -92,8 +92,8 @@ def _read_token_fallback() -> str | None: def _read_token() -> str | None: """Read the GitHub token, preferring this package's own config. - Falls back to the sibling companion apps' token files so one repo-scoped - PAT covers every app syncing through ``kuhyx/syncs``. + Falls back to diet_guard's token file so one repo-scoped PAT covers + every app syncing through ``kuhyx/syncs``. Returns: The token, or None if no configured source holds one.