cli

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2026 License: MIT Imports: 12 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Execute

func Execute() error

Types

type EvalEntry added in v0.4.0

type EvalEntry struct {
	Input    EvalInput `json:"input"`
	Scope    string    `json:"scope"`
	Expected string    `json:"expected"`
	Label    string    `json:"label"`
}

EvalEntry represents a single labeled example in an evaluation dataset.

type EvalInput added in v0.4.0

type EvalInput struct {
	Operation string         `json:"operation"`
	Params    map[string]any `json:"params"`
}

EvalInput describes the operation and parameters for an evaluation entry.

type Expectation

type Expectation struct {
	Decision  string             `yaml:"decision"`
	Rule      string             `yaml:"rule,omitempty"`
	Message   string             `yaml:"message,omitempty"`
	Mutations []ExpectedMutation `yaml:"mutations,omitempty"`
}

Expectation is the expected evaluation result.

type ExpectedMutation

type ExpectedMutation struct {
	Path     string `yaml:"path"`
	Replaced string `yaml:"replaced"`
}

ExpectedMutation is an expected mutation from a redact action.

type FixtureCall

type FixtureCall struct {
	Operation string          `yaml:"operation"`
	Params    map[string]any  `yaml:"params"`
	Context   *FixtureContext `yaml:"context,omitempty"`
}

FixtureCall is the call to evaluate.

type FixtureContext

type FixtureContext struct {
	AgentID   string            `yaml:"agent_id,omitempty"`
	UserID    string            `yaml:"user_id,omitempty"`
	Scope     string            `yaml:"scope,omitempty"`
	Direction string            `yaml:"direction,omitempty"`
	Labels    map[string]string `yaml:"labels,omitempty"`
	Timestamp string            `yaml:"timestamp,omitempty"` // RFC3339 format
}

FixtureContext is optional context overrides.

type FixtureFile

type FixtureFile struct {
	Path  string     // source file path (set during loading, not in YAML)
	Scope string     `yaml:"scope"`
	Tests []TestCase `yaml:"tests"`
}

FixtureFile is a parsed test fixture file.

func LoadFixtures

func LoadFixtures(path string) ([]FixtureFile, error)

LoadFixtures reads and parses fixture files from a path. Path can be a single .yaml/.yml file or a directory (loads all yaml files).

type FixtureVerdict added in v0.4.0

type FixtureVerdict struct {
	Decision string `yaml:"decision"`
	Reason   string `yaml:"reason"`
}

FixtureVerdict is a recorded judge verdict for deterministic testing.

type TestCase

type TestCase struct {
	Name          string                    `yaml:"name"`
	Call          FixtureCall               `yaml:"call"`
	Expect        Expectation               `yaml:"expect"`
	JudgeVerdicts map[string]FixtureVerdict `yaml:"judge_verdicts,omitempty"`
}

TestCase is a single test: a call and the expected result.

Jump to

Keyboard shortcuts

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