Skip to content

Scribble lab rk#113

Open
rohitkaushik-214 wants to merge 10 commits into
everest-engineering:mainfrom
rohitkaushik-214:scribble-lab-rk
Open

Scribble lab rk#113
rohitkaushik-214 wants to merge 10 commits into
everest-engineering:mainfrom
rohitkaushik-214:scribble-lab-rk

Conversation

@rohitkaushik-214

Copy link
Copy Markdown

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):

  • 001 — Room & Lobby Management: create/join rooms with a 4-char code, host
    assignment, presence heartbeat & stale-player pruning, room closes when empty or
    the host leaves; lobby synced via GET /rooms/:code polling.
  • 002 — Game Start, Drawer & Word Reveal: host starts the game (≥2 players);
    the host becomes the drawer; a deterministic secret word is selected and revealed
    only to the drawer (guessers see masked blanks + length).
  • 003 — Active Round Drawing, Guessing & Scoring: guessers submit via
    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).
  • 004 — Round Result & Host Restart: host ends the round
    (POST /rooms/:code/end → new ended status) 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

rohitkaushik-214 and others added 10 commits June 7, 2026 17:21
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant