Repository navigation
refactor(reports): remove hardcoded leftovers from renderers - #236
Conversation
There was a problem hiding this comment.
✅ Re-review complete · 97cef84
No findings in this incremental review.
lanyue-llk
left a comment
There was a problem hiding this comment.
Independent review, round 1
Reviewed head 97cef84e. Three P2 findings and one P3. The code moves are correct; the problems are the Closes claims and one untested behaviour change.
Findings
P2. src/harness/web_fetch/report_changes.py:14,74: Closes #97 misses an item the issue names.
#97 lists "report_changes.py:11,71 hardcodes release IDs". Both are still there (HEADLESS_HISTORY_START and '2026-09-03-fairness-correction'). The PR neither changes them nor mentions them under "Deliberately left", and neither #183 nor #205 covers them. The file is not hash-bound.
Fix: move the two IDs into the release history data the module already reads, if that keeps output identical. Otherwise list them and change to Part of #97.
P2. PR body, ## Issues: Closes #98 is overclaimed.
The issue title and problem list include report prose and product claims in translation regexes. Still present:
- the
report_i18n.pyregexes, for example:292("这三项在五款中均最低") and:429 - cohort prose in
generate_webmainbench_full(report.py:4129,4134,4137,4180,4191,4206) - the
case_count==150 and track_count==6branch (report.py:1882) MOLI_TIMING_*intrajectory_replay/report.py:405,407
Leaving these is reasonable, since they need a new bound content edition, an owner decision or #99. But the body says the prose "has no issue of its own, so reopen #98 if you want it tracked", which makes closing the default and tracking the exception. The rule is that Closes means the issue is complete.
Fix: use Part of #98 and keep the existing list as what remains. No new issue is needed.
P2. src/harness/web_fetch/report_pricing.py:54: the deliberate branch change has no test.
all(native_browser_engine(name) ...) changes behaviour for browser-only cohorts outside the old set. I confirmed that ['chromium','moli-candidate'] and ['moli-pr643'] get the price comparison on main and the cost-boundary table on this head. ['chromium','exa'] still gets the comparison. As a mutation, I restored a literal set in place of the new condition; test_report_pricing.py, test_public_report_language.py and the matching golden tests (-k "pricing or web_fetch or language") still passed. Golden snapshots do not reach this case either.
Fix: add one paired test to tests/test_report_pricing.py that asserts the branch for ['chromium','moli-candidate'] and for ['chromium','exa'].
P3. src/harness/web_fetch/webmainbench_correction.py:343: same literal left unchanged.
provider != "kitesurf" is the same test this PR replaces in webmainbench_certification.py, and the file is not hash-bound.
Fix: use engine_definition(provider).hosted here too, or say why this one differs.
Verified with no defect found
- Moved assets:
JS,EXTRA,STYLE, Web SearchSTYLE,SCRIPTandEVIDENCE_SCRIPTare equal character for character between main and this head. The cohort diagnostic CSS and JS equal the literals extracted from main withast. The WCXB golden snapshot is unchanged. - Complete report: rendered from both trees with the fixture denominators set to 545/110/257/179/179. All 12 changed files are identical once the theme key and the
?v=hash are normalized, and no files were added or removed. - Public research report: rendered from the real research document in both trees, and the output is identical.
- Correction section: the PR did not render it. I rendered it on this head with a stub correction file, and it works. Its
min(...)value could not be checked against real evidence, because none is available in this environment. - Literal swaps: only
kitesurfsetshostedand onlychromiumsetsplaywright_launched, and unregistered names behave as before, so the preflight, explainer, certification and label changes are equivalent. profile["case_count"]: certification requires it to be 545 on real profiles, and the report check requires the expected denominators.renderer_sha256: recorded values are only compared to decide whether to refresh, and nothing verifies them as frozen.headless.py,network_preflight.py,report_pricing.pyandui_check.jsare not hash-bound;headless_worker.pyandwebmainbench_runner.pyare untouched.--siteandMOLI_REPORT_SITE: no supported caller relied on the old defaults, and the Lexbench README already passes--siteand sets the variable.- Over-design: none found.
asset_textandrenderer_sha256are small and each removes more than it adds.
Tests and CI
- Lint gate: passed.
tests/test_golden_reports.py: 17 passed.- Local audit, complete report, public research, data home,
tests/web_search, Lexbench verification and software versions: 658 passed. tests/test_report_ui.mjsandtests/test_report_loader.mjs: passed.- CI on this head: all checks pass, including "Tests and static checks" and "Installation and packaging".
|
Review round 1 follow-up. Fixed:
Disputed: nothing. |
There was a problem hiding this comment.
✅ Re-review complete · 54b2d59
No findings in this incremental review.
lanyue-llk
left a comment
There was a problem hiding this comment.
Independent review, round 2
Reviewed head 54b2d591. No defects found: no P0, P1, P2 or P3 findings.
Round 1 findings
report_changes.py:first_correctionand its release ID are gone, with no remaining references. I accept the reason for keepingHEADLESS_HISTORY_START:select_cohort_historyuses it to partition releases withoutcomparison_kinds, so it cannot move without changing how bound copies are selected. It is listed under what remains in #97.Closesoverclaims: the body now saysPart of #97andPart of #98, and the lists match what I found in the code.- Pricing branch test: restoring the literal nine-name set makes the
['chromium','moli-candidate']case fail. I ran this mutation and reverted it. webmainbench_correction.pyreadsengine_definition(provider).hosted. Onlykitesurfis hosted, so behaviour is unchanged.
What I verified
- Asset moves: I evaluated the old string literals from
35bed218withastand compared them to the new assets.report.jsandreport-extra.cssare byte-identical.wcxb.cssandwcxb.jsare byte-identical after the old slice, replace and append steps.webmainbench-full.cssis byte-identical, andwebmainbench-full.jsdiffers only by the theme key.
- Participant swaps:
hostedis true only forkitesurf, andplaywright_launchedonly forchromium. Both labels and thekitesurftests therefore behave as before, including for unregistered variants.- Every name in the old pricing set resolves through
native_browser_engine. No catalog method outside the old set does, so the branch change only affects registry browser variants, as the body discloses.
- Measured values:
- The research document yields 200, 150, 1497 and 511.
webmainbench_report_checkrejects any summary whose denominators differ from 545/110/257/179/179, so reading them from the first summary is safe for a release.certificationrequirescase_countto be 545.- The correction section is not rendered by the fixture, as the body says. I read it instead:
prior_moli,content_moliandtarget_body_countare all defined unconditionally before it.
- Renderer hash and hash-bound files:
renderer_sha256replaces all threereport.pyhash uses inreport_build.py.- The
first_correctionremoval and the_engine_definitionrename leave no stale references, including in the frozen latency certifiers. providers/headless.pyandnetwork_preflight.pyare not hashed by any source binding.headless_worker.py,webmainbench_runner.pyand the other listed hash-bound files are untouched.- No
wmb545-themereference remains.
- Goldens: only
webmainbench-full(12 routes) andweb-search(manifest.json) changed, which matches the table in the body. - Simplicity:
asset_text,renderer_sha256and the publicengine_definitioneach replace repeated code. There is no new registry or layer, and I found no simpler form.
Test results
- Lint gate: passed.
- Golden, pricing, report changes, complete WebMainBench report, data home, Lexbench verification, local audit and public language tests: 190 passed.
test_report_ui.mjsandtest_report_loader.mjs: passed.- CI on this head: Tests and static checks, Installation and packaging, and Rendered reference and report checks all passed.
…hort literals out of renderers Inline CSS and JavaScript in web_fetch/report.py and web_search/report.py now load from package assets, and each renderer hash covers those assets. Complete WebMainBench and public research counts read the profile, score summaries and research document. Hosted and Playwright engine branches read the engine registry, and the Lexbench check no longer defaults to one report's directory.
54b2d59 to
3e43884
Compare
Issues
Closes #97. Everything else it listed is frozen or hash-bound, so it stays:
HEADLESS_HISTORY_STARTinreport_changes.py(reason under "Deliberately left").headless_worker.py,task_outputs.py(Move remaining headless engine branches into the engine registry #183);remote_execution.py,remote_runtime.py,webarena_corrections.py(Move engine literals and the task 225 branch out of hash-bound replay files #205);webmainbench_runner.py.SAMPLE_PROVIDERS,expected_denominatorsandquality_limitsinwebmainbench_report_check.py.Closes #98. What stays, and why, is under "Deliberately left":
web_fetch/report_i18n.pyandbrowser_use/report_i18n.py, and inreport-translations.json(Make English the source language of all report renderers, with Chinese as a catalog #99).generate_webmainbench_full.case_count==150 and track_count==6branch inweb_fetch/report.py.MOLI_TIMING_*and the"moli"tests that select them intrajectory_replay/report.py.The inline CSS and JS and the Mermaid pin from #98 are finished, in every track.
Part of #183:
network_preflight.pynow readshosted.headless_worker.pyandtask_outputs.pyremain there. #205 is untouched.Summary
Inline CSS and JavaScript. About 76k characters in
web_fetch/report.pyand 9k inweb_search/report.pymove to package assets, as other tracks already do (web_fetch/assets/{report.js,report-extra.css,wcxb.*,webmainbench-full.*,cohort-diagnostic.*},web_search/assets/{report.css,report.js,native-evidence-result.js}). In WCXB, the old slice and replace calls that patched its script are gone, because the asset holds the final text.Renderer hashes (the question from #197). A new
renderer_sha256()inreport_build.pyhashesreport.pyplus the CSS and JS inassets/, so a style change still refreshes Web Fetch details. This also coversreport-style.css, which was outside the hash until now. Recorded values stay valid:presentation_refresh.renderer_sha256is only compared to decide whether to render again, so the first build after this change refreshes, as after any renderer edit. The Web Searchrenderer_sha256covers its assets the same way. Thesource_sha256in therescoring.pyaudit still namesreport.pyonly, because CSS and JS cannot change a score.Measured values.
profile["case_count"]and the metric populations from the score summaries'denominators.Theme key.
wmb545-themebecomeswebmainbench-theme. A reader's saved theme on that report resets once.Participant literals.
_engine_definitionbecomes publicengine_definition, with no new registry. These now read it instead of testing forkitesurforchromium:network_preflight.py,report_explainer.py,webmainbench_certification.pyand the labels inreport.py.report_pricing.pyusesnative_browser_engineinstead of a nine-name set. This can change one case: a browser method outside the old set, such as a new Moli variant, now gets the browser cost table instead of the price comparison.lexbench check --siteandMOLI_REPORT_SITEare now required, instead of defaulting to one old report's directory.Release IDs.
first_correctioninreport_changes.pyhad no caller, so it and its test are gone, along with2026-09-03-fairness-correction.webmainbench_correction.pyreadshostedfor its version argument.Rendered output
With real populations, output is byte-identical apart from the theme key. I rendered the complete report from the old and new trees, with the fixture set to 545/110/257/179/179.
report.jsdiffers only by the theme key, and every HTML page only by the?v=asset hash that follows it. The public research report built from the real research document is identical except for the source hashes inbrowser-eval-version.jsonandreport-manifest.json.Golden changes:
webmainbench-fullassets/report.jswebmainbench-fullindex,analysis,cases,dataset,en,guide,history,methodology,reproduce,results,viewer)?v=hash followsreport.jswebmainbench-fullindex,analysis,guideweb-searchmanifest.jsonrenderer_sha256covers the new assetsAll other snapshots are unchanged. The moved assets keep their routes (
assets/style.css,assets/report.js).The fixture profile gains
case_count: 545, which certification already requires of real profiles.Deliberately left
Hash-bound or frozen, not edited:
headless_worker.py(Move remaining headless engine branches into the engine registry #183), andremote_execution.py,remote_runtime.py,webarena_corrections.py(Move engine literals and the task 225 branch out of hash-bound replay files #205).webmainbench_runner.py(PROVIDERS,WCXB_PROVIDERS,EXPECTED_VERSIONS, kitesurf branches):runner_sha256is recorded per run and frozen certifier sources depend on it.lexbench/reproduction.pyandresource_matrix.py: copied byte for byte into published reports asreproduction/run.pyandrun_resource_matrix.py.Frozen cohort facts, left as written:
HEADLESS_HISTORY_STARTinreport_changes.py. It partitions the 15 releases that predatecomparison_kinds. Moving it into the release data would add a key to the publicreport-changes.json. A boundreport-assets/report-changes.jsoncannot gain the key either, and without it every untagged release would be selected for every cohort.SAMPLE_PROVIDERS,expected_denominatorsandquality_limitsinwebmainbench_report_check.py. They are the check's independent expectation, and no profile reaches it. Reading them from the report under check would weaken it.certification.py(moli,moli-pr643binary bindings),webmainbench_latency_*.py,webmainbench_correction.py,wcxb_latency.pyand the 545 checks inreport_build.pyname cohorts that have already run.Adapter behaviour, not participant lists:
playwright_tool.py,catalog_runner.py,runtime_identity.py,cloudflare.py,public_webarena/qualification.py. A capability table would add as much as it removes.Needs a new bound content version or a text change:
generate_webmainbench_full("七条", "六类", the three Moli versions) andMOLI_TIMING_*intrajectory_replay/report.py. Moving this prose means a new hash-bound report-content edition.case_count==150 and track_count==6wording branch inreport.py. Removing it changes real output, so it needs an owner decision.report_i18n.pytranslation regexes andreport-translations.jsonbelong to Make English the source language of all report renderers, with Chinese as a catalog #99.Test plan
Run with the shared locked environment on Python 3.11. Local runs used
-o pythonpath="src .", because this session could not setPYTHONPATH. Subprocess tests therefore import the older installed package rather than this checkout.ruffF, TID252 and the default config): passed.tests/test_golden_reports.py: 17 passed after regenerating the two snapshots above.tests/web_search/test_offline_imports.py: its subprocess importsharness.web_search.clifrom the older install.-k "report or wcxb or webmainbench or pricing or preflight or headless or lexbench or certif or package or language"): 3119 passed, 32 failed, 13 skipped. I re-ran a sample of these (network preflight, runner concurrency, report check owner, headless report, publication privacy) and every error came from the environment: the dataset lock or older CLI of the other checkout. I did not inspect all 32, so CI on Linux is the gate for them.test_renderer_identity_covers_loaded_assets: an asset edit changes the renderer identity.PYTHONPATHset to this checkout: golden, report changes, pricing, public report language and the WebMainBench correction and review guard suites gave 124 passed. The lint gate passed.test_only_browser_only_cohorts_get_the_cost_boundary_table: it fails for['chromium','moli-candidate']when a literal set replaces the condition.545/545line) is not exercised by the fixture, so it was only compiled, not rendered.