Files
Dune/docs/DRAW_PILES.md
T
Quintine 14a7800fe9 Show live Treachery and Spice draw-pile counts
Add server-derived physical draw counts above the board after setup begins.
Counts exclude hands, auction pools, faction caches and discards; the client
receives only two numbers, without deck identities or order. Lobby counts are
absent, zero remains explicit and existing refill/custody rules are unchanged.
An internal guide explains pile boundaries, empty/refill behavior, first-turn
worm return and existing authorized inspection. Nexus counts remain separate.

Independent review found no material issue. Six focused cases cover genuine
Basic setup, every viewer, private-field exclusion, JSON/input immutability,
actual auction draws and refill, physical custody, Spice refill with Thumper
annotations excluded, skipped worm return and connected busy/empty/lobby UI.
The initial refill assertion assumed a single card; it was corrected to account
for a legal randomized chain of worms before a territory. The original broad check caught seven view-equality failures in privacy
fixtures that also changed the now-public deck count. Their four test files now
vary hidden allocations/identities at fixed public counts, retain whole-view
assertions and check physical custody. The Sapho fixture now returns its
swapped card rather than losing it. A reviewed CHOAM correction keeps its owner
empty during donor1to2 by staging a hidden discard; the original oracle test
remains intact. All70 affected focused tests pass.

Types, lint, all 4990 offline tests, production build and 49 HTTP tests
passed on stable source. Browser QA reused the existing three-human Basic Nexus
without any game action. Treachery29 and Spice19 matched saved physical arrays;
390px layout fit within339px without internal overflow, with16px body/14px labels.
The internal guide worked by click and Enter, and Back/refresh restored the same
counts. Normal viewport restored and preview retained. Screenshot capture timed
out; full visual, screen-reader,200% text and combined-game acceptance stay open.

All 1499 opening rooms, 3171 seats and auxiliary rows are
unchanged. SQLite integrity and foreign keys pass; isolated HTTP rooms are new.
Healthy server reused without restart, migration, reset or recurring automation.
Full AI refinement remains deferred and no mode/publication gate was opened.

Private evidence: 20260921-deck-status.
Verified source tree: 091be8f49f9b637b9a79da43271cbffdff5cf8c9f653484afa7041c71af88e98
2026-09-21 11:36:25 +10:00

3.0 KiB

Live draw-pile counts

Connected prototype, 21 September 2026. This completes the missing ordinary draw-count display; full component, rules-mode and visual acceptance remain open.

Behavior and boundaries

viewGame now projects drawPiles: { treachery, spice } from the lengths of the authoritative draw arrays, or null while the lobby is uninitialized. The table displays both counts above the board with an internal guide. Counts refresh with the existing saved-table response and require no decision, command or schema. Finished games retain their actual counts.

The numbers exclude hands, auction pools, the Richese cache, discards and other separate holdings. Auction remaining already counts its unsold pool including the current lot; Nexus already exposes its own deck/discard counts. No inferred Storm deck is introduced: that runtime selects from six values without a saved physical draw array. No private identities, order, peeks or discard faces are added to the response.

Zero is a real empty draw pile. Existing Treachery and Spice refill logic remains authoritative; viewing never triggers a shuffle. First-turn worms set aside are outside the pile until returned, and Thumper annotations are not physical Spice Cards to recycle. Optional cards contribute only when physically in a draw pile. The feature does not change any of these rules or the existing card custody.

The existing Nullentropy contract records the GF9 CHOAM & Richese rulebook's discard privacy restriction and the paid owner's search entitlement. Counts grant no new discard inspection. Public Spice tops, owned hands and entitled peeks keep their existing inspectors. Generic discard browsing and hand sorting/filtering are not supplied by this checkpoint.

Verification

  • Genuine three-player Basic setup checks undealt and dealt counts, all viewers, private-field exclusion, input immutability and JSON restoration.
  • Controlled Charity boundaries use real ready/auction draws, including an exhausted Treachery pile, and reconcile physical auction/deck identities.
  • A later Storm/Spice boundary exercises real Spice refill with an excluded Thumper annotation. A first-turn draw checks a skipped worm leaving and rejoining the counted pile.
  • Full-table rendering connects the display while controls are busy. Empty, single-card and lobby states have focused rendering checks.
  • Existing CHOAM market, Ecaz alliance, Richese Ambassador and Sapho privacy fixtures now keep public draw counts fixed while varying hidden allocations or identities. Complete opposing-view equality assertions remain intact, with physical custody checks. Moving a card out of a public draw pile is not an otherwise-identical public state.

Run npm test -- draw-piles. Independent review, browser checks, final type/lint/offline/build/HTTP checks, saved-game preservation and Git delivery are recorded in the private source-bound checkpoint. Focused fixtures are not complete-game or expansion-combination certification. AI strategy and release gates are unchanged.