deployment

package
v0.0.0-...-147a9b8 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalid          = errors.New("invalid Runtime deployment")
	ErrIdentityConflict = errors.New("runtime identity conflict")
	ErrStatusUnverified = errors.New("runtime status could not be verified")
)

Functions

func DigestValue

func DigestValue(value any) (string, error)

func HasMCPSecrets

func HasMCPSecrets(servers []MCPServer) bool

func LifecycleTransition

func LifecycleTransition(kind OperationKind, from LifecycleState) (LifecycleState, LifecycleState, error)

func ValidateDigest

func ValidateDigest(value string) error

func ValidateMCPSecretValues

func ValidateMCPSecretValues(servers []MCPServer, values map[string]map[string]string) error

func ValidateRevision

func ValidateRevision(value RuntimeRevision) error

Types

type Configuration

type Configuration struct {
	ManagedMCPTemplate  *MCPTemplateSource     `json:"managed_mcp_template,omitempty"`
	MCPServers          []MCPServer            `json:"mcp_servers,omitempty"`
	ImageRef            string                 `json:"image_ref"`
	Network             NetworkSpec            `json:"network"`
	Resources           ResourceLimits         `json:"resources"`
	OrganizationID      string                 `json:"organization_id,omitempty"`
	SystemSkills        []skillset.FrozenSkill `json:"system_skills,omitempty"`
	PreparedSkillSet    *skillset.PreparedSet  `json:"prepared_skill_set,omitempty"`
	PreparedReferenceID string                 `json:"prepared_reference_id,omitempty"`
	SkillScope          string                 `json:"-"`
}

Configuration is the caller-owned policy input. Deployment identity and Runtime image invariants are injected by Runtime Controller.

func (Configuration) Resolve

func (c Configuration) Resolve(agentID string, generation uint64) (Deployment, error)

func (Configuration) Validate

func (c Configuration) Validate() error

type Deployment

type Deployment struct {
	ManagedMCPTemplate      *MCPTemplateSource                `json:"managed_mcp_template,omitempty"`
	InstanceAuthentication  *instanceauth.Record              `json:"-"`
	ImageReference          string                            `json:"image_reference,omitempty"`
	ImageRef                string                            `json:"image_ref"`
	RuntimeSpec             RuntimeSpec                       `json:"runtime_spec"`
	Resources               ResourceLimits                    `json:"resources"`
	PreparedSkills          *skillset.PreparedReference       `json:"prepared_skills,omitempty"`
	PreparedMaterialization *skillset.PreparedMaterialization `json:"-"`
}

func (Deployment) ValidateFor

func (d Deployment) ValidateFor(key Key) error

type EffectOutcome

type EffectOutcome struct {
	State  EffectState `json:"state"`
	Code   string      `json:"code,omitempty"`
	Detail string      `json:"detail,omitempty"`
	Cause  error       `json:"-"`
}

func (EffectOutcome) Validate

func (o EffectOutcome) Validate() error

type EffectState

type EffectState string
const (
	EffectCompleted  EffectState = "completed"
	EffectNotStarted EffectState = "not_started"
	EffectUnknown    EffectState = "unknown"
)

type Environment

type Environment struct {
	TunnelKeyID        string
	Phase              PlatformPhase
	Reason             string
	DiagnosticSummary  string
	AgentID            string
	RuntimeRevision    RuntimeRevision
	LifecycleState     LifecycleState
	Health             HealthState
	MCPEndpoint        string
	RuntimeEndpoint    string
	RuntimeExecutionID string
	RestartCount       uint64
	ObservedAt         time.Time

	Generation  uint64
	SpecDigest  string
	OperationID string
}

func (Environment) RuntimeKey

func (e Environment) RuntimeKey() (Key, bool)

func (Environment) WithInspection

func (e Environment) WithInspection(value Inspection) Environment

type FilesystemSpec

type FilesystemSpec struct {
	Workspace    string `json:"workspace"`
	SystemSkills string `json:"system_skills"`
}

type HealthState

type HealthState string
const (
	HealthAbsent    HealthState = "absent"
	HealthStarting  HealthState = "starting"
	HealthHealthy   HealthState = "healthy"
	HealthUnhealthy HealthState = "unhealthy"
	HealthUnknown   HealthState = "unknown"
)

type IPv4Endpoint

type IPv4Endpoint struct {
	IPv4 string `json:"ipv4"`
	Port uint16 `json:"port"`
}

type Inspection

type Inspection struct {
	TunnelKeyID        string        `json:"-"`
	Reason             string        `json:"-"`
	DiagnosticSummary  string        `json:"-"`
	AgentID            string        `json:"-"`
	Generation         uint64        `json:"-"`
	SpecDigest         string        `json:"-"`
	PlatformResourceID string        `json:"-"`
	PlatformPhase      PlatformPhase `json:"-"`
	Health             HealthState   `json:"-"`
	MCPEndpoint        string        `json:"-"`
	RuntimeEndpoint    string        `json:"-"`
	RuntimeExecutionID string        `json:"-"`
	RestartCount       uint64        `json:"-"`
	ObservedAt         time.Time     `json:"-"`
	StatusEndpoint     string        `json:"-"`
}

func (Inspection) RuntimeKey

func (i Inspection) RuntimeKey() Key

type Key

type Key struct {
	AgentID    string `json:"agent_id"`
	Generation uint64 `json:"generation"`
}

func (Key) Validate

func (k Key) Validate() error

type LifecycleState

type LifecycleState string
const (
	LifecycleUninitialized LifecycleState = "uninitialized"
	LifecycleInitializing  LifecycleState = "initializing"
	LifecycleProvisioned   LifecycleState = "provisioned"
	LifecycleUpdating      LifecycleState = "updating"
	LifecycleDisabling     LifecycleState = "disabling"
	LifecycleDisabled      LifecycleState = "disabled"
	LifecycleEnabling      LifecycleState = "enabling"
	LifecycleDeleting      LifecycleState = "deleting"
	LifecycleDeleted       LifecycleState = "deleted"
	LifecycleFailed        LifecycleState = "failed"
	LifecycleUnknown       LifecycleState = "unknown"
)

type MCPSecretDescriptor

type MCPSecretDescriptor struct {
	Set         bool   `json:"set"`
	Fingerprint string `json:"fingerprint"`
}

type MCPServer

type MCPServer struct {
	ID        string                         `json:"id"`
	Command   string                         `json:"command"`
	Args      []string                       `json:"args"`
	Env       map[string]string              `json:"env"`
	SecretEnv map[string]MCPSecretDescriptor `json:"secret_env,omitempty"`
}

MCPServer is startup input, never public inspection or telemetry data.

func CloneMCPServers

func CloneMCPServers(servers []MCPServer) []MCPServer

func (MCPServer) GoString

func (server MCPServer) GoString() string

func (MCPServer) String

func (server MCPServer) String() string

type MCPTemplateSource

type MCPTemplateSource struct {
	OrganizationID string `json:"organization_id"`
	TemplateID     string `json:"template_id"`
	Revision       int64  `json:"revision"`
}

func (*MCPTemplateSource) Validate

func (source *MCPTemplateSource) Validate() error

type MaintenanceVerifierKey

type MaintenanceVerifierKey struct {
	KID                string `json:"kid"`
	Algorithm          string `json:"algorithm"`
	PublicKeyBase64URL string `json:"public_key_base64url"`
}

type MaintenanceVerifiers

type MaintenanceVerifiers struct {
	Keys []MaintenanceVerifierKey `json:"keys"`
}

func (MaintenanceVerifiers) Clone

func (MaintenanceVerifiers) Normalize

type NetworkSpec

type NetworkSpec struct {
	PacketContractRevision uint32       `json:"packet_contract_revision"`
	EgressEndpoint         IPv4Endpoint `json:"egress_endpoint"`
	TunnelIPv4             string       `json:"tunnel_ipv4"`
	ResolverIPv4           string       `json:"resolver_ipv4"`
}

type Observation

type Observation struct {
	Sequence           uint64
	AgentID            string
	RuntimeRevision    RuntimeRevision
	RuntimeExecutionID string
	Kind               ObservationKind
	DiagnosticSummary  string
	ObservedAt         time.Time

	Generation         uint64
	SpecDigest         string
	PlatformResourceID string
	Source             string
}

func (Observation) RuntimeKey

func (o Observation) RuntimeKey() (Key, bool)

func (Observation) Validate

func (o Observation) Validate() error

type ObservationKind

type ObservationKind string
const (
	ObservationInitialized      ObservationKind = "initialized"
	ObservationUpdated          ObservationKind = "updated"
	ObservationDisabled         ObservationKind = "disabled"
	ObservationEnabled          ObservationKind = "enabled"
	ObservationHealthy          ObservationKind = "healthy"
	ObservationStarting         ObservationKind = "starting"
	ObservationUnhealthy        ObservationKind = "unhealthy"
	ObservationRestarted        ObservationKind = "restarted"
	ObservationExited           ObservationKind = "exited"
	ObservationDeleted          ObservationKind = "deleted"
	ObservationRuntimeDeleted   ObservationKind = "runtime_deleted"
	ObservationStorageMissing   ObservationKind = "storage_missing"
	ObservationStorageDrift     ObservationKind = "storage_drift"
	ObservationGap              ObservationKind = "observation_gap"
	ObservationReconciled       ObservationKind = "reconciled"
	ObservationStatusUnverified ObservationKind = "status_unverified"
	ObservationRuntimeMissing   ObservationKind = "runtime_missing"
)

type ObservationWindow

type ObservationWindow struct {
	Observations   []Observation
	OldestSequence uint64
	LatestSequence uint64
}

ObservationWindow is one consistent view of the retained journal and its sequence bounds. Sequence zero means the journal is currently empty.

type Operation

type Operation struct {
	InstanceAuthentication *instanceauth.Record `json:"-"`
	ImageReference         string
	ImageID                string
	MaintenanceVerifiers   *MaintenanceVerifiers
	RequestID              string
	RequestDigest          string
	Kind                   OperationKind
	AgentID                string
	RuntimeRevision        RuntimeRevision
	State                  OperationState
	Effect                 EffectState
	Inspection             *Environment
	ErrorCode              string
	ErrorDetail            string
	CreatedAt              time.Time
	UpdatedAt              time.Time

	Attempt                 uint64
	ExpectedRevision        RuntimeRevision
	SourceState             LifecycleState
	SourceRevision          RuntimeRevision
	SourceGeneration        uint64
	SourceSpecDigest        string
	Generation              uint64
	SpecDigest              string
	Transition              LifecycleState
	PreparedReference       *skillset.PreparedReference
	PreparedSetID           int64
	PreparedVolumeName      string
	PreparedMaterialization int64
	PreparedManifestDigest  string
	PreparedReferenceID     string
}

func (Operation) CreatesCompute

func (o Operation) CreatesCompute() bool

func (Operation) RuntimeKey

func (o Operation) RuntimeKey() Key

func (Operation) SourceKey

func (o Operation) SourceKey() (Key, bool)

func (Operation) SuccessState

func (o Operation) SuccessState() (LifecycleState, error)

type OperationKind

type OperationKind string
const (
	OperationInitializeRuntime OperationKind = "initialize_runtime"
	OperationUpdateRuntime     OperationKind = "update_runtime"
	OperationDisableRuntime    OperationKind = "disable_runtime"
	OperationEnableRuntime     OperationKind = "enable_runtime"
	OperationDeleteRuntime     OperationKind = "delete_runtime"
)

type OperationState

type OperationState string
const (
	OperationRunning   OperationState = "running"
	OperationCompleted OperationState = "completed"
	OperationFailed    OperationState = "failed"
	OperationUnknown   OperationState = "unknown"
)

type PlatformPhase

type PlatformPhase string
const (
	PhaseAbsent  PlatformPhase = "absent"
	PhaseCreated PlatformPhase = "created"
	PhaseRunning PlatformPhase = "running"
	PhaseExited  PlatformPhase = "exited"
	PhaseUnknown PlatformPhase = "unknown"
)

type ResourceLimits

type ResourceLimits struct {
	MemoryBytes uint64 `json:"memory_bytes"`
	PidsLimit   uint32 `json:"pids_limit"`
	TmpfsBytes  uint64 `json:"tmpfs_bytes"`
}

type RuntimeAuthentication

type RuntimeAuthentication struct {
	Tunnel         instanceauth.TunnelDescriptor `json:"tunnel"`
	ConnectionID   string                        `json:"connection_id"`
	CallersFile    string                        `json:"callers_file"`
	ReceiverDigest string                        `json:"receiver_digest"`
}

RuntimeAuthentication is nonsecret bootstrap identity. Bearers never enter RuntimeSpec.

type RuntimeRevision

type RuntimeRevision string

func RevisionFor

func RevisionFor(requestID, requestDigest string) RuntimeRevision

type RuntimeSpec

type RuntimeSpec struct {
	Authentication            *RuntimeAuthentication `json:"authentication,omitempty"`
	MCPServers                []MCPServer            `json:"mcp_servers,omitempty"`
	SkillMaintenanceVerifiers *MaintenanceVerifiers  `json:"skill_maintenance_verifiers,omitempty"`
	AgentID                   string                 `json:"agent_id"`
	Generation                uint64                 `json:"generation"`
	Listen                    SocketAddress          `json:"listen"`
	Network                   NetworkSpec            `json:"network"`
	Filesystem                FilesystemSpec         `json:"filesystem"`
}

type SocketAddress

type SocketAddress struct {
	Host string `json:"host"`
	Port uint16 `json:"port"`
}

Jump to

Keyboard shortcuts

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