Skip to content

fix(cache): isolate Windows probes and stabilize nightly checks - #1782

Merged
mldangelo-oai merged 8 commits into
mainfrom
fix/windows-nightly-cache-probe-isolation
Jul 27, 2026
Merged

fix(cache): isolate Windows probes and stabilize nightly checks#1782
mldangelo-oai merged 8 commits into
mainfrom
fix/windows-nightly-cache-probe-isolation

Conversation

@mldangelo-oai

@mldangelo-oai mldangelo-oai commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Fix the Windows Nightly cache/probe failures without weakening malicious pickle detection.
  • Protect the real Hugging Face snapshot scan root even when model files resolve into sibling blob storage; canonicalize cache/temporary probe aliases.
  • Propagate repository roots through real batch and keyed cache lookups with exception-safe context isolation, without changing existing no-context or legacy subclass signatures.
  • Preserve normal Windows temporary-directory and cross-volume behavior by selecting writable ancestors strictly outside the protected scan root.
  • Safely close and relocate previously cached locked probes; retain in-use or uncloseable probes, protect concurrent identity captures, and keep cache clearing atomic through metadata reset.
  • Preserve unresolved suspicious framework findings and pin standalone CI/release lint to root-locked Ruff 0.15.10.

Validation

  • Complete exact-head fast suite: 22,116 passed; 788 expected platform, optional-dependency, and reduced-lane skips; 41 warnings.
  • Complete root-cache, release-workflow, and standalone pickle API suites: 1,455 passed; 3 expected platform skips.
  • Real Hugging Face external blob symlinks, canonical probe aliases, populated batch caches, temporary/cross-volume ancestors, safe old-probe relocation, active-handle retention, and cache-clear regressions: 38 passed.
  • Exact CI Python 3.10 full type check: 479 source files; no errors.
  • Full root and standalone Ruff checks: 424 root files + 26 standalone files clean.
  • Standalone uv lock --check and cargo fmt --check: passed.
  • Three independent exact-head native Codex reviews and a fourth independent evidence verifier: high-risk publication gate clean; no findings.
  • Root uv.lock, standalone uv.lock, and Cargo.lock remain unchanged. Known box-local root resolver drift also reproduces on main-identical inputs; the exact-head GitHub lock check is authoritative.

Release impact

This repository is squash-only. The existing stabilization touches standalone regression coverage and its canonical agent documentation, so release-please may identify a standalone modelaudit-picklescan patch despite no standalone implementation or version change. Splitting commits does not change squash component attribution. No release policy, dependency constraints, package version, lockfile, CODEOWNER requirement, or branch protection is modified.

Copilot AI review requested due to automatic review settings July 26, 2026 22:07
@mldangelo-oai

Copy link
Copy Markdown
Contributor Author

@codex review

@github-actions

github-actions Bot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Workflow run and artifacts

Performance Benchmarks

Compared 13 shared benchmarks with a regression threshold of 15%.
Status: 0 regressions, 0 improved, 13 stable, 0 new, 0 missing.
Aggregate shared-benchmark median: 3.890s -> 3.873s (-0.4%).

Workload Benchmark Target Size Files Baseline Current Change Status
nested-payload-review tests/benchmarks/test_picklescan_benchmarks.py::test_picklescan_nested_payload_review[nested_base64] nested_base64 98 B 1 263.8us 270.1us +2.4% stable
warm-cache-rescan tests/benchmarks/test_scan_benchmarks.py::test_scan_warm_cached_repository_rescan release-candidate 547.3 KiB 32 124.69ms 122.39ms -1.8% stable
nested-payload-review tests/benchmarks/test_picklescan_benchmarks.py::test_picklescan_nested_payload_review[nested_hex] nested_hex 130 B 1 277.1us 274.4us -1.0% stable
direct-malicious-upload tests/benchmarks/test_picklescan_benchmarks.py::test_picklescan_direct_malicious_upload malicious_reduce 52 B 1 195.2us 196.3us +0.5% stable
mixed-model-repository tests/benchmarks/test_scan_benchmarks.py::test_scan_release_candidate_repository release-candidate 547.3 KiB 32 575.50ms 572.39ms -0.5% stable
rejected-basic-auth-candidates tests/benchmarks/test_scan_benchmarks.py::test_rejected_basic_auth_candidates_scan_linearly - 371.1 KiB 1 2.179s 2.169s -0.5% stable
single-checkpoint-preflight tests/benchmarks/test_scan_benchmarks.py::test_scan_single_checkpoint_before_load single_checkpoint.pkl 183.0 KiB 1 95.03ms 95.42ms +0.4% stable
padded-multi-stream-upload tests/benchmarks/test_picklescan_benchmarks.py::test_picklescan_padded_multi_stream_upload multi_stream_padded 4.1 KiB 1 295.8us 294.6us -0.4% stable
clean-training-checkpoint tests/benchmarks/test_picklescan_benchmarks.py::test_picklescan_clean_training_checkpoint safe_large 278.2 KiB 1 110.73ms 110.31ms -0.4% stable
duplicate-heavy-registry tests/benchmarks/test_scan_benchmarks.py::test_scan_duplicate_registry_snapshot registry-snapshot 915.2 KiB 13 548.81ms 547.02ms -0.3% stable
chunked-upload-stream tests/benchmarks/test_picklescan_benchmarks.py::test_picklescan_chunked_upload_stream chunked_stream 278.2 KiB 1 113.33ms 113.70ms +0.3% stable
nested-payload-review tests/benchmarks/test_picklescan_benchmarks.py::test_picklescan_nested_payload_review[nested_raw] nested_raw 78 B 1 242.4us 242.6us +0.1% stable
suspicious-pickle-intake tests/benchmarks/test_scan_benchmarks.py::test_scan_suspicious_pickle_intake suspicious-intake 183.8 KiB 4 141.13ms 141.02ms -0.1% stable

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses Nightly CI failures by hardening cache identity probing on Windows to avoid creating locked probe files within scanned content, and by ensuring pickle scan results preserve suspicious findings even when shared call-graph analysis becomes inconclusive due to source instability.

Changes:

  • Update Windows cache “change clock” probe selection to restrict probe locations to system temp/cache directories (and fail closed otherwise).
  • Add/adjust regression tests covering Windows probe behavior and call-graph source-stability inconclusive reporting while preserving suspicious findings.
  • Document the Windows probe fix in the root changelog.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
modelaudit/cache/scan_results_cache.py Adjusts _get_change_clock_probe() candidate directories on Windows to avoid scanned ancestors and include cache dir fallback.
tests/cache/test_cache_correctness.py Splits POSIX-vs-Windows probe expectations and adds a Windows regression ensuring scanned ancestors are not probed.
packages/modelaudit-picklescan/tests/test_api.py Extends framework-global unresolved tests to cover source-stability failure mode and allow INCONCLUSIVE while keeping suspicious findings.
CHANGELOG.md Adds an Unreleased bug-fix entry describing the Windows probe behavior change.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/modelaudit-picklescan/tests/test_api.py
Comment thread tests/cache/test_cache_correctness.py

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 40cb9a420e

ℹ️ 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".

Comment thread modelaudit/cache/scan_results_cache.py
Comment on lines +9065 to +9068
("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),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3 Badge Keep test stabilization out of the releasing fix commit

Because this fix(cache): ... commit also touches the standalone package tree, release-please will treat it as a patch-worthy modelaudit-picklescan change and initiate a separate package version bump and publish, even though the standalone package's shipped code is unchanged. Move these test-only edits into a non-releasing test: commit so the cache fix releases only the root package.

AGENTS.md reference: packages/modelaudit-picklescan/AGENTS.md:L69-L75

Useful? React with 👍 / 👎.

Copilot AI review requested due to automatic review settings July 26, 2026 22:13
@mldangelo-oai

Copy link
Copy Markdown
Contributor Author

@codex review

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Comment on lines +109 to +117
for workflow, job_name in (
(_load_release_workflow(), "build-picklescan-package"),
(python_workflow, "picklescan-package"),
):
for step in _job_steps(workflow, job_name):
run = step.get("run", "")
if "ruff check" in run or "ruff format" in run:
assert expected_requirement in run

Comment thread modelaudit/cache/scan_results_cache.py Outdated
Comment on lines +2081 to +2084
with self._change_clock_probe_lock:
for probe, _directory in self._change_clock_probes.values():
probe.close()
self._change_clock_probes.clear()

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6e09366cd6

ℹ️ 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".

- name: Lint standalone package with Ruff
run: |
uv run --with ruff ruff check src tests
uv run --with 'ruff==0.15.10' ruff check src tests

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Pin the documented standalone Ruff commands

uv help run describes --with as layering the requested package into a separate ephemeral environment. On a fresh package checkout, however, the required standalone commands remain uv 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 and docs/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 👍 / 👎.

@codecov-commenter

codecov-commenter commented Jul 26, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 85.71429% with 21 lines in your changes missing coverage. Please review.
✅ Project coverage is 76.29%. Comparing base (89125b5) to head (242335c).

Files with missing lines Patch % Lines
modelaudit/cache/scan_results_cache.py 85.10% 13 Missing and 8 partials ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1782      +/-   ##
==========================================
+ Coverage   76.28%   76.29%   +0.01%     
==========================================
  Files         217      217              
  Lines      115280   115403     +123     
  Branches    27124    27151      +27     
==========================================
+ Hits        87938    88049     +111     
- Misses      19970    19979       +9     
- Partials     7372     7375       +3     
Files with missing lines Coverage Δ
modelaudit/cache/batch_operations.py 71.01% <100.00%> (+1.08%) ⬆️
modelaudit/cache/scan_results_cache.py 73.28% <85.10%> (+1.68%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI review requested due to automatic review settings July 27, 2026 06:02
@mldangelo-oai

Copy link
Copy Markdown
Contributor Author

@codex review

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.

Comments suppressed due to low confidence (1)

tests/cache/test_cache_correctness.py:269

  • This branch checks for system_temp_ancestor, but the parametrization for unsafe_location in this test only supplies system_temp_parent and system_temp_descendant. The system_temp_ancestor path is unreachable and makes the test harder to reason about.
        if unsafe_location == "system_temp_parent":
            system_temp = scanned_directory
        elif unsafe_location == "system_temp_ancestor":
            system_temp = tmp_path
        else:

Comment on lines +9092 to +9097
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 +254 to +260
if unsafe_location.startswith("cache_"):
if unsafe_location == "cache_parent":
cache_directory = scanned_directory
elif unsafe_location == "cache_ancestor":
cache_directory = tmp_path
else:
cache_directory = scanned_directory / ".scan-cache"
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

Reviewed commit: 242335c017

ℹ️ 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".

try:
identity = cache.capture_file_identity(str(file_path))
cache.release_ancestor_identity(identity[-1])
except BaseException as exc:
clear_started.set()
try:
cache.clear_cache()
except BaseException as exc:
@mldangelo-oai
mldangelo-oai merged commit 47f94ee into main Jul 27, 2026
51 checks passed
@mldangelo-oai
mldangelo-oai deleted the fix/windows-nightly-cache-probe-isolation branch July 27, 2026 06:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants