Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.
JavaScript 3d-generationai-agentsanimationavatardigital-humangenerative-aiglbgltfimage-to-3dllmmcpmcp-servermodel-context-protocolsolanatext-to-3dthreejsweb-componentswebglwebxrx402
docs(changelog): refresh forge, character studio, fee and ops docs and regenerate the changelog and public pages
nirholas1919274a796b
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex cbc429c59..771b15b5c 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -14,6 +14,7 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr- **GET /api/pump-bounties and its stats/detail routes serve last-known-good data instead of a 502**: pump.fun's Cloudflare anti-bot challenge has been rejecting livestream-api.pump.fun's bounty API for hours at a time, which left the bounty list, the aggregate stats, and individual bounty detail pages 502ing for every visitor even though the board itself had not changed. All three routes now go through the same last-known-good cache tier already proven on /api/portal and /api/crypto/bonding: a fresh answer is mirrored into a 24-hour backup, and that backup answers (flagged with an x-pump-stale header) instead of a 502 once the live fetch fails. A true miss, with nothing cached at all, still returns the original pump.fun error unchanged. (`/bounties`) `[fix]`- **Image-to-3D Forge instances recycle before a VRAM leak crashes a job**: The trellis lane's GPU worker already restarted itself between jobs once host memory ratcheted up, but had no equivalent check for GPU memory: a rasterizer dependency allocates outside torch's own memory pool, so an instance's usable VRAM only ever shrank, and the instance's own health check kept passing right up until a job crashed or Cloud Run killed it mid-generation. The worker now also tracks GPU memory after every job and restarts cleanly between jobs once it has ratcheted far enough, the same way the existing memory guard already does, so Forge image-to-3D jobs on this lane fail or stall less often. (`/image-to-3d`) `[fix]`- **Object-storage outages now answer a clean 503 with Retry-After instead of a raw 500**: When the R2 bucket is unreachable (account disabled, keys rotated, endpoint down), any API route that writes or reads an object without its own error handling, such as avatar upload, used to answer a bare 500 and fire a Sentry event and an unhandled-5xx alert on every request. The shared error boundary now treats a storage fault like a database outage: a 503 service_unavailable with Retry-After, one throttled warning, a single deduped ops alert, and a clean skip for cron ticks. Deliberate 4xx errors and real handler bugs are unchanged. (`/docs/api-reference`) `[fix]`+- **Rate limiter Redis path repaired and its health hint made honest**: The rate limiter had been failing every Redis call because @upstash/ratelimit 2.1+ sends a script flag that self-hosted Redis rejects, so traffic ran on the Postgres fallback while healthz called it transient. The library is pinned to 2.0.8, and this class of fault is now logged and reported as a non-transient script incompatibility. `[fix]`- **Security hardening across sign-in, uploads, vaults, agents and the chat server**: A source audit led to fixes in many places. Agent updates only link avatars you own, and unpublished agents stay hidden from ask. Handoff, Telegram and SAML sign-ins are bound to the flow that started them, and the walk-avatar extension only accepts a token for a sign-in it began. Vault deposits that would mint zero shares are refunded, and strategy buys reserve against the daily SOL cap atomically. Oracle follow and test alerts need a linked Telegram chat, shown read-only in the panels. Anonymous uploads are size-checked hourly. The local chat server binds loopback and requires a token, and webhook retries re-run after a failed delivery. (`/oracle`) `[fix]`## 2026-10-24diff --git a/data/changelog.json b/data/changelog.jsonindex de82083e7..628aa7ec5 100644--- a/data/changelog.json+++ b/data/changelog.json@@ -1,6 +1,22 @@{"$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, desktop (desktop entries become the desktop app's release notes). `link` is optional and must be a live three.ws path.","entries": [+ {+ "date": "2026-10-25",+ "title": "Rate limiter Redis path repaired and its health hint made honest",+ "summary": "The rate limiter had been failing every Redis call because @upstash/ratelimit 2.1+ sends a script flag that self-hosted Redis rejects, so traffic ran on the Postgres fallback while healthz called it transient. The library is pinned to 2.0.8, and this class of fault is now logged and reported as a non-transient script incompatibility.",+ "tags": [+ "fix"+ ]+ },+ {+ "date": "2026-10-25",+ "title": "Allowance pulls now require the signed real-funds agreement",+ "summary": "Pulling funds through an owner-funded on-chain allowance now checks the signed real-funds agreements before the agent key is used, matching every other custodial signing path. Unsigned accounts get the standard agreement-required refusal and nothing is sent.",+ "tags": [+ "fix"+ ]+ },{"date": "2026-10-25","title": "Commit feed cron skips quietly on a lock-check fault",@@ -13,7 +29,9 @@"date": "2026-10-25","title": "Object-storage outages now answer a clean 503 with Retry-After instead of a raw 500","summary": "When the R2 bucket is unreachable (account disabled, keys rotated, endpoint down), any API route that writes or reads an object without its own error handling, such as avatar upload, used to answer a bare 500 and fire a Sentry event and an unhandled-5xx alert on every request. The shared error boundary now treats a storage fault like a database outage: a 503 service_unavailable with Retry-After, one throttled warning, a single deduped ops alert, and a clean skip for cron ticks. Deliberate 4xx errors and real handler bugs are unchanged.",- "tags": ["fix"],+ "tags": [+ "fix"+ ],"link": "/docs/api-reference"},{diff --git a/docs/3d-api.md b/docs/3d-api.mdindex 37ab2f36b..89efa9297 100644--- a/docs/3d-api.md+++ b/docs/3d-api.md@@ -41,9 +41,12 @@ curl https://three.ws/api/3d"version": "1.0.0","endpoints": [{ "slug": "generate", "methods": ["POST"], "path": "/api/3d/generate", "title": "Text → 3D (free draft)", "…": "…" },- { "slug": "inspect", "methods": ["GET", "POST"], "path": "/api/3d/inspect", "title": "3D Model Inspect & Validate", "…": "…" }+ { "slug": "inspect", "methods": ["GET", "POST"], "path": "/api/3d/inspect", "title": "3D Model Inspect & Validate", "…": "…" },+ { "slug": "diff", "methods": ["GET", "POST"], "path": "/api/3d/diff", "title": "3D Model Diff", "…": "…" },+ { "slug": "print-quote", "methods": ["POST"], "path": "/api/print/quote", "title": "Printability Report & Print Quote", "…": "…" },+ { "slug": "print-prepare", "methods": ["POST"], "path": "/api/print/prepare", "title": "Repair & Export for Printing (STL, 3MF, GLB)", "…": "…" }],- "count": 2,+ "count": 5,"paidTiers": [{ "name": "Forge Pro", "path": "/api/x402/forge", "price": "from $0.05 USDC", "why": "…" },{ "name": "Rigged Avatar", "path": "/api/forge?action=rig", "price": "from $0.05 USDC", "why": "…" }@@ -269,7 +272,9 @@ Returns one of four verdicts (`simulation_ready`, `needs_scale`,winding, real-world extents in meters, exact volume, centroid and inertia tensorat unit density, and how well a single convex hull approximates the shape. Free,no account, cached by content hash, and available to agents as the-`grade_sim_readiness` MCP tool. Full reference: [Simulation+`grade_sim_readiness` MCP tool. Grading by `?src=` is capped at 30 per five+minutes per address (the `429` carries `Retry-After`); `?hash=` lookups of an+already-graded model are not capped, so grade once and reuse hashes. Full reference: [Simulationreadiness](/docs/sim-readiness).### Upgrade path@@ -295,7 +300,11 @@ generation: the single subject and its silhouette, its construction and partjoins, per-part PBR material cues, one held art style, fine surface detail,and composition constraints tuned for clean image→mesh reconstruction(centered, isolated, no text, no collage). It is fail-soft: if the director-LLM is unavailable, the raw prompt proceeds untouched. The prompt specs live in one+LLM is unavailable, or its reply fails the safety check (empty, over the+1000-character prompt ceiling, unfinished, carrying a link, or no richer than+what you typed), the raw prompt proceeds untouched and the run receipt names+the reason. The director is asked to stay under 90 words so a spec fits the+ceiling. The prompt specs live in onemodule, [api/_lib/forge-director-prompts.js](../api/_lib/forge-director-prompts.js)(`MESH_DIRECTOR` for objects and props, `AVATAR_DIRECTOR` for rig-readyhumanoids), so the free and paid lanes cannot drift apart.@@ -552,6 +561,33 @@ mesh-optimization routes. See---+## Diff two models (free)++**`GET /api/3d/diff?a=<url>&b=<url>`** or **`POST /api/3d/diff`** with+`{ "a": "<url>", "b": "<url>", "format": "json" }`. Compares a baseline and a+candidate glTF/GLB (public https URLs, 32 MiB each) and reports what changed in+geometry, hierarchy, materials, textures, skeletons and animation clips, with+rename and move detection. The JSON carries a top-level `severity`+(`none`, `cosmetic`, `minor`, `major`, `breaking`) to gate a build on;+`format=markdown` returns a pull-request-ready report and `format=text` a+terminal report. The engine is the `@three-ws/glb-diff` package, the same code+the `/diff` page runs.++```bash+curl "https://three.ws/api/3d/diff?a=https://three.ws/avatars/cesium-man.glb&b=https://three.ws/avatars/cesium-man.glb&format=text"+```++## Printing (free)++Two further catalog entries turn a model into a physical object.+`POST /api/print/quote` returns a printability report (closed solid, wall+thickness, volume, a 0-100 score) and, when you pass a `materialId`, an+itemized quote with a signed token. `POST /api/print/prepare` repairs the mesh+and writes an STL, a 3MF and the repaired GLB. Both are free and keyless;+ordering is paid. See [Materialize](/docs/materialize).++---+## Related- [Cookbook](/cookbook) - runnable recipes built on these endpoints: a command-line client,diff --git a/docs/agent-abilities/chapters/04-the-mind.md b/docs/agent-abilities/chapters/04-the-mind.mdindex f82d02368..8c93de879 100644--- a/docs/agent-abilities/chapters/04-the-mind.md+++ b/docs/agent-abilities/chapters/04-the-mind.md@@ -16,7 +16,7 @@ The agent reads its own high-salience memories and recent reflections and turnsNothing is granted by default: the agent can propose but not act until the owner opts in per capability (create_alert, briefing, wallet_transfer). Reversible actions can be flipped to auto-run without asking; SOL transfers are irreversible, always confirmation-gated, and bounded by a daily SOL spend cap. The agent never sells or sends $THREE — it only accumulates and burns it.-**How it works:** Scopes live on agent_identities.meta.autopilot (AUTOPILOT_DEFAULTS in api/_lib/autopilot.js: all scopes false, daily_spend_sol 0, require_confirm true) and are enforced server-side on every execute, including a live SOL balance read before any transfer (through the shared RPC failover lanes behind SOLANA_RPC_URL, so one provider's outage never blanks the check) that refuses with insufficient_funds when the wallet cannot cover the amount. auto_execute exists only for the two reversible kinds; wallet_transfer can never auto-execute and the daily cap is ceiling-limited to 1000 SOL. Executing a wallet_transfer also requires the owner's signed real-funds agreements (403 risk_ack_required otherwise), and an API key or OAuth token driving /api/autopilot/proposals (or the other money routes this chapter names: the sniper strategy, the market maker, agent hiring) must hold the wallet:write scope or is refused with 403 insufficient_scope.+**How it works:** Scopes live on agent_identities.meta.autopilot (AUTOPILOT_DEFAULTS in api/_lib/autopilot.js: all scopes false, daily_spend_sol 0, require_confirm true) and are enforced server-side on every execute, including a live SOL balance read before any transfer (through the shared RPC failover lanes behind SOLANA_RPC_URL, so one provider's outage never blanks the check) that refuses with insufficient_funds when the wallet cannot cover the amount. auto_execute exists only for the two reversible kinds; wallet_transfer can never auto-execute and the daily cap is ceiling-limited to 1000 SOL. Executing a wallet_transfer also requires the owner's signed real-funds agreements (403 risk_ack_required otherwise), a wallet_transfer recipient must also pass the agent's destination allowlist (403 with the allowlist's own code otherwise), and an API key or OAuth token driving the money routes this chapter names is refused with 403 insufficient_scope unless it holds the scope for that grade of movement: wallet:trade for /api/autopilot/proposals and the sniper strategy, wallet:launch for the market-maker controls on /api/launch/mm, and wallet:write for the auto-launcher, the market-maker policy, the coin autopilot policy, team tasks, and agent hiring. wallet:write implies the other two.**Why it matters:** You decide exactly how much rope the agent gets, capability by capability — and a misconfigured or compromised client can't widen it because enforcement is server-side.@@ -72,7 +72,7 @@ The agent periodically reflects: it reads its recent raw memories and its signedAny external agent or MCP client can send a message to any three.ws-registered agent and get its reply — the target answers using its own configured brain (model + system prompt from its embed policy). Owners can opt an agent out of MCP delegation entirely.-**How it works:** Paid MCP tool ($0.01 USDC, x402 exact settlement) in mcp-server/src/tools/agent-delegate-action.js, calling POST /api/agents/talk. Agents with embed_policy surfaces.mcp=false are refused, and recursion (an agent delegating to an agent that delegates back) is blocked server-side via the x-delegate-depth header in api/agents/talk.js.+**How it works:** Paid MCP tool ($0.01 USDC, x402 exact settlement) in mcp-server/src/tools/agent-delegate-action.js, calling POST /api/agents/talk. Agents with embed_policy surfaces.mcp=false are refused, an unpublished agent answers 404 to everyone but its owner, and recursion (an agent delegating to an agent that delegates back) is blocked server-side via the x-delegate-depth header in api/agents/talk.js.**Why it matters:** Your agent becomes a composable service other agents can consult — and you keep the off switch and the brain settings.diff --git a/docs/aws-builder-center-claims-ledger.md b/docs/aws-builder-center-claims-ledger.mdindex 3eb370d57..560469b13 100644--- a/docs/aws-builder-center-claims-ledger.md+++ b/docs/aws-builder-center-claims-ledger.md@@ -231,7 +231,7 @@ export function modelRungs(request, env = process.env) {return [() => viaVertex(request),() => viaChatCompletions(request, { url: 'https://api.groq.com/openai/v1/chat/completions', key: env.GROQ_API_KEY, model: 'openai/gpt-oss-120b', label: 'groq', textOnly: true }),- () => viaChatCompletions(request, { url: 'https://openrouter.ai/api/v1/chat/completions', key: env.OPENROUTER_API_KEY, model: `anthropic/${EDITOR_MODEL}`, label: 'openrouter', extraHeaders: { 'http-referer': 'https://three.ws', 'x-title': 'three.ws editorial review' } }),+ () => viaChatCompletions(request, { url: 'https://openrouter.ai/api/v1/chat/completions', key: env.OPENROUTER_API_KEY, model: `anthropic/${EDITOR_MODEL}`, label: 'openrouter', extraHeaders: OPENROUTER_ATTRIBUTION_HEADERS }),() => viaChatCompletions(request, { url: 'https://api.openai.com/v1/chat/completions', key: env.OPENAI_API_KEY, model: 'gpt-5.5-pro', label: 'openai' }),() => viaChatCompletions(request, { url: 'https://integrate.api.nvidia.com/v1/chat/completions', key: env.NVIDIA_API_KEY, model: 'moonshotai/kimi-k3', label: 'nvidia', maxTokens: RUNG_MAX_TOKENS }),];@@ -334,7 +334,7 @@ export function jitterMinutes(id, windowMinutes, seed = null) {}```-The HMAC is stable per slot, so a preview, a retry and the real tick agree on the minute, while nobody without the seed can compute it. Without the seed it falls back to the public hash, which keeps tests deterministic, and the planning command says its minutes are placeholders. Which post fills a slot is decided when the slot opens, so a correct guess at the minute would not say which post goes out. The account has three slots a day, one per tier (flagship, feature, proof of work), plus a slot for long-form X Articles every second day.+The HMAC is stable per slot, so a preview, a retry and the real tick agree on the minute, while nobody without the seed can compute it. Without the seed it falls back to the public hash, which keeps tests deterministic, and the planning command says its minutes are placeholders. Which post fills a slot is decided when the slot opens, so a correct guess at the minute would not say which post goes out. The account has three slots a day, one per tier (flagship, feature, proof of work), plus a slot for long-form X Articles every second day. The flagship slot can also belong to a series: the queue gives it to a daily partner spotlight, and when no spotlight is ready it is the flagship slot as before.**Who approves** is [`api/_lib/x-content/approval.js`](https://github.com/nirholas/three.ws/blob/main/api/_lib/x-content/approval.js). In `owner` mode every post waits for a person. In `auto` mode a post is released without one only when all of these hold:@@ -345,7 +345,7 @@ The HMAC is stable per slot, so a preview, a retry and the real tick agree on th| It tags no one | A tag puts a partner's name next to ours, and a person decides that || The review passed on the editor's own verdict | An override is a person's judgment, so it needs a person |-X Articles have their own switch: long-form writing rarely has a reel to film, so the review stands in for it (every probe re-run, every link resolved, every sentence of the body held to the claims ledger), while the tag, verdict and proof rules still apply. A release by policy is never immediate: the post waits out a veto window (the code's default is 24 hours; the queue sets its own), the release is written to the ops alerts, and one command takes it back. Human attention goes to tags, flagship claims and disagreements with the editor, not to re-reading a filmed, verified, linted post.+A series has its own switch too (`approval.series`): a partner spotlight is flagship because it names a partner, so the tier rule alone would hold every one. What stands in for the owner's eye is a series lint that requires the partner's designation exactly as its registry entry gives it and bans any phrase that overstates the relationship, while the filmed, no-tag and editor-verdict conditions still apply. X Articles have their own switch: long-form writing rarely has a reel to film, so the review stands in for it (every probe re-run, every link resolved, every sentence of the body held to the claims ledger), while the tag, verdict and proof rules still apply. A release by policy is never immediate: the post waits out a veto window (the code's default is 24 hours; the queue sets its own), the release is written to the ops alerts, and one command takes it back. Human attention goes to tags, flagship claims and disagreements with the editor, not to re-reading a filmed, verified, linted post.## 12. The learning loop, and the limits of what it learned@@ -363,6 +363,8 @@ The guard rails are the part to copy. A post counts once it is 48 hours old, becA second model ranks by a different measured outcome: [`data/x-content/volume-model.json`](https://github.com/nirholas/three.ws/blob/main/data/x-content/volume-model.json) is a logistic regression fitted on 313 post moments, 54 of which were followed by a volume response on the $THREE pool. Read honestly, it is weak evidence: of its 9 features, only three (announcing a shipped thing, posting inside US working hours, posting from the company account) have confidence intervals that exclude no effect. It also rewards the word "introducing", which the voice lint bans as an opener. The lint wins, because it is a blocker and the model is a ranking term.+The outcomes record can also carry a measured price return for each post ([`price-impact.js`](https://github.com/nirholas/three.ws/blob/main/api/_lib/x-content/price-impact.js)), which feeds a second set of lifts once 20 matured posts have one.+The boundary that matters: no deterministic check reads any of this. The learned lifts and the volume model change which ready post fills a slot, and the best-measured posts are what the editor sees as calibration. A learned preference can reorder true posts; it cannot make a false one publishable.## 13. What we would build differentlydiff --git a/docs/btn-pill-migration.md b/docs/btn-pill-migration.mdindex 1b8e4258c..2ac5baddf 100644--- a/docs/btn-pill-migration.md+++ b/docs/btn-pill-migration.md@@ -56,7 +56,7 @@ Linked pills: use `<a class="pill pill--onchain">` — gets hover/focus states a## Remaining long tail — classes → canonical equivalent-These classes are defined across the codebase. Follow-up agents should replace them with canonical classes (keep old class as needed for scoped CSS overrides). Re-verified 2026-09-17: every class in both tables below is still in use in `pages/`, `src/`, or `public/`, so every row remains open work.+These classes are defined across the codebase. Follow-up agents should replace them with canonical classes (keep old class as needed for scoped CSS overrides). Re-verified 2026-10-25: every class in both tables below is still in use in `pages/`, `src/`, or `public/`, so every row remains open work.### Button class names → canonicaldiff --git a/docs/character-studio.md b/docs/character-studio.mdindex ce8905d81..632e9c87f 100644--- a/docs/character-studio.md+++ b/docs/character-studio.md@@ -191,7 +191,7 @@ purchase or equip:- **Shop** (`src/game/cosmetics-shop.js`) — browse the real catalog(`/api/cosmetics/catalog`), preview any item live on your avatar, and buy premium pieces- with real USDC via x402 (`cosmetics-purchase.js` → `/api/x402/cosmetic-purchase`). Ownership+ with real USDC via x402 on Solana or Base, Solana listed first (`cosmetics-purchase.js` → `/api/x402/cosmetic-purchase`). Ownershipis recorded server-side (`api/_lib/cosmetics-ownership.js`) and validated by`multiplayer/src/economy.js`. Premium cosmetics are intentionally billed in USDC/`$THREE`,kept separate from the in-world cash economy (`multiplayer/src/shop.js`) — cash buys tools@@ -205,7 +205,8 @@ purchase or equip:### The public ledger: `/fits`Every premium purchase settles USDC and splits revenue with the creator of the coin world the-fit belongs to, all of it recorded in the settled-sale ledger+fit belongs to (the creator's cut is always a share of the item's USDC list price, whichever+asset the buyer paid in), all of it recorded in the settled-sale ledger(`api/_lib/cosmetics-economy.js`). That ledger has a public page at[`/fits`](https://three.ws/fits) (`pages/fits.html` + `src/fits.js`, pure helpers in`src/fits-lib.js`), so the economy is readable without entering a world:diff --git a/docs/copy-trading.md b/docs/copy-trading.mdindex f1dad0796..7333cbf84 100644--- a/docs/copy-trading.md+++ b/docs/copy-trading.md@@ -13,6 +13,8 @@ If you want to feel a leader's edge before committing money, that is a *separateA leader can also price *when* each copier is shown their signal: [alpha-drip](./alpha-drip.md) releases the copy intent to higher $THREE tiers first and everyone else after a delay the leader sets. It is off unless a leader turns it on, it delays the reveal and never the record, and the copier is shown the seat they get before they subscribe.+Two more surfaces sit on the copier path: [Copy Coach](./copy-coach.md) walks a first-time copier to one tiny, capped copy they sign themselves, and [syndicates](./syndicates.md) let a named team of copiers follow a leader together, each member through an ordinary subscription with their own wallet and caps (no pooled funds).+Related reading: [Smart Money Radar](./smart-money.md) for the first-party wallet reputation graph, [the trading surfaces](./trading-surfaces.md) for the screeners and the trading cockpit these leaders trade from, [agent wallets](./agent-wallets.md) for the custody and spend-policy model, and [signal marketplace](./signals.md) for the paid-feed variant that reuses the same guarded executor.---@@ -261,7 +263,7 @@ Validated by `normalizeSubscriptionInput` in `api/_lib/copy-engine.js`. `per_tra### Who you are allowed to copy-Two gates run before a subscription is written, both in `api/_lib/copy-eligibility.js`. Neither is a taste filter: they exist because a copy-trading board is worthless the moment a track record can be manufactured or a fee can be paid to yourself.+Two gates run before a subscription is written, both in `api/_lib/copy-eligibility.js` and enforced through the shared `subscribeCopier` in `api/_lib/copy-subscribe.js` (the same path a syndicate join uses). Neither is a taste filter: they exist because a copy-trading board is worthless the moment a track record can be manufactured or a fee can be paid to yourself.**You cannot copy an agent you own.** A self-copy routes the performance fee back to its own owner while inflating that leader's public copier count, copied volume, and the "earned X for being copied" figure the leaderboard shows as social proof. The endpoint answers `403 self_copy`, and `api/cron/copy-fanout.js` skips any such row again at fan-out time so a subscription predating this rule cannot keep firing. The custodial mirror has always refused the equivalent (an agent may not mirror itself, and may not close a follow loop).@@ -296,7 +298,7 @@ Leave `max_drawdown_pct` null to opt out; that is the behavior every subscriptioFor every (leader event, subscription) pair it calls `planCopyOrder`, the pure engine in `api/_lib/copy-engine.js` (tested in `tests/copy-engine.test.js`):-- **Safety gate on entries only.** A honeypot flag is fatal. Market cap is checked against your floor and ceiling. A dev holding 30 percent or more of supply is refused as `dev_heavy`. Liquidity under 1000 USD is refused as `low_liquidity`. A known Oracle conviction score below your `min_oracle_score` is refused. If coin context could not be fetched at all, the result depends on your `require_safety_pass` flag: with it on, the copy is skipped as `safety_unknown`. Coin context is best-effort from the public pump.fun coin endpoint (market cap) merged with the stored Oracle score.+- **Safety gate on entries only.** A honeypot flag is fatal. Market cap is checked against your floor and ceiling. A dev holding 30 percent or more of supply is refused as `dev_heavy`. Liquidity under 1000 USD is refused as `low_liquidity`. A leader whose own trading wallet scores as the same controller as the coin's creator (a shared fee payer or first funder, scored by `@three-ws/wallet-linkage` at the "strong" band or above) is refused as `leader_linked_to_creator`, because copying it would only mirror the creator's own buy of their own launch. That check runs once per leader and coin per tick (`checkLeaderCreatorLinkage` in `api/_lib/copy-eligibility.js`) and fails open to "not linked" on any RPC or database error, so an outage never blocks a legitimate copy. A known Oracle conviction score below your `min_oracle_score` is refused. If coin context could not be fetched at all, the result depends on your `require_safety_pass` flag: with it on, the copy is skipped as `safety_unknown`. Coin context is best-effort from the public pump.fun coin endpoint (market cap) merged with the stored Oracle score.- **Open-copy cap.** More pending intents than `max_open_copies`, skipped.- **Sizing.** `fixed` uses `fixed_sol`, `multiplier` scales the leader's entry, `pct_balance` takes a percentage of your balance. The result is clamped to `per_trade_cap_sol`, then to the remaining `daily_budget_sol` (today's `pending` plus `acted` buy sizes), and rejected if it falls under `min_order_sol`.- **Exits.** A sell fans out with `order_sol: 0` and reason `mirror_exit`, and only to copiers who actually acted on the matching buy. Oracle sells are not modelled, because that engine has no explicit exit event.diff --git a/docs/fact-check.md b/docs/fact-check.mdindex 49868a80c..f45177654 100644--- a/docs/fact-check.md+++ b/docs/fact-check.md@@ -1,6 +1,6 @@# Fact Check: sourced verdicts with cryptographic attestations-Fact Check submits a claim and returns a verdict, `supported`, `contradicted`, `mixed`, or `insufficient`, backed by live web search and LLM stance analysis, cited sources, a confidence score, and a SHA-256 attestation over the result you can recompute. It ships with a published, checkable accuracy benchmark instead of an asserted quality number, and a live free-check box on the page. The first 3 checks a day per IP run the exact same real chain for free; after that it is $0.10 USDC per check via x402 on Base or Solana. No account, no API key.+Fact Check submits a claim and returns a verdict, `supported`, `contradicted`, `mixed`, or `insufficient`, backed by live web search and LLM stance analysis, cited sources, a confidence score, and a SHA-256 attestation over the result you can recompute. It ships with a published, checkable accuracy benchmark instead of an asserted quality number, and a live free-check box on the page. The first 3 checks a day per IP run the exact same real chain for free; after that it is $0.10 USDC per check via x402 on Solana or Base. No account, no API key.Page: [/fact-check](https://three.ws/fact-check)@@ -17,7 +17,7 @@ The page (`src/fact-check.js`) hydrates three cards: the accuracy benchmark, a "The request routing:- A `POST` with a valid `claim` and free quota remaining runs the real chain and returns `200` with `lane: "free"` and `free_remaining_today`.-- Once the free quota is exhausted, or if a payment header is present, the request falls through to the x402 rail: a `402` challenge for $0.10 USDC (100,000 atomics), payable on Base or Solana, and a paid run returns `lane: "paid"`.+- Once the free quota is exhausted, or if a payment header is present, the request falls through to the x402 rail: a `402` challenge for $0.10 USDC (100,000 atomics), payable on Solana (listed first) or Base, and a paid run returns `lane: "paid"`.- Malformed JSON or a present-but-invalid claim returns a hard `400`; a body with no `claim` at all falls through to a valid 402 so discovery probes get a proper challenge.The fact-check pipeline (`runFactCheck`):@@ -95,7 +95,7 @@ The response's `source` field says which one answered (`database` or `image`).### Scheduled re-run-`/api/cron/fact-check-benchmark` runs the suite weekly (Mondays 04:41 UTC, see `vercel.json`) in-process on Cloud Run, against the real chain with the Redis verdict cache disabled, and publishes to the DB. No credential is needed for this path: it calls the chain directly, below the x402 payment layer. Tune with `FACT_CHECK_BENCHMARK_CONCURRENCY` (default 6) and `FACT_CHECK_BENCHMARK_DEADLINE_MS` (default 240000, kept under Cloud Scheduler's 320s attempt deadline).+`/api/cron/fact-check-benchmark` runs the suite weekly (Mondays 04:41 UTC, see `vercel.json`) in-process on Cloud Run, against the real chain with the Redis verdict cache disabled, and publishes to the DB. No credential is needed for this path: it calls the chain directly, below the x402 payment layer. Tune with `FACT_CHECK_BENCHMARK_CONCURRENCY` (default 6) and `FACT_CHECK_BENCHMARK_DEADLINE_MS` (default 240000, kept under Cloud Scheduler's 320s attempt deadline). The handler declares `maxDuration = 300` and passes it to `wrapCron` as `maxDurationMs`, so the cron answers its own clean 503 at 300s instead of `wrapCron`'s 120s default.### Running it by hand@@ -121,6 +121,8 @@ The runner's HTTP path calls the paid endpoint 40 times, which the 3-per-day freUse `--update-env-vars` (merges), never `--set-env-vars` (replaces the whole set). Every bypassed call is logged to `x402_access_log` with caller `internal`.- **`FACT_CHECK_BYPASS_TOKEN`**, an OAuth bearer carrying the `x402:bypass` scope, sent as `Authorization: Bearer`. Use this when you want a scoped, per-user credential rather than the service key.+A self-serve Premium pass key does not bypass this route: pass keys are scoped to `PREMIUM_PASS_ROUTES` (the archive search) and fall through to the normal 402 here.+With neither, the runner exits before spending a run and writes nothing.### Why a run can be refused@@ -134,7 +136,7 @@ Two guards keep a bad run from becoming a published number:## States and limits- **Free quota.** 3 checks per day per IP, running the identical real chain (`lane: "free"`). The limiter is critical: a cache or limiter outage fails closed to the paid rail rather than opening unlimited free checks.-- **Paid lane.** $0.10 USDC (100,000 atomics) per check, on Base or Solana, discoverable in the x402 bazaar. Quota exhaustion or a payment header routes here.+- **Paid lane.** $0.10 USDC (100,000 atomics) per check, on Solana or Base (Solana first in the 402), discoverable in the x402 bazaar. Quota exhaustion or a payment header routes here.- **Input validation.** Claim 5 to 1000 characters (else `400`), strictness one of `high`, `medium`, `low` (default `medium`), and an optional image URL that must be http(s) and under 2048 characters.- **Errors.** No search results returns `422 no_results`; a search failure `502 search_failed`; a provider failure `502 provider_error`; malformed JSON `400`; an oversized body `413`.- **Honest benchmark.** The score shown is whatever the runner last measured against the real chain, or a "not yet run" empty state. Because production currently runs on keyless search fallbacks, decisive verdicts are harder to reach, which the published benchmark reflects rather than hides.diff --git a/docs/forge-pipeline.md b/docs/forge-pipeline.mdindex 469a0a089..c074c26ad 100644--- a/docs/forge-pipeline.md+++ b/docs/forge-pipeline.md@@ -51,6 +51,11 @@ Three properties define the design:| Forge Studio | [/forge-studio](https://three.ws/forge-studio), `src/forge-studio/` | Create, refine, stylize, Game-Ready export, remix. || Core API | `POST /api/forge` (`api/forge.js`) | The orchestrator. Auth-free. Text, image, and sketch bodies. || Job poll | `GET /api/forge?job=<id>` | Free to poll regardless of how the job was paid for. |+| Cost preview | `GET /api/forge-quote` (`api/forge-quote.js`) | Public, spend-free price for a `(path, tier, backend, options)` combination, or `?table=1` for all three tiers. Reads the same tables the generation endpoint enforces, so a quote cannot drift from the charge. |+| Pay-to-keep | `GET/POST /api/forge-keep` (`api/forge-keep.js`) | Off unless `FORGE_PAY_TO_KEEP=on` (flip with `npm run forge:pay-to-keep -- on\|off\|status`). When on, generating and previewing on a free lane stays free and the original file is released once per creation to a $THREE holder or against one settled $THREE payment; with it off every generation is keepable. |+| Image to splat | `POST/GET /api/forge-splat` (`api/forge-splat.js`) | TripoSplat: one public https image to a 3D Gaussian splat (`num_gaussians` 8192 to 262144), opened in the Splat Viewer. 503 `unconfigured` until `MODEL_TRIPOSPLAT_URL` is set. |+| Photo to scene | `POST/GET /api/forge-scene-objects` (`api/forge-scene-objects.js`) | SAM 3D Objects: one photo to a scene GLB with one named node per object, laid out like the photo. 503 `backend_unconfigured` until `MODEL_SAM3D_URL` points at a deployed worker (32 GB+ GPU, gated weights). |+| Tripo webhook | `POST /api/forge/webhook/tripo` (`api/forge/webhook/tripo.js`) | Optional fast-completion path for Tripo jobs: HMAC-signed (`TRIPO_WEBHOOK_SECRET`, 5 minute replay window) and idempotent per delivery (`forge_webhook_deliveries`). Polling stays the fallback. || Catalog | `GET /api/forge?catalog=1` | The tier/backend/cost matrix the UI renders. || Health | `GET /api/forge?health=1` | Live per-lane upstream status. || Rig | `POST /api/forge?action=rig` | Auto-rig a finished GLB (see post-processing). |@@ -100,16 +105,21 @@ Self-hosted TRELLIS additionally maps tiers to sampler and texture budgets via `| `hunyuan3d` | Tencent Hunyuan3D-2.1 | Our Cloud Run L4 worker (`workers/model-hunyuan3d/`) | image | free (our GPU) | `GCP_HUNYUAN3D_URL` + key || `modly` | VAST AI TripoSG via Modly (MIT, untextured geometry) | Our Cloud Run L4 worker (`workers/modly/`) | image (single photo) | free (our GPU) | `MODEL_MODLY_URL` + `GCP_RECONSTRUCTION_KEY` || `modly_hunyuan` | Tencent Hunyuan3D 2 Mini Turbo via Modly (untextured geometry) | Same worker as `modly` | image (single photo) | free (our GPU) | `MODEL_MODLY_URL` + `GCP_RECONSTRUCTION_KEY` |+| `pixal3d` | TencentARC Pixal3D ("Match my photo", MIT) | Our Cloud Run worker (`workers/model-pixal3d/`) | image (1 to 4 labeled photos fused pixel-aligned; opt-in only) | free (our GPU) | `MODEL_PIXAL3D_URL` + `GCP_RECONSTRUCTION_KEY` |+| `anigen` | VAST AI AniGen (MIT) | Our Cloud Run worker (`workers/model-anigen/`) | image (mesh, skeleton and skin weights in one pass, already rigged) | free (our GPU) | `MODEL_ANIGEN_URL` + `GCP_RECONSTRUCTION_KEY` |+| `partcrafter` | PartCrafter (MIT) | Our Cloud Run worker (`workers/model-partcrafter/`) | image (2 to 16 named part meshes) | free (our GPU) | `MODEL_PARTCRAFTER_URL` + `GCP_RECONSTRUCTION_KEY` || `triposg` | VAST AI TripoSG-scribble | Our Cloud Run L4 worker (`workers/model-triposg/`) | sketch only | free (our GPU) | `GCP_TRIPOSG_URL` + key || `trellis` | Microsoft TRELLIS | Replicate | image | paid platform, last resort | `REPLICATE_API_TOKEN` || `meshy` | Meshy 6 | vendor API | geometry, image | BYOK, credits | user key |-| `tripo` | Tripo v3.1 | vendor API | geometry, image | BYOK | user key |+| `tripo` | Tripo v3.1 | vendor API | geometry, image | BYOK, or house lane when `TRIPO_API_KEY` is set | user key, or `TRIPO_API_KEY` || `rodin` | Rodin (Hyper3D) | vendor API | geometry, image | BYOK | user key || `stability` | Stable Fast 3D | vendor API | image, synchronous | BYOK | user key || `replicate_byok` | Replicate models | caller's Replicate account | image | BYOK | user key |The two Modly lanes run [Modly](https://github.com/lightningpixel/modly)'s backend headless on one worker (`workers/modly/README.md`): TripoSG and Hunyuan3D 2 Mini Turbo through Modly's own extensions, then a mesh repair pass and a decimate to the tier's face budget (`target_polycount`). They return geometry without textures, so they rank below every textured free lane and are meant as an explicit pick, or for retexture and stylize afterwards.+`pixal3d`, `anigen` and `partcrafter` are opt-in lanes: none is a named default or a failover target, so a plain request never lands on one by chance. TripoSplat (`/api/forge-splat`) and SAM 3D Objects (`/api/forge-scene-objects`) are not `BACKENDS` entries at all: they are standalone endpoints over the same `gcp` provider (modes `triposplat` and `sam3d`), because their outputs (a splat, a multi-object scene) are not a single mesh.+Two lanes deserve a warning. `hunyuan3d` must point at the general Hunyuan3D worker URL, never at the avatar-pipeline controller: the controller fronts a face pipeline and rejects general object images. And `nvidia` is text-only; every routing list that might carry a user photo filters it out.## 4. Routing: free-first, subject-aware, health-tempered@@ -120,7 +130,10 @@ Routing answers one question: given `(path, tier, userImages, prompt)`, which co1. The tier's named free default (`FREE_DEFAULT_FOR_TIERS`): every image tier (draft, standard, high) names `trellis2`, the only default lane that serves every region. Hunyuan3D is no longer a named default; it is an explicit lane and a fallback outside the restricted territories (see Territory enforcement below). The unconfigured case matters: until `MODEL_TRELLIS2_URL` is set the lane is skipped and the chain behind it serves the request. The workers are our own GPUs; NVIDIA NIM is no longer a named default (its text-only, no-reference-image conditioning is the realism hole this table closes) but stays explicitly selectable and remains the final fallthrough in the per-path chain.2. The per-path free fallback chain (`FREE_FALLBACK_FOR_PATH`). For `image` that is `trellis2`, `trellis_selfhost`, `hunyuan3d`, `huggingface`, `modly`, `modly_hunyuan`, `nvidia`: our own textured GPU workers first (zero vendor cost), then external free lanes, then the untextured Modly lanes, with the text-only NIM lane trailing as a safety net.-3. The paid platform default (`DEFAULT_BACKEND_FOR_PATH`: image → `trellis` on Replicate, geometry → `meshy`, sketch → `triposg`) only when nothing free is configured and healthy.+3. A configured house-key lane (`houseDefaultForPath()`): on the High tier only, when `TRIPO_API_KEY` is set, Tripo becomes the default geometry engine and bills through the same $THREE hold-or-pay gate as every platform lane. A caller's own inline or saved Tripo key still takes precedence and runs exempt. Draft and standard are untouched, and with the env var unset behavior is unchanged. The catalog reports `house_key_available` so the picker can offer it without a key prompt.+4. The paid platform default (`DEFAULT_BACKEND_FOR_PATH`: image → `trellis` on Replicate, geometry → `meshy`, sketch → `triposg`) only when nothing free is configured and healthy.++**Generation controls** (`api/_lib/forge-options.js`). `target_polycount` (alias `target_faces`) is honored by every lane that has polygon control, including the BYOK providers (Meshy, Tripo, Rodin), which used to hardcode the tier default. `bbox` (`[x, y, z]` meters) is lane-agnostic: after generation `api/_lib/glb-bbox-fit.js` uniformly scales the delivered mesh to fit the box, centered on X/Z and floored at Y=0, on every sync and async lane. `pose` (`t` or `a`) asks for a rest pose where the lane can honor it (`poseControlFor()`: text-conditioned requests only, since a caller photo fixes the pose, and never `anigen`, whose rigging pass re-normalizes the pose), and the response reports `pose_applied`.**Subject-aware reorder (high tier).** `classifyForgeSubject()` regex-classifies the prompt as hard-surface or organic. Hard-surface prompts (vehicles, machines, architecture) hoist `trellis_selfhost` above `hunyuan3d`; organic subjects (people, creatures) keep Hunyuan3D first. This exists because the two engines genuinely differ on those subject classes at high fidelity.@@ -162,6 +175,8 @@ Every non-terminal poll also carries honest timing: `elapsed_seconds` (the age o**Poll-time failover** (`api/_lib/forge-failover.js`) closes the nastier gap: a self-host worker can accept a task and fail it minutes later, in a poll handled by a different instance that no longer holds the request. On a failed poll the module recovers the original inputs (prompt plus reference image) from the creation row, resubmits to the next configured lane, and binds old handle to new handle in Redis (2 hour TTL). The client keeps polling the same job id and simply sees `status: running` with a new `backend`. Hops are capped by `MAX_FAILOVER_HOPS = 3` (one primary plus up to three backups). The redispatch order is `trellis2`, `trellis_selfhost`, `hunyuan3d`, `trellis`, `modly`, `modly_hunyuan`, then `triposg` as the final rung (Tencent lanes are skipped for a restricted or unknown territory). TripoSG runs its photo pipeline (gcp provider mode `triposg`) and returns untextured geometry, so it only serves a job once every textured lane has failed or is marked down; the client's lane note says the result will have no textures. It was added after the 2026-09-18 to 09-28 outage, when Hunyuan3D and TRELLIS self-host failed together, Replicate was unconfigured, and roughly 400 photo jobs a day ended in a hard failure while the TripoSG worker was healthy. TripoSG stays out of the `retry_backends` suggestions because its public lane is sketch-only; the two Modly lanes are image lanes and close that list. A Modly lane that rejects the submit itself (cold, restarting, throttled) is cooled and the same request retries on `trellis2`, then `trellis_selfhost`, inside the submit. HuggingFace is excluded because its provider blocks through the whole generation (cannot be ridden from a poll), and NVIDIA is excluded because poll-time redispatch always reconstructs from a stored reference image, which NIM rejects. Both failover paths (this attended one and the unattended finalizer sweep) link the failed attempt to its successor row (`forge_creations.superseded_by`, migration `20260814200000_forge_failover_supersede.sql`), so the outcome ledger, the forge health sensor and `npm run forge:errors` count a recovered attempt as a recovery, not a loss.+**Stalled NVIDIA jobs.** The unattended finalizer (`api/cron/forge-finalize.js`) is the only consumer of a poll-time failure on the free NIM text lane once the browser stops polling. A stalled text-to-3D job there gets one resubmit (`decideNvidiaStall`), and both give-up points (`nvcf_expired` and the bare TTL timeout) now mark the `forge-nim-trellis` cooldown, so new submissions skip to the next lane within the 120 s window instead of feeding a broken lane for up to 45 minutes.+**Designed terminal failure.** When no successor is possible, the failed response carries `retryable: true` plus `retry_backends: [...]`, the ordered configured lanes a client can one-click resubmit to. A failure is never a bare string. The whole module is fail-open: no Redis disables automatic redispatch but keeps suggestions; no DB disables recovery but never turns a clean failure into a hang.### Quality, caching, and scale@@ -186,16 +201,18 @@ Every non-terminal poll also carries honest timing: `elapsed_seconds` (the age o`api/_lib/forge-store.js` owns all writes: `createCreation` on submit (also records the funnel `start` event), `materializeCreation` on completion, `markFailed`, `markSupersededBy` when a failed attempt is re-dispatched, verdict capture, and `deleteCreation` (behind `DELETE /api/forge-creation?id=`), which removes the mesh, preview and source uploads from storage before the row and is scoped to the owning client key. It is fail-soft: without a DB or storage config it no-ops rather than blocking generation.-**Storage is two-layer.** GPU workers write raw output to GCS (`gs://$GCS_BUCKET/raw-meshes/...`), and provider URLs generally expire within about an hour. `materializeCreation` therefore mirrors the mesh and reference image into Cloudflare R2 (`api/_lib/r2.js`) and stores the durable CDN URL in `glb_url`. Anything user-facing must reference the R2 URL, never the raw provider URL.+**Storage is two-layer.** GPU workers write raw output to GCS (`gs://$GCS_BUCKET/raw-meshes/...`), and provider URLs generally expire within about an hour. `materializeCreation` therefore mirrors the mesh and reference image into Cloudflare R2 (`api/_lib/r2.js`) and stores the durable same-origin `/cdn/` URL (`cdnUrl()`) in `glb_url`. Stored and returned URLs go through the `/cdn/` proxy (`api/cdn-object.js`), never the raw `*.r2.dev` domain, which browsers block on cross-origin reads (ORB/CORS); `normalizeStoredUrl()` rewrites legacy raw URLs on read. Anything user-facing must reference the R2 URL, never the raw provider URL.### When object storage is the thing that is downA rejected S3 secret takes 3D generation and every avatar, thumbnail and GLB read down at once, and on 2026-09-07 it did so with no health signature at all, because the forge sensor only sees generations that got far enough to write a row. Four rules now bound that blast radius:-1. **It has its own sensor.** [api/_lib/ops/object-storage-health.js](../api/_lib/ops/object-storage-health.js) probes the bucket with a signed one-key list and reports `ok` / `degraded` / `down` with the R2-specific hint (the secret is the token *digest*, not the token).+1. **It has its own sensor.** [api/_lib/ops/object-storage-health.js](../api/_lib/ops/object-storage-health.js) probes the bucket with a signed one-key list (retried once after a 300 ms backoff, so a one-off blip stays `ok` while two consecutive failures still classify `down`) and reports `ok` / `degraded` / `down` with the R2-specific hint (the secret is the token *digest*, not the token).2. **The reference-view write is no longer a single point of failure.** `persistImageBytes` runs before the reconstructor is ever called, so a refusing bucket returned 502 on 100% of text-to-3D while image-to-3D, which supplies its own view URLs, kept working. A storage-*infrastructure* fault now falls back to an inline `data:` URI under 4 MB ([api/_lib/image-persist.js](../api/_lib/image-persist.js)). `backendAcceptsInlineViews()` names the lanes that can read one, and it is true for our own GPU workers and only them, because every `workers/model-*` declares `images: [data-uri|url]` while a third-party reconstructor takes a URL it fetches itself. A programming error or an oversized payload still throws.3. **A refusal is reported as a refusal.** `/api/forge-upload` used to check only that the S3 env vars were *present*, so a rotated token still minted a well-formed presigned URL, the bucket answered the browser's PUT with a `403 SignatureDoesNotMatch` carrying no `Access-Control-Allow-Origin`, and the page fell into its catch-all "network error" branch for a fault that had nothing to do with the user's connection. `objectStorageUsable()` in `r2.js` runs the same probe, cached and single-flighted so a six-slot burst costs one, and both forge entry points answer `503 storage_unavailable` rather than forwarding a raw signing complaint.-4. **Reads fail over to the public domain.** When the signed read fails on infrastructure rather than on the object, [api/cdn-object.js](../api/cdn-object.js) **streams** the same key from the public bucket domain. It must stream and never redirect: `r2.dev` sends no `access-control-allow-origin`, a browser re-runs the CORS check on a redirect's target, and the wildcard grant this handler sets is discarded the moment the hop is followed (measured on 2026-09-09, every cross-origin `/cdn` read threw "Failed to fetch" while the same URL curled 200). Streaming keeps the response on three.ws so the CORS, CORP and content-type headers survive the degraded path, and a short 60 s edge cache absorbs a thumbnail burst instead of pointing every browser at the rate-limited public domain the route exists to dodge.+4. **Reads fail over to the public domain.** When the signed read fails on infrastructure rather than on the object, [api/cdn-object.js](../api/cdn-object.js) **streams** the same key from the public bucket domain. It must stream and never redirect: `r2.dev` sends no `access-control-allow-origin`, a browser re-runs the CORS check on a redirect's target, and the wildcard grant this handler sets is discarded the moment the hop is followed (measured on 2026-09-09, every cross-origin `/cdn` read threw "Failed to fetch" while the same URL curled 200). Streaming keeps the response on three.ws so the CORS, CORP and content-type headers survive the degraded path, and a short 60 s edge cache absorbs a thumbnail burst instead of pointing every browser at the rate-limited public domain the route exists to dodge. When both lanes fail on a storage-infrastructure fault, an image key gets a bundled 64x64 placeholder PNG with a 30 s cache instead of a raw 502, so real content resumes within 30 s of recovery; non-image keys (a `.glb`) still fail, because a static image cannot stand in for a model.++Anonymous presigned uploads cannot sign a content length, so `api/cron/anon-upload-sweep.js` (hourly) deletes objects that exceed their prefix ceiling in `api/_lib/anon-upload-limits.js` (for example 8 MB under `forge/uploads/`).Note the asymmetry with rule 3: `objectStorageUsable()` fails closed only on a *rejected credential*, which never recovers on retry, and stays open through a timeout, so a flaky probe cannot take uploads down on its own.@@ -247,6 +264,11 @@ Workers are Python FastAPI services on Cloud Run (scale-to-zero L4 GPUs unless n| `workers/modly/` | Modly's backend headless, the `modly` (TripoSG) and `modly_hunyuan` (Hunyuan3D 2 Mini Turbo) lanes. Untextured GLB, repaired and decimated to the tier's face budget. || `workers/model-trellis/` | Self-hosted TRELLIS, the `trellis_selfhost` lane. Quality-tiered up to 4096px textures. || `workers/model-hunyuan3d/` | Hunyuan3D-2.1 single image to textured mesh, the `hunyuan3d` lane. |+| `workers/model-pixal3d/` | Pixal3D, the `pixal3d` "Match my photo" lane: 1 to 4 photos fused into one PBR GLB. |+| `workers/model-anigen/` | AniGen, the `anigen` lane: mesh, skeleton and skin weights predicted together. |+| `workers/model-partcrafter/` | PartCrafter, the `partcrafter` lane: named part meshes. `workers/model-holopart/` is the companion that completes occluded geometry on meshes segmented after the fact. |+| `workers/model-triposplat/` | TripoSplat behind `/api/forge-splat`: image to Gaussian splat. |+| `workers/model-sam3d-objects/` | SAM 3D Objects behind `/api/forge-scene-objects`: photo to laid-out scene. 32 GB+ GPU, off until the gated weights are staged (`npm run stage:sam3d-objects`). || `workers/model-triposg/` | TripoSG 1.5B. `mode: image` for the avatar pool, `mode: scribble` for the sketch path. || `workers/model-triposr/` | TripoSR fast path and fallback (5 to 15s). || `workers/rig/` | Make-It-Animatable rigging: 52-bone Mixamo skeleton, skin weights, ARKit-52 blendshapes, sub-second GPU predict, grafted into the original GLB bytes. Replaced the retired `workers/unirig/` (2026-07-17); cutover was the `GCP_UNIRIG_URL` env change. |@@ -282,7 +304,9 @@ The env vars that shape a deployment (production values live on the Cloud Run se| --- | --- || `NVIDIA_API_KEY` | Enables the free NIM TRELLIS text lane. || `HF_TOKEN` | Enables the HF Spaces lane. |-| `MODEL_TRELLIS2_URL`, `MODEL_TRELLIS_URL`, `GCP_HUNYUAN3D_URL`, `GCP_TRIPOSG_URL`, `GCP_UNIRIG_URL`, `GCP_RECONSTRUCTION_URL` | Self-host worker URLs (TRELLIS, Hunyuan3D, sketch, rig, avatar controller). |+| `MODEL_TRELLIS2_URL`, `MODEL_TRELLIS_URL`, `MODEL_MODLY_URL`, `MODEL_PIXAL3D_URL`, `MODEL_ANIGEN_URL`, `MODEL_PARTCRAFTER_URL`, `MODEL_TRIPOSPLAT_URL`, `MODEL_SAM3D_URL`, `GCP_HUNYUAN3D_URL`, `GCP_TRIPOSG_URL`, `GCP_UNIRIG_URL`, `GCP_RECONSTRUCTION_URL` | Self-host worker URLs (TRELLIS, Modly, Pixal3D, AniGen, PartCrafter, TripoSplat, SAM 3D Objects, Hunyuan3D, sketch, rig, avatar controller). |+| `TRIPO_API_KEY`, `TRIPO_WEBHOOK_SECRET` | Optional. The key makes Tripo the High-tier default geometry engine (house lane); the secret enables the signed Tripo webhook receiver. |+| `FORGE_PAY_TO_KEEP` | Default off; gates releasing the original file behind a $THREE hold or payment (`api/forge-keep.js`). || `GCP_RECONSTRUCTION_KEY` | Shared bearer for all self-host workers. || `REPLICATE_API_TOKEN` | Enables the paid Replicate last resort. || `FORGE_PREFER_FREE` | Default on; prefer free reconstruction before paid Replicate. |diff --git a/docs/ibm-community-doc-freshness-post.md b/docs/ibm-community-doc-freshness-post.mdindex 7b4bff5c9..355cab62c 100644--- a/docs/ibm-community-doc-freshness-post.md+++ b/docs/ibm-community-doc-freshness-post.md@@ -626,7 +626,7 @@ It is red. One of the seven, `workers/browser-gateway`, is an empty directory on### 12.2 `npm run check:claude`-This is the piece most relevant to teams adopting coding agents. [`scripts/check-claude-md.mjs`](https://github.com/nirholas/three.ws/blob/main/scripts/check-claude-md.mjs) treats the agent operating file as code with assertions, because when it drifts, "agents follow instructions into dead ends... and burn a session discovering the drift." It does not judge prose. It **re-derives each checkable claim from its source of truth** on every run:+This is the piece most relevant to teams adopting coding agents. [`scripts/check-claude-md.mjs`](https://github.com/nirholas/three.ws/blob/main/scripts/check-claude-md.mjs) treats the agent operating file as code with assertions, because when it drifts, "agents follow instructions into dead ends... and burn a session discovering the drift." It does not judge prose. It **re-derives each checkable claim from its source of truth** on every run. Since 2026-10-10 the operating file is split: the deploy runbook, playbook and standards moved into on-demand skills under `.claude/skills/`, and the check reads the file and those skills as one body, so the claims below hold for all of it:- every `npm run` script and repo path the file names must exist;- the quoted scheduled-job count must equal the length of the config's job list;diff --git a/docs/pump-platform-fee.md b/docs/pump-platform-fee.mdindex 7c2f74d79..4d5df81d0 100644--- a/docs/pump-platform-fee.md+++ b/docs/pump-platform-fee.md@@ -13,6 +13,7 @@ signature.| Agent wallet trade tab + `/api/agents/:id/solana/trade` | `api/agents/solana-trade.js` `buildTradeInstructions` | SOL spent / minimum SOL out || Agent strategies and mirror trading | same builder (`agent-strategy-runtime.js`, `agent-mirror.js`) | SOL spent / minimum SOL out || `/api/agents/:id/trade`, the market-maker (`workers/agent-mm`), programmable orders (`workers/agent-orders`) | `api/agents/agent-trade.js` `executeAgentTrade` | SOL spent / minimum SOL out |+| Aggregator and venue swaps by an agent (any SPL pair, `api/_lib/trading-tools/swap.js`, venues in `venues.js`; filled by `workers/agent-orders` for non-launchpad coins) | `api/agents/solana-trade.js` `buildVenueTradeInstructions`: the venue builds the swap, the same fee is appended so no venue can skip it. Quotes report it as `three_ws_fee_bps` | quote spent / minimum out || Sniper buys and sells (`workers/agent-sniper/executor.js`) | appended before broadcast; included in the position's cost basis and P&L | SOL spent / slippage-floor proceeds || Agent pump.fun buy, sell, AMM swap (`/api/agents/:id/pumpfun/*`) | `api/agents/pumpfun/[action].js` | quote spent / slippage-floor proceeds || Coin launches | the dev buy, see [Launch fee](#launch-fee-on-by-default) | dev buy |@@ -23,7 +24,7 @@ sell that fills at its floor always covers its own fee.**Not billed:**- **Platform-owned agents** (owner account `[email protected]` or `@agents.three.ws`,`isPlatformOwnedAgent`): the $THREE circulation desk, house sniper fleets and other three.ws- money movements (`isPlatformOwnedUser` in `api/_lib/pump-platform-fee.js`).+ money movements (`isPlatformOwnedUser` in `api/_lib/pump-platform-fee.js`, cached for 10 minutes per account; `isPlatformOwnedAgent` in `api/_lib/custodial-key-health.js` holds the email rule).- **Trades made outside three.ws.** A trade on pump.fun, a terminal or another app never touchesour transaction builders, and the pump.fun program has no third-party fee hook, so there isnothing to attach a fee to.diff --git a/public/changelog-recent.json b/public/changelog-recent.jsonindex b18a383bb..ca6bc5e5c 100644--- a/public/changelog-recent.json+++ b/public/changelog-recent.json@@ -1,11 +1,11 @@{- "generated_at": "2026-10-25T11:57:28.846Z",+ "generated_at": "2026-10-25T11:58:03.204Z","generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json","site": {"name": "three.ws","url": "https://three.ws"},- "total": 4201,+ "total": 4202,"complete": false,"full_feed": "/changelog.json","entries": [@@ -89,6 +89,16 @@"fix"]},+ {+ "date": "2026-10-25",+ "type": "update",+ "title": "Rate limiter Redis path repaired and its health hint made honest",+ "summary": "The rate limiter had been failing every Redis call because @upstash/ratelimit 2.1+ sends a script flag that self-hosted Redis rejects, so traffic ran on the Postgres fallback while healthz called it transient. The library is pinned to 2.0.8, and this class of fault is now logged and reported as a non-transient script incompatibility.",+ "link": null,+ "tags": [+ "fix"+ ]+ },{"date": "2026-10-25","type": "update",@@ -1548,17 +1558,6 @@"improvement","docs"]- },- {- "date": "2026-10-13",- "type": "update",- "title": "The public animation library is now openly licensed, every clip CC0 or self-generated",- "summary": "GET /api/animations/library used to serve a bulk motion library baked from Mixamo, redistributable by anyone through scripts/mirror-animation-library.mjs even though Mixamo's own terms permit using its animations inside a project but not redistributing the raw files. The library is rebuilt from two CC0 1.0 Universal sources instead (Quaternius's Universal Animation Library 2 and Mesh2Motion's human animation packs), retargeted through the existing pipeline with every clip carrying a source and license field end to end from scripts/cc0-library.config.json through the published manifest. The /animations gallery shows each clip's pack and license next to its category chip, and the endpoint itself now refuses to publish any entry missing a license or naming Mixamo as its source, so a raw Mixamo clip can never reach the public endpoint or its mirror again. scripts/mixamo-all.mjs keeps its download and local-build phases for offline retargeting research, but its upload phase is permanently disabled.",- "link": "/docs/animations",- "tags": [- "improvement",- "docs"- ]}]}diff --git a/public/changelog.json b/public/changelog.jsonindex dd4a1baba..d257e5494 100644--- a/public/changelog.json+++ b/public/changelog.json@@ -1,5 +1,5 @@{- "generated_at": "2026-10-25T11:57:28.802Z",+ "generated_at": "2026-10-25T11:58:03.173Z","generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json","site": {"name": "three.ws",@@ -86,6 +86,16 @@"fix"]},+ {+ "date": "2026-10-25",+ "type": "update",+ "title": "Rate limiter Redis path repaired and its health hint made honest",+ "summary": "The rate limiter had been failing every Redis call because @upstash/ratelimit 2.1+ sends a script flag that self-hosted Redis rejects, so traffic ran on the Postgres fallback while healthz called it transient. The library is pinned to 2.0.8, and this class of fault is now logged and reported as a non-transient script incompatibility.",+ "link": null,+ "tags": [+ "fix"+ ]+ },{"date": "2026-10-25","type": "update",diff --git a/public/changelog.xml b/public/changelog.xmlindex 87a5dc5bc..155ebba04 100644--- a/public/changelog.xml+++ b/public/changelog.xml@@ -70,6 +70,14 @@<category>fix</category><description>When the R2 bucket is unreachable (account disabled, keys rotated, endpoint down), any API route that writes or reads an object without its own error handling, such as avatar upload, used to answer a bare 500 and fire a Sentry event and an unhandled-5xx alert on every request. The shared error boundary now treats a storage fault like a database outage: a 503 service_unavailable with Retry-After, one throttled warning, a single deduped ops alert, and a clean skip for cron ticks. Deliberate 4xx errors and real handler bugs are unchanged.</description></item>+ <item>+ <title>Rate limiter Redis path repaired and its health hint made honest</title>+ <link>https://three.ws/changelog</link>+ <guid isPermaLink="false">2026-10-25:Rate limiter Redis path repaired and its health hint made honest</guid>+ <pubDate>Sun, 25 Oct 2026 12:00:00 GMT</pubDate>+ <category>fix</category>+ <description>The rate limiter had been failing every Redis call because @upstash/ratelimit 2.1+ sends a script flag that self-hosted Redis rejects, so traffic ran on the Postgres fallback while healthz called it transient. The library is pinned to 2.0.8, and this class of fault is now logged and reported as a non-transient script incompatibility.</description>+ </item><item><title>Security hardening across sign-in, uploads, vaults, agents and the chat server</title><link>https://three.ws/oracle</link>diff --git a/public/features.json b/public/features.jsonindex 14c800398..0ecd3a84e 100644--- a/public/features.json+++ b/public/features.json@@ -1,5 +1,5 @@{- "generated_at": "2026-10-25T11:57:28.772Z",+ "generated_at": "2026-10-25T11:58:03.155Z","generated_by": "scripts/build-page-index.mjs from data/pages.json","site": {"name": "three.ws",