README.md

Go skills eval

This eval measures how well an agent writes, ports and reviews Go, so that one arm, such as the skills before a change, after a change, or no skills at all, can be compared with another. A machine grades every task.

text
1evals/
2├── grade.py # prepares an arm folder and grades it
3├── triggers.json # 16 requests and the one skill each should load, or none
4└── tasks/
5 ├── write/<id>/ # prompt.md and cases.json for a new command line program
6 ├── port/<id>/ # prompt.md, cases.json, and source/ with the Python to port
7 └── review/<id>/ # prompt.md, key.json with the seeded defects, and module/
TaskWhat it exercises
write/retry-fetchHTTP client, retries under one deadline, error matching
write/probegoroutines with a limit, one deadline, cancellation that is not an outcome
write/order-checkstrict JSON decoding, error classes mapped to exit codes
write/tallythe uuid, slices and cmp packages, sorting and aggregation
port/bucket-reportfloor division on negatives, stable sort, code point indexing, dict order, round half to even
review/fleet-monitor13 seeded defects, of which 4 are golangci-lint findings and 9 need a reader

Run it

Each prompt holds {ARM}. Replace it with the arm folder before you give the prompt to an agent. The agent sees only the arm folder, never this one.

bash
1python3 evals/grade.py --prepare /tmp/arm-skills
2# give each tasks/*/*/prompt.md to the agent, with {ARM} set to /tmp/arm-skills
3python3 evals/grade.py --arm /tmp/arm-skills --lint-config skills/go-review/assets/golangci.yml

--prepare creates write/<id>/, port/<id>/ and review/<id>/ in an empty or new folder, and copies in the Python source and the review module. It never copies cases.json, key.json or a reference solution.

--arm needs Go and golangci-lint, and a folder that --prepare made. It exits 1 when the folder or one of its task folders is missing. It starts a local HTTP server for the cases that make requests, and prints one line per task, then one JSON object as its last line:

KeyMeaning
buildFailureswritten and ported modules that are missing, fail go build -race, or give no golangci-lint report
casesPassed, casesTotalwrite task cases with the expected stdout and exit code
lintIssuesgolangci-lint issues in the written and ported modules, with the given config
fixDiffLineschanged lines that go fix -diff ./... proposes in those modules
portPassed, portTotalport task cases with the expected stdout and exit code
reviewFound, reviewTotalseeded defects that some finding in findings.json matches
reviewFalsePositivesfindings that match no seeded defect

A finding matches a defect when its file is the same, its line is within 3 lines of the defect's range, and its summary is a non-empty string. A case passes when the exit code matches and stdout matches exactly, or as parsed JSON when the case sets "stdoutFormat": "json". The port cases compare the Go program with fixed expected outputs in cases.json, which were produced by running the Python source on each case. Grading never runs the Python.

The grader prints a problem on stderr and exits 1, after the JSON object, when a findings.json is not a JSON list or golangci-lint gives no report for a module. Such a findings file scores no findings. A missing findings.json scores no findings without a problem. Otherwise the grader exits 0.

triggers.json is input for a harness that records which skill an agent loads for each request. grade.py does not read it.