import type { BrandReviewScore } from "../api/types.js"; import { type ReviewOutcome } from "./outcomes.js"; /** * Minimal SARIF 2.1.0 representation for a batch brand review. * GitHub's SARIF uploader (`github/codeql-action/upload-sarif`) tolerates * extra fields and missing optional ones, so the shape here keeps to * the fields that drive PR annotations: `ruleId`, `level`, `message`, * and a `physicalLocation` pointing at the source file. * * Threshold filtering: if `threshold` is provided, only section * results whose score is strictly less than the threshold become * SARIF entries. When unset, scores of 4 and 5 are omitted (well- * aligned content shouldn't fill PRs with noise) — scores 1–3 are * always emitted as findings. * * Per-file errors (API failures) are emitted as a synthetic * `brand/api-error` rule so consumers don't have to cross-reference * the SARIF run with the CLI exit log. */ export interface SarifReport { version: "2.1.0"; $schema: string; runs: SarifRun[]; } interface SarifRun { tool: { driver: SarifDriver; }; results: SarifResult[]; } interface SarifDriver { name: string; version: string; informationUri?: string; rules: SarifRule[]; } interface SarifRule { id: string; shortDescription: { text: string; }; fullDescription?: { text: string; }; help?: { text: string; }; } interface SarifResult { ruleId: string; level: "error" | "warning" | "note"; message: { text: string; }; locations: Array<{ physicalLocation: { artifactLocation: { uri: string; }; }; }>; } export declare const buildSarifReport: (outcomes: readonly ReviewOutcome[], threshold: BrandReviewScore | undefined, driverVersion: string) => SarifReport; export {};