#!/usr/bin/env node /* * audit.test.mjs — TDD harness for the off-token audit (D-13) * ------------------------------------------------------------------ * RED phase: every test below fails while scripts/audit.mjs does * not exist (spawn ENOENT); all must pass once it is implemented. * * Run: node scripts/audit.test.mjs (exit 0 = all green) * * Fixtures are (re)created under /tmp/opencode/audit-test/ — * never inside the repo. Zero runtime dependencies. * * Contract under test (from plan 01-04 task 1): * T1 stylesheet using ONLY token values → exit 0 * T2 stylesheet with off-token color / non-zero * border-radius / off-token font / box-shadow / * blur / backdrop-filter → exit 1, each * offending declaration listed as file:line: declaration * T3 tokens.css drifting below 40 colors → exit 2 (drift guard) * T4 any --radius-* token other than 0 → exit 2 (drift guard) * T5 real build (dist/rams.css) → exit 0, and the * shipped vocabulary carries no bare shadow/blur * utilities, no off-token radius default (WR-01) * T6 off-token values inside @layer components → flagged (exit 1) * T7 @layer utilities: only classes used by the * implementation pages are audited (compiled * mockup vocabulary is reference material per D-06, * never worn by implementation markup) * T8 inline style="…" attributes on implementation * pages are audited too (no evasion path around * the