Skip to content

refactor(reporting): extract one shared release-check base - #190

Merged
lanyue-llk merged 5 commits into
mainfrom
refactor/shared-release-check-base
Nov 3, 2026
Merged

lanyue-llk merged 5 commits into
mainfrom
refactor/shared-release-check-base

Conversation

@lanyue-llk

@lanyue-llk lanyue-llk commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

What, why and how of this PR

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_editions and check_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.py and tests/test_bound_report_content.py add 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.

Binding Modules it records
checker_sources (Browser Use visual receipt) browser_use/report_visual.py, reporting/visual.py
checker_sources (Trajectory Replay visual receipt) trajectory_replay/webarena_report_visual.py, reporting/visual.py
producer_sources (Web Search reader capture) web_search/visual.py, web_search/pages.py, reporting/visual.py
renderer_sha256 (Web Fetch presentation_refresh) web_fetch/report.py
renderer_sha256 (Web Search manifest) web_search/report.py
review_script_sha256 (WebMainBench diagnostics) web_fetch/webmainbench_diagnostics.py

The edited checkers are not in this list, and no file under evaluation/ or research/ names them.

Mutation results

Each mutation changed one line, ran tests/test_release_check_base.py and tests/test_bound_report_content.py, then all 41 gate test files if it survived. 47 tried: 44 killed, 3 survived.

Group Mutations Result
open_report drop the symlink refusal killed
checked_page skip presentation rules killed
language_editions Chinese only; wrong English prefix killed
check_report_identity drop build version; drop template; allow linked profile; skip hash; always allow unbound; never allow unbound killed
Gate skips open_report Web Fetch check and revision, snapshot, diagnostic, WCXB, WebMainBench full and sample, Trajectory Replay, Browser Use killed
checked_page to read_page snapshot core routes; diagnostic core routes and result pages; WebMainBench check_table_interaction, full home, guide and result template, sample result detail killed
checked_page to read_page WebMainBench sample edition home and guide (webmainbench_report_check.py:748, :749) survived
language_editions Chinese only Web Fetch public evidence; WCXB guide content; WebMainBench guide content and sample editions killed
language_editions Chinese only WCXB route pairs (wcxb_report_check.py:427) survived
Trajectory Replay identity drop profile; allow unbound; remove the call killed
Browser Use identity refuse legacy reports; drop profile killed
One own rule per track diagnostic, snapshot, Web Fetch, WCXB, WebMainBench full and sample, Trajectory Replay, Browser Use killed

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 raise statement in the seven edited checkers between base and head: the only one removed is report was built from a different instance profile in the Trajectory Replay and Browser Use gates, which moved to check_report_identity. No check_presentation, symlink or identity call was lost.

The mutations ran on 839ea1df, except the sample home site, which ran on the final head after 012e21fa changed that line.

Test plan

Run locally on macOS with the locked environment, Python 3.11:

  • Lint gate (ruff check with F,TID252, then the default config): passed.
  • All 41 gate test files, 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.
  • The full suite was not run locally; CI runs it.

@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 · 8d7f79c

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

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.py
  • producer_sources: web_search/visual.py, web_search/pages.py, reporting/visual.py
  • renderer_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_page replaced by read_page: published_snapshot.py:281; webmainbench_report_check.py:108, 310, 311, 397, 622, 751
  • language_editions replaced 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_json matches the old json.loads(read_text) for valid and invalid input, including BOM and decode errors.
    • read_page and checked_page match the old parser calls.
    • language_editions matches the old pairs for both allowed language contracts, and every language_pairs consumer 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 src creates 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.py passes with no snapshot change.
  • Local tests: the 31 gate test files plus goldens gave 806 passed, 1 skipped. tests/test_config.py and tests/test_optional_reports.py fail 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

@lanyue-llk

Copy link
Copy Markdown
Contributor Author

Round 1 review findings are all addressed; none disputed.

  • P2, PR body: added the mutation results, the frozen-binding list and the symlink note.
  • P2, profile binding at the gates: 4cb86ae5 adds trajectory.check(..., profile_path=...) controls for a changed, unbound and linked profile, and a Browser Use gate control for an unbound legacy report. The mutations named in the finding are now killed.
  • P2, shared flow reached by gates: 839ea1df adds gate-level controls for a wrong highlight and a missing English edition. This kills every named site except the sample guide at webmainbench_report_check.py:749. The docstring is narrowed, and the PR lists that site as unprotected, with the sample home at :748 and WCXB route pairs at wcxb_report_check.py:427. Reach the remaining deep release-gate calls with synthetic reports #193 tracks all three.
  • P3, diagnostic core routes: 21dec65f uses checked_page in the loop. 012e21fa makes the same change for the sample home in WebMainBench.

Beyond the findings: the mutation run also found the WCXB and sample home survivors, which the review did not list.

@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 · 012e21f

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: 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.py and tests/test_golden_reports.py: 105 passed. No golden snapshot is in the diff.

Helper semantics.

  • read_json is the same as json.loads(read_text(encoding="utf-8")) for valid JSON, because raw line breaks cannot appear inside a JSON string.
  • read_page builds the same soup as the old code.
  • checked_page is the same as check_presentation on that text.
  • language_editions keeps the old order and prefixes, because generated_languages only returns ("zh",) or ("zh", "en").
  • check_report_identity matches the old Trajectory Replay and Browser Use logic. Browser Use gains no new refusal in practice, because report_check.py already 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 raise removed is report was built from a different instance profile, in the Trajectory Replay and Browser Use gates. It moved to check_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_page call.

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/ or configs/.
  • checker_sources hashes only the visual module and reporting/visual.py, which matches the PR table.
  • Web Search's gate sits inside web_search/report.py, whose hash renderer_sha256 records, so leaving it out is correct.

Symlink tightening.

  • Only one symlink-creating call exists in src, in environments/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.

lanyue-llk added a commit that referenced this pull request Nov 3, 2026
@lanyue-llk
lanyue-llk force-pushed the refactor/shared-release-check-base branch from 012e21f to d4a66ac Compare November 3, 2026 21:33

@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 · d4a66ac

No findings in this review.

@lanyue-llk
lanyue-llk merged commit b7bd32d into main Nov 3, 2026
7 checks passed
@lanyue-llk
lanyue-llk deleted the refactor/shared-release-check-base branch November 3, 2026 21:43
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.

Extract one shared release-check base

1 participant