fix: keep failed adaptive actions off frontier#2035
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Root cause
exploreAdaptiveBrowserStateMachine()captured and registered the post-action DOM state regardless of whetherexecuteAdaptiveAction()completed. For a multi-step action that mutated the page and then failed, the frontier path therefore contained the complete failing action even though only its successful prefix produced the destination. Start-URL resets could never replay that path and repeatedly consumed action and duration budgets.Replay safety and evidence semantics
WP Codebox does not currently define a partial-step replay contract. This change uses the minimal safe behavior: an action error still produces an
errortransition with its destination digest, URL/history, mutation novelty, browser observations, andbrowser_adaptive_action_errordiagnostic, but that destination is not registered as a replayable state or queued. Oracle output observed during the failed action remains on the transition rather than becoming a finding with an unreplayable path.Successful transitions retain the existing state IDs, transition IDs, action ordering, fingerprints, replay paths, and minimization behavior. Authored and one-shot browser modes are unchanged.
Budget and cancellation effects
A partially failed action consumes one action/error as before, but it cannot create repeated reset/replay failures or spend the remaining duration budget on a known-unreplayable source. Other candidates continue from the same replayable source under start-URL reset. Cancellation after a partial failure retains the error transition and terminates with the existing
cancelledsummary/diagnostic semantics.Tests
Passed:
npx tsx tests/browser-adaptive-exploration.test.ts(9 tests, including intercepted two-click overlay failure, continued valid exploration, no reset loop, cancellation, minimization exclusion, and deterministic output)npx tsx tests/browser-action-corpus.test.ts(5 tests)npx tsx tests/adversarial-recipe-orchestration.test.tsnpx tsx tests/schema-parity.test.tsnpx tsx tests/runtime-contract-package-exports.test.tsnpm run buildgit diff --checknpm run checkpassed production-boundary enforcement, build, and the preceding smoke commands, then stopped at the unchanged known #1745 failure:wordpress.collect-workload-result outputShape should mention outputSchema id. The implicated command registry and smoke files are unchanged fromorigin/main.Fixes #2031