refactor(ios): runner synthesized policy — one keyboard rule, one fallback decision

Merged
TH
12h ago
+85-259

Summary

Behavior-preserving simplification of the runner's synthesized-gesture policy (iOS/iPad simplification pass, PR1). One keyboard rule, one fallback decision.

Deleted as redundant:

  • SynthesizedKeyboardPolicy — only the scroll and drag contexts ever read it, and both always carried .requiredWhenAvailable, so SynthesizedCoordinateContext.allowsKeyboardProbe is exactly accessibilityHealth != .unavailable.
  • SynthesizedGesturePolicy (two-field struct) and synthesizedGesturePolicy(_:) — the fallback decision now lives on SynthesizedGesturePolicyKind.allowsXCTestCoordinateFallback(accessibilityHealth:), so a context can never be built from one kind while execution is labeled with another.
  • SynthesizedFallbackPolicy — its three cells were a per-command rename of the kind's own decision.
  • The policy: parameter of synthesizedCoordinateContext and its 12 call sites; the single-use keyboardAvoidingSynthesizedDragPoints and axFreeDragVisualizationFrame; the keyboardPolicy= log tokens and the false frameSource=window token (no reader outside the runner).

9 files, net -174 lines. No wire contract, ADR, public type or CLI help change. Held: C7a (gestureViewportFrame probe rule) — it changes behavior.

Deleted with it: the private showsAppsOnlyFullScreen alias in
RunnerTests+SynthesizedInteractionTests.swift; its two uses read
soleScreenRouteIsOpen(for:) directly.

Validation

Head 450db6e63e (base 7c909a3f4d). Rebased after #3979 merged: its two synthesizedCoordinateContext calls in RunnerTests+Navigation.swift lost the policy: argument, and nothing else conflicted.

  • iOS runner unit build with AGENT_DEVICE_XCUITEST_INCLUDE_UNIT_TESTS=1 at 450db6e63e. The touched suites (gesture policy, synthesized interaction, navigation, scroll/drag execution, scroll gesture; 53 tests) pass 53/53 on iPhone 18 Pro and 53/53 on iPad Pro 13-inch (M5).
  • Before the rebase (9c563a09d8): full iOS suite on iPhone 496/496, and XCTest Nightly green (run 40400938359).
  • XCTest Nightly at 450db6e63e: run 40475306583: both legs green.
  • macOS host lane: 356/356 pass (matches the derived host reach).
  • Mutants (disposable copy): == .healthy in the fallback rule fails the retained fallback matrix and route test. The same mutant in the keyboard rule fails the retained 3-row health table.
  • pnpm check:affected --run --head 450db6e63e: all runnable checks passed, exactCommit: true.
  • Size report: package unpacked −3.7 kB, download −486 B.
  • git diff --stat origin/main...HEAD: 9 files changed, 85 insertions(+), 259 deletions(-).

🤖 Generated with Claude Code