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
docs: add audit:docs integrity guard and wire it into the contributor flow
nirholasd86b0dbc9a7c
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.mdindex 817bf3f3c..a97848369 100644--- a/CONTRIBUTING.md+++ b/CONTRIBUTING.md@@ -116,11 +116,23 @@ See [docs/architecture.md](docs/architecture.md) for a deep dive.npm run typecheck # tsc over the @ts-check'd files — also gates every deploynpm run test:core # vitest unit suitenpm test # vitest + playwright e2e+npm run audit:docs # documentation integrity: dead links, dead routes, dead scripts```If unit tests fail on a fresh clone with module-resolution or missing-fileerrors, run `npm run setup` first.+`audit:docs` is the guard against documentation rot. It walks every Markdown+file in the repo and reports four things: relative links that point at files+which do not exist, site links (`/create`, `/docs/x`) that match no route in+`data/pages.json`, `vercel.json`, `pages/`, or `public/`, commands naming an+npm script or `scripts/*.mjs` file that is gone, and `packages/*` or `workers/*`+directories missing a README. Run it after any change that renames, moves, or+deletes a file, and after adding docs. Fenced code blocks, inline code spans,+external URLs, generated aggregates, and the internal work-order packs under+`prompts/` and `tasks/` are excluded by design; pass an explicit path to audit+one of those anyway. Add `--advisory` to report without a non-zero exit.+### Manual Testing ChecklistBefore submitting a PR, verify:diff --git a/package.json b/package.jsonindex 6e5874716..3fc70c5b2 100644--- a/package.json+++ b/package.json@@ -140,6 +140,7 @@"smoke:mcp": "node scripts/smoke-mcp-remotes.mjs","test:mcp": "node scripts/test-mcp-all.mjs","audit:pages": "node scripts/audit-page-index.mjs",+ "audit:docs": "node scripts/audit-docs.mjs","audit:routes": "node scripts/verify-routes.mjs","audit:handlers": "node scripts/audit-empty-handlers.mjs","audit:x402-catalog": "node scripts/audit-x402-catalog.mjs",diff --git a/packages/agent-sniper/runbooks/PLAN.md b/packages/agent-sniper/runbooks/PLAN.mdindex 239ddfd43..5f93808a9 100644--- a/packages/agent-sniper/runbooks/PLAN.md+++ b/packages/agent-sniper/runbooks/PLAN.md@@ -20,7 +20,7 @@ behind each decision — plus a complete written log of the process.## 2. Principles / hard rules- **No pump.fun Mayhem tokens.** Only normal launches. Enforced on-chain via- `isMayhemMode` (see [scripts/mayhem-filter.js](../scripts/mayhem-filter.js));+ `isMayhemMode` (see [src/mayhem-filter.js](../src/mayhem-filter.js));verified working 2026-07-03. See memory `no-mayhem-pumpfun-tokens`.- **$THREE is the promoted coin.** Agents trade arbitrary runtime mints (thecoin-agnostic exception); no other coin is *promoted*. Commit gate applies to anydiff --git a/scripts/audit-docs.mjs b/scripts/audit-docs.mjsindex c72569c08..5dd1c659b 100644--- a/scripts/audit-docs.mjs+++ b/scripts/audit-docs.mjs@@ -22,10 +22,15 @@* node scripts/audit-docs.mjs --advisory # report findings, always exit 0* node scripts/audit-docs.mjs docs/x.md # audit specific files*- * Deliberately excluded: fenced code blocks (examples may reference files the- * reader creates), external URLs (network-dependent, checked by nobody at build- * time), and generated aggregates (docs/ALL.md, EVERYTHING.md) whose links are- * rewritten by their generator.+ * Deliberately excluded: fenced code blocks and inline code spans (both show+ * the reader templates and examples, not links that must resolve), external+ * URLs (network-dependent), generated aggregates (docs/ALL.md, EVERYTHING.md)+ * whose links are rewritten by their generator, and the internal work-order+ * packs under prompts/ and tasks/. Those packs delete work orders as they are+ * completed (an owner directive, recorded by the retirement notes in each+ * pack's index), so dangling index links there are the documented convention+ * rather than rot. Pass an explicit path to audit them anyway:+ * node scripts/audit-docs.mjs prompts/roadmap/00-README.md*/import { readFileSync, existsSync, readdirSync, statSync } from 'node:fs';import { resolve, dirname, join, relative } from 'node:path';@@ -49,6 +54,10 @@ const SKIP_DIRS = new Set([]);// Generated aggregates: their links are produced by a generator, not authored.const SKIP_FILES = new Set(['docs/ALL.md', 'docs/EVERYTHING.md', 'EVERYTHING.md', 'CHANGELOG.md']);+// Internal work-order packs: completed orders are deleted by design (see the+// retirement notes in each pack index), so their indexes intentionally list+// files that no longer exist. Audited only when named explicitly.+const SKIP_TREES = ['prompts', 'tasks'];const readJson = (p) => JSON.parse(readFileSync(resolve(root, p), 'utf8'));@@ -150,8 +159,11 @@ const auditFile = (file) => {return;}if (inFence) return;+ // Strip inline code spans: `[Title](file.md)` inside backticks is a format+ // template being shown to the reader, not a link that should resolve.+ const scannable = line.replace(/`[^`]*`/g, '');- for (const match of line.matchAll(/\]\(([^)\s]+?)(#[^)\s]*)?\)/g)) {+ for (const match of scannable.matchAll(/\]\(([^)\s]+?)(#[^)\s]*)?\)/g)) {const target = match[1];if (!target || target.startsWith('#')) continue; // same-page anchor, nothing to resolveif (/^([a-z][a-z0-9+.-]*:)/i.test(target)) continue; // external or mailto@@ -169,10 +181,10 @@ const auditFile = (file) => {if (!existsSync(resolve(dir, decoded))) report(file, lineNo, 'dead-link', target);}- for (const match of line.matchAll(/npm run ([a-zA-Z0-9:_-]+)/g)) {+ for (const match of scannable.matchAll(/npm run ([a-zA-Z0-9:_-]+)/g)) {if (!allScriptNames.has(match[1])) report(file, lineNo, 'dead-script', `npm run ${match[1]}`);}- for (const match of line.matchAll(/\bnode (scripts\/[A-Za-z0-9._/-]+)/g)) {+ for (const match of scannable.matchAll(/\bnode (scripts\/[A-Za-z0-9._/-]+)/g)) {// Resolve against the doc's own directory first: a skill or package// doc means its own scripts/ folder, not the repo root's.const local = resolve(dir, match[1]);@@ -185,7 +197,10 @@ const auditFile = (file) => {const targets = explicitFiles.length? explicitFiles.map((f) => resolve(root, f))- : markdownFiles(root);+ : markdownFiles(root).filter((f) => {+ const rel = relative(root, f);+ return !SKIP_TREES.some((tree) => rel === tree || rel.startsWith(`${tree}/`));+ });for (const file of targets) {if (existsSync(file) && statSync(file).isFile()) auditFile(file);