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 ¶
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 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" )
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.