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.

chore(x-content): mark assistant and free-objects as posted by the owner from the X app

qhqf867649ada7bd
diff --git a/CHANGELOG.md b/CHANGELOG.md
index dd774163f..be9e4ee1b 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -6,9 +6,12 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr
## 2026-09-21
+- **Forge now asks what your model is for**: Under a finished model in Forge there is a new one-tap row: Game, Web, Avatar, Simulation, Print, AR, or Just playing. It is optional, it is remembered in your browser so you are only asked once, and it rides along on your later generations. We are using it to see which kinds of work Forge does well and which it does not, by use, instead of one blended number for everyone. Developers calling the Forge API can send the same thing as a destination field. (`/forge`) `[improvement]`
- **Paying at the Club door no longer fails when our own traffic has been busy**: Some visitors paying the Club cover approved the payment in their wallet and then saw it fail at the last step with an internal error. The cause was on our side. We cover the small Solana network fee on your payment, and a safety limit that spreads our own automated payments across the day was also being applied to customers, so once our background traffic had used the morning's share, a real payment was turned away. Customers are now exempt from that limit: if you are paying, the payment goes through, and our own traffic waits instead. Nothing was charged on a failed attempt. Separately, when a wallet refuses to open its approval window, the payment window now says plainly that nothing was signed or charged and what to try next, instead of repeating the wallet's own wording. (`/club`) `[fix]`
- **Phantom users no longer have to switch off transaction protection to pay**: Phantom adds a small safety check to every transaction before you sign it, and it does this by default. Our payment rail treated that check as tampering and refused the payment, and the payment window told you to turn the protection off in your wallet settings. That was the wrong answer: the check moves no money and is there to protect you. Payments that carry it now go through, at the Club door and everywhere else you pay with a Solana wallet. We still refuse a payment if a wallet changes the amount, the recipient, or who covers the network fee. (`/club`) `[fix]`
- **Pick DEXTools as your chart on every coin chart**: The chart-source switcher now covers every coin chart on three.ws. The Oracle coin page and the Pump Dashboard market chart join the coin pages, launch pages, the trade deep-dive and Mission Control, so wherever a coin is charted you can switch between the three.ws chart, DexScreener, Birdeye, GMGN, DEXTools and GeckoTerminal. Your pick is remembered and follows you from one coin surface to the next. The Oracle page keeps its Line and Agent trades views, and the dashboard keeps its own candle chart; the terminals simply line up beside them. (`/docs/coin-pages`) `[feature, improvement]`
+- **The club alley no longer renders a giant avatar across the sky**: Walking into /club, some visitors saw a huge metallic shape filling the sky above the alley, and their computer ran hot. It was a crowd member: one avatar model built at centimetre scale was measured wrong before it was sized, so it spawned about 400 times too big, roughly 700 metres tall, and the GPU spent the whole walk-in painting it. Crowd members, your own avatar in the agent switcher, the theater stage and the Agora now size every avatar from its real posed mesh, so that model stands at normal human height like everyone else. (`/club`) `[fix]`
+- **The club no longer runs your computer hot on the way in**: While you walked the alley and stood at the door, the club was secretly drawing the whole dance floor behind it at full quality, so your graphics card was rendering two complete 3D scenes at once. The hidden stage now pauses its drawing until the alley fades away, roughly halving the graphics work for the entire walk-in. For a cooler machine inside the club too, turn on Power saver in the club controls. (`/club`) `[fix, improvement]`
- **Three SDKs now report the version you actually installed**: The walk, tour and assistant SDKs each export a VERSION constant, and a release earlier this month bumped all three packages without updating it. Code that read the constant got the previous release's number: 0.3.0 from walk 0.3.1, 0.5.1 from tour 0.5.2, 1.0.0 from assistant 1.0.1. The constants now match the packages, and the tour builder's copy-paste embed snippet points at tour 0.5.2. Only the tour SDK had a test comparing the two, which is how this was found; the other two were caught by checking every package from that release for the same mistake. Copies already installed from npm keep the old number until the next release of each package. (`/tour-builder`) `[sdk, fix]`
## 2026-09-20
diff --git a/STRUCTURE.md b/STRUCTURE.md
index be0cd5f87..5756f7c3b 100644
--- a/STRUCTURE.md
+++ b/STRUCTURE.md
@@ -184,6 +184,7 @@ bottom.
| Realism quality bench | Benchmark [data/quality-bench/prompts.json](data/quality-bench/prompts.json) (23 fixed prompts + 3 CC0 reference photos), runner [scripts/quality-bench.mjs](scripts/quality-bench.mjs), shared generate/render/judge core [api/_lib/quality-bench.js](api/_lib/quality-bench.js), dashboard [api/quality-bench.js](api/quality-bench.js) + [pages/quality-bench.html](pages/quality-bench.html) `→ /quality-bench` (internal, not in `data/pages.json`), weekly smoke cron [api/cron/quality-bench.js](api/cron/quality-bench.js) (`23 3 * * 1`) | Live | The measurement loop the realism campaign hangs on: fires the fixed prompt set through the real `/api/forge` path, renders 3 canonical views per result with the same headless three.js renderer as the avatar clip/OG-card renders ([api/_lib/render-clip.js](api/_lib/render-clip.js)), and scores every view with Vertex Gemini vision (`gemini-2.5-pro`, temperature 0, scored twice and averaged, judge never sees forge's internal prompt-enhancement text). Runs are committed append-only JSON under `data/quality-bench/runs/`; the dashboard renders score trends by lane/tier/subject-class, a worst-5 critique gallery, and the full results table. `node scripts/quality-bench.mjs --compare=latest,previous` exits nonzero on a >1.0 mean drop — run it before/after any forge change that could affect quality. Docs: [data/quality-bench/README.md](data/quality-bench/README.md). |
| Likeness bench (Phase 1 verification metric) | Scoring core [api/_lib/likeness-score.js](api/_lib/likeness-score.js), face-embedding runtime [api/_lib/face-embed.js](api/_lib/face-embed.js), store + distribution queries [api/_lib/likeness-store.js](api/_lib/likeness-store.js) ([schema](api/_lib/migrations/20260814000000_avatar_likeness_scores.sql)), weekly sweep [api/cron/likeness-eval.js](api/cron/likeness-eval.js) (`47 3 * * 1`), by-hand runner [scripts/likeness-eval.mjs](scripts/likeness-eval.mjs), internal board [api/likeness-bench.js](api/likeness-bench.js) + [pages/likeness-bench.html](pages/likeness-bench.html) `→ /likeness-bench` (admin or `x-ops-secret`, not in `data/pages.json`) | Live · applied 2026-08-14 (this file alone, via `apply-migrations.mjs --apply --file`, because `db:migrate` would have applied seven other agents' pending migrations with it). The header comment still reads "Draft, NOT applied" and must stay that way: an applied migration is an immutable record and editing its bytes trips the drift guard | The number the roadmap gates Phase 1 on, measured instead of asserted. The realism bench scores whether a generation looks real and never asks whose face it is; the reconstruction worker's ISE eval scores face *shape* offline against a synthetic set and stores nothing. This closes the gap: it renders a finished reconstruction head-framed at three yaws (head-on 0°, three-quarter 35°, profile 65°) with the platform's own `headshot` preset, embeds every render and every input capture with OSS face recognition (YuNet detection, MIT + SFace 128-d identity, Apache-2.0, both hash-pinned from OpenCV Zoo and run on `onnxruntime-web`'s WASM backend so there is no native install step), and files a 1-5 score against the generation record in `forge_creations`. The 1-5 mapping is anchored on SFace's own published decision boundary (cosine 0.363 = 3.0, so the roadmap's 4/5 gate is cosine 0.68, roughly twice the same-identity threshold) rather than on taste. **Refuses rather than fabricates:** `captures_unusable`, `render_unusable` and a genuinely low score are three separate statuses, and a budget-truncated sweep is withheld from the distribution. Reports `turn_falloff` (identity lost between head-on and the worst view), which is the only place a frontally-flattering texture transfer is visible. **Stores no biometrics:** no capture URLs, no crops, no embeddings, only the measurement. Docs: [docs/likeness-eval.md](docs/likeness-eval.md). Tests: [tests/likeness-score.test.js](tests/likeness-score.test.js) |
| Payment-outcome board (x402 failure visibility) | Endpoint [api/ops/payment-outcomes.js](api/ops/payment-outcomes.js), page [pages/payment-outcomes.html](pages/payment-outcomes.html) `-> /payment-outcomes` (admin session or `x-ops-secret`, `noindex`, not in `data/pages.json`), sensors [api/_lib/ops/x402-settle-health.js](api/_lib/ops/x402-settle-health.js) + [api/_lib/x402/wallet-balance-monitor.js](api/_lib/x402/wallet-balance-monitor.js) + [api/_lib/x402/sponsor-runway.js](api/_lib/x402/sponsor-runway.js) + [api/_lib/custodial-key-health.js](api/_lib/custodial-key-health.js) | Live | Every way an x402 payment can fail, in one read, before it halts the economy. The 2026-07-11 audit found the griefing classes (verify-reject floods, settle failures, sponsor-fee starvation) were only visible after the economy stopped: `recordPaymentMetric` was already emitting the events and nothing surfaced them. Four panels: inbound rates over 1h/3h/24h from the durable `x402_audit_log` (settle success, verify reject, replay reject with its own `inbound_attempts` denominator, top failure reasons by stage, replay stage split), the outbound ring settle sensor with its triage hint, every configured ring wallet against **its own** floor plus the measured sponsor runway, and stranded custody. The wallet panel is per-wallet on purpose: settle-floor starvation and dry wallets look identical from outside and have opposite fixes, and a board showing only the sponsor renders a starved payer as healthy. Panels are read independently and a failed one names itself in `degraded` (207 Multi-Status) rather than blanking the board; on the page a rate with no attempts renders `n/a` and an unmeasured custody total renders `not measured`, because a green zero on a reading that never happened is worse than no board. Docs: [docs/ops/payment-outcomes.md](docs/ops/payment-outcomes.md). |
+| Forge funnel board (does anyone keep what Forge makes) | Report [api/_lib/forge-funnel.js](api/_lib/forge-funnel.js), endpoint [api/ops/forge-funnel.js](api/ops/forge-funnel.js), page [pages/forge-funnel.html](pages/forge-funnel.html) `-> /forge-funnel` (admin session or `x-ops-secret`, `noindex`, not in `data/pages.json`), CLI [scripts/forge-funnel-report.mjs](scripts/forge-funnel-report.mjs) (`npm run forge:funnel`), destination list [src/shared/forge-destinations.js](src/shared/forge-destinations.js) + composer chips [src/shared/forge-destination-picker.js](src/shared/forge-destination-picker.js), columns from migration `20260921120000_forge_destination.sql` | Built, needs migration applied and a deploy | The generation health sensor says whether a mesh came back. This says whether anyone kept it: useful-output rate (accepted or downloaded over finished), first and second asset rates for new makers, D7/D30 return, acceptance by what the model was for, attempts and generation seconds per kept model by engine, and x402 revenue per kept model. Forge recorded the verdict columns from its first migration and nothing read them until this board. The destination is asked once in a chip row under a finished model on `/forge` and `/forge-studio`, remembered per browser and sent on later requests; API callers send `destination`. Platform-generated rows (seeder, quality benchmark) are flagged `internal` and excluded. Docs: [docs/ops/forge-funnel.md](docs/ops/forge-funnel.md). Tests: [tests/forge-funnel.test.js](tests/forge-funnel.test.js) |
| Sketchfab showcase (community models → official account) | Cron [api/cron/sketchfab-showcase.js](api/cron/sketchfab-showcase.js), lib [api/_lib/sketchfab.js](api/_lib/sketchfab.js), ledger migration [api/_lib/migrations/20260714130000_sketchfab_uploads.sql](api/_lib/migrations/20260714130000_sketchfab_uploads.sql) | Live · dormant until `SKETCHFAB_API_TOKEN` is set | Publishes the best community forge models to the official three.ws Sketchfab account, prompt and backlink included. Selection order: forge-board winners (now populated by the [Forge-Off](docs/forge-off.md) crown cron), then top-voted (>=1 vote), then creator-accepted (accepted or downloaded, refinement children excluded, title-quality heuristic). Brand safety is two layers: a SQL denylist plus NemoGuard re-moderation; blocked rows park as `blocked` in the `sketchfab_uploads` ledger (states `pending`/`uploaded`/`live`/`failed`/`blocked`). `?dry_run=1` exercises selection before the token is wired; `SKETCHFAB_UPLOADS_PER_RUN` clamps 1-5 (default 2). Docs: [docs/sketchfab.md](docs/sketchfab.md) |
| Third-party display-name safety | [api/_lib/display-name-safety.js](api/_lib/display-name-safety.js), applied at ERC-8004 metadata hydration in [api/cron/[name].js](api/cron/%5Bname%5D.js) | Live | The ERC-8004 crawler indexes 126k+ on-chain agents and renders each one's `name`/`description`/`image` from attacker-controlled metadata. Visibility used to be decided solely by the agent's own `meta.active`, so a Base-registered agent whose name was a racial slur shipped to `/marketplace`. `matchedSlurStem()` now withholds such rows (`active = false`), which removes them from every feed at once since explore/marketplace/agents/search all filter `active = true`. Deliberately narrow — **whole-word** hate slurs only, never general profanity, and hex-address aware: leet folding turns `0xdb6b887289c380…` into letter soup, so long alphanumeric runs are excluded from the spaced-out-evasion pass. A false positive silently delists a legitimate agent, so precision outranks recall. Backfill for already-indexed rows: [scripts/deactivate-slur-agents.mjs](scripts/deactivate-slur-agents.mjs) (`--dry-run`). Tests: [tests/display-name-safety.test.js](tests/display-name-safety.test.js) — pins the real agent names an earlier substring matcher wrongly flagged. |
| FBX → GLB conversion | [scripts/fbx-to-glb.mjs](scripts/fbx-to-glb.mjs) | In-repo | Skinned/animated FBX → GLB (FBX2glTF), `npm run convert:fbx` |
diff --git a/api/_lib/forge-funnel.js b/api/_lib/forge-funnel.js
new file mode 100644
index 000000000..51f325498
--- /dev/null
+++ b/api/_lib/forge-funnel.js
@@ -0,0 +1,437 @@
+// @ts-check
+// Forge funnel report: does a generation turn into an asset someone keeps?
+//
+// The forge health sensor (ops/forge-health-sensor.js) answers "did the mesh
+// come back?". That is a pipeline question. This module answers the product
+// question that sits after it: of the meshes that came back, how many did a
+// person accept or download, do makers come back for a second one, which lane
+// earns its attempts, and what is each generation for. forge_creations has
+// carried the verdict columns (outcome, rating, downloaded) since its first
+// migration; nothing read them until now.
+//
+// Definitions, stated once so the endpoint, the CLI and the page quote one
+// number computed one way:
+//
+// useful A finished row the maker accepted OR downloaded. Either is a
+// deliberate act on the result; a rating alone is not.
+// actor coalesce(user_id, client_key). Rows written with no client key
+// hash to the literal key 'anon', which pools every keyless API
+// caller into one pseudo-actor, so per-actor metrics leave those
+// rows out and the report says how many it left out.
+// new actor An actor whose first-ever creation falls inside the window.
+// internal Platform-generated rows (catalog seeder, quality benchmark).
+// Excluded everywhere: by the `internal` flag going forward and by
+// forge_seed_jobs.creation_id for seeder rows that predate it.
+// superseded An attempt that failed over to another lane. The successor row
+// carries the request to its real outcome, so request-level metrics
+// skip the superseded attempt. The per-lane table keeps it, because
+// an attempt a lane lost is exactly what that table measures.
+//
+// Read-only. Every query is a SELECT.
+
+import { sql } from './db.js';
+import { backendCostClass } from './forge-tiers.js';
+import { FORGE_DESTINATIONS } from '../../src/shared/forge-destinations.js';
+
+export const FUNNEL_MIN_DAYS = 1;
+export const FUNNEL_MAX_DAYS = 365;
+export const FUNNEL_DEFAULT_DAYS = 30;
+
+// A rate over fewer finished rows than this is reported, but flagged, so nobody
+// reads "100% useful" off three generations.
+export const MIN_SAMPLE = 20;
+
+// Retention cohorts look back this far for first-time actors. Long enough to
+// hold a judgeable cohort at Forge's volume, short enough to describe the
+// current product rather than last spring's.
+const COHORT_LOOKBACK_DAYS = 90;
+
+/** Clamp a caller-supplied window to a whole number of days in range. */
+export function clampFunnelDays(value) {
+ // Number(null) and Number('') are both 0, which would clamp an absent
+ // parameter to a one-day window instead of the default.
+ if (value == null || value === '') return FUNNEL_DEFAULT_DAYS;
+ const n = Math.floor(Number(value));
+ if (!Number.isFinite(n)) return FUNNEL_DEFAULT_DAYS;
+ return Math.min(FUNNEL_MAX_DAYS, Math.max(FUNNEL_MIN_DAYS, n));
+}
+
+/** n/d as a 0..1 number rounded to 4 places, or null when the base is empty. */
+export function rate(n, d) {
+ const num = Number(n) || 0;
+ const den = Number(d) || 0;
+ if (den <= 0) return null;
+ return Math.round((num / den) * 10_000) / 10_000;
+}
+
+function int(v) {
+ const n = Number(v);
+ return Number.isFinite(n) ? Math.trunc(n) : 0;
+}
+
+/** A rate plus the counts behind it and whether the base is big enough to trust. */
+function measured(n, d) {
+ return { value: rate(n, d), n: int(n), of: int(d), low_sample: int(d) < MIN_SAMPLE };
+}
+
+// ── Pure summarizers ────────────────────────────────────────────────────────
+// Each takes the exact row shape its query returns, so thresholds and edge
+// cases (empty window, zero useful rows, unknown destination ids) are testable
+// without a database.
+
+/**
+ * @param {Record<string, unknown>|undefined} r
+ */
+export function summarizeOutput(r = {}) {
+ const done = int(r.done);
+ const failed = int(r.failed);
+ const useful = int(r.useful);
+ const signalled = int(r.signalled);
+ return {
+ requests: int(r.requests),
+ in_flight: int(r.in_flight),
+ done,
+ failed,
+ generation_success_rate: measured(done, done + failed),
+ useful_output_rate: measured(useful, done),
+ accepted: int(r.accepted),
+ rejected: int(r.rejected),
+ downloaded: int(r.downloaded),
+ rated: int(r.rated),
+ avg_rating: r.avg_rating == null ? null : Math.round(Number(r.avg_rating) * 100) / 100,
+ // How much of the finished output carries ANY human signal. This bounds
+ // every other number here: a useful-output rate over rows nobody judged
+ // undercounts, and a router cannot learn from rows with no label.
+ feedback_coverage: measured(signalled, done),
+ unattributed_requests: int(r.unattributed),
+ };
+}
+
+/**
+ * @param {Record<string, unknown>|undefined} r
+ */
+export function summarizeNewActors(r = {}) {
+ const actors = int(r.new_actors);
+ const withAsset = int(r.with_asset);
+ return {
+ new_actors: actors,
+ // Of people who tried Forge for the first time in the window, how many
+ // reached an asset they accepted or downloaded.
+ first_asset_success_rate: measured(r.with_useful, actors),
+ reached_any_asset_rate: measured(withAsset, actors),
+ // Of those who got one finished asset, how many made a second. The
+ // closest thing here to "did it work well enough to use again".
+ second_asset_rate: measured(r.with_second_asset, withAsset),
+ };
+}
+
+/**
+ * @param {Record<string, unknown>|undefined} r
+ */
+export function summarizeRetention(r = {}) {
+ return {
+ cohort_lookback_days: COHORT_LOOKBACK_DAYS,
+ d7: measured(r.d7_retained, r.d7_cohort),
+ d30: measured(r.d30_retained, r.d30_cohort),
+ };
+}
+
+/**
+ * One row per destination, in the composer's order, then any id this build does
+ * not know, then the unanswered bucket last. A known destination with no rows
+ * still appears, so the table reads as "nobody chose Print", not as a gap.
+ * @param {Array<Record<string, unknown>>} rows
+ */
+export function summarizeDestinations(rows = []) {
+ const byId = new Map(rows.map((r) => [r.destination == null ? null : String(r.destination), r]));
+ const shape = (id, label, r = {}) => ({
+ destination: id,
+ label,
+ done: int(r.done),
+ useful: int(r.useful),
+ downloaded: int(r.downloaded),
+ useful_output_rate: measured(r.useful, r.done),
+ });
+ const out = FORGE_DESTINATIONS.map((d) => shape(d.id, d.label, byId.get(d.id)));
+ const known = new Set(FORGE_DESTINATIONS.map((d) => d.id));
+ for (const [id, r] of byId) {
+ if (id !== null && !known.has(id)) out.push(shape(id, id, r));
+ }
+ out.push(shape(null, 'Not answered', byId.get(null)));
+ const answered = out.filter((d) => d.destination !== null).reduce((s, d) => s + d.done, 0);
+ const total = out.reduce((s, d) => s + d.done, 0);
+ return { rows: out, answer_rate: measured(answered, total) };
+}
+
+/**
+ * Per-lane table. `attempts_per_useful` is the honest cost driver: how many
+ * terminal attempts a lane spends for each asset someone keeps. Generation
+ * seconds are summed only over rows that carry completed_at.
+ * @param {Array<Record<string, unknown>>} rows
+ */
+export function summarizeLanes(rows = []) {
+ return rows
+ .map((r) => {
+ const backend = r.backend == null ? 'unknown' : String(r.backend);
+ const attempts = int(r.done) + int(r.failed);
+ const useful = int(r.useful);
+ const timed = int(r.timed);
+ const seconds = Number(r.gen_seconds) || 0;
+ return {
+ backend,
+ cost_class: backendCostClass(backend),
+ attempts,
+ done: int(r.done),
+ failed: int(r.failed),
+ useful,
+ generation_success_rate: measured(r.done, attempts),
+ useful_output_rate: measured(useful, r.done),
+ attempts_per_useful: useful > 0 ? Math.round((attempts / useful) * 100) / 100 : null,
+ avg_generation_seconds: timed > 0 ? Math.round(seconds / timed) : null,
+ generation_seconds_per_useful: useful > 0 && timed > 0 ? Math.round(seconds / useful) : null,
+ timed_attempts: timed,
+ };
+ })
+ .sort((a, b) => b.attempts - a.attempts);
+}
+
+/**
+ * x402 is the only payment rail whose price is recorded on the row, so this is
+ * x402 revenue specifically, never "total revenue".
+ * @param {Record<string, unknown>|undefined} r
+ * @param {{ useful: number }} ctx
+ */
+export function summarizeRevenue(r = {}, { useful = 0 } = {}) {
+ const atomic = Number(r.atomic) || 0;
+ const usdc = Math.round(atomic / 10_000) / 100;
+ return {
+ rail: 'x402',
+ paid_generations: int(r.paid),
+ distinct_payers: int(r.payers),
+ usdc,
+ usdc_per_useful_asset: useful > 0 ? Math.round((atomic / 1_000_000 / useful) * 10_000) / 10_000 : null,
+ // Distinct paying agents last week who paid again this week.
+ agent_weekly_retention: measured(r.retained_payers, r.prior_week_payers),
+ };
+}
+
+// ── Queries ─────────────────────────────────────────────────────────────────
+
+/**
+ * Build the whole report. The panels are read independently: one failing query
+ * names itself in `degraded` and leaves the others standing, matching the other
+ * ops boards.
+ * @param {{ days?: number }} [opts]
+ */
+export async function gatherForgeFunnel({ days = FUNNEL_DEFAULT_DAYS } = {}) {
+ const windowDays = clampFunnelDays(days);
+ const degraded = [];
+ const panel = async (name, fn, fallback) => {
+ try {
+ return await fn();
+ } catch (err) {
+ degraded.push({ panel: name, error: String(err?.message || err).slice(0, 200) });
+ return fallback;
+ }
+ };
+
+ const outputPending = panel(
+ 'output',
+ async () => {
+ const [r] = await sql`
+ select
+ count(*)::int as requests,
+ count(*) filter (where fc.status = 'generating')::int as in_flight,
+ count(*) filter (where fc.status = 'done')::int as done,
+ count(*) filter (where fc.status = 'failed')::int as failed,
+ count(*) filter (where fc.status = 'done'
+ and (fc.outcome = 'accepted' or fc.downloaded))::int as useful,
+ count(*) filter (where fc.status = 'done' and fc.outcome = 'accepted')::int as accepted,
+ count(*) filter (where fc.status = 'done' and fc.outcome = 'rejected')::int as rejected,
+ count(*) filter (where fc.status = 'done' and fc.downloaded)::int as downloaded,
+ count(*) filter (where fc.status = 'done' and fc.rating is not null)::int as rated,
+ avg(fc.rating) filter (where fc.status = 'done') as avg_rating,
+ count(*) filter (where fc.status = 'done' and (fc.outcome in ('accepted', 'rejected')
+ or fc.downloaded or fc.rating is not null))::int as signalled,
+ count(*) filter (where fc.user_id is null and fc.client_key = 'anon')::int as unattributed
+ from forge_creations fc
+ where fc.created_at > now() - make_interval(days => ${windowDays})
+ and fc.internal = false
+ and fc.superseded_by is null
+ and not exists (select 1 from forge_seed_jobs sj where sj.creation_id = fc.id)
+ `;
+ return summarizeOutput(r);
+ },
+ summarizeOutput(),
+ );
+
+ const newActorsPending = panel(
+ 'new_actors',
+ async () => {
+ const [r] = await sql`
+ with mine as (
+ select coalesce(fc.user_id::text, fc.client_key) as actor,
+ fc.created_at, fc.status,
+ (fc.status = 'done' and (fc.outcome = 'accepted' or fc.downloaded)) as useful
+ from forge_creations fc
+ where fc.internal = false
+ and fc.superseded_by is null
+ and (fc.user_id is not null or fc.client_key <> 'anon')
+ and not exists (select 1 from forge_seed_jobs sj where sj.creation_id = fc.id)
+ ), per_actor as (
+ select actor,
+ min(created_at) as first_at,
+ count(*) filter (where status = 'done') as assets,
+ bool_or(useful) as any_useful
+ from mine
+ group by actor
+ )
+ select
+ count(*)::int as new_actors,
+ count(*) filter (where assets >= 1)::int as with_asset,
+ count(*) filter (where assets >= 2)::int as with_second_asset,
+ count(*) filter (where any_useful)::int as with_useful
+ from per_actor
+ where first_at > now() - make_interval(days => ${windowDays})
+ `;
+ return summarizeNewActors(r);
+ },
+ summarizeNewActors(),
+ );
+
+ const retentionPending = panel(
+ 'retention',
+ async () => {
+ const [r] = await sql`
+ with mine as (
+ select coalesce(fc.user_id::text, fc.client_key) as actor, fc.created_at
+ from forge_creations fc
+ where fc.internal = false
+ and (fc.user_id is not null or fc.client_key <> 'anon')
+ and not exists (select 1 from forge_seed_jobs sj where sj.creation_id = fc.id)
+ ), per_actor as (
+ select actor, min(created_at) as first_at, max(created_at) as last_at
+ from mine
+ group by actor
+ )
+ select
+ count(*) filter (where first_at <= now() - interval '7 days')::int as d7_cohort,
+ count(*) filter (where first_at <= now() - interval '7 days'
+ and last_at >= first_at + interval '7 days')::int as d7_retained,
+ count(*) filter (where first_at <= now() - interval '30 days')::int as d30_cohort,
+ count(*) filter (where first_at <= now() - interval '30 days'
+ and last_at >= first_at + interval '30 days')::int as d30_retained
+ from per_actor
+ where first_at > now() - make_interval(days => ${COHORT_LOOKBACK_DAYS})
+ `;
+ return summarizeRetention(r);
+ },
+ summarizeRetention(),
+ );
+
+ const destinationsPending = panel(
+ 'destinations',
+ async () => {
+ const rows = await sql`
+ select fc.destination,
+ count(*) filter (where fc.status = 'done')::int as done,
+ count(*) filter (where fc.status = 'done'
+ and (fc.outcome = 'accepted' or fc.downloaded))::int as useful,
+ count(*) filter (where fc.status = 'done' and fc.downloaded)::int as downloaded
+ from forge_creations fc
+ where fc.created_at > now() - make_interval(days => ${windowDays})
+ and fc.internal = false
+ and fc.superseded_by is null
+ and not exists (select 1 from forge_seed_jobs sj where sj.creation_id = fc.id)
+ group by fc.destination
+ `;
+ return summarizeDestinations(rows);
+ },
+ summarizeDestinations(),
+ );
+
+ const lanesPending = panel(
+ 'lanes',
+ async () => {
+ const rows = await sql`
+ select fc.backend,
+ count(*) filter (where fc.status = 'done')::int as done,
+ count(*) filter (where fc.status = 'failed')::int as failed,
+ count(*) filter (where fc.status = 'done'
+ and (fc.outcome = 'accepted' or fc.downloaded))::int as useful,
+ count(*) filter (where fc.completed_at is not null
+ and fc.status in ('done', 'failed'))::int as timed,
+ coalesce(sum(extract(epoch from (fc.completed_at - fc.created_at)))
+ filter (where fc.completed_at is not null
+ and fc.status in ('done', 'failed')), 0) as gen_seconds
+ from forge_creations fc
+ where fc.created_at > now() - make_interval(days => ${windowDays})
+ and fc.internal = false
+ and fc.status in ('done', 'failed')
+ and not exists (select 1 from forge_seed_jobs sj where sj.creation_id = fc.id)
+ group by fc.backend
+ `;
+ return summarizeLanes(rows);
+ },
+ [],
+ );
+
+ const revenueRawPending = panel(
+ 'revenue',
+ async () => {
+ const [r] = await sql`
+ with paid as (
+ select fc.x402_payer, fc.x402_price_atomic, fc.created_at
+ from forge_creations fc
+ where fc.x402_tx_sig is not null and fc.internal = false
+ ), this_week as (
+ select distinct x402_payer from paid
+ where created_at > now() - interval '7 days' and x402_payer is not null
+ ), prior_week as (
+ select distinct x402_payer from paid
+ where created_at <= now() - interval '7 days'
+ and created_at > now() - interval '14 days' and x402_payer is not null
+ )
+ select
+ (select count(*) from paid
+ where created_at > now() - make_interval(days => ${windowDays}))::int as paid,
+ (select count(distinct x402_payer) from paid
+ where created_at > now() - make_interval(days => ${windowDays}))::int as payers,
+ (select coalesce(sum(x402_price_atomic), 0) from paid
+ where created_at > now() - make_interval(days => ${windowDays})) as atomic,
+ (select count(*) from prior_week)::int as prior_week_payers,
+ (select count(*) from prior_week p
+ where exists (select 1 from this_week t
+ where t.x402_payer = p.x402_payer))::int as retained_payers
+ `;
+ return r;
+ },
+ undefined,
+ );
+
+ // Independent reads, so they run together. Revenue per useful asset needs the
+ // useful count from the output panel, so it is summarized once both are in.
+ const [output, newActors, retention, destinations, lanes, revenueRaw] = await Promise.all([
+ outputPending,
+ newActorsPending,
+ retentionPending,
+ destinationsPending,
+ lanesPending,
+ revenueRawPending,
+ ]);
+ const revenue = summarizeRevenue(revenueRaw, { useful: output.useful_output_rate.n });
+
+ return {
+ ok: degraded.length === 0,
+ degraded,
+ window_days: windowDays,
+ generated_at: new Date().toISOString(),
+ min_sample: MIN_SAMPLE,
+ output,
+ new_actors: newActors,
+ retention,
+ destinations,
+ lanes,
+ revenue,
+ };
+}
diff --git a/api/ops/forge-funnel.js b/api/ops/forge-funnel.js
new file mode 100644
index 000000000..d84c957ea
--- /dev/null
+++ b/api/ops/forge-funnel.js
@@ -0,0 +1,45 @@
+// GET /api/ops/forge-funnel?days=30: the Forge funnel report.
+//
+// The forge health sensor says whether meshes come back. This board says
+// whether anyone keeps them: useful-output rate, first-asset success and
+// second-asset rate for new makers, D7/D30 return, what each generation was for,
+// which lane earns its attempts, and x402 revenue per kept asset. Definitions
+// and the queries live in api/_lib/forge-funnel.js, shared with
+// `npm run forge:funnel`, so the board and the CLI can never disagree.
+//
+// days Rolling window in whole days, 1 to 365. Default 30. Retention always
+// uses its own fixed cohort lookback, stated in the response.
+//
+// A failed panel names itself in `degraded` and the response is 207, matching
+// /api/ops/health and /api/ops/payment-outcomes. `ok` reports whether the board
+// rendered, never whether the funnel is good.
+//
+// Auth: authorizeOps (admin session, or x-ops-secret / OPS_SECRET). Owner-only
+// on purpose: it carries per-lane performance and revenue.
+// Read-only: SELECTs and nothing else.
+
+import { cors, json, method, wrap, error, rateLimited } from '../_lib/http.js';
+import { limits, clientIp } from '../_lib/rate-limit.js';
+import { authorizeOps } from '../_lib/ops-auth.js';
+import { gatherForgeFunnel, clampFunnelDays } from '../_lib/forge-funnel.js';
+
+export const maxDuration = 30;
+
+export default wrap(async (req, res) => {
+ if (cors(req, res, { methods: 'GET,OPTIONS' })) return;
+ if (!method(req, res, ['GET'])) return;
+
+ // Same bucket as the other ops boards: a polled board must not drain the
+ // login budget of the IP that watches it.
+ const rl = await limits.authedReadIp(clientIp(req));
+ if (!rl.success) return rateLimited(res, rl);
+
+ const auth = await authorizeOps(req);
+ if (!auth.ok) return error(res, 401, 'unauthorized', 'ops secret or admin session required');
+
+ const url = new URL(req.url, 'http://localhost');
+ const days = clampFunnelDays(url.searchParams.get('days') ?? undefined);
+
+ const report = await gatherForgeFunnel({ days });
+ return json(res, report.ok ? 200 : 207, report, { 'cache-control': 'private, no-store' });
+});
diff --git a/data/changelog.json b/data/changelog.json
index 6d7c3f4c6..1c0384104 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-09-21",
+ "title": "Forge now asks what your model is for",
+ "summary": "Under a finished model in Forge there is a new one-tap row: Game, Web, Avatar, Simulation, Print, AR, or Just playing. It is optional, it is remembered in your browser so you are only asked once, and it rides along on your later generations. We are using it to see which kinds of work Forge does well and which it does not, by use, instead of one blended number for everyone. Developers calling the Forge API can send the same thing as a destination field.",
+ "tags": [
+ "improvement"
+ ],
+ "link": "/forge"
+ },
{
"date": "2026-09-21",
"title": "The club alley no longer renders a giant avatar across the sky",
diff --git a/data/x-content/queue.json b/data/x-content/queue.json
index 98d39996a..c2df0ce36 100644
--- a/data/x-content/queue.json
+++ b/data/x-content/queue.json
@@ -992,7 +992,7 @@
},
{
"id": "free-objects",
- "status": "approved",
+ "status": "posted",
"kind": "post",
"tier": 2,
"lane": "ar",
@@ -1572,7 +1572,7 @@
},
{
"id": "assistant",
- "status": "review",
+ "status": "posted",
"kind": "post",
"tier": 2,
"lane": "developer",
diff --git a/docs/forge-pipeline.md b/docs/forge-pipeline.md
index d7e846c43..95f1ed04d 100644
--- a/docs/forge-pipeline.md
+++ b/docs/forge-pipeline.md
@@ -166,6 +166,7 @@ Every non-terminal poll also carries honest timing: `elapsed_seconds` (the age o
- Routing outcome: `backend`, `tier`, `path`, `replicate_job_id` (poll correlation for any provider, despite the name), `model_category` (avatar, accessory, item, scene, creature, vehicle, other).
- Result: `glb_key`, `glb_url`, `size_bytes`, `status` (`generating`, `done`, `failed`), `error`.
- Feedback flywheel: `outcome` (`generated`, `accepted`, `rejected`), `rating`, `note`, `downloaded`, `feedback_at`. The outcome partial index feeds training-signal export.
+- Funnel instrumentation (migration `20260921120000_forge_destination.sql`): `destination` (what the maker is building for: `game`, `web`, `avatar`, `simulation`, `print`, `ar`, `play`; sent on the request or answered afterwards in the composer, null when never answered), `completed_at` (when the row reached `done` or `failed`; `updated_at` cannot stand in because later votes and feedback move it), and `internal` (true for rows the catalog seeder or the quality benchmark generated, so they stay out of conversion numbers). The handler states `destination` and `internal` once per request in a creation context that `createCreation` reads, so no insert branch can omit them, and both failover paths copy them to the successor row. Read by the [Forge funnel board](./ops/forge-funnel.md).
- Lineage and remix (migration `20260625000000_forge_refine_lineage.sql`): `parent_creation_id`, `refine_instruction`, `lineage_index`, `remixable`, `remix_royalty_bps` (0 to 2000, default 1000), `creator_wallet_solana`, `remix_settlement_ref`.
- Forge-Off (migration `20260625120000_forge_board.sql`): `vote_count`, plus the `forge_votes` and `forge_board_winners` tables.
- Failover and cleanup: `superseded_by` (migration `20260814200000_forge_failover_supersede.sql`, the successor row's id when this attempt was re-dispatched; a plain uuid, not a foreign key, so retention pruning stays free) and `source_image_keys` (migration `20260813160000_forge_source_image_keys.sql`, the storage key of every uploaded reference photo, so a delete can erase them).
@@ -267,6 +268,8 @@ The env vars that shape a deployment (production values live on the Cloud Run se
Fast diagnostics: `forge_creations` carries per-generation backend, status, error, and prompt, so it is the quickest ground truth for generation issues. `GET /api/forge?health=1` shows the live lane picture.
+Whether the output is any good to the people asking for it is a separate question with its own report: `npm run forge:funnel` (or the owner board at `/forge-funnel`) gives useful-output rate, repeat use, per-destination acceptance and attempts per kept model by engine. See [ops/forge-funnel.md](./ops/forge-funnel.md).
+
## 11. Extending the pipeline
**Adding a generation lane:**
diff --git a/docs/forge.md b/docs/forge.md
index c620507a6..93c2e90e8 100644
--- a/docs/forge.md
+++ b/docs/forge.md
@@ -93,6 +93,23 @@ empty list, which is indistinguishable from "not there yet" on purpose. Crumbs
expire after five minutes, and they only ever hold what the response itself
carries moments later, so a trace id grants no access to anything.
+### Saying what a model is for
+
+Under a finished model, a "Making this for" row offers Game, Web, Avatar,
+Simulation, Print, AR and Just playing. It is optional and one tap. The answer is
+remembered in your browser and attached to your later generations, so you are
+asked once, not every time. It tells us which kinds of work Forge serves well and
+which it does not, broken out by use instead of one blended number.
+
+API callers can send the same thing as `destination`. An unrecognised value is
+ignored, never an error:
+
+```bash
+curl -sS -X POST https://three.ws/api/forge \
+ -H 'content-type: application/json' \
+ -d '{"prompt":"a low-poly wooden barrel","destination":"game"}'
+```
+
### Comparing two engines on one prompt
The engine grid is only useful if you can see what choosing an engine actually
diff --git a/docs/ops/README.md b/docs/ops/README.md
index 554497b85..276fd0952 100644
--- a/docs/ops/README.md
+++ b/docs/ops/README.md
@@ -15,6 +15,7 @@ Start with [gcp-production.md](gcp-production.md); it is the complete operationa
| [gcp-logs.md](gcp-logs.md) | Production log reading and automated triage tools for the Cloud Run fleet. |
| [production-log-triage.md](production-log-triage.md) | Known error/warning signature map: what each recurring log signature means and the fix. |
| [forge-error-triage.md](forge-error-triage.md) | `npm run forge:errors`: which 3D generation failures actually recur, ranked by class and lane over a real window. |
+| [forge-funnel.md](forge-funnel.md) | The Forge funnel board (`GET /api/ops/forge-funnel`, `npm run forge:funnel`): useful-output rate, first and second asset rates, retention, what each model was for, attempts per kept model by engine, and x402 revenue per kept model. |
| [cron-auth.md](cron-auth.md) | The two locks on `/api/cron/*`: the handler gate, the edge gate, and the header trap that makes attaching Cloud Scheduler OIDC take the whole fleet down if done naively. |
| [materialize-fulfillment.md](materialize-fulfillment.md) | Running physical print fulfillment: the operator console, its authorization doors, the adapter contract for wiring a partner, webhook idempotency, and the stall sweep. |
| [payment-outcomes.md](payment-outcomes.md) | The payment-outcome board (`GET /api/ops/payment-outcomes`): verify-reject, settle-fail, replay, and sponsor-runway signals and how to read them in an incident. |
diff --git a/docs/ops/forge-funnel.md b/docs/ops/forge-funnel.md
new file mode 100644
index 000000000..0a6a2d83f
--- /dev/null
+++ b/docs/ops/forge-funnel.md
@@ -0,0 +1,152 @@
+# Forge funnel board
+
+`GET /api/ops/forge-funnel` answers the question the generation health sensor
+cannot: of the models Forge finishes, how many does anyone keep? The sensor
+(`api/_lib/ops/forge-health-sensor.js`, surfaced on `/api/healthz`) reports
+whether a mesh came back. That is a pipeline fact. This board is the product
+fact after it: accepted or downloaded output, whether new makers come back for a
+second model, what each model was for, which engine earns its attempts, and what
+paying agents spend per kept model.
+
+Forge has recorded the verdict on every generation (`outcome`, `rating`,
+`downloaded`) since its first migration. Until this board nothing read those
+columns, so the acceptance data was collected and never looked at.
+
+Three ways to read it, all backed by `api/_lib/forge-funnel.js` so the
+definitions cannot drift:
+
+- **[/forge-funnel](../../pages/forge-funnel.html)**, the internal page.
+- `GET /api/ops/forge-funnel?days=30`, the JSON behind it.
+- `npm run forge:funnel`, the same report in a terminal with no server running.
+
+```bash
+npm run forge:funnel # last 30 days
+npm run forge:funnel -- --days 7
+npm run forge:funnel -- --json
+
+curl -s -H "x-ops-secret: $OPS_SECRET" "https://three.ws/api/ops/forge-funnel?days=30" | jq '.output.useful_output_rate'
+```
+
+The CLI reads `DATABASE_URL` from `.env.local`, then `.env`, then the shell, the
+same order as `npm run forge:errors`. It runs SELECTs and nothing else.
+
+## Auth
+
+Same gate as `/api/ops/health` and the [payment-outcome board](payment-outcomes.md):
+an admin session, or `x-ops-secret` matching `OPS_SECRET` (never `CRON_SECRET`;
+see `api/_lib/ops-auth.js`). Unset secret means open in dev and denied in
+production. It is owner-only on purpose: it carries per-engine performance and
+revenue. Per-IP ceiling is the shared `authedReadIp` bucket.
+
+## The response envelope
+
+```json
+{
+ "ok": true,
+ "degraded": [],
+ "window_days": 30,
+ "min_sample": 20,
+ "generated_at": "2026-09-21T22:33:20.917Z",
+ "output": {},
+ "new_actors": {},
+ "retention": {},
+ "destinations": {},
+ "lanes": [],
+ "revenue": {}
+}
+```
+
+`days` is a whole number from 1 to 365, default 30. The panels are read
+independently and in parallel. One that throws is named in `degraded`, its
+section reads as empty, and the status is `207 Multi-Status`, the convention the
+other ops boards use. `ok` says whether the board rendered, never whether the
+funnel is good. If a panel reports a missing column, migration
+`20260921120000_forge_destination.sql` is not applied: `npm run db:status`.
+
+Every rate is an object, not a bare number:
+
+```json
+{ "value": 0.2183, "n": 310, "of": 1420, "low_sample": false }
+```
+
+`value` is null when `of` is zero, because an empty base is not a zero rate.
+`low_sample` is true when `of` is under `min_sample`. The rate is still shown.
+Do not act on it.
+
+## Definitions
+
+| Term | Meaning |
+| --- | --- |
+| Useful | A finished row the maker accepted or downloaded. Either is a deliberate act on the result. A rating alone is not. |
+| Maker | `coalesce(user_id, client_key)`: the account when signed in, otherwise the anonymous browser key. |
+| Keyless request | A row with no account and no `x-forge-client` header. All of them hash to the literal key `anon`, which would read as one extremely loyal maker, so they count in volume and are left out of every per-maker number. `output.unattributed_requests` says how many. |
+| New maker | A maker whose first-ever Forge creation falls inside the window. |
+| Internal | Rows the platform generated itself (catalog seeder, weekly quality benchmark). Excluded everywhere: by `forge_creations.internal` from this migration on, and by `forge_seed_jobs.creation_id` for older seeder rows. Older benchmark rows cannot be told apart and remain in pre-migration numbers. |
+| Failed over | An attempt re-dispatched to another engine (`superseded_by` set). Request-level panels skip it, because the successor row carries the request to its real outcome. The engine table keeps it, because a lost attempt is what that table measures. |
+
+## The panels
+
+**`output`**: volume (`requests`, `done`, `failed`, `in_flight`),
+`generation_success_rate`, and `useful_output_rate` (useful over done).
+`feedback_coverage` is the share of finished rows carrying any verdict, rating
+or download. Read it first. It bounds everything else: a useful-output rate over
+rows nobody judged undercounts, and a router cannot learn from rows with no
+label.
+
+**`new_actors`**: `first_asset_success_rate` is new makers who reached a model
+they kept, over all new makers. `second_asset_rate` is based on new makers who
+got one finished model, not on everyone, so a bad first-generation failure rate
+does not masquerade as low repeat interest.
+
+**`retention`**: `d7` and `d30` are makers who created again at least that many
+days after their first creation, over makers first seen long enough ago to have
+had the chance. The cohort always looks back `cohort_lookback_days` and ignores
+`days`, so narrowing the window does not starve it.
+
+**`destinations`**: one row per destination in composer order, any stored id
+this build does not recognise, then `Not answered` last. A known destination
+with no rows still appears, so the table reads "nobody chose Print" and not as a
+gap. `answer_rate` is answered finished rows over all finished rows.
+
+**`lanes`**: per engine. `attempts_per_useful` is the cost driver: terminal
+attempts spent per kept model. `generation_seconds_per_useful` is total
+generation seconds over kept models, which is what GPU cost scales with on the
+self-hosted engines. Seconds come from `completed_at - created_at`, so only rows
+finished after the migration are timed; `timed_attempts` says how many that is.
+There is deliberately no dollar figure. Cost per generation is not recorded, and
+an always-on GPU bills idle time that a per-row estimate would hide.
+
+**`revenue`**: x402 only, because it is the one payment rail whose price is
+recorded on the row (`x402_price_atomic`). `usdc_per_useful_asset` divides that
+by every kept model in the window. `agent_weekly_retention` is distinct payer
+wallets from the prior week that paid again this week. $THREE and credit payments
+are not on the row and are not in this panel.
+
+## Where destination comes from
+
+`forge_creations.destination` is one of `game`, `web`, `avatar`, `simulation`,
+`print`, `ar`, `play`. The list lives once in
+`src/shared/forge-destinations.js`, which the composer, the request validator
+and this report all import.
+
+- In [/forge](../../pages/forge.html) and `/forge-studio`, a "Making this for"
+ chip row appears under a finished model. One tap is remembered in that browser,
+ sent as `destination` on every later `POST /api/forge`, and written onto the
+ model on screen through `POST /api/forge-feedback`.
+- API callers send the same field. An unrecognised value is ignored, never an
+ error.
+
+```bash
+curl -sS -X POST https://three.ws/api/forge \
+ -H 'content-type: application/json' \
+ -d '{"prompt":"a low-poly wooden barrel","destination":"game"}'
+```
+
+Rows from before the migration are null and land in `Not answered`. They are
+never folded into a real answer.
+
+## Related
+
+- [forge-error-triage.md](forge-error-triage.md): what fails, ranked by class and engine.
+- [../forge-pipeline.md](../forge-pipeline.md): the pipeline, the `forge_creations` columns, and routing.
+- [payment-outcomes.md](payment-outcomes.md): the sibling board for the payment rail.
diff --git a/package.json b/package.json
index ff66f0f8c..7d165f606 100644
--- a/package.json
+++ b/package.json
@@ -431,6 +431,7 @@
"db:check": "node scripts/apply-migrations.mjs --check",
"db:restamp": "node scripts/apply-migrations.mjs --restamp",
"forge:errors": "node scripts/forge-error-report.mjs",
+ "forge:funnel": "node scripts/forge-funnel-report.mjs",
"worker:oracle": "node --env-file-if-exists=.env workers/oracle/index.js",
"worker:sniper": "node workers/agent-sniper/index.js",
"worker:sniper:live": "SNIPER_MODE=live node workers/agent-sniper/index.js",
diff --git a/pages/forge-funnel.html b/pages/forge-funnel.html
new file mode 100644
index 000000000..5328cef79
--- /dev/null
+++ b/pages/forge-funnel.html
@@ -0,0 +1,383 @@
+<!doctype html>
+<html lang="en">
+<head>
+ <script>/* three.ws theme boot */(function(){document.documentElement.classList.add('js');try{var m=localStorage.getItem('twx_theme');var l=m==='auto'?(window.matchMedia&&window.matchMedia('(prefers-color-scheme: light)').matches):m==='light';document.documentElement.setAttribute('data-theme',l?'light':'dark');}catch(e){document.documentElement.setAttribute('data-theme','dark');}})();</script>
+ <meta charset="utf-8" />
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+ <title>Forge Funnel · three.ws</title>
+ <meta name="robots" content="noindex, nofollow" />
+ <link rel="icon" href="/favicon.ico" sizes="any" />
+ <link rel="stylesheet" href="/style.css" />
+ <link rel="stylesheet" href="/nav.css" />
+ <link rel="stylesheet" href="/fonts/fonts.css" />
+ <style>
+ body { background: #0a0a0f; color: #e2e8f0; min-height: 100vh; }
+ /* style.css makes body a flex container, so this wrapper is a flex item whose
+ default min-width:auto lets the engine table's min-content stretch it to the
+ full 1200px on a phone, clipping every section. width + min-width:0 pins it
+ to the viewport and hands the overflow to .ff-table-wrap, where it belongs. */
+ .ff-wrap { width: 100%; min-width: 0; box-sizing: border-box; max-width: 1200px; margin: 0 auto; padding: clamp(1.5rem, 4vw, 3rem) 1.25rem 5rem; }
+ .ff-title { font-size: clamp(1.4rem, 3vw, 1.85rem); font-weight: 800; letter-spacing: -0.025em; margin: 0 0 0.5rem; }
+ .ff-sub { color: rgba(255,255,255,0.45); font-size: 13.5px; margin: 0 0 1.75rem; max-width: 74ch; line-height: 1.65; }
+
+ .ff-controls { display: flex; gap: 0.75rem; margin-bottom: 1.75rem; flex-wrap: wrap; align-items: center; }
+ .ff-controls label { font-size: 12px; color: rgba(255,255,255,0.45); }
+ .ff-controls select, .ff-controls button { font: inherit; font-size: 13px; padding: 8px 12px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.12); background: rgba(255,255,255,0.05); color: #e2e8f0; cursor: pointer; transition: border-color var(--duration-fast) var(--ease-standard), background var(--duration-fast) var(--ease-standard), transform var(--duration-fast) var(--ease-standard); }
+ .ff-controls select:hover, .ff-controls button:hover { border-color: rgba(255,255,255,0.24); background: rgba(255,255,255,0.09); }
+ .ff-controls button:active { transform: translateY(1px); }
+ .ff-controls select:focus-visible, .ff-controls button:focus-visible, .ff-defs summary:focus-visible { outline: 2px solid rgba(124,92,255,0.75); outline-offset: 2px; }
+ .ff-controls button[disabled] { opacity: 0.5; cursor: progress; }
+ .ff-stamp { font-size: 11.5px; color: rgba(255,255,255,0.3); margin-left: auto; font-variant-numeric: tabular-nums; }
+
+ .ff-note { padding: 2.5rem 1.5rem; text-align: center; border-radius: 14px; background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.08); color: rgba(255,255,255,0.55); line-height: 1.75; }
+ .ff-note code { background: rgba(255,255,255,0.08); padding: 2px 6px; border-radius: 4px; font-size: 12.5px; }
+ .ff-note.bad { background: rgba(248,113,113,0.05); border-color: rgba(248,113,113,0.18); }
+ .ff-note h2 { font-size: 15px; margin: 0 0 0.6rem; color: #e2e8f0; font-weight: 700; }
+ .ff-note a { color: var(--accent-violet-strong); }
+ .ff-note.inline { padding: 1.25rem 1.25rem; text-align: left; font-size: 13px; }
+
+ .ff-banner { padding: 0.85rem 1.1rem; border-radius: 11px; margin-bottom: 1.5rem; font-size: 12.5px; line-height: 1.6; background: rgba(240,169,59,0.07); border: 1px solid rgba(240,169,59,0.24); color: #f0a93b; }
+
+ .ff-section-title { font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 700; color: rgba(255,255,255,0.35); margin: 0 0 0.85rem; display: flex; gap: 0.6rem; align-items: baseline; flex-wrap: wrap; }
+ .ff-section-title span { text-transform: none; letter-spacing: 0; font-weight: 500; color: rgba(255,255,255,0.25); }
+ .ff-section { margin-bottom: 2.5rem; }
+
+ .ff-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0.75rem; }
+ .ff-cell { padding: 1rem 1.15rem; border-radius: 12px; background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.07); transition: border-color var(--duration-fast) var(--ease-standard), background var(--duration-fast) var(--ease-standard); }
+ .ff-cell:hover { border-color: rgba(255,255,255,0.14); background: rgba(255,255,255,0.045); }
+ .ff-cell.lead { border-color: rgba(124,92,255,0.35); background: rgba(124,92,255,0.06); }
+ .ff-cell-label { font-size: 12px; color: rgba(255,255,255,0.5); margin-bottom: 0.4rem; }
+ .ff-cell-value { font-size: 1.55rem; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; line-height: 1.15; }
+ .ff-cell-note { font-size: 11.5px; color: rgba(255,255,255,0.35); margin-top: 0.4rem; line-height: 1.5; }
+ .muted { color: rgba(255,255,255,0.35); }
+
+ .ff-pill { display: inline-block; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; padding: 2px 7px; border-radius: 999px; border: 1px solid currentColor; color: #f0a93b; vertical-align: middle; margin-left: 0.35rem; }
+
+ .ff-bars { display: flex; flex-direction: column; gap: 0.5rem; }
+ .ff-bar-row { display: grid; grid-template-columns: minmax(96px, 150px) 1fr minmax(120px, 170px); gap: 0.85rem; align-items: center; font-size: 12.5px; }
+ .ff-bar-label { color: rgba(255,255,255,0.7); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
+ .ff-bar-row.unanswered .ff-bar-label { color: rgba(255,255,255,0.35); }
+ .ff-bar-track { position: relative; height: 20px; border-radius: 6px; background: rgba(255,255,255,0.04); overflow: hidden; }
+ .ff-bar-fill { position: absolute; inset: 0 auto 0 0; border-radius: 6px; background: rgba(124,92,255,0.28); transition: width var(--duration-slow) cubic-bezier(.4,0,.2,1); }
+ .ff-bar-fill.useful { background: linear-gradient(90deg, rgba(47,191,113,0.9), rgba(47,191,113,0.45)); }
+ .ff-bar-row.unanswered .ff-bar-fill { background: rgba(255,255,255,0.1); }
+ .ff-bar-row.unanswered .ff-bar-fill.useful { background: rgba(255,255,255,0.28); }
+ .ff-bar-count { text-align: right; font-variant-numeric: tabular-nums; color: rgba(255,255,255,0.7); white-space: nowrap; }
+ .ff-legend { display: flex; gap: 1.1rem; font-size: 11.5px; color: rgba(255,255,255,0.4); margin-top: 0.85rem; flex-wrap: wrap; }
+ .ff-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 0.4rem; vertical-align: -1px; background: rgba(124,92,255,0.28); }
+ .ff-legend i.useful { background: rgba(47,191,113,0.8); }
+
+ .ff-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
+ .ff-table th, .ff-table td { text-align: left; padding: 0.55rem 0.8rem; border-bottom: 1px solid rgba(255,255,255,0.06); white-space: nowrap; }
+ .ff-table th { color: rgba(255,255,255,0.4); font-weight: 600; text-transform: uppercase; font-size: 10.5px; letter-spacing: 0.06em; }
+ .ff-table tbody tr { transition: background var(--duration-fast) var(--ease-standard); }
+ .ff-table tbody tr:hover { background: rgba(255,255,255,0.035); }
+ .ff-table td.num, .ff-table th.num { font-variant-numeric: tabular-nums; text-align: right; }
+ .ff-table-wrap { overflow-x: auto; border-radius: 12px; border: 1px solid rgba(255,255,255,0.07); }
+ .ff-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
+ .ff-class { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.06em; color: rgba(255,255,255,0.4); }
+
+ .ff-detail { font-size: 12.5px; color: rgba(255,255,255,0.55); line-height: 1.7; margin: 0.75rem 0 0; max-width: 84ch; }
+ .ff-detail b { color: rgba(255,255,255,0.8); font-weight: 600; }
+
+ .ff-defs { border-radius: 12px; border: 1px solid rgba(255,255,255,0.07); background: rgba(255,255,255,0.02); padding: 0.25rem 1.15rem; }
+ .ff-defs summary { cursor: pointer; font-size: 13px; color: rgba(255,255,255,0.7); padding: 0.75rem 0; border-radius: 6px; transition: color var(--duration-fast) var(--ease-standard); }
+ .ff-defs summary:hover { color: #fff; }
+ .ff-defs dl { margin: 0 0 1rem; display: grid; grid-template-columns: minmax(120px, 180px) 1fr; gap: 0.6rem 1.25rem; font-size: 12.5px; line-height: 1.65; }
+ .ff-defs dt { color: rgba(255,255,255,0.8); font-weight: 600; }
+ .ff-defs dd { margin: 0; color: rgba(255,255,255,0.5); }
+
+ .ff-skeleton { border-radius: 12px; background: linear-gradient(90deg, rgba(255,255,255,0.035) 25%, rgba(255,255,255,0.07) 50%, rgba(255,255,255,0.035) 75%); background-size: 200% 100%; animation: ff-shimmer 1.4s ease-in-out infinite; }
+ .ff-skeleton.cell { height: 96px; }
+ .ff-skeleton.bar { height: 20px; margin-bottom: 0.5rem; }
+ @keyframes ff-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
+ @media (max-width: 560px) {
+ .ff-bar-row { grid-template-columns: 1fr; gap: 0.3rem; }
+ .ff-bar-count { text-align: left; }
+ .ff-defs dl { grid-template-columns: 1fr; gap: 0.15rem 0; }
+ .ff-defs dd { margin-bottom: 0.6rem; }
+ }
+ @media (prefers-reduced-motion: reduce) {
+ .ff-skeleton { animation: none; }
+ .ff-bar-fill { transition: none; }
+ }
+ </style>
+</head>
+<body>
+ <div class="ff-wrap">
+ <h1 class="ff-title">Forge Funnel</h1>
+ <p class="ff-sub">
+ The health board says whether meshes come back. This one says whether anyone keeps them:
+ how much of Forge's output a maker accepts or downloads, whether new makers return for a
+ second model, what each model was for, and which engine earns its attempts. Platform
+ generated rows (catalog seeder, quality benchmark) are left out. Internal tooling, not a
+ public surface.
+ </p>
+
+ <div class="ff-controls">
+ <label for="ff-window">Window</label>
+ <select id="ff-window">
+ <option value="7">Last 7 days</option>
+ <option value="30" selected>Last 30 days</option>
+ <option value="90">Last 90 days</option>
+ <option value="365">Last 365 days</option>
+ </select>
+ <button id="ff-refresh" type="button">Refresh</button>
+ <span class="ff-stamp" id="ff-stamp"></span>
+ </div>
+
+ <div id="ff-content" aria-live="polite" aria-busy="true"></div>
+ </div>
+
+ <script src="/nav.js"></script>
+ <script type="module">
+ const el = document.getElementById('ff-content');
+ const windowSelect = document.getElementById('ff-window');
+ const refreshBtn = document.getElementById('ff-refresh');
+ const stamp = document.getElementById('ff-stamp');
+
+ const esc = (s) => String(s ?? '').replace(/[&<>"]/g, (c) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;' }[c]));
+ const num = (n, d = 0) => (typeof n === 'number' && Number.isFinite(n) ? n.toLocaleString('en-US', { minimumFractionDigits: d, maximumFractionDigits: d }) : 'n/a');
+
+ // A null rate means "nothing to divide by", which is not zero and must never
+ // render as one: an empty window and a funnel nobody converts through would
+ // otherwise look the same.
+ const pct = (m) => (typeof m?.value === 'number' ? `${(m.value * 100).toFixed(1)}%` : 'n/a');
+ const lowPill = (m) => (m && m.low_sample && m.of > 0 ? '<span class="ff-pill" title="Too few rows to trust this rate yet">low sample</span>' : '');
+
+ function cell(label, m, note, { lead = false } = {}) {
+ const base = m ? `${num(m.n)} of ${num(m.of)}` : '';
+ return `<div class="ff-cell${lead ? ' lead' : ''}">
+ <div class="ff-cell-label">${esc(label)}</div>
+ <div class="ff-cell-value${typeof m?.value === 'number' ? '' : ' muted'}">${pct(m)}${lowPill(m)}</div>
+ <div class="ff-cell-note">${esc(base)}${base && note ? '. ' : ''}${esc(note || '')}</div>
+ </div>`;
+ }
+
+ function plainCell(label, value, note) {
+ return `<div class="ff-cell">
+ <div class="ff-cell-label">${esc(label)}</div>
+ <div class="ff-cell-value">${esc(value)}</div>
+ <div class="ff-cell-note">${esc(note || '')}</div>
+ </div>`;
+ }
+
+ function headlineSection(d) {
+ const o = d.output, a = d.new_actors, r = d.retention;
+ return `<section class="ff-section">
+ <div class="ff-section-title">Does it convert <span>${num(o.requests)} requests, ${num(o.done)} finished, ${num(o.failed)} failed, ${num(o.in_flight)} in flight</span></div>
+ <div class="ff-grid">
+ ${cell('Useful output', o.useful_output_rate, 'Finished models a maker accepted or downloaded', { lead: true })}
+ ${cell('First asset success', a.first_asset_success_rate, `Of ${num(a.new_actors)} new makers, those who reached a model they kept`)}
+ ${cell('Second asset', a.second_asset_rate, 'New makers with one finished model who made another', { lead: true })}
+ ${cell('Back after day 7', r.d7, `Makers first seen in the last ${r.cohort_lookback_days} days`)}
+ ${cell('Back after day 30', r.d30, `Makers first seen in the last ${r.cohort_lookback_days} days`)}
+ ${cell('Generation success', o.generation_success_rate, 'Finished over finished plus failed')}
+ </div>
+ </section>`;
+ }
+
+ function signalSection(d) {
+ const o = d.output;
+ return `<section class="ff-section">
+ <div class="ff-section-title">How much signal there is <span>every rate above is bounded by this</span></div>
+ <div class="ff-grid">
+ ${cell('Feedback coverage', o.feedback_coverage, 'Finished models carrying any verdict, rating or download')}
+ ${plainCell('Accepted', num(o.accepted), 'Explicit keep')}
+ ${plainCell('Rejected', num(o.rejected), 'Explicit discard')}
+ ${plainCell('Downloaded', num(o.downloaded), 'Implicit keep')}
+ ${plainCell('Rated', num(o.rated), o.avg_rating == null ? 'No ratings in this window' : `Average ${o.avg_rating} of 5`)}
+ </div>
+ <p class="ff-detail"><b>${num(o.unattributed_requests)}</b> requests arrived with no client key and no account.
+ They count in the totals above but are left out of every per-maker number, because they
+ all hash to one shared key and would read as a single very loyal maker.</p>
+ </section>`;
+ }
+
+ function destinationSection(d) {
+ const dest = d.destinations;
+ const answered = dest.rows.filter((x) => x.destination !== null).reduce((s, x) => s + x.done, 0);
+ const max = Math.max(1, ...dest.rows.map((x) => x.done));
+ const head = `<div class="ff-section-title">What it was for <span>answered on ${pct(dest.answer_rate)} of finished models</span></div>`;
+ if (answered === 0) {
+ return `<section class="ff-section">${head}
+ <div class="ff-note inline">
+ <b>No maker has answered in this window.</b> The question is a chip row under the
+ result in <a href="/forge">/forge</a> and <a href="/forge-studio">/forge-studio</a>, and an
+ optional <code>destination</code> field on <code>POST /api/forge</code>. Answers are
+ remembered per browser, so this fills in as makers return. Until then there is no
+ per-destination rate to read, and the honest display is none.
+ </div>
+ </section>`;
+ }
+ const rows = dest.rows.map((x) => {
+ const unanswered = x.destination === null;
+ return `<div class="ff-bar-row${unanswered ? ' unanswered' : ''}">
+ <div class="ff-bar-label" title="${esc(x.label)}">${esc(x.label)}</div>
+ <div class="ff-bar-track" role="img" aria-label="${esc(x.label)}: ${num(x.useful)} useful of ${num(x.done)} finished">
+ <div class="ff-bar-fill" style="width:${((x.done / max) * 100).toFixed(1)}%"></div>
+ <div class="ff-bar-fill useful" style="width:${((x.useful / max) * 100).toFixed(1)}%"></div>
+ </div>
+ <div class="ff-bar-count">${num(x.useful)} / ${num(x.done)} · ${pct(x.useful_output_rate)}${lowPill(x.useful_output_rate)}</div>
+ </div>`;
+ }).join('');
+ return `<section class="ff-section">${head}
+ <div class="ff-bars">${rows}</div>
+ <div class="ff-legend"><span><i></i>Finished</span><span><i class="useful"></i>Accepted or downloaded</span></div>
+ </section>`;
+ }
+
+ function laneSection(d) {
+ const head = `<div class="ff-section-title">Which engine earns its attempts <span>failed-over attempts included, since a lost attempt is what this measures</span></div>`;
+ if (!d.lanes.length) {
+ return `<section class="ff-section">${head}<div class="ff-note inline">No finished or failed attempts in this window. Widen the window above.</div></section>`;
+ }
+ const body = d.lanes.map((l) => `<tr>
+ <td class="ff-mono">${esc(l.backend)}</td>
+ <td class="ff-class">${esc(l.cost_class)}</td>
+ <td class="num">${num(l.attempts)}</td>
+ <td class="num">${pct(l.generation_success_rate)}</td>
+ <td class="num">${num(l.useful)}</td>
+ <td class="num">${pct(l.useful_output_rate)}${lowPill(l.useful_output_rate)}</td>
+ <td class="num">${l.attempts_per_useful == null ? 'n/a' : num(l.attempts_per_useful, 2)}</td>
+ <td class="num">${l.avg_generation_seconds == null ? 'n/a' : `${num(l.avg_generation_seconds)}s`}</td>
+ <td class="num">${l.generation_seconds_per_useful == null ? 'n/a' : `${num(l.generation_seconds_per_useful)}s`}</td>
+ </tr>`).join('');
+ const untimed = d.lanes.reduce((s, l) => s + (l.attempts - l.timed_attempts), 0);
+ return `<section class="ff-section">${head}
+ <div class="ff-table-wrap"><table class="ff-table">
+ <thead><tr>
+ <th scope="col">Engine</th><th scope="col">Cost</th><th scope="col" class="num">Attempts</th>
+ <th scope="col" class="num">Success</th><th scope="col" class="num">Useful</th>
+ <th scope="col" class="num">Useful rate</th><th scope="col" class="num">Attempts per useful</th>
+ <th scope="col" class="num">Avg time</th><th scope="col" class="num">Time per useful</th>
+ </tr></thead>
+ <tbody>${body}</tbody>
+ </table></div>
+ <p class="ff-detail"><b>Attempts per useful</b> is the cost driver: how many runs an engine spends
+ for each model someone keeps. <b>Time per useful</b> is total generation seconds over kept
+ models, the quantity GPU cost scales with on the self-hosted engines.${untimed > 0 ? ` <b>${num(untimed)}</b> attempts finished before completion time was recorded and are left out of both time columns.` : ''}</p>
+ </section>`;
+ }
+
+ function revenueSection(d) {
+ const v = d.revenue;
+ return `<section class="ff-section">
+ <div class="ff-section-title">Paying agents <span>x402 only, the one rail whose price is recorded on the row</span></div>
+ <div class="ff-grid">
+ ${plainCell('USDC collected', num(v.usdc, 2), `${num(v.paid_generations)} paid generations`)}
+ ${plainCell('Distinct payers', num(v.distinct_payers), 'Wallets that paid in this window')}
+ ${plainCell('USDC per useful model', v.usdc_per_useful_asset == null ? 'n/a' : num(v.usdc_per_useful_asset, 4), 'x402 revenue over every kept model')}
+ ${cell('Payers back next week', v.agent_weekly_retention, 'Paid last week and again this week')}
+ </div>
+ </section>`;
+ }
+
+ function definitions(d) {
+ return `<details class="ff-defs">
+ <summary>How these numbers are defined</summary>
+ <dl>
+ <dt>Useful</dt><dd>A finished model the maker accepted or downloaded. Either is a deliberate act on the result. A rating alone is not.</dd>
+ <dt>Maker</dt><dd>The signed-in account when there is one, otherwise the anonymous browser key.</dd>
+ <dt>New maker</dt><dd>A maker whose first-ever Forge creation falls inside the window.</dd>
+ <dt>Failed over</dt><dd>An attempt that moved to another engine is skipped in request-level numbers, because its successor carries the request to its real outcome. The engine table keeps it.</dd>
+ <dt>Low sample</dt><dd>A rate resting on fewer than ${num(d.min_sample)} rows. It is shown, but do not act on it.</dd>
+ <dt>Same numbers, no browser</dt><dd><code>npm run forge:funnel -- --days ${num(d.window_days)}</code>, or <code>GET /api/ops/forge-funnel?days=${num(d.window_days)}</code> with <code>x-ops-secret</code>.</dd>
+ </dl>
+ </details>`;
+ }
+
+ function render(d) {
+ const banner = d.degraded?.length
+ ? `<div class="ff-banner" role="alert">Partial read: ${d.degraded.map((g) => `<b>${esc(g.panel)}</b> (${esc(g.error)})`).join(', ')}. The other panels are current. A panel that names a missing column means migration <code>20260921120000_forge_destination.sql</code> is not applied yet: <code>npm run db:status</code>.</div>`
+ : '';
+ if (!d.degraded?.length && d.output.requests === 0) {
+ el.innerHTML = `<div class="ff-note">
+ <h2>No Forge requests in the last ${num(d.window_days)} days</h2>
+ Nothing was generated in this window, so there is no funnel to read. Pick a longer
+ window above, or make a model in <a href="/forge">/forge</a> and refresh.
+ </div>`;
+ } else {
+ el.innerHTML = banner + headlineSection(d) + signalSection(d) + destinationSection(d) + laneSection(d) + revenueSection(d) + definitions(d);
+ }
+ stamp.textContent = d.generated_at ? `read ${new Date(d.generated_at).toLocaleTimeString()}` : '';
+ }
+
+ function skeleton() {
+ const cells = Array.from({ length: 6 }, () => '<div class="ff-skeleton cell"></div>').join('');
+ const rows = Array.from({ length: 7 }, () => '<div class="ff-skeleton bar"></div>').join('');
+ el.innerHTML = `
+ <section class="ff-section">
+ <div class="ff-section-title">Does it convert <span>reading the outcome ledger</span></div>
+ <div class="ff-grid">${cells}</div>
+ </section>
+ <section class="ff-section">
+ <div class="ff-section-title">What it was for <span>grouping finished models</span></div>
+ ${rows}
+ </section>`;
+ }
+
+ function denied() {
+ el.innerHTML = `<div class="ff-note">
+ <h2>This board is internal</h2>
+ It carries per-engine performance and revenue, so it takes the same gate as
+ <code>/api/ops/health</code>. <a href="/login?next=/forge-funnel">Sign in</a> as a platform admin,
+ or call the API directly with <code>x-ops-secret: $OPS_SECRET</code>:<br /><br />
+ <code>curl -s -H "x-ops-secret: $OPS_SECRET" https://three.ws/api/ops/forge-funnel | jq</code>
+ </div>`;
+ stamp.textContent = '';
+ }
+
+ function failed(message) {
+ el.innerHTML = `<div class="ff-note bad">
+ <h2>Could not read the funnel</h2>
+ <code>${esc(message)}</code><br /><br />
+ The endpoint answers 207 with whatever panels it managed to read, so a total failure here
+ is the request itself. Check the service is up (<code>/api/healthz</code>) and press Refresh.
+ </div>`;
+ stamp.textContent = '';
+ }
+
+ let inFlight = null;
+
+ async function load() {
+ // A second click while a read is open would race two renders; the button
+ // reports the state instead of pretending the click did nothing.
+ if (inFlight) return;
+ refreshBtn.disabled = true;
+ refreshBtn.textContent = 'Reading…';
+ el.setAttribute('aria-busy', 'true');
+ skeleton();
+ inFlight = (async () => {
+ try {
+ const res = await fetch(`/api/ops/forge-funnel?days=${encodeURIComponent(windowSelect.value)}`, {
+ credentials: 'include',
+ headers: { accept: 'application/json' },
+ });
+ if (res.status === 401) return denied();
+ if (res.status === 429) {
+ return failed(`rate limited, retry in ${res.headers.get('retry-after') || 'a moment'}s`);
+ }
+ // 207 is the designed partial: the body is valid and names its blind panels.
+ if (!res.ok && res.status !== 207) throw new Error(`status ${res.status}`);
+ render(await res.json());
+ } catch (err) {
+ failed(err?.message || String(err));
+ } finally {
+ refreshBtn.disabled = false;
+ refreshBtn.textContent = 'Refresh';
+ el.setAttribute('aria-busy', 'false');
+ inFlight = null;
+ }
+ })();
+ await inFlight;
+ }
+
+ // Unlike the payment board, each window is its own set of aggregate queries,
+ // so changing it is a real read.
+ windowSelect.addEventListener('change', load);
+ refreshBtn.addEventListener('click', load);
+ load();
+ </script>
+</body>
+</html>
diff --git a/public/changelog-recent.json b/public/changelog-recent.json
index 40533fcfc..65e29544c 100644
--- a/public/changelog-recent.json
+++ b/public/changelog-recent.json
@@ -1,14 +1,24 @@
{
- "generated_at": "2026-09-21T05:41:11.543Z",
+ "generated_at": "2026-09-21T22:46:08.594Z",
"generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json",
"site": {
"name": "three.ws",
"url": "https://three.ws"
},
- "total": 3741,
+ "total": 3744,
"complete": false,
"full_feed": "/changelog.json",
"entries": [
+ {
+ "date": "2026-09-21",
+ "type": "update",
+ "title": "Forge now asks what your model is for",
+ "summary": "Under a finished model in Forge there is a new one-tap row: Game, Web, Avatar, Simulation, Print, AR, or Just playing. It is optional, it is remembered in your browser so you are only asked once, and it rides along on your later generations. We are using it to see which kinds of work Forge does well and which it does not, by use, instead of one blended number for everyone. Developers calling the Forge API can send the same thing as a destination field.",
+ "link": "/forge",
+ "tags": [
+ "improvement"
+ ]
+ },
{
"date": "2026-09-21",
"type": "update",
@@ -40,6 +50,27 @@
"improvement"
]
},
+ {
+ "date": "2026-09-21",
+ "type": "update",
+ "title": "The club alley no longer renders a giant avatar across the sky",
+ "summary": "Walking into /club, some visitors saw a huge metallic shape filling the sky above the alley, and their computer ran hot. It was a crowd member: one avatar model built at centimetre scale was measured wrong before it was sized, so it spawned about 400 times too big, roughly 700 metres tall, and the GPU spent the whole walk-in painting it. Crowd members, your own avatar in the agent switcher, the theater stage and the Agora now size every avatar from its real posed mesh, so that model stands at normal human height like everyone else.",
+ "link": "/club",
+ "tags": [
+ "fix"
+ ]
+ },
+ {
+ "date": "2026-09-21",
+ "type": "update",
+ "title": "The club no longer runs your computer hot on the way in",
+ "summary": "While you walked the alley and stood at the door, the club was secretly drawing the whole dance floor behind it at full quality, so your graphics card was rendering two complete 3D scenes at once. The hidden stage now pauses its drawing until the alley fades away, roughly halving the graphics work for the entire walk-in. For a cooler machine inside the club too, turn on Power saver in the club controls.",
+ "link": "/club",
+ "tags": [
+ "fix",
+ "improvement"
+ ]
+ },
{
"date": "2026-09-21",
"type": "update",
@@ -1583,39 +1614,6 @@
"fix",
"improvement"
]
- },
- {
- "date": "2026-09-09",
- "type": "update",
- "title": "The Pump.fun Stream tells you it is live, counts what it has seen, and has working Recent and Favorites tabs",
- "summary": "A full audit of /pumpfun, the live pump.fun feed with a 3D agent narrating it. The connection badge in the header said \"connecting...\" forever, even with events pouring in, and the counter on the \"Powered by PumpPortal\" pill stayed on zero no matter how many launches arrived. Both were the same fault: the page's translated-copy pass rewrote those two headings wholesale every time it ran, throwing away the very elements the page updates. Seven controls were affected, including the Share button's \"Copied!\" flash and the avatar picker's name. Each one now hands the page ownership of its live value. The avatar picker's Recent and Favorites tabs were listed but had nothing behind them: opening either showed a blank panel. Both work now, kept in your own browser: every avatar you narrate with lands in Recent, and a star on any card adds it to Favorites. Filtering the feed down to nothing used to leave a blank column; it now says how many events are hidden and offers one click to clear the filters. If the stream drops, the feed says so and offers a Reconnect button instead of sitting on \"Waiting for events...\", and it notices about twice as fast as before. Also: the page title now matches the page (it said \"PumpFun migrations\" while the page streamed new tokens, graduations and claims too), a \"Launch a coin\" link sits next to the status badge, the first-time-fee-claims panel shows skeleton rows during its load and an actionable message with a retry if it fails, and clicking a tab in the agent-config dialog no longer reaches into the avatar picker and deselects its tabs.",
- "link": "/pumpfun",
- "tags": [
- "fix",
- "improvement"
- ]
- },
- {
- "date": "2026-09-09",
- "type": "update",
- "title": "The quality check on a generated model keeps running when one AI provider goes down",
- "summary": "Every generated model can be looked at by a vision model before you see it, which is what catches a flat slab or a melted blob before it reaches you. That check asks one provider first and a free provider second, but when the first one started refusing every request it was still asked first every single time, and half the checks ended up returning no verdict at all, so models shipped unchecked. The check now notices a provider that is refusing, sets it aside for a few minutes, and goes straight to the one that is answering. The set-aside expires by itself, so the moment the first provider is healthy again it is used again with nothing to switch back on.",
- "link": null,
- "tags": [
- "fix",
- "improvement"
- ]
- },
- {
- "date": "2026-09-09",
- "type": "update",
- "title": "The Recording Pipeline board stops showing mainnet numbers when you ask it about devnet",
- "summary": "A full audit of /pipeline, the one-glance health board for the loop that turns every pump.fun launch into a trade signal. The recorder worker writes a single liveness record for whichever network it is recording, and the board was reading that record no matter which network you selected: switching to devnet showed the recorder as LIVE and told you the loop was waiting on the next launch, when nothing had ever recorded there. Devnet now answers honestly, with the recorder marked off and the reason spelled out, and the whole board follows: idle, every stage at zero, and the deploy instruction on screen. Switching networks while a refresh was already running used to be dropped silently, so you got the previous network's numbers under the new label; the newer request now always wins. Five more fixes came with it. The board refreshes every eight seconds and used to rebuild all seven cards each time, which threw away keyboard focus mid-read and made screen readers re-announce the entire grid on every tick; it now updates the numbers in place and announces only the one-line health summary. A response missing a section no longer collapses the page into a false connection error. The refresh spinner turns for exactly as long as the request actually takes. The network switch and refresh controls have a visible focus ring. And the board now points at the public endpoint behind it, so an agent can read the same stages and the same recommended next action as JSON.",
- "link": "/pipeline",
- "tags": [
- "fix",
- "improvement"
- ]
}
]
}
diff --git a/public/changelog.json b/public/changelog.json
index 7e6a8c2f6..93fbe2b7e 100644
--- a/public/changelog.json
+++ b/public/changelog.json
@@ -1,11 +1,21 @@
{
- "generated_at": "2026-09-21T05:41:11.310Z",
+ "generated_at": "2026-09-21T22:46:08.566Z",
"generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json",
"site": {
"name": "three.ws",
"url": "https://three.ws"
},
"entries": [
+ {
+ "date": "2026-09-21",
+ "type": "update",
+ "title": "Forge now asks what your model is for",
+ "summary": "Under a finished model in Forge there is a new one-tap row: Game, Web, Avatar, Simulation, Print, AR, or Just playing. It is optional, it is remembered in your browser so you are only asked once, and it rides along on your later generations. We are using it to see which kinds of work Forge does well and which it does not, by use, instead of one blended number for everyone. Developers calling the Forge API can send the same thing as a destination field.",
+ "link": "/forge",
+ "tags": [
+ "improvement"
+ ]
+ },
{
"date": "2026-09-21",
"type": "update",
@@ -37,6 +47,27 @@
"improvement"
]
},
+ {
+ "date": "2026-09-21",
+ "type": "update",
+ "title": "The club alley no longer renders a giant avatar across the sky",
+ "summary": "Walking into /club, some visitors saw a huge metallic shape filling the sky above the alley, and their computer ran hot. It was a crowd member: one avatar model built at centimetre scale was measured wrong before it was sized, so it spawned about 400 times too big, roughly 700 metres tall, and the GPU spent the whole walk-in painting it. Crowd members, your own avatar in the agent switcher, the theater stage and the Agora now size every avatar from its real posed mesh, so that model stands at normal human height like everyone else.",
+ "link": "/club",
+ "tags": [
+ "fix"
+ ]
+ },
+ {
+ "date": "2026-09-21",
+ "type": "update",
+ "title": "The club no longer runs your computer hot on the way in",
+ "summary": "While you walked the alley and stood at the door, the club was secretly drawing the whole dance floor behind it at full quality, so your graphics card was rendering two complete 3D scenes at once. The hidden stage now pauses its drawing until the alley fades away, roughly halving the graphics work for the entire walk-in. For a cooler machine inside the club too, turn on Power saver in the club controls.",
+ "link": "/club",
+ "tags": [
+ "fix",
+ "improvement"
+ ]
+ },
{
"date": "2026-09-21",
"type": "update",
diff --git a/public/changelog.xml b/public/changelog.xml
index 4822c2f68..d5d3a5028 100644
--- a/public/changelog.xml
+++ b/public/changelog.xml
@@ -6,6 +6,14 @@
<atom:link href="https://three.ws/changelog.xml" rel="self" type="application/rss+xml"/>
<description>What's new on three.ws: features, improvements, and releases, newest first.</description>
<language>en</language>
+ <item>
+ <title>Forge now asks what your model is for</title>
+ <link>https://three.ws/forge</link>
+ <guid isPermaLink="false">2026-09-21:Forge now asks what your model is for</guid>
+ <pubDate>Mon, 21 Sep 2026 12:00:00 GMT</pubDate>
+ <category>improvement</category>
+ <description>Under a finished model in Forge there is a new one-tap row: Game, Web, Avatar, Simulation, Print, AR, or Just playing. It is optional, it is remembered in your browser so you are only asked once, and it rides along on your later generations. We are using it to see which kinds of work Forge does well and which it does not, by use, instead of one blended number for everyone. Developers calling the Forge API can send the same thing as a destination field.</description>
+ </item>
<item>
<title>Paying at the Club door no longer fails when our own traffic has been busy</title>
<link>https://three.ws/club</link>
@@ -30,6 +38,22 @@
<category>feature</category>
<description>The chart-source switcher now covers every coin chart on three.ws. The Oracle coin page and the Pump Dashboard market chart join the coin pages, launch pages, the trade deep-dive and Mission Control, so wherever a coin is charted you can switch between the three.ws chart, DexScreener, Birdeye, GMGN, DEXTools and GeckoTerminal. Your pick is remembered and follows you from one coin surface to the next. The Oracle page keeps its Line and Agent trades views, and the dashboard keeps its own candle chart; the terminals simply line up beside them.</description>
</item>
+ <item>
+ <title>The club alley no longer renders a giant avatar across the sky</title>
+ <link>https://three.ws/club</link>
+ <guid isPermaLink="false">2026-09-21:The club alley no longer renders a giant avatar across the sky</guid>
+ <pubDate>Mon, 21 Sep 2026 12:00:00 GMT</pubDate>
+ <category>fix</category>
+ <description>Walking into /club, some visitors saw a huge metallic shape filling the sky above the alley, and their computer ran hot. It was a crowd member: one avatar model built at centimetre scale was measured wrong before it was sized, so it spawned about 400 times too big, roughly 700 metres tall, and the GPU spent the whole walk-in painting it. Crowd members, your own avatar in the agent switcher, the theater stage and the Agora now size every avatar from its real posed mesh, so that model stands at normal human height like everyone else.</description>
+ </item>
+ <item>
+ <title>The club no longer runs your computer hot on the way in</title>
+ <link>https://three.ws/club</link>
+ <guid isPermaLink="false">2026-09-21:The club no longer runs your computer hot on the way in</guid>
+ <pubDate>Mon, 21 Sep 2026 12:00:00 GMT</pubDate>
+ <category>fix</category>
+ <description>While you walked the alley and stood at the door, the club was secretly drawing the whole dance floor behind it at full quality, so your graphics card was rendering two complete 3D scenes at once. The hidden stage now pauses its drawing until the alley fades away, roughly halving the graphics work for the entire walk-in. For a cooler machine inside the club too, turn on Power saver in the club controls.</description>
+ </item>
<item>
<title>Three SDKs now report the version you actually installed</title>
<link>https://three.ws/tour-builder</link>
diff --git a/scripts/forge-funnel-report.mjs b/scripts/forge-funnel-report.mjs
new file mode 100644
index 000000000..838c360b9
--- /dev/null
+++ b/scripts/forge-funnel-report.mjs
@@ -0,0 +1,130 @@
+#!/usr/bin/env node
+/**
+ * Forge funnel report: does a generation turn into an asset someone keeps?
+ *
+ * `npm run forge:errors` ranks what fails. This is the question after it: of the
+ * meshes that came back, how many did a person accept or download, do new makers
+ * return for a second one, what is each generation for, and which lane earns its
+ * attempts. Same numbers as the owner board at /forge-funnel
+ * (GET /api/ops/forge-funnel); both read api/_lib/forge-funnel.js, so the
+ * definitions cannot drift.
+ *
+ * Usage:
+ * node scripts/forge-funnel-report.mjs # last 30 days
+ * node scripts/forge-funnel-report.mjs --days 7
+ * node scripts/forge-funnel-report.mjs --json
+ *
+ * Reads DATABASE_URL from .env.local, then .env, then the shell (same order as
+ * scripts/apply-migrations.mjs). Read-only: it runs SELECTs and nothing else.
+ * Needs migration 20260921120000_forge_destination.sql applied.
+ */
+
+import { readFileSync } from 'node:fs';
+import { fileURLToPath } from 'node:url';
+import path from 'node:path';
+
+const HERE = path.dirname(fileURLToPath(import.meta.url));
+const REPO_ROOT = path.resolve(HERE, '..');
+
+for (const envFile of ['.env.local', '.env']) {
+ try {
+ const raw = readFileSync(path.resolve(REPO_ROOT, envFile), 'utf8');
+ for (const line of raw.split('\n')) {
+ const m = line.match(/^([A-Z_][A-Z0-9_]*)=(.*)$/);
+ if (!m || process.env[m[1]]) continue;
+ let val = m[2].trim();
+ if ((val.startsWith('"') && val.endsWith('"')) || (val.startsWith("'") && val.endsWith("'"))) {
+ val = val.slice(1, -1);
+ }
+ process.env[m[1]] = val;
+ }
+ } catch { /* file not present */ }
+}
+
+const args = process.argv.slice(2);
+const flag = (name, fallback) => {
+ const i = args.indexOf(`--${name}`);
+ return i >= 0 && args[i + 1] && !args[i + 1].startsWith('--') ? args[i + 1] : fallback;
+};
+const JSON_OUT = args.includes('--json');
+
+if (!process.env.DATABASE_URL) {
+ console.error('DATABASE_URL is not set. Add it to .env.local or export it in your shell.');
+ console.error('Production\'s value: node scripts/read-service-env.mjs \'^DATABASE_URL$\' --raw');
+ process.exit(2);
+}
+
+// Imported after the env files load: the db module resolves DATABASE_URL lazily,
+// but env.js snapshots other vars at import time.
+const { gatherForgeFunnel, clampFunnelDays } = await import('../api/_lib/forge-funnel.js');
+
+const pct = (m) => (m?.value == null ? 'n/a' : `${(m.value * 100).toFixed(1)}%`);
+const base = (m) => `${m?.n ?? 0}/${m?.of ?? 0}${m?.low_sample ? ' (low sample)' : ''}`;
+const line = (label, m) => console.log(` ${label.padEnd(30)} ${pct(m).padStart(7)} ${base(m)}`);
+
+function table(headers, rows) {
+ const widths = headers.map((h, i) => Math.max(h.length, ...rows.map((r) => String(r[i]).length)));
+ const fmt = (r) => r.map((c, i) => (i === 0 ? String(c).padEnd(widths[i]) : String(c).padStart(widths[i]))).join(' ');
+ console.log(` ${fmt(headers)}`);
+ console.log(` ${widths.map((w) => '-'.repeat(w)).join(' ')}`);
+ for (const r of rows) console.log(` ${fmt(r)}`);
+}
+
+const report = await gatherForgeFunnel({ days: clampFunnelDays(flag('days', undefined)) });
+
+if (JSON_OUT) {
+ console.log(JSON.stringify(report, null, 2));
+ process.exit(report.ok ? 0 : 1);
+}
+
+const { output: o, new_actors: a, retention: r, destinations: d, lanes, revenue: v } = report;
+
+console.log(`\nForge funnel, last ${report.window_days} days (rates under ${report.min_sample} rows are flagged low sample)\n`);
+
+console.log('Output');
+console.log(` requests ${o.requests} done ${o.done} failed ${o.failed} in flight ${o.in_flight} keyless (left out of per-maker metrics) ${o.unattributed_requests}`);
+line('Generation success', o.generation_success_rate);
+line('Useful output (kept or downloaded)', o.useful_output_rate);
+line('Feedback coverage', o.feedback_coverage);
+console.log(` accepted ${o.accepted} rejected ${o.rejected} downloaded ${o.downloaded} rated ${o.rated} avg rating ${o.avg_rating ?? 'n/a'}`);
+
+console.log(`\nNew makers (first-ever creation inside the window): ${a.new_actors}`);
+line('First asset success', a.first_asset_success_rate);
+line('Reached any finished asset', a.reached_any_asset_rate);
+line('Second asset', a.second_asset_rate);
+
+console.log(`\nRetention (makers first seen in the last ${r.cohort_lookback_days} days)`);
+line('Came back after day 7', r.d7);
+line('Came back after day 30', r.d30);
+
+console.log('\nWhat it was for');
+line('Answered', d.answer_rate);
+table(
+ ['destination', 'done', 'useful', 'downloaded', 'useful rate'],
+ d.rows.map((x) => [x.label, x.done, x.useful, x.downloaded, pct(x.useful_output_rate)]),
+);
+
+console.log('\nLanes (failed-over attempts included: an attempt a lane lost is what this measures)');
+if (lanes.length) {
+ table(
+ ['backend', 'class', 'attempts', 'done', 'useful', 'success', 'useful rate', 'attempts/useful', 'avg s', 's/useful'],
+ lanes.map((l) => [
+ l.backend, l.cost_class, l.attempts, l.done, l.useful,
+ pct(l.generation_success_rate), pct(l.useful_output_rate),
+ l.attempts_per_useful ?? 'n/a', l.avg_generation_seconds ?? 'n/a', l.generation_seconds_per_useful ?? 'n/a',
+ ]),
+ );
+} else {
+ console.log(' no terminal attempts in this window');
+}
+
+console.log(`\nRevenue (${v.rail} only: the one rail whose price is recorded on the row)`);
+console.log(` paid generations ${v.paid_generations} distinct payers ${v.distinct_payers} USDC ${v.usdc.toFixed(2)} USDC per useful asset ${v.usdc_per_useful_asset ?? 'n/a'}`);
+line('Paying agents back next week', v.agent_weekly_retention);
+
+if (!report.ok) {
+ console.log('\nDegraded panels:');
+ for (const g of report.degraded) console.log(` ${g.panel}: ${g.error}`);
+ process.exit(1);
+}
+console.log('');
diff --git a/tests/forge-funnel.test.js b/tests/forge-funnel.test.js
new file mode 100644
index 000000000..842b34ba9
--- /dev/null
+++ b/tests/forge-funnel.test.js
@@ -0,0 +1,205 @@
+import { describe, it, expect } from 'vitest';
+import { readFileSync } from 'node:fs';
+import {
+ clampFunnelDays,
+ rate,
+ summarizeOutput,
+ summarizeNewActors,
+ summarizeRetention,
+ summarizeDestinations,
+ summarizeLanes,
+ summarizeRevenue,
+ MIN_SAMPLE,
+ FUNNEL_DEFAULT_DAYS,
+} from '../api/_lib/forge-funnel.js';
+import {
+ FORGE_DESTINATIONS,
+ validForgeDestination,
+ forgeDestinationLabel,
+} from '../src/shared/forge-destinations.js';
+
+describe('forge destinations', () => {
+ it('accepts known ids regardless of case and padding', () => {
+ expect(validForgeDestination('game')).toBe('game');
+ expect(validForgeDestination(' Simulation ')).toBe('simulation');
+ });
+
+ it('rejects anything that is not one of ours', () => {
+ for (const bad of [undefined, null, '', 42, {}, 'robots', 'game; drop table']) {
+ expect(validForgeDestination(bad)).toBeNull();
+ }
+ });
+
+ it('labels known ids and echoes unknown ones', () => {
+ expect(forgeDestinationLabel('ar')).toBe('AR');
+ expect(forgeDestinationLabel('holodeck')).toBe('holodeck');
+ });
+
+ it('keeps ids unique, since they are a stored wire format', () => {
+ const ids = FORGE_DESTINATIONS.map((d) => d.id);
+ expect(new Set(ids).size).toBe(ids.length);
+ });
+});
+
+// The chips are static markup (so the i18n pass localizes them), which means
+// the list exists in three places: the shared module, /forge and /forge-studio.
+// A chip the server does not know is a tap that silently records nothing.
+describe('destination chips in the composer pages', () => {
+ const expected = FORGE_DESTINATIONS.map((d) => d.id);
+ const en = JSON.parse(readFileSync(new URL('../public/locales/en.json', import.meta.url), 'utf8'));
+
+ for (const page of ['forge.html', 'forge-studio.html']) {
+ it(`${page} offers exactly the destinations the server accepts, in order`, () => {
+ const html = readFileSync(new URL(`../pages/${page}`, import.meta.url), 'utf8');
+ const ids = [...html.matchAll(/data-dest="([^"]+)"/g)].map((m) => m[1]);
+ expect(ids).toEqual(expected);
+ });
+ }
+
+ it('has an English label and hint for every destination', () => {
+ for (const d of FORGE_DESTINATIONS) {
+ expect(en.forge[`dest_${d.id}`]).toBe(d.label);
+ expect(en.forge[`dest_${d.id}_hint`]).toBe(d.hint);
+ }
+ });
+});
+
+describe('clampFunnelDays', () => {
+ it('defaults when the parameter is absent, not to a one-day window', () => {
+ // Number(null) and Number('') are 0; a naive clamp would return 1.
+ expect(clampFunnelDays(null)).toBe(FUNNEL_DEFAULT_DAYS);
+ expect(clampFunnelDays(undefined)).toBe(FUNNEL_DEFAULT_DAYS);
+ expect(clampFunnelDays('')).toBe(FUNNEL_DEFAULT_DAYS);
+ expect(clampFunnelDays('abc')).toBe(FUNNEL_DEFAULT_DAYS);
+ });
+
+ it('clamps to the supported range and floors fractions', () => {
+ expect(clampFunnelDays('7')).toBe(7);
+ expect(clampFunnelDays(7.9)).toBe(7);
+ expect(clampFunnelDays(0)).toBe(1);
+ expect(clampFunnelDays(-5)).toBe(1);
+ expect(clampFunnelDays(10_000)).toBe(365);
+ });
+});
+
+describe('rate', () => {
+ it('is null on an empty base rather than 0 or NaN', () => {
+ expect(rate(0, 0)).toBeNull();
+ expect(rate(5, 0)).toBeNull();
+ });
+
+ it('rounds to four places', () => {
+ expect(rate(1, 3)).toBe(0.3333);
+ expect(rate(2, 2)).toBe(1);
+ });
+});
+
+describe('summarizeOutput', () => {
+ it('computes useful output and coverage over finished rows only', () => {
+ const out = summarizeOutput({
+ requests: 130, in_flight: 5, done: 100, failed: 25,
+ useful: 40, accepted: 30, rejected: 10, downloaded: 25, rated: 8,
+ avg_rating: '3.666', signalled: 55, unattributed: 12,
+ });
+ expect(out.generation_success_rate).toMatchObject({ value: 0.8, n: 100, of: 125 });
+ expect(out.useful_output_rate).toMatchObject({ value: 0.4, n: 40, of: 100, low_sample: false });
+ expect(out.feedback_coverage.value).toBe(0.55);
+ expect(out.avg_rating).toBe(3.67);
+ expect(out.unattributed_requests).toBe(12);
+ });
+
+ it('renders an empty window without NaN and flags it low sample', () => {
+ const out = summarizeOutput();
+ expect(out.done).toBe(0);
+ expect(out.useful_output_rate).toEqual({ value: null, n: 0, of: 0, low_sample: true });
+ expect(out.avg_rating).toBeNull();
+ });
+
+ it('flags a rate that rests on fewer rows than the minimum sample', () => {
+ const out = summarizeOutput({ done: MIN_SAMPLE - 1, useful: MIN_SAMPLE - 1 });
+ expect(out.useful_output_rate.value).toBe(1);
+ expect(out.useful_output_rate.low_sample).toBe(true);
+ });
+});
+
+describe('summarizeNewActors', () => {
+ it('bases the second-asset rate on makers who got a first asset, not on everyone', () => {
+ const a = summarizeNewActors({ new_actors: 200, with_asset: 120, with_second_asset: 30, with_useful: 50 });
+ expect(a.first_asset_success_rate).toMatchObject({ value: 0.25, of: 200 });
+ expect(a.reached_any_asset_rate.value).toBe(0.6);
+ expect(a.second_asset_rate).toMatchObject({ value: 0.25, n: 30, of: 120 });
+ });
+});
+
+describe('summarizeRetention', () => {
+ it('keeps the D7 and D30 cohorts separate', () => {
+ const r = summarizeRetention({ d7_cohort: 400, d7_retained: 60, d30_cohort: 250, d30_retained: 20 });
+ expect(r.d7).toMatchObject({ value: 0.15, of: 400 });
+ expect(r.d30).toMatchObject({ value: 0.08, of: 250 });
+ expect(r.cohort_lookback_days).toBeGreaterThan(30);
+ });
+});
+
+describe('summarizeDestinations', () => {
+ it('lists every known destination even with no rows, and the unanswered bucket last', () => {
+ const d = summarizeDestinations([
+ { destination: 'game', done: 50, useful: 30, downloaded: 28 },
+ { destination: null, done: 150, useful: 20, downloaded: 15 },
+ ]);
+ expect(d.rows.map((x) => x.destination)).toEqual([...FORGE_DESTINATIONS.map((x) => x.id), null]);
+ expect(d.rows.find((x) => x.destination === 'print')).toMatchObject({ done: 0, useful: 0 });
+ expect(d.rows.at(-1)).toMatchObject({ label: 'Not answered', done: 150 });
+ expect(d.answer_rate).toMatchObject({ value: 0.25, n: 50, of: 200 });
+ });
+
+ it('keeps a stored id this build does not know instead of dropping its rows', () => {
+ const d = summarizeDestinations([{ destination: 'holodeck', done: 4, useful: 1, downloaded: 1 }]);
+ const row = d.rows.find((x) => x.destination === 'holodeck');
+ expect(row).toMatchObject({ label: 'holodeck', done: 4 });
+ expect(d.rows.at(-1).destination).toBeNull();
+ });
+});
+
+describe('summarizeLanes', () => {
+ it('counts failed attempts in attempts-per-useful and sorts by volume', () => {
+ const lanes = summarizeLanes([
+ { backend: 'hunyuan3d', done: 10, failed: 0, useful: 5, timed: 10, gen_seconds: 600 },
+ { backend: 'trellis_selfhost', done: 60, failed: 40, useful: 20, timed: 50, gen_seconds: 4500 },
+ ]);
+ expect(lanes[0].backend).toBe('trellis_selfhost');
+ expect(lanes[0]).toMatchObject({
+ attempts: 100,
+ attempts_per_useful: 5,
+ avg_generation_seconds: 90,
+ generation_seconds_per_useful: 225,
+ });
+ expect(lanes[0].generation_success_rate.value).toBe(0.6);
+ expect(['free', 'paid']).toContain(lanes[0].cost_class);
+ });
+
+ it('reports null, never Infinity, when a lane produced nothing useful or untimed rows', () => {
+ const [lane] = summarizeLanes([{ backend: null, done: 3, failed: 2, useful: 0, timed: 0, gen_seconds: 0 }]);
+ expect(lane.backend).toBe('unknown');
+ expect(lane.attempts_per_useful).toBeNull();
+ expect(lane.avg_generation_seconds).toBeNull();
+ expect(lane.generation_seconds_per_useful).toBeNull();
+ });
+});
+
+describe('summarizeRevenue', () => {
+ it('converts atomics to USDC and divides by useful assets', () => {
+ const v = summarizeRevenue(
+ { paid: 40, payers: 6, atomic: '6150000', prior_week_payers: 4, retained_payers: 1 },
+ { useful: 25 },
+ );
+ expect(v.usdc).toBe(6.15);
+ expect(v.usdc_per_useful_asset).toBe(0.246);
+ expect(v.agent_weekly_retention).toMatchObject({ value: 0.25, n: 1, of: 4, low_sample: true });
+ expect(v.rail).toBe('x402');
+ });
+
+ it('has no per-asset figure when nothing useful was produced', () => {
+ expect(summarizeRevenue({ atomic: 500000 }, { useful: 0 }).usdc_per_useful_asset).toBeNull();
+ expect(summarizeRevenue().usdc).toBe(0);
+ });
+});
diff --git a/vercel.json b/vercel.json
index c002f66ca..1768bae5d 100644
--- a/vercel.json
+++ b/vercel.json
@@ -1926,6 +1926,10 @@
"src": "/payment-outcomes/?",
"dest": "/payment-outcomes.html"
},
+ {
+ "src": "/forge-funnel/?",
+ "dest": "/forge-funnel.html"
+ },
{
"src": "/examples/?",
"dest": "/examples.html"
diff --git a/vite.config.js b/vite.config.js
index 3292072b0..3f0847830 100644
--- a/vite.config.js
+++ b/vite.config.js
@@ -850,6 +850,7 @@ const appConfig = {
'quality-bench': resolve(__dirname, 'pages/quality-bench.html'),
'likeness-bench': resolve(__dirname, 'pages/likeness-bench.html'),
'payment-outcomes': resolve(__dirname, 'pages/payment-outcomes.html'),
+ 'forge-funnel': resolve(__dirname, 'pages/forge-funnel.html'),
search: resolve(__dirname, 'pages/search.html'),
rankings: resolve(__dirname, 'pages/rankings.html'),
'daily-match': resolve(__dirname, 'pages/daily-match.html'),
@@ -1986,6 +1987,8 @@ const appConfig = {
'/likeness-bench/': resolve(root, 'pages/likeness-bench.html'),
'/payment-outcomes': resolve(root, 'pages/payment-outcomes.html'),
'/payment-outcomes/': resolve(root, 'pages/payment-outcomes.html'),
+ '/forge-funnel': resolve(root, 'pages/forge-funnel.html'),
+ '/forge-funnel/': resolve(root, 'pages/forge-funnel.html'),
'/materialize': resolve(root, 'pages/materialize.html'),
'/materialize/': resolve(root, 'pages/materialize.html'),
'/inspect': resolve(root, 'pages/inspect.html'),