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.

fix(forge-crons): stop the daily smoke test passing on a cached mesh, and stop burying gated seed jobs

nirholasbb12a47c1b7f
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 4f3c082d3..ca1fa0e07 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -13,6 +13,7 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr
- **Every agent persona is now a signed, IPFS-pinned manifest anyone can verify**: Saving an agent's persona now compiles its full configuration (system prompt, voice, body, skills, on-chain identity) into a canonical manifest, signs it with the platform's ed25519 attester identity, and pins the signed envelope to IPFS. The CID lands on the agent record, so the prompt an agent actually runs is no longer a claim you have to trust: it is a document anyone can fetch from a public gateway and check. A new public endpoint, /api/manifest-verify, verifies the signature against the platform's signing key and diffs the pinned manifest against the agent's live configuration, naming every field that moved since the pin. The standalone verifier script does the same from the command line with nothing but the CID, so buyers of a forked agent can prove what behavior they are getting without asking three.ws for anything. The wire format is specified in the Agent Manifest spec's signed-envelope section. (`/agent/4c0e4d18-0544-4c95-a0db-a16896b029be`) `[feature, security]`
- **Run your own inference node: the open inference network operator client is here**: Phase 4 of the roadmap (decouple agent inference from any single provider) takes its first concrete step: anyone can now run a node. The new node-operator client is a self-contained daemon that registers with the platform, claims inference jobs, executes them with a real open model (distilgpt2 via ONNX, CPU by default with a one-flag GPU image), and returns every result signed with the node's own Solana key so anyone can verify it. The proof runs end to end locally: register, claim a job, and return a cryptographically verified result, with a built-in selftest that proves the whole loop on a fresh checkout. Operators bring their own hardware; the network supplies the jobs and the on-chain receipts. This is the first piece of the bet that agent inference settles permissionlessly, closer to how blockchains settle blocks than to how today's AI APIs settle bills. (`/docs/inference-node-operator`) `[feature, infra]`
- **Seed your agent's memory from your X account, with your explicit consent**: Your agent can now learn how you write from your own X account, and only after you say yes. Connect X in Settings, and the consent screen tells you exactly what is read (your profile and up to 100 of your recent original public posts), what is stored (a handful of short distilled facts about what you talk about and how you talk, never your posts themselves and never links), and what is never touched (messages, likes, bookmarks, your follower list, your credentials). Agree and the agent's next replies already speak from those facts; change your mind and revoking, or disconnecting X, deletes every memory the seed created. (`/docs/x-memory-seeding`) `[feature]`
+- **The daily check on 3D generation now proves a real model was made, not a remembered one**: Every day an automated check types a prompt into the Forge and confirms a real 3D model comes back, so a dead generator gets caught within a day instead of by a user. It had stopped proving that. The Forge remembers finished models for a week and hands the saved one back when the same prompt is asked again, and the daily check asked the exact same prompt every time, so it was verifying a model made days earlier and reporting green regardless of whether generation still worked. It now insists on a fresh run, and fails loudly if it is ever handed a remembered result. Measured on the fix: the check went from finishing in half a second to taking 85 seconds of real generation. Two more repairs in the same area: a finished model whose quality review hit a storage hiccup used to be discarded on the spot and never looked at again (two models were lost that way in one day) and is now reviewed again on the next pass before anything is given up on, and a fault in one stage of the gallery-seeding job no longer takes the other three stages down with it. (`/forge`) `[fix, infra]`
- **The DeFi market pages stop hammering their data source when they get busy**: The /defi, /chains, /yields, /stablecoins, /fees, /dex-volumes and /hacks pages, plus the protocol, chain and stablecoin detail pages, all read live data from DeFiLlama and hold it in memory for a few minutes. The moment that held copy expired, every request that arrived at once went and fetched its own fresh copy instead of sharing one. Ten simultaneous visitors to the DEX volume board meant ten downloads of the same two megabytes, and the protocol leaderboard's feed is closer to eight. That burst lands precisely when the page is busiest, and when the source pushed back, the page showed an error even though the data behind it was perfectly good. Now the first request through fetches, and everyone else waiting shares that one result. A chain profile also reuses a single copy of the protocol list rather than pulling it again for every chain. If a fetch does fail, the failure is no longer held on to, so the next visitor gets a real retry instead of the same error for the rest of the window. One cosmetic fix rode along: a pool whose name is missing on /yields now reads "Unknown" instead of a bare dash. (`/defi`) `[fix, improvement]`
- **The developer dashboard's x402 earnings finally show your real revenue**: The Usage tab on /dashboard/developers has an x402 Payments figure. It read zero for everyone, always, no matter how many paid calls your checkout products had settled: the query behind it looked for columns that do not exist on the receipts table, and the failure was swallowed so the panel reported a confident 0 instead of an error. It now counts settled checkout calls against the products you own and reports both the payment count and the gross in USDC. The rest of the panel got the same treatment: if one of its numbers cannot be read, the response says so by name instead of quietly showing zero. Two more fixes rode along on the developer endpoints: a mistyped webhook or API-key id now comes back as a clean not-found rather than a server error, and registering a webhook for an event type that does not exist is rejected with the list of valid ones instead of silently creating a webhook subscribed to nothing. (`/dashboard/developers`) `[fix, improvement]`
- **The Forge can now federate GPU work to the Livepeer decentralized compute network**: Text-to-3D jobs start by painting a reference image, and that GPU step can now run on the Livepeer network instead of our own lanes, behind a flag, with the same request shape and the same verification our own workers get (safety screening plus byte-level image checks before anything is stored). It ships dark: our measured probe found Livepeer's free public gateway dead at the DNS edge, so the lane goes live only after a funded Studio key lands and clears a 20-job latency, cost, and success comparison run by the new bench script. The full record and the expansion criteria are in the operator docs. `[feature, infra]`
diff --git a/api/_lib/migrations/20260812210000_forge_seed_gate_attempts.sql b/api/_lib/migrations/20260812210000_forge_seed_gate_attempts.sql
new file mode 100644
index 000000000..6b7da29bd
--- /dev/null
+++ b/api/_lib/migrations/20260812210000_forge_seed_gate_attempts.sql
@@ -0,0 +1,13 @@
+-- forge_seed_jobs.gate_attempts: how many times the catalog quality gate has
+-- tried to judge this generation.
+--
+-- The gate's error branch was terminal on the FIRST fault: one transient read
+-- from object storage ("We encountered an internal error. Please try again.")
+-- moved a finished, GPU-paid mesh to status 'gate_error' forever, and nothing
+-- ever revisits that state. Two seed jobs were buried that way on 2026-08-12
+-- inside a single day. A gate fault is infrastructure, not a quality verdict,
+-- so it deserves a retry; the counter is what bounds that retry, so a mesh that
+-- genuinely cannot be gated still reaches a terminal state instead of cycling
+-- through the gate batch forever.
+
+ALTER TABLE forge_seed_jobs ADD COLUMN IF NOT EXISTS gate_attempts smallint NOT NULL DEFAULT 0;
diff --git a/api/cron/forge-seed-cron.js b/api/cron/forge-seed-cron.js
index 7ed7480ac..39599d8d1 100644
--- a/api/cron/forge-seed-cron.js
+++ b/api/cron/forge-seed-cron.js
@@ -18,7 +18,9 @@
// rigging → poll the auto-rig job; publish the rigged mesh when it
// lands, and publish the static keeper if the rig failed
// (a gated keeper is never thrown away over a rig fault).
-// done / rejected / failed / gate_error are terminal.
+// done / rejected / failed / gate_error are terminal. A gate that could
+// not RUN is not a verdict: the row stays in `generated` and later ticks
+// retry it, reaching gate_error only after GATE_MAX_ATTEMPTS.
//
// 2. Start: pick the next unused prompt(s) from the library, claim an OG
// username for a new user, submit a draft-tier forge job under that user's
@@ -268,7 +270,7 @@ function withDeadline(transport, budgetMs) {
// Seed generations must never leave the free lanes: this cron runs unattended
// every minute, so one silent fallthrough to a paid third-party engine bills the
// platform continuously with nobody watching. A paid lane is recorded on the row
-// and reported, and the asset is still published (the spend already happened,
+// and reported, and the asset is still published (the spend already happened,
// throwing the mesh away would waste it twice), but the reason string makes the
// fallthrough visible in the tick's response and in the accept-rate report.
function assertFreeBackend(backend) {
@@ -341,9 +343,31 @@ async function pollPending(origin) {
// ── Phase 1b: gate finished generations, then publish or quarantine ──────────
+// How many times a generation may fail the gate on infrastructure before it is
+// given up on. A gate fault is a storage read, a renderer, or a judge transport
+// blipping, and every one of those is transient far more often than not, so the
+// first fault must not be fatal. Three keeps a genuinely ungateable mesh from
+// occupying a gate slot indefinitely: it burns three ticks (three minutes) and
+// then goes terminal.
+const GATE_MAX_ATTEMPTS = 3;
+
+/**
+ * What a gate fault means for the row, given how many gate attempts it has
+ * already burned. Pure so the retry-vs-bury decision is testable without a
+ * database: getting it wrong in either direction is expensive (never retrying
+ * throws finished meshes away, never burying starves the gate batch).
+ * @param {number | null | undefined} priorAttempts
+ * @returns {{ attempt: number, terminal: boolean }}
+ */
+export function gateFaultOutcome(priorAttempts) {
+ const attempt = Number(priorAttempts || 0) + 1;
+ return { attempt, terminal: attempt >= GATE_MAX_ATTEMPTS };
+}
+
async function advanceGates(origin) {
const rows = await sql`
- select id, user_id, raw_client_id, prompt, model_category, creation_id, glb_url, backend
+ select id, user_id, raw_client_id, prompt, model_category, creation_id, glb_url, backend,
+ gate_attempts
from forge_seed_jobs
where status = 'generated'
order by started_at asc
@@ -420,16 +444,36 @@ async function advanceGates(origin) {
} catch (err) {
// The gate itself broke (storage read, renderer, judge transport). That is
- // infrastructure, not a quality verdict, so the row is parked in its own
- // terminal state and never counted against the accept rate.
+ // infrastructure, not a quality verdict, so it is never counted against the
+ // accept rate. Because it is infrastructure, it is also usually transient.
+ // Leave the row in 'generated' so the next tick re-gates it, and only park
+ // it in the terminal state once it has burned its attempts.
+ const { attempt, terminal } = gateFaultOutcome(job.gate_attempts);
+ const detail = String(err?.message || err);
+ if (!terminal) {
+ await sql`
+ update forge_seed_jobs
+ set gate_attempts = ${attempt},
+ error = ${`gate attempt ${attempt}/${GATE_MAX_ATTEMPTS}: ${detail}`.slice(0, 500)}
+ where id = ${job.id}
+ `;
+ results.push({
+ job_id: job.id,
+ status: 'gate_retry',
+ attempt,
+ error: detail.slice(0, 200),
+ });
+ continue;
+ }
await sql`
update forge_seed_jobs
set status = 'gate_error',
- error = ${String(err?.message || err).slice(0, 500)},
+ gate_attempts = ${attempt},
+ error = ${detail.slice(0, 500)},
finished_at = now()
where id = ${job.id}
`;
- results.push({ job_id: job.id, status: 'gate_error', error: String(err?.message || err).slice(0, 200) });
+ results.push({ job_id: job.id, status: 'gate_error', attempt, error: detail.slice(0, 200) });
}
}
return results;
@@ -618,7 +662,7 @@ async function startNextJob(origin, claimed = new Set()) {
select count(*)::int as count from forge_seed_jobs where status = 'pending'
`;
if (count >= maxPending()) {
- return { skipped: true, reason: `${count} jobs already pending` };
+ return { skipped: true, reason: `${count} job${count === 1 ? '' : 's'} already pending` };
}
const circuit = await circuitState(CIRCUIT_NAME);
@@ -851,24 +895,46 @@ export default wrapCron(async (req, res) => {
const origin = ORIGIN();
// Every phase advances a different set of rows, so they are safe to run
// together and the tick costs one phase's wall-clock, not four in series.
- const [polled, gated, rigged, started] = await Promise.all([
- pollPending(origin),
- advanceGates(origin),
- advanceRigs(origin),
- startBatch(origin),
- ]);
+ //
+ // Isolated per phase, not a bare Promise.all: each phase opens with its own
+ // row query, and a fault there (a schema change mid-rollout, a pooler blip)
+ // is outside the per-job try/catch, so under Promise.all one broken phase
+ // rejected the whole tick. That took down the three healthy phases with it
+ // and cost the minute entirely, including the start phase, which is the one
+ // that keeps the gallery growing. A broken phase now reports itself and the
+ // rest of the tick still runs.
+ const [polled, gated, rigged, started] = await Promise.all(
+ [
+ ['poll', () => pollPending(origin)],
+ ['gate', () => advanceGates(origin)],
+ ['rig', () => advanceRigs(origin)],
+ ['start', () => startBatch(origin)],
+ ].map(([name, run]) =>
+ run().catch((err) => {
+ const detail = String(err?.message || err);
+ console.warn(`[forge-seed] ${name} phase failed: ${detail}`);
+ return [{ phase: name, status: 'phase_error', error: detail.slice(0, 200) }];
+ }),
+ ),
+ );
+ const phaseErrors = [...polled, ...gated, ...rigged, ...started].filter((r) => r?.status === 'phase_error');
const advanced = [...gated, ...rigged];
const published = advanced.filter(j => j.status === 'published').length;
const rejected = advanced.filter(j => j.status === 'rejected').length;
const failed = polled.filter(j => j.status === 'failed').length;
+ // Surfaced as its own count so a lane that keeps blipping is visible in the
+ // tick response, not just buried in gate_results.
+ const gateRetries = gated.filter(j => j.status === 'gate_retry').length;
return json(res, 200, {
- ok: true,
+ ok: phaseErrors.length === 0,
polled: polled.length,
published,
rejected,
failed,
+ gate_retries: gateRetries,
+ phase_errors: phaseErrors,
accept_rate: await recentAcceptRate(),
poll_results: polled,
gate_results: gated,
diff --git a/api/cron/forge-smoke.js b/api/cron/forge-smoke.js
index 6a4f7302b..3b72a7753 100644
--- a/api/cron/forge-smoke.js
+++ b/api/cron/forge-smoke.js
@@ -6,8 +6,10 @@
// is the one a stranger hits: a prompt in, a real GLB out. This cron runs that
// bar once a day against the deployed site (vercel.json crons):
//
-// 1. POST /api/forge { prompt, tier: 'draft' } — the free NVIDIA lane, so a
-// daily run costs zero vendor spend.
+// 1. POST /api/forge { prompt, tier: 'draft', force_regenerate: true } against
+// the free NVIDIA lane, so a daily run costs zero vendor spend. The flag is
+// load-bearing: see runGeneration for why a cached hit would make this leg
+// pass while generation is dead.
// 2. Poll the job (the draft lane usually answers synchronously) and fetch
// the resulting GLB's first bytes — only the 'glTF' magic counts as up.
// 3. GET /api/forge?health — surfaces paid-lane breakage (provider auth,
@@ -86,13 +88,25 @@ async function verifyGlb(glbUrl) {
}
// Submit a draft generation and follow it to a verified GLB.
-async function runGeneration(origin) {
+//
+// force_regenerate is what makes this a generation test at all. /api/forge keeps
+// a content-addressed result cache keyed on (path, tier, backend, prompt,
+// options) with a 7-day TTL, and a read never refreshes that TTL. SMOKE_PROMPT is
+// a constant and the submit sends no seed, so the key is stable forever: without
+// this flag the daily run gets an instant cache hit, verifyGlb happily reads the
+// GLB some earlier generation produced, and the check reports green while every
+// GPU lane is dead. That is the exact failure this cron exists to catch (the June
+// 2026 audit found flows 100% dead in production while every config check read
+// green), and it was live: an audit run on 2026-08-12 completed all five legs in
+// 0.55 s total, which no real generation can do. The flag skips only the cache
+// READ; a fresh run is still written back, so the cache stays warm for users.
+export async function runGeneration(origin) {
const submit = await fetchJson(
`${origin}/api/forge`,
{
method: 'POST',
headers: { 'content-type': 'application/json' },
- body: JSON.stringify({ prompt: SMOKE_PROMPT, tier: 'draft' }),
+ body: JSON.stringify({ prompt: SMOKE_PROMPT, tier: 'draft', force_regenerate: true }),
},
SUBMIT_TIMEOUT_MS,
);
@@ -102,6 +116,12 @@ async function runGeneration(origin) {
reason: `submit returned HTTP ${submit.status}: ${submit.body?.error_description || submit.body?.error || 'no body'}`,
};
}
+ // A cache hit under force_regenerate means the flag stopped being honoured, so
+ // the run proved nothing about generation. Fail loudly rather than pass on a
+ // replayed mesh.
+ if (submit.body?.cached) {
+ return { ok: false, reason: 'submit was served from the forge result cache: force_regenerate is not being honoured, so the generation pipeline was never exercised' };
+ }
let { status, glb_url: glbUrl, job_id: jobId } = submit.body || {};
const deadline = Date.now() + POLL_DEADLINE_MS;
diff --git a/api/cron/gpu-keepwarm.js b/api/cron/gpu-keepwarm.js
index 831ba9aed..65244d3e9 100644
--- a/api/cron/gpu-keepwarm.js
+++ b/api/cron/gpu-keepwarm.js
@@ -22,8 +22,10 @@
//
// Set FORGE_KEEPWARM_LANES (comma-separated lane ids) to override the default
// set without a deploy, which is the one-flag change to make when quota lands.
+// An id in that list that matches no lane is reported as unknown_lanes and drops
+// the tick's `ok` to false, so a typo cannot silently warm nothing.
-import { error, json, method, wrapCron } from '../_lib/http.js';
+import { json, method, wrapCron } from '../_lib/http.js';
import { requireCron } from '../_lib/cron-auth.js';
// Every self-host GPU lane that scales to zero. `safeByDefault` records whether
@@ -52,13 +54,27 @@ const PING_TIMEOUT_MS = 8_000;
// is what booted it, which is exactly the cold start a user would have paid.
const WARM_LATENCY_MS = 1_200;
-function selectedLaneIds() {
- const raw = String(process.env.FORGE_KEEPWARM_LANES || '').trim();
- if (!raw) return KEEPWARM_LANES.filter((l) => l.safeByDefault).map((l) => l.id);
- return raw
- .split(',')
- .map((s) => s.trim())
- .filter(Boolean);
+/**
+ * Resolve the override string into the lanes to warm this tick. An id that
+ * matches no lane is reported rather than dropped: FORGE_KEEPWARM_LANES exists to
+ * be edited without a deploy, and a typo in it would otherwise warm nothing at
+ * all while the tick still answered `ok: true`, which is a silent outage of the
+ * exact thing this cron prevents.
+ * @param {string | undefined} raw
+ * @returns {{ lanes: typeof KEEPWARM_LANES, unknown: string[], source: 'default'|'override' }}
+ */
+export function resolveKeepwarmLanes(raw) {
+ const ids = String(raw || '').trim();
+ if (!ids) {
+ return { lanes: KEEPWARM_LANES.filter((l) => l.safeByDefault), unknown: [], source: 'default' };
+ }
+ const wanted = ids.split(',').map((s) => s.trim()).filter(Boolean);
+ const known = new Set(KEEPWARM_LANES.map((l) => l.id));
+ return {
+ lanes: KEEPWARM_LANES.filter((l) => wanted.includes(l.id)),
+ unknown: wanted.filter((id) => !known.has(id)),
+ source: 'override',
+ };
}
// One authenticated GET against the worker root. Cloud Run answers anything
@@ -105,8 +121,11 @@ export default wrapCron(async (req, res) => {
return json(res, 200, { ok: true, skipped: 'no_reconstruction_key', lanes: [] });
}
- const wanted = new Set(selectedLaneIds());
- const lanes = KEEPWARM_LANES.filter((l) => wanted.has(l.id));
+ const { lanes, unknown } = resolveKeepwarmLanes(process.env.FORGE_KEEPWARM_LANES);
+ if (unknown.length) {
+ console.warn(`[gpu-keepwarm] FORGE_KEEPWARM_LANES names ${unknown.length} unknown lane(s): ${unknown.join(', ')}`);
+ }
+ const selected = new Set(lanes.map((l) => l.id));
const results = await Promise.all(lanes.map((l) => pingLane(l, key)));
const booted = results.filter((r) => r.status === 'ok' && r.wasWarm === false).map((r) => r.id);
@@ -119,11 +138,12 @@ export default wrapCron(async (req, res) => {
}
return json(res, 200, {
- ok: true,
+ ok: unknown.length === 0,
checked: results.length,
warm: results.filter((r) => r.wasWarm).length,
booted,
- skipped_for_quota: KEEPWARM_LANES.filter((l) => !l.safeByDefault && !wanted.has(l.id)).map((l) => ({
+ unknown_lanes: unknown,
+ skipped_for_quota: KEEPWARM_LANES.filter((l) => !l.safeByDefault && !selected.has(l.id)).map((l) => ({
id: l.id,
reason: l.reason,
})),
diff --git a/data/changelog.json b/data/changelog.json
index f5ae2b487..d33704dca 100644
--- a/data/changelog.json
+++ b/data/changelog.json
@@ -1,6 +1,16 @@
{
"$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-08-12",
+ "title": "The daily check on 3D generation now proves a real model was made, not a remembered one",
+ "summary": "Every day an automated check types a prompt into the Forge and confirms a real 3D model comes back, so a dead generator gets caught within a day instead of by a user. It had stopped proving that. The Forge remembers finished models for a week and hands the saved one back when the same prompt is asked again, and the daily check asked the exact same prompt every time, so it was verifying a model made days earlier and reporting green regardless of whether generation still worked. It now insists on a fresh run, and fails loudly if it is ever handed a remembered result. Measured on the fix: the check went from finishing in half a second to taking 85 seconds of real generation. Two more repairs in the same area: a finished model whose quality review hit a storage hiccup used to be discarded on the spot and never looked at again (two models were lost that way in one day) and is now reviewed again on the next pass before anything is given up on, and a fault in one stage of the gallery-seeding job no longer takes the other three stages down with it.",
+ "tags": [
+ "fix",
+ "infra"
+ ],
+ "link": "/forge"
+ },
{
"date": "2026-08-12",
"title": "The open inference network's node endpoints answer again",
diff --git a/docs/forge-pipeline.md b/docs/forge-pipeline.md
index b8d8d3217..1d0b62fec 100644
--- a/docs/forge-pipeline.md
+++ b/docs/forge-pipeline.md
@@ -148,7 +148,7 @@ Async jobs get an opaque HMAC-signed token (`f1.<payload>.<sig>`, `api/_lib/forg
### Quality, caching, and scale
- **Quality gate + best-of retry.** `scoreQualityGate` flags degenerate results (near-empty geometry, texture failures); synchronous lanes retry once inline before returning.
-- **Result cache** (`api/_lib/forge-cache.js`). Identical text prompts on platform-keyed non-high lanes are served from cache with `cached: true`.
+- **Result cache** (`api/_lib/forge-cache.js`). Identical text prompts on platform-keyed non-high lanes are served from cache with `cached: true`. The key covers path, tier, backend, the normalized prompt, and the output-affecting options (seed included), with a 7-day TTL that a read never refreshes. `force_regenerate: true` in the request body skips the cache READ while still writing the fresh result back. Any caller that must prove the pipeline is alive rather than that a mesh exists has to send it: the daily smoke cron (`api/cron/forge-smoke.js`) submits a constant prompt with no seed, so without the flag its key never changes and it verifies a replay. Automation that seeds the gallery takes the other route and varies the seed per submit (`api/cron/forge-seed-cron.js`), so a repeated prompt yields a genuinely new asset instead of a second catalog entry pointing at one GLB.
- **Scale controls** (`api/_lib/forge-scale.js`). In-flight coalescing, blocking-lane slots, and daily paid caps keep a traffic spike from stampeding the GPU fleet or the paid last resort.
## 6. Persistence and storage
diff --git a/docs/ops/gcp-model-workers.md b/docs/ops/gcp-model-workers.md
index 612c383fd..3d668df00 100644
--- a/docs/ops/gcp-model-workers.md
+++ b/docs/ops/gcp-model-workers.md
@@ -38,7 +38,9 @@ job runs. We surface that honestly (see *Cold start*), never as a fake timer,
and the `gpu-keepwarm` cron (`api/cron/gpu-keepwarm.js`, every 10 min during
peak hours via Cloud Scheduler) holds allowlisted scale-to-zero lanes resident
where warming them does not contend for that L4 pool (`FORGE_KEEPWARM_LANES`
-overrides the set without a deploy).
+overrides the set without a deploy). A lane id in that override that matches no
+known lane comes back in the tick's `unknown_lanes` and drops its `ok` to false,
+so a typo in the env var fails visibly instead of quietly warming nothing.
`us-east4` has its own grant of 3 L4s and the same arithmetic applies there. It
runs standbys of `model-trellis` (pinned at min 1), `model-hunyuan3d`,
diff --git a/docs/seed-quality.md b/docs/seed-quality.md
index df09b9d17..68edc884c 100644
--- a/docs/seed-quality.md
+++ b/docs/seed-quality.md
@@ -113,6 +113,28 @@ accept-rate statistics, and you would tune thresholds against an outage. The
verdict carries `vision.status` (`judged` / `skipped` / `unavailable`) so the
accept rate can always be computed over the assets that were actually judged.
+## A gate that cannot run is retried, not buried
+
+The distinction above (quality verdict vs infrastructure) also decides what
+happens to the *job row*. When the gate itself throws before reaching a verdict
+(the object-storage read fails, the renderer dies, the judge transport is
+unreachable), `api/cron/forge-seed-cron.js` leaves the row in `generated` and
+counts the attempt in `forge_seed_jobs.gate_attempts`. The next tick re-gates it.
+Only after `GATE_MAX_ATTEMPTS` (3) does the row move to the terminal `gate_error`
+state.
+
+That bound matters in both directions. Nothing ever revisits `gate_error`, so
+burying a row on the first fault throws away a finished mesh that already cost
+GPU time: on 2026-08-12 two seed jobs were lost that way inside one day, both to
+the same transient storage error ("We encountered an internal error. Please try
+again."). But an unbounded retry would let one ungateable mesh occupy a slot in
+the `SEED_CRON_GATE` batch forever and starve every newer generation behind it.
+Three attempts costs three ticks (three minutes) and then moves on.
+
+Retries surface as `gate_retry` entries in the tick's `gate_results`, with a
+`gate_retries` count on the response, so a lane that keeps blipping is visible
+without reading the table.
+
## Rejects are kept, not deleted
A reject is copied (never moved, so the creator's forge history stays coherent)
diff --git a/prompts/swarm-100/api-cron-03.md b/prompts/swarm-100/api-cron-03.md
deleted file mode 100644
index 5830e1a55..000000000
--- a/prompts/swarm-100/api-cron-03.md
+++ /dev/null
@@ -1,110 +0,0 @@
-# API audit: api/cron batch 03 (10 files)
-
-How to run: paste this file's repo path into a fresh Claude Code chat in this
-repository and say "run this work order". This file is fully self-contained:
-it depends on no other prompt file anywhere. If neighboring files in
-prompts/swarm-100/ are gone, that work is done; if present, ignore them.
-Every claim below rots; step 0 re-measures, and what you measure wins.
-
-## Operating clause (binding)
-
-- Read CLAUDE.md first. Its rules override everything, including this file.
-- Finish 100% in this session. Never end the turn with a question, an option
- list, or an unexecuted plan. A judgment call goes in one line of the final
- report; it never becomes a question that halts work.
-- The only permitted stops are the CLAUDE.md stop-and-ask gates: spending real
- funds or any irreversible on-chain write, git push or a production deploy,
- committing content that references a crypto project other than $THREE, and
- destroying unrecoverable data.
-- No mocks, no fake data, no placeholder stubs, no unfinished-work markers, no
- commented-out code. Real APIs and real integrations only.
-- The em-dash and en-dash characters are banned in everything you write.
-- Concurrent agents share this worktree: stage explicit paths only (never a
- bare add-everything), and commit finished work promptly.
-- Before committing, run: npm run check:rules -- --paths <files you touched>.
- It must exit 0.
-
-## Step 0: re-derive the current state
-
-1. Confirm each file below still exists; deleted ones are done, skip them.
-2. For each, decide routability: grep its path in vercel.json and read how
- server/index.mjs maps filesystem handlers. Routed files get an endpoint
- audit; internal modules get a code and test audit.
-3. Start a local server for endpoint checks: node server/index.mjs with .env
- loaded, on a free PORT if 3000 is busy.
-
-## Task: audit these api files, then fix everything found
-
-Files in this batch:
-
-- api/cron/forge-seed-cron.js
-- api/cron/forge-smoke.js
-- api/cron/forge-thumbnail-backfill.js
-- api/cron/free-model-audit.js
-- api/cron/garment-catalog-audit.js
-- api/cron/garment-job-sweep.js
-- api/cron/gcp-burn-report.js
-- api/cron/gmgn-seed.js
-- api/cron/gpu-keepwarm.js
-- api/cron/intel-learn.js
-
-For every routed handler:
-
-1. Exercise it with curl against the local server: the success path returns
- real data with the correct status; malformed input returns a 4xx JSON
- error, never a stack trace or an HTML error page; auth is enforced where
- the code intends it; CORS matches neighboring handlers.
-2. Hard-rule scan: no mock fallbacks, no fake-data arrays, no stubbed
- responses, no unfinished markers. Errors are handled at the boundary and
- internal code trusts itself.
-3. Do not spend funds or sign anything on-chain while probing. Payment and
- trading handlers get their validation and error paths exercised, never a
- live settlement.
-
-For every internal (non-routed) module:
-
-4. Something must import it; if nothing does, delete it as dead code (verify
- with a repo-wide grep first).
-5. Its main path and one failure path must be covered in tests/; add the
- missing test if not.
-
-## Definition of done
-
-- [ ] Every listed file has recorded evidence: a curl transcript for routed
- handlers, a passing test or a deletion for internal modules.
-- [ ] Zero hard-rule violations remain in these files.
-- [ ] vitest run passes; npm run check:rules -- --paths <touched files>
- exits 0.
-
-## Never blocked
-
-| Blocker | Resolution (act, do not ask) |
-|---|---|
-| Missing env var or credential | Check .env and .env.local, then the Cloud Run service env, then Secret Manager (the CLAUDE.md self-unblock playbook has the exact commands). If it truly exists nowhere, wire the code fully behind the env var, prove the wiring with a dry run, and name the single missing var in the report. |
-| gcloud not on PATH | Run: export PATH="$HOME/google-cloud-sdk/bin:$PATH" |
-| Dev server port 3000 busy | Another agent may be serving this repo; probe it and reuse if so. Otherwise start your own on a free port: npx vite --port 3101 |
-| Playwright browser missing | npx playwright install chromium |
-| A surface needs a signed-in user | Register a fresh account through the real /register flow against the real API and use it. Never mock the session. |
-| A defect sits in code you did not touch | Fix it if it blocks a Definition of done line (root cause it, never mask it). Otherwise note it in the report and continue. |
-| An unrelated test is red | Same rule. Never pipe npm test through tail; it masks exit codes. |
-
-## Close out (required)
-
-1. Verify every Definition of done line with the actual command output in
- front of you. Never claim a line you did not verify.
-2. Commit with explicit paths and a subject that describes the diff (house
- style: type(scope): what changed and why a reader cares).
-3. Delete this prompt file in that same commit:
-
- git rm prompts/swarm-100/api-cron-03.md
-
- The shrinking directory is this campaign's only progress ledger; there is
- no progress log to update.
-4. Final report: what step 0 measured, what changed (file list), evidence per
- Definition of done line, and any one-line judgment calls. No trailing
- questions, no unexecuted plans.
-
-If a line genuinely cannot pass inside this session (an external party must
-respond, or an owner-gated action is the final step), finish everything else,
-leave this file in place, and state exactly which line remains and who owns
-it. Never delete this file on a partial.
diff --git a/public/changelog.json b/public/changelog.json
index 41994df65..25106008e 100644
--- a/public/changelog.json
+++ b/public/changelog.json
@@ -1,5 +1,5 @@
{
- "generated_at": "2026-08-12T21:01:26.651Z",
+ "generated_at": "2026-08-12T21:08:04.069Z",
"generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json",
"site": {
"name": "three.ws",
@@ -79,6 +79,17 @@
"feature"
]
},
+ {
+ "date": "2026-08-12",
+ "type": "update",
+ "title": "The daily check on 3D generation now proves a real model was made, not a remembered one",
+ "summary": "Every day an automated check types a prompt into the Forge and confirms a real 3D model comes back, so a dead generator gets caught within a day instead of by a user. It had stopped proving that. The Forge remembers finished models for a week and hands the saved one back when the same prompt is asked again, and the daily check asked the exact same prompt every time, so it was verifying a model made days earlier and reporting green regardless of whether generation still worked. It now insists on a fresh run, and fails loudly if it is ever handed a remembered result. Measured on the fix: the check went from finishing in half a second to taking 85 seconds of real generation. Two more repairs in the same area: a finished model whose quality review hit a storage hiccup used to be discarded on the spot and never looked at again (two models were lost that way in one day) and is now reviewed again on the next pass before anything is given up on, and a fault in one stage of the gallery-seeding job no longer takes the other three stages down with it.",
+ "link": "/forge",
+ "tags": [
+ "fix",
+ "infra"
+ ]
+ },
{
"date": "2026-08-12",
"type": "update",
diff --git a/public/changelog.xml b/public/changelog.xml
index bef22ac25..a575cdb56 100644
--- a/public/changelog.xml
+++ b/public/changelog.xml
@@ -62,6 +62,14 @@
<category>feature</category>
<description>Your agent can now learn how you write from your own X account, and only after you say yes. Connect X in Settings, and the consent screen tells you exactly what is read (your profile and up to 100 of your recent original public posts), what is stored (a handful of short distilled facts about what you talk about and how you talk, never your posts themselves and never links), and what is never touched (messages, likes, bookmarks, your follower list, your credentials). Agree and the agent's next replies already speak from those facts; change your mind and revoking, or disconnecting X, deletes every memory the seed created.</description>
</item>
+ <item>
+ <title>The daily check on 3D generation now proves a real model was made, not a remembered one</title>
+ <link>https://three.ws/forge</link>
+ <guid isPermaLink="false">2026-08-12:The daily check on 3D generation now proves a real model was made, not a remembered one</guid>
+ <pubDate>Wed, 12 Aug 2026 12:00:00 GMT</pubDate>
+ <category>fix</category>
+ <description>Every day an automated check types a prompt into the Forge and confirms a real 3D model comes back, so a dead generator gets caught within a day instead of by a user. It had stopped proving that. The Forge remembers finished models for a week and hands the saved one back when the same prompt is asked again, and the daily check asked the exact same prompt every time, so it was verifying a model made days earlier and reporting green regardless of whether generation still worked. It now insists on a fresh run, and fails loudly if it is ever handed a remembered result. Measured on the fix: the check went from finishing in half a second to taking 85 seconds of real generation. Two more repairs in the same area: a finished model whose quality review hit a storage hiccup used to be discarded on the spot and never looked at again (two models were lost that way in one day) and is now reviewed again on the next pass before anything is given up on, and a fault in one stage of the gallery-seeding job no longer takes the other three stages down with it.</description>
+ </item>
<item>
<title>The DeFi market pages stop hammering their data source when they get busy</title>
<link>https://three.ws/defi</link>
diff --git a/public/features.json b/public/features.json
index fd5ae4215..d2fdcbf7d 100644
--- a/public/features.json
+++ b/public/features.json
@@ -1,5 +1,5 @@
{
- "generated_at": "2026-08-12T21:01:26.643Z",
+ "generated_at": "2026-08-12T21:08:04.050Z",
"generated_by": "scripts/build-page-index.mjs from data/pages.json",
"site": {
"name": "three.ws",
diff --git a/tests/cron-forge-lane-guards.test.js b/tests/cron-forge-lane-guards.test.js
new file mode 100644
index 000000000..69f5445e8
--- /dev/null
+++ b/tests/cron-forge-lane-guards.test.js
@@ -0,0 +1,146 @@
+// Three guards on the crons that keep the forge lanes honest, each locking in a
+// defect found by the 2026-08-12 api/cron audit.
+//
+// 1. forge-smoke's generation leg was passing on a REPLAY. /api/forge keeps a
+// content-addressed result cache keyed on (path, tier, backend, prompt,
+// options) for 7 days, and a read never refreshes the TTL. The smoke test
+// submits a constant prompt with no seed, so the key never changes: the
+// daily run took a cache hit, verified a GLB an earlier generation had
+// produced, and reported green. A probe run measured all five legs finishing
+// in 0.55 s, which no real generation does. The whole point of this cron is
+// to catch a flow that is 100% dead while every config check reads green, so
+// a replayed mesh must never satisfy it.
+//
+// 2. forge-seed-cron buried a finished mesh on the FIRST gate fault. A gate
+// fault is infrastructure (an object-storage read, the renderer, a judge
+// transport), 'gate_error' is terminal, and nothing revisits it: two seed
+// jobs were lost that way in a single day to a transient storage 500. It has
+// to retry, and it has to stop retrying.
+//
+// 3. gpu-keepwarm silently warmed nothing when FORGE_KEEPWARM_LANES held a
+// typo. That env var exists to be edited without a deploy, so a typo is the
+// likely failure, and the tick still answered ok:true with zero lanes
+// checked: a silent outage of the exact cold start this cron prevents.
+
+import { test, expect, afterEach, vi } from 'vitest';
+import { runGeneration } from '../api/cron/forge-smoke.js';
+import { gateFaultOutcome } from '../api/cron/forge-seed-cron.js';
+import { resolveKeepwarmLanes, KEEPWARM_LANES } from '../api/cron/gpu-keepwarm.js';
+
+const realFetch = globalThis.fetch;
+afterEach(() => {
+ globalThis.fetch = realFetch;
+ vi.restoreAllMocks();
+});
+
+// A binary glTF header is the only thing verifyGlb accepts, so the happy path
+// has to hand back real magic bytes.
+const GLTF_MAGIC = new TextEncoder().encode('glTF');
+
+function stubForge(submitBody, { submitStatus = 200 } = {}) {
+ const calls = [];
+ globalThis.fetch = vi.fn(async (url, options = {}) => {
+ calls.push({ url: String(url), options });
+ if (String(url).endsWith('.glb')) {
+ return {
+ ok: true,
+ status: 200,
+ arrayBuffer: async () => GLTF_MAGIC.buffer,
+ json: async () => ({}),
+ };
+ }
+ return {
+ ok: submitStatus === 200,
+ status: submitStatus,
+ json: async () => submitBody,
+ };
+ });
+ return calls;
+}
+
+// ── 1. forge-smoke must actually generate ────────────────────────────────────
+
+test('the smoke submit asks the forge to bypass its result cache', async () => {
+ const calls = stubForge({
+ status: 'done',
+ job_id: null,
+ glb_url: 'https://cdn.example/forge/probe.glb',
+ });
+
+ const result = await runGeneration('https://three.ws');
+
+ expect(result.ok).toBe(true);
+ const submit = calls.find((c) => c.url === 'https://three.ws/api/forge');
+ expect(JSON.parse(submit.options.body)).toMatchObject({ tier: 'draft', force_regenerate: true });
+});
+
+// The regression itself: a cached response satisfied every later check, because
+// a cache hit carries a real, fetchable, glTF-magic GLB.
+test('a cached forge response fails the smoke instead of passing on a replay', async () => {
+ stubForge({
+ status: 'done',
+ job_id: null,
+ cached: true,
+ cached_at: '2026-08-05T00:00:00.000Z',
+ glb_url: 'https://cdn.example/forge/probe.glb',
+ });
+
+ const result = await runGeneration('https://three.ws');
+
+ expect(result.ok).toBe(false);
+ expect(result.reason).toMatch(/result cache/i);
+});
+
+test('a forge submit that errors is still reported by status, not by exception', async () => {
+ stubForge({ error: 'backend_down', error_description: 'no lane available' }, { submitStatus: 503 });
+
+ const result = await runGeneration('https://three.ws');
+
+ expect(result.ok).toBe(false);
+ expect(result.reason).toContain('503');
+});
+
+// ── 2. forge-seed-cron gate faults retry, then stop ──────────────────────────
+
+test('the first gate fault retries rather than burying the mesh', () => {
+ expect(gateFaultOutcome(0)).toEqual({ attempt: 1, terminal: false });
+ expect(gateFaultOutcome(null)).toEqual({ attempt: 1, terminal: false });
+ expect(gateFaultOutcome(undefined)).toEqual({ attempt: 1, terminal: false });
+ expect(gateFaultOutcome(1)).toEqual({ attempt: 2, terminal: false });
+});
+
+test('a mesh that keeps failing the gate reaches a terminal state', () => {
+ expect(gateFaultOutcome(2)).toEqual({ attempt: 3, terminal: true });
+ // Past the ceiling stays terminal: a row that somehow banked more attempts
+ // must not fall back into the retry branch and occupy a gate slot forever.
+ expect(gateFaultOutcome(9).terminal).toBe(true);
+});
+
+// ── 3. gpu-keepwarm lane selection ───────────────────────────────────────────
+
+test('no override warms exactly the lanes that contend with nothing', () => {
+ const { lanes, unknown, source } = resolveKeepwarmLanes(undefined);
+ expect(source).toBe('default');
+ expect(unknown).toEqual([]);
+ expect(lanes.map((l) => l.id)).toEqual(KEEPWARM_LANES.filter((l) => l.safeByDefault).map((l) => l.id));
+ expect(lanes.length).toBeGreaterThan(0);
+});
+
+test('an override selects the named lanes, quota-contended ones included', () => {
+ const { lanes, unknown, source } = resolveKeepwarmLanes(' triposg , text2motion ');
+ expect(source).toBe('override');
+ expect(unknown).toEqual([]);
+ expect(new Set(lanes.map((l) => l.id))).toEqual(new Set(['triposg', 'text2motion']));
+});
+
+test('a typo in the override is reported, not silently dropped', () => {
+ const { lanes, unknown } = resolveKeepwarmLanes('text2moton,triposg');
+ expect(unknown).toEqual(['text2moton']);
+ expect(lanes.map((l) => l.id)).toEqual(['triposg']);
+});
+
+test('an override of nothing but typos leaves no lane warm and says so', () => {
+ const { lanes, unknown } = resolveKeepwarmLanes('nope,alsonope');
+ expect(lanes).toEqual([]);
+ expect(unknown).toEqual(['nope', 'alsonope']);
+});