scalingX's picture
Add 10000 GitHub Trending pr_diff environments
5b60fc2 verified
|
Raw History Blame Contribute Delete
19.9 kB
metadata
license: apache-2.0
language:
  - en
size_categories:
  - n<1K
tags:
  - reinforcement-learning
  - code
  - llm
  - swe-rl
  - harbor
  - pr_diff

View tasks in Harbor Visualiser

github-trending-environments-10k

Generated by Repo2RLEnv — turning real GitHub repositories into verifiable RL environments.

💡 Browse this dataset in your browser — click the badge above or open HuggingFaceH4/harbor-visualiser to inspect every task's spec, instruction, oracle patch, test script, and Dockerfile.

How it was generated

Each task in this dataset was produced by the pr_diff pipeline. The pipeline mines real merged pull requests / commits from the source repo(s), applies quality filters, strips information-leakage from the instruction text, and emits a Harbor-shaped task directory with the gold patch as the oracle.

Reproduce locally:

pip install repo2rlenv
repo2rlenv generate \
  --repo <owner>/<repo> \
  --pipeline pr_diff \
  --pipeline-opt limit=10 \
  --out ./datasets/my-pr_diff

See the pipeline docs for the full option list + reward design.

Run with Harbor

Each task ships a environment/Dockerfile and tests/test.sh, so you can score patches end-to-end:

# Pull the dataset locally
repo2rlenv pull scalingX/github-trending-environments-10k /tmp/github-trending-environments-10k

# Confirm structural soundness — oracle adapter applies the gold patch
# and must score reward = 1.000
harbor run -p /tmp/github-trending-environments-10k -a oracle --env docker

# Score an agent (claude-code + Sonnet 4.6)
harbor run \
  -p /tmp/github-trending-environments-10k \
  -a claude-code -m anthropic/claude-sonnet-4-6 \
  --ak max_budget_usd=2.00 \
  --ae ANTHROPIC_API_KEY=$ANTHROPIC_API_KEY \
  --env docker

The reward is a 6-component diff-similarity score (format / size / file-targeting / region-overlap / changes-only similarity / LLM-judge). The --ve ANTHROPIC_API_KEY=... verifier-env pass enables the LLM-judge component (or --ve R2E_JUDGE_ENDPOINT=... plus --ve R2E_JUDGE_MODEL=... to use a self-hosted judge); without either, the current verifier marks the run ungraded, writes no reward file (Harbor reports VERIFIER_FAILED, so RL consumers drop it) and keeps diagnostic_similarity for inspection. Older task bundles may still renormalize weights; inspect their embedded verifier. Full breakdown in /logs/verifier/reward-details.json.

Reward signal

The reward function is part of the task itself (tests/test.sh + the verifier code baked into the image). The full per-task breakdown is written to /logs/verifier/reward-details.json at run time — useful for slicing training data by component.

See the pipeline doc for the component-by-component design.

Layout

tasks/
└── <task-id>/
    ├── task.toml          # Harbor task with [metadata.repo2env]
    ├── instruction.md     # natural-language prompt
    ├── solution/
    │   ├── patch.diff     # oracle (gold) diff
    │   └── solve.sh       # oracle adapter applies patch.diff
    ├── environment/
    │   └── Dockerfile     # builds the task's container
    └── tests/
        └── test.sh        # verifier — writes /logs/verifier/reward.txt

License

Apache-2.0 — same as Repo2RLEnv itself. The original PR contents remain under their respective source-repo licenses; this dataset redistributes public commits under fair-use for ML research / training-data purposes.