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.
type Server ¶
type Server struct {
v1.UnimplementedHarnessServer
// contains filtered or unexported fields
}
Server serves an api.Harness over the Harness gRPC service.
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.