refactor(reasons): declare the R3 apple-runner reasons in ReasonTable rows

Merged
TH
1h ago
+662-485

Summary

R3, part 1 of 2: packages/apple-runner. Part 2, packages/platform-apple and the macOS helper, is #4924.

  • 13 tables, 41 rows, owned by apple runner or prepare. Each sits beside its classifier: the 13 runner code→reason mappings (RUNNER_ERROR_CODES rows read RUNNER_ERROR_REASONS), the startup-failure vocabulary, the lost reply, and the launch, cache, budget, transport, product, sequence, and session refusals. keyboard_dismiss_unavailable stays for R7.
  • Published-value change: wrapPrepareHealthFailure published reason: appErr.message and overwrote any typed reason. It now publishes prepare_rebuilt_runner_unhealthy. The message moves to rebuiltFailureMessage and the inner reason to rebuiltFailureReason.
  • RunnerCommand and its wire types move to the types-only runner-command-types.ts, which keeps runner-contract.ts under the 1,000-line cap.
  • chore(gates): the two runner reason-docs guards now read the tables.

Value

base 4075dd1178head
R89 untyped values / sites266 / 352249 / 334
Reason tables / rows20 / 7433 / 115

Before / after

prepare ios-runner fails after the cached runner and its rebuild both fail the health check:

  • before: details.reason: "Runner health timed out"
  • after: details.reason: "prepare_rebuilt_runner_unhealthy", details.rebuiltFailureMessage: "Runner health timed out"

Every other value keeps its spelling byte for byte.

Validation

At head 494f7bb546, these pass: typecheck, lint, check:layering, check:fallow, check:runner-error-codes (Swift unchanged), generate:reasons, the apple-runner tests (988), and both runner reason-docs guards. The base Coverage run failed only on those two guards. CI owns the full gate.

šŸ¤– Generated with Claude Code