fix(ios): report an unreadable system prompt as ALERT_UNRESOLVED, not absence

Merged
TH
4d ago
+331-68

Problem

A visible SpringBoard modal whose remote host can't be read resolved to .unresolved, which resolveAlert turned into nil. Dispatch then answered ALERT_NOT_FOUND, and the host retried it as absence. So a blocking prompt on screen was reported as no prompt.

Change (21 files)

  • Runner: resolveAlert returns a typed AlertResolution (resolved, absent, unresolved). Unresolved replies ALERT_UNRESOLVED with dispatched: no and a hint (screenshot, then snapshot -i, press @ref). The system-modal mapping is a pure static alertResolution(forSystemModal:resolved:), unit-tested without the resolution override.
  • Contract: the new code is in the alert contract, the runner dispatch table and contracts/fixtures/dispatch-disclosure.json.
  • platform-apple/alert.ts: unresolved is never absence. alert get reports it at once. accept, dismiss and alert wait retry it in their existing windows and report ALERT_UNRESOLVED when the last check still sees it.
  • Help and docs: "no alert" now says alert didn't recognize the prompt, so use snapshot -i and press @ref. ALERT_UNRESOLVED is documented in commands.md.

Validation

  • pnpm check:affected --run --head 72edac8cd3 passed, exactCommit=true.
  • iPhone 17 simulator, unit variant: testSystemModalAlertResolutionKeepsAnUnreadableModalUnresolved passes, and fails when the .unresolved mapping returns .absent.
  • Live CLI on a runner built from 72edac8cd3: a permission prompt resolves (get, accept); no prompt gives ALERT_NOT_FOUND. The unreadable-SpringBoard-modal case could not be raised on a simulator (see the PR comment); it needs a physical device with the AccessorySetupKit picker.

šŸ¤– Generated with Claude Code