Repository navigation
Export scored runs as webstone-site result submissions for every track - #374
Conversation
There was a problem hiding this comment.
This review found 4 issue(s), including 4 blocking issue(s).
|
|
||
| def method_id(name: str) -> str: | ||
| """A submission method ID: the run's method name in lowercase hyphen form.""" | ||
| slug = re.sub(r"[^a-z0-9]+", "-", str(name).lower()).strip("-") |
There was a problem hiding this comment.
Normalization can collapse distinct, valid run methods into the same provider ID. For example, Web Search's validate_profile accepts both a-b and a--b, but both become a-b here. The exporter then successfully writes a submission that ResultsClient.check rejects with “Method IDs must be unique lowercase identifiers.” Preserve already-valid submission IDs and disambiguate collisions for other names deterministically, or at least detect collisions before writing the submission and report the affected methods. Add a regression test with two colliding method names.
| entries = [json.loads(line) for line in journal.read_text(encoding="utf-8").splitlines() | ||
| if line.strip()] |
There was a problem hiding this comment.
The checkpoint journal contains every physical attempt, whereas manifest['calls'] contains the effective call per (method, case_id). After an access-repair retry, this fallback returns both the failed and replacement calls, inflating executedPages and timing populations and feeding duplicate cases into completion metrics. Collapse journal entries to the latest verified call per (method, case_id), as the pipeline's checkpoint loader does, so exporting a checkpoint uses the same logical population as exporting a finalized run.
| run = Path(run_dir) | ||
| home = run.parents[1] |
There was a problem hiding this comment.
Resolve the run path before indexing its parents. The shared export CLI passes the supplied Path unchanged, so export . from inside a run or export RUN_NAME from the runs directory raises IndexError here despite selecting a valid run. Use Path(run_dir).resolve() before deriving the data home.
Suggestion:
| run = Path(run_dir) | |
| home = run.parents[1] | |
| run = Path(run_dir).resolve() | |
| home = run.parents[1] |
| calls = Counter((record["provider"], record["case_id"]) for record in records) | ||
| if max(calls.values()) > 1: | ||
| raise ValueError("Export needs one scored result per method and case; this run repeats cases") | ||
| case_ids = {record["case_id"] for record in records} |
There was a problem hiding this comment.
Check that every provider covers the same case set before exporting comparable scores. The runner can leave partial results when execution stops (it records remaining cases in manifest['unexecuted']), but case_ids here is the union across providers while summarize() calculates each provider's rates over its own records. For example, a provider passing its only completed case can export 100% alongside another provider covering 100 cases, with a shared taskCount of 100 and misleading category denominators. Reject unequal provider populations, or explicitly represent incomplete coverage and suppress scores that require the shared population. Add a regression test with unequal provider case sets.
Add the export stage: a per-track export(run_dir, receipt=None) registered as TrackStages.export maps scored results and the publication receipt to the submission ResultsClient.check validates. Without a receipt the submission is marked unpublished. Exporters for Web Fetch, Web Search, Web Extract, Browser Use and Browser Trajectory Replay validate versioned scored-result schemas bound to the common record roles; RecordSchema gains nullable roles for untimed calls. Web Search's delivery shard export moves to 'delivery'.
…al retries in export
e37175a to
207802f
Compare
There was a problem hiding this comment.
This review found 1 issue(s), including 1 blocking issue(s).
| raise ValueError(f"Benchmark {name} has no submission definition") | ||
| site_id, quality = SUBMISSIONS[name] | ||
| records = name != "zyte" | ||
| all_truth = read_json(home / "dataset/dataset/ground-truth.json") |
There was a problem hiding this comment.
The exporter rescoring boundary does not verify the dataset against the run contract. Unlike score_run(), it neither calls validate_dataset(home) nor checks contract['dataset_manifest_sha256']. If the prepared dataset is replaced or its ground truth changes after collection, export silently produces quality metrics for different references, even though the call hashes still pass. Validate the prepared dataset and its contract binding before reading truth and recomputing scores, so changed inputs are rejected rather than exported as the original run.
There was a problem hiding this comment.
✅ Re-review complete · 94d0ca5
No findings in this incremental review.
Purpose
The last pipeline stage was manual:
webstone resultscould check and submit a result, but its input was a hand-filled template and no track produced one. This adds theexportstage (spec "Stages and artifacts", Export result): every track with scored results registersexport(run_dir, receipt=None) -> submissionasTrackStages.export, andwebstone <track> export RUN_DIR [--receipt R] --output submission.jsonwrites the submission thatwebstone results validate|submitconsumes. No measured value is typed by hand.What changed
src/harness/results/export.py(shared, track-neutral):submission()builds the formatResultsClient.checkvalidates;read_receipt()readsshare_url/urlorhost|base_url + slugandversionId|version|expected_versionfrom any publish stage's receipt;export_stage()is the shared CLI;scored_result_schema()binds the common record roles. Without a receipt the submission is markedsource.kind: unpublished-runwith no URL, andcheck/submitreject it until the report is published.lexbench-webfetch/split-media, readingresults.jsonlwith the Web Fetch record schemas, one score entry, shared run arguments and certification #371SCORED_RESULTschema andsummarize(); categories fromreport_family.lexbench-websearch/title-snippet-v2orsimpleqa-verified/source-match-v2(--benchmarkwhen a run has both). Scenario relevance stays null: it comes from the separate relevance review.lexbench-swdeorlexbench-zyte-product-extractionviascore_rowsandcompletion_bundle; a method that missed part of the population gets null quality scores.webarena-verifiedvia_logical_results; action times from the BrowserTool events.webarena-verifiedfrom the effectiveresults.jsonand the trace steps.websearch.scored_result/1,webextract.scored_result/1,browseruse.scored_result/1,trajectoryreplay.scored_result/1) bound to the common roles.RecordSchemagainsnullableroles (instance-neutral) for untimed calls.docs/result-submissions.mdexport → submit flow and per-track table;docs/agent-workflows.md, the bundled webstone skill, and thewebstone trackslimits no longer claim there is no evidence-to-leaderboard conversion.Breaking changes
exportstage (lossless delivery shards,report --export-delivery) is renameddelivery(python -m harness.web_search delivery DESTINATION --output REPORT), becauseexportis now the fixed result-export verb.Allowlists and baselines
tests/baselinespass without refresh). Scorer identity unchanged:lexbench-webfetch versionscoring hash0fe89317…before and after.Verification
uv run --frozen --all-extras python -m pytest tests/results tests/baselines tests/test_architecture_*.py tests/test_agent_workflows.py tests/test_documented_paths.py tests/web_search tests/trajectory_replay tests/browser_use tests/web_extract -n 8 --dist worksteal→ 4450 passed, 19 skipped.tests/results/test_export.py: for a synthetic run per track (the baseline fixtures), the export passesResultsClient.checkagainst a catalog-only fake transport (no GitHub), and the same run without a receipt exports as unpublished and is rejected. Also covers thewebstone webfetch exportcommand and receipt forms.make lint-checkpasses.Closes #334
Part of #327