Commit Graph
5 Commits
Author SHA1 Message Date
Locust agent 58f5b29dc2 test(scripts): check README and site id sets against the section map 2026-11-03 00:12:17 +00:00
Locust agent 757f29f6e9 feat(scripts): add theme contrast measurement harness and measured table
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.
2026-11-02 22:23:22 +00:00
Locust agent 86028df383 feat(scripts): add the pre-redesign route compatibility check
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.
2026-11-02 20:51:28 +00:00
Locust agent e12af7bc5b feat(build): generate the 404 fallback from the current build
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.
2026-11-02 19:08:04 +00:00
Locust agentandClaude Opus 4.8 bbb9ce3ae9 feat(scripts): add design-rule and banned-term check scripts
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]>
2026-11-02 15:44:35 +00:00