File size: 3,077 Bytes
9368cc4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# SACB — corpus source

The parquet files in this repository are the *materialised* benchmark: each
record carries a full file map, hidden tests and reference fix, which is
everything a harness needs to run SACB.

This directory is what those records were built *from*, so the corpus can be
regenerated, extended, or ported to another language.

## Layout

```
corpus/<lang>/<repo>/repo/            the base tree, in its CORRECT state
corpus/<lang>/<repo>/tasks/<id>/task.json   metadata + the bug report
corpus/<lang>/<repo>/tasks/<id>/break/      overlay that injects the defect
corpus/<lang>/<repo>/tasks/<id>/tests/      hidden tests
corpus/<lang>/<repo>/tasks/<id>/gold/       optional; defaults to the base tree
```

The base repository is the **correct** code and each task overlays a defect on
top of it. The reference fix is therefore the base itself, which is why a task
cannot ship with a "solution" that does not work. For add-a-feature tasks the
break overlay simply removes the implementation.

## Tools

| script | role |
|---|---|
| `tools/build_corpus.py` | validate every task and emit the JSONL the parquet is built from |
| `tools/make_tasks.py` | helper used by the authoring scripts |
| `tools/tasks_*.py` | the authoring batches, one defect or compound per entry |
| `tools/gen_compounds.py` | compose compound tasks from validated single defects |
| `tools/select_corpus.py` | choose the shipped mix to hit a target resolved rate |
| `tools/upload_sacb.py` | publish to this repository |
| `tools/harness-tests/` | tests for the llama-eval harness itself |

These import `eval_sandbox` and `agentic_eval` from `examples/llama-eval/` in
llama.cpp, so point `sys.path` at a checkout that has them.

## Regenerating

```bash
python3 tools/build_corpus.py --corpus corpus --out agentic-corpus.jsonl
```

`fail_to_pass` and `pass_to_pass` are **derived**, never written by hand: the
tests are run once against the defective tree and once against the reference,
and the sets fall out of the difference. The builder rejects a task whose defect
no test exercises, and one whose reference fix does not itself pass. It caught
several authoring mistakes that way, which is the point.

## Adding a task

Add an entry to a `tasks_*.py` batch giving the exact anchor text to replace and
the tests, run the builder, and fix whatever it rejects. Anchors are matched
exactly and must occur exactly once, so a defect can never silently fail to be
injected.

## Adding a language

The harness takes a new language as a `LangSpec` entry (linter argv, test
runner, packages) without any other change. Java was scoped out of this release
but needs no harness work — a JDK tarball plus the JUnit console-standalone jar
would keep the no-container property.

## Calibration

`CALIBRATION.md` records every measurement taken while tuning this corpus, and
in particular the four assumptions about difficulty that measurement
contradicted. Read it before changing the composition — the headline is that
**repository size, not defect count, is what makes these tasks hard**.