Repository navigation
refactor(platform-apple): colocate sixteen tests with the modules they test - #3657
Conversation
Pure moves and renames. Content changes are import specifiers, the Swift sources path in interactions.test.ts, and references to the old paths in the macOS workflow, docs, comments and the command-coverage and fault-matrix evidence. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e it covers decodeRunnerResponseBody and its siblings live in runner-contract.ts; parseRunnerResponse lives in runner-exchange.ts. Each half now sits beside its own module's name. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…for the runner entry The driver exercises the session executor, command recovery and press-series sequencing against the contracts table, so it takes the runner entry's name. The owning-path string in the contracts fixture follows. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… for the package and runner entries Pure renames. The runner-requests.json producer paths and the comment that names the runner-side driver follow in the next commit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…onformance drivers The producer paths move with the two drivers; the endsWith contract in the runner-side driver already accepts index-runner-requests.test.ts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
This PR is ready at 8541862. It moves sixteen tests next to the modules they test, and I found no problems in the diff. There are no conflicts. CI had not run when I looked: all 16 non-passing jobs were queued, so there is no failure to attribute. I did not run any tests myself, and I checked the runner-response split statically. The 31 and 47 test counts and the vi.mock table come from your description. The layering, fallow, gate-manifest and vitest project-selection results from the earlier commit still need a rerun on this head. Not blocking, and fine to take or leave: runner-client-mac-arch.test.ts tests the destination helpers in apple-runner-platform.ts and imports runner-client.ts only for its host-binding side effect, so a short note in the test would help; and two comments in runner-exchange.ts and runner-swift-settlement-fixtures.ts got longer with the rename, so please check Lint & Format. Next, wait for CI to finish, mainly Repo Guards, Lint & Format and Integration Tests, and rerun check:quick, layering and fallow on this head. |
8541862 to
9eb850d
Compare
Size Report
Startup median (7 runs, lower is better):
|
|
Full gate set on the final head
The first |
|
The changes in 9eb850d look good, and the earlier review (8541862) found no code problems. The tests now sit next to the modules they cover, and the delta since then only renames tests and updates the producer strings in the JSON fixtures. No production code changed. I did not rerun the gates or the conformance test, and I did not capture the failing CI excerpts. The failures look unrelated to me, because the renamed drivers only feed the runner-requests conformance check, but that rests on the diff alone. No conflicts. Before merge, please confirm the CI failures do not come from the fixture producer-path change. |
Summary
Colocation renames for platform-apple: 16 of the 19 test files that were not beside a module they are named for (my recount matched the coordinator's 19). No fixture export is touched. The remaining three are explained below.
The rule thread's baseline is now a merge-base ratchet, so there is nothing to delete; counts are from my scan (
/tmp/coloc/scan.mjs, same definition as the coordinator's numbers).Commits
refactor(tests): name platform-apple tests for the module they test—git mvplus specifier changes. Beyond import specifiers: the Swift-sources path ininteractions.test.ts(moved up two directories), and references to the old paths in.github/workflows/macos.yml(the native-proof lane listscache-native-runtime.test.ts), two docs, an ADR, a few comments, the command-coverage evidence intest/integration/command-coverage/declarations.ts, and the boundary-fault evidence inpackages/test-kit/src/boundary-fault-matrix.ts.refactor(platform-apple): split the runner response test by the module it covers—decodeRunnerResponseBodyand siblings live inrunner-contract.ts,parseRunnerResponseinrunner-exchange.ts.refactor(platform-apple): name the runner dispatch-disclosure driver for the runner entry— per the coordinator's decision; the contracts fixture's owning path follows.Renames (all under
packages/platform-apple/src)runner/__tests__/runner-close-finalizationrunner-session-close-finalizationrunner-session.ts(releaseIosRunnerOnClose,stopIosRunnerSession)runner/__tests__/runner-command-busy-resendrunner-client-busy-resendrunner-client.ts(runAppleRunnerCommand)runner/__tests__/runner-command-retryrunner-client-command-retryrunner-client.tsrunner/__tests__/runner-recovery-wiringrunner-client-recovery-wiringrunner-client.ts(header: enters atrunAppleRunnerCommandon purpose)runner/__tests__/runner-early-exit-diagnosisrunner-startup-transport-early-exitrunner-startup-transport.ts(buildRunnerEarlyExitError)runner/__tests__/runner-readiness-routingrunner-command-traits-readiness-routingrunner-command-traits.tsrunner/__tests__/runner-request-cancellationrunner-lifecycle-request-cancellationrunner-lifecycle.tsrunner/__tests__/runner-start-admissionrunner-xctestrun-start-admissionrunner-xctestrun.ts(start-admission functions)runner/__tests__/runner-startup-failure-reasonsrunner-xctestrun-startup-failure-reasonsrunner-xctestrun.ts(ensureXctestrunArtifact)runner/__tests__/runner-responserunner-contract-response,runner-exchange-responserunner-contract.ts,runner-exchange.tsrunner/__tests__/runner-dispatch-disclosureindex-dispatch-disclosure__tests__/screenshot-backend__tests__/interactor-screenshot-backendinteractor.ts__tests__/watchos-sentinel__tests__/interactor-watchos-sentinelinteractor.tscore/__tests__/interactionssrc/interactions.test.tssrc/interactions.ts(+ the Swift route-parity test)core/__tests__/runner-mac-archcore/__tests__/runner-client-mac-archcore/runner-client.ts(see below)snapshot-source/native-runtimesnapshot-source/cache-native-runtimesnapshot-source/cache.ts(buildSnapshotBridgeCompileArgv)Not changed
runner-mac-archstays undercore/. I first moved it besideapple-runner-platform.ts, and R77 (apple-runner-host-port) rejected it: the test imports@agent-device/host-kit/commandand/processdirectly, which is forbidden underrunner/. Itsimport '../runner-client.ts'is also the production host binding it relies on, sorunner-client-mac-archis the honest name incore/__tests__.runner/__tests__/runner-requests.test.tsand__tests__/runner-requests.test.ts: cross-module request-site conformance drivers whose*runner-requests.test.tsname is a contract (runner-requests.jsonproducer paths and theendsWithcheck). Unrenamed; flagged to the coordinator.core/__tests__/apps.test.ts(24 tests over 6 modules) needs a real split; it is the next PR.Test-count parity (
vitest --reporter=json, passed/total)runner-close-finalization18runner-session-close-finalization18runner-command-busy-resend7runner-client-busy-resend7runner-command-retry33runner-client-command-retry33runner-recovery-wiring47runner-client-recovery-wiring47runner-early-exit-diagnosis11runner-startup-transport-early-exit11runner-readiness-routing1runner-command-traits-readiness-routing1runner-request-cancellation8runner-lifecycle-request-cancellation8runner-start-admission12runner-xctestrun-start-admission12runner-startup-failure-reasons33runner-xctestrun-startup-failure-reasons33runner-response11runner-contract-response8 +runner-exchange-response3screenshot-backend1interactor-screenshot-backend1watchos-sentinel2interactor-watchos-sentinel2core/__tests__/interactions25interactions25runner-mac-arch1runner-client-mac-arch1native-runtime47cache-native-runtime47runner-dispatch-disclosure31index-dispatch-disclosure31Selection:
runner/**files run in theapple-runnerproject, everything else inunit-core; no file changed project.check:affected --runselected 336 test files (2,519 tests, all passed) including the renamed ones. The macOS workflow lane that listscache-native-runtime.test.tsis updated.vi.mockeffectivenessPointed each mock path at a nonexistent module, one at a time, and reverted:
runner-session-close-finalization../runner-io.ts../runner-startup-transport.ts../runner-transport.ts../runner-xctestrun.tsrunner-client-busy-resend../runner-session.tsrunner-client-command-retry../runner-session.ts../runner-xctestrun.tsrunner-client-recovery-wiring../runner-session.tsrunner-lifecycle-request-cancellation../runner-io.ts../runner-startup-transport.ts../runner-xctestrun.tsinteractions./core/runner-client.tsinteractor-screenshot-backend../core/screenshot.tsTwo mocks (bold) are not load-bearing for any current case. They are unchanged by this PR; I'll spy-check them and remove the dead ones in a follow-up unless you want them here.
Surface
exportscounts: platform-apple 21 → 21 (no subpath added or removed).apps.test.tsand the tworunner-requests.test.tsdrivers described above).Gates
check:quick,check:layering,check:fallow,check:gate-manifest,check:affected --runall pass on the commit before the dispatch-disclosure rename; the rename is covered byindex-dispatch-disclosure(31) andcontracts/dispatch-disclosure(3) passing, andpnpm formatis clean. I'll rerun the full set on the final head if you want it before merge.🤖 Generated with Claude Code