Skip to content

refactor(cleanup): finish review leftovers from #92 and #117 - #128

Merged
lanyue-llk merged 3 commits into
mainfrom
refactor/review-leftovers
Nov 2, 2026
Merged

lanyue-llk merged 3 commits into
mainfrom
refactor/review-leftovers

Conversation

@lanyue-llk

Copy link
Copy Markdown
Contributor

Issues

Closes #92
Closes #117

#121 already removed the dead code from #92. I checked each remaining #92 item against main with git grep. AstraResponsesModel, _normalized_reasoning_effort, the orphan runner comment, template_transfer.py, admission.py, _translate_visible_attributes, the repeated messages = report_method_catalog(...) lines and the stale cli.py --suite default no longer exist on main. This PR handles what was left.

Summary

Retired names (#92)

  • In examples/trajectory_replay/run.sh, its README, the rendered reproduction steps in src/harness/trajectory_replay/report.py and tests/trajectory_replay/test_run_entry.py, BROWSER_USE_EVAL_* is now TRAJECTORY_REPLAY_*. There is no alias.
  • The Chromium and Moli images are shared by Browser Use, curated replay and public WebArena replay. Their images, container names and Docker labels move from lex-browser-use-eval-* / lex.browser-use-eval.* to the track-neutral lex-browser-eval-* / lex.browser-eval.*. This covers environments/browser.py, both replay runners, webarena_replay.py, public diagnostics, the public Dockerfiles, run.sh and the tests, all changed in one commit.
  • Public WebArena module docstrings (runner, suite, config, metrics, evaluators) and the config error message now say Trajectory Replay instead of "browser use evaluation".
  • src/harness/environments/webarena/config.py uses WEBARENA_VERIFIED_VERSION instead of repeating "1.2.3".
  • Deleted examples/trajectory_replay/public_webarena/tasks.v2.json and tasks.v3.json. Nothing references them now that the cli.py default is gone.

#117

  • Deleted examples/trajectory_replay/public_webarena/build_public_suite.py. I ran it into a scratch directory and it reproduces the curated tasks.v4.json that feat(benchmarks): version inputs on Hugging Face and unify evaluation code #81 removed, byte for byte (sha256 20dc81a7…). It is not the public tasks.v4.json, which is a different file. No entry point or test uses the generator.

  • The WebMainBench reproduction commands in src/harness/web_fetch/report.py now pass --dataset <WebMainBench_545.jsonl> --expected-dataset-sha256 <source_dataset_sha256>, using the parent hash the report was built from, to both the runner and the scorer.

  • The make webmainbench-score target:

    • SOURCE and SCORER are now optional. Left unset, the script uses its pinned corrected corpus and its pinned scorer.
    • New DATASET_SHA256 and REVISION variables are forwarded as --expected-dataset-sha256 and --revision.
  • src/harness/benchmarks/publication.py no longer branches on self.track == "webfetch". Each track's cards/metadata.json entry now declares:

    • definition_registry: "suites", for the suite-registry dataset format.
    • derived_fields (benchmark_category → harness.web_fetch.models:report_family). Only harness.* module:function references are accepted.
    • order_configurations_by_subsets.

    I also converted the third webfetch branch, in datasets(), so publication has no Web Fetch-specific code paths left. The headless-browser branches have a different input contract and are not changed here.

Golden snapshot change: tests/golden/webmainbench-sample.json changes two routes, reproduce/index.html and en/reproduce/index.html. In both, the reproduction command now includes --dataset and --expected-dataset-sha256. No other route changed.

Not changed on purpose: the browser-use-eval pip extra in pyproject.toml/uv.lock. It installs dependencies for the current autonomous Browser Use track, which is not a retired name, and renaming it would mean regenerating the lockfile.

Test plan

  • ruff check --config 'include=["*.py"]' --select F,TID252 . && ruff check: passed.
  • pytest tests/benchmarks tests/test_golden_reports.py tests/trajectory_replay tests/environments -n 2: 13438 passed. The only failure was the expected WebMainBench golden diff, which I regenerated with UPDATE_GOLDEN=1. All 10 golden tests now pass.
  • pytest tests -k "webmainbench or makefile or publication or browser_use or naming or package" -n 2: 1037 passed, 1 failed. The failure is test_optional_reports.py::test_default_rescore_rebuilds_local_report_without_publication, which runs in a subprocess that imports the shared venv's editable install from another checkout (browser-eval-refactor/src) instead of this tree. It fails with "Historical benchmark source is not recorded in the dataset lock" and is unrelated to this change. CI covers it.
  • Added test_derived_viewer_fields_only_resolve_named_harness_functions. The existing test_dataset_discovery still checks the benchmark_category partitions that are now selected through metadata.
  • scripts/check_track_naming.py: passed.
  • make -n webmainbench-score with and without SOURCE/DATASET_SHA256/REVISION prints the expected argument lists.
  • Inventory: git grep -iE 'BROWSER_USE_EVAL|lex-browser-use-eval|lex\.browser-use-eval|build_public_suite|tasks\.v[23]\.json' returns nothing.

🤖 Generated with Claude Code

- Rename retired BROWSER_USE_EVAL_* run.sh variables to TRAJECTORY_REPLAY_*,
  shared browser images/containers/labels to the track-neutral
  lex-browser-eval prefix, and public WebArena docstrings to Trajectory Replay.
- Use WEBARENA_VERIFIED_VERSION in the WebArena image-lock check.
- Delete the superseded public_webarena/build_public_suite.py generator and
  the unreferenced tasks.v2/v3 suites.
- Bind --dataset and --expected-dataset-sha256 in the WebMainBench
  reproduction commands; make SOURCE/SCORER optional in webmainbench-score
  and forward DATASET_SHA256 and REVISION.
- Select Web Fetch publication behavior through cards/metadata.json instead
  of track-name branches.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

@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 · 4c4d27a

No findings in this review.

@lanyue-llk lanyue-llk left a comment

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.

Independent review, round 1

Reviewed head 4c4d27a3 against main 8b8aa30f. I found no P0, P1 or P2 defects. There are three P3 notes below.

What I verified

  • #92 inventory. I ran git grep on the PR head for every item listed in #92: the browser_use/report.py helpers, AstraResponsesModel, _normalized_reasoning_effort, template_transfer, admission.py, _translate_visible_attributes, tasks.v2/v3, build_public_suite, BROWSER_USE_EVAL_*, lex-browser-use-eval, lex.browser-use-eval and "browser use evaluation". None of them remain.
    • The only "1.2.3" literal left in code is the WEBARENA_VERIFIED_VERSION definition. The other hits are hash-bound evaluation/research JSON and test fixtures, and those should stay as they are.
    • The renamed image names, container names and labels are consistent across every producer and consumer: environments/browser.py, both runners, webarena_replay.py, diagnostics, the Dockerfiles, run.sh and the tests.
    • No frozen evidence or report check reads the old lex.browser-use-eval.* build-source label keys.
  • #117 reproduction command.
    • webmainbench_runner accepts --dataset and --expected-dataset-sha256, and load_selected_ids checks the manifest parent hash against the value passed in. The emitted source_dataset_sha256 is therefore the right value.
    • webmainbench_scoring accepts --expected-dataset-sha256 and --revision, and both --dataset and --scorer-repo are optional there.
    • The two changed WebMainBench golden routes match what the PR description explains.
  • Makefile. The $(if ...) forwarding is correct. Leaving SOURCE and SCORER unset falls through to the pinned corpus and the pinned scorer.
  • publication.py.
    • No track == "webfetch" branches remain.
    • _derived_field rejects any reference that is outside harness.* or is missing a function name.
    • Tracks without the new keys fall through to the previous paths unchanged.
  • Mutation check. I removed derived_fields and order_configurations_by_subsets from cards/metadata.json. Two tests in tests/benchmarks/test_dataset_discovery.py then fail, so the existing tests do enforce the derived-field projection.
  • Local runs.
    • Both ruff gates passed.
    • pytest tests/test_golden_reports.py tests/benchmarks tests/trajectory_replay/test_run_entry.py tests/trajectory_replay/public_webarena/test_runner.py -n 2: 11384 passed.
  • CI on 4c4d27a3. All checks passed, including "Tests and static checks" and "Rendered reference and report checks".

Findings

  1. P3, test coverage. src/harness/benchmarks/publication.py:495
    • Problem: no test fails when order_configurations_by_subsets is removed. Only derived_fields is guarded by the mutation check above.
    • Fix: add a small assertion that the webfetch viewer configurations follow the order of metadata["subsets"].
  2. P3, docs. src/harness/web_fetch/WEBMAINBENCH.md:36
    • Problem: the guide describes the SOURCE override for webmainbench-run. It does not say that webmainbench-score now treats SOURCE/SCORER as optional, or that it accepts DATASET_SHA256 and REVISION.
    • Fix: add one sentence so corrected-edition scoring through make can be found.
  3. P3, retired-name residue outside the #92 list. src/harness/trajectory_replay/public_webarena/report.py:2068-2070
    • Problem: the report writer still globs and deletes browser-use-evaluation-*.{md,html,json} files. This is cleanup for outputs under the retired name.
    • Fix: it is harmless, so it may stay. You could drop it in a follow-up if no supported output directory still holds those files.

No blocking issues. The "Closes #92" and "Closes #117" claims hold for every item listed in those issues.

@lanyue-llk

Copy link
Copy Markdown
Contributor Author

Review round 1 follow-up:

Fixed

  • 2958010 test(benchmarks): test_webfetch_viewer_configurations_follow_card_subset_order registers embedded-documents cases before general-web and asserts the viewer configurations follow metadata['subsets']. It fails when order_configurations_by_subsets is removed from cards/metadata.json (checked locally), and it also checks the benchmark_category derived field.
  • 093684a docs(webmainbench): WEBMAINBENCH.md now says that webmainbench-score requires only EVIDENCE, treats SOURCE/SCORER as optional overrides and forwards DATASET_SHA256/REVISION as --expected-dataset-sha256/--revision.

Disputed / not changed

  • public_webarena/report.py browser-use-evaluation-* cleanup: kept on purpose. This is not a compatibility alias. It deletes stale files from a persistent report root, and public_webarena/publication.py packages that root with rglob("*"). If the cleanup were removed, old files under the retired name could end up in a package from an existing output directory. The reviewer marked it as an optional follow-up outside Remove dead code, retired compatibility shims and duplicated example files #92, so it stays as it is.

Tests: ruff gates pass; tests/test_golden_reports.py tests/benchmarks gave 11327 passed (snapshots unchanged).

@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 · 093684a

No findings in this review.

@lanyue-llk
lanyue-llk merged commit ba1209f into main Nov 2, 2026
6 checks passed
@lanyue-llk
lanyue-llk deleted the refactor/review-leftovers branch November 2, 2026 03:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant