Scribble lab rk#113
Open
rohitkaushik-214 wants to merge 10 commits into
Open
Conversation
Specify create/join room flow, host assignment, code validation, room isolation, ~2s lobby polling, and host-controlled start. Clarifications: heartbeat-timeout leave detection, host-leave closes room, 4-char uppercase codes, 8-player cap. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Phase 0/1 artifacts: research (host model, lazy heartbeat pruning, host-leave closure, name disambiguation, start gating), data-model, rooms REST contract (incl. POST /rooms/:code/start), and two-browser quickstart. Update CLAUDE.md agent context to reference the plan. Constitution Check passes (in-memory, polling, no new deps). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Backend: host assignment, name disambiguation, capacity (8), lazy heartbeat presence pruning with host-leave/empty-room closure, pollRoom heartbeat read, POST /rooms/:code/start (host-only, >=2 players), late-join rejection for started rooms. Frontend: ApiError carrying HTTP status, ~2s lobby polling, host badge, host-only gated Start, navigate to /game on "playing", eject on room close (404). Empty-code guard and specific join error messages. Tests: backend 4->15, frontend 2->4; both builds green. API smoke test validates the full create/join/start/reject flow. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Spec, clarifications, plan, research, data-model, contracts, quickstart, and tasks for the Game Start / Drawer Selection / Secret Word Reveal feature. Updates CLAUDE.md SPECKIT pointer and .specify/feature.json. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…1-US3) - Round model + deterministic word selection (selectWord, seed = code+round) - startGame creates round 1 with host as drawer - viewer-aware snapshot: full word to drawer only, blanks to guessers - reject empty/whitespace player names with a clear message (trim preserved) - GamePage shows drawer badge, viewer role, and word vs blanks - tests: round/drawer, word secrecy, determinism, name trimming Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Spec, clarifications, plan, research, data-model, contracts, quickstart, and tasks for the active-round guess/score feature. Updates the agent-context pointer to the 003 plan. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add POST /rooms/:code/guess: trimmed, case-insensitive guesses; empty rejected (400), drawer blocked (403), inactive round (409). Correct guess scores 100 once per round (FR-007), incorrect 0; scores reset to 0 at round start. Guess history is appended on the round and synced via the existing ~2s GET poll (adds the missing GamePage poll loop). Correct guesses are server-masked in the feed so the word never leaks (FR-011/SC-008); the round does not end on a correct guess (FR-016). Wire up GuessForm/Scoreboard/ ResultPanel and add a drawer-local canvas (draw + clear, not synced). Backend 34 tests, frontend 5 tests, both builds green. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
All 12 quickstart steps verified manually across two browsers: US1 guess validation/scoring, US2 cross-browser sync within ~2s + masked correct guess, US3 drawer-local canvas, and 001/002 regression checks. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add the end-of-round result state and host restart (feature 004, tasks T001-T026): - RoomStatus gains "ended"; new host-only POST /rooms/:code/end (playing -> ended) and POST /rooms/:code/restart (ended -> lobby, idempotent: round cleared, scores reset to 0, players + host preserved) - toRoundSnapshot reveals the word + full guess history to everyone only when "ended"; playing-state masking (002/003) unchanged (regression-safe) - Frontend: ResultsPage at /results (reuses Scoreboard/ResultPanel), host-only End Round (GamePage) + Restart (ResultsPage), poll-driven navigation; api + state store methods endRound/restartGame - Tests: +7 backend (end/restart/reveal), +2 frontend (api shapes) - Spec artifacts under specs/004-round-result-restart/ Validated: backend+frontend builds, 41 backend + 7 frontend tests, end-to-end API smoke test, and manual two-browser acceptance. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements the full Scribble game loop across four spec-driven feature increments
(in-memory store, REST polling ~2s, no WebSockets/database, no new dependencies):
assignment, presence heartbeat & stale-player pruning, room closes when empty or
the host leaves; lobby synced via
GET /rooms/:codepolling.the host becomes the drawer; a deterministic secret word is selected and revealed
only to the drawer (guessers see masked blanks + length).
POST /rooms/:code/guess(trimmed, case-insensitive, empty rejected); correct =100 points once per round; shared guess history synced to all players with correct
guesses server-masked so the word never leaks; drawer-local canvas (draw/clear).
(
POST /rooms/:code/end→ newendedstatus) revealing the word, final scores,and full guess history to everyone; host restarts (
POST /rooms/:code/restart)back to a fresh lobby with players preserved and scores reset (idempotent).
Each feature follows the spec-kit loop (specify → clarify → plan → tasks →
implement → validate) with artifacts under
specs/. Validated by backend +frontend builds, the full test suite (41 backend + 7 frontend), and manual
two-browser acceptance per each feature's quickstart.
Contributor