Help us shape the future of Go! Take the 2026 Go Developer Survey

operator

package
v1.9.3 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2026 License: MIT Imports: 21 Imported by: 0

Documentation

Overview

Package operator exposes authorized, payload-safe durable execution reads.

Index

Constants

View Source
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"
)
View Source
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"
)
View Source
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"
)
View Source
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"
)
View Source
const DiscoveryBudget = 32

Variables

View Source
var (
	ErrBuildMismatch       = errors.New("dispatch: execution build mismatch")
	ErrRuntimeUnavailable  = errors.New("dispatch: compatible runtime unavailable")
	ErrHistoryIncompatible = errors.New("dispatch: execution history incompatible")
)

Functions

func KnownAction

func KnownAction(action string) bool

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 Acceptance struct {
	durable.Key
	RequestID     string `json:"request_id"`
	Revision      string `json:"revision"`
	FirstSequence string `json:"first_sequence"`
	LastSequence  string `json:"last_sequence"`
	Status        string `json:"status"`
	Started       bool   `json:"started,omitempty"`
}

type Authorizer

type Authorizer interface {
	Authorize(context.Context, security.Principal, string, Resource) error
}

type AuthorizerFunc

type AuthorizerFunc func(context.Context, security.Principal, string, Resource) error

func (AuthorizerFunc) Authorize

type BuildInput

type BuildInput struct {
	Namespace string `json:"namespace"`
	BuildID   string `json:"build_id"`
}

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 Capabilities struct {
	Runtime string          `json:"runtime"`
	Actions map[string]bool `json:"actions"`
}

type CapabilitiesInput

type CapabilitiesInput struct {
	durable.Key
	BuildID      string `json:"build_id"`
	WorkflowType string `json:"workflow_type"`
}

type Chain

type Chain struct {
	Page[Execution]
	Restricted bool `json:"restricted"`
}

type Children

type Children struct {
	Page[Link]
	Restricted bool `json:"restricted"`
}

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

type CursorKeys struct {
	Active string
	Keys   map[string][]byte
}

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 Deliveries struct {
	Page[Delivery]
	Pending           string `json:"pending"`
	Blocked           string `json:"blocked"`
	RemoteDelivery    string `json:"remote_delivery"`
	ExternalAnchoring string `json:"external_anchoring"`
}

type Delivery

type Delivery struct {
	ID             string     `json:"id"`
	State          string     `json:"state"`
	Attempts       string     `json:"attempts"`
	AcceptedAt     time.Time  `json:"accepted_at"`
	SinkAcceptedAt *time.Time `json:"sink_accepted_at"`
	NextAttemptAt  *time.Time `json:"next_attempt_at"`
}

type DeliveryInput

type DeliveryInput struct {
	durable.Key
	Destination durable.Destination `json:"destination"`
	Cursor      string              `json:"cursor,omitempty"`
	Limit       int                 `json:"limit,omitempty"`
}

type Detail

type Detail struct {
	Execution
	Links           []Link    `json:"links"`
	LinksRestricted bool      `json:"links_restricted"`
	AsOf            time.Time `json:"as_of"`
}

type EnrollmentInput

type EnrollmentInput struct {
	NamespaceLifecycleInput
	RequestID string `json:"request_id"`
}

type Event

type Event struct {
	Type     string    `json:"type"`
	Sequence string    `json:"sequence"`
	Time     time.Time `json:"time"`
}

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 Link struct {
	Kind       string `json:"kind"`
	Namespace  string `json:"namespace"`
	WorkflowID string `json:"workflow_id"`
	RunID      string `json:"run_id"`
}

type LocalWorkerControl

type LocalWorkerControl struct{ Worker *drt.Worker }

LocalWorkerControl exposes an already constructed Worker, including before Run.

func (LocalWorkerControl) BeginDrain

func (LocalWorkerControl) Readiness

func (LocalWorkerControl) Status

func (LocalWorkerControl) WaitDrain

type Namespace

type Namespace struct {
	Namespace string `json:"namespace"`
	AppID     string `json:"app_id"`
	TenantID  string `json:"tenant_id"`
}

type NamespaceInput

type NamespaceInput struct {
	Cursor string `json:"cursor,omitempty"`
	Limit  int    `json:"limit,omitempty"`
}

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 Payload

type Payload struct {
	State    string `json:"state"`
	Encoding string `json:"encoding"`
	Input    []byte `json:"input"`
	Output   []byte `json:"output"`
	Revision string `json:"revision"`
}

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 QueryResult struct {
	durable.Key
	State        durable.State `json:"state"`
	Revision     string        `json:"revision"`
	LastSequence string        `json:"last_sequence"`
	Encoding     string        `json:"encoding"`
	Output       []byte        `json:"output"`
}

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

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 RunInput

type RunInput struct {
	durable.Key
	Cursor string `json:"cursor,omitempty"`
	Limit  int    `json:"limit,omitempty"`
}

type Service

type Service struct {
	// contains filtered or unexported fields
}

func New

func New(o Options) (*Service, error)

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) Capabilities

Capabilities is an observation of current policy. Every operation rechecks it.

func (*Service) Chain

func (s *Service) Chain(ctx context.Context, p security.Principal, in RunInput) (Chain, error)

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) Children

func (s *Service) Children(ctx context.Context, p security.Principal, in RunInput) (Children, 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 (*Service) Complete

func (*Service) Deliveries

func (s *Service) Deliveries(ctx context.Context, p security.Principal, in DeliveryInput) (Deliveries, error)

func (*Service) Detail

func (s *Service) Detail(ctx context.Context, p security.Principal, key durable.Key) (Detail, error)

func (*Service) EnrollRetirement

func (*Service) Executions

func (*Service) FinalizeBuild

func (*Service) FinishQueryRuntimeRemoval

func (s *Service) FinishQueryRuntimeRemoval(ctx context.Context, p security.Principal, in QueryRemovalInput) (QueryRuntimeAcceptance, error)

func (*Service) Heartbeat

func (*Service) History

func (s *Service) History(ctx context.Context, p security.Principal, in RunInput) (Page[Event], error)

func (*Service) Namespaces

func (s *Service) Namespaces(ctx context.Context, p security.Principal, in NamespaceInput) (Page[Namespace], error)

func (*Service) Payload

func (s *Service) Payload(ctx context.Context, p security.Principal, key durable.Key) (Payload, error)

func (*Service) Query

func (*Service) QueryRuntime

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

ReadQueryRemovalRevalidation returns only the compact authenticated receipt.

func (*Service) RegisterBuild

RegisterBuild captures configured host identity only after accepted-command recovery.

func (*Service) RegisterQueryRuntime

func (*Service) RequestWorkerDrain

RequestWorkerDrain recovers persistence before invoking the same process handle. Lost replies leave acceptance separate from process completion.

func (*Service) ResumeBuild

func (*Service) RetireBuild

func (*Service) RevalidateQueryRuntimeRemoval

RevalidateQueryRuntimeRemoval recovers exact commands before obtaining new proof.

func (*Service) Signal

func (*Service) SignalStart

func (s *Service) SignalStart(ctx context.Context, p security.Principal, in SignalStartInput) (Acceptance, error)

func (*Service) Start

func (*Service) Tasks

func (*Service) VerifyQueryRuntime

func (*Service) WorkerDrainReceipt

WorkerDrainReceipt reads acceptance without invoking or changing the process.

func (*Service) WorkerStatus

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 WardenAuthorizer struct {
	Engine func() (*warden.Engine, error)
}

func (*WardenAuthorizer) Authorize

func (a *WardenAuthorizer) Authorize(ctx context.Context, p security.Principal, action string, r Resource) error

type WorkerClaimObservation

type WorkerClaimObservation struct {
	Kind       string `json:"kind"`
	Claiming   string `json:"claiming"`
	Processing string `json:"processing"`
}

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"`
}

Jump to

Keyboard shortcuts

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