fix(apple): keep runner bridge test hooks out of the shipped package
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 omitsUnitTests/), followingRunnerEdgeContactTesting.m. - Exposes
RunnerSnapshotBridgeReadandRunnerSnapshotBridgeReaderQueuethrough a privateUnitTests/RunnerSnapshotBridge+Internal.h, the same pattern asRunnerAXSnapshotBridge+Internal.h. They losestatic; nothing else changes. - The synchronized group adds the new
.mto the UITests target; the existing bridging header still importsRunnerSnapshotBridgeTesting.h. - 3 files.
check-package.tsandshipped-test-code.tsare unchanged.
Validation
Release Build pack steps (pnpm build:package && pnpm check:package -- --pack-destination .tmp/release, ANDROID_HOME set):
- Base
a68693c72e: fails with the sameRunnerSnapshotBridge.m: names AGENT_DEVICE_RUNNER_UNIT_TESTSerror. - 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](https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-dark-3x.png)
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.