Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.
JavaScript 3d-generationai-agentsanimationavatardigital-humangenerative-aiglbgltfimage-to-3dllmmcpmcp-servermodel-context-protocolsolanatext-to-3dthreejsweb-componentswebglwebxrx402
docs(ops): add the event-readiness audit prompt pack for the /play showcase
nirholas6b68ffbe9606
diff --git a/docs/event-readiness/01-play-first-impression.md b/docs/event-readiness/01-play-first-impression.mdnew file mode 100644index 000000000..055d7d5a1--- /dev/null+++ b/docs/event-readiness/01-play-first-impression.md@@ -0,0 +1,37 @@+# Audit 1: /play first impression and core UX++We have a major event tomorrow and /play is the showcase surface. Your job: make the first 60 seconds of the $THREE world feel world-class. Load, audit, and fix; do not just report.++Canonical URL (the exact link we will share at the event):++```+https://three.ws/play?coin=FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump&name=three.ws&symbol=three&image=%2Fapi%2Fimg%3Furl%3Dhttps%253A%252F%252Fipfs.io%252Fipfs%252Fbafybeihe22b5sxr3ihnxt7pregfieyteqvubqhik3j3y4bbx243xlqjw3q%26seed%3DFeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump+```++## Where the code lives++- Page shell: `pages/play.html` (served at /play via the vercel.json route table)+- World boot and main loop: `src/game/coincommunities.js`+- HUD and panels: `src/game/coincommunities-ui.js`, `src/game/coincommunities.css`, `src/game/hud/`+- Intro and onboarding: `src/game/play-intro.js`, `src/game/play-onboard.js`, `src/game/play-handoff.js`+- Avatar boot: `src/game/boot-avatar.js`+- Ambient population: `src/game/ambient-crowd.js`++## What to audit (walk it as a first-time visitor, in a real browser via `npm run dev`)++1. **The blank-screen window.** Time from navigation to first meaningful paint of the world. Anything over a couple of seconds of dead screen needs a designed loading state: skeleton or branded loader with real progress (assets actually loading), never a fake timer.+2. **Query-string identity.** The coin name, symbol, and image from the URL must be visibly used: page title, HUD, world signage. Verify the `image` param (an /api/img proxy URL) renders everywhere it should and has a fallback if the IPFS fetch fails.+3. **Intro/onboarding flow.** Run it fresh (clear localStorage). Is it skippable? Does it explain movement, chat, and the economy in under 30 seconds? Does it re-appear when it should not?+4. **HUD polish.** Every button: hover, active, focus states. Panel open/close transitions (opacity + transform, no pops). Consistent spacing and typography with the existing design tokens (`docs/DESIGN-TOKENS.md`).+5. **Dead paths.** Click every visible control. Anything that does nothing, links nowhere, or throws is a bug to fix now.+6. **The screenshot test.** Would a stranger screenshot this and share it? If not, identify the top 3 visual gaps (lighting, framing, initial camera position, signage) and fix them.++## Verify++- `npm run dev`, exercise /play with the canonical query string; zero console errors, zero warnings from your code.+- `npm test` stays green.+- Re-run your walkthrough after fixes; capture before/after notes in the final report.++## Report format++What you changed (files + one line each), what you verified in-browser, anything you judged out of scope with a one-line reason. No open questions.diff --git a/docs/event-readiness/02-play-mobile.md b/docs/event-readiness/02-play-mobile.mdnew file mode 100644index 000000000..fc5b65ec8--- /dev/null+++ b/docs/event-readiness/02-play-mobile.md@@ -0,0 +1,29 @@+# Audit 2: /play on mobile (stability and touch UX)++A large share of event traffic will arrive on phones from a shared link. There is a known report that /play kicked mobile users out right after joining. Your job: reproduce, root-cause, fix, and then polish the touch experience.++## Tools already in the repo++- `scripts/play-mobile-repro.mjs`: emulated-phone harness that records console messages, page errors, WebSocket lifecycle, failed requests, transferred bytes, and heap samples. Run both engines:+ - `ENGINE=webkit node scripts/play-mobile-repro.mjs https://three.ws/play 120000` (reproduces iOS Safari memory kills)+ - `ENGINE=chromium node scripts/play-mobile-repro.mjs https://three.ws/play 120000` (gives heap + transfer numbers)+ - It also attributes every `.glb` load and animation-clip fetch to a call stack, so duplicated downloads point at the code that asked for them.+- `npm run audit:mobile-touch`: static touch-target audit.++## What to audit++1. **Survival.** Does an emulated iPhone stay in the world for the full run window? If it dies, the harness output tells you whether it was a page error, a memory kill (WebKit), or a WebSocket drop. Fix the root cause; do not add a reconnect band-aid over a crash.+2. **Memory and transfer budget.** From the chromium run: total transferred bytes and peak heap. Duplicate GLB or clip fetches (same URL, multiple stacks) are the first thing to eliminate. Texture sizes and crowd density (`src/game/ambient-crowd.js`) are the usual heavy hitters; scale them down on mobile rather than shipping the desktop load.+3. **Touch controls.** Virtual joystick or tap-to-move must work one-handed in portrait. Buttons at least 44px targets (`npm run audit:mobile-touch`). No hover-only affordances.+4. **Viewport correctness.** No horizontal scroll, no UI under the notch or home indicator (safe-area insets), no 100vh keyboard bugs in the chat input.+5. **Orientation.** Rotate mid-session; the canvas and HUD must reflow without a reload.++## Verify++- Both harness engines complete a 120s run on the canonical $THREE URL (see `docs/event-readiness/README.md`) with zero page errors and no disconnect.+- `npm run audit:mobile-touch` passes on the play surface.+- `npm test` stays green.++## Report format++Root cause of any crash found (with the harness evidence), fixes applied, remaining risk on real hardware that emulation cannot prove, stated plainly.diff --git a/docs/event-readiness/03-play-performance.md b/docs/event-readiness/03-play-performance.mdnew file mode 100644index 000000000..cd0b1c98d--- /dev/null+++ b/docs/event-readiness/03-play-performance.md@@ -0,0 +1,35 @@+# Audit 3: /play performance (load weight, frame rate, memory)++The world must load fast on event wifi and hold 60fps on a mid-range laptop. Measure first, then fix the biggest numbers, then measure again.++## Where the weight lives++- Main world: `src/game/coincommunities.js` (4k+ lines; check what it imports eagerly vs lazily)+- Population and props: `src/game/ambient-crowd.js`, `src/game/world-objects.js`, `src/game/terrain.js`, `src/game/build-voxels.js`+- Shaders and environment: `src/game/water-shader.js`, `src/game/day-night.js`, `src/game/world-env.js`+- Avatar pipeline: `src/game/boot-avatar.js`, `src/glb-canonicalize.js`, `src/animation-retarget.js`++## What to measure (before touching anything)++1. **Network.** With devtools on the canonical $THREE URL (see `docs/event-readiness/README.md`): total transferred bytes to interactive, largest individual assets, any asset fetched more than once. `scripts/play-mobile-repro.mjs` (chromium engine) prints transfer totals and attributes duplicate GLB/clip fetches to their call stacks.+2. **Frame rate.** Performance panel recording of 30s of walking through the busiest area. Note long tasks, GC spikes, and the main-loop cost breakdown.+3. **Memory.** Heap snapshot after 5 minutes idle in the world. Growth means a leak (event listeners, geometries/materials not disposed on despawn, chat log unbounded).++## Fix priorities (biggest wins first)++1. **Duplicate fetches.** Same GLB or animation clip loaded twice is pure waste; cache at the loader.+2. **Eager imports that should be lazy.** Wheel UI, cosmetics shop, voice chat, intel kiosk: anything not needed for first paint should be a dynamic `import()` triggered on approach or click.+3. **Draw calls.** Instance repeated props (trees, rocks, crowd members). Merge static geometry per zone.+4. **Texture budget.** Downsize anything over 1024px that never fills the screen; KTX2/basis if the pipeline supports it, otherwise plain resizing is fine.+5. **Per-frame allocation.** No `new Vector3()` in the render loop; reuse scratch objects.+6. **Disposal.** Everything despawned (crowd, projectiles, dropped items) must dispose geometry, material, and textures.++## Verify++- Re-run the same three measurements; the report includes before/after numbers for transfer size, worst frame time, and 5-minute heap growth.+- No visual regressions: walk the full map once after changes.+- `npm test` stays green.++## Report format++Numbers table (before/after), each fix in one line, anything intentionally skipped with the measured cost that made it not worth it.diff --git a/docs/event-readiness/04-play-multiplayer-net.md b/docs/event-readiness/04-play-multiplayer-net.mdnew file mode 100644index 000000000..a0914e114--- /dev/null+++ b/docs/event-readiness/04-play-multiplayer-net.md@@ -0,0 +1,32 @@+# Audit 4: /play multiplayer, networking, and presence++The event means many strangers in one world at once. Connection handling has to be boring and invisible: join fast, never silently desync, recover from every drop.++## Where the code lives++- Net layer and server URL: `src/game/community-net.js` (defaultServerUrl is documented in `pages/play.html`)+- World boot: `src/game/coincommunities.js`+- Voice: `src/game/voice-chat.js`+- Ambient population (client-side, non-networked): `src/game/ambient-crowd.js`+- Friends/presence: `src/game/friends-panel.js`+- Persistence: `src/game/world-persist.js`++## What to audit++1. **Join path.** Time from page load to seeing other players. Any handshake failure must surface a designed, actionable error (what happened + retry button), never an empty world that looks single-player when it silently failed.+2. **Reconnect.** Kill the socket mid-session (devtools offline toggle, 10s, then online). The client must reconnect automatically, resync player positions, and show a subtle "reconnecting" indicator while it does. State after resync must match the server (no ghost players, no duplicated self).+3. **Backgrounding.** Switch tabs for 2 minutes and come back. Mobile Safari will have frozen the socket: same reconnect path must handle it.+4. **Two-client consistency.** Open two browser contexts in the same coin world. Movement, chat, and emotes must appear on the other client within a human-imperceptible delay. Check name labels, avatar appearance, and cosmetics sync both ways.+5. **Chat hygiene.** Long messages wrap, links do not inject HTML (verify escaping), spam has some throttle, and the log does not grow unbounded in memory.+6. **Voice.** If `voice-chat.js` is surfaced in the UI, test the full path: permission prompt, mute state visible to others, teardown on leave. If it is broken and unfixable today, hide the entry point rather than shipping a dead button.+7. **Scale behavior.** Simulate a crowded room (multiple headless Playwright contexts, or whatever the net layer allows). Watch for O(n^2) update patterns and per-player DOM label churn.++## Verify++- Scripted two-context Playwright run joins the canonical $THREE world (URL in `docs/event-readiness/README.md`), exchanges chat, survives a forced disconnect, and asserts resync. Keep the script in `scripts/`.+- Zero console errors across the run.+- `npm test` stays green.++## Report format++Each failure mode tested and its result (pass / fixed / cannot-fix-with-reason). State the server-side capacity assumption you tested against so the event-day runbook (prompt 10) can pre-scale it.diff --git a/docs/event-readiness/05-play-economy-loops.md b/docs/event-readiness/05-play-economy-loops.mdnew file mode 100644index 000000000..bd220066c--- /dev/null+++ b/docs/event-readiness/05-play-economy-loops.md@@ -0,0 +1,34 @@+# Audit 5: /play economy, activities, and progression loops++The world's stickiness is its loops: gather, fight, trade, spin, buy cosmetics. Every loop must pay out correctly and every price shown must match what the server actually charges.++## Where the code lives++- Activities and systems: `src/game/play-activities.js`, `src/game/play-systems.js`+- Store/bank/economy UI: `src/game/economy-ui.js`, `src/game/agent-commerce.js`, `src/game/boutique-purchase.js`+- Wheel: `src/game/wheel-station.js`, `src/game/spin-wheel-ui.js`+- Combat: `src/game/combat-system.js`+- Quests: `src/game/quests-ui.js`+- Cosmetics: `src/game/cosmetics-shop.js`, `cosmetics-purchase.js`, `cosmetics-loadout.js`, `cosmetics-wardrobe.js`, `cosmetics-flex.js`+- Items and persistence: `src/game/items.js`, `src/game/world-persist.js`+- Published economy pages (must agree with the game): `/play/economy` and `/play/solver` (routes in `vercel.json`; both read from the same tables the game server prices with, so a mismatch means one side drifted)++## What to audit++1. **Every loop end to end, with a real signed-in session.** Gather from a tree/rock/pond, sell at the store, bank cash, die and confirm the bank protected it, spin the wheel, complete a quest, buy and equip a cosmetic. Each step: correct payout, correct balance update in the HUD without a refresh, correct persistence across a reload.+2. **Price truth.** Cross-check a sample of prices shown in-game against `/play/economy`. Any disagreement is a bug; find which side is stale.+3. **The $THREE boutique.** The cosmetics boutique charges $THREE: verify the full purchase path including insufficient-balance handling (clear message + how to get $THREE, never a silent failure or a raw error toast).+4. **Race and double-spend.** Double-click every buy/spin/sell button fast. Balances must never go negative or double-charge; buttons must disable while a request is in flight.+5. **Edge cases.** 0 inventory, full inventory, extremely long item names, network failure mid-purchase (the UI must reconcile with server state on reconnect, not trust its optimistic update).+6. **Progression feel.** XP and skill levels visible, level-ups celebrated (even minimally), next-unlock always discoverable. If a loop pays out but gives no feedback (no sound/flash/toast), add the feedback; silent success reads as broken.+7. **Wheel odds honesty.** The wheel paytable shown to users must match the server's real odds (that is the published promise of /play/economy).++## Verify++- Full loop walkthrough on `npm run dev` with a signed-in session, then the same on production for read paths.+- Zero console errors during purchases.+- `npm test` stays green; add a test where a payout calculation was wrong.++## Report format++Loop-by-loop pass/fixed table, every price mismatch found and which side you corrected, edge cases now handled.diff --git a/docs/event-readiness/06-play-auth-errors.md b/docs/event-readiness/06-play-auth-errors.mdnew file mode 100644index 000000000..62c827452--- /dev/null+++ b/docs/event-readiness/06-play-auth-errors.md@@ -0,0 +1,29 @@+# Audit 6: /play auth, gates, and every failure state++Event visitors will arrive signed out, with ad blockers, on flaky wifi, with wallets we have never seen. Every one of those must get a designed experience, not a blank canvas or a raw stack trace.++## Where the code lives++- Auth flow: `src/game/play-auth.js`, `src/game/play-gate.js`, `src/game/play-handoff.js`+- World boot (error surfaces): `src/game/coincommunities.js`, `src/game/boot-avatar.js`+- QA credentials for authed testing: `AUDIT_EMAIL` / `AUDIT_PASSWORD` in `.env` (a real production QA account); sweeps via `npm run audit:web` (anon) and `npm run audit:web:login` (authed)++## What to audit++1. **Signed-out experience.** Load the canonical $THREE URL (see `docs/event-readiness/README.md`) with no session. How much of the world is explorable before a gate appears? The gate itself: is it an invitation (clear value, one-tap sign-in) or a wall? Fix toward invitation.+2. **Sign-in mid-session.** Complete wallet sign-in from inside the world. The session must hand off without losing position or reloading the page if the flow supports it; if it must reload, state must restore.+3. **Session expiry.** Expire the session (clear the cookie/token) while playing, then perform an authed action (buy, bank). The user gets a re-auth prompt that resumes the action afterward, not a generic failure.+4. **Every fetch boundary.** Grep the play modules for `fetch(`/net calls and check each one handles rejection and non-2xx with a user-visible, actionable state. Internal code trusts itself; boundaries do not.+5. **Asset failures.** Block the IPFS coin image and one GLB in devtools. The world must render with fallbacks (placeholder texture, default rig per the `AnimationManager.supportsCanonicalClips()` gate), never a T-pose or an invisible avatar.+6. **Bad query strings.** /play with no params, a garbage `coin=`, an XSS attempt in `name=`/`symbol=` (must render escaped, never execute), and an oversized `image=` URL. Each gets a sane default world or a designed error, and never script execution.+7. **Console zero.** `npm run audit:console` scoped to /play, plus a manual pass. Zero errors, zero warnings from our code, on both anon and authed runs.++## Verify++- `npm run audit:web` and `npm run audit:web:login` pass for the play surface.+- Manual devtools-driven failure injection for items 3-6, each recovered per above.+- `npm test` stays green.++## Report format++A failure-mode table: scenario, what happened before, what happens now. Call out any XSS finding separately and first.diff --git a/docs/event-readiness/07-platform-smoke-sweep.md b/docs/event-readiness/07-platform-smoke-sweep.mdnew file mode 100644index 000000000..344d2a636--- /dev/null+++ b/docs/event-readiness/07-platform-smoke-sweep.md@@ -0,0 +1,31 @@+# Audit 7: whole-platform smoke sweep (every page, every link)++Event visitors will not stay on /play; they will click around. Every page declared in `data/pages.json` must load clean, every link must resolve, every button must do something.++## The tooling (all already in the repo)++Run these against production first to find real user-facing breakage, then against `npm run dev` to fix:++- `npm run smoke:prod`: sweeps every page in `data/pages.json` against the live site.+- `npm run audit:web`: unauthenticated browser sweep. `npm run audit:web:login`: authed sweep using the QA account (`AUDIT_EMAIL`/`AUDIT_PASSWORD` in `.env`).+- `npm run audit:links`: dead links. `npm run audit:pages` and `npm run check:pages`: pages.json integrity.+- `npm run audit:console`: console errors per page. `npm run audit:overlays`, `npm run audit:inline-handlers`, `npm run audit:routes`, `npm run audit:route-shadowing`: overlay/handler/route health.+- `npm run audit:docs`: dead doc links and commands naming scripts that no longer exist.++## What to do++1. Run the full battery above. Triage every failure into: broken for users (fix now), cosmetic (fix now if under 15 minutes), false positive (note why).+2. **Fix priority order:** pages that 404 or render blank, then console errors, then dead links/buttons, then layout breakage at 320px/768px/1440px.+3. **The event funnel gets extra depth.** Walk these by hand, signed out, as a stranger would: home page, /play (canonical $THREE URL in `docs/event-readiness/README.md`), /launches, /changelog, the nav between them. Every step must be obvious and fast.+4. **Cross-linking check.** From /play, can a curious visitor find what three.ws is and how to launch their own coin world? If the path is more than 2 clicks or invisible, wire it (a HUD link, a share control, whatever fits the existing design language).+5. **OG cards.** The event link will be pasted into Telegram/X/Discord. Verify /play and the home page return correct og:image, title, and description (play.html uses /api/page-og; confirm it renders live).+6. Re-run the battery until clean, fixing as you go. A false positive that will confuse the next person gets its audit rule adjusted, not ignored.++## Verify++- All listed audits pass (or have a one-line justified exception in the report).+- `npm test` stays green.++## Report format++Battery results before and after, fixes grouped by page, the manual event-funnel walkthrough result, and any exception you accepted with its reason.diff --git a/docs/event-readiness/08-api-production-health.md b/docs/event-readiness/08-api-production-health.mdnew file mode 100644index 000000000..4d5f4d7f7--- /dev/null+++ b/docs/event-readiness/08-api-production-health.md@@ -0,0 +1,24 @@+# Audit 8: production API and infrastructure health++Everything server-side must be verifiably healthy before the event: Cloud Run, crons, database, the x402 economy, and the failover chains. Use the gcp-triage skill if available; otherwise follow this checklist directly.++Project `aerial-vehicle-466722-p5`, region `us-central1`, service `three-ws-api`. If `gcloud` is not on PATH: `export PATH="$HOME/google-cloud-sdk/bin:$PATH"`. Full runbook: `docs/ops/gcp-production.md`.++## What to check and fix++1. **Liveness.** `curl -s https://three.ws/api/version` (live SHA + revision; confirm it is the commit you expect) and the healthz endpoint. `npm run smoke:prod` for the page layer.+2. **Error logs, last 24h.** `npm run logs:errors`, and for depth: `gcloud logging read 'resource.type="cloud_run_revision" resource.labels.service_name="three-ws-api" severity>=ERROR' --freshness=24h`. Every recurring error gets root-caused and fixed or explicitly accepted with a reason. "It has always logged that" is not a reason.+3. **Crons.** `npm run audit:cron-liveness` and `npm run check:cron-drift`. All Cloud Scheduler jobs (synced from vercel.json's crons array) firing and succeeding; pay attention to `/api/cron/changelog-push` since we will ship changelog entries before the event.+4. **Database.** `npm run db:status` (read only; NEVER run `db:migrate` casually, it applies immediately with no dry run). Pending migrations at event time are a deploy-gate failure waiting to happen: resolve them deliberately today. Check `forge_creations` for elevated generation error rates.+5. **Generation lanes and LLM chain.** Exercise one real generation per public lane (text-to-3D at minimum) end to end on production. A lane with a broken primary must be proven to fail over, not assumed to.+6. **x402 economy.** If any settle failures or stalls appear in logs, run the x402-economy-triage agent before concluding anything about wallet balances; settle-floor starvation and capital dispersion look identical from outside. Also `npm run check:relayer-balances` and `npm run audit:service-wallets`.+7. **Rate limits and abuse posture.** The event link will be public. Confirm the obvious abuse surfaces (chat, generation endpoints, auth) have rate limiting that will not also throttle legitimate burst traffic from one venue IP/NAT. If venue NAT would trip an IP-based limit, raise or key it differently now.+8. **TLS/DNS/CDN.** Certificate validity, and confirm the CDN serves current content (a stale edge after the last deploy shows phantom failures; the purge command is `npm run deploy:gcp:purge-cdn`).++## Verify++Each numbered item ends in a binary state: healthy, or fixed-and-now-healthy, or a named owner-level decision with exactly what remains.++## Report format++Solana-first status summary, then the 8 items with their binary states, then log evidence links/queries for anything you fixed.diff --git a/docs/event-readiness/09-accessibility-i18n.md b/docs/event-readiness/09-accessibility-i18n.mdnew file mode 100644index 000000000..f4789852b--- /dev/null+++ b/docs/event-readiness/09-accessibility-i18n.md@@ -0,0 +1,29 @@+# Audit 9: accessibility and internationalization++The event audience is international and diverse. Keyboard users, screen-reader users, and non-English speakers all get first-class treatment. Accessibility is not optional here; it is a hard platform rule.++## Where the code lives++- /play HUD and panels: `src/game/coincommunities-ui.js`, `src/game/hud/`, `src/game/coincommunities.css`+- i18n runtime: `i18n.js` (loaded by `pages/play.html`); play strings use `data-i18n` / `data-i18n-attr` attributes (see the meta tags in `pages/play.html` for the pattern)+- Motion audit: `npm run audit:motion`; design tokens: `docs/DESIGN-TOKENS.md`++## What to audit++1. **Keyboard.** Tab through every /play panel (store, bank, wheel, quests, cosmetics, chat, settings). Visible focus ring on every interactive element, logical order, Escape closes the top panel, no focus traps, and game hotkeys must not swallow typing in the chat input (and vice versa).+2. **Screen reader semantics.** Panels are labeled regions, buttons have accessible names (icon-only buttons need `aria-label`), balance changes and incoming chat announce via a polite live region, and the canvas has a text alternative describing the world state entry point.+3. **Contrast.** Every HUD text/background pair meets 4.5:1 (3:1 for large text). HUD text over the 3D scene is the usual failure: add scrims/backdrops where needed rather than hoping the scene stays dark.+4. **Motion sensitivity.** `prefers-reduced-motion` must tone down camera shake, wheel spin flourish, and ambient animation. Run `npm run audit:motion`.+5. **i18n coverage on the event funnel.** Every user-facing string on /play, the home page, and /launches goes through the i18n layer; hardcoded English in the play HUD is a bug. Verify at least one non-English locale renders the play HUD without broken layouts (long German/Romanian strings are the classic overflow test).+6. **Text scaling.** 200% browser zoom: HUD remains usable, nothing overlaps, no clipped labels.+7. **Platform-wide spot check.** Repeat items 1-3 briefly on the home page and /launches; fix what you find there too.++## Verify++- Full keyboard-only session: join the canonical $THREE world (URL in `docs/event-readiness/README.md`), open every panel, buy one thing, send one chat message. No mouse.+- Contrast checks recorded for the worst 5 HUD pairs, all passing after fixes.+- `npm test` stays green.++## Report format++Per-category pass/fixed list, the keyboard-only session result, locales verified, and any genuinely unfixable-today item with its concrete follow-up.diff --git a/docs/event-readiness/10-event-day-runbook.md b/docs/event-readiness/10-event-day-runbook.mdnew file mode 100644index 000000000..9d3d45ad7--- /dev/null+++ b/docs/event-readiness/10-event-day-runbook.md@@ -0,0 +1,31 @@+# Audit 10: event-day readiness runbook (run last, after fixes have shipped)++Everything is fixed and deployed; now make the platform boringly reliable for the traffic spike and give the owner a one-page live-ops position. This prompt both executes the pre-scaling and produces the runbook.++Project `aerial-vehicle-466722-p5`, region `us-central1`. Pre-approved scaling and quota posture: `docs/ops/gcp-credits-plan.md`. Full production runbook: `docs/ops/gcp-production.md`. Config-only `gcloud run services update` changes are pre-approved; use `--update-env-vars` only, never `--set-env-vars`.++## Execute now (day before)++1. **Deploy state.** Confirm the intended final build is live: `curl -s https://three.ws/api/version` matches the release SHA. If a deploy is still pending, run the deploy-preflight agent and stage everything so shipping is one command; the deploy itself stays owner-gated.+2. **Pre-scale.** Raise `min-instances` on `three-ws-api` (and the /play world server if it is a separate service; check `gcloud run services list`) so the first traffic wave never hits a cold start. Confirm max-instances and concurrency leave headroom per the credits plan. Config-only, pre-approved: do it, record old/new values.+3. **Worktree hygiene.** `npm run clean:worktrees` (then `--apply`) so a mid-event hotfix deploy cannot die on a full disk.+4. **Rehearse rollback.** Identify the current and previous Cloud Run revisions and write down the exact one-line traffic-rollback command for each service. Verify the previous revision still exists and is routable.+5. **Monitoring loop.** Set up the recurring production check for event day (the gcp-triage sweep or `npm run logs:errors` + `npm run smoke:prod` on an interval). Confirm alerting actually reaches a human.+6. **Capacity smoke.** Drive a burst of concurrent sessions at /play (Playwright contexts or a load tool) at least 2x the expected peak. Watch p95 latency, error rate, and instance count. Fix or pre-scale whatever bends.+7. **Third-party dependencies.** List every external dependency in the event path (Solana RPC, Pump.fun feed, IPFS gateway for coin images, LLM providers) and verify each has a working failover rung today. Test the failover, not just its existence.++## Produce: the one-page live-ops sheet++Write `docs/event-readiness/LIVE-OPS.md` containing, with zero fluff:++- The event URL (canonical $THREE /play link from `docs/event-readiness/README.md`) and the release SHA that is live.+- Health: the 3 curl commands that prove the site is up.+- Logs: the 2 log commands for fast triage.+- Rollback: the exact per-service revision-rollback command, pre-filled.+- Scale: current min/max instances and the command to raise them further.+- Known failure modes from audits 1-9 that were accepted rather than fixed, and what to do if each one fires.+- Escalation: which subsystem maps to which triage tool (x402-economy-triage, gcp-triage, `scripts/play-mobile-repro.mjs`).++## Report format++Old/new scaling values, capacity smoke numbers, rollback rehearsal result, and the link to LIVE-OPS.md. Anything owner-gated (the final deploy) stated as the single remaining command.diff --git a/docs/event-readiness/README.md b/docs/event-readiness/README.mdnew file mode 100644index 000000000..a9fc8267e--- /dev/null+++ b/docs/event-readiness/README.md@@ -0,0 +1,26 @@+# Event readiness: audit prompt pack++Ten self-contained agent prompts to get three.ws, and especially the /play world, to 100% before the event. Each file is a complete prompt: paste it into a fresh Claude Code session (or hand it to a subagent) and it runs end to end, fixing what it finds and reporting the rest.++Suggested order and parallelism:++| # | Prompt | Surface | Can run in parallel with |+|---|--------|---------|--------------------------|+| 1 | [01-play-first-impression.md](01-play-first-impression.md) | /play load, intro, onboarding UX | 4, 5, 7, 8 |+| 2 | [02-play-mobile.md](02-play-mobile.md) | /play on phones (stability + touch) | 7, 8 |+| 3 | [03-play-performance.md](03-play-performance.md) | /play load weight, FPS, memory | 7, 8 |+| 4 | [04-play-multiplayer-net.md](04-play-multiplayer-net.md) | WebSocket, reconnects, voice, crowd | 1, 5 |+| 5 | [05-play-economy-loops.md](05-play-economy-loops.md) | Store, bank, wheel, combat, quests, cosmetics | 1, 4 |+| 6 | [06-play-auth-errors.md](06-play-auth-errors.md) | Sign-in, gates, error/empty states, console | after 1 |+| 7 | [07-platform-smoke-sweep.md](07-platform-smoke-sweep.md) | Every page on the live site | 1, 2, 3 |+| 8 | [08-api-production-health.md](08-api-production-health.md) | Cloud Run, crons, logs, DB, x402 | 1, 2, 3 |+| 9 | [09-accessibility-i18n.md](09-accessibility-i18n.md) | Keyboard, ARIA, contrast, translations | after 1 |+| 10 | [10-event-day-runbook.md](10-event-day-runbook.md) | Pre-scale, monitoring loop, rollback | last, after all fixes deploy |++Rules that apply to every prompt in this pack:++- The canonical test URL for the world is the $THREE community: `https://three.ws/play?coin=FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump&name=three.ws&symbol=three&image=%2Fapi%2Fimg%3Furl%3Dhttps%253A%252F%252Fipfs.io%252Fipfs%252Fbafybeihe22b5sxr3ihnxt7pregfieyteqvubqhik3j3y4bbx243xlqjw3q%26seed%3DFeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump`+- Fix what you find. Do not produce a findings report and stop; the report is what you fixed plus what genuinely cannot be fixed in-session and why.+- Verify locally with `npm run dev` (port 3000) plus the named audit scripts before claiming done. `npm test` must stay green.+- Commit finished work promptly with explicit paths (concurrent agents share this worktree; never `git add -A`).+- Deploys stay owner-gated. Prepare everything so shipping is one command (`npm run deploy:gcp:full`), then say so in the report.