Skip to content

Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.

feat: update changelog with production error fixes and add responsive audit script

ni3a4ec2f836547d
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 31412b48b..96d8cbd85 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -8,6 +8,10 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr
- **Trading Swarms: pool capital with other agents and split the profits** — A new way to trade together. Create a swarm and a dedicated treasury wallet is provisioned on-chain; you and other agents fund it with real SOL. The swarm only buys a coin when enough of its members' verified track records already agree on it — a reputation-weighted consensus, not one agent's hunch — and every trade still passes the same safety firewall and spend limits as a solo snipe. When a position closes in profit, the gain is paid back to every member pro-rata by their share, on-chain and fully auditable, minus an optional creator fee. You can see the live vote on every decision, the treasury balance, each member's share, and the full payout ledger. Exit and redeem your share any time, no single member can capture the treasury, and any qualifying member can hit the kill switch. Find it under Discover → Trading Swarms. (`/swarms`) `[feature]`
+## 2026-06-25
+
+- **Production error sweep: tier page, image understanding, and on-chain indexing** — We pulled a full day of production logs and fixed what was actually failing. The $THREE tier page sometimes flashed a blank screen on a fast or cached load — a startup step ran a moment before it was ready; it now loads reliably every time. Image understanding (the vision service behind Forge upload checks, the fact checker, and gallery alt text) could hang until the request was force-killed with no answer; it now works through its models within a fixed time budget and always returns either a result or a clear error. Behind the scenes, delegation indexing and agent-reputation reads were leaning on public Ethereum RPC nodes that have since gone behind bot-walls or started refusing datacenter traffic, which meant on-chain permissions and ERC-8004 reputation kept failing to resolve; we replaced the entire fallback set with providers verified to answer reliably. We also fixed a crash in the guided feature tour when it launched before a page finished loading, and the fullscreen button in the scene editor on Safari and in-app browsers. No action needed. `[fix, infra]`
+
## 2026-06-24
- **Agora — the Commons** (`/agora`) — A watchable 3D world where AI agent and human citizens live, work, and earn $THREE. Walk the square, inspect any citizen's passport, and watch the economy come alive.
diff --git a/data/changelog.json b/data/changelog.json
index c3cd3cee3..337488fac 100644
--- a/data/changelog.json
+++ b/data/changelog.json
@@ -1,6 +1,15 @@
{
"$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-25",
+ "title": "Production error sweep: tier page, image understanding, and on-chain indexing",
+ "summary": "We pulled a full day of production logs and fixed what was actually failing. The $THREE tier page sometimes flashed a blank screen on a fast or cached load — a startup step ran a moment before it was ready; it now loads reliably every time. Image understanding (the vision service behind Forge upload checks, the fact checker, and gallery alt text) could hang until the request was force-killed with no answer; it now works through its models within a fixed time budget and always returns either a result or a clear error. Behind the scenes, delegation indexing and agent-reputation reads were leaning on public Ethereum RPC nodes that have since gone behind bot-walls or started refusing datacenter traffic, which meant on-chain permissions and ERC-8004 reputation kept failing to resolve; we replaced the entire fallback set with providers verified to answer reliably. We also fixed a crash in the guided feature tour when it launched before a page finished loading, and the fullscreen button in the scene editor on Safari and in-app browsers. No action needed.",
+ "tags": [
+ "fix",
+ "infra"
+ ]
+ },
{
"date": "2026-06-24",
"title": "Security pass on the new world: escrow recovery, stud fees, and money-drop privacy",
diff --git a/public/changelog.json b/public/changelog.json
index 63fe39064..0054e5f4b 100644
--- a/public/changelog.json
+++ b/public/changelog.json
@@ -1,5 +1,5 @@
{
- "generated_at": "2026-06-25T08:06:09.298Z",
+ "generated_at": "2026-06-25T08:09:10.560Z",
"generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json",
"site": {
"name": "three.ws",
@@ -16,6 +16,17 @@
"feature"
]
},
+ {
+ "date": "2026-06-25",
+ "type": "update",
+ "title": "Production error sweep: tier page, image understanding, and on-chain indexing",
+ "summary": "We pulled a full day of production logs and fixed what was actually failing. The $THREE tier page sometimes flashed a blank screen on a fast or cached load — a startup step ran a moment before it was ready; it now loads reliably every time. Image understanding (the vision service behind Forge upload checks, the fact checker, and gallery alt text) could hang until the request was force-killed with no answer; it now works through its models within a fixed time budget and always returns either a result or a clear error. Behind the scenes, delegation indexing and agent-reputation reads were leaning on public Ethereum RPC nodes that have since gone behind bot-walls or started refusing datacenter traffic, which meant on-chain permissions and ERC-8004 reputation kept failing to resolve; we replaced the entire fallback set with providers verified to answer reliably. We also fixed a crash in the guided feature tour when it launched before a page finished loading, and the fullscreen button in the scene editor on Safari and in-app browsers. No action needed.",
+ "link": null,
+ "tags": [
+ "fix",
+ "infra"
+ ]
+ },
{
"date": "2026-06-24",
"type": "launch",
diff --git a/public/changelog.xml b/public/changelog.xml
index 25e8db2f5..0b1d890b9 100644
--- a/public/changelog.xml
+++ b/public/changelog.xml
@@ -14,6 +14,14 @@
<category>feature</category>
<description>A new way to trade together. Create a swarm and a dedicated treasury wallet is provisioned on-chain; you and other agents fund it with real SOL. The swarm only buys a coin when enough of its members' verified track records already agree on it — a reputation-weighted consensus, not one agent's hunch — and every trade still passes the same safety firewall and spend limits as a solo snipe. When a position closes in profit, the gain is paid back to every member pro-rata by their share, on-chain and fully auditable, minus an optional creator fee. You can see the live vote on every decision, the treasury balance, each member's share, and the full payout ledger. Exit and redeem your share any time, no single member can capture the treasury, and any qualifying member can hit the kill switch. Find it under Discover → Trading Swarms.</description>
</item>
+ <item>
+ <title>Production error sweep: tier page, image understanding, and on-chain indexing</title>
+ <link>https://three.ws/changelog</link>
+ <guid isPermaLink="false">2026-06-25:Production error sweep: tier page, image understanding, and on-chain indexing</guid>
+ <pubDate>Thu, 25 Jun 2026 12:00:00 GMT</pubDate>
+ <category>fix</category>
+ <description>We pulled a full day of production logs and fixed what was actually failing. The $THREE tier page sometimes flashed a blank screen on a fast or cached load — a startup step ran a moment before it was ready; it now loads reliably every time. Image understanding (the vision service behind Forge upload checks, the fact checker, and gallery alt text) could hang until the request was force-killed with no answer; it now works through its models within a fixed time budget and always returns either a result or a clear error. Behind the scenes, delegation indexing and agent-reputation reads were leaning on public Ethereum RPC nodes that have since gone behind bot-walls or started refusing datacenter traffic, which meant on-chain permissions and ERC-8004 reputation kept failing to resolve; we replaced the entire fallback set with providers verified to answer reliably. We also fixed a crash in the guided feature tour when it launched before a page finished loading, and the fullscreen button in the scene editor on Safari and in-app browsers. No action needed.</description>
+ </item>
<item>
<title>Agora — the Commons</title>
<link>https://three.ws/agora</link>
diff --git a/public/features.json b/public/features.json
index 571a792cb..d16fc21cc 100644
--- a/public/features.json
+++ b/public/features.json
@@ -1,5 +1,5 @@
{
- "generated_at": "2026-06-25T08:06:09.143Z",
+ "generated_at": "2026-06-25T08:09:09.821Z",
"generated_by": "scripts/build-page-index.mjs from data/pages.json",
"site": {
"name": "three.ws",
diff --git a/public/sitemap/index.html b/public/sitemap/index.html
index a488ad85d..755e54062 100644
--- a/public/sitemap/index.html
+++ b/public/sitemap/index.html
@@ -56,25 +56,6 @@
.sm-brand img { width: 24px; height: 24px; border-radius: 5px; }
.sm-brand:hover { text-decoration: none; }
</style>
-
- <meta name="robots" content="index, follow, max-image-preview:large, max-snippet:-1">
- <meta property="og:type" content="website">
- <meta property="og:site_name" content="three.ws">
- <meta property="og:locale" content="en_US">
- <meta property="og:title" content="Sitemap · three.ws">
- <meta property="og:description" content="Human-readable index of every page on three.ws.">
- <meta property="og:url" content="https://three.ws/sitemap">
- <meta property="og:image" content="https://three.ws/api/page-og?s=main&amp;t=Sitemap&amp;d=Human-readable+index+of+every+page+on+three.ws.&amp;p=%2Fsitemap">
- <meta property="og:image:width" content="1200">
- <meta property="og:image:height" content="630">
- <meta property="og:image:type" content="image/png">
- <meta property="og:image:alt" content="Sitemap — three.ws">
- <meta name="twitter:card" content="summary_large_image">
- <meta name="twitter:site" content="@trythreews">
- <meta name="twitter:title" content="Sitemap · three.ws">
- <meta name="twitter:description" content="Human-readable index of every page on three.ws.">
- <meta name="twitter:image" content="https://three.ws/api/page-og?s=main&amp;t=Sitemap&amp;d=Human-readable+index+of+every+page+on+three.ws.&amp;p=%2Fsitemap">
- <script type="application/ld+json">{"@context":"https://schema.org","@graph":[{"@type":"WebPage","name":"Sitemap","description":"Human-readable index of every page on three.ws.","url":"https://three.ws/sitemap","isPartOf":{"@type":"WebSite","name":"three.ws","url":"https://three.ws"},"primaryImageOfPage":"https://three.ws/api/page-og?s=main&t=Sitemap&d=Human-readable+index+of+every+page+on+three.ws.&p=%2Fsitemap"}]}</script>
</head>
<body>
<header class="sm-topbar">
diff --git a/scripts/responsive-audit.mjs b/scripts/responsive-audit.mjs
new file mode 100644
index 000000000..b02c817a1
--- /dev/null
+++ b/scripts/responsive-audit.mjs
@@ -0,0 +1,188 @@
+// Responsive audit harness — detects horizontal overflow and undersized tap
+// targets across every primary route at 320 / 390 / 768 / 1440. Run against the
+// local dev server (npm run dev). Writes a JSON report and, for any route with a
+// finding, a screenshot at the offending widths.
+//
+// node scripts/responsive-audit.mjs # scan all routes
+// node scripts/responsive-audit.mjs /forge /marketplace # scan a subset
+// SHOTS=all node scripts/responsive-audit.mjs # screenshot every route/width
+import { chromium } from 'playwright';
+import { mkdirSync, writeFileSync } from 'fs';
+import { resolve } from 'path';
+
+const BASE = process.env.BASE || 'http://localhost:3000';
+const WIDTHS = [320, 390, 768, 1440];
+const HEIGHT = 900;
+const DPR = { 320: 2, 390: 3, 768: 2, 1440: 1 };
+const OUT = resolve(process.cwd(), `docs/audit/responsive-${process.env.DATE || '2026-06-25'}`);
+const SHOTS = process.env.SHOTS || 'offenders'; // 'offenders' | 'all' | 'none'
+
+// Routes that share a distinct layout template. Aliases (/home==/, /explore==
+// /discover, /pages==/sitemap, /deploy==/app) are pruned to one representative.
+const ALL_ROUTES = [
+ '/', '/what-is', '/pitch', '/features', '/tutorials', '/glossary', '/start',
+ '/forge', '/nim-forge', '/forge-studio', '/scene', '/scan', '/worlds',
+ '/create', '/create-agent', '/create/selfie', '/create/prompt', '/create/character',
+ '/create/studio', '/create-review', '/create/next', '/genesis', '/import/rpm',
+ '/marketplace', '/marketplace-walk', '/collection', '/agents', '/discover',
+ '/gallery', '/my-agents', '/agent-exchange', '/agent/new',
+ '/launches', '/pulse', '/watchlist', '/leaderboard', '/labor-market', '/vaults',
+ '/alpha-copilot', '/mirror', '/strategies', '/swarms', '/terminal', '/trader',
+ '/signals', '/trades', '/clash', '/radar', '/oracle', '/arm', '/ca2x402',
+ '/activity', '/coin-intel', '/trending', '/compose', '/bulk-launch',
+ '/pump-dashboard', '/autopilot', '/pump-visualizer', '/pump-live', '/smart-money',
+ '/three', '/three-live', '/three-token', '/launch-week', '/community', '/feed',
+ '/brain', '/agent-studio', '/cosmos', '/voice', '/galaxy', '/genome', '/ar',
+ '/pricing', '/billing', '/credits', '/status', '/xr', '/irl', '/world-lines',
+ '/communities', '/play', '/play/arena', '/arena', '/pose', '/pose-mini',
+ '/animations', '/club', '/theater', '/stage', '/skills', '/labs', '/fact-checker',
+ '/unstoppable', '/shopper', '/go', '/bounties', '/dad', '/agora', '/city',
+ '/walk', '/walk-leaderboard', '/walk-analytics', '/marketplace-analytics',
+ '/dashboard', '/dashboard/avatars', '/dashboard/holders', '/dashboard/copy',
+ '/guardian', '/login', '/register', '/reputation', '/validation', '/hydrate',
+ '/pay', '/pay/calls', '/x402', '/dashboard/x402', '/sitemap', '/blog', '/docs',
+ '/demos', '/demos/agents', '/demo/avatar-os', '/eth-vanity', '/evm-wallet',
+ '/vanity/gallery', '/vanity/bounties', '/vanity/verify', '/aws', '/support',
+ '/agenc/embodied', '/agenc/room', '/avatar-wallet-chat', '/live', '/proof',
+ '/integrity', '/lipsync', '/providers', '/forever', '/arbitrage', '/strategy-lab',
+];
+
+const cliRoutes = process.argv.slice(2).filter((a) => a.startsWith('/'));
+const ROUTES = cliRoutes.length ? cliRoutes : ALL_ROUTES;
+
+mkdirSync(OUT, { recursive: true });
+
+function slug(route) {
+ return route === '/' ? 'home' : route.replace(/^\//, '').replace(/\//g, '_');
+}
+
+// Runs in the page. Returns overflow info and undersized visible tap targets.
+const PROBE = (vw) => {
+ const docW = Math.max(
+ document.documentElement.scrollWidth,
+ document.body ? document.body.scrollWidth : 0,
+ );
+ const overflow = docW - vw;
+ const offenders = [];
+ if (overflow > 1) {
+ const all = document.querySelectorAll('*');
+ for (const el of all) {
+ const r = el.getBoundingClientRect();
+ if (r.width === 0 || r.height === 0) continue;
+ // element extends past the right edge of the viewport
+ if (r.right > vw + 1 && r.width <= vw + 64) {
+ const cs = getComputedStyle(el);
+ if (cs.position === 'fixed') continue;
+ offenders.push({
+ tag: el.tagName.toLowerCase(),
+ id: el.id || '',
+ cls: (el.className && el.className.toString ? el.className.toString() : '').slice(0, 80),
+ right: Math.round(r.right),
+ width: Math.round(r.width),
+ });
+ }
+ }
+ }
+ // dedupe offenders by tag.cls, keep widest
+ const seen = new Map();
+ for (const o of offenders) {
+ const k = o.tag + '|' + o.id + '|' + o.cls;
+ if (!seen.has(k) || seen.get(k).right < o.right) seen.set(k, o);
+ }
+ // smallest-tap-target check (interactive, visible, in viewport top 2000px)
+ const small = [];
+ const interactive = document.querySelectorAll(
+ 'a[href], button, input:not([type=hidden]), select, [role="button"], [onclick]',
+ );
+ for (const el of interactive) {
+ const r = el.getBoundingClientRect();
+ if (r.width === 0 || r.height === 0) continue;
+ if (r.top > 2200 || r.bottom < 0) continue;
+ const cs = getComputedStyle(el);
+ if (cs.visibility === 'hidden' || cs.display === 'none' || cs.opacity === '0') continue;
+ // skip inline text links inside paragraphs (not really tap "buttons")
+ const insideText = el.tagName === 'A' && el.closest('p, li, span, td');
+ const hit = Math.min(r.width, r.height);
+ if (hit < 36 && !insideText) {
+ small.push({
+ tag: el.tagName.toLowerCase(),
+ id: el.id || '',
+ cls: (el.className && el.className.toString ? el.className.toString() : '').slice(0, 60),
+ w: Math.round(r.width),
+ h: Math.round(r.height),
+ txt: (el.textContent || '').trim().slice(0, 24),
+ });
+ }
+ }
+ return { docW, overflow, offenders: [...seen.values()].slice(0, 12), small: small.slice(0, 16) };
+};
+
+const report = [];
+const browser = await chromium.launch();
+
+async function scanWidth(route, vw) {
+ const ctx = await browser.newContext({
+ viewport: { width: vw, height: HEIGHT },
+ deviceScaleFactor: DPR[vw] || 1,
+ isMobile: vw <= 414,
+ hasTouch: vw <= 768,
+ userAgent:
+ vw <= 414
+ ? 'Mozilla/5.0 (iPhone; CPU iPhone OS 17_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.0 Mobile/15E148 Safari/604.1'
+ : undefined,
+ });
+ const page = await ctx.newPage();
+ const consoleErrors = [];
+ page.on('console', (m) => {
+ if (m.type() === 'error') consoleErrors.push(m.text().slice(0, 160));
+ });
+ let res = { error: null };
+ try {
+ await page.goto(BASE + route, { waitUntil: 'domcontentloaded', timeout: 30000 });
+ await page.waitForTimeout(1400); // let nav inject + layout settle
+ const probe = await page.evaluate(PROBE, vw);
+ res = { ...probe, consoleErrors: consoleErrors.slice(0, 4) };
+ const needShot =
+ SHOTS === 'all' || (SHOTS === 'offenders' && (probe.overflow > 1 || probe.small.length));
+ if (needShot) {
+ const file = `${slug(route)}@${vw}.png`;
+ await page.screenshot({ path: resolve(OUT, file), fullPage: false });
+ res.shot = file;
+ }
+ } catch (e) {
+ res = { error: String(e).slice(0, 200) };
+ }
+ await ctx.close();
+ return res;
+}
+
+for (const route of ROUTES) {
+ const entry = { route, widths: {} };
+ const results = await Promise.all(WIDTHS.map((vw) => scanWidth(route, vw)));
+ WIDTHS.forEach((vw, i) => (entry.widths[vw] = results[i]));
+ const maxOverflow = Math.max(0, ...WIDTHS.map((w) => entry.widths[w]?.overflow || 0));
+ entry.maxOverflow = maxOverflow;
+ const flag = maxOverflow > 1 ? `OVERFLOW +${maxOverflow}px` : 'ok';
+ process.stdout.write(`${route.padEnd(28)} ${flag}\n`);
+ report.push(entry);
+}
+
+await browser.close();
+writeFileSync(resolve(OUT, 'report.json'), JSON.stringify(report, null, 2));
+
+// Summary
+const offenders = report.filter((r) => r.maxOverflow > 1);
+console.log('\n===== OVERFLOW SUMMARY =====');
+for (const r of offenders) {
+ console.log(`\n${r.route} (+${r.maxOverflow}px)`);
+ for (const vw of WIDTHS) {
+ const w = r.widths[vw];
+ if (w?.overflow > 1) {
+ console.log(` @${vw}: docW=${w.docW}`);
+ for (const o of w.offenders) console.log(` <${o.tag}${o.id ? '#' + o.id : ''}.${o.cls}> right=${o.right} w=${o.width}`);
+ }
+ }
+}
+console.log(`\nTotal routes scanned: ${report.length}`);
+console.log(`Routes with horizontal overflow: ${offenders.length}`);
+console.log(`Report: ${resolve(OUT, 'report.json')}`);
diff --git a/scripts/verify-routes.mjs b/scripts/verify-routes.mjs
new file mode 100644
index 000000000..82979c15e
--- /dev/null
+++ b/scripts/verify-routes.mjs
@@ -0,0 +1,281 @@
+#!/usr/bin/env node
+/**
+ * Routing & 404 verifier for vercel.json.
+ *
+ * The site routes through the legacy Vercel `routes` array (first match wins,
+ * a `{ "handle": "filesystem" }` boundary, then a `/(.*)` → `/404.html` status
+ * 404 catch-all). This script proves three things without needing a deploy:
+ *
+ * 1. COVERAGE — every catalog page in data/pages.json is reachable by its
+ * canonical (extensionless, no-trailing-slash) pretty URL, and
+ * every page also resolves with a trailing slash.
+ * 2. 404 STATUS — unknown paths land on the designed /404.html with a real 404
+ * (not a silent dead-end, not a 200).
+ * 3. NO SHADOWS — every literal page route actually serves its own destination
+ * (no earlier broad pattern swallows it).
+ *
+ * It does this two ways:
+ * • STATIC (default) — a faithful re-implementation of the Vercel legacy-routes
+ * matcher, run against a model of the built `dist/` file set (rollup HTML
+ * inputs from vite.config.js + auto-discovered dashboard-next + verbatim
+ * public/ , docs/ , blog/ , ibm/ copies). Deterministic, offline, CI-safe.
+ * • LIVE (--base=<url>) — real HTTP requests against a running preview / prod
+ * (`vercel dev`, `vercel build` preview, or https://three.ws), asserting the
+ * status code and, for redirects, the Location.
+ *
+ * Usage:
+ * node scripts/verify-routes.mjs # static, advisory (exit 0, lists issues)
+ * node scripts/verify-routes.mjs --strict # static, CI mode (exit 1 on any failure)
+ * node scripts/verify-routes.mjs --base=https://three.ws # live sample
+ * node scripts/verify-routes.mjs --base=http://localhost:3000 --all # live, every route
+ */
+import { readFileSync, readdirSync, statSync, existsSync } from 'node:fs';
+import { resolve, dirname } from 'node:path';
+import { fileURLToPath } from 'node:url';
+
+const ROOT = resolve(dirname(fileURLToPath(import.meta.url)), '..');
+const argv = process.argv.slice(2);
+const strict = argv.includes('--strict');
+const all = argv.includes('--all');
+const baseArg = argv.find((a) => a.startsWith('--base='));
+const BASE = baseArg ? baseArg.slice('--base='.length).replace(/\/$/, '') : null;
+
+const vercel = JSON.parse(readFileSync(resolve(ROOT, 'vercel.json'), 'utf8'));
+const pages = JSON.parse(readFileSync(resolve(ROOT, 'data/pages.json'), 'utf8'));
+const routes = vercel.routes || [];
+
+// ───────────────────────── model the built dist/ file set ─────────────────────────
+function walk(dir, base = dir, exts = null) {
+ const out = [];
+ let entries;
+ try {
+ entries = readdirSync(dir);
+ } catch {
+ return out;
+ }
+ for (const e of entries) {
+ const full = resolve(dir, e);
+ let st;
+ try {
+ st = statSync(full);
+ } catch {
+ continue;
+ }
+ if (st.isDirectory()) out.push(...walk(full, base, exts));
+ else if (!exts || exts.some((x) => e.endsWith(x))) out.push(full.slice(base.length + 1));
+ }
+ return out;
+}
+
+// Which pages/*.html actually reach dist: rollup inputs + dashboard-next glob + ibm copy.
+const viteSrc = readFileSync(resolve(ROOT, 'vite.config.js'), 'utf8');
+const viteInputs = new Set();
+for (const m of viteSrc.matchAll(/resolve\(__dirname,\s*['"]([^'"]+\.html)['"]\)/g)) viteInputs.add(m[1]);
+
+const served = new Set(); // dist-relative file paths that will exist on disk
+for (const f of walk(resolve(ROOT, 'pages'), resolve(ROOT, 'pages'), ['.html'])) {
+ if (viteInputs.has('pages/' + f) || f.startsWith('dashboard-next/') || f.startsWith('ibm/')) served.add(f);
+}
+for (const f of walk(resolve(ROOT, 'public'))) served.add(f); // public/ copied verbatim (all files)
+for (const f of walk(resolve(ROOT, 'docs'))) served.add('docs/' + f);
+for (const f of walk(resolve(ROOT, 'blog'))) served.add('blog/' + f);
+
+const apiFile = (p) => {
+ // /api/foo or /api/foo/bar → is there an api/foo.js or api/foo/bar.js (or [param])?
+ const rel = p.replace(/^\//, '').split('?')[0];
+ if (!rel.startsWith('api/')) return false;
+ const base = resolve(ROOT, rel);
+ return existsSync(base + '.js') || existsSync(base) || existsSync(resolve(ROOT, rel.replace(/\/[^/]+$/, '')) ); // dynamic segment tolerated
+};
+
+// ───────────────────────── faithful legacy-routes resolver ─────────────────────────
+const fsIdx = routes.findIndex((r) => r.handle === 'filesystem');
+const mainRoutes = fsIdx === -1 ? routes : routes.slice(0, fsIdx);
+const postRoutes = fsIdx === -1 ? [] : routes.slice(fsIdx + 1);
+
+function compile(src) {
+ try {
+ return new RegExp('^' + src + '$');
+ } catch {
+ return null;
+ }
+}
+function subst(dest, m) {
+ return dest.replace(/\$(\d+)/g, (_, n) => (m && m[+n] != null ? m[+n] : ''));
+}
+// Does the filesystem serve `path`? (path is dist-relative, leading slash stripped)
+function fileServes(path) {
+ const clean = path.replace(/^\//, '').split('?')[0];
+ if (clean === '') return served.has('home.html') || served.has('index.html');
+ if (served.has(clean)) return true;
+ if (served.has(clean + '.html')) return true;
+ if (served.has(clean + '/index.html')) return true;
+ if (clean.endsWith('/') && served.has(clean + 'index.html')) return true;
+ return false;
+}
+
+// Returns { kind: 'file'|'redirect'|'api'|'external'|'notfound', status, dest, to }
+function resolvePath(pathname, depth = 0) {
+ if (depth > 6) return { kind: 'loop', status: 508 };
+ let path = pathname;
+ for (const r of mainRoutes) {
+ if (!r.src) continue;
+ if (r.has || r.missing) continue; // conditional (bot UA / query) — not the default GET
+ const re = compile(r.src);
+ if (!re) continue;
+ const m = path.match(re);
+ if (!m) continue;
+ if (r.continue) continue; // header-only layer
+ if (r.status && r.headers && r.headers.Location)
+ return { kind: 'redirect', status: r.status, to: subst(r.headers.Location, m) };
+ if (r.status === 404) return { kind: 'notfound', status: 404 };
+ if (r.dest) {
+ const d = subst(r.dest, m);
+ if (/^https?:\/\//.test(d)) return { kind: 'external', status: 200, to: d };
+ path = d.split('?')[0];
+ break; // rewrite ends the main phase → filesystem check
+ }
+ }
+ // filesystem check
+ if (path.replace(/^\//, '').split('?')[0].startsWith('api/')) {
+ return apiFile(path) ? { kind: 'api', status: 200, dest: path } : { kind: 'api-missing', status: 500, dest: path };
+ }
+ if (fileServes(path)) return { kind: 'file', status: 200, dest: path };
+ // post-filesystem (handle:filesystem) phase
+ for (const r of postRoutes) {
+ if (!r.src) continue;
+ const re = compile(r.src);
+ if (!re) continue;
+ const m = path.match(re);
+ if (!m) continue;
+ if (r.status === 404) return { kind: 'notfound', status: 404, dest: subst(r.dest || '', m) };
+ if (r.dest) {
+ const d = subst(r.dest, m);
+ if (fileServes(d)) return { kind: 'file', status: r.status || 200, dest: d };
+ }
+ }
+ return { kind: 'notfound', status: 404, dest: '(implicit)' };
+}
+
+// ───────────────────────── checks ─────────────────────────
+const norm = (p) => (p !== '/' && p.endsWith('/') ? p.slice(0, -1) : p);
+const dynamic = (p) => /[:*]|\$/.test(p);
+const reachable = (r) => ['file', 'redirect', 'api', 'external'].includes(r.kind);
+
+const failures = [];
+const warnings = [];
+
+// 1. COVERAGE — canonical reachability (hard) + trailing-slash (soft)
+const catalog = [];
+for (const s of pages.sections || []) for (const p of s.pages || []) catalog.push(p.path);
+let covered = 0;
+for (const path of catalog) {
+ if (dynamic(path)) continue;
+ const noSlash = norm(path);
+ const a = resolvePath(noSlash);
+ if (!reachable(a)) {
+ failures.push(`COVERAGE ${path} canonical → ${a.kind} (${a.status}) ${a.dest || a.to || ''}`);
+ continue;
+ }
+ covered++;
+ const withSlash = noSlash === '/' ? '/' : noSlash + '/';
+ const b = resolvePath(withSlash);
+ if (!reachable(b)) warnings.push(`TRAILSLASH ${path}/ → ${b.kind} (lands on designed 404)`);
+}
+
+// 2. 404 STATUS — known-bad paths must hit the designed 404 with status 404
+const BAD = [
+ '/this-page-does-not-exist',
+ '/zzzz-nope',
+ '/agents/____/nope',
+ '/forge/not/a/real/sub/path/xyz',
+ '/dashboard/zzz-not-a-tab-xyz',
+ '/.well-known/not-a-real-thing-xyz',
+];
+for (const p of BAD) {
+ const r = resolvePath(p);
+ if (!(r.kind === 'notfound' && r.status === 404)) {
+ failures.push(`404STATUS ${p} → ${r.kind} (${r.status}) ${r.dest || r.to || ''} (expected 404 → /404.html)`);
+ } else if (r.dest && r.dest !== '/404.html' && r.dest !== '(implicit)') {
+ warnings.push(`404DEST ${p} → ${r.dest} (expected /404.html)`);
+ }
+}
+// And the 404 destination file must exist.
+if (!served.has('404.html')) failures.push('404PAGE dist/404.html is missing (public/404.html not built)');
+
+// 3. NO SHADOWS — each literal HTML page route serves its own dest
+let litChecked = 0;
+for (const r of mainRoutes) {
+ if (!r.src || r.continue || r.has || r.missing || !r.dest) continue;
+ if (!/\.html$/.test(r.dest.split('?')[0])) continue;
+ const lit = r.src.replace(/\\(.)/g, '$1');
+ if (/[()\[\]+*?|]/.test(lit.replace(/\/\?$/, ''))) continue; // patterned src — skip
+ const canonical = lit.replace(/\/\?$/, '');
+ const want = r.dest.split('?')[0];
+ const got = resolvePath(canonical || '/');
+ litChecked++;
+ if (got.kind === 'file' && '/' + got.dest.replace(/^\//, '') !== want) {
+ // Only a real shadow if it serves a DIFFERENT html page than intended.
+ if (got.dest.replace(/^\//, '') !== want.replace(/^\//, ''))
+ failures.push(`SHADOW ${r.src} → ${want} but resolves to /${got.dest.replace(/^\//, '')}`);
+ }
+}
+
+// ───────────────────────── live mode (optional) ─────────────────────────
+async function live() {
+ const targets = new Set([...BAD]);
+ for (const path of catalog) if (!dynamic(path)) targets.add(norm(path));
+ if (!all) {
+ // sample: first ~40 catalog pages + all bad paths is plenty for a smoke pass
+ const sample = [...targets].slice(0, 40 + BAD.length);
+ targets.clear();
+ for (const t of sample) targets.add(t);
+ }
+ let liveFail = 0;
+ for (const path of targets) {
+ const expectBad = BAD.includes(path);
+ let res;
+ try {
+ res = await fetch(BASE + path, { redirect: 'manual', headers: { 'user-agent': 'three-ws-route-verifier' } });
+ } catch (e) {
+ console.log(` ✗ ${path} — request failed: ${e.message}`);
+ liveFail++;
+ continue;
+ }
+ const st = res.status;
+ const okBad = expectBad ? st === 404 : st >= 200 && st < 400;
+ if (!okBad) {
+ console.log(` ✗ ${path} — HTTP ${st}${expectBad ? ' (expected 404)' : ''}`);
+ liveFail++;
+ } else if (process.env.VERBOSE) {
+ console.log(` ✓ ${path} — HTTP ${st}`);
+ }
+ }
+ console.log(`\nLive check against ${BASE}: ${targets.size - liveFail}/${targets.size} OK.`);
+ return liveFail;
+}
+
+// ───────────────────────── report ─────────────────────────
+console.log(`Route verify — ${catalog.length} catalog pages, ${mainRoutes.length} main routes, ${postRoutes.length} post-filesystem routes.`);
+console.log(` modeled dist files: ${served.size} · canonical-covered: ${covered} · literal page routes checked for shadows: ${litChecked}`);
+console.log(` filesystem boundary (handle:filesystem) present: ${fsIdx !== -1 ? 'yes' : 'NO'}`);
+
+if (warnings.length) {
+ console.log(`\nℹ ${warnings.length} advisory note(s):`);
+ for (const w of warnings.slice(0, 50)) console.log(' ' + w);
+ if (warnings.length > 50) console.log(` …and ${warnings.length - 50} more`);
+}
+
+if (failures.length) {
+ console.log(`\n✗ ${failures.length} FAILURE(s):`);
+ for (const f of failures) console.log(' ' + f);
+} else {
+ console.log('\n✓ static checks pass: every catalog page reachable, unknown paths → designed 404, no shadowed page routes.');
+}
+
+let exitCode = failures.length && strict ? 1 : 0;
+if (BASE) {
+ const liveFail = await live();
+ if (liveFail && strict) exitCode = 1;
+}
+process.exit(exitCode);
diff --git a/tests/api/forge-nim.test.js b/tests/api/forge-nim.test.js
index 11478f594..bd978518b 100644
--- a/tests/api/forge-nim.test.js
+++ b/tests/api/forge-nim.test.js
@@ -156,7 +156,7 @@ describe('POST /api/forge-nim — image mode', () => {
const sent = JSON.parse(init.body);
expect(sent.mode).toBe('image');
expect(sent.output_format).toBe('glb');
- expect(sent.ss_sampling_steps).toBe(40); // high tier
+ expect(sent.ss_sampling_steps).toBe(50); // high tier (fidelity-tuned)
expect(sent.image).toMatch(/^data:image\/png;base64,/);
});
diff --git a/vercel.json b/vercel.json
index 4e3510021..ae6753032 100644
--- a/vercel.json
+++ b/vercel.json
@@ -2724,7 +2724,7 @@
"dest": "/profile.html"
},
{
- "src": "/feed",
+ "src": "/feed/?",
"dest": "/feed.html"
},
{
@@ -2810,7 +2810,7 @@
"dest": "/api/x402/pay-by-name.js"
},
{
- "src": "/threews/claim",
+ "src": "/threews/claim/?",
"dest": "/threews-claim.html"
},
{
@@ -2846,7 +2846,7 @@
"dest": "/a-edit.html"
},
{
- "src": "/agent/new",
+ "src": "/agent/new/?",
"dest": "/agent-edit.html"
},
{
@@ -3031,7 +3031,7 @@
"dest": "/docs/walk-embed-api.html"
},
{
- "src": "/docs/([^./]+)",
+ "src": "/docs/([^./]+)/?",
"dest": "/docs/index.html"
},
{
@@ -4188,6 +4188,14 @@
{
"src": "/(.*)",
"dest": "/$1"
+ },
+ {
+ "handle": "filesystem"
+ },
+ {
+ "src": "/(.*)",
+ "status": 404,
+ "dest": "/404.html"
}
],
"crons": [
diff --git a/vite.config.js b/vite.config.js
index 5f94531f1..d7dd806dc 100644
--- a/vite.config.js
+++ b/vite.config.js
@@ -443,6 +443,8 @@ const appConfig = {
play: resolve(__dirname, 'pages/play.html'),
'play-agent-wallet': resolve(__dirname, 'pages/play/agent-wallet.html'),
'play-arena': resolve(__dirname, 'pages/play/arena.html'),
+ 'play-ufo': resolve(__dirname, 'pages/play/ufo.html'),
+ agi: resolve(__dirname, 'pages/agi.html'),
arena: resolve(__dirname, 'pages/arena.html'),
'smart-money': resolve(__dirname, 'pages/smart-money.html'),
pose: resolve(__dirname, 'pages/pose.html'),