Bug-Fix Main Task Generation
Generates "fix bug" type main tasks by introducing mutations into environment codebases, then using integration test failures as task descriptions.
Quick Start
# Generate 5 bug-fix tasks for web_scraping ct run mtgen-bugfix -e web_scraping --count 5 # With auto-promote to main_tasks/ ct run mtgen-bugfix -e web_scraping --count 5 --promote
How It Works
The pipeline runs ideate (the fast model invents a realistic bug for the environment) → generate (the smart model writes a patch) → validate (in Docker, apply the patch, run the integration tests, and check that they fail) → optionally promote (copy to main_tasks/).
Expect an overall validation success rate of about 8%. Run --count 10 per environment to get 1-2 valid bugs.
Environment Support
The pipeline discovers installed environments with mtgen/bugfix.yml configs.
To add a new environment, you need:
mutable_paths— where the source code livesintegration_test_path— test file for the LLM promptdocker_compose_path— compose file for validation- Path transformation in
llm_pipeline.pyfor host-to-container mapping
Validation Output
| Output | Meaning |
|---|---|
VALID (breaks N tests: ...) | Tests fail as expected |
SETUP_FAILED | Patch doesn't apply to actual code (normal, re-run) |
EVAL_ERROR | Docker/sandbox issue |
HANG - timed out | Mutation causes an infinite loop; discard |
INVALID - Tests still pass | No-op patch; discard |
COLLECTION_ERROR | Test import error in container — env setup issue |