Skip to content

cardkit-server: GameDescriptor.bot() takes the lobby config - #21

Merged
rotundtapir merged 1 commit into
mainfrom
feat/bot-takes-config
Jul 29, 2026
Merged

rotundtapir merged 1 commit into
mainfrom
feat/bot-takes-config

Conversation

@rotundtapir

Copy link
Copy Markdown
Owner

A gap in the seam, found while writing euchre's descriptor: EuchreBot(benny: Boolean) needs to know whether the Benny joker house rule is on, and bot() had no way to tell it. A bot built for the wrong ruleset does not fail loudly — it misplays, which is the worst kind of wrong for something that covers a disconnected player's hand.

bot(config: C) closes it. The room builds the bot from the config it was created with; only the timeouts can change afterwards (RoomCommand.Configure), never the house rules, so the bot cannot go stale.

Small API change with one call site per game — 500's is a single line, updated in 500#36.

🤖 Generated with Claude Code

https://claude.ai/code/session_019EH6XkA2oEhv4YnMXt8hbJ

Found while writing euchre's descriptor: EuchreBot(benny: Boolean) needs to know
whether the Benny joker house rule is on, and bot() had no way to tell it. A bot
built for the wrong ruleset does not fail loudly — it misplays, which is the
worst kind of wrong for something that covers a disconnected player's hand.

The room builds its bot from the config it was created with. Only the timeouts
can change afterwards (RoomCommand.Configure), never the house rules, so the bot
cannot go stale.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019EH6XkA2oEhv4YnMXt8hbJ
Signed-off-by: rotund_tapir <rotund_tapir@protonmail.com>

@rotundtapir rotundtapir left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed: right fix at the cheap moment (module is hours old, consumers still in-flight — same logic as the firstSeedWhere rename). Bot built from the room's creation config is correct since RoomCommand.Configure can only touch timeouts, and a restored room reconstructs from its snapshot's config, so the bot can't go stale there either. Single commit authored/pushed by rotundtapir. Merging on green; 500's descriptor picks up the one-line signature in #36 or its follow-up, author's sequencing choice.

@rotundtapir
rotundtapir merged commit 808f5c2 into main Jul 29, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant