Repository navigation
build(packaging): bundle package data and move package gate to Python - #135
Conversation
Replace deprecated setuptools data-files with harness package data read through importlib.resources; repository paths named by bindings do not move. Pin Python to the 3.11 that the lock and CI test, tidy the Makefile, add one macOS capability module and run ShellCheck on deploy scripts.
lanyue-llk
left a comment
There was a problem hiding this comment.
Independent review, round 1
Reviewed head 96e05753. I found no correctness bugs. There are two documentation defects and one nit.
Findings
P2: src/harness/web_fetch/HEADLESS.md:351-352, src/harness/web_fetch/README.md:456: documented commands are now rejected
- Problem: both guides still say
make report EVIDENCE=/absolute/path/to/evidence, andHEADLESS.mdalso saysmake report-check. Neither passesPROFILE, so both now stop withPROFILE=/absolute/path/to/profile.json is required. On main they did not work either:--profile ""becamePath("."), whichbuild_report.pythen tried to read as a file (from reading the code, not run). This PR makesPROFILEan explicit contract, so these guides should follow it. - Fix: add
PROFILE=/absolute/path/to/profile.jsonto these commands.src/harness/web_fetch/report.py:2944and:2946render the same commands into the reproduction section. Fix those too and explain any golden route change, or list them under "Remaining" in the PR body.
P2: examples/trajectory_replay/README.md:16: stale Python claim
- Problem: it still says "Python 3.11+", while
requires-pythonis now>=3.11,<3.12. The PR body says the untested wider claim was removed.test_python_policy_agrees_across_project_lock_and_cichecks only the root README anddocs/README.zh-CN.md, so it misses this file. - Fix: change the text to "Python 3.11", and consider adding this README to the test's list.
P3: src/harness/web_fetch/webmainbench_latency_diagnostic.py:506: sandbox command assembled by hand
- Problem: this is the only caller that imports the raw
SANDBOX_EXECconstant and builds[path, "-p", profile, ...]itself. There is no functional bug, becauseverify_loopback_sandboxat line 492 goes throughsandbox_exec_commandfirst and stops an unsupported host. It does leave a second copy of the command shape thatplatform_capabilitiesis meant to own. - Fix: use
[*sandbox_exec_command(LOOPBACK_SANDBOX_PROFILE), str(binaries[version]), ...]. The argv stays the same.
What I verified
CI on 96e05753: all jobs passed. The log shows make ci-tests running find deploy -name '*.sh' -exec shellcheck {} +, which covers two scripts, and 18828 passed, 157 skipped. "Installation and packaging" ran scripts/check_package.py under uv 0.7.8.
Local runs (macOS):
- The lint gate passed.
tests/test_packaging_hygiene.py, golden, runtime entry point, network DNS, native DNS, portable CLI, method registry, latency runtime and headless tests gave 219 passed and 1 failed. The failure,test_converter_shared_and_nonzero_not_converted, is on the known local failure list.tests/test_golden_reports.pygave 10 passed, andtests/golden/is not in the diff.
Package data:
uv buildproduced a wheel with no.datadirectory, the seven files underharness/distribution_data/, andRequires-Python: <3.12,>=3.11.- The sdist contains
setup.py,MANIFEST.inand the bundled inputs. - With the wheel unpacked outside the checkout,
source_path("uv.lock"),regression_registry_path(),_report_input()and the provider registry all resolved to the packaged copies. - The four copies I compared byte for byte match the repository:
uv.lock,pyproject.toml,configs/providers.headless.jsonandscoring-regressions.json.
uv.lock, compared package by package against base:
- Only
numpy 2.5.3,scipy 1.18.1andhttpx2-jsfetch 1.0were removed, and nothing was added. - Retained wheels keep their hashes. The removed wheels are all for Python 3.12 or later, including GraalPy 3.12 builds.
uv lock --checkpasses under uv 0.13.0. I did not run it under CI's uv 0.7.8. CI only shows that version reading the lock with--frozen.
Hash bindings:
- No file under
evaluation/orconfigs/bindsuv.lock,pyproject.tomlor the changed modules by hash. capture_source_identityand thefrozen_sourcechecks detect drift within a single run.verify_certifier_sourcechecks a frozen artifact, not the live module.collection_implementationinweb_search/runner.pyhashesuv.lock,pyproject.tomlandharness/distribution.py, so a Web Search cohort interrupted before this PR must start again rather than resume. That is the check's intended behaviour for any change to those files.
Semantics of swapped helpers:
- The sandbox argv is unchanged on macOS, and
sandbox_exec_availablematches the old check. MacOSRequiredErroris aValueError, so existing handlers still catch it._execution_browser_method_registrystill returns{}when the data is absent.- Workers that import
network_dnsrun with the harness root on the path, so the newharness.platform_capabilitiesimport resolves.test_cowagent_isolationis on the known local failure list, so CI is the evidence for that case.
Makefile (GNU Make 3.81):
make formatwithoutFILESexits 2, andmake reportwithoutPROFILEexits 2.make -n cleantouches only build outputs and caches.- BSD
findreturns non-zero when a-exec ... +command fails, soshell-checkwould fail correctly on macOS too. ShellCheck is not installed here, so CI is the only evidence of a clean run.
Scope: "Part of #106" is accurate. The rename, the workflow edits and the methodology PNGs are listed as remaining, and review_guidelines.py no longer appears in the repository.
Not verified by me:
make browser-checkwas not executed, by me or by CI. I only read its recipe, andtests/test_packaging_hygiene.pycompares its test paths with the CI job.make package-checkwas not run locally. The CI job is the evidence for it.
Pre-existing, not caused by this PR: examples/web_fetch/docker/resource.Dockerfile copies harness, but the repository has no root harness/ directory, so that image cannot build on main either.
There was a problem hiding this comment.
✅ Re-review complete · d3ec9fb
No findings in this incremental review.
…ough platform capabilities
d3ec9fb to
01c6205
Compare
|
Review round 1 fixes, on head 01c6205. No finding is disputed. Fixed
Worth checking in the P3 fix. The finding described this as argv-only, but it does change one test-visible behavior: Golden routes changed
Each change only adds the required profile; no measured value changes. The CI on 01c6205: all jobs passed. Tests and static checks: 18829 passed, 157 skipped. Installation and packaging: passed. |
lanyue-llk
left a comment
There was a problem hiding this comment.
Independent review, round 2
Reviewed head 01c6205c. All three round 1 findings are fixed. I found no correctness bugs. Two leftovers remain from the same classes as round 1: one P2 and one P3.
Findings
P2: src/harness/trajectory_replay/report.py:1226: a rendered report still claims "Python 3.11+"
- Problem:
_appendix_page, reached throughwrite_latest_reportfromtrajectory_replay/runner.py, tells readers to preparePython 3.11+. I called it and confirmed that the output contains the string. This is the claim the PR body says it removed, andexamples/trajectory_replay/README.md, the guide for the samerun.sh, now says "Python 3.11".test_python_policy_agrees_across_project_lock_and_ciscans only tracked*.md, so it misses renderers. - Fix: change the text to
Python 3.11and extend the policy scan tosrc/harness/**/*.py. Do not scan frozen data:evaluation/webfetch-seven-family-430/case-corrections.jsoncontains the same string as a quotation from a source page and must stay. If a golden route changes, explain it in the PR body.
P3: src/harness/trajectory_replay/public_webarena/release.py:91,96: printed commands omit the required profile
- Problem: the script tells the operator to run
make public-webarena-report-auditandmake public-webarena-report-release. Both targets now stop withPROFILE=... is required.test_documented_make_commands_name_the_required_profilemisses these because it only checks segments that start withmake, and these commands sit inside a sentence. - Fix: print the commands with
PROFILE=<the --profile value>. The script already holds that value inCURRENT.
What I verified
- CI on
01c6205c: every job passed. Tests and static checks: 18829 passed, 157 skipped. The log showsfind deploy -name '*.sh' -exec shellcheck {} +running insidemake ci-tests, and the job passed. The package job'smake package-checkstep ran through to the installed-wheel smoke result. - Local (macOS, shared locked environment): lint gate passed.
tests/test_packaging_hygiene.py,tests/test_golden_reports.py,tests/test_webmainbench_latency_diagnostic.py,tests/test_webmainbench_latency_runtime.py,tests/test_network_dns.pyandtests/test_runtime_entrypoints.py: 109 passed. - Lock: a package-by-package comparison with main shows only
numpy 2.5.3,scipy 1.18.1andhttpx2-jsfetch 1.0removed and nothing added. Sources, sdists and retained wheels are unchanged, and no cp311, abi3 or pure-Python wheel was dropped.uv lock --check --offline(uv 0.13.0) resolved 178 packages and left the tree clean. - Package data: no
installed_data_pathorshare/browser-harness-evalreference remains. I compared the reader swaps indistribution.py,methods.py,webmainbench_correction.pyandpublic_webarena/report.pywith the old code.ROOTandrepository_root()resolve the same way. The one difference is inmethods.py: a missing file in an installed package now returns{}rather than raising, and the exact-inventory check inverify_package_treecovers that case. - Hash bindings: the base-commit SHA-256 of each changed source file I checked, plus
pyproject.toml,uv.lockandMakefile, appears nowhere in tracked files, so no committed binding names those bytes. Evidence outside Git was not available to check. The hashes recorded bywebmainbench_runner, the latency diagnostic, the latency correction,rescoringandreview_executionare run-time records; I read their comparisons in the first three and found they are within a run or against the frozen certifier registry. One intended effect:web_search.runner.collection_implementationincludesuv.lock,pyproject.tomlandharness/distribution.py, so an interrupted Web Search cohort cannot resume across this PR and must start again. - Package gate: the command sequence matches the removed shell.
PATHstill contains the checkout's.venv/binunderuv run. I found no smoke or harness lookup that resolves a project Python through it, so this is not a finding. - Makefile: one
.PHONYblock,makeprints help, a missing profile stops with the clear message, andmake -n cilists the same checks as the CI jobs. - macOS capabilities:
sandbox_exec_commandproduces the same argv as the old literal, and no rawsandbox-exec,top -lormemory_pressurecall remains outside the capability checks, apart from the frozen certifier copies underdata/latency-certifiers/. - Scope: "Part of #106" is accurate, and its Remaining list covers what is left.
review_guidelineshas no references in the repository, as the PR says.
Not run: make browser-check and a full local make package-check. The PR body already discloses both.
|
Round 2 findings, fixed on the new head.
Nothing disputed. Run locally: |
There was a problem hiding this comment.
✅ Re-review complete · 440e610
No findings in this incremental review.
lanyue-llk
left a comment
There was a problem hiding this comment.
Independent review, round 3
Reviewed head 440e6105. Both round 2 findings are fixed. I found no correctness bugs. Two P3 items remain: leftover code in one module and a stale test plan in the PR body.
Findings
P3: src/harness/trajectory_replay/public_webarena/report.py:15,19: superseded code left behind
- Problem:
ROOT = repository_root()(line 19) was used only by the old_report_input. After the move tobundled_data_path, nothing in the module readsROOT, so the variable and therepository_rootimport exist only for each other. I found no other module or test that readsreport.ROOT. Ruff does not flag an unused module variable. AGENTS.md asks for superseded code to go in the same change. - Fix: delete line 19 and drop
repository_rootfrom the import on line 15.
P3: PR body, "Test plan": results stop before the current head
- Problem: the CI line names
01c6205c, the local section covers only review round 1, and it still saystests/test_packaging_hygiene.pyhas 34 tests (it has 35 now). Nothing there is false, but the body does not report what was run on the commits from round 2 onward. - Fix: update the CI line and the counts to the final head, and add the round 2 and later local runs.
What I verified
- CI on
440e6105: all checks pass. Tests and static checks: 18829 passed, 157 skipped. Installation and packaging passed. The log showsfind deploy -name '*.sh' -exec shellcheck {} +running on the runner with no findings. - Local on
440e6105(macOS): lint gate passed.test_packaging_hygiene,test_golden_reports,test_webmainbench_latency_diagnostic,test_trajectory_releaseandtest_runtime_entrypoints: 80 passed. - Round 2 fixes: the appendix text is corrected, and the policy scan covers
src/harness/**/*.py.release.pyprints quotedPROFILE=commands, and the test checks the printed output. I did not repeat the negative controls. - Packaging:
uv buildproduced a sdist and a wheel. The sdist containssetup.py,MANIFEST.inand the six bundled inputs (setuptools addspyproject.toml).- The wheel has all seven files under
harness/distribution_data/, no.data/entries, andRequires-Python: <3.12,>=3.11. - From the unpacked wheel, outside the checkout,
bundled_data_pathandsource_path("uv.lock")resolve to the packaged copies, and a missing name raisesFileNotFoundError. - No
installed_data_pathorshare/browser-harness-evalreferences remain.
- Lock: the package-by-package comparison confirms the PR body. Only
numpy 2.5.3,scipy 1.18.1andhttpx2-jsfetch 1.0were removed, nothing was added, and retained sdist hashes are unchanged. Each retained package's wheel entries are a subset of the old ones. - Hash bindings: I searched
evaluation/,configs/,research/,tests/andsrc/on main for the SHA-256 of every file this PR changes and found no matches.capture_source_identityand the Web Searchcollection_implementationhashnetwork_dns.py,distribution.py,uv.lockandpyproject.toml. Their comparisons are within a run or against a resumed cohort's own contract, so an interrupted Web Search cohort cannot resume across this change and must start again. Evidence stored outside Git was not checked. The historical latency certifier snapshots are unchanged. - Golden changes: only the three routes explained in the PR body changed.
- Makefile:
makeprints help.make report-checkwithout a profile stops with exit 2 and the stated message. Optional-profile targets are unchanged. No remaining command in tracked files omits a required profile, apart from prose mentions inscripts/README.mdand.agents/skills/benchmark-report/references/evaluation-design.md. - Python policy: no
3.11+,3.12or3.14support claim remains.scripts/bootstrap_oss_baselines.sh(3.11.12) and the Docker base image (python:3.11) satisfy the new range. - Issue scope: "Part of #106" is correct, and the Remaining list matches what is left.
review_guidelines.pyis no longer referenced in the repository.
Not verified
- I did not run the real
make package-checkormake browser-check, becauseuv runand pip installs are out of bounds here. CI covers the package gate.make browser-checkitself remains unrun, as the PR body says. - ShellCheck did not run locally; only the CI run above covers it.
Existing issues outside this PR
These are on main too, so I am not raising them as findings:
src/harness/web_fetch/report.py:1254rendersmake public-benchmark-research, and the Makefile has no such target.examples/web_fetch/docker/resource.Dockerfile:123copiesharness, but the package now lives undersrc/.
There was a problem hiding this comment.
✅ Re-review complete · 7fead61
No findings in this incremental review.
|
Review round 3 fixes, on head 7fead61. Nothing disputed.
Local: the lint gate passes. CI on 7fead61: all jobs passed. Tests and static checks: 18829 passed, 157 skipped. Installation and packaging and the rendered report checks also passed. |
lanyue-llk
left a comment
There was a problem hiding this comment.
Independent review, round 4
Head reviewed: 7fead61. No defects found. The round 1 to 3 fixes are in place, and I found nothing new.
CI on this head
All jobs passed in run 41397652191, and I read the log.
- Tests and static checks:
make ci-tests, 18829 passed, 157 skipped. The log showsfind deploy -name '*.sh' -exec shellcheck {} +running, and it reported no findings. - Installation and packaging:
make package-checkran throughscripts/check_package.py, covering the sdist, wheel and all three optional-profile smoke runs. - Rendered reference and report checks: 81 passed, 1 skipped.
Local runs (macOS, shared locked environment)
- Lint gate: passed.
tests/test_packaging_hygiene.py,test_golden_reports.py,test_runtime_entrypoints.py,test_webmainbench_latency_diagnostic.pyandtests/trajectory_replay/public_webarena: 744 passed, 3 skipped.test_package_contents.py, runtime entry points, report language, release metadata, README navigation, source language, latency runtime and golden tests: 156 passed, 1 skipped.uv build: the wheel has no.data/entries and holds the seven files underharness/distribution_data/. The sdist containssetup.py,MANIFEST.inanduv.lock.- Wheel unpacked outside the checkout:
bundled_data_pathresolved all seven files to the packaged copies, including through the namespace package's multi-path traversable. The same held forsource_path("uv.lock"),source_path("pyproject.toml"), the provider registry, the regression registry and the public WebArena inputs. A missing file raisesFileNotFoundError; absolute,..and empty paths raiseValueError.
Checks by area
- Package gate. The Python gate matches the old inline shell step for step: same build, same install order, same profiles. The Python version now comes from
.python-version. The parentuv runvariables are stripped. - Readers.
_execution_browser_method_registrystill returns{}when the file is absent, and a symlink still raises. No references toinstalled_data_pathorshare/browser-harness-evalremain.ROOTinwebmainbench_correction.pyis still used. - Lock. I compared
uv.lockpackage by package.- Only
numpy 2.5.3,scipy 1.18.1andhttpx2-jsfetch 1.0are removed, and nothing is added. - No retained sdist hash changes.
- None of the 2085 dropped wheels of retained packages can install on CPython 3.11 (no cp311,
py*or abi3 tags).
- Only
- Hash bindings. No file under
evaluation/,research/orsrc/harness/web_fetch/data/changes. The main-branch SHA-256 of each changed non-test file appears nowhere in the tree. The hash matches for new files are the empty-file hash, which is not a binding. Runtime hashes such asrunner_sha256andruntime_source_sha256are recorded per run, so this PR only changes them for new runs. - Goldens. There are no golden changes after d9d40f5. The three earlier route changes are explained in the PR body and only add the profile argument.
- Makefile.
.PHONYequals the target list, andmake helplists every target.- Required-profile,
DIAGNOSTIC_PROFILE,WEBMAINBENCH_PROFILEandFILESerrors fire before any tool runs. - The only remaining profile-less mentions outside the frozen paths are
scripts/README.mdindex rows naming targets, which are not commands to run.
- macOS capabilities. Callers now go through
platform_capabilities. The remainingsys.platformbranches insafety.pyare optional path and copy behaviour, not requirements. In the paired diagnostic, the sandbox command is built before the timer starts. - Python policy.
pyproject.toml, the lock,.python-version, CI, the Dockerfile's Python 3.11 base image and the docs agree.examples/*/run.shgo throughuv run --frozen. - Scope. "Part of #106" is accurate, and the remaining work is listed.
review_guidelines.pyno longer appears anywhere in the repository, as the PR says..github/workflows/is untouched.
Not exercised
make browser-check: the target itself was not run, only compared with the CI job's file list. The PR body says the same.- ShellCheck locally: it is not installed on this machine, so CI is the only ShellCheck result.
Python 3.10 cannot run this project: webarena-verified, numpy, scipy and others require 3.11, and the code uses tomllib, datetime.UTC and hashlib.file_digest. Nothing requires an upper limit, so restore the lock file from main and state the floor in both READMEs.
There was a problem hiding this comment.
✅ Re-review complete · a5ce1ef
No findings in this incremental review.
|
Why Only one route changed: I checked this with an independent rebase. Regenerating on the merged registry changed that one route. In the normalized manifest, reverting only the string The rebase produced tree |
Issues
Closes #106. Remaining:
harnessimport package, and aligningpackage.json: owner decision pending in Refactor roadmap: open-source code quality and English-first source #87..github/workflows/ci.ymlwithmake package-check/make browser-checkonly, and updating.github/workflows/README.md: the token has no workflow scope.make ci-testspicks up ShellCheck without a workflow edit.Summary
Package data.
[tool.setuptools.data-files]is gone. The seven root-level files now install underharness/distribution_data/and are read throughimportlib.resourcesby one helper,bundled_data_path. No repository path moves, so no hash-bound or profile-named path changes.pyproject.tomlanduv.lockcannot live inside a package, so a smallsetup.pybuild_pystep copies the list declared intool.browser-eval.bundled-data, andMANIFEST.inkeeps those files in the sdist.verify_package_treenow treats them as part of the exact package inventory.Python policy.
requires-pythonstays>=3.11, with no upper limit. 3.11 is the real minimum, checked on Python 3.10.22: the locked dependencies do not resolve (webarena-verified,numpy,scipy,networkx,Pint,Markdownandrpds-pyrequire 3.11), and the code usestomllib,datetime.UTCandhashlib.file_digest, none of which exist in 3.10. All 473 source files parse as 3.10 syntax, so the failure is in the standard library and dependencies, not the syntax. This PR removes the untested "3.11–3.14" README claim: the READMEs now say 3.11 or newer is required and that CI tests 3.11. Versions above 3.11 are allowed but not tested here. The lowest 3.11 patch release was not tested; CI uses the latest 3.11.uv.lockis unchanged frommain.Package gate. The inline shell moved to
harness/package_gate.pybehindscripts/check_package.py, with the version read from.python-version. It also runs the base CLI and report-language check that CI otherwise only has inline. It stripsVIRTUAL_ENV,PYTHONHOMEandPYTHONPATH, since it now runs underuv run.Makefile.
.PHONYblock.help(now the default goal; plainmakeused to runsetup),cleanandformat.--profile "". No default is possible: report instance profiles live outside Git andevaluation/current-report.jsonno longer exists.make cinow runsci-tests,package-checkand the newbrowser-check, matching the CI jobs.make formatneeds explicitFILES: 147 files are not Ruff-formatted, and scorer modules must keep their published source hashes.Platform capabilities.
harness/platform_capabilities.pyownssandbox-exec,top -l,memory_pressureand the native DNS bridge, and raisesMacOSRequiredErrornaming the feature. It subclassesValueError, so existing handlers keep working.The issue overstated two items.
ps -axoandfcntlwork on Linux and already run there in CI, so they stay as they are.ShellCheck.
make shell-checkcoversdeploy/**/*.shand is part ofci-tests, so it runs on the CI runner's ShellCheck.The issue's
review_guidelines.pyclaim is out of date: neither CI nor the repository references that script now.Test plan
Local, initial implementation (macOS, shared locked environment; later rounds are listed below):
tests/test_packaging_hygiene.py(new, with negative controls): 34 passed at this point; 35 on the final head.tests/test_golden_reports.py, plus package contents, runtime entry points, report language, release metadata, CI gate, README navigation and source language tests: 201 passed, 1 skipped, 4 failed. The 4 are thetests/test_ci_gate.pyfailures already listed as known on this host. Golden route hashes were unchanged at this point; see the review round below for the three routes that have since changed.-n 2: stopped at its failure limit, with 65 failed and 16008 passed, so it is not a complete local result. I re-ran the nine failing files: the failures trace toHistorical benchmark source is not recorded in the dataset lock, the nested-worktree lookup described below. CI below is the full-suite result.uv buildproduced a wheel and sdist. Unpacking the wheel outside the checkout,verify_package_tree,verify_bundled_dataand each migrated reader (provider registry, regression registry, public WebArena inputs,source_path("uv.lock")) all resolved to the packaged copies. The wheel has no.data/entries and declared the earlier upper limit at that commit; the limit has since been removed.Not verified locally:
make package-check: pip installs were out of bounds in this environment, so only the gate's command sequence is covered, with a fake runner. CI "Installation and packaging" is the real check.evaluation/lexbench-webfetch.json. That is unrelated to this change; CI runs it from a normal checkout.make shell-checkon the runner's ShellCheck and reported no findings, sodeploy/needed no edits.make browser-check: the target itself has not been run. CI's browser job still uses its inline commands, and a test keeps the target's pytest file list equal to that job's.CI on the final head, 7fead61: all jobs passed.
Local runs by review round (macOS, focused targets; the full suite is left to CI):
tests/test_packaging_hygiene.py,tests/test_golden_reports.pyandtests/test_webmainbench_latency_diagnostic.py: 52 passed.tests/test_packaging_hygiene.py,tests/trajectory_replayandtests/test_golden_reports.py: 2094 passed, 5 skipped.tests/test_packaging_hygiene.py: 35 passed.tests/test_packaging_hygiene.py,tests/trajectory_replayandtests/test_golden_reports.py: 2094 passed, 5 skipped. Golden route hashes did not change in rounds 2 or 3.tests/test_ci_gate.pyfailures on this host; they pass on CI.Golden route changes
Regenerated with
UPDATE_GOLDEN=1in d9d40f5. Each change only adds the profile that the Make target requires; no measured value changes.webmainbench-sample:reproduce/index.htmlanden/reproduce/index.htmlnow showmake public-benchmark-report PROFILE=<profile> EVIDENCE=<corrected-evidence>.web-fetch:report-manifest.jsonembeds the report template registry, whosecheckcommand is nowmake report-check PROFILE=/absolute/instance-profile.json.The same correction to the two reproduction strings at
src/harness/web_fetch/report.py:2944and:2946changes no golden route, because no snapshot fixture renders them. They take effect at the next rebuild of a report that uses those branches.