Documentation
¶
Overview ¶
Package domain holds the shared types every layer speaks: findings, gate results, verdicts. Nothing outside stdlib is imported here — this package is the leaf of the import graph.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Finding ¶
type Finding struct {
Gate string `json:"gate"`
Severity Severity `json:"severity"`
File string `json:"file,omitempty"`
Line int `json:"line,omitempty"`
Column int `json:"column,omitempty"`
Rule string `json:"rule,omitempty"`
Message string `json:"message"`
// PreExisting is set by the engine after diff scoping; a raw finding
// from a parser has this false.
PreExisting bool `json:"pre_existing,omitempty"`
// ID is a deterministic synthetic identifier used by
// `gauntlet check --explain <id>`. Set by the engine.
ID string `json:"id,omitempty"`
}
Finding is one discrete quality-gate hit: a lint issue, test failure, build error. File/Line are optional (whole-package findings set Line=0).
type GateResult ¶
type GateResult struct {
Name string `json:"name"`
Status GateStatus `json:"status"`
Findings []Finding `json:"findings,omitempty"`
Duration time.Duration `json:"duration_ms"`
SkipReason string `json:"skip_reason,omitempty"`
// LineScoped is true when the gate's findings can be filtered by
// changed line ranges. Test/build findings set this false — a test
// broken by your change can live in an untouched file.
LineScoped bool `json:"-"`
}
GateResult is what a gate returns; whole-run status plus findings.
type GateStatus ¶
type GateStatus int
GateStatus is the outcome of a single gate run.
const ( GateOK GateStatus = iota // ran, no findings GateFail // ran, produced findings GateSkip // did not run (tool missing, disabled by config) )
func (GateStatus) String ¶
func (g GateStatus) String() string
type Severity ¶
type Severity int
Severity ranks how bad a finding is. Higher constant = more severe. Used for stable sorting in reports.
type Verdict ¶
type Verdict struct {
Status GateStatus `json:"status"`
NewFindings []Finding `json:"new_findings"`
PreExisting int `json:"pre_existing_count"`
Gates []GateResult `json:"gates"`
Scope string `json:"scope"` // "staged" | "since:<ref>" | "whole-tree"
SchemaVersion string `json:"schema"`
}
Verdict is the top-level result the engine returns. The verdict line rendered in reports is a direct read of these counters — tests assert them exactly.
func (Verdict) HasNewFindings ¶
HasNewFindings is the definitive "should we FAIL?" check.