phase

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package phase provides phase constants and state machine logic for the Effectiveness Monitor. Phase constants are re-exported from the API package (api/effectivenessassessment/v1alpha1) for internal EM convenience and provides state machine logic (IsTerminal, CanTransition, Validate).

Per Viceversa Pattern: API defines constants, this package re-exports + adds state machine.

Business Requirements: - BR-EM-005: Phase state transitions (Pending -> Stabilizing -> Assessing -> Completed/Failed)

Index

Constants

View Source
const (
	// Pending - EA created by RO, EM has not reconciled yet.
	Pending = eav1.PhasePending
	// WaitingForPropagation - EM is waiting for async change to propagate
	// (GitOps sync, operator reconciliation) before computing hash.
	// Reference: DD-EM-004 v2.0, BR-EM-010.3, Issue #253
	WaitingForPropagation = eav1.PhaseWaitingForPropagation
	// Stabilizing - EM is waiting for stabilization window to elapse.
	Stabilizing = eav1.PhaseStabilizing
	// Assessing - EM is actively performing assessment checks.
	Assessing = eav1.PhaseAssessing
	// Completed - All assessment checks finished (or validity expired).
	Completed = eav1.PhaseCompleted
	// Failed - Assessment could not be performed.
	Failed = eav1.PhaseFailed
)

Re-export API constants for internal EM convenience. External consumers should import from api/effectivenessassessment/v1alpha1 directly.

Variables

ValidTransitions defines the state machine for EA phases. Key: current phase, Value: list of valid target phases.

Functions

func CanTransition

func CanTransition(current, target Phase) bool

CanTransition checks if transition from current to target is valid.

func IsTerminal

func IsTerminal(p Phase) bool

IsTerminal returns true if the phase is a terminal state.

func Validate

func Validate(p Phase) error

Validate checks if a phase value is valid.

Types

type Phase

type Phase = string

Phase is an alias for the API-exported phase type. This allows internal EM code to use `phase.Phase` for convenience.

Single Source of Truth: api/effectivenessassessment/v1alpha1

Jump to

Keyboard shortcuts

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