baseline

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package baseline implements accepted-findings files (.sandtrap.json).

A baseline records the behavioral findings a team has reviewed and accepted (esbuild's postinstall, vue-demi's version switcher…). Scans then fail only on findings NOT in the baseline — which is precisely the signature of a hijacked release: a trusted package suddenly doing something new.

Index

Constants

View Source
const DefaultFile = ".sandtrap.json"

DefaultFile is auto-loaded from the scan directory when present.

Variables

This section is empty.

Functions

func Write

func Write(path string, results []analyzer.Result) error

Write produces a baseline accepting every finding in the given results. Versions are pinned exactly: when the package version changes the finding resurfaces, forcing a fresh review — that is the point.

Types

type Baseline

type Baseline struct {
	Path string
	// contains filtered or unexported fields
}

Baseline is a loaded, parsed accept list.

func Load

func Load(path string) (*Baseline, error)

Load reads and parses a baseline file.

func (*Baseline) Suppress

func (b *Baseline) Suppress(p analyzer.Package, f analyzer.Finding) bool

Suppress reports whether a finding is covered by the baseline.

type File

type File struct {
	Version int      `json:"version"`
	Accept  []string `json:"accept"`
}

File is the on-disk format.

Jump to

Keyboard shortcuts

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