internal/core/gate
import "github.com/nilstate/scafld/v2/internal/core/gate"
Package gate defines deterministic failure payloads for lifecycle gates.
Functions
func New(cause error, failure Failure) Error
Source: internal/core/gate/failure.go:35
New returns an error that can be matched with errors.Is/As and rendered by automation-facing adapters.
Types
type Error
Source: internal/core/gate/failure.go:28
Error wraps a cause with a deterministic gate failure payload.
type Error struct {
Cause error
Failure Failure
}Fields
Cause errorFailure Failure
func Error) Error() string
Source: internal/core/gate/failure.go:40
Error returns the human-readable cause plus gate reason.
func Unwrap() error
Source: internal/core/gate/failure.go:51
Unwrap exposes the underlying cause for errors.Is.
type Failure
Source: internal/core/gate/failure.go:6
Failure is the machine-readable repair contract for a blocked gate.
type Failure struct {
Gate string `json:"gate"`
Status string `json:"status,omitempty"`
Reason string `json:"reason"`
Evidence []string `json:"evidence,omitempty"`
Expected string `json:"expected,omitempty"`
Actual string `json:"actual,omitempty"`
Blockers []string `json:"blockers,omitempty"`
Next string `json:"next,omitempty"`
RepairAction *RepairAction `json:"repair_action,omitempty"`
}Fields
Gate string`json:"gate"`Status string`json:"status,omitempty"`Reason string`json:"reason"`Evidence []string`json:"evidence,omitempty"`Expected string`json:"expected,omitempty"`Actual string`json:"actual,omitempty"`Blockers []string`json:"blockers,omitempty"`Next string`json:"next,omitempty"`RepairAction *RepairAction`json:"repair_action,omitempty"`
type RepairAction
Source: internal/core/gate/failure.go:20
RepairAction is the machine-readable operator action for salvaging a provider packet that scafld rejected for transport or schema shape.
type RepairAction struct {
ArtifactPath string `json:"artifact_path,omitempty"`
RequiredEdit string `json:"required_edit,omitempty"`
CommandAfterEdit string `json:"command_after_edit,omitempty"`
Fallback string `json:"fallback,omitempty"`
}Fields
ArtifactPath string`json:"artifact_path,omitempty"`RequiredEdit string`json:"required_edit,omitempty"`CommandAfterEdit string`json:"command_after_edit,omitempty"`Fallback string`json:"fallback,omitempty"`
