Documentation
¶
Overview ¶
Package ledger defines durable execution admission and recovery contracts without database or queue implementations.
Index ¶
- func IsTerminalExecutionState(state ExecutionState) bool
- type AtomicAdmissionStore
- type DurableAdmission
- type ExecutionArtifact
- type ExecutionLease
- type ExecutionLeaseRenewer
- type ExecutionLedger
- type ExecutionPlanRecord
- type ExecutionRecord
- type ExecutionState
- type FactApplication
- type RecoveryStats
- type RecoveryStatsReader
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsTerminalExecutionState ¶
func IsTerminalExecutionState(state ExecutionState) bool
Types ¶
type AtomicAdmissionStore ¶
type AtomicAdmissionStore interface {
ExecutionLedger
AdmitExecutionAtomic(context.Context, DurableAdmission) (ExecutionRecord, bool, error)
}
type DurableAdmission ¶
type DurableAdmission struct {
Artifact ExecutionArtifact
Execution ExecutionRecord
FactApplication FactApplication
Plans []ExecutionPlanRecord
Sagas []workflow.CreateSagaRequest
InitialSteps []workflow.EnqueueStepRequest
}
type ExecutionArtifact ¶
type ExecutionArtifact struct {
GenerationDigest string
IRDigest string
IRBytes []byte
Environment json.RawMessage
ExecutorManifest json.RawMessage
FunctionManifest json.RawMessage
SourceDigest string
CompilerMetadata json.RawMessage
CreatedAt time.Time
}
type ExecutionLease ¶
type ExecutionLeaseRenewer ¶ added in v0.5.0
type ExecutionLeaseRenewer interface {
RenewExecutionLease(context.Context, ExecutionLease, time.Duration) (ExecutionLease, error)
}
ExecutionLeaseRenewer extends an unexpired recovery lease without changing its owner, token, or revision. Old handles remain valid while that lease is current. Implementations must reject expired or replaced leases atomically. Recovery uses this optional capability for executions longer than one lease. Stores without it are limited to the original lease's safe execution window.
type ExecutionLedger ¶
type ExecutionLedger interface {
PutArtifact(context.Context, ExecutionArtifact) error
GetArtifact(context.Context, string) (ExecutionArtifact, error)
AdmitExecution(context.Context, DurableAdmission) (ExecutionRecord, bool, error)
GetExecution(context.Context, string) (ExecutionRecord, error)
GetExecutionByAdmission(context.Context, string) (ExecutionRecord, error)
SetExecutionState(context.Context, string, uint64, ExecutionState, string) (ExecutionRecord, error)
LeaseExecutions(context.Context, string, int, time.Duration) ([]ExecutionLease, error)
FinishExecutionLease(context.Context, ExecutionLease, ExecutionState, string) error
}
type ExecutionPlanRecord ¶
type ExecutionRecord ¶
type ExecutionRecord struct {
ExecutionID string
AdmissionIdentity string
RequestHash string
Ruleset string
Version string
TenantNamespace string
MergePolicy string
GenerationDigest string
EffectiveFacts json.RawMessage
State ExecutionState
Revision uint64
RecoveryOwner string
RecoveryToken string
RecoveryDeadline time.Time
LastError string
CreatedAt time.Time
UpdatedAt time.Time
Plans []ExecutionPlanRecord
}
type ExecutionState ¶
type ExecutionState string
const ( ExecutionAdmitting ExecutionState = "admitting" ExecutionAccepted ExecutionState = "accepted" ExecutionRunning ExecutionState = "running" ExecutionCompleted ExecutionState = "completed" ExecutionFailed ExecutionState = "failed" ExecutionBlockedUnknown ExecutionState = "blocked_unknown" ExecutionBlockedFence ExecutionState = "blocked_fence" ExecutionBlockedDependency ExecutionState = "blocked_dependency" ExecutionBlockedCompensation ExecutionState = "blocked_compensation" )
type FactApplication ¶
type RecoveryStats ¶
type RecoveryStatsReader ¶
type RecoveryStatsReader interface {
RecoveryStats(context.Context) (RecoveryStats, error)
}
RecoveryStatsReader reports uncapped durable populations without acquiring recovery leases.