docs: full-project audit + phased hardening fix plan - #25
Merged
Conversation
Audit of main @ 5caa420 across game, phone, relay/protocol, deploy, docs, and .claude tooling. All 156 tests / typecheck / build green and a live two-client co-op round-trip passes — but the audit found: - P0: two remotely triggerable relay process crashes (null frame, missing ws error listeners) - P1: freeze re-cast truncates the freeze window; every particle burst renders off-screen (emitter-local coords passed twice); net-handler leaks that duplicate casts and corrupt M10 telemetry; both clients blind to their own socket death; no relay heartbeat (ghost phone blocks rejoin); protocol-guard hook auto-approves protocol edits; ws 8.20.0 known advisories; smoke:relay orphans its relay child and hangs piped callers; repo playwright MCP broken in cloud sessions - P2/P3: post-win casts, win-card depth, README/CLAUDE.md/session-start drift (docs describe M2/M4 while M11 shipped), tests never typechecked, sub-44px touch targets, and ~30 more, each with file:line evidence Fix plan: six independently shippable phases (relay crash-proofing → co-op disconnect survival → game-feel fixes → docs truth pass → test/CI spine → deploy hardening), with per-phase verification gates and the six decisions that need the owner. Adds one BACKLOG Open item linking the audit. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UEAWk5o1W73GYBS4ahvobK
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.
What & why
You asked for everything that needs fixing or improving, plus a plan to fix all of it. This PR adds
docs/AUDIT-2026-07-09.md— a full-project audit with ~60 findings (each withfile:lineevidence and effort sizing) and a six-phase fix plan (~5–7 focused days), plus one BACKLOG Open item linking it.How it was audited
Not just static reading — the highest-severity claims were reproduced live in this session:
?test=1bridge (win, unlock, schema-v2 telemetry, reload durability)power-castwithsolveMs→ planet-complete → +3 stardust toast)npm audit: 7 advisories (2 critical / 3 high), all fixable in-rangesmoke:relayleaks an orphaned relay process and hangs piped callers (reproduced twice, root-caused)chromechannel absent — hit live)Headline findings
nullframe kills the process (msg.typeonnulloutside the try/catch); nows'error'listeners, so a routine cellular RST can also kill it.protocol-boundary-guard.shemits"permissionDecision":"allow"and thereby auto-approves edits to the one file it exists to guard;ws@8.20.0carries known DoS/memory-disclosure advisories.Level.ts;session-start.mdsays "M4 in flight… don't add automated tests yet" against 156 sanctioned tests;tsconfignever typechecks the test files.Plus a "what's genuinely solid" section — the persistence layer, pure-logic layering, exhaustiveness engineering, and the allowlist relay design hold up well and the plan deliberately leaves them alone.
The plan (in the doc)
npm audit fix, hook fix, smoke-relay orphan fix, MCP browser pin (~½ day)peer-disconnectedprotocol message, room-registry extraction + tests (1–2 days)Each phase is independently shippable with a named verification gate. Six items need your decision (CI, Prettier, jump feel,
solveMssemantics, PROJECT_GUIDE regen, Docker slim approach) — everything else can proceed without input. Coordination note: land or rebase around PR #23 (M12 generator spike) — phases 2/5 touch neighboring files.🤖 Generated with Claude Code
https://claude.ai/code/session_01UEAWk5o1W73GYBS4ahvobK
Generated by Claude Code