From 6e79d182e3cc609385937ace8498ab4449550e01 Mon Sep 17 00:00:00 2001 From: bchanot Date: Mon, 19 Oct 2026 00:40:26 +0200 Subject: [PATCH] feat(a11y): standalone scanner on the shared engine (A11Y-CLEAR / A11Y-NO-NEW); guardrails drops the a11y domain --- lib/tests/a11y-scan.test.sh | 130 ++++++++++++++++++ .../a11y-good/src/components/ContactForm.tsx | 31 +++++ .../src/styles.css | 0 lib/tests/guardrails-scan.test.sh | 53 +++---- .../a11y.py => a11y/scripts/a11y_checks.py} | 2 +- skills/a11y/scripts/scan.py | 28 ++++ skills/guardrails/scripts/scan.py | 8 +- 7 files changed, 213 insertions(+), 39 deletions(-) create mode 100755 lib/tests/a11y-scan.test.sh create mode 100644 lib/tests/fixtures/a11y-good/src/components/ContactForm.tsx rename lib/tests/fixtures/{guardrails-good => a11y-good}/src/styles.css (100%) rename skills/{guardrails/scripts/checks/a11y.py => a11y/scripts/a11y_checks.py} (99%) create mode 100644 skills/a11y/scripts/scan.py diff --git a/lib/tests/a11y-scan.test.sh b/lib/tests/a11y-scan.test.sh new file mode 100755 index 0000000..bdf6944 --- /dev/null +++ b/lib/tests/a11y-scan.test.sh @@ -0,0 +1,130 @@ +#!/usr/bin/env bash +# lib/tests/a11y-scan.test.sh — floor of the /a11y scanner catalogue. +# The clean fixture must scan with zero FAIL and zero WARN. Each mutant breaks +# one rule on a copy of it and must raise that rule at the expected severity +# (positive control). The A11Y-CLEAR / A11Y-NO-NEW markers, the gates.sh +# contract wiring and the rejection of guardrails rules are checked too; the +# shared engine itself is proven in guardrails-scan.test.sh. +# shellcheck disable=SC2016 +set -u +ROOT="$(cd "$(dirname "$0")/../.." && pwd)" +SCAN="$ROOT/skills/a11y/scripts/scan.py" +GOOD="$ROOT/lib/tests/fixtures/a11y-good" +WORK="$(mktemp -d)"; trap 'rm -rf "$WORK"' EXIT +PASS=0; FAIL=0; LAST_OUT=""; LAST_RC=0 + +check() { # check