Repository navigation
refactor(reasons): declare the R6b reasons in ReasonTable rows - #4930
Conversation
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Apex Sentinel: 1 new finding on 5fb2666. The verdict and the full list are in the summary comment.
|
The PR is ready at 5fb2666. Not blocking, and fine to take or leave: the old alias constants SETTINGS_APP_NOT_CONSUMED_REASON, REPLAY_TARGET_GUARD_MISMATCH_REASON and MAESTRO_TEST_FAILURE_REASON still exist beside the tables, so importers could read TABLE.member.reason and the aliases could go; daemon_retirement_unconfirmed is still a literal in https://github.com/callstack/agent-device/blob/5fb2666/packages/daemon-contracts/src/daemon-stop.ts#L155 and could be declared once here or in the R1 batch; the jpeg_decode_failed row comment in https://github.com/callstack/agent-device/blob/5fb2666/packages/capture-kit/src/png.ts#L15 could also mention the pixel budget refusal; and the contact sheet rows carry both a JSDoc and a near-identical // comment, so one would do. The checks are green: 8 checks, none failing at 5fb2666. The PR has merge conflicts with main. Before merge, it needs a rebase onto main (d6767e0, which includes the platform-apple reason tables from #4924) and a regenerated website/docs/docs/error-reasons.md. The open inline thread on the find route reason (#4930 (comment)) still applies as a non-blocking follow-up for the R1 daemon batch. Not verified here: the exact 59 values / 66 sites count, local test runs and generate:reasons (CI was relied on), and out-of-repo consumers of the old decoder or verdict strings. |
|
At |
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.
7d88003 to
50d8c3c
Compare
Size Report
Startup median (7 runs, lower is better):
|
Nothing imports them; the reasons collector also reads tables that are not exported. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Its only reader was a test, which now asserts the published spelling. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This comment has been minimized.
This comment has been minimized.
|
The earlier clean review at 5fb2666 (#4930 (comment)) no longer fully holds: f79abea has one docs problem left. The code itself looks right, and all 21 checks pass at f79abea. No conflicts. The new frameExtractionFailed row on the error reasons page says frame extraction ran. That is not always true. If the decoder executable is missing at launch, spawn throws ENOENT. contact-sheet-frames.ts:105 forwards that error to throwExtractionFailure, which emits contact_sheet_frame_extraction_failed before the decoder has started. The test at contact-sheet-frames.test.ts:259 already covers this case. An agent that reads the reference can conclude the decoder ran and look at the recording, when the real fault is the decoder launch. The rule: each row summary must hold for every path that emits that reason. Please change the frameExtractionFailed summary in contact-sheet-report.ts:16-17 to say the contact sheet could not obtain usable extracted frames, then regenerate error-reasons.md. Not verified here: the output of pnpm generate:reasons at this head, and no CI check compares error-reasons.md with the generator output, so drift would not be caught automatically. Could the managed agent-browser response refusal table and the batch reason type be private to agent-browser-provider.ts, beside sendTextEntry, fetchRefRects and parseBatchEntries? Those are the only production readers, and they classify the response contents. agent-browser-tool.ts owns process execution and returns an ExecResult. The open inline thread on the daemon find sparse refusal (#4930 (comment)) does not apply: the thread author no longer raises it at f79abea, and that refusal is untouched by this PR and is covered by #4936. Once the summary is fixed and the page regenerated, nothing else stops this PR. |
…frames Also drops the JSDoc lines that repeated each row's summary comment. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
At |
This comment has been minimized.
This comment has been minimized.
|
This PR is ready at 95fd770, and the findings from the earlier review (#4930 (comment)) are now fixed. CI is green with 21 checks and none failing. No conflicts. Nothing else blocks the merge. Not blocking: the summary in https://github.com/callstack/agent-device/blob/95fd770/packages/capture-kit/src/recording/contact-sheet-report.ts#L16 ends with "the extractor failed to start or run", but contact-sheet.ts also emits this reason when the extractor returns an over-wide or over-budget frame, so you could say "failed to start, run, or return frames the sheet can use". Take it or leave it. Not verified here: The open inline thread #4930 (comment) (find path prose) is still accurate, but the fix is scoped to #4936 and the base already published that prose, so it does not block this PR. |
* 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: # packages/platform-harmonyos/src/app-lifecycle.ts # website/docs/docs/error-reasons.md
…on summary Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
At |
This comment has been minimized.
This comment has been minimized.
|
The code at 76c74b4 looks correct, and the generated R6b rows match the declarations in a manual diff. All 21 checks pass, and no review threads are open. The earlier review at 95fd770 found nothing to fix, and that still holds. Not verified here: generate:reasons and the tests were not rerun locally, so this rests on CI and the diff read. No conflicts were reported. Could agent-browser-provider.ts own the reply-refusal table and keep AgentBrowserBatchRefusal private, next to the text-entry and geometry checks that use them? |
|
On the simplicity question: I tried it and reverted it. |
|
The answer settles the simplicity question at 76c74b4: moving the table would push agent-browser-provider.ts past the 1,000-line limit, and the generated-reasons evidence covers the rest. The head now conflicts with main, so please rebase and push; the rebased head gets a delta review. |
This comment has been minimized.
This comment has been minimized.
|
Reviewed 7d577f1. The earlier conflict from 76c74b4 is resolved, and CI is green (21 checks, 0 not passing). One defect remains, and the declared wire change does not yet hold for mutating find. A mutating find such as The PR text says the declared sparse find reason applies to both read-only and mutating find. At 7d577f1 only the read-only formatter in selector-read-utils.ts:43-47 uses the new row. Please make the code match that claim as described above. The updated runtime wait test at selector-read.test.ts:236-299 covers the read-only route and passes through the real Could capture-kit own the sparse find refusal details beside its existing reason row, with the read-only and mutating routes each keeping their current error wrapper? Both routes already depend on snapshot-quality-verdict and currently assemble the same refusal independently. The other changes look right. A range-diff shows the six logical patches carried forward unchanged from 76c74b4, and the agent-browser batch refusal type and its seven rows are used only by that provider. Not verified here: the reasons generator and the test suite were not run locally, and the generated page was checked by text comparison against the row sources. After the mutating route is fixed, no further change is needed before merge. |
|
On the simplicity question: not in this PR.
|
|
The design answer covers the open question at 5e458f1. capture-kit owns the sparse verdict that triggers the refusal, the move would add no reach and remove nothing, and moving the builder again would cost another round on this PR and #4936. The selectors question is tracked in #4937. Nothing else blocks this head. |
* 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: # website/docs/docs/error-reasons.md
|
At |
This comment has been minimized.
This comment has been minimized.
|
The conflict from the earlier review (5e458f1) is fixed. At ba67ebb, CI is green (21 checks, none failing) and there are no conflicts. One docs problem remains before merge. The new The summary for Not verified here: the page regeneration. The generator failed locally with |
… not only a surviving process Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
At |
This comment has been minimized.
This comment has been minimized.
|
Two items remain at b4c9bd6; the earlier summary finding from ba67ebb is fixed. The The new The claim that the migration preserves the caller-visible failure details of both production find routes on a sparse snapshot does not hold. At the merge base and at caa232e, both find wrappers returned Could The approve comment on b4c9bd6 reports no open findings, and that matches the fixed summary finding above. CI is green, with 21 checks and none failing. Only the delta and the |
…le PNG; assert the read-only find 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 findings from b4c9bd6 are fixed at 7c0c244. The new commit changes a comment, a test assertion and a docs row, and all 21 checks pass. The reviewed code looks correct, but one thing is still missing before merge: Not verified here: the tests were not run locally, so the author should confirm the run on this head. Not blocking, and fine to take or leave: a sparse find during replay with an active variable such as QUERY=tree reports details.verdictReasonCode as |
…ub only its prose Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Test evidence and the optional note, at
|
This comment has been minimized.
This comment has been minimized.
|
4db8a3a forwards verdictReasonCode unscrubbed and scrubs only verdictReason, which closes the last note. The PR now conflicts with main; please rebase and it can be labeled. |
* 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
|
At
|
|
At 31fd73c the code looks good, and the earlier note about the scrubbed verdictReasonCode is fixed in session-replay-runtime-failure-response.ts (lines 154-158), with a test in session-replay-runtime-failure-response.test.ts (lines 122-148). The Coverage check failed, but the log shows no failing test or assertion, and this change only touches the replay-port cause-detail key lists, so it looks unrelated. Not verified here: the exact Coverage failure, a local test run, or the upstream-merged hunks from the rebase beyond confirming the first 11 commits are identical. There are no conflicts. Before merge, re-run Coverage and confirm it is green; a failure in replay-port or a reason-table test would change this. |
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.
…blishes 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>
|
At |
Summary
Declares the 59 published
error.details.reasonvalues of the R6b packages inReasonTablerows beside the code that classifies them, so every wire spelling is declared once, documented by its row comment, and read asTABLE.member.reason.Three sites published prose or an internal code as their reason. They now publish a typed value, and the old text moved to another details key. These are published-value changes:
png_decode_failed/jpeg_decode_failed, decoder message indetails.decoderError.findon a sparse capture, on both the read-only and the daemon (click, fill, focus, type) routes:find_snapshot_unreadable, with the verdict prose indetails.verdictReasonand its code indetails.verdictReasonCode. Both routes build this from one capture-kit helper,sparseFindRefusal.request_canceledalways, the value its details already carried; the internalabort-signalcode never reached callers.Value
59 values / 66 sites became table rows. Tables went 18 -> 43 and the generated page 76 -> 138 documented rows.
Before / after
Before: literals and one-off consts, three prose reasons, one undeclared router value.
After: one row per value, each read at its raise sites; the router reuses the kernel's exported
REQUEST_CANCELED_REASON.Validation
pnpm build,check:quick,check:layering(R89: 313 sites in 165 files against 352 in 185 at merge-base),generate:reasonscommitted, reason-table and repo guards, and the affected suites.🤖 Generated with Claude Code
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.