awesome-loop-engineering / patterns /accessibility-regression-loop.md
cy0307's picture
Sync v0.7.0 implementation kit
1ab3545 verified
|
Raw
History Blame Contribute Delete
4.71 kB

Accessibility Regression Loop

Objective

Turn newly introduced accessibility failures into small, verified fixes while preserving a human review path for criteria that automation cannot judge.

Use This When

  • A web or app surface changes frequently.
  • Automated accessibility checks and keyboard or screen-reader smoke tests already exist.
  • The team wants evidence attached to each fix instead of a periodic audit backlog.

Do not treat an automated pass as proof of full WCAG conformance. The loop handles detectable regressions; people still judge usability, semantics, and assistive-technology behavior.

Trigger

  • Event: an accessibility check fails on a pull request or deployment preview.
  • Schedule: nightly scan of high-value user journeys.
  • Manual bootstrap: "repair the accessibility regression in ."

Intake

  • Failing rule, selector, route, viewport, browser, and test artifact.
  • The changed diff, component ownership, design-system guidance, and prior baseline.
  • Manual-test checklist for keyboard order, focus behavior, names, roles, states, contrast, motion, and zoom.

Agents

  • Reproducer: confirms the failure on the reported route and viewport.
  • Fixer: changes the smallest component or token responsible.
  • Verifier: reruns automated checks and the focused interaction test.
  • Accessibility reviewer: handles ambiguous semantics and manual criteria.

Workspace And Permissions

  • Use a branch or worktree based on the failing commit.
  • Allow component, style, test, and documentation edits within the affected surface.
  • Disallow suppressing rules, hiding content from assistive technology, lowering thresholds, or rewriting shared tokens without owner review.

Durable State

  • Rule ID, route, viewport, affected users, before/after result, screenshots or trace, commands, and manual-review status.

Loop Steps

  1. Reproduce the exact failing rule and interaction.
  2. Classify whether the failure is automatable, manual, or mixed.
  3. Inspect the changed component and its design-system primitive.
  4. Apply the smallest semantic, focus, label, contrast, motion, or target-size fix.
  5. Rerun the focused check, adjacent component tests, and relevant user journey.
  6. Route manual criteria to an accessibility reviewer with a concise evidence packet.
  7. Persist the receipt and stop when both automated and required human gates pass.

Verification Gates

  • The original rule passes at the same route, viewport, and browser.
  • Keyboard order, visible focus, accessible name, role, and state remain coherent for the affected interaction.
  • No rule is disabled or threshold weakened to obtain the pass.
  • Required manual checks are signed off by a named reviewer.

Budget And Exit

  • Max retries: 3 fix attempts.
  • Max runtime: 90 minutes before handoff.
  • Stop on verified repair, inability to reproduce, design-system conflict, or a failure that requires product judgment.

Escalation

Escalate for ambiguous content alternatives, complex screen-reader behavior, cross-product token changes, legal conformance claims, or any fix that materially changes the user flow.

Loop Instruction

Repair the accessibility regression reported for <route/component>.
Reproduce the exact rule, browser, viewport, and interaction before editing.
Make the smallest standards-aligned fix and rerun the focused automated check plus
the keyboard/focus smoke test. Never disable a rule or hide content to obtain a pass.
Record before/after evidence and escalate manual WCAG judgments to <reviewer>.

Worked Example

A navigation redesign removes visible focus from mobile menu links. The loop reproduces the failed focus test at 390 px, traces the regression to a shared outline token, patches the menu component without changing the global token, reruns the keyboard path and automated scan, and records a short video for human review.

Failure Modes

  • Equating zero automated violations with accessibility.
  • Fixing one viewport while breaking another.
  • Adding aria-* attributes that conflict with native semantics.
  • Hiding problematic content from the accessibility tree.
  • Skipping the manual check because the scanner is green.

Example Contract

References