mirror of
https://github.com/kuhyx/diet-guard.git
synced 2026-11-11 12:47:39 +01:00
due_slots() returns nothing on a sick day, like a free day: no lock, no debt; logging still works. Unreadable pool reads as not sick (fail closed). Pins sickdays-v0.1.0 and freedays-v0.4.0 (pyproject, requirements, pylint hook env). Phone gap documented in docs/DOCS-sick-days.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Xfj1sxKH9VBPqpcAni8Jry
1.2 KiB
1.2 KiB
Free days and sick days
_gate.due_slots returns () on a shared free day (freedays) or a sick day
(sickdays 0.1.0, one pool for every gate). 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.is_sick_daynever raises. - 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.