Help us shape the future of Go! Take the 2026 Go Developer Survey

conformance

package
v0.1.0 Latest Latest
Warning

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

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

Documentation

Overview

Package conformance is the §7.1 harness adapter conformance suite. Any adapter runs it from a test:

conformance.Run(t, conformance.Options{New: func() harnesses.Adapter { return fake.New() }, ...})

The suite supplies a stub platform tool API (ToolServer) and a freshly built steadmesh-tools binary, so adapters exercise the same tool path they use in a seat Pod.

Index

Constants

This section is empty.

Variables

View Source
var Tools = []runtimeapi.ToolDescriptor{
	{Name: "self", Description: "Return the seat identity.", InputSchema: json.RawMessage(`{"type":"object","properties":{}}`)},
	{Name: "memory.write", Description: "Create a memory record.", InputSchema: json.RawMessage(`{"type":"object","properties":{"store":{"type":"string"},"title":{"type":"string"},"body":{"type":"string"}},"required":["store","title","body"]}`)},
	{Name: "messages.reply", Description: "Reply to a message.", InputSchema: json.RawMessage(`{"type":"object","properties":{"message_id":{"type":"string"},"binding":{"type":"string"},"body":{"type":"string"}},"required":["body"]}`)},
	{Name: "messages.send", Description: "Send a message to a seat.", InputSchema: json.RawMessage(`{"type":"object","properties":{"to":{"type":"string"},"body":{"type":"string"},"correlation_id":{"type":"string"}},"required":["to","body"]}`)},
}

Tools are the descriptors the stub lists.

Functions

func BuildTools

func BuildTools(t testing.TB) string

BuildTools builds cmd/steadmesh-tools once per test binary and returns its path.

func Env

func Env(dirs Dirs, ts *ToolServer, toolCmd string) harnesses.Environment

Env builds an Environment for dirs against the tool server.

func Run

func Run(t *testing.T, opts Options)

Run executes the conformance suite.

Types

type Dirs

type Dirs struct{ Root, Workspace, Home, Runner, Tmp, TokenFile string }

Dirs are the seat volume directories for one test seat.

func NewDirs

func NewDirs(t testing.TB, token string) Dirs

NewDirs creates a seat-like layout under a temp dir with a token file.

type Options

type Options struct {
	// New returns a fresh, unprepared adapter.
	New func() harnesses.Adapter
	// QuickBody is a message body the adapter completes promptly.
	QuickBody string
	// SlowBody is a message body that keeps the turn running for at least
	// several seconds, used to test interruption and quiesce.
	SlowBody string
	// Configure may adjust the environment (e.g. model proxy URL).
	Configure func(t *testing.T, env *harnesses.Environment)
	// TurnTimeout bounds a quick turn (default 60s).
	TurnTimeout time.Duration
	// InterruptBound is how long an interrupted turn may take to unwind (default 20s).
	InterruptBound time.Duration
}

Options configures a conformance run.

type ToolCall

type ToolCall struct {
	Name       string
	Arguments  json.RawMessage
	Generation string
	Execution  string
}

ToolCall is one recorded call to the stub platform.

type ToolServer

type ToolServer struct {
	*httptest.Server
	Token string

	// Handler optionally overrides a tool's result.
	Handler func(name string, args json.RawMessage) runtimeapi.ToolCallResult
	// contains filtered or unexported fields
}

ToolServer is a stub of the seat-facing tool API (/v1/tools).

func NewToolServer

func NewToolServer(t testing.TB, token string) *ToolServer

NewToolServer starts a stub tool API that requires token.

func (*ToolServer) Calls

func (ts *ToolServer) Calls() []ToolCall

Calls returns the recorded calls.

Jump to

Keyboard shortcuts

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