Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 70 additions & 0 deletions app/nullius/catalogue/benchmarks/terminal-bench-pro/benchmark.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
{
"key": "terminal-bench-pro",
"title": "Terminal-Bench Pro",
"category": "Terminal",
"domain": "Terminal tasks in a container, in eight balanced categories.",
"scoring": "Test script",
"harness": [
"standard",
"harbor"
],
"origin": "official",
"published": {
"agent": "claude-code",
"says": "Claude Code, the agent the authors' README command runs. Their leaderboard also ranks Codex CLI and iFlow CLI."
},
"good_to_know": [
"Every task gives the agent 3,600 seconds."
],
"upstream_limitations": [
"All but three tasks build on images from the authors' registry, skylensage-registry.cn-hangzhou.cr.aliyuncs.com. It did not answer during validation (upstream issue 10): those tasks end in setup errors. The one-task dataset does not need it.",
"A local run is not a leaderboard entry: results go to the authors by email, and they alone run the 200 private tasks.",
"The authors replaced apache-log-security-analyzer after release v1.0, for quality issues.",
"Most tests download package lists and uv within their time limit, 360 seconds for 164 tasks: on a slow connection they can time out."
],
"limitations": [
"optimize-product-search-query and retrieve-vault-root-token are left out: their image starts a service from its ENTRYPOINT, which Nullius replaces and Harbor keeps.",
"Nullius gives public internet access to 23 tasks, those whose reference solution downloads something, during the agent or reference solution. The other 175 keep only their model route; Harbor gives it to every task.",
"On Nullius, the tests get internet access after the agent ends. What the agent left running is stopped first, except in the 12 tasks whose tests need it.",
"fix-jni-unsatisfiedlinkerror-path cannot pass on Nullius: its tests download a Maven plugin, and Maven ignores the proxy variables that are the tests' only way out.",
"The 195 tasks that build on the authors' registry have not been run through Nullius."
],
"datasets": [
{
"key": "terminal-bench-pro",
"title": "Terminal-Bench Pro public set",
"tasks": 200,
"official": "https://github.com/alibaba/terminal-bench-pro",
"registry": "terminal-bench-pro@1.0",
"hub": "",
"verifier": "Each task's own test script, run after the agent stops.",
"source": "Harbor registry",
"notes": "The 200 public tasks of release v1.0."
}
],
"report": {
"sources": [
"terminal-bench-pro",
"terminal-bench-pro/terminal-bench-pro"
]
},
"citation": "@misc{wang2025letflowagenticcrafting,\n title={Let It Flow: Agentic Crafting on Rock and Roll, Building the ROME Model within an Open Agentic Learning Ecosystem}, \n author={Weixun Wang and XiaoXiao Xu and Xander Xu and others},\n year={2025},\n eprint={2512.24873},\n archivePrefix={arXiv},\n primaryClass={cs.AI},\n url={https://arxiv.org/abs/2512.24873}, \n}",
"citation_source": "https://github.com/alibaba/terminal-bench-pro",
"evidence": [
{
"label": "Why",
"path": "why"
},
{
"label": "Timed out",
"path": "timed_out",
"unless": [
"no"
]
},
{
"label": "Test output",
"path": "output"
}
]
}
170 changes: 170 additions & 0 deletions app/nullius/catalogue/benchmarks/terminal-bench-pro/driver.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
"""Terminal-Bench Pro's driver for the Nullius standard (JSON lines on stdin and stdout).

Each task is a folder of the upstream at its pinned commit: ``instruction.md``
(the prompt), ``task.toml`` (its limits), ``environment/`` (its own
Dockerfile, its own FROM: the task's container), ``tests/`` (``test.sh``,
which writes ``/logs/verifier/reward.txt``) and ``solution/solve.sh`` (the
authors' reference solution).

units - the dataset's tasks: one that builds fast from a public base image
and downloads nothing (``small``), or every task folder of the
upstream but the two whose image this runner cannot start as
published (``full``)
describe - the task's id as its title, its instruction as its text, and its
task.toml's metadata difficulty and category as categories
setup - the task's instruction as the prompt; its own image (``image``: its
environment folder built as published - no task.toml names a
prebuilt one - with the memory and CPUs it asks for), its own agent
timeout (``agent_seconds``, task.toml's agent.timeout_sec), the
internet for the tasks whose reference solution fetches something
(``internet``), and its check (``verify``: tests/ copied to /tests
and test.sh run in the task's container once the agent has ended and
what it left running is stopped - kept, for the tasks whose tests
count on a service its work leaves running - a reward left where
test.sh writes its own deleted first, as Harbor's verifier does,
with the way out it downloads its test runner over, its results
collected from /logs/verifier). The tests reach the container only
then; nothing is written into the workspace.
score - the reward test.sh wrote, read from what the check collected
oracle - the reference control: solution/ copied to /solution and solve.sh
run in the task's container, as the agent would have worked

The driver never runs docker: the run does each step in the unit's container.
"""
import json
import os
import sys
import tomllib

# Fast to build from a public image, its reference solution and its check fetching nothing. Three tasks start
# from a public image (python:3.11-slim, python:3.13-slim), every other from one of the authors' own registry;
# the checks of the other two (bash-ddos-traffic-analyzer, train-fraud-detection-model) download their test runner.
SMALL = ["python-prime-http-server"]

# Tasks whose image starts the task's service from its ENTRYPOINT (a database, a secrets server). The
# unit's container is kept alive by a command of the run's in place of the image's entrypoint, so the
# service would never start: they are left out.
LEFT_OUT = {"optimize-product-search-query", "retrieve-vault-root-token"}

# Tasks whose reference solution fetches something (a package manager, a download, a model or a dataset
# from a hub), from reading each solve.sh at the pinned commit. The benchmark grants them the internet,
# through the public-address proxy, for the agent and the reference solution alike; every other task's
# agent has no way out but its model.
INTERNET = {
"analyze-and-run-encoded-payload", "build-arm64-qemu-linux-with-custom-message", "build-coq-from-source",
"build-graphicsmagick-1-3-45", "build-nginx-1-24-production-server", "build-qemu-arm-user-emulator",
"cache-bert-model-offline", "complete-sql-tutorial-game", "count-claude-tokens-medical-papers",
"count-unique-person-names-conll2003", "implement-chemical-equilibrium-solver", "implement-connect-four-mcts",
"implement-go-board-analyzer", "implement-idcard-flask-api", "implement-sprt-ab-test-analyzer",
"mongodb-sales-aggregation-engine", "ner-eval-conll2003", "python-sql-injection-sanitizer",
"resolve-react-peer-deps", "restore-broken-pip-installation", "setup-mlflow-sqlite-server",
"setup-ubuntu-vm-ssh-key-auth", "train-python-code-skipgram-embeddings",
}

# Tasks whose tests count on a service the agent's work leaves running, as Harbor leaves everything running for
# every task: from reading each tests/ folder and each solve.sh, then from running the reference solution of
# those that leave something up. Most are asked to start it (a web server, an SSH daemon, a virtual machine).
# Two only look as if their tests started it themselves: secure-postgres-schema-migration's start PostgreSQL
# only when its socket file is missing, and a server the run stopped leaves that file; implement-idcard-flask-api's
# start the server with the tests' own Python, which has no Flask. What the agent left running is kept for their
# check. Every other task's check runs with nothing of the agent's still running.
KEEP_PROCESSES = {
"boot-debian-qemu-with-ssh-check", "build-grpc-user-profile-service", "build-nginx-1-24-production-server",
"build-prime-factorization-http-api", "configure-apache-analytics-virtualhost",
"configure-apache-logging-and-rate-limit", "configure-localhost-ssh-key-login",
"find-invalid-blockchain-transactions", "implement-idcard-flask-api", "secure-postgres-schema-migration",
"setup-mlflow-sqlite-server", "setup-ubuntu-vm-ssh-key-auth",
}
LOGS = "/logs/verifier"

# Harbor deletes the reward files before it runs a task's tests (its verifier's _remove_reward_files), so a
# reward written before them never counts when test.sh ends without writing its own. The check does the same.
CHECK = ["bash", "-c", f"rm -f -- {LOGS}/reward.txt {LOGS}/reward.json; exec bash /tests/test.sh"]


def tasks():
"""Every task folder of the upstream this benchmark runs, by name."""
root = os.environ["NULLIUS_UPSTREAM"]
return sorted(d for d in os.listdir(root)
if d not in LEFT_OUT and os.path.isfile(os.path.join(root, d, "task.toml")))


def listed(dataset):
if dataset == "small":
return list(SMALL)
if dataset == "full":
return tasks()
raise ValueError(f"{dataset} is not a dataset of this benchmark")


def task(unit):
if unit not in tasks():
raise ValueError(f"{unit} is not a task of this benchmark's datasets")
here = os.path.join(os.environ["NULLIUS_UPSTREAM"], unit)
with open(os.path.join(here, "task.toml"), "rb") as f:
return here, tomllib.load(f)


def units(dataset, **_):
return {"units": listed(dataset)}


def describe(dataset, **_):
out = {}
for unit in listed(dataset):
here, t = task(unit)
with open(os.path.join(here, "instruction.md")) as f:
text = f.read().strip()
meta = t.get("metadata") or {}
out[unit] = {"title": unit, "text": text,
"categories": {"difficulty": meta.get("difficulty"), "category": meta.get("category")}}
return {"units": out}


def setup(unit, dir):
here, t = task(unit)
with open(os.path.join(here, "instruction.md")) as f:
prompt = f.read().strip()
env = t.get("environment") or {}
image = {"build": f"{unit}/environment"}
if env.get("memory_mb"):
image["memory_mb"] = env["memory_mb"]
if env.get("cpus"):
image["cpus"] = env["cpus"]
agent = (t.get("agent") or {}).get("timeout_sec")
return {"prompt": prompt, "environment": "task", "image": image,
**({"internet": True} if unit in INTERNET else {}),
**({"agent_seconds": agent} if agent else {}), # the task's own agent timeout, not the run's
"verify": {"copy": {f"{unit}/tests": "/tests"}, "run": CHECK, "collect": LOGS,
"seconds": (t.get("verifier") or {}).get("timeout_sec") or 600, "network": True,
**({"keep_processes": True} if unit in KEEP_PROCESSES else {})}}


def score(unit, dir, transcript, answer, verified=None):
if not verified:
return {"reward": 0.0, "passed": False, "detail": {"why": "the task's check did not run"}}
detail = {"exit": verified.get("exit"), "timed_out": verified.get("timed_out"),
"output": (verified.get("output") or "")[-3000:]}
try:
with open(os.path.join(verified["dir"], "reward.txt")) as f:
reward = float(f.read().strip() or 0)
except (OSError, ValueError):
detail["why"] = "test.sh wrote no reward"
reward = 0.0
return {"reward": 1.0 if reward >= 1.0 else 0.0, "passed": reward >= 1.0, "detail": detail}


def oracle(unit, dir):
here, t = task(unit)
return {"answer": "", "solve": {"copy": {f"{unit}/solution": "/solution"}, "run": ["bash", "/solution/solve.sh"],
"seconds": (t.get("agent") or {}).get("timeout_sec") or 3600}}


HANDLERS = {"units": units, "describe": describe, "setup": setup, "score": score, "oracle": oracle}
for line in sys.stdin:
try:
req = json.loads(line)
out = HANDLERS[req.pop("op")](**req)
except Exception as e:
out = {"error": f"{type(e).__name__}: {e}"}
print(json.dumps(out), flush=True)
40 changes: 40 additions & 0 deletions app/nullius/catalogue/benchmarks/terminal-bench-pro/proofs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"schema": "nullius.proofs/v1",
"kind": "benchmark",
"key": "terminal-bench-pro",
"versions": {
"": {
"proven": {
"small": {
"units": {
"units": 1,
"passed": "1 ids, the same twice, unique"
},
"leak": {
"units": 1,
"looked_for": 0,
"short": 0,
"passed": "1/1",
"note": "1 unit(s) whose oracle gave nothing to look for"
},
"nop": {
"passed": "0/1",
"value": 0.0,
"expect": {
"at_most": 0.0
},
"units": 1
},
"oracle": {
"passed": "1/1",
"value": 1.0,
"expect": {
"at_least": 1.0
},
"units": 1
}
}
}
}
}
}
90 changes: 90 additions & 0 deletions app/nullius/catalogue/benchmarks/terminal-bench-pro/standard.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
{
"schema": "nullius.benchmark/v1",
"key": "terminal-bench-pro",
"label": "Terminal-Bench Pro",
"summary": "Each task is its own container, built from the task's Dockerfile as published; the agent works in it, and the task's own tests run there once it has ended.",
"family": "agent",
"needs": [
"agent.workspace/v1"
],
"upstream": {
"repository": "https://github.com/alibaba/terminal-bench-pro",
"tag": "v1.0",
"tested": "321216e78aa4c824f7877f45e3414ea235d7dd5c",
"tested_date": "2026-01-06",
"license": "Apache-2.0"
},
"driver": {
"describe": true,
"command": [
"python3",
"{here}/driver.py"
]
},
"datasets": [
{
"id": "small",
"label": "One task that builds fast",
"units": 1,
"environment": "task",
"subset_of": "full"
},
{
"id": "full",
"label": "All 198 tasks",
"summary": "195 of them need the authors' registry and end in setup errors without it.",
"units": 198,
"environment": "task"
}
],
"units": {
"noun": "task",
"nouns": "tasks",
"categories": {
"difficulty": {
"label": "Difficulty",
"names": {
"easy": "Easy",
"medium": "Medium",
"hard": "Hard"
}
},
"category": {
"label": "Category",
"names": {
"data-processing": "Data processing",
"debugging": "Debugging",
"games": "Games",
"machine-learning": "Machine learning",
"scientific-computing": "Scientific computing",
"security": "Security",
"software-engineering": "Software engineering",
"system-administration": "System administration"
}
}
}
},
"environments": {
"task": {
"summary": "The task's own image, built from its environment folder at the pinned commit - its own FROM, as published - with the agent added at run time.",
"image": "own"
}
},
"controls": {
"nop": {
"source": "nullius",
"from": "Nullius: no agent runs; the task's tests run on its container as its image left it."
},
"oracle": {
"source": "official",
"from": "The task's solution/solve.sh, the authors' reference solution, run in the task's container."
}
},
"score": {
"kind": "pass",
"says": "the task's own tests/test.sh, run in its container after the agent ends, writes reward 1"
},
"limits": {
"turn_seconds": 3600
}
}
Loading
Loading