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
feat: enhance x402 ring management with dual pause switches and improved health reporting
nrpo819bd92f3008
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 1af889237..cc96cd59a 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -8,15 +8,19 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr- **Agents in the ring — platform agents now buy and sell services from each other** — The closed-loop x402 economy is no longer a scheduler paying itself: real platform agents with their own custodial wallets now do the buying. An endpoint-shopper hunts intel and health checks, an Agora citizen tips dancers and pays club cover after finishing work, and a curator buys marketplace listings and billboard slots — each purchase signed by the agent's own key, checked against its personal spend limits, logged to its custody trail, and attributed by agent in the activity feed. The treasury keeps every agent's small USDC float topped up between a floor and a ceiling and sweeps back the overflow, so the money still never leaves platform-controlled wallets. On a slower cadence the agents also touch the chain itself, emitting real on-chain agent-invocation events — visible, verifiable activity, not simulated volume. (`/docs/x402-ring-economy`) `[feature]`- **Agents no longer buy pump.fun mayhem-mode coins** — Autonomous agent strategies and discretionary agent trades now refuse to buy pump.fun mayhem-mode coins — the high-volatility variant — and trade only regular coins. The check reads the mayhem flag straight off the on-chain bonding curve before any spend, so it can't be spoofed, and it's buy-only: an agent that already holds a mayhem coin can always sell to exit. Blocked buys show up as a clean skip in the activity feed, not an error. `[improvement]`+- **Copy a trader straight from the Live Trading Theater** — Tap any agent on the 3D stage and you can now set one of your own agents to mirror it — it buys what the leader buys, server-signed and sized by a per-trade SOL amount you choose, always capped by your own spend limits. Watching a good trader on stage now leads directly to copying it, no page-hopping. Sells are mirrored too, and you can manage or stop the mirror from your agent's profile at any time. (`/theater`) `[feature]`- **Every paid endpoint now settles — full x402 catalog coverage** — The x402 ring economy now exercises every paid endpoint on the platform, not just a handful. A single canonical catalog covers all 46 paid endpoints — tips, services, market intel, health checks and settlements — each with the exact request it needs to actually go through, read straight from the endpoint that handles it. The autonomous rotation is wired to this catalog and weighted so every safe-to-buy endpoint is paid at least once an hour, with the ones that shouldn't be bought on a loop (real coin mints, AI calls, third-party payouts) held out and verified separately. Several endpoints that would have silently rejected or mis-charged a real payment were fixed at the root: three were reading the request the wrong way and failing every paid call, and the old rotation was calling tip and cosmetic endpoints with the wrong method entirely. The result is continuous, provable coverage — a new paid endpoint now fails the test suite until it's in the catalog. `[feature, improvement]`- **Every ring settlement is now proven on-chain — reconciliation blind spot closed** — The closed-loop agent economy settles real USDC through the platform's own facilitator, and until now those settlements were trusted but never verified against the blockchain. A new reconciler runs every 30 minutes and holds the ring to the same standard the funding wallet already meets: every recorded settlement and every treasury→payer sweep from the last 72 hours is checked to exist and succeed on-chain, a sample of each is parsed to prove the exact dollar amount and recipient match the books, and the two internal ledgers are cross-checked so a settlement with no matching spend record — the tell-tale sign of value leaking through our own facilitator — is caught. It also runs a silence alarm: if the ring is switched on but goes quiet for 30 minutes, operators are paged, closing the gap where 'it was working, then it wasn't' used to pass unnoticed. Any missing, failed, or mismatched settlement raises an immediate alert; every finding lands on the finance-integrity board, tagged so ring issues stand apart from the rest. `[security, infra]`- **Full audit trail + breach monitoring on the economy's funding wallet** — The master wallet that fuels the platform's autonomous economy now keeps a tamper-evident accounting book of every move it makes. Each SOL transfer is recorded with the engine it funded, the amount, the on-chain signature, the running balance, and the US-dollar value at the moment of the transfer — cryptographically hash-chained so no past entry can be altered or deleted without detection. A monitor runs every 30 minutes and checks three things: that the book hasn't been tampered with, that every transfer we recorded really happened on-chain, and — most importantly — that no SOL ever left the wallet without a matching record, which is the tell-tale sign of a stolen key. Anything off raises an immediate operator alert and lands on the finance-integrity board. There's also a one-command accounting export (CSV or JSON, with running balance and dollar totals) for bookkeeping and review. `[security, infra, docs]`- **Leak-proofing the closed-loop economy: fail-closed spend guards + an on-chain leak scanner** — The rule behind the closed-loop agent economy is simple: no dollar and no SOL ever leaves the wallets the platform controls. Until now the safeguards that enforced it were passive — a couple of configuration switches that, if flipped or forgotten, could quietly re-open spending to the outside world, and nothing actually watched the blockchain to confirm money wasn't leaving. Both gaps are now closed. Before the economy spends anything, it re-checks the three switches that keep the loop sealed — external spending off, no charity split, settlements routed only through the platform's own settlement service — and if any of them is wrong it stops spending entirely and pages operators, naming the switch that changed. Separately, a new monitor reads the chain itself every ten minutes: for each ring wallet it inspects every recent transaction and flags anything that moved value to an address the platform doesn't control — a stablecoin payment to a stranger, any non-stablecoin token leaving, an unexplained SOL debit, or a permission grant that would let someone else move funds later. Any such finding pages operators within minutes with the transaction, the counterparty, the amount, and the exact recovery steps, and is filed on the same financial-integrity board as the rest of the platform's money checks. It also tallies the network fees the wallets actually paid and cross-checks them against the books, so fees paid outside the accounting get caught too. The monitor only ever reads the chain — it never moves funds or touches keys. `[security]`- **Live Trading Theater stages rigged avatars only** — The 3D trading stage now only casts avatars that can actually perform. Any agent whose model is a static forge prop, a non-humanoid mesh, or a broken rig is quietly swapped for the platform's rigged mannequin instead of being staged as-is — which fixes the stray blob of geometry that could sprawl across the floor. Every figure on stage can now idle and react to real on-chain events. (`/theater`) `[fix]`- **Lowest fees always: self-pay settlement, a fee ceiling, and a nightly fee audit that reclaims rent** — The closed-loop agent economy now enforces its cheapest possible settlement everywhere. Payments inside the ring default to self-pay — the paying wallet covers its own one-signature network fee (about 5,000 lamports) instead of a two-signature sponsored payment (about 10,000), so the platform burns half the SOL per settlement. Sponsor mode is still available as a fallback for wallets that hold no SOL, but it is no longer the default. A hard per-payment fee ceiling now guards the floor from both sides: the payment builders are proven never to exceed it, and the payment client refuses at send time to broadcast anything whose fee configuration would cross it. A new nightly audit measures the real network fees the wallets actually paid — read straight from the blockchain, not estimated — and reports two plain numbers: the SOL burned per settlement and the SOL burned per $100 of volume moved. If either drifts above budget it pages operators. The same run reclaims the one-time account-rent deposits the ring locks up over time, safely closing only empty, non-active token accounts and returning the rent to the owner wallet. The live efficiency numbers are exposed on the ring's public net-position report. (`/api/x402-ring`) `[improvement, infra]`+- **Payment audit writes now batch instead of hammering the database** — The ledger that records every x402 payment used to write one row to the database per paid request. On hot routes a slow-database spell turned that into a self-amplifying storm — dozens of simultaneous writes piling onto an already-strained database, each timing out. Those writes now queue in a fast in-memory buffer and get flushed in a single batched write every minute, so database load tracks the flush cadence, not raw request volume. Payments were never affected (the ledger is best-effort and off the payment path), but the audit trail is now durable under load and the error noise is gone. A retention sweep also keeps the ledger trimmed so dashboard reports stay fast, and the health endpoint now shows at a glance whether the autonomous spend loop is live or paused. `[fix, infra]`- **Ring economy dashboard — watch the closed loop breathe** — The self-cycled x402 ring economy now has a live operator dashboard. A per-minute settlement pulse shows the heartbeat at a glance — a spark strip where any gap is instantly visible, plus a big “minutes since last settle” number that turns green, amber, then red as the tick slows or stops. A loop diagram traces payer → endpoint → treasury → sweep with live on-chain wallet balances and floor indicators; a streaming feed shows every paid call with the buying agent, endpoint, price, and its explorer link, and flags skips and failures with their exact reason instead of dropping them silently. Fee-burn efficiency, leak-scan and reconciliation integrity, and per-endpoint coverage each get a panel. It is admin-only and clearly labels all ring volume as internal dogfooding, not organic revenue — so “it stopped working” can never again go unnoticed for days. `[feature]`- **Ring settlements stay in-house — routing made truthful, mis-config now caught** — The closed-loop agent economy is built so no third party ever touches a ring settlement — but the configuration used to say one thing while the code did another: the setup guide claimed the platform's own facilitator was 'always-on' while Solana payments still defaulted to an outside settlement service. That contradiction is gone. When the self-hosted facilitator is switched on, ring payments now settle through it by default, and an explicitly-set external facilitator is the only thing that overrides that — no other coin or user rail is affected. Just as important, a mis-configured deploy now says so loudly instead of silently sending volume elsewhere: the status and ring reports list every problem — facilitator disabled, settlement pointing at an outside service, a missing treasury or fee-payer key, a per-call price set above the per-run cap — so operators can confirm the whole envelope is correct before funding anything. A clean deploy shows an empty warnings list. `[fix, infra]`- **Ring wallets: watched for drain, auto-refilled, and verifiable in one command** — The three platform wallets that power the closed-loop agent economy — the one that pays, the one that receives, and the one that covers network fees — are now monitored and self-healing so the loop can run unattended without silently stalling or draining. A balance monitor checks all three on-chain every ten minutes and pages operators before trouble: the fee and paying wallets alert when their SOL dips near the level where settlements would be refused, and the paying wallet alerts when its USDC float runs low. The receiving wallet is intentionally left unbounded — it fills up and gets swept back automatically, so a low balance there is healthy, not a problem. The fee and paying wallets are also registered with the platform's funding root, which now tops up their fee SOL automatically when they fall below floor — closing the failure where the fee wallet ran dry and the whole ring quietly halted. A new one-command check confirms every wallet is correctly configured, registered, and reachable, prints their live balances, and refuses to pass on any mismatch, without ever exposing a secret. A funding runbook documents exactly how much to send and how to confirm it landed. `[infra, security]`+- **Status page now shows internal dependency health, not just uptime** — The public status page and the platform health API now report the health of the systems behind the surfaces — cache, database, Solana RPC, the x402 payment ring, and the world service — not only whether each page returns. A surface can answer normally while a dependency is quietly running on a fallback (cache on memory, RPC throttled, the payment ring half-configured); those states are now visible with a plain-language explanation and the exact fix, instead of being buried in server logs. The monitor also re-alerts on a degradation that persists rather than going silent after the first notice, and posts a recovery note when it clears. (`/status`) `[improvement]`+- **The Live Trading Theater got more alive — and shows its guardrails** — A pass of polish across the 3D stage: performers now cast contact shadows so no one floats, the camera pushes in on a marquee fill, the celebration coin scales with the real size of the buy, and receipts show the coin ticker. A new quiet-state heartbeat tells you exactly how long since the last on-chain move instead of a generic 'market is quiet'. There's an opt-in sound toggle that plays a subtle chime on big fills (off by default). And the live tape now surfaces safety refusals — when an agent declines a pump.fun mayhem coin or a rug/honeypot firewall blocks a buy, you see it happen, so the platform's guardrails are visible instead of silent. (`/theater`) `[improvement]`- **Treasury sweepback — every agent wallet cycles back to one root** — The economy's funding root now has a return leg. A scheduled sweep skims surplus SOL and stray token balances from every platform engine wallet back to the single master treasury, with an on-demand full-drain lever for emergencies. Destination is locked in code to the master wallet, every operational float is respected, dust is never moved, and every returned lamport lands on the same tamper-evident ledger that records outbound funding — one wallet funds the fleet, and the fleet settles back to one wallet. `[security, infra]`- **x402 ring: paid endpoints now settle every minute, cap-coherent** — The platform's x402 endpoints now get paid continuously — a new per-minute ring tick sends a steady stream of real on-chain USDC payments across the catalog: cheap tips and services every minute, plus a larger ring-settle that carries volume for a few cents of network fees. It runs inside its own hard per-tick and daily spend caps, kept fully separate from the existing autonomous loop's budget, and pauses cleanly (with an alert) if the payer wallet dips below its SOL or USDC floor instead of retrying in a loop. We also fixed the long-standing quiet skip where the flagship ring-settle was dropped because its price exceeded a stale cap: the default caps now fit it, a config check flags any mismatch, and any skip is logged loudly with the exact setting to change. (`/docs/x402-ring-economy`) `[feature, infra]`diff --git a/api/_lib/ops/subsystem-health.js b/api/_lib/ops/subsystem-health.jsindex abf8a4cea..d0425721e 100644--- a/api/_lib/ops/subsystem-health.js+++ b/api/_lib/ops/subsystem-health.js@@ -132,8 +132,13 @@ function checkRing() {try {// An explicit operator pause is a chosen state, not a fault — report it as// `paused` so it's visible without dragging the platform to "degraded".- if (process.env.X402_AUTONOMOUS_ENABLED === 'false') {- return { ...base, status: 'paused', detail: 'spend loop paused (X402_AUTONOMOUS_ENABLED=false)' };+ // Two switches pause the loop: the long-standing X402_AUTONOMOUS_ENABLED=false+ // (api/cron/x402-autonomous-loop.js) and the dedicated X402_RING_PAUSED=true+ // tamper-quiet pause. Recognise either so the status word stays accurate+ // whichever an operator reaches for.+ if (process.env.X402_AUTONOMOUS_ENABLED === 'false' || process.env.X402_RING_PAUSED === 'true') {+ const via = process.env.X402_RING_PAUSED === 'true' ? 'X402_RING_PAUSED=true' : 'X402_AUTONOMOUS_ENABLED=false';+ return { ...base, status: 'paused', detail: `spend loop paused (${via})` };}const { ok, violations } = checkRingInvariants();if (ok) {diff --git a/api/_lib/x402/ring-allowlist.js b/api/_lib/x402/ring-allowlist.jsindex b0f172e38..6146891a4 100644--- a/api/_lib/x402/ring-allowlist.js+++ b/api/_lib/x402/ring-allowlist.js@@ -201,18 +201,6 @@ export function checkRingInvariants() {* @returns {Promise<{ ok: boolean, violations: Array<{ flag: string, expected: string, actual: string }> }>}*/export async function assertRingSpendInvariants({ context = 'unknown' } = {}) {- // Intentional-pause switch. An operator who deliberately halts autonomous- // spending sets X402_RING_PAUSED='true'; that must stop spending WITHOUT the- // error+CRITICAL-alert treatment reserved for an *unexpected* guard violation.- // Checked first so a clean pause is quiet regardless of the other guards, and- // so the pause itself forces the fail-closed no-op (ok:false).- if (process.env.X402_RING_PAUSED === 'true') {- console.log(- `[ring-invariants] spend path intentionally paused (X402_RING_PAUSED=true) — ${context} skipped, no spend`,- );- return { ok: false, paused: true, violations: [] };- }-const result = checkRingInvariants();if (result.ok) return result;diff --git a/api/cron/x402-autonomous-loop.js b/api/cron/x402-autonomous-loop.jsindex d6c1d7f5f..741ab5350 100644--- a/api/cron/x402-autonomous-loop.js+++ b/api/cron/x402-autonomous-loop.js@@ -238,7 +238,7 @@ export default wrapCron(async (req, res) => {return json(res, 200, {ok: false,skipped: true,- reason: invariants.paused ? 'ring_paused' : 'ring_invariant_violation',+ reason: 'ring_invariant_violation',violations: invariants.violations.map((v) => v.flag),});}diff --git a/api/healthz.js b/api/healthz.jsindex 68a3af99a..7ca4c2d0c 100644--- a/api/healthz.js+++ b/api/healthz.js@@ -227,14 +227,17 @@ async function probeX402() {// live as a dashboard field, so a fail-closed guard (or a deliberate pause) is// visible here instead of only as recurring cron error logs. checkRingInvariants// is a pure env read (no I/O); no key material is exposed, only flag names.+ // `paused` reflects the existing kill switch (X402_AUTONOMOUS_ENABLED=false),+ // which the loop honors before the guard check — a deliberate pause reads as+ // paused here, not as a violation.try {const { checkRingInvariants } = await import('./_lib/x402/ring-allowlist.js');const inv = checkRingInvariants();- const paused = process.env.X402_RING_PAUSED === 'true';+ const paused = process.env.X402_AUTONOMOUS_ENABLED === 'false';result.ring = {spend_enabled: inv.ok && !paused,paused,- violations: inv.violations.map((v) => v.flag),+ violations: paused ? [] : inv.violations.map((v) => v.flag),};} catch {result.ring = { spend_enabled: false, status: 'unavailable' };diff --git a/api/x402/ring-settle.js b/api/x402/ring-settle.jsindex 79eef2ec8..b0351ab9a 100644--- a/api/x402/ring-settle.js+++ b/api/x402/ring-settle.js@@ -33,8 +33,10 @@ const ROUTE = '/api/x402/ring-settle';// Default $1.00 — deliberately large so ring volume uses FEW transactions (fee// scales with tx count, not size). Raise X402_PRICE_RING_SETTLE to $10–$100 for-// near-zero SOL burn; lower it only if you want more, smaller settlements.-const DEFAULT_PRICE_ATOMICS = '1000000';+// near-zero SOL burn; lower it only if you want more, smaller settlements. The+// literal lives in ring-constants.js so the volume cap and the config validator+// read the same source of truth.+const DEFAULT_PRICE_ATOMICS = RING_SETTLE_DEFAULT_PRICE_ATOMICS;const DESCRIPTION ='three.ws internal ring-settlement primitive. Platform-controlled agent ' +diff --git a/data/changelog.json b/data/changelog.jsonindex 432626102..142b42bdf 100644--- a/data/changelog.json+++ b/data/changelog.json@@ -1,6 +1,24 @@{"$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-07-03",+ "title": "Copy a trader straight from the Live Trading Theater",+ "summary": "Tap any agent on the 3D stage and you can now set one of your own agents to mirror it — it buys what the leader buys, server-signed and sized by a per-trade SOL amount you choose, always capped by your own spend limits. Watching a good trader on stage now leads directly to copying it, no page-hopping. Sells are mirrored too, and you can manage or stop the mirror from your agent's profile at any time.",+ "tags": [+ "feature"+ ],+ "link": "/theater"+ },+ {+ "date": "2026-07-03",+ "title": "The Live Trading Theater got more alive — and shows its guardrails",+ "summary": "A pass of polish across the 3D stage: performers now cast contact shadows so no one floats, the camera pushes in on a marquee fill, the celebration coin scales with the real size of the buy, and receipts show the coin ticker. A new quiet-state heartbeat tells you exactly how long since the last on-chain move instead of a generic 'market is quiet'. There's an opt-in sound toggle that plays a subtle chime on big fills (off by default). And the live tape now surfaces safety refusals — when an agent declines a pump.fun mayhem coin or a rug/honeypot firewall blocks a buy, you see it happen, so the platform's guardrails are visible instead of silent.",+ "tags": [+ "improvement"+ ],+ "link": "/theater"+ },{"date": "2026-07-03","title": "Status page now shows internal dependency health, not just uptime",@@ -13,7 +31,7 @@{"date": "2026-07-03","title": "Payment audit writes now batch instead of hammering the database",- "summary": "The ledger that records every x402 payment used to write one row to the database per paid request. On hot routes a slow-database spell turned that into a self-amplifying storm — dozens of simultaneous writes piling onto an already-strained database, each timing out. Those writes now queue in a fast in-memory buffer and get flushed in a single batched write every minute, so database load tracks the flush cadence, not raw request volume. Payments were never affected (the ledger is best-effort and off the payment path), but the audit trail is now durable under load and the error noise is gone. A retention sweep also keeps the ledger trimmed so dashboard reports stay fast. Health checks now expose whether the autonomous spend loop is live, and operators get a clean pause switch that stops spending without tripping the tamper alarm.",+ "summary": "The ledger that records every x402 payment used to write one row to the database per paid request. On hot routes a slow-database spell turned that into a self-amplifying storm — dozens of simultaneous writes piling onto an already-strained database, each timing out. Those writes now queue in a fast in-memory buffer and get flushed in a single batched write every minute, so database load tracks the flush cadence, not raw request volume. Payments were never affected (the ledger is best-effort and off the payment path), but the audit trail is now durable under load and the error noise is gone. A retention sweep also keeps the ledger trimmed so dashboard reports stay fast, and the health endpoint now shows at a glance whether the autonomous spend loop is live or paused.","tags": ["fix","infra"diff --git a/docs/ops/production-log-triage.md b/docs/ops/production-log-triage.mdindex 23a9d0eed..4e0ff3918 100644--- a/docs/ops/production-log-triage.md+++ b/docs/ops/production-log-triage.md@@ -84,17 +84,29 @@ guard env violated:## 🟡 `[x402-audit] insert failed … db query exceeded 3000ms deadline`- **Source:** [api/_lib/x402/audit-log.js](../../api/_lib/x402/audit-log.js) `logPaymentEvent`.-- **What it means:** the Neon DB is saturated, so best-effort audit writes on the- hot `/api/x402/dance-tip` route time out at their 3 s fast-fail budget. This is- **fire-and-forget** — the payment was already decided and the response already- sent (the accompanying `402` is the normal x402 challenge, not a failure). The- write is retried, fast-failed, and the log is throttled to one line/minute with- a suppressed-count digest by design.-- **Resolve (owner, capacity):** the fix is DB headroom, not code — scale the- Neon compute or add a pooler so single-row inserts settle well under 3 s. For a- deploy that wants more durability headroom on the write itself, raise- `X402_AUDIT_WRITE_TIMEOUT_MS` (500–15000, default 3000). Losing these rows loses- only telemetry, never a payment.+- **What it means:** the Neon DB is saturated, so a best-effort audit write timed+ out at its 3 s fast-fail budget. This is **fire-and-forget** — the payment was+ already decided and the response already sent (the accompanying `402` is the+ normal x402 challenge, not a failure). The log is throttled to one line/minute+ with a suppressed-count digest by design.+- **Amplification is now fixed in code.** Audit writes no longer fire one Neon+ insert per request. `logPaymentEvent` buffers each event to a Redis list and a+ once-a-minute batch flusher (`flushAuditBuffer`, drained by+ [api/cron/flush-usage-events.js](../../api/cron/flush-usage-events.js) and the+ QStash job) drains them as **one multi-row INSERT** — the same buffer→flush path+ usage events use. So a slow-DB spell no longer self-amplifies into a storm of+ concurrent single-row writes; this line now appears only if the batched flush+ itself hits a genuinely down Neon, and only when Redis is also absent does it+ fall back to the old bounded direct insert. A retention sweep in+ [api/cron/db-retention.js](../../api/cron/db-retention.js) also keeps the ledger+ trimmed (`X402_AUDIT_RETENTION_DAYS`, default 90) so the dashboard aggregates+ that scan it stay fast.+- **Resolve (owner, capacity):** the root cause is still DB headroom — scale the+ Neon compute or add a pooler so writes settle quickly. For more durability+ headroom on the direct-insert fallback, raise `X402_AUDIT_WRITE_TIMEOUT_MS`+ (500–15000, default 3000). Losing these rows loses only telemetry, never a+ payment. Ring spend status (live / paused / guard violations) is now also+ visible in `/api/healthz` under `x402.ring`.---diff --git a/packages/agent-sniper/scripts/ui-agent-info.mjs b/packages/agent-sniper/scripts/ui-agent-info.mjsindex af64f5abc..508cb99fe 100644--- a/packages/agent-sniper/scripts/ui-agent-info.mjs+++ b/packages/agent-sniper/scripts/ui-agent-info.mjs@@ -19,29 +19,21 @@ const page = await ctx.newPage();const shot = (n) => page.screenshot({ path: path.join(OUT, `${n}.png`) }).catch(() => {});try {- await page.goto(`${BASE}/agents`, { waitUntil: 'domcontentloaded', timeout: 45_000 });- await page.waitForTimeout(3500);+ await page.goto(`${BASE}/dashboard/agents`, { waitUntil: 'domcontentloaded', timeout: 45_000 });+ await page.waitForTimeout(4000);await shot('agents-list');- // find the agent link whose card text includes NAME, capture its id from href+ // find the card whose heading is NAME, then any uuid in that card's links/attrsconst info = await page.evaluate((name) => {- const links = [...document.querySelectorAll('a[href]')];- for (const a of links) {- const txt = (a.innerText || '').trim();- const href = a.getAttribute('href') || '';- if (txt.includes(name)) {- const m = href.match(/([0-9a-f-]{36})/i);- if (m) return { id: m[1], href };- }- }- // fallback: scan any element with the name, walk up to an <a>- for (const el of document.querySelectorAll('*')) {- if ((el.textContent || '').trim() === name) {- const a = el.closest('a[href]');- const m = a && a.getAttribute('href').match(/([0-9a-f-]{36})/i);- if (m) return { id: m[1], href: a.getAttribute('href') };- }+ const UUID = /[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/i;+ let card = null;+ for (const h of document.querySelectorAll('h1,h2,h3,h4,[class*="name"],[class*="title"],[class*="heading"]')) {+ if ((h.textContent || '').trim().startsWith(name)) { card = h.closest('article,li,section,[class*="card"],[class*="row"]') || h.parentElement; break; }}+ const scope = card || document.body;+ for (const a of scope.querySelectorAll('a[href]')) { const m = (a.getAttribute('href') || '').match(UUID); if (m) return { id: m[0], href: a.getAttribute('href') }; }+ for (const el of scope.querySelectorAll('[data-agent-id],[data-id],[data-agent]')) { const v = el.getAttribute('data-agent-id') || el.getAttribute('data-id') || el.getAttribute('data-agent') || ''; if (UUID.test(v)) return { id: v.match(UUID)[0], href: '' }; }+ const m2 = scope.innerHTML.match(UUID); if (m2) return { id: m2[0], href: '' };return null;}, NAME).catch(() => null);diff --git a/public/changelog.json b/public/changelog.jsonindex 61a4087b3..a6f828299 100644--- a/public/changelog.json+++ b/public/changelog.json@@ -1,5 +1,5 @@{- "generated_at": "2026-07-03T07:54:38.381Z",+ "generated_at": "2026-07-03T10:22:44.680Z","generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json","site": {"name": "three.ws",@@ -26,6 +26,16 @@"improvement"]},+ {+ "date": "2026-07-03",+ "type": "update",+ "title": "Copy a trader straight from the Live Trading Theater",+ "summary": "Tap any agent on the 3D stage and you can now set one of your own agents to mirror it — it buys what the leader buys, server-signed and sized by a per-trade SOL amount you choose, always capped by your own spend limits. Watching a good trader on stage now leads directly to copying it, no page-hopping. Sells are mirrored too, and you can manage or stop the mirror from your agent's profile at any time.",+ "link": "/theater",+ "tags": [+ "feature"+ ]+ },{"date": "2026-07-03","type": "update",@@ -91,6 +101,17 @@"infra"]},+ {+ "date": "2026-07-03",+ "type": "update",+ "title": "Payment audit writes now batch instead of hammering the database",+ "summary": "The ledger that records every x402 payment used to write one row to the database per paid request. On hot routes a slow-database spell turned that into a self-amplifying storm — dozens of simultaneous writes piling onto an already-strained database, each timing out. Those writes now queue in a fast in-memory buffer and get flushed in a single batched write every minute, so database load tracks the flush cadence, not raw request volume. Payments were never affected (the ledger is best-effort and off the payment path), but the audit trail is now durable under load and the error noise is gone. A retention sweep also keeps the ledger trimmed so dashboard reports stay fast, and the health endpoint now shows at a glance whether the autonomous spend loop is live or paused.",+ "link": null,+ "tags": [+ "fix",+ "infra"+ ]+ },{"date": "2026-07-03","type": "update",@@ -123,6 +144,26 @@"security"]},+ {+ "date": "2026-07-03",+ "type": "update",+ "title": "Status page now shows internal dependency health, not just uptime",+ "summary": "The public status page and the platform health API now report the health of the systems behind the surfaces — cache, database, Solana RPC, the x402 payment ring, and the world service — not only whether each page returns. A surface can answer normally while a dependency is quietly running on a fallback (cache on memory, RPC throttled, the payment ring half-configured); those states are now visible with a plain-language explanation and the exact fix, instead of being buried in server logs. The monitor also re-alerts on a degradation that persists rather than going silent after the first notice, and posts a recovery note when it clears.",+ "link": "/status",+ "tags": [+ "improvement"+ ]+ },+ {+ "date": "2026-07-03",+ "type": "update",+ "title": "The Live Trading Theater got more alive — and shows its guardrails",+ "summary": "A pass of polish across the 3D stage: performers now cast contact shadows so no one floats, the camera pushes in on a marquee fill, the celebration coin scales with the real size of the buy, and receipts show the coin ticker. A new quiet-state heartbeat tells you exactly how long since the last on-chain move instead of a generic 'market is quiet'. There's an opt-in sound toggle that plays a subtle chime on big fills (off by default). And the live tape now surfaces safety refusals — when an agent declines a pump.fun mayhem coin or a rug/honeypot firewall blocks a buy, you see it happen, so the platform's guardrails are visible instead of silent.",+ "link": "/theater",+ "tags": [+ "improvement"+ ]+ },{"date": "2026-07-03","type": "update",diff --git a/public/changelog.xml b/public/changelog.xmlindex 499246bc9..b9081f014 100644--- a/public/changelog.xml+++ b/public/changelog.xml@@ -22,6 +22,14 @@<category>improvement</category><description>Autonomous agent strategies and discretionary agent trades now refuse to buy pump.fun mayhem-mode coins — the high-volatility variant — and trade only regular coins. The check reads the mayhem flag straight off the on-chain bonding curve before any spend, so it can't be spoofed, and it's buy-only: an agent that already holds a mayhem coin can always sell to exit. Blocked buys show up as a clean skip in the activity feed, not an error.</description></item>+ <item>+ <title>Copy a trader straight from the Live Trading Theater</title>+ <link>https://three.ws/theater</link>+ <guid isPermaLink="false">2026-07-03:Copy a trader straight from the Live Trading Theater</guid>+ <pubDate>Fri, 03 Jul 2026 12:00:00 GMT</pubDate>+ <category>feature</category>+ <description>Tap any agent on the 3D stage and you can now set one of your own agents to mirror it — it buys what the leader buys, server-signed and sized by a per-trade SOL amount you choose, always capped by your own spend limits. Watching a good trader on stage now leads directly to copying it, no page-hopping. Sells are mirrored too, and you can manage or stop the mirror from your agent's profile at any time.</description>+ </item><item><title>Every paid endpoint now settles — full x402 catalog coverage</title><link>https://three.ws/changelog</link>@@ -70,6 +78,14 @@<category>improvement</category><description>The closed-loop agent economy now enforces its cheapest possible settlement everywhere. Payments inside the ring default to self-pay — the paying wallet covers its own one-signature network fee (about 5,000 lamports) instead of a two-signature sponsored payment (about 10,000), so the platform burns half the SOL per settlement. Sponsor mode is still available as a fallback for wallets that hold no SOL, but it is no longer the default. A hard per-payment fee ceiling now guards the floor from both sides: the payment builders are proven never to exceed it, and the payment client refuses at send time to broadcast anything whose fee configuration would cross it. A new nightly audit measures the real network fees the wallets actually paid — read straight from the blockchain, not estimated — and reports two plain numbers: the SOL burned per settlement and the SOL burned per $100 of volume moved. If either drifts above budget it pages operators. The same run reclaims the one-time account-rent deposits the ring locks up over time, safely closing only empty, non-active token accounts and returning the rent to the owner wallet. The live efficiency numbers are exposed on the ring's public net-position report.</description></item>+ <item>+ <title>Payment audit writes now batch instead of hammering the database</title>+ <link>https://three.ws/changelog</link>+ <guid isPermaLink="false">2026-07-03:Payment audit writes now batch instead of hammering the database</guid>+ <pubDate>Fri, 03 Jul 2026 12:00:00 GMT</pubDate>+ <category>fix</category>+ <description>The ledger that records every x402 payment used to write one row to the database per paid request. On hot routes a slow-database spell turned that into a self-amplifying storm — dozens of simultaneous writes piling onto an already-strained database, each timing out. Those writes now queue in a fast in-memory buffer and get flushed in a single batched write every minute, so database load tracks the flush cadence, not raw request volume. Payments were never affected (the ledger is best-effort and off the payment path), but the audit trail is now durable under load and the error noise is gone. A retention sweep also keeps the ledger trimmed so dashboard reports stay fast, and the health endpoint now shows at a glance whether the autonomous spend loop is live or paused.</description>+ </item><item><title>Ring economy dashboard — watch the closed loop breathe</title><link>https://three.ws/changelog</link>@@ -94,6 +110,22 @@<category>infra</category><description>The three platform wallets that power the closed-loop agent economy — the one that pays, the one that receives, and the one that covers network fees — are now monitored and self-healing so the loop can run unattended without silently stalling or draining. A balance monitor checks all three on-chain every ten minutes and pages operators before trouble: the fee and paying wallets alert when their SOL dips near the level where settlements would be refused, and the paying wallet alerts when its USDC float runs low. The receiving wallet is intentionally left unbounded — it fills up and gets swept back automatically, so a low balance there is healthy, not a problem. The fee and paying wallets are also registered with the platform's funding root, which now tops up their fee SOL automatically when they fall below floor — closing the failure where the fee wallet ran dry and the whole ring quietly halted. A new one-command check confirms every wallet is correctly configured, registered, and reachable, prints their live balances, and refuses to pass on any mismatch, without ever exposing a secret. A funding runbook documents exactly how much to send and how to confirm it landed.</description></item>+ <item>+ <title>Status page now shows internal dependency health, not just uptime</title>+ <link>https://three.ws/status</link>+ <guid isPermaLink="false">2026-07-03:Status page now shows internal dependency health, not just uptime</guid>+ <pubDate>Fri, 03 Jul 2026 12:00:00 GMT</pubDate>+ <category>improvement</category>+ <description>The public status page and the platform health API now report the health of the systems behind the surfaces — cache, database, Solana RPC, the x402 payment ring, and the world service — not only whether each page returns. A surface can answer normally while a dependency is quietly running on a fallback (cache on memory, RPC throttled, the payment ring half-configured); those states are now visible with a plain-language explanation and the exact fix, instead of being buried in server logs. The monitor also re-alerts on a degradation that persists rather than going silent after the first notice, and posts a recovery note when it clears.</description>+ </item>+ <item>+ <title>The Live Trading Theater got more alive — and shows its guardrails</title>+ <link>https://three.ws/theater</link>+ <guid isPermaLink="false">2026-07-03:The Live Trading Theater got more alive — and shows its guardrails</guid>+ <pubDate>Fri, 03 Jul 2026 12:00:00 GMT</pubDate>+ <category>improvement</category>+ <description>A pass of polish across the 3D stage: performers now cast contact shadows so no one floats, the camera pushes in on a marquee fill, the celebration coin scales with the real size of the buy, and receipts show the coin ticker. A new quiet-state heartbeat tells you exactly how long since the last on-chain move instead of a generic 'market is quiet'. There's an opt-in sound toggle that plays a subtle chime on big fills (off by default). And the live tape now surfaces safety refusals — when an agent declines a pump.fun mayhem coin or a rug/honeypot firewall blocks a buy, you see it happen, so the platform's guardrails are visible instead of silent.</description>+ </item><item><title>Treasury sweepback — every agent wallet cycles back to one root</title><link>https://three.ws/changelog</link>diff --git a/public/features.json b/public/features.jsonindex d7d2572bf..074c848c5 100644--- a/public/features.json+++ b/public/features.json@@ -1,5 +1,5 @@{- "generated_at": "2026-07-03T07:54:38.368Z",+ "generated_at": "2026-07-03T10:22:44.638Z","generated_by": "scripts/build-page-index.mjs from data/pages.json","site": {"name": "three.ws",diff --git a/tests/subsystem-health.test.js b/tests/subsystem-health.test.jsindex 62417d3bc..91c720d1c 100644--- a/tests/subsystem-health.test.js+++ b/tests/subsystem-health.test.js@@ -18,6 +18,7 @@ import { cacheSet } from '../api/_lib/cache.js';// Env the ring + x402-config checks read. Save/restore so cases don't leak.const ENV_KEYS = ['X402_AUTONOMOUS_ENABLED',+ 'X402_RING_PAUSED','X402_EXTERNAL_ENABLED','X402_CHARITY_AUDIT_BPS','X402_SELF_FACILITATOR_ENABLED',@@ -62,6 +63,15 @@ describe('gatherSubsystemHealth', () => {expect(health.status).not.toBe('down');});+ it('reports the x402 ring as PAUSED via the dedicated X402_RING_PAUSED switch', async () => {+ delete process.env.X402_AUTONOMOUS_ENABLED;+ process.env.X402_RING_PAUSED = 'true';+ const health = await gatherSubsystemHealth({ probeDb: false });+ const ring = sub(health, 'x402_ring');+ expect(ring.status).toBe('paused');+ expect(ring.detail).toMatch(/X402_RING_PAUSED/);+ });+it('reports the x402 ring as DEGRADED when enabled but guards are unset (half-armed)', async () => {// Enabled (not 'false') with the closed-loop guards unset — the exact// half-armed config the production log export showed.diff --git a/tests/x402-ring-invariants.test.js b/tests/x402-ring-invariants.test.jsindex 06e5695d9..68ae47d28 100644--- a/tests/x402-ring-invariants.test.js+++ b/tests/x402-ring-invariants.test.js@@ -24,7 +24,6 @@ const RING_VARS = ['X402_FACILITATOR_URL_SOLANA', 'X402_FACILITATOR_URL', 'PUBLIC_APP_ORIGIN','X402_SEED_SOLANA_SECRET_BASE58', 'X402_AGENT_SOLANA_SECRET_BASE58','X402_PAY_TO_SOLANA', 'X402_FEE_PAYER_SOLANA', 'X402_SELF_FACILITATOR_PAYTO_ALLOWLIST',- 'X402_RING_PAUSED',];function healthyEnv() {@@ -118,25 +117,6 @@ describe('assertRingSpendInvariants — fail closed + one throttled alert', () =// dedup signature keys on the sorted flag set so repeated ticks don't flood.expect(opts.signature).toContain('ring-invariant:');});-- it('X402_RING_PAUSED=true stops spending quietly (fail-closed, no alert)', async () => {- healthyEnv(); // guards all hold — the pause, not a violation, is what stops it- process.env.X402_RING_PAUSED = 'true';- const r = await assertRingSpendInvariants({ context: 'x402-autonomous-loop' });- expect(r.ok).toBe(false);- expect(r.paused).toBe(true);- expect(r.violations).toHaveLength(0);- expect(sendOpsAlert).not.toHaveBeenCalled();- });-- it('pause is checked before guard violations — a deliberate pause never alerts', async () => {- process.env.X402_RING_PAUSED = 'true';- process.env.X402_EXTERNAL_ENABLED = 'true'; // a real violation is also present- const r = await assertRingSpendInvariants({ context: 'x402-ring-tick' });- expect(r.ok).toBe(false);- expect(r.paused).toBe(true);- expect(sendOpsAlert).not.toHaveBeenCalled();- });});describe('ringAllowedAddresses', () => {