diff --git a/theme/scripts/audit.test.mjs b/theme/scripts/audit.test.mjs index 1fac233..663b35d 100644 --- a/theme/scripts/audit.test.mjs +++ b/theme/scripts/audit.test.mjs @@ -18,7 +18,9 @@ * 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 + * 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 @@ -207,6 +209,16 @@ writeFileSync(styleAttrPage, ` const r = runAudit([]); check('T5 audit of real build → exit 0', r.status === 0, `status=${r.status} error=${r.error} out=${r.out.slice(0, 400)}`); + + /* WR-01: the shipped compiled vocabulary carries no prose-minted + * bare Rams-forbidden utilities and no off-token radius default. */ + const dist = readFileSync(join(THEME, 'dist', 'rams.css'), 'utf8'); + check('T5 no bare .shadow utility in shipped vocabulary', !/\.shadow\{/.test(dist), + 'bare .shadow compiled into dist/rams.css — prose leakage or a re-enabled bare --shadow key'); + check('T5 no bare .blur utility in shipped vocabulary', !/\.blur\{/.test(dist), + 'bare .blur compiled into dist/rams.css — prose leakage or a re-enabled bare --blur key'); + check('T5 no v3 .25rem radius default anywhere in dist', !/border-radius:\.25rem/.test(dist), + 'border-radius:.25rem present in dist/rams.css — an off-token radius default escaped'); } // T6 — @layer components is implementation-owned: fully audited diff --git a/theme/src/theme.css b/theme/src/theme.css index 09aa66e..253f891 100644 --- a/theme/src/theme.css +++ b/theme/src/theme.css @@ -16,12 +16,24 @@ /* * Class candidates (D-02, D-06): the four mockup screens are the - * read-only vocabulary reference — their markup is scanned so every - * mockup class compiles from this package; the mockup files themselves - * are never edited. Family utilities are safelisted explicitly because - * the mockups address fonts through their inline config instead. + * read-only vocabulary reference — their markup files are scanned so + * every mockup class compiles from this package; the mockup files + * themselves are never edited. Family utilities are safelisted + * explicitly because the mockups address fonts through their inline + * config instead. + * + * Source scope is deliberately narrow (WR-01): ONLY the four mockup + * markup files are explicit sources, and the theme toolchain's own + * text (scripts/, basemap/) is excluded from the auto-scan — prose + * must never mint utility classes (the bare `shadow`/`blur`/`rounded` + * strays previously compiled from design-doc and audit prose). */ -@source "../../stitch_minimalist_route_navigator"; +@source "../../stitch_minimalist_route_navigator/active_route_guidance/code.html"; +@source "../../stitch_minimalist_route_navigator/community_incident_reporter/code.html"; +@source "../../stitch_minimalist_route_navigator/navigate_map_overview/code.html"; +@source "../../stitch_minimalist_route_navigator/telegram_live_traffic_feed/code.html"; +@source not "../scripts"; +@source not "../basemap"; @source inline("font-geist"); @source inline("font-space-grotesk"); diff --git a/theme/src/tokens.css b/theme/src/tokens.css index a6bed24..12e3f8a 100644 --- a/theme/src/tokens.css +++ b/theme/src/tokens.css @@ -111,6 +111,20 @@ --radius-2xl: 0px; --radius-3xl: 0px; --radius-4xl: 0px; + + /* — Rams-forbidden primitives, disabled at the key (WR-01): v4's + deprecated bare keys (v3-compat defaults, node_modules/tailwindcss/ + theme.css "Deprecated" block) are what drive the bare shadow / + shadow-inner / drop-shadow / blur utilities. `initial` removes the + key, so those utilities can never compile — from any candidate + source, prose leakage included (defense in depth on top of the + @source scoping in theme.css). Scale keys remain: mockup-worn + vocabulary only, flagged the moment an implementation page wears + one (audit adjudication 1). — */ + --shadow: initial; + --shadow-inner: initial; + --drop-shadow: initial; + --blur: initial; } /*