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.

prompts(partners): log order 091's owner-gated Shopify registration step

nirholas53a55ccdd272
diff --git a/prompts/finish/091-partners-08-shopify-product-media.md b/prompts/finish/091-partners-08-shopify-product-media.md
index 0f460b5b1..724c94fbf 100644
--- a/prompts/finish/091-partners-08-shopify-product-media.md
+++ b/prompts/finish/091-partners-08-shopify-product-media.md
@@ -1,5 +1,7 @@
# partners 08: A Shopify app that turns product photos into 3D product media
+**Evolve status (2026-10-13):** Everything except a live Shopify verification is done. The app is built: OAuth install/callback with real query-string HMAC verification and offline-token exchange ([`api/shopify/install.js`](../../api/shopify/install.js), [`api/shopify/callback.js`](../../api/shopify/callback.js), [`api/_lib/shopify/hmac.js`](../../api/_lib/shopify/hmac.js)), session-token-authenticated embedded calls ([`api/_lib/shopify/session-token.js`](../../api/_lib/shopify/session-token.js), [`api/_lib/shopify/auth-request.js`](../../api/_lib/shopify/auth-request.js)), the embedded admin UI listing products with generate/preview/attach and bulk mode with real per-item status ([`pages/shopify-app.html`](../../pages/shopify-app.html), [`src/shopify-app/app.js`](../../src/shopify-app/app.js)), the photo-to-GLB-to-`productCreateMedia` pipeline through three.ws's own `/api/forge` and staged uploads ([`api/shopify/media/`](../../api/shopify/media/), [`api/_lib/shopify/media.js`](../../api/_lib/shopify/media.js)), a usage-based Billing API subscription in test mode ([`api/shopify/billing/`](../../api/shopify/billing/), [`api/_lib/shopify/billing.js`](../../api/_lib/shopify/billing.js)), the three mandatory privacy webhooks plus `app/uninstalled`, HMAC-verified and delivery-deduplicated ([`api/shopify/webhooks/`](../../api/shopify/webhooks/), [`api/_lib/shopify/webhook-verify.js`](../../api/_lib/shopify/webhook-verify.js)), the migration, docs, STRUCTURE.md row, changelog entry, and the submission packet with exact Partner Dashboard settings and App Store listing copy ([`marketing/growth/submissions/shopify-app.md`](../../marketing/growth/submissions/shopify-app.md)). `tests/shopify-hmac.test.js`, `tests/shopify-session-token.test.js`, `tests/shopify-store.test.js`, `tests/shopify-graphql.test.js`, and `tests/shopify-webhooks.test.js` pass (42/42), the HMAC and JWT checks are real crypto round trips, and the store tests run against a real PGlite-backed database with the production schema, no mocked SQL. Two judgment calls: the app lives under `api/shopify/` + `api/_lib/shopify/` + `src/shopify-app/` + `pages/shopify-app.html` rather than `integrations/shopify/`, matching this repo's actual convention for an embedded web integration (the Discord Activity, built the same shape, not `integrations/discord-activity/`); and it is built directly against Shopify's documented REST/OAuth/GraphQL contracts and the App Bridge CDN script rather than the `@shopify/shopify-api`/`shopify-app-remix` npm libraries, matching how every other third-party integration in this codebase (Discord, Google) is built. What cannot be verified from this workspace: no Shopify Partner app has ever been registered in production (`node scripts/read-service-env.mjs '^SHOPIFY' --names` returns zero matches), so the Definition of Done's live-storefront screenshot, test-mode Billing charge, and real webhook test-delivery lines are untestable until the owner registers one, and the migration is deliberately left unapplied for the same reason (`npm run db:status`: `[pending]`). See [OWNER-ACTIONS row 54](_context/production-100-OWNER-ACTIONS.md) for the exact remaining steps. Leaving this file in place until that registration and live verification land.
+
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, no gate.
## Operating clause (binding)
diff --git a/prompts/finish/_context/partners-PROGRESS.md b/prompts/finish/_context/partners-PROGRESS.md
index 7e1f9def5..95804bbb2 100644
--- a/prompts/finish/_context/partners-PROGRESS.md
+++ b/prompts/finish/_context/partners-PROGRESS.md
@@ -420,3 +420,70 @@ library all run against infrastructure (the `model-video2motion` worker, `/api/m
missing credential. Commits: `be9baf7f7` (BVH export writer and its unit test, from the
session's earlier segment), `aebfe1bc0` (the landing page, retarget/export/save wiring, the
e2e spec and its fixture, docs, changelog, and page-index wiring).
+
+## 2026-10-13: order 091 built and verified end to end; Shopify Partner app registration remains, order file stays open
+
+Order 091 asked for a Shopify app that turns a product photo into 3D product media on the
+storefront. Built directly against Shopify's documented OAuth/session-token/GraphQL/Billing
+contracts (no `@shopify/shopify-api` or `shopify-app-remix`), matching how Discord and Google
+are integrated elsewhere in this codebase, and placed the code under `api/shopify/`,
+`api/_lib/shopify/`, `src/shopify-app/` and `pages/shopify-app.html` rather than the order's
+literal `integrations/shopify/`, matching the Discord Activity's actual shape. Both are one-
+line judgment calls, stated in the order file's own Evolve status paragraph.
+
+- **The app (task 1).** OAuth install (`api/shopify/install.js`) and callback
+ (`api/shopify/callback.js`) with real query-string HMAC verification
+ (`api/_lib/shopify/hmac.js`) and offline-token exchange; the embedded admin UI
+ (`pages/shopify-app.html`, `src/shopify-app/app.js`) authenticates every call with an App
+ Bridge session token (`api/_lib/shopify/session-token.js`, `api/_lib/shopify/auth-request.js`)
+ rather than a cookie, and lists the shop's products with their current 3D-media status
+ (`api/shopify/products.js`, `api/_lib/shopify/media.js`'s `listProducts`).
+- **The flow (task 2).** Generate (`api/shopify/media/create.js`) starts a Forge job through
+ three.ws's own `/api/forge` pipeline (`api/_mcp-studio/forge-client.js`, no new generation
+ logic); status polling (`api/shopify/media/status.js`) surfaces real per-item state; attach
+ (`api/shopify/media/attach.js`) stages the GLB upload and calls `productCreateMedia` with
+ `mediaContentType: MODEL_3D` (`api/_lib/shopify/media.js`'s `stageAndUploadGlb`/
+ `attachModel3d`), so Shopify derives the USDZ for iOS AR Quick Look from the one upload.
+ Bulk mode in the admin UI runs three jobs at a time with a live per-card status badge.
+- **Billing (task 3).** Usage-based subscription through the Billing API, test mode until the
+ app has Public distribution (`api/_lib/shopify/billing.js`, `api/shopify/billing/*.js`);
+ the admin UI opens Shopify's confirmation page with `window.open(url, '_top')` to escape the
+ embedded iframe, the one UI judgment call on this order. Cannot be proven against a real
+ development store from this workspace (see below).
+- **Compliance (task 4).** The three mandatory privacy webhooks (`customers/data_request`,
+ `customers/redact`, `shop/redact`) plus `app/uninstalled`, all HMAC-verified
+ (`api/_lib/shopify/webhook-verify.js`) and delivery-deduplicated against a
+ `(topic, delivery_id)` ledger so a Shopify retry never double-processes; scopes kept to
+ `read_products,write_products`, nothing wider.
+- **Submission package (task 5).** `marketing/growth/submissions/shopify-app.md`: exact
+ Partner Dashboard settings (App URL, redirect, scopes, embedding), the App Store listing
+ copy (name, tagline, description, category, pricing), and the owner order 939 steps.
+- **Docs (task 6).** `docs/shopify-app.md` (How it works, Auth flow, Billing, Privacy
+ webhooks, Owner setup), `STRUCTURE.md` row, `data/changelog.json` entry dated 2026-10-13,
+ `data/pages.json` entries for `/docs/shopify-app` and a non-indexable `/apps/shopify`
+ (it only functions inside Shopify's admin iframe).
+- **`npm test`**: 44 failed files / 2353 passed (80 failed tests, 35359 passed, 244 skipped).
+ None of the five new Shopify test files are in the failing set
+ (`npx vitest run tests/shopify-{hmac,session-token,store,graphql,webhooks}.test.js`: 5
+ files, 42/42 passing). Spot-checked the one failure closest to this order's own edits
+ (`tests/pages-routes.test.js`'s "declares each path exactly once"): the reported duplicates
+ are `/docs/grok`, `/docs/grok-bot`, `/grok`, `/tutorials/grok-bot-recipes`, none of them
+ Shopify paths, and `grep` confirms `/apps/shopify` and `/docs/shopify-app` each appear
+ exactly once in `data/pages.json`. The rest of the failing set is OAuth/MCP-wallet/grok/
+ x-content infrastructure this order never touched, consistent with the pre-existing,
+ environment-dependent baseline orders 087-090 each independently measured in this same
+ shared worktree.
+- **`npm run audit:docs`**: 21 findings, the same pre-existing set documented on orders
+ 089/090; none reference `docs/shopify-app.md`, `/apps/shopify`, or `/docs/shopify-app`.
+- **`npm run check:rules`** against every touched path across both commits: `OK: no hard-rule
+ violations in the added lines`.
+
+One step is owner-gated (CLAUDE.md gate 2: no agent may contact a third party or create
+accounts) and cannot be done inside this session: register a Shopify Partner app, set its
+Cloud Run env vars, apply the pending migration, and verify the photo-to-3D flow on a real
+development store (storefront screenshot, a completed test-mode Billing charge, and real
+webhook test deliveries) before submitting it to the App Store. Logged as row 54 in
+[_context/production-100-OWNER-ACTIONS.md](production-100-OWNER-ACTIONS.md). The order file
+stays in place (not deleted) until that registration and live verification land. Commits:
+`7b52431a9` (feature, docs, changelog, tests), `b7b55dbf3` (owner-actions row and the order
+file's Evolve status paragraph).
diff --git a/prompts/finish/_context/production-100-OWNER-ACTIONS.md b/prompts/finish/_context/production-100-OWNER-ACTIONS.md
index 448fc9ff2..4a6c2454d 100644
--- a/prompts/finish/_context/production-100-OWNER-ACTIONS.md
+++ b/prompts/finish/_context/production-100-OWNER-ACTIONS.md
@@ -67,6 +67,7 @@ on it; some resolve themselves as other work lands.
| 51 | **Publish and submit the LiveKit and Pipecat avatar integrations** (added 2026-10-13 by the evolve loop closing out order 087-partners-04). Both packages (`integrations/livekit/livekit-plugins-threews/`, `integrations/pipecat/pipecat-threews/`) are built, tested (unit tests, ruff lint/format), and verified end to end against a real local `livekit-server` with real browser automation driving the actual avatar lipsync and gesture off a live agent/bot in both frameworks (Playwright specs, both passing; the Pipecat run also captured the 30-60s demo video `COMMUNITY_INTEGRATIONS.md` asks for, saved locally and gitignored). Three remaining steps are all owner actions (CLAUDE.md gate 2, external posting/publishing): (a) `python -m build && twine upload` (or equivalent) to publish each package to PyPI as `livekit-plugins-threews` and `pipecat-threews`; (b) open the LiveKit plugin pull request against `livekit/agents` using the title, description and verification packet in [`marketing/growth/submissions/livekit-avatar-plugin.md`](../../marketing/growth/submissions/livekit-avatar-plugin.md), then apply to the LiveKit Startups program; (c) open the Pipecat documentation pull request against `pipecat-ai/pipecat` using the three files in `integrations/pipecat/pipecat-threews/docs-submission/` and the text in [`marketing/growth/submissions/pipecat-integration.md`](../../marketing/growth/submissions/pipecat-integration.md), attaching the local demo video. | two PyPI publishes + two pull requests + one program application | LiveKit plugin PR 938/Startups 939, Pipecat community-integration listing | [087-partners-04-livekit-pipecat-avatar.md](../087-partners-04-livekit-pipecat-avatar.md) |
| 52 | **Register the Discord application and verify the Activity in a real Discord client** (added 2026-10-13 by the evolve loop closing out order 088-partners-05). The shared Forge room Activity ([`src/discord-activity/app.js`](../../src/discord-activity/app.js), [`api/gateway/discord-activity-*`](../../api/gateway/), migration [`20261015050000_discord_activity_rooms.sql`](../../api/_lib/migrations/20261015050000_discord_activity_rooms.sql)) is built and unit-tested (`tests/discord-activity-store.test.js`, `tests/discord-activity-auth.test.js`, 13/13 passing), and the OAuth2 token-exchange path was proven live against Discord's real endpoint (`curl` to `https://discord.com/api/oauth2/token` with a placeholder client returned Discord's real, documented `invalid_client` 400, matching the error path the code already surfaces). No Discord application has ever been registered in this production project (`node scripts/read-service-env.mjs '^DISCORD' --names` returns zero matches), so nothing past that point is testable from this workspace. Full step-by-step with exact Developer Portal settings and the Discovery listing copy: [`marketing/growth/submissions/discord-activity.md`](../../marketing/growth/submissions/discord-activity.md). Summary: (a) create the Discord application and enable Activities, pointing the root URL Mapping at `/discord-activity` and adding a `cdn` URL Mapping for the R2 host; (b) set the OAuth2 redirect and `identify` scope; (c) `gcloud run services update three-ws-api --region us-central1 --update-env-vars DISCORD_CLIENT_ID=...,DISCORD_CLIENT_SECRET=...,DISCORD_PUBLIC_KEY=...` (never `--set-env-vars`); (d) `npm run db:status` then `npm run db:migrate` to create the `discord_activity_rooms`/`discord_activity_events` tables (applies immediately, no dry run); (e) create a test Discord server, invite two accounts, open the Activity in a voice channel on both, and confirm both see the same prompt/generation/vote state (screenshots); (f) submit the Discovery listing using the exact copy in the submission file. | one Developer Portal app + one env update + one migration apply + one live two-account verification + one Discovery submission | Turns on the Discord Activity for real users; completes order 088's two-accounts-in-Discord Definition of Done line | [088-partners-05-discord-activity.md](../088-partners-05-discord-activity.md), [marketing/growth/submissions/discord-activity.md](../../marketing/growth/submissions/discord-activity.md) |
| 53 | **Reset or upgrade the Birdeye API plan (`birdeye-api-key` Secret Manager secret, used by `three-ws-api`).** Added 2026-10-13 by the triage-lane sweep (fifth pass): the deep sweep's `pump-price-history-upstreams-502` finding on `/api/pump/price-history` traced to Birdeye's OHLCV rung. Confirmed live: `curl -H "X-API-KEY: $BIRDEYE_API_KEY" -H "x-chain: solana" "https://public-api.birdeye.so/defi/ohlcv?..."` answers `{"success":false,"message":"Compute units usage limit exceeded"}` (HTTP 400). 5 occurrences of this exact message in the service logs over the last 24h, spaced roughly every 6 hours, meaning the plan's compute-unit allowance is exhausted well before each period rolls over. While Birdeye is out, affected mints fall back to GeckoTerminal alone (`api/_lib/birdeye.js`, `api/pump/price-history.js`); a mint with no cache yet on both rungs 502s cleanly rather than guessing. No in-repo code or config change raises a third-party compute-unit cap. | one plan upgrade decision | Keeps the pump.fun price-history chart populated from Birdeye instead of occasionally falling through to a 502 | [docs/ops/production-log-triage.md](../../docs/ops/production-log-triage.md) |
+| 54 | **Register the Shopify Partner app, run its migration, and verify the photo-to-3D flow on a development store** (added 2026-10-13 by the evolve loop closing out order 091-partners-08). The embedded app ([`api/shopify/`](../../api/shopify/), [`api/_lib/shopify/`](../../api/_lib/shopify/), [`pages/shopify-app.html`](../../pages/shopify-app.html), [`src/shopify-app/app.js`](../../src/shopify-app/app.js), migration [`20261015060000_shopify_app.sql`](../../api/_lib/migrations/20261015060000_shopify_app.sql)) is built and unit-tested (`tests/shopify-hmac.test.js`, `tests/shopify-session-token.test.js`, `tests/shopify-store.test.js`, `tests/shopify-graphql.test.js`, `tests/shopify-webhooks.test.js`, 42/42 passing, real HMAC/JWT round trips and a real PGlite-backed store, no mocked SQL semantics). No Shopify Partner app exists in production yet (`node scripts/read-service-env.mjs '^SHOPIFY' --names` returns zero matches), so nothing past OAuth is testable from this workspace, and the migration is deliberately left unapplied (`npm run db:status` lists it `[pending]`): this evolve session is denied every owner-gated action, applying migrations to the production database included. Full step-by-step with exact Partner Dashboard settings and the App Store listing copy: [`marketing/growth/submissions/shopify-app.md`](../../marketing/growth/submissions/shopify-app.md). Summary: (a) create the Shopify Partner account and app, App URL `https://three.ws/apps/shopify`, redirect `https://three.ws/api/shopify/callback`; (b) set scopes to `read_products,write_products` and enable embedding; (c) `gcloud run services update three-ws-api --region us-central1 --update-env-vars SHOPIFY_API_KEY=...,SHOPIFY_API_SECRET=...,SHOPIFY_APP_URL=https://three.ws` (never `--set-env-vars`), plus `VITE_SHOPIFY_API_KEY` as a build-time variable before the next frontend build; (d) `npm run db:status` then `npm run db:migrate` to create the four `shopify_*` tables (applies immediately, no dry run); (e) create a development store, install the app, generate and attach a model, confirm it renders on the live storefront product page, approve a test-mode Billing charge, and send test webhook deliveries for the three mandatory topics plus `app/uninstalled` from the Partner Dashboard (screenshots); (f) submit the App Store listing using the exact copy in the submission file. | one Partner Dashboard app + one env update + one migration apply + one live development-store verification + one App Store submission | Turns on the Shopify app for real merchants; completes order 091's three live-verification Definition of Done lines | [091-partners-08-shopify-product-media.md](../091-partners-08-shopify-product-media.md), [marketing/growth/submissions/shopify-app.md](../../marketing/growth/submissions/shopify-app.md) |
Deleted 2026-09-01: the former row 5 (`WALLET_ENCRYPTION_KEY_PREVIOUS` policy), which
declared itself "delete on reading" and had outlived that by three weeks.