refactor(apple): reduce SnapshotPresentedSurface to the element-type rule the runner runs
Merged
TH
1d ago+67+67+01234567890123456789-357-357-012345678901234567890123456789
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.swiftdrops from 260 to 37 lines. It keepspresentingElementTypes, the strict ASCIIElement(<digits>)parse, andclassify(_ acquisition:). It dropsPresentedSurfaceNode,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 aRawAXNodeacquisition, which mapped every node toclassName: nil. On that path the old rule could only answerpresented(a presenting element type) orunknown. The new one-liner gives the same answers, and 19 of 19 golden cases matchclassBlindExpected. - 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 testinapple/snapshot-presentation: 22 tests pass. Breaking theElement(n)parse fails all 3SnapshotPresentedSurfaceTests.- iOS runner built with
AGENT_DEVICE_XCUITEST_INCLUDE_UNIT_TESTS=1on an iPhone 17 simulator (iOS 27.1). 24 affected runner XCTests pass, includingtestSnapshotCaptureAssemblyClassifiesTheAcquisitionItPresentedandtestResolvedBlockingSystemModalPayloadStatesAPresentedSurface. pnpm check:xctest-selectionandpnpm check:packaged-runner-swiftpass.