fix(cli): make streaming dry runs non-executing#1649
Open
mldangelo-oai wants to merge 1 commit into
Open
Conversation
Contributor
Author
|
@codex review |
Contributor
Performance BenchmarksCompared
|
|
Codex Review: Didn't find any major issues. Delightful! ℹ️ 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". |
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.
Summary
--dry-run --streamthat performs metadata planning only.Root cause
scan_commandpasseddry_run=Truethrough runtime config, but Hugging Face source resolution still entered the streaming acquisition path. For direct Hugging Face file URLs this downloaded the artifact, then invoked the normal scanner path and emitted full scan JSON. That made--dry-run --streambehave like a real scan for Hugging Face inputs.Security tradeoffs
artifact_downloads: 0andscanner_execution: false; they do not emit scan-result fields likebytes_scanned,files_scanned,issues, orchecks.Real-model QA
Pinned model/revision:
nvidia/nemotron-3.5-asr-streaming-0.6b @ 24b151a851dd15909e1fc611b11bb2da52b9fc81Baseline on
ab6e58ebe587197b2b46866c69f7d41d75e08a55reproduced the bug with the bounded README artifact:Observed baseline behavior: exited 0 but issued artifact
GET .../resolve-cache/.../README.md, invoked the metadata scanner, and emitted full scan JSON withfiles_scanned: 1,bytes_scanned: 47395, andscanner_names: ["metadata"].Fixed dry-run command:
Outcome: exit 0. Verbose output showed only:
GET https://huggingface.co/api/models/nvidia/nemotron-3.5-asr-streaming-0.6b/revision/24b151a851dd15909e1fc611b11bb2da52b9fc81POST https://huggingface.co/api/models/nvidia/nemotron-3.5-asr-streaming-0.6b/paths-info/24b151a851dd15909e1fc611b11bb2da52b9fc81Preview JSON contained
artifact_downloads: 0,scanner_execution: false,metadata_only: true,size_bytes: 47395, and no scan-result fields.Non-dry control:
Outcome: exit 0, normal scan JSON with
files_scanned: 1,bytes_scanned: 47395, andscanner_names: ["metadata"].Tests
uv run ruff format --check modelaudit/ packages/modelaudit-picklescan/src packages/modelaudit-picklescan/tests tests/uv run ruff check modelaudit/ packages/modelaudit-picklescan/src packages/modelaudit-picklescan/tests tests/uv run mypy modelaudit/ packages/modelaudit-picklescan/src packages/modelaudit-picklescan/tests tests/PROMPTFOO_DISABLE_TELEMETRY=1 uv run pytest tests/test_cli.py -k "huggingface_streaming_dry_run or huggingface_file_streaming_dry_run or huggingface_streaming_without_dry_run_still_reports_malicious_result" --maxfail=1PROMPTFOO_DISABLE_TELEMETRY=1 uv run pytest tests/test_cli.py --maxfail=1PROMPTFOO_DISABLE_TELEMETRY=1 uv run pytest tests/test_streaming_scan.py --maxfail=1PROMPTFOO_DISABLE_TELEMETRY=1 uv run pytest tests/cache/test_cache_correctness.py::test_cached_scan_does_not_serialize_known_uncacheable_scan_result -vv --maxfail=1PROMPTFOO_DISABLE_TELEMETRY=1 uv run pytest -n auto tests/cache/test_cache_correctness.py::test_cached_scan_does_not_serialize_known_uncacheable_scan_result -vv --maxfail=1PROMPTFOO_DISABLE_TELEMETRY=1 uv run pytest tests/cache/test_cache_correctness.py --maxfail=1git diff --checkBroad suite attempted:
PROMPTFOO_DISABLE_TELEMETRY=1 uv run pytest -n auto -m "not slow and not integration" --maxfail=1Outcome: failed after 10m33s in unrelated
tests/cache/test_cache_correctness.py::test_cached_scan_does_not_serialize_known_uncacheable_scan_result(release_calls2 vs 1). The exact test passes in isolation, under xdist isolation, and the containing cache module passes locally.