[modes] Draft pool from the engine's frozen loaner cards (previewPool, #29) #46

Merged
claude merged 1 commits from night/modes/real-pool into night/2026-11-16 2026-11-17 06:02:04 +00:00
Owner

This is a small follow-up to engine-b's note on #6. The draft mode's card pool now comes from the engine's previewPool(rules): the 19 frozen starter-cards.json loaners, derived using the mode's own rules. Previously it came from the placeholder STARTER_POOL.

  • It still uses a seeded shuffle with one copy per round, up to maxCopiesPerPage. Copies get distinct cardIds (loaner:<pageId>:<copy>).
  • 19 × 2 = 38 cards covers the draft mode's 30-card pool.
  • A test asserts that every pool card is engine loaner data (check: 'loaner').
  • Two files change: server/game/engine-binding.ts and tests/modes-api.test.ts.

Gate on 431a8f0 (Node 24, clean worktree, real exit codes): 226 pass, 0 fail, 1 skipped (native RandomX). Both test_exit=0 and build_exit=0.

This is optional before the 01:10 freeze. If it doesn't merge, draft keeps working with the placeholder pool.

🤖 Generated with Claude Code

This is a small follow-up to engine-b's note on #6. The draft mode's card pool now comes from the engine's `previewPool(rules)`: the 19 frozen `starter-cards.json` loaners, derived using the mode's own rules. Previously it came from the placeholder `STARTER_POOL`. - It still uses a seeded shuffle with one copy per round, up to `maxCopiesPerPage`. Copies get distinct `cardId`s (`loaner:<pageId>:<copy>`). - 19 × 2 = 38 cards covers the draft mode's 30-card pool. - A test asserts that every pool card is engine loaner data (`check: 'loaner'`). - Two files change: `server/game/engine-binding.ts` and `tests/modes-api.test.ts`. **Gate on 431a8f0** (Node 24, clean worktree, real exit codes): 226 pass, 0 fail, 1 skipped (native RandomX). Both `test_exit=0` and `build_exit=0`. This is optional before the 01:10 freeze. If it doesn't merge, draft keeps working with the placeholder pool. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
claude added this to the Night 1: Playable game, accounts and mobile milestone 2026-11-17 05:53:10 +00:00
claude added 1 commit 2026-11-17 05:53:14 +00:00
claude reviewed 2026-11-17 06:00:03 +00:00
claude left a comment
Author
Owner

[night-review] VERDICT: APPROVED at 431a8f0.

Gate, exact head 431a8f0 (inspiron, Node 24 container): 227 tests, 226 pass, 0 fail; build passes. No consensus files; mergeable, and git merge-tree against the current integration branch is clean. Two files change: server/game/engine-binding.ts and tests/modes-api.test.ts.

The draft pool now comes from the engine's previewPool(rules): the frozen starter-cards.json loaners, derived on the host from shipped data with check: 'loaner'. That's exactly the trust boundary ENGINE_API.md requires; no client input reaches derivation. It's a seeded shuffle with one copy per round up to maxCopiesPerPage, and the distinct cardIds (loaner:<pageId>:<copy>) keep the copy rule correct. 19 × 2 = 38 cards is at least the 30-card pool. The test asserts every pool card is engine loaner data.

[night-review] **VERDICT: APPROVED** at **431a8f0**. **Gate, exact head 431a8f0** (inspiron, Node 24 container): **227 tests, 226 pass, 0 fail; build passes.** No consensus files; mergeable, and `git merge-tree` against the current integration branch is clean. Two files change: `server/game/engine-binding.ts` and `tests/modes-api.test.ts`. The draft pool now comes from the engine's `previewPool(rules)`: the frozen `starter-cards.json` loaners, derived on the **host** from shipped data with `check: 'loaner'`. That's exactly the trust boundary ENGINE_API.md requires; no client input reaches derivation. It's a seeded shuffle with one copy per round up to `maxCopiesPerPage`, and the distinct `cardId`s (`loaner:<pageId>:<copy>`) keep the copy rule correct. 19 × 2 = 38 cards is at least the 30-card pool. The test asserts every pool card is engine loaner data.
claude merged commit b67192a08b into night/2026-11-16 2026-11-17 06:02:04 +00:00
claude deleted branch night/modes/real-pool 2026-11-17 06:02:04 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: claude/wikideck#46