Documentation
¶
Overview ¶
Package eval runs versioned MCP workflows against model runtimes and checks their functional outcomes against explicitly approved regression baselines.
Index ¶
- Constants
- func CheckBaseline(b Baseline, suite Suite, g Generation, repeat int) error
- func Compare(b Baseline, r Report, model string) ([]string, error)
- func Export(r Report, dir string) error
- func Hash(value any) string
- func ReadJSON(path string, value any) error
- func Scores(r Report, model string) map[string]Score
- func ValidateReport(r Report) error
- func WriteJSON(path string, value any) error
- type Baseline
- type Case
- type Check
- type FixtureCall
- type FixtureTool
- type Generation
- type Grade
- type MetricResult
- type ModelCall
- type Options
- type Report
- type Score
- type Suite
- type ToolRef
- type Trial
Constants ¶
const GraderVersion = "mcp-outcomes-v1"
const Version = 1
Variables ¶
This section is empty.
Functions ¶
func CheckBaseline ¶
func CheckBaseline(b Baseline, suite Suite, g Generation, repeat int) error
CheckBaseline validates compatibility before spending model calls on a test.
func Export ¶
Export creates a local comparison dataset, preserving failed trials and raw request/response traces. No credentials are stored. An explicitly selected Laya origin is recorded.
func ValidateReport ¶
ValidateReport recomputes grades instead of trusting editable saved scores.
Types ¶
type Baseline ¶
type Baseline struct {
LayaEnabled bool `json:"laya_enabled,omitempty"`
Version int `json:"version"`
Grader string `json:"grader"`
SuiteHash string `json:"suite_hash"`
SourceRunHash string `json:"source_run_hash"`
Model string `json:"model"`
Generation Generation `json:"generation"`
Cases map[string]Score `json:"cases"`
}
type Case ¶
type Case struct {
ExpectedToolSequence []ToolRef `json:"expected_tool_sequence,omitempty" yaml:"expected_tool_sequence,omitempty"`
ID string `json:"id" yaml:"id"`
AgentID string `json:"agent_id" yaml:"agent_id"`
Skills []string `json:"skills" yaml:"skills"`
Task string `json:"task" yaml:"task"`
Tools []FixtureTool `json:"tools" yaml:"tools"`
Checks []Check `json:"checks" yaml:"checks"`
ConsistencyPaths []string `json:"consistency_paths" yaml:"consistency_paths"`
RequiredBridgeCalls []string `json:"required_bridge_calls,omitempty" yaml:"required_bridge_calls,omitempty"`
ForbiddenTools []string `json:"forbidden_tools,omitempty" yaml:"forbidden_tools,omitempty"`
MaxBytes int `json:"max_bytes,omitempty" yaml:"max_bytes,omitempty"`
}
type FixtureCall ¶
type FixtureTool ¶
type FixtureTool struct {
Server string `json:"server" yaml:"server"`
Name string `json:"name" yaml:"name"`
Description string `json:"description" yaml:"description"`
InputSchema map[string]any `json:"input_schema" yaml:"input_schema"`
Arguments map[string]any `json:"arguments" yaml:"arguments"`
Response map[string]any `json:"response" yaml:"response"`
IsError bool `json:"is_error,omitempty" yaml:"is_error,omitempty"`
Required bool `json:"required" yaml:"required"`
}
type Generation ¶
type Grade ¶
type Grade struct {
Metrics []MetricResult `json:"metrics"`
Passed bool `json:"passed"`
Checks map[string]bool `json:"checks"`
SemanticSignature string `json:"semantic_signature,omitempty"`
}
func GradeTrial ¶
type MetricResult ¶
type ModelCall ¶
type ModelCall struct {
Started time.Time `json:"started"`
Request runtime.ChatRequest `json:"request"`
Response *runtime.ChatResponse `json:"response,omitempty"`
Error string `json:"error,omitempty"`
DurationMS int64 `json:"duration_ms"`
}
type Report ¶
type Report struct {
LayaURL string `json:"laya_url,omitempty"`
Version int `json:"version"`
Grader string `json:"grader"`
Suite Suite `json:"suite"`
SuiteHash string `json:"suite_hash"`
Build buildinfo.Info `json:"build"`
Engine runtime.Engine `json:"engine"`
Models []string `json:"models"`
Repeat int `json:"repeat"`
Generation Generation `json:"generation"`
Started time.Time `json:"started"`
Completed bool `json:"completed"`
Trials []Trial `json:"trials"`
}
type Suite ¶
type Trial ¶
type Trial struct {
Recommendation *app.RecommendationTrace `json:"recommendation,omitempty"`
MCPResponse *sdk.CallToolResult `json:"mcp_response,omitempty"`
CaseID string `json:"case_id"`
Model string `json:"model"`
Repetition int `json:"repetition"`
DurationMS int64 `json:"duration_ms"`
Calls []ModelCall `json:"calls"`
ToolCalls []FixtureCall `json:"tool_calls"`
Result result.RunResult `json:"result"`
MCPError bool `json:"mcp_error"`
Error string `json:"error,omitempty"`
Grade Grade `json:"grade"`
}