feat(audit): run Apple's native accessibility checks on iOS

Merged
TH
7d ago
+1811-64

Summary

On an iOS 17+ target served by the XCTest runner, audit now also runs Apple's accessibility audit and prints its findings with the heuristic ones. There is no flag. Other targets, and iOS before 17, return the heuristic findings alone.

Only Apple's five read-only checks run (contrast, element detection, hit region, description, trait). Dynamic Type and clipped-text are left out: they resize the app's text while they run. A native hit region on the frame of a small-target finding is dropped. Native findings print in a stable order. Part of #4761.

Before / after

agent-device audit   # iOS Settings, simulator

Before: 4 warnings, 1 observation.
After: 8 warnings, 1 observation. Added lines:

native  contrast  Contrast failed for element  @e46~s773569 text "StandBy"  [29.7,756 106.7×29]
native  trait  The accessibilityLabel of this element duplicates information that is available in the traits.  [16,484.3 370×52]

With a system alert over the app, after:

Error (COMMAND_FAILED): A system alert covers the app, so the accessibility audit did not run: Allow “Maps” to use your location? Not dispatched. Next: Run agent-device alert accept or agent-device alert dismiss, then run agent-device audit again.

Runner build progress, before: Building Apple runner.... After: Building Apple runner (one-time per agent-device version)....

Validation

Head 4a92fbfbcf7da9e88f91e85065b9a7031e66a70e.

  • pnpm check:affected --run: all checks passed except unit. There, 2 of 21,401 tests timed out on a host at load 36; both pass alone and are unrelated. The last full pass was at a7c8277505.
  • Live on the audit-platform-ios simulator (iOS 26.2) with the branch-built CLI: evidence. Warm audit takes 1.0–1.8 s; the first one after a runner build took 29 s.
  • Three audit XCTest unit tests passed on that simulator at df8dbd23ae; the alert branch has no unit test and was verified live only.
  • CI must pass at this head, including Apple Smoke Tests and Runner Build.

Risks: physical devices and iOS before 17 were not run live.


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.