fix(report): preserve full finding metadata in SARIF output (#229)#230
Open
rodboev wants to merge 3 commits into
Open
fix(report): preserve full finding metadata in SARIF output (#229)#230rodboev wants to merge 3 commits into
rodboev wants to merge 3 commits into
Conversation
rng1995
requested changes
Jun 30, 2026
rng1995
left a comment
Collaborator
There was a problem hiding this comment.
Requesting changes because exact finding severity is still lost. SARIF level maps both CRITICAL and HIGH to error, so the new property bag does not yet preserve full finding metadata. Include the original severity for active and suppressed results and add a distinction test.
Signed-off-by: Rod Boev <rod.boev@gmail.com>
Signed-off-by: Rod Boev <rod.boev@gmail.com>
Signed-off-by: Rod Boev <rod.boev@gmail.com>
80e6c6b to
66113ee
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
--format sarifcurrently drops finding metadata that--format jsonalready preserves. This update keeps the original finding severity in the SARIF resultpropertiesbag too, so downstream tooling can still distinguishCRITICALfromHIGHafter SARIF level flattening.Closes #229
Root cause
_build_sarif()builds each result from only the core SARIF fields and a partial properties bag. Even after the earlier metadata work, SARIFlevelstill flattened bothCRITICALandHIGHtoerror, and the originalseverityvalue was never preserved alongside the other finding fields.Diff Notes
SarifResultso the report layer preserves the originalseverityalongside the existing SkillSpector-specific finding metadata in the SARIF-compatiblepropertiesbag.endLine, rule generation, sorting, empty-finding filtering, and suppression markers unchanged.level=errorfor both results.Scope
This change is limited to report and SARIF schema code. It does not change analyzers, JSON output, CLI behavior, transitive scanning, baseline matching, or provider and MCP behavior.
Verification
.\.venv\Scripts\python.exe -m pytest tests/nodes/test_report.py tests/nodes/test_sarif_rules_and_empty_findings.py(63 passed, 1 warning)uv run ruff check src/skillspector/nodes/report.py tests/nodes/test_report.py tests/nodes/test_sarif_rules_and_empty_findings.pyuv run ruff format --check src/skillspector/nodes/report.py tests/nodes/test_report.py tests/nodes/test_sarif_rules_and_empty_findings.py