engine

package
v0.1.0 Latest Latest
Warning

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

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

Documentation

Overview

Package engine orchestrates gate execution and applies diff scoping. It's the layer that turns per-gate results into the top-level Verdict a report formatter renders.

Index

Constants

View Source
const SchemaVersion = "gauntlet/v1"

SchemaVersion is the stable identifier stamped into every JSON verdict. Bump when the JSON schema gains a breaking change; goldens then update.

Variables

This section is empty.

Functions

func Run

func Run(ctx context.Context, opt Options) (domain.Verdict, error)

Run executes every gate in Options.GateNames sequentially, collects results, applies scoping, and returns the Verdict. Errors returned are engine-level (unknown gate, cancelled context) — a gate that ran and produced findings or ran and failed is reflected in the Verdict, not the error.

Types

type Options

type Options struct {
	Root       string   // absolute path to repo root
	GateNames  []string // in run order; each must be registered
	Scope      gitdiff.Scope
	ScopeLabel string // "staged" | "since:main" | "whole-tree"
	// FailFast stops the engine on the first gate that reports FAIL.
	// Remaining gates emit GateResult{Status: GateSkip, SkipReason: "fail-fast"}
	// so nothing is silently dropped from the verdict.
	FailFast bool
}

Options controls one engine run. Zero-value is invalid (Root must be set).

Jump to

Keyboard shortcuts

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