fix(runner): type the refusals for a control the target cannot supply
Summary
Four refusals answered a generic code plus prose, so a caller could tell which one it got only by reading message. Each now answers with the runner's own code; the host maps it to the code its command already refused with and publishes details.reason. Public codes are unchanged (19 files).
| Refusal | details.reason | dispatched | code |
|---|---|---|---|
keyboard enter, no return key and no field | keyboard_return_unavailable | unknown (sole-field route taps before typing) | UNSUPPORTED_OPERATION |
| Action Button on a model without one | hardware_control_unavailable | no | UNSUPPORTED_OPERATION |
macOS back, no in-app back control | in_app_back_control_unavailable | no | COMMAND_FAILED (what the code-less reply had) |
Android keyboard dismiss, IME ignored escape | keyboard_dismiss_unavailable (one reason across platforms) | unknown (keyevents sent) | UNSUPPORTED_OPERATION |
iOS keyboard dismiss with no dismiss key was already typed by #4536; skipped. Simulator volume and non-tvOS remote presses are refused by runtime admission before the runner, so they keep unsupported-device-kind / unsupported-platform-leaf — the prose names the reachable route only. No issue was filed.
Validation
Base d78be6c887, tested head 93dc052e06.
vitest --project apple-runner967 passed;unit-core(src/__tests__ src/commands packages/command-output) 3923 passed, 2 skipped; repo-guards,command-surface,platform-android,schemapassed.tsc -b tsconfig.typecheck.jsonclean;pnpm format/lintclean;check:xctest-selectionclean (722 methods, 0 unreachable).- macOS host XCTest lane (
test-without-building,-skip-testing:.../testCommand) at1d453224ed: 433 tests, 0 failures, including both new refusal tests. Swift is comment-only since that SHA.
Unresolved: iOS-simulator and tvOS lanes for the new codes are CI's; the Action Button emission site has no Swift falsifier (deferred, comment-only diff since).
Guard
test/repo-guards/runner-refusal-reason-docs.test.ts fails if a reason joins the union without appearing in commands.md.
🤖 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.