refactor(apple): reduce SnapshotPresentedSurface to the element-type rule the runner runs

Merged
TH
1d ago
+67-357

Summary

Reduces the Swift SnapshotPresentedSurface to the element-type rule the runner actually runs, per the owner's note on #3579. The class-aware rule stays in TypeScript (collectPresentedSurface).

  • SnapshotPresentedSurface.swift drops from 260 to 37 lines. It keeps presentingElementTypes, the strict ASCII Element(<digits>) parse, and classify(_ acquisition:). It drops PresentedSurfaceNode, PresentedSurfaceCompleteness, classify(nodes:completeness:) and the class vocabulary. A repo-wide grep finds no other users.
  • No change in production output. The only caller (RunnerTests+SnapshotCapturePlan.swift:111) passed a RawAXNode acquisition, which mapped every node to className: nil. On that path the old rule could only answer presented (a presenting element type) or unknown. The new one-liner gives the same answers, and 19 of 19 golden cases match classBlindExpected.
  • The Swift parity test runs every fixture case through the acquisition entry point against classBlindExpected. All cases are kept. The TS test still checks both columns.
  • The fixture and TS comments are narrowed to the smaller Swift claim. No case or vocabulary changed.
  • chore(gates): the stale-row deletion is the follow-up #3623 left for the next PR off main.

6 files, +66/−357.

Validation

At a29eac862:

  • pnpm check (full gate): passes. 1,641 files and 14,296 tests pass, 1 skipped.
  • swift test in apple/snapshot-presentation: 22 tests pass. Breaking the Element(n) parse fails all 3 SnapshotPresentedSurfaceTests.
  • iOS runner built with AGENT_DEVICE_XCUITEST_INCLUDE_UNIT_TESTS=1 on an iPhone 17 simulator (iOS 27.1). 24 affected runner XCTests pass, including testSnapshotCaptureAssemblyClassifiesTheAcquisitionItPresented and testResolvedBlockingSystemModalPayloadStatesAPresentedSurface.
  • pnpm check:xctest-selection and pnpm check:packaged-runner-swift pass.