The SDK is the game engine. A renderer displays projections of the game; it does not decide what is legal.
State and actions
State is serializable. Actions declare their input and availability, then apply a transition. Required decisions belong in state, including intermediate payments and other players’ responses. One action vocabulary serves people, agents, tests, and network clients.
Use discoverable finite choices when possible. Validate every input, including choices received from an old projection. A displayed button never grants authorization by itself.
Randomness and replay
Use the SDK’s seeded random source. Record explicit physical outcomes as action inputs when needed. A replay reconstructs the game from its initial settings and command history. Avoid Date.now, Math.random, and network calls in rules.
Completion
The game declares when it ends and what result it returns. Surrender is also an authored rule if the game supports it. The renderer must never guess whether a game is solvable or choose a player’s strategy.