Documentation
¶
Overview ¶
Package applyoutcome owns the StackKits failure-class taxonomy for local runtime execution.
It classifies bounded process output and error text into one closed class with retry and remediation guidance. The package performs no I/O, owns no redaction, and imports nothing beyond the standard library so that evidence and rollout packages can consume it without an import cycle. Callers bound and redact any text before persisting it alongside a classification.
Index ¶
- func AuthorityRetryAfter(text string) (time.Time, bool)
- func DegradedOnly(err error) bool
- func DegradedUnits(err error) map[string]DegradedUnit
- func Recognized(text string) bool
- func Remediation(class Class) []string
- func Retryable(class Class) bool
- type Class
- type Classification
- type DegradedUnit
- type DegradedUnitError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AuthorityRetryAfter ¶
AuthorityRetryAfter returns the last authority-named retry time in text. Only a complete UTC timestamp is accepted; anything else is no time at all.
func DegradedOnly ¶ added in v0.52.2
DegradedOnly reports whether err consists of degraded units and nothing else. A single failure of any other kind anywhere in the error tree makes it false, so a joined set can never hide a real failure behind a degraded one.
func DegradedUnits ¶ added in v0.52.2
func DegradedUnits(err error) map[string]DegradedUnit
DegradedUnits returns every degraded unit named anywhere in err, keyed by runtime requirement ID.
func Recognized ¶
Recognized reports whether Classify produced a closed class for this text.
func Remediation ¶
Remediation returns the operator guidance declared for a class. It is a direct lookup, not a text match: callers that already know the class must never route its name back through Classify, which reads process output.
Types ¶
type Class ¶
type Class string
Class is the closed StackKits failure-class vocabulary. Values are the wire representation used by rollout evidence and apply outcome reporting; they extend the historical rollout failure classes rather than replacing them.
const ( // ClassUnknown means no matcher recognized the text. It is never a // silent default: callers keep the bounded excerpt so an unmatched // failure remains diagnosable. ClassUnknown Class = "unknown_failure" ClassOOMKilled Class = "oom_killed" ClassDiskFull Class = "disk_full" ClassImageArchMismatch Class = "image_arch_mismatch" ClassRegistryRateLimited Class = "registry_rate_limited" ClassACMERateLimited Class = "acme_rate_limited" ClassRegistryUnreachable Class = "registry_unreachable" ClassImagePullDenied Class = "image_pull_denied" ClassImageNotFound Class = "image_not_found" ClassPortConflict Class = "port_conflict" ClassDependencyUnhealthy Class = "dependency_unhealthy" ClassHealthTimeout Class = "health_timeout" ClassDockerBridgeFailed Class = "docker_bridge_failed" ClassDockerSocketDenied Class = "docker_socket_denied" ClassDockerDaemonFailed Class = "docker_daemon_failed" ClassDockerMissing Class = "docker_missing" ClassKernelNamespaceBlocked Class = "kernel_namespace_blocked" ClassClockSkew Class = "clock_skew" ClassCancelled Class = "cancelled" // The classes below are preflight conclusions rather than signatures found // in process output: they are measured before Apply mutates anything, so // Classify never produces them from text. ClassHostResourceShortage Class = "host_resource_shortage" ClassHostIncompatible Class = "host_incompatible" ClassCgroupMemoryMissing Class = "cgroup_memory_controller_missing" // ClassOriginCertificateMissing is a degraded-completion conclusion, not a // text signature, so Classify never produces it: a managed kombify.me // route runs in origin-certificate mode (ADR-0047) while no installed // Cloudflare Origin CA certificate covers it. Only a typed // DegradedUnitError carries it. ClassOriginCertificateMissing Class = "origin_certificate_missing" )
type Classification ¶
type Classification struct {
Class Class
Retryable bool
Transient bool
Remediation []string
RetryAfter time.Time
}
Classification is the closed result of classifying one failure text.
Retryable states whether repeating the same operation can succeed once the named condition is addressed. Transient additionally states that the condition may clear on its own, which is the only case an automatic retry may act on. RetryAfter is the earliest time an external authority named for that retry; it is zero when the authority named none, and a retry before it cannot succeed.
func Classify ¶
func Classify(text string) Classification
Classify recognizes the failure signature in bounded process output or error text. An unmatched text returns ClassUnknown, never a guessed class: the caller keeps its bounded excerpt so the failure stays diagnosable.
The input is matched case-insensitively and is never retained.
type DegradedUnit ¶ added in v0.52.2
DegradedUnit is the per-unit account of one degraded completion.
type DegradedUnitError ¶ added in v0.52.2
DegradedUnitError is a runtime unit that did not reach its postcondition only because a prerequisite another authority delivers later is not yet on the node. Nothing else in the rollout depends on that postcondition, so the unit does not stop the rollout: it is reported degraded with a closed, retryable class while every other unit is still attempted.
It is never inferred from text. Only an owner that proves the exact missing prerequisite returns it; every other failure keeps its criticality.
func (*DegradedUnitError) Error ¶ added in v0.52.2
func (e *DegradedUnitError) Error() string
func (*DegradedUnitError) Unwrap ¶ added in v0.52.2
func (e *DegradedUnitError) Unwrap() error