houserules/packages/chess/e2e
Joey Yakimowich-Payne 4819676d84
fix(net): sync customModifiers to late-joiners + reconnects in game.state
T3 audit gap 2 (CRITICAL). The server's Room kept registered custom
modifier descriptors in a per-room Map but the game.state snapshot
carried no field for them. Impact:
  - Client A registers 'custom:shield' → server broadcasts
    custom-modifier.registered → A + any currently-connected B see it.
  - Client C joins AFTER the registration → receives game.state →
    has no knowledge of 'custom:shield'.
  - Client C's engine applies a profile with kind='custom:shield' →
    registry-dispatch fallback silently no-ops → apparent cosmetic
    modifier mismatch between A/B and C.

Symmetric fix across the wire:
  - GameStatePayloadSchema (server + client types) gains an optional
    customModifiers: CustomModifierDescriptorWire[] field.
  - Both emit sites in broadcast.ts (late-joiner path +
    reconnect-with-buffered-deltas path) include the room's registered
    descriptors.
  - PredictionManager.applyFullState mirrors received descriptors
    onto the fresh engine's customModifiers registry before handing
    control to the UI. Unknown descriptor shapes are accepted as-is
    (the wire-shape cast at the single boundary bridges the Zod v3/v4
    type split same as the custom-modifier.registered subscriber).

E2E regression guard (Oracle Q4.1 recommendation): new scenario
'late-joiner + reconnect receive registered custom modifiers in
game.state'. Host creates + registers, opponent joins AFTER
registration, asserts opponent's game.state carries the descriptor.
Would have caught the pre-fix behaviour as a test failure instead of
a manual audit find.

1393 unit + 19/19 custom-modifiers e2e green.
2026-04-20 16:58:48 -06:00
..
custom-modifiers.spec.ts fix(net): sync customModifiers to late-joiners + reconnects in game.state 2026-04-20 16:58:48 -06:00
full-flow.spec.d.ts Preset refactors for HP 2026-04-17 18:59:11 -06:00
full-flow.spec.d.ts.map Preset refactors for HP 2026-04-17 18:59:11 -06:00
full-flow.spec.js Preset refactors for HP 2026-04-17 18:59:11 -06:00
full-flow.spec.js.map Preset refactors for HP 2026-04-17 18:59:11 -06:00
full-flow.spec.ts test(chess): e2e full-flow scenario; tag Phase 3 (P3.15) 2026-04-16 16:55:28 -06:00
layouts.spec.ts feat(chess): live-sync FEN textarea with board edits in the editor 2026-04-18 20:43:11 -06:00
modifier-profiles.spec.ts feat(ui): hide modifier tooltip on pieces with no active modifiers 2026-04-19 16:58:04 -06:00
multiplayer.spec.ts feat(chess): drop-target hover indicator + personalized turn banner 2026-04-17 14:41:01 -06:00
solo-smoke.spec.ts fix(lobby): clear stale MP creds on Play Solo to avoid blank-screen trap 2026-04-19 17:03:21 -06:00