# `_grader/` — source-of-truth grader package

This directory is **not a runtime dependency**. No `task.yaml` installs from
here directly. It is the **template source** that
`_scripts/generate_tasks.py` copies into each task as `./grader/`.

```
examples/frontier_eng/
├── _grader/                      ← you are here (source of truth, edit this)
│   └── src/frontier_eng_grader/
│       ├── __init__.py
│       └── grader.py
└── <Domain>/<Task>/
    ├── grader/                   ← copy of _grader/, regenerated by the script
    └── task.yaml                 ← `uv pip install -e ./grader`
```

## Editing the grader

1. Edit `src/frontier_eng_grader/grader.py` here.
2. Re-run the generator to propagate to every task:
   ```bash
   python examples/frontier_eng/_scripts/generate_tasks.py \
       --source /tmp/frontier_eng_clone \
       --dest examples/frontier_eng \
       --clean
   ```
   Or for a single task:
   ```bash
   python examples/frontier_eng/_scripts/generate_tasks.py \
       --source /tmp/frontier_eng_clone \
       --dest examples/frontier_eng \
       --only Cryptographic/SHA-256 \
       --clean
   ```
3. Validate:
   ```bash
   uv run coral validate ./examples/frontier_eng/Cryptographic/SHA-256
   ```

## Why a per-task copy instead of `uv pip install -e ../../_grader`?

So each task dir is self-contained:

- `run.session=docker` only mounts the task dir at `/task`; a `../../`
  install would escape the mount.
- A single `<Domain>/<Task>/` can be copied somewhere else and still grade.
- Matches the `examples/swebench-verified/` and `examples/erdos/`
  convention (`./grader/` next to `task.yaml`).

The duplication is ~24 KB × 74 ≈ 1.7 MB, which is the cost of the
self-containment guarantee.
