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
- Variables
- type ArtifactStore
- type GrpcToolInvoker
- func (g *GrpcToolInvoker) InvokeTool(ctx context.Context, in tool.InvokeInput) (tool.InvokeResult, error)
- func (g *GrpcToolInvoker) ListTools(ctx context.Context, tenantID string) ([]store.ToolDescriptor, error)
- func (g *GrpcToolInvoker) ListToolsForAgent(ctx context.Context, tenantID, agentVersionRef string) ([]store.ToolDescriptor, error)
- type IdentitySlot
- type Worker
Constants ¶
const ( ProviderName = "reference-go" RuntimeABI = "fenced.reference/v1" CheckpointSchema = "fenced.reference-state/v1" )
Variables ¶
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 ArtifactStore ¶
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 NewGrpcToolInvoker ¶
func NewGrpcToolInvoker(client gatewayv1.ToolGatewayServiceClient) *GrpcToolInvoker
func (*GrpcToolInvoker) InvokeTool ¶
func (g *GrpcToolInvoker) InvokeTool(ctx context.Context, in tool.InvokeInput) (tool.InvokeResult, error)
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 ¶
func (s *IdentitySlot) Resolve(context.Context) (mcp.AttemptContext, error)
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) 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.