Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
c34087c
fix(trajectory-replay): localize interpretation task link through the…
lanyue-llk Nov 25, 2026
27abb8f
perf(browser-use): index visible dataset row text instead of contract…
lanyue-llk Nov 25, 2026
36cf3b6
fix(reporting): keep same-task explorer checkbox pairs inline against…
lanyue-llk Nov 25, 2026
ab64538
feat(reporting): vendor Mermaid 11.4.1 for Web Fetch and WCXB reports
lanyue-llk Nov 25, 2026
ee2e6a0
feat(reporting): publish one language per page in Web Fetch and Brows…
lanyue-llk Nov 25, 2026
cfe649d
feat(reporting): show registered display names and Chinese interface …
lanyue-llk Nov 25, 2026
5ae9aad
feat(reporting): lead summaries with the primary metric and fold Mean…
lanyue-llk Nov 25, 2026
9c9d2ef
test: follow the folded latency column and refresh report baselines
lanyue-llk Nov 25, 2026
7a94346
test: refresh Web Fetch baselines after rebase
lanyue-llk Nov 25, 2026
c621b5c
fix(reporting): resolve names per page language and refresh vendored …
lanyue-llk Nov 25, 2026
6909795
fix(reporting): read visible cell text when checking display names
lanyue-llk Nov 25, 2026
ec8844a
fix(reporting): skip comments and scripts in the interface-language c…
lanyue-llk Nov 25, 2026
95f5704
fix(reporting): check a cell's whole text before splitting composite …
lanyue-llk Nov 25, 2026
5e56f64
fix(reporting): accept display labels that contain their own id
lanyue-llk Nov 25, 2026
a6c0002
fix(reporting): match display labels as whole separator-delimited parts
lanyue-llk Nov 25, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ evaluation/headless/artifacts/** -diff -text -whitespace
evaluation/headless/sources/** -diff -text -whitespace
evaluation/headless/diagnostics/**/artifacts/** -diff -text -whitespace
evaluation/sources/** -diff -text -whitespace
# The vendored Mermaid runtime is byte-exact upstream release output, pinned by digest.
src/harness/reporting/vendor/** -diff -text -whitespace
1 change: 1 addition & 0 deletions THIRD_PARTY.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ The root Apache-2.0 license covers project-owned code and documentation. It does
| Repository editorial skills | Origins and notices under `.agents/skills/` | Retain their notices; they are not browser-package runtime dependencies |
| Self-hosted extraction dependencies | [Crawl4AI](https://github.com/unclecode/crawl4ai) (Apache-2.0), [ScrapeGraphAI](https://github.com/ScrapeGraphAI/Scrapegraph-ai) (MIT), [Stagehand](https://github.com/browserbase/stagehand) (MIT); versions in `deploy/web-extract/uv.lock` | Installed in the optional extraction service; preserve upstream licenses and dependency notices |
| Firecrawl server | [Firecrawl](https://github.com/firecrawl/firecrawl) (AGPL-3.0); deployments bind an immutable upstream image digest | Runs as a separate service. The facade does not incorporate the server source; retain upstream notices and comply with its license when distributing or modifying it |
| Mermaid diagram runtime | [Mermaid](https://github.com/mermaid-js/mermaid) 11.4.1 `dist/mermaid.min.js`, vendored at `src/harness/reporting/vendor/mermaid.min.js`; SHA-256 pinned in `src/harness/reporting/mermaid.py` | MIT; the [license](src/harness/licenses/Mermaid-MIT.txt) ships in the wheel and is copied beside the runtime in every report that installs it |
| Synthetic offline examples | `src/harness/web_fetch/data/` | Project-owned test inputs with no third-party captures |
| Resource-collection overhead calibration | `src/harness/resource_calibration.py`, derived from a [pinned Lexbench source](https://github.com/lexmount/Lexbench-Headless-Browser/blob/fd8d64c7623d46cd165607f216a0e28967d03040/runner/resources.py); source hash recorded in the module | Apache-2.0; retain the [full license](src/harness/licenses/Lexbench-Apache-2.0.txt) and attribution in source and wheel distributions |

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ include = ["harness*", "lexbench_webfetch*", "lexbench_websearch*"]
"harness.web_search" = ["messages.json", "data/*.json"]
"harness.web_extract" = ["messages.json", "assets/*.css", "assets/*.js", "firecrawl_backend.mjs"]
"harness" = ["licenses/*.txt"]
"harness.reporting" = ["report-style.css", "shell.css", "shell.js", "messages.json", "data/frozen-sources/*.json", "data/frozen-sources/*.txt"]
"harness.reporting" = ["report-style.css", "shell.css", "shell.js", "messages.json", "vendor/mermaid.min.js", "data/frozen-sources/*.json", "data/frozen-sources/*.txt"]
"harness.trajectory_replay" = ["messages.json", "resources/fixtures/*.html"]
"harness.browser_use" = ["messages.json"]
"harness.lexbench" = ["assets/*.js", "assets/*.cjs", "template/*"]
Expand Down
21 changes: 11 additions & 10 deletions src/harness/browser_use/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@
"automatic_failure_type.network_side_effect_acceptance_failure": "网络副作用验收失败",
"changes_page.changelog": "报告版本说明",
"changes_page.each_release_records_only_formal_corrections": "每个版本只记录影响读者判断的正式修正;结论、分母、耗时与证据影响直接展示,技术依据按需展开。",
"chart.task_pass_rate": "任务通过率",
"chart.task_pass_rate_caption": "按通过率排序;n/N 为每个模型与浏览器组合的通过数 / 完成任务数。",
"check.baseline_only": "仅基准通过",
"check.compare_all_configurations": "全部 {models_count} 种配置中比较",
"check.comparison_only": "仅对比通过",
Expand Down Expand Up @@ -172,6 +174,7 @@
"check.user_prompt": "用户提示词",
"check.wall_time_per_call": "单次调用墙钟时间",
"common.not_recorded": "未记录",
"common.task_number": "任务 #{task_id}",
"conditions.unrecorded_steps": "未记录",
"dataset_index.all_tasks_were_fixed_before_model": "本轮在模型执行前固定 {task_count} 个任务,覆盖四个已部署站点以及 RETRIEVE、NAVIGATE、MUTATE 三种最终合同。这里仅描述题目与验收规则;通过率、耗时、轨迹和可完成性观察统一放在结果分析中。",
"dataset_index.candidate_benchmarks_selection_rationale_and_preregistered": "候选 benchmark、选择依据与 {task_count} 个预注册任务",
Expand Down Expand Up @@ -300,7 +303,7 @@
"filters.none": "无",
"filters.result": "结果",
"filters.task_intent_answer_or_error": "任务、意图、答案、错误",
"filters.task_intent_or_acceptance_contract": "任务、意图、验收合同",
"filters.task_intent_site_or_rationale": "任务、意图、站点、入选理由",
"fix_log.action_count": "动作数",
"fix_log.after": "修复后",
"fix_log.before": "修复前",
Expand Down Expand Up @@ -340,6 +343,11 @@
"interpretation_evidence.p50_performance_and_resources_on_tasks": "{value}配置最终共同成功任务的性能与资源 P50",
"interpretation_evidence.text": "{configuration_count} 种",
"interpretation_evidence.within_model_browser_pairs_on_the": "审查合格比较集的模型内浏览器配对结果",
"inventory.back_to_results": "返回结果列表",
"inventory.next_result": "下一条",
"inventory.no_failures_showing_all": "没有未通过的结果,已改为显示全部结果。",
"inventory.previous_result": "上一条",
"inventory.show_more": "显示更多",
"list.separator": "、",
"methodology_deployment.autonomous_trajectory": "{models} · {engines} 自主轨迹示例",
"methodology_deployment.docker_context": "Docker 上下文",
Expand Down Expand Up @@ -595,7 +603,7 @@
"task_pages.result": "{models} · {engines} 结果",
"task_pages.task": "任务 {task_id}",
"task_pages.task_identity": "任务身份",
"task_pages.task_template_id_revision": "· Task #{task_id} · 模板 ID {value} · revision {value_2}",
"task_pages.task_template_id_revision": "· 任务 #{task_id} · 模板 ID {value} · 修订版 {value_2}",
"task_pages.task_type": "任务类型",
"task_pages.view_measured_results_for_this_task": "查看本题运行结果",
"task_table.family": "类型",
Expand Down Expand Up @@ -644,14 +652,7 @@
"verification_html.view_evaluator_technical_details": "查看 evaluator 技术明细",
"verification_html.view_the_official_expectation_and_this": "查看官方期望与本次观察",
"winner.best": "优",
"winner.better": "更优",
"inventory.no_failures_showing_all": "没有未通过的结果,已改为显示全部结果。",
"inventory.show_more": "显示更多",
"inventory.back_to_results": "返回结果列表",
"inventory.previous_result": "上一条",
"inventory.next_result": "下一条",
"chart.task_pass_rate": "任务通过率",
"chart.task_pass_rate_caption": "按通过率排序;n/N 为每个模型与浏览器组合的通过数 / 完成任务数。"
"winner.better": "更优"
},
"rationale_en": {
"打开一个需要登录的 GitLab 目标页": "Open an authenticated GitLab target page",
Expand Down
30 changes: 18 additions & 12 deletions src/harness/browser_use/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
)
from harness.browser_use.report_i18n import (
MESSAGES,
bilingual_text,
english_rationale,
write_english_report,
)
Expand Down Expand Up @@ -99,8 +98,13 @@ def _language() -> str:


def _translated(key: str, source: str, /, **values: Any) -> Safe:
"""Keep dynamic text and its English form beside the same values."""
return Safe(bilingual_text(_ZH(key, source, **values), _EN(key, source, **values)))
"""Dynamic catalog text in the edition being rendered; a page carries one language."""
return Safe(_e(_edition_text(_ZH(key, source, **values), _EN(key, source, **values))))


def _edition_text(zh: str, en: str) -> str:
"""Pick the text of the edition being rendered."""
return en if _language() == "en" else zh


def _rationale(task: dict[str, Any]) -> str:
Expand Down Expand Up @@ -2262,10 +2266,10 @@ def _article_body(
specimen = next(iter(causes), _attempt_id(failures[0]))
cause = causes.get(specimen) or {}
reason = cause.get('reason') or {}
explanation = bilingual_text(
explanation = _e(_edition_text(
str(reason.get('zh') or _ZH('article_body.no_verified_cause', 'This result has no verified root cause.')),
str(reason.get('en') or _EN('article_body.no_verified_cause', 'This result has no verified root cause.')),
)
))
chapters.append(
f'<section data-browser-failure-profile="{_e(model)}-{_e(engine)}"><h3>{_e(label)}</h3>'
+ _translated("article_body.failed_results_have_a_verified_cause", "{failures_count} failed results; {causes_count} have a verified cause.", failures_count=len(failures), causes_count=len(causes))
Expand Down Expand Up @@ -2366,7 +2370,7 @@ def _filters(participants: Participants, *, attempts: bool = False, dataset: boo
"<label>" + t("filters.result", "Result") + ' <select data-filter="result"><option value="">' + t("same_task_comparison.all", "All") + '</option><option value="pass">' + t("same_task_comparison.pass", "Pass") + f"</option><option value=\"fail\"{' selected' if attempts else ''}>" + t("same_task_comparison.fail", "Fail") + "</option></select></label>"
)
)
placeholder = t("filters.task_intent_or_acceptance_contract", "Task, intent, or acceptance contract") if dataset else t("filters.task_intent_answer_or_error", "Task, intent, answer, or error")
placeholder = t("filters.task_intent_site_or_rationale", "Task, intent, site, or rationale") if dataset else t("filters.task_intent_answer_or_error", "Task, intent, answer, or error")
return (
('<div class="filters"><label>' + t("filters.full_text_search", "Full-text search") + f' <input data-search type="search" placeholder="{placeholder}"></label><label>' + t("same_task_comparison.tier", "Tier") + ' <select data-filter="tier"><option value="">' + t("same_task_comparison.all", "All") + '</option><option value="easy">' + t("tier_label.easy", "Easy") + '</option><option value="medium">' + t("tier_label.medium", "Medium") + '</option><option value="hard">' + t("tier_label.hard", "Hard") + "</option></select></label><label>" + t("same_task_comparison.site", "Site") + ' <select data-filter="site"><option value="">' + t("same_task_comparison.all", "All") + '</option>' + _site_options() + '</select></label><label>' + t("same_task_comparison.type", "Type") + ' <select data-filter="kind"><option value="">' + t("same_task_comparison.all", "All") + "</option><option>RETRIEVE</option><option>NAVIGATE</option><option>MUTATE</option></select></label>")
+ result_filter
Expand Down Expand Up @@ -2395,9 +2399,11 @@ def _task_table(tasks: list[dict[str, Any]], participants: Participants) -> str:
str(x)
for x in (
task_id,
_tier_label(task["tier"]),
SITE_LABELS.get(site, site),
kind,
task.get("intent"),
_searchable_rationale(task),
json.dumps(task.get("contract") or {}, ensure_ascii=False),
)
)
rows.append(
Expand Down Expand Up @@ -2441,7 +2447,7 @@ def _diagnosis_dialog(
dialog_id = f"diagnosis-{result_id}"
detail_url = f"results/{result_id}.html"
return (
(f'<dialog class="diagnosis-dialog" id="{_e(dialog_id)}" aria-labelledby="{_e(dialog_id)}-title"><div class="diagnosis-dialog-head"><div><span class="table-kicker">' + t("diagnosis_dialog.failure_diagnosis", "Failure diagnosis") + f'</span><h2 id="{_e(dialog_id)}-title">Task #{task_id} · {_e(configuration)}</h2></div><button class="dialog-close" type="button" onclick="closeDiagnosis(\'{_e(dialog_id)}\')" aria-label="' + t("diagnosis_dialog.close", "Close") + '">×</button></div><div class="diagnosis-dialog-grid"><div><b>' + t("diagnosis_dialog.location", "Location") + f'</b><a href="{_e(step_link)}">{_e(failure_point)}</a></div><div><b>' + t("diagnosis_dialog.program_verdict", "Program verdict") + f"</b>{_e(automatic_failure or t('failure_cause_table.unclassified', 'Unclassified'))}</div><div><b>" + t("diagnosis_dialog.reviewed_root_cause", "Reviewed root cause") + f"</b>{_e(subcategory or t('diagnosis_dialog.awaiting_review', 'Awaiting review'))}</div><div><b>" + t("diagnosis_dialog.owning_scope", "Owning scope") + f"</b>{_e(owner)}</div></div>")
(f'<dialog class="diagnosis-dialog" id="{_e(dialog_id)}" aria-labelledby="{_e(dialog_id)}-title"><div class="diagnosis-dialog-head"><div><span class="table-kicker">' + t("diagnosis_dialog.failure_diagnosis", "Failure diagnosis") + f'</span><h2 id="{_e(dialog_id)}-title">' + t("common.task_number", "Task #{task_id}", task_id=_e(task_id)) + f' · {_e(configuration)}</h2></div><button class="dialog-close" type="button" onclick="closeDiagnosis(\'{_e(dialog_id)}\')" aria-label="' + t("diagnosis_dialog.close", "Close") + '">×</button></div><div class="diagnosis-dialog-grid"><div><b>' + t("diagnosis_dialog.location", "Location") + f'</b><a href="{_e(step_link)}">{_e(failure_point)}</a></div><div><b>' + t("diagnosis_dialog.program_verdict", "Program verdict") + f"</b>{_e(automatic_failure or t('failure_cause_table.unclassified', 'Unclassified'))}</div><div><b>" + t("diagnosis_dialog.reviewed_root_cause", "Reviewed root cause") + f"</b>{_e(subcategory or t('diagnosis_dialog.awaiting_review', 'Awaiting review'))}</div><div><b>" + t("diagnosis_dialog.owning_scope", "Owning scope") + f"</b>{_e(owner)}</div></div>")
+ (
f'<div class="dialog-step"><b>{_e(step_context_label)}</b><a href="{_e(step_link)}">{_raw(step_context)}</a></div>'
if step_context
Expand Down Expand Up @@ -3079,7 +3085,7 @@ def _write_task_pages(stage: Path, inputs: ReportInputs) -> None:
+ ('<a href="analysis/#same-task">' + t("task_pages.compare_all_browsers", "Compare all browsers") + "</a></div>"),
)
_write_page(stage, f"datasets/{task_id}.html", title=t("task_pages.task", "Task {task_id}", task_id=task_id),
active="datasets", eyebrow=f"Task #{task_id}", heading=_rationale(task),
active="datasets", eyebrow=t("common.task_number", "Task #{task_id}", task_id=_e(task_id)), heading=_rationale(task),
body=compose("datasets", {"lead": lead, "definition": definition, "inventory": inventory}))


Expand Down Expand Up @@ -3169,9 +3175,9 @@ def _methodology_protocol(inputs: ReportInputs) -> str:
[t("methodology_protocol.logical_results", "Logical results"), _translated("methodology_protocol.one_retained_logical_result_per_task", "One retained logical result per task, model and browser; binary acceptance and task-paired comparison.")],
[
t("methodology_protocol.execution_limit", "Execution limit"),
Safe(bilingual_text(
Safe(_e(_edition_text(
_ZH('protocol.execution_limit', 'Frozen execution limit per task: {limit}; execution latency and model usage are cumulative.', limit=limit or _ZH('protocol.limit_not_recorded', 'not recorded')),
_EN('protocol.execution_limit', 'Frozen execution limit per task: {limit}; execution latency and model usage are cumulative.', limit=limit or 'not recorded'))),
_EN('protocol.execution_limit', 'Frozen execution limit per task: {limit}; execution latency and model usage are cumulative.', limit=limit or 'not recorded')))),
],
[
t("methodology_protocol.exclusions", "Exclusions"),
Expand Down Expand Up @@ -3302,7 +3308,7 @@ def _evidence_index_entry(


def _result_heading(public: dict[str, Any], participants: Participants) -> str:
return f"{participants.models[public['model']]} · {participants.engines[public['engine']]} · Task #{public['task_id']}"
return f"{participants.models[public['model']]} · {participants.engines[public['engine']]} · " + t("common.task_number", "Task #{task_id}", task_id=public['task_id'])


def _result_hero(public: dict[str, Any], failure_point: str) -> str:
Expand Down
9 changes: 7 additions & 2 deletions src/harness/browser_use/report_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
from harness.report_languages import check_language_contract, generated_languages
from harness.reporting.assets import bound_json_asset
from harness.reporting.locales import catalog_text
from harness.reporting.names import check_display_names
from harness.reporting.presentation import check_one_language
from harness.reporting.presentation import visible_text as _visible_text
from harness.reporting.privacy import BROWSER_USE_CHECK_SOURCE
from harness.reporting.release_check import check_report_identity, check_template_pages, open_report
Expand Down Expand Up @@ -71,7 +73,8 @@ def _forbidden_public_text() -> re.Pattern[str]:
)


def _check_reader_facing_ux(report_dir: Path, rendered_pages: dict[Path, str]) -> None:
def _check_reader_facing_ux(report_dir: Path, rendered_pages: dict[Path, str],
display_labels: dict[str, str] | None = None) -> None:
"""Enforce stable, data-independent report presentation contracts."""

for page, text in rendered_pages.items():
Expand All @@ -80,6 +83,8 @@ def _check_reader_facing_ux(report_dir: Path, rendered_pages: dict[Path, str]) -
raise ValueError(f"formal report contains unexplained internal term {term}: {page}")
if "data-report-en=" in _visible_text(text):
raise ValueError(f"formal report shows escaped interface markup as text: {page}")
check_one_language(text)
check_display_names(text, display_labels or {})
for homepage in (
report_dir / "index.html",
*([report_dir / "en/index.html"] if "en" in generated_languages(report_dir) else []),
Expand Down Expand Up @@ -535,7 +540,7 @@ def check(
rendered_pages = {
page: page.read_text(encoding="utf-8") for page in (*chinese_pages, *english_pages)
}
_check_reader_facing_ux(report_dir, rendered_pages)
_check_reader_facing_ux(report_dir, rendered_pages, {**participants.models, **participants.engines})
if any('<html lang="en">' not in rendered_pages[page] for page in english_pages):
raise ValueError("every Chinese report route must have an English mirror")
cjk = re.compile(r"[\u3400-\u9fff]")
Expand Down
7 changes: 0 additions & 7 deletions src/harness/browser_use/report_i18n.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,16 +95,9 @@ def _rewrite_links(page: str) -> str:
)


def bilingual_text(zh: str, en: str) -> str:
"""Keep dynamic interface text and its English form beside the same values."""
return f'<span data-report-en="{html.escape(en, quote=True)}">{html.escape(zh)}</span>'


def localize_html(page: str, source: PurePosixPath) -> str:
"""Place one page of the English pass under `en/`."""
english = PurePosixPath("en") / source
page = re.sub(r'<span data-report-en="([^"]*)">[^<]*</span>',
lambda match: html.escape(html.unescape(match[1])), page)
page = page.replace('<html lang="zh-CN">', '<html lang="en">', 1)
had_base = bool(re.search(r'<base\s+href=["\'][^"\']*["\']>', page, flags=re.I))
page = re.sub(
Expand Down
Loading
Loading