Skip to content

fix: traverse NeMo YAML list configs#919

Merged
mldangelo-oai merged 2 commits intomainfrom
mdangelo/codex/nemo-yaml-boundary-audit
Apr 11, 2026
Merged

fix: traverse NeMo YAML list configs#919
mldangelo-oai merged 2 commits intomainfrom
mdangelo/codex/nemo-yaml-boundary-audit

Conversation

@mldangelo-oai
Copy link
Copy Markdown
Contributor

Summary

  • recursively inspect top-level and nested YAML lists in .nemo configs for Hydra target values
  • mark malformed or scalar YAML config members as scan_outcome=inconclusive instead of clean/no-config
  • preserve security precedence when inconclusive config coverage appears alongside warnings or critical findings

Validation

  • uv run pytest tests/scanners/test_nemo_scanner.py
  • uv run ruff format modelaudit/ packages/modelaudit-picklescan/src packages/modelaudit-picklescan/tests tests/
  • uv run ruff check --fix modelaudit/ packages/modelaudit-picklescan/src packages/modelaudit-picklescan/tests tests/
  • uv run mypy modelaudit/ packages/modelaudit-picklescan/src packages/modelaudit-picklescan/tests tests/
  • uv run pytest -n auto -m "not slow and not integration" --maxfail=1
  • 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/
  • git diff --check

@mldangelo-oai mldangelo-oai enabled auto-merge (squash) April 10, 2026 20:22
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 10, 2026

Warning

Rate limit exceeded

@mldangelo-oai has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 1 minutes and 25 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 1 minutes and 25 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 0761d5dd-ed87-4635-ac8d-0001e61d44c5

📥 Commits

Reviewing files that changed from the base of the PR and between d4ad8d8 and 53b536c.

📒 Files selected for processing (3)
  • CHANGELOG.md
  • modelaudit/scanners/nemo_scanner.py
  • tests/scanners/test_nemo_scanner.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch mdangelo/codex/nemo-yaml-boundary-audit

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 10, 2026

Workflow run and artifacts

Performance Benchmarks

Compared 6 shared benchmarks with a regression threshold of 15%.
Status: 0 regressions, 0 improved, 6 stable, 0 new, 0 missing.
Aggregate shared-benchmark median: 654.83ms -> 652.41ms (-0.4%).

Benchmark Target Size Files Baseline Current Change Status
tests/benchmarks/test_scan_benchmarks.py::test_scan_safe_pickle safe_model.pkl 49.4 KiB 1 26.23ms 27.98ms +6.7% stable
tests/benchmarks/test_scan_benchmarks.py::test_detect_file_format_safe_pickle safe_model.pkl 49.4 KiB 1 159.3us 165.6us +4.0% stable
tests/benchmarks/test_scan_benchmarks.py::test_scan_pytorch_zip state_dict.pt 1.5 MiB 1 32.12ms 31.39ms -2.3% stable
tests/benchmarks/test_scan_benchmarks.py::test_validate_file_type_pytorch_zip state_dict.pt 1.5 MiB 1 46.6us 47.5us +1.8% stable
tests/benchmarks/test_scan_benchmarks.py::test_scan_mixed_directory mixed-corpus 1.7 MiB 54 127.22ms 128.55ms +1.0% stable
tests/benchmarks/test_scan_benchmarks.py::test_scan_duplicate_directory duplicate-corpus 840.0 KiB 81 469.06ms 464.29ms -1.0% stable

…aml-boundary-audit

# Conflicts:
#	CHANGELOG.md
@mldangelo-oai mldangelo-oai merged commit 0d8d4fd into main Apr 11, 2026
25 checks passed
@mldangelo-oai mldangelo-oai deleted the mdangelo/codex/nemo-yaml-boundary-audit branch April 11, 2026 05:54
Copy link
Copy Markdown

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

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: 53b536cdbb

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

if isinstance(config, list):
for index, item in enumerate(config):
if isinstance(item, dict | list):
self._check_hydra_targets(
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 Guard recursive YAML aliases during list traversal

Prevent unbounded recursion when descending YAML lists. PyYAML can materialize self-referential lists via anchors (e.g., &a [*a]), and this recursive call will repeatedly revisit the same object until RecursionError. Because only yaml.YAMLError is handled upstream, a crafted .nemo can abort scanning instead of producing a normal result.

Useful? React with 👍 / 👎.

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.

1 participant