Repository navigation
Run WebArena catalog loops as backends of the shared replay loop - #383
Conversation
There was a problem hiding this comment.
This review found 1 issue(s), including 1 blocking issue(s).
| from harness.trajectory_replay.catalog_evaluators import catalog_task | ||
| from harness.trajectory_replay.core.evaluators import EvaluatorRegistry, TaskEvidence | ||
| from harness.trajectory_replay.core.runner import replay_attempts |
There was a problem hiding this comment.
The extracted execution and scoring code is no longer covered by the cohort's source-integrity check. cohort_reference_hashes() still hashes remote_execution.py and the previous supporting modules, but not catalog_evaluators.py, core/evaluators.py, or core/runner.py; certify_cohort() relies on equality of those before/after hashes. Consequently, changing the newly extracted scoring or loop implementation during a cohort leaves this check unchanged and can still produce a certified receipt. Include these modules in the source bindings (with receipt-version handling if necessary), and add an integrity test that changes an extracted source and verifies certification fails.
There was a problem hiding this comment.
✅ Re-review complete · 5ef2a2b
No findings in this incremental review.
…loops Drive the catalog runner (local and hosted browsers), the remote cohort, the Docker-site suite and one remote task with fake browsers, transports and evaluators, and snapshot the ordered calls, attempt files and evidence fields.
…f the shared replay loop - core/runner.replay_attempts is the one task/engine/retry loop; run_replay uses it. - catalog_runner: LocalBrowserBackend and HostedBrowserBackend. - remote cohort and the Docker-site suite run their tasks through the same loop. - Register retrieval_acceptance and catalog_acceptance evaluator kinds; the remote task scores through EvaluatorRegistry. TaskEvidence/TaskEvaluation gain instance-neutral trace, page_checks, identity and record fields.
… cohort reference hashes
5ef2a2b to
b08ac13
Compare
…execution baseline
|
Owner approved the additive fix for the OCR integrity finding: |
There was a problem hiding this comment.
✅ Re-review complete · 5570b36
No findings in this incremental review.
Purpose
Finishes #339. The WebArena-Verified catalog loops now run as execution backends of the shared Trajectory Replay loop. The catalog's two evaluation steps are registered evaluator kinds.
What moved
core/runner.py: newreplay_attempts(tasks, engines, run_attempt, max_retries, record)is the one attempt loop.run_replayuses it in place of its inline loop.catalog_runner.py: the local and hosted loops becameLocalBrowserBackend(a context manager that starts and stops the browser) andHostedBrowserBackend. Both run throughreplay_attempts. A restart after a poisoned or dead runtime now happens at the start of the next task. That is the same point in the sequence as before, after the progress record and before the next row binding.remote_execution._execute_cohortandwebarena_replay.run_replay_suiterun their tasks throughreplay_attempts(one engine,max_retries=0). The suite's one clean retry is still part of its logical attempt, so both physical executions keep binding to one result. The suite's per-method body is now a localrun_methodfunction, with the same indentation and no loop-variable closures.catalog_evaluators.pyregistersretrieval_acceptance(answer from current-run observations under the frozen contract) andcatalog_acceptance(official WebArena-Verified scoring through a registered correction, plus live-page assertions) incore/evaluators.EVALUATOR_KINDS.run_replay_taskscores throughEvaluatorRegistry(benchmark=...).core/evaluators.py, all instance-neutral:TaskEvidencegainstrace,page_checks,run_idandattempt_id.TaskEvaluationgainsrecord, the persisted evaluator result.EvaluatorRegistryforwards any evaluator options.webarena_replay._run_onekeeps its own evaluation. Its state-contract and unsupported-payload handling differs from the remote path, and it has no offline characterization of the retrieval branch.Nothing was removed. No command was renamed or removed, so there are no breaking changes.
Proof of behaviour preservation
The first commit adds
tests/baselines/test_trajectory_replay_execution.pyandtrajectory-replay-execution.jsonon unchanged main. They drive each loop with fake browser processes, a hosted CDP transport, BrowserTool and service, a Docker client and an evaluator. They snapshot the ordered calls with their arguments, the progress, receipt and result files, stdout, and the evidence fields:run_replay_taskin six cases: pass, retrieve, insufficient retrieval, step failure, evaluator error, correction with failing assertionThe second commit (the refactor) keeps this snapshot byte-identical. Its only test change moves one monkeypatch target,
evaluate_corrected_contract, to the new evaluator module. A mutation check confirmed the baseline catches a changed restart condition. Every other baseline is unchanged.Hash bindings
scripts/run_remote_three_method_cohort.pyis untouched, andcohort_reference_hasheskeeps the same keys and files.remote_execution.py(runner,remote_execution) andwebarena_replay.py(replay_logic) did change. These hashes are recorded in each cohort receipt at run time and compared only within that run, before against after. No current authority (webarena_results, profiles, tests) compares them with checkout bytes. Existing receipts and published reports still verify. New cohort runs will record new source hashes, as they would for any code change.core/runner.pyandcatalog_evaluators.pyare not added to the cohort's bound sources, because that would change the receipt format.lexbench-webfetch version) is unchanged: no scoring sources were touched.Allowlists
Layering and instance-literal allowlists are unchanged. No entry was added and none applied.
Verification
make lint-check: passuv run --frozen --all-extras python -m pytest tests/baselines tests/trajectory_replay tests/test_architecture_layering.py tests/test_architecture_instance_literals.py tests/test_env_file.py tests/test_webarena_state.py -n 8 --dist worksteal: 1893 passed, 4 skippedLive validation still recommended
This is live execution code. The offline proof covers the loop and evaluator wiring with fakes, not real WebArena sites or browsers. Before the next formal cohort, an operator should run a small diagnostic catalog replay on the deployed sites, for example:
Check the resulting
progress.jsonlandtask-*/evidence against a run of the same tasks from the previous release.Closes #339