Skip to content

fix(tests): preserve fail-closed Joblib source stability - #1811

Open
mldangelo-oai wants to merge 1 commit into
mainfrom
fix/joblib-windows-source-stability-ci
Open

fix(tests): preserve fail-closed Joblib source stability#1811
mldangelo-oai wants to merge 1 commit into
mainfrom
fix/joblib-windows-source-stability-ci

Conversation

@mldangelo-oai

Copy link
Copy Markdown
Contributor

Summary

  • Fix the current-main Windows Nightly failure in test_scan_accepts_security_like_bytes_inside_numpy_array without changing production scanner behavior or weakening fail-closed handling.
  • Exercise each benign security-like NumPy byte payload with both stable source snapshots and deterministic call-graph source instability.
  • Accept an unsuccessful scan only when it is explicitly inconclusive, records call_graph_analysis_error / python_call_graph_source_stability, does not trust the incomplete tail, and still contains no warning or critical findings.

Regression evidence

Validation

  • Focused Joblib / pickle scanner suite: 474 passed.
  • Repository-wide Ruff lint: clean.
  • Repository-wide Ruff formatting: 424 files already formatted.
  • Changed-file mypy: clean.
  • Full local mypy reports 14 existing errors across six unrelated files; the changed test has no type errors.
  • Separate dependency-audit failures on current main are already fixed by fix(deps): audit all CI extras and upgrade vulnerable packages #1808, whose Dependency Audit check is green.

@mldangelo-oai

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Security review completed. No security issues were found in this pull request.

Reviewed commit: b227b84529

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@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: b227b84529

ℹ️ 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 on lines +1366 to +1370
assert any(
issue.details.get("category") == "call_graph_analysis_error"
and issue.details.get("analysis") == "python_call_graph_source_stability"
and issue.details.get("analysis_incomplete") is True
for issue in result.issues

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Assert the fail-closed diagnostic message

In the deterministic changed-source cases, this assertion verifies only the issue details, so the test would still pass if the adapter emitted an empty or misleading operational message. Assert the expected source-stability diagnostic on the matching issue as part of the fail-closed contract.

AGENTS.md reference: AGENTS.md:L137-L137

Useful? React with 👍 / 👎.

and issue.details.get("analysis_incomplete") is True
for issue in result.issues
)
assert not any(issue.severity in {IssueSeverity.WARNING, IssueSeverity.CRITICAL} for issue in result.issues)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Reject critical checks in the fail-closed cases

When source_snapshot_changes is true, an unsuccessful result is expected, but this final assertion inspects only result.issues; a false-positive warning or critical failed entry in result.checks would therefore pass unnoticed. Check both collections, including CheckStatus.FAILED, so the benign payload regression verifies finding precedence across the complete scan result.

AGENTS.md reference: AGENTS.md:L137-L137

Useful? React with 👍 / 👎.

Comment on lines +1358 to +1360
if result.success:
assert source_snapshot_changes is False
assert result.metadata["trusted_incomplete_tail"] is 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.

P1 Badge Preserve a deterministic successful control

When source_snapshot_changes is false, this branch still accepts an inconclusive source-stability failure, so a regression that makes every benign security-like NumPy payload fail with that error would leave all eight cases green. Keep a deterministic stable-source control—such as forcing the stability check to succeed—and require result.success is True there, while retaining the separate injected-change cases for fail-closed coverage.

AGENTS.md reference: AGENTS.md:L115-L117

Useful? React with 👍 / 👎.

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.

1 participant