Files
Wizard/wizard_server
marvinandClaude Opus 5.5 fde8e2fb2e Always forbid bids that add up to the cards in hand
The sum of all bids may never equal the number of cards each player
holds in the round; the last bidder has to adjust their bid. This was an
optional "not equal" lobby setting and is now a fixed rule of the game
engine, so it applies to humans, AI players and training alike.

- Remove GameOptions.not_equal, the set_options field, the lobby toggle
  and the --not-equal training flag
- Explain the rule in the lobby and show the blocked bid while bidding
- Drop the option from the AI observation encoding
- Tests check that no round ends with bids summing to the cards in hand

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-27 10:15:25 +02:00
..
2026-09-27 09:52:00 +02:00
2026-09-27 09:52:00 +02:00
2026-09-27 09:52:00 +02:00
2026-09-27 09:52:00 +02:00
2026-09-27 09:52:00 +02:00

wizard_server

FastAPI game server. It manages sessions, lobbies and games, and talks to the AI service.

  • game_logic/ — the standalone rules engine (pip install ./game_logic, see its README).
  • app/main.py — routes: GET /health, WS /ws (browsers), WS /internal/ai (AI service, refused when the request came through the reverse proxy)
  • app/protocol.py — client message schema
  • app/service.py — dispatches client messages, reconnects sessions, cleanup
  • app/lobby.py — lobbies, seats, host actions, running games and AI turns
  • app/ai_bridge.py — request/response protocol with the AI service, random-move fallback
  • app/sessions.py — sessions (token based, survive reloads) and ordered websocket sending

Configuration (environment): AI_SHARED_SECRET, AI_DECISION_TIMEOUT (5s), AI_MOVE_DELAY (0.8s), TRICK_PAUSE (1.8s), SESSION_TTL (1800s), MAX_LOBBIES (1000), ALLOWED_ORIGINS, LOG_LEVEL.

pip install -r requirements-dev.txt
uvicorn app.main:app --reload
pytest