Skip to content

Implements the path-aware, two-tier documentation accessibility CI gate#3691

Merged
Sayt-0 merged 4 commits into
mainfrom
docs/a11y-smart-gate
Jul 16, 2026
Merged

Implements the path-aware, two-tier documentation accessibility CI gate#3691
Sayt-0 merged 4 commits into
mainfrom
docs/a11y-smart-gate

Conversation

@aheritier

Copy link
Copy Markdown
Contributor

described in the shared plan docs-a11y-smart-gate (prior context:
docs-a11y-audit, shipped as PR #3687).

What changed

PR 1 — dark-mode callout-link contrast fix (docs/css/style.css)
Links inside a callout (warning/info/tip) sat on a variant-colored panel,
not the page background, so the shared prose-link color
(--accent-hover) failed there even though it passes everywhere else:
3.95:1 on the dark warning callout background (#643700), below the
4.5:1 AA threshold. This was a pre-existing bug, first surfaced while
pre-verifying features/tui/ as a new archetype (see below) — that page
has a link inside a [!WARNING] callout at line 503.

Scoped .content .callout a:not(.btn) { color: var(--blue-200); } (plus
a light-mode override restoring --accent, and an explicit :hover
rule so the shared --link-hover token isn't shadowed by the new
equal-specificity selector). Verified contrast ratios:

Background --blue-200 (dark) --accent (light, unchanged)
warning #643700 6.46:1 4.83:1
info #00153C 11.50:1 4.60:1
tip #11371A 8.51:1 4.75:1

The fix is intentionally scoped to callout links only — nothing broader
was touched.

PR 2 — scripts/docs-a11y-urls.sh (new)
Maps changed docs Markdown files to rendered URLs for Tier 2 of the
gate: docs/index.md/, docs/404.md/404.html,
docs/<section>/<page>/index.md/<section>/<page>/ for the 8
mounted sections, _index.md/STYLE.md/non-Markdown files dropped
(silently or via ::notice for unexpected locations), de-dupes against
the static archetype list already in docs/.pa11yci.json, live-probes
survivors to catch renames, caps at ${A11Y_MAX_PAGES:-10} pages
(lexicographic, deterministic), and emits both ?theme=light and
?theme=dark for each surviving page. Ships with --self-test
(fixture-driven, no server required) and a header comment documenting
the mapping rules and env vars.

PR 3 — expand the static archetype list 8 → 12 URLs
(docs/.pa11yci.json)

Kept the existing 4 pages (home, configuration/sandbox/,
getting-started/quickstart/, 404.html) and added 2 more layout
archetypes: features/tui/ (the densest page — images, inline HTML,
many callouts/tables) and concepts/multi-agent/ (deep heading
structure). Each listed in both themes, so this tier is now 12 URLs.
Depends on PR 1 (the callout-link fix), since features/tui/?theme=dark
would otherwise fail immediately on the pre-existing bug.

PR 4 — wire Tier 2 into .github/workflows/docs-a11y.yml

  • actions/checkout gets fetch-depth: 2 so git diff HEAD^1 HEAD
    (against the pull_request test-merge commit) yields exactly the
    PR's changed files — token-free, fork-safe, no changed-files action.
  • A Compute changed-page URLs step (PR-only) runs the new helper
    script against that diff.
  • An Assemble pa11y config step jq-merges the changed-page URLs into
    a generated config on top of the checked-in docs/.pa11yci.json
    (which stays the single source of truth for the static list and
    defaults, so the local contributor flow is unchanged).
  • The Run pa11y-ci step uses the generated config when one exists,
    else falls back to the static-only config — so push-to-main and
    content-free PRs stay static-only (12 URLs), matching the plan (no
    PR diff to compute Tier 2 from on push).
  • Workflow header comment rewritten to describe the two-tier model;
    scripts/docs-a11y-urls.sh added to both paths: trigger lists.

docs/STYLE.md updated in the same PRs that introduce each piece: the
callout-link contrast rule + table row (PR 1), and the two-tier
model/cap/archetype-maintenance guidance under "Running the
accessibility scan locally" (PR 4).

Deviations from the plan

None. All mechanisms (checked-in static config + generated merge file,
git-native diff, deterministic lexicographic cap at N=10, static+changed
for mixed PRs, 6-page/12-URL archetype list, callout-scoped contrast
fix) match the plan's recommendations as confirmed by the user. No
scope expansion beyond the callout-link fix.

Validation

  • ./scripts/docs-a11y-urls.sh --self-test — all checks pass (mapping
    rules, de-dup, both-theme emission, cap + lexicographic tie-break +
    notice).
  • shellcheck scripts/docs-a11y-urls.sh — clean.
  • actionlint .github/workflows/docs-a11y.yml and
    ./scripts/workflow-lint.sh — clean.
  • python3 -c "import json; json.load(open('docs/.pa11yci.json'))"
    valid JSON.
  • npx markdownlint-cli2 STYLE.md — 0 errors.
  • Local hugo server (Hugo v0.164.0) + pa11y-ci@3.1.0 (system Chrome
    via PUPPETEER_EXECUTABLE_PATH, Docker was unavailable in this
    sandbox) against the full 12-URL static set, both themes: 12/12
    passed, 0 errors
    — including features/tui/?theme=dark, confirming
    the PR 1 fix.
  • End-to-end simulation of the exact CI mechanism (helper script → jq
    merge → generated config → pa11y-ci) against a real changed-page
    example: 14/14 passed (12 static + 2 changed-page URLs, with a
    static-list page correctly de-duped away and a nonexistent/renamed
    page correctly dropped by the live-probe safety net).
  • No dark-mode regression: only the callout-link token changed, and it
    doesn't touch anything on the docs-a11y-audit "verified passing —
    do not touch" list.

Final green CI is to be confirmed on GitHub once this PR is open — not
verifiable from the local sandbox for the GitHub Actions runner itself
(the local run stands in for the mechanism, using system Chrome instead
of browser-actions/setup-chrome).

Note: unrelated pre-existing uncommitted changes in the sandbox

The working tree also had uncommitted changes to docs/hugo.yaml,
docs/layouts/_partials/footer.html, and a new
docs/layouts/home.llms.txt (an in-progress llms.txt output-format
feature) that predate this task and are unrelated to the a11y gate.
They were deliberately left uncommitted/untouched — not included in any
commit here — so this PR stays scoped to the accessibility gate only.

Refs: plan docs-a11y-smart-gate, plan docs-a11y-audit, PR #3687.

@aheritier
aheritier requested a review from a team as a code owner July 16, 2026 16:09
@Sayt-0
Sayt-0 merged commit 88bfc40 into main Jul 16, 2026
20 checks passed
@Sayt-0
Sayt-0 deleted the docs/a11y-smart-gate branch July 16, 2026 16:19
pull Bot pushed a commit to TheTechOddBug/cagent that referenced this pull request Jul 16, 2026
The light-mode default override for callout links
([data-theme="light"] .content .callout a:not(.btn)) has the same
specificity as the shared hover rule but sits after it in source
order, so it silently won on hover too — light-mode callout links
stayed --accent (#2560FF) on hover instead of switching to
--link-hover (#1A4DD9) as STYLE.md documents. Not an AA failure
(--accent already passes on every callout background), just a
behavioral mismatch with the intended hover token.

Add an explicit [data-theme="light"] ... :hover rule after the light
default, mirroring the dark-mode fix already in place. Verified new
hover ratios: 6.52:1 warning, 6.21:1 info, 6.42:1 tip (all above the
previous --accent hover values, since blue-600 is darker than
blue-500) — dark-mode hover and non-callout/.btn links are untouched.

Follow-up from the review of PR docker#3691.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants