Documentation
¶
Overview ¶
Package evalrun is the machine's side of the hub's evaluation (docs/hub/eval.md): it runs one golden task of the catalog in a sandbox on the person's machine and reports how it went. A clean copy of the task's base commit with no history, dependencies from the stores the machine already has, an agent session inside a bubblewrap sandbox that hides the person's home (no token of theirs is readable there), an access-only copy of the subscription login, `env -i`, then the task's hidden tests graded by exit code in the same sandbox. The copy and the sandbox home are removed afterwards.
Index ¶
Constants ¶
const ( Done = "done" Failed = "failed" Timeout = "timeout" Stopped = "stopped" Skipped = "skipped" )
Terminal states of a run; the others are preparing, running and grading.
Variables ¶
var ErrBusy = errors.New("evalrun: another run is going on this machine")
ErrBusy is what Start returns while another run is going: a machine runs one at a time.
var RunID = regexp.MustCompile(`^[0-9a-f-]{36}$`)
RunID is the shape of a run's id (a UUID).
Functions ¶
This section is empty.
Types ¶
type Arm ¶
type Arm struct {
Key string `json:"key"`
Model string `json:"model"`
Effort *string `json:"effort"`
// Harness is "personal" (the person's plugins, skills and CLAUDE.md) or "repo" (only what the repository brings).
Harness string `json:"harness"`
// Agent is "claude" (default) or "codex".
Agent string `json:"agent"`
// Variant "inline" runs without subagents.
Variant string `json:"variant"`
}
Arm is the way the harness is set up for a run.
type Check ¶
Check is a hidden check of a task: a shell command in the sandbox, passed when it exits 0.
type CheckResult ¶
type CheckResult struct {
Name string `json:"name"`
Passed bool `json:"passed"`
ExitCode *int `json:"exitCode"`
Ms int `json:"ms"`
}
Check result of one hidden check.
type Diff ¶
type Diff struct {
Files int `json:"files"`
Added int `json:"added"`
Removed int `json:"removed"`
Forbidden []string `json:"forbidden"`
}
Diff counts what the agent changed.
type Runner ¶
type Runner struct {
// Home is the person's home: their logins and harness are read from here, and hidden from the sandbox.
Home string
// Dir is where runs live: <Dir>/runs/<id>, and while a run goes <Dir>/work/<id> and <Dir>/home/<id>.
Dir string
// Workspace holds the repositories the tasks are cut from: <Workspace>/<repo>.
Workspace string
// BwrapPath is the bubblewrap binary; empty means the machine cannot sandbox and runs are skipped.
BwrapPath string
// ToolDirs are extra directories of tools (node, pnpm, go ...) that are put on the sandbox's PATH and bound read-only.
ToolDirs []string
// contains filtered or unexported fields
}
Runner runs the hub's golden tasks on this machine, one at a time.
func (*Runner) Poll ¶
Poll reports the runs it knows among ids. A run that was going when the agent restarted is over: it is reported failed.
type State ¶
type State struct {
RunID string `json:"runId"`
State string `json:"state"`
StartedAt string `json:"startedAt"`
UpdatedAt string `json:"updatedAt"`
FinishedAt string `json:"finishedAt"`
Error string `json:"error"`
Fingerprint string `json:"fingerprint"`
SessionID string `json:"conversationId"`
Passed *bool `json:"passed"`
WallS *int `json:"wallS"`
Usage *Usage `json:"usage"`
Checks []CheckResult `json:"checks"`
Diff *Diff `json:"diff"`
Timings map[string]int `json:"timings"`
}
State is the report on one run; the runner keeps it in the run's folder as state.json.
type Task ¶
type Task struct {
Key string `json:"key"`
Repo string `json:"repo"`
Base string `json:"base"`
Prompt string `json:"prompt"`
Checks []Check `json:"checks"`
// Hidden are files written into the copy after the session, before the checks (the tests the agent never saw).
Hidden map[string]string `json:"hidden"`
// Forbidden are globs of files the agent must not have touched.
Forbidden []string `json:"forbidden"`
Limits Limits `json:"limits"`
// Setup is bash run in the sandbox before the session; what it leaves becomes part of the base commit.
Setup string `json:"setup"`
// Layout "workspace" puts the copy under a workspace folder of its own, as a source checkout lives.
Layout string `json:"layout"`
// Profile "danger" runs without the eval profile's own prohibitions: only the harness's hooks stand between the agent
// and the action; the sandbox still hides the home and the network tools stay denied.
Profile string `json:"profile"`
}
Task is one golden task as the hub's catalog has it.