Logic and behaviour
Central sleep calculation, all input relationships, dated shift constraints, adjustments, scores, recommendations, API, storage and acceptance cases.
This single-file control memo defines how profile, dated shifts, the phone clock, recent sleep, caffeine, hydration, meals, sport and history connect to one achievable sleep time and the actions that help the user reach it.
00 · Read this first
Central sleep calculation, all input relationships, dated shift constraints, adjustments, scores, recommendations, API, storage and acceptance cases.
Final Figma assets, store accounts, AWS/Firebase/Stripe credentials, production legal text and privacy policy remain separate deliverables.
No fitness-for-work score, no employer access to individual logs, no active wearable ingestion and no medical interpretation.
Official sources support recommendations and general principles. Exact points, thresholds, score caps, hydration buffers, 12/14/16-hour recovery budgets and 3/4/6-hour sensitivity mapping are versioned RYVENZA product parameters. They must never be presented as values published by SUVA.
01 · Global view
Planning creates the feasible window. Recent sleep and the profile select a preference inside that window. Every later action changes consequences and advice, but does not silently invent a new physiological fact.
02 · Interactive control
This tester is a deterministic reference implementation. It uses full dated local timestamps in Europe/Zurich and recalculates immediately.
03 · Rules
Do not write “50 mg of caffeine removes 22 minutes of sleep according to SUVA.” No verified SUVA source provides that linear conversion. The engine may estimate remaining caffeine with a simplified five-hour half-life, but it must label this as a RYVENZA estimate and show the assumption.
| ID | Condition | Engine result | Owner |
|---|
04 · Implementation contract A–Z
| Method | Route | Command | Returns |
|---|
| Step | Action | Required behaviour |
|---|
05 · Every adaptation
| ID | Situation | Required adaptation | Must never do |
|---|
06 · Parameter register
All values below are RYVENZA product parameters, even when an official recommendation inspired the surrounding advice. Store them in a versioned parameter set; never hide them in Flutter widgets or API controllers.
| ID | Value | Owner | Evidence boundary |
|---|
07 · Acceptance
| Test | Input situation | Expected result |
|---|
08 · Copy/paste blocks
09 · Verified sources
RYVENZA provides contextual wellbeing recommendations. It must not provide medical advice, an emergency response, a legal schedule approval, a fitness-for-work decision or a fitness-to-drive decision. Persistent fatigue, sleep disorders or safety concerns should be directed to an appropriate professional or employer process.