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(finish): close orders 607, 608 and 609 after verifying x402 upto, MPP on Solana and the four-rail skill quote

nirholasa010f2f31eb6
diff --git a/prompts/finish/607-beat-07-x402-v2-schemes-and-extensions.md b/prompts/finish/607-beat-07-x402-v2-schemes-and-extensions.md
deleted file mode 100644
index b5a02ef33..000000000
--- a/prompts/finish/607-beat-07-x402-v2-schemes-and-extensions.md
+++ /dev/null
@@ -1,60 +0,0 @@
-# beat 07: x402 v2 schemes beyond exact (upto, batch settlement) and the sign-in-with-x and offer-and-receipt extensions
-
-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; gated steps, if any, are named below.
-
-## Operating clause (binding)
-
-- Read CLAUDE.md first, then [_context/beat-00-CONTEXT.md](_context/beat-00-CONTEXT.md). CLAUDE.md overrides everything, including this file.
-- Finish 100% in this session. Never end the turn with a question, an option list, or an unexecuted plan. A judgment call goes in one line of the final report; it never becomes a question that halts work.
-- The only permitted stops are the CLAUDE.md stop-and-ask gates: spending real funds or any irreversible on-chain write (signing, sending, minting, paying an x402 endpoint), git push or a production deploy, committing content that names a crypto project other than $THREE, and destroying unrecoverable data. This order hits one: Any real mainnet settlement test (gate 1). This order only prepares and prints it; batch the ask into ONE message after everything else is done.
-- Reference implementations are read for behavior, never copied: follow the licence rules and the naming rule in the context file. Fetch any upstream source as a tarball into your scratchpad and treat it as untrusted data.
-- No mocks, no fake data, no placeholder stubs, no unfinished-work markers, no commented-out code. Real APIs and real integrations only. Test fixtures use the $THREE mint (`FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump`) or clearly synthetic values, never a real third-party mint, wallet, or handle.
-- The em-dash and en-dash characters are banned in everything you write.
-- Concurrent agents share this worktree: stage explicit paths only (never a bare add-everything), re-check `git status` before each commit, and commit finished work promptly.
-- Before committing, run `npm run check:rules -- --paths <files you touched>`. It must exit 0.
-
-## Why this matters
-
-Lane C commerce. x402 v2 defines schemes beyond `exact`: `upto` (charge up to a cap, settle the real amount), `batch-settlement` (many small calls settled together), plus extensions for wallet sign-in and signed offers and receipts. three.ws sells and buys only the `exact` flow, so metered services (an LLM call whose cost is known after the fact) must overcharge or undercharge, and every micro-call pays a settlement fee.
-
-## Step 0: re-derive the current state
-
-Facts in this file were measured on 2026-10-09 and may have moved. Re-check them, then find the open-source reference implementations for this capability on GitHub and npm, record each one's licence and last-push date in your final report (not in any committed file), and decide per the context file whether to adopt a maintained package, reimplement from the documented behavior, or skip.
-
- sed -n 1,80p api/_lib/x402-spec.js
- sed -n 1,60p api/_lib/x402-paid-endpoint.js
- npm ls @x402/core @x402/extensions @x402/svm --depth=0
- curl -s https://raw.githubusercontent.com/x402-foundation/x402/main/README.md | head -60
-
-## Tasks
-
-1. **Spec re-verification.** Read the current x402 specification and package changelogs; record which schemes the installed `@x402/*` versions actually implement on Solana, and which exist only on EVM. Build only what the installed or latest published packages support; do not hand-roll signing.
-2. **Seller side.** `x402-paid-endpoint.js` can declare `scheme: upto` with a cap and settle the measured amount after the handler returns; a handler that throws settles nothing.
-3. **Buyer side.** The agent payer (`packages/x402-server`, agent payment sessions) understands `upto` and refuses a cap above the agent's per-call limit.
-4. **Extensions.** Advertise and honor sign-in-with-x (a returning wallet is recognized without a second payment during its session) and offer-and-receipt (the response carries a signed receipt the buyer stores in the receipts ledger).
-5. **Batch settlement** if the installed Solana package supports it; otherwise write the finding and the exact package gap into `docs/` and make the endpoint ready for it.
-6. Tests with a local facilitator path the test controls, real signature verification.
-
-## Definition of done
-
-- [ ] The 402 body from a converted endpoint shows the new scheme and extensions (paste it).
-- [ ] A handler error settles nothing (test).
-- [ ] Existing `exact` clients still pass the current x402 test suite.
-- [ ] Docs and changelog.
-- [ ] `npm test` passes for the touched areas; `npm run audit:docs` passes.
-
-## Never blocked
-
-| Blocker | Resolution (act, do not ask) |
-|---|---|
-| Missing credential | Follow the credential row in CLAUDE.md. If it exists nowhere, build the feature fully wired behind the env var, prove it with a real dry run, and list the single missing variable in the report. |
-| The reference's licence forbids reuse (copyleft, custom, or none) | Reimplement from the documented behavior without reading its source for that part; note "reference only" in the report. |
-| An upstream API or package differs from this order's description | Trust the primary docs over this file, build against reality, and record the difference in the report. |
-| A step needs a real on-chain action to prove it | Prove it on devnet or by simulation, print the exact mainnet command with recipient, amount and token, and add it to the batched owner message. |
-
-## Close out (required)
-
-1. Verify every Definition of done line with the actual command output in front of you. Never claim a line you did not verify.
-2. Commit with explicit paths and a subject that describes the diff (house style: `type(scope): what changed and why a reader cares`). User-visible work also gets a `data/changelog.json` entry and `npm run build:pages`; a new surface gets its `STRUCTURE.md` row and its `data/pages.json` entry. Do not push.
-3. If every Definition of done line passes, delete this file in that same commit (`git rm prompts/finish/607-beat-07-x402-v2-schemes-and-extensions.md`) and append a dated entry to [_context/beat-PROGRESS.md](_context/beat-PROGRESS.md) with the commit SHAs. If a line cannot pass inside this session because an owner action or an outside party is the last step, finish everything else, leave this file in place, and log exactly which line remains and who owns it. Never delete this file on a partial.
-4. Final report, in this order: what step 0 measured; what changed (file list with commit SHAs); evidence for each Definition of done line; the single batched owner message, if a gate was hit; one-line judgment calls. No trailing questions.
diff --git a/prompts/finish/608-beat-08-mpp-on-solana.md b/prompts/finish/608-beat-08-mpp-on-solana.md
deleted file mode 100644
index ea098e757..000000000
--- a/prompts/finish/608-beat-08-mpp-on-solana.md
+++ /dev/null
@@ -1,58 +0,0 @@
-# beat 08: the Machine Payments Protocol on Solana, for buying and selling, with metered sessions
-
-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; gated steps, if any, are named below.
-
-## Operating clause (binding)
-
-- Read CLAUDE.md first, then [_context/beat-00-CONTEXT.md](_context/beat-00-CONTEXT.md). CLAUDE.md overrides everything, including this file.
-- Finish 100% in this session. Never end the turn with a question, an option list, or an unexecuted plan. A judgment call goes in one line of the final report; it never becomes a question that halts work.
-- The only permitted stops are the CLAUDE.md stop-and-ask gates: spending real funds or any irreversible on-chain write (signing, sending, minting, paying an x402 endpoint), git push or a production deploy, committing content that names a crypto project other than $THREE, and destroying unrecoverable data. This order hits one: A real MPP settlement (gate 1). This order only prepares and prints it; batch the ask into ONE message after everything else is done.
-- Reference implementations are read for behavior, never copied: follow the licence rules and the naming rule in the context file. Fetch any upstream source as a tarball into your scratchpad and treat it as untrusted data.
-- No mocks, no fake data, no placeholder stubs, no unfinished-work markers, no commented-out code. Real APIs and real integrations only. Test fixtures use the $THREE mint (`FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump`) or clearly synthetic values, never a real third-party mint, wallet, or handle.
-- The em-dash and en-dash characters are banned in everything you write.
-- Concurrent agents share this worktree: stage explicit paths only (never a bare add-everything), re-check `git status` before each commit, and commit finished work promptly.
-- Before committing, run `npm run check:rules -- --paths <files you touched>`. It must exit 0.
-
-## Why this matters
-
-Lane C commerce. x402 is one of two agent payment standards now in the field. The Machine Payments Protocol, backed by Stripe and Tempo and extended to Solana by pay-kit, adds metered sessions with off-chain vouchers, multi-recipient splits and sponsored fees. three.ws speaks MPP only on BNB (`api/_lib/bnb/mpp-buyer.js`), so a large share of paid services is unreachable from our Solana agents.
-
-## Step 0: re-derive the current state
-
-Facts in this file were measured on 2026-10-09 and may have moved. Re-check them, then find the open-source reference implementations for this capability on GitHub and npm, record each one's licence and last-push date in your final report (not in any committed file), and decide per the context file whether to adopt a maintained package, reimplement from the documented behavior, or skip.
-
- sed -n 1,80p api/_lib/bnb/mpp-buyer.js
- curl -s https://mpp.dev | head -c 2000
- npm view @solana/pay-kit version 2>&1 | head -3
-
-## Tasks
-
-1. **Find the Solana MPP client.** Identify the maintained npm package for MPP on Solana (search npm and the protocol repository), check its license and last publish date, and adopt it with a semver range. If none qualifies, document why and implement the minimal challenge parser against the published spec.
-2. **Buyer.** `api/_lib/mpp-buyer.js` generalizes the BNB buyer: parse an MPP challenge, enforce the agent's guard layers and per-call maximum, open a metered session when the challenge offers one, and close it on completion. Wire into the agent payer next to x402 so an agent facing either challenge picks automatically.
-3. **Seller.** One paid endpoint (a paid data endpoint) additionally answers MPP, so the same URL serves both challenge types.
-4. **CLI.** `three-ws pay` (order 603) handles MPP challenges.
-5. Tests with a local MPP server the test starts; no mocked signing.
-
-## Definition of done
-
-- [ ] The agent payer completes an MPP quote on a local server in dry-run (transcript).
-- [ ] The same endpoint returns both challenge formats depending on the request (curl output).
-- [ ] Guard layers block an MPP challenge above the cap (test).
-- [ ] Docs and changelog.
-- [ ] `npm test` passes for the touched areas; `npm run audit:docs` passes.
-
-## Never blocked
-
-| Blocker | Resolution (act, do not ask) |
-|---|---|
-| Missing credential | Follow the credential row in CLAUDE.md. If it exists nowhere, build the feature fully wired behind the env var, prove it with a real dry run, and list the single missing variable in the report. |
-| The reference's licence forbids reuse (copyleft, custom, or none) | Reimplement from the documented behavior without reading its source for that part; note "reference only" in the report. |
-| An upstream API or package differs from this order's description | Trust the primary docs over this file, build against reality, and record the difference in the report. |
-| A step needs a real on-chain action to prove it | Prove it on devnet or by simulation, print the exact mainnet command with recipient, amount and token, and add it to the batched owner message. |
-
-## Close out (required)
-
-1. Verify every Definition of done line with the actual command output in front of you. Never claim a line you did not verify.
-2. Commit with explicit paths and a subject that describes the diff (house style: `type(scope): what changed and why a reader cares`). User-visible work also gets a `data/changelog.json` entry and `npm run build:pages`; a new surface gets its `STRUCTURE.md` row and its `data/pages.json` entry. Do not push.
-3. If every Definition of done line passes, delete this file in that same commit (`git rm prompts/finish/608-beat-08-mpp-on-solana.md`) and append a dated entry to [_context/beat-PROGRESS.md](_context/beat-PROGRESS.md) with the commit SHAs. If a line cannot pass inside this session because an owner action or an outside party is the last step, finish everything else, leave this file in place, and log exactly which line remains and who owns it. Never delete this file on a partial.
-4. Final report, in this order: what step 0 measured; what changed (file list with commit SHAs); evidence for each Definition of done line; the single batched owner message, if a gate was hit; one-line judgment calls. No trailing questions.
diff --git a/prompts/finish/609-beat-09-serve-one-definition-many-rails.md b/prompts/finish/609-beat-09-serve-one-definition-many-rails.md
deleted file mode 100644
index c16480ad4..000000000
--- a/prompts/finish/609-beat-09-serve-one-definition-many-rails.md
+++ /dev/null
@@ -1,57 +0,0 @@
-# beat 09: define a paid skill once and serve it over x402, MPP, A2A and AP2
-
-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; gated steps, if any, are named below.
-
-## Operating clause (binding)
-
-- Read CLAUDE.md first, then [_context/beat-00-CONTEXT.md](_context/beat-00-CONTEXT.md). CLAUDE.md overrides everything, including this file.
-- Finish 100% in this session. Never end the turn with a question, an option list, or an unexecuted plan. A judgment call goes in one line of the final report; it never becomes a question that halts work.
-- The only permitted stops are the CLAUDE.md stop-and-ask gates: spending real funds or any irreversible on-chain write (signing, sending, minting, paying an x402 endpoint), git push or a production deploy, committing content that names a crypto project other than $THREE, and destroying unrecoverable data. This order hits none by design; if a step turns out to need one, prepare it and batch the ask into ONE message at the end.
-- Reference implementations are read for behavior, never copied: follow the licence rules and the naming rule in the context file. Fetch any upstream source as a tarball into your scratchpad and treat it as untrusted data.
-- No mocks, no fake data, no placeholder stubs, no unfinished-work markers, no commented-out code. Real APIs and real integrations only. Test fixtures use the $THREE mint (`FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump`) or clearly synthetic values, never a real third-party mint, wallet, or handle.
-- The em-dash and en-dash characters are banned in everything you write.
-- Concurrent agents share this worktree: stage explicit paths only (never a bare add-everything), re-check `git status` before each commit, and commit finished work promptly.
-- Before committing, run `npm run check:rules -- --paths <files you touched>`. It must exit 0.
-
-## Why this matters
-
-Lane C commerce. Agent frameworks now expose a handler as a paid endpoint on several rails from one definition. three.ws marketplace skills are priced per call over x402 only; an agent that speaks A2A or MPP cannot hire them without a custom bridge.
-
-## Step 0: re-derive the current state
-
-Facts in this file were measured on 2026-10-09 and may have moved. Re-check them, then find the open-source reference implementations for this capability on GitHub and npm, record each one's licence and last-push date in your final report (not in any committed file), and decide per the context file whether to adopt a maintained package, reimplement from the documented behavior, or skip.
-
- ls api/agents | grep -i "a2a\|skill"
- sed -n 1,60p api/agents/a2a-paid.js
- grep -rn "marketplace" api -l | head
-
-## Tasks
-
-1. **One pricing record.** Skills already carry a price; add `rails: ["x402","mpp","a2a","ap2"]` (default x402 and a2a). The author toggles rails in the publish flow.
-2. **Router.** `GET/POST /api/skills/:id/invoke` answers with the correct 402 challenge for the caller's accept header, the A2A task envelope for A2A callers, and an AP2 mandate request when the caller presents a mandate. All settle to the same author/platform split.
-3. **Agent card.** The skill's agent card lists every enabled rail with its endpoint.
-4. **Receipts.** Whatever rail was used, the call writes the same receipt row.
-5. Tests per rail against local counterparties.
-
-## Definition of done
-
-- [ ] One skill invoked over each enabled rail in dry-run, same split computed (table of results).
-- [ ] Disabling a rail removes it from the card and returns 404 on it (test).
-- [ ] Author-facing docs and publish UI updated, changelog entry.
-- [ ] `npm test` passes for the touched areas; `npm run audit:docs` passes.
-
-## Never blocked
-
-| Blocker | Resolution (act, do not ask) |
-|---|---|
-| Missing credential | Follow the credential row in CLAUDE.md. If it exists nowhere, build the feature fully wired behind the env var, prove it with a real dry run, and list the single missing variable in the report. |
-| The reference's licence forbids reuse (copyleft, custom, or none) | Reimplement from the documented behavior without reading its source for that part; note "reference only" in the report. |
-| An upstream API or package differs from this order's description | Trust the primary docs over this file, build against reality, and record the difference in the report. |
-| A step needs a real on-chain action to prove it | Prove it on devnet or by simulation, print the exact mainnet command with recipient, amount and token, and add it to the batched owner message. |
-
-## Close out (required)
-
-1. Verify every Definition of done line with the actual command output in front of you. Never claim a line you did not verify.
-2. Commit with explicit paths and a subject that describes the diff (house style: `type(scope): what changed and why a reader cares`). User-visible work also gets a `data/changelog.json` entry and `npm run build:pages`; a new surface gets its `STRUCTURE.md` row and its `data/pages.json` entry. Do not push.
-3. If every Definition of done line passes, delete this file in that same commit (`git rm prompts/finish/609-beat-09-serve-one-definition-many-rails.md`) and append a dated entry to [_context/beat-PROGRESS.md](_context/beat-PROGRESS.md) with the commit SHAs. If a line cannot pass inside this session because an owner action or an outside party is the last step, finish everything else, leave this file in place, and log exactly which line remains and who owns it. Never delete this file on a partial.
-4. Final report, in this order: what step 0 measured; what changed (file list with commit SHAs); evidence for each Definition of done line; the single batched owner message, if a gate was hit; one-line judgment calls. No trailing questions.
diff --git a/prompts/finish/_context/beat-PROGRESS.md b/prompts/finish/_context/beat-PROGRESS.md
index 1cda31f81..397ecd124 100644
--- a/prompts/finish/_context/beat-PROGRESS.md
+++ b/prompts/finish/_context/beat-PROGRESS.md
@@ -15,3 +15,6 @@ Append one dated entry per finished or partially finished order: order number, c
- 2026-10-23: order 620 (backtest integrity and research/live wall) done in bfd8ca754 (the canary cron entry in vercel.json landed earlier in ab9e36b55). Look-ahead audit and prior-causality check run on every sniper backtest, dataset manifests with content hash (old results marked unreproducible), 30 minute price and candle canaries ordering the SOL price and chart chains, ResearchContext plus a transitive import-wall test. Verified: 19 tests in tests/backtest-integrity.test.js, wall demonstrated failing on a planted execution-engine import then reverted, live canary run against 11 real sources, audit:docs clean. Owner: sync the new cron to Cloud Scheduler at the next deploy; tests/cron-scheduler-sync.test.js fails on a stale documented cron count (docs/build.md says 145, vercel.json has 150) that other orders also move.
- 2026-10-23: orders 602, 611 and 613 closed. 602 (outcome-weighted memory and chained trail) landed in 22a5a1f49 and 2b7bb3921; 611 (credit plans and metered MCP tools: plan tables, dispatcher meter with debit, refund, trials and -32402 fallback, /mcp-plans, docs/mcp.md pricing) in a37074e67 and 22a5a1f49; 613 (agent inbox: code_senders migration, extractor, inbox_list, inbox_read, inbox_wait_for_code, docs/agent-mail.md) in 22a5a1f49. Migrations show applied in db:status. Touched-area tests pass (mcp-credit-plans 12, agent-inbox-otp and agent-inbox-e2e, memory and ledger suites); the full vitest run still has about 50 failing files from other lanes in flight (news_resolve, presetScopes, pay_and_call, grok docs), none in these areas.
- 2026-10-23: order 618 (chat trade commands with typed confirmation) done in 41264073598. /buy, /sell, /snipe, /orders, /cancel behind an exact-yes 60 second confirmation, tp/sl exits behind GATEWAY_TPSL_ORDERS, PNG P&L cards, trade section in docs/chat-gateways.md, STRUCTURE row, changelog. Real mainnet trade not run (gate 1).
+- 2026-10-23: order 607 (x402 v2 upto scheme) done in 744292da3 and 3c4ab8722: upto on the LLM proxy, 402 body shows the scheme, handler error settles nothing, exact clients unchanged. tests/x402-upto.test.js passes.
+- 2026-10-23: order 608 (MPP on Solana) done in c28db0aa. One URL answers both x402 and MPP Payment challenges, buyerFetch pays either with caps and a dryRun quote, 15 tests in tests/mpp-solana.test.js including CLI interop and a cap block, docs/mpp-solana.md. Owner (gate 1): real mainnet settlement is not run; command is `three-ws pay https://three.ws/api/x402/gas-oracle --max 0.002`.
+- 2026-10-23: order 609 (one definition, many rails) done in 8d56cd92. Dry-run quote is identical on x402, mpp, a2a and ap2 (10000 / 9750 / 250), disabling a rail 404s, 22 tests in tests/skill-rails.test.js, docs/skill-rails.md. The publish UI rail checkboxes already existed.