[PR #7343] [MERGED] feat(cli): validate browser scenarios offline #7825

Closed
opened 2026-11-05 01:47:56 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/7343
Author: @gensokyo-dev
Created: 10/27/2026
Status: ✅ Merged
Merged: 10/27/2026
Merged by: @gensokyo-dev

Base: main ← Head: feat/scenario-offline-validation


📝 Commits (1)

  • 7d9d010 feat(cli): validate browser scenarios offline

📊 Changes

5 files changed (+562 additions, -20 deletions)

View changed files

📝 docs/browser-scenario-contract.md (+24 -0)
➕ docs/verification/browser-scenario-validation-2026-10-27.md (+57 -0)
📝 src/cliBrowserScenarioCommands.ts (+80 -20)
📝 src/cliCommandNames.ts (+1 -0)
➕ tests/boundary/cli/browserScenarioValidation.test.ts (+400 -0)

📄 Description

Summary

Fixes #5488. Adds rea validate-browser-scenario INPUT_JSON --json for checking a scenario before execution. Inline JSON, files and stdin share the capture command's input parser, caller-path normalization and canonical domain schema. Success returns only {"valid":true,"actions":7,"secrets":2}; invalid input returns the existing actionable field-path diagnostics and exit 1.

Integrates Ace's #7149 (463c8bd73) with attribution preserved. A shared CLI admission helper removes duplicated parsing/normalization; the execution lifecycle remains owned by the existing capture service. Validation has no provider/environment argument, reads no secret values, and stops before discovery, launch, attachment or navigation. Schema validity does not establish runtime resource/selector availability.

Scope decision: not applicable; this reads caller-selected JSON within the existing CLI/domain boundary and adds no target-execution authority. No MCP operation, Evidence, dependency or release-version change. CI generates the ignored CLI product catalog.

Executed validation

  • 24 passing tests / 3 focused suites, including throwing provider factory and enumerable secret-getter spies, unavailable launch/connect resources, semantic reference errors, file/stdin input, public exit codes, and existing capture diagnostics/summary publication.
  • Build, check:fast, docs:check, rendered docs:build, format:check and test discovery passed (2,628 files discovered exactly once). Initial test-helper typing errors were corrected before the final static gate.
  • Post-merge d109a3910: build and the public offline CLI smoke check passed again with the backend stopped and both secret variables unset; returned exactly {valid:true, actions:7, secrets:2}. No owned Node process remained after verification.
  • Preserved real PocketBase scenario: four public offline CLI invocations passed after stopping the backend and unsetting both declared secret variables, including nonexistent-browser and disconnected-CDP variants. The original file remained unchanged. This verifies offline admission, not browser execution.
  • Each reply: 38 bytes / 14 estimated o200k tokens; complete executable/script/CLI argv + parsed result: 75–77 estimated tokens. Per invocation 1.56–1.72 s elapsed, 1.88–2.01 s CPU, 217–219 MB sampled process-family peak. Fresh processes with warm filesystem caches; no equivalent earlier public offline workflow or comparative speedup claim. No model billing; shell/profiler framing is unmeasured.

Two CPUs, 3 GiB Node heaps and an 8 GiB family guard bounded local work; no resource stop. Verification and limits. Final CI run 40426216386 has 22,356 passed / 5 failed in the retained test reports. All five failures independently reproduce on its exact main parent 0ddde829b2a4ceb6ad1f883d1dd2aebb7305ac2e: bundle-root inventory, two SAZ assertions and two extraction-cleanup assertions. Static/docs/build, real browser/Web network/EVM/binary layout/JavaScript recovery, agentenv, both recorded-crash containers, all four selected Node/SQLite checks, Windows build and Linux native baseline pass.

All cancelled-shard logs were inspected, including individual failure indicators omitted from aggregation. A traversal assertion also reproduces on that parent. One cancelled shard recorded a 30-second Markdown formatting timeout; that managed-artifact test and formatting path are unchanged, its exact main CI passes the case, and the full 23-case file passes on both main and PR in bounded local runs. The original timeout remains unreproduced and cancelled coverage remains incomplete; neither is claimed as passing CI.

Automatic Codex review was refused by the repository usage limit; there are no inline finding threads and no successful fresh automated review is claimed. The user authorized admin bypass; baseline failures, cancelled coverage and the unreproduced timeout are recorded above, and human-readiness declarations remain unchecked.

Author readiness

Human owner: @gensokyo-dev (account selected by the user; no human-review attestation made).

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

The user explicitly authorized a non-draft PR and admin bypass of this unchecked readiness gate without filling these declarations, plus bypass of independently proven unrelated main failures. This does not assert human review occurred.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/7343 **Author:** [@gensokyo-dev](https://github.com/gensokyo-dev) **Created:** 10/27/2026 **Status:** ✅ Merged **Merged:** 10/27/2026 **Merged by:** [@gensokyo-dev](https://github.com/gensokyo-dev) **Base:** `main` ← **Head:** `feat/scenario-offline-validation` --- ### 📝 Commits (1) - [`7d9d010`](https://github.com/morluto/rea/commit/7d9d0106650c797ba94c19e3151e78d2e12f50e2) feat(cli): validate browser scenarios offline ### 📊 Changes **5 files changed** (+562 additions, -20 deletions) <details> <summary>View changed files</summary> 📝 `docs/browser-scenario-contract.md` (+24 -0) ➕ `docs/verification/browser-scenario-validation-2026-10-27.md` (+57 -0) 📝 `src/cliBrowserScenarioCommands.ts` (+80 -20) 📝 `src/cliCommandNames.ts` (+1 -0) ➕ `tests/boundary/cli/browserScenarioValidation.test.ts` (+400 -0) </details> ### 📄 Description ## Summary Fixes #5488. Adds `rea validate-browser-scenario INPUT_JSON --json` for checking a scenario before execution. Inline JSON, files and stdin share the capture command's input parser, caller-path normalization and canonical domain schema. Success returns only `{"valid":true,"actions":7,"secrets":2}`; invalid input returns the existing actionable field-path diagnostics and exit 1. Integrates Ace's #7149 (`463c8bd73`) with attribution preserved. A shared CLI admission helper removes duplicated parsing/normalization; the execution lifecycle remains owned by the existing capture service. Validation has no provider/environment argument, reads no secret values, and stops before discovery, launch, attachment or navigation. Schema validity does not establish runtime resource/selector availability. Scope decision: not applicable; this reads caller-selected JSON within the existing CLI/domain boundary and adds no target-execution authority. No MCP operation, Evidence, dependency or release-version change. CI generates the ignored CLI product catalog. ## Executed validation - **24 passing tests / 3 focused suites**, including throwing provider factory and enumerable secret-getter spies, unavailable launch/connect resources, semantic reference errors, file/stdin input, public exit codes, and existing capture diagnostics/summary publication. - Build, `check:fast`, `docs:check`, rendered `docs:build`, `format:check` and test discovery passed (**2,628 files discovered exactly once**). Initial test-helper typing errors were corrected before the final static gate. - Post-merge `d109a3910`: build and the public offline CLI smoke check passed again with the backend stopped and both secret variables unset; returned exactly `{valid:true, actions:7, secrets:2}`. No owned Node process remained after verification. - Preserved real PocketBase scenario: four public offline CLI invocations passed after stopping the backend and unsetting both declared secret variables, including nonexistent-browser and disconnected-CDP variants. The original file remained unchanged. This verifies offline admission, not browser execution. - Each reply: **38 bytes / 14 estimated o200k tokens**; complete executable/script/CLI argv + parsed result: **75–77 estimated tokens**. Per invocation **1.56–1.72 s elapsed**, **1.88–2.01 s CPU**, **217–219 MB sampled process-family peak**. Fresh processes with warm filesystem caches; no equivalent earlier public offline workflow or comparative speedup claim. No model billing; shell/profiler framing is unmeasured. Two CPUs, 3 GiB Node heaps and an 8 GiB family guard bounded local work; no resource stop. [Verification and limits](docs/verification/browser-scenario-validation-2026-10-27.md). Final [CI run 40426216386](https://github.com/morluto/rea/actions/runs/40426216386) has **22,356 passed / 5 failed** in the retained test reports. All five failures independently reproduce on its exact main parent `0ddde829b2a4ceb6ad1f883d1dd2aebb7305ac2e`: bundle-root inventory, two SAZ assertions and two extraction-cleanup assertions. Static/docs/build, real browser/Web network/EVM/binary layout/JavaScript recovery, agentenv, both recorded-crash containers, all four selected Node/SQLite checks, Windows build and Linux native baseline pass. All cancelled-shard logs were inspected, including individual failure indicators omitted from aggregation. A traversal assertion also reproduces on that parent. One cancelled shard recorded a 30-second Markdown formatting timeout; that managed-artifact test and formatting path are unchanged, its exact main CI passes the case, and the full 23-case file passes on both main and PR in bounded local runs. The original timeout remains unreproduced and cancelled coverage remains incomplete; neither is claimed as passing CI. Automatic Codex review was refused by the repository usage limit; there are no inline finding threads and no successful fresh automated review is claimed. The user authorized admin bypass; baseline failures, cancelled coverage and the unreproduced timeout are recorded above, and human-readiness declarations remain unchecked. ## Author readiness Human owner: @gensokyo-dev (account selected by the user; no human-review attestation made). - [ ] I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work. - [ ] I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps. - [ ] I declare this PR ready for initial maintainer review. The user explicitly authorized a non-draft PR and admin bypass of this unchecked readiness gate without filling these declarations, plus bypass of independently proven unrelated main failures. This does not assert human review occurred. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-05 01:47:56 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#7825
No description provided.