From 7c17316fb963749309934ef579e89b0aee089c37 Mon Sep 17 00:00:00 2001 From: yummybomb <19238148+yummybomb@users.noreply.github.com> Date: Mon, 23 Nov 2026 19:25:12 +0000 Subject: [PATCH] Widen public-web to 21 tasks and compare unpinnable answers across the run --- README.md | 25 ++++-- report/public-web.test.ts | 88 +++++++++++++++++++- report/public-web.ts | 149 ++++++++++++++++++++++++++++++---- suites/public-web/source.toml | 14 ++++ suites/public-web/suite.py | 4 + tests/test_public_web.py | 4 +- 6 files changed, 261 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index 376e8e5..d51d473 100644 --- a/README.md +++ b/README.md @@ -122,9 +122,10 @@ ClawBench's primary score is the lenient reward. `kernel_mcp_valid` records whet ### `public-web` -Compare three browser approaches on nine signed-out tasks across six sites. The tasks cover -repository facts and search, hotel rules, flight search and cart preparation, retail search, -and comparing game prices. No logins, payment details or purchases. One task, +Compare three browser approaches on 21 signed-out tasks across 17 sites. The tasks cover +repository facts and search, hotel rules and room rates, flight search on Google Flights and +three airlines, cart preparation, setting a delivery address, retail and ticket search, +restaurant availability, and comparing prices. No logins, payment details or purchases. One task, `github-latest-release`, is a placebo: the treatment arm gets GitHub's tools, but none of them reads a release, so a difference between control and treatment there is noise. @@ -194,7 +195,7 @@ model access is implied by selecting a preset, and live model availability still provider account. Add another MCP-capable Harbor agent by adding a file under `runners/`, rather than duplicating the three browser arms. Credentials stay in environment variables, not presets. -The full workflow defaults to 135 trials (9 tasks × 3 arms × 5 attempts), each with a fresh +The full workflow defaults to 315 trials (21 tasks × 3 arms × 5 attempts), each with a fresh browser. Control and treatment differ only in the injected tools, so `benchmarks/public-web.toml` pairs them: for every task and attempt, one control and one treatment trial run back to back, in an order that is random but balanced within each task and recorded in the run manifest. @@ -215,8 +216,10 @@ local artifacts and Braintrust's `rawRewards` metadata. Each task's timeout and the run manifest. The agent calls `finalize` with its JSON answer. The verifier applies the pinned answer -schema/rules and, for the cart task, reads the final page independently and compares it to -the answer. That page check covers the route, displayed departure date, cabin, passenger count +schema/rules and, for the two tasks that leave the site in a state, reads the final page +independently: the DoorDash task must leave the requested delivery address set, and the cart +task's page is compared to the answer. The cart check covers the route, displayed departure +date, cabin, passenger count and amount due, not the flight numbers or whether the fare is the cheapest. The verifier adds the departure-date check to the pinned grader and reads it from the cart's itinerary fields; a missing or mismatched date cannot pass. The rules and the grader are uploaded only @@ -228,6 +231,16 @@ because they show a well-formed, in-range answer and nothing about whether it is pinned rules do not verify every returned fact. Audit examples before publishing correctness claims; this catalog is a screening set, not a held-out validation set. +For twelve tasks the best answer changes too often to pin, such as a cheapest fare or +tonight's open tables, and the verifier cannot tell whether a well-formed answer is the best +one. The report compares their passing trials with each other across every arm in it: a +trial matched the run's best answer when it gave the lowest price any passing trial gave for +that task, within the task's tolerance, or, where a task has one right answer, the answer +most passing trials gave. This catches an arm that reports a well-formed fare that is not the +cheapest. It compares trials with each other and not with the site, so one wrong outlier can +set the bar, answers can move while a run is in progress, and the rate depends on which arms +ran. + Reports show per-arm and per-task results, agent-only time (excluding setup and grading), input/cached/output tokens, browser call counts, toolset validity, rejected calls and recorded model cost with pricing coverage. For the paired arms they add, per task, how many pairs passed diff --git a/report/public-web.test.ts b/report/public-web.test.ts index e5974fd..a575585 100644 --- a/report/public-web.test.ts +++ b/report/public-web.test.ts @@ -157,13 +157,13 @@ test("public-web reports agent time, tokens, graded outcomes and pricing coverag ); // This legacy job has no task plan to classify its missing trial. expect(report).toContain( - "| 3/4 | — | — | end state 1/? · unknown 0/? | blocked 1 · errored (SetupError) 1 | 0 |", + "| 3/4 | — | — | — | end state 1/? · unknown 0/? | blocked 1 · errored (SetupError) 1 | 0 |", ); expect(report).toContain( "| control | 3 | 2/3 | 1 | 0 / 0 | 0 / 0 | 0 | 30s |", ); expect(report).toContain( - "| end state | — | blocked 1 · errored (SetupError) 1 | 30s |", + "| end state | — | — | blocked 1 · errored (SetupError) 1 | 30s |", ); expect(report).toContain("30s | 20s"); expect(report).toContain("1000 / 200 / 100"); @@ -779,6 +779,90 @@ test("matched pairs compare speed over both-pass pairs and passes over discordan expect(compared.tasks[0].agreement).toEqual({ checked: 2, differed: 1 }); }); +test("answers that cannot be pinned are compared with the run's best across arms", () => { + const price = { + grading: "shape/range rules", + agreement: { path: "price", better: "lower", tolerance: 1 }, + }; + const times = { + grading: "shape/range rules", + agreement: { path: "times[]", same: true }, + }; + const fare = (value: number, reward = 1) => ({ + task: "fare", + source: price, + answer: { price: value }, + reward, + }); + const slots = (...values: string[]) => ({ + task: "tables", + source: times, + answer: { times: values }, + }); + const arms = [ + readBenchmarkArm({ + name: "control", + path: job([ + fare(327), + fare(327), + // A failed trial's answer neither sets the best nor matches it. + fare(100, 0), + slots("19:00", "20:00"), + slots("19:00"), + { task: "pinned" }, + ]), + }), + readBenchmarkArm({ + name: "treatment", + path: job([ + fare(248), + fare(248.5), + fare(327), + slots("20:00", "19:00"), + slots("20:00", "19:00"), + ]), + }), + ]; + const [control, treatment] = summarizePublicWeb(arms); + expect(control.runBest).toMatchObject({ passes: 1, intended: 5 }); + expect(treatment.runBest).toMatchObject({ + passes: 4, + intended: 5, + interval: wilson(4, 5), + }); + const task = (name: string) => + control.tasks.find((entry) => entry.task === name)?.runBest; + expect(task("fare")).toMatchObject({ passes: 0, intended: 3 }); + expect(task("tables")).toMatchObject({ passes: 1, intended: 2 }); + expect(task("pinned")).toMatchObject({ passes: 0, intended: 0 }); + // The format-only pass rate still counts every well-formed answer. + expect(control.formatOnly).toMatchObject({ passes: 4, intended: 5 }); + + const report = renderMarkdown( + "public-web", + arms.map(summarizeArm), + undefined, + {}, + arms, + ); + expect(report).toContain( + "| fare | control | shape/range rules | 2/3 (21–94%) | 0/3 |", + ); + expect(report).toContain( + "| pinned | control | pinned rules | 1/1 (21–100%) | — |", + ); + + // Two answers given equally often leave no best answer, so the task is not scored. + const tied = summarizePublicWeb([ + readBenchmarkArm({ + name: "control", + path: job([slots("19:00"), slots("20:00")]), + }), + ])[0]; + expect(tied.runBest).toMatchObject({ passes: 0, intended: 0, unresolved: 1 }); + expect(tied.tasks[0].runBest.unresolved).toBe(1); +}); + test("interval and sign-test statistics", () => { const [low, high] = wilson(5, 5) as [number, number]; expect([low.toFixed(3), high.toFixed(3)]).toEqual(["0.566", "1.000"]); diff --git a/report/public-web.ts b/report/public-web.ts index e8a0c6f..df572d3 100644 --- a/report/public-web.ts +++ b/report/public-web.ts @@ -199,6 +199,43 @@ function passRate(groups: ReturnType, known: boolean) { }; } +// Passing trials that gave the run's best answer, over the intended trials of the tasks that +// have one. +function runBestRate( + trials: BenchmarkTrial[], + best: RunBest, + expected: ExpectedTrials, + known: boolean, +) { + const tasks = [ + ...new Set([ + ...expected.counts.keys(), + ...trials.map((trial) => trial.taskName), + ]), + ]; + const passes = trials.filter((trial) => best.matched.has(trial)).length; + const intended = known + ? tasks + .filter((task) => best.resolved.has(task)) + .reduce( + (sum, task) => + sum + + (expected.counts.get(task) ?? + trials.filter((trial) => trial.taskName === task).length), + 0, + ) + : null; + return { + passes, + intended, + interval: intended === null ? undefined : wilson(passes, intended), + // Tasks that compare answers but whose answers have no single most common one. + unresolved: tasks.filter( + (task) => best.compared.has(task) && !best.resolved.has(task), + ).length, + }; +} + // Trials that invoked a tool of one kind, and those where an invocation succeeded. function toolUse(trials: BenchmarkTrial[], kind: "injected" | "native") { return { @@ -215,6 +252,11 @@ export function publicWebStats( trials: BenchmarkTrial[], gradings: Map = taskGradings(trials), expected: ExpectedTrials = { counts: new Map(), total: trials.length }, + best: RunBest = { + compared: new Set(), + resolved: new Set(), + matched: new Set(), + }, ) { const costs = values(trials, (trial) => trial.metrics.costUsd); const byGrading = passesByGrading(trials, gradings, expected); @@ -240,6 +282,7 @@ export function publicWebStats( byGrading.filter((group) => group.grading === "shape/range rules"), known, ), + runBest: runBestRate(trials, best, expected, known), interval: expected.total === null ? undefined @@ -301,6 +344,7 @@ export function summarizePublicWeb(arms: BenchmarkArm[]) { if (grading) gradings.set(task, grading); } } + const best = runBest(arms); return arms.map((arm) => { const counts = new Map( Object.entries(arm.taskPlan).map(([task, plan]) => [task, plan.attempts]), @@ -314,10 +358,12 @@ export function summarizePublicWeb(arms: BenchmarkArm[]) { return { arm: arm.name, configuration: summarizeArm(arm).configuration, - ...publicWebStats(arm.trials, gradings, { - counts, - total: arm.nTotalTrials, - }), + ...publicWebStats( + arm.trials, + gradings, + { counts, total: arm.nTotalTrials }, + best, + ), tasks: tasks.map((task) => { const trials = arm.trials.filter((trial) => trial.taskName === task); const total = @@ -329,10 +375,12 @@ export function summarizePublicWeb(arms: BenchmarkArm[]) { placebo: arm.taskPlan[task]?.metadata.stage === "gap" || trials.some(placebo), - ...publicWebStats(trials, gradings, { - counts: new Map([[task, total ?? trials.length]]), - total, - }), + ...publicWebStats( + trials, + gradings, + { counts: new Map([[task, total ?? trials.length]]), total }, + best, + ), }; }), }; @@ -379,6 +427,69 @@ interface Pair { const answer = (trial: BenchmarkTrial) => readJsonIfPresent(join(trial.dir, "steps/run/verifier/grade.json")).answer; +const answerSet = (trial: BenchmarkTrial, path: string) => + JSON.stringify(resolvePath(answer(trial), path).map(canonical).sort()); +const answerValue = (trial: BenchmarkTrial, path: string) => + number(resolvePath(answer(trial), path)[0]); + +interface RunBest { + // Tasks that define how answers compare, those of them that have a best answer, and the + // passing trials that gave it. + compared: Set; + resolved: Set; + matched: Set; +} + +// A task's answers can change too often to pin, such as a cheapest fare, so its passing +// trials are compared with each other across every arm: the best is the lowest (or highest) +// value any of them reported, within the task's tolerance, or with `same` the answer most of +// them gave. With no single most common answer a `same` task has no best answer. +function runBest(arms: BenchmarkArm[]): RunBest { + const rules = new Map(); + for (const arm of arms) { + for (const trial of arm.trials) + if (trial.taskInfo.agreement) + rules.set(trial.taskName, trial.taskInfo.agreement); + for (const [task, plan] of Object.entries(arm.taskPlan)) + if (plan.metadata.agreement) rules.set(task, plan.metadata.agreement); + } + const best: RunBest = { + compared: new Set(), + resolved: new Set(), + matched: new Set(), + }; + for (const [task, rule] of rules) { + const { path, better, tolerance, same } = object(rule); + if (typeof path !== "string") continue; + best.compared.add(task); + const trials = arms + .flatMap((arm) => arm.trials) + .filter((trial) => trial.taskName === task && passed(trial)); + if (same) { + const counts = new Map(); + for (const trial of trials) { + const set = answerSet(trial, path); + counts.set(set, (counts.get(set) ?? 0) + 1); + } + const [top, next] = [...counts].sort((a, b) => b[1] - a[1]); + if (top && next && top[1] === next[1]) continue; + for (const trial of trials) + if (answerSet(trial, path) === top?.[0]) best.matched.add(trial); + } else { + const sign = better === "lower" ? 1 : -1; + const scored = trials.flatMap((trial) => { + const value = answerValue(trial, path); + return value === undefined ? [] : [{ trial, value: value * sign }]; + }); + const lowest = Math.min(...scored.map((score) => score.value)); + for (const score of scored) + if (score.value - lowest <= (number(tolerance) ?? 0)) + best.matched.add(score.trial); + } + best.resolved.add(task); + } + return best; +} // A pair's trials run back to back, so when both pass but the best value differs, the worse // arm missed it; with `same`, differing answers mean one arm was wrong, though not which. @@ -386,19 +497,19 @@ function agreementStats(pairs: Pair[], rule: unknown) { const { path, better, tolerance, same } = object(rule); if (typeof path !== "string") return undefined; if (same) { - const set = (trial: BenchmarkTrial) => - JSON.stringify(resolvePath(answer(trial), path).map(canonical).sort()); return { checked: pairs.length, differed: pairs.filter( - (pair) => set(pair.baseline) !== set(pair.candidate), + (pair) => + answerSet(pair.baseline, path) !== answerSet(pair.candidate, path), ).length, }; } - const value = (trial: BenchmarkTrial) => - number(resolvePath(answer(trial), path)[0]); const gaps = pairs.flatMap((pair) => { - const [base, other] = [value(pair.baseline), value(pair.candidate)]; + const [base, other] = [ + answerValue(pair.baseline, path), + answerValue(pair.candidate, path), + ]; return base === undefined || other === undefined ? [] : [(other - base) * (better === "lower" ? 1 : -1)]; @@ -609,6 +720,7 @@ export function renderPublicWeb(arms: BenchmarkArm[]): string { "Recorded / intended", "Checked pass (95% CI)", "Format-only pass", + "Matched run's best answer (95% CI)", "Passes by grading", "Stopped by", "Flagged for review", @@ -621,6 +733,7 @@ export function renderPublicWeb(arms: BenchmarkArm[]): string { s.formatOnly.intended === null ? "—" : `${s.formatOnly.passes}/${s.formatOnly.intended}`, + rate(s.runBest), s.passesByGrading .map((g) => `${g.grading} ${g.passes}/${g.intended ?? "?"}`) .join(" · ") || "—", @@ -669,6 +782,7 @@ export function renderPublicWeb(arms: BenchmarkArm[]): string { "Arm", "Grading", "Pass / intended (95% CI)", + "Matched run's best answer", "Stopped by", "Median agent time", "Median agent time (passes)", @@ -686,6 +800,11 @@ export function renderPublicWeb(arms: BenchmarkArm[]): string { intended: t.intended, interval: t.interval, }), + t.runBest.unresolved + ? "no single answer" + : t.runBest.intended + ? `${t.runBest.passes}/${t.runBest.intended}` + : "—", stops(t.stops), seconds(t.medianAgentMs), seconds(t.medianPassedAgentMs), @@ -695,6 +814,8 @@ export function renderPublicWeb(arms: BenchmarkArm[]): string { "", "Checked pass counts only tasks whose answer is checked against the page's end state or a pinned value, with a 95% Wilson interval over intended trials. Planned task gradings and attempt counts keep setup failures and missing trials in the denominator. Rates are unavailable when an older run lacks enough task-plan metadata to determine its denominators; unknown grading is never counted as format-only. A format-only pass, on a task with shape/range rules, shows a well-formed, in-range answer and nothing about whether it is true, and pinned-answer rules do not independently verify every returned fact. A pass also needs the agent to have used its assigned browser toolset and to have stayed within the task's spend limit. A rejected-call trial made a call its arm does not permit; the proxy blocked the call, which does not fail the trial.", "", + "Matched run's best answer covers the tasks whose best answer changes too often to pin, such as a cheapest fare, where the verifier cannot tell whether a well-formed answer is the best one. A trial counts when it passed and gave the best answer any passing trial in this report gave for its task, within the task's tolerance: the lowest price, or, where a task has one right answer, the answer most passing trials gave. It compares trials with each other and not with the site, so one wrong outlier can set the bar, answers can move while a run is in progress, and the rate depends on which arms the report includes. A task whose answers have no single most common one is left out.", + "", "Stopped by counts trials that did not pass for a reason other than a wrong answer: blocked, site error and Kernel error are the agent's own report of what stopped it, page unreadable means the page could not be read for the end-state check, call cap means the task's browser-call limit ran out, over spend limit means the recorded model cost exceeded the task's limit, and errored trials never got a fair run, such as a failed setup or a model provider that rejected the agent's requests.", "", "An injected tool is one of the arm's xwebmcp tools and a native tool is the site's own; tried counts trials that invoked one through the webmcp tool, and completed those where an invocation succeeded. An invocation made from Playwright or REPL code names no tool the proxy can see, so those trials are counted apart. Flagged trials have a tool call in the agent's trajectory that reached the task's site, the Kernel API or the task's files outside the arm's browser tools; review them before publishing.", diff --git a/suites/public-web/source.toml b/suites/public-web/source.toml index e4c3332..dce8d69 100644 --- a/suites/public-web/source.toml +++ b/suites/public-web/source.toml @@ -12,6 +12,20 @@ tasks = [ "steam-compare-series", # No tool at this revision reads a release, so treatment should gain nothing here. "github-latest-release", + "doordash-pizza-near-address", + "youtube-video-details", + "shopify-basic-monthly-price", + # The right answer to these changes too often to pin, so the report compares each trial's + # answer with the best one in the run. + "airbnb-cheapest-well-rated", + "amazon-cheapest-well-rated", + "booking-cheapest-room", + "frontier-cheapest-fare", + "southwest-cheapest-fare", + "united-cheapest-fare", + "stubhub-cheapest-pair", + "marriott-cheapest-rate", + "opentable-available-times", ] # A trial whose recorded model cost exceeds this is not counted as a pass. It matches the diff --git a/suites/public-web/suite.py b/suites/public-web/suite.py index 3da0f18..edb8bd2 100644 --- a/suites/public-web/suite.py +++ b/suites/public-web/suite.py @@ -151,5 +151,9 @@ def _write(task_source: Path, task_dir: Path, source: Path, sha: str, max_cost_u } ], } + # The report compares answers across trials with this rule, including for a task whose + # trials all failed before grading. + if intent.get("agreement"): + config["metadata"]["agreement"] = intent["agreement"] (task_dir / "task.toml").write_text(tomlkit.dumps(config)) return task_dir diff --git a/tests/test_public_web.py b/tests/test_public_web.py index 1f9f92b..67e4830 100644 --- a/tests/test_public_web.py +++ b/tests/test_public_web.py @@ -31,7 +31,7 @@ def test_public_arms_change_only_the_approach(): assert all(len(arm.toolset_ref) == 40 for arm in arms) source = tomllib.loads((ROOT / "suites/public-web/source.toml").read_text()) assert len(source["revision"]) == 40 - assert len(source["tasks"]) == 9 + assert len(source["tasks"]) == 21 assert source["max_cost_usd"] > 0 @@ -82,6 +82,7 @@ def test_suite_writes_harbor_task_and_keeps_injection_outside_image(tmp_path): "trial_timeout_sec": 600, "max_turns": 40, "rules": [{"path": "answer", "equals": "pinned-answer"}], + "agreement": {"path": "answer", "same": True}, }, "prompt": "Return JSON.", "grading": "pinned rules", @@ -95,6 +96,7 @@ def test_suite_writes_harbor_task_and_keeps_injection_outside_image(tmp_path): assert config["source"] == "public-web" assert config["metadata"]["limits"] == {"browser_calls": 40, "cost_usd": 2.0} assert config["metadata"]["xwebmcp_sha"] == "a" * 40 + assert config["metadata"]["agreement"] == {"path": "answer", "same": True} assert config["environment"]["mcp_servers"][0]["name"] == "bench" assert (task_dir / "xwebmcp-tools.js").exists() assert not (task_dir / "environment/bench/tools.js").exists()