Sverka
Reference

Findings normalization

Sverka normalizes output from any analysis tool into a single `Finding[]` model. Source: `packages/verification/src/findings/`.

Sverka normalizes output from any analysis tool into a single Finding[] model. Source: packages/verification/src/findings/.

Finding model

Every finding has:

FieldTypeDescription
idstring{checkId}:{fingerprint}
fingerprintstringSHA-256 of checkId|rule|file|lines
checkIdstringCheck that produced the finding
severitySeverityinfo, low, medium, high, critical
confidencenumber0.0–1.0 (default 0.5 for SARIF)
messagestringHuman-readable description
rulestringRule ID from the originating tool
filestringPath relative to project root
startLinenumberStart line (1-based)
endLinenumberEnd line (1-based, inclusive)
sourceFindingSourceTool name, version, format

normalizeSarif(sarif, context)

Convert SARIF 2.1.0 output to Finding[].

import { normalizeSarif } from "@sverka/sdk";

const findings = normalizeSarif(sarifLog, {
  root: "/path/to/project",
  checkIdPrefix: "eslint",
  defaultConfidence: 0.5,
});

The normalizer:

  • Resolves rule IDs (via ruleId or ruleIndex).
  • Maps SARIF severity levels to Sverka's Severity enum.
  • Resolves file paths relative to the project root.
  • Computes fingerprints for each finding.

computeFingerprint(input)

Deterministic SHA-256 fingerprint. Insensitive to message wording and severity changes; sensitive to file, rule, and line range.

import { computeFingerprint } from "@sverka/sdk";

const fp = computeFingerprint({
  checkId: "eslint",
  rule: "no-unused-vars",
  file: "src/index.ts",
  startLine: 10,
  endLine: 10,
});

Returns a lowercase hex string.

Baselines

Baselines track known findings so only new ones are reported.

createBaseline(findings)

Create a baseline from a set of findings.

import { createBaseline } from "@sverka/sdk";

const baseline = createBaseline(findings);

updateBaseline(findings, baseline)

Update an existing baseline with new findings.

loadBaseline(path)

Load a baseline from a JSON file.

saveBaseline(baseline, path)

Save a baseline to a JSON file.

filterOnlyNew(findings, baseline)

Filter findings to only those not in the baseline.

import { filterOnlyNew } from "@sverka/sdk";

const newFindings = filterOnlyNew(allFindings, baseline);

A finding is "new" if its fingerprint is not in the baseline's fingerprint set and not suppressed by a suppression entry.

On this page