Repository navigation
feat(browser): report what a click, type or select changed - #37245
Conversation
UX Review (Opus 5.5) — ✅ PASSUX-level review of UX-Verdict: PASS Nothing blocks. The one visible addition is the Notes
[UX-REVIEWED] 448370f Description read[DESCRIPTION-READ] 75a105e7f0c5424f00c39b7f94081abbe2104d2beb362e0babaf9c042e716a47 That sha256 names everything this verdict read: the PR description, plus the 5 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: the setting is opt-in, takes nothing away, and is easy to revert. Rendered evidence of the setting is attached. Notes
[DESIGN-REVIEWED] 448370f Description read[DESCRIPTION-READ] 59a0f865abd145cb6d99c7ce21e13d54c9f2688cc743577edcce13f6640989fd That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks: the feature is opt-in (default off), each new piece of surface has an in-tree consumer, and no existing mechanism produces a deterministic before/after report. Inventory (10 items) — 9 justifiedIntent: let the agent learn what a click, type or select did without spending a
[FIRST-PRINCIPLES-REVIEWED] 448370f Description read[DESCRIPTION-READ] 9d28d6d98fe235fed972b2507a45c88bf420f3e19445183aebefbabfba7f4a2c That sha256 names the PR description this verdict read. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Review detailsNo findings. Notes:
[OPUS-REVIEWED] 448370f Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
ecf45a3 to
558495c
Compare
|
Thanks for the review. Both blocking findings are fixed in
Design note, the read before a hook that does not run the action. The page is now read right before the handler, inside the path the decision hook calls, so a hook that answers by itself, or a |
Code change approver recommendation: A person should decideWhy: the decider thinks the change is probably fine but estimates a 22% chance that this change introduces a defect, above the 12% limit for approving on its own. The opt-in An automated recommendation, not a review: a maintainer still decides. It approves on its own only when the estimated chance of a defect is at most 12% and the change has at most 400 changed lines. Decider v3c (217fe607) · commit |
558495c to
d9b4f95
Compare
|
Thanks for the review. Both blocking findings are fixed in First principles, the second address scrubber.
Design note, the 12 s on the tool's HTTP timeout with the setting off. Not changed. The tool reads its timeout before it knows whether the gateway will report changes, since the setting is read fresh by the gateway for each op, so the timeout has to cover the setting being on. It only shows when the gateway does not answer. |
d9b4f95 to
06e81f4
Compare
|
Redaction registry (code change approver). Fixed in 06e81f4. Design note ( First-principles note (off by default, cost not measured). Not changed. Measured in headless Chromium on a page with 91 controls: |
Sensitive change review
|
bc9db4d to
b47dd16
Compare
|
SAST (Semgrep) |
Sensitive change review
|
b47dd16 to
cc41cc2
Compare
|
JavaScript dialog messages are truncated before redaction ( |
Sensitive change review
|
cc41cc2 to
d6a0a4a
Compare
|
Invisible descendant text breaks credential redaction ( The walker's To close the class, |
Sensitive change review
|
A click, type or select_option answers with the point it hit and nothing about what the page did, so the agent reads the page again after each step to learn whether a dialog opened, an error appeared or the page moved. With the new browser.report_changes setting on (off by default), those three ops read the page cheaply before and after the action and add a changes report: the new address and title, dialogs that opened or closed, new alert and validation text, and the controls that appeared or went away. A JavaScript dialog the step opened is reported without reading the page it holds. Page text is cut to bounded redacted lines, a field is named by its label and never by its value, and a page that cannot be read leaves the step's own result with a warning.
d6a0a4a to
448370f
Compare
|
Field descendants bypass the secret-field exclusion ( The ID limit returns partial names before redaction ( Split Google API keys bypass the compacted-token check ( |
Sensitive change review
|
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
We reviewed this at head 448370f. Every new page read runs inside the existing decision gate, after the URL refusal check, and uses the isolated-world walker. A refused redirect during the wait becomes the op's answer. Any other read failure becomes a warning, so the action's own result is never lost. With the setting off, the result and the helper calls stay byte-identical, which test_off_the_result_and_the_helper_calls_are_what_they_were pins. The route budget grows only for click, type and select_option, and only while the setting is on. The tests are deterministic: they use injected fake sleeps, have no wall-clock barriers, and keep all state under tmp_path.
Done well: the bounds are layered (a per-read bound inside the before and after bounds, matched to _op_budget). The redaction tests are built from the redaction format table at run time, so a format added later is covered automatically.
Security: the feature only adds output. It reads no field values or validation messages. Page text is redacted before any cut, and a string that is too long is left out whole rather than cut. The changes key goes through the same tool-text redaction as snapshot output, and a test pins that. No gate allows anything that main refuses.
Optional:
- The Backwards compatibility section could say that the shim's fast-op timeout (
SHIM_FAST_TIMEOUT_S, budgets.py:111) now grows 12 s for every user, setting on or off. Only the route budget is unchanged when the setting is off. - No test covers the walker setting
cappedortruncated(snapshot_walker.js around :1274 to :1317). A vitest case with 11 alerts, dialogs or invalid fields, or more than the scan cap, would pin the walker half of the "never reported as unchanged" promise. - A follow-up could add the
glanceread, thechangesshape and the new budget term to docs/system-specs/modules/browser.md. It could also move the change-report wiring out of ops.py, which is now past 1,600 lines, into a sibling module.
Problem / Motivation
Goal: A
click,typeorselect_optiontells the agent what the page did, so it does not need asnapshotafter every step to find out.With the new
browser.report_changessetting on (default off), the three ops read the page before and after the action and add achangesreport to their answer: the new address (without query, fragment or path parameters) and title, a dialog that opened or closed, new alert or status text, the fields that failed validation (named, never quoted), and the controls that appeared or went away. A JavaScript dialog the step opened (#37101) is reported asjs_dialog.Page text is read as the page shows it and redacted before it is cut. Inline pieces join with no space, so a token split across
<code>elements reads whole; a space goes only where the page holds white space, a block starts or a line breaks. The walker never cuts text: a name past 240 characters or a message past 640 (four times the display caps) is left out whole, and a message left out readsa message too long to show. The gateway then removes credentials and exfiltration links, then cuts for display to 60 or 160 characters. A string past 2,000 characters is left out; an address too long to read readsan address too long to show. A JavaScript dialog's message is read uncut, so it too is redacted before any cut. Undrawn text (display: none,visibility: hiddenorcollapse) adds nothing. Text holding a token once its white space is removed is left out (a message that could not be shown): a prefixed rule (ghp_,eyJ...) or any token format the structured detectors know (a Google API key among them) finds it, read from each known prefix to each word end. A name built fromaria-labelledbyelements is read whole or not at all (more than four ids, a piece inside a field or too long: no name).What is never read: any text inside a field, any alert, dialog or control inside one, and their attributes (
aria-label,title,alt,placeholder). One test,fieldish, decides what a field is (native input, textarea or select, an editable region, an inputrole, or a shadow host holding one). A secret field is left out whole from the controls and the invalid list. A validation message is not read at all, since it can repeat what was typed in any form.Why it matters
Each extra
snapshotis a turn. On a page with 91 controls, a click that raised an error banner reports 29 characters; the outline it replaces is 2,733.Not a goal
hover,press_key,scroll,dragandreflexare not changed. No new refusal, no new argument.What changed
snapshot_walker.js: aglancemethod returns the address, title, onerole|namekey per visible control, dialogs, alert and status text, and invalid fields, native or custom (any element markedaria-invalidthat passes the field test). It adds no regular expression.change_report.py(new): folds two reads into the report; one line per text, redacted throughredact_via_context, then cut. Lists keep 8 entries. The address goes throughrecording.clean_url. A list the walker cut short readsnot compared.ops.py,budgets.py,dashboard/handlers/browser_ops.py:OpContext.report_changesand the wiring inrun_op. The page is read only when the action runs, within bounds (4 s before, 8 s after). A page that cannot be read leaves the action's result in place with awarning. The route budget grows 12 s only while the setting is on.security_posture_sinks_gateway.py: the report is a listed redaction sink.config/sections_browser.py,config-baseline.json, docs and theweb-browseskill: the setting, default off.Backwards compatibility
Off by default. With the setting off no helper is called that was not called before, no key is added to a result and the route budgets are unchanged (
test_off_the_result_and_the_helper_calls_are_what_they_were,test_the_route_budget_counts_the_report_only_while_it_is_on). With it on,click,typeandselect_optiongain achangeskey (or awarning) and nothing else.Tests
2304233aef, 25 of the new tests fail (noreport_changes, noglance).::1brackets; R2;jsessionid=, secret fields in the invalid scan; R3-R4 a field's value through an alert, label, heading or message; R5synthetic_credentials; R6 cut before redaction, no regex; R7 a token split across inline elements; R8 a fixture; R9 a dialog message cut before redaction; R10 undrawn text inside a token.aria-labelinside a secret editor, a name cut at the fourth of five ids, a split Google API key (36 vitest and 10 pytest cases fail ond6a0a4afdc5d).test_browser_change_report.pywith the security-posture, import-budget, walker-world, browser-config and harness-ops suites: 386 passed. The 8snapshotWalker.*.test.tsfiles: 731 passed. Lint, type, black, comment-history, sync-I/O and ratchet gates pass, andeslintandtscinwebsite/.python -m pytest test/test_browser_change_report.py -n0and, inwebsite/,npx vitest run src/test/snapshotWalker.glanceFields.test.tsManual verification
Ran the walker in headless Chromium around each action: a click that raised an alert and a
<dialog>reads both and the new controls; an invalid field reads as its name only; no field value, password or token appears. Split-token layouts read whole or are left out: nine inline layouts leaked onfd7c797f4e29, three undrawn-text splits oncc41cc2506d0, and nine of eleven round-11 layouts (chips and dialogs inside fields, five-id names, split Google-format keys) ond6a0a4afdc5d; none leak now. On 91 controlsglancetook 3.3 ms against 7.5 ms forsnapshot. Not exercised: the full gateway path with a live agent session.Settings › Advanced, off by default:
Sibling sweep
Sibling:
src/kiro_crew/browser_harness/reflex.py-- not affected -- calls the op handlers directlySibling:
src/kiro_crew/browser_harness/decide.py-- not affected --verifyhint unchangedSibling:
src/kiro_crew/browser_harness/recording.py-- reused --clean_urlscrubs the addressPattern harvest
Rule candidate: review-prompt
Pattern: an op that adds page text to its answer needs a bound, one-line cleaning and the shared redaction at a sink.
Related Issues
None filed.
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement