SP slotplate
Pattern

Finite state machine

Named phases with enter/skip/exit.

Where: src/flow/fsm.ts, src/flow/phases/.

The rule: the game is a set of named phases. Transitions are explicit. Each phase has enter(ctx), optional skip(ctx), optional exit(ctx).

Why a machine, not flags: flags like isSpinning, canStop, showingWin multiply until you can't reason about them. A machine has one current state; transitions are auditable.

See FSM & phases for the full treatment.