houserules/packages/server/src
Joey Yakimowich-Payne 567480a788
test(e2e): unblock the 3 fixme tests in modifier-profiles spec
P6 (source chain in pinned panel):
  Required two server-side changes to make the badge actually meaningful:
  - Add `profile` field to GameStatePayload schema (server emits it,
    client receives it) so multiplayer clients see the room's active
    profile metadata, not just the modifier facts.
  - Make `ChessEngine.activeProfile` mutable via `setActiveProfile()`
    so PredictionManager can sync it from `game.state` snapshots.
  Also wire `modifier-profile.updated` through GameClient + Prediction-
  Manager so hot-swap broadcasts update the engine's profile field
  reactively.
  Fix Lobby.handlePlaySolo's resetToFreshGame to forward the selected
  profile to the new ChessEngine — otherwise the local engine had
  modifier facts (via server reconcile) but no profile metadata,
  breaking source-chain attribution and any other profile-aware UI.

P7 (multiplayer propose → approve → both observe updated):
P8 (multiplayer propose → reject → no updated broadcast):
  Implemented at the WS-protocol level using two parallel raw sockets
  per test (mirrors multiplayer.spec.ts pattern). Critical sequencing:
  - Both sockets opened concurrently via Promise.all so opponent is
    listening BEFORE host's propose arrives at the server (otherwise
    proposal-pending broadcasts to nobody and the test deadlocks).
  - Token must travel at the envelope level, not in payload, for the
    server's reconnect-by-token path to fire (otherwise hits ROOM_FULL
    on the second connection from each player).
  - game.move payload uses algebraic notation strings ('a2', 'a3'), not
    square indices — the protocol schema only accepts strings.
  - Host re-uses original room.create token, opponent re-uses their
    join token. Server's reconnectManager treats both as grace-window
    reconnects since the original WS closed cleanly.

Verification:
  - 1231 unit tests pass (96 files)
  - 58/58 Playwright tests pass in 1.9 min (was 55 + 3 fixme)
  - Total Playwright surface coverage: solo-smoke (7) + multiplayer (2) +
    full-flow (1) + layouts (24) + modifier-profiles (24 — including all
    8 T2-polish tests, 0 fixme).
2026-04-19 13:15:15 -06:00
..
broadcast.test.ts feat(server): add reconnection with 60s grace + snapshot resume (P4.7) 2026-04-16 17:38:26 -06:00
broadcast.ts test(e2e): unblock the 3 fixme tests in modifier-profiles spec 2026-04-19 13:15:15 -06:00
game-session.test.ts feat(server): add authoritative game session per room (P4.5) 2026-04-16 17:17:42 -06:00
game-session.ts feat(server): turn-boundary queue for modifier profile updates 2026-04-19 09:06:15 -06:00
index.ts feat(server): add reconnection with 60s grace + snapshot resume (P4.7) 2026-04-16 17:38:26 -06:00
layouts.test.ts feat(server): layout-aware room.create + resolved layout echoes (Phase C) 2026-04-18 20:01:01 -06:00
layouts.ts feat(server): layout-aware room.create + resolved layout echoes (Phase C) 2026-04-18 20:01:01 -06:00
logger.ts feat(server): scaffold Bun HTTP+WS server with health + logging (P4.1) 2026-04-16 17:03:42 -06:00
logging.test.ts feat(server): add reconnection with 60s grace + snapshot resume (P4.7) 2026-04-16 17:38:26 -06:00
logging.ts feat(server): add reconnection with 60s grace + snapshot resume (P4.7) 2026-04-16 17:38:26 -06:00
middleware.test.ts feat(server): add rate-limit, origin allow-list, message-size cap (P4.4) 2026-04-16 17:11:40 -06:00
middleware.ts feat(server): add rate-limit, origin allow-list, message-size cap (P4.4) 2026-04-16 17:11:40 -06:00
protocol.test.ts feat(server): modifier profile protocol schemas + error codes 2026-04-18 22:43:58 -06:00
protocol.ts test(e2e): unblock the 3 fixme tests in modifier-profiles spec 2026-04-19 13:15:15 -06:00
reconnect.test.ts feat(server): add reconnection with 60s grace + snapshot resume (P4.7) 2026-04-16 17:38:26 -06:00
reconnect.ts feat(server): add reconnection with 60s grace + snapshot resume (P4.7) 2026-04-16 17:38:26 -06:00
room.create-profile.test.ts feat(server): room-create accepts profile 2026-04-18 22:55:24 -06:00
rooms.test.ts feat(server): add room registry with codes + tokens (P4.3) 2026-04-16 17:09:43 -06:00
rooms.ts feat(server): Room.proposalState scaffolding for T3 consent flow 2026-04-19 09:17:22 -06:00
ws.modifier-profile-consent.test.ts test(server): two-player consent flow (T3) 2026-04-19 09:25:48 -06:00
ws.modifier-profile-update.test.ts feat(server): turn-boundary queue for modifier profile updates 2026-04-19 09:06:15 -06:00