Repository navigation
refactor(apple): reduce SnapshotPresentedSurface to the element-type rule the runner runs - #3632
Conversation
…rule the runner runs The runner's only caller classifies a RawAXNode acquisition, which carries no UIKit class name, so the class-aware branch never ran in production. Keep the element-type vocabulary, the strict Element(<digits>) parse, and the acquisition entry point; the Swift parity test now checks every golden case against classBlindExpected. The TypeScript rule and its two-column parity test are unchanged.
#3623 put the entry on main, so the merge-base now carries it and the no-growth rule governs it; the stale-row check asks the next PR to remove it.
Size Report
Startup median (7 runs, lower is better):
|
There was a problem hiding this comment.
All reported issues were addressed across 6 files
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
|
The code at 945f68c looks good. Not blocking: commit a29eac8 also deletes the replay-maestro-backend row in scripts/tests/eager-closure-budgets.ts, a gate cleanup left over from #3623 that does not belong to this change, so keep it as its own commit or land it separately, and take or leave this as you see fit. All 19 checks pass at that commit. GitHub reports merge conflicts with main, so please refresh the branch against main before merge; no review change is needed after that. I did not run swift test, the runner XCTests, or the Element(n) parse mutation, so those results are as you reported them. The one lower-priority thread that applied is fixed at this head, so please resolve it: #3632 (comment) |
|
The merge conflict is gone and 945f68c is unchanged, so the earlier review stands: the code looks good and all checks pass. This is ready for a human review. |
Summary
Reduces the Swift
SnapshotPresentedSurfaceto 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.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.classBlindExpected. All cases are kept. The TS test still checks both columns.chore(gates): the stale-row deletion is the follow-up refactor(maestro): shape the replay backend as a create(host) plugin #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.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.