v1alpha1

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2026 License: Apache-2.0 Imports: 9 Imported by: 3

Documentation

Overview

Package v1alpha1 contains API Schema definitions for the runs v1alpha1 API group. +kubebuilder:object:generate=true +groupName=runs.bubustack.io

Index

Constants

View Source
const StructuredErrorVersionV1 = "v1"

StructuredErrorVersionV1 is the current version for StepRun.status.error payloads.

Variables

View Source
var (
	// GroupVersion is group version used to register these objects.
	GroupVersion = schema.GroupVersion{Group: "runs.bubustack.io", Version: "v1alpha1"}

	// SchemeBuilder is used to add go types to the GroupVersionKind scheme.
	SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}

	// AddToScheme adds the types in this group-version to the given scheme.
	AddToScheme = SchemeBuilder.AddToScheme
)

Functions

This section is empty.

Types

type DownstreamTarget

type DownstreamTarget struct {
	// GRPCTarget specifies the connection details for the next Engram in the chain.
	// +optional
	GRPCTarget *GRPCTarget `json:"grpc,omitempty"`

	// Terminate indicates that this is the last step in the flow.
	// +optional
	Terminate *TerminateTarget `json:"terminate,omitempty"`
}

DownstreamTarget defines the destination for an Engram's output in real-time execution mode. Exactly one of the fields must be set.

func (*DownstreamTarget) DeepCopy

func (in *DownstreamTarget) DeepCopy() *DownstreamTarget

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DownstreamTarget.

func (*DownstreamTarget) DeepCopyInto

func (in *DownstreamTarget) DeepCopyInto(out *DownstreamTarget)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type EffectClaim added in v0.1.4

type EffectClaim struct {
	metav1.TypeMeta `json:",inline"`

	// metadata is a standard object metadata
	// +optional
	metav1.ObjectMeta `json:"metadata,omitzero"`

	// spec defines the desired state of EffectClaim
	// +required
	Spec EffectClaimSpec `json:"spec"`

	// status defines the observed state of EffectClaim
	// +optional
	Status EffectClaimStatus `json:"status,omitzero"`
}

EffectClaim is the Schema for the effectclaims API.

func (*EffectClaim) DeepCopy added in v0.1.4

func (in *EffectClaim) DeepCopy() *EffectClaim

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EffectClaim.

func (*EffectClaim) DeepCopyInto added in v0.1.4

func (in *EffectClaim) DeepCopyInto(out *EffectClaim)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*EffectClaim) DeepCopyObject added in v0.1.4

func (in *EffectClaim) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type EffectClaimCompletionStatus added in v0.1.4

type EffectClaimCompletionStatus string

+kubebuilder:validation:Enum=completed;released;abandoned

const (
	EffectClaimCompletionStatusCompleted EffectClaimCompletionStatus = "completed"
	EffectClaimCompletionStatusReleased  EffectClaimCompletionStatus = "released"
	EffectClaimCompletionStatusAbandoned EffectClaimCompletionStatus = "abandoned"
)

type EffectClaimList added in v0.1.4

type EffectClaimList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitzero"`
	Items           []EffectClaim `json:"items"`
}

EffectClaimList contains a list of EffectClaim.

func (*EffectClaimList) DeepCopy added in v0.1.4

func (in *EffectClaimList) DeepCopy() *EffectClaimList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EffectClaimList.

func (*EffectClaimList) DeepCopyInto added in v0.1.4

func (in *EffectClaimList) DeepCopyInto(out *EffectClaimList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*EffectClaimList) DeepCopyObject added in v0.1.4

func (in *EffectClaimList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type EffectClaimPhase added in v0.1.4

type EffectClaimPhase string

+kubebuilder:validation:Enum=Reserved;Completed;Released;Abandoned

const (
	EffectClaimPhaseReserved  EffectClaimPhase = "Reserved"
	EffectClaimPhaseCompleted EffectClaimPhase = "Completed"
	EffectClaimPhaseReleased  EffectClaimPhase = "Released"
	EffectClaimPhaseAbandoned EffectClaimPhase = "Abandoned"
)

type EffectClaimSpec added in v0.1.4

type EffectClaimSpec struct {
	// StepRunRef identifies the StepRun that owns this effect claim.
	// +kubebuilder:validation:Required
	StepRunRef refs.StepRunReference `json:"stepRunRef"`

	// EffectKey identifies the stable external effect within the StepRun.
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:validation:MaxLength=256
	EffectKey string `json:"effectKey"`

	// IdempotencyKey optionally copies the step-scoped business idempotency key.
	// +kubebuilder:validation:MaxLength=256
	// +optional
	IdempotencyKey string `json:"idempotencyKey,omitempty"`

	// HolderIdentity identifies the current reservation owner.
	// +kubebuilder:validation:MaxLength=253
	// +optional
	HolderIdentity string `json:"holderIdentity,omitempty"`

	// LeaseDurationSeconds bounds how long a reservation may remain unrenewed
	// before another worker may recover it.
	// +kubebuilder:validation:Minimum=1
	// +optional
	LeaseDurationSeconds int32 `json:"leaseDurationSeconds,omitempty"`

	// AcquireTime records when the current holder first acquired the reservation.
	// +optional
	AcquireTime *metav1.MicroTime `json:"acquireTime,omitempty"`

	// RenewTime records the latest observed successful renewal by the holder.
	// +optional
	RenewTime *metav1.MicroTime `json:"renewTime,omitempty"`

	// LeaseTransitions counts successful stale-takeover transitions.
	// +kubebuilder:validation:Minimum=0
	// +optional
	LeaseTransitions int32 `json:"leaseTransitions,omitempty"`

	// CompletionStatus records the terminal effect outcome once known.
	// +optional
	CompletionStatus EffectClaimCompletionStatus `json:"completionStatus,omitempty"`

	// CompletedAt records when the effect entered a terminal completion state.
	// +optional
	CompletedAt *metav1.Time `json:"completedAt,omitempty"`

	// Details carries compact structured metadata about the terminal effect outcome.
	// +kubebuilder:pruning:PreserveUnknownFields
	// +optional
	Details *runtime.RawExtension `json:"details,omitempty"`
}

EffectClaimSpec defines the desired state of EffectClaim.

func (*EffectClaimSpec) DeepCopy added in v0.1.4

func (in *EffectClaimSpec) DeepCopy() *EffectClaimSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EffectClaimSpec.

func (*EffectClaimSpec) DeepCopyInto added in v0.1.4

func (in *EffectClaimSpec) DeepCopyInto(out *EffectClaimSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type EffectClaimStatus added in v0.1.4

type EffectClaimStatus struct {
	// ObservedGeneration is the latest generation observed by the controller.
	// +optional
	ObservedGeneration int64 `json:"observedGeneration,omitempty"`

	// Phase provides a canonical high-level lifecycle summary for the claim.
	// +optional
	Phase EffectClaimPhase `json:"phase,omitempty"`

	// Conditions provide canonical Kubernetes lifecycle status for the claim.
	// +listType=map
	// +listMapKey=type
	// +optional
	Conditions []metav1.Condition `json:"conditions,omitempty"`
}

EffectClaimStatus defines the observed state of EffectClaim. +kubebuilder:validation:XValidation:message="status.conditions reason field must be <= 64 characters",rule="!has(self.conditions) || self.conditions.all(c, !has(c.reason) || size(c.reason) <= 64)" +kubebuilder:validation:XValidation:message="status.conditions message field must be <= 2048 characters",rule="!has(self.conditions) || self.conditions.all(c, !has(c.message) || size(c.message) <= 2048)"

func (*EffectClaimStatus) DeepCopy added in v0.1.4

func (in *EffectClaimStatus) DeepCopy() *EffectClaimStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EffectClaimStatus.

func (*EffectClaimStatus) DeepCopyInto added in v0.1.4

func (in *EffectClaimStatus) DeepCopyInto(out *EffectClaimStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type EffectRecord added in v0.1.4

type EffectRecord struct {
	// Seq is a monotonically increasing sequence number for this StepRun.
	Seq uint64 `json:"seq"`
	// Key identifies the external effect (idempotency key or effect ID).
	Key string `json:"key"`
	// Status captures the outcome (e.g., succeeded, failed).
	// +optional
	Status string `json:"status,omitempty"`
	// EmittedAt records when the effect was emitted.
	// +optional
	EmittedAt *metav1.Time `json:"emittedAt,omitempty"`
	// Details carries optional structured metadata about the effect.
	// +optional
	Details *runtime.RawExtension `json:"details,omitempty"`
}

EffectRecord captures a single external side effect for idempotency.

func (*EffectRecord) DeepCopy added in v0.1.4

func (in *EffectRecord) DeepCopy() *EffectRecord

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EffectRecord.

func (*EffectRecord) DeepCopyInto added in v0.1.4

func (in *EffectRecord) DeepCopyInto(out *EffectRecord)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type GRPCTarget

type GRPCTarget struct {
	// Endpoint is the address of the downstream service (e.g., "engram-b.default.svc:9000").
	// +kubebuilder:validation:Required
	Endpoint string `json:"endpoint"`
}

GRPCTarget provides the endpoint for a downstream gRPC peer.

func (*GRPCTarget) DeepCopy

func (in *GRPCTarget) DeepCopy() *GRPCTarget

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GRPCTarget.

func (*GRPCTarget) DeepCopyInto

func (in *GRPCTarget) DeepCopyInto(out *GRPCTarget)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type GateDecisionState added in v0.1.4

type GateDecisionState string

GateDecisionState captures a manual gate decision for a step. +kubebuilder:validation:Enum=Pending;Approved;Rejected

const (
	GateDecisionPending  GateDecisionState = "Pending"
	GateDecisionApproved GateDecisionState = "Approved"
	GateDecisionRejected GateDecisionState = "Rejected"
)

type GateStatus added in v0.1.4

type GateStatus struct {
	// State is the gate decision state (Pending/Approved/Rejected).
	// +optional
	State GateDecisionState `json:"state,omitempty"`
	// Message provides optional human context for the decision.
	// +optional
	Message string `json:"message,omitempty"`
	// UpdatedAt records when the decision was last updated.
	// +optional
	UpdatedAt *metav1.Time `json:"updatedAt,omitempty"`
	// UpdatedBy is an optional identifier for who/what updated the decision.
	// +optional
	UpdatedBy string `json:"updatedBy,omitempty"`
}

GateStatus records a decision for a gate step.

func (*GateStatus) DeepCopy added in v0.1.4

func (in *GateStatus) DeepCopy() *GateStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GateStatus.

func (*GateStatus) DeepCopyInto added in v0.1.4

func (in *GateStatus) DeepCopyInto(out *GateStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type HandoffPhase added in v0.1.4

type HandoffPhase string

HandoffPhase captures lifecycle cutover progress for streaming workloads. +kubebuilder:validation:Enum=pending;draining;cutover;ready

const (
	HandoffPhasePending  HandoffPhase = "pending"
	HandoffPhaseDraining HandoffPhase = "draining"
	HandoffPhaseCutover  HandoffPhase = "cutover"
	HandoffPhaseReady    HandoffPhase = "ready"
)

type HandoffStatus added in v0.1.4

type HandoffStatus struct {
	// Strategy reflects the lifecycle strategy in effect for this streaming workload.
	// +optional
	Strategy *transportv1alpha1.TransportUpgradeStrategy `json:"strategy,omitempty"`

	// Phase indicates the current handoff stage.
	// +optional
	Phase HandoffPhase `json:"phase,omitempty"`

	// Message provides a human-readable explanation for the current phase.
	// +optional
	Message string `json:"message,omitempty"`

	// UpdatedAt records when the handoff status was last updated.
	// +optional
	UpdatedAt *metav1.Time `json:"updatedAt,omitempty"`
}

HandoffStatus reports streaming upgrade/handoff progress for a StepRun.

func (*HandoffStatus) DeepCopy added in v0.1.4

func (in *HandoffStatus) DeepCopy() *HandoffStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HandoffStatus.

func (*HandoffStatus) DeepCopyInto added in v0.1.4

func (in *HandoffStatus) DeepCopyInto(out *HandoffStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type SchemaReference added in v0.1.4

type SchemaReference struct {
	// Ref is the schema identifier (for example: bubu://story/<namespace>/<story>/inputs).
	// +optional
	Ref string `json:"ref,omitempty"`

	// Version is the schema version when known.
	// +optional
	Version string `json:"version,omitempty"`
}

SchemaReference identifies a JSON Schema and optional version.

func (*SchemaReference) DeepCopy added in v0.1.4

func (in *SchemaReference) DeepCopy() *SchemaReference

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SchemaReference.

func (*SchemaReference) DeepCopyInto added in v0.1.4

func (in *SchemaReference) DeepCopyInto(out *SchemaReference)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type SignalEvent added in v0.1.4

type SignalEvent struct {
	// Seq is a monotonically increasing sequence number for this StepRun.
	Seq uint64 `json:"seq"`
	// Key identifies the signal name.
	Key string `json:"key"`
	// EmittedAt records when the signal was emitted.
	// +optional
	EmittedAt *metav1.Time `json:"emittedAt,omitempty"`
	// Payload carries the signal payload.
	// +optional
	Payload *runtime.RawExtension `json:"payload,omitempty"`
}

SignalEvent captures a single emitted signal for replay.

func (*SignalEvent) DeepCopy added in v0.1.4

func (in *SignalEvent) DeepCopy() *SignalEvent

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SignalEvent.

func (*SignalEvent) DeepCopyInto added in v0.1.4

func (in *SignalEvent) DeepCopyInto(out *SignalEvent)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type StepExecutionOverrides

type StepExecutionOverrides struct {
	// Resource overrides - only the essentials
	CPURequest    *string `json:"cpuRequest,omitempty"`    // Override CPU request (e.g., "100m", "0.5")
	CPULimit      *string `json:"cpuLimit,omitempty"`      // Override CPU limit (e.g., "500m", "1")
	MemoryRequest *string `json:"memoryRequest,omitempty"` // Override memory request (e.g., "128Mi", "1Gi")
	MemoryLimit   *string `json:"memoryLimit,omitempty"`   // Override memory limit (e.g., "256Mi", "2Gi")

	// Placement overrides pod scheduling constraints (node selector, tolerations, affinity).
	// +optional
	Placement *bubuv1alpha1.PlacementPolicy `json:"placement,omitempty"`

	// Cache overrides output caching behavior.
	// +optional
	Cache *bubuv1alpha1.CachePolicy `json:"cache,omitempty"`

	// Debug toggles component-level debug logging.
	Debug *bool `json:"debug,omitempty"`

	// Job behavior overrides
	BackoffLimit            *int32  `json:"backoffLimit,omitempty"`            // Override job backoff limit
	TTLSecondsAfterFinished *int32  `json:"ttlSecondsAfterFinished,omitempty"` // Override job cleanup time
	RestartPolicy           *string `json:"restartPolicy,omitempty"`           // Override restart policy (Never, OnFailure)
}

StepExecutionOverrides allows overriding execution parameters at the StepRun level This has the highest priority in the configuration hierarchy: StepRun > Story > Engram > Template

func (*StepExecutionOverrides) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StepExecutionOverrides.

func (*StepExecutionOverrides) DeepCopyInto

func (in *StepExecutionOverrides) DeepCopyInto(out *StepExecutionOverrides)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type StepRun

type StepRun struct {
	metav1.TypeMeta `json:",inline"`
	// metadata is a standard object metadata
	// +optional
	metav1.ObjectMeta `json:"metadata,omitzero"`

	// spec defines the desired state of StepRun
	// +required
	Spec StepRunSpec `json:"spec"`

	// status defines the observed state of StepRun
	// +optional
	Status StepRunStatus `json:"status,omitzero"`
}

StepRun represents the execution of a single step within a StoryRun

Think of the relationship like this: - Story = A recipe (defines the cooking process) - StoryRun = Actually cooking the dish (following the recipe) - StepRun = Each individual cooking step (chopping vegetables, heating oil, etc.)

StepRuns are the atomic units of execution. They represent: - Running a single Engram with specific inputs - Executing a built-in primitive action (condition, parallel, etc.) - Launching a sub-story

StepRuns provide detailed execution tracking: - Exactly when each step started and finished - What inputs were provided and outputs produced - Resource usage and performance metrics - Detailed error information for debugging - Retry attempts and circuit breaker status

+kubebuilder:object:root=true +kubebuilder:subresource:status +kubebuilder:resource:scope=Namespaced,shortName=step,categories={bubu,ai,runs} +kubebuilder:printcolumn:name="StoryRun",type=string,JSONPath=.spec.storyRunRef.name +kubebuilder:printcolumn:name="Step",type=string,JSONPath=.spec.stepId +kubebuilder:printcolumn:name="Phase",type=string,JSONPath=.status.phase +kubebuilder:printcolumn:name="Retries",type=integer,JSONPath=.status.retries +kubebuilder:printcolumn:name="Age",type=date,JSONPath=.metadata.creationTimestamp +kubebuilder:rbac:groups=runs.bubustack.io,resources=stepruns,verbs=get;watch +kubebuilder:rbac:groups=runs.bubustack.io,resources=stepruns/status,verbs=patch;update +kubebuilder:selectablefield:JSONPath=".spec.storyRunRef.name" +kubebuilder:selectablefield:JSONPath=".spec.stepId" +kubebuilder:selectablefield:JSONPath=".status.phase"

func (*StepRun) DeepCopy

func (in *StepRun) DeepCopy() *StepRun

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StepRun.

func (*StepRun) DeepCopyInto

func (in *StepRun) DeepCopyInto(out *StepRun)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*StepRun) DeepCopyObject

func (in *StepRun) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type StepRunList

type StepRunList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitzero"`
	Items           []StepRun `json:"items"`
}

+kubebuilder:object:root=true

func (*StepRunList) DeepCopy

func (in *StepRunList) DeepCopy() *StepRunList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StepRunList.

func (*StepRunList) DeepCopyInto

func (in *StepRunList) DeepCopyInto(out *StepRunList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*StepRunList) DeepCopyObject

func (in *StepRunList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type StepRunSpec

type StepRunSpec struct {
	// Which StoryRun does this step belong to?
	// Used to track the parent execution and coordinate step ordering
	// +kubebuilder:validation:Required
	StoryRunRef refs.StoryRunReference `json:"storyRunRef"`

	// Which step in the Story is this executing?
	// References the step name/ID from the original Story definition
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:validation:MaxLength=63
	// +kubebuilder:validation:Pattern=^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
	StepID string `json:"stepId"`

	// IdempotencyKey provides a stable identifier for step side effects.
	// External systems should use this to dedupe effects across retries.
	// +kubebuilder:validation:MaxLength=256
	// +optional
	IdempotencyKey string `json:"idempotencyKey,omitempty"`

	// What should this step execute?
	// Always references an Engram (for custom logic) or uses built-in primitive type
	// Primitive types: condition, parallel, sleep, stop, wait, executeStory, gate.
	EngramRef *refs.EngramReference `json:"engramRef,omitempty"` // Reference to an Engram for custom logic

	// TemplateGeneration records the EngramTemplate metadata.generation at the time
	// this StepRun was created. Enables auditing and replay against the exact template version.
	// +optional
	TemplateGeneration int64 `json:"templateGeneration,omitempty"`

	// What data should be passed to this step?
	// This is the resolved input after template evaluation and data flow from previous steps
	// Examples:
	// - HTTP request: {"url": "https://api.example.com", "method": "GET", "headers": {...}}
	// - OpenAI call: {"prompt": "Summarize this text: ...", "model": "gpt-4", "temperature": 0.7}
	// - Condition: {"expression": "{{ eq steps.http_check.output.status 200 }}"}
	// +kubebuilder:pruning:PreserveUnknownFields
	Input *runtime.RawExtension `json:"input,omitempty"`

	// Execution timing constraints (inherited from Story → Engram → Template hierarchy)
	// How long to wait before considering this step failed?
	// Examples: "30s", "5m", "1h"
	// Priority: StepRun > Story.steps[].execution.timeout > Engram.execution.timeout > Template.execution.timeout
	Timeout string `json:"timeout,omitempty"`

	// What to do if this step fails?
	// Priority: StepRun > Story.steps[].execution.retry > Engram.execution.retry > Template.execution.retry
	Retry *bubuv1alpha1.RetryPolicy `json:"retry,omitempty"`

	// Last-minute overrides for special situations
	// This has the highest priority in the configuration hierarchy
	ExecutionOverrides *StepExecutionOverrides `json:"executionOverrides,omitempty"`

	// DownstreamTargets instructs the Engram's SDK what to do with the output.
	// This is populated by the storyrun-controller to enable direct Engram-to-Engram communication.
	// Can be a list to support fanning out to multiple parallel steps.
	// +optional
	DownstreamTargets []DownstreamTarget `json:"downstreamTargets,omitempty"`
}

StepRunSpec defines exactly how to execute this specific step

func (*StepRunSpec) DeepCopy

func (in *StepRunSpec) DeepCopy() *StepRunSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StepRunSpec.

func (*StepRunSpec) DeepCopyInto

func (in *StepRunSpec) DeepCopyInto(out *StepRunSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type StepRunStatus

type StepRunStatus struct {
	// observedGeneration is the most recent generation observed for this StepRun. It corresponds to the
	// StepRun's generation, which is updated on mutation by the API Server.
	// +optional
	ObservedGeneration int64 `json:"observedGeneration,omitempty"`

	// Current execution phase
	// - Pending: StepRun created but not yet started (waiting for dependencies)
	// - Running: Step is actively executing
	// - Succeeded: Step completed successfully
	// - Failed: Step failed and will not be retried
	// - Canceled: Step was canceled by user or system
	// - Paused: Step is paused waiting for external input or approval
	Phase enums.Phase `json:"phase,omitempty"`

	// Execution timing and metadata
	StartedAt  *metav1.Time `json:"startedAt,omitempty"`  // When did this step start?
	FinishedAt *metav1.Time `json:"finishedAt,omitempty"` // When did this step finish?
	Duration   string       `json:"duration,omitempty"`   // How long did execution take? (calculated field)

	// LastOutputAt records when the step's output was last written.
	// Useful for staleness detection — downstream consumers can compare this
	// against their own scheduling time.
	// +optional
	LastOutputAt *metav1.Time `json:"lastOutputAt,omitempty"`

	// Trace captures the OpenTelemetry trace context for this StepRun.
	// +optional
	Trace *TraceInfo `json:"trace,omitempty"`

	// Process execution details
	ExitCode  int32           `json:"exitCode,omitempty"`  // What exit code did the container return? (0 = success)
	ExitClass enums.ExitClass `json:"exitClass,omitempty"` // How should we interpret this exit? (success|retry|terminal|rateLimited)
	PodName   string          `json:"podName,omitempty"`   // Which Kubernetes pod executed this step?

	// Retry tracking (aligned with our Story/Engram/Template retry design)
	Retries        int32        `json:"retries"`                  // How many times has this step been retried?
	NextRetryAt    *metav1.Time `json:"nextRetryAt,omitempty"`    // When will the next retry happen?
	LastFailureMsg string       `json:"lastFailureMsg,omitempty"` // Most recent failure message for debugging

	// InputSchemaRef identifies the schema used to validate resolved step inputs.
	// +optional
	InputSchemaRef *SchemaReference `json:"inputSchemaRef,omitempty"`

	// OutputSchemaRef identifies the schema expected for step outputs.
	// +optional
	OutputSchemaRef *SchemaReference `json:"outputSchemaRef,omitempty"`

	// What did this step produce?
	// For small outputs (< 1MB), stored inline here
	// For large outputs, automatically stored in shared storage (if enabled) and path referenced here
	// This gets validated against the Engram's outputSchema (if applicable)
	// Examples:
	// - HTTP client: {"status": 200, "body": "...", "headers": {...}, "responseTime": 150}
	// - OpenAI: {"response": "Summary text...", "usage": {"tokens": 250}, "model": "gpt-4"}
	// - Large file: {"result": "success", "outputPath": "/shared/storage/story-123/step-fetch/response.json"}
	// +kubebuilder:pruning:PreserveUnknownFields
	Output *runtime.RawExtension `json:"output,omitempty"`

	// Optional logs reference emitted by the SDK/Engram.
	// When storage is enabled, the SDK may upload logs and store a storage ref map here.
	// +kubebuilder:pruning:PreserveUnknownFields
	Logs *runtime.RawExtension `json:"logs,omitempty"`

	// If the step failed, what was the error?
	// Contains structured error information for debugging.
	// Must conform to the StructuredError v1 contract (https://bubustack.io/docs/api/errors).
	// Examples:
	// - HTTP error: {"type": "http_error", "status": 404, "message": "Not Found", "url": "..."}
	// - Timeout: {"type": "timeout", "duration": "30s", "stage": "execution"}
	// - Validation: {"type": "validation_error", "field": "url", "message": "Invalid URL format"}
	Error *StructuredError `json:"error,omitempty"`

	// Conditions provide the canonical lifecycle status. Phase/Message are summaries.
	// The Ready condition reason holds stable reason codes for state transitions.
	// +optional
	// +listType=map
	// +listMapKey=type
	Conditions []metav1.Condition `json:"conditions,omitempty"`

	// Handoff captures streaming upgrade/cutover state for realtime workloads.
	// +optional
	Handoff *HandoffStatus `json:"handoff,omitempty"`

	// Step coordination - which steps must complete before this one can start
	// Uses the same "needs" terminology as our Story API for consistency
	Needs []string `json:"needs,omitempty"` // StepRun names that must complete first

	// Signals captures lightweight, controller-friendly metadata emitted by running Engrams.
	// These values are intended for template expressions and branching logic (e.g., last transcript text).
	// Payloads should remain small (<8 KiB) to avoid bloating status objects.
	// +optional
	Signals map[string]runtime.RawExtension `json:"signals,omitempty"`

	// SignalEvents captures an append-only sequence of emitted signals for replay.
	// Payloads should remain small (<8 KiB) to avoid bloating status objects.
	// +optional
	// +kubebuilder:validation:MaxItems=256
	// +kubebuilder:validation:ListType=map
	// +kubebuilder:validation:ListMapKey=seq
	SignalEvents []SignalEvent `json:"signalEvents,omitempty"`

	// Effects records external side effects emitted by the step.
	// This ledger is append-only and intended for idempotency checks.
	// Payloads should remain small to avoid bloating status objects.
	// +optional
	// +kubebuilder:validation:MaxItems=256
	// +kubebuilder:validation:ListType=map
	// +kubebuilder:validation:ListMapKey=seq
	Effects []EffectRecord `json:"effects,omitempty"`
}

StepRunStatus tracks the detailed execution state of this individual step +kubebuilder:validation:XValidation:message="status.conditions reason field must be <= 64 characters",rule="!has(self.conditions) || self.conditions.all(c, !has(c.reason) || size(c.reason) <= 64)" +kubebuilder:validation:XValidation:message="status.conditions message field must be <= 2048 characters",rule="!has(self.conditions) || self.conditions.all(c, !has(c.message) || size(c.message) <= 2048)"

func (*StepRunStatus) DeepCopy

func (in *StepRunStatus) DeepCopy() *StepRunStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StepRunStatus.

func (*StepRunStatus) DeepCopyInto

func (in *StepRunStatus) DeepCopyInto(out *StepRunStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type StepState

type StepState struct {
	// Phase is the current execution phase of the step.
	Phase enums.Phase `json:"phase"`
	// Message provides a human-readable summary of the step's status.
	// +optional
	Message string `json:"message,omitempty"`
	// StartedAt records when the step first entered a non-empty phase.
	// +optional
	StartedAt *metav1.Time `json:"startedAt,omitempty"`
	// FinishedAt records when the step reached a terminal phase.
	// +optional
	FinishedAt *metav1.Time `json:"finishedAt,omitempty"`
	// For 'executeStory' steps, this tracks the name of the created sub-StoryRun.
	// +optional
	SubStoryRunName string `json:"subStoryRunName,omitempty"`
}

StepState holds the detailed status of a single step within a StoryRun.

func (*StepState) DeepCopy

func (in *StepState) DeepCopy() *StepState

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StepState.

func (*StepState) DeepCopyInto

func (in *StepState) DeepCopyInto(out *StepState)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type StoryRun

type StoryRun struct {
	metav1.TypeMeta `json:",inline"`
	// metadata is a standard object metadata
	// +optional
	metav1.ObjectMeta `json:"metadata,omitzero"`

	// spec defines the desired state of StoryRun
	// +required
	Spec StoryRunSpec `json:"spec"`

	// status defines the observed state of StoryRun
	// +optional
	Status StoryRunStatus `json:"status,omitzero"`
}

StoryRun represents an actual execution instance of a Story

Think of the relationship like this: - Story = A movie script (defines what should happen) - StoryRun = Actually filming the movie (executing the script with specific actors and locations)

Every time a Story is triggered (by an Impulse, manual trigger, or another Story), a new StoryRun is created to track that specific execution.

StoryRuns are the "run history" of your automation - they show: - When each story execution started and finished - What inputs were provided - Which steps succeeded or failed - What outputs were produced - Any errors that occurred

+kubebuilder:object:root=true +kubebuilder:subresource:status +kubebuilder:resource:scope=Namespaced,shortName=srun,categories={bubu,ai,runs} +kubebuilder:printcolumn:name="Story",type=string,JSONPath=.spec.storyRef.name +kubebuilder:printcolumn:name="Phase",type=string,JSONPath=.status.phase +kubebuilder:printcolumn:name="Duration",type=string,JSONPath=.status.duration +kubebuilder:printcolumn:name="Age",type=date,JSONPath=.metadata.creationTimestamp +kubebuilder:selectablefield:JSONPath=".spec.storyRef.name" +kubebuilder:selectablefield:JSONPath=".status.phase"

func (*StoryRun) DeepCopy

func (in *StoryRun) DeepCopy() *StoryRun

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StoryRun.

func (*StoryRun) DeepCopyInto

func (in *StoryRun) DeepCopyInto(out *StoryRun)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*StoryRun) DeepCopyObject

func (in *StoryRun) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type StoryRunList

type StoryRunList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitzero"`
	Items           []StoryRun `json:"items"`
}

+kubebuilder:object:root=true

func (*StoryRunList) DeepCopy

func (in *StoryRunList) DeepCopy() *StoryRunList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StoryRunList.

func (*StoryRunList) DeepCopyInto

func (in *StoryRunList) DeepCopyInto(out *StoryRunList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*StoryRunList) DeepCopyObject

func (in *StoryRunList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type StoryRunSpec

type StoryRunSpec struct {
	// Which Story to execute
	// References can be same-namespace (name only) or cross-namespace with explicit namespace
	// Examples: "ci-pipeline", cross-ns: {"name": "deploy-app", "namespace": "production"}
	// +kubebuilder:validation:Required
	StoryRef refs.StoryReference `json:"storyRef"`

	// Which Impulse triggered this StoryRun, if any
	// This provides a clear audit trail from an event trigger to its corresponding workflow execution
	// +optional
	ImpulseRef *refs.ImpulseReference `json:"impulseRef,omitempty"`

	// Input data for this specific story execution
	// This data gets validated against the Story's inputsSchema
	// Examples:
	// - CI pipeline: {"repository": "my-app", "branch": "main", "commit": "abc123"}
	// - Data processing: {"filename": "data.csv", "format": "csv", "destination": "warehouse"}
	// - Deployment: {"environment": "production", "version": "v1.2.3", "rollback": false}
	// +kubebuilder:pruning:PreserveUnknownFields
	Inputs *runtime.RawExtension `json:"inputs,omitempty"`

	// CancelRequested signals that this StoryRun should be gracefully canceled.
	// When set to true, the controller will:
	// 1. Stop scheduling new steps
	// 2. Set running steps' CancelRequested annotation
	// 3. Wait for GracefulShutdownTimeout (default 30s) before force-killing
	// 4. Set the StoryRun phase to Finished
	// +optional
	CancelRequested *bool `json:"cancelRequested,omitempty"`
}

StoryRunSpec defines what Story to run and with what inputs

func (*StoryRunSpec) DeepCopy

func (in *StoryRunSpec) DeepCopy() *StoryRunSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StoryRunSpec.

func (*StoryRunSpec) DeepCopyInto

func (in *StoryRunSpec) DeepCopyInto(out *StoryRunSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type StoryRunStatus

type StoryRunStatus struct {
	// observedGeneration is the most recent generation observed for this StoryRun. It corresponds to the
	// StoryRun's generation, which is updated on mutation by the API Server.
	// +optional
	ObservedGeneration int64 `json:"observedGeneration,omitempty"`

	// Current execution phase
	// - Pending: StoryRun created but not yet started
	// - Running: Story is actively executing steps
	// - Succeeded: All steps completed successfully
	// - Failed: A step failed and the story cannot continue
	// - Finished: Execution was stopped/canceled by user or system (non-failure termination)
	Phase enums.Phase `json:"phase,omitempty"`

	// Human-readable message about the story's status
	Message string `json:"message,omitempty"`

	// List of steps that are currently executing
	Active []string `json:"active,omitempty"`

	// List of steps that have completed successfully
	Completed []string `json:"completed,omitempty"`

	// Tracks the child StepRuns created by primitive steps (e.g., parallel branches)
	// Key: Name of the parent primitive step (e.g., "my-parallel-step")
	// Value: List of child StepRun names created by that primitive
	// +optional
	PrimitiveChildren map[string][]string `json:"primitiveChildren,omitempty"`

	// Execution timing
	StartedAt  *metav1.Time `json:"startedAt,omitempty"`
	FinishedAt *metav1.Time `json:"finishedAt,omitempty"`

	// Timestamp when child resources (StepRuns, Pods) were cleaned up
	// Used to track the two-phase cleanup process (children first, then parent)
	// +optional
	ChildrenCleanedAt *metav1.Time `json:"childrenCleanedAt,omitempty"`

	// How long did this execution take? (calculated field)
	Duration string `json:"duration,omitempty"`

	// Trace captures the OpenTelemetry trace context for this StoryRun.
	// +optional
	Trace *TraceInfo `json:"trace,omitempty"`

	// Attempts counts how many times the StoryRun has entered Running.
	// This increments on each transition into Running.
	Attempts int32 `json:"attempts,omitempty"`

	// InputSchemaRef identifies the schema used to validate StoryRun inputs.
	// +optional
	InputSchemaRef *SchemaReference `json:"inputSchemaRef,omitempty"`

	// OutputSchemaRef identifies the schema expected for StoryRun outputs.
	// +optional
	OutputSchemaRef *SchemaReference `json:"outputSchemaRef,omitempty"`

	// What data did this story produce upon completion?
	// For small outputs (< 1MB), stored inline here
	// For large outputs, automatically stored in shared storage (if enabled) and path referenced here
	// This gets validated against the Story's outputSchema
	// Examples:
	// - CI pipeline: {"buildArtifact": "app-v1.2.3.tar.gz", "testResults": {...}, "deploymentUrl": "https://..."}
	// - Data processing: {"processedRows": 1000, "outputFile": "processed-data.json", "errors": 5}
	// - Large output: {"result": "success", "outputPath": "/shared/storage/story-123/final-output.json"}
	// +kubebuilder:pruning:PreserveUnknownFields
	Output *runtime.RawExtension `json:"output,omitempty"`

	// StepStates provides a detailed, real-time status for each step in the Story.
	// The key is the step name.
	// +optional
	StepStates map[string]StepState `json:"stepStates,omitempty"`

	// Gates captures manual gate decisions keyed by step name.
	// +optional
	Gates map[string]GateStatus `json:"gates,omitempty"`

	// If the story failed, what was the error?
	// Contains structured error information for debugging
	// Examples:
	// - Step failure: {"failedStep": "deploy", "reason": "timeout", "details": "..."}
	// - Validation error: {"type": "input_validation", "field": "url", "message": "Invalid URL"}
	// +kubebuilder:pruning:PreserveUnknownFields
	Error *runtime.RawExtension `json:"error,omitempty"`

	// Conditions provide the canonical lifecycle status. Phase/Message are summaries.
	// The Ready condition reason holds stable reason codes for state transitions.
	// +listType=map
	// +listMapKey=type
	Conditions []metav1.Condition `json:"conditions,omitempty"`

	// Step execution summary for quick overview
	StepsTotal    int32 `json:"stepsTotal,omitempty"`    // Total number of steps in the story
	StepsComplete int32 `json:"stepsComplete,omitempty"` // Number of steps that completed successfully
	StepsFailed   int32 `json:"stepsFailed,omitempty"`   // Number of steps that failed
	StepsSkipped  int32 `json:"stepsSkipped,omitempty"`  // Number of steps that were skipped

	// AllowedFailures lists steps that failed but were explicitly allowed to fail.
	// +optional
	AllowedFailures []string `json:"allowedFailures,omitempty"`

	// TriggerTokens tracks which parent resources have counted this StoryRun.
	// Used for idempotent trigger counting by Story/Impulse controllers.
	// Managed by the StoryRun controller to avoid annotation churn from multiple writers.
	// Possible tokens:
	//   - "story": counted by parent Story's trigger count
	//   - "impulse": counted by parent Impulse's trigger count
	//   - "impulse-success": counted by parent Impulse's success count
	//   - "impulse-failed": counted by parent Impulse's failure count
	// +optional
	TriggerTokens []string `json:"triggerTokens,omitempty"`
}

StoryRunStatus tracks the current state and results of this story execution +kubebuilder:validation:XValidation:rule="!has(self.conditions) || self.conditions.exists(c, c.type == 'Ready')",message="status.conditions must include Ready when conditions are set" +kubebuilder:validation:XValidation:rule="!has(self.conditions) || self.conditions.all(c, has(c.lastTransitionTime))",message="status.conditions entries must set lastTransitionTime" +kubebuilder:validation:XValidation:message="status.conditions reason field must be <= 64 characters",rule="!has(self.conditions) || self.conditions.all(c, !has(c.reason) || size(c.reason) <= 64)" +kubebuilder:validation:XValidation:message="status.conditions message field must be <= 2048 characters",rule="!has(self.conditions) || self.conditions.all(c, !has(c.message) || size(c.message) <= 2048)"

func (*StoryRunStatus) AddTriggerToken added in v0.1.4

func (s *StoryRunStatus) AddTriggerToken(token string) bool

AddTriggerToken adds a trigger token to the StoryRun if not already present. Returns true if the token was newly added, false if already present.

func (*StoryRunStatus) AddTriggerTokens added in v0.1.4

func (s *StoryRunStatus) AddTriggerTokens(tokens ...string) []string

AddTriggerTokens adds multiple trigger tokens and returns the tokens that were newly added.

func (*StoryRunStatus) DeepCopy

func (in *StoryRunStatus) DeepCopy() *StoryRunStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StoryRunStatus.

func (*StoryRunStatus) DeepCopyInto

func (in *StoryRunStatus) DeepCopyInto(out *StoryRunStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*StoryRunStatus) HasTriggerToken added in v0.1.4

func (s *StoryRunStatus) HasTriggerToken(token string) bool

HasTriggerToken checks if the StoryRun has been marked with a specific trigger token.

type StoryTrigger added in v0.1.4

type StoryTrigger struct {
	metav1.TypeMeta `json:",inline"`

	// metadata is a standard object metadata
	// +optional
	metav1.ObjectMeta `json:"metadata,omitzero"`

	// spec defines the desired state of StoryTrigger
	// +required
	Spec StoryTriggerSpec `json:"spec"`

	// status defines the observed state of StoryTrigger
	// +optional
	Status StoryTriggerStatus `json:"status,omitzero"`
}

StoryTrigger is the Schema for the storytriggers API.

func (*StoryTrigger) DeepCopy added in v0.1.4

func (in *StoryTrigger) DeepCopy() *StoryTrigger

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StoryTrigger.

func (*StoryTrigger) DeepCopyInto added in v0.1.4

func (in *StoryTrigger) DeepCopyInto(out *StoryTrigger)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*StoryTrigger) DeepCopyObject added in v0.1.4

func (in *StoryTrigger) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type StoryTriggerDecision added in v0.1.4

type StoryTriggerDecision string

+kubebuilder:validation:Enum=Pending;Created;Reused;Rejected

const (
	StoryTriggerDecisionPending  StoryTriggerDecision = "Pending"
	StoryTriggerDecisionCreated  StoryTriggerDecision = "Created"
	StoryTriggerDecisionReused   StoryTriggerDecision = "Reused"
	StoryTriggerDecisionRejected StoryTriggerDecision = "Rejected"
)

type StoryTriggerList added in v0.1.4

type StoryTriggerList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitzero"`
	Items           []StoryTrigger `json:"items"`
}

StoryTriggerList contains a list of StoryTrigger.

func (*StoryTriggerList) DeepCopy added in v0.1.4

func (in *StoryTriggerList) DeepCopy() *StoryTriggerList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StoryTriggerList.

func (*StoryTriggerList) DeepCopyInto added in v0.1.4

func (in *StoryTriggerList) DeepCopyInto(out *StoryTriggerList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*StoryTriggerList) DeepCopyObject added in v0.1.4

func (in *StoryTriggerList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type StoryTriggerSpec added in v0.1.4

type StoryTriggerSpec struct {
	// StoryRef identifies the Story executed when the trigger is accepted.
	// +kubebuilder:validation:Required
	StoryRef refs.StoryReference `json:"storyRef"`

	// ImpulseRef identifies the Impulse that observed the external event.
	// +optional
	ImpulseRef *refs.ImpulseReference `json:"impulseRef,omitempty"`

	// Inputs is the resolved Story input payload for the requested run.
	// +kubebuilder:pruning:PreserveUnknownFields
	// +optional
	Inputs *runtime.RawExtension `json:"inputs,omitempty"`

	// DeliveryIdentity is the durable request identity used for dedupe and retry resolution.
	// +kubebuilder:validation:Required
	DeliveryIdentity TriggerDeliveryIdentity `json:"deliveryIdentity"`
}

StoryTriggerSpec defines the desired state of StoryTrigger.

func (*StoryTriggerSpec) DeepCopy added in v0.1.4

func (in *StoryTriggerSpec) DeepCopy() *StoryTriggerSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StoryTriggerSpec.

func (*StoryTriggerSpec) DeepCopyInto added in v0.1.4

func (in *StoryTriggerSpec) DeepCopyInto(out *StoryTriggerSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type StoryTriggerStatus added in v0.1.4

type StoryTriggerStatus struct {
	// ObservedGeneration is the latest generation observed by the controller.
	// +optional
	ObservedGeneration int64 `json:"observedGeneration,omitempty"`

	// Decision is the controller-owned durable admission decision.
	// +optional
	Decision StoryTriggerDecision `json:"decision,omitempty"`

	// Reason is a stable machine-readable reason for the current decision.
	// +optional
	Reason string `json:"reason,omitempty"`

	// Message provides a human-readable description of the current decision.
	// +optional
	Message string `json:"message,omitempty"`

	// StoryRunRef points at the accepted or reused StoryRun once resolution completes.
	// +optional
	StoryRunRef *refs.StoryRunReference `json:"storyRunRef,omitempty"`

	// AcceptedAt records when the trigger was first accepted for controller processing.
	// +optional
	AcceptedAt *metav1.Time `json:"acceptedAt,omitempty"`

	// CompletedAt records when the controller finished resolving the trigger.
	// +optional
	CompletedAt *metav1.Time `json:"completedAt,omitempty"`

	// Conditions provide canonical Kubernetes lifecycle status for the trigger request.
	// +listType=map
	// +listMapKey=type
	// +optional
	Conditions []metav1.Condition `json:"conditions,omitempty"`
}

StoryTriggerStatus defines the observed state of StoryTrigger. +kubebuilder:validation:XValidation:message="status.conditions reason field must be <= 64 characters",rule="!has(self.conditions) || self.conditions.all(c, !has(c.reason) || size(c.reason) <= 64)" +kubebuilder:validation:XValidation:message="status.conditions message field must be <= 2048 characters",rule="!has(self.conditions) || self.conditions.all(c, !has(c.message) || size(c.message) <= 2048)"

func (*StoryTriggerStatus) DeepCopy added in v0.1.4

func (in *StoryTriggerStatus) DeepCopy() *StoryTriggerStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StoryTriggerStatus.

func (*StoryTriggerStatus) DeepCopyInto added in v0.1.4

func (in *StoryTriggerStatus) DeepCopyInto(out *StoryTriggerStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type StructuredError added in v0.1.4

type StructuredError struct {
	// Version identifies the schema version for this error payload.
	// +kubebuilder:default="v1"
	Version string `json:"version"`

	// Type is a machine-readable error category.
	Type StructuredErrorType `json:"type"`

	// Message is the human-readable error message.
	Message string `json:"message"`

	// Retryable indicates whether a retry may succeed for this error.
	// Omitted when unknown.
	Retryable *bool `json:"retryable,omitempty"`

	// ExitCode is the container exit code, when known.
	ExitCode *int32 `json:"exitCode,omitempty"`

	// ExitClass mirrors the platform retry classification (success|retry|terminal|rateLimited).
	ExitClass StructuredErrorExitClass `json:"exitClass,omitempty"`

	// Code is an optional, component-specific error code.
	Code string `json:"code,omitempty"`

	// Details carries optional structured data for debugging.
	// +kubebuilder:pruning:PreserveUnknownFields
	Details *runtime.RawExtension `json:"details,omitempty"`
}

StructuredError defines the versioned error contract stored in StepRun.status.error. It is emitted by SDKs and consumed by controllers/CLIs for diagnostics.

func (*StructuredError) DeepCopy added in v0.1.4

func (in *StructuredError) DeepCopy() *StructuredError

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StructuredError.

func (*StructuredError) DeepCopyInto added in v0.1.4

func (in *StructuredError) DeepCopyInto(out *StructuredError)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type StructuredErrorExitClass added in v0.1.4

type StructuredErrorExitClass string

StructuredErrorExitClass mirrors the platform retry classification used in structured StepRun error payloads. +kubebuilder:validation:Enum=success;retry;terminal;rateLimited;unknown

const (
	StructuredErrorExitClassSuccess     StructuredErrorExitClass = "success"
	StructuredErrorExitClassRetry       StructuredErrorExitClass = "retry"
	StructuredErrorExitClassTerminal    StructuredErrorExitClass = "terminal"
	StructuredErrorExitClassRateLimited StructuredErrorExitClass = "rateLimited"
	StructuredErrorExitClassUnknown     StructuredErrorExitClass = "unknown"
)

type StructuredErrorType added in v0.1.4

type StructuredErrorType string

StructuredErrorType categorizes the failure in a machine-readable way. +kubebuilder:validation:Enum=timeout;storage_error;serialization_error;validation_error;initialization_error;execution_error;unknown

const (
	StructuredErrorTypeTimeout        StructuredErrorType = "timeout"
	StructuredErrorTypeStorage        StructuredErrorType = "storage_error"
	StructuredErrorTypeSerialization  StructuredErrorType = "serialization_error"
	StructuredErrorTypeValidation     StructuredErrorType = "validation_error"
	StructuredErrorTypeInitialization StructuredErrorType = "initialization_error"
	StructuredErrorTypeExecution      StructuredErrorType = "execution_error"
	StructuredErrorTypeUnknown        StructuredErrorType = "unknown"
)

type TerminateTarget

type TerminateTarget struct {
	// StopMode defines the final phase of the StoryRun (e.g., success, failure).
	// +kubebuilder:validation:Required
	StopMode enums.StopMode `json:"stopMode"`
}

TerminateTarget specifies how a terminal step should conclude the workflow.

func (*TerminateTarget) DeepCopy

func (in *TerminateTarget) DeepCopy() *TerminateTarget

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TerminateTarget.

func (*TerminateTarget) DeepCopyInto

func (in *TerminateTarget) DeepCopyInto(out *TerminateTarget)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TraceInfo added in v0.1.4

type TraceInfo struct {
	// TraceID is the OpenTelemetry trace identifier.
	// +optional
	TraceID string `json:"traceId,omitempty"`
	// SpanID is the OpenTelemetry span identifier associated with the trace.
	// +optional
	SpanID string `json:"spanId,omitempty"`
	// Sampled reports whether the trace was sampled when recorded.
	// +optional
	Sampled *bool `json:"sampled,omitempty"`
}

TraceInfo captures the OpenTelemetry trace context associated with a run.

func (*TraceInfo) DeepCopy added in v0.1.4

func (in *TraceInfo) DeepCopy() *TraceInfo

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TraceInfo.

func (*TraceInfo) DeepCopyInto added in v0.1.4

func (in *TraceInfo) DeepCopyInto(out *TraceInfo)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TriggerDeliveryIdentity added in v0.1.4

type TriggerDeliveryIdentity struct {
	// Mode records how the trigger identity was derived.
	// +optional
	Mode *bubuv1alpha1.TriggerDedupeMode `json:"mode,omitempty"`

	// Key is the stable business key used for token/key dedupe modes.
	// +kubebuilder:validation:MaxLength=256
	// +optional
	Key string `json:"key,omitempty"`

	// InputHash is the canonical sha256 of the resolved trigger inputs.
	// Required when Key is set.
	// +kubebuilder:validation:MaxLength=64
	// +optional
	InputHash string `json:"inputHash,omitempty"`

	// SubmissionID identifies one logical trigger submission attempt chain.
	// Retries for the same submission must reuse this value.
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:validation:MaxLength=253
	SubmissionID string `json:"submissionId"`
}

TriggerDeliveryIdentity captures the durable business identity for a trigger submission.

func (*TriggerDeliveryIdentity) DeepCopy added in v0.1.4

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TriggerDeliveryIdentity.

func (*TriggerDeliveryIdentity) DeepCopyInto added in v0.1.4

func (in *TriggerDeliveryIdentity) DeepCopyInto(out *TriggerDeliveryIdentity)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

Jump to

Keyboard shortcuts

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