fix: preserve browser environments across action journeys - #2099
Conversation
5df37cc to
c0ae9de
Compare
|
Addressed all requested review items in c0ae9de and rebased onto current main. Shared scenario context/page continuity, per-actor configured isolation, validation flow, adaptive environment identity, resolved-vs-observed evidence, precedence/profile handling, and expanded compatibility/routing/path tests are ready for re-review. No merge, release, or deploy performed. |
c0ae9de to
f22389e
Compare
|
Addressed the three remaining re-review blockers in f22389e and rebased onto current origin/main (including #2098). File-backed action/scenario payloads now receive recipe-relative semantic validation and evaluate-policy detection; scenario steps-json=@path executes; nested adaptive environments own context creation and conflict with outer environment args; and consecutive storage/auth/storage scenarios prove cookie and localStorage isolation in both directions. Build, browser actions environment (8/8), recipe validation, browser scenarios, preview routing (6/6), environment matrix (13/13), and fixture auth/storage tests pass. Ready for re-review; no merge, release, or deploy performed. |
|
Final high blocker addressed at ef8e7f5; rebased head is f3e0485 on current main. recipeExecutionSpec now canonicalizes recipe-local file-backed browser action/scenario payload arguments to absolute paths before runtime execution, so validation, policy derivation, dry-run planning, and runtime consume the same files regardless of process CWD. Added a true built-CLI recipe-run integration launched from a separate temporary CWD covering valid action steps, scenario objects, scenario steps, automatic wordpress.browser-actions.evaluate policy, full runtime execution, and malformed validation failures. Passing: build, cross-CWD recipe integration, recipe validation descriptors, browser actions environment (8/8), preview routing (6/6), browser scenarios, and targeted rebased adaptive oracle tests. The unrelated fixed-delay cancellation race remains tracked in #2104. Ready for re-review; no merge, release, or deploy performed. |
f22389e to
f3e0485
Compare
Summary
@pathenvironments without bypassing existing steps/scenario validation, preserve scenario-over-argument precedence, and reject unknown profilesRoot cause and ownership boundary
wordpress.browser-probe,wordpress.browser-actions, scenarios, and multi-actor scenarios previously owned separate context construction paths. Scenario probe and action phases launched independent browsers, action viewport changes happened after context creation, and multi-actor scenarios always used plain contexts. This lost geolocation/device state and also lost scripts, cookies, storage, permissions, and page state between scenario phases.The Playwright environment adapter now owns context creation for probes, actions, shared scenarios, matrices, and actors. A scenario that needs both probe collection and actions creates one session and lends the same page to both runners without transferring ownership. Multi-actor runs reuse one resolved environment definition but create and close an isolated context per actor.
Evidence
Action/scenario artifacts now separate:
requested: canonical caller declarationresolved: provider-resolved configurationobserved: browser-observed viewport, touch, user agent, locale/timezone, online state, permission, and granted coordinatesunsupportedandinconclusive: dimensions that cannot be applied or independently observedAdaptive contracts, state digests, finding fingerprints, result replay, and per-finding replay include the canonical environment and digest.
Tests
npm run buildnpm run test:browser-actions-environmentnpm run test:browser-environment-matrixnpm run test:browser-scenariosnpx tsx tests/recipe-validation-descriptors.test.tsnpm run test:fixture-auth-storage-statenpm run test:browser-preview-routingnpm run test:public-api-contractnpm run test:wordpress-runtime-actions--test-name-patternCoverage includes probe/action state continuity under performance collection and pre-page scripts, routed granted/denied/prompt geolocation, auth and storage state, scenario precedence and unknown profiles, malformed JSON validation, valid/invalid/missing
@pathenvironments, run isolation, per-actor environment/isolation, unsupported evidence, and environment-bound adaptive identity.npm run checkstill reaches the unrelated main-branch registry failure tracked in #1745. The full adaptive umbrella has a pre-existing fixed-delay cancellation race now tracked in #2104; all adaptive replay/finding tests affected by this PR pass.Compatibility
Existing recipes remain valid. Legacy viewport, profile/device, auth, storage state, and routed preview controls continue to work. Scenario declarations retain precedence over command arguments. Unsupported multi-actor shared pre-page/auth/storage controls now fail before actor launch instead of being ignored. No changelog or version strings were modified.
Fixes #2091
Latest re-review fixes
steps-jsonandscenario-jsonrelative to the recipe directory, including evaluate-capability policy derivationsteps-json=@pathinstead of silently dropping itenvironmentas authoritative and reject conflicting outer declarationsorigin/main, including Fix canonical routed preview origins #2098 preview routing/readiness changesFinal path-consistency fix
recipeExecutionSpecsteps-json, scenario objects, and scenariosteps-json