triage

package
v0.9.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 23, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package triage applies deterministic, user-directed suppression to findings AFTER analysis: inline `godzilla:ignore` source directives and a fingerprint baseline file. Both are the recourse a CI gate needs — a legacy codebase can be baselined so only NEW findings block a PR, and a reviewed false positive can be silenced at the source — without disabling a rule globally. Suppressed findings are RETAINED and flagged (analysis.Finding.Suppressed), not deleted, so they stay auditable, mirroring the LLM reviewer's behavior.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyBaseline

func ApplyBaseline(findings []analysis.Finding, baseline []string) []analysis.Finding

ApplyBaseline marks findings whose fingerprint appears in the baseline as suppressed. Fingerprints are matched as a MULTISET: a baseline entry that appears twice suppresses at most two matching findings, so a genuinely new duplicate at the same location still surfaces. Findings are processed in a deterministic order so the choice of which duplicate is suppressed is stable.

func ApplyInlineIgnores

func ApplyInlineIgnores(findings []analysis.Finding) []analysis.Finding

ApplyInlineIgnores marks any finding whose sink line (or the line directly above it) carries a godzilla:ignore directive as suppressed. It returns the same slice with the matched findings flagged. Source files are read at most once each. A finding already suppressed (e.g. by the LLM reviewer) is left as-is.

func LoadBaseline

func LoadBaseline(path string) ([]string, error)

LoadBaseline reads a Baseline document from path and returns its fingerprints.

func WriteBaseline

func WriteBaseline(w io.Writer, findings []analysis.Finding) error

WriteBaseline writes the fingerprints of all non-suppressed findings to w as a Baseline JSON document, sorted for deterministic output.

Types

type Baseline

type Baseline struct {
	Tool         string   `json:"tool"`
	Fingerprints []string `json:"fingerprints"`
}

Baseline is the on-disk baseline document: a list of finding fingerprints (with duplicates) captured from a prior scan.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL