Repository navigation
refactor(apple-runner): generate the Swift runner error-code enums from runner-contract.ts - #4810
Conversation
RunnerWireErrorCode and RunnerPassThroughErrorCode were a hand-written copy of RUNNER_ERROR_CODES and of a pass-through list kept in a repo guard. A generator now writes both enums into RunnerErrorCodes.swift from runner-contract.ts. Constant names and raw values are unchanged, so the wire is unchanged. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…t gate The runner-error-codes gate renders the Swift enums again and fails when the checked-in file differs, so the regex readers that compared the two languages are deleted. The literal guard stays: the generator cannot see a Swift emit site that writes a new code as a string literal. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Size Report
Startup median (7 runs, lower is better):
|
This comment has been minimized.
This comment has been minimized.
|
This PR is ready at a2138a5. The generated Swift error-code enums look correct, and all 26 checks pass, including the new runner-error-codes gate in repo-guards and the Apple runner builds that compile RunnerErrorCodes.swift. There are no conflicts. Compile and drift coverage comes from CI. Not blocking: |
…eir table rows Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
Follow-up on the two optional notes at
|
Apex Sentinel · ✅ Approve · review of
|
| 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.
* origin/main: refactor(apple-runner): generate the Swift runner error-code enums from runner-contract.ts (#4810) fix(daemon-client): report a newer daemon that won a startup race as daemon-incompatible (#4801) feat(shake): add a shake command for iOS simulators and Android emulators (#4741) fix(daemon): give a closing daemon its full teardown before anything kills it (#4806) fix(android): use typed evidence in the readiness boot poller (#4717)
Summary
The Swift
RunnerWireErrorCodeandRunnerPassThroughErrorCodeenums were a hand-written copy of the TypeScript declarations, kept equal by regex guards.pnpm generate:runner-error-codesnow writes both enums intoRunnerErrorCodes.swiftfromRUNNER_ERROR_CODESandRUNNER_PASS_THROUGH_CODES(moved from the guard intorunner-contract.ts). All 44 constant names and raw values are identical, so there is no wire change and no protocol version bump. The change is not behaviour-changing.project.pbxprojentry.runner-error-codesgate: renders again and fails on drift. Owned by the generated file,runner-contract.ts, and the generator.apple-runner.ErrorPayload.codeis aString, so neither the generator nor the compiler seesErrorPayload(code: "NEW_CODE")or a constant that no emit site uses.WAIVED_LITERALSis unchanged.20 files. Generator +74; Swift +60/−99; guards and tests +169/−538. No scope expansion.
Validation
At
a2138a54ef:pnpm build:xcuitest:ios: TEST BUILD SUCCEEDED withRunnerErrorCodes.swiftcompiled (run before the rebase onto current main).pnpm check:runner-error-codes,check:gate-manifest,check:affected:test,check:layering,check:fallow,check:production-exports,check:xctest-selection,check:packaged-runner-swift,check:quick: pass.runner-code-literalsandrunner-error-classificationtests: pass.No full
check:affected --runreceipt: CI owns it. CI obligations: unit suite, and the iOS, macOS host, tvOS, visionOS and watchOS runner builds as evidence that every platform compiles.🤖 Generated with Claude Code
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.