Versions in this module Expand all Collapse all v0 v0.11.0 Oct 25, 2026 v0.10.0 Oct 20, 2026 Changes in this version + const DefaultMemoryUpgradeAttempts + const MaxChunkBytes + var ErrChunkTooLarge = errors.New("recording chunk exceeds maximum size") + var ErrConflict = errors.New("execution record conflicts with existing record") + var ErrDisabled = errors.New("execution storage is disabled") + var ErrFenced = errors.New("upgrade attempt lease fence rejected the caller") + var ErrFinalized = errors.New("recording is already finalized") + var ErrIdempotencyConflict = errors.New("idempotency key already used with a different request") + var ErrLeaseExpired = errors.New("upgrade attempt lease expired") + var ErrNotFinalized = errors.New("recording is not finalized") + var ErrNotFound = errors.New("execution record not found") + var ErrNotReady = errors.New("execution storage is not ready") + var ErrOverCapacity = errors.New("ephemeral storage capacity exceeded") + var ErrSeqGap = errors.New("recording chunk sequence is not contiguous") + var ErrTampered = errors.New("recording chunk failed integrity verification") + var ErrTruncated = errors.New("recording is missing chunks") + var ErrVMReserved = errors.New("another active upgrade attempt holds this VM reservation") + var ValidAttemptStates = []AttemptState + func DeriveKeyID(key []byte) string + type AgentUpgradeAttempt struct + ActorUID string + AllowReboot bool + AttemptID string + CancelRequested bool + CreatedAt time.Time + ErrorCode string + ExecutionID string + ExpectedInstalledInventorySHA256 string + ExpectedRevocationEpoch uint64 + IdempotencyKey string + JournalSequence uint64 + LeaseExpiresAt time.Time + LeaseFence uint64 + LeaseOwner string + Namespace string + PhaseTimes map[AttemptState]time.Time + Predecessor AttemptPredecessor + RecordingID string + State AttemptState + TargetID string + TargetManifestSHA256 string + UpdatedAt time.Time + VMUID string + WorkspaceName string + WorkspaceUID string + func (a AgentUpgradeAttempt) Clone() AgentUpgradeAttempt + func (a AgentUpgradeAttempt) RequestFingerprint() string + type AgentUpgradeStore interface + ActiveAttempt func(ctx context.Context, vmUID string) (AgentUpgradeAttempt, error) + ClaimLease func(ctx context.Context, attemptID, owner string, now time.Time, ttl time.Duration) (uint64, error) + Close func() error + Get func(ctx context.Context, attemptID string) (AgentUpgradeAttempt, error) + GetByIdempotency func(ctx context.Context, namespace, workspaceName, key string) (AgentUpgradeAttempt, error) + Ready func(ctx context.Context) error + ReleaseLease func(ctx context.Context, attemptID, owner string, fence uint64) error + RenewLease func(ctx context.Context, attemptID, owner string, fence uint64, now time.Time, ...) error + RequestCancel func(ctx context.Context, attemptID string, now time.Time) error + Reserve func(ctx context.Context, a AgentUpgradeAttempt) error + Transition func(ctx context.Context, attemptID string, from AttemptState, t AttemptTransition) error + func NewMemoryAgentUpgrades(capacity int) (AgentUpgradeStore, error) + func NewPostgresAgentUpgrades(ctx context.Context, databaseURL string) (AgentUpgradeStore, error) + type AttemptPredecessor struct + ManifestSHA256 string + TargetID string + type AttemptState string + const AttemptAdmitted + const AttemptAwaitingReboot + const AttemptCancelled + const AttemptFailed + const AttemptInstalling + const AttemptManualRecoveryRequired + const AttemptPrepared + const AttemptRecordingLost + const AttemptRollbackPending + const AttemptRolledBack + const AttemptRollingBack + const AttemptStaging + const AttemptSucceeded + const AttemptUnknown + const AttemptVerifying + func (s AttemptState) Claimable() bool + func (s AttemptState) HoldsReservation() bool + func (s AttemptState) RecordingFinal() bool + func (s AttemptState) Terminal() bool + func (s AttemptState) Valid() bool + type AttemptTransition struct + CancelRequested *bool + ErrorCode string + Fence *uint64 + JournalSequence *uint64 + Now time.Time + Predecessor *AttemptPredecessor + To AttemptState + type AuditEvent struct + ActorID string + Detail map[string]string + ExecutionID string + Kind string + Time time.Time + type Durability string + const DurabilityDurable + const DurabilityNone + type EnrollmentCredential struct + CSRHash string + CertificateDER []byte + ExpiresAt time.Time + Generation string + Namespace string + RevocationEpoch uint64 + TokenHash string + WorkspaceName string + WorkspaceUID string + type EnrollmentStore interface + Close func() error + Create func(ctx context.Context, credential EnrollmentCredential) error + Get func(ctx context.Context, tokenHash string) (EnrollmentCredential, error) + Ready func(ctx context.Context) error + Redeem func(ctx context.Context, tokenHash, csrHash string, certificateDER []byte, ...) ([]byte, error) + func NewMemoryEnrollment(capacity int) (EnrollmentStore, error) + func NewPostgresEnrollment(ctx context.Context, databaseURL string) (EnrollmentStore, error) + type ExecutionOutcome struct + EndTime time.Time + ExitCode *int + RecordingLost bool + StartTime time.Time + State State + Termination string + type ExecutionRecord struct + ActorID string + AdmissionTime time.Time + Admitted bool + DenyReason string + Durability Durability + Elevated bool + ExecutionID string + GrantVersion string + Mode string + Namespace string + OSIdentity string + Operation Operation + RecordingID string + WorkspaceGeneration int64 + WorkspaceName string + WorkspaceUID string + type Filter struct + ActorID string + Limit int + Namespace string + Since time.Time + WorkspaceName string + type FinalizeMeta struct + ActorID string + EndTime time.Time + type Manifest struct + Authentication string + Chain string + Chunks uint64 + CreatedAt time.Time + FinalizedAt time.Time + KeyID string + PlaintextBytes int64 + RecordingID string + Version int + type MetadataStore interface + Audit func(ctx context.Context, ev AuditEvent) error + Close func() error + Create func(ctx context.Context, rec ExecutionRecord) error + Get func(ctx context.Context, id string) (ExecutionRecord, ExecutionOutcome, error) + List func(ctx context.Context, f Filter) ([]ExecutionRecord, error) + Ready func(ctx context.Context) error + Reserve func(ctx context.Context, rec ExecutionRecord) error + Transition func(ctx context.Context, id string, outcome ExecutionOutcome) error + func NewEphemeralMetadata() MetadataStore + func NewPostgresMetadata(ctx context.Context, databaseURL string) (MetadataStore, error) + type Operation string + const OperationCommand + const OperationScript + const OperationShell + const OperationUpgrade + type Options struct + DatabaseURL string + EphemeralDir string + EphemeralMaxBytes int64 + KeyID string + Mode string + RecordingKey []byte + S3 S3Options + type Reader interface + Close func() error + Manifest func() Manifest + ReadChunk func(ctx context.Context, index uint64) ([]byte, error) + Verify func(ctx context.Context) error + type Recorder interface + Abort func(ctx context.Context) error + Finalize func(ctx context.Context, meta FinalizeMeta) error + PutChunk func(ctx context.Context, index uint64, plaintext []byte) error + type RecordingStore interface + Begin func(ctx context.Context, recordingID string) (Recorder, error) + Close func() error + Open func(ctx context.Context, recordingID string) (Reader, error) + Ready func(ctx context.Context) error + func NewEphemeralRecording(base string, key []byte, keyID string, maxBytes int64) (RecordingStore, error) + func NewS3Recording(cfg S3Options, key []byte, keyID string) (RecordingStore, error) + type S3Options struct + AccessKey string + Bucket string + CAFile string + CreateBucket bool + Endpoint string + ForcePathStyle bool + Region string + SecretKey string + func (o S3Options) String() string + type State string + const StateAdmitted + const StateCancelled + const StateFailed + const StateRecordingLost + const StateRevoked + const StateRunning + const StateSucceeded + const StateTimedOut + const StateUnknown + func (s State) Terminal() bool + type Store interface + Close func() error + Durability func() Durability + Metadata func() MetadataStore + Mode func() string + Ready func(ctx context.Context) error + Recording func() RecordingStore + func Open(ctx context.Context, opts Options) (Store, error)