Repository navigation
Conversation
[Low impact] The change reaches the browser-scenario CLI workflow. The PR appears safe to merge; the unused test provider is a non-blocking cleanup. Findings
Fix with agent prompt### Issue 1
tests/boundary/cli/browserScenarioValidation.test.ts:36-47
The `provider` in `registerValidatingCli` is never passed to the command, so its methods cannot catch a regression. The extra setup makes the test look like it checks more than it does. Remove this object, `void provider`, and the now-unused imports and `providerIdentity`. Keep the throwing `createProvider`, which actually guards against browser startup.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.SummaryAdds
z2Ace0107 explicitly states that validation errors retain Tests were not run during this review. Supersession and existing GitHub review threads could not be checked because GitHub authentication was unavailable. Reviews (1) · Last reviewed commit: "feat(cli): validate a browser scenario w..." · Reviewed by Greptile |
| const provider: BrowserScenarioCapturePort = { | ||
| identity: () => providerIdentity, | ||
| captureScenario: async () => | ||
| err( | ||
| new AnalysisCapabilityUnavailableError( | ||
| providerIdentity.id, | ||
| "capture_browser_scenario", | ||
| "validation must not reach a provider", | ||
| ), | ||
| ), | ||
| close: async () => undefined, | ||
| }; |
There was a problem hiding this comment.
Unused provider checks nothing
The provider in registerValidatingCli is never passed to the command, so its methods cannot catch a regression. The extra setup makes the test look like it checks more than it does. Remove this object, void provider, and the now-unused imports and providerIdentity. Keep the throwing createProvider, which actually guards against browser startup.
Prompt To Fix With AI
This is a comment left during a code review.
Path: tests/boundary/cli/browserScenarioValidation.test.ts
Line: 36-47
Comment:
**Unused provider checks nothing**
The `provider` in `registerValidatingCli` is never passed to the command, so its methods cannot catch a regression. The extra setup makes the test look like it checks more than it does. Remove this object, `void provider`, and the now-unused imports and `providerIdentity`. Keep the throwing `createProvider`, which actually guards against browser startup.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
|
Thanks for the validation-only workflow. #7116 also addresses #5488, but proposes a |
Add validate-browser-scenario for offline schema and semantic checks of inline JSON, local files and stdin. Return compact validity/action/secret counts without reading secret values or discovering, launching, attaching to or navigating a browser. Execution and validation share CLI input admission and the canonical domain schema. Preserve existing capture lifecycle, diagnostics, cancellation and caller-relative executable paths. Integrates #7149 with attribution. Fixes #5488. Validation includes 24 focused tests, static/build/docs checks, and the preserved real PocketBase scenario with its backend stopped and secret variables unset. Verification and resource/token measurements are recorded in docs/verification/browser-scenario-validation-2026-10-27.md. Co-authored-by: Ace <[email protected]>
|
Closing as superseded by an upstream implementation of the same command.
Note the linkage: this PR addressed #5488, while the merged work references a Verification recorded for this branch before closing: 7 boundary tests passing, |
feat(cli): validate a browser scenario without launching a browser
Summary
Fixes #5488.
Problem and expected behavior
A browser scenario carries actions, selectors, storage seeds and secret
references. Today the only way to learn that a scenario is invalid is to run
capture-browser-scenario, which has already resolved a provider by the timethe schema is checked. Issue #5488 asks for a validation-only workflow that
reuses the same canonical schema and semantic validation but stops before
browser discovery, launch, attachment, or navigation.
Change and scope
validate-browser-scenarioshares the capture command's input path exactly: thesame
parseCliJsonInput, the sameresolveCliJsonPathsforbrowser.executable_path, and the samebrowserScenarioSchemarefinement.Duplicate or reserved step IDs, duplicate secret identities and
environment-variable names, undeclared secret references, request-step
violations, and unknown fields are therefore rejected here with the same field
paths capture reports, so a correction made here is the correction capture
needs. Failures reuse
analysisInputErrorFromIssues, so the reported operationstays
capture_browser_scenario.Deliberately not included: no new MCP operation (CLI-only command); no read of
secret environment variables, so a scenario whose declared variables are unset
still validates, because the missing-value failure belongs to capture; no check
that the browser executable or CDP target exists on the host. The scenario
contract itself (
src/domain/browserScenario.ts) is unchanged.Contract and boundary impact
(
src/cliBrowserScenarioCommands.ts); the scenario contract owner is untouched.stays inside the existing CLI adapter and the existing scenario contract, and
involves no target execution, injection, mutation, or protection recovery.
validate-browser-scenariotoCLI_COMMANDS. No MCP tool, no catalog operation, no input/output schema change.is constructed and Playwright is not imported.
is produced.
docs/public/product-catalog.json): generated andvalidated by CI; not committed here.
Expected effects (checked): documentation or usability only; no target
interaction.
Evidence and regression coverage
tests/boundary/cli/browserScenarioValidation.test.ts, 7 cases —valid scenario, declared secrets counted without resolution, duplicate step
identity, reserved initial step identity, undeclared secret reference,
unknown field, unreadable input file.
point; the schema was only reached after provider resolution.
constructing a provider — killed; counting only resolved secrets — killed;
dropping the step-ID uniqueness assertion — killed; dropping the
undeclared-secret check — killed; relaxing the strict request object — killed;
disabling the reserved-step check — killed. 6/6 killed.
{"valid":true,"actions":1,"secrets":0}on success; theprojected input error with field paths on failure.
dist/-dependentcatalog/identity suites were not run for this change;
--project cli-boundaryhas 110 pre-existing failing files on this Windows host, verified identical on
unmodified main, and this change adds one passing file and no new failure.
Validation performed
vitest run tests/boundary/cli/browserScenarioValidation.test.ts— 7 passednpm run verify:test-discovery— 2484 files discovered exactly oncenpm run verify:module-boundaries— 3059 source files checkedoxfmt --check .— all matched files correctly formattedoxlinton the four changed files — no new findingsvitest run --project cli-boundary— 110 failed / 34 passed / 35 skipped,against 110 failed / 33 passed / 35 skipped on unmodified main
Compatibility, safety, and release
launched and no provider is constructed.
CLI_COMMANDSgrows by one entry; thegenerated product catalog picks it up in CI.
or printed; validation reports counts and field paths only.
Author readiness
Human owner: @z2Ace0107
Before merge
type(scope): outcome.