Documentation
¶
Overview ¶
Package operator exposes authorized, payload-safe durable execution reads.
Index ¶
- Constants
- Variables
- func KnownAction(action string) bool
- func RegisterNamespaceSchema(ctx context.Context, store resourcetype.Store, n durable.NamespaceRecord) error
- type Acceptance
- type Authorizer
- type AuthorizerFunc
- type BuildInput
- type BuildLifecycle
- type BuildRetirementInput
- type CallbackHandle
- type CallbackToken
- type Capabilities
- type CapabilitiesInput
- type Chain
- type Children
- type Compatibility
- type CompletionInput
- type CursorKeys
- type Deliveries
- type Delivery
- type DeliveryInput
- type Detail
- type EnrollmentInput
- type Event
- type Execution
- type HeartbeatInput
- type LifecycleAcceptance
- type LifecycleHost
- type Link
- type LocalWorkerControl
- func (c LocalWorkerControl) BeginDrain(ctx context.Context, r drt.DrainRequest) (drt.DrainHandle, error)
- func (c LocalWorkerControl) Readiness(ctx context.Context) (drt.WorkerReadiness, error)
- func (c LocalWorkerControl) Status(ctx context.Context) (drt.WorkerStatus, error)
- func (c LocalWorkerControl) WaitDrain(ctx context.Context, h drt.DrainHandle) (drt.DrainResult, error)
- type Namespace
- type NamespaceInput
- type NamespaceLifecycleInput
- type Options
- type Page
- type Payload
- type QueryCommitInput
- type QueryCommitStatus
- type QueryGuardAcceptance
- type QueryGuardCloseInput
- type QueryGuardInput
- type QueryGuardReadInput
- type QueryGuardReceiptInput
- type QueryGuardScope
- type QueryRegistrationPolicy
- type QueryRemovalAcceptance
- type QueryRemovalCheck
- type QueryRemovalCompletionVerifier
- type QueryRemovalFence
- type QueryRemovalInput
- type QueryReservationInput
- type QueryResult
- type QueryRevalidationInput
- type QueryRuntime
- type QueryRuntimeAcceptance
- type QueryRuntimeCommand
- type QueryRuntimeHost
- type QueryRuntimeInput
- type RegisterBuildInput
- type Resource
- type RunInput
- type Service
- func (s *Service) AbortQueryRuntimeRemoval(ctx context.Context, p security.Principal, in QueryRemovalInput) (QueryRuntimeAcceptance, error)
- func (s *Service) BeginQueryRuntimeRemoval(ctx context.Context, p security.Principal, in QueryRuntimeCommand) (QueryRemovalAcceptance, error)
- func (s *Service) BindQueryRemovalCommit(ctx context.Context, p security.Principal, in QueryCommitInput) (QueryGuardAcceptance, error)
- func (s *Service) BuildLifecycle(ctx context.Context, p security.Principal, in BuildInput) (BuildLifecycle, error)
- func (s *Service) Cancel(ctx context.Context, p security.Principal, r durable.CancelExecutionRequest) (Acceptance, error)
- func (s *Service) Capabilities(ctx context.Context, p security.Principal, in CapabilitiesInput) (Capabilities, error)
- func (s *Service) Chain(ctx context.Context, p security.Principal, in RunInput) (Chain, error)
- func (s *Service) CheckQueryRemovalCommit(ctx context.Context, p security.Principal, in QueryGuardReadInput) (QueryCommitStatus, error)
- func (s *Service) CheckQueryRuntimeRemoval(ctx context.Context, p security.Principal, in QueryReservationInput) (QueryRemovalCheck, error)
- func (s *Service) Children(ctx context.Context, p security.Principal, in RunInput) (Children, error)
- func (s *Service) CloseQueryRemovalGuard(ctx context.Context, p security.Principal, in QueryGuardCloseInput) (QueryGuardAcceptance, error)
- func (s *Service) Compatibility(ctx context.Context, p security.Principal, in NamespaceLifecycleInput) (Compatibility, error)
- func (s *Service) Complete(ctx context.Context, p security.Principal, in CompletionInput) (Acceptance, error)
- func (s *Service) Deliveries(ctx context.Context, p security.Principal, in DeliveryInput) (Deliveries, error)
- func (s *Service) Detail(ctx context.Context, p security.Principal, key durable.Key) (Detail, error)
- func (s *Service) EnrollRetirement(ctx context.Context, p security.Principal, in EnrollmentInput) (LifecycleAcceptance, error)
- func (s *Service) Executions(ctx context.Context, p security.Principal, in durable.ExecutionList) (Page[Execution], error)
- func (s *Service) FinalizeBuild(ctx context.Context, p security.Principal, in BuildRetirementInput) (LifecycleAcceptance, error)
- func (s *Service) FinishQueryRuntimeRemoval(ctx context.Context, p security.Principal, in QueryRemovalInput) (QueryRuntimeAcceptance, error)
- func (s *Service) Heartbeat(ctx context.Context, p security.Principal, in HeartbeatInput) (Acceptance, error)
- func (s *Service) History(ctx context.Context, p security.Principal, in RunInput) (Page[Event], error)
- func (s *Service) Namespaces(ctx context.Context, p security.Principal, in NamespaceInput) (Page[Namespace], error)
- func (s *Service) Payload(ctx context.Context, p security.Principal, key durable.Key) (Payload, error)
- func (s *Service) Query(ctx context.Context, p security.Principal, in drt.QueryRequest) (QueryResult, error)
- func (s *Service) QueryRuntime(ctx context.Context, p security.Principal, in QueryRuntimeInput) (QueryRuntime, error)
- func (s *Service) ReadQueryRemovalGuardReceipt(ctx context.Context, p security.Principal, in QueryGuardReceiptInput) (QueryGuardAcceptance, error)
- func (s *Service) ReadQueryRemovalRevalidation(ctx context.Context, p security.Principal, in QueryGuardReadInput) (durable.QueryRemovalRevalidationReceipt, error)
- func (s *Service) RegisterBuild(ctx context.Context, p security.Principal, in RegisterBuildInput) (LifecycleAcceptance, error)
- func (s *Service) RegisterQueryRuntime(ctx context.Context, p security.Principal, in QueryRuntimeCommand) (QueryRuntimeAcceptance, error)
- func (s *Service) RequestWorkerDrain(ctx context.Context, p security.Principal, in WorkerDrainInput) (WorkerDrainAcceptance, error)
- func (s *Service) ResumeBuild(ctx context.Context, p security.Principal, in BuildRetirementInput) (LifecycleAcceptance, error)
- func (s *Service) RetireBuild(ctx context.Context, p security.Principal, in BuildRetirementInput) (LifecycleAcceptance, error)
- func (s *Service) RevalidateQueryRuntimeRemoval(ctx context.Context, p security.Principal, in QueryRevalidationInput) (durable.QueryRemovalRevalidationReceipt, error)
- func (s *Service) Signal(ctx context.Context, p security.Principal, r durable.SignalRequest) (Acceptance, error)
- func (s *Service) SignalStart(ctx context.Context, p security.Principal, in SignalStartInput) (Acceptance, error)
- func (s *Service) Start(ctx context.Context, p security.Principal, in StartInput) (Acceptance, error)
- func (s *Service) Tasks(ctx context.Context, p security.Principal, in durable.TaskList) (Page[Task], error)
- func (s *Service) VerifyQueryRuntime(ctx context.Context, p security.Principal, in QueryRuntimeCommand) (QueryRuntimeAcceptance, error)
- func (s *Service) WorkerDrainReceipt(ctx context.Context, p security.Principal, in WorkerDrainInput) (WorkerDrainAcceptance, error)
- func (s *Service) WorkerStatus(ctx context.Context, p security.Principal, in WorkerInput) (WorkerObservation, error)
- type SignalStartInput
- type StartInput
- type Task
- type TaskDeferral
- type WardenAuthorizer
- type WorkerClaimObservation
- type WorkerControl
- type WorkerDrainAcceptance
- type WorkerDrainInput
- type WorkerInput
- type WorkerObservation
Constants ¶
const ( Discover = "dispatch.namespace.discover" ListExecutions = "dispatch.execution.list" ReadExecution = "dispatch.execution.read" ReadHistory = "dispatch.history.read" ReadTasks = "dispatch.task.read" ReadChain = "dispatch.chain.read" ReadPayload = "dispatch.payload.read" QueryWorkflow = "dispatch.workflow.query" ReadAudit = "dispatch.audit.read" ReadHooks = "dispatch.hook.read" StartWorkflow = "dispatch.workflow.start" SignalWorkflow = "dispatch.workflow.signal" SignalStartWorkflow = "dispatch.workflow.signal_start" CancelWorkflow = "dispatch.workflow.cancel" CompleteActivity = "dispatch.activity.complete" HeartbeatActivity = "dispatch.activity.heartbeat" )
const ( ReadBuild = "dispatch.build.read" EnrollRetirement = "dispatch.retirement.enroll" RegisterBuild = "dispatch.build.register" RetireBuild = "dispatch.build.retire" FinalizeBuild = "dispatch.build.finalize" ResumeBuild = "dispatch.build.resume" ReadWorker = "dispatch.worker.read" DrainWorker = "dispatch.worker.drain" )
const ( ReadQueryRuntime = "dispatch.query_runtime.read" RegisterQueryRuntime = "dispatch.query_runtime.register" VerifyQueryRuntime = "dispatch.query_runtime.verify" RemoveQueryRuntime = "dispatch.query_runtime.remove" FinishQueryRuntime = "dispatch.query_runtime.finish" AbortQueryRuntime = "dispatch.query_runtime.abort" )
const ( RevalidateQueryRuntime = "dispatch.query_runtime.revalidate" ReadQueryRevalidation = "dispatch.query_runtime.revalidation.read" CommitQueryRemoval = "dispatch.query_runtime.commit" ReadQueryCommit = "dispatch.query_runtime.commit.read" CloseQueryGuard = "dispatch.query_runtime.guard.close" ReadQueryGuard = "dispatch.query_runtime.guard.read" )
const DiscoveryBudget = 32
Variables ¶
var ( ErrBuildMismatch = errors.New("dispatch: execution build mismatch") ErrHistoryIncompatible = errors.New("dispatch: execution history incompatible") )
Functions ¶
func KnownAction ¶
func RegisterNamespaceSchema ¶
func RegisterNamespaceSchema(ctx context.Context, store resourcetype.Store, n durable.NamespaceRecord) error
RegisterNamespaceSchema declares the known actions without granting them. Hosts call this during policy provisioning, with persisted namespace ownership.
Types ¶
type Acceptance ¶
type Authorizer ¶
type AuthorizerFunc ¶
type BuildInput ¶
type BuildLifecycle ¶
type BuildLifecycle struct {
BuildInput
State string `json:"state"`
Epoch string `json:"epoch"`
Version string `json:"version"`
CompatibilityVersion string `json:"compatibility_version"`
ObservedAt time.Time `json:"observed_at"`
HasBlockers bool `json:"has_blockers"`
Blockers map[string]string `json:"blockers"`
RetainedExecutions string `json:"retained_executions"`
VerifiedQueryRuntimes string `json:"verified_query_runtimes"`
}
type BuildRetirementInput ¶
type BuildRetirementInput struct {
BuildInput
RequestID string `json:"request_id"`
ExpectedVersion string `json:"expected_version"`
ExpectedEpoch string `json:"expected_epoch"`
}
type CallbackHandle ¶
type CallbackHandle struct {
Version int `json:"version"`
Key durable.Key `json:"key"`
BuildID string `json:"build_id"`
Token CallbackToken `json:"token"`
Secret string `json:"secret"`
InitialHeartbeatSequence int64 `json:"initial_heartbeat_sequence,string"`
}
CallbackHandle is credential material, supplied only by the callback caller. The HTTP wire uses decimal strings for every 64-bit counter.
func (CallbackHandle) GoString ¶
func (h CallbackHandle) GoString() string
func (CallbackHandle) String ¶
func (h CallbackHandle) String() string
type CallbackToken ¶
type CallbackToken struct {
TaskID string `json:"task_id"`
Owner string `json:"owner"`
Epoch int64 `json:"epoch,string"`
LeaseKind durable.TaskLeaseKind `json:"lease_kind"`
}
type Capabilities ¶
type CapabilitiesInput ¶
type Compatibility ¶
type Compatibility struct {
Namespace string `json:"namespace"`
Enrolled bool `json:"enrolled"`
SchemaVersion string `json:"schema_version"`
WriterProtocol string `json:"writer_protocol"`
QueryRemovalGuardSchemaVersion string `json:"query_removal_guard_schema_version"`
QueryRemovalGuardReady bool `json:"query_removal_guard_ready"`
QuerySchemaVersion string `json:"query_schema_version"`
DrainSchemaVersion string `json:"drain_schema_version"`
Version string `json:"version"`
ObservedAt time.Time `json:"observed_at"`
}
type CompletionInput ¶
type CompletionInput struct {
Handle CallbackHandle `json:"handle"`
RequestID string `json:"request_id"`
Output []byte `json:"output,omitempty"`
Failure *drt.ApplicationError `json:"failure,omitempty"`
}
type CursorKeys ¶
CursorKeys are host-managed 32-byte keys. Retain old versions for the cursor lifetime when rotating. Never derive keys from browser input or public IDs.
type Deliveries ¶
type DeliveryInput ¶
type EnrollmentInput ¶
type EnrollmentInput struct {
NamespaceLifecycleInput
RequestID string `json:"request_id"`
}
type Execution ¶
type Execution struct {
Namespace string `json:"namespace"`
WorkflowID string `json:"workflow_id"`
RunID string `json:"run_id"`
WorkflowType string `json:"workflow_type"`
BuildID string `json:"build_id"`
State durable.State `json:"state"`
Revision string `json:"revision"`
LastSequence string `json:"last_sequence"`
RunNumber string `json:"run_number"`
RetryAttempt string `json:"retry_attempt"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
RunDeadlineAt *time.Time `json:"run_deadline_at"`
ExecutionDeadlineAt *time.Time `json:"execution_deadline_at"`
RunAvailableAt time.Time `json:"run_available_at"`
Payload string `json:"payload"`
Runtime string `json:"runtime"`
}
type HeartbeatInput ¶
type HeartbeatInput struct {
Handle CallbackHandle `json:"handle"`
RequestID string `json:"request_id"`
Sequence int64 `json:"sequence,string"`
Details []byte `json:"details,omitempty"`
}
type LifecycleAcceptance ¶
type LifecycleAcceptance struct {
Namespace string `json:"namespace"`
RequestID string `json:"request_id"`
Operation string `json:"operation"`
Status string `json:"status"`
AcceptedAt time.Time `json:"accepted_at"`
BuildID string `json:"build_id,omitempty"`
State string `json:"state,omitempty"`
Version string `json:"version,omitempty"`
Epoch string `json:"epoch,omitempty"`
}
type LifecycleHost ¶
type LifecycleHost struct {
QueryRuntime QueryRuntimeHost
QueryRegistrationPolicy QueryRegistrationPolicy
QueryRemovalGuardVerifier durable.QueryRemovalGuardVerifier
BuildIdentity func(context.Context, durable.BuildTarget) (durable.BuildQueryIdentity, error)
WorkerControl func(context.Context, durable.QueryRuntimeTarget) (WorkerControl, error)
}
LifecycleHost keeps deployment evidence and process control inside the host. Its resolvers must bind actual immutable resources, never caller-supplied proof.
type LocalWorkerControl ¶
LocalWorkerControl exposes an already constructed Worker, including before Run.
func (LocalWorkerControl) BeginDrain ¶
func (c LocalWorkerControl) BeginDrain(ctx context.Context, r drt.DrainRequest) (drt.DrainHandle, error)
func (LocalWorkerControl) Readiness ¶
func (c LocalWorkerControl) Readiness(ctx context.Context) (drt.WorkerReadiness, error)
func (LocalWorkerControl) Status ¶
func (c LocalWorkerControl) Status(ctx context.Context) (drt.WorkerStatus, error)
func (LocalWorkerControl) WaitDrain ¶
func (c LocalWorkerControl) WaitDrain(ctx context.Context, h drt.DrainHandle) (drt.DrainResult, error)
type NamespaceInput ¶
type NamespaceLifecycleInput ¶
type NamespaceLifecycleInput struct {
Namespace string `json:"namespace"`
}
type Options ¶
type Options struct {
// QueryRejection observes private diagnostics after store locks are released.
// It must cooperate with caller deadlines; panic cannot change the command result.
QueryRejection func(context.Context, durable.QueryRejectionDiagnostic)
QueryHost QueryRuntimeHost
QueryRegistrationPolicy QueryRegistrationPolicy
QueryRemovalGuardVerifier durable.QueryRemovalGuardVerifier
// WorkerControl resolves an immutable trusted process handle.
WorkerControl func(context.Context, durable.QueryRuntimeTarget) (WorkerControl, error)
// BuildIdentity resolves actual deployed artifact evidence at the trusted host.
BuildIdentity func(context.Context, durable.BuildTarget) (durable.BuildQueryIdentity, error)
Store durable.Store
Reads durable.ReadStore
Catalog durable.NamespaceStore
InstallationID string
Authorizer Authorizer
Audit security.Boundary
CursorKeys CursorKeys
// RuntimeAvailable reports read-only host availability when Runtime is absent.
// Runtime takes precedence and must resolve the exact namespace and build.
RuntimeAvailable func(namespace, build string) bool
// Runtime resolves only the requested immutable namespace/build.
Runtime func(namespace, build string) (*drt.Worker, error)
}
type Page ¶
type Page[T any] struct { Items []T `json:"items"` Cursor string `json:"cursor,omitempty"` Complete bool `json:"complete"` AsOf time.Time `json:"as_of"` Observation string `json:"observation"` Total *string `json:"total"` Revision string `json:"revision,omitempty"` HighWater string `json:"high_water,omitempty"` }
type QueryCommitInput ¶
type QueryCommitInput struct {
QueryGuardInput
RequestID string `json:"request_id"`
PermissionReference string `json:"permission_reference"`
ExpectedCurrentDigest string `json:"expected_current_digest"`
CurrentRequestID string `json:"current_request_id"`
}
QueryCommitInput names an authenticated permission and the current proof.
type QueryCommitStatus ¶
type QueryCommitStatus struct {
Receipt QueryGuardAcceptance `json:"receipt"`
State string `json:"state"`
CurrentRequestID string `json:"current_request_id"`
CurrentProofDigest string `json:"current_proof_digest"`
SourceObservedAt time.Time `json:"source_observed_at"`
ObservedAt time.Time `json:"observed_at"`
}
QueryCommitStatus reports current guard observations beside historical acceptance.
type QueryGuardAcceptance ¶
type QueryGuardAcceptance struct {
Kind string `json:"kind"`
GuardID string `json:"guard_id"`
RootDigest string `json:"root_digest"`
RequestID string `json:"request_id"`
CommandDigest string `json:"command_digest"`
ReceiptDigest string `json:"receipt_digest"`
PermissionID string `json:"permission_id"`
InvocationID string `json:"invocation_id"`
PermissionProofDigest string `json:"permission_proof_digest"`
CurrentProofDigest string `json:"current_proof_digest"`
CutoffDigest string `json:"cutoff_digest"`
Disposition string `json:"disposition"`
AcceptedAt time.Time `json:"accepted_at"`
}
QueryGuardAcceptance is historical and never grants provider delegation.
type QueryGuardCloseInput ¶
type QueryGuardCloseInput struct {
QueryGuardInput
RequestID string `json:"request_id"`
ClosureReference string `json:"closure_reference"`
}
QueryGuardCloseInput names authoritative permanent cutoff and terminal coverage.
type QueryGuardInput ¶
type QueryGuardInput struct {
QueryReservationInput
GuardID string `json:"guard_id"`
RootDigest string `json:"root_digest"`
OriginalDigest string `json:"original_digest"`
}
QueryGuardInput binds a command to the original reservation and guard root.
type QueryGuardReadInput ¶
type QueryGuardReadInput struct {
QueryReservationInput
RequestID string `json:"request_id"`
CommandDigest string `json:"command_digest"`
}
QueryGuardReadInput recovers one exact immutable command.
type QueryGuardReceiptInput ¶
type QueryGuardReceiptInput struct {
QueryGuardReadInput
Kind string `json:"kind"`
}
QueryGuardReceiptInput selects a finite saved guard command kind.
type QueryGuardScope ¶
type QueryGuardScope struct {
AuthorityID string `json:"authority_id"`
OperationScopeID string `json:"operation_scope_id"`
AttemptID string `json:"attempt_id"`
ProviderOperationID string `json:"provider_operation_id"`
CoverageDigest string `json:"coverage_digest"`
ExcludedInstancesDigest string `json:"excluded_instances_digest"`
ProducerID string `json:"producer_id"`
ProfileID string `json:"profile_id"`
ProfileVersion string `json:"profile_version"`
VerifierID string `json:"verifier_id"`
}
QueryGuardScope names one external operation. The verifier authenticates its contents.
type QueryRegistrationPolicy ¶
type QueryRegistrationPolicy func(context.Context, durable.RegisterQueryRuntimeRequest) error
QueryRegistrationPolicy authorizes new issuance against a managed instance. Accepted command replay skips this gate and never reactivates a binding.
type QueryRemovalAcceptance ¶
type QueryRemovalAcceptance struct {
QueryRuntimeAcceptance
Fence QueryRemovalFence `json:"fence"`
}
type QueryRemovalCheck ¶
type QueryRemovalCheck struct {
Fence QueryRemovalFence `json:"fence"`
CheckedAt time.Time `json:"checked_at"`
}
type QueryRemovalCompletionVerifier ¶
type QueryRemovalCompletionVerifier interface {
VerifyRemoved(context.Context, durable.QueryRemovalFence) error
}
QueryRemovalCompletionVerifier confirms removal of the exact reserved binding. It must resolve unknown issued operations before claiming completion.
type QueryRemovalFence ¶
type QueryRemovalFence struct {
QueryRuntimeInput
InstanceID string `json:"instance_id"`
CandidateVersion string `json:"candidate_version"`
SurvivorRuntimeID string `json:"survivor_runtime_id,omitempty"`
SurvivorInstanceID string `json:"survivor_instance_id,omitempty"`
SurvivorVersion string `json:"survivor_version"`
BuildEpoch string `json:"build_epoch"`
BuildVersion string `json:"build_version"`
BuildState string `json:"build_state"`
RemovalEpoch string `json:"removal_epoch"`
RequestID string `json:"request_id"`
Digest string `json:"digest"`
AcceptedAt time.Time `json:"accepted_at"`
ValidUntil time.Time `json:"valid_until"`
}
type QueryRemovalInput ¶
type QueryRemovalInput struct {
QueryReservationInput
RequestID string `json:"request_id"`
}
type QueryReservationInput ¶
type QueryReservationInput struct {
QueryRuntimeInput
ReservationRequestID string `json:"reservation_request_id"`
ReservationVersion string `json:"reservation_version"`
}
QueryReservationInput identifies the immutable accepted reservation. The version is the original pre-reservation version, not the current binding.
type QueryResult ¶
type QueryRevalidationInput ¶
type QueryRevalidationInput struct {
QueryReservationInput
RequestID string `json:"request_id"`
Scope QueryGuardScope `json:"scope"`
ExpectedCurrentDigest string `json:"expected_current_digest"`
EvidenceReference string `json:"evidence_reference"`
SurvivorRuntimeID string `json:"survivor_runtime_id"`
SurvivorVersion string `json:"survivor_version"`
}
QueryRevalidationInput carries opaque references, never trusted evidence.
type QueryRuntime ¶
type QueryRuntime struct {
QueryRuntimeInput
InstanceID string `json:"instance_id"`
IdentityVersion string `json:"identity_version"`
State string `json:"state"`
Version string `json:"version"`
RemovalEpoch string `json:"removal_epoch"`
ProofID string `json:"proof_id,omitempty"`
ProbePolicyID string `json:"probe_policy_id"`
ProbePolicyVersion string `json:"probe_policy_version"`
VerifiedAt time.Time `json:"verified_at"`
ValidUntil time.Time `json:"valid_until"`
}
type QueryRuntimeAcceptance ¶
type QueryRuntimeAcceptance struct {
LifecycleAcceptance
Binding QueryRuntime `json:"binding"`
}
type QueryRuntimeCommand ¶
type QueryRuntimeCommand struct {
QueryRuntimeInput
RequestID string `json:"request_id"`
ExpectedVersion string `json:"expected_version"`
}
type QueryRuntimeHost ¶
type QueryRuntimeHost interface {
ResolveBinding(context.Context, durable.QueryRuntimeTarget) (durable.QueryRuntimeIdentity, error)
Verify(context.Context, durable.QueryRuntimeBinding) (durable.QueryRuntimeVerification, error)
}
QueryRuntimeHost resolves actual deployed identity and probes retained history. ResolveBinding is read-only. Verify runs the configured named historical probes.
type QueryRuntimeInput ¶
type QueryRuntimeInput struct {
BuildInput
RuntimeID string `json:"runtime_id"`
}
type RegisterBuildInput ¶
type RegisterBuildInput struct {
BuildInput
RequestID string `json:"request_id"`
ExpectedVersion string `json:"expected_version"`
}
type Resource ¶
type Resource struct{ InstallationID, Namespace, AppID, TenantID, WorkflowID, RunID, WorkflowType, BuildID, RuntimeID, InstanceID, Queue string }
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func (*Service) AbortQueryRuntimeRemoval ¶
func (s *Service) AbortQueryRuntimeRemoval(ctx context.Context, p security.Principal, in QueryRemovalInput) (QueryRuntimeAcceptance, error)
func (*Service) BeginQueryRuntimeRemoval ¶
func (s *Service) BeginQueryRuntimeRemoval(ctx context.Context, p security.Principal, in QueryRuntimeCommand) (QueryRemovalAcceptance, error)
func (*Service) BindQueryRemovalCommit ¶
func (s *Service) BindQueryRemovalCommit(ctx context.Context, p security.Principal, in QueryCommitInput) (QueryGuardAcceptance, error)
BindQueryRemovalCommit authenticates a saved external permission before first bind.
func (*Service) BuildLifecycle ¶
func (s *Service) BuildLifecycle(ctx context.Context, p security.Principal, in BuildInput) (BuildLifecycle, error)
func (*Service) Cancel ¶
func (s *Service) Cancel(ctx context.Context, p security.Principal, r durable.CancelExecutionRequest) (Acceptance, error)
func (*Service) Capabilities ¶
func (s *Service) Capabilities(ctx context.Context, p security.Principal, in CapabilitiesInput) (Capabilities, error)
Capabilities is an observation of current policy. Every operation rechecks it.
func (*Service) CheckQueryRemovalCommit ¶
func (s *Service) CheckQueryRemovalCommit(ctx context.Context, p security.Principal, in QueryGuardReadInput) (QueryCommitStatus, error)
CheckQueryRemovalCommit reads active or closed state without granting a send.
func (*Service) CheckQueryRuntimeRemoval ¶
func (s *Service) CheckQueryRuntimeRemoval(ctx context.Context, p security.Principal, in QueryReservationInput) (QueryRemovalCheck, error)
func (*Service) CloseQueryRemovalGuard ¶
func (s *Service) CloseQueryRemovalGuard(ctx context.Context, p security.Principal, in QueryGuardCloseInput) (QueryGuardAcceptance, error)
CloseQueryRemovalGuard requires authenticated permanent cutoff and complete coverage.
func (*Service) Compatibility ¶
func (s *Service) Compatibility(ctx context.Context, p security.Principal, in NamespaceLifecycleInput) (Compatibility, error)
func (*Service) Complete ¶
func (s *Service) Complete(ctx context.Context, p security.Principal, in CompletionInput) (Acceptance, error)
func (*Service) Deliveries ¶
func (s *Service) Deliveries(ctx context.Context, p security.Principal, in DeliveryInput) (Deliveries, error)
func (*Service) EnrollRetirement ¶
func (s *Service) EnrollRetirement(ctx context.Context, p security.Principal, in EnrollmentInput) (LifecycleAcceptance, error)
func (*Service) Executions ¶
func (*Service) FinalizeBuild ¶
func (s *Service) FinalizeBuild(ctx context.Context, p security.Principal, in BuildRetirementInput) (LifecycleAcceptance, error)
func (*Service) FinishQueryRuntimeRemoval ¶
func (s *Service) FinishQueryRuntimeRemoval(ctx context.Context, p security.Principal, in QueryRemovalInput) (QueryRuntimeAcceptance, error)
func (*Service) Heartbeat ¶
func (s *Service) Heartbeat(ctx context.Context, p security.Principal, in HeartbeatInput) (Acceptance, error)
func (*Service) Namespaces ¶
func (*Service) Query ¶
func (s *Service) Query(ctx context.Context, p security.Principal, in drt.QueryRequest) (QueryResult, error)
func (*Service) QueryRuntime ¶
func (s *Service) QueryRuntime(ctx context.Context, p security.Principal, in QueryRuntimeInput) (QueryRuntime, error)
func (*Service) ReadQueryRemovalGuardReceipt ¶
func (s *Service) ReadQueryRemovalGuardReceipt(ctx context.Context, p security.Principal, in QueryGuardReceiptInput) (QueryGuardAcceptance, error)
ReadQueryRemovalGuardReceipt recovers one receipt without invoking the verifier.
func (*Service) ReadQueryRemovalRevalidation ¶
func (s *Service) ReadQueryRemovalRevalidation(ctx context.Context, p security.Principal, in QueryGuardReadInput) (durable.QueryRemovalRevalidationReceipt, error)
ReadQueryRemovalRevalidation returns only the compact authenticated receipt.
func (*Service) RegisterBuild ¶
func (s *Service) RegisterBuild(ctx context.Context, p security.Principal, in RegisterBuildInput) (LifecycleAcceptance, error)
RegisterBuild captures configured host identity only after accepted-command recovery.
func (*Service) RegisterQueryRuntime ¶
func (s *Service) RegisterQueryRuntime(ctx context.Context, p security.Principal, in QueryRuntimeCommand) (QueryRuntimeAcceptance, error)
func (*Service) RequestWorkerDrain ¶
func (s *Service) RequestWorkerDrain(ctx context.Context, p security.Principal, in WorkerDrainInput) (WorkerDrainAcceptance, error)
RequestWorkerDrain recovers persistence before invoking the same process handle. Lost replies leave acceptance separate from process completion.
func (*Service) ResumeBuild ¶
func (s *Service) ResumeBuild(ctx context.Context, p security.Principal, in BuildRetirementInput) (LifecycleAcceptance, error)
func (*Service) RetireBuild ¶
func (s *Service) RetireBuild(ctx context.Context, p security.Principal, in BuildRetirementInput) (LifecycleAcceptance, error)
func (*Service) RevalidateQueryRuntimeRemoval ¶
func (s *Service) RevalidateQueryRuntimeRemoval(ctx context.Context, p security.Principal, in QueryRevalidationInput) (durable.QueryRemovalRevalidationReceipt, error)
RevalidateQueryRuntimeRemoval recovers exact commands before obtaining new proof.
func (*Service) Signal ¶
func (s *Service) Signal(ctx context.Context, p security.Principal, r durable.SignalRequest) (Acceptance, error)
func (*Service) SignalStart ¶
func (s *Service) SignalStart(ctx context.Context, p security.Principal, in SignalStartInput) (Acceptance, error)
func (*Service) Start ¶
func (s *Service) Start(ctx context.Context, p security.Principal, in StartInput) (Acceptance, error)
func (*Service) VerifyQueryRuntime ¶
func (s *Service) VerifyQueryRuntime(ctx context.Context, p security.Principal, in QueryRuntimeCommand) (QueryRuntimeAcceptance, error)
func (*Service) WorkerDrainReceipt ¶
func (s *Service) WorkerDrainReceipt(ctx context.Context, p security.Principal, in WorkerDrainInput) (WorkerDrainAcceptance, error)
WorkerDrainReceipt reads acceptance without invoking or changing the process.
func (*Service) WorkerStatus ¶
func (s *Service) WorkerStatus(ctx context.Context, p security.Principal, in WorkerInput) (WorkerObservation, error)
type SignalStartInput ¶
type SignalStartInput struct {
Start StartInput `json:"start"`
Name string `json:"name"`
Input []byte `json:"input,omitempty"`
}
type StartInput ¶
type StartInput struct {
durable.Key
RequestID string `json:"request_id"`
WorkflowType string `json:"workflow_type"`
BuildID string `json:"build_id"`
Queue string `json:"queue"`
Input []byte `json:"input,omitempty"`
}
StartInput keeps byte payloads intact. Remote starts use the runtime defaults for execution timeouts and retries; internal worker APIs retain richer options.
type Task ¶
type Task struct {
Deferral *TaskDeferral `json:"deferral"`
ID string `json:"id"`
Kind durable.TaskKind `json:"kind"`
State string `json:"state"`
Attempt string `json:"attempt"`
Version string `json:"version"`
AvailableAt time.Time `json:"available_at"`
LeaseUntil *time.Time `json:"lease_until"`
DeadlineAt *time.Time `json:"deadline_at"`
HeartbeatAt *time.Time `json:"heartbeat_at"`
}
type TaskDeferral ¶
type TaskDeferral struct {
Active bool `json:"active"`
Reason string `json:"reason"`
TargetBuildID string `json:"target_build_id"`
TargetState durable.DeferralTargetState `json:"target_state"`
TargetRetirementEpoch string `json:"target_retirement_epoch"`
SourceEpoch string `json:"source_epoch"`
SourceRevision string `json:"source_revision"`
TaskVersion string `json:"task_version"`
Count string `json:"count"`
ReferenceKind durable.DeferralReferenceKind `json:"reference_kind"`
CommandID string `json:"command_id"`
RecordedAt time.Time `json:"recorded_at"`
RetryAt time.Time `json:"retry_at"`
PolicyVersion string `json:"policy_version"`
}
type WardenAuthorizer ¶
type WorkerClaimObservation ¶
type WorkerControl ¶
type WorkerControl interface {
Status(context.Context) (drt.WorkerStatus, error)
Readiness(context.Context) (drt.WorkerReadiness, error)
BeginDrain(context.Context, drt.DrainRequest) (drt.DrainHandle, error)
WaitDrain(context.Context, drt.DrainHandle) (drt.DrainResult, error)
}
WorkerControl is a trusted handle for exactly one immutable process incarnation. A host must never reconnect this handle to a replacement RuntimeID. BeginDrain must atomically refuse first acceptance after the original deadline with ErrDrainDeadline, without closing admission or cancelling work. Exact accepted replay remains available. Remote hosts enforce this at the process.
type WorkerDrainAcceptance ¶
type WorkerDrainAcceptance struct {
LifecycleAcceptance
RuntimeID string `json:"runtime_id"`
InstanceID string `json:"instance_id"`
Queue string `json:"queue"`
OperationID string `json:"operation_id"`
Deadline time.Time `json:"deadline"`
Process string `json:"process"`
Complete bool `json:"complete"`
Quiescent bool `json:"quiescent"`
DeadlineExpired bool `json:"deadline_expired"`
InFlight string `json:"in_flight"`
UnknownClaims string `json:"unknown_claims"`
}
type WorkerDrainInput ¶
type WorkerDrainInput struct {
WorkerInput
RequestID string `json:"request_id"`
OperationID string `json:"operation_id"`
Deadline time.Time `json:"deadline"`
}
type WorkerInput ¶
type WorkerInput struct {
BuildInput
RuntimeID string `json:"runtime_id"`
}
type WorkerObservation ¶
type WorkerObservation struct {
WorkerInput
InstanceID string `json:"instance_id"`
Queue string `json:"queue"`
State string `json:"state"`
Ready bool `json:"ready"`
AdmissionClosed bool `json:"admission_closed"`
InFlight string `json:"in_flight"`
UnknownClaims string `json:"unknown_claims"`
Failure string `json:"failure,omitempty"`
HostQualification string `json:"host_qualification"`
Claims []WorkerClaimObservation `json:"claims"`
RetirementStatus string `json:"retirement_status"`
Compatibility Compatibility `json:"compatibility"`
ObservedAt time.Time `json:"observed_at"`
}