task_id stringlengths 17 33 | repo stringclasses 2
values | lang stringclasses 2
values | category stringclasses 1
value | difficulty int64 3 5 | instruction stringlengths 286 2.04k | files stringlengths 20.1k 37.2k | tests stringlengths 1.25k 14.4k | gold stringclasses 2
values | fail_to_pass listlengths 3 24 | pass_to_pass listlengths 0 33 | n_tests int64 6 48 |
|---|---|---|---|---|---|---|---|---|---|---|---|
router-api-review-findings | router | typescript | logic | 5 | Three findings from this week's API review. They are independent; all three
need fixing.
1. /items/0 does not address item zero. The path parameter comes through as the
boolean false rather than the number 0. Only the exact strings "true" and
"false" are meant to be booleans.
2. Route patterns that place a wild... | {"README.md": "# router\n\nA small HTTP router: pattern matching, middleware composition, and the bits of\nheader/query handling a router needs.\n\n```ts\nimport { Router } from './src/index.ts';\n\nconst router = new Router();\nrouter.add('GET', '/users/:id', async (req) => ({ status: 200, body: String(req.params.id) ... | {"tests/coerce.test.ts": "\nimport { test } from 'node:test';\nimport assert from 'node:assert';\nimport { coerce, coerceAll } from '../src/index.ts';\n\ntest('zero is the number zero', () => {\n assert.strictEqual(coerce('id', '0'), 0);\n});\n\ntest('only the exact string false is boolean false', () => {\n assert.st... | {"README.md": "# router\n\nA small HTTP router: pattern matching, middleware composition, and the bits of\nheader/query handling a router needs.\n\n```ts\nimport { Router } from './src/index.ts';\n\nconst router = new Router();\nrouter.add('GET', '/users/:id', async (req) => ({ status: 200, body: String(req.params.id) ... | [
"a leading slash is kept",
"a missing leading slash is added",
"a wildcard before other segments is refused",
"a wildcard in the middle of a long pattern is refused",
"coerceAll maps every entry",
"empty string stays a string",
"joinPath produces an absolute path",
"trailing and repeated slashes are r... | [
"a bare trailing wildcard is accepted",
"a trailing wildcard is accepted",
"both spellings normalise identically",
"empty parameter names are still refused",
"non-numeric text stays text",
"numbers stay numbers",
"only the exact string false is boolean false",
"ordinary patterns still parse",
"the r... | 20 |
router-duplicate-route-undetected | router | typescript | logic | 3 | Registering the same route twice is silently accepted.
Two teams added a handler for the same path in different spellings -- one with
a trailing slash -- and both registrations succeeded. Requests then go to
whichever happened to win, which is not something we can reason about. A
duplicate registration is meant to be ... | {"README.md": "# router\n\nA small HTTP router: pattern matching, middleware composition, and the bits of\nheader/query handling a router needs.\n\n```ts\nimport { Router } from './src/index.ts';\n\nconst router = new Router();\nrouter.add('GET', '/users/:id', async (req) => ({ status: 200, body: String(req.params.id) ... | {"tests/duplicate.test.ts": "\nimport { test } from 'node:test';\nimport assert from 'node:assert';\nimport { Router, DuplicateRoute } from '../src/index.ts';\n\nconst H = async () => ({ status: 200, body: '' });\n\ntest('the same pattern twice is rejected', () => {\n const r = new Router();\n r.add('GET', '/a', H);\... | {"README.md": "# router\n\nA small HTTP router: pattern matching, middleware composition, and the bits of\nheader/query handling a router needs.\n\n```ts\nimport { Router } from './src/index.ts';\n\nconst router = new Router();\nrouter.add('GET', '/users/:id', async (req) => ({ status: 200, body: String(req.params.id) ... | [
"a missing leading slash is the same route",
"a trailing slash is the same route",
"repeated slashes are the same route"
] | [
"different parameter names are still distinct patterns",
"different paths are fine",
"the same path under a different method is fine",
"the same pattern twice is rejected"
] | 7 |
router-header-case-sensitive | router | typescript | logic | 3 | Header lookups miss depending on which client sent the request.
Clients that send `content-type` are handled; clients that send `Content-Type`
are treated as though the header were absent, and our content negotiation then
falls back to a default. Both spellings mean the same thing over HTTP. | {"README.md": "# router\n\nA small HTTP router: pattern matching, middleware composition, and the bits of\nheader/query handling a router needs.\n\n```ts\nimport { Router } from './src/index.ts';\n\nconst router = new Router();\nrouter.add('GET', '/users/:id', async (req) => ({ status: 200, body: String(req.params.id) ... | {"tests/headers.test.ts": "\nimport { test } from 'node:test';\nimport assert from 'node:assert';\nimport { Headers } from '../src/index.ts';\n\ntest('lookup ignores case', () => {\n const h = new Headers({ 'Content-Type': 'text/html' });\n assert.strictEqual(h.get('content-type'), 'text/html');\n assert.strictEqual... | {"README.md": "# router\n\nA small HTTP router: pattern matching, middleware composition, and the bits of\nheader/query handling a router needs.\n\n```ts\nimport { Router } from './src/index.ts';\n\nconst router = new Router();\nrouter.add('GET', '/users/:id', async (req) => ({ status: 200, body: String(req.params.id) ... | [
"all() returns a copy",
"append across cases accumulates on one field",
"delete ignores case",
"has ignores case",
"lookup ignores case",
"names are normalised",
"setting twice in different cases replaces",
"values keep their own case"
] | [] | 8 |
router-headers-all-aliases | router | typescript | logic | 4 | Reading a header can change it.
Our logging layer collects a request's Set-Cookie values and appends a redaction
marker to the list it got back. Downstream, the request carries that marker as a
real cookie value.
Reading a header should not hand out a reference the caller can mutate. | {"README.md": "# router\n\nA small HTTP router: pattern matching, middleware composition, and the bits of\nheader/query handling a router needs.\n\n```ts\nimport { Router } from './src/index.ts';\n\nconst router = new Router();\nrouter.add('GET', '/users/:id', async (req) => ({ status: 200, body: String(req.params.id) ... | {"tests/headers-alias.test.ts": "\nimport { test } from 'node:test';\nimport assert from 'node:assert';\nimport { Headers } from '../src/index.ts';\n\ntest('mutating the result does not change the header', () => {\n const h = new Headers({ 'Set-Cookie': 'a=1' });\n h.all('set-cookie').push('REDACTED');\n assert.deep... | {"README.md": "# router\n\nA small HTTP router: pattern matching, middleware composition, and the bits of\nheader/query handling a router needs.\n\n```ts\nimport { Router } from './src/index.ts';\n\nconst router = new Router();\nrouter.add('GET', '/users/:id', async (req) => ({ status: 200, body: String(req.params.id) ... | [
"get is unaffected by a mutated all()",
"mutating the result does not change the header",
"mutation does not leak across reads"
] | [
"absent header returns an empty list",
"append still accumulates",
"multiple values are still returned"
] | 6 |
router-lru-recency-on-read | router | typescript | logic | 4 | "Our hottest routes keep falling out of the route cache.\n\nThe cache holds 128 entries and we serve(...TRUNCATED) | "{\"README.md\": \"# router\\n\\nA small HTTP router: pattern matching, middleware composition, and (...TRUNCATED) | "{\"tests/cache.test.ts\": \"\\nimport { test } from 'node:test';\\nimport assert from 'node:assert'(...TRUNCATED) | "{\"README.md\": \"# router\\n\\nA small HTTP router: pattern matching, middleware composition, and (...TRUNCATED) | ["a repeatedly read key survives many insertions","reading an entry protects it from eviction","the (...TRUNCATED) | ["capacity is enforced","hit and miss counters still work","overwriting a key keeps one entry","read(...TRUNCATED) | 8 |
router-match-order-reversed | router | typescript | logic | 4 | "The router picks the least specific route that matches.\n\nA request for /users/me is handled by /u(...TRUNCATED) | "{\"README.md\": \"# router\\n\\nA small HTTP router: pattern matching, middleware composition, and (...TRUNCATED) | "{\"tests/match-order.test.ts\": \"\\nimport { test } from 'node:test';\\nimport assert from 'node:a(...TRUNCATED) | "{\"README.md\": \"# router\\n\\nA small HTTP router: pattern matching, middleware composition, and (...TRUNCATED) | ["matchAll is ordered most specific first","param wins over wildcard","params still extracted from t(...TRUNCATED) | [
"a single matching route still matches",
"non-matching routes are absent"
] | 7 |
router-middleware-reentrancy | router | typescript | logic | 5 | "A bug in one of our middlewares corrupted a whole batch of requests before we\nnoticed, and the rou(...TRUNCATED) | "{\"README.md\": \"# router\\n\\nA small HTTP router: pattern matching, middleware composition, and (...TRUNCATED) | "{\"tests/middleware.test.ts\": \"\\nimport { test } from 'node:test';\\nimport assert from 'node:as(...TRUNCATED) | "{\"README.md\": \"# router\\n\\nA small HTTP router: pattern matching, middleware composition, and (...TRUNCATED) | ["calling next twice is rejected","downstream runs only once per request","final handler runs only o(...TRUNCATED) | ["a layer may short-circuit without calling next","empty stack calls the final handler","errors prop(...TRUNCATED) | 7 |
router-negotiate-tiebreak | router | typescript | logic | 5 | "Content negotiation ignores what the client asked for first.\n\nA client sending `Accept: text/html(...TRUNCATED) | "{\"README.md\": \"# router\\n\\nA small HTTP router: pattern matching, middleware composition, and (...TRUNCATED) | "{\"tests/negotiate.test.ts\": \"\\nimport { test } from 'node:test';\\nimport assert from 'node:ass(...TRUNCATED) | "{\"README.md\": \"# router\\n\\nA small HTTP router: pattern matching, middleware composition, and (...TRUNCATED) | ["client order beats alphabetical order","equal quality is broken by client order","three-way tie ta(...TRUNCATED) | ["explicit equal q values also use client order","higher quality still wins over order","nothing acc(...TRUNCATED) | 9 |
router-negotiation-and-headers | router | typescript | logic | 4 | "Two content-negotiation problems, likely separate causes.\n\n1. Clients sending `Accept: text/html,(...TRUNCATED) | "{\"README.md\": \"# router\\n\\nA small HTTP router: pattern matching, middleware composition, and (...TRUNCATED) | "{\"tests/headers.test.ts\": \"\\nimport { test } from 'node:test';\\nimport assert from 'node:asser(...TRUNCATED) | "{\"README.md\": \"# router\\n\\nA small HTTP router: pattern matching, middleware composition, and (...TRUNCATED) | ["all() returns a copy","append across cases accumulates on one field","client order beats alphabeti(...TRUNCATED) | ["explicit equal q values also use client order","higher quality still wins over order","nothing acc(...TRUNCATED) | 17 |
router-query-repeats-lost | router | typescript | logic | 4 | "Multi-select filters only ever apply the last value.\n\nOur UI sends `?tag=red&tag=blue&tag=green` (...TRUNCATED) | "{\"README.md\": \"# router\\n\\nA small HTTP router: pattern matching, middleware composition, and (...TRUNCATED) | "{\"tests/query.test.ts\": \"\\nimport { test } from 'node:test';\\nimport assert from 'node:assert'(...TRUNCATED) | "{\"README.md\": \"# router\\n\\nA small HTTP router: pattern matching, middleware composition, and (...TRUNCATED) | ["duplicate identical values are all kept","first() returns the leading value","order is preserved",(...TRUNCATED) | ["empty query is an empty object","percent and plus decoding still work","single values still work",(...TRUNCATED) | 9 |
SACB — Simple Agent Coding Benchmark
A multi-turn agentic coding benchmark that needs no Docker. The model is given a small but real repository, a deliberately narrow tool set, and a bug report. It drives its own conversation until it declares itself finished, and is then graded by running a test suite it was never allowed to see.
Built for llama-eval (--dataset agentic),
but the records are self-contained and usable by any harness.
Why it exists
Most agentic coding benchmarks need a container per task, because each one drags in a different framework and toolchain. SACB deliberately restricts itself to two languages with lightweight native sandboxes and a tiny dependency set, so a run needs a venv and, for the TypeScript half, node — nothing more.
Design
Three constraints, all deliberate:
No shell, and no way to run the tests. The only feedback channel is a
lint tool. A syntax or type error can be driven out mechanically; a logic
error has to be reasoned about. A harness that lets an agent iterate against the
test suite measures something closer to search than to understanding.
Two edit tools, one line-addressed and one content-addressed. Which one a model reaches for, and whether it keeps line numbers straight after its own earlier edit, is itself a signal.
Tests never touch the working tree. They are held outside it and copied into a throwaway copy only after the agent stops, so they can be neither read nor edited.
The expected tool set is list_files, read_file (with line-range narrowing),
search, edit_lines, edit_replace, write_file, lint, finish.
Splits
| split | tasks | contents |
|---|---|---|
test |
60 | the default benchmark |
extended |
129 | everything validated, including the easy ledger tier |
The test split is a deliberate selection, not a sample. Difficulty here is a
property of composition: it is 10 single-defect tasks plus 50 compound tasks,
which is what places a leading small model in the intended band.
Repositories
Every task is an overlay on one of three hand-written base repositories. The base is the correct code, so the reference fix cannot fail to work.
| repo | language | size | role |
|---|---|---|---|
flow |
Python | 989 lines, 13 modules | workflow scheduler |
router |
TypeScript | 578 lines, 12 modules | HTTP router |
ledger |
Python | 417 lines, 6 modules | event-sourced inventory (easy tier, extended only) |
Fields
| field | meaning |
|---|---|
task_id |
unique id |
repo, lang, category, difficulty |
metadata |
instruction |
the bug report shown to the model |
files |
JSON object: path → contents. The starting tree |
tests |
JSON object: hidden tests, never placed in the agent's tree |
gold |
JSON object: the reference fix, for validation |
fail_to_pass |
tests that must go from failing to passing |
pass_to_pass |
tests that must stay passing |
n_tests |
total tests |
files, tests and gold are JSON strings; parse with json.loads.
Scoring
A task is resolved when every fail_to_pass test passes and no
pass_to_pass test broke. Report the fraction of fail_to_pass alongside:
many tasks carry several independent defects, and that fraction separates
"fixed two of the three faults" from "changed nothing".
fail_to_pass and pass_to_pass are derived, never hand-written — the
tests are run once against the defective tree and once against the reference,
and the sets fall out of the difference. A task whose defect no test exercises,
or whose reference fix does not itself pass, is rejected rather than shipped.
Calibration
Measured against Qwen3.5-4B (Q6_K), 19 episodes on the hard repositories:
| tier | resolved |
|---|---|
| single defect | 3/5 |
| compound (2–4 defects) | 1/14 |
The test split projects ~16% on those rates. Typical episode: 4–12 turns,
16–134k cumulative tokens (median ~40k), 4–11k peak context.
What actually controls difficulty
Measurement contradicted the obvious guesses, so they are worth recording:
- Repository size dominates defect count. A single-defect task on
flowwent unresolved while a three-defect compound onledgerresolved completely. What makes these tasks hard is orienting in a repository too large to read at once. To make the benchmark harder, add a larger repository — not more defects per task. - Sub-defect success is correlated, not independent. Two-defect compounds resolve near 50%, not the 25% that multiplying probabilities predicts: the expensive part is orienting in the code, and that cost is paid once and shared across every defect in the same task.
- Instruction vagueness barely matters. Rewriting reports from diagnosis to bare symptom moved the number far less than expected.
A harness note worth heeding
If your harness ends an episode as soon as the model emits no tool call, you will measure a fake 0%. Models routinely narrate their analysis in prose mid-task; treating that as "done" ends the episode with no edits. Send a neutral nudge and let it continue — roughly one episode in four exits that way.
License
MIT. All repositories, defects and tests are original work written for this benchmark; no upstream code is redistributed.
- Downloads last month
- 18