Documentation
¶
Index ¶
- Constants
- func ComputeTriggerInputHash(raw []byte) (string, error)
- func ComputeTriggerInputHashFromRawExtension(inputs *runtime.RawExtension) (string, error)
- func ComputeTriggerInputHashFromValue(value any) (string, error)
- func DeriveEffectClaimName(stepRunNamespace, stepRunName, effectKey string) string
- func DeriveStoryRunName(storyNamespace, storyName, token string) string
- func DeriveStoryTriggerName(storyNamespace, storyName, key, submissionID string) string
- func SelectorLabels(storyRun string) map[string]string
- func ServiceAccountName(storyRun string) string
- func ServiceAccountSubject(name, namespace string) rbacv1.Subject
- func StepRunIdempotencyKey(namespace, storyRunName, stepID string) string
- func StoryTriggerIdentity(key, submissionID string) string
- type EngramRunner
Constants ¶
const ( // StoryRunTriggerTokenAnnotation carries the caller-provided trigger token for idempotent StoryRun creation. StoryRunTriggerTokenAnnotation = contracts.StoryRunTriggerTokenAnnotation // StoryRunTriggerInputHashAnnotation optionally carries a hash of the inputs for token-based validation. StoryRunTriggerInputHashAnnotation = "storyrun.bubustack.io/trigger-input-hash" // StoryRunRedriveTokenAnnotation requests a full redrive of the StoryRun when changed. StoryRunRedriveTokenAnnotation = "storyrun.bubustack.io/redrive-token" // StoryRunRedriveObservedAnnotation records the last redrive token processed by the controller. StoryRunRedriveObservedAnnotation = "storyrun.bubustack.io/redrive-observed" // StoryRunRedriveFromStepAnnotation requests a partial rerun starting from a step. // Format: "<step-name>:<token>" (token must change to retrigger). StoryRunRedriveFromStepAnnotation = "storyrun.bubustack.io/redrive-from-step" // StoryRunRedriveFromStepObservedAnnotation records the last redrive-from-step token processed. StoryRunRedriveFromStepObservedAnnotation = "storyrun.bubustack.io/redrive-from-step-observed" )
const ( // StoryRunTriggerRequestNameAnnotation records the originating StoryTrigger name on StoryRuns created // through the durable trigger request path. StoryRunTriggerRequestNameAnnotation = "storyrun.bubustack.io/trigger-request-name" // StoryRunTriggerRequestUIDAnnotation records the originating StoryTrigger UID on StoryRuns created // through the durable trigger request path. StoryRunTriggerRequestUIDAnnotation = "storyrun.bubustack.io/trigger-request-uid" )
Variables ¶
This section is empty.
Functions ¶
func ComputeTriggerInputHash ¶
ComputeTriggerInputHash returns a stable sha256 hash of trigger inputs. Inputs are decoded into JSON and re-encoded to ensure a canonical ordering.
func ComputeTriggerInputHashFromRawExtension ¶
func ComputeTriggerInputHashFromRawExtension(inputs *runtime.RawExtension) (string, error)
ComputeTriggerInputHashFromRawExtension returns the trigger input hash from a RawExtension.
func ComputeTriggerInputHashFromValue ¶
ComputeTriggerInputHashFromValue returns a stable sha256 hash of the provided trigger input value. Nil values are treated as an empty JSON object to match ComputeTriggerInputHash(nil).
func DeriveEffectClaimName ¶
DeriveEffectClaimName returns the deterministic EffectClaim name for the provided StepRun namespace/name and effect key.
func DeriveStoryRunName ¶
DeriveStoryRunName returns the deterministic StoryRun name for the trigger token. This matches the SDK naming algorithm so server-side validation stays consistent.
func DeriveStoryTriggerName ¶
DeriveStoryTriggerName returns the deterministic StoryTrigger name for the provided story namespace/name and trigger identity.
func SelectorLabels ¶
SelectorLabels returns a copy of the deterministic StoryRun selector labels.
func ServiceAccountName ¶
ServiceAccountName exposes the canonical `<storyRun>-engram-runner` name.
func ServiceAccountSubject ¶
ServiceAccountSubject returns an RBAC subject for the ServiceAccount in namespace.
func StepRunIdempotencyKey ¶
StepRunIdempotencyKey builds a stable idempotency key for a step execution. The key is derived from namespace, StoryRun name, and Step ID, and is trimmed to the API's max length by falling back to a hash when needed.
func StoryTriggerIdentity ¶
StoryTriggerIdentity returns the durable business identity for a trigger request. The key wins when present; otherwise the per-submission identifier is used.
Types ¶
type EngramRunner ¶
type EngramRunner struct {
// contains filtered or unexported fields
}
EngramRunner captures the shared metadata for the `<storyRun>-engram-runner` contract.
func NewEngramRunner ¶
func NewEngramRunner(storyRun string) EngramRunner
NewEngramRunner constructs a new EngramRunner helper.
func (EngramRunner) SelectorLabels ¶
func (e EngramRunner) SelectorLabels() map[string]string
SelectorLabels returns a copy of the deterministic selector labels controllers share.
func (EngramRunner) ServiceAccountName ¶
func (e EngramRunner) ServiceAccountName() string
ServiceAccountName exposes the canonical `<storyRun>-engram-runner` ServiceAccount.
func (EngramRunner) StoryRun ¶
func (e EngramRunner) StoryRun() string
StoryRun returns the owning StoryRun name.