Skip to content

refactor(replay): one replay runner loop, run verb, qualification command and site data - #372

Merged
lanyue-llk merged 8 commits into
mainfrom
refactor/browser2
Nov 24, 2026
Merged

lanyue-llk merged 8 commits into
mainfrom
refactor/browser2

Conversation

@lanyue-llk

Copy link
Copy Markdown
Contributor

Purpose

Browser tracks, round 2 of the spec convergence (#336). The curated and public WebArena replays now run through one Trajectory Replay runner loop, and each of them is a benchmark adapter. Replay evaluators live in a track-level registry. The track has a single run verb. Qualification and repair go through one command backed by a registry of repair kinds. WebArena deployment code no longer names sites.

flowchart LR
    RUN["webstone trajectory-replay run --benchmark NAME"] --> REG{"BENCHMARK_RUNS registry"}
    REG -- curated --> CA["CuratedReplay adapter"]
    REG -- public-webarena --> PA["PublicWebArenaReplay adapter"]
    REG -- webarena-verified --> WV["webarena_replay.run_replay_suite (own loop, remaining)"]
    CA --> LOOP["core/runner.py run_replay: engines, fixtures, task x engine x retry, records, manifest, diagnostics, report hook"]
    PA --> LOOP
    PA -. "evaluator kinds" .-> EV["core/evaluators.py EVALUATOR_KINDS + EvaluatorRegistry"]
    EV --- K1["exact_outputs"]
    EV --- K2["webarena_verified (registered by public_webarena/evaluators.py)"]
    PROF["--profile methods[].engine"] --> LOOP
    Q["trajectory-replay qualification SUB"] --> RK["REPAIR_KINDS registry (propose KIND)"]
Loading

What moved or was removed

  • Trajectory Replay: one pipeline for the curated, catalog and public WebArena benchmarks #339, runner and evaluators. Added trajectory_replay/core/runner.py, which holds the ReplayBenchmark protocol, run_replay, the shared reset_state/prepare_page and run_engines. runner.py is now the CuratedReplay adapter and public_webarena/runner.py is now the PublicWebArenaReplay adapter. The two copies of run_evaluation, _reset_state and _prepare_page are gone. The evaluator protocol, TaskEvidence/TaskEvaluation, ExactOutputsEvaluator and a kind-keyed EvaluatorRegistry moved to core/evaluators.py. public_webarena/evaluators.py keeps only the WebArena-Verified kind, which it registers. The curated benchmark keeps its single-tab reset through an explicit all_tabs=False, so its measured behaviour is unchanged.
  • Participants (One browser adapter and participant registry for the browser tracks #321). The curated and public runs take engines from --profile (methods[].engine). --engines narrows that list; with no profile, the registry supplies it. The loop has no default participant set of its own.
  • run verb (Give every track the same stage verbs and a fixed stage registry #316). evaluate and replay are replaced by run --benchmark curated|public-webarena|webarena-verified, and each benchmark parses its own options. The latency process guard now also matches webstone trajectory-replay run.
  • Consolidate the WebArena qualification and repair entry points #335. Added trajectory-replay qualification <subcommand> with 21 subcommands. propose <kind> resolves its kind through the REPAIR_KINDS registry, which replaces the main_repair_proposal(kind=...) if-chain. The 27 thin scripts/*webarena* qualification, diagnostics and manifest-repair scripts were removed. Every stage is still named as current by docs/trajectory-replay-protocol.md, so no stage or kind was removed.
  • WebArena site adapters in the shared environment package #325. The deployment contract check, Map archive verification, Map setup and the environment CLI no longer name map or wikipedia. The archive site comes from the delivered component that declares data_urls and from a new data_archives site-adapter field. The setup error lists SHARED_SITES.

Breaking changes

  • python -m harness.trajectory_replay evaluate ... becomes ... run --benchmark curated ....
  • python -m harness.trajectory_replay replay ... becomes ... run --benchmark webarena-verified ....
  • 27 scripts/*webarena* qualification and repair scripts are removed. Each one is now the matching python -m harness.trajectory_replay qualification <subcommand>.
  • Repair kinds are hyphenated (action_repair becomes action-repair, and likewise for all six), and main_repair_proposal(argv, kind=...) becomes main_repair_proposal([kind, *args]).
  • public_webarena.runner.run_evaluation and trajectory_replay.runner.run_evaluation are replaced by core.runner.run_replay(adapter, ReplayOptions(...)). EvaluatorRegistry(webarena_config_path=...) becomes core.evaluators.EvaluatorRegistry(config_path=...).

Remaining (Part of)

Checks

  • Allowlists: the instance-literal and layering allowlists are unchanged; site names are not in their registries.
  • Baselines: tests/baselines is unchanged and passes.
  • uv run --frozen lexbench-webfetch version: 0fe8931734e1…169e before and after.
  • make lint-check: pass.
  • pytest tests/trajectory_replay tests/baselines tests/environments plus the architecture, command and package tests (-n 8): 2597 passed.
  • Full pytest tests -n 8: 22997 passed, 2 failed under load (test_playwright_tool and a 5 s subprocess budget in test_reference_quality), both of which pass when rerun serially. After rebasing onto refactor: one track registry, generic stage make targets, instance hooks and Yours docs #368 the focused set passes (2517).

Closes #335
Part of #339
Part of #325
Part of #321
Part of #316

@lexmount-ocr lexmount-ocr Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Review complete · 8fb6984

No findings in this review.

@lexmount-ocr lexmount-ocr Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Review complete · 43f73d9

This review found 1 issue(s), including 1 blocking issue(s).

Comment on lines +143 to +145
selected = tuple(item.strip() for item in (engines or "").split(",") if item.strip())
if profile_path is None:
return selected or default

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bug · medium
An explicitly empty filter (--engines '', whitespace, or --engines ',') becomes an empty tuple and silently selects every default/profile engine. In particular, public WebArena previously passed that empty tuple through to engine validation rather than starting a full run. Distinguish engines is None (use defaults) from a supplied filter that selects nothing, and reject the latter before launching containers. Add coverage for empty filters both with and without a profile.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 12f3de7: run_engines now raises when --engines is supplied but names nothing, with or without a profile. Tests cover both cases and profile-order narrowing.

…command

Add `python -m harness.trajectory_replay qualification` with one
subcommand per qualification, repair and recording-audit stage, and
replace the repair proposal kind if-chain with the REPAIR_KINDS registry.
Remove the 27 thin scripts that fronted these stages.
… runner loop

Promote the replay evaluator protocol and kind registry to trajectory_replay/core,
make the curated and public runners benchmark adapters of core/runner.py, take
participants from a run profile, and replace the evaluate and replay verbs with
one run verb keyed by a benchmark registry.
…tract data

The deployment contract check, archive verification, Map setup and the
environment CLI no longer name the map or wikipedia sites: the delivered
component that declares data archives, and the site adapter that declares
data_archives, select them.

@lexmount-ocr lexmount-ocr Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Review complete · 12f3de7

No findings in this review.

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.

Consolidate the WebArena qualification and repair entry points

1 participant