--- license: mit language: - en task_categories: - text-generation tags: - rl-environment - verifiers - code - bug-fixing - swe-bench configs: - config_name: default data_files: - split: train path: data/train-*.parquet --- # Polyglot HardBug RL A Hugging Face RL environment dataset of 10 **expert-level, multi-language bug-fixing tasks** for training and evaluating coding agents. Each task is a self-contained SWE-bench-style instance: a real buggy project, a precise problem statement, hidden verification tests, and a gold patch. Every task was authored to reproduce a *class* of subtle defect that standard datasets miss - the bugs are semantically rich (concurrency, three-valued SQL logic, numeric type systems, Unicode canonicalization) rather than syntactic slips, and each one was verified bidirectionally: the buggy repository fails exactly the declared `fail_to_pass` tests, and the gold patch makes the whole suite pass. ## Tasks by language | Language | Tasks | | --- | --- | | javascript | 1 | | python | 7 | | sql | 1 | | typescript | 1 | ## Row schema | Column | Description | | --- | --- | | `task_id` | stable task identifier (also the HF row id) | | `title` | one-line description of the defect | | `language` | python / javascript / typescript / sql | | `category` | defect class, e.g. concurrency-async, sql-semantics | | `difficulty` | difficulty rating (all rows: expert) | | `source` | provenance (original-synthetic: authored for this dataset) | | `license` | per-row license (MIT) | | `created` | authoring date | | `prompt` | the agent-facing problem statement (markdown) | | `repo_files` | the buggy workspace: list of `{filename, content}` entries | | `test_files` | the hidden verification suite (same entry format) | | `gold_patch` | unified diff (`a/`/`b/` prefixes) fixing the bug | | `test_command` | argv that runs the hidden suite inside the sandbox | | `fail_to_pass` | tests that fail on the buggy repo and pass after the fix | | `pass_to_pass` | tests that must keep passing (regression guard) | | `time_limit_s` | test-run budget in seconds | | `sandbox_image` | runtime image for the task (python or node toolchain) | | `sandbox_system_deps` | extra system packages the image needs (e.g. tzdata) | - `repo_files` entries are sorted by filename; rebuild a dict with `{e["filename"]: e["content"] for e in repo_files}`. The agent edits this state (typically by emitting a unified diff). - `test_files` holds the hidden verification suite, injected by the harness after the agent finishes, so any test edits the agent made are overwritten. - `gold_patch` is `patch -p1` compatible and transforms `repo_files` into the fixed state. ## Verification protocol The suite is TAP-based. Each test prints `ok N - name` or `not ok N - name` with a diagnostic; the process exits non-zero if any test failed. A solution is **resolved** iff every `fail_to_pass` test passes and every `pass_to_pass` test still passes. ## Intended use Load with the companion verifiers environment package (`polyglot-hardbug-rl/environment/`), or drive the rows with your own harness: ```python from datasets import load_dataset rows = load_dataset("mondk/polyglot-hardbug-rl", split="train") for row in rows: write_workspace(row["repo_files"]) # agent edits this apply_patch(agent_patch) # model's diff inject(row["test_files"]) # hidden tests stdout = run(row["test_command"], timeout=row["time_limit_s"]) score = score_tap(stdout, row["fail_to_pass"], row["pass_to_pass"]) ``` ## Repository layout | path | contents | | --- | --- | | `data/` | the published dataset (`train.jsonl`, `train-00000-of-00001.parquet`) | | `tasks/` | one directory per task: `problem.md`, `repo/` (buggy), `fixed/` (gold), `tests/` (hidden TAP suite), `meta.json`, `run.json` | | `scripts/build_dataset.py` | rebuilds `data/` and this card from `tasks/`; enforces the schema and the pure-ASCII English gate | | `scripts/validate_dataset.py` | end-to-end check: buggy fails exactly `fail_to_pass`, gold patch makes the whole suite pass; writes `validation_report.md` | | `environment/` | the verifiers v1 environment package (`polyglot_hardbug`) plus a standalone local runner | | `validation_report.md` | result of the latest `validate_dataset.py` run | ## License MIT (see `LICENSE`). Task content is original synthetic work created for this dataset; no third-party source code is included.