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.

chore(finish): re-verify order 510's per-coin earnings timeline is still migration-blocked

nirholase1538c1b98cb
diff --git a/prompts/finish/510-integrate-11-per-coin-earnings-source.md b/prompts/finish/510-integrate-11-per-coin-earnings-source.md
index ec593c299..f7375fbc7 100644
--- a/prompts/finish/510-integrate-11-per-coin-earnings-source.md
+++ b/prompts/finish/510-integrate-11-per-coin-earnings-source.md
@@ -1,6 +1,6 @@
# integrate 11: reconciled per-coin creator earnings from the coin timeline
-**Evolve status (2026-10-14):** Everything except the production migration apply is done. `fetchCoinEarnings` and `fetchAllShares` are ported into `api/_lib/pump-creator-fees.js` behind the existing circuit breaker (no second client); `api/_lib/creator-earnings-snapshot.js` now reconciles each coin's timeline sum against the wallet-level claimed figure and stores the delta, percentage and source; `api/pump/launch-detail.js` and `api/_lib/agent-earnings.js` serve `distributed` and `reconciliation` alongside the existing wallet-level figures, falling back to a live timeline read when no snapshot row exists; `src/launch-detail.js` and `src/shared/agent-earnings-card.js` render "this coin paid X SOL" with a plain-English reconciliation sentence; `earningsMethod()` names both sources. `tests/pump-creator-fees.test.js` gained 8 new cases (timeline paging/summing, share paging/truncation, reconciliation arithmetic), all passing; a pre-existing, unrelated DDL gap in `tests/agent-earnings-board.test.js` (missing `agent_commerce_invoices` table, from an earlier unrelated commit) was fixed alongside the new columns so that suite's 10 tests pass too. The new migration (`api/_lib/migrations/20261015090000_agent_coin_earnings_timeline.sql`) is written and verified idempotent and syntactically valid via a throwaway PGlite run, and the full `launch-detail.js` handler was proven correct end to end against a PGlite database with both migrations applied and a seeded row, matching the exact JSON shape documented above. It cannot be applied to the real production database from this session (hard-denied), so a live curl against production still returns `creator_fees.distributed: null` until it lands; the query and render logic are verified correct via the PGlite and Playwright route-interception runs described above instead. UI verified at 375/768/1440 with zero console errors via Playwright. See [OWNER-ACTIONS row 63](_context/production-100-OWNER-ACTIONS.md) for the exact migration-apply command and a critical ordering note: the migration must land before this code deploys, or the combined old+new column SQL select throws and the pre-existing enrichment-degrades-to-null wrapper silently drops `economics.creator_fees` to `null` for every coin until it does. Leaving this file in place until that migration lands.
+**Evolve status (2026-10-14, re-verified 2026-10-15):** Everything except the production migration apply is done. `fetchCoinEarnings` and `fetchAllShares` are ported into `api/_lib/pump-creator-fees.js` behind the existing circuit breaker (no second client); `api/_lib/creator-earnings-snapshot.js` now reconciles each coin's timeline sum against the wallet-level claimed figure and stores the delta, percentage and source; `api/pump/launch-detail.js` and `api/_lib/agent-earnings.js` serve `distributed` and `reconciliation` alongside the existing wallet-level figures, falling back to a live timeline read when no snapshot row exists; `src/launch-detail.js` and `src/shared/agent-earnings-card.js` render "this coin paid X SOL" with a plain-English reconciliation sentence; `earningsMethod()` names both sources. `tests/pump-creator-fees.test.js` gained 8 new cases (timeline paging/summing, share paging/truncation, reconciliation arithmetic), all passing; a pre-existing, unrelated DDL gap in `tests/agent-earnings-board.test.js` (missing `agent_commerce_invoices` table, from an earlier unrelated commit) was fixed alongside the new columns so that suite's 10 tests pass too. The new migration (`api/_lib/migrations/20261015090000_agent_coin_earnings_timeline.sql`) is written and verified idempotent and syntactically valid via a throwaway PGlite run, and the full `launch-detail.js` handler was proven correct end to end against a PGlite database with both migrations applied and a seeded row, matching the exact JSON shape documented above. It cannot be applied to the real production database from this session (hard-denied), so a live curl against production still returns `creator_fees.distributed: null` until it lands; the query and render logic are verified correct via the PGlite and Playwright route-interception runs described above instead. UI verified at 375/768/1440 with zero console errors via Playwright. 2026-10-15 re-verification: `npm run db:status` confirms `20261015090000_agent_coin_earnings_timeline.sql` is still `[pending]` against the real production database (10 pending migrations total, none specific to this order applied); `information_schema.columns` on the live `agent_coin_earnings` table confirms the five new columns genuinely do not exist yet; a live local server (`node --env-file=.env.local server/index.mjs`) against the real production DB answered `/api/pump/launch-detail` for a real earning mint with `economics.creator_fees: null` and no 500, confirming the degrade-to-null wrapper behaves exactly as designed while unmigrated; `tests/pump-creator-fees.test.js` and `tests/agent-earnings-board.test.js` re-run clean (24/24); no code or test changes were needed this pass. See [OWNER-ACTIONS row 63](_context/production-100-OWNER-ACTIONS.md) for the exact migration-apply command and a critical ordering note: the migration must land before this code deploys, or the combined old+new column SQL select throws and the pre-existing enrichment-degrades-to-null wrapper silently drops `economics.creator_fees` to `null` for every coin until it does. Leaving this file in place until that migration lands.
How to run: paste this file's repo path into a fresh Claude Code chat in this repository and say "run this work order". Runnable now; one gated step, named below.