reference

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Overview

Package reference provides a deterministic Runtime Protocol conformance worker. It is a development and fault-injection provider, not a sandbox for untrusted code.

Index

Constants

View Source
const (
	ProviderName     = "reference-go"
	RuntimeABI       = "fenced.reference/v1"
	CheckpointSchema = "fenced.reference-state/v1"
)

Variables

View Source
var ErrNoActiveAttempt = errors.New("no active attempt context")

ErrNoActiveAttempt reports an MCP call outside an assignment execution window: the worker holds no fenced identity to bind the call to.

Functions

This section is empty.

Types

type GrpcToolInvoker

type GrpcToolInvoker struct {
	// contains filtered or unexported fields
}

GrpcToolInvoker forwards MCP tool calls over the fenced Tool Gateway gRPC boundary, preserving the attempt identity (tenant, attempt, fencing token) so the gateway's decision chain is exercised exactly like scripted calls.

func (*GrpcToolInvoker) InvokeTool

func (*GrpcToolInvoker) ListTools

func (g *GrpcToolInvoker) ListTools(ctx context.Context, tenantID string) ([]store.ToolDescriptor, error)

func (*GrpcToolInvoker) ListToolsForAgent

func (g *GrpcToolInvoker) ListToolsForAgent(ctx context.Context, tenantID, agentVersionRef string) ([]store.ToolDescriptor, error)

type IdentitySlot

type IdentitySlot struct {
	// contains filtered or unexported fields
}

IdentitySlot is the concurrent-safe fenced identity holder a runtime worker exposes to the sandboxed Agent's MCP endpoint. The worker sets the current Attempt context for the duration of one assignment execution window and clears it afterwards; MCP calls outside that window are denied (default deny — no identity, no tool).

func NewIdentitySlot

func NewIdentitySlot() *IdentitySlot

func (*IdentitySlot) Clear

func (s *IdentitySlot) Clear()

Clear removes the identity at the end of the execution window.

func (*IdentitySlot) Resolve

Resolve implements mcp.IdentityResolver with default-deny semantics.

func (*IdentitySlot) Set

func (s *IdentitySlot) Set(ctx mcp.AttemptContext)

Set publishes the fenced identity for the current execution window.

type Worker

type Worker struct {
	// contains filtered or unexported fields
}

func NewWorker

func NewWorker(client runtimev1.RuntimeControlServiceClient, artifacts ArtifactStore, tenantID, runtimeInstanceID string, heartbeatTTL time.Duration) *Worker

func (*Worker) RunOnce

func (w *Worker) RunOnce(ctx context.Context) (bool, error)

func (*Worker) WithIdentitySlot

func (w *Worker) WithIdentitySlot(slot *IdentitySlot) *Worker

WithIdentitySlot publishes the current Attempt's fenced identity for the duration of each assignment execution window. A sandboxed Agent's MCP endpoint resolves its identity from this slot; calls outside the window are denied by default.

func (*Worker) WithModelGateway

func (w *Worker) WithModelGateway(gateway modelv1.ModelGatewayServiceClient) *Worker

WithModelGateway wires the Model Gateway boundary so workload-spec model scripts are metered (Begin/Settle/Finish) against the task budget.

func (*Worker) WithToolGateway

func (w *Worker) WithToolGateway(gateway gatewayv1.ToolGatewayServiceClient) *Worker

WithToolGateway wires the Tool Gateway boundary so workload-spec tool scripts execute through the full decision chain (policy, budget, receipts) before the attempt completes.

Jump to

Keyboard shortcuts

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