Documentation
¶
Overview ¶
Package workload defines the bounded task specification understood by admission and placement. Unknown fields remain available to later stages.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Budget ¶
type Image ¶
type Image struct {
// Ref is the image reference the provider must run, e.g.
// "example.com/agent@sha256:...". The worker verifies it against the
// runtime's own configuration before starting anything.
Ref string `json:"ref"`
// Digest pins the image content ("sha256:<64 hex>"); empty allows a
// mutable reference in dev, but production admission requires it for
// container runtime classes.
Digest string `json:"digest,omitempty"`
}
Image is the digest-pinned container reference of a workload.
func (Image) Canonical ¶
Canonical returns the pin the worker and admission compare: ref@digest when pinned, ref otherwise.
type ModelCallScript ¶
type ModelCallScript struct {
ModelRef string `json:"modelRef"`
InputTokens int64 `json:"inputTokens,omitempty"`
OutputTokens int64 `json:"outputTokens,omitempty"`
IdempotencyKey string `json:"idempotencyKey"`
}
ModelCallScript is one deterministic model invocation with pre-declared usage, metered and hard-stopped by the Model Gateway.
type Placement ¶
type Placement struct {
RuntimeClasses []string `json:"runtimeClasses"`
PreferredClass string `json:"preferredClass,omitempty"`
Region string `json:"region"`
DataResidency string `json:"dataResidency,omitempty"`
ArtifactRegion string `json:"artifactRegion,omitempty"`
// AvoidFailureDomains prevents retry placement into a known failed zone,
// rack, node, or other provider-defined domain.
AvoidFailureDomains []string `json:"avoidFailureDomains,omitempty"`
CPU int64 `json:"cpuMillis"`
Memory int64 `json:"memoryMiB"`
// WorkspaceBytes is the sandbox workspace size (tmpfs) container-class
// workloads must declare; Admission rejects container classes with a
// zero workspace (ADR-010 hardening checklist).
WorkspaceBytes int64 `json:"workspaceBytes"`
LLMConcurrency int `json:"llmConcurrency"`
}
type RetryPolicy ¶
type RetryPolicy struct {
MaxAttempts int `json:"maxAttempts,omitempty"`
}
func (RetryPolicy) EffectiveMaxAttempts ¶
func (p RetryPolicy) EffectiveMaxAttempts() int
type Runtime ¶
type Runtime struct {
ComponentPath string `json:"componentPath,omitempty"`
Command []string `json:"command,omitempty"`
}
Runtime describes the provider-specific entry point selected by the task. ComponentPath is consumed by the Wasmtime provider; Command is consumed by OCI-compatible providers.
func (Runtime) ValidateCommand ¶
ValidateCommand bounds the argv passed to a container runtime. Empty means use the image's configured Entrypoint/Cmd.
type Spec ¶
type Spec struct {
Priority int `json:"priority"`
Deadline *time.Time `json:"deadline,omitempty"`
Budget Budget `json:"budget"`
Placement Placement `json:"placement"`
RetryPolicy RetryPolicy `json:"retryPolicy,omitempty"`
// Image pins the OCI image this workload must run in (ADR-010). Runtime
// providers for container classes (oci/microvm) must run exactly this
// reference; digest-only references are the production contract.
Image *Image `json:"image,omitempty"`
// Runtime carries provider-specific launch metadata. Command is an argv
// array, never a shell fragment, so OCI providers can override an image's
// default command without introducing shell interpolation.
Runtime *Runtime `json:"runtime,omitempty"`
// ToolCalls is the deterministic tool script the reference provider
// executes through the Tool Gateway before completing. Other providers
// ignore it; the gateway enforces policy and budget regardless of caller.
ToolCalls []ToolCall `json:"tools,omitempty"`
// ModelCalls is the deterministic model script the reference provider
// executes through the Model Gateway (Begin/Settle/Finish) after tools.
ModelCalls []ModelCallScript `json:"modelCalls,omitempty"`
}
type ToolCall ¶
type ToolCall struct {
ToolName string `json:"name"`
ToolVersion string `json:"version,omitempty"`
Action string `json:"action"`
Resource string `json:"resource"`
Args json.RawMessage `json:"args,omitempty"`
IdempotencyKey string `json:"idempotencyKey"`
}
ToolCall is one deterministic gateway invocation the reference provider performs on behalf of the Attempt. IdempotencyKeys must be unique within a task so replays converge on the stored receipts.