feat(audit): report advisory accessibility findings from the current screen

TH
2h ago
+1516-29

Stacked on #4594.

Summary

Adds agent-device audit: one fresh capture of the current screen, then advisory accessibility findings with usable refs. 44 files, 1258 insertions. Gross diff is above the 1,000-line target but is one coherent change (it includes ~500 lines of tests and fixtures).

  • small-target: enabled control under 44pt (iOS) or 48dp (Android, captured density). Unknown units report a limitation.
  • missing-name: control with no accessible name. Identifiers, resource ids and typed values are not names.
  • covered-control: controls and rows the existing occlusion pass already marks covered.
  • Decorative images and structural wrappers are excluded. Only proven duplicates collapse (a sole same-role child, or a sole child of a covered parent), never by matching rects.
  • Pure auditSnapshot in capture-kit, types in contracts. Registered through the descriptor registry. Text, JSON and MCP output. Not recorded in replay, not batchable. No audit --platform, no help dogfood change.
$ agent-device audit        # iOS Settings
agent-device audit
3 warnings, 1 observation — current screen
@e48  covered-control  Accessible action is unavailable to touch
@e55  small-target     336×38pt; review touch area
@e56  small-target     17.3×22pt; review touch area
@e58  small-target     17.3×22pt; review touch area

snapshot is unchanged. The only edit in the snapshot path is an audit command added to runtime/snapshot.ts; no existing snapshot, settle, stabilization or replay code changed. The audit module loads lazily, so no other command's import closure grows (eager-closure budgets pass). A live snapshot before and after the audit differed in nothing.

Validation

  • Restacked onto #4594. pnpm check:affected --run --head d2c380da13 passed, exactCommit: true. git range-diff shows the only change versus the previous head is the tree-helper import.
  • At the previous head: pnpm check:affected --run --head 998e9cee0d passed, exactCommit: true. It covers unit, provider-integration, integration-node, layering and fallow.
  • Tests: 22 pure cases with nearest negatives, formatter test, iOS provider scenario (a ref from the audit is accepted by the next press), Android provider scenario (px to dp).
  • Device runs with the repo CLI: iOS rn-matrix-iphone17 (iOS 26.2) as above. Android Pixel_9_Pro_XL_API_37 Settings returned no findings with density captured. Both devices closed with shutdown.
  • Risks: iOS hittable stands in for visibility, and generic clickable Android containers are not evaluated. Not byte-compared against a separate main build.

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