Documentation
¶
Overview ¶
Package workflowprogress defines and enforces the bounded progress contract shared by MVM execution profiles. Progress is presentation metadata only; it does not create work, dependencies, or scheduling barriers.
Index ¶
- Constants
- func ValidateEvent(event Event) error
- type Custom
- type Emitter
- func (emitter *Emitter) Event(ctx context.Context, name string, data map[string]any) error
- func (emitter *Emitter) Item(ctx context.Context, identifier, phaseID, title, state string) error
- func (emitter *Emitter) Log(ctx context.Context, level, message string) error
- func (emitter *Emitter) Phase(ctx context.Context, identifier, title, state string) error
- type Event
- type Item
- type Kind
- type Log
- type Phase
- type Sink
- type State
Constants ¶
View Source
const ( // ContractVersion identifies the serialized progress envelope contract. ContractVersion = 1 // MaxEvents bounds accepted progress updates in one evaluation. MaxEvents = 256 // MaxIDBytes bounds phase/item identifiers. MaxIDBytes = 128 // MaxTextBytes bounds titles, event names, log messages, and levels. MaxTextBytes = 4096 // MaxDataBytes bounds the encoded custom event data object. MaxDataBytes = 16 << 10 )
Variables ¶
This section is empty.
Functions ¶
func ValidateEvent ¶
ValidateEvent validates an envelope received from an isolated worker.
Types ¶
type Emitter ¶
type Emitter struct {
// contains filtered or unexported fields
}
Emitter owns validation, transition state, and sequence allocation for one evaluation.
func New ¶
New returns an evaluation-scoped progress emitter. A nil sink validates and tracks state while discarding delivery.
type Event ¶
type Event struct {
Phase *Phase `json:"phase,omitempty"`
Item *Item `json:"item,omitempty"`
Custom *Custom `json:"event,omitempty"`
Log *Log `json:"log,omitempty"`
Kind Kind `json:"kind"`
Version int `json:"version"`
Sequence uint64 `json:"sequence"`
}
Event is the versioned, ordered progress envelope. Exactly one typed body is set.
type Item ¶
type Item struct {
ID string `json:"id"`
PhaseID string `json:"phase_id,omitempty"`
Title string `json:"title"`
State State `json:"state"`
}
Item is an item snapshot. PhaseID may be empty when no phase was declared.
Click to show internal directories.
Click to hide internal directories.