Repository navigation
refactor(reasons): declare the daemon reasons in ReasonTable rows - #4936
Conversation
Every error.details.reason the daemon raises now reads a ReasonTable row declared beside the code that classifies the failure. Wire spellings are unchanged except the two sparse-verdict refusals, which published the runner's prose as the reason: find now answers find_snapshot_unreadable and react-native dismiss-overlay answers overlay_snapshot_unreadable, with the prose in details.verdictReason and the code in details.verdictReasonCode. The imported constants DAEMON_SHUTTING_DOWN_REASON, BOUNDED_COMPOSITE_RESOURCE_UNSUPPORTED_REASON and ALERT_WAIT_WINDOW_TOO_LONG_REASON become table rows, and the device-claim conflict union derives from its table. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…in the artifact download digest The reason-docs guard read DeviceClaimConflictReason as a literal union; the union now derives from DEVICE_CLAIM_CONFLICT_REASONS, so the guard reads that table's rows and the unused union extractor goes. The artifact download handler reads artifact_size_mismatch from a table row, so its wire digest moves while the published value stays the same; the existing ack carries the new digest. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Size Report
Startup median (7 runs, lower is better):
|
|
#4930 now declares |
This comment has been minimized.
This comment has been minimized.
|
@apex-sentinel-staging note The command-runtime |
|
This PR is ready at 478859b. The code looks correct, and the two cancelled Body rules runs most likely come from a PR body edit that replaced an earlier run, since that job lints only the PR body. The remaining pending check is an external request-changes on the command-runtime find site, not a failing test. Not blocking, and can be taken or left: |
* origin/main: docs(commands): generate blocks for every public command and halve hand-written prose (#4919) fix(depgraph): budget the blast-radius query, not the whole-tree scan (#4920) refactor: remove dead exports and stale fallow exemptions (#4931) refactor(reasons): declare the R6a reasons in ReasonTable rows (#4938) # Conflicts: # website/docs/docs/error-reasons.md
…rse verdict code Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
At |
This comment has been minimized.
This comment has been minimized.
|
The earlier pass at 478859b found nothing (#4936 (comment)). At 7f08fae, one wire change is not covered by the PR's declared exceptions, so this needs a fix before merge.
The claim that the migration preserves daemon wire reason values outside the declared changes does not hold for this route. The find.test.ts cases at lines 191-259 cover the sparse path through the production handler. They would catch the change once they also assert focus and type. Could CI is green: 22 checks, 0 not passing. No conflicts. Not verified here: the tests and the docs generator were not run, the generated page cells were compared to the source comments by reading only, and the 80-file merge-from-main delta was not diffed in full. Range-diff and git show confirm the logical commit is the only non-main change. Once the wire reason is fixed, nothing else blocks merge. |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Addressed in 27357da: focus and type are now declared in the published-value exception and tested (the sparse-capture test runs over click, fill, focus and type, asserting find_snapshot_unreadable with verdictReason and verdictReasonCode 'sparse-tree'), so all four mutating find actions answer one reason. On moving the row to selectors/interaction-error.ts: it is possible, since selectors already depends on capture-kit and the module only type-imports ReasonTable, so the eager closure would not grow. But #4930 declares FIND_READ_REASONS byte-identically in capture-kit, and moving it here alone would declare the value in two places, which the reason-table guard refuses. I recommend keeping it and moving it in a follow-up after both PRs merge. |
This comment has been minimized.
This comment has been minimized.
|
One problem from the earlier review (7f08fae) remains at 27357da, and the rest is fixed. The new reason reference tells callers to retry with A bare ref outside the current partial frame produces this reason at ref-frame.ts:244-250. The touch route then passes it to interaction-ref-policy.ts:33-49. That code sets Could The PR has merge conflicts with main. CI shows 21 checks with none failing. Not verified here: tests were not run locally, and the regression validity was read from the diff and base code. Once the docs fix is in and the conflicts are resolved, nothing else stands in the way of merge. |
… one Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* origin/main: refactor(reasons): declare the platform-android reasons in ReasonTable rows (#4928) # Conflicts: # packages/replay-port/src/daemon-port/__tests__/session-replay-runtime-failure-response.test.ts # packages/replay-port/src/daemon-port/session-replay-runtime-failure-response.ts # website/docs/docs/error-reasons.md
|
At
On moving the sparse-find row into |
This comment has been minimized.
This comment has been minimized.
* origin/main: refactor(reasons): declare the R5 provider reasons in ReasonTable rows (#4932) # Conflicts: # website/docs/docs/error-reasons.md
This comment has been minimized.
This comment has been minimized.
|
The earlier findings from 27357da (#4936 (comment)) are addressed in f236a3d, but the change now drops replay diagnostics that the base kept. All 21 checks pass, and there are no conflicts. A native The claim that the table migration preserves caller-visible error behavior outside the declared reason replacements does not hold for this route. An in-memory comparison of the producer and replay serializer at d1ace81 and f236a3d shows that a sparse verdict with reason "sparse tree" is visible on base replay and absent on head replay. The only change to the replay serializer in the diff swaps the bounded-composite constant, so nothing carries the new fields. Please fix the projection above, or explain why replay should lose this detail. Could the shared find refusal row live in Not verified here: the reason-table guard and typecheck were not run locally; CI results are relied on. Merge should wait until the replay projection is fixed. |
…failure details Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rrives Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
At |
This comment has been minimized.
This comment has been minimized.
|
The earlier findings from 35245ab are fixed at 11c415c, but one docs problem remains in the new reference. The 21 checks pass, and the PR has merge conflicts with main. Before merge, main must be merged after #4930 lands. Only the changes since 35245ab were line-reviewed here. The error reference at error-reasons.md:483 says agent interactions wait until the human-control hold is released. That is not what the code does. During a hold, a state-changing call such as click is refused before dispatch: request-admission.ts:133 calls the registry, and lease-registry.ts:488 throws DEVICE_IN_USE with human_control_active. The HTTP test at human-control-http.test.ts:173 checks that click returns 423 while snapshot still succeeds, and commands.md:451 says the same. An agent that reads "wait" may treat the rejected click as pending and never resubmit it after release. Please change the HUMAN_CONTROL_REASONS row comment in human-control-contract.ts to say state-changing commands are refused while the hold is active and callers can retry after release, then regenerate the reference. Could both find routes use the capture-kit's sparseFindRefusal that is already on the #4930 branch, with each route wrapping the same message and details in its own response or error type? Today the daemon builds the typed refusal in find-target-capture.ts, while selector-read-utils.ts builds the same refusal on its own with the verdict prose as its reason. |
…e hold is released Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
At On |
* origin/main: feat(contracts): allow third-party snapshot producers (#4905) refactor(reasons): declare the R3 apple-runner reasons in ReasonTable rows (#4922) refactor(reasons): declare the R4 reasons in ReasonTable rows (#4934) refactor(snapshot): one shared model for occluding system surfaces (#4956) # Conflicts: # test/repo-guards/runner-refusal-reason-docs.test.ts # website/docs/docs/error-reasons.md
|
At |
This comment has been minimized.
This comment has been minimized.
|
The earlier findings at 11c415c are fixed in 12fb86c, except one docs problem and one claim that still needs an answer. All 21 checks pass at this commit, with none failing. The merge commit's upstream content from #4922, #4934 and #4905 was not re-reviewed, and no tests or typecheck were run here. The new row comment at errors.ts:329 says a step returning this reason drives a long-lived resource. That is not always true. A batch with a test step that has an attempt timeout returns the same reason with shape The claim "The bounded-composite refusal migration preserves the published contract while moving the reason into a ReasonTable row." did not hold up fully. The wire spelling is the same on base and head, from the producer in core/lease-context.ts through the batch, dispatch-disclosure, replay and test readers. The generated explanation overstates what that spelling means, as described above. Please either fix the explanation or explain why it is accurate. Could The sparseFindRefusal reuse question still waits on #4930 to merge, as the author said. After the docs fix, nothing else is needed before merge. |
…HTTP reads the human-control row Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
At
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Correction on the human-control question, at |
This comment has been minimized.
This comment has been minimized.
|
One docs problem remains at 58847f4. The earlier findings from 12fb86c are otherwise fixed, and no threads are open. The new |
…int says which Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
At |
This comment has been minimized.
This comment has been minimized.
|
The earlier findings from 58847f4 (#4936 (comment)) are fixed at 31ede65, but one docs problem remains. CI is green: 21 checks, none failing. The new |
…dence warn Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
At |
Apex Sentinel · ✅ Approve · review of
|
| 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.
|
The ref_frame_expired row now says mutations are refused and reads with retained evidence get a staleness warning, which matches ref-frame.ts and the read test. This addresses the last finding; nothing else blocks dcaa56d. |
* origin/main: fix(auth): send a stored CLI session only to the cloud that issued it (#4921) refactor(reasons): declare the daemon reasons in ReasonTable rows (#4936) fix(cli): drop --remote-config from auth and skip reading it for unsupported commands (#4957) refactor(snapshot): deduplicate system-surface projections and warnings (#4959) fix(find): enforce offscreen and non-hittable guarantees on focus (#4954) feat(auth): store a rotated CLI session credential and show the login code (#4833) fix(daemon): report Windows SIGTERM daemon exits as forced (#4659) # Conflicts: # packages/capture-kit/src/snapshot-quality-verdict.ts # packages/command-runtime/src/commands/interaction/runtime/target-visibility-stages.ts # packages/contracts/src/device-inventory.ts # packages/daemon/src/execution/interaction/internal/__tests__/find.test.ts # packages/daemon/src/execution/interaction/internal/find-target-capture.ts # packages/replay-port/src/daemon-port/session-replay-runtime-failure-response.ts # website/docs/docs/error-reasons.md
* refactor(reasons): declare the R6b reasons in ReasonTable rows Migrates the 59 published error.details.reason values of the R6b packages into ReasonTable rows beside the code that raises them, so every wire spelling is declared once and read as TABLE.member.reason. Three sites published prose or an internal code as their reason and now publish a typed value instead: the PNG and JPEG screenshot decoders (png_decode_failed / jpeg_decode_failed, decoder message moved to details.decoderError), the sparse-capture find refusal (find_snapshot_unreadable, verdict prose moved to details.verdictReason), and the snapshot router's cancelled rethrow (always request_canceled, the kernel-owned value it already carried in details). Regenerated website/docs/docs/error-reasons.md. * refactor(reasons): declare find_snapshot_unreadable in capture-kit, where both find paths load it The daemon find path (#4936) cannot import command-runtime, so the row lives in capture-kit/snapshot-quality-verdict.ts, byte-identical to #4936's declaration. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * refactor(reasons): keep the 15 module-local reason tables private Nothing imports them; the reasons collector also reads tables that are not exported. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * refactor(reasons): drop the settings app-not-consumed alias Its only reader was a test, which now asserts the published spelling. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * docs(reasons): say a contact sheet could not obtain usable extracted frames Also drops the JSDoc lines that repeated each row's summary comment. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * docs(reasons): cover over-budget frames in the contact-sheet extraction summary Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * refactor(find): build the sparse-capture refusal once in capture-kit for both find routes Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(replay): keep a sparse find refusal's scrubbed verdict in replay failure details Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * refactor(replay): split the cause-detail projection to stay under the complexity limit Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * docs(reasons): daemon_exit_unconfirmed covers every unconfirmed stop, not only a surviving process Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * docs(reasons): png_decode_failed covers any input that is not decodable PNG; assert the read-only find verdict code Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * refactor(replay): pass the sparse verdict code through unchanged, scrub only its prose Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(selectors): keep the off-screen reasons beside the module that publishes them interaction-offscreen.ts imported interaction-error.ts only to read two reason rows, which added a module to its eager closure and failed the closure budget. The rows now live in the module's own ReasonTable. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Summary
Declares the R1 daemon reasons (51 values) in
ReasonTablerows beside their classifiers. That adds 36 tables, anddaemon_shutting_downjoinsDAEMON_LIFECYCLE_REASONS. The imported constantsDAEMON_SHUTTING_DOWN_REASON,BOUNDED_COMPOSITE_RESOURCE_UNSUPPORTED_REASONandALERT_WAIT_WINDOW_TOO_LONG_REASONbecome rows, and their readers switch to them. The device-claim conflict union now comes from its table.Published-value change (prose reasons): the sparse-verdict refusals used to publish the runner's message as
reason. Now:find ... click|fill|focus|type(daemon route) answersfind_snapshot_unreadable. Read-onlyfind ... exists|wait|get textfollows in refactor(reasons): declare the R6b reasons in ReasonTable rows #4930.react-native dismiss-overlayanswersoverlay_snapshot_unreadable.The message moves to
details.verdictReasonand the code todetails.verdictReasonCode.FIND_READ_REASONSlives incapture-kit/snapshot-quality-verdict.ts, declared byte-identically in #4930. Merge #4930 first so bothfindpaths switch together.Value
Before / after
Only the two prose reasons change, as listed above. Every other spelling is byte-for-byte unchanged.
Validation
pnpm typecheckpasses.pnpm generate:reasons: page regenerated and committed.pnpm check:affected --run --head 478859bce8: all 11 runnable checks passed (exactCommit=true). Wire ledger re-pinshandleArtifactDownload(value unchanged).🤖 Generated with Claude Code
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.