summaryrefslogtreecommitdiffstats
path: root/AGENTS.md
diff options
context:
space:
mode:
authorsalmonik <salmonik@tuta.io>2026-10-29 20:43:09 +0100
committersalmonik <salmonik@tuta.io>2026-10-29 20:43:09 +0100
commit6e2787d792de64c003eff03b62a2df798ef851c0 (patch)
tree0e9bf97b2f71df5fb9eb00d5195d32b8326886ff /AGENTS.md
parentv2.2.1: forfeit blackjack bets when leaving or disconnecting (diff)
downloadzagan-bet-6e2787d792de64c003eff03b62a2df798ef851c0.tar.gz
zagan-bet-6e2787d792de64c003eff03b62a2df798ef851c0.zip
v2.3.0: add crash with local multiplier and pushed crash event
Diffstat (limited to '')
-rw-r--r--AGENTS.md15
1 files changed, 15 insertions, 0 deletions
diff --git a/AGENTS.md b/AGENTS.md
index 9bee619..be00df5 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -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.