- app/scheduler/demo.py: run_until(now) replays due and fresh events in time order: dose rows +
med_reminder, missed after 2 h without an answer → monitoring, daily_checkin, scale_due by the
config/modules.yaml schedules, daily monitoring pass (silence, missed doses) → reach_out/scale_due
- idempotent via scheduler_events (unique token+key); stale events are not sent; no contact without
consent or during an open crisis
- config/scheduler.yaml: times and windows; runs while the questionnaire release is off
- POST /demo/clock/advance replays the scheduler up to the new time
Refs #13
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Two DeclarativeBases on two engines (ADR-003): identity holds direct
identifiers, clinical holds token-keyed pseudonymised data plus audit_log.
Portable types (JSONB variant, tz-aware UTC timestamps rejecting naive
values) so tests run on SQLite. init_db() runs create_all at startup.
Guardrail #5 checked by AST and import-graph tests.
Refs #6
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>