Repository navigation
docs(browser): add an interaction example that captures the visible result - #750
Conversation
…esult Fixes morluto#728 Co-authored-by: Cursor <cursoragent@cursor.com>
|
Added follow-up commit Verified the documented JSON through the named input contract (focused test passed), then ran it through real REA CLI/Chromium against a local delayed-render page: click-only returned complete captures showing |
|
Thanks, @akram1089, for your work on “docs(browser): add an interaction example that captures the visible result.” I appreciate your contribution to REA. |
Summary
Fixes #728.
The browser scenario contract only shows a minimal scenario whose default capture is the final sanitized URL. When an interaction changes the page without navigating (for example, a Search button that renders results in place), that default result reports a successful click and an unchanged URL, and cannot answer what the page displayed. This PR adds a worked interaction example that explicitly selects the artifacts that answer the question, and explains how to choose captures and how to read
not_requestedversuscomplete.Problem and expected behavior
capture(at_end: ["url"]). Readers following it for a click interaction get acompletecapture that contains only an unchanged URL.capture.at_end: ["dom", "accessibility", "url"], the equivalent CLI scenario-file flow, guidance on when to request DOM/accessibility, screenshots, history/storage, or event families, and a clear explanation thatnot_requestedmeans "not observed" and thatcompleteness: completecovers only requested sections.Change and scope
docs/browser-scenario-contract.md: new "Interaction example: capture the visible result" section after the minimal example. It contains the scenario JSON from the issue, therea capture-browser-scenario ./browser-search.json --jsonflow, an MCP note, capture-selection guidance, and thenot_requested/completeexplanation.README.md: one sentence in "Controlled browser scenarios" noting that the default retains only the final URL, and pointing to the new example.tests/boundary/cli/productCatalog.test.ts: the existing guard parsed only the firstjsonblock of the contract doc through thecapture_browser_scenarioinput schema. It now parses everyjsonblock, so the new example is checked against the real contract and cannot drift. The fence regex also accepts CRLF, so the test no longer fails on Windows checkouts withcore.autocrlf=true. It previously failed there with "Missing browser scenario example".Not included: no schema, default, or behavior changes, and no new action or origin-permission mechanism (as the issue requests).
Contract and boundary impact
docs/product-catalog.json), package, or installation impact: noneEvidence and regression coverage
admits every documented browser scenario through the named contractnow validates all JSON examples indocs/browser-scenario-contract.mdagainstcapture_browser_scenario'sinputSchema. It also asserts that at least two examples exist.src/domain/browserScenarioValues.ts: theclickaction with acsslocator,timeout_ms, thecapture.at_endsnapshot kinds, and the event family names. Capture state names were verified againstsrc/domain/browserScenarioCaptureValues.ts:not_requested, andcompleteness.statusvaluescomplete,incomplete, andtruncated.Validation performed
npx vitest run tests/boundary/cli/productCatalog.test.ts -t "browser scenario": passed (1 passed)npx oxfmton the three changed files: formatted, no remaining issuesproductCatalog.test.tsneed a builtdist/and fail identically on unmodifiedmainin this environment. They are unrelated to this change.Compatibility, safety, and release
Review checklist
type(scope): outcome.