Skip to content

refactor(apple-runner): share tap and replacement result construction - #5161

Merged
thymikee merged 1 commit into
mainfrom
refactor/ios-runner-result-construction
Nov 28, 2026
Merged

thymikee merged 1 commit into
mainfrom
refactor/ios-runner-result-construction

Conversation

@thymikee

@thymikee thymikee commented Nov 27, 2026 •

Copy link
Copy Markdown
Member

Summary

Share the success response for synthesized and XCTest selector taps. Share result construction for the three exits from synthesized text replacement. The readiness wait, witness update, gesture metadata, fallback and timing-log order are preserved.

Value

  • Selector-tap success response builders: 2 → 1.
  • Synthesized replacement result builders: 3 → 1.
  • Combined Swift diff: 36 additions, 59 deletions.

Validation

At c12c7360f61d, frozen install, CLI build, iOS and macOS runner compilation, XCTest selection and diff checks passed. Independent source review found no behavior changes. After marking the PR ready, all 22 hosted checks completed without failures on the same commit, including iOS Simulator smoke and macOS smoke. Cubic and Sentinel reported no findings.

Local Xcode 27.1, iPhone Duo (iOS 27.1), exact head c12c7360f61d. Built the arm64 runner with unit tests enabled and ran xcodebuild test-without-building. XCTest reported 6 tests, 0 failures.

  • testSelectorTapFallsBackToXCTestCoordinateWhenPrivateSynthesisFails
  • testSelectorTapOnInputThatLeavesTheTreeOnFocusRecordsNoFailure
  • testTextInputTapRecoversWhenItsFirstTapDoesNotTakeFocus
  • testSynthesizedReplacementClearsPastDroppedSelectAlls
  • testSynthesizedReplacementPacesAnAppOwnedFieldAtItsAcknowledgeWindow
  • testSynthesizedReplacementRefusesTextBeyondTheDeliveryBudget

Five Maestro contract tests passed. Live checkout-form.yaml passed on iPhone Duo in one attempt, with 17 steps and zero healed. T3 used client 0.21.41 with an isolated c12c7360f61d daemon, runner and Release fixture.

Request f427ef8ceba9ae5c, step 15 payment-cash: maestro_tap_dispatch reported kind=selector, selectorKey=id. Runner resolved the ID, synthesized the tap and returned ok=1. Step 16 confirmed it was selected. No point dispatch or direct-selector fallback occurred during that tap. The correlated logs identify maestro-direct-selector. Maestro does not expose the nested response fields.


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

Copy link
Copy Markdown
Contributor

Size Report

Metric Base Current Diff
Installed (including dependencies) 6.67 MB 6.67 MB -615 B
Package (unpacked) 6.67 MB 6.67 MB -615 B
Package (download) 2.04 MB 2.04 MB -7 B

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 21.2 ms 21.7 ms +0.5 ms
CLI --help 48.0 ms 49.8 ms +1.8 ms

@apex-sentinel-staging

Copy link
Copy Markdown

Apex Sentinel · ✅ Approve · review of c12c736

No open findings.

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

💬 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.

@thymikee
thymikee marked this pull request as ready for review November 27, 2026 18:31

@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.

No issues found across 2 files

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

@thymikee

Copy link
Copy Markdown
Member Author

No code problems were found at c12c736, but live iOS Simulator evidence for the changed tap and replacement routes is still missing. Without it, a change in what these routes return to users could go unnoticed.

Before merge, please run both changed routes on an iOS Simulator at c12c736 and record the passing output with the SHA and device. For selector tap, run testSelectorTapOnInputThatLeavesTheTreeOnFocusRecordsNoFailure (synthesized tap on a text input), testSelectorTapFallsBackToXCTestCoordinateWhenPrivateSynthesisFails (XCTest fallback fields) and testTextInputTapRecoversWhenItsFirstTapDoesNotTakeFocus (XCTest tap with readiness wait). For synthesized replacement, run testSynthesizedReplacementRefusesTextBeyondTheDeliveryBudget, testSynthesizedReplacementClearsPastDroppedSelectAlls (clearNotObserved) and testSynthesizedReplacementPacesAnAppOwnedFieldAtItsAcknowledgeWindow (final commit exit). Please also run one Maestro tapOn by id replay to cover the non-hittable metadata, since only a Maestro-compatible click with allowNonHittableCoordinateFallback reaches that runner branch. The diagnostics should show maestro_tap_dispatch with kind=selector and no ios_direct_selector_tap_fallback, and the click should succeed through dispatch path maestro-direct-selector.

Not blocking: the single commit subject has no conventional prefix and the squash setting takes it for a single-commit PR, so you could use the PR title as the squash subject at merge (or reword the commit if you push again), or leave it as is.

CI is green. The three non-passing "Body rules" entries are cancelled runs replaced by newer ones, and a later run passes at this commit; that job checks only the title and body.

Not verified here: no code was built or run, and behavior parity rests on reading the base and head source. The absence of these route tests from CI was checked by name in the iOS and macOS job logs: the PR XCTest selection ran six unrelated tests, the iOS smoke replays and fixture E2E use ordinary selectors, and the macOS job cannot run the iOS-only replacement route. The last three listed xctest-nightly runs on main failed; their failing tests were not inspected, and none ran at this commit.

The live iOS Simulator evidence is needed before this can merge.

@thymikee

Copy link
Copy Markdown
Member Author

Live evidence for the requested routes is in the PR body at c12c7360f61d. The six named XCTest cases passed on iPhone Duo (iOS 27.1, Xcode 27.1), and the checkout Maestro flow passed all 17 steps on its first attempt with zero healed.

For request f427ef8ceba9ae5c, step 15 dispatched payment-cash with kind=selector, selectorKey=id. The runner matched identifier ==[c] "payment-cash", issued AGENT_DEVICE_RUNNER_SYNTHESIZED_DISPATCH kind=tap, and reported AGENT_DEVICE_RUNNER_COMMAND_COMPLETED command=tap … ok=1. Step 16 confirmed the selected state. That tap had no point dispatch or ios_direct_selector_tap_fallback. The route is established from correlated logs because Maestro discards the nested click response.

@thymikee

Copy link
Copy Markdown
Member Author

The live evidence at c12c736 covers what the earlier review asked for. All six named XCTest cases passed on an iOS 27.1 Simulator: the three selector tap cases and the three synthesized replacement cases. The Maestro checkout-form.yaml replay also passed on its first attempt. In its tapOn by id step, the diagnostics show maestro_tap_dispatch with kind=selector and the maestro-direct-selector path, with no direct-selector fallback. No code changed since the review, so the clean code verdict stands.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Nov 28, 2026
@thymikee
thymikee merged commit 7942af9 into main Nov 28, 2026
30 of 33 checks passed
@thymikee
thymikee deleted the refactor/ios-runner-result-construction branch November 28, 2026 13:00
thymikee added a commit that referenced this pull request Nov 28, 2026
* origin/main:
  fix(cli): judge install-from-source lease admission by its daemon command (#5169)
  ci: report sizes for affected plugins (#5176)
  fix(ios): keep the zh-Hans alert vocabulary check honest about OS versions (#5177)
  Consolidate Apple tap and replacement result construction (#5161)
  fix(daemon): retry provider lease record retirement (#5174)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-human Valid work that needs human implementation, judgment, or maintainer merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant