The Peanut Gallery: nameless read-only spectators, counted but never named

Watch a room by code alone: no seat, no ledger line, no voice in chat.
Views and events are redacted for the empty viewer id (which no seat can
hold), so hands, wards, ambushes and boobytrap truths stay dark. The
table sees only a head count.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Eric Wagoner
2026-08-21 10:41:33 -04:00
co-authored by Claude Fable 5
parent e30f3f0903
commit 3445d12206
4 changed files with 142 additions and 18 deletions
+6
View File
@@ -361,6 +361,12 @@ export function viewForPlayer(room: Room, playerId: PlayerId): GameView | null {
return room.state ? viewFor(room.state, playerId) : null;
}
/** The Peanut Gallery's viewer id: the empty name can never hold a seat
* (joins reject blank names), so a view built for it shows public knowledge
* only — no hand, no ward, no ambushes, no boobytrap truths — and event
* redaction drops everything marked visibleTo a player. */
export const SPECTATOR: PlayerId = "";
export interface CatchUpStep {
seq: number;
actor: PlayerId;