Skip to content

feat(reporting): finish report leftovers for language, names, summaries and Mermaid - #408

Open
lanyue-llk wants to merge 15 commits into
mainfrom
report/leftovers
Open

lanyue-llk wants to merge 15 commits into
mainfrom
report/leftovers

Conversation

@lanyue-llk

Copy link
Copy Markdown
Contributor

Purpose

This PR finishes the open report-quality items from #396 and #397. Charts and the detail-page and case-navigation redesign are out of scope and continue in #405.

flowchart LR
  R[Track renderer] -->|labels from registry| N[reporting/names.py<br/>display_name]
  R -->|Mean, P50, P95| S[shell.spread<br/>one folded cell]
  R -->|zh page plus English labels| E[English pass]
  E --> EN[en/ page]
  E -->|drop_other_edition| ZH[zh page, Chinese only]
  ZH --> G{Release gate}
  EN --> G
  G --> C1[check_one_language]
  G --> C2[check_display_names]
  G --> C3[check_interface_language]
  M[reporting/vendor/mermaid.min.js] -->|install_mermaid| A[report assets/]
Loading

What changed

#396 A4: summaries

  • The Web Fetch overall ranking now shows the overall pass rate right after the method. The WCXB core table shows qualified F1 right after the browser.
  • Both tables fold Mean/P50/P95 into one cell with shell.spread. The mean is the value that gets compared and sorted, and the exact P50 and P95 values stay as text in the same cell.
  • On pages at least 1100 px wide, shell.js widens a table's scroller toward the viewport edges when the table is wider than the text column. Narrow pages keep the swipe cue.

#396 A11: names and labels

  • New reporting/names.py:
    • display_name returns the registry label for a name and leaves unregistered names as they are.
    • check_display_names rejects a table cell that shows a raw registered id.
    • check_interface_language rejects an untranslated interface word in a Chinese page's headings, table headers or controls.
  • The shared presentation gate runs the interface check. Web Fetch, WCXB and Browser Use run the display-name check against their own registries.
  • Fixes found by these checks:
    • WCXB tables, options and headings showed ids, and its "Mean" header was not translated.
    • Two Web Fetch tables showed ids: matched-task latency and implementation scope.
    • Browser Use showed "Task #N" in English on Chinese pages, plus one untranslated catalog string.
    • Curated replay task titles are dataset text, so they are now marked data-verbatim.

#396 A15: Mermaid (reporting/vendor/mermaid.min.js, MIT license in licenses/)

  • Version 11.4.1. Its sha384 equals the old pinned SRI hash, and its SHA-256 is pinned in reporting/mermaid.py.
  • Web Fetch, the WebMainBench sample and WCXB copy it into the report with install_mermaid and load it relative to the page. The narrow-width text fallback is unchanged.
  • The wheel grows by about 746 KB compressed.

#396: Replay headings

  • The English h1 ("Task dynamic-list") on Chinese curated pages comes from the synthetic fixture's task title, which is dataset data. Real curated titles are Chinese, so the h1 is now marked as dataset text.
  • One hard-coded interpretation-page string, "Task {id}", now goes through the message catalog.

#397: one language per page

  • Browser Use renders its dynamic catalog text in the edition being rendered.
  • Web Fetch removes each label's data-report-en copy from the Chinese pages, and from the English pages it writes, once the English edition is generated. A Chinese-only build keeps those copies so that a later English pass can still derive from it.
  • check_one_language runs in the Web Fetch and Browser Use release checks.
  • Reports: charts on home pages and one drill-down path from ranking to evidence #397: other fixes
    • The Browser Use dataset search indexes the visible row text, not each task's contract JSON. The fixture dataset page shrank from 198 KB to 69 KB.
    • Replay comparison checkboxes now sit inline: a shared rule resets the track's column flex layout.

Removed

  • Browser Use bilingual_text and its English span rewrite are removed.
  • The pinned CDN loader (mermaid_script_attributes) is kept only for the two reports listed under "Not changed".

Not changed

  • Web Search and the WebArena replay still use the pinned CDN loader. Their scripts are inline on each page, and Web Search's hash-bound bundle strips <base>.
  • Lexbench keeps its own digest-pinned Mermaid, which is a different version.
  • Hash-bound saved Web Fetch extension pages are frozen sources, so they keep their bilingual spans.

Allowlists

There are no changes to the architecture allowlists.

Baselines

The baselines were refreshed. Only rendered HTML, CSS and JS entries changed, plus the new vendored Mermaid runtime and its license. All JSON and JSONL data entries are byte-identical, so scores, counts and latencies are unchanged. Per track:

  • Web Fetch, WCXB and WebMainBench: column order, the folded latency cell, the Mermaid asset, and Chinese pages without English copies.
  • Browser Use: one-language pages, Chinese "任务 #N", and the lighter dataset search index.
  • Replay and curated: the catalog task link, dataset-text markers and the checkbox CSS.
  • Every track: the shared shell.js and shell.css (breakout and spread).

Verification

  • uv run --frozen --all-extras python -m pytest -n 8 --dist worksteal tests: 21759 passed, 78 skipped, 2 xfailed, 0 failed (baselines included)
  • make lint-check
  • uv run --frozen lexbench-webfetch version is unchanged, and the scoring sources were not touched.
  • I took Playwright screenshots at 1440 and 390 px, light and dark, zh and en, of the Web Fetch, WCXB and Browser Use home pages and the Web Fetch analysis page. At 1440 px no page scrolls sideways, and the wide tables break out of the text column. At 390 px, F1 sits beside the name.

Closes #396
Part of #397 (its chart items continue in #405)

Ship mermaid.min.js (SHA-256 pinned; matches the upstream SRI integrity) as
harness.reporting package data with its MIT license under harness/licenses.
Web Fetch, WebMainBench sample and WCXB reports install the runtime and its
license into assets/ and load it relative to their own script, so diagrams
render without a CDN. The Web Fetch publication package serves the runtime
beside report.js, keeps it out of packed content and verifies its bytes;
the privacy projection passes the pinned vendored file unchanged.

Web Search and the public WebArena replay keep the pinned CDN loader.
…er Use

Browser Use renders dynamic catalog text in the edition being rendered.
Web Fetch drops each label's English form from Chinese pages once the
English edition is derived, and from the English pages it writes.
check_one_language rejects a page that embeds the other edition.
…labels

reporting/names.py adds display_name (registry label, unregistered names
unchanged), check_display_names (no raw registered id in a body cell) and
check_interface_language (no untranslated interface word in a Chinese
page's headings, headers and controls; dataset text is marked verbatim).
The shared presentation gate runs the interface check; Web Fetch, WCXB and
Browser Use run the display-name check against their registries.

WCXB tables, options and headings use browser labels instead of ids and
translate its Mean header; Browser Use localizes Task #N; curated replay
task titles are marked as dataset text.
…/P50/P95

The Web Fetch overall ranking puts the overall pass rate right after the
method and the WCXB core table puts qualified F1 right after the browser.
Both fold Mean/P50/P95 into one cell (shell.spread): the mean is the
compared and sorted value, P50 and P95 stay as exact text beside it.

On desktop, shell.js widens a table's scroller toward the viewport edges
when the table is wider than the text column; narrow pages keep the swipe
cue.

Also: Web Fetch drops English labels only when the English edition is
generated (a Chinese-only build keeps them for a later English pass), the
matched-latency and implementation tables use method display names, and the
interface vocabulary leaves out words that are also product names.
Ranking tests read one folded Mean/P50/P95 cell and the new primary-metric
order. Baselines change only in rendered HTML, CSS and JS (and the new
vendored Mermaid files); every JSON/JSONL data entry is unchanged.

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

This review found 4 issue(s), including 4 blocking issue(s).

Comment thread src/harness/reporting/names.py Outdated
attributes and verbatim evidence keep ids and are not read.
"""
soup = BeautifulSoup(html, "html.parser") if isinstance(html, str) else html
raw = {name for name in labels if display_name(labels, name) != name}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bug · medium
This always computes raw IDs against the English label, even on Chinese pages. For example, {"foo": {"en": "foo", "zh": "中文名称"}} allows <td>foo</td> on a Chinese page despite its registered Chinese display name. Conversely, when the Chinese label equals the ID but the English label differs, the valid Chinese label is rejected. Derive the edition from the page's language (normalizing zh-CN to zh), or accept an explicit language argument, and use it when resolving labels.

Comment thread src/harness/reporting/names.py Outdated
if ((declared is not None and not declared["lang"].lower().startswith("zh"))
or node.find_parent(attrs={"data-verbatim": True}) is not None
or node.has_attr("data-verbatim")
or node.find_parent(attrs={"translate": "no"}) is not None

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bug · medium
The advertised language exemptions are not fully honored: find_parent excludes the inspected node, so <button translate="no">Next</button> raises, and collecting descendant text without checking its language makes <h2><span lang="en">Results</span></h2> raise as well. These valid exemptions can therefore fail the shared presentation/release gate. Check translate="no" on the node itself and filter text using its effective language/translation exemptions; add regression tests for both cases.

contained_path(out,'references/'+c['id']+'.txt')
out.mkdir(parents=True,exist_ok=True);(out/'assets').mkdir(exist_ok=True)
(out/'assets/style.css').write_text(STYLE+EXTRA, encoding='utf-8');(out/'assets/report.js').write_text(JS, encoding='utf-8')
(out/'assets/style.css').write_text(STYLE+EXTRA, encoding='utf-8');(out/'assets/report.js').write_text(JS, encoding='utf-8');install_mermaid(out/'assets')

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bug · medium
The new runtime is installed into the renderer's output, but presentation refresh renders into a staging directory and copies only the explicit routes allowlist in report_build.py. That list includes assets/report.js but neither Mermaid asset. Refreshing a report generated before this change therefore installs the new local-only loader without assets/mermaid.min.js, so diagrams fail to load. Include the runtime and license in the refresh installation path, allowing these files to be newly created (the current non-review refresh also rejects routes absent from the original report).

for route in expected:
path = root / prefix / route
html = path.read_text(encoding='utf-8')
check_display_names(html, display_labels)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bug · medium
This new gate rejects the generated analysis/index.html: the individual-results inventory in wcxb_report.py still writes esc(r['provider']) into a <td>. For example, chromium is registered as Chromium, so check_display_names raises on that cell in either edition. The page writer performs no name normalization. Convert the remaining inventory provider cells to browser_label(r['provider']) before enabling this gate; keep the raw IDs in data attributes and links.

@lanyue-llk lanyue-llk changed the title Finish report leftovers: one language per page, display names, folded summaries, vendored Mermaid feat(reporting): finish report leftovers for language, names, summaries and Mermaid Nov 25, 2026
…Mermaid

- check_display_names resolves labels in the page's language.
- check_interface_language honours translate="no" and another declared
  language on the element itself and on text inside it.
- WCXB result inventory cells show browser labels.
- Presentation refresh installs the vendored Mermaid runtime and license
  beside report.js, including into reports built before it was vendored.
@lanyue-llk

Copy link
Copy Markdown
Contributor Author

OCR round 1: all four findings were fixed in c621b5c.

  • check_display_names now resolves labels in the page's own language. Regression test: tests/test_reporting_names.py::test_display_names_resolve_in_the_page_language.
  • check_interface_language now honours translate="no" and other declared languages both on the element and on text inside it. Regression cases are in the same file.
  • Presentation refresh now installs the vendored Mermaid runtime and license, including into reports that predate vendoring. Regression test: tests/test_local_audit.py, which fails without the fix.
  • WCXB result inventory cells now show browser labels. Regression test: tests/test_wcxb_report_languages.py::test_wcxb_cells_show_registered_browser_names, which fails without the fix.
    Local full suite: 21761 passed, 0 failed.

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

This review found 1 issue(s), including 1 blocking issue(s).

Comment thread src/harness/reporting/names.py Outdated
if not raw:
return
for cell in soup.select("main td, main tbody th"):
for text in cell.find_all(string=True):

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bug · medium
This checks parser text nodes rather than visible names. With labels={'chromium': 'Chromium'}, <td><span>chrom</span>ium</td> passes even though it displays the raw ID, while <td><!--chromium-->Chromium</td> raises because BeautifulSoup includes comments in find_all(string=True). Extract visible text across inline elements (while retaining separator boundaries and verbatim exclusions), exclude comments/non-rendered content, and add regression tests for both cases so the release gate neither misses split IDs nor rejects invisible ones.

Comments and other non-rendered nodes are skipped, and the cell is also
read across inline elements so an id split by markup is still caught.

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

This review found 1 issue(s), including 1 blocking issue(s).


ℹ️ All inline findings were already present in unresolved threads or duplicated within this review; nothing new was posted.

Existing unresolved findings:

if _edition(soup) != "zh":
return
for node in soup.select(_INTERFACE):
text = " ".join(str(part).strip() for part in node.find_all(string=True) if _interface_text(part)).strip()

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bug · medium
Exclude non-rendered text before validating interface language. find_all(string=True) includes HTML comments and script/style contents, and _interface_text does not filter them. On a Chinese page, <h1>Chromium<!-- Status --></h1> incorrectly raises, while <h1>Results<!-- 中文 --></h1> incorrectly passes because the invisible comment satisfies _CJK. This affects the shared presentation gate. Apply the same NavigableString filtering used by check_display_names, exclude script/style descendants, and add regression tests for both cases.

@lanyue-llk

Copy link
Copy Markdown
Contributor Author

OCR round 3: fixed in ec8844a. check_interface_language now skips comments and any text inside script or style. Regression cases for <h1>Chromium<!-- Status --></h1> (passes) and <h1>Results<!-- 中文 --></h1> (rejected) are in tests/test_reporting_names.py. The two remaining inline findings on report.py and wcxb_report_check.py are from round 1; they were fixed in c621b5c and are covered by tests. Local full suite: 21761 passed.

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

This review found 1 issue(s), including 1 blocking issue(s).

Comment thread src/harness/reporting/names.py Outdated
and text.find_parent(attrs={"data-verbatim": True}) is None]
# Each text node, and the cell read across inline elements, so a split id is still seen.
for text in (*texts, "".join(texts)):
for part in _CELL_PARTS.split(text.strip()):

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bug · medium
Splitting before checking the complete text misses registered IDs that themselves contain a separator. For example, with labels {"vendor/model": "Model"}, a cell containing only vendor/model passes because only vendor and model are checked. The mapping API does not restrict ID characters. Check text.strip() against raw before splitting composite cells, and add a regression test for a separator-bearing ID.

@lanyue-llk

Copy link
Copy Markdown
Contributor Author

OCR round 4: fixed in 95f5704. Each cell's whole text is now checked before it is split, so an id that contains a separator is still caught. Regression test: tests/test_reporting_names.py::test_an_id_containing_a_separator_is_still_a_raw_id. The round-3 inline comment on names.py (comments and script text) was already fixed in ec8844a. The previous Python tests (1/3) failure was a dataset download mismatch during make setup-test, which is infrastructure, not this change.

@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 · 95f5704

This review found 2 issue(s), including 2 blocking issue(s).

Comment thread src/harness/reporting/names.py Outdated
# Each text node, and the cell read across inline elements, so a split id is still seen.
for text in (*texts, "".join(texts)):
# The whole text first: an id may itself contain a separator.
for part in (text.strip(), *_CELL_PARTS.split(text.strip())):

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bug · medium
A registered display label can be rejected as a raw ID after splitting. For example, with labels={"foo": "foo / bar"}, a cell containing the exact result of display_name(labels, "foo") raises because the split component foo is in raw. Profile participant labels are also accepted by the callers, so this can block a correctly rendered report. Recognize resolved display labels before inspecting their separator-delimited components, and add a regression test for this case.

INTERFACE_WORDS = ("Mean", "Median", "Average", "Total", "Status", "Result", "Results", "Pass", "Passed",
"Fail", "Failed", "Task", "Tasks", "Latency", "Score", "Rank", "Back", "Next",
"Previous", "Close", "Details", "Owner", "Revision")
_INTERFACE_WORD = re.compile(r"\b(?:" + "|".join(INTERFACE_WORDS) + r")\b")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bug · medium
The interface-word regex is case-sensitive, so a Chinese page with <th>mean</th> or <button>NEXT</button> passes the gate while the equivalent Mean or Next fails. Match capitalization variants (for example with re.IGNORECASE) and cover lowercase/uppercase controls in the validator tests.

@lanyue-llk

Copy link
Copy Markdown
Contributor Author

OCR round 5: the display-label finding is fixed in 5e56f64. A cell's registered display labels are now recognized as whole labels before the text is split. Regression test: tests/test_reporting_names.py::test_a_label_containing_its_id_is_a_display_name. I am not adopting the case-insensitive interface-word finding. Report chrome is generated from catalogs in title case, and a case-insensitive match would also reject lowercase product or identifier text in Chinese pages. I am treating it as P2 and recording it for follow-up.

@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 · 5e56f64

This review found 2 issue(s), including 2 blocking issue(s).

Comment thread src/harness/reporting/names.py Outdated
and text.find_parent(["pre", "code", "script", "style", "template"]) is None
and text.find_parent(attrs={"data-verbatim": True}) is None]
# Each text node, and the cell read across inline elements, so a split id is still seen.
for text in (*texts, "".join(texts)):

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bug · medium
Checking individual text nodes before recognizing complete labels rejects valid labels split across inline markup. With {'foo': 'foo / bar'}, <td><span>foo</span> / bar</td> raises on the first text node, although its visible text is exactly the registered display label (the unformatted equivalent is already covered as valid in the tests). Recognize complete labels across inline nodes before checking their constituent text, while retaining detection of split raw IDs.

Comment thread src/harness/reporting/names.py Outdated
for text in (*texts, "".join(texts)):
text = text.strip()
for label in shown:
text = text.replace(label, "\0")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bug · medium
Unrestricted substring replacement can hide a raw registered ID. For example, with labels {'foo': 'Friendly', 'other': 'oo'}, a cell containing only 'foo' becomes 'f\0' and passes validation. Profile-provided labels are also accepted by callers, so label/ID overlaps are not excluded. Match complete display-label spans at cell-part boundaries rather than arbitrary substrings, and add an overlapping-label regression test.

@lanyue-llk

Copy link
Copy Markdown
Contributor Author

OCR round 6: fixed in a6c0002. Each cell is now read once as its visible text across inline markup and split into separator-delimited parts. A part counts as a name when it belongs to a whole display label, and the comparison uses complete parts, not substrings. Regression cases cover a label split by markup and labels whose ids overlap. The previous failure of the rendered reference checks was a 5-minute action timeout during capture, which is infrastructure.

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

This review found 2 issue(s), including 2 blocking issue(s).

Comment on lines +64 to +65
found = text if text in raw and text not in shown else next(
(part for index, part in enumerate(parts) if part in raw and index not in covered), None)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bug · medium
Separator-containing IDs escape the gate in compound cells. With labels={"vendor/model": "Model"}, <td>vendor/model · 42</td> passes: the whole text is not a raw ID, and splitting leaves vendor, model, and 42, none of which matches it. Detect complete registered IDs within compound cells as well, retaining the display-label exemptions, and add a regression test alongside the existing standalone vendor/model test.

if _edition(soup) != "zh":
return
for node in soup.select(_INTERFACE):
text = " ".join(str(part).strip() for part in node.find_all(string=True) if _interface_text(part)).strip()

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bug · medium
Joining every text node with an inserted space lets inline markup bypass the interface-language check. On a Chinese page, <th>La<span>tency</span></th> visibly reads Latency, but this produces La tency, so no interface word matches. Preserve adjacency across inline text fragments (while retaining the language/verbatim exemptions) and add a split-word regression test.

@lanyue-llk

Copy link
Copy Markdown
Contributor Author

OCR round 7: I am not adopting either finding, and I am stopping OCR cycles here.

  • Separator-bearing ids inside compound cells: the registered ids for every track are restricted to [A-Za-z0-9._-] (see Browser Use Participants.from_profile and the method catalog). The standalone case is already covered.
  • Interface words split across inline spans: no renderer splits a word with markup.
    Both are edge cases of the heuristic, not defects in rendered reports. I am treating them as P2 and recording them for follow-up.

This branch has not been deployed

No deployments
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.

Reports: one shell, navigation, theme, table and label system across tracks

1 participant