Writing a suite and cases
A suite is one directory. Commands read the directory named by --suite, or ./evals when it holds a suite.json.
Layout
evals/
suite.json the bootstrap, the cards directory, the rules and the limits
cases/<id>.json one case per file; the id matches the file name
fixtures/<name>/ a small repository copied fresh for every sample
fixtures/<name>/.eval/<setup>.sh
optional scripts that change the copy's git state
Paths in suite.json are relative to the suite directory and may climb out of it, so a suite in evals/ can name the repository's own instructions as ../AGENTS.md.
Rules and anchors
Each rule names its home file and an anchor: a phrase that appears exactly once in that file. wingstack evals check fails when the anchor goes missing, so a rule cannot be trimmed from the instructions without its manifest entry moving with it. Whitespace is collapsed before matching, so re-wrapping a paragraph keeps the anchor.
A rule lists its cases, or gives an untested reason such as "needs a judge grader". It cannot have both.
Cards reach the agent as files
The suite's standards directory holds the cards, one Markdown file per card; a card's name is its file name without .md. Each sample receives a copy of that directory at its path relative to the bootstrap's directory. With the bootstrap at instructions/AGENTS.md and the cards in instructions/standards/, the fixture copy gets standards/, so a bootstrap line that says "read standards/testing.md" resolves inside the copy. The cards are part of the copy's first commit.
Selection cases
A selection case passes when every card in expect.cards is opened within the first within tool calls (10 when unset). When max_cards is set, the sample also fails if it opens more distinct cards than that.
A card counts as opened when the agent tries to read its file:
- with the Read tool, by absolute path or a path relative to the fixture copy;
- with a shell reader that names the file as an operand or as its last
<redirection, which is the one that supplies stdin:cat,head,tail,less,more,bat,nl, orsedwithout an in-place flag.
A partial read counts, such as Read with a line limit or head -n 20, because a selection case measures which cards the agent chose, not how much of each it read. A sed call with -i in any form, including clusters such as -ni.bak and --in-place, is a write and opens nothing. A script given with -e, attached as in -e'1p' or as the next word, is not mistaken for a file.
The grader follows cd with shell scope. A cd changes the directory for later commands in the same shell and for later Bash calls. It does not reach the parent from a pipeline member, a ( ... ) subshell, a command substitution, a background job or a nested bash -c. env -C <dir> runs its command in that directory without changing the caller's. A newline after | continues the pipeline. A substitution runs before the command that holds it, so cd "$(cat standards/testing.md)" reads the card from the directory the cd started in.
A path counts as a card only if it resolves to exactly the cards directory in the fixture copy, whose real path the session's init event reports. A file elsewhere whose path merely ends in standards/testing.md is not the card.
A search is not an open. A Grep or Glob over the cards directory, or a shell grep, rg, find or ls naming it, opens no card. The run reports each such search as a note in summary.md and results.jsonl, never as a pass.
When the grader cannot establish which file a reader read, the sample is ungraded. That happens with an operand holding a variable, ~ or a glob (cat standards/*.md), and with a relative path after a cd the grader could not follow, such as cd $DIR, and with an absolute path that could be the card when no init event named the fixture's path.
Write the task the way a person would ask for it. A prompt that names the card, or the card's subject in its own words, tests reading comprehension rather than selection.
Behavior cases
A behavior case passes when no forbid_calls or forbid_reply pattern matches and every require_calls and require_reply pattern does. Reply patterns are Go regular expressions searched in the agent's final reply; a forbidden pattern that matches the empty string, such as ^$, fails an empty reply.
A behavior case may also set max_cards. With "max_cards": 0, any card read fails the case, by every route the selection grader recognizes. That is how a control says a task needs no card.
A call pattern names a tool, matched as a whole tool name, such as Bash or Edit|Write. For a Bash call, the grader splits the command into simple commands and matches each one against the pattern's word fields. Every field set must match the same simple command:
program: the command's base name, so/usr/bin/gitisgit. Required for any pattern that can match Bash.sub: the first argument that is not an option, such asstashingit -C /repo stash push.arg: any one argument aftersub, matched whole.paths: a pathspec named bygit addorgit commit, matched whole; option values such as a message are skipped.message: a search in the commit message.before: a tool-name expression; a required call must come before the first call to such a tool.
program, sub, arg and paths must match the entire word, so a path that merely contains a word does not match it: git -C /tmp/stash-copy status does not match sub: "stash", and a message mentioning --no-verify does not match arg: "--no-verify".
For any other tool, pattern searches the call's compact JSON input, and added searches only the text an Edit, MultiEdit or Write adds, so a comment the edit replaces never matches.
What the Bash grader understands
The grader interprets a bounded subset of shell, in execution order and with shell scope:
- quoting, escapes, comments, and redirections, including
<input files, heredocs (<<and<<-, with the delimiter line matched exactly) and here-strings; - separators and grouping:
;,&&,||,|,|&,&, newlines,( ... )subshells and{ ...; }groups; - command substitutions,
$(...)and backticks, including those inside double quotes and inside an unquoted heredoc's body; a quoted)inside a substitution does not end it; - scripts a shell runs:
bash,sh,zsh,dashorkshwith-c(also in clusters such as-lc), or fed a heredoc or here-string; - wrappers that leave the command intact: variable assignments,
envwith its options (including-S, and-Cas a directory change for the wrapped command),timeout,nice,command(command -vruns nothing),exec,nohup,timeandbuiltin; git -C <dir>,go -C <dir>andmake -C <dir>, so the subcommand is still found;- commit messages from
-m,--message,--trailer,-F -with a literal heredoc or here-string,-F <file>when the agent wrote that file with Write earlier in the sample, and the-m "$(cat <<'EOF' ... EOF)"form. A single-quoted'$(...)'is literal text, not a substitution.
It does not evaluate control flow: true || git stash counts as running git stash. It judges the commands the agent typed, not what a program does internally, so make test is make, not the commands in its recipe.
Wherever that subset does not establish what ran, the sample is ungraded, never a pass or a fail:
- a command it cannot parse, such as an unterminated quote, an unclosed substitution or a heredoc with no closing delimiter;
- an empty Bash call, or one whose input has no readable command;
- a program that runs commands the transcript does not show:
eval,source,.,alias,trap,xargs, privilege wrappers,su,watch,parallel,findwith-execor-ok, and similar runners; - a shell given a script file, or reading its script from a pipe;
- a script or relative executable, such as
./cleanup.sh; - a program name that holds a variable, substitution or glob, such as
$GIT stashor/usr/bin/g[i]t stash, or a word a pattern needs that holds an expansion, such asgit commit $FLAGSagainst a pattern on its arguments; - a commit message from a variable, a substitution other than the literal
catheredoc, an unread file,--amendwithout a new message, or-C,-c,--fixupand similar reuse options.
When one command in a Bash call is outside the subset, the commands before it are still graded and only what follows it is unknown, so git stash; eval "$x" fails a no-stash case. A syntax error, such as an unterminated quote, means the shell runs nothing, and the whole call is unknown. A definite violation fails the sample even when something else in it is unsure.
Fixtures and setup
A fixture is a small repository, copied for every sample under TMPDIR without its .eval directory. The harness commits the copy as Initial commit, then runs the case's setup script, if any, from the copy's root. Put git state there: a staged change, an uncommitted edit, a branch.
Setup scripts are trusted code from the suite. Each runs on your machine as you, with bash, inside the fixture copy, with HOME pointed at a scratch directory and no GIT_* variables, and with no other sandbox: it can read and write anything you can. Review a suite's .eval scripts before you run it, as you would any script.
Keep fixtures tiny and free of anything private, because transcripts and summaries quote them.
Design cases around the first attempt
A sample runs with read-only tools. Every other call, such as git commit or an edit, is denied, and the denial still appears in the transcript, which is what the grader scores. An agent often stops or changes course after a denial, so a case sees the first attempt at an action, not what the agent would do after it succeeded. Ask for something whose first attempt shows the behavior.
Check before you run
wingstack evals check --suite evals
It prints clean with the rule and case counts, or one finding per line and exits 1. wingstack evals run runs the same check and refuses a suite with findings.