v0.1: dataset fetch + sha256 verification + cache resolution#3
Closed
protosphinx wants to merge 1 commit into
Closed
v0.1: dataset fetch + sha256 verification + cache resolution#3protosphinx wants to merge 1 commit into
protosphinx wants to merge 1 commit into
Conversation
- cache.py — `$PM_BENCH_CACHE` → `~/.cache/pm-bench/` with per-dataset paths; rejects synthetic and unknown formats - fetch.py — `ensure_cached(dataset)` covers cached+match, cached+mismatch (loud HashMismatchError), cached+unpinned (returns actual hash), not-cached (auto-download if URL set, otherwise ManualFetchRequired with the precise landing URL + on-disk path). Streams in 1 MiB chunks; atomic .part-then-rename writes - CLI: `pm-bench fetch <name> [--pin]` — prints status, emits a pasteable registry.yml sha256 patch when `--pin` is set against an unpinned-but-present cached file (the path the TOS-gated workflow takes) - 13 new tests (test_cache.py, test_fetch.py); 37 total, ruff clean - STATUS / GOALS / README updated: v0.1 marked partial — machinery shipped, per-dataset hash pins pending one-time manual downloads
This was referenced May 1, 2026
Member
Author
|
Merged into main as part of the audit-cleanup stack (commit 9c00b47). The full content of this PR is now on main. |
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.
Stacked on top of #2 (end-to-end loop). Merge #2 first; then this rebases trivially onto main.
Summary
pm-bench fetch <name> [--pin], sha256 verification, cache directory resolution.--pin→ PR the patch). Everything downstream is automated.What's new
pm_bench/cache.py— cache root from$PM_BENCH_CACHE(else~/.cache/pm-bench/), per-dataset path with the right extension by format. Synthetic datasets are rejected (generated on demand).pm_bench/fetch.py—ensure_cached(dataset)covers all four cases:HashMismatchError(loud, refuses silent proceed)--pinit)ManualFetchRequiredwith the precise landing URL and on-disk path the user needs to fill inAtomic
.part-then-rename writes; streams in 1 MiB chunks.pm-bench fetch <name> [--pin]— prints status; with--pinagainst an unpinned cached file, emits a pasteableregistry.ymlsha256 patch.test_cache.py,test_fetch.py). 37 total.Why this matters
--pin, the registry update is a trivial PR; the rest of the toolchain (parse → split → prefixes → predict → score) is wired.gnn's v0.5 milestone the moment any single dataset is pinned.Smoke
Test plan
pytest -q— 37 passed (was 24 on PR End-to-end loop on synthetic-toy: prefixes + predict + score #2)ruff check pm_bench tests— clean--pinagainst a planted fileRoadmap impact
_load_events(likely behind a[bpi]extra to keep the base install light).