Repository navigation
Stop the zoo digest pin living in two places - #10206
Conversation
… baseline #10187 re-approved unsloth-zoo 2026.8.17 and moved the compiler.py obfuscation finding's pinned digest in scan_packages_baseline.json, but the same digest is written a second time in the test that guards the pin, and that copy was left on the old value. The pin and its guard have disagreed since, so test_context_dependent_unsloth_zoo_findings_are_digest_pinned fails on main and on every open PR, taking Repo tests (CPU) and workflow-trigger lint with it. This is the follow-up write only. The review the pin exists to force already happened in #10187; nothing here re-approves anything.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c591ba320e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| continue | ||
| digest = entry.get("file_sha256") | ||
| if isinstance(digest, str) and re.fullmatch(r"[0-9a-f]{64}", digest): | ||
| pinned.add(key) |
There was a problem hiding this comment.
Check the live evidence variant rather than any old pin
When a later zoo release is appended as a new evidence variant without file_sha256 while an older variant remains pinned, this aggregation still adds the pair and both tests pass: the reopen test only exercises entries that already have a digest. However, _load_baseline keys each variant by evidence_hash, so the new unpinned variant maps to None and suppresses that finding for any file contents. Since compiler.py already has multiple variants, the test must identify and require a pin on the live/current variant rather than accepting any historical pin for the same (file, check) pair.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Correct, and this is the version I should have written. _load_baseline maps an unpinned variant to None, so appending one for a pair that already has a pinned variant would suppress the finding for any file contents while this test stayed green on the old pin.
Tightened in d26e5c5: every entry for these three pairs must carry a file_sha256, except the three superseded compiler.py variants that are already in the baseline unpinned, which are grandfathered by evidence_hash. Those are frozen by construction (an evidence hash is over code a past release shipped), so listing them brings back no drift, unlike the live digest this PR removed.
Verified by doing what you describe: appending a fourth unpinned compiler.py variant now fails with
unsloth_zoo/compiler.py has a new unpinned entry for 'Advanced obfuscation (marshal/compile/zlib) + exec/eval'
(evidence_hash '000...'). An unpinned variant suppresses that finding whatever the file contains, so a
re-approval has to carry file_sha256 rather than ride the evidence alone.
133 passed with the baseline as committed.
|
Security review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
|
@codex review |
|
Codex Review: Didn't find any major issues. Breezy! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
Security review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
The compiler.py obfuscation digest was written in two places:
scripts/scan_packages_baseline.json, and again as a hardcoded expectation intests/security/test_scan_packages.py::test_context_dependent_unsloth_zoo_findings_are_digest_pinned.#10187 re-approved unsloth-zoo 2026.8.17 and moved the baseline copy from
58f43e3b...tof1f6751f.... The copy in the test was left behind, so the pin and the guard that checks it have disagreed ever since.That fails on
main, not just on PRs: the same assertion is red atdddd2d654,4792f9bb2and28a6c36a2, and it takes two checks down with it wherever it runs.Repo tests (CPU)-> 1 failed, 15826 passedworkflow-trigger lint (pull_request_target / cache-poisoning)-> same single assertionRoughly 50 open PRs are red on those two checks for this reason and nothing in their own branches.
What this changes
The first version of this PR just moved the literal to match. That fixes today and schedules the next one, so instead the duplicate copy is gone and the test asserts the property it is named for.
The security value here is
file_sha256:_partition_baselineonly suppresses a pinned entry while the file still hashes to a reviewed value, so any edit tounsloth_zoo/compiler.pyorunsloth_zoo/vision_utils.pyreopens the finding and asks for a fresh review. That mechanism lives in the baseline and is covered bytest_context_dependent_unsloth_zoo_pins_reopen_on_other_file_changes. Repeating the digest in the test pinned nothing extra, because whoever edits the baseline can edit the test in the same commit. It only added a second copy to forget.So the test now checks that each of the three (file, check) pairs still carries a well-formed reviewed digest, and says what to do when one does not:
Verified the guard still fires: dropping
file_sha256from the compiler.py entry in the baseline fails the test, restoring it passes.A (file, check) pair can hold several entries, one per revision of the matched lines a release has shipped, and only the live one carries a pin. compiler.py already has four such entries. The old dict comprehension only ever checked whichever came last in the file, which is a property nobody chose.
Second copy, same file
test_context_dependent_unsloth_zoo_pins_reopen_on_other_file_changesassertedlen(targets) == 3on the pinned entries. That holds only while re-approvals replace a pin in place. The torch and huggingface-hub entries in this same baseline are maintained by appending a revision, and the first zoo re-approval done that way would have turned this red for everyone too. It now asserts the three (file, check) pairs are covered, which is the thing it means.Result
tests/security/test_scan_packages.pygoes from 1 failed / 132 passed onorigin/mainto 133 passed. Nothing here approves anything new: the human review the pin exists to force already happened in #10187.Note this is not the only thing red on
mainright now.Repo tests (CPU)runsunsloth_cli/testsaftertests/, so #10231 is what it fails on next.Frontend build + bundle sanity,GGUF inference smokeandpip scan-packagesare red onmainfor three unrelated reasons, tracked separately.