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(x-content): get the weekly partner Article through its gate for single-feature partners and build the runner image without a second copy of the repo
nirholas14d730a829f7
diff --git a/api/_lib/x-content/partners.js b/api/_lib/x-content/partners.jsindex 21672db90..b39b31930 100644--- a/api/_lib/x-content/partners.js+++ b/api/_lib/x-content/partners.js@@ -465,7 +465,7 @@ export function articleFacts(feature, { lead = false } = {}) {// The code and tables, built from the registry and the runs. `runs` holds, per// feature, the proof and (for an API surface) the live response it answered.-export function articleBlocks(partner, runs) {+export function articleBlocks(partner, runs, roster = []) {const blocks = {};blocks.runs = ['| Feature | Filmed on | Length | Read live |',@@ -481,6 +481,8 @@ export function articleBlocks(partner, runs) {if (logged.length) blocks[`log-${feature.id}`] = ['| Step | Did | On | Result | ms |', '|---|---|---|---|---|', ...logged.map((step) => `| ${step.index} | ${step.kind} | ${cell(clip(bare(String(step.target ?? '')), 80))} | ${step.ok ? 'passed' : 'failed'}: ${cell(clip(String(step.detail ?? ''), 90))} | ${step.ms ?? ''} |`)].join('\n');if (live?.body) blocks[`request-${feature.id}`] = `${fence('bash', `curl -s '${live.url}'`)}\n\n${fence(live.json ? 'json' : 'text', clip(live.body, 900))}`;});+ // The registry's view of every partner, for the closing partners section.+ if (roster.length) blocks.partners = ['| Partner | Designation | What three.ws built on it |', '|---|---|---|', ...roster.map((row) => `| ${cell(row.name)} | ${cell(row.designation)} | ${cell(row.features.map((feature) => feature.title).join('; '))} |`)].join('\n');// X caps code and tables per Article; trim the longest code first.const weight = () => Object.values(blocks).reduce((sum, block) => sum + block.length, 0);const trimmable = (key) => (key.startsWith('scenario-') ? 0 : key.startsWith('log-') ? 1 : 2);@@ -496,7 +498,7 @@ export const ARTICLE_SYSTEM = `You write the weekly partner deep dive for @trythYou are given a brief. It is the only source of facts you have. Do not add anything that is not in it, do not guess at numbers, and do not describe behaviour it does not record.The Article:-- A title of {TITLE_MIN} to {TITLE_MAX} characters that names the partner and says what three.ws built; carry a number only if a fact or a measured value holds it.+- A title of {TITLE_MIN} to {TITLE_MAX} characters (aim for about 90 and count them) that names the partner and says what three.ws built; carry a number only if a fact or a measured value holds it.- At least {WORDS} words of prose (code and tables do not count), in at least {SECTIONS} sections, each a "## " heading named for what the reader learns. Open with a friendly paragraph that says what the partner makes possible, then go deep: how each feature works, what a person does with it, what an agent does with it, and how it was checked.- Give every feature in the brief at least one section of its own.- State the relationship once using the designation exactly as the brief gives it, word for word, with the same capitals, and link the partner page. Thank the partner warmly and specifically.@@ -516,7 +518,7 @@ Hard rules, each enforced by a machine after you answer:Answer in exactly this shape and nothing else:TITLE: the title-POST: the post that quotes the Article on X, 150 to 400 characters, naming the partner and saying what the reader will learn, with no link+POST: the post that quotes the Article on X, 150 to 400 characters, naming the partner and saying what the reader will learn; X reads any domain as a link, so write three.ws at most once and no other domain or path---the Article body in Markdown, starting with the opening paragraph (no top-level # title)`;@@ -562,9 +564,12 @@ export function parseArticle(raw) {const post = text.match(/^\s*POST:\s*(.+)$/m)?.[1]?.trim();const split = text.search(/^---\s*$/m);if (!title || !post || split < 0) throw new Error('drafter did not answer in the TITLE / POST / --- shape');- const markdown = text.slice(split).replace(/^---\s*\n/, '').trim();+ // The brand is always lower case, even opening a sentence; that is a fixed+ // rule, not a judgement, so it is applied rather than sent back.+ const brand = (value) => value.replace(/\bThree\.ws\b/g, 'three.ws');+ const markdown = brand(text.slice(split).replace(/^---\s*\n/, '').trim());if (markdown.split(/\s+/).length < 200) throw new Error('drafter returned an Article body under 200 words');- return { title, post, markdown };+ return { title: brand(title), post: brand(post), markdown };}// Replaces the markers with the real blocks and figures. Every block must bediff --git a/deploy/x-partners/Dockerfile b/deploy/x-partners/Dockerfileindex 702a21b75..b51e9e54c 100644--- a/deploy/x-partners/Dockerfile+++ b/deploy/x-partners/Dockerfile@@ -23,18 +23,28 @@ RUN npm install -g npm@${NPM_VERSION}ENV PLAYWRIGHT_BROWSERS_PATH=/ms-playwright \PUPPETEER_SKIP_DOWNLOAD=1-COPY --parents package.json package-lock.json .npmrc* **/package.json /app/-RUN npm ci --ignore-scripts --no-audit --no-fund--# Chromium for the Playwright version the lockfile resolved, with its system libraries.-RUN npx playwright install --with-deps chromium && rm -rf /var/lib/apt/lists/*-# verify.js refuses to film when emoji draw as boxes; this is the font it asks for.RUN curl -sSL -o /usr/share/fonts/truetype/Noto-COLRv1.ttf --create-dirs \https://raw.githubusercontent.com/googlefonts/noto-emoji/main/2D/fonts/Noto-COLRv1.ttf \&& fc-cache -f-COPY . .+# The run writes stories, proofs and media into the tree before bundling them,+# so the tree belongs to the runtime user from the start. Owning it here rather+# than with a closing chown -R keeps the image from carrying the repo twice.+RUN mkdir -p /ms-playwright && chown node:node /app /ms-playwright+USER node++COPY --chown=node:node --parents package.json package-lock.json .npmrc* **/package.json /app/+RUN npm ci --ignore-scripts --no-audit --no-fund++# Chromium's system libraries need root; the browser itself is fetched for the+# exact Playwright version the lockfile resolved.+USER root+RUN npx playwright install-deps chromium && rm -rf /var/lib/apt/lists/*+USER node+RUN npx playwright install chromium++COPY --chown=node:node . .# npm rebuild runs the install hooks skipped above, among them ffmpeg-static's# binary download, which reel.js and the head builder use.RUN npm rebuild && npm run postinstall@@ -43,8 +53,4 @@ ENV NODE_ENV=production \NODE_OPTIONS=--no-deprecation \GOOGLE_CLOUD_PROJECT=aerial-vehicle-466722-p5-# The run writes stories, proofs and media into the tree before bundling them.-RUN chown -R node:node /app-USER node-ENTRYPOINT ["bash", "deploy/x-partners/run.sh"]diff --git a/scripts/x-partners.mjs b/scripts/x-partners.mjsindex 34c573f7b..1f0033639 100644--- a/scripts/x-partners.mjs+++ b/scripts/x-partners.mjs@@ -371,7 +371,7 @@ async function writeArticle({ partner, partners, queue, day, dryRun, ship }) {writeFileSync(resolve(root, cover.path), reelFrame({ root, path: lead.media.path, atSec: Math.max(0.5, (lead.proof.video.durationSec || 2) * 0.6) }));// 3. Draft around the real blocks until the queue's Article gate passes.- const blocks = articleBlocks(partner, runs);+ const blocks = articleBlocks(partner, runs, [...partners].sort((left, right) => left.order - right.order));const tryIt = [...new Set([partner.page, ...runs.map(({ feature }) => feature.surface)])];const brief = buildArticleBrief({ partner, runs, figures, blocks, partnersSection: partnersSection(partners), tryIt });const bodyPath = `data/x-content/articles/${id}.md`;@@ -392,7 +392,7 @@ async function writeArticle({ partner, partners, queue, day, dryRun, ship }) {exemplar: readText('data/x-content/articles/keeper-article.md', 30000),});for (const attempt of result.attempts) {- for (const failure of attempt.fallbacks || []) console.log(` fell through: ${failure.split('\n')[0].slice(0, 160)}`);+ for (const failure of attempt.fallbacks || []) console.log(` fell through: ${failure.replace(/\s+/g, ' ').slice(0, 220)}`);console.log(` draft ${attempt.attempt} on ${attempt.model}: ${attempt.findings.length ? `${attempt.findings.length} finding(s): ${attempt.findings.slice(0, 3).join(' | ')}` : 'passes'}`);}if (!result.ok) return { id, ok: false, reason: `no draft passed the Article gate in ${result.attempts.length} attempts: ${result.findings.slice(0, 4).join('; ')}; the last draft is at ${bodyPath}` };diff --git a/tests/x-content-partners.test.js b/tests/x-content-partners.test.jsindex 35d1ba670..0f0e63bda 100644--- a/tests/x-content-partners.test.js+++ b/tests/x-content-partners.test.js@@ -203,6 +203,9 @@ describe('the weekly Article', () => {expect(blocks['facts-studio']).toMatch(/the run read tools = 15/);expect(blocks['facts-ar']).not.toMatch(/the run counted/);expect(blocks['request-studio']).toContain("curl -s 'https://three.ws/api/tools'");+ const roster = articleBlocks(openai, runs, [openai, nvidia]).partners;+ expect(roster.split('\n')).toHaveLength(4);+ expect(roster).toContain(`| NVIDIA | ${nvidia.designation} |`);const logged = articleBlocks(openai, [{ ...runs[0], proof: { ...runs[0].proof, steps: [{ index: 1, kind: 'goto', target: 'https://three.ws/openai', detail: 'loaded | ok', ok: true, ms: 812 }, { index: 2, kind: 'hold', target: '2500', ok: true, ms: 2500 }] } }]);expect(logged['log-studio']).toBe('| Step | Did | On | Result | ms |\n|---|---|---|---|---|\n| 1 | goto | three.ws/openai | passed: loaded \\| ok | 812 |');const brief = buildArticleBrief({ partner: openai, runs, figures, blocks, partnersSection: ['OpenAI: Select'], tryIt: [openai.page] });@@ -226,6 +229,7 @@ describe('the weekly Article', () => {it('reads the TITLE / POST / body shape and refuses anything else', () => {const words = Array.from({ length: 220 }, () => 'word').join(' ');expect(parseArticle(`TITLE: A title\nPOST: The post\n---\n${words}`)).toEqual({ title: 'A title', post: 'The post', markdown: words });+ expect(parseArticle(`TITLE: Three.ws and IBM\nPOST: Three.ws met\n---\nThree.ws ran it. ${words}`)).toMatchObject({ title: 'three.ws and IBM', post: 'three.ws met', markdown: expect.stringMatching(/^three\.ws ran it/) });expect(() => parseArticle('{"post":"x"}')).toThrow(/TITLE \/ POST/);});