Documentation
¶
Index ¶
- Constants
- func MissingTraceEvents(required []string, stdout string) []string
- func ParseTraceEventKeys(stdout string) []string
- func TraceEventKeys(stdout string) []string
- type AgentRunInput
- type AgentRunResult
- type AgentRunner
- type AgentRunnerFunc
- type BenchmarkInput
- type BenchmarkReport
- type BenchmarkSummary
- type BenchmarkTaskReport
- type ChangedFilesFunc
- type Command
- type CommandAgentRunner
- type CommandResult
- type CommandRunner
- type ContextCheckResult
- type ContextChecks
- type Harness
- type MaterializeInput
- type Materializer
- type Report
- type Result
- type ResultKind
- type RunInput
- type Runner
- type ScoreInput
- type Status
- type Suite
- type Summary
- type Task
- type ValidationError
- type Workspace
Constants ¶
View Source
const ReportContractVersion = "zero.agenteval.report.v1"
Variables ¶
This section is empty.
Functions ¶
func MissingTraceEvents ¶
func ParseTraceEventKeys ¶
func TraceEventKeys ¶
Types ¶
type AgentRunInput ¶
type AgentRunResult ¶
type AgentRunResult struct {
ExitCode int `json:"exitCode"`
Stdout string `json:"stdout,omitempty"`
Stderr string `json:"stderr,omitempty"`
Error string `json:"error,omitempty"`
// Truncated is set when captured stdout/stderr exceeded the runner's
// OutputLimit and some output was dropped.
Truncated bool `json:"truncated,omitempty"`
}
type AgentRunner ¶
type AgentRunner interface {
Run(context.Context, AgentRunInput) AgentRunResult
}
type AgentRunnerFunc ¶
type AgentRunnerFunc func(context.Context, AgentRunInput) AgentRunResult
func (AgentRunnerFunc) Run ¶
func (fn AgentRunnerFunc) Run(ctx context.Context, input AgentRunInput) AgentRunResult
type BenchmarkInput ¶
type BenchmarkReport ¶
type BenchmarkReport struct {
Contract string `json:"contract"`
SuiteID string `json:"suiteId"`
OK bool `json:"ok"`
Summary BenchmarkSummary `json:"summary"`
Tasks []BenchmarkTaskReport `json:"tasks"`
}
type BenchmarkSummary ¶
type BenchmarkTaskReport ¶
type CommandAgentRunner ¶
type CommandAgentRunner struct {
Command []string
// OutputLimit caps captured stdout/stderr per stream in bytes. Zero applies
// defaultAgentOutputLimit; a negative value disables the cap.
OutputLimit int
}
func (CommandAgentRunner) Run ¶
func (runner CommandAgentRunner) Run(ctx context.Context, input AgentRunInput) AgentRunResult
type CommandResult ¶
type CommandRunner ¶
type CommandRunner func(context.Context, string, Command) CommandResult
type ContextCheckResult ¶
func (ContextCheckResult) OK ¶
func (result ContextCheckResult) OK() bool
type ContextChecks ¶
type ContextChecks struct {
RequiredFiles []string `json:"requiredFiles,omitempty"`
ForbiddenFiles []string `json:"forbiddenFiles,omitempty"`
}
func (ContextChecks) CheckWorkspace ¶
func (checks ContextChecks) CheckWorkspace(workspace string) (ContextCheckResult, error)
type Harness ¶
type Harness struct {
Materializer Materializer
Agent AgentRunner
Runner Runner
}
func (Harness) Run ¶
func (harness Harness) Run(ctx context.Context, suitePath string, suite Suite, input BenchmarkInput) BenchmarkReport
type MaterializeInput ¶
type MaterializeInput struct {
WorkRoot string
}
type Materializer ¶
type Materializer struct{}
func (Materializer) MaterializeTask ¶
func (Materializer) MaterializeTask(ctx context.Context, suitePath string, task Task, input MaterializeInput) (Workspace, error)
type Report ¶
type Report struct {
Contract string `json:"contract"`
SuiteID string `json:"suiteId"`
TaskID string `json:"taskId"`
Status Status `json:"status"`
OK bool `json:"ok"`
Summary Summary `json:"summary"`
ChangedFiles []string `json:"changedFiles"`
Results []Result `json:"results"`
Error string `json:"error,omitempty"`
}
func Score ¶
func Score(suite Suite, input ScoreInput) Report
type Result ¶
type Result struct {
ID string `json:"id"`
Name string `json:"name"`
Kind ResultKind `json:"kind"`
Status Status `json:"status"`
Command []string `json:"command,omitempty"`
ExitCode *int `json:"exitCode,omitempty"`
Stdout string `json:"stdout,omitempty"`
Stderr string `json:"stderr,omitempty"`
Message string `json:"message,omitempty"`
ExpectedFiles []string `json:"expectedFiles,omitempty"`
ActualFiles []string `json:"actualFiles,omitempty"`
MissingFiles []string `json:"missingFiles,omitempty"`
UnexpectedFiles []string `json:"unexpectedFiles,omitempty"`
ExpectedEvents []string `json:"expectedEvents,omitempty"`
ActualEvents []string `json:"actualEvents,omitempty"`
MissingEvents []string `json:"missingEvents,omitempty"`
}
type ResultKind ¶
type ResultKind string
const ( ResultCommand ResultKind = "command" ResultChangedFiles ResultKind = "changed_files" ResultContext ResultKind = "context" ResultTrace ResultKind = "trace" )
type Runner ¶
type Runner struct {
RunCommand CommandRunner
ChangedFiles ChangedFilesFunc
// contains filtered or unexported fields
}
type ScoreInput ¶
type ScoreInput struct {
TaskID string
CommandResults []CommandResult
ChangedFiles []string
ContextCheckResult *ContextCheckResult
ContextCheckError string
TraceStdout string
Blocked bool
BlockReason string
}
type Suite ¶
type Task ¶
type Task struct {
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description,omitempty"`
Tags []string `json:"tags,omitempty"`
Difficulty string `json:"difficulty,omitempty"`
Prompt string `json:"prompt"`
WorkspaceFixture string `json:"workspaceFixture"`
VerificationCommands []Command `json:"verificationCommands"`
ExpectedChangedFiles []string `json:"expectedChangedFiles"`
ForbiddenChangedFiles []string `json:"forbiddenChangedFiles,omitempty"`
RequiredTraceEvents []string `json:"requiredTraceEvents,omitempty"`
ContextChecks ContextChecks `json:"contextChecks,omitempty"`
}
type ValidationError ¶
type ValidationError struct {
Problems []string
}
func (ValidationError) Error ¶
func (err ValidationError) Error() string
Click to show internal directories.
Click to hide internal directories.