Documentation
¶
Overview ¶
Package execution manages owned harness processes on SSH execution hosts. Transport reachability never establishes whether a task or process ended.
Index ¶
- Constants
- Variables
- func CoordinatorCall(ctx context.Context, endpoint Endpoint, host, op string, ref Ref, payload any, ...) error
- func Decode(raw []byte, v any) error
- func Digest(b []byte) string
- func GatewayMCP(ctx context.Context, servers map[string]MCPServer, op string, ...) (any, error)
- func HostPath(s string) bool
- func MCPProxy(ctx context.Context, call MCPCallback) (*mcpserver.MCPServer, error)
- func NewControlKey() (string, error)
- func PublicKey(k ed25519.PrivateKey) string
- func RepositoryIdentity(raw string) string
- func SSHArgv(e Endpoint, connect time.Duration, command string) []string
- func SSHCommand(ctx context.Context, argv []string, stdin []byte) ([]byte, error)
- func Sign(r StartRequest, key ed25519.PrivateKey, now time.Time) string
- func SigningKey(root string) (ed25519.PrivateKey, error)
- func SupportedHarness(h string) bool
- func UnitName(r Ref) string
- func ValidDigest(s string) bool
- func ValidIdentity(s string) bool
- func ValidateHandle(h Host, r StartRequest, x Handle) error
- func ValidateMCP(servers map[string]MCPServer) error
- func Verify(r StartRequest, key string, now time.Time) error
- func VerifyCallback(r CallbackRequest, key string) bool
- func VerifyLease(grant LeaseGrant, request LeaseRequest, ref Ref, coordinator, key string) error
- func WriteMergeAuthorization(root string, grant MergeAuthorization, action string, now time.Time) error
- type Ack
- type ActivationDecision
- type CallbackRequest
- type Capabilities
- type CommandRunner
- type ControlLedger
- type ControlRequest
- type ControlResult
- type ControlSyncer
- type Coordinator
- type Delivery
- type Endpoint
- type Envelope
- type ExecutionID
- type Handle
- type HarnessConfig
- type Host
- type HostCommand
- type HostConfig
- type HostID
- type HostUpdate
- type Inspector
- type Journal
- type LeaseGrant
- type LeaseRequest
- type LogPage
- type LogRequest
- type Logger
- type MCPCallRequest
- type MCPCallback
- type MCPServer
- type MergeAudit
- type MergeAuthorization
- type MergeResult
- type MergeUse
- type MessageLedger
- func (l *MessageLedger) Accept(id string) error
- func (l *MessageLedger) Attempt(m Envelope) error
- func (l *MessageLedger) Next() (Envelope, bool)
- func (l *MessageLedger) Resolve(q MessageResolution) (Ack, error)
- func (l MessageLedger) Status() []Delivery
- func (l *MessageLedger) Store(ref Ref, m Envelope) (Ack, error)
- type MessageResolution
- type MessageResolver
- type Messenger
- type Observation
- type Policy
- type Receipt
- type Ref
- type Resources
- type SSHTransport
- func (t SSHTransport) Call(ctx context.Context, op string, ref Ref, payload, result any) error
- func (t SSHTransport) Check(ctx context.Context) (Capabilities, error)
- func (t SSHTransport) Inspect(ctx context.Context, r Ref) (Observation, error)
- func (t SSHTransport) Logs(ctx context.Context, r Ref, q LogRequest) (LogPage, error)
- func (t SSHTransport) Message(ctx context.Context, r Ref, m Envelope) (Ack, error)
- func (t SSHTransport) ResolveMessage(ctx context.Context, r Ref, q MessageResolution) (Ack, error)
- func (t SSHTransport) Start(ctx context.Context, r StartRequest) (Handle, error)
- func (t SSHTransport) Stop(ctx context.Context, r Ref, q StopRequest) (Ack, error)
- func (t SSHTransport) SyncControl(ctx context.Context, r Ref) (ControlResult, error)
- func (t SSHTransport) UploadSource(ctx context.Context, ref Ref, data []byte) error
- type Sender
- type Server
- func (s *Server) Caller(id string) (Journal, error)
- func (s *Server) Check(ctx context.Context) (Capabilities, error)
- func (s *Server) Inspect(ctx context.Context, r Ref) (Observation, error)
- func (s *Server) InstalledPolicy() (Policy, error)
- func (s *Server) Logs(_ context.Context, r Ref, q LogRequest) (LogPage, error)
- func (s *Server) Message(ctx context.Context, ref Ref, m Envelope) (ack Ack, err error)
- func (s *Server) Policy() Policy
- func (s *Server) Prepare(p Policy) (string, error)
- func (s *Server) Quiesce(ctx context.Context) (busy int, release func(), err error)
- func (s *Server) Read(r Ref) (Journal, error)
- func (s *Server) ReceiveSource(ctx context.Context, ref Ref, chunk SourceChunk) error
- func (s *Server) ResolveMessage(ctx context.Context, ref Ref, q MessageResolution) (ack Ack, err error)
- func (s *Server) Run(ctx context.Context, ref Ref) (runErr error)
- func (s *Server) SendControl(ctx context.Context, j Journal, op string, data any, id string, ...) (ControlResult, error)
- func (s *Server) Serve(ctx context.Context, input io.Reader, output io.Writer) error
- func (s *Server) Start(ctx context.Context, r StartRequest) (Handle, error)
- func (s *Server) Stop(ctx context.Context, r Ref, q StopRequest) (Ack, error)
- func (s *Server) SyncControl(ctx context.Context, r Ref, run CommandRunner) (ControlResult, error)
- type SourceChunk
- type SourceUploader
- type StartRequest
- type Starter
- type StopRequest
- type Stopper
- type ToolConfig
- type Transport
- type UnreachableError
- type WireRequest
- type WireResponse
Constants ¶
const ( MessageWake = "wake" Stored = "stored" Accepted = "accepted" Uncertain = "uncertain" Resolved = "resolved" )
const ( HarnessClaude = "claude" HarnessCodex = "codex" Preparing = "preparing" Activating = "activating" Applied = "applied" ControlNote = "note" ControlPark = "park" ControlReport = "report" Protocol = 1 EnvID = "BEEKEEPER_EXECUTION_ID" EnvCoordinator = "BEEKEEPER_EXECUTION_COORDINATOR" MaxWire = 1 << 20 MaxLog = 256 << 10 Prepared = "prepared" Running = "running" Exited = "exited" Failed = "failed" Unknown = "unknown" Reachable = "reachable" Unreachable = "unreachable" )
const ( ToolGo = "go" ToolGitHub = "gh" )
ToolGo and ToolGitHub are the worker toolchain a host provisions next to its harness: Go for the repositories whose source checkout has a go.mod, and the GitHub CLI on every host.
const ClaudeVersions = ">= 2.1.268, < 3.0.0"
The adapter relies on restricted settings and auth status's configDirectory contract. Pin an exact installed version inside this supported CLI family.
const CodexVersions = ">= 0.165.0, < 1.0.0"
The codex adapter relies on `exec --json` thread events, `exec resume`, PreToolUse hooks from CODEX_HOME and --dangerously-bypass-hook-trust.
const LeaseDuration = 90 * time.Second
const LeaseRenewal = 20 * time.Second
const MCPCall = "mcp-call"
const MCPList = "mcp-list"
const MaxSourceBundle = 64 << 20
const MergeSucceeded = "merged"
const SourceChunkSize = 256 << 10
const UpdateTimeout = 5 * time.Minute
UpdateTimeout bounds a host update: the download, its verification, the new release's prepare and a rollback.
Variables ¶
var ErrNotFound = errors.New("execution journal not found")
ErrNotFound means an inspected execution has no host journal. Other inspection failures never authorize creating or changing a preparation.
var ErrUnsupported = errors.New("message acceptance is unavailable for this SSH execution or adapter; inspect the original execution before recovery")
Functions ¶
func CoordinatorCall ¶
func GatewayMCP ¶
func GatewayMCP(ctx context.Context, servers map[string]MCPServer, op string, request MCPCallRequest) (any, error)
GatewayMCP enforces the current coordinator allowlist for discovery AND calls. An unexposed call is refused before any upstream connection or side effect.
func MCPProxy ¶
MCPProxy is the worker's stdio gateway. Every tool use returns to the coordinator so cached discovery never grants authority after revocation.
func NewControlKey ¶
func PublicKey ¶
func PublicKey(k ed25519.PrivateKey) string
func RepositoryIdentity ¶
RepositoryIdentity accepts the canonical public GitHub transport forms, without passwords, query strings or a caller-selected credential helper.
func Sign ¶
func Sign(r StartRequest, key ed25519.PrivateKey, now time.Time) string
func SigningKey ¶
func SigningKey(root string) (ed25519.PrivateKey, error)
SigningKey creates a coordinator key once. Only its public half is ever returned to an operator; provision that half on the host independently.
func SupportedHarness ¶ added in v0.174.0
SupportedHarness names the harnesses with a remote adapter. Every other harness starts on the coordinating machine only.
func ValidDigest ¶
func ValidIdentity ¶
func ValidateHandle ¶
func ValidateHandle(h Host, r StartRequest, x Handle) error
func ValidateMCP ¶
func VerifyCallback ¶
func VerifyCallback(r CallbackRequest, key string) bool
func VerifyLease ¶
func VerifyLease(grant LeaseGrant, request LeaseRequest, ref Ref, coordinator, key string) error
func WriteMergeAuthorization ¶
func WriteMergeAuthorization(root string, grant MergeAuthorization, action string, now time.Time) error
The caller serializes this durable ledger with the coordinating state lock. It records consumption before invoking GitHub, so a crash can never replay a merge. Reconciliation may read GitHub but never repeats a consumed attempt.
Types ¶
type ActivationDecision ¶
type ActivationDecision struct {
Allowed bool `json:"allowed"`
}
ActivationDecision is a fresh coordinator answer, never a cached grant.
type CallbackRequest ¶
type CallbackRequest struct {
WireRequest
Proof string `json:"proof"`
}
type Capabilities ¶
type Capabilities struct {
Publication bool `json:"publication"`
Protocol int `json:"protocol"`
Identity HostID `json:"identity"`
Version string `json:"version"`
PolicyDigest string `json:"policyDigest"`
Harnesses map[string]string `json:"harnesses"`
// login or guard probe. The host advertises only the passing ones.
Unavailable map[string]string `json:"unavailable,omitempty"`
// Tools names each provisioned worker tool and its pinned version.
Tools map[string]string `json:"tools,omitempty"`
Resources Resources `json:"resources"`
}
type CommandRunner ¶
CommandRunner is replaced by tests; production uses SSHCommand.
type ControlLedger ¶
type ControlLedger struct {
Sequence uint64 `json:"sequence"`
Results map[string]ControlResult `json:"results,omitempty"`
}
ControlLedger belongs to one registered execution on the coordinator. Persist it in the same transaction as the mutation apply performs.
func (*ControlLedger) Apply ¶
func (l *ControlLedger) Apply(expected Ref, request ControlRequest, apply func() (string, error)) (ControlResult, error)
Apply returns the original receipt for an exact replay, including an application refusal. Protocol conflicts and gaps call apply zero times. The callback must validate before mutation: a refusal is acknowledged and persisted, so its domain state must remain unchanged on an error.
type ControlRequest ¶
type ControlRequest struct {
Ref Ref `json:"ref"`
ID string `json:"id"`
Sequence uint64 `json:"sequence"`
Operation string `json:"operation"`
Data json.RawMessage `json:"data"`
}
ControlRequest is a host-to-coordinator mutation. Its sequence and receipt survive both processes; it cannot grant authority or select a caller.
func (ControlRequest) ContentDigest ¶
func (r ControlRequest) ContentDigest() string
type ControlResult ¶
type ControlSyncer ¶
type ControlSyncer interface {
SyncControl(context.Context, Ref) (ControlResult, error)
}
ControlSyncer is the optional host outbox reconciliation operation. It does not implement worker wake acceptance, which remains unsupported.
type Coordinator ¶
type Delivery ¶
type Endpoint ¶
type Endpoint struct {
SSH string `yaml:"ssh" json:"ssh"`
Executable string `yaml:"executable" json:"executable"`
Config string `yaml:"config" json:"config"`
}
Endpoint names an operator-provisioned SSH route, never shell source.
type ExecutionID ¶
type ExecutionID string
type HarnessConfig ¶
type Host ¶
type Host struct {
Endpoint `yaml:",inline"`
Identity HostID `yaml:"identity" json:"identity"`
WorkspaceRoot string `yaml:"workspaceRoot" json:"workspaceRoot"`
Repositories map[string]string `yaml:"repositories" json:"repositories"`
Harnesses []string `yaml:"harnesses" json:"harnesses"`
PolicyDigest string `yaml:"policyDigest" json:"policyDigest"`
MaxBusy int `yaml:"maxBusy" json:"maxBusy"`
ConnectTimeout string `yaml:"connectTimeout,omitempty" json:"connectTimeout,omitempty"`
OperationTimeout string `yaml:"operationTimeout,omitempty" json:"operationTimeout,omitempty"`
}
Host is the coordinator's agents.hosts entry. Timeouts are seconds so the execution contract has no dependency on the configuration package. PolicyDigest is the digest every start on the host is pinned to: the one beekeeper recorded when it last updated the host (agents hosts update), or, for a host it never updated, the entry's own deprecated value.
func (Host) Supports ¶ added in v0.174.0
Supports reports whether the operator lists harness for this host.
func (Host) ValidateCatalog ¶
ValidateCatalog validates the entry as agents.hosts names it: the policy digest is beekeeper's own state, so the entry may leave it out, and one it still names must be a digest.
type HostCommand ¶
type HostConfig ¶
type HostConfig struct {
RulesFile string `yaml:"rulesFile" json:"rulesFile"`
Identity HostID `yaml:"identity" json:"identity"`
WorkspaceRoot string `yaml:"workspaceRoot" json:"workspaceRoot"`
Repositories map[string]string `yaml:"repositories" json:"repositories"`
Harnesses map[string]HarnessConfig `yaml:"harnesses" json:"harnesses"`
Coordinators map[string]Coordinator `yaml:"coordinators" json:"coordinators"`
MaxBusy int `yaml:"maxBusy" json:"maxBusy"`
// Tools pins the worker toolchain (go, gh) a worker calls by bare name.
// Omitted, it leaves the configuration digest of a host without it as is.
Tools map[string]ToolConfig `yaml:"tools,omitempty" json:"tools,omitempty"`
}
HostConfig is operator-owned configuration on the execution host. It is never replaced by a request, a brief or the coordinator's filesystem paths.
func (HostConfig) Validate ¶
func (c HostConfig) Validate() error
type HostUpdate ¶
type HostUpdate struct {
Protocol int `json:"protocol"`
Identity HostID `json:"identity,omitempty"`
Version string `json:"version,omitempty"`
PolicyDigest string `json:"policyDigest,omitempty"`
Busy int `json:"busy,omitempty"`
Error string `json:"error,omitempty"`
}
HostUpdate is the answer of an execution host's `agents hosts self-update`: the release it runs and the digest of the policy it prepared for it. Busy counts the executions that still run there, when it changed nothing for them; Error is why the update failed, the host left on its old release.
func UpdateHost ¶
func UpdateHost(ctx context.Context, h Host, version string, run CommandRunner) (HostUpdate, error)
UpdateHost has host h install release version, verified, and prepare the policy of it (agents hosts self-update over the host's SSH route). The answer is checked against the host's identity: a busy host, or one that answers the release and a digest, is an answer; anything else an error.
type Journal ¶
type Journal struct {
Lease *LeaseGrant `json:"lease,omitempty"`
LeasePending *LeaseRequest `json:"leasePending,omitempty"`
Completed bool `json:"completed,omitempty"`
Messages MessageLedger `json:"messages,omitempty"`
ActivationAttempted bool `json:"activationAttempted"`
RunnerPID int `json:"runnerPID,omitempty"`
RunnerStarted time.Time `json:"runnerStarted,omitempty"`
LastActive time.Time `json:"lastActive,omitzero"`
Request StartRequest `json:"request"`
Digest string `json:"digest"`
Handle Handle `json:"handle"`
Phase string `json:"phase"`
Ready bool `json:"ready"`
InTurn bool `json:"inTurn,omitempty"`
StopRequest *StopRequest `json:"stopRequest,omitempty"`
StopAcknowledged bool `json:"stopAcknowledged"`
LastError string `json:"lastError,omitempty"`
// Thread is the codex thread the first turn created; every later turn
// resumes it and the codex guard binds tool calls to it. Claude's
// conversation is the request's own identity and leaves it empty.
Thread string `json:"thread,omitempty"`
}
type LeaseGrant ¶
type LeaseGrant struct {
Ref Ref `json:"ref"`
Coordinator string `json:"coordinator"`
Sequence uint64 `json:"sequence"`
Nonce string `json:"nonce"`
IssuedAt time.Time `json:"issuedAt"`
ExpiresAt time.Time `json:"expiresAt"`
Signature string `json:"signature"`
}
func IssueLease ¶
func IssueLease(ref Ref, coordinator string, previous *LeaseGrant, request LeaseRequest, key ed25519.PrivateKey, now time.Time) (LeaseGrant, error)
IssueLease is called inside the coordinator's stop/renewal transaction. A repeated request returns its original deadline, never another lease interval.
type LeaseRequest ¶
type LogRequest ¶
type MCPCallRequest ¶
type MCPServer ¶
type MCPServer struct {
URL string `yaml:"url,omitempty"`
Command string `yaml:"command,omitempty"`
Args []string `yaml:"args,omitempty"`
Tools []string `yaml:"tools"`
}
MCPServer is coordinator-only configuration. Credentials and local commands never travel to a worker. Empty Tools exposes nothing; wildcards are not used.
type MergeAudit ¶
type MergeAuthorization ¶
type MergeAuthorization struct {
ReviewDigest string `json:"reviewDigest"`
DeskReviewID string `json:"deskReviewID"`
ReviewID string `json:"reviewID"`
ID string `json:"id"`
Ref Ref `json:"ref"`
Repository string `json:"repository"`
PR int `json:"pr"`
Head string `json:"head"`
Issuer string `json:"issuer"`
IssuedAt time.Time `json:"issuedAt"`
ExpiresAt time.Time `json:"expiresAt"`
Revoked bool `json:"revoked"`
Consumed bool `json:"consumed"`
Outcome string `json:"outcome,omitempty"`
Audit []MergeAudit `json:"audit"`
}
MergeAuthorization is coordinator-owned. It is never a bearer credential: every use also authenticates the exact owned execution with the live service.
func ReadMergeAuthorization ¶
func ReadMergeAuthorization(root, id string) (MergeAuthorization, error)
type MergeResult ¶
func UseMerge ¶
func UseMerge(ctx context.Context, root string, use MergeUse, now time.Time, live func(context.Context) error, merge func(context.Context) error) (MergeResult, error)
UseMerge performs one synchronous attempt under the caller's coordinating state transaction. Stop, holds and revocation therefore cannot commit between the live check and command execution. No detached child is permitted.
type MessageLedger ¶
type MessageLedger struct {
Sequence uint64 `json:"sequence"`
Entries map[string]Delivery `json:"entries,omitempty"`
}
MessageLedger keeps receipts for the execution's lifetime. Sequence only advances on acceptance; gaps stay stored and an uncertain send blocks replay.
func (*MessageLedger) Accept ¶
func (l *MessageLedger) Accept(id string) error
func (*MessageLedger) Attempt ¶
func (l *MessageLedger) Attempt(m Envelope) error
func (*MessageLedger) Next ¶
func (l *MessageLedger) Next() (Envelope, bool)
func (*MessageLedger) Resolve ¶
func (l *MessageLedger) Resolve(q MessageResolution) (Ack, error)
Resolve explicitly skips a blocked receipt. It records operator intent, not harness acceptance, and never retries an uncertain write.
func (MessageLedger) Status ¶
func (l MessageLedger) Status() []Delivery
Status excludes message text but retains identity and evidence for operators.
type MessageResolution ¶
type MessageResolver ¶
type Observation ¶
type Observation struct {
Lease *LeaseGrant `json:"lease,omitempty"`
Messages []Delivery `json:"messages,omitempty"`
MessageSequence uint64 `json:"messageSequence,omitempty"`
Handle Handle `json:"handle"`
ProcessState string `json:"processState"`
Reachability string `json:"reachability"`
ObservedAt time.Time `json:"observedAt"`
ReachabilityAt time.Time `json:"reachabilityAt"`
LastActive time.Time `json:"lastActive,omitzero"`
Ready bool `json:"ready"`
InTurn bool `json:"inTurn,omitempty"`
StopRequested bool `json:"stopRequested"`
StopAcknowledged bool `json:"stopAcknowledged"`
LastError string `json:"lastError,omitempty"`
}
func (Observation) FailedContact ¶
func (o Observation) FailedContact(err error, now time.Time) Observation
FailedContact preserves the last process evidence. A transport failure never establishes completion, releases capacity or changes a worker's task.
type Policy ¶
type Policy struct {
Protocol int `json:"protocol"`
Version string `json:"version"`
ConfigurationDigest string `json:"configurationDigest"`
RulesDigest string `json:"rulesDigest"`
SettingsDigest string `json:"settingsDigest"`
// CodexDigest binds the managed CODEX_HOME's config, hooks and rules. It
// is empty on a host that runs no codex, leaving its policy unchanged.
CodexDigest string `json:"codexDigest,omitempty"`
}
type Ref ¶
type Ref struct {
Host HostID `json:"host"`
Execution ExecutionID `json:"execution"`
Generation uint64 `json:"generation"`
}
type Resources ¶
type Resources struct {
Blocks []string `json:"blocks,omitempty"`
BuildBlocks []string `json:"buildBlocks,omitempty"`
AvailableMiB int `json:"availableMiB"`
Load1 float64 `json:"load1"`
DiskFreeGiB float64 `json:"diskFreeGiB"`
SwapGrowthMiB int `json:"swapGrowthMiB"`
BuildBusy bool `json:"buildBusy"`
ObservedAt time.Time `json:"observedAt"`
}
type SSHTransport ¶
type SSHTransport struct {
Host Host
Run CommandRunner
}
func (SSHTransport) Check ¶
func (t SSHTransport) Check(ctx context.Context) (Capabilities, error)
func (SSHTransport) Inspect ¶
func (t SSHTransport) Inspect(ctx context.Context, r Ref) (Observation, error)
func (SSHTransport) Logs ¶
func (t SSHTransport) Logs(ctx context.Context, r Ref, q LogRequest) (LogPage, error)
func (SSHTransport) ResolveMessage ¶
func (t SSHTransport) ResolveMessage(ctx context.Context, r Ref, q MessageResolution) (Ack, error)
func (SSHTransport) Start ¶
func (t SSHTransport) Start(ctx context.Context, r StartRequest) (Handle, error)
func (SSHTransport) Stop ¶
func (t SSHTransport) Stop(ctx context.Context, r Ref, q StopRequest) (Ack, error)
func (SSHTransport) SyncControl ¶
func (t SSHTransport) SyncControl(ctx context.Context, r Ref) (ControlResult, error)
func (SSHTransport) UploadSource ¶ added in v0.174.0
type Sender ¶
type Sender struct {
Session string `json:"session"`
Name string `json:"name"`
Host string `json:"host"`
}
Sender is the coordinating caller, retained across SSH and login shells. From and To bind delivery to the owned execution and process generation.
type Server ¶
type Server struct {
Config HostConfig
Root, Executable, ConfigPath, Version, SecurityDigest string
Rules []byte
Launcher platform.Launcher
Command HostCommand
Combined HostCommand
Resources func(context.Context) (Resources, error)
GuardProbe func() error
Authorize func(context.Context, StartRequest) error
Callback CommandRunner
Now func() time.Time
OwnUnit func() string
}
Server operates only on journals it created. It never discovers or adopts another conversation, process or unit by name.
func (*Server) Caller ¶
Caller verifies process ownership through the service cgroup. Environment variables alone cannot impersonate a different worker on the same host.
func (*Server) InstalledPolicy ¶
func (*Server) Policy ¶
Policy describes precisely what prepare installs. ConfigurationDigest also binds the caller's host-local guard configuration, not just these fields.
func (*Server) Quiesce ¶
Quiesce holds the host's admission, so that no execution starts until release, and counts the executions that still run. An update replaces the binary and the policy every running execution is pinned to: it goes ahead only at zero, before release.
func (*Server) ReceiveSource ¶ added in v0.174.0
func (*Server) ResolveMessage ¶
func (*Server) Run ¶
Run owns one headless turn and its first-task acceptance evidence. Only the execution-run service calls it; caller verification is done by the command.
func (*Server) SendControl ¶
func (s *Server) SendControl(ctx context.Context, j Journal, op string, data any, id string, run CommandRunner) (ControlResult, error)
SendControl stores a mutation before contacting the coordinator. A caller that retries identical data receives the original receipt, including a note number. Different work cannot overtake an unacknowledged mutation.
func (*Server) Serve ¶
Serve handles one bounded request. EOF and malformed data return a protocol refusal, never an empty successful reply. Diagnostics are not sent as data.
func (*Server) SyncControl ¶
func (s *Server) SyncControl(ctx context.Context, r Ref, run CommandRunner) (ControlResult, error)
type SourceChunk ¶ added in v0.174.0
type SourceUploader ¶ added in v0.174.0
SourceUploader transfers coordinator-fetched objects before preparation. The digest and exact commit are bound into the durable start request.
type StartRequest ¶
type StartRequest struct {
MCP bool `json:"mcp,omitempty"`
LeaseRequired bool `json:"leaseRequired,omitempty"`
Messaging bool `json:"messaging,omitempty"`
Builds bool `json:"builds"`
Ref Ref `json:"ref"`
RequestID string `json:"requestID"`
Coordinator string `json:"coordinator"`
Name string `json:"name"`
Task string `json:"task"`
Repository string `json:"repository"`
GitRef string `json:"gitRef"`
SourceDigest string `json:"sourceDigest,omitempty"`
Harness string `json:"harness"`
Model string `json:"model"`
Prompt string `json:"prompt"`
PolicyDigest string `json:"policyDigest"`
ConversationID string `json:"conversationID"`
// ControlKey authenticates component callbacks, never provider requests.
// It travels only in the protected SSH request and owned journals.
ControlKey string `json:"controlKey"`
RegistrationReceipt string `json:"registrationReceipt,omitempty"`
}
func (StartRequest) Digest ¶
func (r StartRequest) Digest() string
func (StartRequest) Validate ¶
func (r StartRequest) Validate() error
type StopRequest ¶
type ToolConfig ¶
type ToolConfig struct {
Executable string `yaml:"executable" json:"executable"`
Version string `yaml:"version" json:"version"`
}
ToolConfig pins one operator-installed tool a worker calls by bare name.
type UnreachableError ¶
func (*UnreachableError) Error ¶
func (e *UnreachableError) Error() string
func (*UnreachableError) Unwrap ¶
func (e *UnreachableError) Unwrap() error