> ## Documentation Index
> Fetch the complete documentation index at: https://docs.anpord.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Cases

> Define the work and its pass condition

A case describes one coding task:

```ts theme={null}
{
  name: "health route",
  goal: "Add a /health route that returns 200",
  source: {
    kind: "repo",
    url: "https://github.com/acme/api",
    ref: "8f31c4a",
  },
  setup: "bun install",
  verify: "bun test test/health.test.ts",
}
```

| Field    | Purpose                                  |
| -------- | ---------------------------------------- |
| `name`   | Labels the row in a run                  |
| `goal`   | Replaces `{{goal}}` in the shared prompt |
| `source` | Supplies the starting workspace          |
| `setup`  | Runs before the agent starts             |
| `verify` | Runs after the agent finishes            |

Keep `name` short. Write `goal` as the task, not the full agent instruction. Put shared instructions in the run prompt.

## Source

Omit `source` for an empty workspace, or set it explicitly:

```ts theme={null}
source: { kind: "empty" }
```

Use a repository for larger tasks. Pin `ref` to a commit when runs must start from the same files.

```ts theme={null}
source: {
  kind: "repo",
  url: "https://github.com/acme/api",
  ref: "8f31c4a",
}
```

Use inline files for small fixtures:

```ts theme={null}
source: {
  kind: "files",
  files: {
    "src/add.ts": "export const add = () => 0;",
    "src/add.test.ts": "import { expect, test } from 'bun:test';",
  },
}
```

## Setup and verification

`setup` runs after the source is prepared. A nonzero exit prevents that trial's harness from starting and fails the run. Omit it when no preparation is needed.

`verify` runs after the harness finishes. Exit code `0` passes. A nonzero exit fails when the command produced usable evidence. A verifier that cannot execute, or a test runner that reports no tests, produces a void trial. Use `set -o pipefail` in shell pipelines.

Set `verify: null` to record the trajectory without scoring the trial. Void trials do not affect pass rate or create a baseline.
