EnvGap
收藏资源简介:
EnvGap 数据集用于评估 AI 编码代理在仅修复环境配置(依赖清单、锁定文件、构建和安装文件)的情况下,能否使真实项目在干净机器上成功构建和运行,源代码保持不变。任务来源于 Python、C++、Java 和 JavaScript 生态系统中的 GitHub 仓库,每个任务对应一个实际发生的环境故障,例如依赖无法解析、系统库缺失、需求冲突或包从注册表中消失。数据集主要包含两个核心子集:Reported(用户通过 GitHub issue 报告的环境故障,部分故障在当今干净机器上已不再出现,这些作为控制任务,正确做法是不做任何更改以保持项目工作)和 Repaired(维护者通过仅修改依赖或构建文件的 pull request 修复的故障,每个故障在修复前的干净容器中失败,修复后通过)。此外还包含一个候选集(candidates)用于筛选潜在任务。数据集共有 5 个配置:full(43 个测试样本)、reported(23 个测试样本)、repaired(20 个测试样本)、secure(4 个测试样本,带有安全审计发现)和 candidates(2907 个测试样本)。每个样本包含实例ID、仓库、基础提交、修复补丁、gold文件、问题描述、生态系统、Docker镜像、各种命令(bootstrap、resolve、repro、run、d2)、故障签名、控制标志、来源、问题URL、PR信息、类别、安全标志、排除状态等丰富的字段。评估时,代理获取仓库在 base_commit 的状态、问题文本、错误信息、生态系统和清单路径,可以运行 repro_command,然后返回仅环境文件的新内容(任何源代码更改均被拒绝)。评估在全新容器中安装代理声明的环境并运行项目。该数据集特别适用于测试和提升 AI 编码代理在环境修复任务上的能力。
The EnvGap dataset is used to evaluate whether AI coding agents can make real-world projects successfully build and run on a clean machine by only fixing environment configurations (dependency manifests, lock files, build and installation files), while leaving source code unchanged. Tasks are derived from GitHub repositories in Python, C++, Java, and JavaScript ecosystems, each corresponding to an actual environment failure, such as unresolvable dependencies, missing system libraries, conflicting requirements, or packages disappearing from registries. The dataset mainly consists of two core subsets: Reported (environment failures reported by users via GitHub issues; some failures no longer occur on todays clean machines and serve as control tasks where the correct action is to make no changes to keep the project working) and Repaired (failures fixed by maintainers via pull requests that only modify dependency or build files; each failure fails in a clean container before the fix and passes after the fix). It also includes a candidate set (candidates) for filtering potential tasks. The dataset has five configurations: full (43 test samples), reported (23 test samples), repaired (20 test samples), secure (4 test samples with security audit findings), and candidates (2907 test samples). Each sample contains fields such as instance ID, repository, base commit, fix patch, gold file, problem description, ecosystem, Docker image, various commands (bootstrap, resolve, repro, run, d2), failure signature, control flag, source, issue URL, PR info, category, security flag, and exclusion status. During evaluation, the agent receives the repository state at base_commit, issue text, error information, ecosystem, and manifest paths, may run the repro_command, and then returns new content of only the environment files (any source code changes are rejected). Evaluation installs the agents declared environment in a fresh container and runs the project. This dataset is particularly suitable for testing and improving AI coding agents capabilities in environment repair tasks.
EnvGap 数据集总结
基本信息
- 数据集地址: https://huggingface.co/datasets/bhanuprakashvangala/EnvGap
- 许可证: MIT
- 语言: 英语 (en)
- 多语言性: 单语言
- 规模类别: 1K<n<10K
- 任务类别: text-generation
- 标注创建者: found, machine-generated, other
- 语言创建者: found
- 源数据集: original
- 标签: code, agents, benchmark, software-engineering, dependency-management, build-systems, reproducibility, environment-repair
数据集摘要
EnvGap 测试 AI 编码代理能否仅通过修复环境(依赖清单、锁文件、构建和设置文件)就让真实项目在干净机器上构建和运行,源代码保持不变。
任务涵盖 Python、C++、Java 和 JavaScript 项目。每个任务都是一个真实失败:无法解析的依赖、构建假定的系统库、无法共存的依赖要求,或从注册表中消失的包。
任务分为三组,在排行榜上分别排名:
- Reported: 用户在 GitHub issue 中报告的环境失败。部分在干净机器上不再发生,作为对照组保留,正确答案是保持不动并让项目继续工作。
- Repaired: 维护者通过仅修改依赖或构建文件的 pull request 修复的故障。每个在修复前的干净容器中失败,修复后通过。
- Lite: AI 编码代理(Claude Code、Codex 和 Gemini Code Assist)根据任务描述编写的小型项目,其环境在干净机器上无法工作。每个通过仅修改环境文件修复;按原样在干净容器中失败,修复后通过。这些项目从未在 GitHub 上出现,因此每个任务携带项目文件 (
project_files)。
任务解决条件:代理的环境安装成功且项目命令可运行。另有两个评分:
- manifest F1: 比较代理声明的包与系统调用追踪显示程序实际加载的文件。
- safe install: 声明包中存在、固定到精确版本且无已知安全通告的比例。
注意对照组:不做任何更改的代理会答对所有对照组。
支持的任务和排行榜
代理获取 base_commit 处的仓库、issue 文本 (problem_statement)、错误 (failure_signature)、ecosystem 和清单路径。可以运行 repro_command。仅返回环境文件的新内容;任何源文件的更改都会被拒绝。评估随后在全新容器中安装代理声明的内容并运行项目。
在已发布的排行榜上,任务仅在代理独立解决时才计入。如果代理读取了项目后续历史并看到最终合并的修复,该任务计为未解决。
语言
Issue 文本主要为英语,未按语言过滤。
| 生态系统 | 评估镜像 |
|---|---|
| python | Ubuntu 22.04 含 python3 (3.10)、pip 和 venv (envgap-python-eval) |
| cpp | Ubuntu 22.04 含 build-essential、CMake、g++ 和 pkg-config (envgap-cpp-eval) |
| java | Ubuntu 22.04 含 OpenJDK 17 和 Maven (envgap-java-eval) |
| javascript | Ubuntu 22.04 含 Node.js 20 (NodeSource) (envgap-javascript-eval) |
数据集配置
| 配置名称 | 分割 | 样本数 | 下载大小 (字节) | 数据集大小 (字节) |
|---|---|---|---|---|
| full | test | 56 | 531133 | 995335 |
| lite | test | 13 | 175714 | 337311 |
| reported | test | 23 | 162453 | 165826 |
| repaired | test | 20 | 235124 | 492188 |
| secure | test | 4 | 50402 | 45377 |
| candidates (默认) | test | 3527 | 19104343 | 37059003 |
数据结构
数据实例
示例 (envgap__Ezibenroc__PyRoaringBitMap-93):
json { "instance_id": "envgap__Ezibenroc__PyRoaringBitMap-93", "repo": "Ezibenroc/PyRoaringBitMap", "base_commit": "89c361ab0961cd3b51249dde4fce95937ec10bdd", "project_files": [], "patch": "diff --git a/setup.py b/setup.py --- a/setup.py +++ b/setup.py @@ -72,7 +72,7 @@ version=VERSION, description=Fast and lightweight set for unsigned 32 bits integers., long_description=long_description,
- setup_requires=[cython],
- setup_requires=[cython<3.0.0], url=h... [120 more chars]", "gold_files": [ { "path": "setup.py", "content": "#! /usr/bin/env python3
from setuptools import setup from setuptools.extension import Extension from distutils.sysconfig import get_config_vars import os import sys import subprocess import platform
PKG_DIR = pyroaring
PLATFORM_WINDOWS = (platform.system() == Windows) PLATFORM_MACOSX = (plat... [2725 more chars]" } ], "problem_statement": "Build error with cython 3
Building pyroaring with the cython 3.0.0 results in the following error logs:
$ sh -c -e python -P -mbuild --no-isolation --wheel --outdir /buildstream-build/dist .
- Getting build dependencies for wheel...
- Building wheel... running bdist_wheel running bu... [10300 more chars]", "problem_statement_truncated": false, "created_at": "2023-07-24T11:01:01Z", "registry_date": "2023-07-30T12:48:33Z", "registry_date_source": "pull_request_merged_at", "ecosystem": "python", "image": "envgap-python-eval", "manifest_path": "setup.py", "manifest_paths": ["setup.py"], "bootstrap_command": "python3 -m pip install -q --upgrade pip", "resolve_command": "python3 -m pip install .", "repro_command": "python3 -m pip install .", "run_command": "python3 -c " import importlib, importlib.metadata as md mods = set() for dist in md.distributions(): if file:///work not in (dist.read_text(direct_url.json) or ): continue top = (dist.read_text(top_level.txt) or ).split() if not top: top = [str(f).split(/)[0].... [352 more chars]", "d2_command": "python3 -m pip list --format=json > /evidence/D2.raw.json", "failure_signature": "error: subprocess-exited-with-error", "expected_failure_regex": "error:\ subprocess-exited-with-error", "is_control": false, "splits": ["full"], "source": "repaired", "crawl_id": "pr-20260924", "issue_url": "https://github.com/Ezibenroc/PyRoaringBitMap/issues/93", "issue_number": 93, "pull_request": "https://github.com/Ezibenroc/PyRoaringBitMap/pull/95", "pr_number": 95, "pr_head_commit": "684615af89166275b440d6c2977b0ca0acc71c26", "pr_merge_commit": "7e46a671dd28498f647fc885a1b1053aeb267dc5", "categories": [], "security_flags": [], "excluded_from_scoring": false, "exclusion_reason": null, "excluded_since": null, "repo_license": "MIT" }
数据字段
不要向代理显示 patch、gold_files、pull_request、pr_number、pr_head_commit、pr_merge_commit。它们包含答案。
| 字段 | 类型 | 描述 |
|---|---|---|
instance_id |
string |
任务 id, envgap__<owner>__<repo>-<issue number>。编号始终是 issue 编号,Repaired 任务也一样(其 pull request 编号在 pr_number 中)。获取仓库请读取 repo 而非解析 id。 |
repo |
string |
GitHub 仓库,owner/name。Lite 任务从未在 GitHub 上:那里命名为编写项目的代理和语言及研究试验,<agent>/<language>-t<trial>。 |
base_commit |
string |
代理起始且评估重建的 commit。Reported 任务:issue 打开时或之前的最后一个默认分支 commit。Repaired 任务:pull request 的 base commit。Lite 任务:harness 从 project_files 创建的唯一 commit(固定作者和日期,因此哈希始终相同)。 |
project_files |
list<struct<path: string, content: string>> |
仅 Lite 任务:项目完全如编码代理所写,每个文件一个条目。Harness 将这些文件写入新仓库以开始任务。来自 GitHub 的任务为空,从 repo 的 base_commit 开始。 |
patch |
string |
参考环境修复,作为针对 base_commit 的统一 diff。仅涉及环境文件(清单、锁文件、构建和设置文件、Dockerfiles、READMEs),从不涉及源或测试。对照组为空。不要向代理显示。 |
gold_files |
list<struct<path: string, content: string>> |
同一修复的完整文件内容,每个路径一个条目(content 为 null 表示删除)。{f[path]: f[content] for f in row[gold_files]} 正好是预测的 files 对象。对照组为空。不要向代理显示。 |
problem_statement |
string |
Issue 标题、空行、然后 issue 正文,完全如已发布运行中的代理所见。 |
problem_statement_truncated |
bool |
当收集时 issue 正文已被截断至 3,000 字符时为 True。按代理所见交付。 |
created_at |
string |
Issue 打开时间 (ISO 8601)。 |
相关链接
- 排行榜: https://d3npiokq0n7c4l.cloudfront.net/index.html
- 任务: https://d3npiokq0n7c4l.cloudfront.net/tasks.html
- 评分方式: https://d3npiokq0n7c4l.cloudfront.net/oracle.html
- 评估代码: https://huggingface.co/datasets/bhanuprakashvangala/EnvGap/resolve/main/harness/envgap-source.zip




