Skip to content

fix(apple): keep runner bridge test hooks out of the shipped package - #4272

Merged
thymikee merged 2 commits into
mainfrom
fix/release-pack-bridge-test-hooks
Nov 6, 2026
Merged

thymikee merged 2 commits into
mainfrom
fix/release-pack-bridge-test-hooks

Conversation

@thymikee

@thymikee thymikee commented Nov 6, 2026 •

Copy link
Copy Markdown
Member

Summary

Unblocks every npm release. The Release Build job fails packing (run 42221831651): #4256 added an #if defined(AGENT_DEVICE_RUNNER_UNIT_TESTS) block with RunnerSnapshotBridgeReadForTest / RunnerSnapshotBridgeDrainForTest to the shipped RunnerSnapshotBridge.m. The packager strips that macro's blocks from Swift only, so it survived and check-package rejected the tarball.

  • Moves the two hooks to AgentDeviceRunnerUITests/UnitTests/RunnerSnapshotBridgeTesting.m (the package omits UnitTests/), following RunnerEdgeContactTesting.m.
  • Exposes RunnerSnapshotBridgeRead and RunnerSnapshotBridgeReaderQueue through a private UnitTests/RunnerSnapshotBridge+Internal.h, the same pattern as RunnerAXSnapshotBridge+Internal.h. They lose static; nothing else changes.
  • The synchronized group adds the new .m to the UITests target; the existing bridging header still imports RunnerSnapshotBridgeTesting.h.
  • 3 files. check-package.ts and shipped-test-code.ts are unchanged.

Validation

Release Build pack steps (pnpm build:package && pnpm check:package -- --pack-destination .tmp/release, ANDROID_HOME set):

  • Base a68693c72e: fails with the same RunnerSnapshotBridge.m: names AGENT_DEVICE_RUNNER_UNIT_TESTS error.
  • Head d3b161d63b: passes. All four runner platforms build, and the log reports "Confirmed no test code in the 806 packed files."

iOS runner built with AGENT_DEVICE_XCUITEST_INCLUDE_UNIT_TESTS=1. 5 bridge tests ran on an iPhone 17 Pro Max simulator, with 0 failures. They include testAbandonedReadBecomesWedgedUntilItReturns, which calls both hooks.

pnpm check:affected --run --head d3b161d63b: passed, exactCommit=true (receipt run-pOCngB). Swift runner lanes are GitHub-authoritative.

🤖 Generated with Claude Code


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

View guided diff Turn on auto-fix

#4256 put RunnerSnapshotBridgeReadForTest and RunnerSnapshotBridgeDrainForTest
under an #if AGENT_DEVICE_RUNNER_UNIT_TESTS block in the shipped
RunnerSnapshotBridge.m. The packager strips that block only from Swift, so the
macro survived packaging and check-package failed the Release Build job.

Move the hooks to UnitTests/RunnerSnapshotBridgeTesting.m, which the package
omits, and reach the read and the reader queue through a private
UnitTests/RunnerSnapshotBridge+Internal.h.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Size Report

Metric Base Current Diff
Installed (including dependencies) 6.15 MB 6.15 MB -294 B
Package (unpacked) 6.15 MB 6.15 MB -294 B
Package (download) 1.86 MB 1.86 MB -18 B

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 22.3 ms 25.0 ms +2.8 ms
CLI --help 50.1 ms 49.0 ms -1.1 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.

No issues found across 3 files

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

@apex-sentinel-staging

apex-sentinel-staging Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

Apex Sentinel

Verdict: approve

Since the last review: 0 new · 0 still open · 1 no longer raised

No findings.

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

Reply under an inline comment with @apex-sentinel-staging note ... or @apex-sentinel-staging pivot ... to re-check that finding.
Comment @apex-sentinel-staging review on this conversation to run a full review.

Earlier reviews

Review of d3b161d6 · 06.11.2026 13:31 UTC

Apex Sentinel

Verdict: approve

1 finding(s): 1 minor.

🟡 Minor (1)

Where Finding
apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/UnitTests/RunnerSnapshotBridge+Internal.h:10 New RunnerSnapshotBridge+Internal.h declares a nullable return as nonnull

1 finding below minor not shown (user_settings.min_severity).

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

@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 d3b161d. The verdict and the full list are in the summary comment.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@thymikee

thymikee commented Nov 6, 2026

Copy link
Copy Markdown
Member Author

This PR is ready at 1111bd2: I found no problems in the code. All 17 checks pass, but the diff touches only Objective-C under apple/runner, so the Node jobs do not exercise it. PR CI's check:package also never packs dist/apple/runner, so its pass says nothing about this fix. I ran the packager on the PR head into a scratch root and grepped the output for the macro and the hook symbols, which is what the leak guard scans, and found none. There are no conflicts, and nothing else needs to happen before merge.

Not blocking, and you can take or leave these: (1) the leak guard in shipped-test-code.ts runs only in check-package.ts against a dist/ that has dist/apple/runner, and PR CI never writes that folder, so a macro left in a shipped .m or .h passes PR checks and fails only at release; the rule that every packaged runner file must pass testOnlyContentFailures could be enforced by check:packaged-runner-swift, which already packages into a throwaway root, in a small follow-up rather than a second Objective-C stripper; (2) the new comment at RunnerSnapshotBridge.m:190 names a header the package omits, so the compiler cannot tie its prototypes to the shipped definitions, but testAbandonedReadBecomesWedgedUntilItReturns already guards that drift; (3) RunnerSnapshotBridgeReadForTest in RunnerSnapshotBridgeTesting.h still declares a nonnull return and read block while the forwarded result can be nil, so marking both _Nullable fits the next time that wrapper is touched.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Nov 6, 2026
@thymikee
thymikee merged commit b6965c5 into main Nov 6, 2026
17 checks passed
@thymikee
thymikee deleted the fix/release-pack-bridge-test-hooks branch November 6, 2026 16:59
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