Module sarif
Expand description
SARIF 2.1.0 emitter for hotspot results — Behavioral SARIF taxonomy (spec §5.4).
Rule CODELORE-HOTSPOT: properties.tags includes “behavioral” and “hotspot”
security-severity proxy: (100 − cognitive_health) / 10
partialFingerprints for stable identity across CI runs.
Constants§
- SARIF_
SCHEMA_ URL - SARIF 2.1.0 JSON schema URL. All emitters (including the diff emitter
in
codelore-cli) reference this constant so that a future URL change only needs to be made in one place. - TOOL_
INFO_ URI - Canonical project homepage. Surfaces in every SARIF report’s
tool.driver.informationUri— GitHub Code Scanning links the driver name in the tool-details panel here. Shared with the diff SARIF emitter viacodelore_lib::output::sarif::TOOL_INFO_URI.
Functions§
- diff_
finding_ hash - The
partialFingerprints.diffFinding/v1value for acodelore diffresult:sha256("<rule>|<path>|<discriminant>"). - evidence_
attachments - Wrap pre-built evidence location objects into the two SARIF attachment
shapes GitHub reads:
codeFlows(each location wrapped in{"location": …}inside a single threadFlow) andrelatedLocations(the plain location array). Returns(codeFlows, relatedLocations). - evidence_
location - Build one evidence-commit location object: a
physicalLocationwhoseartifactLocation.uriis the percent-encodedpath(leading/trimmed, per RFC 3986 §4.1 so Code Scanning accepts the URI), plus the caller’smessage. Whenwith_regionis set the location carriesregion.startLine = 1— the diff emitter anchors evidence at line 1 because it has no per-commit line span; the check emitter omits the region entirely. - primary_
location_ line_ hash - The
partialFingerprints.primaryLocationLineHashvalue for a finding atpathunderrepo_root:sha256("<repo_root>|<path>"). - write_
check_ sarif - Emit a SARIF 2.1.0 document for quality-gate violations to
w. - write_
clone_ coupling_ sarif - Emit a SARIF 2.1.0 document for live clone-coupling findings.
- write_
clones_ sarif - Emit a SARIF 2.1.0 document for clone families to
w. - write_
hotspots_ sarif - Emit a SARIF 2.1.0 document for
rowstow.