-
Notifications
You must be signed in to change notification settings - Fork 16
fix(cache): isolate Windows probes and stabilize nightly checks #1782
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
40cb9a4
6e09366
d996268
3593b7d
8227b2f
94d00fb
a0adb8b
242335c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9062,26 +9062,39 @@ def test_scan_bytes_warns_when_allowlisted_module_is_unresolved(monkeypatch: pyt | |
|
|
||
|
|
||
| @pytest.mark.parametrize( | ||
| ("module", "name"), | ||
| ("module", "name", "source_changes"), | ||
| [ | ||
| ("joblib.numpy_pickle", "NumpyArrayWrapper"), | ||
| ("numpy._core.multiarray", "_reconstruct"), | ||
| ("torch._utils", "_rebuild_tensor_v2"), | ||
| ("joblib.numpy_pickle", "NumpyArrayWrapper", False), | ||
| ("joblib.numpy_pickle", "NumpyArrayWrapper", True), | ||
|
Comment on lines
+9065
to
+9068
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Because this AGENTS.md reference: packages/modelaudit-picklescan/AGENTS.md:L69-L75 Useful? React with 👍 / 👎. |
||
| ("numpy._core.multiarray", "_reconstruct", False), | ||
| ("torch._utils", "_rebuild_tensor_v2", False), | ||
| ], | ||
| ) | ||
| def test_scan_bytes_warns_on_unresolved_framework_reconstruction_global( | ||
| module: str, | ||
| name: str, | ||
| source_changes: bool, | ||
| monkeypatch: pytest.MonkeyPatch, | ||
| ) -> None: | ||
| monkeypatch.setattr( | ||
| "modelaudit_picklescan.call_graph._trusted_module_origin_kind", | ||
| lambda _module_name: "unresolved", | ||
| ) | ||
| if source_changes: | ||
|
|
||
| def raise_source_stability_error(_report_generation: int | None) -> None: | ||
|
mldangelo-oai marked this conversation as resolved.
|
||
| raise _CallGraphAnalysisLimitError("source changed during shared call-graph analysis") | ||
|
|
||
| monkeypatch.setattr(package_api, "_ensure_shared_source_snapshot_stable", raise_source_stability_error) | ||
|
|
||
| report = scan_bytes(f"c{module}\n{name}\n.".encode(), source="unresolved-framework-global.pkl") | ||
|
|
||
| assert report.status == ScanStatus.COMPLETE | ||
| if report.status == ScanStatus.INCONCLUSIVE: | ||
| _assert_call_graph_source_stability_error(report) | ||
| else: | ||
| assert report.status == ScanStatus.COMPLETE | ||
| if source_changes: | ||
| assert report.status == ScanStatus.INCONCLUSIVE | ||
|
Comment on lines
+9092
to
+9097
|
||
| assert report.verdict == SafetyVerdict.SUSPICIOUS | ||
| assert any( | ||
| finding.rule_code == "NON_ALLOWLISTED_GLOBAL" and finding.details.get("import_reference") == f"{module}.{name}" | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
uv help rundescribes--withas layering the requested package into a separate ephemeral environment. On a fresh package checkout, however, the required standalone commands remainuv run --with ruff ..., so they can resolve a newer Ruff instead of 0.15.10—the exact condition these workflow changes avoid—while CI passes with the pin. Update the package guide anddocs/agents/picklescan-package-split.md:127-134, or make those commands invoke the root-locked tool, so canonical local validation matches CI.AGENTS.md reference: packages/modelaudit-picklescan/AGENTS.md:L39-L45
Useful? React with 👍 / 👎.