Skip to content

Add adaptive browser state graph exploration - #2030

Merged
chubes4 merged 1 commit into
mainfrom
feat/2025-adaptive-browser-exploration
Jul 24, 2026
Merged

Add adaptive browser state graph exploration#2030
chubes4 merged 1 commit into
mainfrom
feat/2025-adaptive-browser-exploration

Conversation

@chubes4

@chubes4 chubes4 commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • add an opt-in wp-codebox/browser-adaptive-exploration/v1 contract and deterministic planner for bounded state, transition, action, revisit, descriptor, stabilization, error, duration, and artifact budgets
  • rediscover fix: generate unique action corpus selectors #2027 unique descriptors after every stabilized action, including supported same-origin frames, and emit bounded graph/replay evidence through the existing browser and recipe artifact paths
  • require exact oracle and state fingerprints during campaign minimization/replay so every candidate continues to use the existing declared checkpoint baseline

Architecture and layer ownership

runtime-core owns the backend-neutral adaptive contract, action planning, digests, graph/replay DTOs, and exact campaign fingerprint semantics. runtime-playground owns Playwright DOM discovery, frame inspection, bounded mutation/stabilization polling, action execution, and browser artifact capture. The merged #2027 selector strategy was extracted unchanged into a shared playground discovery module used by both one-shot and adaptive modes.

This is a standalone additive adaptive-exploration-json mode on wordpress.browser-actions; it does not add another browser DSL, campaign runner, checkpoint abstraction, or artifact system.

State digest and stabilization

States hash bounded semantic DOM structure, visible text, input/checked state, title, URL/frame identity, loading observations, history state, and the unique descriptor digest. Absolute history length is recorded as transition evidence but excluded from state identity so start-URL replay remains reproducible.

Each state-changing action installs bounded mutation counters, polls the current document and supported same-origin frames until the DOM digest is quiet and loading indicators clear, or stops at the explicit stabilization deadline. Cross-origin frames/links and observed shadow roots produce honest bounded diagnostics rather than claimed coverage.

Budgets and safety

Exploration deterministically deduplicates states and actions while bounding actions (including reset/minimization replay), states, transitions, visits, descriptors, frames, mutation records, diagnostics, errors, duration, and graph bytes. It never uses .first(), force clicks, or ambiguous selectors. Selectors are rechecked for exactly one match immediately before execution; invalidation is recorded as a harness diagnostic, not misclassified as an application finding. Cancellation stops scheduling, awaits the active sequential operation, and retains bounded incomplete evidence for established teardown.

Same-origin click/fill/select/submit/keyboard/back/reload/repeat/double-submit transitions are planned where supported. Cross-origin link actions are rejected before entering the frontier.

Checkpoints, minimization, and replay

The adaptive recipe example composes the #2026 adversarial recipe lifecycle and checkpoint-per-case reset policy. Existing campaign execution restores the declared baseline before original and minimization candidates. Campaign fingerprints now include stateDigest; minimized candidates must reproduce the exact oracle/status/diagnostic/matrix/state fingerprint, and replay envelopes record and verify both expected fingerprint and expected state.

Compatibility

Authored steps-json and one-shot action-corpus-json paths are unchanged. Adaptive mode is explicitly standalone to prevent altering authored action ordering or one-shot corpus semantics. Existing public/package export contracts and recipe validation are updated without version or changelog edits.

Tests and results

  • npm run build
  • focused action-corpus and adaptive Playwright tests: 12 passed
  • npm run test:adversarial-runtime: 14 passed
  • schema parity and recipe validation: passed
  • public API and runtime package export contracts: passed
  • release package coverage: passed
  • adaptive adversarial recipe validation: passed
  • real disposable WordPress Playground smoke: passed and emitted files/browser/adaptive-exploration.json through the normal artifact manifest

npm run check independently reached the pre-existing #1745 command-registry smoke assertion: wordpress.collect-workload-result outputShape should mention outputSchema id. No unrelated command-registry code was changed to work around it.

Residual limitations

  • only the main document and currently supported same-origin frames are explored; cross-origin frames and shadow roots remain diagnostic-only
  • stabilization is bounded polling over semantic DOM/loading/mutation evidence, not a claim that all application background work has completed
  • start-URL reset restores browser state; durable runtime state restoration remains owned by the declared recipe checkpoint policy

Fixes #2025

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.

Add adaptive DOM state-machine exploration for browser fuzzing

1 participant