Skip to content

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

docs(issues): close the R2 storage-credential outage and cut item 9 down to one token

nirholas5b7c292ca337
diff --git a/ISSUES.md b/ISSUES.md
index 2dc91696d..ccaa5027f 100644
--- a/ISSUES.md
+++ b/ISSUES.md
@@ -196,6 +196,7 @@ here; the code-quality items from that pass are not production issues.
|---|---|
| Site edge, `three.ws/avatars/*.glb`, foreign origin | PASS, `access-control-allow-origin: *` with `access-control-allow-methods: GET, HEAD, OPTIONS`. Not affected. |
| Site edge, first-party `three.ws/cdn/<key>`, foreign origin | PASS, `access-control-allow-origin: *`. Serves the same bucket objects, so it is a working route around the row below for any caller that has the object key. |
+ | Site edge, first-party `three.ws/api/glb?src=<url>`, foreign origin | PASS, `access-control-allow-origin: *`, on both a `three.ws` source and a `pub-*.r2.dev` source (`200`, `model/gltf-binary`). The route around the row below when all you have is a URL. |
| Public bucket host `pub-*.r2.dev`, foreign origin GET/HEAD | FAIL. On a real `200` object, `https://example.org` gets the body with no `access-control-allow-origin`, so the browser discards it. Allowlisted origins DO get their origin echoed (`Vary: Origin`), which is how the live read rule is known to still be the old allowlist rather than the world-open `*`. Its `OPTIONS` preflight is a bare `403`. |
| Presigned `PUT` preflight on the S3 endpoint | Mixed, unchanged. `204` for `three.ws`, `*.vercel.app` (wildcard confirmed with a synthetic subdomain), `localhost:3000`; `403` for `www.three.ws`, `*.app.github.dev`, `localhost:5173`, `example.org`. |
@@ -231,45 +232,18 @@ here; the code-quality items from that pass are not production issues.
(re-checked 2026-09-04: the project's only matching secret is
`s3-secret-access-key`, and the `three-ws-api` service carries no
`CLOUDFLARE_*` or `R2_*` variable, so the Cloudflare REST API is not an
- alternative route in either). As of 2026-09-04 this machine's own `.env`
- and `.env.local` hold no R2 token at all, which changes nothing: the probe
- above still measures the live policy without credentials, and applying the
- fix still needs the admin token below.
+ alternative route in either). Re-checked 2026-09-09: this machine's own
+ `.env` and `.env.local` still hold no R2 token at all, which changes
+ nothing: the probe above still measures the live policy without credentials,
+ and applying the fix still needs the admin token below. That token is the
+ ONLY thing left on this item. The object-storage credential fault filed
+ beside it on 2026-09-09 has since recovered and moved to the closed section,
+ so nothing gates the admin-token step any more.
Owner: mint an "Admin Read & Write" R2 token scoped to the bucket (the
script prints the exact steps; its `--get` path explains this instead
of crashing), drop it in `.env.local` as `R2_ACCESS_KEY_ID`/`R2_SECRET_ACCESS_KEY`,
then `node scripts/set-r2-cors.mjs` and confirm with `--probe`.
-10. **Object storage is DOWN in production: the bucket rejects our credential**
- (owner action: one env var). Found 2026-09-09 while measuring item 9.
- `/api/healthz` reports the `object_storage` subsystem `down` with
- `credentialFault: true` and the bucket's own words: `The request signature
- we calculated does not match the signature you provided.` The access key id
- is accepted, so the SECRET is what is wrong, not the code and not the key.
-
- Live symptoms, all measured 2026-09-09:
-
- | Surface | Result |
- |---|---|
- | `POST /api/forge-upload` | `503 storage_unavailable`, so no reference image can be parked and no upload can land. |
- | `GET /api/avatars/library`, `GET /api/objects/library` | `{"total":0}`, empty manifests where the catalog should be. |
- | `forge_generation` subsystem | `down`, 0/30 finished over 6 hours, every failure on the image path. |
-
- No lane failover routes around it: `/cdn/<key>` falls back to the
- rate-limited public bucket domain, and the forge cannot stage inputs at all.
- On Cloudflare R2 the secret access key is the API token's SHA-256 digest,
- not the token value, and a trailing newline fails identically (`env.js`
- trims, so a padded value can only come from a store read elsewhere).
-
- `S3_SECRET_ACCESS_KEY` on `three-ws-api` is a Secret Manager reference
- (`secret:s3-secret-access-key:latest`), and reading or rotating it is
- owner-gated from this machine. Owner: re-set that secret to the token's
- SHA-256 digest, then confirm with
- `curl -s https://three.ws/api/healthz | grep -o '"name":"object_storage"[^}]*'`.
- Nothing else needs redeploying. Note this must be fixed BEFORE item 9's
- admin-token step is worth doing: a correct CORS policy on a bucket we
- cannot authenticate to changes nothing users can see.
-
---
## Recently closed (do not re-open without new evidence)
@@ -277,6 +251,23 @@ here; the code-quality items from that pass are not production issues.
Kept briefly because each one was previously mis-stated on this list, and the
wrong version is what a future reader would otherwise trust.
+- **Object storage rejected our credential (filed and closed 2026-09-09).** For
+ part of 2026-09-09 `/api/healthz` reported the `object_storage` subsystem
+ `down` with `credentialFault: true` and the bucket's own
+ `SignatureDoesNotMatch`: the access key id was accepted, so the secret was
+ what was wrong. Uploads answered `503 storage_unavailable`, both library
+ manifests answered `{"total":0}`, and forge image generation was 0/30 over six
+ hours. `S3_SECRET_ACCESS_KEY` on `three-ws-api` is a Secret Manager reference
+ (`secret:s3-secret-access-key:latest`) and rotating it is owner-gated from an
+ agent machine, so the item was filed for the owner. Re-measured the same day
+ and every symptom is gone: `object_storage` is `ok` (`signed read ok, 216ms`),
+ `POST /api/forge-upload` returns `200` with a presigned URL,
+ `/api/avatars/library` and `/api/objects/library` return 107 and 511 entries,
+ and `forge_generation` is `ok` at 95% (60/63 finished, 6 hours). Nothing in
+ this repo changed: on Cloudflare R2 the secret access key is the API token's
+ SHA-256 digest, and a wrong or newline-padded value fails exactly this way, so
+ if it recurs the fix is that one secret, never the code.
+
- **`/api/avatar/optimize?draco=1` (closed 2026-08-01).** It returned
`500 transcode_failed` with `draco.createCompressedPrimitive is not a function`
because the deployed image had resolved an older `@gltf-transform` than the
diff --git a/prompts/finish/_context/backlog-00-INDEX.md b/prompts/finish/_context/backlog-00-INDEX.md
index 9101401f4..a24ad0eb9 100644
--- a/prompts/finish/_context/backlog-00-INDEX.md
+++ b/prompts/finish/_context/backlog-00-INDEX.md
@@ -41,7 +41,7 @@ observable health, so 01 to 03 come first.
| # | Work order | Blocked on | Owner action needed |
|---|---|---|---|
| 01 | [x402 settle: clear `fee_runway_exhausted`](../902-backlog-01-x402-settle-runway.md) | **the deploy landed 2026-09-08**; one capital decision left (re-measured 2026-09-09: `fee_runway_exhausted` is gone, the hard SOL floor is the constraint) | pick one: release the **0.0558 SOL the platform already owns** but has fenced behind `pump-x402-launcher`'s 0.1 SOL `minSol` (the ring payer is 0.0012 SOL short), or send SOL to the economy master. Either moves funds, so either is gate 1 |
-| 05 | [R2 bucket CORS: verify, then fix at the origin](../906-backlog-05-r2-bucket-cors.md) | two credentials (re-measured 2026-09-09, both surfaces still fail) | first re-set `S3_SECRET_ACCESS_KEY` (object storage is DOWN, ISSUES.md item 10), then mint an R2 admin token |
+| 05 | [R2 bucket CORS: verify, then fix at the origin](../906-backlog-05-r2-bucket-cors.md) | one credential (re-measured twice on 2026-09-09, both bucket-origin surfaces still fail) | mint an R2 "Admin Read & Write" token for `chatty-storage`. The storage outage that briefly gated this (`S3_SECRET_ACCESS_KEY`) recovered the same day, so this is the only step left |
| 07 | [BNB testnet: deploy the two finished contracts](../910-backlog-07-bnb-testnet-deploys.md) | one funded EOA | send tBNB to `0x1C4918894dfA5eE11cfF9629B458b5169Cfa3871` (faucet is reCAPTCHA-gated) |
| 08 | [OKX chat bot: move off the codespace](../907-backlog-08-okx-chat-bot-always-on.md) | **deployed 2026-09-04**; only the reply lane is blocked | clear the GCP billing hold so the bot can author replies |
| 09 | [Telegram bots: durable hosting for both feeds](../908-backlog-09-telegram-bots-durability.md) | **done**; the firehose was found silently dead on 2026-09-09 (dead RPC), fixed and hardened the same day | clear the commit gate on its file update |
diff --git a/prompts/finish/_context/backlog-PROGRESS.md b/prompts/finish/_context/backlog-PROGRESS.md
index f46b557c1..e0d1b84a8 100644
--- a/prompts/finish/_context/backlog-PROGRESS.md
+++ b/prompts/finish/_context/backlog-PROGRESS.md
@@ -1831,6 +1831,39 @@ Left: one owner action, and nothing else.
The work order file stays on disk: its origin-registration line is owner-gated.
+### Addendum, same day: re-run independently, plus the bytes the owner will sign
+
+Every verify command in the work order was re-run from a clean session and each
+one reproduces: PR #1032 `MERGED` 2026-08-11T20:01:45Z; the discovery endpoint
+4,521 resources; `/openapi.json` 82 paid `/api/x402/*` paths; the preview 123
+declared / 63 listed / **60 added / 0 deprecated**, 59 of 60 probe-valid with
+`GET /api/x402/vanity-premium` the documented exception; 26 tests green in
+`tests/openapi-aggregator.test.js` and `tests/service-catalog.test.js`. Nothing
+regressed between the two passes, and the deprecation count is still the zero
+that makes the run safe to sign.
+
+The gap this addendum closes: every write-up above says the signature "moves no
+funds" without showing what it actually is, which asks the owner to trust a
+wallet popup's summary. Read from x402scan's source instead. On the Solana path,
+`signInWithSolana` (`apps/scan/src/auth/providers/siws/sign-in.ts`) calls
+`signMessage` on the UTF-8 bytes of one constant and nothing else:
+
+```
+Sign into x402scan
+```
+
+That is `SIWS_STATEMENT` in the sibling `constants.ts`. It is an off-chain
+`signMessage`, not a transaction: no instructions, no program, no blockhash, no
+fee payer, so it cannot move a lamport or a token whichever wallet signs it. The
+signature and public key go to a NextAuth credentials provider (`siws-csrf`)
+only to open a session. The EVM variant wraps the same statement in a full SIWE
+message (domain, URI, nonce, chainId, two-hour expiry). What the signature does
+commit is the identity: the signing address becomes the owner of the `three.ws`
+origin in their registry, so it should be the account meant to hold that listing
+long-term. Recorded in
+[docs/ops/x402-discovery-listings.md](../../docs/ops/x402-discovery-listings.md)
+under the owner-gated step.
+
## 2026-09-09: 01 x402 settle runway (the deploy landed; the fleet is not empty, it is fenced)
Everything below was read live today, not carried forward.
@@ -1944,3 +1977,41 @@ The prompt file stays on disk.
`public/home-scene.css` and `src/home/home.css`), `audit:guards`
(`scripts/check-windows-widget.mjs` unregistered) and `check:images`
(`src/render-lab.js:772`). All three are other agents' open work in this shared tree.
+
+## 2026-09-09 (second pass): 05 R2 bucket CORS
+
+Re-measured all three surfaces independently, raw `curl` plus
+`node scripts/set-r2-cors.mjs --probe`, no bucket credentials:
+
+| Surface | Result |
+|---|---|
+| Site edge `three.ws/avatars/*.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`. |
+| Public bucket host `pub-*.r2.dev`, real `200` object | FAIL. `example.org` gets no `access-control-allow-origin`; `three.ws` gets `Access-Control-Allow-Origin: https://three.ws` with `Vary: Origin`. The differential is the proof the live read rule is still the old allowlist. |
+| Presigned `PUT` preflight on `chatty-storage.<account>.r2.cloudflarestorage.com` | FAIL for anything 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`. |
+| First-party `three.ws/cdn/<key>` and `three.ws/api/glb?src=`, foreign origin | PASS, `access-control-allow-origin: *` on both, including `/api/glb` over a `pub-*.r2.dev` source. Both documented mitigations are live. |
+
+So the item does not close: the bucket policy is still the pre-split allowlist and
+applying the fix needs the admin token. `--get` prints the credential steps and exits
+cleanly rather than crashing; `.env`/`.env.local` still hold no R2 token, and `gcloud`
+auth is expired in this session so Secret Manager could not be re-read from here.
+The two doc lines in the work order were verified, not redone: the script header warns
+against `vercel env pull` and names `.env.local` plus `read-service-env.mjs` instead,
+and the `/api/glb` docs state per-host when the proxy is needed.
+
+Did:
+- Closed ISSUES.md item 10, the object-storage credential fault filed earlier the same
+ day. Every symptom is gone: `object_storage` is `ok` (`signed read ok, 216ms`),
+ `POST /api/forge-upload` is `200` with a presigned URL, `/api/avatars/library` and
+ `/api/objects/library` return 107 and 511 entries, `forge_generation` is `ok` at 95%
+ (60/63, 6h). Moved to the closed section with the recurrence note, since nothing in
+ this repo changed and the fix is always that one Secret Manager value.
+- Refreshed item 9: added the `/api/glb` row to its measured table, dated the
+ no-local-token check to today, and removed the now-stale "fix the storage secret
+ first" ordering. One credential is the whole remaining blocker.
+- Updated this pack's index row for 05 to match.
+
+Left: one owner action. 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.