refactor(apple-runner): generate the Swift runner error-code enums from runner-contract.ts
Summary
The Swift RunnerWireErrorCode and RunnerPassThroughErrorCode enums were a hand-written copy of the TypeScript declarations, kept equal by regex guards. pnpm generate:runner-error-codes now writes both enums into RunnerErrorCodes.swift from RUNNER_ERROR_CODES and RUNNER_PASS_THROUGH_CODES (moved from the guard into runner-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.
- The UITests folder is a synchronized group with one target for every platform, so the new file needs no
project.pbxprojentry. - New
runner-error-codesgate: renders again and fails on drift. Owned by the generated file,runner-contract.ts, and the generator. - Deleted: the 1:1 parity tests, the enum-body readers, and a second Swift enum reader with three tests in
apple-runner. - Kept: the UPPER_SNAKE literal guard and the emitted-constant check.
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 --run receipt: 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
![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.