gate

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package gate runs a gate: a list of checks, each a command whose result is read against thresholds decided in advance (docs/spec/gates.md). No model is ever asked whether to pass.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(repo, name string) *verdict.Verdict

Run runs every check and returns the gate's verdict. A check that could not run, or whose output cannot be read, fails the gate unless marked optional.

Types

type Check

type Check struct {
	ID       string         `yaml:"id"`
	Run      string         `yaml:"run"`
	Output   string         `yaml:"output"` // exit | sarif
	Max      map[string]int `yaml:"max"`    // per SARIF level: error, warning, note
	Optional bool           `yaml:"optional"`
	Timeout  string         `yaml:"timeout"` // e.g. "10m"; default 10 minutes
}

Check is one command of a gate.

type Gate

type Gate struct {
	Criteria string            `yaml:"criteria"`
	Checks   []Check           `yaml:"checks"`
	Enforce  map[string]string `yaml:"enforce"`
}

Gate is one named gate.

func Load

func Load(repo, name string) (*Gate, error)

Load reads the gates declared in <repo>/.workline/config.yaml.

func (*Gate) Validate

func (g *Gate) Validate() []verdict.Finding

Validate refuses a gate whose verdict would be decided while reading the results: every counted output needs its thresholds up front.

Jump to

Keyboard shortcuts

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