#!/usr/bin/env node /** * scaffold-audit.mjs · THE R1/R1b SCAFFOLD CONTRACT, AS A GATE THAT CAN ACTUALLY FAIL. * * ═══════════════════════════════════════════════════════════════════════════════════════════════ * ⛔ WHY THIS REPLACED A STRING GREP. The first pass audited the study page with `'chapter-rail' in * html` and reported OK. There was no chapter-rail ELEMENT on the page at all — the substring * matched the driver SCRIPT that looks for it. The page shipped a table-of-contents driver hunting * an element that did not exist, and the gate called it present. * ★ `LATTICE-CONTENT-STACK.md` R2 lists this exact family: `indexOf('featured-partner-cta')` * matching its own CSS selector in
; a split on a CSS comment that mentioned a tag. * A SUBSTRING CHECK ASKS "IS THIS WORD ANYWHERE", NOT "DOES THIS THING EXIST". * * ⭐ AND IT CANARIES ITSELF. `--canary` strips each required element from a copy of the page in turn * and asserts the gate FAILS for that element. A check that cannot fail is decoration, and the * only way to know is to break the page on purpose. * * usage: * node variance/scaffold-audit.mjs