Skip to content

feat(webfetch): compose separate runs into a saved-matrix spec by command - #343

Merged
lanyue-llk merged 2 commits into
mainfrom
refactor/compose
Nov 24, 2026
Merged

lanyue-llk merged 2 commits into
mainfrom
refactor/compose

Conversation

@lanyue-llk

Copy link
Copy Markdown
Contributor

Purpose

Methods run separately on the same frozen dataset (as documented in #310) could only be combined through --saved-matrix with a hand-written spec holding computed SHA-256 values and enumerated case ids. Offline revision had no command. This adds both entry points (spec rules 5 and 9).

flowchart LR
  A["webstone run --providers A<br/>RUNS/a"] --> C["webstone compose RUNS/a RUNS/b"]
  B["webstone run --providers B<br/>RUNS/b"] --> C
  C --> S["comparison.json<br/>providers, suites, sources, hashes"]
  S --> R["build_report.py --saved-matrix"]
  R --> O["comparison report<br/>A and B"]
Loading

Changes

  • webstone compose RUN_DIR [RUN_DIR ...] --output SPEC [--title T] [--by-suite] (src/harness/web_fetch/saved_matrix_compose.py). Reads each run's manifest.json, dataset.json and results.jsonl. It requires one frozen dataset hash; --by-suite turns each distinct dataset into its own suite. It also requires the same selected cases and one result per method and case, and no method repeated within a suite. It writes schema_version, title, providers, suites and sources with hashes and spec-relative paths. Optional keys (missing, ranking, result_review, pricing, revisions, completions and so on) stay unset. The written spec is validated with the existing loader and removed if it fails.
  • report_saved_matrix._called: records from an ordinary webstone run carry no native_route_receipt, so the build rejected them with "Saved result lacks explicit transport evidence". When no receipt exists, the loader now accepts a verified public call log as transport evidence; every such log opens with call_started. unsupported_task records still count as not called. Records with receipts keep the current behaviour. This is the one behaviour change. Without it, compose output cannot be built.
  • webstone revise SOURCE --config CONFIG.json calls revise_local_snapshot unchanged. --help lists the configuration keys.
  • Docs: the "Saved multi-suite reports" section of the Web Fetch guide gains the run, compose and build flow. The local-revision paragraph names the command. configs/report-templates.json gains saved_matrix_compose.

Usage

webstone run --providers method-a --output RUNS/a
webstone run --providers method-b --output RUNS/b
webstone compose RUNS/a RUNS/b --output RUNS/comparison.json
uv run --frozen python scripts/build_report.py --saved-matrix RUNS/comparison.json --output NEW_REPORT

Verification

  • New tests/test_saved_matrix_compose.py: two fixture-provider runs, then compose, then build_report.py --saved-matrix, checking both methods in matrix.json with the expected pass/fail. Negative tests: different datasets without --by-suite, and a missing results.jsonl. webstone revise runs on a local-revision fixture.
  • pytest tests/test_saved_matrix_*.py tests/test_local_revision.py plus the CLI, report-template and owner-command tests: 872 passed.
  • make lint-check passes.
  • A manual run of --check-saved-matrix NEW_REPORT --source-spec SPEC on the composed fixture report returns valid: true.

Follow-up

  • The saved-matrix build is still Chinese-only (scripts/build_report.py:71). The comparison works, but no English edition can be built yet.

Closes #329

@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 · 0dfd89c

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

Comment on lines +61 to +62
suite_id = first["suite_id"] if first["suite_id"] not in used_ids else first["suite_id"] + "-" + digest[:8]
used_ids.add(suite_id)

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 digest-suffixed fallback is not checked against used_ids. With --by-suite, valid datasets encountered with IDs foo, foo-12345678, and foo (the last hash starting with 12345678) produce duplicate suite IDs. _load_saved_matrix then raises Duplicate or empty matrix registry and the specification is deleted. Generate candidates until an unused ID is found, and add a regression test covering a natural dataset ID that matches the generated fallback.

…mand

Add `webstone compose RUN_DIR... --output SPEC` that derives providers,
suites, sources, case ids and every SHA-256 from run directories and
validates the result with the saved-matrix loader. Accept the hash-bound
public call log as transport evidence for ordinary runs. Expose offline
revision as `webstone revise SOURCE --config CONFIG`.

Closes #329

@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 · 867f19e

No findings in this review.

@lanyue-llk
lanyue-llk merged commit b7b398d into main Nov 24, 2026
8 checks passed
@lanyue-llk
lanyue-llk deleted the refactor/compose branch November 24, 2026 06:47
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.

Compose separately produced runs into one comparison report by command

1 participant