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
test(x402): cover the memo interop fix and the shared Solana lane definitions
nirholas00943fd8e5b6
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 799da2c8b..fa7b8cd21 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- **A Terms acceptance is only recorded when we could actually read the request**: When you agree to the Terms of Service or the real-funds risk disclosure, three.ws keeps a durable, permanent record of which version you accepted and when. The Terms endpoint could write one of those records from a request whose contents it never managed to read: a request sent in the wrong format, or one too large to accept, was answered as a successful acceptance of the current Terms even though nothing in it had been understood. That is the one thing an evidentiary record must never do, and it no longer happens. Both acceptance endpoints now refuse an unreadable request and say precisely what was wrong with it (too large, wrong format, or unreadable) instead of blaming the version field, and they record nothing on those paths. (`/legal/tos`) `[fix, security]`- **Adding your agent to a LobeHub chat no longer loses its name when one lookup stumbles**: Before a chat host renders your agent, it asks three.ws to confirm the agent exists and to hand back the sites you allow it to be embedded on. Those are two separate reads, and if the second one hiccuped the whole answer was thrown away: the host was told the agent could not be confirmed and was given no name, even though the first read had just found it. The confirmation and the name now survive a stumble on the embed settings. Separately, a misspelled address in a host's setup returned an explanation the browser refused to show, so integrators saw an unexplained network failure instead of the message naming their typo. That message now reaches them. `[fix]`- **Agent subscriptions and on-chain history reachable again**: Two API endpoints were being swallowed by broader routing rules. The subscription skill's weekly USDC subscribe action posted to a path that a different subscription system answered, so every subscribe attempt failed validation; delegation-backed agent subscriptions now live at their own /api/agent-subscriptions path and the skill records them correctly. The public /api/agents/onchain-history endpoint, which returns an agent's verifiable on-chain event log with explorer links, was unreachable for the same reason and now resolves. The route audits that guard this now also model the chat app's build output, so /chat coverage is checked correctly in any workspace. `[fix]`+- **An agent coin now shows its real market on the agent page, including rehearsal launches**: When an agent launches its own coin, the agent's page is where people look for it. Two things were missing there. Coins launched through three.ws could not be read from their bonding curve at all, because the reader only recognised coins whose address ends in "pump" and ours are marked differently, so anything that depended on that read came back as "no such coin". And a coin launched on the free rehearsal network showed nothing but a ticker and an address: no price, no market cap, no progress toward graduation, which made the free path a poor rehearsal for the real one. Both are fixed. The page now reads the coin's state straight off Solana whenever the market indexer does not know it yet, so a brand-new launch shows real numbers from its first minute instead of an empty card, and a rehearsal coin renders exactly like a live one, priced in SOL and clearly badged so nobody mistakes practice money for real money. Market caps are also computed correctly now: the figure the trading library reports goes negative on live curves, and coins that should have shown a real price were displaying zero. (`/launches`) `[fix, improvement]`- **An API key can no longer be minted with zero scopes**: Sending an explicitly empty scope list to the key-minting endpoint used to succeed and issue a credential that could never pass a permission check: the key looked fine, then failed every call with nothing explaining why. The dashboard already refused an empty selection; the raw API now enforces the same rule for every other client and answers with a clear error instead of minting a dead key. Repeated scopes in one request are also deduplicated, so the grants shown on a key are listed once each. (`/docs/api-reference`) `[fix]`- **An avatar rendered through the MCP server can no longer be turned into a tracking beacon**: When an AI assistant renders one of your avatars through the three.ws MCP server, the server builds a small viewer page and the assistant displays it. The caller picks the background for that page. The check on that value blocked anything that could break out of the styling, but it still allowed a CSS url(), so a caller could point the background at an image on a server they control and quietly collect the address and referring page of everyone who ever viewed that avatar. Backgrounds and gradients never need url(), so it is refused outright now and the safe default is used instead. A second fix went in with it: the server works out its own public web address to build the links it hands back, and its test for a local development address matched anywhere in the name instead of the whole name, so a request arriving with a forged host like evil-127.0.0.1.example.com was treated as local and got plain http links rather than https. That test is now anchored to the whole host, and IPv6 loopback is recognised properly. The animation tools also stopped treating built-in JavaScript property names as though they were real animation clips, and the shared MCP helpers behind all of this are now covered by tests. (`/docs/mcp`) `[security, fix]`- **An expired Bitcoin inscription order now says so, instead of looking like a broken server**: The Forever page writes your message into Bitcoin, then keeps a pay screen open while you send the payment from your own wallet. That screen is restored when you come back to the tab. If the inscription order behind it had since expired, the page had no way to say so: the server reported an order it could not find as a server fault, so the pay screen either sat there polling an order that no longer existed, or repainted itself empty with no charge address and no explanation. An order that no longer exists is now reported as exactly that, and the page retires it, tells you nothing was charged, and puts you back at the message box to start a new one. Three related fixes went in with it. An inscription that the provider rejected could come back marked as success, which briefly showed a pay screen for an order that was never created; every provider failure is now reported as one. A receive address with a typo is now caught by its checksum before the order is created, and tells you to recopy it from your wallet, rather than failing later with a message that explained nothing. And an order that expired unpaid is no longer counted as paid. (`/forever`) `[fix]`@@ -34,6 +35,7 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr- **FBX export on the OKX 3D studio works again**: The paid FBX export service at /api/okx/3d/fbx-export was handing the conversion engine the wrong parameter names, so every call came back as a rejected request instead of a converted model, and the format you asked for was dropped on the way through. The adapter now speaks the engine's own parameter names, so a rigged GLB converts to FBX (or OBJ, STL, PLY, USDZ, 3MF) and keeps its skeleton, skin weights, and blendshapes. Buyers were never charged for the failed calls. A contract test now checks every OKX studio service against the schema its engine actually publishes, so a renamed parameter cannot slip through again. Separately, a Chinese-language brand brief sent to the Agent Identity Studio now has its first sentence picked out correctly when the prompt director is unavailable, instead of the whole brief crowding out the style hints. (`/api/okx/3d/catalog`) `[fix]`- **Four platform guides now show the responses and numbers the code really produces**: The Permissions guide documented a failure body no permissions endpoint sends, so anyone writing error handling from it was matching on fields that never arrive; it now shows the real envelope, with a curl you can run, and separates it from the different shape the in-browser helper returns. The 3D provenance guide only ever showed a verified answer, even though its own example command asks about a model that was never anchored: the real unknown-but-hashed reply is now shown first, so nobody reads a correct answer as a broken endpoint. The bulk on-chain agent guide still told admins to use a dashboard that was removed with the admin panel, and misnumbered its last tutorial. And the onboarding tier page's menu counts had drifted behind the navigation itself. The persona key generator and the permissions smoke test also stopped naming the retired host in their setup instructions. (`/docs/permissions`) `[docs, fix]`- **Importing an agent you already own on-chain no longer fails because its metadata host is slow**: If you registered an agent on-chain, the hydrate page finds it from your connected wallets and offers to import it into three.ws. Importing read two things: the registry entry on the chain, and the registration file the registry points at, which usually lives on IPFS. If that file did not load in five seconds, the whole import was refused, even though the part that actually matters, the chain saying you own the agent, had already answered. Public IPFS gateways throttle constantly, so owners were locked out of their own agents by a slow third party. The import now only needs the chain read to succeed; a registration file that will not load means the agent lands under its on-chain name and the metadata fills in on the next crawl. Two more changes went in alongside it: ownership is now re-checked against the live registry rather than the crawler's cached copy, so an agent you transferred away cannot be imported by the old wallet, and a chain that is unreachable now says so plainly and asks you to retry instead of reporting a generic failure. Separately, confirming a new registration now reads the transaction receipt over the same priority provider list the rest of the platform uses, instead of the slowest public fallbacks, which is what made a freshly mined registration occasionally come back as "not yet mined". (`/hydrate`) `[fix]`+- **Inference receipts settle on a reproducible test lane, and two chain-labelling bugs are fixed**: Paid inference on three.ws hands back a receipt that ties the payment to the exact job and answer it bought. Proving that end to end used to depend on the public Solana devnet faucet, which is often empty, so the proof could not be re-run on demand. It now runs against a Solana test validator on your own machine: it creates its own test token, settles a real on-chain payment through the normal payment path, and verifies the receipt against the job signature, with no faucet and no real funds. Running it surfaced three real defects, all fixed. Payments built by the standard x402 Solana client carry a short note attached to the transaction, and our own settlement service rejected every one of them, so any buyer using the standard client could not pay us at all. Both receipt verifiers also matched the devnet chain id by a text fragment that was missing a character, so it never matched: a devnet receipt was looked up on mainnet and reported as a mainnet payment. Verifiers now read the chain from the receipt itself, and a receipt from a chain with no public endpoint asks you for one instead of quietly checking the wrong chain. (`/docs/inference-node-operator`) `[fix, infra, security]`- **IRL endpoints answer bad input honestly, and the usage rollup works again**: Audited the ten /api/irl endpoints against a real database. A pin, drop or interaction id that was not a UUID used to reach Postgres and come back as a server error; those requests are now a plain 400 that never touches the database. The site-wide /irl usage rollup had a broken daily-series query, and because the endpoint quietly served an empty summary when a query failed, it had been reporting zeros instead of real numbers; the query is fixed and a failure is now logged. A report filed from a device that sends its id in the header is once again recognised, so an owner cannot accidentally count as an independent reporter of their own pin, and repeat reports from one device still collapse into one. Captions shilling a coin whose ticker runs past ten characters are rejected like every other off-brand ticker. `[fix, security]`- **Labor Market API says what is wrong with a request instead of failing on it**: Sending a bounty, job or bid id that was not a real id to the Labor Market endpoints produced a server fault, and in a couple of places leaked the database's own error text back to the caller. Every one of those endpoints now checks the id first and answers with a plain message naming the field. Posting a bounty is stricter too: a reward that is not a number is refused as bad input rather than crashing or being quietly read as zero, and a deadline that is not a real date is caught before the bounty is created. A delivered work item's text is now truncated to the documented limit for real, which it was not when the deliverable was sent as an object. (`/labor-market`) `[fix, improvement]`- **Launchpad paid pages now describe themselves correctly to paying agents**: When an agent reaches a paid Launchpad page (a pay-per-question concierge or a gated showroom unlock) without payment, the 402 challenge it receives now carries that page type's own bazaar discovery document: the exact field to send, the shape of the answer that comes back, and a worked example. Before, the challenge fell back to a generic entry that told crawlers to send a model-validation body, so an agent that indexed a concierge page from discovery would never send the one field it actually needs. An agent can now go from discovery to a settled paid call using nothing but the challenge itself. (`/launchpad`) `[improvement]`@@ -99,6 +101,7 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr- **x402 Studio is keyboard-usable, phone-usable, and no longer drops product-grid picks**: A full pass over the x402 Studio merchant console. Editing a "product grid" block on the storefront builder silently saved an empty grid, because the checkbox lookup searched the wrong part of the page; it now saves exactly the products you tick. Half-built storefront layouts used to vanish the moment you visited another tab and came back, and now survive with an "Unsaved changes" marker until you save or publish. Every dialog is a real dialog: Escape closes it, Tab stays inside it, and focus returns to the control that opened it. The setup checklist rows are real buttons a keyboard can reach, every control has a visible focus ring, and the labels are correctly attached to their inputs. On a phone the "Agent wallets" heading no longer squeezed its description into a one-word column, and the sidebar links to the x402 explainer and the classic dashboard are reachable instead of hidden. The "+ New product" button in the header now opens the new-product form instead of only switching tabs, the signed-out and load-failure screens carry a proper page heading, and a load failure offers a retry plus a route to the classic dashboard. (`/x402/studio`) `[fix, improvement]`- **You can now delete your Forge creations, photos included**: Every card in the "Your creations" gallery on /forge and the Forge Studio now carries a delete button (tap once to arm, tap again to confirm). Deleting a creation permanently erases everything the platform stored for it: the 3D model file, the preview image, and, for image-to-3D runs, the reference photos you uploaded. The model also disappears from the community showcase, share links and embeds at the same moment. Before this, a generated model and its source photo stayed on our storage forever with no way to remove them, which is not acceptable for anyone turning personal photos into 3D. Only the browser that forged a model can delete it. (`/forge`) `[feature, security]`- **Your agent learns your GitHub work from a checklist you tick, and nothing else**: Seeding an agent from GitHub now shows you the exact inventory first: your public profile, the repositories you pinned to your profile, your recent public repositories, and a separate tick for each repository's README. Whatever you leave unticked is never read, and the server rebuilds the same list when you press Seed, so a request naming anything you were not shown is refused outright rather than quietly seeding something else. Private repositories never appear in the list at all. Every stored memory records the exact set of boxes that produced it, so you can always see where a fact came from, and deleting them is one button on the agent or one Disconnect on the account, which removes every GitHub-derived memory across all your agents and revokes the access on GitHub's side too. Two fixes ship with it: the agent picker in Settings was reading the wrong field and never listed your agents, so the panel always fell back to asking for an agent ID by hand, and the Connect button on a deployment with no GitHub app configured now says so instead of opening an error page. (`/settings`) `[feature, security]`+- **Your agent's cloned voice now speaks in embeds, not just on three.ws**: Give an agent your voice in the Voice step of the agent builder and it now actually speaks with that voice wherever you put it. Cloning runs on ElevenLabs, and when you bring your own ElevenLabs key the cloned voice lives in your account, so a visitor listening to your agent has to be served on your key. The hosted embed was not telling the server which agent was speaking, so it was never allowed to use that key: the agent looked fine and simply stayed silent for everyone except you, with nothing to indicate why. It now names the agent on every request, so the voice plays for real visitors on any site the agent is embedded in. The embed also picks up the voice model and the stability, similarity and style settings you tuned, instead of falling back to the defaults, and the same fix applies to agents built on the SDK runtime. An agent with no voice bound still says so plainly rather than substituting a stranger's voice. (`/create-agent`) `[fix, feature]`- **Your API keys now show whether they still work, and a key can no longer be issued with no permissions at all**: The API keys table in your developer dashboard listed every key you had ever created, but nothing on the row said which ones were still usable. A key you had already revoked looked exactly like a live one, right down to a Revoke button that could only ever fail, and a key that had passed its expiry date looked perfectly healthy until a request mysteriously stopped working. Every key now carries an Active, Expired, or Revoked label, dead keys are dimmed, and the Revoke button is only shown where it can do something. The connection tester also stops picking an expired key to test with. Separately, creating a key through the API with an explicitly empty permission list used to succeed and hand back a credential that could not do anything, with nothing to tell you so; that request is now rejected with a clear message, and a permission listed twice is stored once. (`/dashboard/api`) `[fix, improvement]`- **Your face scan keeps building even if the engine lineup changes mid-job**: A scan in progress is tracked by an id that only the engine which started it can read. When the platform had more than one avatar engine available, the page checking on your scan could ask the wrong one, and it would answer that it had never heard of your job. Your avatar was generating perfectly well and you were told it had failed. The status check now always asks the engine that actually took your photos, and if that engine is no longer reachable it leaves your job alone for the server-side sweep to finish instead of declaring it dead. (`/create/selfie`) `[fix]`- **Your friends list no longer goes blank when the database is mid-upgrade, and search finds unusual names**: Two problems in the friends area. The friends list is built to survive an environment where the social tables have not been created yet: it shows an empty list instead of an error. That safety net was matching on the wording of the database error rather than its type, and the wording it looked for also appears when a single column is missing, which is what a partly-applied upgrade looks like. So during an upgrade the page answered normally and told you that you had no friends, no incoming requests, and no pending invites, with nothing anywhere reporting a fault. The safety net now recognises only a genuinely missing table, and any other database problem is reported as the error it is. Separately, friend search could not find a display name containing a backslash, and a search term ending in one quietly searched for something else, because the search was not escaping the backslash before handing the term to the database. (`/walk`) `[fix]`diff --git a/data/changelog.json b/data/changelog.jsonindex bc93826de..45a66d774 100644--- a/data/changelog.json+++ b/data/changelog.json@@ -1,6 +1,37 @@{"$comment": "Curated changelog entries for three.ws, the editorial layer of the public changelog. New PAGE launches are tracked automatically via the `added` field in data/pages.json; this file is for everything else holders care about: improvements, fixes, SDK releases, trading/payments capabilities, security work. scripts/build-page-index.mjs merges both sources into CHANGELOG.md, public/changelog.json, and public/changelog.xml. Newest first. Allowed tags: feature, improvement, fix, sdk, infra, docs, security. `link` is optional and must be a live three.ws path.","entries": [+ {+ "date": "2026-08-13",+ "title": "Your agent's cloned voice now speaks in embeds, not just on three.ws",+ "summary": "Give an agent your voice in the Voice step of the agent builder and it now actually speaks with that voice wherever you put it. Cloning runs on ElevenLabs, and when you bring your own ElevenLabs key the cloned voice lives in your account, so a visitor listening to your agent has to be served on your key. The hosted embed was not telling the server which agent was speaking, so it was never allowed to use that key: the agent looked fine and simply stayed silent for everyone except you, with nothing to indicate why. It now names the agent on every request, so the voice plays for real visitors on any site the agent is embedded in. The embed also picks up the voice model and the stability, similarity and style settings you tuned, instead of falling back to the defaults, and the same fix applies to agents built on the SDK runtime. An agent with no voice bound still says so plainly rather than substituting a stranger's voice.",+ "tags": [+ "fix",+ "feature"+ ],+ "link": "/create-agent"+ },+ {+ "date": "2026-08-13",+ "title": "An agent coin now shows its real market on the agent page, including rehearsal launches",+ "summary": "When an agent launches its own coin, the agent's page is where people look for it. Two things were missing there. Coins launched through three.ws could not be read from their bonding curve at all, because the reader only recognised coins whose address ends in \"pump\" and ours are marked differently, so anything that depended on that read came back as \"no such coin\". And a coin launched on the free rehearsal network showed nothing but a ticker and an address: no price, no market cap, no progress toward graduation, which made the free path a poor rehearsal for the real one. Both are fixed. The page now reads the coin's state straight off Solana whenever the market indexer does not know it yet, so a brand-new launch shows real numbers from its first minute instead of an empty card, and a rehearsal coin renders exactly like a live one, priced in SOL and clearly badged so nobody mistakes practice money for real money. Market caps are also computed correctly now: the figure the trading library reports goes negative on live curves, and coins that should have shown a real price were displaying zero.",+ "tags": [+ "fix",+ "improvement"+ ],+ "link": "/launches"+ },+ {+ "date": "2026-08-13",+ "title": "Inference receipts settle on a reproducible test lane, and two chain-labelling bugs are fixed",+ "summary": "Paid inference on three.ws hands back a receipt that ties the payment to the exact job and answer it bought. Proving that end to end used to depend on the public Solana devnet faucet, which is often empty, so the proof could not be re-run on demand. It now runs against a Solana test validator on your own machine: it creates its own test token, settles a real on-chain payment through the normal payment path, and verifies the receipt against the job signature, with no faucet and no real funds. Running it surfaced three real defects, all fixed. Payments built by the standard x402 Solana client carry a short note attached to the transaction, and our own settlement service rejected every one of them, so any buyer using the standard client could not pay us at all. Both receipt verifiers also matched the devnet chain id by a text fragment that was missing a character, so it never matched: a devnet receipt was looked up on mainnet and reported as a mainnet payment. Verifiers now read the chain from the receipt itself, and a receipt from a chain with no public endpoint asks you for one instead of quietly checking the wrong chain.",+ "tags": [+ "fix",+ "infra",+ "security"+ ],+ "link": "/docs/inference-node-operator"+ },{"date": "2026-08-13","title": "Compressed models now work across every 3D tool, not just some",diff --git a/prompts/swarm-100/sweep-tour-atlas.md b/prompts/swarm-100/sweep-tour-atlas.mddeleted file mode 100644index 345d81419..000000000--- a/prompts/swarm-100/sweep-tour-atlas.md+++ /dev/null@@ -1,86 +0,0 @@-# Sweep: Tour atlas healthy--How to run: paste this file's repo path into a fresh Claude Code chat in this-repository and say "run this work order". This file is fully self-contained:-it depends on no other prompt file anywhere. If neighboring files in-prompts/swarm-100/ are gone, that work is done; if present, ignore them.-Every claim below rots; step 0 re-measures, and what you measure wins.--## Operating clause (binding)--- Read CLAUDE.md first. Its rules override 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, git push or a production deploy,- committing content that references a crypto project other than $THREE, and- destroying unrecoverable data.-- No mocks, no fake data, no placeholder stubs, no unfinished-work markers, no- commented-out code. Real APIs and real integrations only.-- 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), and commit finished work promptly.-- Before committing, run: npm run check:rules -- --paths <files you touched>.- It must exit 0.--## Step 0: re-derive the current state--Run the sweep's own command first and work from its output, not from any-memory of what used to fail:-- npm run audit:tour-atlas && npm run tour:atlas:health--Capture the full output to the session scratchpad; do not work from an-excerpt.--## Task--Run both. Broken tour stops get fixed at the stop definition or the page it points to. The tour is a first-run surface; a broken stop is a first-impression defect.--Fix everything found in this sweep's scope. Findings that belong to a-different surface entirely (and would take this session off its one task) go-in the report as named follow-ups instead; everything in scope gets fixed-here, at root, with no masking.--## Definition of done--- [ ] The command above exits 0 (or, for measurement-style sweeps, the report- carries the measured numbers and every committed fix).-- [ ] Every fix is a root-cause fix; no check was weakened, skipped, or- quarantined to get to green.-- [ ] npm run check:rules -- --paths <touched files> exits 0; npm test passes- if code changed.--## Never blocked--| Blocker | Resolution (act, do not ask) |-|---|---|-| Missing env var or credential | Check .env and .env.local, then the Cloud Run service env, then Secret Manager (the CLAUDE.md self-unblock playbook has the exact commands). If it truly exists nowhere, wire the code fully behind the env var, prove the wiring with a dry run, and name the single missing var in the report. |-| gcloud not on PATH | Run: export PATH="$HOME/google-cloud-sdk/bin:$PATH" |-| Dev server port 3000 busy | Another agent may be serving this repo; probe it and reuse if so. Otherwise start your own on a free port: npx vite --port 3101 |-| Playwright browser missing | npx playwright install chromium |-| A surface needs a signed-in user | Register a fresh account through the real /register flow against the real API and use it. Never mock the session. |-| A defect sits in code you did not touch | Fix it if it blocks a Definition of done line (root cause it, never mask it). Otherwise note it in the report and continue. |-| An unrelated test is red | Same rule. Never pipe npm test through tail; it masks exit codes. |--## 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).-3. Delete this prompt file in that same commit:-- git rm prompts/swarm-100/sweep-tour-atlas.md-- The shrinking directory is this campaign's only progress ledger; there is- no progress log to update.-4. Final report: what step 0 measured, what changed (file list), evidence per- Definition of done line, and any one-line judgment calls. No trailing- questions, no unexecuted plans.--If a line genuinely cannot pass inside this session (an external party must-respond, or an owner-gated action is the final step), finish everything else,-leave this file in place, and state exactly which line remains and who owns-it. Never delete this file on a partial.diff --git a/public/changelog.json b/public/changelog.jsonindex ae3ad0685..88ea7aa3c 100644--- a/public/changelog.json+++ b/public/changelog.json@@ -1,5 +1,5 @@{- "generated_at": "2026-08-13T23:43:33.589Z",+ "generated_at": "2026-08-14T00:06:06.407Z","generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json","site": {"name": "three.ws",@@ -100,6 +100,17 @@"fix"]},+ {+ "date": "2026-08-13",+ "type": "update",+ "title": "An agent coin now shows its real market on the agent page, including rehearsal launches",+ "summary": "When an agent launches its own coin, the agent's page is where people look for it. Two things were missing there. Coins launched through three.ws could not be read from their bonding curve at all, because the reader only recognised coins whose address ends in \"pump\" and ours are marked differently, so anything that depended on that read came back as \"no such coin\". And a coin launched on the free rehearsal network showed nothing but a ticker and an address: no price, no market cap, no progress toward graduation, which made the free path a poor rehearsal for the real one. Both are fixed. The page now reads the coin's state straight off Solana whenever the market indexer does not know it yet, so a brand-new launch shows real numbers from its first minute instead of an empty card, and a rehearsal coin renders exactly like a live one, priced in SOL and clearly badged so nobody mistakes practice money for real money. Market caps are also computed correctly now: the figure the trading library reports goes negative on live curves, and coins that should have shown a real price were displaying zero.",+ "link": "/launches",+ "tags": [+ "fix",+ "improvement"+ ]+ },{"date": "2026-08-13","type": "update",@@ -300,6 +311,18 @@"fix"]},+ {+ "date": "2026-08-13",+ "type": "update",+ "title": "Inference receipts settle on a reproducible test lane, and two chain-labelling bugs are fixed",+ "summary": "Paid inference on three.ws hands back a receipt that ties the payment to the exact job and answer it bought. Proving that end to end used to depend on the public Solana devnet faucet, which is often empty, so the proof could not be re-run on demand. It now runs against a Solana test validator on your own machine: it creates its own test token, settles a real on-chain payment through the normal payment path, and verifies the receipt against the job signature, with no faucet and no real funds. Running it surfaced three real defects, all fixed. Payments built by the standard x402 Solana client carry a short note attached to the transaction, and our own settlement service rejected every one of them, so any buyer using the standard client could not pay us at all. Both receipt verifiers also matched the devnet chain id by a text fragment that was missing a character, so it never matched: a devnet receipt was looked up on mainnet and reported as a mainnet payment. Verifiers now read the chain from the receipt itself, and a receipt from a chain with no public endpoint asks you for one instead of quietly checking the wrong chain.",+ "link": "/docs/inference-node-operator",+ "tags": [+ "fix",+ "infra",+ "security"+ ]+ },{"date": "2026-08-13","type": "update",@@ -1001,6 +1024,17 @@"security"]},+ {+ "date": "2026-08-13",+ "type": "update",+ "title": "Your agent's cloned voice now speaks in embeds, not just on three.ws",+ "summary": "Give an agent your voice in the Voice step of the agent builder and it now actually speaks with that voice wherever you put it. Cloning runs on ElevenLabs, and when you bring your own ElevenLabs key the cloned voice lives in your account, so a visitor listening to your agent has to be served on your key. The hosted embed was not telling the server which agent was speaking, so it was never allowed to use that key: the agent looked fine and simply stayed silent for everyone except you, with nothing to indicate why. It now names the agent on every request, so the voice plays for real visitors on any site the agent is embedded in. The embed also picks up the voice model and the stability, similarity and style settings you tuned, instead of falling back to the defaults, and the same fix applies to agents built on the SDK runtime. An agent with no voice bound still says so plainly rather than substituting a stranger's voice.",+ "link": "/create-agent",+ "tags": [+ "fix",+ "feature"+ ]+ },{"date": "2026-08-13","type": "update",diff --git a/public/changelog.xml b/public/changelog.xmlindex cfdd4c58b..a19c70852 100644--- a/public/changelog.xml+++ b/public/changelog.xml@@ -78,6 +78,14 @@<category>fix</category><description>Two API endpoints were being swallowed by broader routing rules. The subscription skill's weekly USDC subscribe action posted to a path that a different subscription system answered, so every subscribe attempt failed validation; delegation-backed agent subscriptions now live at their own /api/agent-subscriptions path and the skill records them correctly. The public /api/agents/onchain-history endpoint, which returns an agent's verifiable on-chain event log with explorer links, was unreachable for the same reason and now resolves. The route audits that guard this now also model the chat app's build output, so /chat coverage is checked correctly in any workspace.</description></item>+ <item>+ <title>An agent coin now shows its real market on the agent page, including rehearsal launches</title>+ <link>https://three.ws/launches</link>+ <guid isPermaLink="false">2026-08-13:An agent coin now shows its real market on the agent page, including rehearsal launches</guid>+ <pubDate>Thu, 13 Aug 2026 12:00:00 GMT</pubDate>+ <category>fix</category>+ <description>When an agent launches its own coin, the agent's page is where people look for it. Two things were missing there. Coins launched through three.ws could not be read from their bonding curve at all, because the reader only recognised coins whose address ends in "pump" and ours are marked differently, so anything that depended on that read came back as "no such coin". And a coin launched on the free rehearsal network showed nothing but a ticker and an address: no price, no market cap, no progress toward graduation, which made the free path a poor rehearsal for the real one. Both are fixed. The page now reads the coin's state straight off Solana whenever the market indexer does not know it yet, so a brand-new launch shows real numbers from its first minute instead of an empty card, and a rehearsal coin renders exactly like a live one, priced in SOL and clearly badged so nobody mistakes practice money for real money. Market caps are also computed correctly now: the figure the trading library reports goes negative on live curves, and coins that should have shown a real price were displaying zero.</description>+ </item><item><title>An API key can no longer be minted with zero scopes</title><link>https://three.ws/docs/api-reference</link>@@ -230,6 +238,14 @@<category>fix</category><description>If you registered an agent on-chain, the hydrate page finds it from your connected wallets and offers to import it into three.ws. Importing read two things: the registry entry on the chain, and the registration file the registry points at, which usually lives on IPFS. If that file did not load in five seconds, the whole import was refused, even though the part that actually matters, the chain saying you own the agent, had already answered. Public IPFS gateways throttle constantly, so owners were locked out of their own agents by a slow third party. The import now only needs the chain read to succeed; a registration file that will not load means the agent lands under its on-chain name and the metadata fills in on the next crawl. Two more changes went in alongside it: ownership is now re-checked against the live registry rather than the crawler's cached copy, so an agent you transferred away cannot be imported by the old wallet, and a chain that is unreachable now says so plainly and asks you to retry instead of reporting a generic failure. Separately, confirming a new registration now reads the transaction receipt over the same priority provider list the rest of the platform uses, instead of the slowest public fallbacks, which is what made a freshly mined registration occasionally come back as "not yet mined".</description></item>+ <item>+ <title>Inference receipts settle on a reproducible test lane, and two chain-labelling bugs are fixed</title>+ <link>https://three.ws/docs/inference-node-operator</link>+ <guid isPermaLink="false">2026-08-13:Inference receipts settle on a reproducible test lane, and two chain-labelling bugs are fixed</guid>+ <pubDate>Thu, 13 Aug 2026 12:00:00 GMT</pubDate>+ <category>fix</category>+ <description>Paid inference on three.ws hands back a receipt that ties the payment to the exact job and answer it bought. Proving that end to end used to depend on the public Solana devnet faucet, which is often empty, so the proof could not be re-run on demand. It now runs against a Solana test validator on your own machine: it creates its own test token, settles a real on-chain payment through the normal payment path, and verifies the receipt against the job signature, with no faucet and no real funds. Running it surfaced three real defects, all fixed. Payments built by the standard x402 Solana client carry a short note attached to the transaction, and our own settlement service rejected every one of them, so any buyer using the standard client could not pay us at all. Both receipt verifiers also matched the devnet chain id by a text fragment that was missing a character, so it never matched: a devnet receipt was looked up on mainnet and reported as a mainnet payment. Verifiers now read the chain from the receipt itself, and a receipt from a chain with no public endpoint asks you for one instead of quietly checking the wrong chain.</description>+ </item><item><title>IRL endpoints answer bad input honestly, and the usage rollup works again</title><link>https://three.ws/changelog</link>@@ -750,6 +766,14 @@<category>feature</category><description>Seeding an agent from GitHub now shows you the exact inventory first: your public profile, the repositories you pinned to your profile, your recent public repositories, and a separate tick for each repository's README. Whatever you leave unticked is never read, and the server rebuilds the same list when you press Seed, so a request naming anything you were not shown is refused outright rather than quietly seeding something else. Private repositories never appear in the list at all. Every stored memory records the exact set of boxes that produced it, so you can always see where a fact came from, and deleting them is one button on the agent or one Disconnect on the account, which removes every GitHub-derived memory across all your agents and revokes the access on GitHub's side too. Two fixes ship with it: the agent picker in Settings was reading the wrong field and never listed your agents, so the panel always fell back to asking for an agent ID by hand, and the Connect button on a deployment with no GitHub app configured now says so instead of opening an error page.</description></item>+ <item>+ <title>Your agent's cloned voice now speaks in embeds, not just on three.ws</title>+ <link>https://three.ws/create-agent</link>+ <guid isPermaLink="false">2026-08-13:Your agent's cloned voice now speaks in embeds, not just on three.ws</guid>+ <pubDate>Thu, 13 Aug 2026 12:00:00 GMT</pubDate>+ <category>fix</category>+ <description>Give an agent your voice in the Voice step of the agent builder and it now actually speaks with that voice wherever you put it. Cloning runs on ElevenLabs, and when you bring your own ElevenLabs key the cloned voice lives in your account, so a visitor listening to your agent has to be served on your key. The hosted embed was not telling the server which agent was speaking, so it was never allowed to use that key: the agent looked fine and simply stayed silent for everyone except you, with nothing to indicate why. It now names the agent on every request, so the voice plays for real visitors on any site the agent is embedded in. The embed also picks up the voice model and the stability, similarity and style settings you tuned, instead of falling back to the defaults, and the same fix applies to agents built on the SDK runtime. An agent with no voice bound still says so plainly rather than substituting a stranger's voice.</description>+ </item><item><title>Your API keys now show whether they still work, and a key can no longer be issued with no permissions at all</title><link>https://three.ws/dashboard/api</link>diff --git a/specs/inference-receipts.md b/specs/inference-receipts.mdindex aac2ad5d6..077dea1fa 100644--- a/specs/inference-receipts.md+++ b/specs/inference-receipts.md@@ -139,6 +139,14 @@ The HTTP verifier and the CLI add one optional check on top:| -------------------- | ------------------------------------------------------------------- || `onchain_settlement` | `payment.transaction` confirmed on `payment.network` (read-only RPC). |+The lane for `onchain_settlement` comes from the receipt's own+`payment.network`, compared in full against the canonical id. A verifier that+guesses the lane can report a devnet payment as a mainnet one, which is a false+statement about where money moved; both verifiers did exactly that until the+phase-4 proof run caught it. A network with no public endpoint (the local test+lane, a private cluster) is reported by its id and needs an explicit `--rpc`+rather than being silently looked up on mainnet.+A receipt is **verified** when every requested check passes. `prompt_binding`and `response_binding` are optional because a third party may hold only thereceipt, not the raw text; the receipt still proves payment-to-job binding@@ -156,10 +164,26 @@ without them.## Activation and lanes-- **Test lane (default for proof runs):** Solana devnet. The platform's- self-hosted facilitator already routes `solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1`;- settle against it with devnet USDC and every check above runs identically.- No real funds move.+A `payment.network` is a CAIP-2 id: `solana:` followed by the first 32 base58+characters of that cluster's genesis hash. The id therefore *identifies the+ledger*, which is what lets a receipt state where the money moved. The rail's+one definition of the Solana lanes lives in+[`api/_lib/x402/solana-networks.js`](../api/_lib/x402/solana-networks.js).++- **Local test lane (default for proof runs):** a `solana-test-validator` on+ the operator's machine. It is the reproducible lane: unlimited SOL, an SPL+ mint the proof creates for itself, and no shared faucet to be rate-limited+ by. A test validator generates a fresh genesis on every reset, so the lane's+ id is derived at runtime from `getGenesisHash` and passed to the rail in+ `X402_SOLANA_LOCAL_NETWORK`. That variable is unset in every deployed+ environment, so the recognized networks there remain mainnet and devnet.+ The lane is named honestly: settling on a local validator while labelling+ the receipt as devnet would put a false chain id inside a signed attestation.+- **Devnet:** `solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1`, settled by the same+ self-hosted facilitator with every check above running identically. It is the+ shared public lane; its faucet is rate-limited per IP and is frequently dry on+ shared CI egress, which is why the local lane is the default. No real funds+ move on either.- **Mainnet:** the same receipt format with `payment.network` =`solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp` (or any EVM lane the railsettles). Activation is setting `INFERENCE_SIGNING_KEY` (and optionally a@@ -167,6 +191,43 @@ without them.owner-gated deploy step. With the key unset, responses ship unsigned and noreceipts are issued: that is the rollback position.+## The proof run++[`scripts/inference-settlement-proof.mjs`](../scripts/inference-settlement-proof.mjs)+settles one real metered job end to end and verifies its receipt. It runs a+real completion through the provider chain, signs the metered job, creates its+own 6-decimal SPL mint on the test ledger, builds an `exact` payment with the+reference client, puts it through `verifyPayment` → `settlePayment`, issues the+receipt, and verifies it (including a tamper check and the on-chain leg). Every+identity in the run is a throwaway keypair; no real asset appears anywhere.++Two production guards stay ON during the proof and are pointed at the run's own+throwaway payee and test mint rather than disabled: the facilitator's payTo+allowlist (`X402_SELF_FACILITATOR_PAYTO_ALLOWLIST`) and its settleable-mint pin+(`X402_ASSET_MINT_SOLANA`). A third, the DB-backed settle-credit gate+([`api/_lib/x402/settle-credit.js`](../api/_lib/x402/settle-credit.js), one+on-chain signature credits at most one payment), fails closed without a+database, so the proof brings a local Postgres rather than relaxing it. The+script header lists the containers.++The facilitator is served on loopback for the run. With the self-hosted+facilitator enabled the rail resolves it to `${APP_ORIGIN}/api/x402-facilitator`+and calls it over HTTP, and `APP_ORIGIN` defaults to `https://three.ws`, so a+proof run left alone would ask production to co-sign a test-lane payment.++## Interop requirement: memos++The reference x402 SVM client (`@x402/svm`, which+[`buildSolanaExactPayload`](../api/_lib/x402/a2a-client.js) delegates to)+attaches an SPL Memo to every `exact` payment it builds. Any facilitator+settling these payments must accept the Memo program+(`MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr`, and the legacy+`Memo1UhkJRfHyvLMcVucJwxXeuD728EqVDDwQDxFMNo`) as a no-op instruction: memo+owns no accounts and moves no lamports. Our own facilitator refused them until+this proof run surfaced it, which made every standards-built payment+unsettleable while our ring's own memo-free transactions passed. Covered by+[`tests/x402-facilitator-memo-interop.test.js`](../tests/x402-facilitator-memo-interop.test.js).+## Security notes- Signing keys are ed25519 and MUST be distinct from every `X402_PAY_TO_*`diff --git a/tests/x402-facilitator-memo-interop.test.js b/tests/x402-facilitator-memo-interop.test.jsnew file mode 100644index 000000000..68998cfe3--- /dev/null+++ b/tests/x402-facilitator-memo-interop.test.js@@ -0,0 +1,130 @@+// The self-hosted facilitator must be able to settle a payment built by the+// REFERENCE x402 SVM client, not just by our own ring builder.+//+// Found while running the phase-4 inference settlement proof+// (scripts/inference-settlement-proof.mjs): @x402/svm attaches an SPL Memo to+// every `exact` payment it builds, and our anti-drain gate allowed only+// ComputeBudget, AssociatedToken and SPL Token instructions. Every standards-+// built payment was therefore refused with `program_not_allowed:MemoSq4…`,+// including payments from our own buyer path (api/_lib/x402/a2a-client.js+// delegates to that library). The ring builder emits no memo, which is why the+// gap survived: nothing we built ourselves ever hit it.+//+// Memo owns no accounts and moves no lamports, so accepting it costs the+// facilitator nothing. The rest of the gate must stay exactly as strict.++import { describe, it, expect } from 'vitest';+import {+ Keypair, PublicKey, TransactionMessage, TransactionInstruction,+ VersionedTransaction, SystemProgram, ComputeBudgetProgram,+} from '@solana/web3.js';+import {+ getAssociatedTokenAddressSync, createTransferCheckedInstruction,+ TOKEN_PROGRAM_ID, ASSOCIATED_TOKEN_PROGRAM_ID,+} from '@solana/spl-token';++const USDC = 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v';+process.env.X402_ASSET_MINT_SOLANA = USDC;++const { validateRingTransaction } = await import('../api/_lib/x402/self-facilitator.js');++const MEMO_V2 = new PublicKey('MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr');+const MEMO_V1 = new PublicKey('Memo1UhkJRfHyvLMcVucJwxXeuD728EqVDDwQDxFMNo');+const BLOCKHASH = '11111111111111111111111111111111';++const buyer = Keypair.generate();+const treasury = Keypair.generate();+const mint = new PublicKey(USDC);+const payTo = treasury.publicKey;+const requirement = {+ network: 'solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp',+ asset: USDC,+ payTo: payTo.toBase58(),+ amount: '1000000',+};+const allowlist = new Set([requirement.payTo]);++function memoIx(programId, text) {+ return new TransactionInstruction({+ keys: [],+ programId,+ data: Buffer.from(text, 'utf8'),+ });+}++// A self-paid transfer with `extra` instructions spliced in ahead of it, which+// is the shape @x402/svm produces (compute budget, memo, then the transfer).+function buildTx(extra = []) {+ const senderAta = getAssociatedTokenAddressSync(mint, buyer.publicKey, false, TOKEN_PROGRAM_ID, ASSOCIATED_TOKEN_PROGRAM_ID);+ const receiverAta = getAssociatedTokenAddressSync(mint, payTo, false, TOKEN_PROGRAM_ID, ASSOCIATED_TOKEN_PROGRAM_ID);+ const instructions = [+ ComputeBudgetProgram.setComputeUnitLimit({ units: 60_000 }),+ ComputeBudgetProgram.setComputeUnitPrice({ microLamports: 5 }),+ ...extra,+ createTransferCheckedInstruction(+ senderAta, mint, receiverAta, buyer.publicKey,+ BigInt(requirement.amount), 6, [], TOKEN_PROGRAM_ID,+ ),+ ];+ const msg = new TransactionMessage({+ payerKey: buyer.publicKey,+ recentBlockhash: BLOCKHASH,+ instructions,+ }).compileToV0Message();+ const vtx = new VersionedTransaction(msg);+ vtx.sign([buyer]);+ return Buffer.from(vtx.serialize()).toString('base64');+}++const validate = (txBase64) => validateRingTransaction({+ txBase64, requirement, feePayerPubkey: null, allowlist,+});++describe('facilitator gate: SPL Memo interop', () => {+ it('settles a payment carrying a memo, the shape the reference client builds', () => {+ const v = validate(buildTx([memoIx(MEMO_V2, 'x402-payment:0xdeadbeef')]));+ expect(v.ok).toBe(true);+ expect(v.decoded.payer).toBe(buyer.publicKey.toBase58());+ expect(String(v.decoded.amountAtomic)).toBe(requirement.amount);+ });++ it('accepts the legacy memo program id too', () => {+ expect(validate(buildTx([memoIx(MEMO_V1, 'legacy')])).ok).toBe(true);+ });++ it('is unchanged for a payment with no memo', () => {+ expect(validate(buildTx()).ok).toBe(true);+ });++ it('does not let a memo smuggle in a second transfer', () => {+ const senderAta = getAssociatedTokenAddressSync(mint, buyer.publicKey, false, TOKEN_PROGRAM_ID, ASSOCIATED_TOKEN_PROGRAM_ID);+ const receiverAta = getAssociatedTokenAddressSync(mint, payTo, false, TOKEN_PROGRAM_ID, ASSOCIATED_TOKEN_PROGRAM_ID);+ const second = createTransferCheckedInstruction(+ senderAta, mint, receiverAta, buyer.publicKey, 1n, 6, [], TOKEN_PROGRAM_ID,+ );+ const v = validate(buildTx([memoIx(MEMO_V2, 'note'), second]));+ expect(v.ok).toBe(false);+ });++ it('still forbids a System instruction sitting next to a memo', () => {+ const drain = SystemProgram.transfer({+ fromPubkey: buyer.publicKey,+ toPubkey: treasury.publicKey,+ lamports: 1,+ });+ const v = validate(buildTx([memoIx(MEMO_V2, 'note'), drain]));+ expect(v.ok).toBe(false);+ expect(v.reason).toBe('system_instruction_forbidden');+ });++ it('still forbids an unrelated program next to a memo', () => {+ const stray = new TransactionInstruction({+ keys: [],+ programId: Keypair.generate().publicKey,+ data: Buffer.from([1, 2, 3]),+ });+ const v = validate(buildTx([memoIx(MEMO_V2, 'note'), stray]));+ expect(v.ok).toBe(false);+ expect(v.reason).toMatch(/^program_not_allowed:/);+ });+});diff --git a/tests/x402-solana-networks.test.js b/tests/x402-solana-networks.test.jsnew file mode 100644index 000000000..75b84d09b--- /dev/null+++ b/tests/x402-solana-networks.test.js@@ -0,0 +1,118 @@+// The Solana lane definitions the whole x402 rail shares, plus the two lane+// bugs found while running the phase-4 settlement proof (see+// specs/inference-receipts.md):+//+// 1. The rail carried three inlined copies of `isSolanaNetwork`. They agreed+// by luck, not by construction, and only the copy in x402-spec.js was+// exercised by the settle path.+// 2. The receipt verifiers matched the devnet CAIP-2 id by a substring that+// was missing a character, so it never matched: every devnet receipt was+// looked up on MAINNET and reported as mainnet.++import { describe, it, expect, afterEach } from 'vitest';++import {+ NETWORK_SOLANA_MAINNET,+ NETWORK_SOLANA_DEVNET,+ caip2ForGenesisHash,+ isSolanaNetwork,+ solanaLocalTestNetwork,+} from '../api/_lib/x402/solana-networks.js';++const LOCAL_GENESIS = '8p5TJ23ZcDXq5QA3vGbpf2sXZ25f69YWJbpxS6dhE1Mr';+const LOCAL_ID = 'solana:8p5TJ23ZcDXq5QA3vGbpf2sXZ25f69YW';++afterEach(() => {+ delete process.env.X402_SOLANA_LOCAL_NETWORK;+});++describe('Solana CAIP-2 ids', () => {+ it('are the truncated genesis hashes the x402 spec advertises', () => {+ expect(NETWORK_SOLANA_MAINNET).toBe('solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp');+ expect(NETWORK_SOLANA_DEVNET).toBe('solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1');+ });++ it('derives a lane id from a genesis hash by truncating to 32 base58 chars', () => {+ expect(caip2ForGenesisHash(LOCAL_GENESIS)).toBe(LOCAL_ID);+ expect(caip2ForGenesisHash(LOCAL_ID.slice('solana:'.length))).toBe(LOCAL_ID);+ expect(() => caip2ForGenesisHash('')).toThrow(/genesis hash is required/);+ });++ // The bug this guards: 'solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1' lowercased+ // contains "imfey", and both verifiers searched for "imey". A devnet receipt+ // therefore fell through to the mainnet branch, was queried against the+ // mainnet RPC, and was reported to the operator as a mainnet settlement.+ it('lowercases devnet to an id containing imfey, not imey', () => {+ const lower = NETWORK_SOLANA_DEVNET.toLowerCase();+ expect(lower).toBe('solana:etwtrabzayq6imfeykouru166vu2xqa1');+ expect(lower.includes('etwtrabzayq6imeykouru166vu2xqa1')).toBe(false);+ });+});++describe('isSolanaNetwork', () => {+ it('accepts the two public lanes and the bare alias', () => {+ expect(isSolanaNetwork(NETWORK_SOLANA_MAINNET)).toBe(true);+ expect(isSolanaNetwork(NETWORK_SOLANA_DEVNET)).toBe(true);+ expect(isSolanaNetwork('solana')).toBe(true);+ });++ it('rejects EVM networks, junk, and empty values', () => {+ expect(isSolanaNetwork('eip155:8453')).toBe(false);+ expect(isSolanaNetwork('base')).toBe(false);+ expect(isSolanaNetwork('')).toBe(false);+ expect(isSolanaNetwork(null)).toBe(false);+ expect(isSolanaNetwork(undefined)).toBe(false);+ });++ it('rejects an unconfigured local lane, which is how production runs', () => {+ expect(solanaLocalTestNetwork()).toBe(null);+ expect(isSolanaNetwork(LOCAL_ID)).toBe(false);+ });++ it('accepts exactly the configured local lane, and nothing else', () => {+ process.env.X402_SOLANA_LOCAL_NETWORK = LOCAL_ID;+ expect(solanaLocalTestNetwork()).toBe(LOCAL_ID);+ expect(isSolanaNetwork(LOCAL_ID)).toBe(true);+ expect(isSolanaNetwork('solana:someOtherLedgerId111111111111')).toBe(false);+ // A null network must never match a null local lane by accident.+ delete process.env.X402_SOLANA_LOCAL_NETWORK;+ expect(isSolanaNetwork(null)).toBe(false);+ });++ it('ignores a malformed local lane rather than widening the rail', () => {+ for (const bad of ['not-a-caip2', 'solana:', 'eip155:1', 'solana:has spaces', ' ']) {+ process.env.X402_SOLANA_LOCAL_NETWORK = bad;+ expect(solanaLocalTestNetwork()).toBe(null);+ expect(isSolanaNetwork(bad)).toBe(false);+ }+ });+});++describe('one definition, shared by every module on the rail', () => {+ it('x402-spec, x402-solana-confirm and a2a-client agree on ids and predicate', async () => {+ const spec = await import('../api/_lib/x402-spec.js');+ const confirm = await import('../api/_lib/x402-solana-confirm.js');+ const client = await import('../api/_lib/x402/a2a-client.js');++ expect(spec.NETWORK_SOLANA_MAINNET).toBe(NETWORK_SOLANA_MAINNET);+ expect(spec.NETWORK_SOLANA_DEVNET).toBe(NETWORK_SOLANA_DEVNET);+ expect(client.NETWORK_SOLANA_MAINNET).toBe(NETWORK_SOLANA_MAINNET);+ expect(client.NETWORK_SOLANA_DEVNET).toBe(NETWORK_SOLANA_DEVNET);++ process.env.X402_SOLANA_LOCAL_NETWORK = LOCAL_ID;+ for (const pred of [confirm.isSolanaNetwork, client.isSolanaNetwork]) {+ expect(pred(NETWORK_SOLANA_MAINNET)).toBe(true);+ expect(pred(LOCAL_ID)).toBe(true);+ expect(pred('eip155:8453')).toBe(false);+ }+ });++ it('routes the local lane to the Solana facilitator, and only when configured', async () => {+ const { facilitatorFor } = await import('../api/_lib/x402-spec.js');+ // Unconfigured: an unknown solana: id is not a network at all, so routing+ // fails closed rather than quietly settling it somewhere.+ expect(() => facilitatorFor(LOCAL_ID)).toThrow(/unsupported network/);+ process.env.X402_SOLANA_LOCAL_NETWORK = LOCAL_ID;+ expect(facilitatorFor(LOCAL_ID).url).toBe(facilitatorFor(NETWORK_SOLANA_MAINNET).url);+ });+});