Riya Singh Rathore

Shift Left: Accessibility at Pull-Request Time

A developer ships a button that a screen reader announces as just "button," with no label. The engineer never hears it, so nothing about their own experience flags the mistake. The idea here is to make a machine hear it, and to make it hear it while the change is still an open pull request rather than weeks later in an audit.

Move the check, not the rule

Shift-left testing means sliding a quality check as far left as it will go on the timeline that runs from writing code on the left to shipping it on the right. The check itself does not change. Only its position in time does. The checks worth moving are the cheap, mechanical ones, because they never needed a slow, expensive stage to run in the first place. Accessibility linting is exactly that kind of check: it is structural, it is fast, and it does not need the app running to find most of its bugs.

What the analyzer actually reads

Assistive technology does not see pixels. A screen reader consumes the accessibility tree, a semantic model the browser derives from your markup: this node is a button, its accessible name is "Submit," this image is decorative, these headings nest in this order. An accessibility analyzer inspects that tree and checks it against the WCAG standard, flagging the recurring failure modes: an image with no alternative text, a control with no accessible name, text with too little contrast against its background, a heading level that skips. This work builds on Sa11y, Salesforce's open-source accessibility library, which in turn wraps the open-source axe rules engine.

The reason these bugs are worth a dedicated gate is that they are invisible to the person who writes them. A sighted engineer with a mouse never notices a missing label, so the defect slips past code review and surfaces only in a manual audit, or from a user who cannot use the product at all. Automating the check turns an invisible, late, expensive problem into a visible, early, cheap one.

The architecture

The analyzer is one plug-in among several in a shared static-analysis stage that runs on every pull request, before the change lands. The stage discovers its analyzers at startup, hands each one the set of files a change touched, and collects whatever they find. The interesting engineering is in how this particular analyzer keeps itself cheap and how it speaks the stage's common language.

Only look at what changed. A full accessibility sweep of a large front end is far too slow to sit in front of every commit. So the analyzer never scans the world. It takes the diff, keeps only the files that are actually web UI, narrows further to the area it is responsible for, and ignores everything else. The cost of a run scales with the size of the change, not the size of the codebase, which is what makes it viable at the front of the pipeline.

Hand each file to the engine, get back violations. For each surviving file the analyzer runs the accessibility engine as a separate process and reads back a list of violations: a rule id, a severity, and where in the file it occurred. Running the engine out of process, behind a timeout, keeps a slow or stuck check from ever hanging the pull request.

Speak the stage's shared language. Every analyzer in the stage, whatever tool it wraps, emits findings in one common shape: a rule identifier, a severity, a file path, and a line-and-column range. This analyzer's real job is translation. It maps each raw accessibility violation into that shared model and normalizes the file path so the range lines up with the pull request's own view of the file. Because the finding looks like every other finding, the stage can render it directly onto the changed lines without knowing anything about accessibility.

Why one shared model matters A common finding format is what lets a pipeline stay open-ended. Add a new analyzer for a new class of bug and nothing downstream has to change, because the new tool emits the same four fields as the old ones. The translation layer is small and boring on purpose. That is the point: the intelligence lives in the engines, and the pipeline only has to understand one uniform result.

Filter the known false positives. No linter is perfect, and a check that cries wolf gets ignored. So the analyzer carries a small list of known-benign patterns and drops any violation that matches one before reporting. And if the engine is unavailable, it skips silently rather than failing the build. A tool at the front of the pipeline has to fail open: an accessibility checker that can break every commit when it hiccups would be turned off within a week.

Advisory on purpose

The analyzer reports but does not block. Its findings come back as advisory comments on the pull request, not as a hard stop that prevents the merge. That is a deliberate design choice, not an unfinished one. The value of shifting left is almost entirely about feedback latency, the gap between "I wrote this" and "here is what is wrong with it." The longer that gap, the more the author's mental model of the change decays and the more a two-second fix turns into a re-investigation. Collapsing that gap to minutes, while the author is still looking at the diff, captures most of the benefit. Forcing a block on top of it mostly adds friction and false-positive fights. Put the truth in front of the author early, and let them act on it.

The presentation

Shifting an accessibility analyzer left into the static-analysis stage. Final presentation.