state machine
A state machine describes states and permitted transitions driven by events.
Use this when A workflow can become both saving and failed, or process an event in the wrong phase.
without the term
“The upload screen can somehow be uploading and failed at the same time, and retry sometimes fires while it's still uploading. Can you make the steps strict so only valid next steps can happen?”
with the term · How do you ask a model for state machine?
Model this workflow as a state machine. Test valid transitions, rejected events, failure, and retry without contradictory states.
What is state machine?
You list the states, the events, and which events move which states where. Any event the table doesn't allow is handled on purpose instead of by accident.
Why does state machine matter when vibe coding?
Independent booleans can admit combinations that no valid workflow should reach.
How do you do state machine?
List states, events, and transition effects; decide how unexpected events are handled.
What goes wrong with state machine?
Maintaining a second set of flags that can disagree with the machine’s state.