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(prompts): hold order 039 on the owner-gated xAI key, log row 33
nirholasbaf80425a05e
diff --git a/prompts/finish/039-x-grok-17-xai-remote-mcp-e2e.md b/prompts/finish/039-x-grok-17-xai-remote-mcp-e2e.mdindex d3eabc040..7997add4c 100644--- a/prompts/finish/039-x-grok-17-xai-remote-mcp-e2e.md+++ b/prompts/finish/039-x-grok-17-xai-remote-mcp-e2e.md@@ -1,5 +1,7 @@# x-grok 17: prove a Grok model drives three.ws end to end+**Evolve status (2026-10-10):** Tasks 1-3 are built and verified: `scripts/xai-mcp-e2e.mjs`, npm script `e2e:xai-mcp`, unit tests (`tests/xai-mcp-e2e.test.js`, 13 passing) and the `docs/grok-bot.md` section. Step 0 re-derivation confirmed no `GROK_API_KEY`/`XAI_API_KEY` exists anywhere on this machine (not `process.env`, not `.env`/`.env.local`, not the `three-ws-api` Cloud Run service). DoD line 2 (dry run, no key) passes: `npm run e2e:xai-mcp -- --dry-run` prints a request matching xAI's current docs (`https://docs.x.ai/developers/tools/remote-mcp`) field for field, and the plain `npm run e2e:xai-mcp` run names order 927 as the owner of the missing key. DoD line 1 (live run against production) cannot be verified in this session: no xAI key exists to send. That gate is owned by order 927 (`prompts/finish/927-x-grok-46-owner-grok-api-key.md`), already open, and is also logged as row 33 of [_context/production-100-OWNER-ACTIONS.md](_context/production-100-OWNER-ACTIONS.md). Leaving this file in place per the close-out rule for a line blocked on an owner action; retire it once order 927 supplies a key and `npm run e2e:xai-mcp` exits 0 against production.+How to run: paste this file's repo path into a fresh Claude Code chat in this repository and say "run this work order". Runnable now. Needs an xAI key: if none exists anywhere, build and dry-run it, and order 927 supplies the key.## Operating clause (binding)diff --git a/prompts/finish/_context/production-100-OWNER-ACTIONS.md b/prompts/finish/_context/production-100-OWNER-ACTIONS.mdindex dabc2ecc7..934bd4114 100644--- a/prompts/finish/_context/production-100-OWNER-ACTIONS.md+++ b/prompts/finish/_context/production-100-OWNER-ACTIONS.md@@ -9,7 +9,7 @@ it and, if that unblocks a work order, say which one in the owning pack's `produRows carry the date they were added so staleness is visible. Re-verify a row before actingon it; some resolve themselves as other work lands.-## Open rows (2026-10-10: rows 1, 19 and 24 re-measured by the triage sweep; 2026-10-09: rows 1, 2 and 24 re-measured by the triage sweep, row 31 added for the GPU worker redeploy and row 32 for database table retention; row 30 added for the Grok Bot CLI setup rerun; 2026-10-08: row 26 added for the coin-gated MCP catalog regeneration; rows 1 and 2 re-measured by the triage sweep, row 24 added for the paid Solana RPC credits, row 25 added for the MCP connector OAuth deploy; 2026-09-30: row 23 added for the $THREE receiver wallets; 2026-09-29: row 19 re-measured after the agent-sniper deploy; 2026-09-09: row 19 added, and row 1 corrected because its outage premise no longer holds; rows 1, 2, 3, 9, 13, 15 and 16 re-measured 2026-09-04; the former row 18 was cleared that day and its number is not reused; the 2026-09-02 and 2026-08-09 passes are folded in below)+## Open rows (2026-10-10: row 33 added for the xAI MCP e2e key; rows 1, 19 and 24 re-measured by the triage sweep; 2026-10-09: rows 1, 2 and 24 re-measured by the triage sweep, row 31 added for the GPU worker redeploy and row 32 for database table retention; row 30 added for the Grok Bot CLI setup rerun; 2026-10-08: row 26 added for the coin-gated MCP catalog regeneration; rows 1 and 2 re-measured by the triage sweep, row 24 added for the paid Solana RPC credits, row 25 added for the MCP connector OAuth deploy; 2026-09-30: row 23 added for the $THREE receiver wallets; 2026-09-29: row 19 re-measured after the agent-sniper deploy; 2026-09-09: row 19 added, and row 1 corrected because its outage premise no longer holds; rows 1, 2, 3, 9, 13, 15 and 16 re-measured 2026-09-04; the former row 18 was cleared that day and its number is not reused; the 2026-09-02 and 2026-08-09 passes are folded in below)| # | Action | Size | Unblocks | Detail lives in ||---|---|---|---|---|@@ -44,6 +44,7 @@ on it; some resolve themselves as other work lands.| 30 | **After the row 25 deploy, rerun `npx three-ws setup --client grok-bot` against production** (added 2026-10-09 by the evolve loop, x-grok order 037, which is otherwise complete and retired). The CLI (`cd9b7f5be`) reads the live directory, so on production today (`fe2a8b24f`) it connects the free studio `three-ws-studio` and its live check passes; `--auth install` answers that the deployment cannot mint install tokens yet, and `--auth key` without `--connector-key` answers that it cannot mint connector keys from the CLI yet, because the bearer `preset: "connector"` on `POST /api/api-keys` (`3350e513c`) is not deployed. All four modes were verified against a server built from this tree, including a real connector-key mint (scope capped to the connector set, then revoked). Once the deploy lands, run `node packages/three-ws-cli/src/cli.js setup --client grok-bot --yes`, then the same with `--auth install` and `--auth oauth`; each must name `three-ws-grok` and exit 0. Nothing to approve beyond the deploy itself. | three commands after the deploy | Proof the Grok Bot CLI setup reaches `/api/mcp-grok`, install tokens and connector keys on production | [docs/cli.md](../../../docs/cli.md#grok-bot) || 31 | **Redeploy the GPU workers that fetch caller images, so a Wikimedia reference photo stops failing** (added 2026-10-09 by the evolve loop triage sweep). `upload.wikimedia.org` answers httpx's default `python-httpx` agent with 403, so `model-triposg` failed every job whose reference photo was a Wikimedia link before inference (4 logged 403 failures in the 24 hours to 2026-10-09 03:00 UTC). `d886d09e1` sends a descriptive User-Agent from the shared `worker_security.py`, mirrored to all 17 vendored copies, but a worker only picks it up when its image is rebuilt. Start with the one that failed: `gcloud builds submit --config workers/model-triposg/cloudbuild.yaml --region us-central1 --project aerial-vehicle-466722-p5 --substitutions=SHORT_SHA=manual$(date +%s) .` (the command in `workers/model-triposg/README.md`); the other image-fetching workers (`model-trellis`, `model-hunyuan3d`, `rig`, `texture`, `stylize`, `segment`, `remesh`) inherit it on their next routine deploy. Separately worth a look: `model-trellis` was killed by its own liveness probe (`/health` timing out during inference, then signal 9) three times in the 24 hours to 2026-10-09, which left 147 task polls answering 503; not root-caused this session. | one build | Image-to-3D jobs whose reference photo is a Wikimedia link | [workers/model-triposg/README.md](../../../workers/model-triposg/README.md) || 32 | **Decide retention for the six large tables the database retention cron never prunes** (added 2026-10-09 by the evolve loop triage sweep). The Neon footprint reached 11,606 MB, past the 8192 MB high-water mark since 2026-09-09, so five write-heavy crons (`launcher-tick`, `coin-intel-observe`, `smart-money-rollup`, `recompute-reputation`, `intel-learn`) skipped every tick for a month. The sweep raised `DB_RETENTION_HIGH_WATER_MB` to 16384 (config-only, pre-approved; real cap `neon.max_cluster_size` is 16TB), which buys about six weeks at the measured ~114 MB a day. The growth is in tables outside the retention set, and pruning them deletes history, so it is not an agent's call: `oracle_training_set` 1.8 GB (1.37M rows), `x402_self_facilitator_log` 1.4 GB (3.0M rows; the code already names it a product decision about lifetime revenue totals), `firewall_decisions` 1.2 GB, `usage_events` 0.7 GB, `club_tips` 0.6 GB (1.2M rows), `ops_alerts` 0.5 GB (693k one-off `503 settlement_unavailable` rows from July to October). Name a window per table (or keep forever and accept the storage bill); an agent then adds each to `TIME_SERIES_TABLES` in `api/cron/db-retention.js`. | decision | Keeping the write crons running past mid-November without raising the mark again | [docs/ops/db-retention.md](../../../docs/ops/db-retention.md) |+| 33 | **Create a production xAI API key so a Grok model's live MCP calls against three.ws can be proven** (added 2026-10-10 by the evolve loop, x-grok order 039, which already owns this exact gate as order 927: `prompts/finish/927-x-grok-46-owner-grok-api-key.md`). Step 0 re-derivation this session found no `GROK_API_KEY`/`XAI_API_KEY` anywhere: not in `process.env`, not in `.env`/`.env.local`, not on the `three-ws-api` Cloud Run service (`node scripts/read-service-env.mjs '^(GROK\|XAI)_API_KEY$' --names` returned nothing). `scripts/xai-mcp-e2e.mjs` (npm script `e2e:xai-mcp`) is built and verified end to end in dry-run mode: it matches xAI's current Responses API remote-MCP schema field for field and names this gate when no key is found. Create a key at console.x.ai, then either set it directly (`gcloud run services update three-ws-api --region us-central1 --update-env-vars GROK_API_KEY=<key>`) or hand it to order 927 to wire through Secret Manager; afterward `npm run e2e:xai-mcp` should exit 0 against production. | minutes, console only | Closes x-grok order 039's one remaining Definition of Done line, and order 927 | [_context/x-grok-PROGRESS.md](x-grok-PROGRESS.md), 2026-10-10 entry |Deleted 2026-09-01: the former row 5 (`WALLET_ENCRYPTION_KEY_PREVIOUS` policy), whichdeclared itself "delete on reading" and had outlived that by three weeks.diff --git a/prompts/finish/_context/x-grok-PROGRESS.md b/prompts/finish/_context/x-grok-PROGRESS.mdindex 6fbaf43aa..87578803a 100644--- a/prompts/finish/_context/x-grok-PROGRESS.md+++ b/prompts/finish/_context/x-grok-PROGRESS.md@@ -204,3 +204,12 @@ Cross-session handoff for the `x-grok-` orders ([x-grok-00-CONTEXT.md](x-grok-00- Checks: `npx vitest run tests/tutorials-manifest.test.js` 7 passed (fixed one failure caused by the new doc having no manifest entry); `npx vitest run tests/grok-page.test.js` 9 passed (confirms `/grok` wiring unaffected). `npx vitest run tests/mcp-schema.test.js` has 3 pre-existing failures from `public/mcp-catalog.json` drift caused by unrelated concurrent-agent commits (`ca0809923`, `0176eedef`), neither file touched in this diff; left alone per the self-unblock playbook. `check:rules` clean on all 6 committed files (one em-dash violation in the doc's own recipe headings was fixed before commit).- No deploy gate implied by this order; the doc and its links are a docs-only change reachable on the next deploy like any other page. No migration.- Judgment calls: recipe 3's "teammate's photo" and recipe 4's "X post's image" used real, freely licensed stand-in images rather than a real teammate or a real X post, since the order needs a genuine image-to-3D run, not a specific source; recipe 2's asset pack documents its partial 1-of-5 capture honestly rather than running all 5 or fabricating the rest, to keep the session inside a reasonable generation budget; `safeLookAtModel()`'s non-fatal design was concretely validated in the final run (two real timeouts, both logged as notes, run still completed with valid output).++## 2026-10-10: order 039 (xAI remote-MCP e2e proof) built, one DoD line owner-gated (order file kept)++- Step 0 measured: `node scripts/read-service-env.mjs '^(GROK|XAI)_API_KEY$' --names` printed nothing, `grep` of `.env`/`.env.local` found neither key, and no key exists in `process.env` either; no xAI key exists anywhere on this machine. Fetched the current remote-MCP schema straight from `docs.x.ai` rather than guessing: `https://docs.x.ai/developers/tools/remote-mcp` gives the exact tool shape (`type: "mcp"`, `server_url`, `server_label`, optional `server_description`/`allowed_tools`/`authorization`/`headers`); `https://docs.x.ai/developers/tools/tool-usage-details` confirms the Responses API output item type for a server-executed call is `mcp_call`.+- Shipped: `scripts/xai-mcp-e2e.mjs` (`parseArgs`, `buildRequest`, `resolveKey`, `mcpCalls`, `finalText`, `matchesToolName`, CLI guarded by the `mcp-client-probe.mjs` entrypoint-check convention), npm script `e2e:xai-mcp`, `tests/xai-mcp-e2e.test.js` (13 tests), and a new "Prove a real Grok model drives it" section in `docs/grok-bot.md` between the connector check and the error table.+- DoD 1 (live run against production) cannot be verified this session: no key exists to send. DoD 2 passes: `npm run e2e:xai-mcp -- --dry-run` sends nothing and prints a request matching the docs field for field (`model`, `input: [{role: "user", content: ...}]`, `tools: [{type: "mcp", server_url: "https://three.ws/api/mcp-grok", server_label: "three-ws", server_description: ...}]`); the plain `npm run e2e:xai-mcp` run (no key) exits 1 and names order 927 by file path as the owner of the missing key.+- Checks: `npx vitest run tests/xai-mcp-e2e.test.js` 13 passed; `npx vitest run tests/grok-bot-doc.test.js` 10 passed; `npm run check:rules -- --paths scripts/xai-mcp-e2e.mjs tests/xai-mcp-e2e.test.js package.json docs/grok-bot.md` clean; `npm run audit:docs` clean.+- Owner row 33 added to `_context/production-100-OWNER-ACTIONS.md`, pointing at order 927 (already open, already the designated owner of this exact gate per this campaign's "every gate is batched into the order that owns it" convention) rather than duplicating its content. Order file kept in place with a dated "Evolve status" paragraph under its title naming the one remaining line; retire both 039 and 927 together once a key lands and `npm run e2e:xai-mcp` exits 0 against production.+- Judgment calls: `matchesToolName()` accepts either a bare tool name or a `{server_label}.{name}`-prefixed one in the `mcp_call` item's `name` field, since xAI's own docs use the prefixed form only for billing/usage categorization and do not pin which form appears on the item itself; kept the live `npm run e2e:xai-mcp` command out of a `` ```bash `` fence in the doc (prose only) since `scripts/run-doc-samples.mjs` executes every fenced bash block and the live command fails with no key today, while the `--dry-run` variant (always safe) stayed as the doc's one executable sample.