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
feat: enhance agent detail loading with resilient error handling and add dataset integrity tests for avatar engines
udvkfdccba096afd
diff --git a/ARCHITECTURE.md b/ARCHITECTURE.mdindex 6a250b56a..7a28ef82c 100644--- a/ARCHITECTURE.md+++ b/ARCHITECTURE.md@@ -37,7 +37,7 @@ graph TDLib["api/_lib/ — 413 shared utilities\ndb.js · auth.js · redis.js · r2.js · x402-spec.js · memory-store.js"]end- APILayer --> Neon["Neon Postgres\n(primary DB)\npgvector · ~260 tables"]+ APILayer --> Neon["Neon Postgres\n(primary DB)\ncitext · pg_trgm · pgcrypto\n~270 tables · JSONB embeddings"]APILayer --> Redis["Upstash Redis REST\n(rate limit + cache)"]APILayer --> R2["Cloudflare R2\nGLBs · Audio · Thumbnails · Metadata"]APILayer --> MCPSvc["MCP Servers — 8 remote endpoints\n/api/mcp · /api/mcp-3d\n/api/pump-fun-mcp · /api/ibm-mcp · + 4 more"]@@ -187,10 +187,10 @@ three.ws is a **Multi-Page Application (MPA)** with no client-side router framew| Surface | Route | HTML | JS Controller | Description ||---------|-------|------|---------------|-------------|| Home / Landing | `/` | `pages/home.html` | `src/app.js` (partial) | Walk companion, footer-bot, hero stage, live token ticker |-| 3D Viewer / App | `/app` | `pages/app.html` | `src/app.js` | Core GLB viewer: material editor, texture inspector, scene explorer, magic brush, Runtime LLM brain, widget system, drop-zone upload |+| 3D Viewer / App | `/app` (`/app-next`) | `pages/app-next.html` | `src/app-next-overlay.js` + `src/next-layout.js` | Core GLB viewer: material editor, texture inspector, scene explorer, magic brush, Runtime LLM brain, widget system, drop-zone upload. Legacy `pages/app.html` (`src/app.js`) is served at `/app-classic` || Agent Edit | `/agent/:id/edit`, `/agent/new` | `pages/agent-edit.html` | `src/agent-edit.js` | Full agent editor: name, description, avatar picker, skills config, wallet chips, mood engine, autopilot brain || Create Agent | `/create-agent` | `pages/create-agent.html` | `src/create-agent.js` | 5-step wizard: Basics → 3D Model → Skills → Personality → Review |-| Agent Detail | `/agent/:id` | `pages/agent-detail.html` | `src/agent-detail.js` | Live wallet pulse, mirror panel, strategy panel, patronage, validation badge, WebGL avatar, on-chain status, coin launch history |+| Agent Detail | `/agent/:id` (301 → canonical) | `public/agent/index.html` (`src/agent-home.js`); `pages/agent-detail.html` (`src/agent-detail.js`) | `/agent/:id` 301-redirects to the canonical profile (`public/agent/index.html`). Live wallet pulse, mirror panel, strategy panel, patronage, validation badge, WebGL avatar, on-chain status, coin launch history || Agent Wallet Hub | `/agent/:id/wallet` | `pages/agent-wallet.html` | `src/agent-wallet-hub/index.js` | **22-tab** Solana wallet (`src/agent-wallet-hub/tabs/`): Balance, Portfolio, Deposit, Trade, Snipe, Orders, Earn, Autopilot, Intents, Signals, Pay, Vanity, Policy, Withdraw, Give, Access, Recovery, Guard, Proof, **Copilot, Pulse, Reputation** || Agent Mind Palace | `/agent/:id/mind` | `pages/agent-mind.html` | `src/agent-mind.js` + `src/mind-palace.js` | Visual 3D memory graph || Agent Studio | `/agent/:id/studio` | `pages/agent-studio.html` | `src/studio/studio-shell.js` | Tabs: Brain, Memory, Body, Money, Skills |@@ -341,7 +341,7 @@ three.ws is a **Multi-Page Application (MPA)** with no client-side router framew| Hydrate (ERC-8004) | `/hydrate` | `public/hydrate/index.html` — on-chain agent hydration tool || Vanity Wallet | `/vanity-wallet` | `public/vanity-wallet.html` — browser-side Solana vanity address grinder || ETH Vanity | `/eth-vanity` | `public/eth-vanity.html` — browser-side EVM vanity address grinder |-| Brain (Persona Builder) | `/brain` | `pages/brain.html` — 14-provider LLM playground |+| Brain (Persona Builder) | `/brain` | `pages/brain.html` — 20+ provider LLM playground || IBM Suite | `/ibm/*` | `pages/ibm/` — IBM watsonx.ai integration pages |---@@ -441,7 +441,7 @@ Requests authenticate through one of these gates:| `x402-paid-endpoint.js` | `paidEndpoint()` factory — wraps any handler with 402 challenge || `x402.js` | pump.fun agent-payments 402 protocol (separate from CDP x402) || `agent-wallet.js` | Custodial agent keypair load/encrypt/decrypt (AES-256-GCM) |-| `memory-store.js` | Tiered memory engine (working/recall/archival, pgvector embeddings) |+| `memory-store.js` | Tiered memory engine (working/recall/archival; JSONB-array embeddings, cosine in JS — no pgvector) || `granite-guardian.js` | IBM Granite Guardian 12-risk taxonomy safety gate || `three-tier.js` | $THREE holder tier resolution (Genesis/Diamond/Platinum/Gold/Silver/Bronze) || `three-gate.js` | $THREE token balance check (Redis-cached 30s, fails open on RPC error) |@@ -477,7 +477,7 @@ Requests authenticate through one of these gates:| `/api/agents/:id/autopilot` | GET/POST | Per-agent autopilot policy config || `/api/agents/:id/memory` | GET/POST/DELETE | Agent memory CRUD || `/api/agents/:id/brain` | GET/PUT | Persona + LLM config |-| `/api/agents/:id/voice-clone` | POST | ElevenLabs voice clone |+| `/api/agents/:id/voice` · `/api/agents/:id/voice/clone` | GET/PUT · POST | Voice status/assign/tune; ElevenLabs voice clone (POST `/voice/clone`) || `/api/agents/:id/embed` | GET | Embedding vector (NIM or VoyageAI) || `/api/agents/:id/strategies` | GET/POST | Agent strategy management || `/api/agents/:id/sns` | POST | Mint `*.threews.sol` subdomain |@@ -600,7 +600,7 @@ Representative endpoints:| Endpoint | Description ||----------|-------------|| `GET/POST/DELETE /api/agent-memory` | Agent memory CRUD; ERC-191 signed writes |-| `POST /api/memory/search` | Semantic + lexical search over `agent_memories` (pgvector cosine) |+| `POST /api/memory/search` | Semantic + lexical search over `agent_memories` (JSONB embeddings, cosine computed in JS) || `GET /api/memory/context` | Working-tier token-budgeted context assembly || `POST /api/memory/curate` | Memory curation || `GET /api/memory/graph` | Entity knowledge graph (Zep/Graphiti-style temporal KG) |@@ -945,7 +945,7 @@ Beyond animated-USDZ export, a full AR stack: `src/ar/webxr.js` (`immersive-ar`## MCP Layer-three.ws exposes **~311 total MCP tools** across a multi-tier server architecture.+three.ws exposes **~317 total MCP tools** (≈115 remote + 180 domain-package + 22 stdio) across a multi-tier server architecture.### MCP Protocol@@ -1421,7 +1421,7 @@ Tiered memory architecture (Letta/MemGPT model):| Recall | Semantic search results | ~2000 tokens || Archival | Long-term knowledge graph | Unlimited (paginated) |-**Embeddings:** NVIDIA NIM `nv-embedqa-e5-v5` (primary) · OpenAI `text-embedding-3-small` (backstop) — 1024-dim vectors stored in pgvector.+**Embeddings:** NVIDIA NIM `nv-embedqa-e5-v5` (primary) · OpenAI `text-embedding-3-small` (backstop) — 1024-dim vectors stored as **JSONB arrays tagged with the embedder** (cosine computed in JS strictly within each embedder space; **no pgvector column**). Postgres extensions in use are `citext`, `pg_trgm`, and `pgcrypto`.**Memory writes:** signed with agent's EVM wallet (ERC-191) for authorship provenance.@@ -1725,7 +1725,7 @@ three.ws/ (root package v1.5.2, Node 24.x)### Vercel Deployment-**Config:** `vercel.json` — ~350+ route rewrites mapping URL patterns to `api/*.js` handlers.+**Config:** `vercel.json` — **932 entries** in the legacy `routes` array mapping URL patterns to `api/*.js` handlers and static assets (no `rewrites`/`redirects`/`headers` arrays), plus a 49-entry `functions` block and 61 `crons`.**Build command:** `npm run build:vercel` (`scripts/build-vercel.mjs`) — esbuild bundles all `api/*.js` functions.@@ -1757,7 +1757,7 @@ three.ws/ (root package v1.5.2, Node 24.x)**Driver:** `@neondatabase/serverless` HTTP driver (tagged-template `sql` with composable fragments)-**Schema:** `api/_lib/schema.sql` — ~260 tables (full list in [Complete Database Table Inventory](#complete-database-table-inventory))+**Schema:** `api/_lib/schema.sql` — ~270 tables (full list in [Database Schema — Complete Table Index](#database-schema--complete-table-index))**Migrations:** `api/_lib/migrations/` — 234 dated migration files (2026-04-29 through 2026-06-23)@@ -1770,8 +1770,8 @@ Key table groups:| Payments | `skill_purchases`, `purchase_receipts`, `x402_payments`, `x402_merchant_settings`, `x402_skus`, `siwx_payments` || Agents | `agent_memories`, `agent_strategies`, `agent_sniper_strategies`, `agent_sniper_positions` || Pump.fun | `pump_agent_mints`, `pump_coin_intel`, `oracle_conviction`, `oracle_narrative`, `wallet_reputation`, `coin_smart_money` |-| Market | `market_maker_policies`, `dca_strategies`, `copy_follows`, `mirror_strategies`, `swarms`, `vaults` |-| Community | `agora_citizens`, `agora_activity`, `clash_rounds`, `tournaments`, `labor_bounties` |+| Market | `market_maker_policies`, `dca_strategies`, `copy_subscriptions`/`copy_executions`, `agent_mirror_follows`/`agent_mirror_fills`, `swarms`, `agent_vaults` |+| Community | `agora_citizens`, `agora_activity`, `clash_battles`, `tournaments`/`tournament_entries`, `agent_bounties`/`agent_jobs` || x402 | `x402_pump_launches`, `x402_checkout_records`, `bsc_consumed_tx` || Infrastructure | `radar_watchlist`, `radar_events`, `firewall_decisions`, `bot_heartbeat` |@@ -1853,65 +1853,13 @@ Stores: GLBs · audio clips · thumbnails · manifests · OG images · validatio### Repository Directory Reference-Every top-level directory in the monorepo, mapped to its purpose and the section that documents it in depth. Surfaces documented elsewhere are cross-referenced rather than re-described.--| Directory | Purpose | Detailed in |-|-----------|---------|-------------|-| `api/` | 1,200+ Vercel serverless functions + `api/_lib/` shared layer | [API Layer](#api-layer) |-| `src/` | Frontend JS modules: page controllers + 60+ subsystem dirs | [Frontend Application](#frontend-application) |-| `pages/` | 150+ HTML MPA entry points (+ `dashboard-next/` SPA shell) | [Frontend Application](#frontend-application) |-| `public/` | Static surfaces, well-known files, animation clips, embed apps | [Frontend Application](#frontend-application) |-| `packages/` | Spec/schema packages + 30+ domain MCP servers (`@three-ws/*`) | [SDK Ecosystem](#sdk-ecosystem) · [MCP Layer](#mcp-layer) |-| `contracts/` | Anchor (Rust) + Solidity (Foundry) on-chain programs | [On-chain & Solana](#on-chain--solana) |-| `crates/` | Rust crates (`vanity-grinder`) | [Rust Crates](#rust-crates-crates) |-| `workers/` | Long-running Node + Python/GPU workers | [Long-Running Workers](#long-running-workers) |-| `services/` | Standalone always-on services (`pump-graduations` indexer) | [Standalone Services](#standalone-services-services) |-| `multiplayer/` | Colyseus real-time room server (`@three-ws/multiplayer`, :2567) | [Other Infrastructure](#other-infrastructure) |-| `infra/` | AWS CDK (TypeScript) — Lambda, S3, CloudWatch | [Other Infrastructure](#other-infrastructure) |-| `deploy/` | Cloud Run + Docker world deployment configs | [Other Infrastructure](#other-infrastructure) |-| `sdk/` · `solana-agent-sdk/` · `agent-payments-sdk/` · `agent-protocol-sdk/` · `agent-ui-sdk/` | Cross-chain agent SDKs (published `@three-ws/*`) | [Top-Level SDKs](#top-level-sdks) |-| `avatar-sdk/` · `walk-sdk/` · `page-agent-sdk/` · `tour-sdk/` | Avatar/embed web-component SDKs | [Top-Level SDKs](#top-level-sdks) |-| `x402-payment-modal/` · `x402-modal-sdk/` | Drop-in x402 checkout modal SDKs | [Published Modal / Payment SDKs](#published-modal--payment-sdks) |-| `mcp-server/` · `mcp-bridge/` | Top-level npm stdio MCP servers | [npm stdio MCP Servers](#npm-stdio-mcp-servers) |-| `apps-sdk/` | OpenAI Apps SDK surface: `embodiment/` helpers + `studio-viewer/` | [Embeds & Plugins](#mobile-embeds--integrations) |-| `chat/` | `three.ws-chat` — standalone fast, light, BYOK chat UI (own Vite app) | [Embeds & Plugins](#mobile-embeds--integrations) |-| `chat-plugin/` | `@three-ws/chat-plugin` — LobeHub sidebar plugin (embodied avatar) | [Embeds & Plugins](#mobile-embeds--integrations) |-| `extensions/` | Browser extension(s): `walk-avatar` | [Embeds & Plugins](#mobile-embeds--integrations) |-| `integrations/` | DCC/tooling bridges: `blender/`, `comfyui/` nodes, `_pyclient` Python client | [Embeds & Plugins](#mobile-embeds--integrations) |-| `solana-mobile/` | Seeker dApp Store build: TWA + PWA + publish + `.well-known` | [Mobile, Embeds & Integrations](#mobile-embeds--integrations) |-| `agents/` | Reference standalone agents: `endpoint-shopper`, `fact-checker`, `tutor`, `unstoppable` | [Reference Agents & Skills](#reference-agents--skills-examples) |-| `pump-fun-skills/` | Composable pump.fun skill modules: `coin-fees`, `create-coin`, `reactive`, `swap`, `tokenized-agents` | [Reference Agents & Skills](#reference-agents--skills-examples) |-| `examples/` | Embed/integration demos: `coach-leo` (VR), `agenc-task-roundtrip`, `pump-fun-agent`, `metamask-agent-wallet`, bare-avatar/minimal HTML | [Reference Agents & Skills](#reference-agents--skills-examples) |-| `marketplace/` | Marketplace plugin assets (`plugins/`) | — |-| `character-studio/` | Web character creator (fork of `m3-org/CharacterStudio`, MIT) | `STRUCTURE.md` |-| `animation-sources/` | Mixamo FBX source library (120+ clips) feeding the animation build | [Animation Pipeline](#animation-pipeline-build-time) |-| `scripts/` | 400+ build, migration, backfill, audit & smoke scripts | [Build, Migration & Audit Scripts](#build-migration--audit-scripts-scripts) |-| `tests/` | Vitest + Playwright test suite (589 `.test.js`) | [Testing & QA](#testing--qa) |-| `prompts/` | Numbered manual QA/audit playbooks (production-readiness, dead-paths, a11y, perf…) | [Testing & QA](#testing--qa) |-| `specs/` | Protocol & format specifications (agent card, manifest, embed, memory, skills…) | [Specifications & Protocol Documents](#specifications--protocol-documents-specs) |-| `docs/` | 100+ public docs + subdirs (tutorials, roadmap, audits, ux-flows, internal) | [Documentation Map](#documentation-map-docs) |-| `data/` | Build-time data: `changelog.json`, `pages.json`, `walk-social.json`, ERC-8004 ledgers | [Vite Frontend Build](#vite-frontend-build) |-| `blog/` | Marketing/blog posts (HTML + Markdown) | — |-| `content/` | Editorial content schedule (`x-schedule`, manifesto) | — |-| `snapshots/` | Captured site snapshots for diffing/regression | — |-| `x402-buildout/` | x402 rollout `PLAN.md` + agent prompts (internal) | — |-| `my-agents/` | Static landing for the on-chain "My Agents" surface | [Auth, Identity & Discovery](#auth-identity--discovery) |+The complete top-level directory map — every directory, its purpose, file counts, and where it is documented in depth — lives in [Repository Directory Atlas](#repository-directory-atlas).---### Testing & QA-**Runner:** `npm test` → `vitest run && playwright test`. The repo holds **589 `.test.js` files** in `tests/`, plus shared `tests/_fixtures/` and `tests/_helpers/`.--| Layer | Tooling | Scope |-|-------|---------|-------|-| Unit / integration | Vitest | API handlers, `_lib` utilities, SDK clients, on-chain guards, animation/retarget math, MCP tool shapes |-| End-to-end | Playwright | Critical browser flows (wallet tabs, agent detail, lipsync, marketplace purchase) |-| SDK suites | `node --test` | Per-package suites under `packages/*/test/` and the top-level SDKs (216+ green) |--Representative coverage: agent custody/trade guards, A2A payment mandates, sniper/oracle scoring, reflection & dreams, reputation UI, avatar lipsync & retargeting, `glb-canonicalize` rig conventions, agent recovery, monetization & labor economics.--**Manual QA playbooks (`prompts/`):** numbered audit prompts run by agents/engineers before release — production-readiness audit, dead-paths & broken-links, console error/warning sweep, build/deploy artifact integrity, routing & 404 audit, unit + e2e coverage, error-handling failsafes, accessibility, responsive/mobile, and Web-Vitals performance.+Full test-suite layout (runners, per-directory counts, heaviest-tested subsystems) and the `prompts/` manual QA playbooks are documented under [Testing & Quality Assurance](#testing--quality-assurance) and [Build, Test & Release Pipeline](#build-test--release-pipeline).---@@ -2087,13 +2035,13 @@ flowchart TDB --> C["recallForChat()"]C --> D["api/_lib/memory-store.js computeContext()"]D --> E["embedQuery\n(NVIDIA NIM nv-embedqa-e5-v5)"]- E --> F["pgvector cosine similarity search\non agent_memories"]+ E --> F["cosine similarity in JS\n(JSONB embeddings on agent_memories)"]F --> G["top-k working + recall tier memories\ninjected into system prompt"]G --> H["LLM generates response"]H --> I["POST /api/agent-memory { content, type }"]I --> J["ERC-191 sign with agent's EVM wallet"]J --> K["INSERT agent_memories"]- K --> L["lazy: embed content → pgvector update"]+ K --> L["lazy: embed content → JSONB embedding update"]subgraph Reflect["reflect-sweep cron (daily)"]R1["gatherReflectionContext\n(recent memories)"]@@ -2395,23 +2343,9 @@ Beyond the page controllers in the Surfaces tables, `src/` contains **62 subsyst----### Agent-Discovery & Well-Known Files (`public/.well-known/`)--Machine-readable manifests that let agents, crawlers, and wallets discover the platform:+### Agent-Discovery & Well-Known Files-| File | Purpose |-|------|---------|-| `3d-agent-card.json` + `.schema.json` | three.ws 3D agent card + its JSON Schema |-| `agent-card.json` | A2A / agent-card discovery |-| `agent-registration.json` | Agent registration descriptor |-| `three-ws-agent.metaplex.json` | Metaplex on-chain agent metadata |-| `ai-plugin.json` | OpenAI plugin manifest |-| `lobehub-plugin.json` | LobeHub plugin manifest |-| `openapi.yaml` | OpenAPI spec for the public API |-| `validators.json` | Allow-listed GLB-validation authorities |-| `security.txt` | Security disclosure contact |-| `x402.json` (served at `/.well-known/x402.json`) | Published x402 payable services (see [Bazaar Marketplace](#bazaar-marketplace)) |-| `three-vanity.json` | Proof-of-grind vanity certificates (see [Vanity Wallet Protocol](#vanity-wallet-protocol)) |+The full set of `/.well-known/` manifests (static `public/.well-known/` + dynamic `api/wk.js` / `api/openapi-json.js`) is catalogued under [Agent Discovery & Well-Known Manifests](#agent-discovery--well-known-manifests).---@@ -2423,62 +2357,145 @@ Standalone HTML apps and asset roots served directly (not Vite-controller pages)### Complete Cron Schedule (`api/cron/`)-**62 scheduled jobs** are declared in `vercel.json` (`crons`). Full inventory by domain (schedule in cron syntax):+The full **61-job** schedule grouped by domain is documented under [Scheduled Jobs (Cron Reference)](#scheduled-jobs-cron-reference). All handlers authenticate via the `CRON_SECRET` Bearer gate.++----| Domain | Job (`/api/cron/…`) — schedule |-|--------|-------------------------------|-| Oracle & intel | `oracle-score` `*/2m` · `oracle-digest` `08:00` · `intel-learn` `*/15m` · `reconcile-decisions` `*/10m` · `gmgn-seed` `03:00` |-| Smart money & reputation | `smart-money-rollup` `*/5m` · `smart-money-graph` `*/10m` · `recompute-reputation` `*/10m` · `trader-score-attest` `09:45` |-| Pump.fun | `pumpfun-monitor` `*/3m` · `pumpfun-graduations-sync` `*/2m` · `pumpfun-signals` `*/15m` · `pump-agent-stats` `*/10m` · `radar-watchlist` `*/10m` |-| Buyback & payouts | `run-buyback` `hourly` · `run-distribute-payments` `:30` · `run-three-buyback` `06:00` · `run-coin-cycle` `*/5m` · `run-coin-payouts` `1-59/5m` · `club-payouts` `2-59/5m` · `cosmetic-splits-sweep` `:15` · `settle-royalties` `03:00` · `treasury-autopilot` `:23` |-| Trading fanout | `copy-fanout` · `mirror-fanout` · `signal-fanout` · `strategy-fanout` (all `*/2m`) · `run-dca` `hourly` |-| Subscriptions & billing | `run-subscriptions` `hourly` · `process-subscriptions` `*/6h` · `process-withdrawals` `hourly` · `expire-pending-purchases` `*/5m` · `flush-usage-events` `*/1m` |-| On-chain attest & index | `erc8004-crawl` `*/15m` · `solana-attestations-crawl` `*/10m` · `solana-attest-event-cleanup` `*/10m` · `custody-attest` `17 */6h` · `index-delegations` `*/5m` |-| Agent lifecycle | `reflect-sweep` `*/30m` · `dead-man-switch` `05:00` · `auto-rig-sweep` `*/5m` · `avaturn-seed-cron` `*/1m` |-| Forge | `forge-seed-cron` `*/1m` · `forge-smoke` `09:30` |-| $THREE | `three-holders-snapshot` `*/5m` |-| IRL & worlds | `irl-drops-refund` `*/10m` · `irl-reap` `:17` · `world-health` `*/15m` |-| Wallet & custody | `wallet-intents` `*/10m` · `relayer-balance-check` `*/6h` |-| X (social) | `run-x-scheduled-posts` `*/1m` · `run-x-triggers` `*/5m` · `fetch-x-metrics` `*/6h` |-| Health & maintenance | `quota-check` `hourly` · `uptime-check` `*/5m` · `/api/llm/health` `hourly` · `audit-log-cleanup` `04:00` · `cleanup-csrf-tokens` `:17` · `siwx-gc` `03:00` |-| Reference agent | `unstoppable-tick` `*/5m` |-| Activity | `pulse-tick` `*/2m` |+### Complete Database Table Inventory-All cron handlers authenticate via the `CRON_SECRET` Bearer gate.+The full ~270-table inventory grouped by domain lives in [Database Schema — Complete Table Index](#database-schema--complete-table-index). Key facts: `api/_lib/schema.sql` + **234 dated migration files** (2026-04-29 → 2026-06-29); extensions `citext`, `pg_trgm`, `pgcrypto` (**no pgvector** — embeddings are JSONB float arrays, cosine in JS); `master_wallets` and a few others are bootstrapped at runtime via `CREATE TABLE IF NOT EXISTS`.----### Complete Database Table Inventory+## Surface & Page Atlas-The schema (`api/_lib/schema.sql` + **234 dated migration files**, 2026-04-29 → 2026-06-23) defines **~260 Postgres tables** (pgvector for embeddings). Full inventory by domain:+Beyond the product surfaces in [Frontend Application](#frontend-application), the site ships a large catalog of demo, embed, legal, news, and marketing pages. Routing is **not** fully auto-resolved — most entry points are explicit Rollup `input` entries in `vite.config.js`; only `pages/dashboard-next/*.html` is auto-discovered, and the rest of `public/` is copied as static assets routed by `vercel.json` (**932 route entries**). Totals: **213 `pages/` + 280 `public/`** HTML files (the latter includes 106 news articles).-| Group | Tables |-|-------|--------|-| Identity & auth | `users` · `sessions` · `api_keys` · `oauth_clients` · `oauth_auth_codes` · `oauth_refresh_tokens` · `password_resets` · `email_verifications` · `csrf_tokens` · `siwe_nonces` · `siws_nonces` · `siwx_nonces` · `gate_nonces` · `saml_request_ids` · `agent_identities` · `agent_registrations_pending` · `user_subdomains` · `solana_credentials` |-| Agents | `agent_versions` · `agent_decisions` · `agent_actions` · `agent_jobs` · `agent_mood_history` · `agent_reflections` · `agent_reflection_runs` · `agent_brain_anchors` · `agent_memories` · `agent_memory_entities` · `agent_memory_entity_links` · `agent_memory_pins` · `agent_bookmarks` · `agent_reviews` · `agent_anomaly_events` |-| Wallets & custody | `user_wallets` · `agent_payout_wallets` · `agent_wallet_capabilities` · `agent_wallet_intents` · `agent_custody_events` · `custody_attestation_epochs` · `custody_attestation_leaves` · `wallet_value_snapshots` · `wallet_reputation` · `agent_withdrawals` · `payouts` · `payment_configs_pending` |-| Recovery & delegation | `agent_recovery_guardians` · `agent_recovery_requests` · `agent_recovery_approvals` · `agent_delegations` · `agent_autopilot_proposals` |-| Payments & x402 | `agent_payments` · `agent_payment_intents` · `agent_revenue_events` · `agent_paid_services` · `siwx_payments` · `token_payments` · `bsc_consumed_tx` · `credit_accounts` · `credit_ledger` · `usage_events` · `developer_webhooks` · `webhook_deliveries` |-| Skills & marketplace | `marketplace_skills` · `marketplace_themes` · `agent_skill_prices` · `skill_pricing_rules` · `skill_purchases` · `skill_access_grants` · `skill_installs` · `skill_license_mints` · `skill_payment_earnings` · `skill_usage_logs` · `skill_ratings` · `skill_reviews` · `skill_bundles` · `bundle_items` · `bundle_purchases` · `purchase_receipts` · `purchase_events` · `paid_assets` · `asset_purchases` · `asset_purchase_receipts` · `asset_prices` · `plugins` |-| Royalties & splits | `fork_royalty_terms` · `fork_royalty_payouts` · `royalty_ledger` · `listing_splits` · `listing_split_recipients` · `split_distributions` · `cosmetic_creator_splits` · `referral_visits` |-| Pump.fun & oracle | `pump_agent_mints` · `pump_agent_payments` · `pump_agent_trades` · `pump_agent_price_points` · `pump_agent_stats` · `pump_coin_intel` · `pump_coin_outcomes` · `pump_coin_wallets` · `pump_intel_weights` · `pump_relay_trades` · `pump_trade_delegations` · `pump_buyback_runs` · `pump_distribute_runs` · `pump_autopilot` · `pumpfun_graduations` · `pumpfun_monitor_cursor` · `pumpfun_signals` · `pumpfun_signals_cursor` · `oracle_conviction` · `oracle_conviction_history` · `oracle_narrative` · `oracle_agent_watch` · `oracle_watch_actions` · `oracle_followers` · `coin_smart_money` · `smart_money_scored` · `smart_wallet_clusters` · `smart_wallet_folded` · `smart_wallet_reputation` · `firewall_decisions` |-| Trading engines | `orders` · `order_fills` · `strategy_backtests` · `strategy_kill_switch` · `agent_strategies` · `agent_strategy_equips` · `agent_strategy_positions` · `agent_sniper_strategies` · `agent_sniper_positions` · `market_maker_policies` · `market_maker_actions` · `dca_strategies` · `dca_executions` · `copy_subscriptions` · `copy_executions` · `agent_mirror_follows` · `agent_mirror_fills` · `signal_feeds` · `signal_emissions` · `signal_deliveries` · `signal_subscriptions` · `swarms` · `swarm_members` · `swarm_votes` · `swarm_payouts` · `agent_vaults` · `vault_backers` · `vault_positions` · `vault_events` · `portfolio_snapshots` |-| Alerts & signals | `pump_alert_rules` · `pump_alert_rule_fires` · `pump_alert_deliveries` · `user_alert_configs` · `user_alert_fires` · `radar_watchlist` · `radar_events` |-| Tournaments & games | `tournaments` · `tournament_entries` · `clash_battles` · `coin_draws` · `coin_events` · `coin_holders` · `coin_launches` · `coin_payouts` |-| Community & social | `agora_citizens` · `agora_activity` · `agora_vouches` · `agora_idempotency` · `crews` · `crew_members` · `crew_invites` · `friendships` · `social_connections` · `user_follows` · `user_mutes` · `direct_messages` · `agent_hires` · `agent_bids` · `agent_bounties` · `bounties` · `bounty_submissions` · `bounty_submission_likes` · `agent_labor_policies` |-| Club & cosmetics | `club_tips` · `club_payouts` · `club_bans` · `club_dancer_wallets` · `rider_passes` · `cosmetic_sales` · `genome_breedings` |-| IRL | `irl_drops` · `irl_drop_claims` |-| Walk & widgets | `walk_sessions` · `walk_events` · `walk_metrics` · `walk_achievements` · `walk_control_sessions` · `walk_control_commands` · `widgets` · `widget_views` · `widget_chat_threads` · `widget_chat_messages` · `widget_knowledge_docs` · `widget_knowledge_chunks` · `world_docs` |-| Avatars & media | `avatars` · `avatar_regen_jobs` · `animation_clips` · `mocap_clips` · `token_metadata` · `launchpad_pages` |-| Forge | `forge_creations` · `forge_votes` · `forge_board_winners` · `forge_seed_jobs` · `forge_consumption_redemptions` · `forge_high_redemptions` |-| Subscriptions & billing | `subscription_plans` · `subscriptions` · `subscription_payments` · `subscription_checkouts` · `creator_subscriptions` · `user_agent_subscriptions` · `agent_subscriptions` · `plan_quotas` · `plan_payment_intents` · `aws_marketplace_customers` · `aws_marketplace_metering` |-| Attestations & ledger | `solana_attestations` · `solana_attestations_cursor` · `solana_attest_event_claims` · `ledger_anchors` · `decision_outcomes` · `audit_log` |-| $THREE | `three_allowances` · `three_buyback_runs` · `three_holder_snapshot` · `three_holder_snapshot_meta` · `three_rewards_distributions` |-| Notifications & infra | `notification_events` · `notification_preferences` · `user_notifications` · `push_subscriptions` · `newsletter_subscribers` · `bot_heartbeat` · `indexer_state` · `circulation_actions` · `scene_gates` · `chat_brand_config` · `user_prefs` |-| Reference agent (Unstoppable) | `unstoppable_activity` · `unstoppable_reflections` · `unstoppable_treasury` |-| X (social) | `x_posts` · `x_scheduled_posts` · `x_triggers` · `x_pending_reviews` |--> `master_wallets` is created at runtime via inline `CREATE TABLE IF NOT EXISTS` rather than a migration (see [Technical Debt](#technical-debt)).+### Demos & Interaction Lab (`/demos/*`)++`public/demos/*.html`, route `/demos/:name` (index `/demos`). Feature demos: `3d-home`, `audio2face` (`/audio2face`), `avatar-sdk`, `react-sdk`, `bonding-curve`, `brain`, `lipsync-tts` (`/lipsync`), `lipsync-mic` (`/lipsync/mic`), `erc8004`, `eas-reputation`, `livepeer-inference`, `skill-royalty`, `memory-seed`, `persona-extract`, `selfie-fit`, `create-v2`, `halfbody-xr`, `gallery-picker`, `usdz-ar`, `voice-clone`, `checkout`/`pricing`/`login`/`button`, `walk-embed-sdk`. **Agent Interaction Lab** (`public/demos/agents/`, `/demos/agents/:name`): `auto-rig`, `face-mocap`, `gemini-live`, `cursor-follower`, `scroll-inertia`, `builds-button`, `climb-title`, `holds-cta`, `walks-gutter`, `fall-from-top`, `falls-asleep`, `high-five`, `pickup-drop`, `sit-in-body`, `skateboard`, `trampoline`, `wrecking-ball`. **Chromeless embed builds** in `public/demos-embed/*.html` (`agents`, `avatar-only`, `forge`, `gallery`, `selfie`, `walk`).++### In-App Documentation Site (`/docs/*`)++`public/docs/` (index + catch-all `/docs/:slug`). **Walk SDK docs** (`public/docs/walk/*.html`): `getting-started`, `embed-iframe`, `embed-sdk`, `postmessage-events`, `companion-mode`, `chrome-extension`, `analytics`, `walk-page`, `changelog`; plus **Walk Embed API reference** (`public/docs/walk-embed-api.html`) and **Widget Docs** (`public/docs-widgets.html`, `/docs/widgets`). Distinct from the narrative Markdown in `docs/` ([Documentation Map](#documentation-map-docs)).++### Embed, Widget & Artifact Surfaces++| Surface | Route | File |+|---------|-------|------|+| Embed editor | `/embed`, `/embed-demo` | `pages/embed.html`, `embed-demo.html` |+| Embed v1 preview | `/embed/v1/preview` | `public/embed/v1/preview.html` |+| Avatar / Agent / Walk embed | `/embed/avatar`, `/agent/:id/embed`, `/walk-embed`, `/walk/app` | `pages/avatar-embed.html`, `agent-embed.html`, `walk-embed.html` |+| Widget / Widgets gallery | static, `/widgets` | `pages/widget.html`, `public/widget-demo.html`, `public/widgets-gallery/index.html` |+| Claude.ai artifact | static | `public/artifact/index.html`, `snippet.html`, `public/artifact-example.html` |+| Forge viewer (chat) | static | `public/chat/forge-viewer.html` |+| Apps-SDK studio viewer | static | `public/apps-sdk/studio-viewer.html` |+| LobeHub / Sperax embed | `/lobehub/iframe`, `/sperax/iframe` | `public/lobehub/iframe/index.html` |+| Avatar artifact viewer | `/avatar-artifact` | `pages/avatar-artifact.html` |++### Vanity Wallet Surfaces (`/vanity/*`)++Beyond the documented `/vanity-wallet` grinder: `/vanity/verify` (proof-of-grind receipt verifier), `/vanity/gallery` (Proof-of-Grind gallery), `/vanity/bounties` (Grind-Bounty Market) — all `public/vanity/*` with explicit Rollup inputs.++### News & Announcements Archive++`public/news/`, routes `/news` and `/news/:slug`; RSS at `/rss/announcements.xml` and `/rss.xml` → `/api/rss/announcements`. **106 pre-rendered article pages** (tweet/thread renders + slugged announcements), managed at `public/admin/news.html`.++### Legal, Policy & Admin++**Legal/policy** (`public/legal/*` + `pages/`): EULA, Terms (`/legal/tos`), Privacy (`/legal/privacy`), Content Policy (`/content-policy`), AWS Marketplace EULA, Walk Extension Privacy/Terms (`/extension/privacy`, `/extension/terms`), IRL location privacy (`/irl-privacy`). **Admin console** (`public/admin/*`): home, News admin (`/admin/news`), Solana Developer Platform admin (`/admin/sdp`), Bulk launch (`/admin/bulk-launch`).++### App/Viewer Variants & Marketing Pages++**Variants:** `/app` & `/app-next` → `pages/app-next.html`; `/app-demo`; `/a/*` agent routes (`a-me.html`, `a-edit.html`, `a-embed.html`); `pages/avatar-wallet-chat.html`; `pages/hero-demo.html`. **Partner:** `/aws`, `/aws-marketplace/welcome`, `/ibm/hello`, `/ibm/x402-demo`. **Marketing/info:** `/what-is`, `/labs`, `/glossary`, `/pitch`, `/tour`, `/features` + 9 sub-pages (`/features/{ar,forge,scan,play,walk,studio,marketplace,agent-exchange,deploy}`), `/status`, `/pricing` & `/x-pricing`, `/credits`, `/billing`, `/playground`, `/collection`, `/guardian`, `/proof` & `/integrity`, `/temporary`, `/marketplace-walk`. **System:** `public/404.html` (+ `public/demos/404.html`), `/500`, fetched fragments `public/footer.html` / `public/nav.html`.++---++## Design System & UI Tokens++A single canonical design vocabulary. **Source of truth: the `:root` block in `public/style.css`** (~11,000 lines); pages reference tokens (`var(--surface-1)`, `var(--text-md)`, `var(--font-display)`) rather than raw hex/`rgba()`/`px`. **Reference docs:** `docs/DESIGN-TOKENS.md`, `docs/btn-pill-migration.md`.++**Typography** — self-hosted woff2 (variable, `font-display: swap`) in `public/fonts/fonts.css`:++| Token | Stack | Use |+|-------|-------|-----|+| `--font-display` | `'Space Grotesk', 'Inter', system-ui` | Headers, hero, brand, section titles |+| `--font-body` | `'Inter', system-ui` | Product UI, body copy, controls |+| `--font-mono` | `'JetBrains Mono', 'SF Mono', 'Fira Code', ui-monospace` | Code, addresses, numeric readouts |++Type scale: dense UI band (`--text-2xs` 11px → `--text-md` 13px → `--text-ui` 14px) + phi-spaced (×1.618) display band (`--text-base` 16px → `--text-3xl` ~67.8px). Weights `--weight-regular/medium/semibold/bold`; line-heights `--leading-tight/normal/loose`. Classes: `.h1`–`.h4`, `.display` (fluid clamp), `.body-lg/.body/.body-sm`, `.label/.label-sm`, `.eyebrow`, `.mono`.++**Color, spacing, radii** — monochrome glass on near-black: `--bg`, `--surface-1/2/3`, `--surface-glass`; borders `--stroke`/`--stroke-strong`; text `--ink`/`--ink-dim`; `--accent`/`--accent-soft`; semantic `--success`/`--danger`/`--warn`. Phi spacing `--space-3xs`→`--space-2xl`; radii `--radius-sm/md/lg`, `--radius-card`, `--radius-control`, `--radius-pill`.++**Components** — `.btn` (`--primary/--secondary/--ghost/--danger/--sm/--lg/--block/--icon`; `:focus-visible` ring, `[aria-busy]` CSS spinner — no `setTimeout`), `.pill` (`--onchain`/`--devnet`/`--success`/`--warn`/`--danger`/`--new`; `.pill__dot` animated pulse), cards (`--card-*`), modals (`--modal-*`). Per-surface namespaces (`--nv-*` NVIDIA, `--ibm-*` IBM) alias canonical tokens via the CSS-var fallback chain.++---++## User Identity & Social Graph++User-facing identity, follow graph, and home feed (`api/users/*`, `api/users/me/*`):++| Endpoint | Method | Description |+|----------|--------|-------------|+| `/api/users/:username` | GET | Public profile |+| `/api/users/:username/avatar` | GET | Username → canonical avatar |+| `/api/users/:username/collectibles` | GET | On-chain collectibles + linked wallets |+| `/api/users/:username/follow` | GET/POST/DELETE | Follow edge `{following, followed_by, counts}` (`user_follows`) |+| `/api/users/:username/follows` | GET | Followers / following (`?type=`) |+| `/api/users/by-subdomain` | GET | Reverse-lookup `<label>.<parent>.sol` → user_id |+| `/api/users/lookup` | GET | Resolve username/wallet/id → minimal profile (gift flow) |+| `/api/users/earnings` | GET | Earnings summary |+| `/api/users/referral-code` · `referral-claim` · `referrals` | various | Referral code availability, claim, stats |+| `/api/users/me/feed` | GET | Home feed from followed accounts |+| `/api/users/me/bookmarks` | GET | Bookmarked agents (`agent_bookmarks`) |+| `/api/users/me/purchased-skills` · `transaction-history` | GET | Owned skills + purchase/sale history |+| `/api/users/me/tier` | GET | Account tier/mode + badges |++**Tables:** `user_follows`, `agent_bookmarks`, `skill_purchases`, `social_connections`, `user_mutes`, `direct_messages`.++---++## Host & Platform Integrations (detail)++Three non-package surfaces that embed an agent into third-party hosts (summarized in [Mobile, Embeds & Integrations](#mobile-embeds--integrations)):++- **LobeHub Chat Plugin (`chat-plugin/`)** — `@three-ws/chat-plugin` 1.0.0 (Apache-2.0). `manifest.json` (`identifier: "3dagent"`, 320×420 right panel). `src/index.ts` exports `AgentPane` (React panel mounting the embed iframe), `AgentBridge` (host PostMessage; wire envelope `{ v:1, source, id, inReplyTo?, kind, op, payload }`; ops `ping/pong/ready/speak/gesture/emote/look/setAgent/subscribe/error`). Build `tsc` + esbuild; depends on `@lobehub/chat-plugin-sdk`.+- **Walk Avatar Chrome Extension (`extensions/walk-avatar/`)** — Manifest V3. `background.js` (session/auth), `content.js` (mounts/drag-repositions avatar iframe), `content-narrator.js` (`window.__ThreewsWalkNarrator` — Readability section detection, `IntersectionObserver` ≥60%/600ms, fetches `POST /api/tts/speak`). Build `npm run build:extension:prod` → `dist/extension/`.+- **OpenAI / Claude Apps SDK (`apps-sdk/`)** — `embodiment/embodiment-stage.js` (`EmbodimentStage` — framework-agnostic Three.js engine; state machine `loading → idle ⇄ listening ⇄ thinking ⇄ speaking → error`; rides `AnimationManager` + canonicalize/retarget, never T-poses), `overlay.js` (DOM chrome), `studio-viewer/src.js` (renders Studio GLB inline from `window.openai.toolOutput.glb_url`). Build `scripts/build-apps-sdk-viewer.mjs`; inlined into `ui://widget/studio-viewer.html` by `api/_mcp3d/studio-viewer-resource.js`.++---++## Claude Code Plugin Marketplace++Root manifest `.claude-plugin/marketplace.json` (`name: "three-ws"`, owner `nirholas`) registers four installable Claude Code plugins (this is three.ws's **own** official marketplace, not external assets):++| Plugin | Source | Category | Provides |+|--------|--------|----------|----------|+| `three-ws-core` | `./.agents` | payments | Wallet + x402 skills: authenticate, fund, send, trade, search bazaar, pay-for-service, monetize, query onchain data |+| `three-ws-developer` | `./marketplace/plugins/three-ws-developer` | developer-tools | Slash commands `scaffold-agent`, `setup-mcp`, `use-tools` + bundled `@three-ws/mcp-server` |+| `three-ws-pump-fun` | `./pump-fun-skills` | trading | `create-coin`, `swap`, `coin-fees`, `reactive`, `tokenized-agents` (Apache-2.0) |+| `three-ws-3d` | `./marketplace/plugins/three-ws-3d` | creative | 3D Forge skills (`forge-3d`, `mesh-forge`, `text-to-avatar`, `auto-rig`) wired to `@three-ws/mcp-server`, `scene-mcp`, `avatar-mcp` |++Each carries `.claude-plugin/plugin.json`; the 3D/developer plugins declare `mcpServers` blocks that auto-launch npm stdio MCP servers via `npx -y` with `MCP_SVM_PAYMENT_ADDRESS` wiring.++---++## Agora Professions — Verifiable WORK Supply Chain (`workers/agora-citizens/`)++The WORK step of each citizen's daily loop (`IDLE → SEEK → CLAIM → WORK → PROVE → EARN → SPEND → IDLE`) dispatches to a profession module keyed by an AgenC u64 capability bit. Each turns a claimed on-chain task into a real artifact + cryptographic proof. `work/index.js` is the open registry (`runProfession`); every runner returns `{ result, resultText, proofHashHex, proofHashBytes, resultData (≤64-byte CID), deliverableUrl, bytes, summary }`:++| Bit | Module | Real skill | Deliverable | Proof |+|----:|--------|-----------|-------------|-------|+| 0 | `fetcher.js` | x402/HTTP call | response fingerprint | `sha256(canonical)` |+| 1 | `sculptor.js` | text→GLB (`@three-ws/forge`) | `.glb` | `sha256(GLB)` |+| 2 | `scribe.js` | research/write (`@three-ws/brain`) | `.md` | `sha256(text)` |+| 3 | `cartographer.js` | scene/diorama (`@three-ws/scene`) | plan JSON | `sha256(canonical)` |+| 4 | `crier.js` | TTS/voice (`@three-ws/voice`) | audio clip | `sha256(audio)` |+| 5 | `appraiser.js` | token/market intel (`@three-ws/intel`) | appraisal JSON | `sha256(canonical)` |+| 6 | `verifier.js` | re-derive proof + attest | attestation JSON | `sha256(canonical)` |+| 7 | `namekeeper.js` | `.sol`/ENS resolve (`@three-ws/names`) | resolution JSON | `sha256(canonical)` |++**Invariant:** `proofHashHex === sha256(bytes served at deliverableUrl)` — a Verifier re-downloads, re-hashes, reproduces the on-chain proof, and emits a `vouch`. Deliverables stored in R2 at `agora/deliverables/<profession>/<sha256>.<ext>`. Loop modules: `engine.js` (heartbeat), `agenc.js` (retry/backoff over `@three-ws/solana-agent` → `@tetsuo-ai/sdk`), `roster.js` (profession bitmap + citizen seeding from `agent_identities`), `policy.js`, `demand.js` (SPEND), `post.js` (on-chain bounty + escrow), `reconcile.js`, `narrative.js`, `keypair.js`. E2E: `node workers/agora-citizens/verify-supply-chain.mjs`; proof helpers tested in `tests/agora-work-proof.test.js`.---@@ -2688,8 +2705,8 @@ CREATE2-deterministic, so `IdentityRegistry` + `ReputationRegistry` share one ad| Domain | Crons (path → schedule) ||--------|--------------------------|-| **Oracle / Intel** | `oracle-score` `*/2m` · `intel-learn` `*/15m` · `reflect-sweep` `*/30m` · `pulse-tick` `*/2m` · `gmgn-seed` `daily 03:00` · `pumpfun-signals` `*/15m` · `reconcile-decisions` `*/10m` |-| **Pump.fun** | `pumpfun-monitor` `*/3m` · `pumpfun-graduations-sync` `*/2m` · `pump-agent-stats` `*/10m` · `run-buyback` `hourly` · `run-distribute-payments` `:30 hourly` · `run-coin-cycle` `*/5m` · `run-coin-payouts` `*/5m` |+| **Oracle / Intel** | `oracle-score` `*/2m` · `oracle-digest` `daily 08:00` · `intel-learn` `*/15m` · `reflect-sweep` `*/30m` · `pulse-tick` `*/2m` · `gmgn-seed` `daily 03:00` · `pumpfun-signals` `*/15m` · `reconcile-decisions` `*/10m` |+| **Pump.fun** | `pumpfun-monitor` `*/3m` · `pumpfun-graduations-sync` `*/2m` · `pump-agent-stats` `*/10m` · `run-buyback` `hourly` · `run-distribute-payments` `:30 hourly` · `run-coin-cycle` `*/5m` · `run-coin-payouts` `*/5m` · `cosmetic-splits-sweep` `:15 hourly` || **Smart money / radar** | `smart-money-rollup` `*/5m` · `smart-money-graph` `*/10m` · `radar-watchlist` `*/10m` · `recompute-reputation` `*/10m` || **Trading fan-out** | `copy-fanout` `*/2m` · `mirror-fanout` `*/2m` · `signal-fanout` `*/2m` · `strategy-fanout` `*/2m` · `run-dca` `hourly` · `run-subscriptions` `hourly` || **$THREE / treasury** | `three-holders-snapshot` `*/5m` · `treasury-autopilot` `:23 hourly` · `run-three-buyback` `daily 06:00` · `settle-royalties` `daily 03:00` |@@ -2766,7 +2783,7 @@ The codebase references **~260 distinct `process.env.*` keys** across `api/`; `a## Database Schema — Complete Table Index-`api/_lib/schema.sql` + ~160 dated migration files in `api/_lib/migrations/` define **~276 Postgres tables** (Neon, with `pgvector`). Complete index by domain:+`api/_lib/schema.sql` + **234 dated migration files** in `api/_lib/migrations/` (2026-04-29 → 2026-06-29) define **~270 Postgres tables** on Neon. Extensions: `citext`, `pg_trgm`, `pgcrypto` — **no pgvector**; embeddings are JSONB float arrays with cosine computed in JS. Complete index by domain:| Domain | Tables ||--------|--------|@@ -2781,7 +2798,8 @@ The codebase references **~260 distinct `process.env.*` keys** across `api/`; `a| **3D, avatars & forge** | `avatars` · `avatar_regen_jobs` · `animation_clips` · `mocap_clips` · `forge_creations` · `forge_votes` · `forge_board_winners` · `forge_seed_jobs` · `forge_consumption_redemptions` · `forge_high_redemptions` · `cosmetic_sales` · `cosmetic_creator_splits` · `token_metadata` · `launchpad_pages` || **Patronage & agent services** | `agent_patron_perks` · `agent_patron_prefs` · `agent_paid_services` · `agent_autopilot_proposals` || **Widgets, notifications & RAG** | `widgets` · `widget_views` · `widget_chat_threads` · `widget_chat_messages` · `widget_knowledge_docs` · `widget_knowledge_chunks` · `plugins` · `chat_brand_config` · `notification_events` · `notification_preferences` · `user_alert_configs` · `user_alert_fires` |-| **Indexing, attestations & infra** | `erc8004_agents_index` · `erc8004_crawl_cursor` · `solana_attestations` · `solana_attestations_cursor` · `solana_attest_event_claims` · `three_holder_snapshot` · `three_holder_snapshot_meta` · `three_rewards_distributions` · `three_buyback_runs` · `usage_events` · `audit_log` · `bot_heartbeat` · `indexer_state` · `webhook_deliveries` · `developer_webhooks` · `referral_visits` |+| **Indexing, attestations & infra** | `erc8004_agents_index` · `erc8004_crawl_cursor` · `solana_attestations` · `solana_attestations_cursor` · `solana_attest_event_claims` · `three_holder_snapshot` · `three_holder_snapshot_meta` · `three_rewards_distributions` · `three_buyback_runs` · `usage_events` · `audit_log` · `bot_heartbeat` · `indexer_state` · `webhook_deliveries` · `developer_webhooks` · `referral_visits` · `decision_outcomes` |+| **X (social) automation** | `x_posts` · `x_scheduled_posts` · `x_triggers` · `x_pending_reviews` |> Several tables (e.g. `master_wallets`) are bootstrapped at runtime via `CREATE TABLE IF NOT EXISTS` rather than a migration — see [Known Gaps](#known-gaps--in-progress).diff --git a/CHANGELOG.md b/CHANGELOG.mdindex cdf56c4ee..7f1f35672 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -12,6 +12,7 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr- **A stale Arena link no longer dead-ends on a 'not found' screen** — Opening a shared tournament link after the competition has ended or rolled off used to leave you stranded on a bare 'Tournament not found' page whose only button was a Retry that could never work. Now that case turns into a way forward: a clear explanation plus a live grid of the tournaments running and starting right now, so there's always something to jump into. Genuine connection hiccups (as opposed to a missing tournament) keep a Retry alongside a 'Back to all tournaments' escape hatch. Every tournament page also gets a Share button that copies its link, sets a proper browser-tab title, and scrolls cleanly to the top as you move between views. (`/arena`) `[fix, improvement]`- **Agent Activity is now a live trading floor — Conviction Board rail, richer trade detail and a real KPI bar that never shows an empty void** — The /activity page used to go blank whenever no agent had traded recently. It no longer does. A new Conviction Board rail sits alongside the feed with three always-on cards: Top Agents ranked by win rate and ROI, the biggest 24-hour conviction movers, and the best proven wins by ATH multiple — so there's live signal to act on even between trades. An insight strip surfaces the single standout in each. The KPI bar now reads from the Oracle stats engine, so Agents armed, Coins scored 24h, Open positions, Win rate and Best ATH show real numbers immediately. Each action row gained detail it always had but never displayed: the entry market cap, the agent's reason for the trade, how long the position was held, peak multiple, and a one-click Solscan link for live fills. Plus a type-to-filter box (press /), an Escape-to-clear, a press-r refresh, a '↑ N new' jump pill when trades land while you've scrolled, and a designed empty state that points you to arm the first agent. (`/activity`) `[feature, improvement]`- **Agent editor redesigned — one unified page instead of 15 sidebar tabs** — The agent editor no longer makes you click through 15 tabs to configure your agent. Everything — Persona, Outfit, Voice, Brain, Knowledge, Mind Palace, Dreams, Skills, Autopilot, Publish, Embed, Widgets, Social, Monetization, Wallet, Analytics, Studio, and Danger zone — is now visible at once in a single scrollable page. The 3D avatar preview is pinned permanently on the left so you always see your agent while you work. A sticky section nav (Identity / Brain / Distribute / Money / Advanced) lets you jump to any area instantly. (`/agent-edit`) `[improvement]`+- **Agent profile pages no longer fail to load over a hiccup** — Opening an agent's profile (/agents/<id>) could show a full-page "Couldn't load this agent" error even when the agent was perfectly fine — a brief stumble in a side service (skill pricing, or the avatar self-heal check) was allowed to take down the whole profile. Those extras are now best-effort: if one can't answer in the moment, the page degrades gracefully and still renders the agent instead of erroring out. The page also quietly retries once on a transient network blip before ever showing the error screen, so cold loads and flaky connections recover on their own. (`/agents`) `[fix]`- **Alpha Co-pilot overhauled — agent gallery, cited-signal highlights, score bars, and live routing fixed** — The Alpha Co-pilot page has been fully redesigned. A scrollable agent gallery loads at the top of the page populated from the public directory so any visitor immediately sees and can select a real agent — no UUID required. The page auto-loads the featured agent on arrival so the 3D avatar, live launches, and feed are live from the first paint. Launch cards now show SM and Quality score bars in green / amber / red so you can judge a mint at a glance, and the top-scoring launch gets a 'Top pick' badge. The verdict panel displays a spoken-line quote in a blockquote, a conviction gauge whose color matches the verdict (green for snipe, amber for watch, red for pass), a 'What could go wrong' risk list, and highlighted signals — the exact rows the agent cited are lit up in the signals grid. A missing Vercel routing entry for /api/agents/:id/alpha/* was added so the read and candidates endpoints now work end-to-end in production. (`/alpha-copilot`) `[feature, improvement]`- **Animation Studio — avatars no longer break when you switch animations** — In the /pose Animation Studio, playing one animation preset and then a second one used to mangle the avatar — limbs would lock up in the wrong position (arms stuck overhead while "walking", a forearm bent 90° off). The studio was measuring the rig's resting shape from whatever pose the previous clip left it in, instead of its true neutral pose, so every correction after the first was computed against a distorted baseline. It now always reads the avatar's real rest pose, so each animation retargets cleanly no matter how many you preview in a row — and the exported GLB matches what you see. (`/pose`) `[fix]`- **Animation Studio gains undo, mirror, and copy/paste posing** — Posing an avatar in the Animation Studio is now far quicker. Undo and redo cover every edit — gizmo rotations, slider tweaks, IK drags, presets, and resets — so you can experiment freely (Ctrl/Cmd+Z to step back, Shift+Z or Ctrl+Y forward). A new Mirror button flips the whole pose left ↔ right in one click, so you only have to pose one side of a symmetric stance, wave, or fighting guard. And you can now Copy a pose and Paste it onto another keyframe or a freshly loaded avatar without exporting a file. Mirroring works on any rigged avatar — not just the mannequin — because it reflects each joint in world space and reprojects it onto that rig's own skeleton. Keyboard shortcuts: M to mirror, C to copy, V to paste. (`/pose`) `[feature, improvement]`@@ -23,6 +24,7 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr- **Coin pages now show price moves and on-chain safety at a glance** — Every coin's launch page (/launches/<mint>) gained a richer market header. A new metrics strip shows price moves across 5m, 1h, 6h, and 24h — computed live from real trade history, and only quoting a window once there's enough history to back it, so a brand-new coin never shows a fake 24h number. Alongside it, an on-chain safety panel surfaces the same checks the autonomous sniper runs before trading: whether the mint and freeze authorities are revoked (can the dev print more supply or freeze your tokens?), where real liquidity sits, and an overall 0–100 safety score. The coin header also now lists total supply. On the /launches feed, every card leads with the coin's age, the same at-a-glance freshness cue pro terminals open with. (`/launches`) `[feature, improvement]`- **Coin Radar upgraded — a live market-pulse banner, smart-money signals, search, sort and a list view** — The Coin Radar now opens with a market-pulse banner that reads the whole room at a glance: launches observed in the last 24 hours (and the last hour), a health-mix bar splitting them into healthy / mixed / risky, the share carrying danger flags, how many a reputation-scored wallet touched, and the graduated-versus-rugged tally from labeled outcomes. Every coin card surfaces signals the engine always measured but never showed — a smart-money badge counting reputation-scored buyers, a news-driven badge when a launch matches a live headline, funding-cluster and graduated/rugged badges, plus market cap, top-10 concentration and net SOL flow. You can now search by name, ticker or mint, sort by newest, quality, smart money, buyers or volume, filter to only smart-money or news-driven coins, and switch between the card grid and a dense list view. The detail drawer gained a Smart money section listing the notable wallets with their win rates, a News-driven source link, and richer signals (coordination, top-5 concentration, funding clusters, buy/sell ratio, net flow, first-seen market cap). Power users get keyboard shortcuts: / to search, g and l for grid and list, r to refresh. Every filter, sort and view is saved in the URL so a radar view is shareable. (`/radar`) `[feature, improvement]`- **Community Avatars — dedicated gallery page in the sidebar** — The community tab from the Avatars page is now its own first-class destination: /dashboard/community-avatars. Browse every public avatar on the platform with full search, rig filters, tag chips, and sort controls — all without needing to navigate through your own avatar library first. Accessible directly from the Explore section of the dashboard sidebar. (`/dashboard/community-avatars`) `[feature]`+- **Dashboard Overview now leads with your live numbers** — The dashboard home page used to open with a row of avatar thumbnails, pushing your actual metrics below the fold. It now leads with your key numbers — 7-day revenue, widget views, chats, and active avatars — each with a momentum chip (▲/▼ with the percent change across the week) and a colored sparkline that's green when a metric is trending up and red when it's falling, so you can read your week at a glance. The header gained a clear primary action (Create avatar) plus a New widget shortcut and today's date, filling space that was previously empty. Your avatars, autonomous-trading status, agent health, and recent activity all still live one glance further down. (`/dashboard`) `[improvement]`- **Default avatars render again everywhere** — Avatars stopped appearing across the site — the homepage hero, guest avatars, and any embed that falls back to the default character all showed an empty frame. The default avatar was being loaded from an asset host that had gone offline. It now loads from three.ws itself, so default avatars render again on every page and in every embed. `[fix]`- **Embeddable avatars get tap-to-walk, gestures, and a lighter footprint** — The walking-avatar embed you drop onto any site is now friendlier and lighter. Visitors can tap or click the ground to send the avatar walking there — no joystick required — and a one-time on-screen hint appears so first-timers actually discover the controls. Turn on a Gestures option and they get wave and jump buttons too. On desktop the avatar gently turns to face your cursor when it's standing still, so a hovered embed feels alive. While the 3D model loads, a soft silhouette stands in instead of a blank gap. The embed now pauses itself the moment it scrolls out of view or its tab is hidden, so it never drains a laptop battery in the background, and it respects your system 'reduce motion' setting. Every embed carries a small, tasteful three.ws badge that links home — removable with one toggle. The embed editor adds matching controls: walk speed, ground on/off, gestures, the badge toggle, and a Responsive option that emits a fluid snippet that fills its container on any screen. (`/embed`) `[feature, improvement]`- **Fixed: the Animation Gallery footer no longer covers the page** — The /animations page had a layout bug where the site footer was being pulled up and painted on top of the gallery — the hero, search bar, and animation cards ended up hidden behind it. The footer now sits where it belongs, at the bottom of the page, so the full motion library is visible and browsable again. (`/animations`) `[fix]`@@ -30,6 +32,7 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr- **Infrastructure fixes: 3D forge reliability, cache resilience, and bounty escrow** — Fixed a URL-generation bug that caused the Hunyuan3D-2.1 HuggingFace Space to always fail with a DNS error (dot in version number wasn't converted to a hyphen in the subdomain). Doubled the NVIDIA NIM and Redis circuit-breaker cooldowns to reduce retry noise during external-service outages. Added documentation for the LABOR_ESCROW_SECRET_BASE58 env var so bounty posting can be enabled in production. `[fix, infra]`- **Launchpad is now an actual launchpad — mint a coin right on the page** — Going to /launchpad used to drop you into a page-builder studio instead of letting you launch anything. Now it's a real launchpad, like it should be: the live coin launcher is front and center, so you pick your agent, set the name, ticker, and image, and mint a Pump.fun coin straight from your wallet — creator fees route to you. Live launches from three.ws agents show right below it. The white-label page builder (hosted token page, paid concierge, gated 3D showroom) is still there as an optional add-on, not the main event. Token-launchpad pages also carry your coin details into the launch flow pre-filled and flip from "Launch" to a one-click "Trade" once your coin is live. (`/launchpad`) `[fix, feature]`- **Living Worlds video generator is back online** — The Cosmos text-to-world lane — describe a scene and get a short cinematic video that plays as a living backdrop behind your avatar — had stopped generating: NVIDIA moved the hosted Cosmos model to a new address, so every request came back as an error. We've pointed the lane at the new endpoint and it generates worlds again. (`/cosmos`) `[fix]`+- **Marketplace no longer loads with a broken layout after an update** — After we shipped a site update, returning visitors could occasionally land on a page that looked broken — the top navigation collapsed into overlapping text and the marketplace tabs (including Animations) stacked into a plain vertical list instead of the real design. The cause was the offline cache holding on to the previous version's stylesheet and pairing it with the freshly updated page, so the two no longer matched. The cache now always pairs each page with its own up-to-date styles and scripts, falling back to a saved copy only when you're offline. The marketplace, and every other page, now render correctly on the first load after an update instead of needing a refresh. (`/marketplace`) `[fix]`- **Mission Control now has a real candlestick chart with live price updates** — The trading terminal's price panel is now a full candlestick chart instead of a flat line. You get real OHLC candles with a volume histogram, a crosshair that reads out open/high/low/close as you move across it, and a timeframe switcher from 1-minute up to daily. Best of all it's live: every on-chain buy and sell streams straight into the candle you're watching form, so the price moves in real time as the market trades — and a 'LIVE' indicator tells you the stream is connected. Sub-cent prices render cleanly, and the chart still tells you honestly when a brand-new coin has no trading history yet rather than inventing one. (`/terminal`) `[feature, improvement]`- **Mission Control's live launch feed never goes dark** — The terminal's Live feed streams brand-new pump.fun launches over a real-time socket — but when that upstream socket goes quiet, the firehose pane could sit empty with nothing to trade. The feed now has a live safety net: it also reads pump.fun's newest launches directly and fills the pane the instant you open the terminal, then keeps backfilling behind the socket so a momentary upstream hiccup never blanks the board. Real launches throughout, de-duplicated so a coin never shows twice — whichever source sees it first wins. (`/terminal`) `[fix, improvement]`- **Oracle hero now reads like a live conviction terminal — six clickable stats, watchlist filter and keyboard control** — The Oracle landing page used to show four cryptic numbers and a lot of dashes. The hero is now a row of six live KPI tiles that surface data the engine already tracked but never showed: coins scored in the last 24h (with the all-time total), Prime and Strong counts right now, realized win rate with the resolved sample behind it, the best ATH multiple ever called, and how many agents are armed with open positions. Every tile is clickable — Prime and Strong filter the feed instantly, Win rate jumps to the edge proof, Best ATH opens the win gallery, Agents opens the leaderboard. The conviction feed gained a star Watching filter that folds your existing watchlist straight into the live stream, and each coin card now shows launch age alongside when it was scored. Above the feed there's now a live conviction-breadth bar — a stacked read of how the whole scored board splits across Prime, Strong, Lean, Watch and Avoid right now, with the average score and the share sitting at strong-or-better, so you can tell at a glance whether the board is hot or cold; click any segment or legend chip to filter. The hero stats and the breadth bar refresh themselves every minute while the tab is open (and pause when it's backgrounded), so the numbers stay honest without a reload. The whole tab bar is finally keyboard-operable (arrow keys, Home/End), every view deep-links and bookmarks via the URL so you can share /oracle#proof, the browser back button steps through tabs, and power users get shortcuts — press / to search, 1 to 9 to jump between tabs. (`/oracle`) `[feature, improvement]`diff --git a/api/agents.js b/api/agents.jsindex 8aa67781c..a599bae6f 100644--- a/api/agents.js+++ b/api/agents.js@@ -422,10 +422,25 @@ export async function handleGetOne(req, res, id) {// Skill prices come from the cache (1h TTL, invalidated on price edits)// rather than an inline subquery, so the dominant repeat read on this hot- // path never touches agent_skill_prices once the agent is warm.- row.skill_prices = skillPriceMap(await getSkillPrices(id));+ // path never touches agent_skill_prices once the agent is warm. Pricing is+ // decoration: a cache-backend hiccup or agent_skill_prices read failure must+ // never 500 the whole profile (the frontend renders that as "Couldn't load+ // this agent"). Degrade to an empty price map and keep serving the agent.+ try {+ row.skill_prices = skillPriceMap(await getSkillPrices(id));+ } catch (err) {+ console.warn('[agents] skill_prices lookup failed, defaulting to {}:', err?.message);+ row.skill_prices = {};+ }- await healStaleAvatarId(row);+ // Self-heal of a dangling avatar_id is opportunistic maintenance, not part+ // of the read contract. If the avatars probe throws, leave avatar_id as-is+ // and let the frontend fall back to its placeholder — never fail the fetch.+ try {+ await healStaleAvatarId(row);+ } catch (err) {+ console.warn('[agents] healStaleAvatarId failed, leaving avatar_id intact:', err?.message);+ }// chat_count is supplementary decoration on the agent record — never let// a usage-stats query failure (e.g. usage_events not yet migrated, codediff --git a/data/changelog.json b/data/changelog.jsonindex 79c9f3d56..25061972e 100644--- a/data/changelog.json+++ b/data/changelog.json@@ -1,6 +1,34 @@{"$comment": "Curated changelog entries for three.ws — the editorial layer of the public changelog. New PAGE launches are tracked automatically via the `added` field in data/pages.json; this file is for everything else holders care about: improvements, fixes, SDK releases, trading/payments capabilities, security work. scripts/build-page-index.mjs merges both sources into CHANGELOG.md, public/changelog.json, and public/changelog.xml. Newest first. Allowed tags: feature, improvement, fix, sdk, infra, docs, security. `link` is optional and must be a live three.ws path.","entries": [+ {+ "date": "2026-06-26",+ "title": "Fixed the marketplace's collapsed layout for good",+ "summary": "The marketplace could load with its whole layout collapsed — the navigation crammed into overlapping text and the section tabs (Agent, Avatars, Tools, Skills, and the rest) stacked into a plain full-width list with the agent grid squeezed into a narrow strip or missing entirely. The real cause was structural, not a caching hiccup: the page is built as a two-column grid (a 240px sidebar beside the main content), and the global navigation bar was quietly claiming the sidebar's column, shoving the sidebar and main content into the wrong places. The navigation now spans the full width as intended, so the sidebar and the agent/avatar grid always land in their correct columns. The marketplace renders right on the very first load, every time.",+ "tags": ["fix"],+ "link": "/marketplace"+ },+ {+ "date": "2026-06-26",+ "title": "Dashboard Overview now leads with your live numbers",+ "summary": "The dashboard home page used to open with a row of avatar thumbnails, pushing your actual metrics below the fold. It now leads with your key numbers — 7-day revenue, widget views, chats, and active avatars — each with a momentum chip (▲/▼ with the percent change across the week) and a colored sparkline that's green when a metric is trending up and red when it's falling, so you can read your week at a glance. The header gained a clear primary action (Create avatar) plus a New widget shortcut and today's date, filling space that was previously empty. Your avatars, autonomous-trading status, agent health, and recent activity all still live one glance further down.",+ "tags": ["improvement"],+ "link": "/dashboard"+ },+ {+ "date": "2026-06-26",+ "title": "Marketplace no longer loads with a broken layout after an update",+ "summary": "After we shipped a site update, returning visitors could occasionally land on a page that looked broken — the top navigation collapsed into overlapping text and the marketplace tabs (including Animations) stacked into a plain vertical list instead of the real design. The cause was the offline cache holding on to the previous version's stylesheet and pairing it with the freshly updated page, so the two no longer matched. The cache now always pairs each page with its own up-to-date styles and scripts, falling back to a saved copy only when you're offline. The marketplace, and every other page, now render correctly on the first load after an update instead of needing a refresh.",+ "tags": ["fix"],+ "link": "/marketplace"+ },+ {+ "date": "2026-06-26",+ "title": "Agent profile pages no longer fail to load over a hiccup",+ "summary": "Opening an agent's profile (/agents/<id>) could show a full-page \"Couldn't load this agent\" error even when the agent was perfectly fine — a brief stumble in a side service (skill pricing, or the avatar self-heal check) was allowed to take down the whole profile. Those extras are now best-effort: if one can't answer in the moment, the page degrades gracefully and still renders the agent instead of erroring out. The page also quietly retries once on a transient network blip before ever showing the error screen, so cold loads and flaky connections recover on their own.",+ "tags": ["fix"],+ "link": "/agents"+ },{"date": "2026-06-26","title": "Coin pages now show price moves and on-chain safety at a glance",diff --git a/public/changelog.json b/public/changelog.jsonindex 5db648490..6d82f2033 100644--- a/public/changelog.json+++ b/public/changelog.json@@ -1,5 +1,5 @@{- "generated_at": "2026-06-26T11:55:28.746Z",+ "generated_at": "2026-06-26T12:23:53.168Z","generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json","site": {"name": "three.ws",@@ -68,6 +68,16 @@"improvement"]},+ {+ "date": "2026-06-26",+ "type": "update",+ "title": "Agent profile pages no longer fail to load over a hiccup",+ "summary": "Opening an agent's profile (/agents/<id>) could show a full-page \"Couldn't load this agent\" error even when the agent was perfectly fine — a brief stumble in a side service (skill pricing, or the avatar self-heal check) was allowed to take down the whole profile. Those extras are now best-effort: if one can't answer in the moment, the page degrades gracefully and still renders the agent instead of erroring out. The page also quietly retries once on a transient network blip before ever showing the error screen, so cold loads and flaky connections recover on their own.",+ "link": "/agents",+ "tags": [+ "fix"+ ]+ },{"date": "2026-06-26","type": "update",@@ -186,6 +196,16 @@"feature"]},+ {+ "date": "2026-06-26",+ "type": "update",+ "title": "Dashboard Overview now leads with your live numbers",+ "summary": "The dashboard home page used to open with a row of avatar thumbnails, pushing your actual metrics below the fold. It now leads with your key numbers — 7-day revenue, widget views, chats, and active avatars — each with a momentum chip (▲/▼ with the percent change across the week) and a colored sparkline that's green when a metric is trending up and red when it's falling, so you can read your week at a glance. The header gained a clear primary action (Create avatar) plus a New widget shortcut and today's date, filling space that was previously empty. Your avatars, autonomous-trading status, agent health, and recent activity all still live one glance further down.",+ "link": "/dashboard",+ "tags": [+ "improvement"+ ]+ },{"date": "2026-06-26","type": "update",@@ -260,6 +280,16 @@"fix"]},+ {+ "date": "2026-06-26",+ "type": "update",+ "title": "Marketplace no longer loads with a broken layout after an update",+ "summary": "After we shipped a site update, returning visitors could occasionally land on a page that looked broken — the top navigation collapsed into overlapping text and the marketplace tabs (including Animations) stacked into a plain vertical list instead of the real design. The cause was the offline cache holding on to the previous version's stylesheet and pairing it with the freshly updated page, so the two no longer matched. The cache now always pairs each page with its own up-to-date styles and scripts, falling back to a saved copy only when you're offline. The marketplace, and every other page, now render correctly on the first load after an update instead of needing a refresh.",+ "link": "/marketplace",+ "tags": [+ "fix"+ ]+ },{"date": "2026-06-26","type": "update",diff --git a/public/changelog.xml b/public/changelog.xmlindex df6c8d8e0..8140a74ee 100644--- a/public/changelog.xml+++ b/public/changelog.xml@@ -54,6 +54,14 @@<category>improvement</category><description>The agent editor no longer makes you click through 15 tabs to configure your agent. Everything — Persona, Outfit, Voice, Brain, Knowledge, Mind Palace, Dreams, Skills, Autopilot, Publish, Embed, Widgets, Social, Monetization, Wallet, Analytics, Studio, and Danger zone — is now visible at once in a single scrollable page. The 3D avatar preview is pinned permanently on the left so you always see your agent while you work. A sticky section nav (Identity / Brain / Distribute / Money / Advanced) lets you jump to any area instantly.</description></item>+ <item>+ <title>Agent profile pages no longer fail to load over a hiccup</title>+ <link>https://three.ws/agents</link>+ <guid isPermaLink="false">2026-06-26:Agent profile pages no longer fail to load over a hiccup</guid>+ <pubDate>Fri, 26 Jun 2026 12:00:00 GMT</pubDate>+ <category>fix</category>+ <description>Opening an agent's profile (/agents/<id>) could show a full-page "Couldn't load this agent" error even when the agent was perfectly fine — a brief stumble in a side service (skill pricing, or the avatar self-heal check) was allowed to take down the whole profile. Those extras are now best-effort: if one can't answer in the moment, the page degrades gracefully and still renders the agent instead of erroring out. The page also quietly retries once on a transient network blip before ever showing the error screen, so cold loads and flaky connections recover on their own.</description>+ </item><item><title>Alpha Co-pilot overhauled — agent gallery, cited-signal highlights, score bars, and live routing fixed</title><link>https://three.ws/alpha-copilot</link>@@ -142,6 +150,14 @@<category>feature</category><description>The community tab from the Avatars page is now its own first-class destination: /dashboard/community-avatars. Browse every public avatar on the platform with full search, rig filters, tag chips, and sort controls — all without needing to navigate through your own avatar library first. Accessible directly from the Explore section of the dashboard sidebar.</description></item>+ <item>+ <title>Dashboard Overview now leads with your live numbers</title>+ <link>https://three.ws/dashboard</link>+ <guid isPermaLink="false">2026-06-26:Dashboard Overview now leads with your live numbers</guid>+ <pubDate>Fri, 26 Jun 2026 12:00:00 GMT</pubDate>+ <category>improvement</category>+ <description>The dashboard home page used to open with a row of avatar thumbnails, pushing your actual metrics below the fold. It now leads with your key numbers — 7-day revenue, widget views, chats, and active avatars — each with a momentum chip (▲/▼ with the percent change across the week) and a colored sparkline that's green when a metric is trending up and red when it's falling, so you can read your week at a glance. The header gained a clear primary action (Create avatar) plus a New widget shortcut and today's date, filling space that was previously empty. Your avatars, autonomous-trading status, agent health, and recent activity all still live one glance further down.</description>+ </item><item><title>Default avatars render again everywhere</title><link>https://three.ws/changelog</link>@@ -198,6 +214,14 @@<category>fix</category><description>The Cosmos text-to-world lane — describe a scene and get a short cinematic video that plays as a living backdrop behind your avatar — had stopped generating: NVIDIA moved the hosted Cosmos model to a new address, so every request came back as an error. We've pointed the lane at the new endpoint and it generates worlds again.</description></item>+ <item>+ <title>Marketplace no longer loads with a broken layout after an update</title>+ <link>https://three.ws/marketplace</link>+ <guid isPermaLink="false">2026-06-26:Marketplace no longer loads with a broken layout after an update</guid>+ <pubDate>Fri, 26 Jun 2026 12:00:00 GMT</pubDate>+ <category>fix</category>+ <description>After we shipped a site update, returning visitors could occasionally land on a page that looked broken — the top navigation collapsed into overlapping text and the marketplace tabs (including Animations) stacked into a plain vertical list instead of the real design. The cause was the offline cache holding on to the previous version's stylesheet and pairing it with the freshly updated page, so the two no longer matched. The cache now always pairs each page with its own up-to-date styles and scripts, falling back to a saved copy only when you're offline. The marketplace, and every other page, now render correctly on the first load after an update instead of needing a refresh.</description>+ </item><item><title>Mission Control now has a real candlestick chart with live price updates</title><link>https://three.ws/terminal</link>diff --git a/public/features.json b/public/features.jsonindex a185ad395..50e45dbd5 100644--- a/public/features.json+++ b/public/features.json@@ -1,5 +1,5 @@{- "generated_at": "2026-06-26T11:55:28.725Z",+ "generated_at": "2026-06-26T12:23:53.147Z","generated_by": "scripts/build-page-index.mjs from data/pages.json","site": {"name": "three.ws",diff --git a/public/marketplace-v2.css b/public/marketplace-v2.cssindex b1615df05..55928c95c 100644--- a/public/marketplace-v2.css+++ b/public/marketplace-v2.css@@ -4,10 +4,13 @@/* ── Body grid layout ─────────────────────────────────────────────────────* body.market-page is a 2-col CSS grid (240px sidebar + 1fr main). Direct* children with no grid-column rule auto-place into individual cells, which- * shoved .site-header into the 240px col and .market-sidebar into the wide+ * shoved the global nav into the 240px col and .market-sidebar into the wide* col, with .market-main wrapping to a second row. Force the page chrome* (top header, bottom footer) to span both columns so the sidebar/main row- * lays out correctly. */+ * lays out correctly. The global header now mounts inside #nav-container+ * (via /nav.js), so that wrapper — not a bare .site-header — is the direct+ * body child that must span; keep .site-header for any page still using it. */+body.market-page > #nav-container,body.market-page > .site-header,body.market-page > #footer-container {grid-column: 1 / -1;diff --git a/src/agent-detail.js b/src/agent-detail.jsindex 74c145260..6e820d28d 100644--- a/src/agent-detail.js+++ b/src/agent-detail.js@@ -2356,6 +2356,24 @@ async function fetchJson(url) {return res.json();}+/**+ * Fetch the primary agent record with one automatic retry on a *transient*+ * failure (offline, 5xx, 429) — a single network blip or cold serverless boot+ * shouldn't dump the visitor onto the full "Couldn't load this agent" screen.+ * A 404 is a definitive answer, never retried; it falls straight through to the+ * not-found / avatar-redirect path.+ */+async function fetchAgentRecord(url) {+ try {+ return await fetchJson(url);+ } catch (e) {+ const transient = e?.status == null || e.status >= 500 || e.status === 429;+ if (!transient) throw e;+ await new Promise((r) => setTimeout(r, 600));+ return fetchJson(url);+ }+}+/*** Inflate the /api/agents/:id record into the detail-page shape.* `meta.onchain`, `rec.token`, and `rec.payments` are surfaced when present.@@ -2497,7 +2515,7 @@ async function loadAgent(id) {let rec;try {- const json = await fetchJson(`/api/agents/${encodeURIComponent(id)}`);+ const json = await fetchAgentRecord(`/api/agents/${encodeURIComponent(id)}`);rec = json.agent;} catch (e) {// A 404 is genuinely "no such agent"; anything else (offline, 5xx) is adiff --git a/src/dashboard-next/pages/home.js b/src/dashboard-next/pages/home.jsindex 5d3b264a6..07c190965 100644--- a/src/dashboard-next/pages/home.js+++ b/src/dashboard-next/pages/home.js@@ -37,18 +37,26 @@ const STATE = {${!forgeAnnounceDismissed ? `<section data-slot="announce" class="dnx-announce-wrap"></section>` : ''}<div class="dnx-welcome-row">- <div>+ <div class="dnx-welcome-text"><h1 class="dn-h1" style="margin-bottom:4px">Welcome back, ${esc(greeting)}.</h1><p class="dn-h1-sub" style="margin:0">Your 3D agents, revenue, and visitor activity — all in one place.</p></div>+ <div class="dnx-welcome-actions">+ <span class="dnx-welcome-date" aria-hidden="true">${esc(todayLabel())}</span>+ <a class="dn-btn" href="/dashboard/widgets">New widget</a>+ <a class="dn-btn primary dnx-welcome-cta" href="/create">+ <svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M8 3v10M3 8h10"/></svg>+ Create avatar+ </a>+ </div></div>${!dismissed ? `<section data-slot="onboarding" class="dnx-onboarding-wrap"></section>` : ''}<div class="dnx-grid"><div class="dnx-col-main">- <section data-slot="hero" class="dnx-hero"></section><section data-slot="kpis" class="dnx-kpis"></section>+ <section data-slot="hero" class="dnx-hero"></section><section data-slot="trading" class="dnx-trading-wrap"></section><section data-slot="health" class="dnx-health-wrap"></section><section data-slot="quick" class="dnx-quick"></section>@@ -351,6 +359,12 @@ async function refreshKpis(host, ctx) {},];+ for (const c of cards) {+ // Active-avatars is a running total (flat synthetic series), so a momentum+ // read would be meaningless — only chart-backed metrics get a trend chip.+ c.trend = c.key === 'avatars' ? null : trendOf(c.series);+ }+host.innerHTML = cards.map(renderKpiCard).join('');for (const c of cards) {@@ -363,15 +377,31 @@ async function refreshKpis(host, ctx) {}function renderKpiCard(c) {- const body = c.empty- ? `<div class="dnx-kpi-empty"><div class="dnx-kpi-value">${esc(c.value)}</div>- <a class="dn-btn" href="${c.emptyCta.href}">${esc(c.emptyCta.label)}</a></div>`- : `<div class="dnx-kpi-value">${esc(c.value)}</div>- <div class="dnx-kpi-spark">${sparkSvg(c.series)}</div>`;+ if (c.empty) {+ return `+ <div class="dn-panel dnx-kpi dnx-kpi-is-empty" data-kpi="${esc(c.key)}">+ <div class="dnx-kpi-label">${esc(c.label)}</div>+ <div class="dnx-kpi-empty">+ <div class="dnx-kpi-value">${esc(c.value)}</div>+ <a class="dn-btn" href="${c.emptyCta.href}">${esc(c.emptyCta.label)}</a>+ </div>+ </div>`;+ }+ const t = c.trend;+ const dir = t?.dir || 'flat';+ const trendHtml = t+ ? `<span class="dnx-kpi-trend dnx-kpi-trend-${dir}" title="Momentum across the last 7 days">+ ${trendArrow(dir)}<span>${t.label ? esc(t.label) : `${Math.abs(t.pct).toFixed(0)}%`}</span>+ </span>`+ : '';return `<div class="dn-panel dnx-kpi" data-kpi="${esc(c.key)}"><div class="dnx-kpi-label">${esc(c.label)}</div>- ${body}+ <div class="dnx-kpi-value-row">+ <div class="dnx-kpi-value">${esc(c.value)}</div>+ ${trendHtml}+ </div>+ <div class="dnx-kpi-spark">${sparkSvg(c.series, dir)}</div></div>`;}@@ -1404,26 +1434,66 @@ function renderDirectory(host) {// ── Sparkline ─────────────────────────────────────────────────────────────-function sparkSvg(series) {+const SPARK_COLOR = {+ up: 'var(--nxt-success)',+ down: 'var(--nxt-danger)',+ flat: 'var(--nxt-ink-dim)',+};++function sparkSvg(series, dir = 'flat') {if (!series.length) return '';const w = 220, h = 38, pad = 2;+ const color = SPARK_COLOR[dir] || SPARK_COLOR.flat;const max = Math.max(1, ...series.map((p) => p.value));const dx = (w - pad * 2) / Math.max(1, series.length - 1);- const pts = series.map((p, i) => {+ const coords = series.map((p, i) => {const x = pad + i * dx;const y = h - pad - (p.value / max) * (h - pad * 2);- return `${x.toFixed(2)},${y.toFixed(2)}`;+ return [x, y];});- const line = pts.join(' ');+ const line = coords.map(([x, y]) => `${x.toFixed(2)},${y.toFixed(2)}`).join(' ');const area = `${pad},${h - pad} ${line} ${(w - pad).toFixed(2)},${h - pad}`;+ const [lx, ly] = coords[coords.length - 1];return `- <svg viewBox="0 0 ${w} ${h}" preserveAspectRatio="none" width="100%" height="${h}">- <polygon points="${area}" fill="var(--nxt-ink-dim)" fill-opacity="0.10"/>- <polyline points="${line}" fill="none" stroke="var(--nxt-ink-dim)" stroke-width="1.6" stroke-linejoin="round" stroke-linecap="round"/>+ <svg viewBox="0 0 ${w} ${h}" preserveAspectRatio="none" width="100%" height="${h}" style="color:${color}">+ <polygon points="${area}" fill="currentColor" fill-opacity="0.12"/>+ <polyline points="${line}" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linejoin="round" stroke-linecap="round"/>+ <circle cx="${lx.toFixed(2)}" cy="${ly.toFixed(2)}" r="2.4" fill="currentColor" vector-effect="non-scaling-stroke"/></svg>`;}+// Momentum across the available window: sum of the latest third vs the earliest+// third of the daily series. Honest read computed from real data only — null+// when there's nothing to compare (flat or empty series).+function trendOf(series) {+ if (!series || series.length < 4) return null;+ const vals = series.map((p) => Number(p.value) || 0);+ const span = Math.max(1, Math.floor(vals.length / 3));+ const first = vals.slice(0, span).reduce((a, b) => a + b, 0);+ const second = vals.slice(vals.length - span).reduce((a, b) => a + b, 0);+ if (first === 0 && second === 0) return null;+ if (first === 0) return { dir: 'up', pct: null, label: 'New' };+ const pct = ((second - first) / first) * 100;+ if (Math.abs(pct) < 1) return { dir: 'flat', pct: 0 };+ return { dir: pct > 0 ? 'up' : 'down', pct };+}++function trendArrow(dir) {+ if (dir === 'up') return '<svg viewBox="0 0 12 12" width="10" height="10" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M2.5 7.5L6 4l3.5 3.5"/></svg>';+ if (dir === 'down') return '<svg viewBox="0 0 12 12" width="10" height="10" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M2.5 4.5L6 8l3.5-3.5"/></svg>';+ return '<svg viewBox="0 0 12 12" width="10" height="10" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><path d="M2.5 6h7"/></svg>';+}++// "Thu, Jun 26" — calm context for the header, no live ticking.+function todayLabel() {+ try {+ return new Date().toLocaleDateString('en-US', { weekday: 'short', month: 'short', day: 'numeric' });+ } catch {+ return '';+ }+}+function padDailySeries(rows, days) {const today = startOfUtcDay(new Date());const out = [];@@ -1570,7 +1640,15 @@ function injectStyles() {gap: 14px;}@media (max-width: 920px) { .dnx-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }- .dnx-kpi { padding: 14px 16px; }+ .dnx-kpi {+ padding: 14px 16px;+ transition: border-color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;+ }+ .dnx-kpi:hover {+ border-color: var(--nxt-stroke-strong);+ transform: translateY(-2px);+ box-shadow: 0 10px 30px -18px rgba(0,0,0,0.6);+ }.dnx-kpi-label {font-size: 11.5px;font-weight: 600;@@ -1579,17 +1657,71 @@ function injectStyles() {color: var(--nxt-ink-fade);margin-bottom: 8px;}+ .dnx-kpi-value-row {+ display: flex;+ align-items: baseline;+ justify-content: space-between;+ gap: 8px;+ margin-bottom: 8px;+ }.dnx-kpi-value {font-size: 26px;font-weight: 600;letter-spacing: -0.02em;color: var(--nxt-ink);line-height: 1.1;- margin-bottom: 8px;font-variant-numeric: tabular-nums;}+ .dnx-kpi-value-row .dnx-kpi-value { margin-bottom: 0; }+ .dnx-kpi-trend {+ display: inline-flex;+ align-items: center;+ gap: 2px;+ flex-shrink: 0;+ font-size: 11.5px;+ font-weight: 600;+ font-variant-numeric: tabular-nums;+ padding: 2px 6px 2px 4px;+ border-radius: var(--nxt-radius-pill);+ line-height: 1;+ }+ .dnx-kpi-trend svg { display: block; }+ .dnx-kpi-trend-up { color: var(--nxt-success); background: rgba(184, 188, 196, 0.1); }+ .dnx-kpi-trend-down { color: var(--nxt-danger); background: rgba(150, 155, 163, 0.1); }+ .dnx-kpi-trend-flat { color: var(--nxt-ink-fade); background: rgba(255,255,255,0.04); }.dnx-kpi-spark { height: 38px; }.dnx-kpi-empty { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }+ .dnx-kpi-empty .dnx-kpi-value { margin-bottom: 0; }++ /* ── Welcome header ── */+ .dnx-welcome-row {+ display: flex;+ align-items: flex-end;+ justify-content: space-between;+ gap: 18px;+ flex-wrap: wrap;+ margin-bottom: 20px;+ }+ .dnx-welcome-text { min-width: 0; }+ .dnx-welcome-actions {+ display: flex;+ align-items: center;+ gap: 10px;+ flex-shrink: 0;+ }+ .dnx-welcome-date {+ font-size: 12.5px;+ color: var(--nxt-ink-fade);+ font-variant-numeric: tabular-nums;+ white-space: nowrap;+ margin-right: 2px;+ }+ .dnx-welcome-cta svg { margin-right: -1px; }+ @media (max-width: 620px) {+ .dnx-welcome-actions { width: 100%; }+ .dnx-welcome-date { display: none; }+ .dnx-welcome-cta { margin-left: auto; }+ }/* ── Agent health ── */.dnx-health-wrap { min-width: 0; }diff --git a/tests/api/agent-detail-resilient-load.test.js b/tests/api/agent-detail-resilient-load.test.jsnew file mode 100644index 000000000..4c11e576c--- /dev/null+++ b/tests/api/agent-detail-resilient-load.test.js@@ -0,0 +1,123 @@+// GET /api/agents/:id must survive a failure in its *supplementary* decoration+// steps. The core read is a single agent_identities row; skill pricing and the+// dangling-avatar self-heal are enrichments layered on top. When either throws+// (skill-price cache backend hiccup, a transient error on the avatars probe),+// the endpoint used to 500 — which the agent-detail page renders as the full+// "Couldn't load this agent — problem reaching the registry" error state, even+// though the agent itself loaded fine. These tests pin the degrade-don't-die+// contract: the agent still returns 200, with skill_prices defaulting to {}.+//+// Driven through the real handleGetOne with DB / auth / rate-limit / r2 / cache+// mocked so the suite stays offline.++import { describe, it, expect, vi, beforeEach } from 'vitest';+import { makeReq, makeRes } from '../_helpers/monetization.js';++const AGENT_ID = '6bf40884-35af-432e-b432-8ba73fb5ba15';++// Content-addressed SQL mock: classify by query text so call order never+// matters. `avatarsThrows` flips the avatars probe (healStaleAvatarId) into a+// rejection to exercise that degrade path independently.+let agentRow = null;+let avatarsThrows = false;+const sqlMock = vi.fn((strings) => {+ const q = Array.isArray(strings) ? strings.join(' ') : String(strings);+ if (/FROM avatars/i.test(q)) {+ if (avatarsThrows) return Promise.reject(new Error('avatars probe failed'));+ return Promise.resolve([{ id: agentRow?.avatar_id }]);+ }+ if (/FROM agent_identities/i.test(q)) return Promise.resolve(agentRow ? [agentRow] : []);+ if (/FROM usage_events/i.test(q)) return Promise.resolve([{ total: 7 }]);+ return Promise.resolve([]);+});+vi.mock('../../api/_lib/db.js', () => ({ sql: sqlMock }));++// The skill-price cache is the primary fault we inject: getSkillPrices rejects.+let skillPricesThrows = true;+vi.mock('../../api/_lib/skill-price-cache.js', () => ({+ getSkillPrices: vi.fn(async () => {+ if (skillPricesThrows) throw new Error('cache backend unreachable');+ return [];+ }),+ skillPriceMap: vi.fn(() => ({})),+}));++vi.mock('../../api/_lib/auth.js', () => ({+ getSessionUser: vi.fn(async () => null),+ authenticateBearer: vi.fn(async () => null),+ extractBearer: vi.fn(() => null),+ hasScope: vi.fn(() => false),+}));++vi.mock('../../api/_lib/rate-limit.js', () => ({+ limits: { publicIp: vi.fn(async () => ({ success: true, reset: Date.now() + 1000, limit: 60, remaining: 59 })) },+ clientIp: vi.fn(() => '127.0.0.1'),+}));++vi.mock('../../api/_lib/r2.js', () => ({ publicUrl: (k) => (k ? `https://cdn.test/${k}` : null) }));++// cacheWrap(key, ttl, fn) → run fn so the usage_events count path still exercises+// the mocked sql, but never reaches a real cache backend.+vi.mock('../../api/_lib/cache.js', () => ({+ cacheWrap: vi.fn(async (_key, _ttl, fn) => fn()),+}));++const { handleGetOne } = await import('../../api/agents.js');++function agentFixture(overrides = {}) {+ return {+ id: AGENT_ID,+ name: 'Atlas',+ description: 'A research agent.',+ user_id: 'owner-uuid',+ avatar_id: null,+ meta: {},+ skills: ['research'],+ created_at: '2026-01-01T00:00:00Z',+ updated_at: '2026-01-01T00:00:00Z',+ ...overrides,+ };+}++async function getAgent() {+ const req = makeReq({ method: 'GET', url: `/api/agents/${AGENT_ID}` });+ const res = makeRes();+ await handleGetOne(req, res, AGENT_ID);+ return { status: res.statusCode, body: res.body ? JSON.parse(res.body) : null };+}++beforeEach(() => {+ sqlMock.mockClear();+ agentRow = agentFixture();+ avatarsThrows = false;+ skillPricesThrows = true;+});++describe('GET /api/agents/:id — resilient load', () => {+ it('still 200s with skill_prices={} when the skill-price cache throws', async () => {+ const { status, body } = await getAgent();+ expect(status).toBe(200);+ expect(body.agent.id).toBe(AGENT_ID);+ expect(body.agent.name).toBe('Atlas');+ expect(body.agent.skill_prices).toEqual({});+ });++ it('still 200s when the dangling-avatar self-heal probe throws', async () => {+ agentRow = agentFixture({ avatar_id: '99999999-1111-4111-8111-222222222222' });+ avatarsThrows = true;+ skillPricesThrows = false;+ const { status, body } = await getAgent();+ expect(status).toBe(200);+ expect(body.agent.id).toBe(AGENT_ID);+ // avatar_id is left intact rather than nulled when the probe can't run.+ expect(body.agent.avatar_id).toBe('99999999-1111-4111-8111-222222222222');+ });++ it('serves the agent normally when every enrichment succeeds', async () => {+ skillPricesThrows = false;+ const { status, body } = await getAgent();+ expect(status).toBe(200);+ expect(body.agent.chat_count).toBe(7);+ expect(body.agent.skill_prices).toEqual({});+ });+});diff --git a/tests/avatar-engines-data.test.js b/tests/avatar-engines-data.test.jsnew file mode 100644index 000000000..0eab77f2e--- /dev/null+++ b/tests/avatar-engines-data.test.js@@ -0,0 +1,97 @@+/**+ * Avatar Engines Atlas — dataset integrity tests.+ *+ * The /avatar-engines page renders straight from avatar-engines-data.js, so the+ * data IS the product. These tests guard the invariants the page relies on:+ * unique ids, valid enum fields, real links, and the licensing rule that keeps+ * non-commercial research engines out of the commercial generation pipeline.+ */++import { describe, it, expect } from 'vitest';+import {+ ENGINES,+ FAMILIES,+ INTEGRATIONS,+ REPRESENTATIONS,+ enginesByFamily,+ engineStats,+} from '../src/avatar-engines-data.js';++const FAMILY_IDS = new Set(FAMILIES.map((f) => f.id));+const INTEGRATION_IDS = new Set(Object.keys(INTEGRATIONS));+const REP_IDS = new Set(Object.keys(REPRESENTATIONS));++describe('avatar-engines dataset', () => {+ it('has a healthy number of engines across every family', () => {+ expect(ENGINES.length).toBeGreaterThanOrEqual(20);+ for (const fam of FAMILIES) {+ expect(enginesByFamily(fam.id).length, `family ${fam.id} should not be empty`).toBeGreaterThan(0);+ }+ });++ it('has unique ids', () => {+ const ids = ENGINES.map((e) => e.id);+ expect(new Set(ids).size).toBe(ids.length);+ });++ it('every engine has valid enum fields and required text', () => {+ for (const e of ENGINES) {+ expect(FAMILY_IDS.has(e.family), `${e.id}: bad family ${e.family}`).toBe(true);+ expect(REP_IDS.has(e.representation), `${e.id}: bad representation ${e.representation}`).toBe(true);+ expect(INTEGRATION_IDS.has(e.integration), `${e.id}: bad integration ${e.integration}`).toBe(true);+ expect(typeof e.commercial, `${e.id}: commercial must be boolean`).toBe('boolean');+ for (const field of ['name', 'org', 'input', 'output', 'license', 'compute', 'blurb', 'integrationNote', 'venue']) {+ expect(typeof e[field], `${e.id}: missing ${field}`).toBe('string');+ expect(e[field].length, `${e.id}: empty ${field}`).toBeGreaterThan(0);+ }+ expect(Number.isInteger(e.year), `${e.id}: year`).toBe(true);+ }+ });++ it('every engine links to a real repo and an http(s) or internal demo', () => {+ for (const e of ENGINES) {+ expect(e.links?.repo, `${e.id}: no repo`).toMatch(/^https?:\/\//);+ if (e.links?.paper) expect(e.links.paper).toMatch(/^https?:\/\//);+ if (e.links?.demo) expect(e.links.demo).toMatch(/^(https?:\/\/|\/)/);+ }+ });++ it('only commercially-licensed engines may deep-link into the generation pipeline (/forge)', () => {+ // Routing a non-commercial research model into the paid pipeline would+ // violate its license — the page must never do it.+ for (const e of ENGINES) {+ const ctaHref = e.cta?.href || '';+ if (ctaHref.startsWith('/forge')) {+ expect(e.commercial, `${e.id} deep-links to /forge but is not commercial-licensed`).toBe(true);+ }+ if (e.integration === 'forge' || e.integration === 'live') {+ // live/forge integrations are the ones we actively run; they must be commercial.+ expect(e.commercial, `${e.id} is integration=${e.integration} but not commercial-licensed`).toBe(true);+ }+ }+ });++ it('engines flagged for the splat viewer produce a splat/neural representation', () => {+ for (const e of ENGINES) {+ if (e.integration === 'splat') {+ expect(['gaussian', 'nerf'], `${e.id}: splat integration needs gaussian/nerf output`).toContain(e.representation);+ }+ }+ });++ it('engineStats reflects the dataset', () => {+ const s = engineStats();+ expect(s.total).toBe(ENGINES.length);+ expect(s.families).toBe(FAMILIES.length);+ expect(s.commercial).toBe(ENGINES.filter((e) => e.commercial).length);+ expect(s.splat).toBe(ENGINES.filter((e) => e.integration === 'splat').length);+ });++ it('references no token other than $THREE', () => {+ const blob = JSON.stringify(ENGINES).toLowerCase();+ // guard against accidental coin tickers slipping into copy+ for (const bad of ['$sol ', '$btc', '$eth ', '$pump', '$bonk', '$wif']) {+ expect(blob.includes(bad), `dataset mentions ${bad}`).toBe(false);+ }+ });+});diff --git a/vite.config.js b/vite.config.jsindex db5b9a1a6..73657579d 100644--- a/vite.config.js+++ b/vite.config.js@@ -2255,17 +2255,18 @@ support: resolve(__dirname, 'pages/support.html'),urlPattern: /^https?:\/\/[^/]+\/api\/widgets\//i,handler: 'NetworkOnly',},- // Same-origin scripts & styles. Not precached (see globPatterns- // note above) — cached opportunistically at runtime so repeat- // visits stay fast without the deploy-skew fragility of- // precaching every hashed chunk. StaleWhileRevalidate serves the- // cached chunk instantly and refreshes it in the background; a- // 404 during a deploy rollover is a non-fatal background miss,- // never a broken SW install. Placed after the /widget, /embed,- // and /api/widgets NetworkOnly rules so those keep precedence.+ // Content-hashed build chunks under /assets/ (e.g.+ // assets/marketplace-Cn45GLvE.js, assets/index-<hash>.css).+ // These are immutable: the filename changes whenever the bytes+ // change, so the cached copy can NEVER be stale for a URL that+ // still resolves. StaleWhileRevalidate is correct and fast here —+ // serve instantly, refresh in the background; a 404 during a+ // deploy rollover is a non-fatal background miss the page's own+ // dynamic import handles, never a broken SW install.{- urlPattern: ({ request, sameOrigin }) =>+ urlPattern: ({ url, request, sameOrigin }) =>sameOrigin &&+ url.pathname.startsWith('/assets/') &&(request.destination === 'script' ||request.destination === 'style'),handler: 'StaleWhileRevalidate',@@ -2278,6 +2279,36 @@ support: resolve(__dirname, 'pages/support.html'),cacheableResponse: { statuses: [200] },},},+ // Stable-named same-origin scripts & styles served verbatim from+ // public/ (/style.css, /marketplace.css, /nav.css, /mobile.css,+ // /nav.js, /footer.js, ...). Unlike the hashed chunks above these+ // keep ONE URL across deploys while their BYTES change — so+ // StaleWhileRevalidate would hand a returning user last deploy's+ // CSS against this deploy's freshly-served HTML. When a redesign+ // renames classes or restructures the header/marketplace markup,+ // the stale stylesheet no longer matches: the header collapses to+ // overlapping text and the tab rail stacks vertically (the exact+ // FOUC users hit "again" after every deploy). NetworkFirst pins+ // the live deploy's CSS/JS to its HTML — always fetch fresh, fall+ // back to cache only when offline. A short network timeout keeps+ // repeat visits fast. Placed after the /assets/ rule so hashed+ // chunks keep their immutable SWR fast path.+ {+ urlPattern: ({ request, sameOrigin }) =>+ sameOrigin &&+ (request.destination === 'script' ||+ request.destination === 'style'),+ handler: 'NetworkFirst',+ options: {+ cacheName: 'app-shell-assets',+ networkTimeoutSeconds: 4,+ expiration: {+ maxEntries: 80,+ maxAgeSeconds: 60 * 60 * 24 * 30,+ },+ cacheableResponse: { statuses: [200] },+ },+ },{urlPattern: /^https:\/\/fonts\.googleapis\.com\/.*/i,handler: 'CacheFirst',