Wake missions
A mission starts after the system alarm has been stopped. It never keeps the alarm ringing and never blocks the system controls: it is the user's own commitment, with an emergency exit that is always available and always recorded.
Common contract
- Engine in
AlarmCore/Missions:generate(level:round:seed:)andvalidate(_:answer:), pure and deterministic. The same seed gives the same puzzle, which is how tests and bug reports reproduce a morning. - View in
App/Features/Missions:XMissionView(mission: ResolvedMission, onFinish:), reporting oneMissionOutcome(completed with mistakes, duration and rounds, orunavailable). - Levels 1 (easy) to 4 (expert). A step is
easy,normal,hard,expertoradaptive. - Runner (
MissionRunnerView): progress across steps, "Switch to an alternative mission" (accessibility), automatic fallback when a mission is unavailable, emergency exit, wake confirmation, summary.
| # | Mission | What the user does | Levels | Engine guarantees (tested) |
|---|---|---|---|---|
| 1 | Math Blitz | answers on a large keypad; estimation questions are multiple choice | 1: + and − · 2: adds × and exact ÷ · 3: larger numbers, missing number, sequences, estimation · 4: multi-step with parentheses | one correct integer answer, no division by zero, prompts re-evaluated by an independent parser |
| 2 | Memory Matrix | memorises lit cells, then taps them | 3×3, 4×4, 5×5; ordered sequences at higher levels; length grows each round | cells inside the grid, distinct, reproducible |
| 3 | QR Escape | walks to a QR code registered earlier and scans it | — | only a SHA-256 digest of the code is stored; wrong codes are rejected |
| 4 | Step Challenge | walks 20 to 300 steps (pedometer, not shaking) | goal set per step | monotonic progress, implausible jumps rejected |
| 5 | Pattern Lock | watches a path through a constellation of nodes and redraws it (drag or tap) | 3×3 then 4×4, longer paths | distinct nodes, adjacent moves only |
| 6 | Word Scramble | rebuilds a word from letter tiles, English or French | three vocabulary tiers, longer words at level 4 | scramble never equals the word, any anagram present in the list is accepted, accents exact |
| 7 | Logic Gates | flips switches so the lamp reaches its goal | 1 to 5 gates (AND, OR, NOT, XOR) | always solvable, never already solved |
| 8 | Maze Escape | guides a light to the exit (swipe, arrows, optional tilt) | 6×6 to 12×12; keys to collect at levels 3 and 4 | perfect maze, exit and keys reachable (BFS over thousands of seeds) |
| 9 | Color Sequence | repeats a growing sequence of panels, each with its own colour and shape | 4 panels, 6 at level 4 | each round extends the previous one |
| 10 | Morning Combo | a sequence of up to six of the missions above | — | order kept, one outcome per step |
Difficulty
AdaptiveEngine is a documented rule, not a model: it looks at the last five completed steps of the same mission. Four fast and clean ones raise the level by one; three slow or error-ridden ones lower it; otherwise the median level is kept. With fewer than three results the level is 2. A snooze policy can add one level per snooze. Insights shows the rule's reasoning, and suggestions never change a setting by themselves.
When a mission cannot run
| Situation | Behaviour |
|---|---|
| No camera, camera permission denied, tag deleted | the QR mission explains why and the runner offers Math Blitz |
| No pedometer, motion permission denied | the runner offers Memory Matrix |
| The user cannot do a gesture or see a colour | "Switch to an alternative mission" in the runner menu; panels and wires also differ by shape and thickness |
| The user must leave | emergency exit: confirmed, recorded as a bypass, never counted as a wake-up |
An alarm whose mission is invalid (a QR step without a tag) cannot be saved from the editor, but an alarm already scheduled keeps ringing whatever happens to its mission.
Verification
Engines: 2 500 to 12 000 generated puzzles per level in unit tests. Views: Math (levels 1 to 4), Memory, Pattern, Word, Logic Gates and Maze were played to the summary by UI tests; Color Sequence at level 1. The real camera, the real pedometer, tilt control, VoiceOver and Reduce Motion paths have not been exercised on a device.