[READY][Gameplay] #287-D Canonical phase contract parity between session-detail and phase transition responses #308

Open
opened 2026-03-16 19:33:44 +01:00 by architecture-bot · 0 comments

Parent epic: #287

Problem statement

The canonical round flow now exists, but the contract is still spread across multiple response shapes (session, phase_view_model, round_question, reveal, scoreboard, phase_transition). We need one narrow follow-up task that verifies and hardens parity between GET /lobby/sessions/<code> and the write endpoints that advance the game.

Expected value / why now

This reduces desync risk between frontend polling, transition responses, and realtime updates. It also makes future UI work cheaper because the client can trust a stable server contract instead of endpoint-specific quirks.

Acceptance criteria

  • Document and enforce the minimum canonical phase contract returned by session-detail and by the write endpoints that advance phase.
  • At minimum, verify parity for: session.status, phase_view_model.current_phase, round_question.id, reveal/scoreboard presence, and host/player readiness flags.
  • Add targeted tests proving the contract remains internally consistent at lie, guess, reveal, scoreboard, and finished.
  • Any mismatch found must be fixed in backend responses rather than patched only in UI.
  • PR references #287 and clearly states which contract fields are canonical for clients.

Scope boundary

  • Not a full frontend rewrite.
  • Not websocket redesign by itself.
  • Not localisation/content polish unless directly touched by the response contract.
Parent epic: #287 ## Problem statement The canonical round flow now exists, but the contract is still spread across multiple response shapes (`session`, `phase_view_model`, `round_question`, `reveal`, `scoreboard`, `phase_transition`). We need one narrow follow-up task that verifies and hardens parity between `GET /lobby/sessions/<code>` and the write endpoints that advance the game. ## Expected value / why now This reduces desync risk between frontend polling, transition responses, and realtime updates. It also makes future UI work cheaper because the client can trust a stable server contract instead of endpoint-specific quirks. ## Acceptance criteria - Document and enforce the minimum canonical phase contract returned by session-detail and by the write endpoints that advance phase. - At minimum, verify parity for: `session.status`, `phase_view_model.current_phase`, `round_question.id`, reveal/scoreboard presence, and host/player readiness flags. - Add targeted tests proving the contract remains internally consistent at lie, guess, reveal, scoreboard, and finished. - Any mismatch found must be fixed in backend responses rather than patched only in UI. - PR references #287 and clearly states which contract fields are canonical for clients. ## Scope boundary - Not a full frontend rewrite. - Not websocket redesign by itself. - Not localisation/content polish unless directly touched by the response contract.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: wpp/weirsoe-party-protocol#308