Repository navigation
refactor(trajectory-replay): read replay report text from the catalog - #214
Merged
Merged
Conversation
lanyue-llk
commented
Nov 4, 2026
lanyue-llk
left a comment
Contributor
Author
There was a problem hiding this comment.
Independent review, round 1
Head reviewed: b51724a4. No defects found.
Byte identity (base 0565b4ab against head, both run locally)
- Full
build_webarena_replay_reportbuilds in both languages for 12 fixture variants: pass and fail crossed with the default fixture, a non-Rainbond site stack, resource samples present, a declared Playwright backend, unverifiable references and a recorded browser host. Each build has 37 files. Every HTML, CSS, JS and data file matched by SHA-256. Onlybrowser-eval-version.jsonandreport-manifest.jsondiffer, as the checkout's build identity would. Those two were not inspected line by line. - Direct helper calls matched in both languages for branches those builds miss: singular and plural failure headings, the failure matrix with unreviewed rows, verdict labels for
pass,failanderror, the supplemental diagnostic, the task page with a corrected acceptance, and the legacy notice. - A fixture that drops
duration_msraises the sameKeyErrorbefore rendering on both commits, so it adds no output comparison. _detail_pagewas covered through the builds, plus reading the diff for its rarer branches. The interpretation-article path was covered only by the curated golden snapshots.
Catalog mapping (my own AST pass over the base source)
- 236 old zh/en string ternaries map to a new source and catalog pair. The 5 exceptions are expected: the 4 folded
.replace()sources andmissing, which is now themissing {count}template. - Tuple and index-selected label tables also match, apart from four unpaired adjacent strings that are not translations (for example
display / visibility, which stays literal). I read the remaining non-string forms, such as dict label tables and nested ternaries, in the diff. messages.jsonhas no duplicate keys. Placeholder names and format specs agree between English and Chinese, apart fromverdict.not_passed, whose Chinese text intentionally has no placeholder. 329 dotted IDs are used, as the PR states.
Scope (Closes #210)
- Neither file has a language ternary containing Chinese left. The remaining
zhconditionals pick paths or evidence fields, or preserve the0.0 squirk, which the PR discloses and #213 tracks. - The Chinese still in
webarena_report.pyis the Chinese-only catalog renderer and the not-generated notice, which have no ternaries.
Rules
- No file under
tests/golden,evaluation/,research/orconfigs/changed. - The base-commit SHA-256 and Git blob hashes of the changed renderer, catalog and locale files appear nowhere in the repository at base.
configs/report-templates.jsonrecords only the renderer path.- No callers of the changed
_format_mssignature orFAMILIESshape exist outside these files. No compatibility aliases were added.
Tests
ruff checkpasses in both lint modes.tests/test_golden_reports.py,tests/test_report_locales.py,tests/test_source_language_policy.pyandtests/trajectory_replay/test_report_messages.py: 41 passed.tests/trajectory_replay,tests/test_report_software_versions.py,tests/test_report_browser_interactions.pyandtests/test_release_check_base.py: 2354 passed, 5 skipped.
CI at b51724a4: all checks pass, including "Tests and static checks", "Installation and packaging" and "Rendered reference and report checks".
lanyue-llk
added a commit
that referenced
this pull request
Nov 4, 2026
Replace the inline language ternaries in webarena_report.py and failure_matrix.py with t(id, english) lookups. English stays inline as source; Chinese lives in messages.json under stable semantic IDs. Rendered output is unchanged in both languages.
lanyue-llk
force-pushed
the
refactor/replay-report-catalog
branch
from
November 4, 2026 03:03
b51724a to
f0aa94b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issues
Closes #210
Follow-up found during this work: #213 (English shows absent timing samples as
0.0 s).Summary
The replay report now reads its text from the catalog instead of inline language ternaries. Rendered output is unchanged in both languages.
catalog_text(path, language)inreporting/locales.pybindst(id, english, **values). English stays inline as source text; other languages read the catalog through the existingtranslate.trajectory_replay/messages.pyowns the catalog path andreport_text(lang).interpretation.pyimports the path from there instead of defining its own.messages.jsongains 329 semantic IDs such asresult.diagnosis.headingandcomparison.relation.all_pass, underzh. The interpretation renderer's existing keys are unchanged..replace()rewrites on the dataset, results and environment bodies are gone; those pages render the final text directly._format_ms(value, lang).failure_matrix.pyjoinsCATALOG_RENDERERS, so inline Chinese there now fails the source-language check.What stays as it was
webarena_report.py: the Chinese-only catalog acceptance renderer and the English-not-generated notice have no language ternaries, so they are out of scope. This is also whywebarena_report.pycan't joinCATALOG_RENDERERSyet.zhconditionals left in place: these only pick paths or evidence fields such asreason_zh, not display text.0.0 sin English and a dash in Chinese. Show absent replay timing samples as a dash in English #213 tracks the fix, and a code comment marks the spot.status.title(), kept through theverdict.not_passedID.webarena_report.py,failure_matrix.pyandmessages.jsondon't appear underevaluation/,configs/,research/,src/ortests/.configs/report-templates.jsononly names the renderer path.Test plan
tests/test_golden_reports.py: 16 passed with no snapshot regenerated, so the replay route hashes did not move.tests/test_golden_reports.py,tests/trajectory_replay,tests/test_report_locales.py,tests/test_source_language_policy.py,tests/test_report_software_versions.py,tests/test_report_browser_interactions.pyandtests/test_release_check_base.py: 2388 passed, 5 skipped. After a final line-length fix in the new test file, I reran only that file and the golden snapshots: 23 passed.tests/trajectory_replay/test_report_messages.pychecks that:has_resource_samplesbranches weren't called directly; a static comparison covers their text..replace()sources andmissing, which is now themissing {count}template.ruff checkpasses in both lint gate modes.