diet-guard/scripts
Krzysztof kuhy Rudnicki 93669776b6 feat: gate a phone deploy on a peer already holding the device's state
`adb install -r` preserves app data and phone_deploy already refuses every
path that would not, but "preserved" is a property of the happy path -- a
failed install or a later wipe leaves unpublished entries existing nowhere
else. The log is CRDT-synced precisely so a recoverable copy exists, so the
deploy now checks that one does before touching the device.

The obvious device-side signal does not work and would be a gate that can
never pass: the app records a successful tick through SyncHealth, which writes
to SharedPreferences (app-private, unreadable over ADB on a release build),
and it only writes to logcat when a sync *fails*. So the check is remote-side
-- pull the shared log and assert it holds recent entries, which answers "is
there a copy off the device" directly.

Advisory by default; SYNC_GATE_STRICT=1 makes it block (exit 38). A network
outage must not stop a fix reaching the phone.

The shell half lives in ~/.claude/scripts/lib/phone_deploy_sync.sh. Verified
against the real phone: passes when a peer is current, skips cleanly for an
unsynced or not-yet-installed app, and blocks with exit 38 in strict mode.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QQpCiPaSbyRpwsLkH3dgsX
2026-08-23 07:41:26 +02:00
..
bump_patch_version.sh Bump the patch version on every commit 2026-08-09 23:04:17 +02:00
check_file_length.sh Enforce the shared 250-line file cap 2026-08-15 16:35:01 +02:00
check_no_crdt_sync_override.sh Add Google sign-in support for the Firebase sync account 2026-08-12 23:36:10 +02:00
check_patch_targets.py Fix check_patch_targets' own fail-open: put the repo root on sys.path 2026-08-15 21:27:24 +02:00
check_requirements_sync.py Add CI-mirror pre-push gate + requirements-sync check 2026-07-11 17:58:49 +02:00
ci_mirror.sh Stop two keyboard tests hanging, and make the CI mirror mirror CI 2026-08-04 21:50:15 +02:00
probe_kuchnia_auth.py feat: import Kuchnia Wikinga catering deliveries into the food bank 2026-08-22 23:04:22 +02:00
probe_kuchnia_details.py feat: import Kuchnia Wikinga catering deliveries into the food bank 2026-08-22 23:04:22 +02:00
probe_kuchnia_shape.py feat: import Kuchnia Wikinga catering deliveries into the food bank 2026-08-22 23:04:22 +02:00
probe_kuchnia.py feat: import Kuchnia Wikinga catering deliveries into the food bank 2026-08-22 23:04:22 +02:00
setup_mcp.sh Fix pre-existing CI failures (deps, lint, whitespace) 2026-07-10 23:55:56 +02:00
sync_freshness.py feat: gate a phone deploy on a peer already holding the device's state 2026-08-23 07:41:26 +02:00