applyoutcome

package
v0.41.0 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

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

func AuthorityRetryAfter(text string) (time.Time, bool)

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

func Recognized(text string) bool

Recognized reports whether Classify produced a closed class for this text.

func Remediation

func Remediation(class Class) []string

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.

func Retryable

func Retryable(class Class) bool

Retryable reports whether the declared class can succeed on a retry once its condition is addressed.

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"
	ClassSecretUnavailable      Class = "secret_unavailable"
	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"
)

func Classes

func Classes() []Class

Classes returns every closed class in a stable order. It exists so the rollout event schema and documentation can be checked against one source.

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.

Jump to

Keyboard shortcuts

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