Skip to content

refactor(scripts): prune duplicate entry points and add an inventory - #129

Merged
lanyue-llk merged 3 commits into
mainfrom
refactor/prune-unreferenced-scripts
Nov 2, 2026
Merged

lanyue-llk merged 3 commits into
mainfrom
refactor/prune-unreferenced-scripts

Conversation

@lanyue-llk

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

Copy link
Copy Markdown
Contributor

Issues

Closes #93. Still open after this PR:

  • scripts/README.md lists, under "Pending owner decision (Prune unreferenced and one-off migration scripts #93)", every kept script that no Makefile target, CI job, guide, configs/report-templates.json entry or checked-in profile, certificate or receipt names by basename or module path. Each is the sole entry to a stage a current harness module still implements. An owner still has to either name it in the owning guide or delete the stage: add_provider_results, certify_headless_cases, project_headless_provider, build_postcheck_observations, check_resource_links, select_headless_speed_cases/package_headless_speed, assemble_webfetch_dataset/_refresh, audit_fixed_native_comparison, probe_cowagent_text, the three result-review shard tools, select_wcxb_sample, run_wcxb_paired_latency, check_webmainbench_report/_full_report, authorize_/rename_/publish_browser_use_artifact_hub, use_prepared_webarena_cohort_reset, the four replay seed/replay/promotion stages, merge_webarena_replay_results, the six build_webarena_*_suite/_subset and finalize_webarena_adjudication qualification commands, build_webarena_trace_catalog and run_real_smoke.sh.
  • The 51 migration/repair-named scripts were checked one by one. Every one is named in docs/trajectory-replay-protocol.md, WEBMAINBENCH.md, src/harness/web_fetch/README.md or the Makefile, so none of them is removed here.

Summary

I checked every script in scripts/ against the Makefile, CI, the guides, configs/report-templates.json and the files under evaluation/ by searching for its basename and module path. Removed: entry points whose behavior a supported command already provides.

Removed Supported entry point
run_risk_control_moli.py run_certified_benchmark.py risk-control (omit --execute for call-free validation)
certify_webmainbench_case_correction.py run_certified_benchmark.py webmainbench-correction
freeze_headless_references.py, postcheck_headless.py, finalize_benchmark_run.py run_certified_benchmark.py runs these stages through reference_freeze / evidence
prepare_reference_promotion.py, promote_reference_candidate.py python -m harness.web_fetch.reference_freeze prepare-promotion / promote (already the documented form)
check_wcxb_report.py (+ wcxb_report_check.main) check_report.py --profile, used by make wcxb-release-check
check_webarena_trajectory_report.py, package_webarena_trajectory_report.py (+ publication.check_main / package_main) release_webarena_trajectory_report.py (make public-webarena-report), which checks and packages the bundle itself
run_webfetch_eval.sh uv run --frozen python -m harness.web_fetch run
plot_moli_version_resources.py uv run --frozen python -m harness.lexbench.charts

The harness functions behind the first five rows are still in use, because certification.py calls them. Only the wrappers were exclusive, so only the wrappers are removed.

Other changes:

  • Add scripts/README.md. It lists every remaining entry point next to the authority that names it, keeps unnamed entry points in a separate pending section with the reason each survived, and states the rule for adding and removing entry points.
  • reference_freeze.prepare_promotion_main / promote_main lose the root= keyword that only the removed wrappers passed; their path defaults now resolve from the repository root instead of the current directory.
  • Tests that called removed scripts now use the supported command. package_smoke runs the WCXB release rejection through check_report.py. The risk-control call-free CLI test uses run_certified_benchmark.py risk-control. The certification --help parametrization drops the two removed duplicates.
  • Update the docs: src/harness/web_fetch/README.md (reference promotion) and scripts/moli_report/BUILD.md (charts).
  • No scripts were renamed.

Repository inventory: a search for each removed basename, module path, check_main and package_main found no remaining references. The only matches are local import aliases in tests/test_run_certified_benchmark.py that bind the reference_freeze module. Every file left in scripts/ appears in the inventory.

Test plan

  • ruff check --config 'include=["*.py"]' --select F,TID252 . and ruff check: pass.
  • pytest tests/test_golden_reports.py tests/test_run_certified_benchmark.py tests/test_risk_control_optional_report.py tests/test_risk_control_dataset.py tests/benchmarks/test_checkout_entrypoint_precedence.py tests/test_runtime_entrypoints.py tests/test_remaining_public_boundaries.py tests/test_wcxb_report_check.py tests/test_wcxb_publication.py tests/test_moli_version_resource_chart.py tests/test_reference_monitoring.py tests/test_finalize_benchmark_run.py tests/test_webmainbench_report_authority.py tests/trajectory_replay/public_webarena tests/test_cli_scope.py: 934 passed, 4 failed. Golden route hashes are unchanged.
    • One failure is the known local zillow failure.
    • The other three are in test_risk_control_dataset.py. They happen only because this worktree is nested inside another checkout: reference_inputs walks parent directories and finds the outer checkout's evaluation/lexbench-webfetch.json. The same tests pass on an unnested export of main.
  • Ran package_smoke.verify_release_check_helpers and verify_public_trajectory_publication directly against the source tree: pass.
  • Full local suite (pytest tests -n 2) on macOS: 18729 passed, 67 failed. I can't separate these from the local setup here. The failures include the 14 known failures on unmodified main and the nested-worktree reference-input failures above. Most of the rest are in subprocess-based runner, call-log and markdown-converter tests that load the shared venv's installed harness rather than this checkout. None of the failing tests touches a removed script or function.
  • Review round 1 fixes: ruff (both gates) pass; pytest tests/test_reference_promotion_outputs.py tests/test_golden_reports.py tests/test_reference_lifecycle.py tests/test_freeze_headless_references.py tests/test_run_certified_benchmark.py -n 2: 141 passed. The new test_promotion_commands_default_to_repository_paths_from_any_directory runs both commands from a temporary directory and checks the defaults.
  • CI (Linux) Tests and static checks, Installation and packaging (runs package_smoke) and Rendered reference and report checks: all pass.

🤖 Generated with Claude Code

Remove command scripts that a supported entry point already covers:
- run_risk_control_moli.py and certify_webmainbench_case_correction.py
  duplicate run_certified_benchmark.py risk-control and
  webmainbench-correction.
- freeze_headless_references.py, postcheck_headless.py and
  finalize_benchmark_run.py duplicate stages run_certified_benchmark.py
  runs itself.
- prepare_reference_promotion.py and promote_reference_candidate.py
  duplicate the documented python -m harness.web_fetch.reference_freeze
  subcommands.
- check_wcxb_report.py duplicates check_report.py, which
  make wcxb-release-check already uses.
- check_webarena_trajectory_report.py and
  package_webarena_trajectory_report.py duplicate
  release_webarena_trajectory_report.py; remove the check_main and
  package_main functions they exclusively wrapped.
- run_webfetch_eval.sh and plot_moli_version_resources.py wrap module
  entry points that run directly.

Add scripts/README.md, which lists every remaining entry point and the
Makefile target, guide, profile or receipt that keeps it.

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 · ba63219

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 ba63219c against main 8b8aa30f.

What I verified

  • git grep for every removed basename, plus check_main, package_main and wcxb_report_check.main, across the whole tree (Makefile, CI, docs, .agents/, configs/, evaluation/, tests). Nothing outside scripts/README.md still refers to a removed script. The only hits are module aliases in tests/test_run_certified_benchmark.py and the tests/test_finalize_benchmark_run.py fixture path, and both are fine.
  • The harness functions behind the removed wrappers are still reached through supported entry points. risk_control.main, certify_case_correction, reference_freeze.main/postcheck_main and evidence.finalize_main are called from certification.py. prepare_promotion_main/promote_main are dispatched by reference_freeze.__main__. check_report.py sends WCXB trees to wcxb_report_check.check when it finds wcxb-score-summary.json, which is why the new package_smoke fixture line is needed. The removed check_main/package_main/main functions had no other callers.
  • Every .py/.sh file left in scripts/ appears in scripts/README.md, and every make <target> the inventory names exists.
  • Locally, ruff (both gates) passes. pytest on golden reports, run_certified_benchmark, risk_control_optional_report, wcxb_report_check, moli chart, reference_monitoring, finalize_benchmark_run, public_webarena, cli_scope and wcxb_generation_roundtrip gives 821 passed, 3 skipped. Golden route hashes are unchanged.
  • CI on the head: Tests and static checks, Installation and packaging, and Rendered reference and report checks all pass.
  • The issue section says "Part of #93" and lists what remains, which is accurate.

Findings

P2: scripts/README.md names authorities that do not mention the script. The README says a script stays only when the Makefile, CI, a guide, the report-template config, or a profile, certificate or receipt reaches it. It then lists that authority in the "Reached from" column. For these rows, the named file never mentions the script by basename or module path:

  • scripts/README.md:40: neither certify_headless_cases.py nor project_headless_provider.py appears in HEADLESS.md.
  • scripts/README.md:43: evaluation/webfetch-seven-family-430/dataset-assembly.json does not name assemble_webfetch_dataset.py.
  • scripts/README.md:45: probe_cowagent_text.py is backed by guide/cowagent-text-probe.json. That is an output file, not an authority, and nothing names the script. The PR body does not list this one as remaining.
  • scripts/README.md:65: AGENTS.md does not name authorize_artifact_hub.py.
  • scripts/README.md:73: evaluation/public-wcxb-test-qualified.json does not name select_wcxb_sample.py. Only tests do.
  • scripts/README.md:110: evaluation/trajectory-replay/webarena-verified/README.md does not name build_browser_use_replay_seeds.py, build_webarena_expert_seeds.py, run_webarena_trajectory_replay.py or promote_webarena_trajectories.py.
  • scripts/README.md:114: the six build_webarena_*_suite/_subset/finalize_webarena_adjudication.py scripts are attributed to "Qualification decisions and immutable outputs" in docs/trajectory-replay-protocol.md. That section describes the commands only generically and never names the scripts. The PR body does not list these as remaining.
  • build_webarena_trace_catalog.py (line 116) has no authority at all. The PR body does acknowledge it.

The PR body lists most of these as still open, but the inventory presents them as kept by an authority. A future pruning pass would read that as a reason to keep them. Fix: move every script that is not actually named into a separate section, such as "Pending owner decision (#93)", that says why it survived. Alternatively, add the script name to the owning guide in this PR. Also add rows 45 and 114 to the "remaining" list in the PR body.

P3: root keyword on the promotion entry points is now dead. src/harness/web_fetch/reference_freeze.py:529 and :670: only the deleted scripts passed root=, so the parameter is now unused and the defaults always resolve from Path.cwd(). Fix: drop the parameter, or default it to the module's ROOT (repository_root()) so that --dataset/--canonical resolve the same way the removed scripts did, wherever the command runs from.

No P0/P1 defects found.

lanyue-llk and others added 2 commits October 30, 2026 21:02
Keep only scripts whose listed authority names them by basename or
module path in the inventory tables. Move the scripts that no Makefile
target, guide, template registry, profile, certificate or receipt names
into a "Pending owner decision (#93)" section that records why each one
survived the pruning.

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

The root keyword on prepare_promotion_main and promote_main lost its
last callers with the removed wrapper scripts, so the --dataset,
--canonical and --research-root defaults resolved from the current
working directory. Drop the keyword and default to the module ROOT.

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

Copy link
Copy Markdown
Contributor Author

Review round 1 fixes:

  • P2, inventory rows without a naming authority: fixed in 280b466. The inventory tables now keep only scripts whose listed authority names them by basename or module path; I checked every script with git grep excluding scripts/README.md and tests/. Every flagged row (lines 40, 43, 45, 65, 73, 110, 114, 116), plus the other unnamed ones (use_prepared_webarena_cohort_reset, rename_artifact_hub, the WebMainBench release gates, run_real_smoke.sh, and others), moved to a new "Pending owner decision (Prune unreferenced and one-off migration scripts #93)" section that says why each one survived. verify_artifact_hub.py stays in the main table because public_webarena/release.py names it. The propose_webarena_* row also stays, because docs/trajectory-replay-protocol.md names it by the scripts/propose_webarena_*.py pattern. The PR body's remaining-work list now includes probe_cowagent_text (row 45) and the six qualification commands (row 114).
  • P3, unused root= keyword: fixed in f52535d. I dropped the keyword from prepare_promotion_main and promote_main, and --dataset, --canonical and --research-root now default to the module ROOT (repository_root()). A new test runs both commands from a temporary directory and asserts the repository-root defaults.

Nothing disputed.

@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.

✅ Re-review complete · f52535d

No findings in this incremental 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 2

Head reviewed: f52535db. I found no defects at P0–P3.

Round 1 follow-up

  • P2 (inventory authorities): fixed. I checked every row of the main tables in scripts/README.md against the authority it names. Each script appears in that authority by basename, module path, Makefile target or (for the catalog and propose_webarena_* rows) the pinned set in check_track_naming.py or the documented scripts/propose_webarena_*.py glob. No authority names any script in the "Pending owner decision (#93)" section, apart from tests. The PR body's remaining-work list matches that section, and the PR correctly says "Part of #93", not "Closes".
  • P3 (root= keyword): fixed. prepare_promotion_main and promote_main now default to ROOT = repository_root(). The new test test_promotion_commands_default_to_repository_paths_from_any_directory runs both commands after chdir into a temporary directory, so it would fail on the old Path.cwd() defaults.

What I verified

  • Inventory search: none of the 12 removed basenames appears anywhere in the repository. The only matches are local import aliases of reference_freeze in tests/test_run_certified_benchmark.py and tests/test_finalize_benchmark_run.py, which is a different file from the removed finalize_benchmark_run.py. Every remaining scripts/*.py|*.sh file is listed in scripts/README.md.
  • No scripts were renamed, and no hash-bound evidence or golden snapshots changed.
  • Both ruff gates pass. pytest tests/test_golden_reports.py tests/test_reference_promotion_outputs.py tests/test_run_certified_benchmark.py tests/test_risk_control_optional_report.py tests/test_finalize_benchmark_run.py -n 2: 61 passed, and the golden route hashes are unchanged. scripts/check_track_naming.py passes.
  • CI on f52535db: Tests and static checks, Installation and packaging, Rendered reference and report checks, Python 3.11 and OCR all pass.

@lanyue-llk
lanyue-llk merged commit 65f0f5d into main Nov 2, 2026
6 checks passed
@lanyue-llk
lanyue-llk deleted the refactor/prune-unreferenced-scripts branch November 2, 2026 03:04
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.

Prune unreferenced and one-off migration scripts

1 participant