gates

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultProfile Profile = "default"

	Error   Severity = "error"
	Warning Severity = "warning"

	Proposal Artifact = "proposal"
	Deltas   Artifact = "deltas"
	Design   Artifact = "design"
	Tasks    Artifact = "tasks"
	State    Artifact = "state"

	PlanningToApproved TransitionID = "planning_to_approved"
)
View Source
const CoreRegistryVersion = "core-v2"

CoreRegistryVersion changes whenever the gate inventory changes, so any approval bound to an older inventory is stale rather than silently reused.

Variables

This section is empty.

Functions

This section is empty.

Types

type Artifact

type Artifact string

type Evaluator

type Evaluator func(Snapshot) []Issue

type Finding

type Finding struct {
	Gate     GateID
	Severity Severity
	Location plan.Location
	Problem  string
	Repair   string
}

func Production

func Production(snapshot Snapshot, required []evidence.RequiredCheck) []Finding

Production evaluates the production-only planning rules over the canonical planning projection. It is additive by construction: it never runs, replaces, or suppresses a core gate, and the caller keeps evaluating the core registry exactly as the default profile does. It is pure: no filesystem, clock, network, or LLM access.

type Gate

type Gate struct {
	ID          GateID
	Description string
	Transition  TransitionID
	Profile     Profile
	Artifacts   []Artifact
	Severity    Severity
	Evaluate    Evaluator
}

type GateID

type GateID string
const (
	ProductionPolicyGate     GateID = "production_policy"
	ProductionDesignGate     GateID = "production_design"
	ProductionTraceGate      GateID = "production_trace"
	ProductionAcceptanceGate GateID = "production_acceptance"
	ProductionCheckGate      GateID = "production_checks"
)
const (
	ProposalGate             GateID = "proposal"
	DeltaGate                GateID = "deltas"
	DesignGate               GateID = "design"
	TaskGate                 GateID = "tasks"
	TraceGate                GateID = "trace"
	VerificationGate         GateID = "verification"
	ApprovalPrerequisiteGate GateID = "approval_prerequisite"
	LifecycleGate            GateID = "lifecycle"
	RegistryGate             GateID = "gate_registry"
)

type Issue

type Issue struct {
	Location plan.Location
	Problem  string
	Repair   string
}

type Profile

type Profile string

type Registry

type Registry struct {
	// contains filtered or unexported fields
}

func CoreRegistry

func CoreRegistry(evaluators map[GateID]Evaluator) (Registry, error)

func PlanningRegistry

func PlanningRegistry() (Registry, error)

func (Registry) Evaluate

func (registry Registry) Evaluate(snapshot Snapshot) []Finding

func (Registry) Gates

func (registry Registry) Gates() []Gate

func (Registry) Version

func (registry Registry) Version() string

type Severity

type Severity string

type Snapshot

type Snapshot struct {
	Plan            plan.Change
	Lifecycle       string
	StateRevision   uint64
	Transition      TransitionID
	RegistryVersion string
	PolicyDigest    string
}

Snapshot contains values assembled before gate evaluation. It deliberately exposes no filesystem, clock, mutation, network, or LLM capability.

type Transition

type Transition struct {
	ID      TransitionID
	GateIDs []GateID
}

type TransitionID

type TransitionID string

Jump to

Keyboard shortcuts

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