Documentation
¶
Overview ¶
Package cloudworker runs one exact cloud-leased target through Fort's native runtime without importing any provider credential or cloud database client.
Index ¶
- Variables
- type AdapterRegistry
- type ApprovedBinding
- type CommandReadiness
- type Control
- type ExecutionContext
- type HTTPClient
- func (client *HTTPClient) AcknowledgeWorkerCancellation(ctx context.Context, command controlapi.WorkerCancellationAckCommand) (controlapi.WorkerCancellationAck, error)
- func (client *HTTPClient) AppendWorkerArtifactChunk(ctx context.Context, command controlapi.WorkerArtifactChunkCommand) (controlapi.WorkerArtifactChunk, error)
- func (client *HTTPClient) ClaimNextWorkerTarget(ctx context.Context, command controlapi.WorkerClaimNextCommand) (controlapi.WorkerAssignment, error)
- func (client *HTTPClient) CommitWorkerTerminal(ctx context.Context, command controlapi.WorkerTerminalCommand) (controlapi.WorkerTerminalResult, error)
- func (client *HTTPClient) CreateWorkerArtifact(ctx context.Context, command controlapi.WorkerArtifactCreateCommand) (controlapi.WorkerArtifact, error)
- func (client *HTTPClient) FinalizeWorkerArtifact(ctx context.Context, command controlapi.WorkerArtifactFinalizeCommand) (controlapi.WorkerArtifact, error)
- func (client *HTTPClient) GetWorkerArtifactStatus(ctx context.Context, command controlapi.WorkerArtifactStatusCommand) (controlapi.WorkerArtifact, error)
- func (client *HTTPClient) HeartbeatWorkerLease(ctx context.Context, command controlapi.WorkerLeaseHeartbeatCommand) (controlapi.WorkerLeaseHeartbeatResult, error)
- func (client *HTTPClient) ReadWorkerContextPage(ctx context.Context, command controlapi.WorkerContextPageCommand) (controlapi.WorkerContextPage, error)
- func (client *HTTPClient) RecordWorkerReadiness(ctx context.Context, command controlapi.WorkerReadinessCommand) (controlapi.WorkerReadinessResult, error)
- type HTTPConfig
- type HeartbeatFactory
- type IDSource
- type Identity
- type NativeRegistry
- type Readiness
- type ReadinessSnapshot
- type Worker
Constants ¶
This section is empty.
Variables ¶
var ( ErrAdapterNotApproved = errors.New("cloud worker adapter binding is not approved") ErrWorkerInvalid = errors.New("cloud worker configuration or assignment is invalid") )
Functions ¶
This section is empty.
Types ¶
type AdapterRegistry ¶
type AdapterRegistry interface {
Prepare(controlapi.WorkerAssignment, ExecutionContext) (runtime.RunSpec, error)
}
type ApprovedBinding ¶
type ApprovedBinding struct {
Pins coreworker.ExecutionPins `json:"pins"`
Execution controlapi.WorkerExecutionBinding `json:"execution"`
}
type CommandReadiness ¶
type CommandReadiness struct {
// contains filtered or unexported fields
}
CommandReadiness delegates capability observation to one explicitly configured, absolute executable. The executable must emit one bounded JSON object. Recheck runs it again and requires byte-identical evidence before it probes the exact built-in native provider and verifies the pinned workdir.
func NewCommandReadiness ¶
func (*CommandReadiness) Recheck ¶
func (readiness *CommandReadiness) Recheck(ctx context.Context, assignment controlapi.WorkerAssignment) error
func (*CommandReadiness) Snapshot ¶
func (readiness *CommandReadiness) Snapshot(ctx context.Context) (ReadinessSnapshot, error)
type Control ¶
type Control interface {
RecordWorkerReadiness(context.Context, controlapi.WorkerReadinessCommand) (controlapi.WorkerReadinessResult, error)
ClaimNextWorkerTarget(context.Context, controlapi.WorkerClaimNextCommand) (controlapi.WorkerAssignment, error)
ReadWorkerContextPage(context.Context, controlapi.WorkerContextPageCommand) (controlapi.WorkerContextPage, error)
HeartbeatWorkerLease(context.Context, controlapi.WorkerLeaseHeartbeatCommand) (controlapi.WorkerLeaseHeartbeatResult, error)
AcknowledgeWorkerCancellation(context.Context, controlapi.WorkerCancellationAckCommand) (controlapi.WorkerCancellationAck, error)
CreateWorkerArtifact(context.Context, controlapi.WorkerArtifactCreateCommand) (controlapi.WorkerArtifact, error)
GetWorkerArtifactStatus(context.Context, controlapi.WorkerArtifactStatusCommand) (controlapi.WorkerArtifact, error)
AppendWorkerArtifactChunk(context.Context, controlapi.WorkerArtifactChunkCommand) (controlapi.WorkerArtifactChunk, error)
FinalizeWorkerArtifact(context.Context, controlapi.WorkerArtifactFinalizeCommand) (controlapi.WorkerArtifact, error)
CommitWorkerTerminal(context.Context, controlapi.WorkerTerminalCommand) (controlapi.WorkerTerminalResult, error)
}
Control is transport-agnostic. HTTPClient implements this interface while unit tests can prove ordering, fencing, and cancellation without a network.
type ExecutionContext ¶
type ExecutionContext struct {
ManifestID string
ManifestDigest string
Items []controlapi.WorkerContextItem
}
ExecutionContext is the complete immutable, typed context selected by Fort. A separately approved adapter owns any provider-specific encoding; Worker never concatenates these records into the assignment prompt.
type HTTPClient ¶
type HTTPClient struct {
// contains filtered or unexported fields
}
HTTPClient is the enrolled machine's bounded HTTPS implementation of Control. It sends plaintext only to the authenticated control endpoint; it has no application AEAD key and no Supabase credential.
func NewHTTPClient ¶
func NewHTTPClient(config HTTPConfig) (*HTTPClient, error)
func (*HTTPClient) AcknowledgeWorkerCancellation ¶
func (client *HTTPClient) AcknowledgeWorkerCancellation(ctx context.Context, command controlapi.WorkerCancellationAckCommand) (controlapi.WorkerCancellationAck, error)
func (*HTTPClient) AppendWorkerArtifactChunk ¶
func (client *HTTPClient) AppendWorkerArtifactChunk(ctx context.Context, command controlapi.WorkerArtifactChunkCommand) (controlapi.WorkerArtifactChunk, error)
func (*HTTPClient) ClaimNextWorkerTarget ¶
func (client *HTTPClient) ClaimNextWorkerTarget(ctx context.Context, command controlapi.WorkerClaimNextCommand) (controlapi.WorkerAssignment, error)
func (*HTTPClient) CommitWorkerTerminal ¶
func (client *HTTPClient) CommitWorkerTerminal(ctx context.Context, command controlapi.WorkerTerminalCommand) (controlapi.WorkerTerminalResult, error)
func (*HTTPClient) CreateWorkerArtifact ¶
func (client *HTTPClient) CreateWorkerArtifact(ctx context.Context, command controlapi.WorkerArtifactCreateCommand) (controlapi.WorkerArtifact, error)
func (*HTTPClient) FinalizeWorkerArtifact ¶
func (client *HTTPClient) FinalizeWorkerArtifact(ctx context.Context, command controlapi.WorkerArtifactFinalizeCommand) (controlapi.WorkerArtifact, error)
func (*HTTPClient) GetWorkerArtifactStatus ¶
func (client *HTTPClient) GetWorkerArtifactStatus(ctx context.Context, command controlapi.WorkerArtifactStatusCommand) (controlapi.WorkerArtifact, error)
func (*HTTPClient) HeartbeatWorkerLease ¶
func (client *HTTPClient) HeartbeatWorkerLease(ctx context.Context, command controlapi.WorkerLeaseHeartbeatCommand) (controlapi.WorkerLeaseHeartbeatResult, error)
func (*HTTPClient) ReadWorkerContextPage ¶
func (client *HTTPClient) ReadWorkerContextPage(ctx context.Context, command controlapi.WorkerContextPageCommand) (controlapi.WorkerContextPage, error)
func (*HTTPClient) RecordWorkerReadiness ¶
func (client *HTTPClient) RecordWorkerReadiness(ctx context.Context, command controlapi.WorkerReadinessCommand) (controlapi.WorkerReadinessResult, error)
type HTTPConfig ¶
type NativeRegistry ¶
type NativeRegistry struct {
// contains filtered or unexported fields
}
NativeRegistry is an explicit local allow-list. Every immutable execution selector, including the server-pinned workdir, must match before a RunSpec is produced. It never falls back to another provider, model, adapter, or path.
func NewNativeRegistry ¶
func NewNativeRegistry(bindings []ApprovedBinding) (*NativeRegistry, error)
func (*NativeRegistry) Prepare ¶
func (registry *NativeRegistry) Prepare(assignment controlapi.WorkerAssignment, executionContext ExecutionContext) (runtime.RunSpec, error)
type Readiness ¶
type Readiness interface {
Snapshot(context.Context) (ReadinessSnapshot, error)
Recheck(context.Context, controlapi.WorkerAssignment) error
}
Readiness owns local capability observation. Recheck must probe the same exact local evidence again; Worker invokes it immediately before Dispatch.
type ReadinessSnapshot ¶
type ReadinessSnapshot struct {
CapabilityRevisionID string
Revision int
Evidence json.RawMessage
EvidenceDigest string
}