Problem
SARIF results currently carry evidence, mutation, and link references only as opaque IDs inside properties (evidence_ids, mutation_ids, ...), so GitHub code scanning and other SARIF viewers show a single location with no navigable pointers to the guard/mutation sites that justify the finding — reviewers must cross-reference the JSON report by hand. There is also no suppressions support, so acknowledged findings can't participate in standard SARIF suppression workflows.
(Note: stable partialFingerprints already exist — authmapStable et al. with a line-move stability test — so that part of SARIF fidelity is done.)
Current behavior
coverage_result in crates/authmap-report/src/lib.rs (~line 2659) builds each result with ruleId, message, partialFingerprints, properties (ID lists), and a single locations entry from coverage_location. No relatedLocations, no suppressions.
- The
ReportIndex already resolves evidence/mutation/link IDs to their records (spans included) for Markdown rendering — the data needed for relatedLocations is on hand at render time.
Proposed implementation
relatedLocations
- For each result, resolve
evidence_ids, weak_evidence_ids, and mutation_ids through the existing ReportIndex and emit relatedLocations[] entries reusing sarif_location(span), each with a message.text describing the relationship ("authorization evidence: @login_required", "linked mutation: prisma.user.update"). Cap the list (e.g. 10 per result) to keep SARIF size bounded on link-heavy routes; note truncation in properties.
- Viewers (GitHub code scanning) render these as navigable "related locations" — direct review UX win with no schema risk.
suppressions
- When the per-route suppression config (companion config issue) marks a finding suppressed, emit SARIF
suppressions: [{ "kind": "external", "status": "accepted", "justification": "<reason>" }] on the result instead of dropping it. GitHub code scanning treats suppressed results per SARIF semantics, keeping alert history consistent instead of open/close churn.
- If the config issue lands later, this issue can still land the plumbing behind an internal flag with tests, activated when suppressions exist.
Acceptance criteria
References
crates/authmap-report/src/lib.rs (coverage_result ~2659, sarif_location, ReportIndex)
- SARIF 2.1.0 spec:
relatedLocations, suppressions
- Companion: per-route suppressions config issue
Problem
SARIF results currently carry evidence, mutation, and link references only as opaque IDs inside
properties(evidence_ids,mutation_ids, ...), so GitHub code scanning and other SARIF viewers show a single location with no navigable pointers to the guard/mutation sites that justify the finding — reviewers must cross-reference the JSON report by hand. There is also nosuppressionssupport, so acknowledged findings can't participate in standard SARIF suppression workflows.(Note: stable
partialFingerprintsalready exist —authmapStableet al. with a line-move stability test — so that part of SARIF fidelity is done.)Current behavior
coverage_resultincrates/authmap-report/src/lib.rs(~line 2659) builds each result withruleId,message,partialFingerprints,properties(ID lists), and a singlelocationsentry fromcoverage_location. NorelatedLocations, nosuppressions.ReportIndexalready resolves evidence/mutation/link IDs to their records (spans included) for Markdown rendering — the data needed forrelatedLocationsis on hand at render time.Proposed implementation
relatedLocationsevidence_ids,weak_evidence_ids, andmutation_idsthrough the existingReportIndexand emitrelatedLocations[]entries reusingsarif_location(span), each with amessage.textdescribing the relationship ("authorization evidence: @login_required", "linked mutation: prisma.user.update"). Cap the list (e.g. 10 per result) to keep SARIF size bounded on link-heavy routes; note truncation inproperties.suppressionssuppressions: [{ "kind": "external", "status": "accepted", "justification": "<reason>" }]on the result instead of dropping it. GitHub code scanning treats suppressed results per SARIF semantics, keeping alert history consistent instead of open/close churn.Acceptance criteria
relatedLocationswith correct URIs/regions and human-readable messages; cap + truncation behavior tested.suppressions[]with the justification; unsuppressed results emit none (absent key, not empty array — match SARIF 2.1.0 expectations).authmap-report).docs/GITHUB_ACTION.md/docs/USAGE.mdSARIF notes updated; CHANGELOG entry.References
crates/authmap-report/src/lib.rs(coverage_result~2659,sarif_location,ReportIndex)relatedLocations,suppressions