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
fix(server): send www.three.ws to the apex so 3D stops failing there
nirholas168b1fcd39ec
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex df2ee61b5..9a90941c3 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -15,6 +15,7 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr- **Arm your agent stops telling signed-out visitors to create an agent, and shows them the live conviction stream instead**: A full audit of /oracle/arm found that anyone not signed in was shown “Create a 3D agent to arm it”, a dead end for a visitor with no account, and the rest of the page was hidden behind it. Signing in now gets its own state with sign-in and register buttons, and the live “clearing your bar” preview plus the 30-day win-rate readout stay on screen for everyone, because both run on public data. If the agents list itself fails to load, the page now says so with the status it got back and a Try again button, instead of pretending the account is empty. Four more fixes went with it: the arm switch and the two rule toggles can now be operated from the keyboard (they were focusable but did nothing on Enter or Space), coin artwork routes through the site image proxy so icons stop failing on IPFS gateways, the status line no longer flips back to “Disarmed” when the translation catalog lands after the page has rendered, and every form field now has a real label attached to it. (`/oracle/arm`) `[fix, improvement]`- **Avatars and token art load again on sites that embed three.ws**: Assets served from /cdn (avatars, thumbnails, generated models) are read from our object store with a signed request, and when that request is rejected the route falls back to the store's public address so the bytes still arrive. That fallback was a redirect, and a redirect throws away the cross-origin permission the route grants: browsers re-check permission at the redirect's destination, and the public address grants none. Measured from an outside site, every one of those reads failed outright, which took down model previews on pages that load art through the proxy and silently broke third-party embeds of three.ws avatars. The bytes are now served through three.ws itself rather than pointed at, so the permission, the file type and the download rules all survive the fallback, partial reads for video and audio keep working, and a file that genuinely is not there says so instead of reporting a server fault the page retries forever. It also keeps the fallback off the rate-limited public address, which is the whole reason the proxy exists. `[fix]`- **Connecting a home: the page now says which state it is in, out loud**: Two moments on /smart-home were doing the right thing silently. Typing an address that can never work (a 192.168 number, a .local name) has always put the reason under the field straight away, before anything is sent, but the message was carried by colour alone and a screen reader never read it out; it is now announced the moment it appears, and marked in a way that does not depend on seeing red. And a house that has stopped answering, is refusing the stored token, or has simply gone quiet is now labelled as such by the page itself rather than only in the sentence on its card. Nothing about what you see moves: the last known summary of your house stays exactly where it was, with how long ago it last answered, because a home that went quiet should never look like a home that was deleted. (`/smart-home`) `[improvement, fix]`+- **Disconnecting a home now stops the screens that were showing it**: A kitchen tablet or wall display left open on a connected home kept saying "Live" and kept drawing that house after the home had been disconnected from another device. The connection was really gone, but the open page was never told, so it sat on a stale picture of somebody's house with a green Live badge on it. Disconnecting now closes the live connection and hands every screen still watching a final message that says what happened, and those screens stop asking for more. They keep showing the last state they saw, greyed and dated, with the reason and a Reconnect button, which is what every other kind of drop already did. (`/docs/home-scene`) `[fix, security]`- **Endpoint Shopper fits a phone, and says something useful when a run finds nothing to buy**: A full audit of /shopper, the page where you describe a task, set a budget, and let an agent shop the x402 Bazaar for endpoints that can answer it. Three things were wrong. A run that came back with no plan and no answer, which is what happens when nothing in the Bazaar matches the task or everything that does prices above your ceiling, painted an empty white column and stopped: no explanation, no way forward. That case now says no endpoints matched, quotes the task back, and offers the three things that change the outcome (rewrite the task, raise the budget, browse the Bazaar) plus a button to run again. Second, when the request could not reach us at all, the page showed the browser's own wording for a dropped connection, which names no cause and suggests no fix; it now says the agent service could not be reached and what to do about it. Third, on a phone narrower than 560px the four navigation links were squeezed into a strip about 76px wide and had to be dragged sideways a few pixels at a time to read; they now wrap onto their own full-width row. Alongside those: the results column announces itself to a screen reader while a run is in flight and when it settles, the Task label sits above its box as intended rather than beside it, and an internal ticket number that had been sitting in the page's headline label since launch is gone. (`/shopper`) `[fix, improvement]`- **Ethereum wallets load on the portfolio page again, keylessly, and every token logo shows up**: A full audit of /portfolio, where you paste any Solana or Ethereum address and get a live portfolio. The Ethereum half had gone dark: the single provider behind it ran out of monthly capacity, so every 0x address answered "Data source unavailable" with nothing behind it. Ethereum now has the same keyless floor Solana has always had. The ETH balance comes from the public Ethereum nodes the rest of the platform already uses, the token list with its prices and icons comes from a public block explorer, and the 24h move comes from the same market source the Solana side uses, with the coverage it achieved stated on the card. The Data panel names whichever lane actually answered, so you can see whether you are reading the paid provider or the free one. Token logos were another visible break: the page pointed your browser straight at an IPFS gateway, which the browser refuses on cross-origin grounds, so every holding fell back to a three-letter monogram and your address bar handed your IP to the gateway on every load. Logos now come through three.ws, sized for the row. Keyboard users could tab onto a slice of the allocation donut and get nothing: the tooltip was wired to an event handler property that browsers do not actually support, so it never fired once; the slice now names its asset and share, and Escape dismisses it. When a lookup fails, the page now shows the reason the server actually sent instead of a generic sentence, and clicking Retry after a rejected address no longer silently reloads the wallet you looked at before it. Underneath, the fallback that names Solana tokens when the primary metadata source is out of quota had never run at all, because of a missing import; token symbols and names come back on that path. (`/portfolio`) `[fix, improvement]`- **Every translated news page is advertised as translated again**: The site publishes a manifest of which pages carry translated copy, and it was missing 113 of them: every news page. The build wrote that manifest before the news pages had been through the translation pass, so it read them as English-only and shipped a list 113 pages short. Nothing was untranslated, the translations were there and served correctly, but anything reading the manifest to decide what to offer in a reader's language (the language picker's page-level hints, and crawlers looking for alternates) was told those pages had no other language. The build now annotates the news pages first and counts afterwards, so the published count is 357 rather than 244. (`/news`) `[fix]`@@ -59,6 +60,7 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr- **The partner page gets its footer back, fits a narrow phone, and stops naming three partners it does not have**: An end-to-end audit of /partners found it was the only page on the site that carried a footer slot but never loaded the footer, so the whole bottom of the page was missing. It is back. On a 320px phone the partner cards were 38px wider than the screen and the overhanging text was silently cut off, because a card header could not shrink past its logo, name and category chip on one line; the chip now wraps and every card fits. The page description search engines and link previews read was also stale: it advertised Intel, Microsoft and Oracle, none of which have a card, and left out OpenAI and HackerNoon, which do. The AWS card said View on AWS Marketplace above a link to our own AWS page, so it now says what it actually opens. Beyond that: the 8 partners and 22 chains counters are no longer hidden from screen readers and the partner number is now counted from the cards themselves, keyboard users get a visible ring on every card and button, the card lift is dropped for anyone who asks for reduced motion, and the page eyebrow, the four benefit headings and every card call to action are translatable instead of staying English on a translated page. The floating walk companion also got a full-size dismiss, avatar-swap and narration button on touch devices, everywhere it appears. (`/partners`) `[fix, improvement]`- **The partnership page works properly on the partner's own site**: The IBM partnership page is published once onto IBM's own domain and then keeps itself current by reading from three.ws, so everything it loads is a cross-origin read and anything we get wrong there is invisible on three.ws itself. Three things were wrong. The site-wide command palette asked the partner's server for our page index and for the ranking module it imports, so it never opened and logged an error on every visit: the index now travels with the code the way the language catalogs already do, and both files are readable from other sites. And a build step that adds the site's mobile stylesheet to every page was reaching the partner artifacts too, even though they are copied out untouched by design, so the hosted copy asked IBM's server for a stylesheet only we have. All three are closed, and the audit that loads the page from a foreign domain now passes all four of its checks: the live update applies, the language switcher mounts, the paid demo arms, and the console is clean. `[fix]`- **The payments dashboard now says whose wallet ran out of SOL**: When a Solana payment cannot go through because the wallet paying the network fee is too low, the chain reports it as a generic simulation failure. Our status page grouped all of those together, so the platform's own fee wallet running low looked exactly like a buyer signing from an empty wallet, and both were also counted as payment-network faults. They are now three separate, named outcomes, so the status page says whether the money problem is ours to fix, the buyer's, or neither. Today's reject book was 1,438 rows of the first kind reading as the third. `[fix, infra]`+- **The payments status page now says which of two opposite outages it is looking at**: When agent payments stop settling, the status page names the cause. Two very different situations shared one description: either the platform stops offering Solana payment on its price quotes, so nothing is ever attempted, or it keeps offering them and then turns each signed payment away at the final check. Both are fixed by topping up the same wallet, but the evidence sits in opposite places, and the old wording sent whoever was on call to the wrong one. It could even report that Solana had been withdrawn from quotes while the counter printed beside it read zero withdrawals. The status page now names the mechanism and points at the record that actually holds the proof, and the operations runbook carries a table for telling the two apart. `[fix, infra]`- **The pitch deck now shows the whole character, and says so when the 3D cannot load**: The live 3D figure on the deck at /pitch was framed by a camera that cut it off above the chest and pointed at its back, so the slide that says "give your AI a face" showed neither a head nor a face. Both stages now frame the full character from the front. Each stage also ships a still frame rendered from the same glTF file: it fills the panel while the model streams instead of leaving an empty box, and if the 3D runtime is blocked or fails outright the panel says so in the open, drops the "Live" badge that used to sit over nothing, and offers a retry. Navigation got the same pass: the slide dots are now full-size tap targets and step out of the way on a phone, the language picker no longer lands on the slide counter, slide copy no longer runs underneath the nav bar on a tablet, links on hidden slides are out of the keyboard tab order, and every button and link has a visible focus ring. (`/pitch`) `[fix, improvement]`- **The press kit reads in the three.ws typeface, fits a phone, and quotes every mark at its true size**: Every paragraph on the press kit was rendering in the browser default serif on a bare white-ish ground: the page styled its own cards and headings but never applied the site typeface, colour, or background to the document itself, so the one page a journalist opens looked nothing like the rest of three.ws. It now uses the platform design tokens throughout, in both light and dark mode. On a 320px phone the two OpenAI announcement cards were sliced off at the right edge, taking their Download PNG buttons with them, and because the page clips rather than scrolls sideways there was no way to reach what was cut; both card grids now fold to a single full-width column instead. The pixel dimensions printed under each mark were also all slightly wrong, off by a pixel or two from the artwork they labelled, which is the number a designer laying out a conference programme actually acts on. They are corrected, and the brand asset renderer now writes them back from the PNG headers on every build the way it already did for the archive size, so they cannot drift again. Last, the Copy buttons beside the boilerplate did nothing at all when the browser withheld clipboard access; they now select the passage in place and tell you which keys to press. (`/press`) `[fix, improvement]`- **The Pump Visualizer's live counters stopped freezing a few seconds after the page opened**: A full audit of /pump-visualizer, the 3D scene of live pump.fun mints. The status bar across the top counts the tokens in the scene, the mint rate per minute and the total market cap, and about fifteen seconds into every visit all three froze: the counter sat at 0 and the rate and total sat at a dash while the scene behind them kept filling with new coins. The cause was the page's own translation pass. Those three numbers were written inside blocks of translated copy, so the moment the language file arrived the browser rebuilt that copy and threw away the very elements the page was writing into. The numbers now live beside their labels instead of inside them, so the labels still translate into all 85 languages and the values keep counting for as long as the page is open. The per-minute and per-hour units now translate too, which they never did once the page switched between live mints and migrations. The page also gained a heading and a labelled search box for screen readers, and its browser tab now reads Pump.fun Visualizer, three.ws instead of a retired product name. (`/pump-visualizer`) `[fix, improvement]`@@ -76,6 +78,7 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr- **Trading finally counts toward your daily streak**: The cross-surface streak on three.ws counted signing in, forging a model, saving a world and a walk session, but not a trade, which on a trading platform is the one thing it most obviously should count. A confirmed on-chain buy or sell now keeps your streak alive like any other activity, and still counts once per day however many times you trade, so the streak measures showing up rather than trading volume. `[improvement]`- **Voice satellite: the token command works where you actually run it, and an unpaired satellite explains itself**: Two fixes for the Home Assistant voice satellite. The command that prints a viewing token for a screen on your own network was documented to be run on the machine already running the satellite, but doing exactly that failed: it tried to start a second copy of the service and died because the ports were already taken. It now reads the identity it needs and prints the token, with nothing else running. Separately, a satellite that has not been paired yet answers its health check again and says why it is unpaired, and turns a browser away with that same reason instead of a blank refusal. That is the state you are in on a fresh install, which is exactly when you need something to read. (`/smart-home/satellite`) `[fix]`- **When the payment wallets look empty, the self-heal now says whether they are empty or just fenced**: The x402 payment rail keeps a set of platform wallets topped up from one funding root, and a recovery run reports why it could not draw on each source. Every source that held less than its configured floor reported the same thing: "at or below floor". That single phrase covered two opposite situations. A wallet holding nothing needs money added from outside. A wallet holding real funds behind a floor somebody set does not: the platform already owns that money, and a floor decision releases it. Because the two printed identically, three separate investigations of the same stalled rail concluded the platform was out of funds while one of its own wallets held roughly forty-five times what the stalled wallet was short. A skipped source now reports how much it is holding and the line it had to stay above, and every run totals the funds it left behind, so an operator can tell at a glance whether the recovery needs a deposit or a decision. The health page and the operations runbook now point at that total instead of asserting that money is required. `[fix, infra]`+- **www.three.ws now takes you to three.ws, and 3D loads there**: Typing www before the address landed on a copy of the site that looked right and then quietly refused to show any 3D. Avatars and models are served from a media host that only recognises three.ws, so on the www address every model was blocked by the browser and pages that should have shown a character showed an empty box instead. The www address now sends you straight to three.ws, keeping the page you asked for and anything after the question mark, so bookmarks and shared links keep working and everything on them renders. `[fix]`- **Your monthly agent turns now count, and locking up never does**: Talking to the agent about your house is the one part of the smart-home lane that can really cost money: the room graph makes a home prompt large, and on a paid model a single turn costs several weeks of holding that house’s connection open. Those turns were being counted but never actually limited. They are now, against the monthly allowance shown on your plan page, and if you run out the agent says so in a sentence that names the limit, the date it resets and where to raise it, instead of failing at you. Two things are deliberately left outside that limit. Asking the agent what the house is doing still works, because you have to be able to see which door is open. And telling it to lock a door, close a garage or a valve, or arm the alarm still runs, over quota, on a paused home, in every state we can put an account in: the safe direction is free, always, on every plan. If our own billing lookup fails, the turn is allowed through rather than refused. (`/smart-home/plan`) `[feature, improvement]`- **Your own agent now stands in your live house**: The 3D home at /smart-home/<id> always drew a generic figure standing in your rooms, even when you had given your agent a face months ago. It now shows your agent: the same avatar the walk world, /play and the voice satellite use, read from the one record the whole platform treats as "my agent". Switch agents in another tab and the body in the house follows, with no reload. It is fetched after the house has already drawn, so nothing waits on it, and the platform's default body stands in when you have no agent yet, no avatar yet, or an avatar you keep private, which by design publishes no model for any page to read. (`/docs/home-scene`) `[improvement]`- **Your private avatars load on the dashboard again, and say so when they cannot**: Avatars you have not made public were failing to load on your dashboard, with nothing on the page to say why. The dashboard was being handed a temporary direct link into our storage provider rather than a link back through three.ws. When storage stopped accepting our credential, that direct link was refused in a way browsers deliberately hide, so the page could not tell the difference between a refusal and a dead connection: it just showed nothing. Private avatars now load through three.ws itself, which checks that the avatar is yours exactly as before, and which already knows how to fall back to a second copy when storage is having a bad day. As a side effect these links no longer expire, so a dashboard tab left open for an hour still shows your avatars when you come back to it. (`/dashboard/avatars`) `[fix]`diff --git a/ISSUES.md b/ISSUES.mdindex ccaa5027f..200b31d67 100644--- a/ISSUES.md+++ b/ISSUES.md@@ -183,7 +183,7 @@ here; the code-quality items from that pass are not production issues.9. **Live R2 CORS does not match `scripts/set-r2-cors.mjs`** (owner action:one credential). CONFIRMED by measurement, not inference, and RE-CONFIRMED- unchanged on 2026-09-09: `node scripts/set-r2-cors.mjs --probe` reads the+ unchanged three times on 2026-09-09: `node scripts/set-r2-cors.mjs --probe` reads theenforced policy from outside and exits 1 on this bucket. The probe needs nocredentials of any kind (it discovers the public host from a live listingendpoint, and the upload host from an auth-free presign route or from an@@ -212,6 +212,22 @@ here; the code-quality items from that pass are not production issues.applies where (docs/media-api.md, docs/character-library.md, both embedtutorials).+ Fixed on the way past, 2026-09-09: the same narrow allowlist was breaking a+ FIRST-party origin, not just third-party ones. `www.three.ws` resolves to+ the same load balancer as the apex, is covered by the managed cert, and+ served the identical app, but the bucket echoes only the apex, so every+ page on the www host got its GLB URLs from the API and had every one of+ them blocked by the browser: 3D was dead there while looking fine+ everywhere else. Measured on one bucket object the same day:+ `Origin: https://three.ws` returns `Access-Control-Allow-Origin:+ https://three.ws`, `Origin: https://www.three.ws` returns no header at all.+ [server/index.mjs](server/index.mjs) now redirects the whole www host to+ the apex (301 on GET/HEAD, 308 otherwise so a write keeps its method and+ body), which matches the canonical URL the site already served there and+ needs no bucket credential. `tests/server-canonical-host.test.js` locks in+ that no other host is touched, the Cloud Run `*.run.app` URL and+ `dev.three.ws` included. Ships with the next deploy.+Fixed on the way past, 2026-09-04, and now VERIFIED LIVE (2026-09-09): thesite edge advertised `access-control-allow-methods: GET, HEAD, OPTIONS` onthe media routes but answered `OPTIONS` with the 404 page, because thediff --git a/data/changelog.json b/data/changelog.jsonindex 7b0f9ee24..c104ee534 100644--- a/data/changelog.json+++ b/data/changelog.json@@ -10,6 +10,14 @@"infra"]},+ {+ "date": "2026-09-09",+ "title": "www.three.ws now takes you to three.ws, and 3D loads there",+ "summary": "Typing www before the address landed on a copy of the site that looked right and then quietly refused to show any 3D. Avatars and models are served from a media host that only recognises three.ws, so on the www address every model was blocked by the browser and pages that should have shown a character showed an empty box instead. The www address now sends you straight to three.ws, keeping the page you asked for and anything after the question mark, so bookmarks and shared links keep working and everything on them renders.",+ "tags": [+ "fix"+ ]+ },{"date": "2026-09-09","title": "Trading finally counts toward your daily streak",diff --git a/docs/ops/gcp-production.md b/docs/ops/gcp-production.mdindex 47d78224a..3a2387b59 100644--- a/docs/ops/gcp-production.md+++ b/docs/ops/gcp-production.md@@ -664,6 +664,19 @@ proxy + Memorystore + connector. The `upstash-redis-rest-token` secret and the- The Cloud Run URL `https://three-ws-api-lp642k3kpa-uc.a.run.app` serves theidentical site and bypasses the LB — useful for isolating LB vs serviceissues.+- **`www.three.ws` is a duplicate host, not a second origin.** Its A record and+ the managed cert both cover it, so it reaches the same backend, but the apex+ is the only origin the platform declares: `server/seo-head.mjs` pins every+ canonical URL to `https://three.ws` and the media bucket's CORS read rule+ allowlists that origin alone. Measured 2026-09-09 on one bucket object: the+ apex gets `Access-Control-Allow-Origin: https://three.ws` back, `www` gets no+ header at all, so every GLB fetch on a www page was blocked by the browser.+ `server/index.mjs` now redirects the whole www host to the apex (301 on+ GET/HEAD, 308 on everything else so a write keeps its method and body), and+ `tests/server-canonical-host.test.js` locks in that no other host, including+ the `*.run.app` URL above and `dev.three.ws`, is touched. Do not add a second+ serving hostname without either widening the bucket policy to match or+ redirecting it here too.### Client geo header (analytics country column)diff --git a/prompts/finish/_context/backlog-PROGRESS.md b/prompts/finish/_context/backlog-PROGRESS.mdindex f5cdd5abe..76afb0127 100644--- a/prompts/finish/_context/backlog-PROGRESS.md+++ b/prompts/finish/_context/backlog-PROGRESS.md@@ -2151,3 +2151,72 @@ Left: one owner action, the last box on that order. Approve committing thelaunchpad-referencing update into three.ws under the coin gate. Nothing technicalremains; the code and the deploys landed in the sibling repo, which the gateexempts.++## 2026-09-09 (third pass): 05 R2 bucket CORS++Re-measured all three surfaces a third time, independently, raw `curl` plus+`node scripts/set-r2-cors.mjs --probe`, no bucket credentials. Every row is+unchanged from the two earlier passes today.++| Surface | Result |+|---|---|+| Site edge `three.ws/avatars/cesium-man.glb`, `Origin: https://example.org` GET | PASS. `200`, `access-control-allow-origin: *`, `access-control-allow-methods: GET, HEAD, OPTIONS`. |+| Site edge, same route, `OPTIONS` preflight | PASS. `204`, `access-control-allow-origin: *`, `access-control-allow-headers: range`, `access-control-max-age: 86400`. |+| Public bucket host `pub-*.r2.dev`, real `200` object | FAIL. `example.org` gets no `access-control-allow-origin`; `three.ws` gets its origin echoed with `Vary: Origin`. |+| Presigned `PUT` preflight on `chatty-storage.<account>.r2.cloudflarestorage.com` | FAIL off the allowlist. `204` for `three.ws` (`Access-Control-Allow-Methods: GET, PUT, HEAD, POST, DELETE`, one combined rule); bare `403` for `www.three.ws`, `localhost:5173`, `example.org`. |++The probe's own drift table names five origins the live policy refuses that the+script's policy would allow: `www.three.ws`, `*.app.github.dev`, `localhost:5173`,+`example.org`, `localhost:8080`.++Credential routes re-checked and all still shut: `.env` holds three keys and none+is an R2 or Cloudflare one, `.env.local` holds no `R2_*`/`CLOUDFLARE_*`/`S3_*`+variable, and `gcloud` answers `Reauthentication failed. cannot prompt during+non-interactive execution` on every call, so Secret Manager cannot be read from+here either. The two doc lines of the definition of done were verified rather+than redone: the script header warns against `vercel env pull` and names+`.env.local` plus `read-service-env.mjs` instead, and `docs/media-api.md`,+`docs/character-library.md` and both embed tutorials say per-host when `/api/glb`+is needed and when a direct fetch is fine.++Found and fixed what three measurement passes had walked past: **the narrow+allowlist was breaking a first-party origin.** `www.three.ws` resolves to the+same load balancer as the apex (`136.68.246.178` for both), is on the managed+cert, and served the identical app with a `200`, but the bucket echoes the apex+alone. So `https://www.three.ws/api/avatars/library` handed the browser+`pub-*.r2.dev` GLB URLs and every one of them was blocked: an `<img>` thumbnail+survives without CORS, a GLTFLoader fetch does not, so 3D was simply dead on that+host while looking healthy on the apex. Measured on one object the same day:+apex gets `Access-Control-Allow-Origin: https://three.ws`, www gets no header.++Did:+- `server/index.mjs` redirects the whole www host to the apex, 301 on GET/HEAD+ and 308 on everything else so an API write keeps its method and body. The+ target is re-parsed through `new URL(req.url, CANONICAL_ORIGIN)` rather than+ concatenated, so an absolute-form request target cannot smuggle an origin in.+ This needs no bucket credential and matches what the site already declared:+ `server/seo-head.mjs` pins every canonical URL to `https://three.ws`, and the+ page served on www already carried `<link rel="canonical" href="https://three.ws/">`.+- Exported that pinned origin as `CANONICAL_ORIGIN` from `server/seo-head.mjs`+ so the redirect and the canonical tags cannot drift apart.+- `tests/server-canonical-host.test.js` (8 tests, all passing): the redirect,+ query preservation, the port and case forms of the Host header, the 308 on a+ POST, the absolute-form target, and that the apex, `dev.three.ws`, `localhost`+ and a `*.run.app` host all pass through untouched.+- Runbook row in `docs/ops/gcp-production.md` under DNS / TLS / CDN, ISSUES.md+ item 9 refreshed with the finding and this third measurement, and a+ `data/changelog.json` entry (`npm run build:pages` regenerated the feeds).++Verified: `npm run audit:docs` clean (1593 files), `check:rules` clean on every+touched path, the new suite plus `server-media-cors-preflight`, `server-404-routes`,+`server-rewrite-query`, `seo-head` and `ssr-pages` all green run per suite. Two+`server-rewrite-query` tests time out when three server-spawning suites run in one+vitest invocation and pass alone; the endpoint answers in 22ms against a+hand-started server, so that is harness contention, not this change.++Left: the same one owner action, unchanged. Mint an "Admin Read & Write" R2 token+for `chatty-storage`, put it in `.env.local` as `R2_ACCESS_KEY_ID` /+`R2_SECRET_ACCESS_KEY`, run `node scripts/set-r2-cors.mjs`, confirm with `--probe`.+The work order stays on disk because its "policy applied" line is that action.+The www fix removes the largest real-user consequence of the wait; third-party+embeds still need `/cdn/<key>` or `/api/glb` until the policy is applied.diff --git a/public/changelog-recent.json b/public/changelog-recent.jsonindex 467fd640e..ae2c71d01 100644--- a/public/changelog-recent.json+++ b/public/changelog-recent.json@@ -1,11 +1,11 @@{- "generated_at": "2026-09-09T15:43:39.345Z",+ "generated_at": "2026-09-09T19:42:06.423Z","generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json","site": {"name": "three.ws","url": "https://three.ws"},- "total": 3650,+ "total": 3653,"complete": false,"full_feed": "/changelog.json","entries": [@@ -102,6 +102,17 @@"fix"]},+ {+ "date": "2026-09-09",+ "type": "update",+ "title": "Disconnecting a home now stops the screens that were showing it",+ "summary": "A kitchen tablet or wall display left open on a connected home kept saying \"Live\" and kept drawing that house after the home had been disconnected from another device. The connection was really gone, but the open page was never told, so it sat on a stale picture of somebody's house with a green Live badge on it. Disconnecting now closes the live connection and hands every screen still watching a final message that says what happened, and those screens stop asking for more. They keep showing the last state they saw, greyed and dated, with the reason and a Reconnect button, which is what every other kind of drop already did.",+ "link": "/docs/home-scene",+ "tags": [+ "fix",+ "security"+ ]+ },{"date": "2026-09-09","type": "update",@@ -578,6 +589,17 @@"infra"]},+ {+ "date": "2026-09-09",+ "type": "update",+ "title": "The payments status page now says which of two opposite outages it is looking at",+ "summary": "When agent payments stop settling, the status page names the cause. Two very different situations shared one description: either the platform stops offering Solana payment on its price quotes, so nothing is ever attempted, or it keeps offering them and then turns each signed payment away at the final check. Both are fixed by topping up the same wallet, but the evidence sits in opposite places, and the old wording sent whoever was on call to the wrong one. It could even report that Solana had been withdrawn from quotes while the counter printed beside it read zero withdrawals. The status page now names the mechanism and points at the record that actually holds the proof, and the operations runbook carries a table for telling the two apart.",+ "link": null,+ "tags": [+ "fix",+ "infra"+ ]+ },{"date": "2026-09-09","type": "update",@@ -762,6 +784,16 @@"infra"]},+ {+ "date": "2026-09-09",+ "type": "update",+ "title": "www.three.ws now takes you to three.ws, and 3D loads there",+ "summary": "Typing www before the address landed on a copy of the site that looked right and then quietly refused to show any 3D. Avatars and models are served from a media host that only recognises three.ws, so on the www address every model was blocked by the browser and pages that should have shown a character showed an empty box instead. The www address now sends you straight to three.ws, keeping the page you asked for and anything after the question mark, so bookmarks and shared links keep working and everything on them renders.",+ "link": null,+ "tags": [+ "fix"+ ]+ },{"date": "2026-09-09","type": "update",@@ -1577,38 +1609,6 @@"tags": ["fix"]- },- {- "date": "2026-09-05",- "type": "update",- "title": "Machine Atlas: two working machines built in the browser from code, with no 3D model files",- "summary": "A new Labs surface at /assembly renders a nine-cylinder radial aero engine and a coupled steam locomotive without loading a single model file. Both are generated when the page opens: bore and stroke set the crank throw, the crank throw sets the crankcase diameter, and every fin, rail section and propeller blade is a profile revolved, extruded or lofted at runtime. Move any dimension slider and the geometry is rebuilt in front of you. The motion is solved rather than animated, so the pistons follow the exact slider-crank and the locomotive's valve gear closes a real four-bar chain every frame, which means a rod length that cannot physically reach simply refuses to move. Pull either machine apart with the explode slider, switch to the structure view to see the mesh, hover any part to name it, hide whole subassemblies, and read the actual generating calls in the Source panel, printed from the values you set. Every configuration has its own link, and any of them can be exported as a GLB or saved as a PNG frame.",- "link": "/assembly",- "tags": [- "feature"- ]- },- {- "date": "2026-09-05",- "type": "update",- "title": "One command drops a three.ws prop, character or motion clip into your project",- "summary": "npx @three-ws/assets search wooden chair finds it, and npx @three-ws/assets add object:painted_wooden_chair_01 downloads the model into your public folder and prints the tag that renders it, already pointing at your local copy rather than our CDN. Your site keeps working even if we do not. The catalog behind it is the same one the AI tools read: 511 CC0 props, 107 rigged characters and 2,874 motion clips, searchable in one place instead of three separate galleries. It is also a plain HTTP endpoint now, GET /api/catalog, free and open to any origin, so a build script or a site that is not using an AI client can read it too. Adding an asset twice changes nothing the second time, and a file you edited afterwards is never overwritten without asking. Every object is CC0, and the license of anything that is not travels with it in the output.",- "link": "/docs/api-reference",- "tags": [- "feature",- "sdk"- ]- },- {- "date": "2026-09-05",- "type": "update",- "title": "Seven background jobs that were never running now run",- "summary": "Seven scheduled jobs were declared in the platform config but had no matching job on the scheduler, so they had never fired: the companion poll, feedback triage, print-order syncing, the home health alert, the home-relay sweep, web-variant generation for the forge, and the oracle refit. Three of them shipped with live features behind them, which meant those features quietly did nothing on a timer. All seven are now created and enabled on their declared schedules, and a drift check confirms every declared job exists and matches.",- "link": null,- "tags": [- "fix",- "infra"- ]}]}diff --git a/public/changelog.json b/public/changelog.jsonindex 152d3fbd1..c2bc0c86d 100644--- a/public/changelog.json+++ b/public/changelog.json@@ -1,5 +1,5 @@{- "generated_at": "2026-09-09T15:43:39.320Z",+ "generated_at": "2026-09-09T19:42:06.399Z","generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json","site": {"name": "three.ws",@@ -99,6 +99,17 @@"fix"]},+ {+ "date": "2026-09-09",+ "type": "update",+ "title": "Disconnecting a home now stops the screens that were showing it",+ "summary": "A kitchen tablet or wall display left open on a connected home kept saying \"Live\" and kept drawing that house after the home had been disconnected from another device. The connection was really gone, but the open page was never told, so it sat on a stale picture of somebody's house with a green Live badge on it. Disconnecting now closes the live connection and hands every screen still watching a final message that says what happened, and those screens stop asking for more. They keep showing the last state they saw, greyed and dated, with the reason and a Reconnect button, which is what every other kind of drop already did.",+ "link": "/docs/home-scene",+ "tags": [+ "fix",+ "security"+ ]+ },{"date": "2026-09-09","type": "update",@@ -575,6 +586,17 @@"infra"]},+ {+ "date": "2026-09-09",+ "type": "update",+ "title": "The payments status page now says which of two opposite outages it is looking at",+ "summary": "When agent payments stop settling, the status page names the cause. Two very different situations shared one description: either the platform stops offering Solana payment on its price quotes, so nothing is ever attempted, or it keeps offering them and then turns each signed payment away at the final check. Both are fixed by topping up the same wallet, but the evidence sits in opposite places, and the old wording sent whoever was on call to the wrong one. It could even report that Solana had been withdrawn from quotes while the counter printed beside it read zero withdrawals. The status page now names the mechanism and points at the record that actually holds the proof, and the operations runbook carries a table for telling the two apart.",+ "link": null,+ "tags": [+ "fix",+ "infra"+ ]+ },{"date": "2026-09-09","type": "update",@@ -759,6 +781,16 @@"infra"]},+ {+ "date": "2026-09-09",+ "type": "update",+ "title": "www.three.ws now takes you to three.ws, and 3D loads there",+ "summary": "Typing www before the address landed on a copy of the site that looked right and then quietly refused to show any 3D. Avatars and models are served from a media host that only recognises three.ws, so on the www address every model was blocked by the browser and pages that should have shown a character showed an empty box instead. The www address now sends you straight to three.ws, keeping the page you asked for and anything after the question mark, so bookmarks and shared links keep working and everything on them renders.",+ "link": null,+ "tags": [+ "fix"+ ]+ },{"date": "2026-09-09","type": "update",diff --git a/public/changelog.xml b/public/changelog.xmlindex f6da244c7..72f8c4045 100644--- a/public/changelog.xml+++ b/public/changelog.xml@@ -78,6 +78,14 @@<category>improvement</category><description>Two moments on /smart-home were doing the right thing silently. Typing an address that can never work (a 192.168 number, a .local name) has always put the reason under the field straight away, before anything is sent, but the message was carried by colour alone and a screen reader never read it out; it is now announced the moment it appears, and marked in a way that does not depend on seeing red. And a house that has stopped answering, is refusing the stored token, or has simply gone quiet is now labelled as such by the page itself rather than only in the sentence on its card. Nothing about what you see moves: the last known summary of your house stays exactly where it was, with how long ago it last answered, because a home that went quiet should never look like a home that was deleted.</description></item>+ <item>+ <title>Disconnecting a home now stops the screens that were showing it</title>+ <link>https://three.ws/docs/home-scene</link>+ <guid isPermaLink="false">2026-09-09:Disconnecting a home now stops the screens that were showing it</guid>+ <pubDate>Wed, 09 Sep 2026 12:00:00 GMT</pubDate>+ <category>fix</category>+ <description>A kitchen tablet or wall display left open on a connected home kept saying "Live" and kept drawing that house after the home had been disconnected from another device. The connection was really gone, but the open page was never told, so it sat on a stale picture of somebody's house with a green Live badge on it. Disconnecting now closes the live connection and hands every screen still watching a final message that says what happened, and those screens stop asking for more. They keep showing the last state they saw, greyed and dated, with the reason and a Reconnect button, which is what every other kind of drop already did.</description>+ </item><item><title>Endpoint Shopper fits a phone, and says something useful when a run finds nothing to buy</title><link>https://three.ws/shopper</link>@@ -430,6 +438,14 @@<category>fix</category><description>When a Solana payment cannot go through because the wallet paying the network fee is too low, the chain reports it as a generic simulation failure. Our status page grouped all of those together, so the platform's own fee wallet running low looked exactly like a buyer signing from an empty wallet, and both were also counted as payment-network faults. They are now three separate, named outcomes, so the status page says whether the money problem is ours to fix, the buyer's, or neither. Today's reject book was 1,438 rows of the first kind reading as the third.</description></item>+ <item>+ <title>The payments status page now says which of two opposite outages it is looking at</title>+ <link>https://three.ws/changelog</link>+ <guid isPermaLink="false">2026-09-09:The payments status page now says which of two opposite outages it is looking at</guid>+ <pubDate>Wed, 09 Sep 2026 12:00:00 GMT</pubDate>+ <category>fix</category>+ <description>When agent payments stop settling, the status page names the cause. Two very different situations shared one description: either the platform stops offering Solana payment on its price quotes, so nothing is ever attempted, or it keeps offering them and then turns each signed payment away at the final check. Both are fixed by topping up the same wallet, but the evidence sits in opposite places, and the old wording sent whoever was on call to the wrong one. It could even report that Solana had been withdrawn from quotes while the counter printed beside it read zero withdrawals. The status page now names the mechanism and points at the record that actually holds the proof, and the operations runbook carries a table for telling the two apart.</description>+ </item><item><title>The pitch deck now shows the whole character, and says so when the 3D cannot load</title><link>https://three.ws/pitch</link>@@ -566,6 +582,14 @@<category>fix</category><description>The x402 payment rail keeps a set of platform wallets topped up from one funding root, and a recovery run reports why it could not draw on each source. Every source that held less than its configured floor reported the same thing: "at or below floor". That single phrase covered two opposite situations. A wallet holding nothing needs money added from outside. A wallet holding real funds behind a floor somebody set does not: the platform already owns that money, and a floor decision releases it. Because the two printed identically, three separate investigations of the same stalled rail concluded the platform was out of funds while one of its own wallets held roughly forty-five times what the stalled wallet was short. A skipped source now reports how much it is holding and the line it had to stay above, and every run totals the funds it left behind, so an operator can tell at a glance whether the recovery needs a deposit or a decision. The health page and the operations runbook now point at that total instead of asserting that money is required.</description></item>+ <item>+ <title>www.three.ws now takes you to three.ws, and 3D loads there</title>+ <link>https://three.ws/changelog</link>+ <guid isPermaLink="false">2026-09-09:www.three.ws now takes you to three.ws, and 3D loads there</guid>+ <pubDate>Wed, 09 Sep 2026 12:00:00 GMT</pubDate>+ <category>fix</category>+ <description>Typing www before the address landed on a copy of the site that looked right and then quietly refused to show any 3D. Avatars and models are served from a media host that only recognises three.ws, so on the www address every model was blocked by the browser and pages that should have shown a character showed an empty box instead. The www address now sends you straight to three.ws, keeping the page you asked for and anything after the question mark, so bookmarks and shared links keep working and everything on them renders.</description>+ </item><item><title>Your monthly agent turns now count, and locking up never does</title><link>https://three.ws/smart-home/plan</link>diff --git a/public/features.json b/public/features.jsonindex 4e7de4b59..e129cba4b 100644--- a/public/features.json+++ b/public/features.json@@ -1,5 +1,5 @@{- "generated_at": "2026-09-09T15:43:39.309Z",+ "generated_at": "2026-09-09T19:42:06.387Z","generated_by": "scripts/build-page-index.mjs from data/pages.json","site": {"name": "three.ws",diff --git a/server/index.mjs b/server/index.mjsindex c153a86c9..c6edc09ff 100644--- a/server/index.mjs+++ b/server/index.mjs@@ -36,7 +36,7 @@ import { statSync, readFileSync } from 'node:fs';import path from 'node:path';import { pathToFileURL, fileURLToPath } from 'node:url';import { isSsrRoute, renderSsrPage } from './ssr-pages.mjs';-import { hasSeoRoute, renderSeoHead } from './seo-head.mjs';+import { hasSeoRoute, renderSeoHead, CANONICAL_ORIGIN } from './seo-head.mjs';import { renderCrawlerBody } from './crawler-body.mjs';import { isMissingShellPage } from './shell-pages.mjs';import { hardenHeaderBag } from './csp-hashes.mjs';@@ -335,6 +335,31 @@ app.disable('x-powered-by');// images, GLB), so SSE and binary assets pass through untouched.app.use(compression());+// Canonical host. `www.three.ws` resolves to the same load balancer as the apex+// and serves the identical app, but the apex is the only origin the platform+// declares: seo-head.mjs pins every canonical URL to it, and the media bucket's+// CORS read rule allowlists it alone. So a visitor on the www host got a page+// that looked right and then failed every cross-origin media read, because the+// browser sent `Origin: https://www.three.ws` and the bucket answered with no+// Access-Control-Allow-Origin. Measured 2026-09-09 against the live bucket: the+// apex gets its origin echoed on the same object, www gets nothing, so every+// GLB load (fetch/XHR, unlike an <img>) is blocked there and 3D silently dies.+// Collapsing the duplicate host fixes that without widening a bucket policy we+// cannot reach, and removes the duplicate-content host at the same time.+// 308 rather than 301 off the safe methods, so a POST keeps its method and body.+const CANONICAL_HOST = new URL(CANONICAL_ORIGIN).host;+const WWW_HOST = `www.${CANONICAL_HOST}`;++app.use((req, res, next) => {+ const host = String(req.headers.host || '').toLowerCase().split(':')[0];+ if (host !== WWW_HOST) return next();+ // Re-parse rather than concatenating req.url: absolute-form request targets+ // are legal on the wire, and only the path and query may cross over.+ const target = new URL(req.url, CANONICAL_ORIGIN);+ const safeMethod = req.method === 'GET' || req.method === 'HEAD';+ res.redirect(safeMethod ? 301 : 308, `${CANONICAL_ORIGIN}${target.pathname}${target.search}`);+});+// External-dest proxy — before the body parsers (see proxyExternal above).app.use((req, res, next) => {const url = new URL(req.url, 'http://internal');diff --git a/server/seo-head.mjs b/server/seo-head.mjsindex 1d4db18c8..09b6b0fd4 100644--- a/server/seo-head.mjs+++ b/server/seo-head.mjs@@ -26,7 +26,13 @@ import { fileURLToPath } from 'node:url';import { truncateChars } from '../api/_lib/safe-text.js';const __dirname = path.dirname(fileURLToPath(import.meta.url));-const ORIGIN = 'https://three.ws';+// The single origin this site declares. Every canonical URL, Open Graph URL and+// JSON-LD node is pinned to it rather than to the request host, so a page served+// from any other hostname still names this one as itself. server/index.mjs+// imports it to collapse the `www.` duplicate onto it, which keeps the served+// host and the declared host from disagreeing.+export const CANONICAL_ORIGIN = 'https://three.ws';+const ORIGIN = CANONICAL_ORIGIN;function htmlEscape(s) {return String(s)diff --git a/tests/server-canonical-host.test.js b/tests/server-canonical-host.test.jsnew file mode 100644index 000000000..812539a63--- /dev/null+++ b/tests/server-canonical-host.test.js@@ -0,0 +1,92 @@+import { describe, it, expect, beforeAll, afterAll } from 'vitest';+import { request } from 'node:http';+import { startTestServer } from './helpers/test-server.js';++// `www.three.ws` resolves to the same load balancer as the apex and served the+// same app, which reads as harmless until media is involved. The apex is the+// only origin the platform declares (server/seo-head.mjs pins every canonical+// URL to it) and the only origin the media bucket's CORS read rule allowlists,+// so a page loaded from www got its GLB URLs from the API and then had every+// one of them blocked by the browser.+//+// Measured 2026-09-09 against the live bucket, same object, before the fix:+// Origin: https://three.ws -> Access-Control-Allow-Origin: https://three.ws+// Origin: https://www.three.ws -> (no Access-Control-Allow-Origin)+//+// The server now collapses the duplicate host onto the canonical one. Any other+// host has to pass through untouched: Cloud Run's own *.run.app URL answers the+// health probe, and dev.three.ws is a real testing host.++let server;+let PORT;++beforeAll(async () => {+ server = await startTestServer();+ PORT = server.port;+}, 30000);++afterAll(() => {+ server?.close();+});++/** Raw request with an explicit Host header, which fetch() refuses to set. */+function withHost(host, pathname, method = 'GET') {+ return new Promise((resolve, reject) => {+ const req = request(+ { host: '127.0.0.1', port: PORT, path: pathname, method, headers: { host } },+ (res) => {+ res.resume();+ resolve({ status: res.statusCode, location: res.headers.location });+ },+ );+ req.on('error', reject);+ req.end();+ });+}++describe('canonical host redirect', () => {+ it('sends a www page request to the apex, permanently', async () => {+ const res = await withHost('www.three.ws', '/create');+ expect(res.status).toBe(301);+ expect(res.location).toBe('https://three.ws/create');+ });++ it('preserves the query string', async () => {+ const res = await withHost('www.three.ws', '/marketplace?sort=new&page=2');+ expect(res.location).toBe('https://three.ws/marketplace?sort=new&page=2');+ });++ it('ignores the port in the Host header', async () => {+ const res = await withHost('www.three.ws:443', '/');+ expect(res.status).toBe(301);+ expect(res.location).toBe('https://three.ws/');+ });++ it('matches the host case-insensitively', async () => {+ const res = await withHost('WWW.Three.WS', '/');+ expect(res.status).toBe(301);+ });++ it('keeps the method and body on an API write with a 308', async () => {+ const res = await withHost('www.three.ws', '/api/forge-upload', 'POST');+ expect(res.status).toBe(308);+ expect(res.location).toBe('https://three.ws/api/forge-upload');+ });++ it('never rewrites the origin out of an absolute-form request target', async () => {+ const res = await withHost('www.three.ws', 'http://evil.example/steal?a=1');+ expect(res.location).toBe('https://three.ws/steal?a=1');+ });++ it('leaves the apex alone', async () => {+ const res = await withHost('three.ws', '/api/healthz');+ expect(res.status).toBe(200);+ });++ it('leaves every other host alone, including Cloud Run and dev', async () => {+ for (const host of ['three-ws-api-abc123-uc.a.run.app', 'dev.three.ws', 'localhost']) {+ const res = await withHost(host, '/api/healthz');+ expect(res.status, host).toBe(200);+ }+ });+});