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.

guards(model-viewer): stop the pin guard tripping on its own proof fixture

nirholasb40970bc58a0
diff --git a/data/guards.json b/data/guards.json
index bff1eeffc..dda877a53 100644
--- a/data/guards.json
+++ b/data/guards.json
@@ -1203,7 +1203,7 @@
"npm": "check:model-viewer",
"title": "One <model-viewer> build across the whole tree",
"protects": "Every model-viewer URL in tracked source names the same version, no version is served under two different integrity hashes, and the vendored copy under pages/ibm/vendor/ hashes to the build the rest of the tree points at.",
- "why": "model-viewer registers itself as a custom element, so a second customElements.define for it in one document throws and the later surface renders nothing at all. A three.ws embed pasted onto a page that already carries another three.ws surface is exactly that document, so a split pin is a blank viewer for somebody else, on their site, with nothing failing on ours. It had already drifted: eight of eighty-one references sat a major version behind, two of them still carrying SRI hashes for the older build, which is the shape a half-finished bump leaves. Delivery legitimately differs per surface (a top-level document pins SRI, a server-interpolated embed cannot, the Vite pages walk a CDN failover chain); the version never does.",
+ "why": "model-viewer registers itself as a custom element, so a second customElements.define for it in one document throws and the later surface renders nothing at all. A three.ws embed pasted onto a page that already carries another three.ws surface is exactly that document, so a split pin is a blank viewer for somebody else, on their site, with nothing failing on ours. It had already drifted: eight of eighty-one references sat a major version behind. Integrity is checked alongside the version because the usual way a bump goes wrong is half-finished, the URL moved and its SRI hash left pointing at the old build, which browsers refuse outright. Delivery legitimately differs per surface (a top-level document pins SRI, a server-interpolated embed cannot, the Vite pages walk a CDN failover chain); the version never does.",
"stages": [
"gate"
],
diff --git a/public/guards.json b/public/guards.json
index bff1eeffc..dda877a53 100644
--- a/public/guards.json
+++ b/public/guards.json
@@ -1203,7 +1203,7 @@
"npm": "check:model-viewer",
"title": "One <model-viewer> build across the whole tree",
"protects": "Every model-viewer URL in tracked source names the same version, no version is served under two different integrity hashes, and the vendored copy under pages/ibm/vendor/ hashes to the build the rest of the tree points at.",
- "why": "model-viewer registers itself as a custom element, so a second customElements.define for it in one document throws and the later surface renders nothing at all. A three.ws embed pasted onto a page that already carries another three.ws surface is exactly that document, so a split pin is a blank viewer for somebody else, on their site, with nothing failing on ours. It had already drifted: eight of eighty-one references sat a major version behind, two of them still carrying SRI hashes for the older build, which is the shape a half-finished bump leaves. Delivery legitimately differs per surface (a top-level document pins SRI, a server-interpolated embed cannot, the Vite pages walk a CDN failover chain); the version never does.",
+ "why": "model-viewer registers itself as a custom element, so a second customElements.define for it in one document throws and the later surface renders nothing at all. A three.ws embed pasted onto a page that already carries another three.ws surface is exactly that document, so a split pin is a blank viewer for somebody else, on their site, with nothing failing on ours. It had already drifted: eight of eighty-one references sat a major version behind. Integrity is checked alongside the version because the usual way a bump goes wrong is half-finished, the URL moved and its SRI hash left pointing at the old build, which browsers refuse outright. Delivery legitimately differs per surface (a top-level document pins SRI, a server-interpolated embed cannot, the Vite pages walk a CDN failover chain); the version never does.",
"stages": [
"gate"
],
diff --git a/scripts/check-model-viewer-version.mjs b/scripts/check-model-viewer-version.mjs
index bf2b5feb0..c9bb1259b 100755
--- a/scripts/check-model-viewer-version.mjs
+++ b/scripts/check-model-viewer-version.mjs
@@ -43,9 +43,15 @@ const INTEGRITY_RE = /integrity=["'](sha\d{3}-[A-Za-z0-9+/=]+)["']/i;
const SCANNED = /\.(js|mjs|cjs|jsx|ts|tsx|html|htm|md|json|svelte|vue|py|ipynb)$/;
-// Point-in-time captures of past runs (audit baselines, recorded MCP responses).
-// They are records of what shipped then, not references that should be bumped.
-const SKIPPED = [/\/_generated\//, /\.min\.js$/, /^node_modules\//];
+// Not real references, so not this guard's business:
+// _generated/ point-in-time captures of past runs (audit baselines, recorded
+// MCP responses). Records of what shipped then, not pins to bump.
+// *.min.js the vendored library itself, which names its own version.
+// guards.json the guard registry carries THIS guard's proof fixture inline
+// (a deliberately wrong version the harness writes to a temp file
+// and expects us to reject). Reading it back as a real reference
+// would make the guard fail on its own proof, forever.
+const SKIPPED = [/\/_generated\//, /\.min\.js$/, /^node_modules\//, /(^|\/)guards\.json$/];
function trackedFiles() {
const listed = (args) => execFileSync('git', args, { encoding: 'utf8', maxBuffer: 1 << 28 }).split('\n');