Skip to content

test: cover archive primitive detection#1489

Open
mldangelo-oai wants to merge 2 commits into
mainfrom
mdangelo/codex/fix-archive-torchserve-primitives-c197
Open

test: cover archive primitive detection#1489
mldangelo-oai wants to merge 2 commits into
mainfrom
mdangelo/codex/fix-archive-torchserve-primitives-c197

Conversation

@mldangelo-oai
Copy link
Copy Markdown
Contributor

Summary

  • add TorchServe handler regression coverage for direct/imported ctypes and webbrowser primitives plus shadowed negatives
  • add generic ZIP Python-member regression coverage for direct/imported ctypes and webbrowser primitives plus shadowed negatives
  • rerun exact C197 probes to confirm ctypes, webbrowser, runpy, fallback MAR, and ZIP paths now fail with S108/S109/S110 checks

Validation

  • PYTHONPATH=/private/tmp/modelaudit-c197 PROMPTFOO_DISABLE_TELEMETRY=1 /Users/mdangelo/code/modelaudit/.venv/bin/pytest tests/scanners/test_torchserve_mar_scanner.py::test_scan_detects_handler_execution_primitive tests/scanners/test_torchserve_mar_scanner.py::test_scan_allows_shadowed_direct_handler_primitives tests/scanners/test_zip_scanner.py::test_scan_zip_flags_direct_imported_python_member_primitives tests/scanners/test_zip_scanner.py::test_scan_zip_allows_shadowed_direct_python_member_primitives -q: 27 passed
  • PYTHONPATH=/private/tmp/modelaudit-c197 PROMPTFOO_DISABLE_TELEMETRY=1 /Users/mdangelo/code/modelaudit/.venv/bin/pytest tests/scanners/test_torchserve_mar_scanner.py tests/scanners/test_zip_scanner.py -q: 591 passed, 13 warnings
  • ruff check modelaudit/scanners/torchserve_mar_scanner.py modelaudit/scanners/archive_member_security.py tests/scanners/test_torchserve_mar_scanner.py tests/scanners/test_zip_scanner.py
  • ruff format --check modelaudit/scanners/torchserve_mar_scanner.py modelaudit/scanners/archive_member_security.py tests/scanners/test_torchserve_mar_scanner.py tests/scanners/test_zip_scanner.py
  • mypy modelaudit/scanners/torchserve_mar_scanner.py modelaudit/scanners/archive_member_security.py tests/scanners/test_torchserve_mar_scanner.py tests/scanners/test_zip_scanner.py
  • git diff --check

@mldangelo-oai
Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown

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

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

@mldangelo-oai mldangelo-oai marked this pull request as ready for review May 31, 2026 13:44
Copy link
Copy Markdown
Contributor

@ianw-oai ianw-oai left a comment

Choose a reason for hiding this comment

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

Looks good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants