Documentation
¶
Overview ¶
Package execution is the pure event-sourced domain core for one execution's lifecycle (init → phase → per-stack ticks → terminal). It follows the Decider pattern: Decide emits Events, Evolve folds them into a State. No I/O, no store imports — a pure leaf package, mirroring internal/claims. The aggregate is scoped per execution id (stream "run:<execID>"); it carries NO gate state (the gate lives in the (pr,env) aggregate in internal/reconcile).
Index ¶
- func MarshalEvent(e Event) (string, []byte, error)
- func MarshalSnapshot(s State) ([]byte, error)
- type Edge
- type Event
- type Failed
- type PhaseChanged
- type ReportAnnotate
- type ReportFail
- type ReportInit
- type ReportPhase
- type ReportSucceed
- type ReportSupersede
- type ReportTick
- type Signal
- type Stack
- type StackStatusChanged
- type StacksAnnotated
- type Started
- type State
- type Succeeded
- type Superseded
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MarshalEvent ¶
MarshalEvent serializes a domain Event to a neutral (typeTag, JSON) pair. The tag is the variant's Go type name. Keep this switch and UnmarshalEvent in sync with the Event variants in state.go (the round-trip-every-variant test enforces it).
func MarshalSnapshot ¶
MarshalSnapshot serializes a folded State to JSON.
Types ¶
type Event ¶
type Event interface {
// contains filtered or unexported methods
}
Event is a past-tense domain fact produced by Decide and folded by Evolve.
type PhaseChanged ¶
type ReportAnnotate ¶
type ReportAnnotate struct {
Projects map[string]string
Categories map[string][]events.Category
Counts map[string]events.Counts
Moving []string
}
ReportAnnotate annotates stacks with project, categories, counts, and moving state.
type ReportFail ¶
type ReportFail struct{}
ReportFail marks the run terminally failed (fails-open innocent stacks in Evolve).
type ReportInit ¶
type ReportInit struct{ Exec State }
ReportInit registers the execution and its changed subgraph.
type ReportPhase ¶
type ReportPhase struct {
Phase events.Phase
Label string
Pct *int
ID string
PR int
Repo string
SHA string
Environment string
Context string
LogURL string
}
ReportPhase narrates a lifecycle phase transition.
type ReportSupersede ¶
type ReportSupersede struct{ By string }
ReportSupersede marks this execution as superseded by another.
type ReportTick ¶
ReportTick ticks a single stack's runner-told status.
type Signal ¶
type Signal interface {
// contains filtered or unexported methods
}
Signal is the union of everything that can drive an execution's State.
type Stack ¶
type Stack struct {
Path string
Project string
RunStatus events.Status
Detail string
Categories []events.Category
Counts *events.Counts
}
Stack is one node. RunStatus holds ONLY the runner-told status; the gated/safe overlay is derived elsewhere (the (pr,env) gate aggregate's projection).
type StackStatusChanged ¶
type StacksAnnotated ¶
type State ¶
type State struct {
ID string
Repo string
SHA string
LogURL string
PR int
Environment string
Context string
Phase events.Phase
ProgressLabel string
ProgressPct *int
Status string
SupersededBy string
Stacks []Stack
Edges []Edge
}
State is the folded lifecycle of ONE execution.
func Empty ¶
func Empty() State
Empty is the initial state for the fold (an unseen execution stream).
func Evolve ¶
Evolve applies a single domain Event to a State, returning the new state. Total (never panics on any state/event combination), pure, deterministic — the fold half of the Decider pattern.
func UnmarshalSnapshot ¶
UnmarshalSnapshot reverses MarshalSnapshot.
type Superseded ¶
type Superseded struct{ By string }