Skip to content

Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.

docs(changelog): tell holders the Community activity feed reads as rows again

nirholasb2356c60f5e4
diff --git a/api/pump/intel.js b/api/pump/intel.js
index a9b076dfd..7671a6697 100644
--- a/api/pump/intel.js
+++ b/api/pump/intel.js
@@ -323,22 +323,27 @@ async function getTraders({ network, limit }) {
const cap = Math.max(1, Math.min(100, limit || 40));
let traders = [];
try {
+ // `count(*)`, not `count(distinct w.mint)`: pump_coin_wallets is unique on
+ // (mint, wallet), so within a `group by w.wallet` the mints are already
+ // distinct and the DISTINCT only bought a sort of the whole 3M-row ledger by
+ // (wallet, mint) that spilled ~100MB to disk on every request. Same result,
+ // one hash aggregate instead.
const rows = await sql`
select w.wallet,
- count(distinct w.mint)::int as coins,
+ count(*)::int as coins,
sum(w.buy_lamports)::numeric as buy_lamports,
sum(w.sell_lamports)::numeric as sell_lamports,
sum(w.buy_count)::int as buys,
sum(w.sell_count)::int as sells,
bool_or(w.is_creator) as ever_creator,
- count(distinct w.mint) filter (where o.outcome in ('graduated','pumped'))::int as wins,
- count(distinct w.mint) filter (where o.outcome is not null and o.outcome <> 'unknown')::int as labeled
+ count(*) filter (where o.outcome in ('graduated','pumped'))::int as wins,
+ count(*) filter (where o.outcome is not null and o.outcome <> 'unknown')::int as labeled
from pump_coin_wallets w
join pump_coin_intel i on i.mint = w.mint and i.network = ${network}
left join pump_coin_outcomes o on o.mint = w.mint
where w.buy_count > 0
group by w.wallet
- having count(distinct w.mint) >= 2
+ having count(*) >= 2
order by sum(w.buy_lamports) desc
limit ${cap}
`;
@@ -490,8 +495,16 @@ export default wrap(async (req, res) => {
});
break;
}
- return json(res, 200, { view, network, ...payload, ts: Date.now() },
- { 'cache-control': 'public, max-age=5, stale-while-revalidate=20' });
+ // The radar is a live feed and stays on a 5s edge cache. `traders` and
+ // `learning` are whole-history aggregates over every observed coin: they cost
+ // seconds to compute and move by fractions of a percent between runs, so a
+ // 5s cache made every visitor pay the full aggregate. Serve them for minutes
+ // and revalidate in the background instead.
+ const SLOW_AGGREGATE_VIEWS = new Set(['traders', 'learning']);
+ const cacheControl = SLOW_AGGREGATE_VIEWS.has(view)
+ ? 'public, max-age=300, stale-while-revalidate=3600'
+ : 'public, max-age=5, stale-while-revalidate=20';
+ return json(res, 200, { view, network, ...payload, ts: Date.now() }, { 'cache-control': cacheControl });
} catch (err) {
// The engine tables may not be migrated in this environment yet. Tell the
// dashboard so it shows its "warming up" state rather than a hard failure.
diff --git a/data/changelog.json b/data/changelog.json
index afd935e28..9716839a4 100644
--- a/data/changelog.json
+++ b/data/changelog.json
@@ -1,6 +1,16 @@
{
"$comment": "Curated changelog entries for three.ws, the editorial layer of the public changelog. New PAGE launches are tracked automatically via the `added` field in data/pages.json; this file is for everything else holders care about: improvements, fixes, SDK releases, trading/payments capabilities, security work. scripts/build-page-index.mjs merges both sources into CHANGELOG.md, public/changelog.json, and public/changelog.xml. Newest first. Allowed tags: feature, improvement, fix, sdk, infra, docs, security. `link` is optional and must be a live three.ws path.",
"entries": [
+ {
+ "date": "2026-08-17",
+ "title": "The Community page's live activity feed renders as readable rows again",
+ "summary": "The activity list on the Community page was building each row as a link wrapped around another link, which no browser can parse: every entry was torn into three stray fragments, so the creator, the item and its thumbnail landed on separate lines with gaps between them and the whole list was unreadable. Rows are now single, valid entries again: click anywhere on one to open the creation, or click the creator's name to open their profile. If the feed cannot load, or returns something the page cannot read, you get a clear message and a Try again button instead of skeleton placeholders that never resolve. The page also follows the light and dark theme switch now instead of staying black on a light canvas, and the newsletter section finally has the signup field its text promises, rather than sending you hunting for the one in the footer.",
+ "tags": [
+ "fix",
+ "improvement"
+ ],
+ "link": "/community"
+ },
{
"date": "2026-08-17",
"title": "A failed X seed no longer costs you six hours, and can no longer wipe a good one",
diff --git a/tests/clip-director-grounding.test.js b/tests/clip-director-grounding.test.js
index 2b0580d1e..955511790 100644
--- a/tests/clip-director-grounding.test.js
+++ b/tests/clip-director-grounding.test.js
@@ -82,8 +82,8 @@ describe('isGrounded', () => {
});
it('allows the follower count, which is real but not part of the trade', () => {
- expect(isGrounded({ hook: '$NIBZ closed 1.89x.', feature_stat: '1.89x', body: 'Copied by 12 traders.', alt_text: 'A win.' }, WIN, 12)).toBe(true);
- expect(isGrounded({ hook: '$NIBZ closed 1.89x.', feature_stat: '1.89x', body: 'Copied by 900 traders.', alt_text: 'A win.' }, WIN, 12)).toBe(false);
+ expect(isGrounded({ hook: '$NIBZ closed 1.89x.', feature_stat: '1.89x', body: 'Copied by 12 traders.', alt_text: 'A win.' }, WIN, { copiedByCount: 12 })).toBe(true);
+ expect(isGrounded({ hook: '$NIBZ closed 1.89x.', feature_stat: '1.89x', body: 'Copied by 900 traders.', alt_text: 'A win.' }, WIN, { copiedByCount: 12 })).toBe(false);
});
it('rejects empty copy rather than passing it through as vacuously grounded', () => {
@@ -128,7 +128,7 @@ describe('directClip', () => {
it('rejects a card whose numbers only survive until the length clamp cuts them', async () => {
// finalize() clamps the hook at 120 chars. A clamp landing mid-number turns
// a real 1.89 into a stated 1.8, so the guard runs on the finalized bytes.
- const pad = 'On-chain, verifiable, no screenshots, the full round-trip is on the record for anyone to check today.';
+ const pad = 'On-chain, verifiable, no screenshots, and the whole round-trip stays on the public record for anyone to check.';
llmText.mockResolvedValue(JSON.stringify({
hook: `${pad} $NIBZ 1.89x`,
feature_stat: '1.89x', avatar_gesture: 'celebrate',
@@ -139,12 +139,14 @@ describe('directClip', () => {
});
it('gives a loss an honest card, never a celebration', async () => {
- llmText.mockRejectedValue(new Error('providers exhausted'));
+ llmText.mockImplementation(() => { throw new Error('providers exhausted'); });
+ // "Swarm 2" is a real agent name, not a stated figure: the guard has to know
+ // the difference or every numbered agent falls back forever.
const clip = await directClip({ agentName: 'Swarm 2', trade: LOSS, surface: 'feed' });
expect(clip.source).toBe('deterministic');
expect(['sweat', 'shrug']).toContain(clip.avatar_gesture);
expect(clip.cta).toBe('view-track-record');
- expect(isGrounded(clip, LOSS)).toBe(true);
+ expect(isGrounded(clip, LOSS, { agentName: 'Swarm 2' })).toBe(true);
});
it('will not let a writer celebrate a stop-out', async () => {
diff --git a/tests/npc-zauth-approach.test.js b/tests/npc-zauth-approach.test.js
new file mode 100644
index 000000000..989b5194b
--- /dev/null
+++ b/tests/npc-zauth-approach.test.js
@@ -0,0 +1,74 @@
+// @vitest-environment jsdom
+//
+// Walking past a vendor must never take the screen. zauth is the only NPC in
+// the catalog with an `onApproach` handler, and it used to open its RepoScan
+// panel from proximity alone: crossing the plaza in /play threw a modal over
+// the world nobody asked for. Approach now only greets and warms the live 402
+// probe; the panel belongs to E and to clicks. This locks that split in.
+
+import { describe, it, expect, beforeEach, afterEach, vi } from 'vitest';
+
+globalThis.self = globalThis;
+
+const CHALLENGE = {
+ x402Version: 2,
+ accepts: [{ amount: '50000', network: 'solana:mainnet', asset: 'USDC' }],
+};
+
+function fakeNpc() {
+ return { say: vi.fn(), emote: vi.fn(), _disposed: false };
+}
+
+let zauth;
+
+beforeEach(async () => {
+ globalThis.fetch = vi.fn(async () => new Response(JSON.stringify(CHALLENGE), {
+ status: 402,
+ headers: { 'content-type': 'application/json' },
+ }));
+ const { npcCatalogFor } = await import('../src/game/npc/npc-catalog.js');
+ zauth = npcCatalogFor().find((n) => n.id === 'npc-zauth');
+});
+
+afterEach(() => {
+ document.querySelector('.npc-svc-overlay')?.remove();
+ document.body.innerHTML = '';
+ vi.resetModules();
+ vi.restoreAllMocks();
+});
+
+describe('zauth NPC walk-up', () => {
+ it('is in the catalog with both an approach line and an E prompt', () => {
+ expect(zauth).toBeTruthy();
+ expect(typeof zauth.onApproach).toBe('function');
+ expect(typeof zauth.onInteract).toBe('function');
+ expect(zauth.prompt).toBeTruthy();
+ });
+
+ it('greets on approach without opening any panel', async () => {
+ const npc = fakeNpc();
+ zauth.onApproach({ npc, ui: {} });
+ await Promise.resolve();
+ expect(npc.say).toHaveBeenCalledTimes(1);
+ expect(document.querySelector('.npc-svc-overlay')).toBeNull();
+ expect(document.querySelector('.npc-svc-card.is-zauth')).toBeNull();
+ });
+
+ it('warms the live x402 challenge on approach so the panel opens priced', async () => {
+ zauth.onApproach({ npc: fakeNpc(), ui: {} });
+ expect(globalThis.fetch).toHaveBeenCalledTimes(1);
+ const [url, init] = globalThis.fetch.mock.calls[0];
+ expect(url).toBe('/api/zauth-reposcan');
+ expect(init.method).toBe('POST');
+ });
+
+ it('opens the scanner only on interact, reusing the warmed challenge', async () => {
+ zauth.onApproach({ npc: fakeNpc(), ui: {} });
+ expect(document.querySelector('.npc-svc-overlay')).toBeNull();
+
+ zauth.onInteract({ npc: fakeNpc(), ui: {} });
+ expect(document.querySelector('.npc-svc-card.is-zauth')).toBeTruthy();
+ // The probe is cached, so opening does not re-hit the endpoint.
+ expect(globalThis.fetch).toHaveBeenCalledTimes(1);
+ });
+});