Repository navigation
refactor(reporting): extract one shared release-check base - #190
Conversation
lanyue-llk
left a comment
There was a problem hiding this comment.
Independent review, round 1
Head 8d7f79c5. CI is green on this head (Tests and static checks, Installation and packaging, Rendered reference and report checks, Python 3.11). I found no behavioural regression in the helper swaps. The findings below are about the proof that #187 requires.
Findings
P2: PR body, Closes #187 is claimed but the required proof is missing.
The body says mutation results "are being collected" and the test plan is "Pending". #187 also requires each hash-bound checker to be listed with its binding, and that list is absent.
Fix: before merge, add the mutation list with results and the frozen-binding list. From my reading, the list should cover:
checker_sources:browser_use/report_visual.py,trajectory_replay/webarena_report_visual.py,reporting/visual.pyproducer_sources:web_search/visual.py,web_search/pages.py,reporting/visual.pyrenderer_sha256:web_search/report.py,web_fetch/report.py
The body should also disclose one behaviour change: wcxb_report_check.check, webmainbench_report_check.check, check_sample_report, check_diagnostic_report and check_snapshot_audit now reject symlinks in the report tree. The two WebMainBench gates, the diagnostic gate and the snapshot gate also now resolve the root. This tightening looks right, but it is new behaviour and not a pure refactor.
P2: src/harness/trajectory_replay/webarena_report_check.py:519, the moved profile binding is not protected at the gate.
Changing the call to check_report_identity(root, manifest, "trajectory-replay") drops the instance-profile hash check, and the whole test suite still passes. Passing allow_unbound_profile=True here also survived the 31 gate test files; I did not run that one against the whole suite. The new unit tests cover the helper, not this call's arguments. The same gap exists at the base commit: removing the inline comparison there also survived the gate test files I ran, so this is not a regression. It is still the main risk #187 names, on a line this PR rewrites.
Fix: add a trajectory.check(..., profile_path=...) negative control for a changed, unbound and linked profile. Add one for allow_unbound_profile=True at browser_use/report_check.py:485 too, where switching it to False also survives.
P2: tests/test_release_check_base.py:1, the docstring claims more than the tests prove.
It says the shared flow "is reached by every track gate", but the gate-level tests only reach open_report. These swapped call sites can lose the shared rule with the whole suite still passing:
checked_pagereplaced byread_page:published_snapshot.py:281;webmainbench_report_check.py:108, 310, 311, 397, 622, 751language_editionsreplaced by Chinese only:report_check.py:78;webmainbench_report_check.py:50, 523
I confirmed two of the checked_page sites (published_snapshot.py:281, webmainbench_report_check.py:310) survive in equivalent form at the base commit, so these look like existing gaps and not lost checks.
Fix: add gate-level negative controls (a wrong highlight reaching each gate, a missing English route), or narrow the docstring and report these sites as unprotected in the PR's mutation list.
P3: src/harness/web_fetch/report_diagnostic.py:462-464, one repeated pattern was left behind.
The core-route loop still reads text and calls check_presentation, while line 553 in the same function uses checked_page.
Fix: use checked_page(output / route) here as well.
What I verified
- Helper semantics:
read_jsonmatches the oldjson.loads(read_text)for valid and invalid input, including BOM and decode errors.read_pageandchecked_pagematch the old parser calls.language_editionsmatches the old pairs for both allowed language contracts, and everylanguage_pairsconsumer was updated for the swapped tuple order.- The Browser Use identity check adds no real change, because that gate already rejects a linked profile earlier.
- Frozen bindings: none of the modules above were edited. Hashes of the edited files at the base commit do not appear in the repository. They also do not appear in the 20,000 evidence and review JSON files I sampled locally, out of 27,748. This was a sample and not a full search.
- Symlink producers: nothing in
srccreates a symlink inside a report tree, so the tightening should not reject a normal build. I did not run the gates against real published reports. - Lint and golden snapshots: ruff passes, and
tests/test_golden_reports.pypasses with no snapshot change. - Local tests: the 31 gate test files plus goldens gave 806 passed, 1 skipped.
tests/test_config.pyandtests/test_optional_reports.pyfail 4 tests on the unmutated head in my checkout, with errors from the local dataset lock and paths. They are not on the known local failure list, but they pass in CI and do not involve this diff.
Mutations tried
I ran 35 mutants against the 31 gate test files. Survivors were then applied together and run against all of tests/, except trajectory.unbound, which conflicts with trajectory.noprofile. tests/package_smoke.py is not collected by pytest, so it was not run.
| Group | Killed | Survived |
|---|---|---|
open_report removed, 9 gate sites |
all 9 | none |
checked_page swapped, 8 sites |
report_diagnostic.py:553 |
the other 7 |
| Identity wiring, 5 mutants | Browser Use call removed, trajectory call removed | Browser Use strict, trajectory without profile, trajectory unbound |
language_editions swapped, 5 sites |
wcxb_report_check.py:306, wcxb_report_check.py:427 (only by tests/test_wcxb_participant_registry.py) |
report_check.py:78, webmainbench_report_check.py:50, 523 |
release_check.py internals, 8 mutants |
all 8 | none |
|
Round 1 review findings are all addressed; none disputed.
Beyond the findings: the mutation run also found the WCXB and sample home survivors, which the review did not list. |
There was a problem hiding this comment.
✅ Re-review complete · 012e21f
No findings in this incremental review.
lanyue-llk
left a comment
There was a problem hiding this comment.
Independent review, round 2
Head reviewed: 012e21fa. No defects found. All round 1 findings are fixed.
What I verified
CI. Run 41720951772 on this head passed: Tests and static checks, Installation and packaging, and Rendered reference and report checks. Main is still at the PR base, 2c8a6947.
Local runs.
- The lint gate passed.
tests/test_release_check_base.py,tests/test_bound_report_content.pyandtests/test_golden_reports.py: 105 passed. No golden snapshot is in the diff.
Helper semantics.
read_jsonis the same asjson.loads(read_text(encoding="utf-8"))for valid JSON, because raw line breaks cannot appear inside a JSON string.read_pagebuilds the same soup as the old code.checked_pageis the same ascheck_presentationon that text.language_editionskeeps the old order and prefixes, becausegenerated_languagesonly returns("zh",)or("zh", "en").check_report_identitymatches the old Trajectory Replay and Browser Use logic. Browser Use gains no new refusal in practice, becausereport_check.pyalready rejects a linked profile before the identity call.
No check lost. I compared the AST of all seven edited checkers between base and head.
- The only
raiseremoved isreport was built from a different instance profile, in the Trajectory Replay and Browser Use gates. It moved tocheck_report_identity. - The removed calls match the added helper calls one for one. The WebMainBench home is the one exception by design: its parse and presentation check became one
checked_pagecall.
Frozen bindings.
- The base-commit SHA-256 of each edited checker appears nowhere in the Git tree at base or in the local data home.
- None of the edited file names appears under
evaluation/,research/orconfigs/. checker_sourceshashes only the visual module andreporting/visual.py, which matches the PR table.- Web Search's gate sits inside
web_search/report.py, whose hashrenderer_sha256records, so leaving it out is correct.
Symlink tightening.
- Only one symlink-creating call exists in
src, inenvironments/webarena/map_setup.py, outside report building. The report-build code I searched creates none. - The local report-build and evidence directories contain no symlinks, so no local report build or evidence tree trips the new refusal.
- These gates now also refuse a report root that is itself a link, which is slightly wider than the PR's "inside the report tree" wording. The same evidence applies, so I am not raising it.
Mutations I ran
I ran these independently of the author's list. The first pass used the two new test files; the survivors noted below were then run against wider suites.
| Mutation | Result |
|---|---|
Every checked_page site to read_page (10 sites) |
8 killed; webmainbench_report_check.py:748 and :749 survive |
Every language_editions site to Chinese only (4 sites) |
report_check.py:78 and webmainbench_report_check.py:49, :522 killed; wcxb_report_check.py:306 killed by tests/test_wcxb_report_languages.py; wcxb_report_check.py:427 survives |
Skip open_report at each of the nine gates |
all killed; Browser Use by tests/browser_use/test_report_check.py |
| Wrong track in the Trajectory Replay and Browser Use identity calls | killed |
| Trajectory Replay: drop profile, allow unbound | killed |
| Browser Use: refuse legacy reports | killed |
| Base: drop build version, drop template, allow linked profile, swap the English prefix, return an unresolved root | killed |
Swap the pair order at webmainbench_report_check.py:523 and :546 |
killed |
Swap the pair order at webmainbench_report_check.py:708 |
survives |
The survivors at 748, 749 and 427 are exactly the three the PR body discloses, and open issue #193 tracks them.
The survivor at 708 is not in the PR's list. It sits in the same part of check_sample_report, past what any synthetic report reaches, so the complete fixture #193 asks for will cover it too. The line is correct by reading, so it needs no change here.
Scope
"Closes #187" holds:
- One shared base is used by all nine gates.
- Each track keeps its own rules.
- The frozen-bound checkers are untouched and listed.
- Mutation results are reported, with the remaining gaps tracked in #193.
012e21f to
d4a66ac
Compare
Issues
Closes #187
Part of #156
Follow-up: #193 covers three gate calls no synthetic report reaches yet (listed under the mutation results).
Summary
Adds
src/harness/reporting/release_check.py, the outer flow the release gates repeat:open_report,read_page,checked_page,language_editionsandcheck_report_identity. All nine gates use it: Web Fetch check and revision, snapshot, diagnostic, WCXB, WebMainBench full and sample, Browser Trajectory Replay and Browser Use. Each track keeps its own rules and negative controls.tests/test_release_check_base.pyandtests/test_bound_report_content.pyadd gate-level negative controls for a wrong highlight, a missing English edition, and a changed, unbound or linked profile.Behavior change: symlinks in the report tree
The WCXB, WebMainBench full and sample, diagnostic and snapshot gates did not refuse a symlink inside the report tree before. They do now, through
open_report, as the Web Fetch, Trajectory Replay and Browser Use gates already did. A report tree holding a symlink that one of these gates used to accept now fails. WCXB and WebMainBench already refused linked profile and binding files; those checks are unchanged. The gates also resolve the report root before reading.Frozen hash bindings
No module recorded by a frozen binding is edited or routed through the new base.
checker_sources(Browser Use visual receipt)browser_use/report_visual.py,reporting/visual.pychecker_sources(Trajectory Replay visual receipt)trajectory_replay/webarena_report_visual.py,reporting/visual.pyproducer_sources(Web Search reader capture)web_search/visual.py,web_search/pages.py,reporting/visual.pyrenderer_sha256(Web Fetchpresentation_refresh)web_fetch/report.pyrenderer_sha256(Web Search manifest)web_search/report.pyreview_script_sha256(WebMainBench diagnostics)web_fetch/webmainbench_diagnostics.pyThe edited checkers are not in this list, and no file under
evaluation/orresearch/names them.Mutation results
Each mutation changed one line, ran
tests/test_release_check_base.pyandtests/test_bound_report_content.py, then all 41 gate test files if it survived. 47 tried: 44 killed, 3 survived.open_reportchecked_pagelanguage_editionscheck_report_identityopen_reportchecked_pagetoread_pagecheck_table_interaction, full home, guide and result template, sample result detailchecked_pagetoread_pagewebmainbench_report_check.py:748,:749)language_editionsChinese onlylanguage_editionsChinese onlywcxb_report_check.py:427)The three survivors are unprotected, because they sit past what any synthetic report reaches. Each call is correct today. The guide and WCXB mutations also survive in equivalent form at base
2c8a6947, so these are existing gaps rather than lost checks; the home site was not tried at base. #193 tracks them.The own-rule row samples one rule per track, so it does not prove every rule runs. For that, an AST inventory compared every
raisestatement in the seven edited checkers between base and head: the only one removed isreport was built from a different instance profilein the Trajectory Replay and Browser Use gates, which moved tocheck_report_identity. Nocheck_presentation, symlink or identity call was lost.The mutations ran on
839ea1df, except the sample home site, which ran on the final head after012e21fachanged that line.Test plan
Run locally on macOS with the locked environment, Python 3.11:
ruff checkwithF,TID252, then the default config): passed.tests/test_golden_reports.py,tests/test_explicit_utf8_io.py,tests/test_shared_hash_json_helpers.py: 1435 passed, 1 skipped. Golden route hashes are unchanged.