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(changelog): post releases to the @trythreews X thread again, through a sensitivity filter
oversteppinga6e600617e34
diff --git a/CLAUDE.md b/CLAUDE.mdindex ff1ec27c2..564c648a9 100644--- a/CLAUDE.md+++ b/CLAUDE.md@@ -212,7 +212,7 @@ The three.ws community follows the public changelog (three.ws/changelog, RSS, JS- **New page?** Nothing extra: the `added` date in `data/pages.json` feeds the changelog automatically.- **Everything else users would notice** (feature, improvement, fix, SDK release, security work): append an entry to `data/changelog.json` with date, community-readable title + summary (plain language, no commit jargon), and tags from: feature, improvement, fix, sdk, infra, docs, security. Optional `link` must be a live page path.- `npm run build:pages` regenerates CHANGELOG.md, public/changelog.json, and public/changelog.xml. It also validates your entry and fails the build on a malformed one.-- **Delivery to the community is automatic.** `/api/cron/changelog-push` (Cloud Scheduler, every 20 min) reads the feed baked into the running image, diffs it against DB state (`app_settings`), and posts anything new to the community Telegram channel (`TELEGRAM_CHANGELOG_CHAT_ID`, @three_ws). **X.com delivery is retired** (owner directive 2026-07-18): `pushXLane` and `scripts/changelog-x.mjs` stay in the tree but the cron never calls them, so do not describe X as an automatic changelog lane. @trythreews posts come from the reviewed X content queue instead (`docs/x-content-pipeline.md`). An entry goes out on its own shortly after the deploy that ships it; there is no manual push step. Credentials live on the Cloud Run service. Do NOT run `npm run changelog:push` / `changelog:push:x` for routine releases anymore: their file-based state (`data/changelog-*-state.json`) is separate from the cron's DB state, so a manual push double-posts. The scripts remain for `--dry-run` previews and owner-directed backfills only.+- **Delivery to the community is automatic.** `/api/cron/changelog-push` (Cloud Scheduler, every 20 min) reads the feed baked into the running image, diffs it against DB state (`app_settings`), and posts anything new to two lanes: the community Telegram channel (`TELEGRAM_CHANGELOG_CHAT_ID`, @three_ws) gets every entry, and a reply thread on @trythreews (`pushXLane`) gets every entry that passes `data/changelog-x-filter.json`. That filter keeps a public, unattended feed free of wallet and payment internals, keys, outages, security work, other coins, and bare fixes; extend it there, with a reason, rather than in code. X was retired on 2026-07-18 and turned back on by the owner on 2026-09-24. The three reviewed feature posts a day are a separate pipeline (`docs/x-content-pipeline.md`). An entry goes out on its own shortly after the deploy that ships it; there is no manual push step. Credentials live on the Cloud Run service. Do NOT run `npm run changelog:push` / `changelog:push:x` for routine releases anymore: their file-based state (`data/changelog-*-state.json`) is separate from the cron's DB state, so a manual push double-posts. The scripts remain for `--dry-run` previews and owner-directed backfills only.- Internal-only chores (CI, lockfiles, refactors with no visible effect) do NOT get entries.## Documentation: every feature ships with its docsdiff --git a/api/_lib/changelog-push.js b/api/_lib/changelog-push.jsindex 5ba5caef9..f5c82f775 100644--- a/api/_lib/changelog-push.js+++ b/api/_lib/changelog-push.js@@ -117,7 +117,7 @@ function cutoffDate() {return new Date(Date.now() - CUTOFF_DAYS * 86400000).toISOString().slice(0, 10);}-export function pendingEntries(feed, posted, limit, { newestWin = false } = {}) {+export function pendingEntries(feed, posted, limit, { newestWin = false, accept = () => true } = {}) {const cutoff = cutoffDate();// The posted-set is keyed by entryKey, so it can only suppress an entry that// went out on an EARLIER tick. Two feed entries sharing one key are both@@ -129,7 +129,7 @@ export function pendingEntries(feed, posted, limit, { newestWin = false } = {})// rather than a repeated message to every subscriber.const seen = new Set();const unposted = feed.entries- .filter((e) => !posted.has(entryKey(e)) && e.date >= cutoff && e.type !== 'launch')+ .filter((e) => !posted.has(entryKey(e)) && e.date >= cutoff && e.type !== 'launch' && accept(e)).filter((e) => {const key = entryKey(e);if (seen.has(key)) return false;@@ -234,6 +234,35 @@ export async function pushTelegramLane(feed) {// --- X lane ------------------------------------------------------------------+// The X lane posts to a public feed with no human in the loop, so it only ever+// sees entries that pass data/changelog-x-filter.json: nothing about wallets,+// funds, payment internals, keys, outages, or other coins, and nothing that is+// only a fix or plumbing. Telegram, a community channel, still gets them all.+export function loadXFilter() {+ const filter = JSON.parse(readFileSync(join(process.cwd(), 'data', 'changelog-x-filter.json'), 'utf8'));+ // Projects the owner put under the coin gate for announcements stay off X too.+ const gated = loadRepoState('announce-gate-terms.json')?.terms || [];+ const escape = (t) => t.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');+ for (const term of gated) {+ filter.patterns.push({ pattern: `\\b${escape(term)}\\b`, reason: 'A project name the owner gated in data/announce-gate-terms.json.' });+ }+ return filter;+}++/** @returns {string|null} why the entry must not go to X, or null when it may */+export function xFilterReason(e, filter) {+ const tags = e.tags || [];+ const blocked = tags.find((t) => filter.blockedTags?.[t]);+ if (blocked) return `tag ${blocked}: ${filter.blockedTags[blocked]}`;+ const required = filter.requireAnyTag;+ if (required?.tags?.length && !tags.some((t) => required.tags.includes(t))) return required.reason;+ const text = `${e.title}\n${e.summary}`;+ for (const rule of filter.patterns || []) {+ if (new RegExp(rule.pattern, 'i').test(text)) return rule.reason;+ }+ return null;+}+// X counts every URL as 23 chars (t.co wrapping) and each emoji/astral// codepoint as 2. Compose title + summary + link within the 280 budget,// trimming the summary on a word boundary when it overflows.@@ -318,7 +347,8 @@ export async function pushXLane(feed) {// X is a rate-limited showcase, not the full log: when there is more to say// than the daily budget allows, the newest releases win (as on Telegram),// otherwise a busy week keeps the lane posting entries days late.- const { pending, backlog } = pendingEntries(feed, posted, X_LIMIT, { newestWin: true });+ const filter = loadXFilter();+ const { pending, backlog } = pendingEntries(feed, posted, X_LIMIT, { newestWin: true, accept: (e) => !xFilterReason(e, filter) });if (pending.length === 0) {await saveState(); // persist the pruned 24h windowreturn { posted: 0, backlog };diff --git a/api/cron/changelog-push.js b/api/cron/changelog-push.jsindex 0c5dc62c9..997a24b8b 100644--- a/api/cron/changelog-push.js+++ b/api/cron/changelog-push.js@@ -1,6 +1,6 @@// @ts-check// GET /api/cron/changelog-push - automatic changelog delivery to the community-// Telegram channel.+// Telegram channel and the @trythreews X thread.//// Runs every 20 minutes. Reads the changelog feed baked into the running// image (public/changelog.json, regenerated by every deploy build), diffs it@@ -8,14 +8,18 @@// Because the feed ships inside the image, entries go out shortly after the// deploy that made them live, with no manual `npm run changelog:push` step.//-// X.com delivery is retired (owner directive 2026-07-18): @trythreews posts-// come from the reviewed X content queue (api/cron/x-content.js), not from-// every release. The X lane in api/_lib/changelog-push.js stays but is unused.-// Telegram is the only automatic changelog channel; the on-site changelog,-// RSS feed, and GitHub CHANGELOG.md carry the rest.+// Two lanes, independent of each other:+// Telegram gets every entry.+// X gets every entry that passes data/changelog-x-filter.json (nothing about+// wallets, funds, payment internals, keys, outages, or other coins, and+// nothing that is only a fix), as replies in one thread under a daily cap.+// X was retired on 2026-07-18 and turned back on by the owner on 2026-09-24.+// The reviewed feature posts (three a day) are a separate pipeline,+// api/cron/x-content.js.//// A lane whose credentials are absent reports { skipped: 'not_configured' }.// Telegram: TELEGRAM_BOT_TOKEN + TELEGRAM_CHANGELOG_CHAT_ID+// X: X_API_KEY + X_API_SECRET + X_ACCESS_TOKEN + X_ACCESS_SECRET//// A failing lane answers 502, which wrapCron records as a failed heartbeat, so// a stalled lane turns red on /api/ops/health instead of passing silently.@@ -26,7 +30,7 @@// remain for previews (--dry-run) and backfills only.import { error, json, method, wrapCron } from '../_lib/http.js';-import { acquireLock, releaseLock, loadFeed, pushTelegramLane } from '../_lib/changelog-push.js';+import { acquireLock, releaseLock, loadFeed, pushTelegramLane, pushXLane } from '../_lib/changelog-push.js';import { requireCron } from '../_lib/cron-auth.js';export default wrapCron(async (req, res) => {@@ -48,11 +52,14 @@ export default wrapCron(async (req, res) => {}try {- // A throw (DB outage mid-lane) is reported like any other lane error.- const telegram = await pushTelegramLane(feed).catch((err) => ({ error: String(err?.message || err) }));- const failed = Boolean(telegram.error);- if (failed) console.warn('[cron] changelog-push lane error', { telegram });- json(res, failed ? 502 : 200, { ok: !failed, telegram, x: { skipped: 'retired' } });+ // A throw (DB outage mid-lane) is contained to its own lane and reported+ // like any other lane error, so one lane never stops the other.+ const runLane = (lane) => lane(feed).catch((err) => ({ error: String(err?.message || err) }));+ const telegram = await runLane(pushTelegramLane);+ const x = await runLane(pushXLane);+ const failed = Boolean(telegram.error || x.error);+ if (failed) console.warn('[cron] changelog-push lane error', { telegram, x });+ json(res, failed ? 502 : 200, { ok: !failed, telegram, x });} finally {await releaseLock().catch(() => {});}diff --git a/data/changelog-x-filter.json b/data/changelog-x-filter.jsonnew file mode 100644index 000000000..6e2235d0c--- /dev/null+++ b/data/changelog-x-filter.json@@ -0,0 +1,56 @@+{+ "$comment": "Which changelog entries the automatic X lane (api/_lib/changelog-push.js, pushXLane) must never post. Telegram is unaffected. An entry is skipped when it carries a blocked tag, carries none of the required tags, or when its title or summary matches any pattern (case-insensitive regular expressions). Every rule records why, so removing one is a decision, not a guess. Project names the owner gated in data/announce-gate-terms.json are blocked here too.",+ "blockedTags": {+ "security": "Security work is described on the changelog page, never advertised on a public feed."+ },+ "requireAnyTag": {+ "tags": [+ "feature",+ "improvement",+ "sdk"+ ],+ "reason": "Bare fixes and infra or docs-only entries read as outage notes or plumbing, not as something a reader can use."+ },+ "patterns": [+ {+ "pattern": "\\bx402\\b",+ "reason": "Agent payment rail internals."+ },+ {+ "pattern": "\\bagent economy\\b",+ "reason": "Internal agent-to-agent payment loop."+ },+ {+ "pattern": "\\b(agent|payer|pool|fee|hot|custodial|funding|treasury|brand-new|distinct|seed) wallets?\\b|\\bwallets? (that|which) (cannot|can't) sign\\b",+ "reason": "Agent and platform wallet operations (funding, signing, pools) are sensitive on a public feed."+ },+ {+ "pattern": "\\b(payer|payout|treasury|custod\\w*|fee claims?|settle\\w*|funds?|funded|funding)\\b",+ "reason": "Money movement internals."+ },+ {+ "pattern": "\\b(private key|seed phrase|secret|credential|api key)s?\\b",+ "reason": "Key material."+ },+ {+ "pattern": "\\b(exploit|vulnerab\\w*|leak\\w*|bypass\\w*|drain\\w*|attack\\w*)\\b",+ "reason": "Security surface."+ },+ {+ "pattern": "\\b(outage|downtime|answering again|fail\\w* silently|incident)\\b",+ "reason": "Reliability admissions belong on the changelog page."+ },+ {+ "pattern": "\\breal[- ](funds|money)\\b|\\btransaction protection\\b",+ "reason": "Real-money risk, or copy that reads as advice to lower a protection."+ },+ {+ "pattern": "\\$(?!THREE\\b)[A-Z][A-Z0-9]{1,9}\\b",+ "reason": "$THREE is the only coin the account promotes."+ },+ {+ "pattern": "@trythreews|\\bannouncement (queue|machine)\\b|\\bqueued posts?\\b|\\bpost slots?\\b",+ "reason": "Posts about our own posting machinery."+ }+ ]+}diff --git a/tests/changelog-push.test.js b/tests/changelog-push.test.jsindex afebdd18a..56fae101c 100644--- a/tests/changelog-push.test.js+++ b/tests/changelog-push.test.js@@ -6,6 +6,8 @@ import {formatTweet,weightedLength,classifyXError,+ xFilterReason,+ loadXFilter,pushTelegramLane,pushXLane,} from '../api/_lib/changelog-push.js';@@ -95,6 +97,33 @@ describe('formatTweet', () => {});});+describe('the X filter', () => {+ const filter = loadXFilter();+ const verdict = (over) => xFilterReason(entry(over), filter);++ it('passes a plain product feature', () => {+ expect(verdict({ title: 'Text avatars now wear what you describe', summary: 'Describe an outfit and the avatar wears it.', tags: ['feature'] })).toBeNull();+ });++ it('keeps agent wallets, x402, funds, and keys off X', () => {+ expect(verdict({ title: 'Agents now buy real work from brand-new wallets', tags: ['feature'] })).not.toBeNull();+ expect(verdict({ summary: 'Paid calls settle over x402.', tags: ['feature'] })).not.toBeNull();+ expect(verdict({ summary: 'The pool only pays from wallets that hold funds.', tags: ['improvement'] })).not.toBeNull();+ expect(verdict({ summary: 'Rotate your API keys from the dashboard.', tags: ['feature'] })).not.toBeNull();+ });++ it('skips security work, bare fixes, and plumbing', () => {+ expect(verdict({ tags: ['security', 'feature'] })).not.toBeNull();+ expect(verdict({ tags: ['fix'] })).not.toBeNull();+ expect(verdict({ tags: ['infra', 'docs'] })).not.toBeNull();+ });++ it('allows $THREE and blocks any other ticker', () => {+ expect(verdict({ summary: 'Every coin on the launchpad is bought with $THREE.', tags: ['feature'] })).toBeNull();+ expect(verdict({ summary: 'Now quoting $ABC next to the chart.', tags: ['feature'] })).not.toBeNull();+ });+});+describe('classifyXError', () => {const now = 1_800_000_000_000;