Repository navigation
Verify SHA-256 for every model catalog entry, pin HF commit SHAs - #1543
Conversation
#1497) Every catalog entry now carries a real SHA-256 fetched from HuggingFace's LFS blob metadata, and download URLs pin the repo commit at fetch time instead of the moving /resolve/main/ ref. An empty hash is now a hard error raised before a download starts, not a silent skip after a multi-GB transfer completes. Also corrects Ministral 14B's stale size_bytes estimate to the real LFS-reported size. Co-Authored-By: Claude Sonnet 5 <[email protected]>
Code Review SummaryThis PR closes a real security gap: every catalog entry previously shipped an empty I independently verified the externally-sourced data rather than trusting the diff: I queried HuggingFace's live blobs API for 6 of the 13 catalog entries (Ministral 3B, Ministral 8B — the locked default, Ministral 14B, Qwen3-8B, Qwen3.5-9B, Mistral-Small-3.2-24B, and Ornith-1.9B). In every case the commit SHA pinned in the URL, the This is a net positive change and I recommend approval, with one non-blocking follow-up item noted below. FindingsCritical IssuesNone found. Suggested Improvements
Nitpicks
Verification Detail (for transparency)Live HuggingFace API spot-checks (all matched exactly — commit SHA, sha256, size_bytes):
Security correctness checks:
Acceptance criteria from issue #1497:
Recommendation: Approve. |
malibio
left a comment
There was a problem hiding this comment.
Review recommendation: APPROVE (GitHub blocks self-approval on this PR since it's authenticated as the PR author — see the full review report posted as a PR comment above for details, verification methodology, and two non-blocking follow-up suggestions). No blocking issues found; independently verified 7/13 catalog entries against HuggingFace's live API and reproduced test/clippy/fmt results myself.
Fix the misleading comment on the (now unreachable) empty-hash branch in perform_download -- the actual guard lives in download(), not find_catalog_entry. Also tighten every_catalog_entry_pins_a_commit_not_a_moving_ref to assert the resolve-ref segment is actually a 40-char hex commit SHA, not just "doesn't say main". Co-Authored-By: Claude Sonnet 5 <[email protected]>
Review responseBoth suggested improvements were already addressed in commit `91c3006a` (pushed before this review comment landed):
⏭️ Skipped (by reviewer's own recommendation, out of scope for this PR):
Re-verified at current HEAD (`91c3006a`): `cargo test -p nodespace-agent model_manager` (43/43 pass), `cargo clippy -p nodespace-agent --all-targets -- -D warnings -D clippy::unused-async` (clean), `cargo fmt -p nodespace-agent -- --check` (clean). No re-review needed — the changes are narrowly scoped comment/test clarifications with no behavior change, already reviewed in substance. Ready to merge pending your go-ahead. |
Summary
GET /api/models/<org>/<repo>?blobs=true,lfs.sha256field) — no more empty-hash "skip verification" policy exceptions./resolve/main/ref.sha256a hard error indownload(), raised before the transfer starts (previouslyperform_downloadsilently skipped verification after downloading the full multi-GB file).MINISTRAL_14B's stalesize_bytes(was a rough~8.2 GBestimate; corrected to the real LFS-reported8_239_593_024).Test plan
cargo test -p nodespace-agent model_manager— 43 passed, including 3 new tests (every_catalog_entry_has_a_verifiable_sha256,every_catalog_entry_pins_a_commit_not_a_moving_ref,no_catalog_entry_has_an_empty_sha256)cargo clippy -p nodespace-agent --all-targets -- -D warnings -D clippy::unused-async— cleancargo fmt -p nodespace-agent -- --check— cleanbun run test:all— frontend 3946/3946, Rust workspace unit tests 966/966 passedCloses #1497
🤖 Generated with Claude Code