refactor(ios): drop the unused modal-scope input and document corpus recording

Merged
TH
1d ago
+413-85

Summary

  • SnapshotPresentedSurface.classify drops its modalScope input. Its only caller always passed nil. The modalScopeExpected column, its fixture text, and its Swift test go too. The table rows and the TS rule stay as they are.
  • ModalSurface (follow-up to #4128): a note that an empty honor-modal read reports rootMismatch only as a label, the duplicate-occurrence rule in the walk comment, and each parent's children counted once. No behavior change.
  • Corpus README: prerequisites, a worked expect + expectModalScope example, the closing swift test step, and a screenshot-first rule: expectations come from what the screen shows, never from the rule's output. An ambiguous duplicate may be expected as unknown(duplicatedChild).
  • pnpm print:alert-surface: prints a recording's honor-modal tree with indexes and kept-children markers, plus ModalSurface's reading labelled as the rule's answer, not ground truth. It rejects malformed or non-format-2 recordings.
  • Test-app README: a fresh-simulator recipe for the SpringBoard prompt (create/boot, build and install, open a session, raise it).

Tree printer on a real recording

$ pnpm print:alert-surface apple/snapshot-presentation/Tests/AlertSurfaceCorpus/iphone-duo-folded-springboard-open-in-app.json
ModalSurface reads (the rule's answer, not ground truth): modal
   0 Application ""  [kept 1 of 40 children]
   1   Window ""  [kept 1 of 3 children]
   2     Other ""  [kept 1 of 3 children]
   3       Alert "Open in “Agent Device Tester”?"
   ...

Verification

  • swift test --package-path apple/snapshot-presentation: 50 passed
  • geometry-policy-presented-surface.test.ts: passed
  • build:xcuitest:ios and build:xcuitest:macos: succeeded
  • pnpm check:affected --run --head 4b6ccdf7cc: passed

🤖 Generated with Claude Code