Files
weirsoe-party-protocol/docs/ISSUE-300-SCOREBOARD-NEXT-ROUND-BOOTSTRAP-INVARIANT.md
DEV-bot 8a8ac54a73
All checks were successful
CI / test-and-quality (push) Successful in 2m45s
fix(gameplay): harden scoreboard next-round bootstrap refs #300
2026-03-16 12:56:58 +00:00

1.1 KiB

Issue #300 — scoreboard -> next-round bootstrap invariant

Refs: #300, parent #287

Hardened invariant

POST /lobby/sessions/{code}/rounds/next now treats scoreboard -> next round as a deterministic backend-owned bootstrap boundary:

  • stale pre-created RoundConfig / RoundQuestion rows for the next round are deleted before bootstrap
  • dependent lies / guesses for that stale next-round question are cleared with it
  • current_round increments exactly once when a fresh next-round question can be selected
  • the response makes reset semantics explicit with:
    • round_bootstrap.active_submissions = { lies: 0, guesses: 0 }
    • round_question.answers = []
    • submission_progress = { lies_submitted: 0, guesses_submitted: 0, players_expected: N }
    • reveal = null
    • leaderboard = null

Regression coverage

Targeted Django tests lock:

  1. scoreboard -> next-round bootstrap returns explicit reset semantics
  2. stale future round artifacts are removed before the next round is exposed
  3. two consecutive round bootstraps do not leak prior-round state into the next round