Bring CI onto the current template; archetype B with real unit tests#22
Merged
Conversation
added 2 commits
July 16, 2026 17:02
…eme.js Reclassifies this repo from an ad hoc pre-template workflow set to archetype B (static-app): the theme bootstrap script has genuine, testable resolution and toggle logic, so it gets real Vitest coverage rather than a content-only declaration. - Replace ci.yml, accessibility.yml, security.yml, codeql.yml with the current merged template versions (current SHA pins, manifest gating, archetype declaration check). - Add the missing lint.yml, .github/lint-tools/, and .github/accessibility-tools/ from the template. - Add .github/ci-archetype declaring static-app. - Add vitest + jsdom, vitest.config.js, and assets/theme.test.js (15 tests) covering theme.js's initial resolution and its set/toggleMode/ toggleFamily helpers. - Update eslint.config.js to lint the new test and config files as ES modules. - Rework deploy.yml's bundler-free assemble step: drop the template's default /scripts/*** and /styles/*** and /data/*** includes (this repo has none and /scripts/*** would have published its own AgentTeam tooling scripts), add /CNAME (the custom domain needs it in the artifact), and exclude /assets/*.test.js from publish.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Archetype decision
Archetype B (static-app), not content-only.
assets/theme.js(the sharedtheme-bootstrap script, loaded via
<script src="assets/theme.js">beforepaint) has genuine, non-trivial logic: theme resolution from
localStorageand
prefers-color-scheme, validation against the four required themes witha safe fallback, and
toggleMode/toggleFamilystring transforms. A bughere is a real accessibility defect (wrong or non-AAA-compliant theme
applied), not a markup issue, so it gets real Vitest coverage rather than a
static-contentdeclaration..github/ci-archetypeis added asstatic-app.What changed
ci.yml,accessibility.yml,security.yml,codeql.ymlwiththe current merged template versions (current SHA pins, manifest gating,
the
.github/ci-archetypecheck, the Chrome/ChromeDriver matchingaction). The repo's previous
ci.ymlpredated the template's build+testmechanism and only ran lint; the repo had no
lint.ymlat all.lint.yml,.github/lint-tools/, and.github/accessibility-tools/from the template.vitest+jsdom,vitest.config.js, andassets/theme.test.js(15 tests) covering
theme.js's initial resolution (saved theme vs OSpreference vs invalid value) and its
set/toggleMode/toggleFamilyhelpers.
eslint.config.jsso the new test and config files lintcorrectly as ES modules (the project's own runtime script stays
sourceType: 'script', unchanged).deploy.yml's bundler-free assemble step (this repo has apackage.jsonfor tooling only, no build script, so it uses thetemplate's BUNDLED job, which correctly falls back to the allow-list
path when no
dist/is produced):/scripts/***,/styles/***, and/data/***includes: this repo has no such runtime folders, and/scripts/***would have published this repository's own AgentTeamtooling scripts (
next-q.sh,record-backport.sh,sync-from-template.sh,tasks.sh) to the public site./CNAME, needed for theprojects.timdixon.netcustom domain;without it in the published artifact GitHub Pages drops the custom
domain on the next deploy.
/assets/*.test.jsfrom the assets include, so the newVitest test file isn't shipped to the live site.
npm audit fixfor a moderate js-yaml DoS advisory in the devdependency tree (production dependency tree already had 0
vulnerabilities).
Verification
npm test: 15/15 passing (Vitest, jsdom environment).npm run lint: clean (html-validate, stylelint, eslint).npm run build --if-present: no-op, as expected (no build script).rsyncwith the updated filter set) againstthe working tree: publishes exactly
index.html,CNAME, andassets/**(analytics, CSS, fonts,theme.js) — no test file, no.github, no repo tooling scripts, no config files.--standard WCAG2AAA --config pa11y.json, local Chrome) againstthe served page: No issues found.
bundled ChromeDriver could not maintain a session against local Chrome
(
net::ERR_CONNECTION_REFUSED), which looks like a localChrome/ChromeDriver interaction issue on macOS, not a workflow defect.
CI's
browser-actions/setup-chromestep (Ubuntu) installs a matchedChrome/ChromeDriver pair and should not hit this; flagging so Carol
confirms the CI axe-core job is green and, if it is not, treats this as
a first real finding rather than assuming it's the same local-only gap.
docs/patterns/accessibility-regression- suite.md), static front-end entries, checked manually (thescripts/accessibility-regression.shentry-point referenced by thepattern does not exist in this repo or the template, so I could not run
it as a script):
tabindex/jump navigation, no ARIA grid, no modal on this page).
opacity-derived text colours; no per-category colourtokens outside the four documented, contrast-annotated themes.
eslint --print-configresolves a non-empty config forassets/theme.js,assets/theme.test.js, andvitest.config.js.aria-liveregions on the page (N/A).index.htmlhas exactly one<main>landmark plus<header>and
<footer>.four themes — light 10.62:1, dark 8.21:1, muted-light 7.99:1,
muted-dark 9.15:1. All pass.
<select>'sborder (
rgba(255,255,255,0.4)over the navy header) blends to3.16:1 against the header background. Passes, narrowly — worth a note
to Simon if the header background or border opacity is ever revised.
No test-coverage carve-out note needed: this is archetype B and the PR
adds the test file alongside the code path it exercises.