harnesswire

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package harnesswire bridges the in-process api.Harness SPI and the out-of-process Harness.Connect gRPC stream, in both directions:

  • Server wraps an api.Harness as a v1.HarnessServer: it runs the harness with a streaming EventSink that emits each nondeterministic op as an Event on the wire and blocks for the host's ControllerFrame reply. The harness never invokes the model itself — the load-bearing rule holds across a process boundary.
  • ClientHarness wraps a v1.HarnessClient as an api.Harness: its Run drives the Connect stream and translates each Event into a call on the host's sink (which invokes-and-records live or serves-from-journal on replay), sending the result back. So the controller and its sinks are reused UNCHANGED — the remote harness looks exactly like a local one.

The model REQUEST (messages) rides on the wire ModelCall so the host can invoke live; the host records only input_hash (Option A).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DescriptorToProto

func DescriptorToProto(d api.Descriptor) *v1.HarnessDescriptor

DescriptorToProto renders a harness descriptor as the wire type Describe returns.

Types

type ClientHarness

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

ClientHarness makes a remote harness (reached via HarnessClient) look like a local api.Harness, so the controller drives it exactly as an in-process one.

func NewClientHarness

func NewClientHarness(client v1.HarnessClient) *ClientHarness

NewClientHarness wraps client as an api.Harness.

func (*ClientHarness) Describe

func (h *ClientHarness) Describe(ctx context.Context) (api.Descriptor, error)

Describe fetches the remote harness's contract.

func (*ClientHarness) Run

func (h *ClientHarness) Run(ctx context.Context, start *api.Start, sink api.EventSink) error

Run drives the remote harness over Connect, translating each emitted Event into a host-mediated sink call and sending the result back. The sink (live or replay) is the controller's — the host still mediates the model over the wire.

type Server

type Server struct {
	v1.UnimplementedHarnessServer
	// contains filtered or unexported fields
}

Server serves an api.Harness over the Harness gRPC service.

func NewServer

func NewServer(h api.Harness) *Server

NewServer wraps h as a HarnessServer.

func (*Server) Connect

func (s *Server) Connect(stream v1.Harness_ConnectServer) error

Connect drives one execution, ending with END or a transport-only PARKED acknowledgement.

func (*Server) Describe

func (s *Server) Describe(ctx context.Context, _ *v1.DescribeRequest) (*v1.HarnessDescriptor, error)

Describe returns the harness's static contract.

Jump to

Keyboard shortcuts

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