cd /news/ai-tools/generate-coding-tasks-prove-the-grad… Β· home β€Ί topics β€Ί ai-tools β€Ί article
[ARTICLE Β· art-182989] src=dev.to β†— pub= topic=ai-tools verified=true sentiment=↑ positive

Generate coding tasks. Prove the grader can catch a believable mistake.

Coding Task Lab, a project that builds reproducible coding challenges from real repositories, released a toolchain that generates tasks from pinned Git checkouts and verifies each grader before it is used to evaluate coding agents. The lab's checks confirm the reference implementation passes, unchanged code fails the new requirements, and plausible wrong implementations fail a specific check; in a Click-based alias task, each reference passed 11/11 checks on its own contract but only 10/11 on the swapped one. The setup runs on Python 3.12+ with a local verifier that needs no Docker or model API key, and an optional Harbor-based Docker path runs oracle and nop baselines.

key takeaway

A grader is only trustworthy if the reference passes all checks, unchanged code fails, and a swapped-in plausible implementation loses exactly one specific check (11/11 versus 10/11 in the Click alias task).

read6 min views6 publishedDec 6, 2026

Coding Task Lab builds reproducible coding challenges from real repositories. Each challenge has a feature request, a reference implementation, and a grader. Before using a task to evaluate a coding agent, the lab checks that the reference passes, unchanged code fails the new requirements, and plausible wrong implementations fail a specific check.

Both alias tasks receive --mode DEPLOY, but the alias points to a different choice than the canonical deploy value:

Contract Expected behavior What happens if you swap in the other reference?
Canonical choice wins Return deploy The collision check fails
Reject a conflicting alias Exit with code 2 The collision check fails

The two tasks share the same inputs. Each reference passes 11/11 checks on its own contract and 10/11 on the other. The swapped implementation still earns partial credit, but it does not solve the task. The grader tells you which rule it missed.

Use Python 3.12+ and Git. The first run needs GitHub access to fetch Click unless you already have a verified checkout or snapshot. The local verifier does not require Docker or a model API key.

python3.12 -m venv .venv
.venv/bin/python -m pip install pytest==8.4.2
.venv/bin/python workspace.py

Open http://127.0.0.1:8765 for the showcase. Choose Run the lab β†’ New run β†’ Local verifier β†’ Start evaluation. Open a task and select Evidence to see what the wrong implementations got wrong. Export run downloads the task packages and the evidence for a completed run.

A source-only Git checkout starts without saved runs. The distributed submission archive includes the recorded sample. workspace.py --snapshot /path/to/click-source lets you use an offline source snapshot that matches the checked-in blob manifest.

.venv/bin/python factory.py baseline
.venv/bin/python factory.py generate --out repro --run-log repro-run.json

.venv/bin/python verify.py --dataset repro

.venv/bin/python factory.py audit --dataset repro --click-source .upstream/click/src/click
.venv/bin/python replay_alias.py --dataset repro

To show reproducibility, generate again into repro-repeat and run diff -r repro repro-repeat. With identical inputs, the package files should match. To see a behavioral change, generate --seed 43 --out fresh: the unique-prefix contract requires one normalized character instead of the three required by seed 42.

.venv/bin/python factory.py generate --seed 43 --out fresh
diff -u repro/pallets__click-prefix-choice-42/instruction.md \
  fresh/pallets__click-prefix-choice-43/instruction.md

Use a fresh output directory or a new seed when generating again. For the Docker version, start Docker with Compose and install Harbor in the same virtual environment:

.venv/bin/python -m pip install harbor==0.25.0
.venv/bin/python harbor_check.py --dataset repro

Harbor builds the task images and runs the oracle (reference) and nop (unchanged) baselines. The job directories and aggregate baselines.json are saved under jobs/. The builds require access to GitHub, the base image registry, and Python package repositories.

flowchart LR
    A["Clean checkout at a pinned Git commit"] --> B["Task generator"]
    C["Task rules or repository recipe + seed"] --> B
    B --> D["Harbor package: instructions, patches, tests, Dockerfile"]
    D --> E["Local pytest or Harbor in Docker"]
    D --> F["Deliberate wrong patches"]
    E --> G["Grading details and regression results"]
    F --> G
    G --> H["CLI reports, local workspace, and exports"]
Layer What it uses
Generation Python standard library (argparse ,tomllib ,difflib ,random ) andGit for commit checks and unified patches
Grading pytest 8.4.2 , a test-result plugin, and explicit feature and regression test IDs
Container trials Harbor 0.25.0 ,Docker/Compose , and lightweightBash entry points
Workspace Python ThreadingHTTPServer bound to localhost, withplain HTML, CSS, and JavaScript ; no Node build step
Automation GitHub Actions regenerates the tasks twice, compares the output, and runs the Docker baselines
Optional benchmark Harbor Terminus-2 with a configured model provider; not used to generate the tasks or reported as a model solve rate

The Click factory checks the checkout’s origin, exact commit, and clean status before it generates patches. The Docker build checks out the same Click 8.3.1 commit. A representative package looks like this:

pallets__click-alias-reject-conflict-42/
β”œβ”€β”€ instruction.md
β”œβ”€β”€ task.toml
β”œβ”€β”€ environment/Dockerfile
β”œβ”€β”€ solution/
β”‚   β”œβ”€β”€ patch.diff
β”‚   └── solve.sh
└── tests/
    β”œβ”€β”€ fail_to_pass.json       # new requirements
    β”œβ”€β”€ pass_to_pass.json       # existing behaviors to preserve
    β”œβ”€β”€ test_patch.diff
    β”œβ”€β”€ test.sh
    β”œβ”€β”€ grade.py
    β”œβ”€β”€ run_script.sh
    └── parser.py

The grader applies the test patch and runs pytest. A failed regression check yields zero. Otherwise the reward is the fraction of passing feature checks; only 1.0 counts as solved. The focused wrong-patch audit is separate from the Docker baseline jobs. For the scoring internals, design choices, and trade-offs, see the technical blog.

Task Rule Mistake the tests catch
Prefix choice Accept unique normalized prefixes at the generated minimum length; exact matches win Accept the first of two ambiguous matches
Alias: canonical priority Keep the canonical choice on a collision Reject a valid canonical input
Alias: reject conflicts Reject collisions between different targets Accept the conflicting input
Config-first option Prefer CLI β†’ config β†’ environment β†’ default and report the actual source Let the environment override a configured zero
Fallback group Send unknown words to a fallback without losing arguments or changing regular dispatch Override a command that resolves after normalization

Recorded results: For each of the two tested seeds, all five references scored 1.0, all five unchanged baselines scored 0.0, and all listed regressions passed in Docker. A separate focused audit caught 15/15 deliberate wrong patches per seed. These figures measure validator behavior on the tested tasks, not model performance or coverage of all possible mistakes. Raw results and videos are local submission artifacts, excluded from Git; the commands above regenerate the evidence.

Start with the MarkupSafe example:

.venv/bin/python portable.py recipes/markupsafe \
  --check output/portable/markupsafe-replay.json
reference        5/5 checks   reward=1.00
no-change        0/5 checks   reward=0.00
believable-error 4/5 checks   reward=0.80

The last implementation incorrectly escapes an already formatted value. You can see the behavior test in recipes/markupsafe/checks.py. To create another recipe:

owner/repo, full commit SHA, task slug, and upstream license in recipe.toml. instruction.md and checks.py. In the recipe, list the new pytest node IDs and the existing node IDs that must keep passing.reference.py and an insertion anchor, or a solution.diff for a multi-file change. Describe one plausible wrong edit in [wrong_patch]. portable.py against a trusted recipe. Use a custom Dockerfile and run_script.sh if the project needs a different setup from src/ imports and pytest under tests/. The runner must load the bundled parser and record the configured pytest IDs. The current adapter targets Python/pytest GitHub repositories. A recipe author supplies the feature and expected behavior. The tooling packages changes and checks them against the repository; it does not discover requirements from a GitHub URL. Other languages need a verifier adapter.

   git clone https://github.com/YOUR_HANDLE/YOUR_FORK.git coding-task-lab
   cd coding-task-lab
   git switch -c feature/new-task-recipe

factory.py and templates/ for Click task changes or recipes/ for adding a repository.

Code & more: https://www.dailybuild.xyz/project/336-coding-task-lab

── more in #ai-tools 4 stories Β· sorted by recency
── more on @coding task lab 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain β€” perfect for shipping the agent you just read about.

$git push zahid main
β†’ Live at https://your-agent.zahid.host βœ“
Get free account β†’ Pricing
from €0/mo Β· no card required
LIVE [news/generate-coding-task…] indexed:0 read:6min 2026-12-06 Β· β€”