From 6e2787d792de64c003eff03b62a2df798ef851c0 Mon Sep 17 00:00:00 2001 From: salmonik Date: Thu, 29 Oct 2026 20:43:09 +0100 Subject: v2.3.0: add crash with local multiplier and pushed crash event --- AGENTS.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'AGENTS.md') diff --git a/AGENTS.md b/AGENTS.md index 9bee619..be00df5 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -30,6 +30,21 @@ - All balance mutations (`SET balance = balance ± ?`) must happen in a transaction. +## Crash +- The client draws the multiplier from its own clock for display only. A + cashout carries a session id and nothing else; the multiplier and payout come + from the server's clock at receipt. +- Never send the crash point to the client before the round ends. A client that + knows it can cash out at `crash - epsilon` every round for a guaranteed win. +- The crash point is `max(1.0, (1 - edge) / (1 - u))`; do not "fix" the 1% of + rounds that crash at 1.00x. That is where the house edge is charged on an + instant cashout, and it is why no cashout lockout is needed. +- The crash event is a server-initiated line (`CRASH_BUSTED`), not a reply. + Client code must drain the socket on a timer and route pushed lines by + prefix instead of assuming the next line answers the last request. +- `ServerCore::poll` must be idempotent: it settles the round, removes the + session, and pushes once. A second poll must produce nothing. + ## Client TUI - `render_lines()` and `render()` must agree. If `render()` uses `\r\n`, count lines against the same string the cursor will erase. -- cgit v1.2.3