Repository navigation
fix(benchmarks): keep hub edition metadata and dataset tools in publication builds - #283
Merged
Merged
Conversation
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
A crafted Git tree can name '..' entries that ls-tree prints verbatim; reject them in _git_blobs before any output path is written.
There was a problem hiding this comment.
✅ Re-review complete · 4b1f9a2
No findings in this incremental review.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #281.
Problem: building a dataset release from a Hugging Face checkout (
python -m harness.benchmarks.publication --checkout <hub> …) dropped the hub manifest'seditionblock and didn't output the dataset'stools/orMakefile. Because--create-prdeletes everything missing from the output, republishing LexBench-Web-Fetch v3.x would have deleted its 7tools/*.pyfiles and itsMakefile, and dropped the v3.0.0 edition metadata that the dataset's owntools/rebuild_publication.pyrequires.Fix (
src/harness/benchmarks/publication.py, +11/−2):from_gitreadseditionfrom the committed manifest, the way it already readsviewer_filters. It also readstools/andMakefileat the revision through the existing_git_blobs, so uncommitted edits are ignored.build()writesmanifest['edition']when it's present, and writes the tool files to the output. They're kept out of the manifestfileslist and the archive, as on the hub._git_blobsnow rejects committed names that are absolute or contain.or... A crafted Git tree such astools/../../escapedwould otherwise make the build write outside--output. The independent review reproduced that escape, and the guard also closes the older, narrower form of it underdefinitions/.Tests:
test_committed_paths_cannot_leave_the_releasebuilds a craftedtools/..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_toolscovers both cases:editionor tools rebuilds as before.edition,tools/*andMakefilebyte-identical, even when a tool file has an uncommitted edit.tests/benchmarksand the doc tests pass (11,748).End-to-end against LexBench-Web-Fetch
e14592e6, built to a local folder and not published:bc1ff8dd…), data, definitions, tools andMakefileare byte-identical.manifest.jsonhas the same keys andeditionequals the hub's.schema(the hub keeps the oldbrowser-eval-dataset-release/1name);source_revision(the build records the checkout commit);dynamic-*tasks;uv run --frozenhelper prefix).Docs:
docs/benchmarks.mdno longer says to avoid--create-prfor 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.