amphro
Currently the full `GameResolution` (seed + all rounds + both strategies) only lives in Durable Object storage (`ctx.storage`). If the DO is evicted or dev state is wiped, the game exists in D1 but can't be replayed. Migration 003 already added the `seed`, `blue_strategy`, `red_strategy`, `blue_readback`, `red_readback` columns — but the write code was never implemented. ## What to do 1. In `GameRoom.ts` at game start (when seed + config are set), write `seed` to D1. 2. In `endGame()`, write `blue_strategy`, `red_strategy`, `blue_readback`, `red_readback` to D1. 3. Optionally write the full `GameResolution` JSON as a TEXT column (for perfect replay) — though this is large (~40KB per game). 4. In `handleWebSocket`, if `this.resolution === null` but D1 has strategies + seed, reconstitute the resolution by re-running `runGame()`. ## Why this matters Sharing a game link (`/game/:code`) breaks if the server restarted. With strategies + seed in D1, the DO can always replay any finished game — even after restart.