Skip to content

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

Merged
thymikee merged 1 commit into
mainfrom
t3/platform-apple-error-reasons
Nov 21, 2026
Merged

thymikee merged 1 commit into
mainfrom
t3/platform-apple-error-reasons

Conversation

@thymikee

@thymikee thymikee commented Nov 21, 2026 •

Copy link
Copy Markdown
Member

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

base head
R89 untyped values / sites 266 / 352 248 / 334
Reason tables / rows 20 / 74 39 / 114

Before / after

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

Validation

Head c27329c 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.

View guided diff Turn on auto-fix

…rows

Every `details.reason` platform-apple publishes now reads a ReasonTable row beside the code that
classifies it: app resolution, settings, open and launch confirmation, close, snapshot, snapshot
capture, screenshot, logs, audit, orientation, and the foldable panel tables.

The macOS helper's values move into one `macos helper` table: the five app-surface refusals and
the seven failures only the Swift helper wrote (window-not-found, front-window-capture-excluded,
front-window-not-shareable, context-menu-not-observed, window-list-unreadable,
event_creation_failed, missing_button). Swift now spells the failures through a
HelperFailureReason enum, and contracts/fixtures/macos-native-helper-outcomes.json pins both
languages to the same list.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

Size Report

Metric Base Current Diff
Installed (including dependencies) 6.49 MB 6.49 MB +3.1 kB
Package (unpacked) 6.49 MB 6.49 MB +3.1 kB
Package (download) 1.98 MB 1.98 MB +987 B

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 18.5 ms 20.9 ms +2.4 ms
CLI --help 39.0 ms 42.3 ms +3.3 ms

@thymikee

Copy link
Copy Markdown
Member Author

The code in c27329c looks ready. Not blocking, and fine to take or leave: the generator capitalizes only the first letter of an owner, so "macos helper" renders as "Macos helper" in error-reasons.md, and the macOS helper refusal set in helper.ts is split from the failures by row position instead of by separate tables.

The two cancelled Body rules runs were superseded PR-body runs, and one other check is still in progress. None of these jobs exercises the changed source, Swift or docs paths. Not verified here: vitest, swift test and generate:reasons were not run, and the 19 tables, 40 rows and R89 numbers were not recounted. Page freshness and duplicate values rely on the reason-tables guard in CI.

Before merge, wait for Body rules to rerun green and the remaining check to finish. #4922 also edits error-reasons.md, so whichever PR merges second needs a rebase and generate:reasons.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Nov 21, 2026
@apex-sentinel-staging

Copy link
Copy Markdown

Apex Sentinel · ✅ Approve · review of c27329c

No open findings.

Reviewed with this repository's own Sentinel configuration (a29f3ea79a59).

💬 Talking to Sentinel

In a finding's thread, reply with:

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.

@thymikee
thymikee merged commit 638903c into main Nov 21, 2026
22 of 24 checks passed
@thymikee
thymikee deleted the t3/platform-apple-error-reasons branch November 21, 2026 19:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-human Valid work that needs human implementation, judgment, or maintainer merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant