Skip to content

fix: parse ABACUS binary options safely - #1949

Open
njzjz-bot wants to merge 1 commit into
masterfrom
codex/fix-1892-abacus-safe-values
Open

fix: parse ABACUS binary options safely#1949
njzjz-bot wants to merge 1 commit into
masterfrom
codex/fix-1892-abacus-safe-values

Conversation

@njzjz-bot

Copy link
Copy Markdown
Collaborator

Summary

  • Replace Python eval() with an explicit parser for ABACUS 0/1 and boolean-style values.
  • Reuse the safe parser for SCF input generation and init relax/MD gamma_only handling.
  • Reject arbitrary expressions with a field-specific error.
  • Add a regression test proving a Python payload is not executed.

Tests

  • python -m unittest tests.generator.test_abacus_safe_values -v
  • ruff check dpgen/generator/lib/abacus_scf.py dpgen/data/gen.py tests/generator/test_abacus_safe_values.py
  • ruff format --check dpgen/generator/lib/abacus_scf.py dpgen/data/gen.py tests/generator/test_abacus_safe_values.py
  • Confirmed no eval( calls remain in the affected ABACUS paths.

Fixes #1892

Coding agent: Codex
Codex version: codex-cli 0.149.0
Model: gpt-5.6-sol
Reasoning effort: xhigh

Fixes #1892

Coding-Agent: Codex

Codex-Version: codex-cli 0.149.0

Model: gpt-5.6-sol

Reasoning-Effort: xhigh
@coderabbitai

coderabbitai Bot commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

Next included review available in 24 minutes.

View limit details

Limit details: You’ve used all 2 included reviews currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: ba1bef74-fa96-45bb-94b0-c4e67e7978bf

📥 Commits

Reviewing files that changed from the base of the PR and between d5ce577 and f822856.

📒 Files selected for processing (3)
  • dpgen/data/gen.py
  • dpgen/generator/lib/abacus_scf.py
  • tests/generator/test_abacus_safe_values.py

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.

@codecov

codecov Bot commented Aug 23, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 88.88889% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 49.80%. Comparing base (d5ce577) to head (f822856).

Files with missing lines Patch % Lines
dpgen/data/gen.py 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1949      +/-   ##
==========================================
- Coverage   49.80%   49.80%   -0.01%     
==========================================
  Files          83       83              
  Lines       14986    14982       -4     
==========================================
- Hits         7464     7462       -2     
+ Misses       7522     7520       -2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

[Code scan] Avoid eval when parsing ABACUS configuration values

1 participant