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

Merged
TH
17h ago
+393-130

Summary

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

  • 19 tables, 40 rows. Each sits beside its classifier: app resolution, settings, open and launch confirmation, close, snapshot, snapshot capture, screenshot, logs, audit, orientation, and the foldable panels. Constants such as SIMCTL_SCREENSHOT_TIMEOUT_REASON become table members.
  • The macOS helper's 5 refusals and its 7 native-only failures (window-not-found, front-window-*, context-menu-not-observed, window-list-unreadable, event_creation_failed, missing_button) now share one macos helper table. Swift spells the failures through a new HelperFailureReason enum. macos-native-helper-outcomes.json gains failureReasons, and the Swift and TS tests both hold to it.
  • No Swift generator: the fixture already pins both sides with a small test in each language.
  • Skipped as R7: alert-*, app-device-scope, request_canceled, and the runtime facts.

Value

basehead
R89 untyped values / sites266 / 352248 / 334
Reason tables / rows20 / 7439 / 114

Before / after

No observable change. Every value keeps its spelling byte for byte, and the macOS helper JSON is unchanged.

Validation

Head c27329ccdd passes:

  • pnpm typecheck, pnpm lint
  • check:layering, check:fallow, check:production-exports
  • generate:reasons, with the page committed
  • vitest run packages/platform-apple test/repo-guards/reason-tables.test.ts: 1756 passed
  • swift test --filter BackgroundInteractionTests in apple/macos-helper: 10 passed, including the fixture check

CI owns the full gate.

🤖 Generated with Claude Code


Prove it works
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.