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.

fix(guards): verify CLAUDE.md's documented git remotes actually resolve

nirholas672f327fcc87
diff --git a/CLAUDE.md b/CLAUDE.md
index 29518b62a..94905f66a 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -199,7 +199,7 @@ Three subagents live in `.claude/agents/` and encode checklists you would otherw
This file is the operating brain for every agent here, and agents execute what it says verbatim. A stale line in it does not read as stale, it reads as an instruction, and the cost is a wasted session per drift. Treat it as load-bearing code:
- **`npm run check:rules` enforces the hard rules on the lines you changed** (`scripts/check-rules.mjs`). It reads added lines only, so your change is held to the rules while the legacy around it is left alone: em-dashes, TODO/FIXME comments, not-implemented throws, commented-out code, and `sampleFoo = [...]` fallback arrays all fail it. Because concurrent agents share this worktree, scope it to your own work: `npm run check:rules -- --paths <files you touched>`. It also reads brand-new untracked files, which a bare `git diff` cannot see. It is also enforced mechanically at push time: the pre-push hook (installed into `.git/hooks` by `scripts/setup-git-hooks.mjs`, which `postinstall` runs on every `npm install`) runs it with `--base <remote sha> --head <local sha>` per pushed ref, so it judges exactly the commits leaving the machine and never the shared working tree. Emergency bypass: `SKIP_PUSH_CHECKS=1 git push`. The hook deliberately runs ONLY this diff-scoped check, never `npm run gate` or other worktree-state audits, because those would block a requested push on other agents' in-flight work.
-- **`npm run check:claude` guards it** (`scripts/check-claude-md.mjs`, wired into `npm run gate`). It re-derives the checkable claims from their source of truth on every run: every npm script and repo path named here must exist, the cron count must match `vercel.json`, the deploy runbook must list the real `build:gcp` chain in the real order, the `db:migrate` warning must match what the script actually does, the README-coverage standard must hold, and the em-dash ban must be honored by this file itself. Run it after editing this file.
+- **`npm run check:claude` guards it** (`scripts/check-claude-md.mjs`, wired into `npm run gate`). It re-derives the checkable claims from their source of truth on every run: every npm script and repo path named here must exist, the cron count must match `vercel.json`, the deploy runbook must list the real `build:gcp` chain in the real order, the `db:migrate` warning must match what the script actually does, the README-coverage standard must hold, the remotes documented below must be the ones actually configured (a `git push <remote> main` instruction that does not resolve fails exactly when the owner asked to ship), and the em-dash ban must be honored by this file itself. Run it after editing this file.
- **If you change a load-bearing script, update this file in the same change.** Renaming a script, reordering `build:gcp`, adding a cron, or flipping a default is a documentation change too. The guard will catch most of it; do not make it do your job.
- **Never add a claim here you have not verified.** Numbers, dates, and "X is automatic" statements are the ones that rot. If a claim cannot be checked mechanically, prefer wording that stays true (name the source of truth instead of quoting a number from it).
diff --git a/scripts/check-claude-md.mjs b/scripts/check-claude-md.mjs
index f1db52082..a07b364cc 100644
--- a/scripts/check-claude-md.mjs
+++ b/scripts/check-claude-md.mjs
@@ -20,7 +20,8 @@
// 4. The load-bearing factual claims still hold. These are the ones that
// have actually drifted before and cost a session each: the cron count,
// the build:gcp chain order, the db:migrate safety semantics, the
-// README-coverage standard, and the retired X changelog lane. Each is
+// README-coverage standard, the documented git remotes (the push target
+// must actually resolve), and the retired X changelog lane. Each is
// re-derived from the source of truth on every run, so the doc cannot
// quietly go stale again.
//
@@ -144,6 +145,48 @@ if (coverageGaps.length && /Coverage under `packages\/`, `workers\/`, and `servi
);
}
+// 4f. Git remotes. CLAUDE.md names the push target in an imperative the agent
+// runs verbatim, and on 2026-07-30 this worktree had only `origin`, so that exact
+// command failed. A push instruction that does not resolve is worse than a
+// missing one: it fails at the moment the owner asked to ship. The remote table
+// is also a safety boundary (the retired mirror must never be the target), so a
+// documented URL that no longer matches the configured one has to surface.
+try {
+ const { execFileSync } = await import('node:child_process');
+ const configured = new Map();
+ for (const line of execFileSync('git', ['remote', '-v'], { cwd: root, encoding: 'utf8', stdio: ['ignore', 'pipe', 'ignore'] })
+ .split('\n')
+ .filter(Boolean)) {
+ const [name, url] = line.split(/\s+/);
+ if (name && url && !configured.has(name)) configured.set(name, url);
+ }
+ // Only trust this check when git actually reported a remote set; a bare clone
+ // with none configured is a legitimate state, not doc drift.
+ if (configured.size) {
+ const norm = (u) => u.replace(/\.git$/, '').replace(/\/$/, '');
+ // The remote table: lines like - `name` -> `https://...`
+ const documented = new Map();
+ for (const m of md.matchAll(/^-\s+`([A-Za-z0-9_-]+)`\s*(?:→|->)\s*`(https?:\/\/[^`]+)`/gm)) {
+ documented.set(m[1], m[2]);
+ }
+ const pushTarget = md.match(/git push ([A-Za-z0-9_-]+) main/)?.[1];
+ if (pushTarget && !configured.has(pushTarget)) {
+ failures.push(
+ `CLAUDE.md tells agents to run \`git push ${pushTarget} main\` but no remote named \`${pushTarget}\` is configured ` +
+ `(configured: ${[...configured.keys()].join(', ')}). Add it, or correct the instruction.`,
+ );
+ }
+ for (const [name, url] of documented) {
+ const actual = configured.get(name);
+ if (actual && norm(actual) !== norm(url)) {
+ failures.push(`remote \`${name}\` points at ${actual} but CLAUDE.md documents ${url}`);
+ }
+ }
+ }
+} catch {
+ // No git, or not a repository. Nothing to verify; never fail on that.
+}
+
// 4e. The retired X changelog lane. If the cron ever calls it again, the
// "retired" wording in CLAUDE.md becomes a lie in the other direction.
const cronHandler = path.join(root, 'api/cron/changelog-push.js');