mirror of
https://github.com/kuhyx/diet-guard.git
synced 2026-11-10 20:27:11 +01:00
Some checks are pending
dependency freshness / dependencies on newest stable (push) Waiting to run
file-length / file length <= 250 lines (push) Waiting to run
md-naming / markdown naming convention (push) Waiting to run
pre-commit / pre-commit (${{ matrix.group }}) (mypy, mypy, ) (push) Waiting to run
pre-commit / pre-commit (${{ matrix.group }}) (pylint, pylint, ) (push) Waiting to run
pre-commit / pre-commit (${{ matrix.group }}) (rest, , mypy,pylint) (push) Waiting to run
Tests / test (push) Waiting to run
release-apk / release (APK) (push) Waiting to run
repo-contract / repo contract (push) Waiting to run
due_slots asks sickdays.stands_down(LOCKER_DIET, day) instead of is_sick_day, so a sick day that keeps diet is a normal day for the gate. Bump sickdays pins to v0.2.0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PAhbNszs5JKdtnD4uBi3xp
1.4 KiB
1.4 KiB
Free days and sick days
_gate.due_slots returns () on a shared free day (freedays) or a sick day
(sickdays 0.2.0, one pool for every gate) -- unless that sick day keeps
diet (sickdays.stands_down(LOCKER_DIET, day) is False): a kept locker behaves
exactly as on a normal day. Nothing is due, so no lock opens,
nothing is said about missing meals and no debt accrues. Logging a meal works
as on any other day (the log path never consults the gate); diet-guard earns
nothing, so there is nothing to credit.
- Each pool is one local file, never the network, so the systemd-fired gate cannot hang on it.
- Fail closed: an unreadable pool reads as "not free" / "not sick", so the
gate stays armed.
sickdays.stands_downnever raises for a data problem. - Only the calendar day of
nowis asked (the last slot is at most 22:00, so the gate never runs on yesterday's slots after midnight). - Tests:
tests/_state_redirects.pypoints both pools intotmp_path; a real sick day on the dev machine must not stand the suite's gate down. - Phone gap: the companion app does not read either pool.
due_slot_check.dart(checkAndNotify) still posts "log your meal" notifications on a free or sick day. It would needcrdt_sync_dartsyncingsickdays-sync/devices/*/sick_days.json(see the sickdays README) and an early return before_reconcileNotificationsthat cancels pending ones.