Bench adding a data source in task-bench, from a register a seeded script generates

This commit is contained in:
2026-11-23 18:48:03 +01:00
parent f6b180fd9d
commit c45472397e
12 changed files with 320 additions and 56 deletions
+4 -1
View File
@@ -44,7 +44,8 @@ GREMLINS = textwrap.dedent("""\
if os.environ.get("FAKE_GREMLINS_LOG"):
json.dump([os.getcwd(), *sys.argv[1:]], open(os.environ["FAKE_GREMLINS_LOG"], "w"))
""")
# Logs each call. A `run` of the bench's image runs its command in the mounted tree: sh as it is, and claude as the fake below.
# Logs each call. A `run` of the bench's image runs its command in the mounted tree: sh as it is, claude as the fake below, and a
# file mounted beside the tree from where the host keeps it.
DOCKER = textwrap.dedent("""\
#!/usr/bin/env python3
import json, os, subprocess, sys
@@ -61,6 +62,8 @@ DOCKER = textwrap.dedent("""\
command = args[next(at for at, arg in enumerate(args) if arg.endswith(":throwaway")) + 1:]
if command[0] == "claude":
command = [sys.executable, os.environ["FAKE_CLAUDE"], command[-1]]
mounted = {inside: host for host, inside, *_ in (arg.split(":") for at, arg in enumerate(args) if args[at - 1] == "--volume")}
command[0] = mounted.get(command[0], command[0])
sys.exit(subprocess.run(command, cwd=tree).returncode)
""")
# Reads the README, then the file with the bug. At the head it fixes the bug; at the base it rewrites the test to pass instead.