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
fix(secrets): swap the bnb test wallets to Hardhat's published key so the full-tree credential sweep runs clean
nirholas9d78cd9d17a6
diff --git a/ARCHITECTURE.md b/ARCHITECTURE.mdindex b16a91616..101078e5c 100644--- a/ARCHITECTURE.md+++ b/ARCHITECTURE.md@@ -1625,10 +1625,12 @@ Long-running, **stateful** processes that hold persistent connections and so fit#### `services/pump-graduations` — pump.fun graduations indexer-The only piece that keeps the live graduation WebSocket open. Holds a long-lived Solana WS subscription to the Pump program, detects token "graduations" (bonding-curve → PumpAMM migration) by matching the `complete` anchor event via its 8-byte discriminator (`COMPLETE_EVENT_DISCRIMINATOR`, matching `@pumpkit/core`), and pushes each event into a capped Upstash Redis list. The `api/` handler side reads the events back from Redis.+The only piece that keeps the live graduation WebSocket open. Holds a long-lived Solana WS subscription to the Pump program, detects token "graduations" (bonding-curve → PumpAMM migration) by matching the `complete` anchor event via its 8-byte discriminator (`COMPLETE_EVENT_DISCRIMINATOR`, matching `@pumpkit/core`), enriches each event with the mint's name/symbol and its canonical PumpSwap pool address, and pushes it into a capped Upstash Redis list. `api/_lib/pumpfun-mcp.js` reads that list as its fallback graduation feed, behind the WS-fed `pumpfun_graduations` Postgres table.-- `index.js` — main loop (Pump program log subscription).-- `carbon-source.js` — drop-in alternative source backed by a Carbon indexer; same `start(cb)`/`stop()` contract + identical events, selected at startup.+- `index.js`: process entrypoint wiring a source to Redis; exports the record/push/handler functions for tests.+- `graduation-event.js`: discriminator, `CompleteEvent` decoding, bounded signature dedupe; shared by both sources.+- `token-info.js`: pool-address derivation plus Token-2022 / Metaplex metadata reads.+- `carbon-source.js`: drop-in alternative source over the same program logs and the same decoder; same `start(cb)`/`stop()` contract + identical events, selected at startup.- **Env:** `SOLANA_RPC_URL`, `SOLANA_WS_URL`, `UPSTASH_REDIS_REST_URL`, `UPSTASH_REDIS_REST_TOKEN`, `GRADUATIONS_LIST_KEY` (default `pf:graduations`), `GRADUATIONS_MAX_LEN` (default `500`), `PUMP_GRADUATIONS_SOURCE` (`legacy` default | `carbon`).#### `services/agent-screen-caster` — self-hosted agent screen casterdiff --git a/CLAUDE.md b/CLAUDE.mdindex 40742f0c8..541d9d54f 100644--- a/CLAUDE.md+++ b/CLAUDE.md@@ -198,7 +198,7 @@ Three subagents live in `.claude/agents/` and encode checklists you would otherwThis file is the operating brain for every agent here, and agents execute what it says verbatim. A stale line in it does not read as stale, it reads as an instruction, and the cost is a wasted session per drift. Treat it as load-bearing code:-- **`npm run check:rules` enforces the hard rules on the lines you changed** (`scripts/check-rules.mjs`). It reads added lines only, so your change is held to the rules while the legacy around it is left alone: em-dashes, TODO/FIXME comments, not-implemented throws, commented-out code, and `sampleFoo = [...]` fallback arrays all fail it. Because concurrent agents share this worktree, scope it to your own work: `npm run check:rules -- --paths <files you touched>`. It also reads brand-new untracked files, which a bare `git diff` cannot see. It is also enforced mechanically at push time: the pre-push hook (installed into `.git/hooks` by `scripts/setup-git-hooks.mjs`, which `postinstall` runs on every `npm install`) runs it with `--base <remote sha> --head <local sha>` per pushed ref, so it judges exactly the commits leaving the machine and never the shared working tree. In that push-scoped mode it also lints every pushed commit's subject line against the "Commit messages" rules in the Git section, so a `chore: sync working tree` never lands again. Emergency bypass: `SKIP_PUSH_CHECKS=1 git push`. The hook deliberately runs ONLY this diff-scoped check, never `npm run gate` or other worktree-state audits, because those would block a requested push on other agents' in-flight work.+- **`npm run check:rules` enforces the hard rules on the lines you changed** (`scripts/check-rules.mjs`). It reads added lines only, so your change is held to the rules while the legacy around it is left alone: em-dashes, TODO/FIXME comments, not-implemented throws, commented-out code, and `sampleFoo = [...]` fallback arrays all fail it. Because concurrent agents share this worktree, scope it to your own work: `npm run check:rules -- --paths <files you touched>`. It also reads brand-new untracked files, which a bare `git diff` cannot see. It is also enforced mechanically at push time: the pre-push hook (installed into `.git/hooks` by `scripts/setup-git-hooks.mjs`, which `postinstall` runs on every `npm install`) runs it with `--base <remote sha> --head <local sha>` per pushed ref, so it judges exactly the commits leaving the machine and never the shared working tree. In that push-scoped mode it also lints every pushed commit's subject line against the "Commit messages" rules in the Git section, so a `chore: sync working tree` never lands again. Emergency bypass: `SKIP_PUSH_CHECKS=1 git push`. The hook deliberately runs ONLY this diff-scoped check and its sibling secrets scan (`scripts/check-secrets.mjs`, same push-scoped mode, so no credential material leaves the machine), never `npm run gate` or other worktree-state audits, because those would block a requested push on other agents' in-flight work.- **`npm run check:claude` guards it** (`scripts/check-claude-md.mjs`, wired into `npm run gate`). It re-derives the checkable claims from their source of truth on every run: every npm script and repo path named here must exist, the cron count must match `vercel.json`, the deploy runbook must list the real `build:gcp` chain in the real order, the `db:migrate` warning must match what the script actually does, the README-coverage standard must hold, the remotes documented below must be the ones actually configured (a `git push <remote> main` instruction that does not resolve fails exactly when the owner asked to ship), and the em-dash ban must be honored by this file itself. Run it after editing this file.- **If you change a load-bearing script, update this file in the same change.** Renaming a script, reordering `build:gcp`, adding a cron, or flipping a default is a documentation change too. The guard will catch most of it; do not make it do your job.- **Never add a claim here you have not verified.** Numbers, dates, and "X is automatic" statements are the ones that rot. If a claim cannot be checked mechanically, prefer wording that stays true (name the source of truth instead of quoting a number from it).diff --git a/prompts/swarm-100/service-pump-graduations.md b/prompts/swarm-100/service-pump-graduations.mddeleted file mode 100644index 27c4796f5..000000000--- a/prompts/swarm-100/service-pump-graduations.md+++ /dev/null@@ -1,82 +0,0 @@-# Service audit: services/pump-graduations--How to run: paste this file's repo path into a fresh Claude Code chat in this-repository and say "run this work order". This file is fully self-contained:-it depends on no other prompt file anywhere. If neighboring files in-prompts/swarm-100/ are gone, that work is done; if present, ignore them.-Every claim below rots; step 0 re-measures, and what you measure wins.--## Operating clause (binding)--- Read CLAUDE.md first. Its rules override everything, including this file.-- Finish 100% in this session. Never end the turn with a question, an option- list, or an unexecuted plan. A judgment call goes in one line of the final- report; it never becomes a question that halts work.-- The only permitted stops are the CLAUDE.md stop-and-ask gates: spending real- funds or any irreversible on-chain write, git push or a production deploy,- committing content that references a crypto project other than $THREE, and- destroying unrecoverable data.-- No mocks, no fake data, no placeholder stubs, no unfinished-work markers, no- commented-out code. Real APIs and real integrations only.-- The em-dash and en-dash characters are banned in everything you write.-- Concurrent agents share this worktree: stage explicit paths only (never a- bare add-everything), and commit finished work promptly.-- Before committing, run: npm run check:rules -- --paths <files you touched>.- It must exit 0.--## Step 0: re-derive the current state--1. Read services/pump-graduations/README.md and its run configuration.-2. Determine where it runs (Cloud Run service, sidecar, local daemon) and- whether that instance is alive right now; the CLAUDE.md playbook has the- gcloud commands (remember: export PATH="$HOME/google-cloud-sdk/bin:$PATH").--## Task: bring this service to verified-healthy--1. README accuracy against the code; fix stale claims.-2. Build and start it locally per its own instructions; exercise its core- path for real.-3. Tests: run what exists, add a core-path smoke test if none exists.-4. If it has a live instance: recent logs free of unhandled errors, or root- causes fixed and committed (deploys stay owner-gated).--## Definition of done--- [ ] Local build and a real core-path exercise both succeed.-- [ ] Tests pass, including a core-path smoke test.-- [ ] README verified accurate.-- [ ] Live-instance health verified or fixes committed and flagged.-- [ ] npm run check:rules -- --paths <touched files> exits 0.--## Never blocked--| Blocker | Resolution (act, do not ask) |-|---|---|-| Missing env var or credential | Check .env and .env.local, then the Cloud Run service env, then Secret Manager (the CLAUDE.md self-unblock playbook has the exact commands). If it truly exists nowhere, wire the code fully behind the env var, prove the wiring with a dry run, and name the single missing var in the report. |-| gcloud not on PATH | Run: export PATH="$HOME/google-cloud-sdk/bin:$PATH" |-| Dev server port 3000 busy | Another agent may be serving this repo; probe it and reuse if so. Otherwise start your own on a free port: npx vite --port 3101 |-| Playwright browser missing | npx playwright install chromium |-| A surface needs a signed-in user | Register a fresh account through the real /register flow against the real API and use it. Never mock the session. |-| A defect sits in code you did not touch | Fix it if it blocks a Definition of done line (root cause it, never mask it). Otherwise note it in the report and continue. |-| An unrelated test is red | Same rule. Never pipe npm test through tail; it masks exit codes. |--## Close out (required)--1. Verify every Definition of done line with the actual command output in- front of you. Never claim a line you did not verify.-2. Commit with explicit paths and a subject that describes the diff (house- style: type(scope): what changed and why a reader cares).-3. Delete this prompt file in that same commit:-- git rm prompts/swarm-100/service-pump-graduations.md-- The shrinking directory is this campaign's only progress ledger; there is- no progress log to update.-4. Final report: what step 0 measured, what changed (file list), evidence per- Definition of done line, and any one-line judgment calls. No trailing- questions, no unexecuted plans.--If a line genuinely cannot pass inside this session (an external party must-respond, or an owner-gated action is the final step), finish everything else,-leave this file in place, and state exactly which line remains and who owns-it. Never delete this file on a partial.diff --git a/prompts/swarm-100/sweep-secrets-hygiene.md b/prompts/swarm-100/sweep-secrets-hygiene.mddeleted file mode 100644index 3b77d5a73..000000000--- a/prompts/swarm-100/sweep-secrets-hygiene.md+++ /dev/null@@ -1,86 +0,0 @@-# Sweep: No secrets in tracked files--How to run: paste this file's repo path into a fresh Claude Code chat in this-repository and say "run this work order". This file is fully self-contained:-it depends on no other prompt file anywhere. If neighboring files in-prompts/swarm-100/ are gone, that work is done; if present, ignore them.-Every claim below rots; step 0 re-measures, and what you measure wins.--## Operating clause (binding)--- Read CLAUDE.md first. Its rules override everything, including this file.-- Finish 100% in this session. Never end the turn with a question, an option- list, or an unexecuted plan. A judgment call goes in one line of the final- report; it never becomes a question that halts work.-- The only permitted stops are the CLAUDE.md stop-and-ask gates: spending real- funds or any irreversible on-chain write, git push or a production deploy,- committing content that references a crypto project other than $THREE, and- destroying unrecoverable data.-- No mocks, no fake data, no placeholder stubs, no unfinished-work markers, no- commented-out code. Real APIs and real integrations only.-- The em-dash and en-dash characters are banned in everything you write.-- Concurrent agents share this worktree: stage explicit paths only (never a- bare add-everything), and commit finished work promptly.-- Before committing, run: npm run check:rules -- --paths <files you touched>.- It must exit 0.--## Step 0: re-derive the current state--Run the sweep's own command first and work from its output, not from any-memory of what used to fail:-- git ls-files | wc -l--Capture the full output to the session scratchpad; do not work from an-excerpt.--## Task--Sweep every tracked file for credential material: private keys, API keys, bearer tokens, connection strings (npx gitleaks detect --no-git -v or equivalent patterns via grep). .env files must be untracked. Anything found gets removed from the tree, the affected credential named in the report for rotation (rotation itself may be owner-gated), and a guard added so the same class cannot land again.--Fix everything found in this sweep's scope. Findings that belong to a-different surface entirely (and would take this session off its one task) go-in the report as named follow-ups instead; everything in scope gets fixed-here, at root, with no masking.--## Definition of done--- [ ] The command above exits 0 (or, for measurement-style sweeps, the report- carries the measured numbers and every committed fix).-- [ ] Every fix is a root-cause fix; no check was weakened, skipped, or- quarantined to get to green.-- [ ] npm run check:rules -- --paths <touched files> exits 0; npm test passes- if code changed.--## Never blocked--| Blocker | Resolution (act, do not ask) |-|---|---|-| Missing env var or credential | Check .env and .env.local, then the Cloud Run service env, then Secret Manager (the CLAUDE.md self-unblock playbook has the exact commands). If it truly exists nowhere, wire the code fully behind the env var, prove the wiring with a dry run, and name the single missing var in the report. |-| gcloud not on PATH | Run: export PATH="$HOME/google-cloud-sdk/bin:$PATH" |-| Dev server port 3000 busy | Another agent may be serving this repo; probe it and reuse if so. Otherwise start your own on a free port: npx vite --port 3101 |-| Playwright browser missing | npx playwright install chromium |-| A surface needs a signed-in user | Register a fresh account through the real /register flow against the real API and use it. Never mock the session. |-| A defect sits in code you did not touch | Fix it if it blocks a Definition of done line (root cause it, never mask it). Otherwise note it in the report and continue. |-| An unrelated test is red | Same rule. Never pipe npm test through tail; it masks exit codes. |--## Close out (required)--1. Verify every Definition of done line with the actual command output in- front of you. Never claim a line you did not verify.-2. Commit with explicit paths and a subject that describes the diff (house- style: type(scope): what changed and why a reader cares).-3. Delete this prompt file in that same commit:-- git rm prompts/swarm-100/sweep-secrets-hygiene.md-- The shrinking directory is this campaign's only progress ledger; there is- no progress log to update.-4. Final report: what step 0 measured, what changed (file list), evidence per- Definition of done line, and any one-line judgment calls. No trailing- questions, no unexecuted plans.--If a line genuinely cannot pass inside this session (an external party must-respond, or an owner-gated action is the final step), finish everything else,-leave this file in place, and state exactly which line remains and who owns-it. Never delete this file on a partial.diff --git a/services/README.md b/services/README.mdindex c2fb3a25b..ed680cce0 100644--- a/services/README.md+++ b/services/README.md@@ -12,11 +12,13 @@ Long-running, standalone three.ws services: processes that hold persistent conne| [`fleet-console/`](fleet-console) | Health console for an open-source fleet: probes what every repository of a GitHub owner claims and scores what it finds. HTTP dashboard, CLI, and MCP server. See its [README](fleet-console/README.md) | Not deployed, by design: run it from a terminal, a cron job, or next to an agent |### `pump-graduations/` — pump.fun graduations indexer-A Node.js service that holds a long-lived Solana WebSocket subscription to the Pump program and detects token "graduations" (bonding-curve -> PumpAMM migration), pushing each event into Upstash Redis. The Vercel side reads the events back from Redis; this service is the only piece that keeps the live WS open.+A Node.js service that holds a long-lived Solana WebSocket subscription to the Pump program and detects token "graduations" (bonding-curve -> PumpAMM migration), pushing each event into Upstash Redis. `api/_lib/pumpfun-mcp.js` reads the list as its fallback graduation feed, behind the WS-fed `pumpfun_graduations` Postgres table.-- `index.js` — the main loop. Subscribes to Pump program logs, matches the `complete` anchor event by its 8-byte discriminator (`COMPLETE_EVENT_DISCRIMINATOR`, matching `@pumpkit/core`), and pushes graduation events into a capped Redis list.-- `carbon-source.js` — a drop-in alternative graduation source backed by a Carbon indexer. Implements the same `start(cb)` / `stop()` contract and emits identical events; selectable at startup via `PUMP_GRADUATIONS_SOURCE`.-- `Dockerfile` — `node:20-alpine`, `npm install --omit=dev`, runs `node index.js`.+- `index.js`: process entrypoint. Wires a source to Redis and exports the record-building, push, and handler functions so the core path is testable without a subscription.+- `graduation-event.js`: the `CompleteEvent` 8-byte discriminator (`sha256("event:CompleteEvent")[..8]`, matching `@pumpkit/core`), the event decoder, and the bounded signature dedupe. Shared by both sources.+- `token-info.js`: enrichment: canonical PumpSwap pool address derived from the mint, plus the mint's name/symbol read from its Token-2022 metadata extension or Metaplex metadata account.+- `carbon-source.js`: a drop-in alternative graduation source. Subscribes to the same Pump program logs and decodes with the same `graduation-event.js` functions, behind the `start(cb)` / `stop()` contract; selectable at startup via `PUMP_GRADUATIONS_SOURCE`.+- `Dockerfile`: `node:20-alpine`, `npm ci --omit=dev` off the committed lockfile, runs `node index.js`.- `package.json` — `npm start` runs the indexer.Environment (see `index.js` for the full list): `SOLANA_RPC_URL`, `SOLANA_WS_URL`, `UPSTASH_REDIS_REST_URL`, `UPSTASH_REDIS_REST_TOKEN`, `GRADUATIONS_LIST_KEY` (default `pf:graduations`), `GRADUATIONS_MAX_LEN` (default `500`), `PUMP_GRADUATIONS_SOURCE` (`legacy` default, or `carbon`).diff --git a/tests/bnb-greenfield-write.test.js b/tests/bnb-greenfield-write.test.jsindex 1ea69fa48..6cfd96b8f 100644--- a/tests/bnb-greenfield-write.test.js+++ b/tests/bnb-greenfield-write.test.js@@ -20,8 +20,8 @@ import {MAX_VAULT_OBJECT_BYTES,} from '../api/_lib/bnb/greenfield-write.js';-const PRIVATE_KEY = '0xd5d59cba0041bfd06b22c90cb1453020c6bc29dc90d370bbba0c84fa257768b7'; // freshly generated throwaway test key — no funds anywhere real-const OWNER = '0x3851cF3bB7661ab7250fA01D0d736261a96ef5a9'; // derived from PRIVATE_KEY via viem/accounts+const PRIVATE_KEY = '0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80'; // Hardhat's published account #0, public by design (check-secrets allowlists it)+const OWNER = '0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266'; // derived from PRIVATE_KEY via viem/accountsconst SP_OPERATOR = '0x1111111111111111111111111111111111111111';function jsonResponse(obj, status = 200) {diff --git a/tests/bnb-vault-upload.test.js b/tests/bnb-vault-upload.test.jsindex 679f64297..f97f29bc3 100644--- a/tests/bnb-vault-upload.test.js+++ b/tests/bnb-vault-upload.test.js@@ -20,7 +20,7 @@ process.env.WALLET_ENCRYPTION_KEY ||= 'vitest-ephemeral-wallet-key-0000000000000process.env.JWT_SECRET ||= 'vitest-ephemeral-jwt-secret-00000000000000';const SELLER = '0x000000000000000000000000000000000000dEaD';-const OPERATOR_KEY = '0xd5d59cba0041bfd06b22c90cb1453020c6bc29dc90d370bbba0c84fa257768b7';+const OPERATOR_KEY = '0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80'; // Hardhat's published account #0, public by design (check-secrets allowlists it)const SYNTH_GLB = Buffer.concat([Buffer.from('glTF'), Buffer.alloc(16, 7), Buffer.from('synthetic-vault-fixture')]);const rl = { ok: true };diff --git a/tests/pump-graduations.test.js b/tests/pump-graduations.test.jsindex e489ef4e4..b7d70f18b 100644--- a/tests/pump-graduations.test.js+++ b/tests/pump-graduations.test.js@@ -1,3 +1,4 @@+import { createHash } from 'node:crypto';import { describe, it, expect, vi } from 'vitest';import bs58 from 'bs58';import { PublicKey } from '@solana/web3.js';@@ -85,6 +86,23 @@ function recordingRedis() {};}+describe('COMPLETE_EVENT_DISCRIMINATOR', () => {+ it('is the Anchor discriminator for CompleteEvent, not a hand-copied constant', () => {+ expect(COMPLETE_EVENT_DISCRIMINATOR).toEqual(+ createHash('sha256').update('event:CompleteEvent').digest().subarray(0, 8),+ );+ });++ it('does not match the trade event that dominates the Pump log stream', () => {+ // bddb7fd34ee661ee is Pump's TradeEvent discriminator: 4559 of the 5019+ // event-carrying entries in a four-minute live capture of the program's+ // logs. Decoding one as a graduation would flood the feed.+ const trade = Buffer.alloc(8 + 32 + 32 + 32 + 8);+ Buffer.from('bddb7fd34ee661ee', 'hex').copy(trade, 0);+ expect(parseCompleteEvent(SIG, [`Program data: ${trade.toString('base64')}`])).toBeNull();+ });+});+describe('parseCompleteEvent', () => {it('decodes the CompleteEvent layout off a real-shaped log line', () => {const ev = parseCompleteEvent(SIG, completeEventEntry().logs);