Skip to content

refactor(ios-runner): drop the XCTest coordinate gesture fallback - #5359

Open
thymikee wants to merge 4 commits into
perf/ios-sim-hid-tap-no-fallbackfrom
refactor/runner-no-xctest-gesture-fallback
Open

thymikee wants to merge 4 commits into
perf/ios-sim-hid-tap-no-fallbackfrom
refactor/runner-no-xctest-gesture-fallback

Conversation

@thymikee

@thymikee thymikee commented Dec 3, 2026 •

Copy link
Copy Markdown
Member

Summary

Stacked on #5354. Invariant: a synthesized iOS gesture never switches to an XCUICoordinate gesture. Covered: tap, long press, drag, one-contact gesture, sequence tap/long-press, nav-bar back tap, coordinate fill tap. When the private event record is refused, the runner returns the refusal with the synthesis hint: SYNTHESIZED_GESTURE_NOT_DISPATCHED when nothing was sent, otherwise UNSUPPORTED_OPERATION.

Why: both routes go through testmanagerd event synthesis and only differ when a private selector is missing. The XCUICoordinate route crashed the runner on a rejected AX root (#4274). No report or local log shows the fallback firing.

Removed: the fallback policy, the deferred-window proof, the policy log marker, the gestureFallback* wire fields, and the TS diagnostic. Older runners still send the fields; the client ignores them, so version skew is safe. ADR 0011 and RUNNER_PROTOCOL.md are amended.

Value

  • Runner fallback branches (.xctestFallback): 10 → 0
  • Gesture fallback wire fields: 3 → 0
  • Net diff: −526 lines (+156/−682)

Validation

141 affected runner tests on an iPhone 17 Pro simulator (iOS 27.0) at 3b10ed3: 140 passed; testCoordinateTapCommandOnASoleScreenPhoneLandsWithoutAWindowsQuery read its witness early, is unchanged here, and passed alone. pnpm vitest run runner-session-response.test.ts passed (10 tests).

Risk: if the event record fails only on a physical device, the gesture is now refused instead of falling back to a slower XCTest gesture.

🤖 Generated with Claude Code


See it in action
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

View guided diff Turn on auto-fix

@github-actions

github-actions Bot commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

Size Report

Metric Base Current Diff
Installed (including dependencies) 6.78 MB 6.77 MB -7.4 kB
Package (unpacked) 6.77 MB 6.77 MB -7.4 kB
Package (download) 2.07 MB 2.07 MB -1.3 kB

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 25.9 ms 24.9 ms -1.0 ms
CLI --help 54.9 ms 58.1 ms +3.2 ms

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 25 files

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

@apex-sentinel-staging

This comment has been minimized.

@apex-sentinel-staging apex-sentinel-staging Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apex Sentinel: 2 new findings on 36c4f9e. The verdict and the full list are in the summary comment.

@apex-sentinel-staging

This comment has been minimized.

@thymikee

thymikee commented Dec 3, 2026

Copy link
Copy Markdown
Member Author

This PR is ready at 42d8585. Not blocking, and each can be taken or left: the new nav test testInAppBackAfterAnInterruptedBackButtonTapSendsNoSwipe runs only on a simulator, where the tap path already threw the outcome-unknown error before this change, so it passes without the physical-device fix in https://github.com/callstack/agent-device/blob/42d8585/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/SynthesizedInteraction.swift#L109-L124 (a small static status-mapping function that a unit test calls for all four statuses would pin it, or the test doc can say it covers the simulator route only); apple/runner/RUNNER_PROTOCOL.md:357 should say that a synthesized sequence tap or long-press step reports the two codes, because tap steps now report them too; the PR body Summary still maps every non-NOT_DISPATCHED failure to UNSUPPORTED_OPERATION and omits SYNTHESIZED_GESTURE_OUTCOME_UNKNOWN, and its counts and validation head predate this commit; and the earlier note that SynthesizedGestureAttempt is now just timing plus a non-performed outcome, so the "Policy" file name no longer fits, can wait for a follow-up.

Of the earlier review threads, #5359 (comment) (failure after hand-off) and #5359 (comment) (ADR error mapping) are fixed at this head. The threads #5359 (comment) (rename covers naming concern) and #5359 (comment) (ADR now limits the Swift file) no longer apply and can be resolved.

CI is still pending: the one non-passing check is an in-progress review check that exercises no route this diff touches, and the other 17 checks pass at 42d8585, including the iOS simulator runner build and unit tests. No CI job compiles the physical-device runner, so the rewritten tap branch is checked by inspection only. Not verified here: a device build (xcodebuild build-for-testing -destination generic/platform=iOS) and one tap on a physical iPhone, which would close that gap. No conflicts. Nothing in the code blocks merge, so the merge waits only for the pending check.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Dec 3, 2026
@thymikee
thymikee added this pull request to stack #5361 December 3, 2026 12:28
thymikee and others added 4 commits December 3, 2026 13:36
A synthesized tap, long press, drag, sequence step, nav-bar back tap,
coordinate fill tap, or one-contact gesture whose private XCTest event
record is refused now answers the refusal (SYNTHESIZED_GESTURE_NOT_DISPATCHED
when nothing was sent, UNSUPPORTED_OPERATION otherwise) with the synthesis
hint, instead of replaying the gesture through XCUICoordinate.

Removes the fallback policy, its deferred-window proof and policy log
marker, the gestureFallback* response fields and their TS diagnostic, and
amends ADR 0011.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… unknown outcome

The physical-device tap reported every event-record failure as UNSUPPORTED_OPERATION, so `back`
read a record that failed after XCTest was handed it as unsent and sent the edge swipe too. The
tap now reports its dispatch stage like the drag and long press: a refusal before hand-off answers
SYNTHESIZED_GESTURE_NOT_DISPATCHED, and a failure after it throws the unknown outcome, so no second
gesture follows. ADR 0011's amendment maps both stages.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…own status

The tap synthesis status now carries the dispatch stage, so the
dispatched out-parameter leaves the tap API, and the unit tests share
one tap helper. This clears the native-dupes clones.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…stale policy docs

Off iOS no synthesized lane exists, so a caller that passes a drag
profile still performs the XCTest coordinate drag; the branch stays and
its hold helper no longer implies a removed fallback. ADR 0011 now names
only the rules the Swift policy file still owns.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@apex-sentinel-staging

Copy link
Copy Markdown

Apex Sentinel · ✅ Approve · review of 75aa712

Since the review of 42d8585: 1 new · 0 still open · 0 no longer raised

1 finding(s): 1 minor.

🟡 Minor (1)

Where Finding
apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SequenceExecution.swift:181 🆕 Uncaught RunnerCoordinateRefusal in performSequenceStep fails the whole sequence command

Reviewed with this repository's own Sentinel configuration (64dd30eae755).

💬 Talking to Sentinel

In a finding's thread, reply with:

Command What it does
@apex-sentinel-staging note <context> Adds context; Sentinel re-checks the cited code
@apex-sentinel-staging pivot <why> Says the finding is wrong; Sentinel re-checks the cited code
@apex-sentinel-staging like Marks the finding as useful
@apex-sentinel-staging dislike <why> Marks it as not useful, so it is not raised again

On this conversation, comment @apex-sentinel-staging review to run a full review once again.

@apex-sentinel-staging apex-sentinel-staging Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apex Sentinel: 1 new finding on 75aa712. The verdict and the full list are in the summary comment.

@thymikee thymikee removed the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Dec 3, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant