Repository navigation
fix(runner): type the refusals for a control the target cannot supply - #4548
Conversation
Four refusals answered with a generic code and prose, so a caller could tell which one it got only by reading `message`. Each now answers with the runner's own code, which the host maps to the code its command already refused with and publishes as `details.reason`. `keyboard enter` with no return key and no field to submit through reports KEYBOARD_RETURN_UNAVAILABLE under UNSUPPORTED_OPERATION. Its disclosure stays `unknown`: the sole-text-field route taps that field before typing the return, and that tap can be the step that fails. A press of a control this target cannot express reports HARDWARE_CONTROL_UNAVAILABLE under UNSUPPORTED_OPERATION with `dispatched: no` — the Action Button on a model without one, a volume key on a simulator, or a Siri Remote button off tvOS all press nothing, and the message names the control. macOS `back` finding no in-app back control reports IN_APP_BACK_CONTROL_UNAVAILABLE; it keeps COMMAND_FAILED, the code its code-less reply always produced, and `dispatched: no`. One reason covers Android's keyboard dismiss too: `keyboard_dismiss_unavailable` with `dispatched: unknown`, because its escape keyevents were already sent. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The classifier publishes details.reason from a code, and the doc is prose a reader follows, so nothing connected the RunnerReportedErrorReason union to website/docs/docs/commands.md. A reason added to the union and not published would reach clients as an undocumented value they cannot branch on. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Runtime admission refuses an iOS Simulator volume press and a non-tvOS remote press before the runner is asked, under `unsupported-device-kind` and `unsupported-platform-leaf`. The published prose named this new runner code for those routes, where a caller would key on a reason that can never arrive. It now names the code for the press the runner does answer — the Action Button on an iPhone or iPad model without one — and the command help carries it too. The keyboard help attributed Android's keyevents to iOS, and each new classifier test lacked the closest negative: prose alone earning no reason. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The guard collected quoted snake-case literals with a regular expression, so a member that is not one — a digit, a hyphen, or a non-literal member — dropped out of the doc check instead of failing it. Silence is the failure mode the guard exists to prevent. It now walks the union with the parser the sibling startup-reason guard uses and rejects every member it cannot read. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Size Report
Startup median (7 runs, lower is better):
|
There was a problem hiding this comment.
All reported issues were addressed across 19 files
You’re at about 90% of the monthly reviewed-line limit. You may want to disable incremental reviews to conserve quota. Reviews will continue until that limit is exceeded. If you need help avoiding interruptions, please contact contact@cubic.dev.
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
Trim the action-button searchHint, document the reachable hardware refusal sites, match refusal reasons as whole tokens, split the keyboard enter field-attempt failure from the missing-control refusal, and count the Android escape keyevents in the disclosure row. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Apex Sentinel · ✅ ApproveNo open findings. 2 findings below 💬 Talking to SentinelIn a finding's thread, reply with:
On this conversation, comment |
|
This looks ready at 2002e0a. I found nothing that needs to change before merge. CI is green: 22 checks, none failing, including the Apple smoke jobs that build the changed Swift. There are no conflicts. Nothing else blocks merge. Not blocking, so take or leave each: testKeyboardReturnFieldAttemptFailureIsNotTheTypedRefusal only asserts that two constants differ, so it would still pass if On the earlier inline threads: none of them still apply at this head, so they can be resolved. #4548 (comment) (RUNNER_PROTOCOL.md) now names all three emission sites. #4548 (comment) (docs reason matching) now uses whole-token lookarounds with prefix and suffix tests. #4548 (comment) (keyboard description) now limits the iOS reason to the no-key case. #4548 (comment) ( I ran no tests. I could not confirm that CI's Apple selector ran the iOS-only keyboard test for nothing focused, which the macOS host lane does not cover, and the Action Button site has no Swift test, so I checked that change by reading. |
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 publishesdetails.reason. Public codes are unchanged (19 files).details.reasondispatchedkeyboard enter, no return key and no fieldkeyboard_return_unavailableunknown(sole-field route taps before typing)UNSUPPORTED_OPERATIONhardware_control_unavailablenoUNSUPPORTED_OPERATIONback, no in-app back controlin_app_back_control_unavailablenoCOMMAND_FAILED(what the code-less reply had)keyboard dismiss, IME ignored escapekeyboard_dismiss_unavailable(one reason across platforms)unknown(keyevents sent)UNSUPPORTED_OPERATIONiOS
keyboard dismisswith 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 keepunsupported-device-kind/unsupported-platform-leaf— the prose names the reachable route only. No issue was filed.Validation
Base
d78be6c887, tested head93dc052e06.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).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.tsfails if a reason joins the union without appearing incommands.md.🤖 Generated with Claude Code
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.