You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add review_sarif to export review findings as SARIF 2.1.0 #103
Add a review_sarif(outcome, organization_id) helper in proofline to export a ReviewOutcome into a standard SARIF 2.1.0 document, matching the CLI's --sarif format.
Motivation
Teams running Proofline in Python-based CI/CD workflows and automated test runners need review findings formatted as SARIF 2.1.0 to upload to GitHub Advanced Security / Code Scanning (code-scanning/sarif), GitLab SAST, or IDE consumers.
Currently, callers must either install and spawn the CLI binary or implement the complex SARIF projection mapping manually (handling verified reviewed head commit validation, code citation locations, partial fingerprints, and execution notifications).
Exposing review_sarif directly in the Python SDK enables callers to write:
Hi @P1Manav
Could you please take a look and let me know if this approach aligns with the intended solution? Thanks
Approach
proofline/sarif.py — Added review_sarif(outcome, organization_id) to export retained pull-request reviews as SARIF 2.1.0. The exporter follows the CLI’s format for verified citation locations, retained fingerprints, and execution notifications. It requires a full reviewed head SHA and rejects outcomes with a recorded head mismatch.
proofline/outcomes.py — Shared CODE assessment validation and gap detection with the exporter so SARIF can report CODE gaps alongside completed environment assessments.
proofline/init.py and README.md — Exposed review_sarif as a public import and documented how to write the report to a file.
Verification
Added regression tests in tests/test_sarif.py covering verified citation locations, fingerprint handling, incomplete and timed-out reviews, and head validation. Sample reports passed validation against the OASIS SARIF 2.1.0 schema.
Ran python3 scripts/check.py in a temporary LF checkout. All 222 tests passed, along with linting, formatting, type checks, contract checks, and wheel and source install checks.
Hi @arshian11, sorry for the confusion, I had opened #104 for this on Nov 24 but forgot to link it to the issue. I've linked it now. Your approach looks good too. Happy for the maintainers to review both and go with whichever fits best.
Activity
arshian11 commentedon Nov 25, 2026
Hi @P1Manav
Could you please take a look and let me know if this approach aligns with the intended solution? Thanks
Approach
proofline/sarif.py — Added review_sarif(outcome, organization_id) to export retained pull-request reviews as SARIF 2.1.0. The exporter follows the CLI’s format for verified citation locations, retained fingerprints, and execution notifications. It requires a full reviewed head SHA and rejects outcomes with a recorded head mismatch.
proofline/outcomes.py — Shared CODE assessment validation and gap detection with the exporter so SARIF can report CODE gaps alongside completed environment assessments.
proofline/init.py and README.md — Exposed review_sarif as a public import and documented how to write the report to a file.
Verification
Added regression tests in tests/test_sarif.py covering verified citation locations, fingerprint handling, incomplete and timed-out reviews, and head validation. Sample reports passed validation against the OASIS SARIF 2.1.0 schema.
Ran python3 scripts/check.py in a temporary LF checkout. All 222 tests passed, along with linting, formatting, type checks, contract checks, and wheel and source install checks.
P1Manav commentedon Nov 26, 2026
Hi @arshian11, sorry for the confusion, I had opened #104 for this on Nov 24 but forgot to link it to the issue. I've linked it now. Your approach looks good too. Happy for the maintainers to review both and go with whichever fits best.
arshian11 commentedon Nov 26, 2026
@P1Manav No worries, thanks for clarifying!