Skip to content

feat: add spectator coach - #43

Open
avatarneil wants to merge 1 commit into
mainfrom
neil/spectator-coach
Open

avatarneil wants to merge 1 commit into
mainfrom
neil/spectator-coach

Conversation

@avatarneil

Copy link
Copy Markdown
Owner

Summary

Spectators can now opt into live coaching on public matches without gaining any control over the game board. Followed public AI match sequences also have an observable continuation path, and the watch lobby makes followed or recently watched matches easier to rejoin when automatic continuation is not available.

What Changed

  • Live watch pages now include an off-by-default coach toggle with legal move candidates, best-move highlighting, and concise explanations for recent placements.
  • Coaching analysis runs client-side from public board state and is cached by board signature, avoiding extra server analysis work for spectators.
  • Public room lineage now links successor AI rooms to the previous public room so followers can continue watching a match sequence.
  • Public room responses expose safe follower metadata while keeping player, watcher, and follower tokens out of the public payload.
  • The watch lobby now prioritizes and badges followed or recently watched rooms.

Test Plan

  • npm run lint passes with existing unrelated warnings in AI/remotion files.
  • npx oxfmt --check docs/plans/2026-05-15-spectator-coach-plan.md 'src/app/api/rooms/[id]/follow/route.ts' 'src/app/api/rooms/[id]/state/route.ts' src/app/api/rooms/create-ai/route.ts src/app/api/rooms/create/route.ts src/app/api/rooms/public/route.ts src/app/play/page.tsx 'src/app/watch/[id]/page.tsx' src/app/watch/page.tsx src/lib/kv.ts src/lib/spectator.ts src/lib/spectator-coach.ts
  • git diff --check
  • npx tsx smoke test for spectator coach removal explanations.
  • npx tsx smoke test for public room follower metadata without token leakage.
  • Browser smoke test on http://localhost:3010/watch and /watch/ABC123: routes compile; local room data is blocked by missing Vercel KV environment variables.

Notes

  • npm run build is blocked locally before Next.js runs because this machine's Homebrew Rust toolchain lacks the wasm32-unknown-unknown target and rustup is not installed.
  • Full npx tsc --noEmit is blocked by the same missing generated wasm/pkg/knucklebones_ai package.
  • Local live-room API testing is blocked by missing KV_REST_API_URL and KV_REST_API_TOKEN.

Compound Engineering
GPT-5

@vercel

vercel Bot commented May 17, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
knucklebones Error Error May 17, 2026 11:13pm

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