Skip to content

refactor: remove dead code and duplicated example files - #121

Merged
lanyue-llk merged 1 commit into
mainfrom
refactor/remove-dead-code
Oct 30, 2026
Merged

lanyue-llk merged 1 commit into
mainfrom
refactor/remove-dead-code

Conversation

@lanyue-llk

@lanyue-llk lanyue-llk commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Issues

Summary

First part of #92: deletes code with no supported caller, as AGENTS.md requires. No behaviour changes. Every removed name was checked with git grep across src, scripts, tests, examples, the Makefile and CI; each was referenced only by its own definition (or, for admission.py, only by its own test).

Removed Where
_finding_text, _probability, _wilson_interval, _task_family_summary, _task_family_table, _clean_subset_table, _group_rows, _english_page, RESEARCH_ROOT (and the repository_root import it alone used) src/harness/browser_use/report.py
AstraResponsesModel compatibility alias, unused _normalized_reasoning_effort method src/harness/browser_use/model.py
Whole module, no importers src/harness/trajectory_replay/template_transfer.py
Whole module, used only by its own test (deleted too) src/harness/web_fetch/admission.py, tests/test_case_admission.py
_translate_visible_attributes and the _VISIBLE_ATTRIBUTE regex only it used src/harness/web_fetch/report_i18n.py
messages = report_method_catalog(...) repeated three times → once src/harness/web_fetch/methods.py
build_public_suite.py, tasks.v2.json, tasks.v3.json: byte-identical copies of the public_webarena/ files, referenced nowhere examples/trajectory_replay/

The orphaned comment in browser_use/runner.py, explaining why the shopping image needs a longer readiness ceiling, now sits on ENV_CTRL_READY_TIMEOUT_SECONDS in environments/webarena/runtime.py, the constant it describes.

Left for follow-ups in #92

  • Retired BROWSER_USE_EVAL_* variables and lex-browser-use-eval-* image names in examples/trajectory_replay/run.sh and its README: renaming changes user-facing configuration, so it gets its own PR.
  • src/harness/environments/webarena/config.py:53 compares the lock against the literal "1.2.3" instead of the WEBARENA_VERIFIED_VERSION constant defined on line 19.
  • The public_webarena/build_public_suite.py generator that still writes tasks.v4.json is tracked in Follow-ups from the #81 review: generator, reproduction command, make target, track branches #117.

Test plan

  • make lint-check passes.
  • Golden snapshots from test: add golden route-hash snapshots for report tracks #119, applied on top, are unchanged for all ten report builds.
  • make test-python (-n 4 --dist loadfile, as in CI): 18,780 passed. The 14 failures are the same set that fails on unmodified main in this macOS setup (Node-based Markdown converter, CI-gate and local-data tests).

🤖 Generated with Claude Code

Delete definitions and modules with no supported caller: unused Browser Use
report helpers, the AstraResponsesModel compatibility alias, an unused model
method, the trajectory template transfer module, the Web Fetch admission
module and its only test, the unused visible-attribute translator, a line
repeated three times in methods.py, and example copies that are byte-identical
to their public_webarena versions. Move an orphaned comment to the readiness
timeout it explains.

Refs #92.

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 · 8b6a621

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.

No defects found. It's ready to merge once #119 is green and has merged first.

Verified on the head (8b6a621) against main (b220d07):

  • git grep finds no reference left to any removed name: the browser_use/report.py helpers, RESEARCH_ROOT, AstraResponsesModel, _normalized_reasoning_effort, template_transfer, web_fetch.admission, _translate_visible_attributes/_VISIBLE_ATTRIBUTE, build_public_suite, tasks.v2, tasks.v3. That includes docs and CI.
  • The three examples/trajectory_replay/ files have the same git blob IDs as their public_webarena/ counterparts on main, so nothing unique is lost.
  • browser_use/report.py removes only the listed helpers plus the repository_root import that only RESEARCH_ROOT used. Lint confirms nothing else became unused.
  • The relocated readiness comment now sits on ENV_CTRL_READY_TIMEOUT_SECONDS, the constant it explains. Dropping the duplicate report_method_catalog assignments is behaviour-neutral.
  • Removing the compatibility alias and the retired admission module follows AGENTS.md, which says to remove superseded code and its exclusive tests in the same change.
  • CI is green.

Merge order: the "golden snapshots unchanged" claim relies on #119, which this branch doesn't contain, so CI here doesn't exercise the snapshots. #119 currently fails on Linux because of a platform-dependent WCXB digest (see my review there). After #119 is fixed and merged, please rebase this PR so CI runs the snapshots against it before merging.

@lanyue-llk
lanyue-llk merged commit 7613e25 into main Oct 30, 2026
6 checks passed
@lanyue-llk
lanyue-llk deleted the refactor/remove-dead-code branch October 30, 2026 12:35
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.

Remove dead code, retired compatibility shims and duplicated example files

1 participant