Skip to content

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.

docs(core): true up README, STRUCTURE, build, and guards against the shipped repo

nirholas985c4a0a11bc
diff --git a/README.md b/README.md
index 182671144..e744e803e 100644
--- a/README.md
+++ b/README.md
@@ -8724,20 +8724,20 @@ A map of every user-facing route. [`STRUCTURE.md`](STRUCTURE.md) maps each produ
| **Profile** | `/profile`, `/u/[username]`, `/avatars/[id]` | User and avatar public pages — SNS badge + pay-by-name modal when `[username].threews.sol` is claimed |
| **SNS Subdomain** | `/threews/claim` | Mint `[label].threews.sol`, set the URL record to your showcase, transfer ownership — single tx, platform pays |
| **Dashboard** | `/dashboard`, `/dashboard/actions`, `/dashboard/wallets`, `/dashboard/usage`, `/dashboard/x402` | Account management, settings, and x402 receipts/payouts |
-| **Studio / Tools** | `/studio`, `/embed`, `/pose`, `/voice`, `/mocap-studio`, `/hydrate`, `/validation`, `/strategy-lab` | Widget Studio, WYSIWYG embed editor, pose authoring, Voice Lab, Mocap Studio, on-chain import, glTF validator, DCA |
+| **Studio / Tools** | `/studio`, `/embed`, `/pose`, `/gestures`, `/choreograph`, `/voice`, `/mocap-studio`, `/hydrate`, `/validation`, `/strategy-lab` | Widget Studio, WYSIWYG embed editor, pose authoring, gesture vocabulary + override builder, routine choreographer, Voice Lab, Mocap Studio, on-chain import, glTF validator, DCA |
| **Widgets** | `/widgets`, `/w/[id]` | Widget gallery and public widget pages (OG + oEmbed) |
| **Launchpad** | `/launchpad`, `/p/[slug]` | Launchpad Studio + hosted launch pages (token, agent, drop campaigns) |
| **Club** | `/club` | Multiplayer 3D venue — tips, leaderboard, audio tracks, perf-aware renderer |
| **Walk** | `/walk` | Authoritative multiplayer walk scene (Colyseus on Fly.io) |
-| **Coin Communities** | `/communities`, `/communities/[mint]`, `/worlds`, `/play` | Live 3D world per Solana token — lobby, coin profile, and the shared coin-keyed world |
+| **Coin Communities** | `/communities`, `/communities/[mint]`, `/worlds`, `/play`, `/crews` | Live 3D world per Solana token: lobby, coin profile, the shared coin-keyed world, and crew HQ |
| **City** | `/city` | Free-roam walkable 3D city scene |
| **Bazaar (x402)** | `/x402`, `/x402/studio`, `/x402-revenue` | Paid-API marketplace, listing studio, revenue dashboard |
| **Artifacts** | `/artifact`, `/artifact/snippet`, `/artifact-example` | Claude Artifact viewer |
| **Solana / DeFi** | `/pumpfun`, `/pump-visualizer`, `/vanity-wallet` | pump.fun launcher, live token visualizer, WASM vanity grinder |
| **Mobile (Seeker)** | Solana Mobile dApp Store | MWA wallet wired into the web app + Seeker release pipeline |
| **News / Blog** | `/news`, `/admin/news` | News feed + local-only CMS, syndicated via WebSub / Dev.to / Medium / HackerNoon |
-| **Admin / Rep** | `/admin`, `/reputation` | Staff admin, reputation registry |
-| **Experiments** | `/rider` | A-Frame WebVR music visualization |
+| **Admin / Rep** | `/admin`, `/reputation`, `/monitor` | Staff admin, reputation registry, fleet ops-room dashboard |
+| **Experiments** | `/rider`, `/holo` | A-Frame WebVR music visualization, procedural holographic sticker |
| **Integrations** | `/cz`, `/lobehub/iframe` | CZ demo, LobeHub plugin |
| **IBM / Granite** | `/galaxy`, `/ibm/x402-demo`, `/ibm/hello` | Granite on watsonx.ai: semantic agent galaxy, pay-per-call Granite demo, hello-world embed |
| **Docs** | `/docs`, `/docs/widgets` | Developer documentation |
@@ -9972,14 +9972,14 @@ The full OpenAPI 3.1 spec is available at `/openapi.json`. The key API surface i
Cron schedules are declared in `vercel.json` (still the live cron/route config the server reads) and executed in production by **Google Cloud Scheduler**, which calls each endpoint on its schedule. All cron endpoints are fail-closed — a missing auth token aborts with an error rather than silently skipping (see [Security Hardening](#security-hardening)).
-The 101 crons in `vercel.json` are routed through a single dynamic handler at [`api/cron/[name].js`](api/cron/[name].js); the `name` segment selects the handler function. Scheduler jobs are provisioned from the `vercel.json` cron list via [scripts/create-gcp-scheduler.mjs](scripts/create-gcp-scheduler.mjs); the schedules below match `vercel.json` verbatim.
+The 103 crons in `vercel.json` are routed through a single dynamic handler at [`api/cron/[name].js`](api/cron/[name].js); the `name` segment selects the handler function. Scheduler jobs are provisioned from the `vercel.json` cron list via [scripts/create-gcp-scheduler.mjs](scripts/create-gcp-scheduler.mjs); the schedules below match `vercel.json` verbatim.
| Schedule | Endpoint | Purpose |
| -------------------- | --------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| Every minute | `/api/cron/run-x-scheduled-posts` | Publish queued X (Twitter) posts |
| Every 3 min | `/api/cron/pumpfun-monitor` | Watch for new pump.fun token creates |
| Every 5 min | `/api/cron/expire-pending-purchases` | Clear stale x402 pending purchases |
-| Every 5 min | `/api/cron/solana-attestations-crawl` | Index new Solana feedback / validation memos |
+| Every 10 min | `/api/cron/solana-attestations-crawl` | Index new Solana feedback / validation memos |
| Every 5 min | `/api/cron/index-delegations` | Index EIP-7710 delegations |
| Every 5 min | `/api/cron/run-x-triggers` | Trigger-based X posts (mentions, milestones) |
| Every 5 min | `/api/cron/run-coin-cycle` | Unified coin-launch tick: holder snapshots, vault claims, lottery draws, reflections |
@@ -9993,7 +9993,7 @@ The 101 crons in `vercel.json` are routed through a single dynamic handler at [`
| Hourly | `/api/cron/process-withdrawals` | Sweep creator withdrawals (pump.fun, club tips) |
| Hourly | `/api/cron/run-dca` | Execute DCA strategy orders |
| Hourly | `/api/cron/run-subscriptions` | Execute recurring x402 subscriptions |
-| Hourly | `/api/cron/siwx-gc` | Prune SIWX nonces (10-min replay window) and expired payment grants |
+| Daily 03:00 UTC | `/api/cron/siwx-gc` | Prune SIWX nonces (10-min replay window) and expired payment grants |
| Every 6h | `/api/cron/fetch-x-metrics` | Pull X engagement metrics for owned accounts |
| Every 6h | `/api/cron/process-subscriptions` | Charge creator subscriptions whose period is about to end |
| Daily 03:00 UTC | `/api/cron/settle-royalties` | Settle creator and skill royalties owed |
@@ -10053,7 +10053,7 @@ Access tokens are short-lived JWTs (1 hour). Refresh tokens are opaque strings s
## MCP Server
-[`api/mcp.js`](api/mcp.js) is a thin HTTP entrypoint (POST / GET-SSE / DELETE) that implements the [Model Context Protocol](https://modelcontextprotocol.io) 2025-06-18 specification over JSON-RPC 2.0. The protocol logic is split across [`api/_mcp/`](api/_mcp/) — `auth.js` (Bearer/OAuth + x402 paywall), `dispatch.js` (JSON-RPC routing), `catalog.js` (dynamic tool catalog), `payments.js` (x402 paid-tool settlement), `render.js`, and `embed-policy.js`. Tools are registered per category under [`api/_mcp/tools/`](api/_mcp/tools/) (`avatars.js`, `models.js`, `solana.js`, `pumpfun.js`). External AI systems (including Claude Desktop, other agents, or custom integrations) can drive avatars programmatically through this surface.
+[`api/mcp.js`](api/mcp.js) is a thin HTTP entrypoint (POST / GET-SSE / DELETE) that implements the [Model Context Protocol](https://modelcontextprotocol.io) 2025-06-18 specification over JSON-RPC 2.0. The protocol logic is split across [`api/_mcp/`](api/_mcp/): `auth.js` (Bearer/OAuth + x402 paywall), `dispatch.js` (JSON-RPC routing), `catalog.js` (dynamic tool catalog), `payments.js` (x402 paid-tool settlement), `render.js`, and `embed-policy.js`. Tools are registered per category under [`api/_mcp/tools/`](api/_mcp/tools/) (14 category modules: `avatars.js`, `models.js`, `solana.js`, `pumpfun.js`, `animations.js`, `agents.js`, `garments.js`, `memory.js`, `oracle.js`, `trader.js`, `embed.js`, `sign.js`, `crypto-data.js`, `tokenize.js`). External AI systems (including Claude Desktop, other agents, or custom integrations) can drive avatars programmatically through this surface.
**Endpoint:** `POST /api/mcp` (tools), `GET /api/mcp` (SSE), `DELETE /api/mcp` (session terminate)
**Auth:** OAuth 2.1 Bearer token with `mcp` scope; some tools additionally require x402 USDC payment
@@ -10072,6 +10072,7 @@ _Avatars_ ([`api/_mcp/tools/avatars.js`](api/_mcp/tools/avatars.js))
| `get_avatar` | Fetch a single avatar by id or owner+slug; returns metadata plus a public `model_url` or short-lived signed URL for private avatars. |
| `search_public_avatars` | Free-text + tag search across the public avatar gallery; useful for finding characters to render without prior knowledge of an id. |
| `render_avatar` | Produce an HTML `<model-viewer>` snippet that renders the given avatar, with configurable background, camera orbit, poster, and AR button. |
+| `render_avatar_image` | Render a stored avatar to a real PNG/JPEG/WebP image (headless three.js) with camera framing, pose preset, and ARKit-52 expression; cached. |
| `delete_avatar` | Soft-delete an avatar you own. Requires the `avatars:delete` scope. |
_Models_ ([`api/_mcp/tools/models.js`](api/_mcp/tools/models.js))
@@ -10099,6 +10100,8 @@ _Pump.fun_ ([`api/_mcp/tools/pumpfun.js`](api/_mcp/tools/pumpfun.js))
| `pumpfun_token_intel` | Full intel on a pump.fun token: graduation status, bonding-curve progress, creator profile, top holders, volume, bundle detection, and trust signals. |
| `pumpfun_creator_intel` | Reputation profile for a pump.fun creator wallet: prior launches, graduation rate, claim activity, and behavioural trust signals. |
+Ten further category modules register the rest of the catalog: _Animations_ (`list_animations`, `animation_signature`, `find_similar_animations`, `apply_animation`, `text_to_animation`), _Agents_ (`call_agent`, `register_agent`, `attach_avatar_to_agent`, `identity_check`), _Garments_ (`generate_garment`, `garment_status`, `list_garment_catalog`), _Memory_ (`remember`, `recall`, `forget`), _Oracle_ (`oracle_top_plays`, `oracle_coin`, `oracle_arm_watch`, `oracle_watch_status`), _Trader_ (`trader_leaderboard`, `trader_profile`, `copy_subscribe`, `copy_status`), _Embed_ (`get_embed_code`, `create_gated_embed`), _Sign_ (`list_sign_vocabulary`, `sign_text`), _Crypto data_ (`crypto_data`, `token_snapshot`), and _Tokenize_ (`mint_3d_asset`, `get_3d_asset_onchain`).
+
**MCP discovery:** configured in `.mcp.json` at the repo root for Claude Desktop integration.
**SSE stream:** `GET /api/mcp` returns a Server-Sent Events stream for real-time notifications from long-running operations (validation, optimization).
@@ -10333,14 +10336,14 @@ Every CDP-settled endpoint ships a Permit2 sibling that accepts an EIP-2612 perm
import { paidEndpoint } from './_lib/x402-paid-endpoint.js';
export default paidEndpoint({
- price: '0.10', // USDC
- chain: 'base', // base | bsc | solana
- network: 'mainnet',
- resource: 'https://three.ws/api/your-endpoint',
+ route: '/api/your-endpoint',
+ method: 'POST',
+ priceAtomics: '100000', // USDC atomic units (6 decimals): $0.10
+ networks: ['solana', 'base'], // solana | base | bsc; Solana listed first by default
description: 'What the buyer is paying for',
- handler: async (req, res, { payer }) => {
- // payer is verified — settle the request
- res.json({ ok: true, payer });
+ handler: async ({ req, payer }) => {
+ // payer is verified. RETURN the good; the wrapper settles, then flushes it
+ return { ok: true, payer };
},
});
```
@@ -11010,7 +11013,7 @@ npm run build # frontend build to dist/ (only when frontend changed)
npm run deploy:gcp # check:dist + db:check, gcloud builds submit, purge CDN
```
-`npm run deploy:gcp` runs `gcloud builds submit --config server/cloudbuild.yaml`. Routing, cache headers, and cron schedules are defined in `vercel.json`, which the server reads at runtime. The scheduled jobs (101 at time of writing, one per entry in the `crons` array of `vercel.json`) run on **Cloud Scheduler** (provisioned by [scripts/create-gcp-scheduler.mjs](scripts/create-gcp-scheduler.mjs)); the GPU inference workers run as their own Cloud Run services. Full ops runbook (load balancer, DNS/TLS, env, rollback, recovery): **[docs/ops/gcp-production.md](docs/ops/gcp-production.md)**.
+`npm run deploy:gcp` runs `gcloud builds submit --config server/cloudbuild.yaml`. Routing, cache headers, and cron schedules are defined in `vercel.json`, which the server reads at runtime. The scheduled jobs (103 at time of writing, one per entry in the `crons` array of `vercel.json`) run on **Cloud Scheduler** (provisioned by [scripts/create-gcp-scheduler.mjs](scripts/create-gcp-scheduler.mjs)); the GPU inference workers run as their own Cloud Run services. Full ops runbook (load balancer, DNS/TLS, env, rollback, recovery): **[docs/ops/gcp-production.md](docs/ops/gcp-production.md)**.
**Environment variables** live on the Cloud Run service, not in `.env` files — inspect or update them with `gcloud run services describe/update three-ws-api --region us-central1`. See [Environment Variables](#environment-variables) for the full list.
diff --git a/STRUCTURE.md b/STRUCTURE.md
index c8b1e16ea..9ae9d6b05 100644
--- a/STRUCTURE.md
+++ b/STRUCTURE.md
@@ -35,8 +35,10 @@ bottom.
| Scene Studio (3D scene editor) | [src/scene-studio/](src/scene-studio) `→ /scene` | Vendored [mrdoob/three.js](https://github.com/mrdoob/three.js) r184 editor, MIT, see [src/scene-studio/vendor/README.md](src/scene-studio/vendor/README.md) | Import GLBs, compose scenes, edit materials/lights, export |
| Diorama (text → 3D world) | [src/diorama/](src/diorama) `→ /diorama` | In-repo · backend [api/diorama.js](api/diorama.js) | One sentence → an explorable 3D diorama: Claude composes the scene, each object is forged to a real GLB, assembled live, saved to a public gallery + shareable permalink |
| Creator portfolio (human profile) | [pages/profile.html](pages/profile.html) `→ /u/:username` (self-view `/profile`), backend [api/users/[username].js](api/users/%5Busername%5D.js) + paginated [api/users/[username]/creations.js](api/users/%5Busername%5D/creations.js) `→ /api/users/:username/creations` | Live | Every three.ws user's public portfolio: avatars, agents, widgets, skills, plugins, coins, memories, items for sale, and (added 2026-07-12, extended 2026-07-23) a **Creations** tab merging forged 3D models + Scene Studio worlds + Material Studio restyles — real, live, spinning `<model-viewer>` cards, cursor-paginated for 100+ items. `/forge`, `/diorama`, and `/restyle` all stay anonymous by default (no login required); a signed-in creator's `user_id` is attached to `forge_creations`/`dioramas` rows at generation/save time (migration [api/_lib/migrations/20260712010000_creator_portfolio_user_ids.sql](api/_lib/migrations/20260712010000_creator_portfolio_user_ids.sql)) and to a new `material_restyles` row per AI restyle or colorway variant (migration [api/_lib/migrations/20260723140000_material_restyles.sql](api/_lib/migrations/20260723140000_material_restyles.sql), store [api/_lib/material-restyle-store.js](api/_lib/material-restyle-store.js)) so those creations surface here. The same opt-in attribution now links back from the diorama viewer HUD, the diorama gallery cards, and the forge result bar ("by @user") whenever a creation's creator is known. `/@:handle` ([pages/handle.html](pages/handle.html)) is a separate, narrower agent-embed page — not the human portfolio. |
+| Model detail page (`/m/:id`) | [pages/model.html](pages/model.html) `→ /m/:id`, page module [src/model-page.js](src/model-page.js) + pure helpers [src/model-lib.js](src/model-lib.js) + [src/model.css](src/model.css), backend [api/forge-creation.js](api/forge-creation.js) (`?related=&view=` + voted state) and [api/forge-comments.js](api/forge-comments.js), store reads [api/_lib/forge-store.js](api/_lib/forge-store.js) (`getPublicCreation`/`listRelated`/`recordCreationView`), schema [api/_lib/migrations/20260805120000_model_page.sql](api/_lib/migrations/20260805120000_model_page.sql) | Live | Every finished forge model as a first-class page in the classic model-platform detail layout: interactive viewer hero with AR and fullscreen, title + creator card with a real follow button (follow graph), live triangle/vertex stats from `GET /api/3d/inspect` (nothing persisted, nothing invented), the full prompt as the description, honest attribute chips, anonymous likes shared with the Forge-Off vote rail (`forge_votes`, same `forge:cid` id), a real page-view counter (`forge_creations.view_count`), a signed-in comment thread (`forge_comments`, bell-notifies the creator via the `comment` event type), paid remix via the existing x402 rail, embed/share/download, and a same-category suggested-models rail. Linked from the Details button on `/creations` cards and the Forge showcase. Tests: [tests/model-lib.test.js](tests/model-lib.test.js) |
| Labs (hidden-gems hub) | [pages/labs.html](pages/labs.html) + [src/labs.js](src/labs.js) `→ /labs` | In-repo | Data-driven discovery hub: renders every `data/pages.json` entry flagged `showcase: true` as a live card (status check + iframe preview), filterable by category |
-| Examples gallery | [pages/examples.html](pages/examples.html) `→ /examples`, curated snippets [public/examples.js](public/examples.js), generated index renderer [public/examples-index.js](public/examples-index.js), styles [public/examples.css](public/examples.css) | Live | Two halves. The top is six copy-paste snippets that RUN on the page: each is a complete document loading the production CDN bundle into a sandboxed iframe, so "Run" executes exactly the code shown. The bottom is every example that ships in the repo (39 as of 2026-07-30), generated by [scripts/build-examples-index.mjs](scripts/build-examples-index.mjs) scanning every `examples/` directory into [data/examples.json](data/examples.json), mirrored to the served [public/examples.json](public/examples.json) by [scripts/mirror-examples-index.mjs](scripts/mirror-examples-index.mjs) (`npm run build:examples` runs both). Because it is scanned, the page cannot advertise a deleted example or miss an added one; each card carries the files it contains and the command that runs it. Tests: [tests/examples-page.test.js](tests/examples-page.test.js), [tests/examples-index.test.js](tests/examples-index.test.js) |
+| Holo Sticker (procedural foil demo) | [pages/holo.html](pages/holo.html) `→ /holo`, app [src/holo.js](src/holo.js), styles [src/holo.css](src/holo.css) | Live | A real-time holographic foil sticker rendered with physical materials, fully procedural (no assets fetched): tilt it with the pointer, peel the corner (vertex-shader cylinder roll), switch foil styles, die-cut arbitrary typed text via a marching-squares vectorizer, and download the frame as a PNG |
+| Examples gallery | [pages/examples.html](pages/examples.html) `→ /examples`, curated snippets [public/examples.js](public/examples.js), generated index renderer [public/examples-index.js](public/examples-index.js), styles [public/examples.css](public/examples.css) | Live | Two halves. The top is six copy-paste snippets that RUN on the page: each is a complete document loading the production CDN bundle into a sandboxed iframe, so "Run" executes exactly the code shown. The bottom is every example that ships in the repo (40 as of 2026-08-05), generated by [scripts/build-examples-index.mjs](scripts/build-examples-index.mjs) scanning every `examples/` directory into [data/examples.json](data/examples.json), mirrored to the served [public/examples.json](public/examples.json) by [scripts/mirror-examples-index.mjs](scripts/mirror-examples-index.mjs) (`npm run build:examples` runs both). Because it is scanned, the page cannot advertise a deleted example or miss an added one; each card carries the files it contains and the command that runs it. Tests: [tests/examples-page.test.js](tests/examples-page.test.js), [tests/examples-index.test.js](tests/examples-index.test.js) |
| Cookbook (runnable recipes) | Index [pages/cookbook.html](pages/cookbook.html) `-> /cookbook`, recipe viewer [pages/recipe.html](pages/recipe.html) `-> /cookbook/<slug>`, manifest [public/cookbook-manifest.js](public/cookbook-manifest.js), styles [public/cookbook.css](public/cookbook.css), recipe prose [docs/cookbook/](docs/cookbook), runnable files [public/cookbook/recipes/](public/cookbook/recipes), notebook export [public/cookbook/self-correcting-3d/](public/cookbook/self-correcting-3d) | Live | The sibling of the Examples gallery, and deliberately a different thing: an example is a snippet you read on the page, a recipe is a file you download and run. Five recipes, each one executed against the live API before it was published: a standard-library text-to-3D CLI, a parallel asset-pack builder that emits a manifest plus a gallery, an MCP server that hands Claude Code or Cursor a 3D tool, a CI budget gate over [api/3d/inspect.js](api/3d/inspect.js), and the function-calling-plus-vision notebook also submitted to the OpenAI Cookbook. The manifest is the single source of truth for both surfaces; recipe prose is markdown under `docs/cookbook/` fetched by the viewer, so adding a recipe is a manifest entry plus a `.md` plus the file itself. Route order is load-bearing in both [vercel.json](vercel.json) and the dev middleware: the notebook's static export must be matched before the generic `/cookbook/<slug>` rule or the viewer shadows it. Docs: [public/cookbook/recipes/README.md](public/cookbook/recipes/README.md). Tests: [tests/cookbook.test.js](tests/cookbook.test.js) |
| Cross-entity search | [pages/search.html](pages/search.html) `→ /search`, backend [api/search.js](api/search.js) + query layer [api/_lib/cross-search.js](api/_lib/cross-search.js) | Live | The one search across every creation type — avatars, on-chain/Solana agents, forged 3D models, worlds, and coins. Federates (not one SQL UNION — the stores are genuinely heterogeneous, two of five aren't even in the same database) five parallel queries, normalizes into one card shape, and ranks by recency plus real signals (follower count via `user_follows`, remix count, view count) — see the file header in `api/search.js` for the full unify-vs-federate writeup. Model results carry a working "Remix — $0.25" action against the existing paid rail ([api/x402/remix-asset.js](api/x402/remix-asset.js)), reused from [pages/creations.html](pages/creations.html) rather than re-derived. Coin search checks three.ws's own launch directory (`pump_agent_mints`) first, then falls back to market-wide pump.fun/Birdeye search for broader coverage (those external matches carry no verified timestamp or creator profile, and are ranked/labelled accordingly). Linked from the Discover nav menu. |
| Cross-surface rankings, streaks & badges | [pages/rankings.html](pages/rankings.html) `→ /rankings`, backend [api/leaderboard/unified.js](api/leaderboard/unified.js), streak/badge engine [api/_lib/streaks.js](api/_lib/streaks.js) (migration [api/_lib/migrations/20260712020000_leaderboard_streaks_badges.sql](api/_lib/migrations/20260712020000_leaderboard_streaks_badges.sql)), daily Top-10 badge sweep [api/cron/leaderboard-rollup.js](api/cron/leaderboard-rollup.js) | Live | Five real, queried leaderboard metrics — creations (forge models + worlds), remixes received, coin launches, followers, and walk distance (signed-in walkers, all-time) — ranked live with the viewer's own rank pinned even off-page. Every signed-in qualifying action (login, a finished forge model, a saved world, a `/walk` session) rolls a per-user daily streak in `user_streaks` via `recordDailyActivity()`, called from [api/_lib/auth.js](api/_lib/auth.js), [api/_lib/forge-store.js](api/_lib/forge-store.js), [api/_lib/diorama-store.js](api/_lib/diorama-store.js), and [api/walk/metrics.js](api/walk/metrics.js). Four real earned badges persist in `user_badges`: First Creation, Remixed (awarded in [api/x402/remix-asset.js](api/x402/remix-asset.js) when a remix lands on your creation), 7-Day Streak, and a daily-refreshed `top10_<metric>` per leaderboard. Streak + badges surface on the profile ([pages/profile.html](pages/profile.html)) and the Rankings page itself. Rejected metrics (documented in `api/leaderboard/unified.js`'s header): royalties earned in USD (the settlement record is a single overwritten JSONB column, not a cumulative ledger) and `/play` activity (no per-human-user session table exists). |
@@ -70,7 +72,7 @@ bottom.
| Verifiable 3D provenance (content credentials) | Spec [specs/PROVENANCE_3D.md](specs/PROVENANCE_3D.md), pure core [api/_lib/provenance-3d.js](api/_lib/provenance-3d.js), Solana anchor [api/_lib/provenance-anchor.js](api/_lib/provenance-anchor.js), MCP tools [api/_mcp3d/tools/provenance.js](api/_mcp3d/tools/provenance.js) (`verify_provenance` free, `anchor_provenance` paid $0.05), free REST verify [api/provenance.js](api/provenance.js) `→ /api/provenance`, viewer badge [public/viewer.html](public/viewer.html), docs [docs/provenance.md](docs/provenance.md). | Live (verify) · anchor gated on issuer key + devnet funds | C2PA-style signed content credentials for AI 3D: creator, prompt, model/provider, lineage, timestamp, and the GLB's sha256, ed25519-signed by the three.ws issuer with the credential hash anchored on Solana. Free public `verify_provenance` / `GET /api/provenance?src=…` recompute the hash and return `verified | tampered | unknown` (a single changed byte → tampered); the verify path and response are coin-clean (both stores). `anchor_provenance` signs + writes the SPL Memo anchor + stores the credential in R2. Tests: [tests/provenance-3d.test.js](tests/provenance-3d.test.js). Evidence: [prompts/store-submissions/_generated/provenance/](prompts/store-submissions/_generated/provenance/). Store-submission prompt 19. |
| OpenAI Select Partner (partner surface + announcement pack) | [pages/openai/index.html](pages/openai/index.html) `→ /openai`, badge assets [public/partners/openai/](public/partners/openai), announcement [blog/three-ws-openai-select-partner.html](blog/three-ws-openai-select-partner.html) `→ /blog/three-ws-openai-select-partner`, directory card in [pages/partners.html](pages/partners.html) `→ /partners`, press/social pack [marketing/openai-select-partner/](marketing/openai-select-partner/README.md), original OpenAI-supplied badge files + press-release template [OAI Select Tier Assets/](OAI%20Select%20Tier%20Assets/README.md) | Live | three.ws's OpenAI Partner Network Select-tier surface. `/openai` is the partner landing: the supplied badge (used unmodified, on a white plate), the four live OpenAI surfaces (the free keyless [3D Studio MCP connector](docs/mcp-studio.md) `→ /api/mcp-studio`, the custom-GPT Actions twin `→ /api/3d/studio`, [Spatial MCP](specs/SPATIAL_MCP.md), and [AR in ChatGPT](docs/chatgpt-ar.md)), the connect table, and the nine-tool list. The marketing pack holds badge-usage rules and the press-release draft, which is gated on OpenAI's written approval before publishing (see its README). |
| NVIDIA Inception (membership surface + GPU docs cluster) | Landing page [pages/nvidia/index.html](pages/nvidia/index.html) `→ /nvidia` (vercel route + vite input + dev middleware, same wiring as `/openai`), membership doc [docs/nvidia-inception.md](docs/nvidia-inception.md) `→ /docs/nvidia-inception` + overview deck [docs/nvidia-inception/index.html](docs/nvidia-inception/index.html) `→ /docs/nvidia-inception/index.html`, free hosted-model map [docs/nvidia-models.md](docs/nvidia-models.md) `→ /docs/nvidia-models`, forum write-up [docs/nvidia-nemotron-spotlight.md](docs/nvidia-nemotron-spotlight.md) `→ /docs/nvidia-nemotron-spotlight`, tutorials [docs/tutorials/nvidia-3d-free.md](docs/tutorials/nvidia-3d-free.md) `→ /tutorials/nvidia-3d-free` and [docs/tutorials/nvidia-nim-self-host.md](docs/tutorials/nvidia-nim-self-host.md) `→ /tutorials/nvidia-nim-self-host`, engineering post [blog/image-to-3d-on-nvidia-l4-and-blackwell.html](blog/image-to-3d-on-nvidia-l4-and-blackwell.html) `→ /blog/image-to-3d-on-nvidia-l4-and-blackwell`, member badge [public/marks/nvidia-inception-badge.svg](public/marks/nvidia-inception-badge.svg) in [public/footer.html](public/footer.html), directory card in [pages/partners.html](pages/partners.html) `→ /partners` | Live | Everything NVIDIA on the platform, in two layers. **Free hosted lane:** one `NVIDIA_API_KEY` behind TRELLIS text-to-3D, FLUX.1-schnell, the Llama/Nemotron chat lineup, Nemotron vision, nv-embedqa, the reranker, NemoGuard, and Magpie speech (`nvidia-models`). **Self-hosted GPU fleet:** 12 Cloud Run GPU services, 11 on `nvidia-l4` and one on `nvidia-rtx-pro-6000` (Blackwell), covering text/image-to-3D, texture, remesh, rigging, and motion (see each `workers/model-*/README.md`). Membership was accepted July 2026 and is a startup program, not a partnership or an investment; the badge links to NVIDIA's startup program and must not imply endorsement. |
-| Press kit (brand marks + media assets) | [pages/press/index.html](pages/press/index.html) `→ /press`, marks [public/brand/](public/brand), layout source [marketing/brand/](marketing/brand/README.md), renderer [scripts/render-brand-assets.mjs](scripts/render-brand-assets.mjs) `npm run build:brand-assets` | Live | The self-serve press surface: transparent-PNG marks (cube, horizontal and stacked lockups for dark and light grounds), the OpenAI announcement graphics, boilerplate at three lengths with copy buttons, fast facts, and the mark-usage rules. Everything is rendered from source rather than hand-exported, so a copy change re-renders the whole set; the renderer also builds `/brand/three-ws-press-kit.zip` with a README carrying the usage rules so the files cannot travel without them. Announcement cards come from [marketing/openai-select-partner/cards/social-card.html](marketing/openai-select-partner/cards/social-card.html) via `npm run build:openai-cards`. |
+| Press kit (brand marks + media assets) | [pages/press/index.html](pages/press/index.html) `→ /press`, marks [public/brand/](public/brand), layout source [marketing/brand/](marketing/brand/README.md), renderer [scripts/render-brand-assets.mjs](scripts/render-brand-assets.mjs) `npm run build:brand-assets` | Live | The self-serve press surface: transparent-PNG marks (cube, horizontal and stacked lockups for dark and light grounds), the OpenAI announcement graphics, boilerplate at four lengths (one line, short, long, and a full-length bio) with copy buttons, fast facts, and the mark-usage rules. Everything is rendered from source rather than hand-exported, so a copy change re-renders the whole set; the renderer also builds `/brand/three-ws-press-kit.zip` with a README carrying the usage rules so the files cannot travel without them. Announcement cards come from [marketing/openai-select-partner/cards/social-card.html](marketing/openai-select-partner/cards/social-card.html) via `npm run build:openai-cards`. |
| Sperax partnership + SperaxOS plugin | [pages/sperax.html](pages/sperax.html) `→ /sperax`, plugin [public/sperax/](public/sperax/README.md), manifest `→ /.well-known/sperax-plugin.json`, tools [api/chat-plugin/[tool].js](api/chat-plugin/%5Btool%5D.js) `→ /api/chat-plugin/*`, panel `→ /sperax/iframe/`, bundled SDK component [chat-plugin/](chat-plugin) (`@three-ws/chat-plugin`, for hosts that mount plugins as React components instead of framing the manifest) | In-repo · Live | Partnership landing for the SperaxOS integration: three.ws ships as a standalone `plugin.delivery` plugin that gives a SperaxOS agent an embodied 3D avatar (speak/gesture/emote/render_agent), bound to an ERC-8004 identity, settling over Base x402. Launch offer: free AI credits for three.ws users on [chat.sperax.io](https://chat.sperax.io) — page explains what it is and how to claim. Blog: [/blog/three-ws-speraxusd-integration](blog/three-ws-speraxusd-integration.html) |
| Agent Monitor (fleet ops board) | [pages/monitor.html](pages/monitor.html) + [src/monitor.js](src/monitor.js) `→ /monitor` | In-repo · Live | HQ-style ops-room dashboard for the whole 3D agent fleet on one screen, every panel a real public feed on its own poll cadence: fleet ranked by real actions ([api/agents/public.js](api/agents/public.js) `sort=live`) with a click-to-load 3D `<agent-3d>` spotlight, live screen casts ([api/agent-screen-active.js](api/agent-screen-active.js)), 24h money pulse + 7d sparkline + agent coin launches ([api/pulse.js](api/pulse.js) `view=stats`), delta-polled on-chain event wire (`/api/pulse` with `head_cursor`), x402 revenue by endpoint ([api/x402-revenue.js](api/x402-revenue.js)), A2A hire volume ([api/agent-economy/volume.js](api/agent-economy/volume.js)), uptime probes ([api/status.js](api/status.js)), a community forge feed ([api/forge-gallery.js](api/forge-gallery.js)), the tip-earner leaderboard, and the crew directory ([api/crews/directory.js](api/crews/directory.js)). Panel controls: fleet search + sort (server `q=`/`sort=`), wire kind filters + pause, x402 period and A2A window toggles, mainnet/devnet switch, spotlight prev/next/fullscreen, and keyboard shortcuts (`f` search, `r` refresh, `[`/`]` cycle spotlight) |
| Live Agents wall (mission control) | [pages/agents-live.html](pages/agents-live.html) + [src/agents-live.js](src/agents-live.js) `→ /agents-live` | In-repo · roster [api/agents/public.js](api/agents/public.js) (`sort=live`), per-agent SSE [api/agent-screen-stream.js](api/agent-screen-stream.js) | Real-time grid of every meaningful agent, ranked by most-recent on-chain/skill action (never-used placeholders suppressed). Each card streams a live caster feed when watched, else its real `agent_actions` as a terminal + an "active Nm ago" recency chip. Layers: showrunner spotlight ([src/showrunner.js](src/showrunner.js)), reputation arena ([src/agents-live-arena.js](src/agents-live-arena.js)), platform ticker ([src/theater-feed.js](src/theater-feed.js)) |
diff --git a/docs/build.md b/docs/build.md
index 2c371acba..008ba6ffb 100644
--- a/docs/build.md
+++ b/docs/build.md
@@ -8,13 +8,13 @@ touching the build pipeline.
| Command | What it does |
| --- | --- |
-| `npm run build` | The app build: `prebuild` lifecycle → `vite build` (`--max-old-space-size=6144`) → `scripts/strip-sw-from-embeds.mjs` → `scripts/inject-tour-boot.mjs`. Output → `dist/`. |
-| `npm run build:gcp` | The **full pre-deploy build**, in the load-bearing order: build info snapshot → `npm run build` (the vite build wipes `dist/`, so it must run first) → UMD library build (`build:lib:full`) → `publish:lib` (mirrors the library into `dist/`) → `build:info` → `check:dist`. Run this, not bare `npm run build`, before deploying: `check:dist` fails without the published library bundle. |
-| `npm run deploy:gcp` | The **production deploy**: `check:dist` + `db:check` gates → `gcloud builds submit` (Docker image via `server/cloudbuild.yaml`) → Cloud Run (`three-ws-api`, `us-central1`) → CDN cache purge. Run `npm run build:gcp` first so `dist/` is complete (see [CI parity](#ci-parity)). |
+| `npm run build` | The app build: `prebuild` lifecycle → `vite build` (`--max-old-space-size=6144`) → `scripts/strip-sw-from-embeds.mjs` → `scripts/inject-tour-boot.mjs` → `scripts/inject-atlas.mjs`. Output → `dist/`. |
+| `npm run build:gcp` | The **full pre-deploy build**, in the load-bearing order: `check:conflicts` → `check:browser-graph` → `ensure:avatar-studio` → build info snapshot → `build:chat` → `npm run build` (the vite build wipes `dist/`, so everything that writes into `dist/` comes after it) → UMD library build (`build:lib:full`) → `publish:lib` (mirrors the library into `dist/`) → `build:info` → `check:dist` → `check:pages`. Run this, not bare `npm run build`, before deploying: `check:dist` fails without the published library bundle. |
+| `npm run deploy:gcp` | The **production deploy**: `check:dist` + `check:pages` + `db:check` gates → `gcloud builds submit` (Docker image via `server/cloudbuild.yaml`) → Cloud Run (`three-ws-api`, `us-central1`) → CDN cache purge → `smoke:prod` sweep of the live site. Run `npm run build:gcp` first so `dist/` is complete (see [CI parity](#ci-parity)). |
| `npm run deploy:gcp:full` | `build:gcp` + `deploy:gcp` in one command. |
| `npm run build:vercel` | Legacy full-build orchestrator (`scripts/build-vercel.mjs`) from the Vercel era — runs the gate suite, bundles the API with esbuild, and builds every sub-package. **Not on the Cloud Run deploy path**; kept for full local reproduction (see [the trap](#the-esbuild-overwrite-trap)). |
| `npm run clean` | `rm -rf dist/* dist-lib/*`. |
-| `npm run check:dist` | Asserts the published `agent-3d` library bundle + `dist-lib` mirror exist and the version matches `package.json` (`scripts/check-dist.mjs`). |
+| `npm run check:dist` | Asserts the published `agent-3d` library bundle + `dist-lib` mirror exist, the version matches `package.json`, and a short list of critical static pages resolves in `dist/` (`scripts/check-dist.mjs`). The full page sweep against the `vercel.json` route table is `npm run check:pages` (`scripts/check-pages.mjs`). |
| `npm run audit:deploy` | Pre-flight for the three 2026-06-11 outage classes: committed symlinks, unsatisfied peer deps, undeclared `api/` imports (`scripts/audit-deploy-artifacts.mjs`). |
| `npm run guard:esbuild` | esbuild-trap guard — blocks committing a bundled `api/*.js` (scans the git index). `:all` sweeps the working tree. |
@@ -33,14 +33,15 @@ npm run deploy:gcp # build the image + deploy to Cloud Run
only: the vite step wipes `dist/`, so without the follow-on `publish:lib`
mirror the `check:dist` gate fails. `build:gcp` encodes the correct order.
-`deploy:gcp` runs `check:dist` and `db:check`, then `gcloud builds submit
+`deploy:gcp` runs `check:dist`, `check:pages`, and `db:check`, then `gcloud builds submit
--config server/cloudbuild.yaml`. Cloud Build builds the root `Dockerfile` on a
32-vCPU machine with BuildKit inline caching (an unchanged `package-lock.json`
skips `npm ci`), pushes the image, deploys it to Cloud Run in one run, and the
-`deploy:gcp:purge-cdn` step invalidates the CDN cache. The image copies the
+`deploy:gcp:purge-cdn` step invalidates the CDN cache, after which `smoke:prod`
+sweeps every registered page on the live site. The image copies the
already-built `dist/` and runs `server/index.mjs`, which serves the static
front-end, the `vercel.json` route table, and every `api/**` handler from source
-(no per-route bundling). The scheduled jobs (89 crons in `vercel.json` at last
+(no per-route bundling). The scheduled jobs (103 crons in `vercel.json` at last
count) run on **Google Cloud Scheduler** driven off the `vercel.json` cron
list; there is **no GitHub Actions CI**. Full runbook: [docs/ops/gcp-production.md](./ops/gcp-production.md).
@@ -137,11 +138,12 @@ head -1 api/<route>.js # bundle if it starts with __defProp / createRequire /
## Embed integrity
Embed surfaces (`/widget`, `/embed`, `/agent-embed`, `/a-embed`,
-`/avatar-embed`, `/agent-token-page`) load inside third-party iframes. They must
+`/avatar-embed`, `/agent-token-page`, `/assistant-frame`) load inside third-party iframes. They must
**not** register the service worker — an SW registered from an iframe is scoped
to `https://three.ws/` and would intercept every other tab on the origin.
-`scripts/strip-sw-from-embeds.mjs` runs as the last step of `npm run build` and
+`scripts/strip-sw-from-embeds.mjs` runs straight after the vite step of
+`npm run build` (before `inject-tour-boot` and `inject-atlas`) and
removes the VitePWA `register-sw` `<script>` from each embed HTML in `dist/`. It
is idempotent and fails loudly if no embed HTML is found. Verify with:
diff --git a/docs/guards.md b/docs/guards.md
index d56fb8da8..400fda2bb 100644
--- a/docs/guards.md
+++ b/docs/guards.md
@@ -101,6 +101,7 @@ Run `npm run audit:guards` to print the current count and per-stage breakdown. T
| Route documentation | `npm run audit:pages` | Every human-facing route is documented in `data/pages.json`. |
| Declared pages resolve | `npm run check:pages` | Every page declared in `data/pages.json` is actually reachable. |
| Routing and 404 model | `npm run audit:routes` | Catalog pages reachable, unknown paths reach the designed 404, no shadowed routes. |
+| Route shadowing | `npm run audit:route-shadowing` | Every handler under `api/` that looks routed can actually be reached through the production router's walk of `vercel.json`. |
| API handlers export a body | `npm run audit:handlers` | No API handler ships empty or without an export. |
| The `[hidden]` guard | `npm run audit:hidden-guard` | Every page resolves the CSS that makes `hidden` actually hide. |
| Site link integrity | `npm run audit:links` | Every navigable target resolves to a real route or file. |
@@ -110,10 +111,15 @@ Run `npm run audit:guards` to print the current count and per-stage breakdown. T
| Guard | Command | Protects |
|---|---|---|
| Documentation integrity | `npm run audit:docs` | No dead relative link, no command naming a missing script, no package without a README. |
+| Tutorial reachability | `npm run check:tutorials` | Every tutorial appears in the library manifest, has its markdown on disk, and is registered in `data/pages.json`. |
+| Runnable doc samples | `npm run check:runnable-docs` | Every sample a reader can press Run on still returns what the doc says it returns. |
+| Doc figures | `npm run check:doc-media` | Every figure a doc points at was really captured, still matches its recipe, and carries alt text. |
+| Tour atlas truth | `npm run audit:tour-atlas` | `public/tour/atlas.json` matches a fresh render: every stop resolves and every promised screenshot exists. |
| x402 endpoint catalog | `npm run audit:x402-catalog` | Every paid endpoint is documented, so a buyer can find it. |
| MCP manifests | `npm run audit:mcp` | Every MCP manifest satisfies the official registry's rules, offline. |
| MCP golden contracts | `npm run audit:mcp-golden` | Tool names, descriptions, and schemas against a committed snapshot. |
| MCP safety annotations | `npm run audit:mcp-safety` | Declared `readOnlyHint` and `destructiveHint` match what handlers do. |
+| MCP tool catalog freshness | `npm run audit:mcp-catalog` | `public/mcp-catalog.json` matches what the MCP servers actually expose. |
| Cron schedule drift | `npm run check:cron-syntax`, `npm run check:cron-drift` | Valid expressions, and agreement with the running Cloud Scheduler jobs. |
### Build and deploy
@@ -130,12 +136,16 @@ Run `npm run audit:guards` to print the current count and per-stage breakdown. T
| Guard | Command | Protects |
|---|---|---|
| Console sweep | `npm run audit:console` | A clean browser console on every route, desktop and mobile. |
+| Overlapping fixed overlays | `npm run audit:overlays` | No persistent floating widget can cover another one's controls. |
| Image loading attributes | `npm run check:images` | Every JS-rendered image sets `loading` and `decoding`. |
| Wardrobe catalog integrity | `npm run audit:garments` | Every garment validates and its GLB hash matches its manifest. |
| Rig coverage | `npm run audit:rig-coverage` | How well the canonicalizer maps skeletons actually stored in production. |
| Service wallet configuration | `npm run audit:service-wallets` | Balances, floors, and whether the advertised x402 fee payer matches the real secret. |
| Fleet wallet flows | `npm run audit:wallet-flows` | Where the platform's SOL is, where it went, and whether any is leaking. |
| Relayer balances | `npm run check:relayer-balances` | Every configured Solana signer is above its documented minimum. |
+| LLM spend metering | `npm run audit:llm-metering` | Every LLM lane that spends money reports a real cost, never exactly $0 and never an unknown. |
+| Cron liveness | `npm run audit:cron-liveness` | Each cron in `vercel.json` resolves to a handler that exists, imports, answers a live request, and refuses an unauthenticated one. |
+| Custodial key health | `npm run audit:custodial-keys` | Every stored custodial Solana secret still decrypts under the current `WALLET_ENCRYPTION_KEY`. |
| Delegation contract addresses | `npm run check:erc7710` | Every delegation-manager address is a deployed contract. |
---