6ff8f34666af0f9d72d40cf40cee5c98ad090dc0 / bench/tasks/fix_easy/__init__.py · 1405 bytes · raw
"""Easy-tier bug fixes for agentic-fix: one module per language, each with ITEMS = [item, ...].
An item is one single-turn fix, graded by bench/core/runners.py with the real toolchain:
id unique, "<lang>-<name>"
lang a key of runners.RUNNERS (go, rust, ts, swift, python, sh, sql)
symptom what the user sees, one or two sentences (shown with the code)
buggy the code the model must fix: the whole solution file (sql: one query)
fix a reference fix (validate: buggy fails, fix passes)
test the hidden test: Go/Rust test code, a TS/Swift script, a Python script that imports
solution, a bash script that sources ./solution.sh (sql: none)
context optional text shown before the code (sql: the schema)
fixture sql only: the SQL that builds the database the query runs on
expect sql only: the expected CSV output (sqlite3 -csv, no header); compared as sorted lines
unless "ordered": True
Shell items must run on macOS's bash 3.2 (no declare -A, ${x,,}, mapfile, |&, ;&).
"""
import importlib
import os
LANGS = ("go", "rust", "ts", "swift", "python", "sh", "sql")
def load():
here = os.path.dirname(os.path.abspath(__file__))
items = []
for lang in LANGS:
if os.path.exists(os.path.join(here, lang + ".py")):
items += importlib.import_module("bench.tasks.fix_easy." + lang).ITEMS
return items