Turn repositories, pull requests and task seeds into executable RL environments.
Quickstart · Pipelines · Output · Datasets · Documentation
Repo2RLEnv generates coding, terminal and reasoning tasks in the Harbor format: a task instruction, starting environment, reference solution and executable verifier. Run them with Harbor agents, inspect their quality, and publish them to the Hugging Face Hub.
Repository / PR / task seed
│
▼
Native pipeline · Tasksmith · Research recipe
│
▼
Harbor task: instruction + environment + solution + verifier
│
▼
Static checks → baseline / oracle → review and learner rollout
│ ↺ bounded repair
▼
Labeled tasks + evidence → Hugging Face Hub → training / evaluation
Generation methods have different checks. The shared quality workflow can review and repair emitted tasks; exporting a task alone does not establish its quality.
Requires Python 3.12+ and Git. This example generates PR-diff tasks without building a container:
Windows CI covers CLI startup, recipe discovery, native task emission and static validation. Use Linux, macOS or WSL for Tasksmith, research-recipe generation and the quality controller; their full native Windows execution is not yet supported.
pip install repo2rlenv
# GitHub access; alternatively set GITHUB_TOKEN
gh auth login
repo2rlenv generate \
--repo pallets/click --pipeline pr_diff \
--pipeline-opt limit=3 --out ./workspace/click-tasks
repo2rlenv validate ./workspace/click-tasks --deep
repo2rlenv pipelines listFor test-based repository tasks, use pr_runtime or Tasksmith. LLM stages need a
provider key such as ANTHROPIC_API_KEY or OPENAI_API_KEY. Native runtime
pipelines build and cache Docker environments; owned recipes and Tasksmith build
and execute remotely through Daytona or Modal.
Install the extras your route needs:
pip install 'repo2rlenv[tasksmith,daytona,harbor]'
# Other extras: modal, mutation
repo2rlenv tasksmith install-runtime # Pi / OpenCode; requires Node.js 22.19+See the quickstart for execution and publishing, and authentication for model, sandbox and Hub credentials.
| Pipeline | Task |
|---|---|
pr_diff |
Reproduce a real PR change; scored by diff similarity and an optional LLM judge |
pr_runtime |
Fix a PR regression; failing tests must pass while existing tests stay green |
commit_runtime |
Build the same test-based task from commit history |
code_instruct |
Solve an LLM-authored problem grounded in repository APIs |
equivalence_tests |
Implement a function matching a private reference |
cve_patches |
Repair a vulnerability identified through public CVE and fix-commit records |
The first three are marked stable; the others are experimental. Supported source hosts and languages vary by pipeline. See the pipeline guide.
Tasksmith adaptively converts a merged PR into a Harbor task. LangGraph orchestrates Pi or OpenCode to investigate the change, establish a working environment, and design the instruction and private verifier. The merged implementation supplies the oracle. Baseline checks, review, learner rollouts and bounded repair produce labeled revisions with execution evidence and cost records.
Tasksmith is experimental and currently targets testable Python changes. CPU execution supports Daytona and Modal; the implemented GPU route uses Modal L4 GPUs. Start with the one-PR walkthrough, which includes example inputs, provider setup and an explicit spending limit.
These 14 experimental recipes adapt published methods into code owned by this repository. No upstream research package is installed at runtime. A pipeline names the generation family; a recipe selects its method.
repo2rlenv pipelines describe repo_mutate --recipe swe_smith --jsonEach recipe walkthrough
includes configuration, a pipeline diagram, model prompts, verification steps,
limitations and upstream credits. Use its example config with
repo2rlenv generate --config <config.yaml>.
<task-id>/
├── instruction.md # Learner's task
├── task.toml # Runtime, resources, provenance and evaluation labels
├── environment/ # Dockerfile, source snapshot and fixtures
├── solution/solve.sh # Private reference entrypoint
└── tests/test.sh # Trusted verifier entrypoint
Private solutions and tests belong to their respective execution phases; the whole task bundle is not the learner workspace. Task assets and reference formats vary by recipe. Most owned verifiers return deterministic 0/1 rewards; SCALER uses −1/+1, and native pipelines also support graded test and diff-similarity rewards.
With the harbor extra and a configured runtime, execute a reference solution:
harbor run -p ./workspace/click-tasks -a oracle --env dockervalidate --deep checks files and metadata without execution. Use
review and repair
for instruction quality, verifier defects, leakage and rollout evidence.
Explore the HuggingEnvs collection with the Harbor Visualizer. The release inventory records per-pipeline task counts, revisions and validation scope; the economics guide reports measured yield and cost per task.
The Tasksmith reference cohort contains 50 verified tasks from an assisted campaign. Research-recipe exports retain separate quality labels, including unverified and needs-repair. Consult the recorded evidence before using a cohort for training or evaluation.
hf auth login # Or set HF_TOKEN with write access to your namespace
repo2rlenv push ./workspace/click-tasks <your-org>/<dataset-name>
repo2rlenv pull <your-org>/<dataset-name> ./workspace/downloaded-tasksDocumentation · Exact prompts · Design RFCs · Contributing · Adding a pipeline · Release notes
Repo2RLEnv's own code is Apache-2.0.
Bundled adaptations retain their MIT and Apache-2.0 licenses; the distribution is
Apache-2.0 AND MIT. Third-party notices
link each recipe's source revision, retained material and attribution.
Source repositories and generated task assets retain their respective terms;
check each dataset's license and provenance before redistribution.

