Skip to content

fix(benchmarks): keep hub edition metadata and dataset tools in publication builds - #283

Merged
lanyue-llk merged 2 commits into
mainfrom
fix/publication-keeps-edition
Nov 12, 2026
Merged

lanyue-llk merged 2 commits into
mainfrom
fix/publication-keeps-edition

Conversation

@lanyue-llk

@lanyue-llk lanyue-llk commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Dataset rebuilds keep the hub's edition and tools

Closes #281.

Problem: building a dataset release from a Hugging Face checkout (python -m harness.benchmarks.publication --checkout <hub> …) dropped the hub manifest's edition block and didn't output the dataset's tools/ or Makefile. Because --create-pr deletes everything missing from the output, republishing LexBench-Web-Fetch v3.x would have deleted its 7 tools/*.py files and its Makefile, and dropped the v3.0.0 edition metadata that the dataset's own tools/rebuild_publication.py requires.

Fix (src/harness/benchmarks/publication.py, +11/−2):

  • For hub checkouts, from_git reads edition from the committed manifest, the way it already reads viewer_filters. It also reads tools/ and Makefile at the revision through the existing _git_blobs, so uncommitted edits are ignored.
  • build() writes manifest['edition'] when it's present, and writes the tool files to the output. They're kept out of the manifest files list and the archive, as on the hub.
  • Builds from sources other than a hub checkout are unchanged.
  • Path safety: _git_blobs now rejects committed names that are absolute or contain . or ... A crafted Git tree such as tools/../../escaped would otherwise make the build write outside --output. The independent review reproduced that escape, and the guard also closes the older, narrower form of it under definitions/.

Tests:

  • test_committed_paths_cannot_leave_the_release builds a crafted tools/.. tree and asserts the build refuses it and writes nothing outside the output. It fails without the guard.

Also: tests/benchmarks/test_publication.py::test_hub_rebuild_keeps_committed_edition_and_dataset_tools covers both cases:

  • A hub without edition or tools rebuilds as before.
  • A hub with them keeps edition, tools/* and Makefile byte-identical, even when a tool file has an uncommitted edit.
  • Negative controls: removing either carry-over makes the test fail.

tests/benchmarks and the doc tests pass (11,748).

End-to-end against LexBench-Web-Fetch e14592e6, built to a local folder and not published:

  • Same file set as the hub, and the archive (bc1ff8dd…), data, definitions, tools and Makefile are byte-identical.
  • manifest.json has the same keys and edition equals the hub's.
  • Differences that remain for review on a dataset PR:
    • schema (the hub keeps the old browser-eval-dataset-release/1 name);
    • source_revision (the build records the checkout commit);
    • 10 annotations the hub keeps for viewer-hidden dynamic-* tasks;
    • two README lines (the challenge-set table row and the uv run --frozen helper prefix).

Docs: docs/benchmarks.md no longer says to avoid --create-pr for v3.x.

No scorer, dataset or score changes; this is a patch-level fix. The review also found an older problem with the same root cause in other datasets; it's tracked separately as an issue.

A build from a Hugging Face checkout now carries the committed manifest
`edition` object unchanged and writes the checkout's committed `tools/`
files and `Makefile` to the output (outside the manifest file inventory
and archive), so `--create-pr` no longer deletes them. Builds from
sources without these keep their previous output.

Closes #281

@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 · e154eda

No findings in this review.

A crafted Git tree can name '..' entries that ls-tree prints verbatim;
reject them in _git_blobs before any output path is written.

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

✅ Re-review complete · 4b1f9a2

No findings in this incremental review.

@lanyue-llk
lanyue-llk merged commit e979ae1 into main Nov 12, 2026
8 checks passed
@lanyue-llk
lanyue-llk deleted the fix/publication-keeps-edition branch November 12, 2026 16:18
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.

Dataset publication drops the Web Fetch v3 edition metadata and tools

1 participant