Skip to content

refactor(ios): runner native bridge — one sole-screen entry, API-only ObjC comments - #3976

Merged
thymikee merged 2 commits into
mainfrom
simplify/runner-native-bridge
Oct 27, 2026
Merged

thymikee merged 2 commits into
mainfrom
simplify/runner-native-bridge

Conversation

@thymikee

@thymikee thymikee commented Oct 26, 2026 •

Copy link
Copy Markdown
Member

Summary

Behavior-preserving simplification of the runner native bridge and the shared geometry header. These Objective-C files ship byte-for-byte in the npm package, so their narration is shipped size.

  • Deleted RunnerResolveSoleScreenDisplayID: a renaming wrapper that discarded the resolved screen. RunnerCreateEventRecord now calls RunnerResolveSoleScreen at the same point, so the dispatch-time sole-screen admission recheck keeps the same call and timing.
  • Fixed the stale RunnerSynthesizedGesture.h comment: a nil resolvedWindow is the sole-screen route, not the first window.
  • Inlined the single-use RunnerDragProgressFunction / RunnerSampledDragPointerPath into RunnerControlledScrollPointerPath, its only caller, which passed a fixed progress function. Same event sequence.
  • Replaced AgentDeviceForegroundOwnershipMatches (an inline a == b) with == at both callers; deleted the dead kAttributeFrame branch in SnapshotBridgeRuntime.m (it returned nil into a return nil;).
  • Trimmed ObjC narration to one sentence per exported symbol plus the constraints code cannot show (frame read before screen; exists required; class absence cached, never geometry; phone idiom skips the probe). History notes (#2728, "measured on a live Duo") are gone.

7 files, two commits. No wire, CLI, or public type changed; the shared header's protocol, tolerance, and measurable/fills predicates are untouched.

Validation

Tested SHA 25bc6b2d5f (rebased onto origin/main a16d437237; 1ba2e5fa74 changed only one header comment).

  • Bridge native tests (cache-native-runtime.test.ts, cache.test.ts, cache-identity.test.ts): 58 passed, including the -Werror bridge compile.
  • Mutant (disposable checkout): drop the bridge ownership check → cache-native-runtime.test.ts 3 failed / 46 passed (baseline 55 passed).
  • Runner unit suites (bridge, synthesized interaction, scroll gesture, gesture) built with AGENT_DEVICE_XCUITEST_INCLUDE_UNIT_TESTS=1: iPhone 17 Pro 36 passed / 0 failed; iPad Air 13-inch (M4) 38 passed / 0 failed (counts after the rebase; the pre-rebase run was 37 and 39).
  • Mutant: remove the sole-screen fills-screen refusal → the nightly-iPad selection fails 4/4 (baseline 4 passed).
  • pnpm check:xctest-selection passed. pnpm check:affected --run --head 25bc6b2d5f: all runnable checks passed, exactCommit=true; swift-runner lanes are GitHub-authoritative.
  • XCTest Nightly on the final head (the iPad sole-screen route changed): https://github.com/callstack/agent-device/actions/runs/40403407186 — success; iPhone full suite 498 executed, iPad sole-screen leg 4 executed.

Size Report

Metric Base Current Diff
Installed (including dependencies) 5.57 MB 5.56 MB -5.1 kB
Package (unpacked) 5.56 MB 5.56 MB -5.1 kB
Package (download) 1.69 MB 1.69 MB -1.8 kB

🤖 Generated with Claude Code

@github-actions

github-actions Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Size Report

Metric Base Current Diff
Installed (including dependencies) 5.57 MB 5.56 MB -5.1 kB
Package (unpacked) 5.56 MB 5.56 MB -5.1 kB
Package (download) 1.69 MB 1.69 MB -1.8 kB

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 40.0 ms 38.9 ms -1.1 ms
CLI --help 79.2 ms 81.6 ms +2.4 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 7 files

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

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

Comment thread apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerXCTestEventBridge.h Outdated
@thymikee

Copy link
Copy Markdown
Member Author

PR 3976 is ready at 1ba2e5f. Not blocking: the local id soleScreen = nil; at RunnerSynthesizedGesture.m:327 is never read and only fills the out-parameter, which is an acceptable price for one entry point, and you could drop the second comment line ("Re-asking here..."); take or leave both.

All 16 checks pass on this commit and there are no conflicts. I did not rerun the simulator runner suites, the bridge -Werror compile or the mutants, so those results come from the PR body. I read the diff and every non-comment hunk is an inline, a deleted pass-through or a dead branch, so I expect no device behavior change. The header comment edits change the runner source fingerprints, so installed users rebuild once, which is expected.

The one bot thread (the RunnerResolveWindowDisplayID header wording) is fixed at this commit, so you can resolve it: #3976 (comment)

Before merge, confirm the XCTest Nightly run on this head is green.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Oct 26, 2026
thymikee and others added 2 commits October 26, 2026 21:48
…ive bridge

Delete RunnerResolveSoleScreenDisplayID, a renaming wrapper that threw the
resolved screen away: RunnerCreateEventRecord calls RunnerResolveSoleScreen
at the same point, so the dispatch-time admission recheck stays identical.
Inline the single-use progress function and sampled-drag path into
RunnerControlledScrollPointerPath, which was its only caller and passed a
fixed progress function. Replace AgentDeviceForegroundOwnershipMatches with
== at both callers and delete the dead kAttributeFrame branch in the bridge
runtime. Trim the shipped ObjC narration to one sentence per exported symbol
plus the constraints the code cannot show: the frame read before the screen,
`exists` required, class absence cached but never geometry, and the phone
idiom skipping the probe.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`RunnerResolveWindowDisplayID` returns a message string, not the typed
failure, so the header must not call it a typed refusal.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@thymikee
thymikee force-pushed the simplify/runner-native-bridge branch from 1ba2e5f to 25bc6b2 Compare October 26, 2026 20:53
@thymikee

Copy link
Copy Markdown
Member Author

I found no problems in 25bc6b2. The new header comment in RunnerXCTestEventBridge.h now says the window route returns a refusal message, and RunnerXCTestEventBridge.m returns an NSString there, so the earlier doc thread is fixed (#3976 (comment)); please resolve it.

All 16 checks pass. The change since the last review is a header comment only, so no route behavior changed. I did not build or run the Objective-C or runner suites. The simulator and -Werror results at the rebased head come from the PR body, and I did not re-run them. No conflicts are known, and nothing further is needed before merge.

@thymikee

Copy link
Copy Markdown
Member Author

Thanks — taking both notes on r4381544807 as-is: the discarded soleScreen out-parameter is the price of the single entry point, and the "Re-asking here" line states the constraint that keeps the dispatch-time recheck from being folded into the earlier admission read, which the code cannot show. No push for them.

The doc thread r4381544807 is already resolved, and nothing changed since: head stays 25bc6b2. XCTest Nightly is green at that head — run https://github.com/callstack/agent-device/actions/runs/40403407186 (iPhone full suite 498 executed, iPad sole-screen leg 4 executed, both legs success).

@thymikee
thymikee merged commit dfcb7e9 into main Oct 27, 2026
18 checks passed
@thymikee
thymikee deleted the simplify/runner-native-bridge branch October 27, 2026 08:33
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