Skip to content

Add isolated public WebArena fixed-trajectory replay - #12

Merged
lanyue-llk merged 108 commits into
mainfrom
codex/webarena-trajectory-eval
Sep 15, 2026
Merged

lanyue-llk merged 108 commits into
mainfrom
codex/webarena-trajectory-eval

Conversation

@lanyue-llk

@lanyue-llk lanyue-llk commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

变更概述

加入公开 WebArena 人工轨迹的固定回放评测。浏览器执行冻结的网页 UI 操作,WebArena-Verified 根据最终回答、站点状态和 HAR 判分;运行中没有 Agent 规划、模型调用或 LLM judge。本轮合格的 30 个任务与仓库原有 30 例浏览器工具微基准不是同一数据集,也不共用成绩或报告。

主要改动

  • 公开 WebArena 的导入、资格验证、动作执行、站点重置、HAR、判分和报告放在 harness/trajectory_replay/public_webarena/。自主 CowAgent 评测仍由最新主分支的 harness/browser_use/ 负责;相对当前 main,该目录及其示例、测试没有净改动。
  • 179 条官方人工录制先作为候选,只有 30 条通过资格门禁进入正式清单。浏览器使用相同任务和动作,失败时按声明规则最多重试一次;原始尝试和资源数据保存在 Git 外。
  • 两仓库契约核对 WebArena-Verified 1.2.3、六个站点的镜像 digest、架构、端口和凭据变量名;还要求 Map 三份归档的大小与 SHA-256 锁定项完整。站点交付依赖 webarena-env #2。
  • 公开报告有独立的当前绑定文件和发布目标;代码修正没有重跑正式任务,也没有改写已测成绩或更新其他报告。

影响说明

现有正式证据的最终任务验收为 Chromium 29/30、Moli 15/30。这是固定轨迹与当前环境的兼容性结果,不是 Agent 成功率或浏览器总体能力排名。最新主分支合入后,完整 Python 回归、UI 回归、轨迹包测试、命名门禁、跨仓库契约以及本地报告绑定检查均通过;报告检查没有外部发布操作。

公开报告:WebArena 固定轨迹回放。

kevin added 30 commits September 10, 2026 14:31
@github-actions

github-actions Bot commented Sep 15, 2026 •

Copy link
Copy Markdown

Claude finished @lanyue-llk's task in 1m 49s —— View job


PR #12 Code Review

  • 读取 AGENTS.md 及相关 SKILL.md
  • 检查最新提交与历史 review 覆盖差异(1723ef1 → 71f71f7)
  • 独立审查关键代码文件
  • 输出 Review 结论

Review 结论

通过

最新提交 71f71f7("Guard replay evidence scope and empty traces")直接修复了上一轮遗留的三个 P2 问题,历史 P0/P1 问题全部保持已修复状态。


历史问题独立核验

问题 状态
executor.py 三处 deadline 变量覆盖(P0) ✅ 第 227/263/315 行均为 action_deadline
webarena-evaluator-exclusion-audit.json suite_sha256 不一致(P1) ✅ 双字段 + 机器测试
current-report.json 绑定无脚本强制(P1) ✅ _validate_binding 校验字段完整
所有其余历史 P2 问题 ✅ 保持已修复

最新提交 71f71f7 核验

[已修复 P2] verify_metrics.py:67–79:恢复并加固 evidence_directory 路径边界检查

上一轮(dda60e1)移除了路径越界检查,标记为 P2。本次修复:

  • 引入 expected_dir = (artifacts / "tasks" / key[0] / key[1] / f"attempt-{index}").resolve(),强制路径精确匹配(evidence_dir != expected_dir 拒绝任何不一致),同时 not expected_dir.is_relative_to(artifacts / "tasks") 防御 key 中的 .. 路径穿越。
  • 逐文件检查由 evidence_file.parent != evidence_dir 守护,防止 required_attempt_evidence 文件名含路径穿越字符。
  • test_independent_audit_enforces_retry_matrix_and_success_evidence 新增对 "evidence path differs" 的断言覆盖。✅

[已修复 P2] runner.py:389,486:process_passed 和 all_calls_passed 空 trace 语义与 result_audit.py 对齐

原问题:runner.py 对空 trace 存储 all_calls_passed: True(空列表 vacuous truth),而 result_audit.py:82 推导 bool(browser_trace) and all(...) → False,两者不一致导致潜在 ResultAuditError。

本次修复:

  • process_passed = bool(tool_trace) and actual_actions == expected_actions and all(...) — 空 trace 直接为 False,正确反映无动作执行 = 失败。
  • "all_calls_passed": bool(tool_trace) and all(...) — 与 result_audit.py:82 语义完全对齐。✅

[已修复 P2] test_supersede_webarena_results.py:补充 _validate_run_binding 单元测试

原问题:_validate_run_binding 验证 suite_sha256、五项协议字段及引擎镜像/版本绑定,但无测试覆盖。

本次新增 test_rejects_correction_run_binding_drift,逐一覆盖四种拒绝路径:

  • suite_sha256 不符(匹配 "suite differs")
  • task_timeout_ms 协议字段不符
  • 引擎镜像摘要不符("image differs")
  • 浏览器版本不符("version differs")

并验证完全一致时正常通过。✅


问题及建议

未发现需要阻塞合并的问题。

残余已知风险(均属先前接受的设计决策):

  • supersede_webarena_task_browser_results.py:178:derived_from.reason 硬编码,未来复用时溯源说明将不准确
  • result_audit.py:40:引擎顺序回退路径(engines 从 summary.functional 键顺序推导)无注释说明潜在方向歧义

@github-actions github-actions 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.

Automated Claude review completed. Review run: https://github.com/lexmount/browser-eval/actions/runs/34951120933. Please check Claude's inline feedback and summary comment for details.

@github-actions

github-actions Bot commented Sep 15, 2026 •

Copy link
Copy Markdown

PR #12 Code Review

  • 读取 AGENTS.md 及相关 SKILL.md
  • 检查最新提交与历史 review 覆盖差异
  • 独立审查关键代码文件
  • 输出 Review 结论

View job run

@github-actions

github-actions Bot commented Sep 15, 2026 •

Copy link
Copy Markdown

PR #12 Code Review

  • Gather context from previous reviews
  • Review new commits since last review (71f71f7 → HEAD)
  • Post findings

View job run

@github-actions

github-actions Bot commented Sep 15, 2026 •

Copy link
Copy Markdown

Claude finished @lanyue-llk's task in 4m 13s —— View job


PR #12 Code Review

  • 读取 AGENTS.md 及相关 SKILL.md
  • 检查最新提交与历史 review 覆盖差异(71f71f7 → 1e0818c)
  • 独立审查关键代码文件
  • 输出 Review 结论

Review 结论

通过

本轮三个新提交(90b0998、b9dd0a3 合并、1e0818c)均已独立审查。历史所有 P0/P1 问题保持已修复状态。


历史问题独立核验

问题 状态
executor.py 三处 deadline 变量覆盖(P0) ✅ 第 227/263/315 行均为 action_deadline
webarena-evaluator-exclusion-audit.json suite_sha256 不一致(P1) ✅ 双字段 + 机器测试
current-report.json 绑定无脚本强制(P1) ✅ _validate_binding 校验字段完整
所有其余历史 P2 问题 ✅ 保持已修复

最新提交核验

90b0998(Align replay examples with verified site runtime contract)

新增 port + credentials 跨仓库一致性校验(scripts/verify_webarena_env_contract.py:51–65)

对每个站点校验:URL 端口与环境仓库 runtime.example.json 中的 sites[site].port 一致;control URL 端口与 control_port 一致;credentials_env 变量名一致(仅在环境仓库有声明时)。逻辑正确,空 site_row 时 site_row.get("port") 返回 None,与 URL 中的 int 端口不等,正确拒绝。

examples/browser_use/webarena.config.example.json 删除硬编码的 site_docker_host(rootless socket 路径),文档更新说明无需假设特定用户的 rootless socket,与多 daemon 场景说明一致。

新测试 test_cross_repo_contract_rejects_port_and_credential_drift 覆盖 port mismatch 和 credential mismatch 两个拒绝路径。✅

b9dd0a3(合并主线 Web Fetch 独立资源审计 #14)

  • harness/browser_use/metrics.py 将资源采集类(DockerStatsResources、ResourceSampler 等)迁移至新共享模块 harness/resource_accounting.py,自身仅保留 summarize_attempts;browser_use 导入路径同步更新。WebArena 评测逻辑、评分路径、证据采集均未变。
  • harness/browser_use/runner.py:881 新增 require_linux_cgroup_v2(client) 门控,拒绝非 Linux 或非 cgroup v2 宿主机;测试 mock 更新为 {"OSType": "linux", "CgroupVersion": "2"},覆盖新校验路径。✅

1e0818c(Allow explicit formal evidence in trajectory audit)

trajectory-report-audit Makefile 目标新增 $(if $(FORMAL_ROOT),--formal-root "$(FORMAL_ROOT)",),允许通过环境变量指定正式证据目录。scripts/release_webarena_trajectory_report.py 第 79 行 --formal-root 参数早已存在,Makefile 仅是补全了透传路径,与其他两个目标的行为一致。✅


问题及建议

[P2] harness/browser_use/runner.py:880–881:client.info() 被调用两次

_validate_measured_resource_controls(client.info())   # 第一次
require_linux_cgroup_v2(client)                       # 第二次,内部再次调用 client.info()

require_linux_cgroup_v2 被设计为独立调用(container_isolation.py 共享模块),因此内部自行取 info。对分钟级基准测试无实质影响,但 info 已在第 880 行取得,可将其结果直接传给 require_linux_cgroup_v2 以避免重复调用(需调整共享函数签名接受 info dict 或缓存)。当前属代码风格问题,不阻塞合并。

[P2] tests/browser_use/test_webarena_env_contract.py:control_port 漂移未被测试

test_cross_repo_contract_rejects_port_and_credential_drift 只测了 port 和 credentials_env 两条拒绝路径;verify() 中同样存在的 control_port 校验无测试覆盖。建议在同一测试函数末尾追加一组 control_port 修改 + pytest.raises(ValueError, match="control port differs: map") 断言。


残余已知风险(均属先前接受的设计决策):

  • supersede_webarena_task_browser_results.py:178:derived_from.reason 硬编码
  • result_audit.py:40:引擎顺序回退路径无注释说明

@github-actions

github-actions Bot commented Sep 15, 2026 •

Copy link
Copy Markdown

Claude finished @lanyue-llk's task in 3m 10s —— View job


PR #12 Code Review

  • Gather context from previous reviews
  • Review new commits since last review (71f71f7 → HEAD: 90b0998, b9dd0a3, 1e0818c)
  • Post findings

No bugs or security issues found in the three new commits.

90b0998 ("Align replay examples with verified site runtime contract") extends verify_webarena_env_contract.py to cross-check site port numbers and credential environment variable names between the two repos. Logic verified:

  • urlparse(str(urls[0])).port != site_row.get("port") correctly compares ports; if urls[0] has no port, urlparse returns None and the != comparison with an integer port raises correctly.
  • The credential check (if env_credentials is not None and env_credentials != eval_row.get("credentials_env")) is skipped for sites with no credentials (wikipedia, map) — correct behavior.
  • test_cross_repo_contract_rejects_port_and_credential_drift covers both rejection paths. ✓

b9dd0a3 (merge from main — "Web Fetch: isolated CPU, memory and network benchmark reporting") refactors resource accounting classes out of harness/browser_use/metrics.py into harness/resource_accounting.py and adds require_linux_cgroup_v2 in harness/container_isolation.py. The new call in runner.py:881:

_validate_measured_resource_controls(client.info())   # line 880
require_linux_cgroup_v2(client)                        # line 881

calls client.info() twice. This is a minor inefficiency, not a bug — _validate_measured_resource_controls takes a dict and require_linux_cgroup_v2 takes the client object, so the result cannot be trivially shared. Both checks pass correctly in the updated test_run_saves_evidence_before_diagnostics_and_cleans_up mock. The existing test_measured_run_rejects_missing_cgroup_controls_before_creating_output is unaffected because _validate_measured_resource_controls raises before require_linux_cgroup_v2 is reached.

1e0818c ("Allow explicit formal evidence in trajectory audit") adds $(if $(FORMAL_ROOT),--formal-root "$(FORMAL_ROOT)",) to the trajectory-report-audit Makefile target. The --formal-root argument was already supported by scripts/release_webarena_trajectory_report.py:79. No issues.


All previously confirmed fixes through 71f71f7 remain intact.

Historical issue Status
executor.py three deadline variable overshadows (P0) ✅ Fixed — action_deadline at lines 227, 263, 315
webarena-evaluator-exclusion-audit.json suite_sha256 mismatch (P1) ✅ Fixed
current-report.json binding not machine-enforced (P1) ✅ Fixed — _validate_binding checks 8 fields
All prior P2 issues ✅ Fixed
all_calls_passed vacuous truth (P2) ✅ Fixed in 71f71f7
verify_metrics.py path escape check (P2) ✅ Fixed in 71f71f7
_validate_run_binding no test coverage (P2) ✅ Fixed in 71f71f7

Remaining non-blocking: supersede_webarena_task_browser_results.py:178 hardcoded derived_from.reason — informational only, script was used once.

@github-actions github-actions 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.

Automated Claude review completed. Review run: https://github.com/lexmount/browser-eval/actions/runs/34954467365. Please check Claude's inline feedback and summary comment for details.

@github-actions

github-actions Bot commented Sep 15, 2026 •

Copy link
Copy Markdown

Claude finished @lanyue-llk's task in 7m 37s —— View job


PR #12 Code Review

  • Gather context from previous reviews
  • Review new commits since last review (1e0818c → HEAD: 69c7fc1, 4be72c3, 175506c)
  • Post findings

No blocking bugs or security issues found.

Summary of new commits

69c7fc1 ("Separate WebArena fixed-trajectory replay from browser-use harness") extracts the fixed-trajectory replay harness to harness/trajectory_replay/ and creates a new standalone runner for the non-public-webarena use case.

4be72c3 ("Nest public WebArena replay under trajectory-replay track") moves the public WebArena examples to examples/trajectory_replay/public_webarena/.

175506c ("Merge latest main and preserve autonomous Browser Use boundary") merges PR #8 ("Add autonomous WebArena-Verified browser evaluation"), adding the autonomous CowAgent browser evaluation harness.


Two P2 issues in the new harness/trajectory_replay/runner.py

harness/trajectory_replay/runner.py:258 — all_calls_passed vacuous truth (same as prior P2 in public_webarena/runner.py, fixed in 71f71f7)

"all_calls_passed": all(item.get("status") == "pass" for item in tool_trace),

The public_webarena runner was fixed to bool(tool_trace) and all(...) in 71f71f7. The new harness/trajectory_replay/runner.py introduced in 69c7fc1 still uses the unguarded form. An empty tool_trace (task aborted before recording any action) returns True vacuously, inconsistent with process_passed which correctly requires bool(tool_trace) to be non-empty only implicitly through actual_actions == expected_actions. There is no result_audit.py for this runner to catch the discrepancy. Non-blocking.

harness/trajectory_replay/runner.py:299 — 0.0.0.0 fixture server binding without comment

server = ThreadingHTTPServer(("0.0.0.0", 0), handler)

public_webarena/runner.py:598–599 has the comment explaining Docker bridge requirement. This copy does not. Non-blocking.


Autonomous browser evaluation (175506c) — no new bugs

The new harness/browser_use/ modules:

  • API key and cowagent path handling are properly validated (runner.py:923–927)
  • _container_host_gateway uses ipaddress.ip_address() to validate the resolved gateway IP before using it as a URL hostname
  • subprocess calls use list args (no shell injection risk)
  • Physical execution lock (fcntl.flock) is correctly scoped to the user's temp directory
  • publication.py sanitization covers Authorization, cookie, bearer tokens and known secret values before any public projection

All previously confirmed fixes through 1e0818c remain intact.

Historical issue Status
executor.py three deadline variable overshadows (P0) ✅ Fixed — action_deadline in public_webarena/executor.py
webarena-evaluator-exclusion-audit.json suite_sha256 mismatch (P1) ✅ Fixed
current-report.json binding not machine-enforced (P1) ✅ Fixed — _validate_binding checks 8 fields
All prior P2 issues ✅ Fixed

@github-actions

github-actions Bot commented Sep 15, 2026 •

Copy link
Copy Markdown

Claude finished @lanyue-llk's task in 6m 8s —— View job


PR #12 Code Review

  • 读取 AGENTS.md 及相关 SKILL.md
  • 检查最新提交与历史 review 覆盖差异(1e0818c → 175506c)
  • 独立审查关键代码文件
  • 输出 Review 结论

Review 结论

通过

三个新提交(69c7fc1 "Separate WebArena fixed-trajectory replay from browser-use harness"、4be72c3 "Nest public WebArena replay under trajectory-replay track"、175506c "Merge latest main and preserve autonomous Browser Use boundary")完成了 harness 架构拆分,符合 AGENTS.md 规则 22/23。前几轮所有历史 P0/P1 问题全部保持已修复状态。


历史问题独立核验

问题 状态
public_webarena/executor.py 三处 deadline 变量覆盖(P0) ✅ 第 227/263/315 行均为 action_deadline
webarena-evaluator-exclusion-audit.json suite_sha256 不一致(P1) ✅ 双字段 + 机器测试
current-report.json 绑定无脚本强制(P1) ✅ _validate_binding 校验字段完整
所有其余历史 P2 问题(wall_clock_timeout、0.0.0.0 注释等) ✅ 保持已修复

架构拆分核验

69c7fc1(Separate) 将 trajectory replay 实现从 harness/browser_use/ 迁移至新的 harness/trajectory_replay/;harness/browser_use/ 保留为自主轨迹(autonomous)track。脚本、测试的导入路径同步更新,无遗漏。

4be72c3(Nest) 将 harness/trajectory_replay/* 及 examples/trajectory_replay/* 内的 public WebArena 文件全部移至 */public_webarena/ 子目录,符合 AGENTS.md 规则 23("isolated under harness/trajectory_replay/public_webarena/")。

175506c(Merge) 合并主线自主 Browser Use 实现(harness/browser_use/runner.py、model.py、har.py 等),同时新增 harness/trajectory_replay/ 内的仓库级轨迹重放模块(webarena_replay.py、webarena_dataset.py 等)。


问题及建议

[P2] harness/trajectory_replay/runner.py:299:0.0.0.0 绑定缺少 Docker 桥接注释

server = ThreadingHTTPServer(("0.0.0.0", 0), handler)  # line 299
origin = f"http://host.docker.internal:{server.server_port}"  # line 306

与 public_webarena/runner.py:598-599 使用完全相同的 fixture 服务模式,但新 runner 缺少解释 0.0.0.0 原因的注释。public_webarena/runner.py 已在此前 review 中补充了"Linux containers reach the host through the Docker bridge..."注释,同一模式在新文件中应同步。建议在第 298 行添加同等说明。Fix this →

[P2] harness/trajectory_replay/webarena_replay.py:18-33:跨 track 导入 13 个私有符号

from harness.browser_use.runner import (
    SITE_PORTS,
    _allow_official_container_hostname,
    _cdp_metadata,
    _configure_benchmark,
    _container_host_gateway,
    _docker_daemon_lock_namespace,
    _docker_image_metadata,
    _login_context,
    _physical_execution_lock,
    _physical_execution_lock_path,
    _prepare_sites,
    _require_clean_git_checkout,
    _resource_summary,
    _site_container_manager,
)

harness.trajectory_replay.webarena_replay 直接引用 harness.browser_use.runner 的 13 个单下划线私有函数(WebArena 站点管理共享基础设施)。类似地,harness/browser_use/runner.py 也从 harness.trajectory_replay.runner 导入 _published_endpoint、_start_browser_container、_wait_cdp(3 个私有符号)。两个 track 之间存在双向私有符号共享,比之前的 _wall_clock_timeout 单点问题更系统性。建议将共享的 WebArena 站点管理函数(_prepare_sites、_login_context、_site_container_manager 等)以及 Docker/容器辅助函数(_start_browser_container、_wait_cdp 等)抽取到 harness/container_isolation.py 或新建 harness/webarena_sites.py 公共模块,消除跨 track 私有边界。

[P2] AGENTS.md 规则 7 与多 track 架构字面不符

规则 7:"Treat evaluation/current-report.json as the only current matrix and publication-target authority."

但本次合并新增了:

  • evaluation/browser-use/current-report.json(自主 Browser Use track 权威)
  • evaluation/trajectory-replay/webarena-verified/current-run.json(仓库级轨迹重放配置)
  • evaluation/browser-use-public/current-report.json(已有,public WebArena replay 权威,规则 23 已提及)

规则 7 未更新,读者可能误以为应将 evaluation/browser-use/current-report.json 写回 evaluation/current-report.json,或误判三个文件中哪个有"唯一权威"。建议将规则 7 改为"每个 track 以其 evaluation/<track>/current-report.json(或 current-run.json)为发布目标权威;evaluation/current-report.json 仅归 Web Fetch track。" Fix this →


残余已知风险(均属先前接受的设计决策):

  • supersede_webarena_task_browser_results.py:178:derived_from.reason 硬编码
  • result_audit.py:40:引擎顺序回退路径无注释说明

@lanyue-llk lanyue-llk changed the title Add browser-eval WebArena fixed-trajectory replay Add isolated public WebArena fixed-trajectory replay Sep 15, 2026

@github-actions github-actions 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.

Automated Claude review completed. Review run: https://github.com/lexmount/browser-eval/actions/runs/34958445260. Please check Claude's inline feedback and summary comment for details.

@github-actions

github-actions Bot commented Sep 15, 2026 •

Copy link
Copy Markdown

Claude finished @lanyue-llk's task in 2m 47s —— View job


PR #12 Code Review

  • Gather context from previous reviews
  • Check new commits since last review (1e0818c → 7570074)
  • Review for bugs and security issues
  • Post findings

No blocking bugs found in 7570074 ("Require locked Map archives in WebArena cross-repo contract").

New commit summary

The commit adds Map archive checksum validation to scripts/verify_webarena_env_contract.py and two new tests.

Key changes verified:

  • verify_webarena_env_contract.py:67–94: The image_lock path equality check (delivery_path.parent / str(delivery.get("image_lock")) .resolve()) is path-comparison only — no file is read through that path — so a crafted image_lock value cannot cause path traversal reads. The Map archive block correctly requires exactly 3 distinct archive names (via len(archive_names) != 3 or len(set(archive_names)) != 3) with matching data_archive_sha256 and data_archive_bytes keys, 64-hex digest format validation, and positive-integer size validation. If components["map"] were missing (not possible due to the prior set(components) != set(sites) - {"wikipedia"} guard), the KeyError would propagate uncaught — but it's structurally impossible given that guard. ✓

  • New tests: test_cross_repo_contract_rejects_missing_map_digest and test_cross_repo_contract_rejects_site_delivery_lock_path_drift cover the two new rejection paths. The fixture fixture correctly sets image_lock: "images.lock.json" (relative, not absolute), matching what the verify() path equality check expects. ✓


Open P2 from prior review round — still not fixed

harness/trajectory_replay/runner.py:232, 258 — process_passed and all_calls_passed vacuous truth

This was flagged when 69c7fc1 introduced the file. The analogous fix in public_webarena/runner.py (commit 71f71f7) guarded both with bool(tool_trace):

# public_webarena/runner.py (fixed)
process_passed = bool(tool_trace) and actual_actions == expected_actions and all(...)
"all_calls_passed": bool(tool_trace) and all(item.get("status") == "pass" for item in tool_trace),

harness/trajectory_replay/runner.py still uses the unguarded form:

# harness/trajectory_replay/runner.py (unfixed)
process_passed = actual_actions == expected_actions and all(...)   # line 232
"all_calls_passed": all(item.get("status") == "pass" for item in tool_trace),  # line 258

An empty tool_trace (task aborted before any action) sets both to True vacuously, making an aborted run appear to have passed process validation.

harness/trajectory_replay/runner.py:299 — 0.0.0.0 binding undocumented

public_webarena/runner.py has the Docker bridge comment; this file does not. Non-blocking.

All previously confirmed P0/P1 fixes through 1e0818c remain intact.

@github-actions

github-actions Bot commented Sep 15, 2026 •

Copy link
Copy Markdown

Claude finished @lanyue-llk's task in 2m 40s —— View job


PR #12 Code Review

  • 读取 AGENTS.md 及相关 SKILL.md
  • 检查最新提交与历史 review 覆盖差异(175506c → 7570074)
  • 独立审查关键代码文件
  • 输出 Review 结论

Review 结论

通过

最新提交 7570074("Require locked Map archives in WebArena cross-repo contract")向跨仓库合约校验器增加 Map 数据卷档案包的 SHA-256/字节数完整性检查。前几轮所有历史 P0/P1 问题全部保持已修复状态。


历史问题独立核验

问题 状态
public_webarena/executor.py 三处 deadline 变量覆盖(P0) ✅ 第 227/263/315 行均为 action_deadline
webarena-evaluator-exclusion-audit.json suite_sha256 不一致(P1) ✅ 双字段 + 机器测试
current-report.json 绑定无脚本强制(P1) ✅ _validate_binding 校验字段完整
所有其余历史 P2 问题(wall_clock_timeout、0.0.0.0 注释等) ✅ 保持已修复

最新提交 7570074 核验

新增 delivery 校验块(verify_webarena_env_contract.py:67–94)

逻辑结构清晰,覆盖以下五层校验:

  1. webarena_verified_version 与合约一致 ✓
  2. image_lock 路径解析为与 environment_lock 相同的绝对路径,防止交叉引用 ✓
  3. components 键集合 = required_sites - {"wikipedia"} ✓
  4. 每个站点的 component.image 与 env_lock["images"][site]["pinned"] 一致 ✓
  5. Map 档案包:恰好 3 个唯一命名、data_archive_sha256 全部为 64 位十六进制、data_archive_bytes 全部为正整数 ✓

测试覆盖(新增 2 个)

  • test_cross_repo_contract_rejects_missing_map_digest:删除 osrm_routing.tar digest → 3 名称 vs 2 digest 键 → ValueError("Map archive checksum contract") ✓
  • test_cross_repo_contract_rejects_site_delivery_lock_path_drift:image_lock 改为 "../images.lock.json" → resolve 后路径不符 → ValueError("image lock path differs") ✓

问题及建议

[P2] verify_webarena_env_contract.py:68:delivery_path.read_text() 不处理环境仓库缺少 config/site-delivery-contract.json 的情况

delivery = json.loads(delivery_path.read_text(encoding="utf-8"))

若用户提供的 environment_repo 早于 webarena-env #2(不含 config/site-delivery-contract.json),此处抛出无提示的 FileNotFoundError,而函数其余部分统一使用 ValueError。建议替换为:

if not delivery_path.is_file():
    raise ValueError(f"environment repo is missing site-delivery-contract: {delivery_path}")
delivery = json.loads(delivery_path.read_text(encoding="utf-8"))

或至少在 argparse 的帮助文本中说明对 webarena-env #2 的依赖。

[P2] verify_webarena_env_contract.py:71–74:delivery.get("image_lock") 为 None 时报错信息误导

if (delivery_path.parent / str(delivery.get("image_lock"))).resolve() != ...:
    raise ValueError("cross-repository site delivery image lock path differs")

当 image_lock 字段缺失时,str(None) = "None" → 路径 config/None 与预期不符 → 抛出"path differs",而实际原因是字段缺失。建议在读取前加 if not delivery.get("image_lock"): raise ValueError("site-delivery-contract missing image_lock field")。


残余已知风险(均属先前接受的设计决策):

  • harness/trajectory_replay/runner.py:299:0.0.0.0 绑定缺少 Docker 桥接注释
  • harness/trajectory_replay/webarena_replay.py:18-33:跨 track 导入 13 个私有符号
  • AGENTS.md 规则 7 与多 track 架构字面不符(evaluation/browser-use/ 等)
  • supersede_webarena_task_browser_results.py:178:derived_from.reason 硬编码

@github-actions github-actions 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.

Automated Claude review completed. Review run: https://github.com/lexmount/browser-eval/actions/runs/34959575291. Please check Claude's inline feedback and summary comment for details.

@github-actions

github-actions Bot commented Sep 15, 2026 •

Copy link
Copy Markdown

Claude finished @lanyue-llk's task in 2m 26s —— View job


PR #12 Code Review

  • 读取 AGENTS.md 及相关 SKILL.md
  • 检查最新提交与历史 review 覆盖差异(7570074 → 3607ba8)
  • 独立审查关键代码文件
  • 输出 Review 结论

Review 结论

通过

最新提交 3607ba8("Fix replay validation and cross-repo contract diagnostics")一次性修复了上一轮遗留的全部 P2 问题。历史 P0/P1 问题全部保持已修复状态。


历史问题独立核验

问题 状态
public_webarena/executor.py 三处 deadline 变量覆盖(P0) ✅ 第 227/263/315 行均为 action_deadline
webarena-evaluator-exclusion-audit.json suite_sha256 不一致(P1) ✅ 双字段 + 机器测试
current-report.json 绑定无脚本强制(P1) ✅ _validate_binding 校验字段完整
所有其余历史 P2 问题 ✅ 保持已修复

最新提交 3607ba8 核验

[已修复 P2] harness/trajectory_replay/runner.py:232,258:process_passed / all_calls_passed 空 trace 语义与 public_webarena/runner.py 对齐

上轮(69c7fc1 引入此文件时)和英文 review 均标注:新 runner 的 process_passed 和 all_calls_passed 对空 trace 存在 vacuous truth 问题,与 public_webarena/runner.py 在 71f71f7 中已修复的语义不一致。

本次修复:

  • process_passed = bool(tool_trace) and actual_actions == expected_actions and all(...) — 空 trace 直接为 False。✅
  • "all_calls_passed": bool(tool_trace) and all(...) — 与 result_audit.py:82 语义对齐。✅
  • 新测试 test_empty_tool_trace_cannot_pass_process_validation:task 设 expected_actions: [](使 actual_actions == expected_actions 在不加 bool 守护时为 True),断言 process_status == "fail" 且 all_calls_passed is False,精确覆盖 vacuous truth 场景。✅

[已修复 P2] harness/trajectory_replay/runner.py:301:0.0.0.0 绑定添加 Docker 桥接注释

# Containers reach host.docker.internal through the bridge, not host loopback.
server = ThreadingHTTPServer(("0.0.0.0", 0), handler)

与 public_webarena/runner.py:598-599 注释风格一致。✅

[已修复 P2] scripts/verify_webarena_env_contract.py:67-79:两处诊断缺失字段改为明确 ValueError

  • delivery_path.is_file() 前置检查:is_file() 返回 False 时抛 ValueError("environment repo is missing site delivery contract: ...") 而非无提示 FileNotFoundError。新测试 test_cross_repo_contract_reports_missing_site_delivery_contract 覆盖。✅
  • image_lock 字段缺失检查:not isinstance(image_lock, str) or not image_lock → ValueError("cross-repository site delivery image_lock is missing"),替换旧 str(None) = "None" 产生的误导性"path differs"错误。新测试 test_cross_repo_contract_reports_missing_image_lock_field 覆盖。✅

[已修复 P2] AGENTS.md 规则 7:多 track 架构命名空间歧义消除

规则 7 由"Treat evaluation/current-report.json as the only current matrix and publication-target authority"更新为"For Web Fetch, treat ... Browser Use and Browser Trajectory Replay have separate contracts under their own evaluation/ namespaces; never reuse a publication target across tracks."与 evaluation/browser-use/、evaluation/browser-use-public/、evaluation/trajectory-replay/ 等多 track 现状完全对应。✅


问题及建议

未发现需要阻塞合并的问题。

残余已知风险(均属先前接受的设计决策):

  • harness/trajectory_replay/webarena_replay.py:18-33:跨 track 导入 harness.browser_use.runner 的 13 个私有符号(_allow_official_container_hostname 等),以及反向从 harness.trajectory_replay.runner 导入 3 个私有符号。属 WebArena 站点管理共享基础设施尚未抽取的遗留债,后续可将相关函数迁移至 harness/container_isolation.py 或新 harness/webarena_sites.py。
  • scripts/supersede_webarena_task_browser_results.py:178:derived_from.reason 硬编码为当前特定修正场景的描述,未来复用该脚本时溯源说明不准确。
  • harness/trajectory_replay/public_webarena/result_audit.py:40:引擎顺序回退(从 summary.functional 键推导)无注释说明;正式运行已由 _validate_binding 强制 protocol.engines 存在,实际不触发,仅影响独立调用语义。

@github-actions

github-actions Bot commented Sep 15, 2026 •

Copy link
Copy Markdown

Claude finished @lanyue-llk's task in 1m 9s —— View job


PR #12 Code Review

  • Review new commit 3607ba8 ("Fix replay validation and cross-repo contract diagnostics")
  • Post findings

No bugs or security issues found in 3607ba8.

The commit closes the remaining open P2 items from prior review rounds:

Issue Status
trajectory_replay/runner.py:232, 258 — process_passed and all_calls_passed vacuous truth for empty traces ✅ Fixed — bool(tool_trace) and guard added, matching public_webarena/runner.py semantics from 71f71f7
trajectory_replay/runner.py:299 — 0.0.0.0 fixture server binding undocumented ✅ Fixed — Docker bridge comment added
verify_webarena_env_contract.py:68 — FileNotFoundError on missing site-delivery-contract.json ✅ Fixed — explicit is_file() check with descriptive ValueError
verify_webarena_env_contract.py:71 — str(None) path when image_lock field missing ✅ Fixed — isinstance(image_lock, str) guard before path construction
AGENTS.md rule 7 ambiguity with multi-track architecture ✅ Fixed — rule now explicitly scopes evaluation/current-report.json to Web Fetch track

New test test_empty_tool_trace_cannot_pass_process_validation verifies the vacuous-truth fix: with execute_steps mocked to do nothing, tool_trace is empty, bool([]) = False, and process_status == "fail". ✓

All previously confirmed P0/P1 fixes through 7570074 remain intact. No remaining blocking findings.

@lanyue-llk

Copy link
Copy Markdown
Contributor Author

本轮盘点了 PR body、58 条顶层评论、27 个正式 review;没有行内评论或回复。旧评审关于公开轨迹审计哈希、发布绑定、Browser Use 命名和自主实现边界的意见,已由现有代码和测试覆盖;正式 review body 均为自动通知,不含新增行内意见。

成立并已修复:仓库级轨迹重放的空操作记录不再被判为过程通过;跨仓库交付契约缺文件或缺 image_lock 字段时给出准确错误;AGENTS.md 明确 Web Fetch 与 Browser Use、Trajectory Replay 各有独立评测命名空间。Docker 桥接监听原因也已补到仓库级 runner。新增回归测试覆盖空轨迹与两种契约缺失路径。

未采纳两项建议:把 13 个站点辅助函数整体抽成跨 track 新模块,会扩大本 PR 对自主 Browser Use 的净改动;目前它们复用主线既有的站点基础设施,未证明运行故障,PR #12 对自主目录仍为零净差异。测试中的 MagicMock.call_args 守卫也只是更换异常类型;该执行路径无条件调用 containers.run,当前测试已验证。

验证:browser-eval 1007 个 unittest 通过(38 skip)、116 个 Browser Use 测试通过、509 个 Trajectory Replay 测试通过(4 skip);命名检查、双仓库契约检查通过。此次不重跑正式 30 任务,也不改 Chromium 29/30、Moli 15/30 的成绩。修复提交 3607ba8。

@github-actions github-actions 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.

Automated Claude review completed. Review run: https://github.com/lexmount/browser-eval/actions/runs/34962935562. Please check Claude's inline feedback and summary comment for details.

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.

1 participant