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: update changelogs and features, enhance Mixamo export handling, and improve wallet activation UI
fudjia401fb57e07c0
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex aec0455e1..3e72258f8 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -10,11 +10,14 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr- **2,000+ new motion-capture animations in the library** — The animation library just grew from around 100 curated clips to over 2,000 — the full professional motion-capture set, every one retargeted to the universal three.ws skeleton so it plays on any humanoid avatar. Walks, runs, dances, combat, idles, reactions, sports, and hundreds more are all searchable in the animations gallery, previewable on a live avatar, and one click away from the pose studio or any embed. The clips are served from the CDN, so the site stays fast no matter how big the library gets. (`/animations`) `[feature, improvement]`- **Agent creation now tells you what to do when your avatar library is full** — If you hit your plan's avatar limit while creating an agent, the wizard used to fail with a bare error and leave you stuck. It now explains what happened and gives you three ways forward, right in the form: connect an avatar you already own (one click jumps you to your library), free up a slot by deleting an old avatar, or upgrade your plan. Oversized model files get a clearer message too. (`/create-agent`) `[fix, improvement]`- **Animation Gallery rebuilt — see every clip before you use it** — The animation gallery at three.ws/animations got a ground-up upgrade. All 2,100+ clips now show a real poster image of the avatar mid-motion instead of a blank tile, and hovering any card plays the full animation live in 3D. Clips are organized into 16 browsable categories (dance, combat, weapons, sports, and more) with search, sorting, and loop filters, and every clip has its own shareable link with playback controls — scrub the timeline, change the speed, then send it straight to the Animation Studio or copy an embed snippet for your own site. (`/animations`) `[feature, improvement]`+- **Go Live: a real path to activate your agent even when the welcome grant is paused** — When the one-tap welcome grant is temporarily paused, the Go Live tab used to show a bare dead-end card. It's now a proper self-fund path: it explains that depositing your own SOL does the exact same thing — funds your agent and lands it on the live Money Pulse — shows how much is enough to go live, and reassures you the deposit stays yours and is withdrawable anytime. The grant reopens on its own when the treasury is back online. `[improvement]`- **Go Pro with SOL or $THREE — 20% off in the platform coin** — The Pro plan is now a real self-serve upgrade you can buy on-chain. The pricing page checkout accepts USDC, SOL, or $THREE on Solana: pick your asset, scan a Solana Pay QR (or open it straight in your wallet), and your account upgrades the moment the payment finalizes. SOL and $THREE amounts are quoted at the live market price and pinned for the session, and paying in $THREE takes 20% off the sticker price — holding the coin already earns discounts, and now spending it does too. (`/pricing`) `[feature]`- **Payments a wallet silently rewrites now explain themselves instead of bouncing** — Some Solana wallets modify a payment transaction before signing it — injecting their own fee or guard instructions — and the platform's payment verifier rightly refuses anything that isn't the exact transfer it prepared. Until now that refusal looked like a dead end: the pay button bounced with a payment-required error no matter how many times you retried. The checkout now detects the rewrite the moment the wallet hands the transaction back and says plainly that the wallet altered it and nothing was charged, so you can switch wallets instead of retrying in circles. Verify rejections and settle failures are also now counted by reason on the public health endpoint, so a streak of refused payments is visible at a glance instead of hiding in admin logs. (`/club`) `[fix, improvement]`+- **Portfolio risk panel stops crying wolf on fresh wallets** — Every agent wallet holds SOL as its base currency, but the Portfolio tab used to flag a brand-new wallet holding only SOL as "100% concentration risk" in alarming red — a false alarm, since holding the base asset isn't a bet on anything. Concentration is now measured only across volatile memecoin positions, so a wallet parked in SOL or stablecoins reads correctly: a new Reserve tile shows your dry powder, and the panel tells you it's ready to deploy with minimal market risk instead of warning you about a risk that isn't there. A genuine over-concentration in one memecoin is still flagged. Applies to every agent's Portfolio view. `[fix, improvement]`- **Status page no longer reports a phantom outage — and graduation tracking runs clean** — The public status page had been showing the x402 paid-API discovery feed and the 3D viewer as down for days while both were actually healthy: the uptime monitor was probing two URLs that never existed. The probes now hit the real public paths, and the falsely-recorded downtime history is purged so the 90-day uptime bars reflect the services, not the monitor bug. The pump.fun graduation tracker was also timing out on every heartbeat tick because it listened longer than the heartbeat allows — it now fits its budget and reports a clean run. (`/status`) `[fix, infra]`- **The agent economy now watches itself and pages the team** — After weeks of the agent-to-agent economy silently stalling and being diagnosed hours late, the platform now monitors it as a system: every 5 minutes it checks that the per-minute heartbeat is alive, that no engine is failing or stuck on a fixable problem (missing config, an unfundable payment, a full database), and that real on-chain agent activity is still flowing. Any of those pages the ops channel immediately, keeps re-paging hourly until fixed, and announces recovery. The status page's JSON feed also keeps 24 hours of health history so anyone can see exactly when a stall began. `[improvement, infra]`- **The sniper engine now pages us when it goes down — and restarts itself** — The on-chain sniper worker went quiet on July 3 and nothing noticed: the status page showed the engine offline and zero launches scored, but no alert fired. The platform's watchdog now checks the sniper's own heartbeat every 5 minutes and pages the ops channel within 10 minutes of a stall, with hourly re-pages until it recovers. The worker also gained a dead-man switch: if it loses its database for 15 minutes straight it restarts itself instead of running as a zombie that scores nothing. (`/status`) `[fix, infra]`+- **Wallet chips on avatar and agent cards no longer overflow their card** — On the Avatars and Agents dashboards, the wallet identity chip — address, ownership, live balance, rarity and the vanity shortcut — was crammed onto a single line and spilled past the edge of narrow cards, bleeding into the card beside it. It now fills the card footer as a tidy rounded block and wraps its badges onto a second line when space is tight, so every card stays clean at any width. The Community and Characters galleries get the same fix. (`/dashboard/avatars`) `[fix]`## 2026-07-04diff --git a/api/_lib/cache.js b/api/_lib/cache.jsindex 908a20022..d9716f609 100644--- a/api/_lib/cache.js+++ b/api/_lib/cache.js@@ -8,14 +8,26 @@// Falls back to in-memory transparently when UPSTASH_REDIS_REST_URL is unset,// so dev + tests need no extra config.//+// Values above COMPRESS_MIN_BYTES are gzip-compressed before the wire (see+// encodeForWire): the large best-effort bodies — the galaxy money-feed, trending+// snapshots — are highly compressible JSON, and shipping 5-10x fewer bytes over+// Upstash REST is what keeps a far-region SET inside its command deadline instead+// of aborting on timeout. Reads transparently decompress; legacy plaintext values+// still parse, so the format change needs no migration.+//// Env:// UPSTASH_REDIS_REST_URL — https://<region>.upstash.io// UPSTASH_REDIS_REST_TOKEN — REST API token (read+write)// (resolved through _lib/env.js, which also accepts the Vercel-marketplace// names three_KV_REST_API_URL/TOKEN and KV_REST_API_URL/TOKEN)+import { gzip, gunzip } from 'node:zlib';+import { promisify } from 'node:util';import { env } from './env.js';+const gzipAsync = promisify(gzip);+const gunzipAsync = promisify(gunzip);+const memCache = new Map();const MEM_DEFAULT_TTL_MS = 60_000;@@ -233,6 +245,31 @@ function warnThrottled(category, message) {warnState.set(category, { lastAt: now, suppressed: 0 });}+// Wire codec. Small values go as raw JSON (framing + gzip CPU aren't worth it+// under ~1KB); larger ones are gzipped and base64-wrapped behind a NUL-led+// sentinel. JSON text may begin only with {,[,",digit,-,t,f,n or the four legal+// whitespace bytes (space, tab, LF, CR) -- never NUL -- and our stored plaintext+// is JSON.stringify output with no leading whitespace, so the sentinel is+// unambiguous and legacy plaintext values keep parsing untouched. base64(gzip(+// json)) still lands far under the raw size for the compressible bodies we+// cache; the only-if-smaller guard keeps incompressible/tiny payloads on raw.+const GZIP_PREFIX = '\u0000gz:';+const COMPRESS_MIN_BYTES = 1024;++async function encodeForWire(payload) {+ if (payload.length < COMPRESS_MIN_BYTES) return payload;+ const encoded = GZIP_PREFIX + (await gzipAsync(payload)).toString('base64');+ return encoded.length < payload.length ? encoded : payload;+}++async function decodeFromWire(raw) {+ if (typeof raw === 'string' && raw.startsWith(GZIP_PREFIX)) {+ const buf = Buffer.from(raw.slice(GZIP_PREFIX.length), 'base64');+ return JSON.parse((await gunzipAsync(buf)).toString('utf8'));+ }+ return JSON.parse(raw);+}+async function redisCmd(args) {const target = cacheTarget();if (!target) throw new Error('cache redis not configured');@@ -267,7 +304,7 @@ function redisGetThrough(key) {const p = (async () => {try {const raw = await redisCmd(['GET', key]);- const value = raw == null ? null : JSON.parse(raw);+ const value = raw == null ? null : await decodeFromWire(raw);memoPut(key, value);return value;} catch (err) {@@ -313,20 +350,25 @@ export async function cacheSet(key, value, ttlSeconds = 60) {}try {const payload = JSON.stringify(value);+ // Compress before measuring: the size gate below must reflect the bytes+ // that actually go over the wire, not the raw JSON. A body that gzips well+ // (the money-feed, trending snapshots) now lands in Redis where the raw+ // length would have wrongly shunted it to memory-only.+ const body = await encodeForWire(payload);// An oversized value over Upstash REST is a guaranteed timeout from a// non-co-located region: it can never finish inside the command deadline,// so it would burn the failure streak and flap the suppression gate all// day without ever landing. Keep it memory-only and leave the streak to- // reflect the store's real health.- if (payload.length > env.CACHE_REDIS_MAX_VALUE_BYTES) {+ // reflect the store's real health. Gated on the compressed wire size.+ if (body.length > env.CACHE_REDIS_MAX_VALUE_BYTES) {// Memo the value too: with Redis healthy a GET is a clean miss (null),// not an error, so it would never consult the memory fallback — the memo// is what keeps near-term reads coherent with this write.memoPut(key, value);- warnThrottled('set-size', `[cache] value for "${key}" exceeds ${env.CACHE_REDIS_MAX_VALUE_BYTES} bytes — memory-only (raise CACHE_REDIS_MAX_VALUE_BYTES to override)`);+ warnThrottled('set-size', `[cache] value for "${key}" exceeds ${env.CACHE_REDIS_MAX_VALUE_BYTES} bytes compressed — memory-only (raise CACHE_REDIS_MAX_VALUE_BYTES to override)`);return memSet(key, value, ttlSeconds);}- await redisCmd(['SET', key, payload, 'EX', String(ttlSeconds)]);+ await redisCmd(['SET', key, body, 'EX', String(ttlSeconds)]);if (setSuppressedUntil !== 0) warnThrottled('set-gate', '[cache] redis SET recovered — resuming cache writes');setFailures = 0;setSuppressedUntil = 0;diff --git a/api/_lib/portfolio.js b/api/_lib/portfolio.jsindex 3fde8cea8..660941aad 100644--- a/api/_lib/portfolio.js+++ b/api/_lib/portfolio.js@@ -174,17 +174,39 @@ export function computeRisk(holdings, netWorthUsd, metrics, closedPnlPcts) {// At-risk exposure: share of net worth in volatile memecoins (not SOL, not a// stablecoin). This is the honest "tape beta" proxy — the slice that moves// with the broad pump.fun tape, vs SOL/USDC that don't.- const volatileUsd = valued- .filter((h) => !h.isNative && !h.stable)- .reduce((s, h) => s + h.usd, 0);+ const riskAssets = valued.filter((h) => !h.isNative && !h.stable);+ const volatileUsd = riskAssets.reduce((s, h) => s + h.usd, 0);const exposurePct = netWorthUsd > 0 ? (volatileUsd / netWorthUsd) * 100 : 0;const tapeBeta = netWorthUsd > 0 ? volatileUsd / netWorthUsd : 0;+ // Reserve ("dry powder"): SOL + stablecoins — the slice that carries no tape+ // risk and is ready to deploy. A wallet that is all reserve (the common fresh+ // state) has NO concentration risk; concentration is a property of the volatile+ // sleeve, not of holding the base asset.+ const reserveUsd = totalValued - volatileUsd;+ const reservePct = netWorthUsd > 0 ? (reserveUsd / netWorthUsd) * 100 : 0;++ // Concentration of the *risk* sleeve: the single largest volatile position as a+ // share of net worth. This is what "one position could rug me" actually means.+ let topRisk = null;+ let topRiskShare = 0;+ for (const h of riskAssets) {+ const w = totalValued > 0 ? h.usd / totalValued : 0;+ if (w > topRiskShare) { topRiskShare = w; topRisk = h; }+ }+ const topIsReserve = !!topHolding && (topHolding.isNative || topHolding.stable);+return {net_worth_usd: round(netWorthUsd, 2),concentration_hhi: round(hhi, 4),top_position_pct: round(topShare * 100, 2),top_position_mint: topHolding?.mint || (topHolding?.isNative ? 'SOL' : null),+ top_position_is_reserve: topIsReserve,+ top_risk_position_pct: round(topRiskShare * 100, 2),+ top_risk_position_mint: topRisk?.mint || null,+ reserve_usd: round(reserveUsd, 2),+ reserve_pct: round(reservePct, 2),+ risk_assets_count: riskAssets.length,volatile_exposure_usd: round(volatileUsd, 2),exposure_pct: round(exposurePct, 2),tape_beta: round(tapeBeta, 3),@@ -203,7 +225,11 @@ export function computeRisk(holdings, netWorthUsd, metrics, closedPnlPcts) {*/export function riskFlags(risk, topHoldingPriceable) {const flags = [];- const top = risk.top_position_pct;+ // Concentration is a property of the *risk* sleeve, not of holding the base+ // asset. A wallet that is all SOL/stable is dry powder, not a concentrated bet —+ // so key the flag off the largest volatile position when we know it, and never+ // alarm when the dominant holding is reserve (SOL / stablecoin).+ const top = risk.top_risk_position_pct != null ? risk.top_risk_position_pct : risk.top_position_pct;if (top != null && top >= 60) {const liq = topHoldingPriceable === false ? ' illiquid' : '';flags.push({@@ -229,6 +255,14 @@ export function riskFlags(risk, topHoldingPriceable) {text: `${risk.unpriceable_count} holding${risk.unpriceable_count === 1 ? '' : 's'} could not be priced — shown as unvalued, never guessed.`,});}+ // Reserve-heavy wallets (the common fresh / between-trades state) carry no tape+ // risk. Say so positively instead of leaving a scary silence or a false alarm.+ if (!flags.length && risk.reserve_pct != null && risk.reserve_pct >= 90) {+ flags.push({+ level: 'info',+ text: `${risk.reserve_pct}% of net worth is held in SOL / stable reserve — dry powder ready to deploy, minimal market risk.`,+ });+ }if (!flags.length && risk.net_worth_usd != null) {flags.push({ level: 'info', text: 'No elevated concentration, exposure, or drawdown risk detected.' });}@@ -494,7 +528,10 @@ export async function getPortfolio({ agentId, network = 'mainnet', now = Date.no});const risk = computeRisk(holdingsOut, netWorthUsd, metrics, closedPnlPcts);- const top = holdingsOut.find((h) => (h.mint || (h.isNative ? 'SOL' : null)) === risk.top_position_mint);+ // The concentration flag now keys off the largest volatile position, so its+ // illiquid detail should track that holding when one drives the flag.+ const flagMint = risk.top_risk_position_mint || risk.top_position_mint;+ const top = holdingsOut.find((h) => (h.mint || (h.isNative ? 'SOL' : null)) === flagMint);const flags = riskFlags(risk, top ? top.priceable : null);return {diff --git a/data/changelog.json b/data/changelog.jsonindex f5d833f8c..2de3546d9 100644--- a/data/changelog.json+++ b/data/changelog.json@@ -1,6 +1,41 @@{"$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-05",+ "title": "Faster, steadier pages under load — cache now compresses what it stores",+ "summary": "Behind the scenes, three.ws caches heavy data (live money flows, trending snapshots, leaderboards) in a shared store so pages stay fast without re-crunching everything on every visit. When that store sits far from our servers, the largest of those writes were timing out and quietly falling back to a per-server memory copy that vanishes on restart — so under traffic, pages kept hitting the origin and slowed down. Those payloads are now gzip-compressed before they're stored, shrinking them 5–10×, which lets them land in the shared cache instead of timing out. The result is fewer cache misses, less origin load, and steadier response times on data-heavy pages during busy periods. No action needed — it just works.",+ "tags": [+ "fix",+ "infra"+ ]+ },+ {+ "date": "2026-07-05",+ "title": "Portfolio risk panel stops crying wolf on fresh wallets",+ "summary": "Every agent wallet holds SOL as its base currency, but the Portfolio tab used to flag a brand-new wallet holding only SOL as \"100% concentration risk\" in alarming red — a false alarm, since holding the base asset isn't a bet on anything. Concentration is now measured only across volatile memecoin positions, so a wallet parked in SOL or stablecoins reads correctly: a new Reserve tile shows your dry powder, and the panel tells you it's ready to deploy with minimal market risk instead of warning you about a risk that isn't there. A genuine over-concentration in one memecoin is still flagged. Applies to every agent's Portfolio view.",+ "tags": [+ "fix",+ "improvement"+ ]+ },+ {+ "date": "2026-07-05",+ "title": "Wallet chips on avatar and agent cards no longer overflow their card",+ "summary": "On the Avatars and Agents dashboards, the wallet identity chip — address, ownership, live balance, rarity and the vanity shortcut — was crammed onto a single line and spilled past the edge of narrow cards, bleeding into the card beside it. It now fills the card footer as a tidy rounded block and wraps its badges onto a second line when space is tight, so every card stays clean at any width. The Community and Characters galleries get the same fix.",+ "tags": [+ "fix"+ ],+ "link": "/dashboard/avatars"+ },+ {+ "date": "2026-07-05",+ "title": "Go Live: a real path to activate your agent even when the welcome grant is paused",+ "summary": "When the one-tap welcome grant is temporarily paused, the Go Live tab used to show a bare dead-end card. It's now a proper self-fund path: it explains that depositing your own SOL does the exact same thing — funds your agent and lands it on the live Money Pulse — shows how much is enough to go live, and reassures you the deposit stays yours and is withdrawable anytime. The grant reopens on its own when the treasury is back online.",+ "tags": [+ "improvement"+ ]+ },{"date": "2026-07-05","title": "Agent creation now tells you what to do when your avatar library is full",diff --git a/docs/ops/production-log-triage.md b/docs/ops/production-log-triage.mdindex 47195feeb..ccbd0df0c 100644--- a/docs/ops/production-log-triage.md+++ b/docs/ops/production-log-triage.md@@ -2,7 +2,9 @@Every recurring `error`/`warning` signature that shows up in a Vercel logexport, mapped to its **root cause**, the **exact resolution**, and **who** can-apply it. Built from the `three-ws-character-studio` export on 2026-07-03.+apply it. Built from the `three-ws-character-studio` export on 2026-07-03 and+re-confirmed against the `three.ws` export on 2026-07-05 (same population plus the+two storage-pressure signatures added below — still no code defects).The headline finding, so nobody re-derives it: **none of these are codedefects.** Each line is the platform's own graceful-degradation or fail-closed@@ -110,6 +112,26 @@ guard env violated:---+## 🟡 `[cron] <name> skipped — db at storage cap (<size>MB ≥ <high-water>MB); retention will reclaim space`++```+[cron] launcher-tick skipped — db at storage cap (593MB ≥ 470MB); retention will reclaim space+```++- **Source:** [api/_lib/http.js](../../api/_lib/http.js) `wrapCron({ requireWriteCapacity: true })`, via `isStoragePressured()` in [api/_lib/db.js](../../api/_lib/db.js). Emitted by the write-heavy crons that opt into the preflight: `launcher-tick`, `coin-intel-observe`, `smart-money-rollup`, `recompute-reputation`, `intel-learn`.+- **What it means:** the Neon branch is over its high-water mark (`DB_RETENTION_HIGH_WATER_MB`, default 470). Rather than run a full write-tick that would fail per-row with SQLSTATE 53100 and flood the logs, each write-heavy cron **preflight-skips** with a single warn and a healthy heartbeat (uptime reads it as up, not stalled). [api/cron/db-retention.js](../../api/cron/db-retention.js) runs every 15 min, tightens its retention window to the floor under pressure, DELETEs + VACUUMs, and the next tick resumes once size drops back under the mark. In the 2026-07-05 export db-retention was scheduled and returning `200` (~3.5 s/run) the whole window — the valve is working; the branch is simply sitting above the mark because the live data footprint exceeds it and Neon's storage GC is not instant.+- **Resolve (owner, capacity):** the write crons stay skipped only while `pg_database_size > high-water`. Pick one: (a) raise the **Neon compute/storage plan** so the branch has headroom above the real footprint; (b) if the branch's actual cap is higher than 470 MB, raise `DB_RETENTION_HIGH_WATER_MB` to match the plan so the write crons stop skipping needlessly; (c) tighten `PUMP_INTEL_RETENTION_DAYS` / `PUMP_INTEL_MIN_RETENTION_DAYS` to shed the firehose faster. None is a code change — the gate and the valve are already correct and covered by [tests/cron-storage-backoff.test.js](../../tests/cron-storage-backoff.test.js).++---++## 🟢 `{"stage":"index-delegations","warning":"time-budget-exceeded","elapsedMs":…,"stoppedAtBlock":…}`++- **Source:** [api/cron/\[name\].js](../../api/cron/[name].js), the delegations indexer (`IDX_TIME_BUDGET_MS`, 22 s — 8 s of headroom under Vercel's 30 s limit).+- **What it means:** the indexer hit its per-invocation time budget mid-backfill, so it **saved the cursor at `stoppedAtBlock` and returned** rather than risk a 504. The next tick resumes exactly where it stopped. This is a checkpoint, not a failure — logged as `warning` by design. A run of these back-to-back just means the indexer is draining a block backlog (cold cursor starts a day back); it stops once the cursor catches the confirmed head.+- **Resolve:** 🟢 nothing required — it self-heals as the backlog drains. If it never stops over many hours, the RPC pool is too slow to keep pace; add a faster `IDX_RPC_URLS` endpoint or shrink the per-chain block cap so each tick makes more progress.++---+## 🟢 `[cache] redis SET failed / degraded / circuit opened … memory fallback`- **Source:** [api/_lib/cache.js](../../api/_lib/cache.js).@@ -159,19 +181,65 @@ guard env violated:----## The 5-minute owner checklist--Everything red/yellow above, condensed to the actions only the owner can take:+## The owner runbook — every fix as an exact command-1. **Ring:** set `X402_AUTONOMOUS_ENABLED=false` to pause quietly, **or** finish- the guard env (see [docs/x402-ring-economy.md](../x402-ring-economy.md)) to go live.-2. **World:** set `ADMIN_CODE` on the world service + re-run `apply-hardening.sh`.-3. **Replicate:** add billing credit (restores the paid forge lanes).-4. **Neon:** add compute/pooler headroom so audit writes stop timing out.-5. **Upstash / Helius (optional):** same-region cache store; higher Helius quota.--Nothing on this list is a code change. The code paths behind every line are-already hardened and covered by tests+Everything red/yellow above, condensed to the actions only the owner can take,+each reduced to a copy-paste command. Nothing here is a code change — the code+paths behind every line are already hardened and covered by tests([tests/x402-ring-invariants.test.js](../../tests/x402-ring-invariants.test.js),[tests/cache-circuit-breaker.test.js](../../tests/cache-circuit-breaker.test.js),-[tests/cache-store-routing.test.js](../../tests/cache-store-routing.test.js)).+[tests/cache-store-routing.test.js](../../tests/cache-store-routing.test.js),+[tests/cron-storage-backoff.test.js](../../tests/cron-storage-backoff.test.js)).+Run the Vercel env writes from the repo root against the linked project, then+redeploy so they take effect.++### 1. 🔴 World — stop every visitor having build rights (do this first)++The fail-closed patch ([deploy/world/patches/0003-fail-closed-without-admin-code.patch](../../deploy/world/patches/0003-fail-closed-without-admin-code.patch))+is already in the repo; it just isn't live on the running revision. One script+generates the secret, rebuilds, redeploys, and polls `/status` until it reports+`protected:true` (needs Cloud Run / Secret Manager / Cloud Build on project+`aerial-vehicle-466722-p5`):++```bash+bash deploy/world/apply-hardening.sh # prints the admin code once — store it in a password manager+```++### 2. 🔴 x402 ring — pause cleanly, or finish arming++```bash+# Pause quietly (recommended unless you're actively going live) — kills the hourly guard alert:+vercel env add X402_AUTONOMOUS_ENABLED production # value: false+# …or finish arming (moves real USDC) per docs/x402-ring-economy.md guard-env section.+```++### 3. 🟡 Neon — stop the write-crons preflight-skipping at the storage cap++DB sat at 593 MB vs the 470 MB high-water in the 2026-07-05 export, so+`launcher-tick`, `coin-intel-observe`, `smart-money-rollup`, `recompute-reputation`,+and `intel-learn` were skipping. Pick the lever that matches your Neon plan:++```bash+# (a) If your branch's real cap is well above 470 MB, raise the high-water to match:+vercel env add DB_RETENTION_HIGH_WATER_MB production # value: e.g. 900 (must stay under the real Neon cap)+# (b) …or shed the pump.fun firehose faster (keeps the branch smaller):+vercel env add PUMP_INTEL_RETENTION_DAYS production # value: e.g. 7+vercel env add PUMP_INTEL_MIN_RETENTION_DAYS production # value: e.g. 2+# (c) Best durable fix: bump the Neon compute/storage plan in the Neon dashboard.+```++### 4. 🟡 Replicate — restore the paid forge lane (clears the two 502s)++Add credit at `replicate.com/account/billing`. The free NVIDIA NIM + HF lanes+keep serving meanwhile; paid credit brings back the high-fidelity TRELLIS lane.++### 5. 🟡 Upstash / Helius — kill the redis-timeout and 429 warnings (optional)++```bash+# A same-region dedicated cache store ends the 'redis SET failed' flood:+vercel env add UPSTASH_CACHE_REST_URL production+vercel env add UPSTASH_CACHE_REST_TOKEN production+# …or just give a distant store more headroom:+vercel env add CACHE_REDIS_CMD_TIMEOUT_MS production # value: e.g. 5000+# Helius 429s: raise the plan/quota in the Helius dashboard (public-RPC fallback covers the gap).+```diff --git a/pages/pose.html b/pages/pose.htmlindex 25620b89e..842a73f36 100644--- a/pages/pose.html+++ b/pages/pose.html@@ -923,6 +923,48 @@box-shadow: 0 0 0 0 rgba(34, 211, 238, 0);}}+ .al-scrub-row {+ display: flex;+ align-items: center;+ gap: 8px;+ }+ .al-play {+ appearance: none;+ flex: 0 0 auto;+ width: 30px;+ height: 30px;+ display: flex;+ align-items: center;+ justify-content: center;+ border: 1px solid rgba(34, 211, 238, 0.4);+ border-radius: 7px;+ background: rgba(34, 211, 238, 0.1);+ color: var(--text);+ font-size: 12px;+ cursor: pointer;+ transition: background 0.12s ease;+ }+ .al-play:hover {+ background: rgba(34, 211, 238, 0.2);+ }+ .al-play:focus-visible {+ outline: 2px solid #22d3ee;+ outline-offset: 1px;+ }+ .al-scrub {+ flex: 1 1 auto;+ min-width: 40px;+ accent-color: #22d3ee;+ cursor: pointer;+ }+ .al-time {+ flex: 0 0 auto;+ font-family: ui-monospace, monospace;+ font-size: 10.5px;+ color: var(--text-2);+ min-width: 66px;+ text-align: right;+ }.al-speed-row {display: flex;align-items: center;diff --git a/public/changelog.json b/public/changelog.jsonindex cfdca5dc8..d6f6d0689 100644--- a/public/changelog.json+++ b/public/changelog.json@@ -1,5 +1,5 @@{- "generated_at": "2026-07-05T09:11:52.882Z",+ "generated_at": "2026-07-05T10:42:59.507Z","generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json","site": {"name": "three.ws",@@ -50,6 +50,16 @@"improvement"]},+ {+ "date": "2026-07-05",+ "type": "update",+ "title": "Go Live: a real path to activate your agent even when the welcome grant is paused",+ "summary": "When the one-tap welcome grant is temporarily paused, the Go Live tab used to show a bare dead-end card. It's now a proper self-fund path: it explains that depositing your own SOL does the exact same thing — funds your agent and lands it on the live Money Pulse — shows how much is enough to go live, and reassures you the deposit stays yours and is withdrawable anytime. The grant reopens on its own when the treasury is back online.",+ "link": null,+ "tags": [+ "improvement"+ ]+ },{"date": "2026-07-05","type": "update",@@ -71,6 +81,17 @@"improvement"]},+ {+ "date": "2026-07-05",+ "type": "update",+ "title": "Portfolio risk panel stops crying wolf on fresh wallets",+ "summary": "Every agent wallet holds SOL as its base currency, but the Portfolio tab used to flag a brand-new wallet holding only SOL as \"100% concentration risk\" in alarming red — a false alarm, since holding the base asset isn't a bet on anything. Concentration is now measured only across volatile memecoin positions, so a wallet parked in SOL or stablecoins reads correctly: a new Reserve tile shows your dry powder, and the panel tells you it's ready to deploy with minimal market risk instead of warning you about a risk that isn't there. A genuine over-concentration in one memecoin is still flagged. Applies to every agent's Portfolio view.",+ "link": null,+ "tags": [+ "fix",+ "improvement"+ ]+ },{"date": "2026-07-05","type": "update",@@ -104,6 +125,16 @@"infra"]},+ {+ "date": "2026-07-05",+ "type": "update",+ "title": "Wallet chips on avatar and agent cards no longer overflow their card",+ "summary": "On the Avatars and Agents dashboards, the wallet identity chip — address, ownership, live balance, rarity and the vanity shortcut — was crammed onto a single line and spilled past the edge of narrow cards, bleeding into the card beside it. It now fills the card footer as a tidy rounded block and wraps its badges onto a second line when space is tight, so every card stays clean at any width. The Community and Characters galleries get the same fix.",+ "link": "/dashboard/avatars",+ "tags": [+ "fix"+ ]+ },{"date": "2026-07-04","type": "launch",diff --git a/public/changelog.xml b/public/changelog.xmlindex eeb678fae..c7d2822b3 100644--- a/public/changelog.xml+++ b/public/changelog.xml@@ -38,6 +38,14 @@<category>feature</category><description>The animation gallery at three.ws/animations got a ground-up upgrade. All 2,100+ clips now show a real poster image of the avatar mid-motion instead of a blank tile, and hovering any card plays the full animation live in 3D. Clips are organized into 16 browsable categories (dance, combat, weapons, sports, and more) with search, sorting, and loop filters, and every clip has its own shareable link with playback controls — scrub the timeline, change the speed, then send it straight to the Animation Studio or copy an embed snippet for your own site.</description></item>+ <item>+ <title>Go Live: a real path to activate your agent even when the welcome grant is paused</title>+ <link>https://three.ws/changelog</link>+ <guid isPermaLink="false">2026-07-05:Go Live: a real path to activate your agent even when the welcome grant is paused</guid>+ <pubDate>Sun, 05 Jul 2026 12:00:00 GMT</pubDate>+ <category>improvement</category>+ <description>When the one-tap welcome grant is temporarily paused, the Go Live tab used to show a bare dead-end card. It's now a proper self-fund path: it explains that depositing your own SOL does the exact same thing — funds your agent and lands it on the live Money Pulse — shows how much is enough to go live, and reassures you the deposit stays yours and is withdrawable anytime. The grant reopens on its own when the treasury is back online.</description>+ </item><item><title>Go Pro with SOL or $THREE — 20% off in the platform coin</title><link>https://three.ws/pricing</link>@@ -54,6 +62,14 @@<category>fix</category><description>Some Solana wallets modify a payment transaction before signing it — injecting their own fee or guard instructions — and the platform's payment verifier rightly refuses anything that isn't the exact transfer it prepared. Until now that refusal looked like a dead end: the pay button bounced with a payment-required error no matter how many times you retried. The checkout now detects the rewrite the moment the wallet hands the transaction back and says plainly that the wallet altered it and nothing was charged, so you can switch wallets instead of retrying in circles. Verify rejections and settle failures are also now counted by reason on the public health endpoint, so a streak of refused payments is visible at a glance instead of hiding in admin logs.</description></item>+ <item>+ <title>Portfolio risk panel stops crying wolf on fresh wallets</title>+ <link>https://three.ws/changelog</link>+ <guid isPermaLink="false">2026-07-05:Portfolio risk panel stops crying wolf on fresh wallets</guid>+ <pubDate>Sun, 05 Jul 2026 12:00:00 GMT</pubDate>+ <category>fix</category>+ <description>Every agent wallet holds SOL as its base currency, but the Portfolio tab used to flag a brand-new wallet holding only SOL as "100% concentration risk" in alarming red — a false alarm, since holding the base asset isn't a bet on anything. Concentration is now measured only across volatile memecoin positions, so a wallet parked in SOL or stablecoins reads correctly: a new Reserve tile shows your dry powder, and the panel tells you it's ready to deploy with minimal market risk instead of warning you about a risk that isn't there. A genuine over-concentration in one memecoin is still flagged. Applies to every agent's Portfolio view.</description>+ </item><item><title>Status page no longer reports a phantom outage — and graduation tracking runs clean</title><link>https://three.ws/status</link>@@ -78,6 +94,14 @@<category>fix</category><description>The on-chain sniper worker went quiet on July 3 and nothing noticed: the status page showed the engine offline and zero launches scored, but no alert fired. The platform's watchdog now checks the sniper's own heartbeat every 5 minutes and pages the ops channel within 10 minutes of a stall, with hourly re-pages until it recovers. The worker also gained a dead-man switch: if it loses its database for 15 minutes straight it restarts itself instead of running as a zombie that scores nothing.</description></item>+ <item>+ <title>Wallet chips on avatar and agent cards no longer overflow their card</title>+ <link>https://three.ws/dashboard/avatars</link>+ <guid isPermaLink="false">2026-07-05:Wallet chips on avatar and agent cards no longer overflow their card</guid>+ <pubDate>Sun, 05 Jul 2026 12:00:00 GMT</pubDate>+ <category>fix</category>+ <description>On the Avatars and Agents dashboards, the wallet identity chip — address, ownership, live balance, rarity and the vanity shortcut — was crammed onto a single line and spilled past the edge of narrow cards, bleeding into the card beside it. It now fills the card footer as a tidy rounded block and wraps its badges onto a second line when space is tight, so every card stays clean at any width. The Community and Characters galleries get the same fix.</description>+ </item><item><title>Markets — Live Crypto Prices</title><link>https://three.ws/coins</link>diff --git a/public/features.json b/public/features.jsonindex b39754e3c..8f0f6d9e1 100644--- a/public/features.json+++ b/public/features.json@@ -1,5 +1,5 @@{- "generated_at": "2026-07-05T09:11:52.868Z",+ "generated_at": "2026-07-05T10:42:59.495Z","generated_by": "scripts/build-page-index.mjs from data/pages.json","site": {"name": "three.ws",diff --git a/scripts/.check-avatars.mjs b/scripts/.check-avatars.mjsnew file mode 100644index 000000000..27ee70aa2--- /dev/null+++ b/scripts/.check-avatars.mjs@@ -0,0 +1,43 @@+import { chromium } from 'playwright';++const AVATARS = [+ 'cz.glb', 'michelle.glb', 'default.glb', 'realistic-female.glb',+ 'realistic-male.glb', 'xbot.glb', 'studio.glb', 'selfie-girl.glb',+ 'cesium-man.glb', 'dancing-twerk.glb',+];+const CLIP = 'https://pub-2534e921bf9c4314addcd4d8a6e98b7b.r2.dev/animations/library/clips/mx-covered-eyes-idle-c9c6b5f8b96c.json';++const browser = await chromium.launch({ args: ['--no-sandbox', '--enable-unsafe-swiftshader'] });+const page = await browser.newPage();+await page.goto('http://localhost:3000/pose', { waitUntil: 'domcontentloaded' });+// Pull a real curated clip json to retarget (covereyes) from the site.+const clipJson = await page.evaluate(async () => {+ const r = await fetch('/animations/clips/covereyes.json');+ return r.json();+});++for (const a of AVATARS) {+ const out = await page.evaluate(async ({ url, clipJson }) => {+ try {+ const THREE = await import('/node_modules/.vite/deps/three.js');+ } catch {}+ const [{ GLTFLoader }, retarget, { getMeshoptDecoder }] = await Promise.all([+ import('/node_modules/three/examples/jsm/loaders/GLTFLoader.js').catch(() =>+ import('three/addons/loaders/GLTFLoader.js')),+ import('/src/animation-retarget.js'),+ import('/src/viewer/internal.js'),+ ]);+ const loader = new GLTFLoader();+ loader.setMeshoptDecoder(await getMeshoptDecoder());+ let gltf;+ try { gltf = await loader.loadAsync(url); } catch (e) { return { err: 'load:' + e.message }; }+ const scene = gltf.scene;+ scene.updateMatrixWorld(true);+ const map = retarget.canonicalNodeMapFromObject(scene);+ const clip = retarget.parseClipJSON(clipJson, 'covereyes');+ const { clip: bound, coverage } = retarget.retargetClipToObject(clip, scene, { minCoverage: 0 });+ return { bones: map.size, coverage: Math.round((coverage || 0) * 100), ok: !!bound };+ }, { url: `/avatars/${a}`, clipJson });+ console.log(a.padEnd(24), JSON.stringify(out));+}+await browser.close();diff --git a/scripts/mixamo-all.mjs b/scripts/mixamo-all.mjsindex ee223115f..d0f96df90 100644--- a/scripts/mixamo-all.mjs+++ b/scripts/mixamo-all.mjs@@ -308,6 +308,26 @@ function flattenGmsHash(g) {return { ...g, params };}+// A single clip inside a MotionPack export. Mirrors what mixamo.com's bundle+// builds (getSlidersForGmsHash → gmsifySequence): the full clip object with+// `name`, hardcoded `trim`/`overdrive`/`inplace`, and `params` flattened to a+// comma-joined value string. Sending the bare motion gms_hash instead yields a+// server-side "Error while generating the animation".+function packClipHash(motion) {+ const g = motion.gms_hash ?? motion.details?.gms_hash;+ if (!g) return null;+ return {+ name: motion.name,+ 'model-id': g['model-id'],+ mirror: false,+ trim: [0, 100],+ overdrive: 0,+ params: Array.isArray(g.params) ? g.params.map((p) => p[1]).join(',') : (g.params ?? '0'),+ 'arm-space': 0,+ inplace: false,+ };+}+// The status endpoint Mixamo's own UI polls is the per-character monitor.// Some deployments also expose a per-product export status — fall back to it// once if the monitor 404s.@@ -453,10 +473,13 @@ async function downloadAll(catalog, token) {throw new Error(`detail HTTP ${code}`);}const detail = await detailRes.json();+ // Motions and MotionPacks need different export shapes (mirrors what+ // mixamo.com's own bundle sends — see gmsifySequence + the Motion vs+ // MotionPack preference sets). Packs: full per-clip objects with the+ // pose in `mesh_motionpack`, no `skin`. Motions: the single flattened+ // gms_hash with `skin`.const gmsHashes = isPack- ? (detail?.details?.motions ?? [])- .map((m) => flattenGmsHash(m.gms_hash ?? m.details?.gms_hash))- .filter(Boolean)+ ? (detail?.details?.motions ?? []).map((m) => packClipHash(m)).filter(Boolean): [flattenGmsHash(detail?.details?.gms_hash)].filter(Boolean);if (!gmsHashes.length) {progress[anim.id] = { status: 'perm_fail', reason: 'no_gms_hash' };@@ -464,6 +487,10 @@ async function downloadAll(catalog, token) {throw new Error('no gms_hash');}+ const preferences = isPack+ ? { format: 'fbx7_2019', mesh_motionpack: 't-pose', fps: '30', reducekf: '0' }+ : { format: 'fbx7', skin: 'false', fps: '30', reducekf: '0' };+// Request exportconst exportRes = await rlFetch(`${MIXAMO_API}/animations/export`, {method: 'POST',@@ -474,7 +501,7 @@ async function downloadAll(catalog, token) {product_name: anim.name,type: anim.type || 'Motion',gms_hash: gmsHashes,- preferences: { format: 'fbx7', skin: 'false', fps: '30', reducekf: '0' },+ preferences,}),});if (!exportRes.ok) {diff --git a/src/agent-wallet-hub/tabs/activate.js b/src/agent-wallet-hub/tabs/activate.jsindex 5e0261735..646942c5e 100644--- a/src/agent-wallet-hub/tabs/activate.js+++ b/src/agent-wallet-hub/tabs/activate.js@@ -191,28 +191,55 @@ registerWalletTab({</div>`;}- function unavailableView() {- // reason: not_configured (treasury off) | platform_agent | not_owner- let title = 'Activation is paused';- let lede = 'The activation grant is temporarily unavailable. You can still fund this agent yourself from the Deposit tab — that also brings it to life on the Pulse.';- if (status?.reason === 'platform_agent') {- title = 'Already live';- lede = 'This is a platform-operated agent — it is already active on the Money Pulse. Activation is for agents you create.';- }+ // Platform-operated (circulation) agent — already live, activation N/A.+ function platformAgentView() {+ return `+ <div class="awh-go">+ <div class="awh-go-hero">+ <span class="awh-go-live-badge">Live</span>+ <h2 class="awh-go-title">${escapeHtml(agentName)} is already live</h2>+ <p class="awh-go-lede">This is a platform-operated agent — it's already active on the Money Pulse. The welcome grant is only for agents you create yourself.</p>+ <div class="awh-go-next">+ <a class="awh-btn awh-btn--primary" href="/pulse">See it on the Money Pulse ↗</a>+ <button class="awh-btn" type="button" data-act="tab-pulse">Its wallet story</button>+ </div>+ </div>+ </div>`;+ }++ // Grant paused (treasury off) OR status couldn't be read. Not a dead end:+ // self-funding from Deposit reaches the identical outcome — funded wallet,+ // live on the Pulse — so we sell that path, not just offer it.+ function pausedView() {+ const grant = status?.grant_sol != null ? formatSol(status.grant_sol) : null;+ const net = status?.network || 'mainnet';return `<div class="awh-go"><div class="awh-go-hero"><p class="awh-go-kicker">Go Live</p>- <h2 class="awh-go-title">${escapeHtml(title)}</h2>- <p class="awh-go-lede">${escapeHtml(lede)}</p>+ <h2 class="awh-go-title">Fund ${escapeHtml(agentName)} to go live</h2>+ <p class="awh-go-lede">The one-tap welcome grant is paused right now — but you don't have to wait for it. Depositing your own SOL does the exact same thing: it funds ${escapeHtml(agentName)} and lands it on the live Money Pulse the moment the balance clears.</p>+ ${grant ? `<div class="awh-go-grant"><b>◎${escapeHtml(grant)}+</b><span>enough to go live</span></div>` : ''}+ <ul class="awh-go-list">+ <li><span class="awh-go-tick" aria-hidden="true">✓</span><span><strong>Funds the wallet</strong> — your SOL lands in ${escapeHtml(agentName)}'s custodial wallet so it can make its first move.</span></li>+ <li><span class="awh-go-tick" aria-hidden="true">✓</span><span><strong>Goes live on the Money Pulse</strong> — a funded wallet counts as active the moment its first transaction settles.</span></li>+ <li><span class="awh-go-tick" aria-hidden="true">✓</span><span><strong>Still yours</strong> — it's your deposit, not a grant. Pull it back anytime from the Withdraw tab.</span></li>+ </ul><div class="awh-go-next"><button class="awh-btn awh-btn--primary" type="button" data-act="tab-deposit">Fund from Deposit</button><a class="awh-btn" href="/pulse">Open the Money Pulse ↗</a></div>+ <p class="awh-go-hint">Runs on Solana ${escapeHtml(net)}. The welcome grant reopens automatically when the treasury is back online — nothing you need to do.</p></div></div>`;}+ function unavailableView() {+ // reason: not_configured (treasury off) | platform_agent | not_owner+ if (status?.reason === 'platform_agent') return platformAgentView();+ return pausedView();+ }+function render() {if (destroyed) return;if (!loaded) { panel.innerHTML = skeleton(); return; }diff --git a/src/agent-wallet-hub/tabs/portfolio.js b/src/agent-wallet-hub/tabs/portfolio.jsindex 33b0c8e02..3fee45a2d 100644--- a/src/agent-wallet-hub/tabs/portfolio.js+++ b/src/agent-wallet-hub/tabs/portfolio.js@@ -6,8 +6,9 @@* - a holdings table (live value, FIFO cost basis, unrealized P&L, liquidity* warning) with a one-click jump to trade/exit,* - a PnL attribution breakdown (what's making / losing money, by source),- * - a risk panel (concentration, exposure, drawdown, realized vol) with- * plain-language flags.+ * - a risk panel (reserve / dry powder, concentration of the volatile sleeve,+ * tape exposure, drawdown, realized vol) with plain-language flags. Holding+ * SOL/stables is treated as reserve, never as "concentration risk".** Every figure is real, from GET /api/agents/:id/portfolio (api/_lib/portfolio.js):* live on-chain valuation + the sniper position ledger + the custody/spend ledger.@@ -317,15 +318,22 @@ registerWalletTab({function renderRisk(d) {const r = d.risk || {};+ // Concentration is the largest *volatile* position — holding SOL/stables+ // is reserve, not a risk bet. "None" when nothing is at tape risk.+ const hasRisk = (r.risk_assets_count ?? 0) > 0;+ const conc = !hasRisk ? 'None' : (r.top_risk_position_pct != null ? `${r.top_risk_position_pct}%` : '—');const cells = [- ['Concentration', r.top_position_pct != null ? `${r.top_position_pct}%` : '—', 'Largest position share'],- ['Diversification', r.concentration_hhi != null ? hhiLabel(r.concentration_hhi) : '—', 'HHI of weights'],- ['Tape exposure', r.exposure_pct != null ? `${r.exposure_pct}%` : '—', 'In volatile memecoins'],- ['Max drawdown', r.max_drawdown_pct != null ? `${r.max_drawdown_pct}%` : '—', 'Realized, from peak'],- ['Realized vol', r.realized_volatility_pct != null ? `${r.realized_volatility_pct}%` : '—', 'Per-trade return σ'],+ ['Reserve', r.reserve_pct != null ? `${r.reserve_pct}%` : '—', 'SOL + stables — dry powder ready to deploy, no tape risk'],+ ['Concentration', conc, 'Largest single memecoin position, as a share of net worth'],+ ['Tape exposure', r.exposure_pct != null ? `${r.exposure_pct}%` : '—', 'Share of net worth in volatile memecoins'],+ ['Max drawdown', r.max_drawdown_pct != null ? `${r.max_drawdown_pct}%` : '—', 'Largest realized drop from a net-worth peak'],+ ['Realized vol', r.realized_volatility_pct != null ? `${r.realized_volatility_pct}%` : '—', 'Standard deviation of per-trade returns'],];- const grid = cells.map(([k, v]) =>- `<div class="awh-risk-cell"><div class="awh-risk-k">${escapeHtml(k)}</div><div class="awh-risk-v">${escapeHtml(v)}</div></div>`).join('');+ const grid = cells.map(([k, v, help]) =>+ `<div class="awh-risk-cell" title="${escapeHtml(help)}">+ <div class="awh-risk-k">${escapeHtml(k)}</div>+ <div class="awh-risk-v">${escapeHtml(v)}</div>+ </div>`).join('');const flags = (d.risk_flags || []).map((f) =>`<li class="awh-flag is-${escapeHtml(f.level)}">${escapeHtml(f.text)}</li>`).join('');return `<div class="awh-card">@@ -452,10 +460,3 @@ function formatNum(n) {if (n >= 1) return n.toLocaleString('en-US', { maximumFractionDigits: 4 });return Number(n.toPrecision(4)).toString();}--function hhiLabel(hhi) {- // HHI 0..1 → plain reading: <0.15 diversified, 0.15-0.4 moderate, >0.4 concentrated.- if (hhi < 0.15) return 'Broad';- if (hhi < 0.4) return 'Moderate';- return 'Concentrated';-}diff --git a/src/animation-library.js b/src/animation-library.jsindex 2275d2e7a..28be838d3 100644--- a/src/animation-library.js+++ b/src/animation-library.js@@ -84,6 +84,8 @@ export class AnimationLibrary {this._activeDef = null;this._speed = 1;this._previewing = false;+ this._paused = false;+ this._scrubbing = false;this._state = 'loading';// Resolves once mount() has finished loading the manifest (success or@@ -177,6 +179,47 @@ export class AnimationLibrary {/** Tick the preview mixer. Host calls this from its render loop while previewing. */update(dt) {this._mixer?.update(dt);+ if (!this._scrubbing) this._syncProgress();+ }++ /** Push the active action's clock into the transport scrubber + time label. */+ _syncProgress() {+ const { transportScrub, transportTime } = this._refs;+ if (!transportScrub || !this._action) return;+ const clip = this._action.getClip?.();+ const dur = clip?.duration || 0;+ if (dur <= 0) return;+ // action.time wraps within [0, duration) for a looping action and clamps+ // for a one-shot, so it reads as clip-local position either way.+ const t = Math.max(0, Math.min(dur, this._action.time));+ transportScrub.value = String(Math.round((t / dur) * 1000));+ if (transportTime) transportTime.textContent = `${t.toFixed(1)} / ${dur.toFixed(1)}s`;+ }++ /** Seek the active clip to a 0..1 fraction and reflect it immediately. */+ _seek(frac) {+ if (!this._action) return;+ const dur = this._action.getClip?.().duration || 0;+ this._action.paused = false;+ this._action.time = Math.max(0, Math.min(0.999, frac)) * dur;+ this._mixer?.update(0);+ if (this._paused) this._action.paused = true;+ }++ /** Toggle play/pause on the live preview. */+ _togglePlay() {+ if (!this._action) return;+ this._paused = !this._paused;+ this._action.paused = this._paused;+ this._updatePlayIcon();+ }++ _updatePlayIcon() {+ const btn = this._refs.transportPlay;+ if (!btn) return;+ btn.textContent = this._paused ? '▶' : '⏸';+ btn.setAttribute('aria-label', this._paused ? 'Play' : 'Pause');+ btn.title = this._paused ? 'Play' : 'Pause';}isPreviewing() {@@ -504,6 +547,9 @@ export class AnimationLibrary {action.clampWhenFinished = def.loop === false;action.timeScale = this._speed;action.reset().play();+ this._paused = false;+ this._scrubbing = false;+ this._updatePlayIcon();this._action = action;this._activeName = def.name;@@ -677,6 +723,32 @@ export class AnimationLibrary {]);stop.addEventListener('click', () => this.stopPreview());+ // Play/pause + scrubbable progress — the clip's own timeline, so users can+ // scrub to any frame, pause on a pose, and see how long the motion runs.+ const play = el('button', { class: 'al-play', type: 'button', title: 'Pause', 'aria-label': 'Pause' }, ['⏸']);+ play.addEventListener('click', () => this._togglePlay());+ const scrub = el('input', {+ type: 'range',+ min: '0',+ max: '1000',+ step: '1',+ value: '0',+ class: 'al-scrub',+ 'aria-label': 'Scrub animation timeline',+ });+ const onScrub = () => {+ this._scrubbing = true;+ this._seek(parseInt(scrub.value, 10) / 1000);+ };+ scrub.addEventListener('input', onScrub);+ scrub.addEventListener('change', () => {+ this._scrubbing = false;+ });+ scrub.addEventListener('pointerup', () => {+ this._scrubbing = false;+ });+ const timeLabel = el('span', { class: 'al-time' }, ['0.0 / 0.0s']);+const exportBtn = el('button',{@@ -690,6 +762,7 @@ export class AnimationLibrary {const root = el('div', { class: 'al-transport', style: 'display:none' }, [el('div', { class: 'al-now' }, [el('span', { class: 'al-now-dot' }), label]),+ el('div', { class: 'al-scrub-row' }, [play, scrub, timeLabel]),el('div', { class: 'al-speed-row' }, [el('label', {}, ['Speed']), speed, speedVal]),el('div', { class: 'al-transport-actions' }, [stop, exportBtn]),]);@@ -699,6 +772,9 @@ export class AnimationLibrary {transportLabel: label,transportSpeedVal: speedVal,transportSpeed: speed,+ transportPlay: play,+ transportScrub: scrub,+ transportTime: timeLabel,exportBtn,};return { root };diff --git a/src/characters.js b/src/characters.jsindex 0948c047a..6ff201b4e 100644--- a/src/characters.js+++ b/src/characters.js@@ -100,7 +100,7 @@ function cardHtml(ch) {${ch.description ? `<p class="chs-card-desc">${escHtml(ch.description)}</p>` : ''}${statsHtml}${tokenHtml}- ${ch.solana_address ? `<div class="chs-card-wallet" style="margin-top:8px">${walletChipHTML(ch, { link: false, showPending: false })}</div>` : ''}+ ${ch.solana_address ? `<div class="chs-card-wallet" style="margin-top:8px">${walletChipHTML(ch, { link: false, showPending: false, dense: true })}</div>` : ''}</a>`;}diff --git a/src/collection.js b/src/collection.jsindex 25876edf4..00a0f5392 100644--- a/src/collection.js+++ b/src/collection.js@@ -67,7 +67,7 @@ function skillCard(p) {avatar_thumbnail_url: p.agent_thumbnail || null,};const walletLine = agentRecord.solana_address- ? `<div class="col-card-wallet" style="margin-top:8px">${walletChipHTML(agentRecord, { isOwner: false, showPending: false })}</div>`+ ? `<div class="col-card-wallet" style="margin-top:8px">${walletChipHTML(agentRecord, { isOwner: false, showPending: false, dense: true })}</div>`: '';return `diff --git a/src/dashboard-next/pages/agents.js b/src/dashboard-next/pages/agents.jsindex 240d85e8a..e8fbe466a 100644--- a/src/dashboard-next/pages/agents.js+++ b/src/dashboard-next/pages/agents.js@@ -487,7 +487,7 @@ function agentCard(a, avatars) {${a.avatar_id ? rigBadgeHTML(avatar, { size: 'sm' }) : ''}${coinChipHTML(a, { launchable: false })}</div>- <div style="margin-bottom:6px">${walletChipHTML(a, { isOwner: true, showPending: false })}</div>+ <div style="margin-bottom:6px">${walletChipHTML(a, { isOwner: true, showPending: false, dense: true })}</div><div style="display:flex;align-items:center;gap:10px;flex-wrap:wrap;font-size:12.5px;color:var(--nxt-ink-dim)"><span>Created ${esc(created)}</span><span style="display:inline-flex;align-items:center;gap:4px">diff --git a/src/dashboard-next/pages/avatars.js b/src/dashboard-next/pages/avatars.jsindex c9b269aef..58136469a 100644--- a/src/dashboard-next/pages/avatars.js+++ b/src/dashboard-next/pages/avatars.js@@ -834,7 +834,7 @@ function avatarWalletChip(a) {solana_vanity_prefix: a.agent_solana_vanity_prefix || null,solana_vanity_suffix: a.agent_solana_vanity_suffix || null,};- return `<div class="dn-av-wallet" style="margin-top:8px;">${walletChipHTML(agent, { isOwner: true, showPending: true })}</div>`;+ return `<div class="dn-av-wallet" style="margin-top:8px;">${walletChipHTML(agent, { isOwner: true, showPending: true, dense: true })}</div>`;}// ── Inline rename ────────────────────────────────────────────────────────diff --git a/src/shared/agent-wallet-chip.js b/src/shared/agent-wallet-chip.jsindex c75c1e3b2..50c250500 100644--- a/src/shared/agent-wallet-chip.js+++ b/src/shared/agent-wallet-chip.js@@ -252,6 +252,14 @@ export function ensureWalletChipStyles() {.twc:focus-visible{outline:none;box-shadow:0 0 0 2px var(--wallet-glow,rgba(139,92,246,.45));}.twc[data-vanity="true"]{color:var(--wallet-accent-strong,#a78bfa);background:var(--wallet-accent-fill,rgba(139,92,246,.15));border-color:var(--wallet-stroke-strong,rgba(139,92,246,.5));}.twc[data-owner="1"]{border-color:var(--wallet-stroke-strong,rgba(139,92,246,.5));}+/* Dense mode: fill a narrow card footer and wrap badges onto a second line inside+ the same rounded container instead of overflowing the card into its neighbours. */+.twc[data-dense="1"]{display:flex;flex-wrap:wrap;width:100%;max-width:100%;box-sizing:border-box;white-space:normal;+ border-radius:12px;column-gap:7px;row-gap:5px;padding:6px 10px;align-items:center;}+.twc[data-dense="1"] .twc-addr{min-width:0;overflow:hidden;text-overflow:ellipsis;}+.twc[data-dense="1"] .twc-bal,+.twc[data-dense="1"] .twc-make,+.twc[data-dense="1"] button.twc-make{border-left:0;padding-left:0;margin-left:0;}.twc-ico{width:11px;height:11px;flex:none;opacity:.8;}.twc-addr{font-family:var(--font-mono,ui-monospace,SFMono-Regular,Menlo,monospace);letter-spacing:.01em;display:inline-flex;gap:1px;}.twc-hi{color:var(--ink-bright,#fff);font-weight:700;}@@ -387,18 +395,22 @@ function tipAttrs(agent, status) {* @param {boolean} [opts.balance=true] Render + lazily hydrate the live balance.* @param {boolean} [opts.popover=true] Enable the rich preview popover.* @param {string} [opts.network='mainnet'] Cluster for the balance read.+ * @param {boolean} [opts.dense=false] Render a full-width chip whose badges wrap+ * onto a second line inside the same rounded container — for narrow card footers+ * (avatar/agent grids) where the single-line pill would otherwise overflow.*/export function walletChipHTML(agent, opts = {}) {ensureWalletChipStyles();const {isOwner = false, showPending = true, link = true, tip = true,balance = true, popover = true, network = 'mainnet', reputation = true,+ dense = false,} = opts;const status = getWalletStatus(agent);if (!status) {if (!showPending) return '';- return `<span class="twc twc-pending" title="Wallet provisioning">${WALLET_SVG}<span>Wallet pending</span></span>`;+ return `<span class="twc twc-pending"${dense ? ' data-dense="1"' : ''} title="Wallet provisioning">${WALLET_SVG}<span>Wallet pending</span></span>`;}// Live balance + rich popover only make sense when the chip is backed by a real@@ -487,7 +499,7 @@ export function walletChipHTML(agent, opts = {}) {const title = `Agent wallet ${status.address}${status.isVanity ? ' (vanity)' : ''}`;return (- `<span class="twc" data-vanity="${status.isVanity}" data-owner="${isOwner ? '1' : '0'}"${triggerAttrs}${hydrateAttrs} title="${esc(title)}">` ++ `<span class="twc" data-vanity="${status.isVanity}" data-owner="${isOwner ? '1' : '0'}"${dense ? ' data-dense="1"' : ''}${triggerAttrs}${hydrateAttrs} title="${esc(title)}">` +WALLET_SVG +addressLabelHTML(status) +ownerBadge +diff --git a/tests/cache-circuit-breaker.test.js b/tests/cache-circuit-breaker.test.jsindex 512fedd5f..23cca8955 100644--- a/tests/cache-circuit-breaker.test.js+++ b/tests/cache-circuit-breaker.test.js@@ -13,6 +13,19 @@ import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';import { cacheSet, cacheGet } from '../api/_lib/cache.js';const SHARED = 'https://ratelimit-store.upstash.io';++// Deterministic high-entropy string (LCG over printable ASCII) that gzip can't+// meaningfully shrink — needed to exercise the size gate now that it measures the+// COMPRESSED wire size. No Math.random so the test stays reproducible.+function incompressible(len) {+ let out = '';+ let x = 0x9e3779b1;+ while (out.length < len) {+ x = (Math.imul(x, 1103515245) + 12345) & 0x7fffffff;+ out += String.fromCharCode(33 + (x % 94));+ }+ return out;+}const ENV_KEYS = ['UPSTASH_CACHE_REST_URL', 'UPSTASH_CACHE_REST_TOKEN', 'UPSTASH_REDIS_REST_URL', 'UPSTASH_REDIS_REST_TOKEN'];let saved;@@ -109,13 +122,15 @@ describe('cache circuit breaker', () => {// from a non-co-located region — sending it would poison the failure streak// and flap the suppression gate (the July 2026 log export). The size guard// must route it to memory without any network call or streak side effects.+ // The gate now measures COMPRESSED bytes, so the oversized value has to be+ // incompressible (high-entropy) to actually exceed the cap after gzip.vi.resetModules();const { cacheGet, cacheSet } = await import('../api/_lib/cache.js');const fetchMock = vi.fn(async () => ({ ok: true, json: async () => ({ result: 'OK' }) }));globalThis.fetch = fetchMock;const warn = vi.spyOn(console, 'warn').mockImplementation(() => {});- const oversized = { blob: 'x'.repeat(300_000) }; // > 256KB default cap+ const oversized = { blob: incompressible(400_000) }; // > 256KB even after gzipawait cacheSet('size:big', oversized, 30);expect(fetchMock).not.toHaveBeenCalled(); // never sent to the network// Near-term reads stay coherent via the read memo — no network round-trip.diff --git a/tests/cache-compression.test.js b/tests/cache-compression.test.jsnew file mode 100644index 000000000..bb9ad625f--- /dev/null+++ b/tests/cache-compression.test.js@@ -0,0 +1,135 @@+/**+ * cache.js wire compression — unit test.+ *+ * Large best-effort cache bodies (the galaxy money-feed, trending snapshots) are+ * highly compressible JSON. Shipping them raw over Upstash REST from a region not+ * co-located with the function is the root cause of the "operation aborted due to+ * timeout" SET failures: the body can't finish inside the command deadline. The+ * cache now gzips anything over COMPRESS_MIN_BYTES before the wire, gates the size+ * guard on the COMPRESSED bytes, and transparently decompresses on read — while+ * legacy plaintext values still parse. This pins that behavior.+ */++import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';+import { gzipSync } from 'node:zlib';++const SHARED = 'https://cache-store.upstash.io';+const ENV_KEYS = ['UPSTASH_CACHE_REST_URL', 'UPSTASH_CACHE_REST_TOKEN', 'UPSTASH_REDIS_REST_URL', 'UPSTASH_REDIS_REST_TOKEN'];+let saved;++// Minimal in-memory Upstash stand-in: SET stores the raw wire body, GET returns+// it verbatim — exactly what a real store round-trips, so the codec is exercised+// end to end rather than mocked away.+function fakeUpstash() {+ const store = new Map();+ const calls = [];+ const fetchMock = vi.fn(async (_url, init) => {+ const args = JSON.parse(init.body);+ calls.push(args);+ const [cmd, key, val] = args;+ if (cmd === 'SET') { store.set(key, val); return { ok: true, json: async () => ({ result: 'OK' }) }; }+ if (cmd === 'GET') { return { ok: true, json: async () => ({ result: store.has(key) ? store.get(key) : null }) }; }+ if (cmd === 'DEL') { store.delete(key); return { ok: true, json: async () => ({ result: 1 }) }; }+ return { ok: true, json: async () => ({ result: null }) };+ });+ return { store, calls, fetchMock };+}++function incompressible(len) {+ let out = '';+ let x = 0x9e3779b1;+ while (out.length < len) {+ x = (Math.imul(x, 1103515245) + 12345) & 0x7fffffff;+ out += String.fromCharCode(33 + (x % 94));+ }+ return out;+}++beforeEach(() => {+ saved = {};+ for (const k of ENV_KEYS) { saved[k] = process.env[k]; delete process.env[k]; }+ process.env.UPSTASH_CACHE_REST_URL = SHARED;+ process.env.UPSTASH_CACHE_REST_TOKEN = 'cache-token';+ vi.resetModules();+});++afterEach(() => {+ for (const k of ENV_KEYS) {+ if (saved[k] === undefined) delete process.env[k];+ else process.env[k] = saved[k];+ }+ vi.restoreAllMocks();+});++describe('cache wire compression', () => {+ it('compresses a large compressible value and round-trips it through Redis', async () => {+ const { store, calls, fetchMock } = fakeUpstash();+ globalThis.fetch = fetchMock;+ const { cacheSet, cacheGetFresh } = await import('../api/_lib/cache.js');++ // ~200KB of repetitive JSON — highly compressible, well over COMPRESS_MIN_BYTES.+ const value = { rows: Array.from({ length: 4000 }, (_, i) => ({ id: i, label: 'flow-node', amount: 1000 })) };+ const rawBytes = JSON.stringify(value).length;++ await cacheSet('cmp:big', value, 30);++ // It reached the network (was NOT shunted to memory-only) and the stored+ // body is the compressed sentinel form, far smaller than the raw JSON.+ const setArgs = calls.find((c) => c[0] === 'SET' && c[1] === 'cmp:big');+ expect(setArgs).toBeTruthy();+ const stored = setArgs[2];+ expect(stored.startsWith('\u0000gz:')).toBe(true);+ expect(stored.length).toBeLessThan(rawBytes / 2);+ expect(store.get('cmp:big')).toBe(stored);++ // A fresh GET (memo bypassed) decompresses back to the exact original.+ const got = await cacheGetFresh('cmp:big');+ expect(got).toEqual(value);+ });++ it('stores small values as raw JSON — no compression framing', async () => {+ const { calls, fetchMock } = fakeUpstash();+ globalThis.fetch = fetchMock;+ const { cacheSet, cacheGetFresh } = await import('../api/_lib/cache.js');++ await cacheSet('cmp:small', { v: 1, name: 'ok' }, 30);+ const setArgs = calls.find((c) => c[0] === 'SET' && c[1] === 'cmp:small');+ expect(setArgs[2]).toBe(JSON.stringify({ v: 1, name: 'ok' })); // stored verbatim+ expect(await cacheGetFresh('cmp:small')).toEqual({ v: 1, name: 'ok' });+ });++ it('reads legacy plaintext values written before compression existed', async () => {+ const { store, fetchMock } = fakeUpstash();+ globalThis.fetch = fetchMock;+ const { cacheGetFresh } = await import('../api/_lib/cache.js');++ // Simulate a value written by the previous format: raw JSON, no sentinel.+ store.set('legacy:key', JSON.stringify({ legacy: true, n: 42 }));+ expect(await cacheGetFresh('legacy:key')).toEqual({ legacy: true, n: 42 });+ });++ it('reads a compressed value produced out-of-band (decode path is stable)', async () => {+ const { store, fetchMock } = fakeUpstash();+ globalThis.fetch = fetchMock;+ const { cacheGetFresh } = await import('../api/_lib/cache.js');++ const value = { hello: 'world', list: [1, 2, 3] };+ const wire = '\u0000gz:' + gzipSync(JSON.stringify(value)).toString('base64');+ store.set('oob:key', wire);+ expect(await cacheGetFresh('oob:key')).toEqual(value);+ });++ it('leaves an incompressible value on the raw path when gzip would not shrink it', async () => {+ const { calls, fetchMock } = fakeUpstash();+ globalThis.fetch = fetchMock;+ const { cacheSet, cacheGetFresh } = await import('../api/_lib/cache.js');++ // High-entropy but under the size cap: encodeForWire's only-if-smaller guard+ // must fall back to raw JSON rather than ship a larger base64(gzip) body.+ const value = { blob: incompressible(2_000) };+ await cacheSet('cmp:noise', value, 30);+ const setArgs = calls.find((c) => c[0] === 'SET' && c[1] === 'cmp:noise');+ expect(setArgs[2].startsWith('\u0000gz:')).toBe(false); // stayed raw+ expect(await cacheGetFresh('cmp:noise')).toEqual(value);+ });+});diff --git a/tests/portfolio.test.js b/tests/portfolio.test.jsindex 361afa890..cc08dc434 100644--- a/tests/portfolio.test.js+++ b/tests/portfolio.test.js@@ -82,6 +82,35 @@ describe('computeRisk — concentration, exposure, drawdown', () => {expect(r.valued_count).toBe(3);});+ it('treats SOL + stables as reserve, not concentration (fresh wallet)', () => {+ const holdings = [+ { usd: 0.33, mint: null, isNative: true, stable: false }, // only SOL+ ];+ const r = computeRisk(holdings, 0.33, metrics, []);+ expect(r.reserve_pct).toBe(100);+ expect(r.reserve_usd).toBe(0.33);+ expect(r.top_position_is_reserve).toBe(true);+ expect(r.risk_assets_count).toBe(0);+ expect(r.top_risk_position_pct).toBe(0);+ expect(r.top_risk_position_mint).toBe(null);+ expect(r.exposure_pct).toBe(0);+ });++ it('reports the risk sleeve alongside reserve for a mixed wallet', () => {+ const holdings = [+ { usd: 8000, mint: 'MEME', isNative: false, stable: false }, // 80% volatile+ { usd: 1000, mint: null, isNative: true, stable: false }, // 10% SOL+ { usd: 1000, mint: 'USDC', isNative: false, stable: true }, // 10% stable+ ];+ const r = computeRisk(holdings, 10000, metrics, []);+ expect(r.reserve_pct).toBe(20); // SOL + USDC+ expect(r.reserve_usd).toBe(2000);+ expect(r.top_position_is_reserve).toBe(false); // MEME is the top holding+ expect(r.top_risk_position_pct).toBe(80);+ expect(r.top_risk_position_mint).toBe('MEME');+ expect(r.risk_assets_count).toBe(1);+ });+it('counts unpriceable non-native holdings honestly', () => {const holdings = [{ usd: 100, mint: null, isNative: true, stable: false },@@ -113,6 +142,28 @@ describe('riskFlags — plain-language flags', () => {expect(flags[0].level).toBe('info');expect(flags[0].text).toMatch(/No elevated/);});++ it('never raises concentration risk on a reserve-only wallet — surfaces dry powder', () => {+ // 100% SOL: top_position_pct is 100 but the risk sleeve is empty.+ const risk = {+ top_position_pct: 100, top_risk_position_pct: 0, top_position_is_reserve: true,+ reserve_pct: 100, exposure_pct: 0, max_drawdown_pct: 0, unpriceable_count: 0, net_worth_usd: 0.33,+ };+ const flags = riskFlags(risk, true);+ expect(flags.some((f) => /concentration risk/.test(f.text))).toBe(false);+ expect(flags).toHaveLength(1);+ expect(flags[0].level).toBe('info');+ expect(flags[0].text).toMatch(/dry powder/);+ });++ it('still flags a dominant volatile position even when reserve is present', () => {+ const risk = {+ top_position_pct: 70, top_risk_position_pct: 70, top_position_is_reserve: false,+ reserve_pct: 30, exposure_pct: 70, max_drawdown_pct: 0, unpriceable_count: 0, net_worth_usd: 1000,+ };+ const flags = riskFlags(risk, true);+ expect(flags.some((f) => /70% of valued holdings sit in one position — concentration risk/.test(f.text))).toBe(true);+ });});describe('buildAttribution — buckets, realized + unrealized, outflows', () => {