guestapi

package
v0.0.0-...-9530497 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package guestapi defines the versioned public contract exposed to restricted MVM programs. It contains policy only; worker bindings remain responsible for enforcing the contract for a particular execution profile.

Index

Constants

View Source
const (
	PackageTools     = "librecode/tools"
	PackageAgents    = "librecode/agents"
	PackageWorkflow  = "librecode/workflow"
	PackageArtifacts = "librecode/artifacts"
	PackageState     = "librecode/state"

	LegacyPackageTools = "tools"
)

Canonical guest import paths. Artifact and state packages reserve names; they do not imply that those capabilities are implemented yet.

Variables

This section is empty.

Functions

func ValidateWorkerContract

func ValidateWorkerContract(profile Profile, version Version) error

ValidateWorkerContract rejects worker contracts that this binary cannot execute. Version 1 retains the legacy turn and durable package layouts; version 2 selects the canonical profile-aware manifest.

Types

type Availability

type Availability struct {
	Package     string
	Function    string
	Turn        bool
	Durable     bool
	Implemented bool
}

Availability describes whether a canonical function is part of a profile's Version2 contract. Implemented is false for functions reserved for a later epic phase; callers must receive ErrorUnsupported until that phase ships.

func AvailabilityManifest

func AvailabilityManifest() []Availability

AvailabilityManifest returns the canonical function policy.

func (Availability) Available

func (availability Availability) Available(profile Profile) bool

Available reports whether a function belongs to the selected profile. It does not report implementation readiness, which is represented separately.

type CapabilityErrorCode

type CapabilityErrorCode string

CapabilityErrorCode is a stable machine-readable guest capability failure.

const (
	// ErrorUnavailable means a known capability is not exposed in the selected profile.
	ErrorUnavailable CapabilityErrorCode = "guest_capability_unavailable"
	// ErrorDenied means policy refused an otherwise supported capability.
	ErrorDenied CapabilityErrorCode = "guest_capability_denied"
	// ErrorUnsupported means the selected guest API/runtime does not implement the capability.
	ErrorUnsupported CapabilityErrorCode = "guest_capability_unsupported"
	// ErrorRecursive means a capability attempted to invoke the outer execute surface.
	ErrorRecursive CapabilityErrorCode = "guest_capability_recursive"
)

type Profile

type Profile string

Profile identifies an execution guarantee profile for capability policy.

const (
	// ProfileTurn identifies synchronous provider-turn execution.
	ProfileTurn Profile = "turn"
	// ProfileDurable identifies detached persisted workflow execution.
	ProfileDurable Profile = "durable"
)

type Version

type Version string

Version identifies a guest API independently of any persisted source format.

const (
	// Version1 is the currently deployed legacy guest API.
	Version1 Version = "1"
	// Version2 is the canonical unified package contract introduced by the
	// unified execute migration.
	Version2 Version = "2"
	// CurrentVersion is the version new unified executions will request once
	// profile-aware worker manifests are introduced.
	CurrentVersion = Version2
)

Jump to

Keyboard shortcuts

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