Shipping & Running
$definestate--plain-english
TLDRThe stuff the app has to remember while it's running — and after.
State is the sticky notes on the monitor. Storage is the notebook you take home.
Your app is thinking right now. Which modal is open. What the judge typed into the form. Which step the agent already finished. That working picture is state. It is not the database. The database is what you still know tomorrow. State is what you know this second, in this process, in this session.
Kill the process and the notes hit the floor. That's why serverless feels rude: every request may be a new process. If you stuffed the shopping cart in a variable, the cart is empty on the next click. The judge thinks your app is broken. You hid the memory in the wrong pocket.
Two pockets
Cache is a rumor of state. Allowed to be wrong for a minute. Don't put the receipt there.
Agents forget the same way
An agent doing a multi-step job needs a working picture. "Step one is done, here's the file, now step two." If the process dies and you never wrote that down, the agent wakes up as a stranger. That's a state problem, not a model problem.
The builder already picked a cabinet for you. Auth sessions, todos, the user row survive a refresh because they were never only in RAM. When you invent a new thing the app must remember, pick a pocket on purpose.
What this unlocks
Until you know where "right now" lives, every crash is a mystery. After you do, the cart belongs in the database, the modal belongs in the URL, the agent's checklist belongs in a file. The demo survives a refresh. The agent can continue. You stop blaming the model for a wiped board.