A new table type, "review" (レビュー付きCPU戦), can only be created by
admins. Only the creator and CPUs sit there: friends cannot join, and the
table is hidden from non-admin lobbies. After every hand a review opens,
and the next hand waits until the creator presses "次のハンドへ".
- Preflop: shows which color of the registered hand range the hole cards
are and whether the action followed it. With no entrant before you,
open with the color for the number of players still to act; facing an
entrant, estimate their range from their position, call one color
above it and raise two above. Purple ranks just below white (SB only).
- Flop onward: equity vs ranges estimated from those colors (narrowed by
later bets/calls) gives a rough EV per option. The score is the EV lost
against the best option, relative to the pot. It is a guide, not GTO.
- Also: pot-odds call check, all-in equity and luck-adjusted P&L,
VPIP/PFR/3bet/Cbet/WTSD/W$SD/AF, per-color and per-position compliance,
habits to watch, worst-5 hands, a P&L chart and a step-by-step replay
on the admin-only /review page.
Hand now logs every action for the review. The range data moves to
admin/range-data.js, shared by the range page and the server. Reviews are
saved under data/reviews/ (newest 50 sessions). Admin scripts and CSS are
no longer cached for a day, so updates show up immediately.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Each CPU now thinks with one of four engines, each backed by a different
published library (pinned versions):
- montecarlo (@pokertools/evaluator): the existing balanced Monte Carlo
equity player, moved to server/bots/montecarlo.js.
- calculator (poker-calculations): the library's decideAction over the
table state; push/fold below 12BB via its jam breakeven equity.
Skipped automatically if the native addon cannot load.
- range (poker-utils): tight player; preflop by hand-strength percentile,
postflop equity vs an estimated opponent range, bluffs only when
alpha/bluffEV say they pay.
- madehand (pokersolver): loose, sticky player that only looks at the
made hand and draws.
server/ai.js assigns a mix of engines per table (makeStyles), falls back
to the Monte Carlo engine on errors, and legalizes every decision.
The engine and its parameters stay server-side; players cannot tell
which library a CPU uses. Tests cover every engine and the no-leak rule.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Replace the hand-rolled betting rules, side pots, showdown and hand
evaluator with the published @pokertools/engine and @pokertools/evaluator
libraries (MIT, pinned to 2.1.0).
- server/hand.js now wraps a PokerEngine per hand: it maps seats,
mirrors stacks, staggers the all-in runout, and pays host-chosen
winners on cash-only tables.
- server/cards.js and server/ai.js use the library evaluator.
- Out-of-turn folds go through the engine's stand; all-in hands stay
live when the player leaves; uncalled bets return to a leaver.
- The engine refuses some check-able folds that would leave a side pot
without eligible players; those now return a message (or check for
a leaving player) instead of crashing.
- BB must be greater than SB (engine requirement); Node >= 24.
- Tests rig cards via engine snapshots and cover the new edge cases.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- When the last human presses leave on a CPU table (even mid-hand), the table
is deleted right away instead of lingering with CPUs only; friends / cash-only
tables keep the existing 30-minute idle cleanup
- Spectators still watching get a "テーブルが終了しました" notice, and the lobby
updates immediately
- Don't show the "接続が切れました" banner when the page disconnects on purpose
(closed or missing table)
- Test for the close condition; README notes the behavior
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Create screen: choose キャッシュオンリー (real cards, chips only), 友人戦
(server deals and settles) or CPU戦 (友人戦 plus 1–8 CPU players); replaces
the card toggle. The lobby shows each table's type
- Poker AI written from scratch (server/ai.js, no libraries): fast 7-card
evaluator (checked against bestHand), Monte Carlo equity, and decisions from
hand rank, pot odds, raise count, opponents and a per-CPU style (aggression,
bluff rate); continuation bets via the last aggressor. It never sees other
players' hole cards
- CPU seats: think time of 0.7–1.8s (faster when no human is left in the hand),
automatic rebuy, never the host, no new hand unless a human is playing,
re-think after pause
- Play UI: robot avatars and a "考えています…" status for CPU turns
- Tests for the evaluator, equity, legality of AI actions and CPU tables
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- New "カードを配る" switch on the create-table screen (default off); the lobby
shows "カードあり" for tables that use it
- Card mode (server/cards.js restored): crypto-shuffled deck kept server-side,
hole cards sent only to their owner until showdown/all-in reveal, board dealt
per street with burns, all-in runout on a timer (frozen while paused)
- Showdown is evaluated and every pot (incl. side pots, split pots) is paid out
automatically; host winner selection is only used when card mode is off
- Play UI: board, hole cards, own cards in the action bar, hand names, winning
cards highlighted; layout tuned for 7+ seats and short screens
- Playing-card styles use .pcard so they don't clash with the existing .card panel
- Tests for hand evaluation, card privacy, runout, side pots, ties and random play
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Showdown winners can now be chosen only by the table host (others see
"ホストが勝者を選んでいます"); if the host leaves, the next host does it
- START / pause moved into the header to the right of the table name
(pause is an icon button), freeing the row they used to occupy
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Optional ADMIN_KEY (6 digits, distinct from ACCESS_KEY): entering it on the
key screen signs in as admin (role-specific HMAC cookie; member cookies
stay valid). Logged-in members can open /key?admin to enter it.
- /range (range chart + color/category quiz, ported from poker-hand and
restyled to the site design) and its files under admin/ are served only to
admins; everyone else gets 404. Card images cached privately for a day.
- Lobby shows a link to the page for admins only (GET /api/me).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Remove the deck, hole cards, board, hand evaluator and reveal logic
(cards are dealt physically; the site only tracks bets, pots and stacks)
- Showdown now waits for a winner per pot (main/side), chosen by a player
still in the hand or the host; multiple winners split the pot
- All-in with no further betting goes straight to showdown
- Remove the 30s action clock / auto sit-out (everyone is at the same table)
- UI: winner picker panel (main winner auto-fills side pots), compact table
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Hand engine (server/hand.js): crypto-shuffled deck kept server-side,
blinds (heads-up button = SB), min-raise rules incl. incomplete all-in,
uncalled bet refunds, side pots, split pots, all-in runout
- Hand evaluator (server/cards.js) and node:test suite (npm test)
- Table flow: hands auto-continue after host START, 30s action clock
(timeout = check/fold + sit out), sit out / sit in, rebuy, mid-hand leave
folds and keeps the seat reserved until the hand ends, pause freezes all clocks
- Only each player's own hole cards are sent until a showdown/runout reveal;
all actions validated server-side
- Play UI: board, hole cards, bets, action tags, turn timer, raise panel with
presets, showdown results with winning cards highlighted, compact 7+ layout
- Remove the host crown and the temporary "next phase" control
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>