Commit b982b6f
a11y: add an oracle for the two failure classes that had none
WCAG 1.4.11 (non-text contrast) and generated content were invisible to every
gate in this fleet. axe has no rule for either, and the arithmetic text walk in
contrast.ts cannot reach them: it measures text nodes, so a control's boundary
is out of scope and a ::before glyph is not an element and owns no text node.
Both were being found by hand-sampling screenshots, which does not
regress-test. Between them they accounted for most of the hand-measured
findings in this sweep — button fills within 1.1:1 of their own panel, and a
duplicate-block marker at 1.00:1 that was the entire non-colour cue its
exhibit existed to provide.
nontext.ts measures both, reusing this repo's own contrast.ts paint core so it
compiles against the same tsconfig strictness that file already satisfies —
shipping one version fleet-wide broke `npm run build`, and since
webServer.command runs the build, a type error in a test helper takes the
whole gate down.
It is wired as a RATCHET, not a report. A check that logs and never fails is
not a gate, and this sweep has spent its length deleting exactly those. So:
- a finding NOT in the baseline fails, so a regression cannot land;
- a baselined finding that gets WORSE fails, so the list cannot rot;
- a baselined finding that no longer appears ALSO fails, so a fixed entry
must be deleted and the file can only shrink toward empty.
The last rule is what stops an allowlist becoming a permanent exemption.
The baseline is captured through the gate's own path (NT_BASELINE_CAPTURE),
because generating it any other way produced a baseline that disagreed with
the check: a first-paint survey missed every control that only exists after
driving, and reported them as NEW on the first run.
Four bugs were found and fixed in the oracle before this landed — it judged
the browser's own unstyled widgets, ignored gradient backgrounds and
composited onto white, and modelled a translucent border over the surround
instead of over the element's own fill (background-clip defaults to
border-box). Each was caught by an implausible number checked against a known
answer, never by reading the code. Validated in both directions against a
lab whose 1.4.11 defect had been hand-measured: it reproduces 2.01:1 / 1.91:1
with the fix reverted and reports clean with it in place.
Verified: green in 69 of 69 repos, and it bites — an injected control whose
fill and border both match its panel is caught at 1.08:1.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>1 parent 1df69fe commit b982b6f
3 files changed
Lines changed: 686 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
| 5 | + | |
4 | 6 | | |
5 | 7 | | |
6 | 8 | | |
| |||
203 | 205 | | |
204 | 206 | | |
205 | 207 | | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
206 | 269 | | |
207 | 270 | | |
208 | 271 | | |
| |||
229 | 292 | | |
230 | 293 | | |
231 | 294 | | |
| 295 | + | |
232 | 296 | | |
233 | 297 | | |
234 | 298 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
0 commit comments