Skip to content

Translate Python CodeQL DIL rules to Ascent - #1

Merged
StarGazerM merged 5 commits into
mainfrom
codex/python-codeql-dil-translation
Jul 29, 2026
Merged

Translate Python CodeQL DIL rules to Ascent#1
StarGazerM merged 5 commits into
mainfrom
codex/python-codeql-dil-translation

Conversation

@StarGazerM

Copy link
Copy Markdown
Owner

Summary

  • add the macro, schema, provider, and extractor-boundary infrastructure needed by the Python CodeQL package
  • represent AST kinds and field positions with Rust ADTs at the input boundary instead of leaking extractor numeric tags into rules
  • restructure the Python implementation into source-aligned Ascent modules and translate the current Unreachable Code and Cyclic Import slices from compiled CodeQL DIL
  • remove approximation-only SQL injection, unused-local, and probe implementations until they can be translated directly
  • document Cyclic Import relation cardinalities and static join-order reasoning

Why

The previous Python implementation mixed numeric extractor encodings, raw Rust plumbing, and approximate query logic. That prevented a line-by-line mapping back to compiled CodeQL DIL and made semantic parity difficult to audit.

Current status

This PR does not claim complete Cyclic Import or full Python CodeQL parity. The canonical points_to closure and the recursive AbsentModule and BoundMethod portions still need direct DIL translation. The incomplete query therefore remains outside the provider registry.

Validation

  • cargo test -p codeql-ascent-python
  • cargo check -p codeql-ascent-python --all-targets
  • cargo fmt --all -- --check
  • git diff --check
  • inspected expanded Ascent SCCs
  • compared the translated subset against CodeQL CLI 2.25.5 DIL/RA output

@StarGazerM
StarGazerM marked this pull request as ready for review July 29, 2026 07:00
@StarGazerM
StarGazerM merged commit 8780bd2 into main Jul 29, 2026
3 checks passed
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