Skip to content

fix: keep failed adaptive actions off frontier#2035

Merged
chubes4 merged 1 commit into
mainfrom
fix/2031-adaptive-unreplayable-states
Jul 24, 2026
Merged

fix: keep failed adaptive actions off frontier#2035
chubes4 merged 1 commit into
mainfrom
fix/2031-adaptive-unreplayable-states

Conversation

@chubes4

@chubes4 chubes4 commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • retain failed adaptive action transitions and their post-error observations as bounded diagnostic evidence
  • exclude partially reached destinations from replayable states, findings, minimization, revisit accounting, and frontier scheduling
  • continue deterministic exploration from the original replayable source and preserve cancellation behavior

Root cause

exploreAdaptiveBrowserStateMachine() captured and registered the post-action DOM state regardless of whether executeAdaptiveAction() 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 error transition with its destination digest, URL/history, mutation novelty, browser observations, and browser_adaptive_action_error diagnostic, 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 cancelled summary/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.ts
  • npx tsx tests/schema-parity.test.ts
  • npx tsx tests/runtime-contract-package-exports.test.ts
  • npm run build
  • git diff --check

npm run check passed 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 from origin/main.

Fixes #2031

@chubes4
chubes4 merged commit 9e20ff1 into main Jul 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Do not queue unreplayable adaptive states after action errors

1 participant