Skip to content

feat(cli): validate browser scenarios offline - #7343

Merged
gensokyo-dev merged 1 commit into
mainfrom
feat/scenario-offline-validation
Oct 27, 2026
Merged

gensokyo-dev merged 1 commit into
mainfrom
feat/scenario-offline-validation

Conversation

@gensokyo-dev

@gensokyo-dev gensokyo-dev commented Oct 27, 2026 •

Copy link
Copy Markdown
Collaborator

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.

Fixes #5488. Integrates the validation-only command from #7149 with shared CLI admission and public offline boundary coverage.

Co-authored-by: Ace <[email protected]>
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-10-27T00:24:41.188170Z
We couldn’t complete this review. Comment @codex review to try again.
7d9d010 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@greptile-apps

greptile-apps Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no actionable defects were found.

Summary

Adds validate-browser-scenario for offline checks using the same input parser, path rules, and schema as capture.

  • Browser scenarios can now be checked before a browser run.

No actionable issues found. Tests were inspected, not run during this review. Checking whether another PR supersedes this one was blocked by unavailable GitHub authentication.

gensokyo-dev explicitly acknowledged the unchecked readiness declarations and stated that the user authorized bypassing that gate without claiming human review.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Inline JSON, file, or stdin] --> B[Shared input parser]
  B --> C[Resolve caller-relative paths]
  C --> D[Canonical scenario schema]
  D -->|Invalid| E[Existing field-path errors]
  D -->|Valid: validate command| F[Return validity and counts]
  D -->|Valid: capture command| G[Create provider and run capture]
Loading

Reviews (1) · Last reviewed commit: "feat(cli): validate browser scenarios of..." · Reviewed by Greptile

@gensokyo-dev
gensokyo-dev merged commit d109a39 into main Oct 27, 2026
33 of 46 checks passed
@gensokyo-dev
gensokyo-dev deleted the feat/scenario-offline-validation branch October 27, 2026 00:47
@github-actions github-actions Bot mentioned this pull request Oct 27, 2026
3 tasks done
@morluto morluto added area: cli CLI adapter and one-shot commands enhancement New feature or request labels Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: cli CLI adapter and one-shot commands enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Add a validation-only command for browser scenario files

2 participants