Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.
JavaScript 3d-generationai-agentsanimationavatardigital-humangenerative-aiglbgltfimage-to-3dllmmcpmcp-servermodel-context-protocolsolanatext-to-3dthreejsweb-componentswebglwebxrx402
feat: enhance reward resolution and introduce new use cases
qbdz0ab35e8725a4
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex f95c75668..a28b0df36 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -21,6 +21,7 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr- **Documented the full x402 paid-endpoint catalog and where endpoint revenue is recorded** — The developer docs now cover every x402 paid endpoint and the money that flows through them. The endpoint catalog adds the services that had landed without docs — the revenue/analytics report, the avatar batch optimizer, club cover, paid tutoring, the notification gateway, the wallet-connect and Permit2 reference endpoints, the MCP tool catalog — and a new page explains the revenue ledger end to end: how a payment verifies, settles, and is recorded in x402_audit_log, how to read endpoint revenue (with copy-paste SQL and the analytics report shape), how signed receipts work, and why this is the opposite direction of money from the Money Pulse agent-spend feed. The api/x402 directory also gets a README showing how a paid endpoint is built and priced. (`/docs/x402-endpoints`) `[docs]`- **Documented the x402 volume engine and the daily payment reconciliation job** — The developer docs now cover the two newest pieces of the x402 money machine. The Volume Bootstrap Loop — the autonomous sweep that pays every cheap paid endpoint a real on-chain micro-payment to prove it is live — is documented with its per-endpoint proof-of-volume ledger (x402_volume_metrics) and its budget knobs. The docs are explicit that this is synthetic liveness traffic — the platform paying its own endpoints from its own seed wallet — and must not be reported as organic marketplace demand; any published volume or facilitator-ranking number has to exclude the seed wallet. The new daily reconciliation job is documented too: it cross-checks every settlement our books claim against the actual Solana transaction and flags any row the chain does not corroborate, so a silently-failed settlement can't drift our accounting. (`/docs/x402-revenue`) `[docs]`- **Fixed several pages returning a 404** — A handful of pages were built and shipping but had no clean-URL route, so they fell through to the not-found page: the agent wallet (/agent-wallet), the viability report (/viability), and the gallery picker. All now load correctly. The agent wallet, when opened without a specific agent, also shows a clear prompt to pick or create one. (`/viability`) `[fix]`+- **Labor Market disputes can be resolved — moderator escrow override** — Bounty rewards are held in real on-chain escrow, and the happy path settles automatically when a neutral verifier passes the work. For the rare stuck or disputed bounty, a platform moderator can now force the outcome — release the reward to the worker or refund the poster — through an authenticated admin action. The moderator never holds or even sees the escrow wallet's private key; the server signs on their authorization, reusing the exact same payout path (so a moderator override can never double-pay), and a moderator refund never counts against the worker's reputation. (`/labor-market`) `[feature]`- **Marketplace & trading viability get a dedicated page** — The two "honest signal" panels — marketplace viability (real $THREE skill GMV, take-rate, repeat buyers, trading pairs) and trading viability (real guarded coin-trade flow, cost and realized P&L on closed positions) — now live on their own page at /viability. The Money Pulse stays focused on the live event feed and links across to the full viability breakdown, so each surface does one thing well. Same real on-chain numbers, just easier to read and share. (`/viability`) `[improvement]`- **Memory seeding no longer times out** — Building your agent's memory seed from your connected accounts could fail with an opaque error when the language model took a moment to respond — the request was being cut off before it finished and the page showed a generic failure. The synthesis step now has the time it needs to complete, automatically falls over to a backup provider if one is slow, and when it genuinely can't run it tells you plainly instead of failing silently. `[fix]`- **More real money cycling through the agent economy — autonomous x402 throughput raised** — The autonomous loop that makes three.ws an active participant in the agent-to-agent economy now drives more real volume. It processes more ready endpoints per tick (up from 8 to 12) and runs against a higher daily budget ($15, up from $5), so more genuine USDC settlements flow across the catalog each day — every one a real on-chain payment, never a simulation. Per-endpoint cooldowns and the hard daily cap are unchanged, so the extra throughput broadens activity without hammering any single service, and both limits stay tunable at any time. The GLB optimization report is now part of the rotation too, widening the set of endpoints earning real revenue. `[improvement, infra]`diff --git a/api/_lib/launch/usecase-engine.js b/api/_lib/launch/usecase-engine.jsindex e347a65f6..d930150a9 100644--- a/api/_lib/launch/usecase-engine.js+++ b/api/_lib/launch/usecase-engine.js@@ -77,18 +77,28 @@ export function validateUseCase(uc) {/*** Resolve a reward spec (what `uc.rewards(candidate)` returns) into a concrete- * routing the UI can show and the executor can apply. Real DB-backed resolution- * for GitHub identities; pass-through for explicit addresses.+ * routing the UI can show and the executor can apply.+ *+ * `resolve:false` (the default, used by the PUBLIC preview) returns the routing+ * INTENT only — it never touches the DB and never reveals whether a GitHub user+ * has a linked wallet. `resolve:true` (the AUTHED launch path) does the real,+ * DB-backed resolution to a concrete address.+ ** @param {any} spec- * @param {{ network: 'mainnet'|'devnet' }} ctx+ * @param {{ network: 'mainnet'|'devnet', resolve?: boolean }} ctx*/-export async function resolveReward(spec, { network }) {+export async function resolveReward(spec, { network, resolve = false }) {if (!spec || spec.kind === 'creator') {return { kind: 'creator', shareholders: [], claimable_now: true,note: 'Creator fees stay with the launching agent wallet — claim or delegate later from the fees panel.' };}if (spec.kind === 'github-owner') {+ if (!resolve) {+ return { kind: 'github-owner', github_username: spec.github_username || null, github_user_id: spec.github_user_id || null,+ mode: 'pending', claimable_now: false, shareholders: [],+ note: spec.github_username ? `Creator fees route to @${String(spec.github_username).replace(/^@/, '')} — resolved to their wallet (or a social-fee escrow) at launch.` : 'Creator fees route to the GitHub owner at launch.' };+ }const r = await resolveGithubReward({ githubUsername: spec.github_username, githubUserId: spec.github_user_id, network });const shareholders = r.address ? [{ address: r.address, share_bps: 10_000, github_username: r.github_username, mode: r.mode }] : [];return { kind: 'github-owner', github_username: r.github_username, github_user_id: r.github_user_id,@@ -97,6 +107,10 @@ export async function resolveReward(spec, { network }) {if (spec.kind === 'split') {const rows = Array.isArray(spec.shareholders) ? spec.shareholders : [];+ if (!resolve) {+ return { kind: 'split', shareholders: [], claimable_now: false,+ note: `Split across ${rows.length} recipient${rows.length === 1 ? '' : 's'} — resolved at launch.` };+ }const resolved = [];for (const row of rows) {if (row.address) { resolved.push({ address: row.address, share_bps: row.share_bps, mode: 'address' }); continue; }diff --git a/api/_lib/launch/usecases/community.js b/api/_lib/launch/usecases/community.jsnew file mode 100644index 000000000..678b86a41--- /dev/null+++ b/api/_lib/launch/usecases/community.js@@ -0,0 +1,176 @@+// @ts-check+// Community launch use cases — the social surface of the launch catalog. Two+// flavours live here, both real and complete:+//+// 1. Attribution coins for the PEOPLE and PROJECTS a community is built around+// — ecosystem contributors, language communities, and open-source builders.+// The coin is named for a live GitHub subject and its creator fees route to+// that subject (resolved at runtime via the fee-sharing system). Coin-+// agnostic: every subject comes from live GitHub data, never hardcoded.+//+// 2. Cross-source narrative blends that capture community CULTURE — the vibes,+// memes, and shared interests surfacing across multiple trend providers at+// once. These ride a theme; the identity is INVENTED and held to the $THREE+// rule (brand-safe, no external ticker minted verbatim, only $THREE is ever+// the promoted coin).+//+// Each entry is a distinct, fully-wired recipe — the engine does the fetching,+// naming, and reward routing from these declarations.++import { deriveSymbol } from '../usecase-engine.js';++// ── helpers ────────────────────────────────────────────────────────────────────++// Turn a raw theme term into an original Title-Case coin name. Used only by the+// narrative recipes, which must invent a brand-safe identity rather than reuse a+// real ticker. Collapses separators, capitalises each word, caps the length.+function titleCase(raw) {+ const words = String(raw || '')+ .replace(/[\s\-_/.]+/g, ' ')+ .trim()+ .split(' ')+ .filter(Boolean);+ if (!words.length) return 'Community';+ return words+ .map((w) => w.charAt(0).toUpperCase() + w.slice(1).toLowerCase())+ .join(' ')+ .slice(0, 32);+}++// A coin named for a GitHub CREATOR (a community's builders), fees → that creator.+function communityCreatorUseCase({ id, title, description, tags = [], params = {} }) {+ return {+ id,+ title,+ description,+ category: 'community',+ mode: 'attribution',+ tags: ['community', 'creator', 'attribution', 'rewards', ...tags],+ reward_label: 'Creator fees → the GitHub creator',+ source: { kind: 'github-creators', params },+ defaults: { devBuySol: 0, network: 'mainnet' },+ naming: (c) => {+ const login = c.raw?.login || String(c.subject || '').replace(/^@/, '');+ return {+ name: login,+ symbol: deriveSymbol(login, { max: 9 }),+ description: c.description,+ image: c.image,+ };+ },+ rewards: (c) => ({+ kind: 'github-owner',+ github_username: c.attribution?.github_username,+ github_user_id: c.attribution?.github_user_id,+ }),+ };+}++// A coin named for a GitHub REPO (a community's projects), fees → the repo owner.+function communityRepoUseCase({ id, title, description, tags = [], params = {} }) {+ return {+ id,+ title,+ description,+ category: 'community',+ mode: 'attribution',+ tags: ['community', 'repo', 'attribution', 'rewards', ...tags],+ reward_label: 'Creator fees → the repo owner',+ source: { kind: 'github-repos', params },+ defaults: { devBuySol: 0, network: 'mainnet' },+ naming: (c) => ({+ name: c.title || c.raw?.name,+ symbol: deriveSymbol(c.raw?.name || c.title, { max: 9 }),+ description: c.description,+ image: c.image,+ }),+ rewards: (c) => ({+ kind: 'github-owner',+ github_username: c.attribution?.github_username,+ github_user_id: c.attribution?.github_user_id,+ }),+ };+}++// A narrative coin riding cross-source community CULTURE. Identity invented from+// the theme; fees stay with the launching creator.+function communityNarrativeUseCase({ id, title, description, tags = [], params = {} }) {+ return {+ id,+ title,+ description,+ category: 'community',+ mode: 'narrative',+ tags: ['community', 'narrative', 'culture', ...tags],+ reward_label: 'Creator fees',+ source: { kind: 'narratives', params },+ defaults: { devBuySol: 0, network: 'mainnet' },+ naming: (c) => {+ const subject = c.subject || (Array.isArray(c.themes) ? c.themes[0] : '') || c.title;+ const name = titleCase(subject);+ return {+ name,+ symbol: deriveSymbol(subject, { max: 9 }),+ description: `A community coin riding the “${name}” vibe — minted on three.ws as the culture surfaces across the open web.`,+ image: null,+ };+ },+ rewards: () => ({ kind: 'creator' }),+ };+}++// ── catalog ──────────────────────────────────────────────────────────────────────++export const communityUseCases = [+ // (a) Attribution — the people and projects a community rallies behind.+ communityCreatorUseCase({+ id: 'community-ecosystem-contributors',+ title: 'Ecosystem contributors → reward coins',+ description:+ 'Mint a coin for the builders carrying a whole ecosystem forward right now — the contributors whose repos are trending across GitHub. Creator fees route to each builder; they claim by linking a Solana wallet on three.ws.',+ tags: ['contributors', 'ecosystem'],+ params: { window: 'active', sinceDays: 30, minStars: 120 },+ }),+ communityRepoUseCase({+ id: 'community-language-projects',+ title: 'Language-community projects → reward coins',+ description:+ 'Back the flagship projects of a programming-language community. Each trending repo in the language becomes a reward coin for its owner, so a community can fund the work it depends on.',+ tags: ['language', 'projects'],+ params: { window: 'new', sinceDays: 45, minStars: 90 },+ }),+ communityCreatorUseCase({+ id: 'community-open-source-builders',+ title: 'Open-source builders this month',+ description:+ 'The highest-signal open-source builders by trending stars over the last 30 days — one reward coin per person, fees routed to them. Turn community appreciation into real, claimable creator fees.',+ tags: ['builders', 'open-source'],+ params: { window: 'new', sinceDays: 30, minStars: 100 },+ }),++ // (b) Narrative — cross-source community culture blends.+ communityNarrativeUseCase({+ id: 'community-culture-blend',+ title: 'Community culture, cross-sourced',+ description:+ 'Blend what the internet’s communities are actually talking about — pulling shared themes from social, forums, search, and meme culture at once — into an original, brand-safe community coin. Identity is invented; only $THREE is ever the promoted coin.',+ tags: ['blend', 'social'],+ params: { sources: ['reddit', 'hackernews', 'knowyourmeme', 'x'], limit: 12 },+ }),+ communityNarrativeUseCase({+ id: 'community-meme-zeitgeist',+ title: 'The meme zeitgeist',+ description:+ 'The shared jokes and references a community is rallying around, cross-checked across meme culture, search interest, and the broader knowledge web. An original Title-Case identity rides the vibe — never an external ticker.',+ tags: ['meme', 'zeitgeist'],+ params: { sources: ['knowyourmeme', 'googletrends', 'wikipedia', 'reddit'], limit: 12 },+ }),+ communityNarrativeUseCase({+ id: 'community-fandom-pulse',+ title: 'Fandom pulse',+ description:+ 'Where fandoms and interest communities are converging right now — themes surfacing across forums, search trends, and the encyclopedic web, distilled into a fresh, brand-safe community coin.',+ tags: ['fandom', 'interest'],+ params: { sources: ['reddit', 'googletrends', 'wikipedia', 'trending'], limit: 12 },+ }),+];diff --git a/api/_lib/launch/usecases/culture.js b/api/_lib/launch/usecases/culture.jsnew file mode 100644index 000000000..a0c026ab4--- /dev/null+++ b/api/_lib/launch/usecases/culture.js@@ -0,0 +1,138 @@+// @ts-check+// Culture / meme launch use cases — NARRATIVE coins that ride a live cultural+// theme. Unlike the GitHub surface, there is no real subject to reward and no+// external ticker to mint: the engine pulls a brand-safe meme/culture THEME from+// the narrative providers (knowyourmeme, reddit, x) and we INVENT an original+// coin identity from it. This is how the $THREE rule is honoured mechanically —+// the only coin three.ws promotes is $THREE; here we name no other coin, we coin+// a fresh name for a meme and route fees to the creator.+//+// Every entry shares one naming/reward strategy (cultureUseCase) and differs only+// in which providers it blends, how many candidates it pulls, and how it frames+// the meme energy. The engine does the wiring, so each is a real, complete recipe.++import { deriveSymbol } from '../usecase-engine.js';++// Title-Case a raw meme term: split on whitespace/separators, capitalise each+// word, drop empties. Inlined (per spec) — too small to warrant a dependency.+function titleCase(raw) {+ return String(raw || '')+ .split(/[\s\-_/.]+/)+ .filter(Boolean)+ .map((w) => w.charAt(0).toUpperCase() + w.slice(1).toLowerCase())+ .join(' ');+}++// Tasteful coin-name suffixes. We rotate a suffix in by a stable hash of the+// term so the same meme always invents the same name, and so a raw term is never+// minted verbatim as a coin name. Empty string = no suffix (clean title-case).+const NAME_SUFFIXES = ['', 'Coin', 'Wave', 'Szn', 'Mania', 'Hour', 'Energy', 'Core'];++function inventName(subject) {+ const base = titleCase(subject) || 'Meme';+ let h = 0;+ for (let i = 0; i < base.length; i++) h = (h * 31 + base.charCodeAt(i)) >>> 0;+ const suffix = NAME_SUFFIXES[h % NAME_SUFFIXES.length];+ return suffix ? `${base} ${suffix}` : base;+}++// One narrative meme coin: invented name from the theme, fees to the creator.+function cultureUseCase({ id, title, description, tags = [], sources, limit }) {+ return {+ id, title, description, category: 'culture', mode: 'narrative',+ tags: ['culture', 'meme', 'narrative', ...tags],+ reward_label: 'Creator fees',+ source: { kind: 'narratives', params: { sources, ...(limit ? { limit } : {}) } },+ defaults: { devBuySol: 0, network: 'mainnet' },+ naming: (c) => ({+ name: inventName(c.subject),+ symbol: deriveSymbol(c.subject),+ description: `A coin riding the ${c.subject} meme.`,+ image: null,+ }),+ rewards: () => ({ kind: 'creator' }),+ };+}++export const cultureUseCases = [+ cultureUseCase({+ id: 'culture-fresh-memes',+ title: 'Freshest confirmed memes',+ description: 'Named memes just entering culture, straight from Know Your Meme. Mint an original coin the moment a meme gets a name.',+ tags: ['fresh', 'knowyourmeme'],+ sources: ['knowyourmeme'],+ limit: 12,+ }),+ cultureUseCase({+ id: 'culture-reddit-hot',+ title: 'Reddit hot culture',+ description: 'What the front page is laughing at right now — the community pulse, ranked. Ride the joke before it leaves the feed.',+ tags: ['reddit', 'community'],+ sources: ['reddit'],+ limit: 12,+ }),+ cultureUseCase({+ id: 'culture-x-chatter',+ title: 'X chatter, live',+ description: 'Hashtags and entities spiking across X this hour. Catch the meme while the timeline is still posting it.',+ tags: ['x', 'live', 'fast'],+ sources: ['x'],+ limit: 10,+ }),+ cultureUseCase({+ id: 'culture-kym-reddit-blend',+ title: 'Named memes meeting the front page',+ description: 'Memes confirmed on Know Your Meme cross-checked against what Reddit is actually upvoting — named energy with community heat behind it.',+ tags: ['knowyourmeme', 'reddit', 'blend'],+ sources: ['knowyourmeme', 'reddit'],+ limit: 12,+ }),+ cultureUseCase({+ id: 'culture-broad-meme-mix',+ title: 'The broad meme mix',+ description: 'Every culture source at once — Know Your Meme, Reddit, and X blended into one ranked feed of the strongest themes across the internet.',+ tags: ['knowyourmeme', 'reddit', 'x', 'broad'],+ sources: ['knowyourmeme', 'reddit', 'x'],+ limit: 16,+ }),+ cultureUseCase({+ id: 'culture-x-reddit-breakouts',+ title: 'Cross-platform breakouts',+ description: 'Themes spiking on both X and Reddit at the same time — the strongest signal a meme is genuinely breaking out, not just one corner of the web.',+ tags: ['x', 'reddit', 'breakout'],+ sources: ['x', 'reddit'],+ limit: 12,+ }),+ cultureUseCase({+ id: 'culture-kym-x-confirmed',+ title: 'Confirmed and still spiking',+ description: 'Memes that have a Know Your Meme entry and are still trending on X — proven format, live momentum. The sweet spot for a coin.',+ tags: ['knowyourmeme', 'x', 'confirmed'],+ sources: ['knowyourmeme', 'x'],+ limit: 12,+ }),+ cultureUseCase({+ id: 'culture-reddit-deep-cuts',+ title: 'Reddit deep cuts',+ description: 'A wider pull from Reddit for the niche jokes and emerging in-group memes that have not gone mainstream yet — early on the long tail.',+ tags: ['reddit', 'niche', 'early'],+ sources: ['reddit'],+ limit: 20,+ }),+ cultureUseCase({+ id: 'culture-x-rapid-fire',+ title: 'X rapid-fire',+ description: 'A tight, fast feed of the very top X spikes — the few entities the timeline cannot stop posting. Built for launching while a moment is peaking.',+ tags: ['x', 'fast', 'peak'],+ sources: ['x'],+ limit: 6,+ }),+ cultureUseCase({+ id: 'culture-everything-deep',+ title: 'Whole-internet deep scan',+ description: 'The widest possible culture pull — Know Your Meme, Reddit, and X with a deep limit — to surface emerging themes the tighter feeds miss.',+ tags: ['knowyourmeme', 'reddit', 'x', 'deep'],+ sources: ['knowyourmeme', 'reddit', 'x'],+ limit: 24,+ }),+];diff --git a/api/_lib/launch/usecases/events.js b/api/_lib/launch/usecases/events.jsnew file mode 100644index 000000000..76da1c84e--- /dev/null+++ b/api/_lib/launch/usecases/events.js@@ -0,0 +1,111 @@+// @ts-check+// Events launch use cases — narrative coins that ride what the world is paying+// attention to RIGHT NOW. The live surface here is current-moment attention:+// Wikipedia's top pageviews (the people, films, sports, and events everyone is+// looking up) and Google's real-time trending searches (search spikes with+// traffic). Each entry invents an original, brand-safe coin identity from the+// trending subject — it never mints an external project verbatim, never routes+// fees anywhere but the launching agent (creator fees), and stays celebratory.+//+// $THREE is the only coin this platform promotes. These recipes only ever read+// real-world attention (sports, releases, launches, cultural moments) and the+// engine already filters sensitive terms — the framing below stays neutral and+// upbeat so a launched coin reads as a moment, never a tragedy.++import { deriveSymbol } from '../usecase-engine.js';++/** Title-Case a free-form trending term: each word capitalised, whitespace collapsed. */+function titleCase(raw) {+ return String(raw || '')+ .replace(/[_/]+/g, ' ')+ .replace(/\s+/g, ' ')+ .trim()+ .split(' ')+ .filter(Boolean)+ .map((w) => w.charAt(0).toUpperCase() + w.slice(1))+ .join(' ');+}++// One shared narrative strategy: invent a Title-Case name from the subject (an+// optional tasteful suffix gives the coin a distinct identity instead of the+// bare term), derive a ticker via the engine helper, and keep fees with the+// creator. Each use case differs only in its live source mix, limit, and framing.+function eventsUseCase({ id, title, description, tags = [], sources, limit, suffix = '' }) {+ return {+ id,+ title,+ description,+ category: 'events',+ mode: 'narrative',+ tags: ['events', 'trending', 'narrative', ...tags],+ reward_label: 'Creator fees',+ source: { kind: 'narratives', params: limit ? { sources, limit } : { sources } },+ defaults: { devBuySol: 0, network: 'mainnet' },+ naming: (c) => {+ const base = titleCase(c.subject) || 'Moment';+ const name = suffix ? `${base} ${suffix}` : base;+ return {+ name,+ symbol: deriveSymbol(c.subject),+ description: `A coin riding the ${c.subject} moment.`,+ image: null,+ };+ },+ rewards: (c) => ({ kind: 'creator' }),+ };+}++export const eventsUseCases = [+ eventsUseCase({+ id: 'events-wikipedia-top-today',+ title: 'Top of Wikipedia today',+ description: 'The people, films, and events the world is reading about right now, ranked by today\'s Wikipedia pageviews. Each becomes an original, brand-safe coin riding the moment.',+ tags: ['wikipedia', 'attention', 'today'],+ sources: ['wikipedia'],+ limit: 12,+ }),+ eventsUseCase({+ id: 'events-search-spikes-now',+ title: 'Live Google search spikes',+ description: 'Real-time trending Google searches with traffic behind them — the queries spiking this minute. Mint a coin the moment a topic catches fire.',+ tags: ['googletrends', 'search', 'realtime'],+ sources: ['googletrends'],+ limit: 12,+ suffix: 'Wave',+ }),+ eventsUseCase({+ id: 'events-world-attention-blend',+ title: 'World attention, blended',+ description: 'Wikipedia\'s most-viewed pages and Google\'s top searches, fused into one feed of what the planet is collectively focused on. Broad coverage, the highest-signal moments first.',+ tags: ['wikipedia', 'googletrends', 'blend', 'global'],+ sources: ['wikipedia', 'googletrends'],+ limit: 16,+ }),+ eventsUseCase({+ id: 'events-tight-headliners',+ title: 'Today\'s headliners only',+ description: 'A tight shortlist of the single biggest moments across Wikipedia and Google right now — fewer picks, every one a genuine headliner worth a coin.',+ tags: ['wikipedia', 'googletrends', 'curated', 'top'],+ sources: ['wikipedia', 'googletrends'],+ limit: 5,+ suffix: 'Moment',+ }),+ eventsUseCase({+ id: 'events-encyclopedia-moments',+ title: 'Wikipedia moments, expanded',+ description: 'A wider sweep of Wikipedia\'s trending pages — beyond the obvious top few into the deep cut subjects quietly surging in readership. Each minted as its own celebratory coin.',+ tags: ['wikipedia', 'discovery', 'deep'],+ sources: ['wikipedia'],+ limit: 20,+ suffix: 'Day',+ }),+ eventsUseCase({+ id: 'events-breakout-searches',+ title: 'Breakout searches, search-first',+ description: 'Google\'s freshest breakout queries leading, reinforced by Wikipedia\'s most-read pages — the fastest-moving cultural moments of the day turned into original coins.',+ tags: ['googletrends', 'wikipedia', 'breakout', 'culture'],+ sources: ['googletrends', 'wikipedia'],+ limit: 14,+ suffix: 'Rush',+ }),+];diff --git a/api/_lib/launch/usecases/news.js b/api/_lib/launch/usecases/news.jsnew file mode 100644index 000000000..62e0500b4--- /dev/null+++ b/api/_lib/launch/usecases/news.js@@ -0,0 +1,138 @@+// @ts-check+// News launch use cases — the CURRENT-ATTENTION surface. These are narrative-mode+// coins that ride what the world is reading, searching, and building RIGHT NOW.+// Every subject is a live theme pulled from real attention signals: Hacker News+// (tech/internet zeitgeist), Google Trends (broad real-time search surges), and+// Wikipedia (top pageviews — what people are looking up). No headline, term, or+// trend is ever hardcoded; the narrative engine supplies them at runtime.+//+// Narrative mode means the coin IDENTITY is INVENTED. We never mint an external+// term verbatim as a ticker, and we never reference any specific external crypto+// project, coin, token, or mint. The only promoted coin is $THREE. Here we work+// strictly with themes and headlines, turning a trending subject into an original,+// brand-safe coin name and letting the engine's $THREE hygiene gate (isSensitive /+// normTerm in usecase-engine.js) drop anything unsafe.++import { deriveSymbol } from '../usecase-engine.js';++/** Title-Case a free-form trending subject so it reads as a coin name, not a slug. */+function titleCase(raw) {+ return String(raw || '')+ .replace(/[_\-/]+/g, ' ')+ .replace(/\s+/g, ' ')+ .trim()+ .split(' ')+ .filter(Boolean)+ .map((w) => w.charAt(0).toUpperCase() + w.slice(1).toLowerCase())+ .join(' ');+}++/**+ * Build a news/narrative use case. `suffix` lets each recipe invent a distinct,+ * original coin name from the same trending subject (e.g. "X Index", "X Wave") so+ * we never reuse a raw external term as the coin's identity verbatim.+ */+function newsUseCase({ id, title, description, tags = [], sources, limit = 12, suffix = '' }) {+ return {+ id,+ title,+ description,+ category: 'news',+ mode: 'narrative',+ tags: ['news', 'narrative', 'attention', ...tags],+ reward_label: 'Creator fees',+ source: { kind: 'narratives', params: { sources, limit } },+ defaults: { devBuySol: 0, network: 'mainnet' },+ naming: (c) => {+ const base = titleCase(c.subject || c.title);+ const name = suffix ? `${base} ${suffix}` : base;+ return {+ name,+ symbol: deriveSymbol(c.subject),+ description: `A coin riding the ${c.subject} story.`,+ image: null,+ };+ },+ rewards: (c) => ({ kind: 'creator' }),+ };+}++export const newsUseCases = [+ newsUseCase({+ id: 'news-hn-zeitgeist',+ title: 'Hacker News front-page zeitgeist',+ description:+ 'The tech and internet conversation as it happens — invent an original coin for whatever is climbing the Hacker News front page right now. Themes only, never the source verbatim.',+ tags: ['hackernews', 'tech', 'zeitgeist'],+ sources: ['hackernews'],+ limit: 12,+ }),+ newsUseCase({+ id: 'news-google-search-surge',+ title: 'Google search surges',+ description:+ 'Whatever the world is suddenly searching for, turned into a fresh coin name. Tracks broad real-time Google Trends spikes across news, culture, and sport.',+ tags: ['googletrends', 'search', 'breakout'],+ sources: ['googletrends'],+ limit: 12,+ suffix: 'Surge',+ }),+ newsUseCase({+ id: 'news-wikipedia-top-events',+ title: 'Wikipedia top events',+ description:+ 'What the world is actually reading up on — coins invented from the most-viewed Wikipedia pages of the moment. The deepest, least-noisy signal of public attention.',+ tags: ['wikipedia', 'pageviews', 'events'],+ sources: ['wikipedia'],+ limit: 12,+ suffix: 'Index',+ }),+ newsUseCase({+ id: 'news-search-and-read',+ title: 'Search-and-read blend',+ description:+ 'Where what people search meets what they read — a blend of Google Trends surges and Wikipedia top pageviews, distilled into original coin names with real staying power.',+ tags: ['googletrends', 'wikipedia', 'blend'],+ sources: ['googletrends', 'wikipedia'],+ limit: 16,+ }),+ newsUseCase({+ id: 'news-tech-meets-mainstream',+ title: 'Tech meets mainstream',+ description:+ 'The crossover stories breaking out of the tech bubble into mass attention — Hacker News momentum blended with Google search surges, named as fresh coins.',+ tags: ['hackernews', 'googletrends', 'crossover'],+ sources: ['hackernews', 'googletrends'],+ limit: 16,+ suffix: 'Wave',+ }),+ newsUseCase({+ id: 'news-builder-attention',+ title: 'Builder attention radar',+ description:+ 'What technical people are reading and looking up — Hacker News front-page themes paired with Wikipedia top pageviews to surface durable, builder-relevant narratives.',+ tags: ['hackernews', 'wikipedia', 'builders'],+ sources: ['hackernews', 'wikipedia'],+ limit: 14,+ suffix: 'Signal',+ }),+ newsUseCase({+ id: 'news-everything-trending',+ title: 'Everything trending right now',+ description:+ 'The widest possible read on public attention — Hacker News, Google Trends, and Wikipedia fused into one ranked feed of invented coin names. The full pulse of the moment.',+ tags: ['hackernews', 'googletrends', 'wikipedia', 'firehose'],+ sources: ['hackernews', 'googletrends', 'wikipedia'],+ limit: 24,+ }),+ newsUseCase({+ id: 'news-front-page-picks',+ title: 'Front-page picks',+ description:+ 'A tight, high-conviction shortlist from the broadest attention sources — the top handful of trending themes across HN, Google, and Wikipedia, each minted as an original coin.',+ tags: ['hackernews', 'googletrends', 'wikipedia', 'curated'],+ sources: ['hackernews', 'googletrends', 'wikipedia'],+ limit: 8,+ suffix: 'Daily',+ }),+];diff --git a/api/_lib/launch/usecases/onchain.js b/api/_lib/launch/usecases/onchain.jsnew file mode 100644index 000000000..947c356a7--- /dev/null+++ b/api/_lib/launch/usecases/onchain.js@@ -0,0 +1,129 @@+// @ts-check+// Onchain launch use cases — NARRATIVE coins minted from the venue's own live+// signal. Instead of pointing at a project, these recipes mine what's actually+// breaking out on pump.fun right now (high-quality coin categories/tags via+// coin_intel, and oracle conviction-scored hot sectors via trending) and turn+// each surfaced THEME into an original, brand-safe coin identity.+//+// $THREE brand-safety rule (mechanically enforced by the engine): narrative mode+// never mints an external ticker verbatim. We only ever read back a cultural /+// sector THEME term and INVENT a Title-Case coin name from it. No specific coin,+// token, mint, or project is referenced anywhere in this file — $THREE is the+// only coin three.ws promotes, and these recipes name none other.++import { deriveSymbol } from '../usecase-engine.js';++// Small, inlined Title-Case helper — capitalises each word of a theme term and+// collapses whitespace, so a raw narrative term becomes a clean coin name.+function titleCase(raw) {+ return String(raw || '')+ .replace(/\s+/g, ' ')+ .trim()+ .split(' ')+ .filter(Boolean)+ .map((w) => w.charAt(0).toUpperCase() + w.slice(1))+ .join(' ');+}++// Shared narrative recipe builder. Every onchain use case differs only in its+// live query (which providers, how many, which categories) and its framing —+// the naming + reward strategy is identical, so each entry is a complete recipe.+//+// `suffix` is an optional tasteful themed word appended to the invented name to+// give the coin its own identity rather than echoing the bare theme term.+function onchainUseCase({ id, title, description, tags = [], suffix = '', params }) {+ return {+ id,+ title,+ description,+ category: 'onchain',+ mode: 'narrative',+ tags: ['onchain', 'narrative', 'pumpfun', ...tags],+ reward_label: 'Creator fees',+ source: { kind: 'narratives', params },+ defaults: { devBuySol: 0, network: 'mainnet' },+ naming: (c) => {+ const base = titleCase(c.subject);+ const name = suffix && base ? `${base} ${suffix}` : base;+ return {+ name,+ symbol: deriveSymbol(c.subject),+ description: `A coin riding the ${c.subject} narrative.`,+ image: null,+ };+ },+ rewards: () => ({ kind: 'creator' }),+ };+}++export const onchainUseCases = [+ onchainUseCase({+ id: 'onchain-breakout-narratives',+ title: 'Pump.fun breakout narratives',+ description:+ 'Reads the categories and tags of the highest-quality coins breaking out on the venue in the last 24 hours, then mints an original coin for each surfaced theme. Pure venue signal, no project named.',+ tags: ['breakout', 'coin-intel', '24h'],+ params: { sources: ['coin_intel'], limit: 10 },+ }),+ onchainUseCase({+ id: 'onchain-oracle-hot-sectors',+ title: 'Oracle hot sectors',+ description:+ 'Rides the conviction-scored sectors the trending oracle ranks hottest right now. Each hot sector becomes a clean, invented coin — back the theme, not any one ticker.',+ tags: ['oracle', 'trending', 'sectors'],+ suffix: 'Sector',+ params: { sources: ['trending'], limit: 10 },+ }),+ onchainUseCase({+ id: 'onchain-blended-momentum',+ title: 'Blended onchain momentum',+ description:+ 'Combines fresh coin-intel breakouts with oracle conviction into one momentum feed, surfacing the themes both signals agree on. Mints an original coin per blended narrative.',+ tags: ['blended', 'momentum'],+ params: { sources: ['coin_intel', 'trending'], limit: 12 },+ }),+ onchainUseCase({+ id: 'onchain-high-conviction-top',+ title: 'High-conviction top sectors',+ description:+ 'A tight, high-conviction subset — only the five strongest oracle-ranked sectors of the moment — so each coin rides a theme with real weight behind it.',+ tags: ['high-conviction', 'oracle', 'top5'],+ suffix: 'Index',+ params: { sources: ['trending'], limit: 5 },+ }),+ onchainUseCase({+ id: 'onchain-fresh-tags',+ title: 'Fresh venue tags',+ description:+ 'Mines the raw category tags attached to quality coins breaking out in the last day and turns the freshest tags into invented coins — catch a narrative as the venue starts labelling it.',+ tags: ['tags', 'coin-intel', 'fresh'],+ suffix: 'Tag',+ params: { sources: ['coin_intel'], limit: 12 },+ }),+ onchainUseCase({+ id: 'onchain-ai-agent-narratives',+ title: 'Onchain AI & agent narratives',+ description:+ 'Focuses the venue signal on the AI and autonomous-agent themes surfacing across both feeds, minting an original coin for each. The sector three.ws lives in, read live.',+ tags: ['ai', 'agents', 'sector'],+ params: { sources: ['coin_intel', 'trending'], categories: ['ai', 'agents'], limit: 8 },+ }),+ onchainUseCase({+ id: 'onchain-degen-meta',+ title: 'Onchain degen meta',+ description:+ 'The fast-moving meme and culture themes the oracle scores hottest, framed as a degen meta watchlist. Each surfaced theme becomes a brand-safe, invented coin.',+ tags: ['meme', 'culture', 'oracle', 'meta'],+ suffix: 'Meta',+ params: { sources: ['trending'], categories: ['meme', 'culture'], limit: 10 },+ }),+ onchainUseCase({+ id: 'onchain-wide-radar',+ title: 'Wide onchain radar',+ description:+ 'A broad sweep across both venue providers with no category filter — the widest net of onchain narratives, surfacing emerging themes before they consolidate. One invented coin per theme.',+ tags: ['radar', 'blended', 'wide'],+ suffix: 'Wave',+ params: { sources: ['coin_intel', 'trending'], limit: 20 },+ }),+];diff --git a/api/pump/launch-studio.js b/api/pump/launch-studio.jsnew file mode 100644index 000000000..8ff1c9591--- /dev/null+++ b/api/pump/launch-studio.js@@ -0,0 +1,52 @@+// GET /api/pump/launch-studio?action=list[&category=&mode=]+// GET /api/pump/launch-studio?action=preview&id=<useCaseId>[&limit=&network=]+// ------------------------------------------------------------------------------+// Read API for the Launch Studio — the catalog of coin-launch use cases and a+// LIVE preview of what each would mint right now. Public + rate-limited:+// list → every use case as a summary (id, title, category, mode, tags).+// preview → runs the use case against live data (GitHub trending / narrative+// engine) and returns a concrete launch plan: coin identities + the+// reward-routing INTENT for each candidate.+//+// Reward resolution here is INTENT-ONLY (engine resolveRewards defaults to false)+// so the public endpoint never touches the DB or reveals whether a GitHub user+// has a linked wallet. The concrete address is resolved on the authed launch path+// (resolve-github-shareholder / fee-sharing-agent) when a user actually mints.++import { cors, json, method, wrap, error, rateLimited } from '../_lib/http.js';+import { limits, clientIp } from '../_lib/rate-limit.js';+import { listUseCases, getUseCase, categories, USE_CASE_COUNT } from '../_lib/launch/registry.js';+import { planLaunch } from '../_lib/launch/usecase-engine.js';++export default wrap(async (req, res) => {+ if (cors(req, res, { methods: 'GET,OPTIONS', origins: '*' })) return;+ if (!method(req, res, ['GET'])) return;++ const rl = await limits.authIp(clientIp(req));+ if (!rl.success) return rateLimited(res, rl);++ const url = new URL(req.url, `http://${req.headers.host}`);+ const action = url.searchParams.get('action') || 'list';++ if (action === 'list') {+ const category = url.searchParams.get('category') || undefined;+ const mode = url.searchParams.get('mode') || undefined;+ return json(res, 200, {+ count: USE_CASE_COUNT,+ categories: categories(),+ use_cases: listUseCases({ category, mode }),+ }, { 'cache-control': 'public, max-age=60, s-maxage=300' });+ }++ if (action === 'preview') {+ const id = url.searchParams.get('id');+ const uc = id ? getUseCase(id) : null;+ if (!uc) return error(res, 404, 'not_found', 'unknown use case id');+ const limit = Math.max(1, Math.min(12, parseInt(url.searchParams.get('limit') || '6', 10) || 6));+ const network = url.searchParams.get('network') === 'devnet' ? 'devnet' : 'mainnet';+ const plan = await planLaunch(uc, { limit, network });+ return json(res, 200, plan, { 'cache-control': 'public, max-age=30, s-maxage=120' });+ }++ return error(res, 400, 'bad_request', "unknown action — use 'list' or 'preview'");+});diff --git a/public/changelog.json b/public/changelog.jsonindex 035dd91de..246111425 100644--- a/public/changelog.json+++ b/public/changelog.json@@ -1,5 +1,5 @@{- "generated_at": "2026-06-30T23:27:47.484Z",+ "generated_at": "2026-06-30T23:44:53.117Z","generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json","site": {"name": "three.ws",@@ -159,6 +159,16 @@"fix"]},+ {+ "date": "2026-06-30",+ "type": "update",+ "title": "Labor Market disputes can be resolved — moderator escrow override",+ "summary": "Bounty rewards are held in real on-chain escrow, and the happy path settles automatically when a neutral verifier passes the work. For the rare stuck or disputed bounty, a platform moderator can now force the outcome — release the reward to the worker or refund the poster — through an authenticated admin action. The moderator never holds or even sees the escrow wallet's private key; the server signs on their authorization, reusing the exact same payout path (so a moderator override can never double-pay), and a moderator refund never counts against the worker's reputation.",+ "link": "/labor-market",+ "tags": [+ "feature"+ ]+ },{"date": "2026-06-30","type": "update",diff --git a/public/changelog.xml b/public/changelog.xmlindex 8f05ed2a6..0ecb7cdd3 100644--- a/public/changelog.xml+++ b/public/changelog.xml@@ -126,6 +126,14 @@<category>fix</category><description>A handful of pages were built and shipping but had no clean-URL route, so they fell through to the not-found page: the agent wallet (/agent-wallet), the viability report (/viability), and the gallery picker. All now load correctly. The agent wallet, when opened without a specific agent, also shows a clear prompt to pick or create one.</description></item>+ <item>+ <title>Labor Market disputes can be resolved — moderator escrow override</title>+ <link>https://three.ws/labor-market</link>+ <guid isPermaLink="false">2026-06-30:Labor Market disputes can be resolved — moderator escrow override</guid>+ <pubDate>Tue, 30 Jun 2026 12:00:00 GMT</pubDate>+ <category>feature</category>+ <description>Bounty rewards are held in real on-chain escrow, and the happy path settles automatically when a neutral verifier passes the work. For the rare stuck or disputed bounty, a platform moderator can now force the outcome — release the reward to the worker or refund the poster — through an authenticated admin action. The moderator never holds or even sees the escrow wallet's private key; the server signs on their authorization, reusing the exact same payout path (so a moderator override can never double-pay), and a moderator refund never counts against the worker's reputation.</description>+ </item><item><title>Marketplace & trading viability get a dedicated page</title><link>https://three.ws/viability</link>diff --git a/public/features.json b/public/features.jsonindex 9236f678f..52bdbfd73 100644--- a/public/features.json+++ b/public/features.json@@ -1,5 +1,5 @@{- "generated_at": "2026-06-30T23:27:47.464Z",+ "generated_at": "2026-06-30T23:44:53.101Z","generated_by": "scripts/build-page-index.mjs from data/pages.json","site": {"name": "three.ws",diff --git a/tests/launch-usecases.test.js b/tests/launch-usecases.test.jsnew file mode 100644index 000000000..a9f0e06d0--- /dev/null+++ b/tests/launch-usecases.test.js@@ -0,0 +1,101 @@+import { describe, it, expect } from 'vitest';+import {+ cleanName, deriveSymbol, cleanDescription, validateUseCase, resolveReward, summarizeUseCase,+} from '../api/_lib/launch/usecase-engine.js';+import { listUseCases, getUseCase, categories, USE_CASE_COUNT, allUseCases } from '../api/_lib/launch/registry.js';++describe('identity helpers', () => {+ it('cleanName collapses whitespace and caps at 32 chars', () => {+ expect(cleanName(' hello world ')).toBe('hello world');+ expect(cleanName('x'.repeat(40))).toHaveLength(32);+ });+ it('deriveSymbol acronyms multi-word, compacts single-word, uppercases, clamps', () => {+ expect(deriveSymbol('Deep Spec Engine')).toBe('DSE');+ expect(deriveSymbol('widget')).toBe('WIDGET');+ expect(deriveSymbol('a-really-long-project-name')).toBe('ARLPN'); // acronym of the words+ expect(deriveSymbol('supercalifragilisticexpialidocious')).toHaveLength(8); // single word, clamped to default max+ expect(deriveSymbol('supercalifragilistic', { max: 9 })).toHaveLength(9);+ expect(deriveSymbol('')).toBe('COIN');+ expect(deriveSymbol('!!!')).toBe('COIN');+ });+ it('cleanDescription caps at 500 chars', () => {+ expect(cleanDescription('y'.repeat(600))).toHaveLength(500);+ });+});++describe('validateUseCase', () => {+ const ok = {+ id: 'sample-uc', title: 'T', description: 'D', category: 'github', mode: 'attribution',+ source: { kind: 'github-repos' }, naming: () => ({}), rewards: () => ({}),+ };+ it('accepts a well-formed use case', () => {+ expect(validateUseCase(ok)).toBe(true);+ });+ it('rejects a bad id', () => {+ expect(() => validateUseCase({ ...ok, id: 'X' })).toThrow(/invalid id/);+ });+ it('rejects an unknown category and mode', () => {+ expect(() => validateUseCase({ ...ok, category: 'nope' })).toThrow(/invalid category/);+ expect(() => validateUseCase({ ...ok, mode: 'nope' })).toThrow(/invalid mode/);+ });+ it('requires naming and rewards to be functions', () => {+ expect(() => validateUseCase({ ...ok, naming: 'x' })).toThrow(/naming must be a function/);+ expect(() => validateUseCase({ ...ok, rewards: null })).toThrow(/rewards must be a function/);+ });+});++describe('resolveReward (shallow / public preview — no DB)', () => {+ const ctx = { network: 'mainnet' }; // resolve defaults to false+ it('creator spec stays with the creator', async () => {+ const r = await resolveReward({ kind: 'creator' }, ctx);+ expect(r.kind).toBe('creator');+ expect(r.shareholders).toEqual([]);+ });+ it('github-owner returns intent only, never a DB address', async () => {+ const r = await resolveReward({ kind: 'github-owner', github_username: 'nirholas' }, ctx);+ expect(r.kind).toBe('github-owner');+ expect(r.mode).toBe('pending');+ expect(r.shareholders).toEqual([]);+ expect(r.note).toMatch(/@nirholas/);+ });+ it('address spec passes through to a fixed recipient', async () => {+ const r = await resolveReward({ kind: 'address', address: 'A'.repeat(44), share_bps: 10000 }, ctx);+ expect(r.kind).toBe('address');+ expect(r.shareholders[0].address).toBe('A'.repeat(44));+ });+ it('split returns the recipient count as intent', async () => {+ const r = await resolveReward({ kind: 'split', shareholders: [{ github_username: 'a' }, { github_username: 'b' }] }, ctx);+ expect(r.kind).toBe('split');+ expect(r.note).toMatch(/2 recipients/);+ });+});++describe('registry integrity', () => {+ it('holds exactly 50 use cases with unique ids', () => {+ expect(USE_CASE_COUNT).toBe(50);+ const ids = allUseCases().map((u) => u.id);+ expect(new Set(ids).size).toBe(ids.length);+ });+ it('every use case validates and summarizes with required fields', () => {+ for (const uc of allUseCases()) {+ expect(validateUseCase(uc)).toBe(true);+ const s = summarizeUseCase(uc);+ expect(s.id).toBeTruthy();+ expect(s.title).toBeTruthy();+ expect(s.description).toBeTruthy();+ expect(['github', 'culture', 'news', 'onchain', 'events', 'community']).toContain(s.category);+ expect(['attribution', 'narrative']).toContain(s.mode);+ }+ });+ it('covers all six categories', () => {+ expect(categories().sort()).toEqual(['community', 'culture', 'events', 'github', 'news', 'onchain']);+ });+ it('lists are filterable by category and mode', () => {+ expect(listUseCases({ category: 'github' }).every((u) => u.category === 'github')).toBe(true);+ expect(listUseCases({ mode: 'attribution' }).every((u) => u.mode === 'attribution')).toBe(true);+ });+ it('getUseCase returns an object for a known id and null otherwise', () => {+ expect(getUseCase('github-trending-repos')).toBeTruthy();+ expect(getUseCase('does-not-exist')).toBeNull();+ });+});