Plain Node script (no dependency) proving every research claim and figure
in README.md and public/src/data carries an inline [id] citation or a
BEAT-default marker, and that every citation id resolves to a reference
entry on both mirrors (README ## References and references.js). A
reference entry that is never cited fails. Structured fields (limits,
durations, option scale labels, score values, presentation data) are
carved out per the settled calibration.
Exit 0 at branch head: 9 README claim lines, 23 data prose claims, 6
reference entries each side, 26 citation sites, zero defects.
Verified failure modes on a scratch copy: unresolved id, dropped
references entry, never-cited entry, uncited claim all fail with exit 1.
Add scripts/check-contrast.mjs, a plain Node script with no runtime
dependency and no test framework, that measures the WCAG 2.2 contrast
ratio of every theme token pair in the light and the dark theme.
- Read the light values from the :root block and the dark values from
the .dark block of public/src/main.css, the only stylesheet in the
build that declares the token values.
- Read the measured pairs from scripts/contrast-pairs.json, so the list
is reviewable next to the script. Every pair states its own threshold
and the harness rejects a threshold that disagrees with its category.
- Apply 4.5:1 for body text, 3:1 for large text and 3:1 for UI
component boundaries, and exit non-zero naming every pair below its
threshold with its token names, values, measured ratio and threshold.
- Report a token that is missing from a theme as a failure, not a skip.
Commit the measured table to docs/theme-contrast.md: 16 pairs, 32
measurements, 32 pass, 0 fail at commit 552d847.
scripts/check-routes.mjs reads the committed "before" route list from
docs/pre-redesign-routes.md and proves every path in it still resolves
at the branch head.
Two halves, both required for every old path:
- Router half: the path resolves against the route table of
public/src/router/index.js as a route path, an alias or the target of
a redirect chain.
- Published-output half: the directory the Pages workflow uploads
(./public/dist) answers a cold request to the old URL. index.html and
the 404.html fallback must both boot the app from the same bundle, and
the route table inside that bundle must still carry the old path and
resolve it to the same target as the router config.
The route list is parsed at run time, so a path added to the document
later is picked up without touching the script. The published output is
read from the workflow file, so the check follows the real deploy target.
Plain Node, no runtime dependency and no test framework: exit 0 when
every old path resolves, 1 naming each path that does not, 2 on a usage
or I/O error.
The SPA fallback must load the hashed assets of the build that is actually
published, so it cannot be a frozen copy of an index document. The new
scripts/generate-404.mjs writes dist/404.html from the built dist/index.html
and runs last in the build, after vite build has copied publicDir.
The generator resolves the dist directory from its own location, so it
behaves the same from the repository root and from public/, where npm runs
it. It refuses to write a fallback that has no app mount point or that
references files missing from the build output, so a broken build fails
loudly instead of shipping a blank page.
The two frozen copies (public/404.html, public/public/404.html) are
removed; dist/404.html is a generated artefact with no committed source
copy.
Two plain-Node check scripts, no new runtime dependency, that enforce the
BEAT design rules and the copy discipline mechanically. Both exit non-zero
when they find something and print file, line and column for every hit.
scripts/check-design-rules.mjs covers README.md and public/src: no emoji
characters, no gradient utilities or gradient declarations, no inline style
attributes, no <style> blocks in Vue components, and no icon markup other
than FontAwesome components or classes.
scripts/check-banned-terms.mjs reads the banned-term list from
scripts/banned-terms.txt, so the list can be tuned without touching the
script. It scans the site copy (string literals, template text and
user-visible attributes) and the README headings.
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>