{"data":{"kind":"file","path":"README.md","version_id":"kdcod7c1dvtgw99xqiun8g4i","entry":{"name":"README.md","path":"README.md","is_directory":false,"size":4092,"modified_at":"2026-09-06T18:14:13.081000","content_hash":"b54244d74ca5b8fb839325d2ea7160de7df08b9b40ab8492a9c17ef1343c29e3"},"entries":[],"content":"# gafitas-repair-hard\r\n\r\n**The same contract as [`gafitas-repair`](https://app.primeintellect.ai/dashboard/environments/joseantoniodominguez/gafitas-repair), on larger modules.**\r\n\r\nWrite a missing Python module until the project's own frozen pytest suite\r\npasses. Each task is reconstructed from a real commit: the tree is the state\r\nbefore that commit with the target module absent, and the reward is the suite\r\nthat commit shipped.\r\n\r\n| task | module to write | new code | suite |\r\n|---|---|---|---|\r\n| `gb07` | `generalista_bootstrap.py` | 89 lines | `tests/test_executor_isolation.py` |\r\n| `gb01` | `screen_runner.py` | 118 lines | `tests/test_screen_runner.py` |\r\n| `gb04` | `explorer/gitignore.py` | 148 lines | `tests/test_gitignore.py` |\r\n| `gb05` | `explorer/cache.py` | 231 lines | `tests/test_cache.py` |\r\n\r\n## Why this is a separate package\r\n\r\nThese modules are 89–231 lines of new code; the companion environment's are\r\n39–126. Mixing difficulty tiers inside one environment hides which tier a score\r\ncame from. Two packages report two honest numbers; one package reports an\r\naverage of two different things.\r\n\r\nThe work is also qualitatively harder: an executor-isolation bootstrap that must\r\nresist `sys.path` shadowing, a `.gitignore` matcher with anchoring, negation and\r\nper-segment globs, and a sqlite cache with schema versioning, content-hash\r\ninvalidation that must beat an unchanged mtime, row purging, and self-healing\r\nfrom a corrupt database on Windows file locks.\r\n\r\n## The controls, run before publishing\r\n\r\n**Task level** — the reward measures what it claims:\r\n\r\n| task | NEGATIVE | POSITIVE | TAMPER |\r\n|---|---|---|---|\r\n| gb01 | FAIL | PASS | held |\r\n| gb04 | FAIL | PASS | held |\r\n| gb05 | FAIL | PASS | held |\r\n| gb07 | FAIL | PASS | held |\r\n\r\n- **NEGATIVE** — no target module: the suite must FAIL. A task that starts\r\n  solved measures nothing.\r\n- **POSITIVE** — the historical module: the suite must PASS. A task nobody can\r\n  solve teaches nothing.\r\n- **TAMPER** — the suite is replaced with trivially-passing tests and the\r\n  verdict does not move, because every test file is rewritten from the frozen\r\n  payload before pytest runs. Passing by weakening the test is impossible by\r\n  construction, not forbidden by policy.\r\n\r\n**Package level** — the environment as the hub loads it:\r\n\r\n| task | reference solution | junk code | no code block |\r\n|---|---|---|---|\r\n| gb01 | **1.0** | 0.0 | 0.0 |\r\n| gb04 | **1.0** | 0.0 | 0.0 |\r\n| gb05 | **1.0** | 0.0 | 0.0 |\r\n| gb07 | **1.0** | 0.0 | 0.0 |\r\n\r\nReproduce with `validate_env.py gafitas_repair_hard` and\r\n`validate_published.py gafitas_repair_hard`.\r\n\r\n## What the environment reports\r\n\r\n| signal | meaning |\r\n|---|---|\r\n| `repaired` *(reward)* | the frozen acceptance suite passed |\r\n| `suite_usable` | pytest actually ran. A suite that could not be collected is **not** a failed solution, and an average that mixes the two measures nothing |\r\n\r\n## A note on tree size\r\n\r\nThree of these repositories are large. Only what the acceptance suite needs\r\ntravels, and **the trim itself was tested**: a candidate tree is accepted only\r\nafter the suite still fails without the module and still passes with it, so\r\nnothing quietly required was dropped. `gb01` went from 2 MB to 817 KB that way.\r\n\r\n## What is not in this package\r\n\r\nThe historical fix. Each objective was authored from the pre-change public API\r\nand the frozen tests alone, then checked against the reference's own distinctive\r\nlines to confirm it quotes none of them. Trees were searched for the reference\r\n**as bytes**, so compiled bytecode and archives were searched too — a check that\r\nonce found the post-change version of a target file inside a `__pycache__` in\r\nthis corpus, where two filename-based checks had passed it.\r\n\r\n## Safety\r\n\r\nThis environment **executes model-generated Python**. Grading writes the tree\r\ninto a fresh temporary directory and runs pytest there as a subprocess under a\r\ntimeout, writing nothing outside it — but untrusted code still runs. Use a\r\nsandbox, as with any code-execution environment.\r\n","encoding":"utf-8","truncated":false,"total_bytes":4092},"status":null}