executor

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package executor runs an exact ResolvedRunPlan. It owns lifecycle, budget, retry, and finalizer semantics while protocol-specific work is delegated to a Runner selected by an exact driver digest.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Runners RunnerResolver
	NewID   IDSource
	Now     func() time.Time
}

type ErrorClass

type ErrorClass string
const (
	ErrorTransient      ErrorClass = "transient"
	ErrorAuthentication ErrorClass = "authentication"
	ErrorPermission     ErrorClass = "permission"
	ErrorDriver         ErrorClass = "driver"
	ErrorHarness        ErrorClass = "harness"
)

type IDSource

type IDSource func() (schema.InstanceID, error)

type Invocation

type Invocation struct {
	RunID         schema.InstanceID
	InvocationID  schema.InstanceID
	AttemptID     schema.InstanceID
	PlanDigest    schema.Digest
	Scenario      schema.ScenarioDecision
	AttemptNumber int64
}

type Outcome

type Outcome struct {
	Verdict          schema.Verdict
	ReasonCode       schema.ReasonCode
	EvidenceRefs     []schema.ObjectRef
	AssertionResults []schema.AssertionResult
	Findings         []schema.Finding
	Usage            budget.Usage
	UnknownUsage     []string
}

Outcome is returned only after the runner has completed the target observation path. Harness/driver failures are returned as errors and cannot carry endpoint findings.

type Result

type Result struct {
	RunID           schema.InstanceID   `json:"run_id"`
	ResolvedPlanRef schema.ObjectRef    `json:"resolved_plan_ref"`
	Attempts        []schema.Attempt    `json:"attempts"`
	Cases           []schema.CaseResult `json:"cases"`
	Budget          budget.Snapshot     `json:"budget"`
	ResidualLeases  []string            `json:"residual_leases,omitempty"`
	StartedAt       schema.UTCTime      `json:"started_at"`
	FinishedAt      schema.UTCTime      `json:"finished_at"`
}

func Execute

func Execute(ctx context.Context, plan schema.ResolvedRunPlan, expectedDigest schema.Digest, config Config) (Result, error)

type RunError

type RunError struct {
	Class      ErrorClass
	Err        error
	Usage      budget.Usage
	UsageKnown bool
	// UnknownUsage keeps absent provider token accounting distinct from an
	// observed zero. Only input_tokens and output_tokens are accepted.
	UnknownUsage []string
	// EvidenceRefs preserves observations already committed before a
	// non-verdict terminal condition such as authentication or transport
	// failure. The executor validates and carries them into the attempt/case.
	EvidenceRefs []schema.ObjectRef
}

func (*RunError) Error

func (runError *RunError) Error() string

func (*RunError) Unwrap

func (runError *RunError) Unwrap() error

type RunnerResolver

type RunnerResolver interface {
	Resolve(schema.ArtifactPin) (Runner, error)
}

Jump to

Keyboard shortcuts

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