diff options
Diffstat (limited to '')
| -rw-r--r-- | AGENTS.md | 15 |
1 files changed, 15 insertions, 0 deletions
| @@ -30,6 +30,21 @@ | |||
| 30 | - All balance mutations (`SET balance = balance ± ?`) must happen in a | 30 | - All balance mutations (`SET balance = balance ± ?`) must happen in a |
| 31 | transaction. | 31 | transaction. |
| 32 | 32 | ||
| 33 | ## Crash | ||
| 34 | - The client draws the multiplier from its own clock for display only. A | ||
| 35 | cashout carries a session id and nothing else; the multiplier and payout come | ||
| 36 | from the server's clock at receipt. | ||
| 37 | - Never send the crash point to the client before the round ends. A client that | ||
| 38 | knows it can cash out at `crash - epsilon` every round for a guaranteed win. | ||
| 39 | - The crash point is `max(1.0, (1 - edge) / (1 - u))`; do not "fix" the 1% of | ||
| 40 | rounds that crash at 1.00x. That is where the house edge is charged on an | ||
| 41 | instant cashout, and it is why no cashout lockout is needed. | ||
| 42 | - The crash event is a server-initiated line (`CRASH_BUSTED`), not a reply. | ||
| 43 | Client code must drain the socket on a timer and route pushed lines by | ||
| 44 | prefix instead of assuming the next line answers the last request. | ||
| 45 | - `ServerCore::poll` must be idempotent: it settles the round, removes the | ||
| 46 | session, and pushes once. A second poll must produce nothing. | ||
| 47 | |||
| 33 | ## Client TUI | 48 | ## Client TUI |
| 34 | - `render_lines()` and `render()` must agree. If `render()` uses `\r\n`, | 49 | - `render_lines()` and `render()` must agree. If `render()` uses `\r\n`, |
| 35 | count lines against the same string the cursor will erase. | 50 | count lines against the same string the cursor will erase. |
