Skip to main content

Repo2RLEnv

Build verifiable RL environments for coding agents.

PyPI Python versions CI Docs Datasets on the Hub Harbor task format License: Apache-2.0 and MIT

Documentation · Quickstart · Pipelines · Datasets · Changelog

Repo2RLEnv: source material to Harbor tasks

Repo2RLEnv turns repositories, pull requests, agent trajectories and task seeds into Harbor tasks. Each task includes an instruction, a starting environment, a verifier and a reference solution. Repo2RLEnv generates and reviews the tasks; Harbor runs agents against them.

flowchart LR
    S["Repo, PR, trajectory or seed"] --> G["Generate a Harbor task"]
    G --> V["Check controls and review"]
    V -->|"Repairable defect"| R["Repair a new revision"]
    R --> V
    V --> E["Keep task and evidence label"]
    E --> U["Evaluate, train or publish"]

Quickstart

Python 3.12+ and the GitHub CLI are required. This example generates patch-similarity tasks without Docker or model calls:

pip install repo2rlenv
gh auth login

repo2rlenv generate --repo pallets/click --pipeline pr_diff \
  --pipeline-opt limit=3 --out ./tasks
repo2rlenv validate ./tasks --oracle

limit caps candidates, so this may export fewer than three tasks. validate is a file check; it does not run the environment.

To execute these tasks, install the tested Harbor integration and start Docker. Set ANTHROPIC_API_KEY in your shell: PR-diff grading requires a model judge, including when checking the reference solution.

pip install 'repo2rlenv[harbor]'
harbor run -p ./tasks -a oracle --env docker \
  --ve ANTHROPIC_API_KEY="$ANTHROPIC_API_KEY"
harbor run -p ./tasks -a nop --env docker \
  --ve ANTHROPIC_API_KEY="$ANTHROPIC_API_KEY"

An unavailable judge leaves the trial ungraded, not a zero reward. For test-based rewards, choose pr_runtime or Tasksmith instead. Continue the quickstart →

What you can build

Start with Use What the agent does
Merged PRs; no test execution during generation pr_diff Reproduce a change, scored by patch similarity and a correctness judge
PRs or commits with runnable tests pr_runtime, commit_runtime, cve_patches Fix failing tests while preserving passing tests
A merged Python PR needing custom task design Tasksmith Implement the requested behavior, checked by private tests
Repository functions or APIs code_instruct, equivalence_tests Implement functionality against generated or differential tests
Recorded coding-agent sessions trajectory_to_env Repair, build, extend or answer a data question derived from the session
Repositories, seeds, terminal recordings or existing tasks Research recipes Repository repair, reconstruction, terminal work, reasoning or optimization

The recipes include SWE-smith, SWE-gen, SWE-Next, R2E, R2E-Gym, SWE-Flow, CodeMidas, SETA Seed2Synth, SETA Evol, TMax, Endless Terminals, TerminalWorld, CLI-Gym, DataArc, SCALER and FrontierSmith. Their implementation lives in this repository, with upstream credits and retained licenses.

repo2rlenv pipelines list
repo2rlenv pipelines describe repo_mutate --recipe swe_smith

Native generation uses local Docker when it executes code. Tasksmith and research recipes execute target code on Modal or Daytona workers; supported GPU trials use Modal. Choose a pipeline compares inputs, rewards and requirements.

Tasksmith: an agent that builds environments

Tasksmith uses LangGraph with Pi or OpenCode to investigate a merged PR, build its dependencies, design a human-readable task and verifier, and check the reference against the starting code. Review, verifier probes and a blind rollout then guide bounded repairs. Failed or incomplete attempts retain their diagnoses.

Start with the one-PR walkthrough, then use batch campaigns to share bootstrap work and control spending.

Check task quality

A generated task is not automatically suitable for training. Check that the reference works, the baseline fails as expected, and the verifier measures the instruction. The shared quality loop can review files and rollouts, probe the verifier and repair supported offline tasks. The optional evidence reviewer records findings with source excerpts and proposed repairs.

Tasks carry uniform labels: unverified, verified, needs_repair or blocked. Labels describe retained evidence for that task revision; solver success is a separate measurement. Quality and verification →

Datasets

Browse the FineEnvs collection or Harbor Visualizer. The release inventory records dataset revisions, counts and validation scope. The yield and cost report separates generation, quality review and solver costs.

HF_ML_Tasksmith contains 50 tasks from Accelerate, Diffusers, PEFT, Transformers and TRL, labeled verified under the campaign's recorded checks. Other collections include unverified tasks. Older published artifacts do not automatically receive new generator or verifier fixes.

hf download FineEnvs/HF_ML_Tasksmith tasks.tar.gz --repo-type dataset --local-dir ./hf-ml-tasksmith
tar -xzf ./hf-ml-tasksmith/tasks.tar.gz -C ./hf-ml-tasksmith
repo2rlenv tasks list ./hf-ml-tasksmith/tasks

Documentation

Docs describe current main; PyPI installs the latest published release. Use the checkout installation for unreleased changes. A text index is available at llms.txt.

Contributing

Read CONTRIBUTING.md. For a new generator, open an issue and start with an RFC and the pipeline contribution guide.

License and credits

Repo2RLEnv's own code is Apache-2.0. Bundled adaptations retain MIT and Apache-2.0 terms, so the distribution is Apache-2.0 AND MIT. Third-party notices document each source and attribution. Generated tasks and source repositories retain their own license terms.

Metadata

Release files for repo2rlenv 0.9.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for repo2rlenv 0.9.7
File Size Uploaded Provenance Actions
repo2rlenv-0.9.7.tar.gz 879.0 kB Without provenance Details for repo2rlenv-0.9.7.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for repo2rlenv 0.9.7
File Interpreter ABI Platform Actions
repo2rlenv-0.9.7-py3-none-any.whl Python 3 none any Details for repo2rlenv-0.9.7-py3-none-any.whl

Total release size: 2.0 MB

Release files / repo2rlenv-0.9.7.tar.gz

Download URL repo2rlenv-0.9.7.tar.gz
Size 879.0 kB
Tags Source
SHA-256 checksum
How to use checksums
201159eb660c9981ac79b876011966b32c0e1e763cd309e891cf0ae82f77140c
BLAKE2b-256 checksum
How to use checksums
b096fed7c92da87ac4b07bc305fda576f1cf8fe8b7a443f8f183e1d788a16c19
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / repo2rlenv-0.9.7-py3-none-any.whl

Download URL repo2rlenv-0.9.7-py3-none-any.whl
Size 1.1 MB
Tags Python 3
SHA-256 checksum
How to use checksums
4db3dd2e66e5ab999b582c17c49b1e3ef4b8fc68335b5743461bbff1d64a8e5a
BLAKE2b-256 checksum
How to use checksums
1dddfd5184385faf422c4e560e1d7512a646fd4f8b987fa0e2ae7e50af7cbdf5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for repo2rlenv 0.9.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page