From dba19af2bcf55914b532a5812c5d390e4c7d7d82 Mon Sep 17 00:00:00 2001 From: Etienne Filhol Date: Mon, 30 Nov 2026 11:38:02 +0100 Subject: [PATCH 1/9] feat(catalogue): add HealthAgentBench, on Harbor and the Nullius standard --- .../healthagentbench/benchmark.json | 91 +++++ .../benchmarks/healthagentbench/driver.py | 353 ++++++++++++++++++ .../benchmarks/healthagentbench/proofs.json | 219 +++++++++++ .../benchmarks/healthagentbench/standard.json | 234 ++++++++++++ .../healthagentbench/upstream-settings.json | 35 ++ app/nullius/recipes/launch.py | 2 + app/static/builder/command-builder-core.js | 3 +- app/static/catalogue/marks.svg | 3 + app/tests/test_catalog.py | 2 +- app/ui_tests/test_catalogue_routes.py | 2 +- app/ui_tests/test_command_builder.py | 6 + docs/agents/supported/README.md | 28 +- docs/agents/supported/codex.md | 6 +- docs/agents/supported/digitalmate.md | 6 +- docs/agents/supported/goose.md | 4 +- docs/agents/supported/jiuwenswarm.md | 8 +- docs/agents/supported/mini-swe-agent.md | 4 +- docs/agents/supported/opencode.md | 4 +- docs/agents/supported/swe-agent.md | 4 +- docs/agents/supported/terminus-2.md | 4 +- docs/benchmarks/supported/README.md | 2 + docs/benchmarks/supported/healthagentbench.md | 85 +++++ 22 files changed, 1068 insertions(+), 37 deletions(-) create mode 100644 app/nullius/catalogue/benchmarks/healthagentbench/benchmark.json create mode 100644 app/nullius/catalogue/benchmarks/healthagentbench/driver.py create mode 100644 app/nullius/catalogue/benchmarks/healthagentbench/proofs.json create mode 100644 app/nullius/catalogue/benchmarks/healthagentbench/standard.json create mode 100644 app/nullius/catalogue/benchmarks/healthagentbench/upstream-settings.json create mode 100644 docs/benchmarks/supported/healthagentbench.md diff --git a/app/nullius/catalogue/benchmarks/healthagentbench/benchmark.json b/app/nullius/catalogue/benchmarks/healthagentbench/benchmark.json new file mode 100644 index 000000000..2d1fcb27b --- /dev/null +++ b/app/nullius/catalogue/benchmarks/healthagentbench/benchmark.json @@ -0,0 +1,91 @@ +{ + "key": "healthagentbench", + "title": "HealthAgentBench", + "category": "Healthcare", + "domain": "Clinical imaging, pathology and health records: read the data, submit the finding.", + "scoring": "Task verifiers", + "harness": [ + "standard", + "harbor" + ], + "origin": "official", + "task_count": 75, + "published": { + "agent": "claude-code", + "says": "Claude Code, the agent of the upstream's own run command; its leaderboard also ranks Codex." + }, + "good_to_know": [ + "39 tasks use public data. X-ray needs PhysioNet access (PN_USER, PN_PASS), CT a Hugging Face token with CT-RATE accepted, MRI and event modelling a Redivis token with MRNet and EHRSHOT granted.", + "Plan 250 GB of disk for all 75 tasks. The first run downloads the data.", + "Each task's agent time limit comes from the task: 1 to 2 hours.", + "The provider must serve the X-ray judge, gpt-5.4, or the run another judge model, even when no X-ray task is run.", + "The leaderboard runs xhigh reasoning effort and no web tools. Set the same to compare.", + "Data use agreements forbid sending MIMIC, EHRSHOT and similar records to providers they do not allow. Check yours first." + ], + "upstream_limitations": [ + "Some images install unpinned packages, so a rebuild can differ.", + "Survival scores break ties by row order." + ], + "limitations": [ + "Tasks need Docker with Compose on the machine. Podman and Boat cannot run them.", + "The agent reaches its model alone. A hosted web search its provider runs is not blocked: turn it off in the agent.", + "Staged data is copied into each task's container, writable there, so it takes its size twice while the task runs.", + "Disk limits are not applied.", + "The X-ray verifier shares this machine's network, to reach its judge through the relay.", + "Controls and proofs allow 10 minutes of setup. A first build or download takes longer: run each category once with an agent first.", + "X-ray, CT, MRI and event modelling have not been run through Nullius." + ], + "datasets": [ + { + "key": "healthagentbench", + "title": "HealthAgentBench V2", + "tasks": 75, + "official": "https://github.com/microsoft/HealthAgentBench", + "registry": "", + "hub": "", + "verifier": "Each task's own verifier, in a container of its own given the submission alone.", + "source": "GitHub", + "notes": "9 categories; 39 tasks on public data." + }, + { + "key": "healthagentbench-v1", + "title": "HealthAgentBench V1", + "tasks": 54, + "official": "https://github.com/microsoft/HealthAgentBench/tree/v1", + "registry": "", + "hub": "", + "verifier": "Each task's own verifier, run in the task's container after the agent.", + "source": "GitHub", + "notes": "7 categories; 28 tasks on public data." + } + ], + "versions": { + "v1": { + "good_to_know": [ + "28 tasks use public data. X-ray needs PhysioNet access (PN_USER, PN_PASS), CT a Hugging Face token with CT-RATE accepted, event modelling a Redivis token with EHRSHOT granted.", + "Agents have public internet access, as V1 was published. V2 removed it because agents fetched answers.", + "The provider must serve the X-ray judge, gpt-5.4, or the run another judge model, even when no X-ray task is run." + ], + "upstream_limitations": [ + "Images install unpinned packages, so a rebuild can differ.", + "The authors retired EHR format conversion as too easy, and clinical trial matching for ambiguous cases." + ], + "limitations": [ + "Tasks need Docker with Compose on the machine. Podman and Boat cannot run them.", + "Upstream gives X-ray agents its credentials. Nullius does not.", + "The X-ray verifier shares this machine's network, to reach its judge through the relay.", + "Controls and proofs allow 10 minutes of setup. A first build or download takes longer: run each category once with an agent first.", + "X-ray, CT and event modelling have not been run through Nullius." + ], + "datasets": { + "healthagentbench": { + "tasks": 54, + "notes": "7 categories; 28 tasks on public data.", + "verifier": "Each task's own verifier, run in the task's container after the agent." + } + } + } + }, + "citation": "@misc{liu2026healthagentbench,\n title = {HealthAgentBench: A Unified Benchmark Suite of Realistic Agentic Healthcare Environments for Challenging Frontier AI Agents},\n author = {Liu, Qianchu and Zhang, Sheng and Qin, Guanghui and Valanarasu, Jeya Maria Jose and Huang, Xiaoke and Argaw, Peniel and Rokuss, Maximilian and Lu, Mingyu and Ossowski, Timothy and Chaves, Juan Manuel Zambrano and Wong, Cliff and Patel, Naisargi and Hasija, Yashna and Wei, Mu and Yim, Wen-wai and Liu, Qin and Jing, Zilin and Entenmann, Jason and Usuyama, Naoto and Naumann, Tristan and Poon, Hoifung},\n year = {2026},\n eprint = {2606.31179},\n archivePrefix = {arXiv},\n primaryClass = {cs.AI},\n url = {https://arxiv.org/abs/2606.31179}\n}", + "citation_source": "https://github.com/microsoft/HealthAgentBench" +} diff --git a/app/nullius/catalogue/benchmarks/healthagentbench/driver.py b/app/nullius/catalogue/benchmarks/healthagentbench/driver.py new file mode 100644 index 000000000..5d1d7e462 --- /dev/null +++ b/app/nullius/catalogue/benchmarks/healthagentbench/driver.py @@ -0,0 +1,353 @@ +"""HealthAgentBench's driver for the Nullius standard (JSON lines on stdin and stdout). + +Each task is a Harbor task of the upstream at its pinned commit: ``instruction.md`` (the +prompt), ``task.toml`` (its limits), ``environment/`` (its image and, for most, a compose +file whose ``bootstrap`` service stages the data), ``tests/`` (its verifier). All of it runs +as published; only Harbor's part is done here. + +units - the dataset's tasks: ``full``, ``public`` (no credential) or one category's +setup - the upstream's own bootstrap service, run by docker compose on a copy of the task, + its volumes bound to a folder; that folder goes into the unit's container + (``prepare``) at the paths the compose file gives the agent's service. The image + is built from the compose file's own context and Dockerfile +score - V2 (a separate verifier): ``verify`` takes out the task's artifacts alone, which + the image of ``tests/`` scores with no network, as Harbor does. V1 (a shared one): + ``verify`` runs ``tests/test.sh`` in the unit's container. The X-ray verifier, of + either, runs apart and asks the judge through the relay +oracle - the authors' solution where a task has one, else its answer key as a submission + +The bootstraps download into the upstream's own ``assets/``, shared by every unit. What one +unit stages, its hidden labels included, is under the upstream's ``.nullius/`` until it is scored. +""" +import atexit +import csv +import hashlib +import json +import os +import pwd +import shutil +import subprocess +import sys +import tempfile +import time +import tomllib + +UP = os.environ["NULLIUS_UPSTREAM"] +WORK = os.path.join(UP, ".nullius") +LOGS = "/logs/verifier" +OUT = "/nullius-artifacts" +BUILD_SECONDS = 3600 + +# A category's tasks (V1's names after V2's), and the credentials its bootstrap reads. +CATEGORIES = { + "xray": (("xray_report_correction_",), ("PN_USER", "PN_PASS")), + "ct": (("ct_abnormality_",), ("HF_TOKEN",)), + "pathology-area": (("pathology_tumor_area_selection_", "tumor_area_selection_pathology_"), ()), + "pathology-slide": (("pathology_tumor_slide_selection_",), ()), + "mri": (("mri_qa_",), ("REDIVIS_API_TOKEN",)), + "data-quality": (("ehr_data_quality_",), ()), + "ehr-qa": (("ehr_compositional_qa_",), ()), + "event": (("ehr_event_modelling_",), ("REDIVIS_API_TOKEN",)), + "survival": (("survival_prediction_",), ()), + "trial-matching": (("clinical_trial_matching_",), ()), + "ehr-to-meds": (("ehr_to_meds_",), ()), +} +ENVIRONMENTS = {"xray": "physionet", "ct": "ct-rate", "mri": "redivis", "event": "redivis"} + +# The tasks' own base, as the data-quality tasks pin it: here it only handles folders root wrote. +IMAGE = "python:3.12-slim@sha256:090ba77e2958f6af52a5341f788b50b032dd4ca28377d2893dcf1ecbdfdfe203" + +# The run gives the driver a home of its own; docker's plugins (compose) are in the user's. +os.environ.setdefault("DOCKER_CONFIG", os.path.join(pwd.getpwuid(os.getuid()).pw_dir, ".docker")) + +made = set() # the staging folders of this process's units +staged = {} # each unit's last staging here: a proof's oracle gets a copy of its folder + + +def docker(*args, seconds=600, check=True, env=None): + r = subprocess.run(["docker", *args], capture_output=True, text=True, timeout=seconds, stdin=subprocess.DEVNULL, env=env) + if check and r.returncode: + said = r.stderr + r.stdout + for name in {n for _, names in CATEGORIES.values() for n in names}: + said = said.replace(os.environ.get(name) or "\0", "[redacted]") + raise RuntimeError(f"docker {' '.join(args[:2])}: {said.strip()[-600:]}") + return r + + +def quietly(*args): + try: + docker(*args, check=False) + except subprocess.TimeoutExpired: + pass + + +def category(unit): + for name, (starts, _) in CATEGORIES.items(): + if unit.startswith(starts): + return name + raise ValueError(f"{unit} is of no category this driver knows") + + +def task(unit): + category(unit) + here = os.path.join(UP, "tasks", unit) + with open(os.path.join(here, "task.toml"), "rb") as f: + return here, tomllib.load(f) + + +def stage(dir): + """The unit's staging folder: its task's copy, with the tests its bootstrap fills, and its volumes.""" + return os.path.join(WORK, hashlib.sha256(os.path.realpath(dir).encode()).hexdigest()[:16]) + + +def project(path): + return "nullius-hab-" + os.path.basename(path) + + +def forget(path): + """A unit's staging and its compose project's tags. The bootstraps write as root, so what they wrote is removed the same way.""" + if os.path.isdir(path): + for name in ("img", "main", "bootstrap"): # the tags; their images stay under their kept name + quietly("rmi", f"{project(path)}-{name}") + shutil.rmtree(path, ignore_errors=True) + if os.path.isdir(path): + quietly("run", "--rm", "--network", "none", "-v", f"{path}:/gone", IMAGE, "find", "/gone", "-mindepth", "1", "-delete") + shutil.rmtree(path, ignore_errors=True) + made.discard(path) + + +def context(unit, build): + """The agent's image: the compose file's build context without ``tests/``, its Dockerfile at the + root, where ``image.build`` reads it. Pinned by the commit, so made once.""" + rel = os.path.join(".nullius", "images", unit) + where = os.path.join(UP, rel) + if not os.path.isdir(where): + src = build["context"] + os.makedirs(os.path.dirname(where), exist_ok=True) + tmp = tempfile.mkdtemp(dir=os.path.dirname(where)) + shutil.copytree(src, tmp, symlinks=True, dirs_exist_ok=True, ignore=shutil.ignore_patterns("tests", "solution", "README.md")) + shutil.copyfile(os.path.join(src, build.get("dockerfile") or "Dockerfile"), os.path.join(tmp, "Dockerfile")) + try: + os.rename(tmp, where) + except OSError: # another unit made it first + shutil.rmtree(tmp, ignore_errors=True) + return rel + + +def bootstrap(unit, dir): + """The unit's data staged by the upstream's own service: its image's folder, and each staged + folder by the path it has in the agent's container.""" + here = stage(dir) + forget(here) + made.add(here) + staged[unit] = here + work = os.path.join(here, "tasks", unit) + shutil.copytree(os.path.join(UP, "tasks", unit), work, symlinks=True) + os.makedirs(os.path.join(UP, "assets"), exist_ok=True) + os.symlink(os.path.join(UP, "assets"), os.path.join(here, "assets")) + compose = os.path.join(work, "environment", "docker-compose.yaml") + if not os.path.isfile(compose): + return os.path.join("tasks", unit, "environment"), {} + # what the compose files name as their env_file, empty: the credentials go by name, never into a file + open(os.path.join(here, ".env"), "w").close() + base = ["compose", "-p", project(here), "-f", compose] + services = json.loads(docker(*base, "config", "--format", "json").stdout)["services"] + main = services["main"] + volumes = {v["source"]: v["target"] for v in main.get("volumes") or [] if v["type"] == "volume"} + over = {} + for name in volumes: + os.makedirs(os.path.join(here, "volumes", name)) + over[name] = {"driver": "local", "driver_opts": {"type": "none", "o": "bind", "device": os.path.join(here, "volumes", name)}} + with open(os.path.join(here, "volumes.json"), "w") as f: + json.dump({"volumes": over}, f) + base += ["-f", os.path.join(here, "volumes.json")] + try: + # each image the compose file builds, kept by the task and the commit: built once + built = {svc["image"]: f"nullius/hab-{unit.replace('_', '-')}-{name}:{os.path.basename(UP)[:12]}" + for name, svc in services.items() if svc.get("build")} + if not all(docker("image", "inspect", kept, check=False).returncode == 0 for kept in built.values()): + docker(*base, "build", seconds=BUILD_SECONDS) + for image, kept in built.items(): + docker("tag", image, kept) + for image, kept in built.items(): + docker("tag", kept, image) + named = [w for n in CATEGORIES[category(unit)][1] for w in ("-e", n)] + docker(*base, "run", "--rm", "--no-deps", "-T", *named, "bootstrap", seconds=6 * 3600) + finally: + quietly(*base, "down", "-v") + # what root wrote, readable to the copies made of it + docker("run", "--rm", "--network", "none", "-v", f"{os.path.join(here, 'volumes')}:/v", "-v", f"{work}/tests:/t", IMAGE, "chmod", "-R", "a+rX", "/v", "/t", seconds=3600) + return context(unit, main["build"]), {os.path.relpath(os.path.join(here, "volumes", n), UP): at for n, at in volumes.items()} + + +def separate(t): + return (t.get("verifier") or {}).get("environment_mode") == "separate" + + +def artifacts(t): + return t.get("artifacts") or [t["metadata"]["submission_path"]] + + +def units(dataset): + every = sorted(os.listdir(os.path.join(UP, "tasks"))) + if dataset == "full": + return {"units": every} + if dataset == "public": + return {"units": [u for u in every if not CATEGORIES[category(u)][1]]} + return {"units": [u for u in every if category(u) == dataset]} + + +def setup(unit, dir): + here, t = task(unit) + kind = category(unit) + with open(os.path.join(here, "instruction.md")) as f: + prompt = f.read().strip() + reply = {"prompt": prompt, "environment": ENVIRONMENTS.get(kind, "task"), "agent_seconds": t["agent"]["timeout_sec"]} + if not all(os.environ.get(n) for n in CATEGORIES[kind][1]): + return reply # the run says which credential is missing + for old in list(made): # a driver serves one unit at a time: what an earlier one left goes + forget(old) + build, data = bootstrap(unit, dir) + env = t["environment"] + reply["image"] = {"build": build, "memory_mb": env["memory_mb"], "cpus": env["cpus"]} + if env.get("allow_internet"): # V1's policy + reply["internet"] = True + if data: + reply["prepare"] = {"copy": data, "run": ["true"], "seconds": 600} + if separate(t) or kind == "xray": + take = f'rm -rf "{OUT}"\n' + "".join(f'mkdir -p "{OUT}{os.path.dirname(a)}"; [ -f "{a}" ] && [ ! -L "{a}" ] && cp "{a}" "{OUT}{a}"\n' for a in artifacts(t)) + reply["verify"] = {"run": ["sh", "-c", take + "true"], "collect": OUT, "seconds": 600} + else: + tests = os.path.relpath(os.path.join(stage(dir), "tasks", unit, "tests"), UP) + # what the agent may have left in the verifier's logs goes before the verifier writes there + reply["verify"] = {"copy": {tests: "/tests"}, "run": ["sh", "-c", f"rm -rf {LOGS}; exec bash /tests/test.sh"], "collect": LOGS, + "seconds": t["verifier"]["timeout_sec"], "network": True} + return reply + + +def verifier(unit, dir, t, judge, out): + """The task's verifier in a container of its own, given its artifacts alone: the folder its logs + are copied into, and its exit.""" + here = stage(dir) + name = "nullius-hab-verify-" + os.path.basename(here) + tests = os.path.join(here, "tasks", unit, "tests") + v = t["verifier"] + room = v.get("environment") or t["environment"] + # V2's verifier is the image of tests/, labels included; V1's X-ray verifier is in the task's image + where = tests if separate(t) else os.path.join(UP, ".nullius", "images", unit) + args, env = ["--network", "none"], dict(os.environ) + if category(unit) == "xray": + env.update({"CHEXPROMPT_OPENAI_API_KEY": judge["key"], "CHEXPROMPT_OPENAI_BASE_URL": judge["base_url"], + "CHEXPROMPT_DEPLOYMENT": judge["model"].rsplit("/", 1)[-1]}) + # the relay's route is on this machine's loopback + args = ["--network", "host", "-e", "CHEXPROMPT_OPENAI_API_KEY", "-e", "CHEXPROMPT_OPENAI_BASE_URL", "-e", "CHEXPROMPT_DEPLOYMENT"] + if not separate(t): + args += ["-v", f"{tests}:/tests:ro"] + try: + docker("build", "-t", name, where, seconds=BUILD_SECONDS) + docker("create", "--name", name, "--cpus", str(room["cpus"]), "--memory", f"{room['memory_mb']}m", *args, name, "bash", "/tests/test.sh", env=env) + sent = os.path.join(out, "workspace") + if os.path.isdir(sent): + docker("cp", sent, f"{name}:/") + try: + r = docker("start", "-a", name, seconds=v["timeout_sec"], check=False) + except subprocess.TimeoutExpired: + raise RuntimeError(f"VerifierError: the verifier did not end in {v['timeout_sec']:g} s") + with open(os.path.join(out, "test-stdout.txt"), "w") as f: + f.write(r.stdout + r.stderr) + logs = os.path.join(out, "task-verifier") + os.makedirs(logs) + docker("cp", f"{name}:{LOGS}/.", logs, check=False) + return logs, r.returncode + finally: + quietly("rm", "-f", "-v", name) + quietly("rmi", "--no-prune", name) # its packages stay as the next unit's build cache + + +def score(unit, dir, transcript, answer, verified=None, judge=None): + _, t = task(unit) + if not verified: + raise RuntimeError("VerifierError: the task's check did not run") + out, code = verified["dir"], verified.get("exit") + try: + if separate(t) or category(unit) == "xray": + out, code = verifier(unit, dir, t, judge, out) + finally: + try: + forget(stage(dir)) + except subprocess.TimeoutExpired: + pass + detail, reward = {"exit": code}, None + try: + with open(os.path.join(out, "reward.txt")) as f: + reward = float(f.read().strip()) + except (OSError, ValueError): + try: + with open(os.path.join(out, "reward.json")) as f: + got = json.load(f) + reward = float(got["reward"] if isinstance(got, dict) else got) + except (OSError, ValueError, KeyError, TypeError): + pass + if reward is None: + raise RuntimeError("VerifierError: the task's verifier wrote no reward") + try: + with open(os.path.join(out, "metrics.json")) as f: + detail["metrics"] = {k: v for k, v in json.load(f).items() if isinstance(v, (int, float, str, bool))} + except (OSError, ValueError, AttributeError): + pass + return {"reward": reward, "passed": reward >= 1.0, "detail": detail} + + +def key(unit, dir, name): + """An answer key of ``tests/``: published with the task, or written there by its bootstrap.""" + here = stage(dir) if os.path.isdir(stage(dir)) else staged.get(unit, stage(dir)) + with open(os.path.join(here, "tasks", unit, "tests", name), newline="") as f: + return json.load(f) if name.endswith(".json") else list(csv.DictReader(f)) if name.endswith(".csv") else f.read() + + +def oracle(unit, dir): + _, t = task(unit) + solution = os.path.join("tasks", unit, "solution") + if os.path.isdir(os.path.join(UP, solution)): + return {"answer": "", "solve": {"copy": {solution: "/solution"}, "run": ["bash", "/solution/solve.sh"], "seconds": t["agent"]["timeout_sec"]}} + kind = category(unit) + if kind == "pathology-slide": + text = json.dumps({"tumor_slides": key(unit, dir, "task_answer_key.json")["tumor_slides"]}) + elif kind == "pathology-area": + text = json.dumps([{"task_id": k["task_id"], "contains_tumor": k["expected_contains_tumor"], + "predicted_tumor_tiles": k["expected_tumor_tiles"]} for k in key(unit, dir, "task_answer_key.json")]) + elif kind == "ehr-qa": + text = json.dumps([{"question_id": k["question_id"], "answer": k["gt_answer"]} for k in key(unit, dir, "answer_key.json")]) + elif kind == "survival": + text = "sample_id,prediction\n" + "".join(f"{r['sample_id']},{r['observed_time_days']}\n" for r in key(unit, dir, "test_labels.csv")) + elif kind == "data-quality": + text = "table,_row_id\n" + "".join(f"{r['table']},{r['row_id']}\n" for r in key(unit, dir, "labels.csv")) + elif kind == "trial-matching": + text = key(unit, dir, "gold.txt") + else: + raise RuntimeError(f"the upstream gives {unit} no reference solution") + return {"answer": "", "solve": {"write": {artifacts(t)[0]: text}, "run": ["true"], "seconds": 60}} + + +def end(unit, dir): + forget(stage(dir)) + return {} + + +atexit.register(lambda: [forget(p) for p in list(made)]) +# a driver closed while it removed them (the run gives it seconds) leaves stagings: after a day, longer +# than any unit's setup, work and score together, no run is using one +for old in os.listdir(WORK) if os.path.isdir(WORK) else (): + path = os.path.join(WORK, old) + if old != "images" and time.time() - os.path.getmtime(path) > 86400: + forget(path) +HANDLERS = {"units": units, "setup": setup, "score": score, "oracle": oracle, "end": end} +for line in sys.stdin: + try: + req = json.loads(line) + out = HANDLERS[req.pop("op")](**req) + except RuntimeError as e: # said as it is: "VerifierError: ..." keeps its kind + out = {"error": str(e)} + except Exception as e: + out = {"error": f"{type(e).__name__}: {e}"} + print(json.dumps(out), flush=True) diff --git a/app/nullius/catalogue/benchmarks/healthagentbench/proofs.json b/app/nullius/catalogue/benchmarks/healthagentbench/proofs.json new file mode 100644 index 000000000..aaaebf861 --- /dev/null +++ b/app/nullius/catalogue/benchmarks/healthagentbench/proofs.json @@ -0,0 +1,219 @@ +{ + "schema": "nullius.proofs/v1", + "kind": "benchmark", + "key": "healthagentbench", + "versions": { + "v2": { + "proven": { + "data-quality": { + "units": { + "units": 8, + "passed": "8 ids, the same twice, unique" + }, + "leak": { + "units": 2, + "looked_for": 0, + "short": 0, + "passed": "2/2", + "note": "2 unit(s) whose oracle gave nothing to look for", + "limit": 2 + }, + "nop": { + "passed": "0/2", + "value": 0.0, + "expect": { + "at_most": 0.0 + }, + "units": 2, + "judge": "gpt-5.4", + "limit": 2 + }, + "oracle": { + "passed": "2/2", + "value": 1.0, + "expect": { + "at_least": 1.0 + }, + "units": 2, + "judge": "gpt-5.4", + "limit": 2 + } + }, + "ehr-qa": { + "units": { + "units": 6, + "passed": "6 ids, the same twice, unique" + }, + "leak": { + "units": 2, + "looked_for": 0, + "short": 0, + "passed": "2/2", + "note": "2 unit(s) whose oracle gave nothing to look for", + "limit": 2 + }, + "nop": { + "passed": "0/2", + "value": 0.0, + "expect": { + "at_most": 0.0 + }, + "units": 2, + "judge": "gpt-5.4", + "limit": 2 + }, + "oracle": { + "passed": "2/2", + "value": 1.0, + "expect": { + "at_least": 1.0 + }, + "units": 2, + "judge": "gpt-5.4", + "limit": 2 + } + }, + "survival": { + "units": { + "units": 5, + "passed": "5 ids, the same twice, unique" + }, + "leak": { + "units": 2, + "looked_for": 0, + "short": 0, + "passed": "2/2", + "note": "2 unit(s) whose oracle gave nothing to look for", + "limit": 2 + }, + "nop": { + "passed": "0/2", + "value": 0.0, + "expect": { + "at_most": 0.0 + }, + "units": 2, + "judge": "gpt-5.4", + "limit": 2 + }, + "oracle": { + "passed": "2/2", + "value": 1.0, + "expect": { + "at_least": 1.0 + }, + "units": 2, + "judge": "gpt-5.4", + "limit": 2 + } + }, + "pathology-slide": { + "units": { + "units": 10, + "passed": "10 ids, the same twice, unique" + }, + "leak": { + "units": 2, + "looked_for": 0, + "short": 0, + "passed": "2/2", + "note": "2 unit(s) whose oracle gave nothing to look for", + "limit": 2 + }, + "nop": { + "passed": "0/2", + "value": 0.0, + "expect": { + "at_most": 0.0 + }, + "units": 2, + "judge": "gpt-5.4", + "limit": 2 + }, + "oracle": { + "passed": "2/2", + "value": 1.0, + "expect": { + "at_least": 1.0 + }, + "units": 2, + "judge": "gpt-5.4", + "limit": 2 + } + } + } + }, + "v1": { + "proven": { + "data-quality": { + "units": { + "units": 8, + "passed": "8 ids, the same twice, unique" + }, + "leak": { + "units": 2, + "looked_for": 0, + "short": 0, + "passed": "2/2", + "note": "2 unit(s) whose oracle gave nothing to look for", + "limit": 2 + }, + "nop": { + "passed": "0/2", + "value": 0.0, + "expect": { + "at_most": 0.0 + }, + "units": 2, + "judge": "gpt-5.4", + "limit": 2 + }, + "oracle": { + "passed": "2/2", + "value": 1.0, + "expect": { + "at_least": 1.0 + }, + "units": 2, + "judge": "gpt-5.4", + "limit": 2 + } + }, + "trial-matching": { + "units": { + "units": 9, + "passed": "9 ids, the same twice, unique" + }, + "leak": { + "units": 2, + "looked_for": 0, + "short": 0, + "passed": "2/2", + "note": "2 unit(s) whose oracle gave nothing to look for", + "limit": 2 + }, + "nop": { + "passed": "0/2", + "value": 0.0, + "expect": { + "at_most": 0.0 + }, + "units": 2, + "judge": "gpt-5.4", + "limit": 2 + }, + "oracle": { + "passed": "2/2", + "value": 1.0, + "expect": { + "at_least": 1.0 + }, + "units": 2, + "judge": "gpt-5.4", + "limit": 2 + } + } + } + } + } +} diff --git a/app/nullius/catalogue/benchmarks/healthagentbench/standard.json b/app/nullius/catalogue/benchmarks/healthagentbench/standard.json new file mode 100644 index 000000000..ae24dad2c --- /dev/null +++ b/app/nullius/catalogue/benchmarks/healthagentbench/standard.json @@ -0,0 +1,234 @@ +{ + "schema": "nullius.benchmark/v1", + "key": "healthagentbench", + "label": "HealthAgentBench", + "summary": "Each task is a container with real clinical data staged by the upstream's own bootstrap; the agent writes a submission and the task's own verifier scores it.", + "family": "agent", + "needs": [ + "agent.workspace/v1" + ], + "upstream": { + "repository": "https://github.com/microsoft/HealthAgentBench", + "license": "MIT" + }, + "driver": { + "command": [ + "python3", + "{here}/driver.py" + ], + "unit_end": true + }, + "datasets": [ + { + "id": "full", + "label": "All 75 tasks", + "units": 75, + "environment": "task" + }, + { + "id": "public", + "label": "Public data (no credential)", + "units": 39, + "environment": "task" + }, + { + "id": "data-quality", + "label": "EHR data quality auditing", + "units": 8, + "environment": "task" + }, + { + "id": "ehr-qa", + "label": "EHR compositional QA", + "units": 6, + "environment": "task" + }, + { + "id": "survival", + "label": "Cancer survival prediction", + "units": 5, + "environment": "task" + }, + { + "id": "pathology-area", + "label": "Pathology tumor area selection", + "units": 10, + "environment": "task" + }, + { + "id": "pathology-slide", + "label": "Pathology tumor slide selection", + "units": 10, + "environment": "task" + }, + { + "id": "ct", + "label": "CT abnormality classification", + "units": 10, + "environment": "ct-rate" + }, + { + "id": "mri", + "label": "MRI QA", + "units": 10, + "environment": "redivis" + }, + { + "id": "event", + "label": "EHR event modelling", + "units": 6, + "environment": "redivis" + }, + { + "id": "xray", + "label": "X-ray report correction", + "units": 10, + "environment": "physionet" + } + ], + "units": { + "noun": "task", + "nouns": "tasks", + "redistribute": false + }, + "environments": { + "task": { + "summary": "The task's own image, built from its Dockerfile as published, its data staged by its own bootstrap.", + "image": "own" + }, + "ct-rate": { + "summary": "The task's own image and the gated CT-RATE scans.", + "image": "own", + "needs_secrets": [ + { + "name": "HF_TOKEN", + "to": "driver", + "provider": "huggingface", + "summary": "Hugging Face access token." + } + ] + }, + "redivis": { + "summary": "The task's own image and the gated EHRSHOT or MRNet data.", + "image": "own", + "needs_secrets": [ + { + "name": "REDIVIS_API_TOKEN", + "to": "driver", + "summary": "Redivis API token with access to EHRSHOT and MRNet." + } + ] + }, + "physionet": { + "summary": "The task's own image and the credentialed MIMIC-CXR images and reports.", + "image": "own", + "needs_secrets": [ + { + "name": "PN_USER", + "to": "driver", + "summary": "PhysioNet user name." + }, + { + "name": "PN_PASS", + "to": "driver", + "summary": "PhysioNet password." + } + ] + } + }, + "controls": { + "nop": { + "source": "nullius", + "from": "Nullius: no agent runs; the verifier scores the submission as the image left it." + }, + "oracle": { + "source": "adapter", + "from": "The authors' solution for data quality; elsewhere the task's own answer key, written as a submission. X-ray, CT, MRI, event modelling and EHR format conversion have none." + } + }, + "score": { + "kind": "pass", + "says": "the task's own verifier writes reward 1; an X-ray report passes when most of its judge's votes find no clinically significant error", + "judge": { + "model": "gpt-5.4", + "says": "The X-ray tasks' CheXprompt votes. No other task asks it." + } + }, + "limits": { + "turn_seconds": 7200, + "setup_seconds": 28800, + "score_seconds": 10800 + }, + "default": "v2", + "versions": { + "v2": { + "upstream": { + "tested": "6f070d7b7c3380cbdf8a2981febfc1ea2560797a", + "tested_date": "2026-10-25" + } + }, + "v1": { + "upstream": { + "branch": "v1", + "tested": "67101dbe98c06bd140f07d26735340c9ea8e6036", + "tested_date": "2026-10-25" + }, + "datasets": [ + { + "id": "full", + "label": "All 54 tasks", + "units": 54, + "environment": "task" + }, + { + "id": "public", + "label": "Public data (no credential)", + "units": 28, + "environment": "task" + }, + { + "id": "data-quality", + "label": "EHR data quality auditing", + "units": 8, + "environment": "task" + }, + { + "id": "trial-matching", + "label": "Clinical trial matching", + "units": 9, + "environment": "task" + }, + { + "id": "ehr-to-meds", + "label": "EHR format conversion", + "units": 1, + "environment": "task" + }, + { + "id": "pathology-area", + "label": "Pathology tumor area selection", + "units": 10, + "environment": "task" + }, + { + "id": "ct", + "label": "CT abnormality classification", + "units": 10, + "environment": "ct-rate" + }, + { + "id": "event", + "label": "EHR event modelling", + "units": 6, + "environment": "redivis" + }, + { + "id": "xray", + "label": "X-ray report correction", + "units": 10, + "environment": "physionet" + } + ] + } + } +} diff --git a/app/nullius/catalogue/benchmarks/healthagentbench/upstream-settings.json b/app/nullius/catalogue/benchmarks/healthagentbench/upstream-settings.json new file mode 100644 index 000000000..d090b02d3 --- /dev/null +++ b/app/nullius/catalogue/benchmarks/healthagentbench/upstream-settings.json @@ -0,0 +1,35 @@ +[ + {"entry": "harbor run", "setting": "--path / --include-task-name (which tasks)", "values": "tasks/ or a category's glob", "default": "tasks/", "nullius": "dataset:full"}, + {"entry": "harbor run", "setting": "the tasks on public data", "values": "", "default": "", "nullius": "dataset:public"}, + {"entry": "harbor run", "setting": "--include-task-name, EHR data quality auditing", "values": "", "default": "", "nullius": "dataset:data-quality"}, + {"entry": "harbor run", "setting": "--include-task-name, EHR compositional QA", "values": "", "default": "", "nullius": "dataset:ehr-qa"}, + {"entry": "harbor run", "setting": "--include-task-name, Cancer survival prediction", "values": "", "default": "", "nullius": "dataset:survival"}, + {"entry": "harbor run", "setting": "--include-task-name, Pathology tumor area selection", "values": "", "default": "", "nullius": "dataset:pathology-area"}, + {"entry": "harbor run", "setting": "--include-task-name, Pathology tumor slide selection", "values": "", "default": "", "nullius": "dataset:pathology-slide"}, + {"entry": "harbor run", "setting": "--include-task-name, CT abnormality classification", "values": "", "default": "", "nullius": "dataset:ct"}, + {"entry": "harbor run", "setting": "--include-task-name, MRI QA", "values": "", "default": "", "nullius": "dataset:mri"}, + {"entry": "harbor run", "setting": "--include-task-name, EHR event modelling", "values": "", "default": "", "nullius": "dataset:event"}, + {"entry": "harbor run", "setting": "--include-task-name, X-ray report correction", "values": "", "default": "", "nullius": "dataset:xray"}, + {"entry": "harbor run", "setting": "--include-task-name, Clinical trial matching", "values": "", "default": "", "nullius": "dataset:trial-matching"}, + {"entry": "harbor run", "setting": "--include-task-name, EHR format conversion", "values": "", "default": "", "nullius": "dataset:ehr-to-meds"}, + {"entry": "harbor run", "setting": "--agent", "values": "claude-code, codex", "default": "claude-code", "nullius": "fixed:the run's agent - any that proved the workspace port"}, + {"entry": "harbor run", "setting": "--model", "values": "the agent's model", "default": "claude-opus-5", "nullius": "fixed:the run's model - sent through the relay"}, + {"entry": "harbor run", "setting": "--agent-kwarg reasoning_effort", "values": "xhigh on the leaderboard", "default": "xhigh", "nullius": "fixed:the agent's own reasoning_effort option - an agent setting"}, + {"entry": "harbor run", "setting": "--agent-kwarg disallowed_tools / web_search", "values": "web tools off", "default": "off", "nullius": "fixed:the agent's own - the container has no web; a search the provider hosts is said in the limitations"}, + {"entry": "harbor run", "setting": "--allow-agent-host", "values": "a model API's host", "default": "none", "nullius": "fixed:the relay alone - no host is opened"}, + {"entry": "harbor run", "setting": "--n-attempts", "values": "attempts per task", "default": "1 (V1's leaderboard: 3)", "nullius": "fixed:the run's attempts - 1 by default"}, + {"entry": "harbor run", "setting": "--n-concurrent", "values": "5 in the README", "default": "5", "nullius": "fixed:the run's concurrency - not what is measured"}, + {"entry": "task.toml", "setting": "agent.timeout_sec", "values": "3600 to 7200", "default": "per task", "nullius": "fixed:each task's own - as Harbor gives it"}, + {"entry": "task.toml", "setting": "agent.network_mode, allowed_hosts", "values": "V2 model APIs; V1 open", "default": "per version", "nullius": "fixed:V2 the relay alone; V1 public internet - as each version published it"}, + {"entry": "task.toml", "setting": "environment.cpus, memory_mb", "values": "per task", "default": "per task", "nullius": "fixed:each task's own - as Harbor gives it"}, + {"entry": "task.toml", "setting": "environment.storage_mb", "values": "per task", "default": "per task", "nullius": "fixed:docker's own limit - not applied, said in the limitations"}, + {"entry": "task.toml", "setting": "environment.gpus", "values": "0", "default": "0", "nullius": "fixed:0 - no task asks for one"}, + {"entry": "task.toml", "setting": "environment.build_timeout_sec", "values": "300 to 21600", "default": "per task", "nullius": "fixed:3600 s for a build and 6 h for a bootstrap - no task's own"}, + {"entry": "task.toml", "setting": "verifier.timeout_sec, verifier.environment", "values": "per task", "default": "per task", "nullius": "fixed:each task's own - as Harbor gives it"}, + {"entry": "environment/docker-compose.yaml", "setting": "the bootstrap service and its volumes", "values": "per task", "default": "per task", "nullius": "fixed:the upstream's own service - its volumes copied into the task's container"}, + {"entry": ".env", "setting": "PN_USER, PN_PASS, HF_TOKEN, REDIVIS_API_TOKEN", "values": "credentials", "default": "unset", "nullius": "fixed:the benchmark's credentials in Settings - given to the bootstrap alone"}, + {"entry": ".env", "setting": "CHEXPROMPT_OPENAI_API_KEY, CHEXPROMPT_OPENAI_BASE_URL", "values": "the judge's endpoint", "default": "api.openai.com", "nullius": "fixed:the judge's route on the relay - no key leaves it"}, + {"entry": ".env", "setting": "CHEXPROMPT_DEPLOYMENT", "values": "a judge model", "default": "gpt-5.4", "nullius": "fixed:the run's judge - gpt-5.4 unless --judge-model names another"}, + {"entry": ".env", "setting": "CHEXPROMPT_AZURE_* (three)", "values": "an Azure endpoint", "default": "unset", "nullius": "not offered - the judge is asked through the relay"}, + {"entry": "tests/harbor_evaluator.py", "setting": "CHEXPROMPT_VOTES, CHEXPROMPT_PASS_THRESHOLD", "values": "V2's X-ray votes and bar", "default": "5, 3", "nullius": "fixed:5 and 3 - the upstream's defaults"} +] diff --git a/app/nullius/recipes/launch.py b/app/nullius/recipes/launch.py index 92a1ff9fc..f1acf6eda 100644 --- a/app/nullius/recipes/launch.py +++ b/app/nullius/recipes/launch.py @@ -45,6 +45,8 @@ def parameter(key, label, group, kind, default=None, *, help="", **extra): LAUNCH = { "swe-bench-verified": {"local": "../harbor-datasets/swe-bench-verified"}, "terminal-bench": {"local": "../harbor-datasets/terminal-bench"}, + # Its tasks read ../../../assets and ../../../.env, so the folder stays in its clone. + "healthagentbench": {"local": "../HealthAgentBench/tasks"}, # A generator: the program `uv run` starts in a checkout of the repository that holds it, writing to --output-dir. "tau3-bench": {"local": "../harbor-datasets/tau3-bench", "generate": {"program": "tau3-bench", "checkout": "tau2-bench checkout · dev/tau3 branch", "example": "../tau2-bench"}}, diff --git a/app/static/builder/command-builder-core.js b/app/static/builder/command-builder-core.js index 8c7d02fd6..37168ac9b 100644 --- a/app/static/builder/command-builder-core.js +++ b/app/static/builder/command-builder-core.js @@ -458,8 +458,9 @@ const d = dataset(r), options = []; if (d?.hub) options.push(['hub', d.hub.includes('(private)') ? 'Private hub' : 'Harbor hub']); else if (d?.registry) options.push(['registry', 'Versioned registry']); - else options.push(['registry', 'Registry or hub']); + else if (!d) options.push(['registry', 'Registry or hub']); options.push(['local', 'Local folder']); + if (d && !d.hub && !d.registry) options.push(['registry', 'Registry or hub']); if (d?.generate) options.push(['generate', 'Generate tasks']); return options; } diff --git a/app/static/catalogue/marks.svg b/app/static/catalogue/marks.svg index dce84e25b..b3f5028c2 100644 --- a/app/static/catalogue/marks.svg +++ b/app/static/catalogue/marks.svg @@ -35,4 +35,7 @@ + + + diff --git a/app/tests/test_catalog.py b/app/tests/test_catalog.py index fd792c27f..98889552f 100644 --- a/app/tests/test_catalog.py +++ b/app/tests/test_catalog.py @@ -33,7 +33,7 @@ def test_shipped_catalogue_is_consistent(self): self.assertEqual(titles, sorted(titles, key=catalog.sort_key)) # what has a usable route is listed, whoever made it and whether or not it has run listed = {x.key for x in cat.listed_benchmarks} - self.assertEqual(sorted(listed), ["gaia", "gsm8k", "humaneval", "locomo", "longmemeval", "open-telco", "osworld1", "osworld2", "swe-bench-verified", "tau3-bench", "terminal-bench"]) + self.assertEqual(sorted(listed), ["gaia", "gsm8k", "healthagentbench", "humaneval", "locomo", "longmemeval", "open-telco", "osworld1", "osworld2", "swe-bench-verified", "tau3-bench", "terminal-bench"]) self.assertEqual((cat.benchmark("longmemeval").origin, cat.benchmark("longmemeval").label), ("official", "Official")) self.assertEqual(cat.benchmark("tau3-bench").label, "Official") # τ³ files as "t3…", before "te…": a reader looking under T finds it diff --git a/app/ui_tests/test_catalogue_routes.py b/app/ui_tests/test_catalogue_routes.py index 4f4a61cb5..95dee861d 100644 --- a/app/ui_tests/test_catalogue_routes.py +++ b/app/ui_tests/test_catalogue_routes.py @@ -128,7 +128,7 @@ def test_every_listed_benchmark_is_a_card_opening_its_page(self): cat = catalog.load() keys = re.findall(r'e.message),run:c.artifacts.map(a=>a.text).join("\\n")}));') + self.assertEqual((got['source'], got['errors']), ('local', [])) + self.assertIn('-p ', got['run']) + def test_an_agent_that_needs_its_own_vendor_key_is_named_on_review(self): schema = dict(self.schema, agentNeeds={"cursor-cli": ["CURSOR_API_KEY"]}, credentials={"available": ["openrouter"], "agent_keys": []}) code = 'const r=C.create("harbor");C.setBenchmark(r,"terminal-bench");r.customAgents=["x:Y"];r.agents=["custom-0"];' diff --git a/docs/agents/supported/README.md b/docs/agents/supported/README.md index e5603cdfd..eeb0f9f6f 100644 --- a/docs/agents/supported/README.md +++ b/docs/agents/supported/README.md @@ -55,21 +55,21 @@ Every agent in the catalogue, the ports each version has proven, and the benchma ### Benchmarks each agent fits - + - - - - - - - - - - - - - + + + + + + + + + + + + +
GAIAGSM8KHumanEvalOpen TelcoOSWorld1OSWorld2SWE-bench Verifiedτ³-benchTerminal-Bench 2.0
One task, Workspace files, SearchOne taskWorkspace filesOne taskComputer useComputer useWorkspace filesMCP tools, ConversationWorkspace files
GAIAGSM8KHealthAgentBenchHumanEvalOpen TelcoOSWorld1OSWorld2SWE-bench Verifiedτ³-benchTerminal-Bench 2.0
One task, Workspace files, SearchOne taskWorkspace filesWorkspace filesOne taskComputer useComputer useWorkspace filesMCP tools, ConversationWorkspace files
codex@2.2.2✓✓✓✓✓✓✓✓✓
codex@0.16.0✓✓✓✓✗✗✓✓✓
digitalmate@0.1.13✗✓✗✓✗✗✗✗✗
digitalmate@0.1.13-fixes✓✓✓✓✗✗✓✓✓
goose✓✓✓✓✗✗✓✓✓
jiuwenswarm@0.2.7✗✓✓✓✗✗✓✓✓
jiuwenswarm@0.2.8✓✓✓✓✗✗✓✓✓
jiuwenswarm@0.2.9✗✓✓✓✗✗✓✓✓
mini-swe-agent✗✗✗✗✗✗✓✗✗
opencode✓✓✓✓✗✗✓✓✓
reference✗✓✓✓✗✗✓✓✓
swe-agent✗✗✗✗✗✗✓✗✗
terminus-2✗✗✗✗✗✗✗✗✓
codex@2.2.2✓✓✓✓✓✓✓✓✓✓
codex@0.16.0✓✓✓✓✓✗✗✓✓✓
digitalmate@0.1.13✗✓✗✗✓✗✗✗✗✗
digitalmate@0.1.13-fixes✓✓✓✓✓✗✗✓✓✓
goose✓✓✓✓✓✗✗✓✓✓
jiuwenswarm@0.2.7✗✓✓✓✓✗✗✓✓✓
jiuwenswarm@0.2.8✓✓✓✓✓✗✗✓✓✓
jiuwenswarm@0.2.9✗✓✓✓✓✗✗✓✓✓
mini-swe-agent✗✗✗✗✗✗✗✓✗✗
opencode✓✓✓✓✓✗✗✓✓✓
reference✗✓✓✓✓✗✗✓✓✓
swe-agent✗✗✗✗✗✗✗✓✗✗
terminus-2✗✗✗✗✗✗✗✗✗✓
- ✗: the missing port, on hover. diff --git a/docs/agents/supported/codex.md b/docs/agents/supported/codex.md index fa271132c..e4797add4 100644 --- a/docs/agents/supported/codex.md +++ b/docs/agents/supported/codex.md @@ -34,10 +34,10 @@ OpenAI's coding agent. ## Benchmarks it fits - + - - + +
GAIAGSM8KHumanEvalOpen TelcoOSWorld1OSWorld2SWE-bench Verifiedτ³-benchTerminal-Bench 2.0
One task, Workspace files, SearchOne taskWorkspace filesOne taskComputer useComputer useWorkspace filesMCP tools, ConversationWorkspace files
GAIAGSM8KHealthAgentBenchHumanEvalOpen TelcoOSWorld1OSWorld2SWE-bench Verifiedτ³-benchTerminal-Bench 2.0
One task, Workspace files, SearchOne taskWorkspace filesWorkspace filesOne taskComputer useComputer useWorkspace filesMCP tools, ConversationWorkspace files
codex@2.2.2✓✓✓✓✓✓✓✓✓
codex@0.16.0✓✓✓✓✗✗✓✓✓
codex@2.2.2✓✓✓✓✓✓✓✓✓✓
codex@0.16.0✓✓✓✓✓✗✗✓✓✓
- ✗: the missing port, on hover. diff --git a/docs/agents/supported/digitalmate.md b/docs/agents/supported/digitalmate.md index afc0abf32..f764fecc0 100644 --- a/docs/agents/supported/digitalmate.md +++ b/docs/agents/supported/digitalmate.md @@ -32,10 +32,10 @@ None declared. ## Benchmarks it fits - + - - + +
GAIAGSM8KHumanEvalOpen TelcoOSWorld1OSWorld2SWE-bench Verifiedτ³-benchTerminal-Bench 2.0
One task, Workspace files, SearchOne taskWorkspace filesOne taskComputer useComputer useWorkspace filesMCP tools, ConversationWorkspace files
GAIAGSM8KHealthAgentBenchHumanEvalOpen TelcoOSWorld1OSWorld2SWE-bench Verifiedτ³-benchTerminal-Bench 2.0
One task, Workspace files, SearchOne taskWorkspace filesWorkspace filesOne taskComputer useComputer useWorkspace filesMCP tools, ConversationWorkspace files
digitalmate@0.1.13✗✓✗✓✗✗✗✗✗
digitalmate@0.1.13-fixes✓✓✓✓✗✗✓✓✓
digitalmate@0.1.13✗✓✗✗✓✗✗✗✗✗
digitalmate@0.1.13-fixes✓✓✓✓✓✗✗✓✓✓
- ✗: the missing port, on hover. diff --git a/docs/agents/supported/goose.md b/docs/agents/supported/goose.md index 907d34524..ba9eb0f01 100644 --- a/docs/agents/supported/goose.md +++ b/docs/agents/supported/goose.md @@ -30,9 +30,9 @@ The AAIF's open-source agent, formerly Block's. ## Benchmarks it fits - + - +
GAIAGSM8KHumanEvalOpen TelcoOSWorld1OSWorld2SWE-bench Verifiedτ³-benchTerminal-Bench 2.0
One task, Workspace files, SearchOne taskWorkspace filesOne taskComputer useComputer useWorkspace filesMCP tools, ConversationWorkspace files
GAIAGSM8KHealthAgentBenchHumanEvalOpen TelcoOSWorld1OSWorld2SWE-bench Verifiedτ³-benchTerminal-Bench 2.0
One task, Workspace files, SearchOne taskWorkspace filesWorkspace filesOne taskComputer useComputer useWorkspace filesMCP tools, ConversationWorkspace files
goose✓✓✓✓✗✗✓✓✓
goose✓✓✓✓✓✗✗✓✓✓
- ✗: the missing port, on hover. diff --git a/docs/agents/supported/jiuwenswarm.md b/docs/agents/supported/jiuwenswarm.md index bc0191250..98a424032 100644 --- a/docs/agents/supported/jiuwenswarm.md +++ b/docs/agents/supported/jiuwenswarm.md @@ -36,11 +36,11 @@ openJiuwen's WorkSwarm agent. ## Benchmarks it fits - + - - - + + +
GAIAGSM8KHumanEvalOpen TelcoOSWorld1OSWorld2SWE-bench Verifiedτ³-benchTerminal-Bench 2.0
One task, Workspace files, SearchOne taskWorkspace filesOne taskComputer useComputer useWorkspace filesMCP tools, ConversationWorkspace files
GAIAGSM8KHealthAgentBenchHumanEvalOpen TelcoOSWorld1OSWorld2SWE-bench Verifiedτ³-benchTerminal-Bench 2.0
One task, Workspace files, SearchOne taskWorkspace filesWorkspace filesOne taskComputer useComputer useWorkspace filesMCP tools, ConversationWorkspace files
jiuwenswarm@0.2.7✗✓✓✓✗✗✓✓✓
jiuwenswarm@0.2.8✓✓✓✓✗✗✓✓✓
jiuwenswarm@0.2.9✗✓✓✓✗✗✓✓✓
jiuwenswarm@0.2.7✗✓✓✓✓✗✗✓✓✓
jiuwenswarm@0.2.8✓✓✓✓✓✗✗✓✓✓
jiuwenswarm@0.2.9✗✓✓✓✓✗✗✓✓✓
- ✗: the missing port, on hover. diff --git a/docs/agents/supported/mini-swe-agent.md b/docs/agents/supported/mini-swe-agent.md index f43378ed5..8d8056d29 100644 --- a/docs/agents/supported/mini-swe-agent.md +++ b/docs/agents/supported/mini-swe-agent.md @@ -30,9 +30,9 @@ Princeton's 100-line agent, bash only. ## Benchmarks it fits - + - +
GAIAGSM8KHumanEvalOpen TelcoOSWorld1OSWorld2SWE-bench Verifiedτ³-benchTerminal-Bench 2.0
One task, Workspace files, SearchOne taskWorkspace filesOne taskComputer useComputer useWorkspace filesMCP tools, ConversationWorkspace files
GAIAGSM8KHealthAgentBenchHumanEvalOpen TelcoOSWorld1OSWorld2SWE-bench Verifiedτ³-benchTerminal-Bench 2.0
One task, Workspace files, SearchOne taskWorkspace filesWorkspace filesOne taskComputer useComputer useWorkspace filesMCP tools, ConversationWorkspace files
mini-swe-agent✗✗✗✗✗✗✓✗✗
mini-swe-agent✗✗✗✗✗✗✗✓✗✗
- ✗: the missing port, on hover. diff --git a/docs/agents/supported/opencode.md b/docs/agents/supported/opencode.md index c288131d1..2c6c3fda3 100644 --- a/docs/agents/supported/opencode.md +++ b/docs/agents/supported/opencode.md @@ -30,9 +30,9 @@ The open-source terminal coding agent. ## Benchmarks it fits - + - +
GAIAGSM8KHumanEvalOpen TelcoOSWorld1OSWorld2SWE-bench Verifiedτ³-benchTerminal-Bench 2.0
One task, Workspace files, SearchOne taskWorkspace filesOne taskComputer useComputer useWorkspace filesMCP tools, ConversationWorkspace files
GAIAGSM8KHealthAgentBenchHumanEvalOpen TelcoOSWorld1OSWorld2SWE-bench Verifiedτ³-benchTerminal-Bench 2.0
One task, Workspace files, SearchOne taskWorkspace filesWorkspace filesOne taskComputer useComputer useWorkspace filesMCP tools, ConversationWorkspace files
opencode✓✓✓✓✗✗✓✓✓
opencode✓✓✓✓✓✗✗✓✓✓
- ✗: the missing port, on hover. diff --git a/docs/agents/supported/swe-agent.md b/docs/agents/supported/swe-agent.md index 9413747ed..9a53ea7c9 100644 --- a/docs/agents/supported/swe-agent.md +++ b/docs/agents/supported/swe-agent.md @@ -28,9 +28,9 @@ None declared. ## Benchmarks it fits - + - +
GAIAGSM8KHumanEvalOpen TelcoOSWorld1OSWorld2SWE-bench Verifiedτ³-benchTerminal-Bench 2.0
One task, Workspace files, SearchOne taskWorkspace filesOne taskComputer useComputer useWorkspace filesMCP tools, ConversationWorkspace files
GAIAGSM8KHealthAgentBenchHumanEvalOpen TelcoOSWorld1OSWorld2SWE-bench Verifiedτ³-benchTerminal-Bench 2.0
One task, Workspace files, SearchOne taskWorkspace filesWorkspace filesOne taskComputer useComputer useWorkspace filesMCP tools, ConversationWorkspace files
swe-agent✗✗✗✗✗✗✓✗✗
swe-agent✗✗✗✗✗✗✗✓✗✗
- ✗: the missing port, on hover. diff --git a/docs/agents/supported/terminus-2.md b/docs/agents/supported/terminus-2.md index fcc73382d..b72c84de2 100644 --- a/docs/agents/supported/terminus-2.md +++ b/docs/agents/supported/terminus-2.md @@ -30,9 +30,9 @@ Harbor's terminal agent, used by Terminal-Bench. ## Benchmarks it fits - + - +
GAIAGSM8KHumanEvalOpen TelcoOSWorld1OSWorld2SWE-bench Verifiedτ³-benchTerminal-Bench 2.0
One task, Workspace files, SearchOne taskWorkspace filesOne taskComputer useComputer useWorkspace filesMCP tools, ConversationWorkspace files
GAIAGSM8KHealthAgentBenchHumanEvalOpen TelcoOSWorld1OSWorld2SWE-bench Verifiedτ³-benchTerminal-Bench 2.0
One task, Workspace files, SearchOne taskWorkspace filesWorkspace filesOne taskComputer useComputer useWorkspace filesMCP tools, ConversationWorkspace files
terminus-2✗✗✗✗✗✗✗✗✓
terminus-2✗✗✗✗✗✗✗✗✗✓
- ✗: the missing port, on hover. diff --git a/docs/benchmarks/supported/README.md b/docs/benchmarks/supported/README.md index 735c499f2..ca3713956 100644 --- a/docs/benchmarks/supported/README.md +++ b/docs/benchmarks/supported/README.md @@ -14,6 +14,7 @@ Every benchmark in the catalogue: where it runs, what it needs, the ways it runs
GAIA
gaiaReal-world questions needing reasoning, web research and file understanding.General assistance✓–165Official GSM8K
gsm8kGrade-school math word problems that take two to eight steps of basic arithmetic, each with a single numeric answer.Math✓–1319Official +HealthAgentBench
healthagentbenchClinical imaging, pathology and health records: read the data, submit the finding.Healthcare✓✓75Official HumanEval
humanevalPython functions written from their signature and docstring, each checked by its unit tests.Coding✓–164Official LoCoMo
locomoVery long-term conversational memory over conversations of 19 to 32 sessions.Memory✓–10Official LongMemEval
longmemevalLong-term chat memory: questions over timestamped chat histories.Memory✓–1500Official @@ -32,6 +33,7 @@ Every benchmark in the catalogue: where it runs, what it needs, the ways it runs GAIAagent.task/v1, agent.workspace/v1, agent.search/v1Nulliusan adapter's author✓✓✓ GSM8Kagent.task/v1Nulliusthe authors✓✓✓ +HealthAgentBenchagent.workspace/v1Nulliusan adapter's author✓✓✓ HumanEvalagent.workspace/v1Nulliusthe authors✓✓✓ LoCoMocap.memory/v1NulliusNullius✓✓✓ LongMemEvalcap.memory/v1NulliusNullius✓✓✓ diff --git a/docs/benchmarks/supported/healthagentbench.md b/docs/benchmarks/supported/healthagentbench.md new file mode 100644 index 000000000..c4b87b05b --- /dev/null +++ b/docs/benchmarks/supported/healthagentbench.md @@ -0,0 +1,85 @@ + + +# HealthAgentBench + +Clinical imaging, pathology and health records: read the data, submit the finding. + + + + + + + + + + +
Keyhealthagentbench
CategoryHealthcare
OriginOfficial
Runs onNullius, Harbor
Tasks75
PaperHealthAgentBench: A Unified Benchmark Suite of Realistic Agentic Healthcare Environments for Challenging Frontier AI Agents, arXiv · 2026
Needs, ports provenagent.workspace/v1
+ +## Datasets + +| Dataset | Key | Tasks | From | Verifier | +|---|---|---|---|---| +| HealthAgentBench V2 | `healthagentbench` | 75 | GitHub [microsoft/HealthAgentBench](https://github.com/microsoft/HealthAgentBench/tree/6f070d7b7c3380cbdf8a2981febfc1ea2560797a) | Each task's own verifier, in a container of its own given the submission alone. | +| HealthAgentBench V1 | `healthagentbench-v1` | 54 | GitHub [microsoft/HealthAgentBench](https://github.com/microsoft/HealthAgentBench/tree/6f070d7b7c3380cbdf8a2981febfc1ea2560797a) | Each task's own verifier, run in the task's container after the agent. | + +## On the standard + +| Control | Written by | +|---|---| +| `nop` | Nullius | +| `oracle` | an adapter's author | + +### Versions + +| Version | Setups as published, whose model | Options | +|---|---|---| +| `healthagentbench@v2` (default) | none | none | +| `healthagentbench@v1` | none | none | + +- `key@version`: a revision of the definition and driver; a recipe pins one, the builder offers the default. + +## As published + +| Harbor agent, among the builder's | Model | What it is | +|---|---|---| +| `claude-code` | any | Claude Code, the agent of the upstream's own run command; its leaderboard also ranks Codex. | + +## Good to know + +- 39 tasks use public data. X-ray needs PhysioNet access (PN_USER, PN_PASS), CT a Hugging Face token with CT-RATE accepted, MRI and event modelling a Redivis token with MRNet and EHRSHOT granted. +- Plan 250 GB of disk for all 75 tasks. The first run downloads the data. +- Each task's agent time limit comes from the task: 1 to 2 hours. +- The provider must serve the X-ray judge, gpt-5.4, or the run another judge model, even when no X-ray task is run. +- The leaderboard runs xhigh reasoning effort and no web tools. Set the same to compare. +- Data use agreements forbid sending MIMIC, EHRSHOT and similar records to providers they do not allow. Check yours first. + +## Upstream limitations + +- Some images install unpinned packages, so a rebuild can differ. +- Survival scores break ties by row order. + +## Nullius limitations + +- Tasks need Docker with Compose on the machine. Podman and Boat cannot run them. +- The agent reaches its model alone. A hosted web search its provider runs is not blocked: turn it off in the agent. +- Staged data is copied into each task's container, writable there, so it takes its size twice while the task runs. +- Disk limits are not applied. +- The X-ray verifier shares this machine's network, to reach its judge through the relay. +- Controls and proofs allow 10 minutes of setup. A first build or download takes longer: run each category once with an agent first. +- X-ray, CT, MRI and event modelling have not been run through Nullius. + +## Cite + +??? citation "BibTeX" + + ```bibtex + @misc{liu2026healthagentbench, + title = {HealthAgentBench: A Unified Benchmark Suite of Realistic Agentic Healthcare Environments for Challenging Frontier AI Agents}, + author = {Liu, Qianchu and Zhang, Sheng and Qin, Guanghui and Valanarasu, Jeya Maria Jose and Huang, Xiaoke and Argaw, Peniel and Rokuss, Maximilian and Lu, Mingyu and Ossowski, Timothy and Chaves, Juan Manuel Zambrano and Wong, Cliff and Patel, Naisargi and Hasija, Yashna and Wei, Mu and Yim, Wen-wai and Liu, Qin and Jing, Zilin and Entenmann, Jason and Usuyama, Naoto and Naumann, Tristan and Poon, Hoifung}, + year = {2026}, + eprint = {2606.31179}, + archivePrefix = {arXiv}, + primaryClass = {cs.AI}, + url = {https://arxiv.org/abs/2606.31179} + } + ``` From c99f12a513cb0d26bf4f1e9e2b261205959f9185 Mon Sep 17 00:00:00 2001 From: Etienne Filhol Date: Mon, 30 Nov 2026 16:21:10 +0100 Subject: [PATCH 2/9] fix(standard): mount a task's staged data as its compose file does; check HealthAgentBench's limitations against Harbor --- .../healthagentbench/benchmark.json | 11 ++++------ .../benchmarks/healthagentbench/driver.py | 10 ++++----- .../healthagentbench/upstream-settings.json | 4 ++-- app/nullius/standard/backends/container.py | 18 +++++++++++----- app/nullius/standard/contract/definitions.py | 11 ++++++++++ app/nullius/standard/pages/recipe.py | 5 +++-- app/nullius/standard/runner/run.py | 15 ++++++++----- app/static/builder/command-builder.js | 5 +---- .../fixtures/standard/ownbench/driver.py | 7 ++++--- .../ownbench/tasks/one/data/staged.txt | 1 + .../ownbench/tasks/one/tests/check.sh | 7 ++++--- app/tests/test_standard_driver_hooks.py | 8 +++---- app/tests/test_standard_own_image.py | 21 +++++++++++++++++++ docs/benchmarks/supported/healthagentbench.md | 8 +++---- docs/cli/run.md | 2 +- docs/standard.md | 5 +++-- 16 files changed, 90 insertions(+), 48 deletions(-) create mode 100644 app/tests/fixtures/standard/ownbench/tasks/one/data/staged.txt diff --git a/app/nullius/catalogue/benchmarks/healthagentbench/benchmark.json b/app/nullius/catalogue/benchmarks/healthagentbench/benchmark.json index 2d1fcb27b..8b020c5c4 100644 --- a/app/nullius/catalogue/benchmarks/healthagentbench/benchmark.json +++ b/app/nullius/catalogue/benchmarks/healthagentbench/benchmark.json @@ -12,7 +12,7 @@ "task_count": 75, "published": { "agent": "claude-code", - "says": "Claude Code, the agent of the upstream's own run command; its leaderboard also ranks Codex." + "says": "Claude Code, the agent the authors' own command runs. Their leaderboard also ranks Codex." }, "good_to_know": [ "39 tasks use public data. X-ray needs PhysioNet access (PN_USER, PN_PASS), CT a Hugging Face token with CT-RATE accepted, MRI and event modelling a Redivis token with MRNet and EHRSHOT granted.", @@ -24,15 +24,13 @@ ], "upstream_limitations": [ "Some images install unpinned packages, so a rebuild can differ.", - "Survival scores break ties by row order." + "Survival scores break ties by row order.", + "Harbor sets no disk limit on Docker, so the tasks' disk sizes are not enforced." ], "limitations": [ "Tasks need Docker with Compose on the machine. Podman and Boat cannot run them.", - "The agent reaches its model alone. A hosted web search its provider runs is not blocked: turn it off in the agent.", - "Staged data is copied into each task's container, writable there, so it takes its size twice while the task runs.", - "Disk limits are not applied.", + "The agent reaches only its model. A web search its provider runs is not blocked, and Claude Code's has no switch here yet.", "The X-ray verifier shares this machine's network, to reach its judge through the relay.", - "Controls and proofs allow 10 minutes of setup. A first build or download takes longer: run each category once with an agent first.", "X-ray, CT, MRI and event modelling have not been run through Nullius." ], "datasets": [ @@ -74,7 +72,6 @@ "Tasks need Docker with Compose on the machine. Podman and Boat cannot run them.", "Upstream gives X-ray agents its credentials. Nullius does not.", "The X-ray verifier shares this machine's network, to reach its judge through the relay.", - "Controls and proofs allow 10 minutes of setup. A first build or download takes longer: run each category once with an agent first.", "X-ray, CT and event modelling have not been run through Nullius." ], "datasets": { diff --git a/app/nullius/catalogue/benchmarks/healthagentbench/driver.py b/app/nullius/catalogue/benchmarks/healthagentbench/driver.py index 5d1d7e462..9ca5312c0 100644 --- a/app/nullius/catalogue/benchmarks/healthagentbench/driver.py +++ b/app/nullius/catalogue/benchmarks/healthagentbench/driver.py @@ -7,9 +7,9 @@ units - the dataset's tasks: ``full``, ``public`` (no credential) or one category's setup - the upstream's own bootstrap service, run by docker compose on a copy of the task, - its volumes bound to a folder; that folder goes into the unit's container - (``prepare``) at the paths the compose file gives the agent's service. The image - is built from the compose file's own context and Dockerfile + its volumes bound to a folder; that folder is mounted in the unit's container + (``mount``) where the compose file mounts each volume in the agent's service, read-only + where it does. The image is built from the compose file's own context and Dockerfile score - V2 (a separate verifier): ``verify`` takes out the task's artifacts alone, which the image of ``tests/`` scores with no network, as Harbor does. V1 (a shared one): ``verify`` runs ``tests/test.sh`` in the unit's container. The X-ray verifier, of @@ -153,7 +153,7 @@ def bootstrap(unit, dir): base = ["compose", "-p", project(here), "-f", compose] services = json.loads(docker(*base, "config", "--format", "json").stdout)["services"] main = services["main"] - volumes = {v["source"]: v["target"] for v in main.get("volumes") or [] if v["type"] == "volume"} + volumes = {v["source"]: v["target"] + (":ro" if v.get("read_only") else "") for v in main.get("volumes") or [] if v["type"] == "volume"} over = {} for name in volumes: os.makedirs(os.path.join(here, "volumes", name)) @@ -213,7 +213,7 @@ def setup(unit, dir): if env.get("allow_internet"): # V1's policy reply["internet"] = True if data: - reply["prepare"] = {"copy": data, "run": ["true"], "seconds": 600} + reply["mount"] = data if separate(t) or kind == "xray": take = f'rm -rf "{OUT}"\n' + "".join(f'mkdir -p "{OUT}{os.path.dirname(a)}"; [ -f "{a}" ] && [ ! -L "{a}" ] && cp "{a}" "{OUT}{a}"\n' for a in artifacts(t)) reply["verify"] = {"run": ["sh", "-c", take + "true"], "collect": OUT, "seconds": 600} diff --git a/app/nullius/catalogue/benchmarks/healthagentbench/upstream-settings.json b/app/nullius/catalogue/benchmarks/healthagentbench/upstream-settings.json index d090b02d3..a08da74e7 100644 --- a/app/nullius/catalogue/benchmarks/healthagentbench/upstream-settings.json +++ b/app/nullius/catalogue/benchmarks/healthagentbench/upstream-settings.json @@ -22,11 +22,11 @@ {"entry": "task.toml", "setting": "agent.timeout_sec", "values": "3600 to 7200", "default": "per task", "nullius": "fixed:each task's own - as Harbor gives it"}, {"entry": "task.toml", "setting": "agent.network_mode, allowed_hosts", "values": "V2 model APIs; V1 open", "default": "per version", "nullius": "fixed:V2 the relay alone; V1 public internet - as each version published it"}, {"entry": "task.toml", "setting": "environment.cpus, memory_mb", "values": "per task", "default": "per task", "nullius": "fixed:each task's own - as Harbor gives it"}, - {"entry": "task.toml", "setting": "environment.storage_mb", "values": "per task", "default": "per task", "nullius": "fixed:docker's own limit - not applied, said in the limitations"}, + {"entry": "task.toml", "setting": "environment.storage_mb", "values": "per task", "default": "per task", "nullius": "fixed:not applied - Harbor sets none on Docker either"}, {"entry": "task.toml", "setting": "environment.gpus", "values": "0", "default": "0", "nullius": "fixed:0 - no task asks for one"}, {"entry": "task.toml", "setting": "environment.build_timeout_sec", "values": "300 to 21600", "default": "per task", "nullius": "fixed:3600 s for a build and 6 h for a bootstrap - no task's own"}, {"entry": "task.toml", "setting": "verifier.timeout_sec, verifier.environment", "values": "per task", "default": "per task", "nullius": "fixed:each task's own - as Harbor gives it"}, - {"entry": "environment/docker-compose.yaml", "setting": "the bootstrap service and its volumes", "values": "per task", "default": "per task", "nullius": "fixed:the upstream's own service - its volumes copied into the task's container"}, + {"entry": "environment/docker-compose.yaml", "setting": "the bootstrap service and its volumes", "values": "per task", "default": "per task", "nullius": "fixed:the upstream's own service - its volumes mounted in the task's container, read-only where the file says"}, {"entry": ".env", "setting": "PN_USER, PN_PASS, HF_TOKEN, REDIVIS_API_TOKEN", "values": "credentials", "default": "unset", "nullius": "fixed:the benchmark's credentials in Settings - given to the bootstrap alone"}, {"entry": ".env", "setting": "CHEXPROMPT_OPENAI_API_KEY, CHEXPROMPT_OPENAI_BASE_URL", "values": "the judge's endpoint", "default": "api.openai.com", "nullius": "fixed:the judge's route on the relay - no key leaves it"}, {"entry": ".env", "setting": "CHEXPROMPT_DEPLOYMENT", "values": "a judge model", "default": "gpt-5.4", "nullius": "fixed:the run's judge - gpt-5.4 unless --judge-model names another"}, diff --git a/app/nullius/standard/backends/container.py b/app/nullius/standard/backends/container.py index 5279cef2d..46a69dcca 100644 --- a/app/nullius/standard/backends/container.py +++ b/app/nullius/standard/backends/container.py @@ -117,7 +117,7 @@ from nullius import constraints, ondisk, paths from nullius.standard.calls import exchanges as exchange_store from nullius.standard.contract import definitions -from nullius.standard.contract.definitions import step_problems +from nullius.standard.contract.definitions import mount_problems, step_problems from nullius.standard.requirements import install def _runs_podman(path: str) -> bool: @@ -1646,18 +1646,24 @@ class Box: (unless the task keeps its processes). **Its limits** are the machine's constraints (:func:`capped`) and the - task's own ``cpus`` and ``memory_mb`` (``task``), the lower value of each.""" + task's own ``cpus`` and ``memory_mb`` (``task``), the lower value of each. + + **A task's staged data is mounted, not copied** (``volumes``, its setup's + ``mount``): folders of the upstream at their paths inside for the whole + unit, read-only when the path ends in ``:ro``, as its compose file's volume + gives them to its service.""" def __init__(self, job: str, tag: str, image: str, *, workdir: str, path: str = IMAGE_PATH, network: Optional[str] = None, mounted: Iterable[Tuple[str, bool]] = (), - runtimes: Optional[Dict[str, Tuple[str, str]]] = None, task: Optional[dict] = None, app: Optional[str] = None, env: Optional[dict] = None): + runtimes: Optional[Dict[str, Tuple[str, str]]] = None, task: Optional[dict] = None, app: Optional[str] = None, env: Optional[dict] = None, + volumes: Optional[Dict[str, str]] = None): n = names(job, tag) self.job, self.image, self.workdir, self.path = job, image, workdir, path self.env = dict(env or {}) self.name = n["agent"] self.net = network or n["network"] self.own_net = network is None - self.mounted, self.runtimes = list(mounted), dict(runtimes or {}) + self.mounted, self.runtimes, self.volumes = list(mounted), dict(runtimes or {}), dict(volumes or {}) self.task, self.app = dict(task or {}), app self.up = False self.keep: Optional[str] = None # the keep-alive's PID inside, found at the start @@ -1667,7 +1673,7 @@ def __init__(self, job: str, tag: str, image: str, *, workdir: str, path: str = def start(self) -> "Box": if self.app: app = os.path.abspath(self.app) - for p, _ in self.mounted: # the application's folder holds the keys' file + for p in [p for p, _ in self.mounted] + list(self.volumes): # the application's folder holds the keys' file if app == p or app.startswith(p.rstrip(os.sep) + os.sep): raise ValueError(f"{p} would show the agent this application's folder and its keys") try: @@ -1682,6 +1688,8 @@ def start(self) -> "Box": a += ["-v", f"{p}:{p}:{'ro' if ro else 'rw'}"] for host, inside in self.runtimes.values(): a += ["-v", f"{host}:{inside}:ro"] + for host, inside in self.volumes.items(): + a += ["-v", f"{host}:{inside}" if inside.endswith(":ro") else f"{host}:{inside}:rw"] self.up = True _docker(a + ["--entrypoint", KEEP_ALIVE[0], self.image] + KEEP_ALIVE[1:], timeout=300) self.keep = self.keeper() diff --git a/app/nullius/standard/contract/definitions.py b/app/nullius/standard/contract/definitions.py index 83c8b0996..19e00cf96 100644 --- a/app/nullius/standard/contract/definitions.py +++ b/app/nullius/standard/contract/definitions.py @@ -1572,6 +1572,17 @@ def step_problems(step, *, collect: bool) -> List[str]: return bad +def mount_problems(mount) -> List[str]: + """Validate an own image's ``mount``: folders of the upstream, each at its own absolute path inside, + read-only when that path ends in ``:ro``, as a compose file writes it.""" + inside = [d.removesuffix(":ro") if isinstance(d, str) else d for d in (mount.values() if isinstance(mount, dict) else ())] + if (not isinstance(mount, dict) or not mount or len(set(inside)) != len(inside) + or not all(isinstance(s, str) and s and not s.startswith("/") for s in mount) + or not all(isinstance(d, str) and d.startswith("/") and d != "/" and ":" not in d for d in inside)): + return ["mount: {path in the upstream: absolute path inside, :ro after it for read-only}, each path inside once"] + return [] + + def problems(d: dict, kind: str) -> List[str]: """What is wrong with definition ``d`` of ``kind``; empty when it may be offered.""" kind = names.kind(kind) diff --git a/app/nullius/standard/pages/recipe.py b/app/nullius/standard/pages/recipe.py index feeebab74..5a38dc12a 100644 --- a/app/nullius/standard/pages/recipe.py +++ b/app/nullius/standard/pages/recipe.py @@ -217,10 +217,11 @@ def _bench_page(b: dict) -> dict: "attempts": (b.get("limits") or {}).get("attempts", ""), "retries": (b.get("limits") or {}).get("retries", 0), # what a unit's time limits and a conversation's length are when the recipe forces none - "timeouts": {"setup": run.DRIVER_SECONDS, "setup_agent": (b.get("limits") or {}).get("setup_seconds") or run.DRIVER_SECONDS, "image": run.IMAGE_SECONDS, "score": (b.get("limits") or {}).get("score_seconds") or run.DRIVER_SECONDS, + "timeouts": {"setup": (b.get("limits") or {}).get("setup_seconds") or run.DRIVER_SECONDS, "image": run.IMAGE_SECONDS, "score": (b.get("limits") or {}).get("score_seconds") or run.DRIVER_SECONDS, "agent": (b.get("limits") or {}).get("turn_seconds") or run.TURN_SECONDS, "turns": (b.get("limits") or {}).get("turns") or run.MAX_TURNS, - "catalogue": [k for k, f in (("agent", "turn_seconds"), ("turns", "turns"), ("score", "score_seconds")) if (b.get("limits") or {}).get(f)]}, + "catalogue": [k for k, f in (("agent", "turn_seconds"), ("turns", "turns"), ("setup", "setup_seconds"), ("score", "score_seconds")) + if (b.get("limits") or {}).get(f)]}, "options": {n: {"label": o.get("label") or n.replace("_", " ").capitalize(), "summary": o["summary"], "datasets": o.get("datasets") or [], "setups": o.get("setups") or ["yours"], **({"values": o["values"]} if "values" in o else {"pattern": o["pattern"], "example": o.get("example")}), "default": o.get("default"), "about": o.get("about") or {}, "names": o.get("names") or {}, "needs": o.get("needs") or {}, "when": o.get("when") or {}, diff --git a/app/nullius/standard/runner/run.py b/app/nullius/standard/runner/run.py index ce79f91ab..dbfc890f9 100644 --- a/app/nullius/standard/runner/run.py +++ b/app/nullius/standard/runner/run.py @@ -144,13 +144,12 @@ def setup_request(bench: dict, kind: str, attempt: Optional[int] = None) -> tupl """What a unit's ``setup`` is sent besides the unit and its folder, and how long it may take, for a unit that ``kind`` runs (agent, capability, control): ``attempt`` when the benchmark tells attempts apart (``limits.attempts``), ``participant`` when its driver asks (``driver.participant``); the benchmark's - ``limits.setup_seconds`` for an agent's unit, - ``DRIVER_SECONDS`` for any other.""" + ``limits.setup_seconds``, else ``DRIVER_SECONDS``, whoever runs the unit: a control's setup stages what an agent's does.""" limits, drv = bench.get("limits") or {}, bench.get("driver") or {} sent = {"attempt": attempt} if attempt and limits.get("attempts") else {} if drv.get("participant"): sent["participant"] = kind - return sent, (limits.get("setup_seconds") if kind == "agent" else None) or DRIVER_SECONDS + return sent, limits.get("setup_seconds") or DRIVER_SECONDS def provider_endpoint(provider: str, env=os.environ) -> tuple: @@ -1756,6 +1755,8 @@ def sent(): raise _Ended("EnvironmentSetupError", "the unit's setup: verify runs in an own image, and this unit has none", retryable=False) if setup.get("prepare") is not None and not own: raise _Ended("EnvironmentSetupError", "the unit's setup: prepare runs in an own image, and this unit has none", retryable=False) + if setup.get("mount") is not None and not own: + raise _Ended("EnvironmentSetupError", "the unit's setup: mount is an own image's, and this unit has none", retryable=False) try: rl = self.unit_relay(tag, trial, setup, env_def, own) except (container.Unavailable, OSError) as e: @@ -2401,7 +2402,8 @@ def agent_internet(self, setup: dict, box, rl, trial: str): def own_box(self, tag: str, setup: dict, rl, home: str): """The unit's own container, started (``container.Box``): the image its - setup names, built or pulled on first use and said as a stage; for an + setup names, built or pulled on first use and said as a stage, with + the setup's ``mount``; for an agent, its install, definition, home and runtimes mounted, and each runtime shown to start in the image - a unit where one cannot (a glibc runtime in a musl image) is not run, which is no one's result.""" @@ -2412,6 +2414,8 @@ def own_box(self, tag: str, setup: dict, rl, home: str): bad += ["verify." + p for p in container.step_problems(setup["verify"], collect=True)] if setup.get("prepare") is not None: bad += ["prepare." + p for p in container.step_problems(setup["prepare"], collect=False)] + if setup.get("mount") is not None: + bad += container.mount_problems(setup["mount"]) if setup.get("workdir") is not None and not (isinstance(setup["workdir"], str) and setup["workdir"].startswith("/")): bad.append("workdir: an absolute path inside the image") if bad: @@ -2423,6 +2427,7 @@ def own_box(self, tag: str, setup: dict, rl, home: str): try: image = self.own_image(spec) cfg = container.image_config(image) + volumes = {container.within(self.up or self.bench["_here"], src): inside for src, inside in (setup.get("mount") or {}).items()} mounted, runtimes = [], {} if self.other["_kind"] == "agent": # as on the base: the unit home, install, definition, and MCP files, and what it runs on, under /opt/nullius @@ -2432,7 +2437,7 @@ def own_box(self, tag: str, setup: dict, rl, home: str): runtimes = self.runtimes box = container.Box(self.name, tag, image, workdir=setup.get("workdir") or cfg["workdir"], path=cfg["path"], network=rl.names["network"] if isinstance(rl, container.Unit) else None, - mounted=mounted, runtimes=runtimes, app=APP, env=setup.get("env"), + mounted=mounted, runtimes=runtimes, app=APP, env=setup.get("env"), volumes=volumes, task={k: spec[k] for k in ("cpus", "memory_mb") if k in spec}).start() for name in runtimes: why = box.runtime_problem(name) diff --git a/app/static/builder/command-builder.js b/app/static/builder/command-builder.js index 72fe82cde..477f33fa5 100644 --- a/app/static/builder/command-builder.js +++ b/app/static/builder/command-builder.js @@ -995,10 +995,7 @@ // each field shows, greyed, the value used while it is empty; a task that declares its own keeps it const m = s => String(+(s / 60).toFixed(2)); // [placeholder, declared]: the benchmark's or the agent's own reads as a value, Nullius's default stays grey - const setupSeconds = C.runsOf(rec).map(k => !['original', 'model'].includes(k) && !(b.controls || []).some(x => x.key === k) && b.family === 'agent' ? (d.setup_agent || d.setup) : d.setup); - const setup = setupSeconds.length && setupSeconds.some(s => s !== setupSeconds[0]) ? ['per setup', true] - : [m(setupSeconds[0] || d.setup), (setupSeconds[0] || d.setup) !== d.setup]; - const def = {setup, image: [m(d.image), false], agent: agentDefault(rec, b), verify: ['per task', true], score: [m(d.score), (d.catalogue || []).includes('score')]}; + const def = {setup: [m(d.setup), (d.catalogue || []).includes('setup')], image: [m(d.image), false], agent: agentDefault(rec, b), verify: ['per task', true], score: [m(d.score), (d.catalogue || []).includes('score')]}; const label = (k, l) => k === 'agent' ? 'Agent, whole ' + u.noun : l; return '

Time limits

' + C.STANDARD_PHASES.map(([k, l]) => minutesRow(k, label(k, l), t[k], def[k])).join(''); diff --git a/app/tests/fixtures/standard/ownbench/driver.py b/app/tests/fixtures/standard/ownbench/driver.py index 1c7baea19..f2e0bf207 100644 --- a/app/tests/fixtures/standard/ownbench/driver.py +++ b/app/tests/fixtures/standard/ownbench/driver.py @@ -1,6 +1,6 @@ """The own-image bench's driver: unit "one" runs in its own image, prepared -as root before anyone works in it, and is checked in it; unit "base" names no image but asks for a check, which only -an own image can give (the run refuses it).""" +as root before anyone works in it, its staged data mounted, and is checked in it; unit "base" names no image but asks +for a check, which only an own image can give (the run refuses it).""" import json import os import sys @@ -17,7 +17,8 @@ def handle(op, **kw): if kw["unit"] == "base": return {"prompt": "work", "environment": "base", "verify": verify} return {"prompt": "work", "environment": "task", "image": {"build": "tasks/one/environment", "memory_mb": 256}, - "prepare": {"run": ["sh", "-c", "id -u > /prepared-by"], "seconds": 60}, "verify": verify} + "prepare": {"run": ["sh", "-c", "id -u > /prepared-by"], "seconds": 60}, "mount": {"tasks/one/data": "/data:ro"}, + "verify": verify} if op == "score": v = kw.get("verified") or {} try: diff --git a/app/tests/fixtures/standard/ownbench/tasks/one/data/staged.txt b/app/tests/fixtures/standard/ownbench/tasks/one/data/staged.txt new file mode 100644 index 000000000..19d9cc858 --- /dev/null +++ b/app/tests/fixtures/standard/ownbench/tasks/one/data/staged.txt @@ -0,0 +1 @@ +staged diff --git a/app/tests/fixtures/standard/ownbench/tasks/one/tests/check.sh b/app/tests/fixtures/standard/ownbench/tasks/one/tests/check.sh index 9546d7461..a99a65e28 100644 --- a/app/tests/fixtures/standard/ownbench/tasks/one/tests/check.sh +++ b/app/tests/fixtures/standard/ownbench/tasks/one/tests/check.sh @@ -1,12 +1,13 @@ #!/bin/sh # The task's check, run in its container after the agent: the work is there, the agent never saw this -# folder, nothing the agent started still runs (its loop would write /tmp/alive again), and the -# benchmark's preparation ran as root before it. +# folder, nothing the agent started still runs (its loop would write /tmp/alive again), the +# benchmark's preparation ran as root before it, and its staged data is mounted, read-only as asked. mkdir -p /logs/out rm -f /tmp/alive sleep 1 if [ -f /work/done.txt ] && [ "$(cat /work/saw-tests.txt 2>/dev/null)" = "no" ] && [ ! -e /tmp/alive ] \ - && [ "$(cat /prepared-by 2>/dev/null)" = "0" ]; then + && [ "$(cat /prepared-by 2>/dev/null)" = "0" ] && [ "$(cat /data/staged.txt 2>/dev/null)" = "staged" ] \ + && ! touch /data/written 2>/dev/null; then echo 1 > /logs/out/reward.txt else echo 0 > /logs/out/reward.txt diff --git a/app/tests/test_standard_driver_hooks.py b/app/tests/test_standard_driver_hooks.py index 8ed73494c..dfb2b61d1 100644 --- a/app/tests/test_standard_driver_hooks.py +++ b/app/tests/test_standard_driver_hooks.py @@ -73,11 +73,11 @@ def test_setup_preserves_attempts_and_sends_only_requested_fields(self): bench = dict(BENCH, driver=dict(BENCH["driver"], participant=True), limits={"attempts": "A seed per attempt.", "setup_seconds": 1800}) self.assertEqual(run.setup_request(bench, kind, 2), - ({"participant": kind, "attempt": 2}, 1800.0 if kind == "agent" else 600.0)) + ({"participant": kind, "attempt": 2}, 1800.0)) bench["driver"]["participant"] = False self.assertEqual(run.setup_request(bench, kind, 2)[0], {"attempt": 2}) - def test_the_leak_check_sets_up_a_control_with_the_original_bound(self): + def test_the_leak_check_sets_up_a_control_with_the_benchmarks_bound(self): bench = dict(BENCH, driver=dict(BENCH["driver"], participant=True), limits={"setup_seconds": 1800}) with tempfile.TemporaryDirectory() as tmp: proc = mock.Mock() @@ -86,7 +86,7 @@ def test_the_leak_check_sets_up_a_control_with_the_original_bound(self): driver.start.return_value = proc prove.leak_check(driver, ["a"], "agent") op, kw = proc.request.call_args_list[0].args[0], proc.request.call_args_list[0].kwargs - self.assertEqual((op, kw["timeout"], kw["participant"]), ("setup", 600.0, "control")) + self.assertEqual((op, kw["timeout"], kw["participant"]), ("setup", 1800.0, "control")) proc.close.assert_called_once() @@ -399,7 +399,7 @@ def test_the_setup_phase_takes_the_setup_limit(self): control = definitions.control(dict(BENCH, controls=controls), "nop") for other, limits, expected in ((self.fake_agent(), None, 600), (control, None, 600), (self.fake_agent(), {"setup_seconds": 1800}, 1800), - (control, {"setup_seconds": 1800}, 600)): + (control, {"setup_seconds": 1800}, 1800)): with self.subTest(kind=other["_kind"], limits=limits): bench = dict(controls=controls, **({"limits": limits} if limits else {})) got = self.env_setup_timeouts(other, **bench) diff --git a/app/tests/test_standard_own_image.py b/app/tests/test_standard_own_image.py index b1028e155..aea9e82c1 100644 --- a/app/tests/test_standard_own_image.py +++ b/app/tests/test_standard_own_image.py @@ -116,6 +116,13 @@ def test_task_environment_reaches_agent_and_runner_variables_win(self): self.assertEqual(env["NO_PROXY"], "localhost,relay") self.assertNotIn("testbed", argv) # values travel in the process environment, not arguments + def test_a_mount_names_upstream_folders_each_at_its_own_path_inside(self): + self.assertEqual(container.mount_problems({"tasks/one/data": "/data", "assets/x": "/workspace/x:ro"}), []) + for bad in ({}, [], {"tasks/one/data": "data"}, {"/etc": "/data"}, {"a": "/"}, {"a": "/d", "b": "/d:ro"}, {"": "/d"}, + {"a": "/d:rw"}, {"a": "/:ro"}): + with self.subTest(mount=bad): + self.assertTrue(any(p.startswith("mount:") for p in container.mount_problems(bad))) + def test_a_driver_names_the_tasks_files_and_nothing_else(self): self.assertTrue(container.within(HERE, "tasks/one/tests").endswith("tasks/one/tests")) for bad in ("../ownbench/../../..", "/etc", "tasks/../../envbench", "tasks/none"): @@ -184,6 +191,20 @@ def test_the_box_runs_in_the_machines_user_namespace_on_a_docker_with_userns_rem b.start() self.assertEqual("--userns=host" in calls[0], remap) + def test_a_tasks_mount_keeps_its_mode_at_its_own_path_and_is_never_this_applications_folder(self): + self.enterContext(mock.patch.object(container, "DOCKER", "docker")) + self.enterContext(mock.patch.object(container, "userns_remap", return_value=False)) + calls = [] + b = container.Box("job", "u0001", "img", workdir="/app", network="net", + volumes={"/up/.nullius/s/volumes/data": "/workspace/data", "/up/.nullius/s/volumes/mri": "/workspace/mri:ro"}) + with mock.patch.object(container, "_docker", lambda a, **kw: calls.append(a)), mock.patch.object(b, "keeper", return_value="7"): + b.start() + self.assertIn("/up/.nullius/s/volumes/data:/workspace/data:rw", calls[0]) + self.assertIn("/up/.nullius/s/volumes/mri:/workspace/mri:ro", calls[0]) + app = os.path.dirname(os.path.dirname(os.path.abspath(container.__file__))) + with mock.patch.object(container, "_docker", lambda a, **kw: None), self.assertRaises(ValueError): + container.Box("job", "u0002", "img", workdir="/app", network="net", app=app, volumes={os.path.dirname(app): "/x"}).start() + def test_exec_passes_variables_by_name_and_the_runtimes_read_only(self): b = container.Box("job", "u0001", "img", workdir="/app", runtimes=self.RT) argv = b.exec_argv(["node", "x"], {"HOME": "/h", "NULLIUS_RELAY_KEY": "placeholder", "PATH": "/p"}, "/usr/bin:/opt/nullius/node/bin") diff --git a/docs/benchmarks/supported/healthagentbench.md b/docs/benchmarks/supported/healthagentbench.md index c4b87b05b..8a35a9038 100644 --- a/docs/benchmarks/supported/healthagentbench.md +++ b/docs/benchmarks/supported/healthagentbench.md @@ -42,7 +42,7 @@ Clinical imaging, pathology and health records: read the data, submit the findin | Harbor agent, among the builder's | Model | What it is | |---|---|---| -| `claude-code` | any | Claude Code, the agent of the upstream's own run command; its leaderboard also ranks Codex. | +| `claude-code` | any | Claude Code, the agent the authors' own command runs. Their leaderboard also ranks Codex. | ## Good to know @@ -57,15 +57,13 @@ Clinical imaging, pathology and health records: read the data, submit the findin - Some images install unpinned packages, so a rebuild can differ. - Survival scores break ties by row order. +- Harbor sets no disk limit on Docker, so the tasks' disk sizes are not enforced. ## Nullius limitations - Tasks need Docker with Compose on the machine. Podman and Boat cannot run them. -- The agent reaches its model alone. A hosted web search its provider runs is not blocked: turn it off in the agent. -- Staged data is copied into each task's container, writable there, so it takes its size twice while the task runs. -- Disk limits are not applied. +- The agent reaches only its model. A web search its provider runs is not blocked, and Claude Code's has no switch here yet. - The X-ray verifier shares this machine's network, to reach its judge through the relay. -- Controls and proofs allow 10 minutes of setup. A first build or download takes longer: run each category once with an agent first. - X-ray, CT, MRI and event modelling have not been run through Nullius. ## Cite diff --git a/docs/cli/run.md b/docs/cli/run.md index 2ac6f5aba..e949116c5 100644 --- a/docs/cli/run.md +++ b/docs/cli/run.md @@ -69,7 +69,7 @@ Each phase of a unit has a time limit. `--timeout PHASE=SECONDS` (repeatable) fo | Phase | Default | A unit past it | | --- | --- | --- | -| `setup` | The benchmark's `limits.setup_seconds` for an agent's unit, else 600 s; an own image's `prepare` step its `seconds` | Environment setup error | +| `setup` | The benchmark's `limits.setup_seconds`, else 600 s; an own image's `prepare` step its `seconds` | Environment setup error | | `image` | 3600 s: an own image's pull or build | Environment setup error | | `agent` | The task's `agent_seconds`, else the Original setup's `turn_seconds`, else `limits.turn_seconds`, else 900 s: the agent's whole work on the unit, every turn of a conversation and the simulated user's between them; each add and each recall of a capability (its reader has `limits.turn_seconds`); an Original setup's answerer; the oracle | Agent timeout; scored where the benchmark [scores the cut](#a-unit-cut-at-a-limit) | | `verify` | The verify step's `seconds`, else the agent's default | Verifier error | diff --git a/docs/standard.md b/docs/standard.md index cbc4b9e13..86b05745e 100644 --- a/docs/standard.md +++ b/docs/standard.md @@ -320,6 +320,7 @@ A benchmark whose tasks are containers (their own Dockerfile and `FROM`) says so | `image.memory_mb`, `image.cpus` | The task's limits; a machine's [constraint](settings/run-hosts.md#constraints) wins when lower | | `workdir` | The session's `cwd` when not the image's working directory | | `prepare` | A step (`copy`, `write`, `run`, `seconds`, `network`) run as root in the unit's container before the agent or a control starts: what the task's own harness adds to every image | +| `mount` | `{path in the upstream: absolute path inside}`, `:ro` after the path inside for read-only: bind-mounted for the whole unit, nothing copied, as a compose file's volume gives a task its staged data. What the unit writes there is written on this machine | | `internet` | Boolean task policy, only in an own image: `true` gives the agent and reference solution a public-address proxy during their work. No run option can enable it | | `env` | Task variables for the agent: uppercase names and string values, no model settings or credentials. The run's variables take precedence; `PATH` contains absolute folders prepended to the image's path | | `verify.copy` | Folders of the upstream copied in only after the agent ends | @@ -429,7 +430,7 @@ local proof records; saved runs and credentials remain. | --- | --- | --- | | `units` | `dataset`, `setup` | Every unit id | | `describe` | `dataset`, with `driver.describe` | `{units: {ID: {title, text, categories: {FIELD: VALUE}}}}`, from the dataset's files alone, for [listings](cli/task-sets.md) | -| `setup` | `unit`, `dir`; `attempt` with `limits.attempts`; `participant` (`agent`, `capability` or `control`) with `driver.participant` | `{prompt}`, any `mcp` servers, `environment`, an own image's `image`, `prepare`, `internet` and `verify`, and `agent_seconds`, the unit's own agent timeout (up to 6 hours, instead of `limits.turn_seconds`); `progress`, a file in the trial the driver rewrites: `{steps, steps_limit, ended}` | +| `setup` | `unit`, `dir`; `attempt` with `limits.attempts`; `participant` (`agent`, `capability` or `control`) with `driver.participant` | `{prompt}`, any `mcp` servers, `environment`, an own image's `image`, `prepare`, `mount`, `internet` and `verify`, and `agent_seconds`, the unit's own agent timeout (up to 6 hours, instead of `limits.turn_seconds`); `progress`, a file in the trial the driver rewrites: `{steps, steps_limit, ended}` | | `turn` | The transcript so far; `simulator: {model, base_url, key}` when there is one; `judge` for an upstream that grades as the conversation ends; `attempt` with `limits.attempts` | The next message, `{done: true}`, or `restart` | | `produce` | A capability benchmark's recall, `base_url` and `key` | The reading, through the relay | | `answer` | `unit, dir, setup, model, base_url, key` | `{answer}`: the upstream's own answerer, for a [setup](#setups-as-published-your-model-your-agent-or-capability) | @@ -449,7 +450,7 @@ An `answer` or `score` error that begins `EnvironmentSetupError: `, `VerifierErr | `leaderboard` | `{says, simulator?, judge?, bench_options?, repeat?}`: what the upstream's leaderboard fixes besides the ranked model, from its own submission rules - the user simulator's and judge's models, the benchmark's options it sets and the fewest attempts per unit. The builder then offers **Like the leaderboard** | | `limits.turns` | At most this many agent turns in a conversation (default 20; `cli run --max-turns` forces another) | | `limits.turn_seconds` | The agent's whole work on a unit, every turn of a conversation included (default 900; a task's `agent_seconds`, a setup's own `turn_seconds` or `cli run --timeout agent=` before it) | -| `limits.setup_seconds` | How long `setup` may take, in seconds, for a unit an agent runs; every other unit keeps 600; `cli run --timeout setup=` forces either. A driver's own bound still applies | +| `limits.setup_seconds` | How long `setup` may take, in seconds, for every unit, a control's too (default 600; `cli run --timeout setup=` forces another). A driver's own bound still applies | | `limits.score_seconds` | How long `score` may take (default 600; `cli run --timeout score=` before it) | | `limits.call_seconds` | How long the relay waits for one model call's reply (default 900). A benchmark whose agent waits longer for a call sets it above that agent's own wait, so the agent's client, not the relay, ends a long call | | `driver.participant` | `true`: `setup` is also sent `participant`, the kind of what runs the unit, for a driver that starts something only an agent uses | From c373f9c12286b1b5ffee220e7d4b941e09aa4ac9 Mon Sep 17 00:00:00 2001 From: Etienne Filhol Date: Mon, 30 Nov 2026 17:08:42 +0100 Subject: [PATCH 3/9] feat(catalogue): HealthAgentBench's driver runs on the engine the run chose, Podman included --- .../benchmarks/healthagentbench/driver.py | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/app/nullius/catalogue/benchmarks/healthagentbench/driver.py b/app/nullius/catalogue/benchmarks/healthagentbench/driver.py index 9ca5312c0..4b65643f1 100644 --- a/app/nullius/catalogue/benchmarks/healthagentbench/driver.py +++ b/app/nullius/catalogue/benchmarks/healthagentbench/driver.py @@ -6,7 +6,7 @@ as published; only Harbor's part is done here. units - the dataset's tasks: ``full``, ``public`` (no credential) or one category's -setup - the upstream's own bootstrap service, run by docker compose on a copy of the task, +setup - the upstream's own bootstrap service, run by compose (docker's or podman's) on a copy of the task, its volumes bound to a folder; that folder is mounted in the unit's container (``mount``) where the compose file mounts each volume in the agent's service, read-only where it does. The image is built from the compose file's own context and Dockerfile @@ -32,6 +32,8 @@ import time import tomllib +from nullius.standard.backends.container import DOCKER as ENGINE # docker, or podman where it stands in, as the run chose + UP = os.environ["NULLIUS_UPSTREAM"] WORK = os.path.join(UP, ".nullius") LOGS = "/logs/verifier" @@ -54,23 +56,27 @@ } ENVIRONMENTS = {"xray": "physionet", "ct": "ct-rate", "mri": "redivis", "event": "redivis"} -# The tasks' own base, as the data-quality tasks pin it: here it only handles folders root wrote. -IMAGE = "python:3.12-slim@sha256:090ba77e2958f6af52a5341f788b50b032dd4ca28377d2893dcf1ecbdfdfe203" +# The tasks' own base, as the data-quality tasks pin it, named in full for podman: here it only handles folders root wrote. +IMAGE = "docker.io/library/python:3.12-slim@sha256:090ba77e2958f6af52a5341f788b50b032dd4ca28377d2893dcf1ecbdfdfe203" -# The run gives the driver a home of its own; docker's plugins (compose) are in the user's. -os.environ.setdefault("DOCKER_CONFIG", os.path.join(pwd.getpwuid(os.getuid()).pw_dir, ".docker")) +# The run gives the driver a home of its own; docker's plugins (compose) are in the user's, and podman's images and settings. +HOME = pwd.getpwuid(os.getuid()).pw_dir +os.environ.setdefault("DOCKER_CONFIG", os.path.join(HOME, ".docker")) +if ENGINE == "podman": + for name, under in (("XDG_DATA_HOME", ".local/share"), ("XDG_CONFIG_HOME", ".config")): + os.environ.setdefault(name, os.path.join(HOME, under)) made = set() # the staging folders of this process's units staged = {} # each unit's last staging here: a proof's oracle gets a copy of its folder def docker(*args, seconds=600, check=True, env=None): - r = subprocess.run(["docker", *args], capture_output=True, text=True, timeout=seconds, stdin=subprocess.DEVNULL, env=env) + r = subprocess.run([ENGINE, *args], capture_output=True, text=True, timeout=seconds, stdin=subprocess.DEVNULL, env=env) if check and r.returncode: said = r.stderr + r.stdout for name in {n for _, names in CATEGORIES.values() for n in names}: said = said.replace(os.environ.get(name) or "\0", "[redacted]") - raise RuntimeError(f"docker {' '.join(args[:2])}: {said.strip()[-600:]}") + raise RuntimeError(f"{ENGINE} {' '.join(args[:2])}: {said.strip()[-600:]}") return r @@ -261,7 +267,7 @@ def verifier(unit, dir, t, judge, out): return logs, r.returncode finally: quietly("rm", "-f", "-v", name) - quietly("rmi", "--no-prune", name) # its packages stay as the next unit's build cache + quietly("rmi", *(["--no-prune"] if ENGINE == "docker" else []), name) # docker keeps its packages as the next build's cache def score(unit, dir, transcript, answer, verified=None, judge=None): From 5e3d9c735e9f8c35e35a11f0f1f31922b6b7a7a1 Mon Sep 17 00:00:00 2001 From: Etienne Filhol Date: Mon, 30 Nov 2026 17:21:55 +0100 Subject: [PATCH 4/9] feat(standard): a benchmark can run every agent with its web tools off --- .../catalogue/agents/claude-code/agent.json | 13 +++ .../agents/claude-code/claude-settings.json | 3 +- app/nullius/catalogue/agents/codex/agent.json | 13 +++ .../catalogue/agents/codex/config.toml | 1 + .../catalogue/agents/opencode/agent.json | 13 +++ .../catalogue/agents/opencode/opencode.json | 2 +- app/nullius/standard/contract/definitions.py | 35 ++++++- app/nullius/standard/pages/recipe.py | 9 +- app/nullius/standard/requirements/install.py | 2 +- app/nullius/standard/runner/run.py | 4 +- app/static/builder/command-builder.js | 2 + app/tests/test_standard_options.py | 92 +++++++++++++++++++ docs/agents/supported/claude-code.md | 1 + docs/agents/supported/codex.md | 1 + docs/agents/supported/opencode.md | 1 + docs/cli/run.md | 2 +- docs/standard.md | 5 +- 17 files changed, 188 insertions(+), 11 deletions(-) diff --git a/app/nullius/catalogue/agents/claude-code/agent.json b/app/nullius/catalogue/agents/claude-code/agent.json index 070e6c278..eb3aae1f6 100644 --- a/app/nullius/catalogue/agents/claude-code/agent.json +++ b/app/nullius/catalogue/agents/claude-code/agent.json @@ -49,6 +49,19 @@ "max" ], "default": "default" + }, + "web_tools": { + "label": "Web tools", + "summary": "WebSearch and WebFetch, Claude Code's web tools: `off` denies both in its settings, `default` leaves them as it ships.", + "values": [ + "default", + "off" + ], + "default": "default", + "writes": { + "default": "", + "off": "\"WebSearch\", \"WebFetch\"" + } } }, "fidelity": { diff --git a/app/nullius/catalogue/agents/claude-code/claude-settings.json b/app/nullius/catalogue/agents/claude-code/claude-settings.json index 5473423d1..26e8ab9c0 100644 --- a/app/nullius/catalogue/agents/claude-code/claude-settings.json +++ b/app/nullius/catalogue/agents/claude-code/claude-settings.json @@ -1,5 +1,6 @@ { "permissions": { - "defaultMode": "bypassPermissions" + "defaultMode": "bypassPermissions", + "deny": [{opt_web_tools}] } } diff --git a/app/nullius/catalogue/agents/codex/agent.json b/app/nullius/catalogue/agents/codex/agent.json index 9ce686846..dece5ecc0 100644 --- a/app/nullius/catalogue/agents/codex/agent.json +++ b/app/nullius/catalogue/agents/codex/agent.json @@ -37,6 +37,19 @@ "high" ], "default": "medium" + }, + "web_tools": { + "label": "Web tools", + "summary": "web_search, the search OpenAI runs for Codex: `off` writes web_search = \"disabled\" into its config.toml, `default` leaves Codex's own.", + "values": [ + "default", + "off" + ], + "default": "default", + "writes": { + "default": "", + "off": "web_search = \"disabled\"" + } } }, "default": "2.2.2", diff --git a/app/nullius/catalogue/agents/codex/config.toml b/app/nullius/catalogue/agents/codex/config.toml index caa8de761..2d97b45fa 100644 --- a/app/nullius/catalogue/agents/codex/config.toml +++ b/app/nullius/catalogue/agents/codex/config.toml @@ -13,6 +13,7 @@ model_reasoning_effort = "{opt_reasoning_effort}" model_provider = "nullius" approval_policy = "never" sandbox_mode = "danger-full-access" +{opt_web_tools} [features] plugins = false diff --git a/app/nullius/catalogue/agents/opencode/agent.json b/app/nullius/catalogue/agents/opencode/agent.json index f83d5ccc7..1d6dbdf5e 100644 --- a/app/nullius/catalogue/agents/opencode/agent.json +++ b/app/nullius/catalogue/agents/opencode/agent.json @@ -58,6 +58,19 @@ "xhigh" ], "default": "medium" + }, + "web_tools": { + "label": "Web tools", + "summary": "webfetch, OpenCode's web tool: `off` denies it in its permissions, `default` allows it, as Nullius runs OpenCode without asking.", + "values": [ + "default", + "off" + ], + "default": "default", + "writes": { + "default": "allow", + "off": "deny" + } } } } diff --git a/app/nullius/catalogue/agents/opencode/opencode.json b/app/nullius/catalogue/agents/opencode/opencode.json index 383637f8b..90d1242ea 100644 --- a/app/nullius/catalogue/agents/opencode/opencode.json +++ b/app/nullius/catalogue/agents/opencode/opencode.json @@ -8,7 +8,7 @@ "permission": { "edit": "allow", "bash": "allow", - "webfetch": "allow", + "webfetch": "{opt_web_tools}", "external_directory": "deny" }, "provider": { diff --git a/app/nullius/standard/contract/definitions.py b/app/nullius/standard/contract/definitions.py index 059e23de2..15d692d2a 100644 --- a/app/nullius/standard/contract/definitions.py +++ b/app/nullius/standard/contract/definitions.py @@ -172,7 +172,7 @@ def setup_label(bench, which): MAX_RETRIES = 9 # the most retries of a failed attempt (runner.retries, cli run --retries) # What a benchmark's version may say for itself: its data, its driver, how it scores, who plays its user, its environments. BENCH_VERSIONED = ("upstream", "datasets", "task_parts", "files", "driver", "mcp_servers", "score", "simulator", "limits", "controls", "environments", - "options", "host", "setups", "proven", "leaderboard") + "options", "host", "setups", "proven", "leaderboard", "agent_options") # What a benchmark option may need: embedding and reranker models through the relay, # machine requirements (host), and digest-pinned auxiliary files. NEED_KEYS = ("embeddings", "reranker", "host", "files") @@ -546,6 +546,9 @@ def _options(d: dict) -> List[str]: bad.append(f"{w}.example: a value its pattern allows besides its default, shown in its place") if option_problem(o, o.get("default")): bad.append(f"{w}.default: the vendor's own default, a value it allows") + wr = o.get("writes") + if wr is not None and not ("values" in o and isinstance(wr, dict) and wr and all(k in o["values"] and isinstance(t, str) for k, t in wr.items())): + bad.append(f"{w}.writes: {{value: the text its slot writes for it}}, for some of its values") for where, n in _option_slots(d): if n not in opts: bad.append(f"{where}: {{opt_{n}}} is not an option (options.{n})") @@ -759,6 +762,32 @@ def options_of(d: dict, given: Optional[dict] = None) -> Tuple[dict, List[str]]: return {n: given.get(n, o.get("default")) for n, o in opts.items()}, bad +def agent_options_of(bench: dict, d: dict, given: Optional[dict] = None) -> Tuple[dict, List[str]]: + """:func:`options_of` for a run of ``bench``: an agent that has an option the benchmark sets for every + agent (``agent_options``, as its rules require) runs with that value; another value given is refused.""" + vals, bad = options_of(d, given) + if d.get("_kind") != "agent": + return vals, bad + opts, given = d.get("options") or {}, given or {} + for n, v in (bench.get("agent_options") or {}).items(): + if n not in opts: + continue # it has no such setting: nothing of it to set + if given.get(n, v) != v: + bad.append(f"{bench.get('label') or bench.get('key')} runs every agent with {n}={v}, not {given[n]}") + why = option_problem(opts[n], v) + if why: + bad.append(f"option {n}: {why}, and {bench.get('label') or bench.get('key')} runs every agent with {n}={v}") + vals[n] = v + return vals, bad + + +def option_slots(d: dict, values: dict) -> Dict[str, str]: + """The ``{opt_}`` slots of ``d``'s templates for the run's ``values``: what each option ``writes`` + for its value, else the value itself.""" + opts = d.get("options") or {} + return {"opt_" + n: str(((opts.get(n) or {}).get("writes") or {}).get(v, v)) for n, v in values.items()} + + def _command(where: str, cmd, slots=SLOTS, word=_WORD) -> List[str]: if not isinstance(cmd, list) or not cmd or not all(isinstance(w, str) for w in cmd): return [f"{where}: a list of words"] @@ -1624,6 +1653,10 @@ def problems(d: dict, kind: str) -> List[str]: bad += _host(d) bad += _files(d) bad += _bench_options(d) + ao = d.get("agent_options") + if ao is not None and not (isinstance(ao, dict) and all(_OPTION.match(str(n)) and isinstance(v, str) and _OPTION_VALUE.match(v) + for n, v in ao.items())): + bad.append("agent_options: {an agent option's name: the value every agent that has it runs with}") drv = d.get("driver") or {} bad += _command("driver.command", drv.get("command") if isinstance(drv, dict) else None, {"here", "install"}) if isinstance(drv, dict): diff --git a/app/nullius/standard/pages/recipe.py b/app/nullius/standard/pages/recipe.py index feeebab74..805ec84e0 100644 --- a/app/nullius/standard/pages/recipe.py +++ b/app/nullius/standard/pages/recipe.py @@ -214,6 +214,8 @@ def _bench_page(b: dict) -> dict: "experiment_judge": {k: v for k, v in ((b.get("score") or {}).get("experiment_judge") or {}).items() if k in ("label", "model")} or None, # what the upstream's leaderboard fixes besides the ranked model (Like the leaderboard) "leaderboard": b.get("leaderboard") or None, + # what every agent that has the option runs with on this benchmark, as its rules require + "agent_options": b.get("agent_options") or {}, "attempts": (b.get("limits") or {}).get("attempts", ""), "retries": (b.get("limits") or {}).get("retries", 0), # what a unit's time limits and a conversation's length are when the recipe forces none @@ -606,7 +608,8 @@ def add(step, message, shown=False, field=None, unset=False): if not isinstance(given, dict) or not all(isinstance(v, str) for v in given.values()): add("agent", "Options are names with a word each.") given = {} - opts, bad = definitions.options_of(o, given) + given = {k: v for k, v in given.items() if k not in (b.get("agent_options") or {})} # the benchmark's own, shown fixed + opts, bad = definitions.agent_options_of(b, o, given) for why_not in bad: add("agent", f"{o['label']}: " + why_not) picks.append({"o": o, "control": control, "given": given, "opts": opts}) @@ -1067,7 +1070,9 @@ def row(p: dict) -> list: p.get("agent") and p["agent"]["start"]["driver"]["agent"] in b["options"][k]["when"]["agent"] for p in picks)], *[row(p) for p in picks], *[[STEP["agent"], "Options" + (f" of {p['o']['label']}" if several else ""), - ", ".join(f"{(p['o'].get('options') or {}).get(k, {}).get('label') or k.replace('_', ' ').capitalize()} {v}" + ("" if k in p["given"] else " (its default)") for k, v in p["opts"].items())] + ", ".join(f"{(p['o'].get('options') or {}).get(k, {}).get('label') or k.replace('_', ' ').capitalize()} {v}" + + (f" ({b['label']}'s)" if k in (b.get("agent_options") or {}) else "" if k in p["given"] else " (its default)") + for k, v in p["opts"].items())] for p in picks if p["opts"]], [STEP["model"], "Model", "none: a control calls no model" if out["keyless"] else f"{providers.label(providers.choice(provider, str(recipe.get('endpoint') or '')))} · " + (model if needs_model else ", ".join(p["o"]["sent"] for p in picks if p.get("setup")) or "the judge only") diff --git a/app/nullius/standard/requirements/install.py b/app/nullius/standard/requirements/install.py index 336f77041..bada1c6a1 100644 --- a/app/nullius/standard/requirements/install.py +++ b/app/nullius/standard/requirements/install.py @@ -267,7 +267,7 @@ def process_env(d: dict, where: str, home: str, options: Optional[dict] = None) ``env`` rendered (``{opt_}`` from ``options``, the run's values), and ``HF_HUB_CACHE`` when it prefetched models.""" slots = {"install": where, "home": home, "here": d.get("_here", ""), - **{"opt_" + k: v for k, v in (options or {}).items()}} + **definitions.option_slots(d, options or {})} out = {} if (d.get("install") or {}).get("prefetch"): out["HF_HUB_CACHE"] = os.path.join(where, HF) diff --git a/app/nullius/standard/runner/run.py b/app/nullius/standard/runner/run.py index 2e2066b46..22aac93c1 100644 --- a/app/nullius/standard/runner/run.py +++ b/app/nullius/standard/runner/run.py @@ -356,7 +356,7 @@ def agent_env(agent: dict, inst: str, home: str, base_url: str, model: str, opti ``{opt_}``; an option left out is filled with its default.""" options = definitions.options_of(agent, options)[0] slots = {"base_url": base_url, "base": base_url.removesuffix("/v1"), "key": relay.PLACEHOLDER_KEY, "model": model, "home": home, - **{"opt_" + k: v for k, v in options.items()}} + **definitions.option_slots(agent, options)} m = agent.get("model") or {} for dest, src in (m.get("files") or {}).items(): path = _render(dest, slots) @@ -886,7 +886,7 @@ def __init__(self, bench: dict, other: dict, *, model: str, provider: str, datas self.licences = licences or Licences(bench) # where a benchmark's environments find the licences they need self.unsandboxed = bool(unsandboxed) self.image = "" - self.options, bad = definitions.options_of(other, options) + self.options, bad = definitions.agent_options_of(bench, other, options) if bad: raise Refused("; ".join(bad)) # A benchmark scored by a model: its official judge, or the one asked for; its calls go through the relay diff --git a/app/static/builder/command-builder.js b/app/static/builder/command-builder.js index 72fe82cde..ea60caa32 100644 --- a/app/static/builder/command-builder.js +++ b/app/static/builder/command-builder.js @@ -831,6 +831,8 @@ const chosen = others.filter(o => C.chosenOf(rec).includes(o.key) && !o.why.length), mine = chosen.filter(o => !o.own); const optionsOf = o => { const mine = (rec.options || {})[o.key] || {}, opts = Object.entries(o.options || {}); return !opts.length ? '' : `
` + opts.map(([n, x]) => { + // one the benchmark sets for every agent that has it (recipe.py: agent_options), as its rules require + if ((b.agent_options || {})[n] !== undefined) return fixed(words(n), b.agent_options[n], b.label); const cur = mine[n] ?? x.default; return x.values ? `` diff --git a/app/tests/test_standard_options.py b/app/tests/test_standard_options.py index d6f9863fe..db7874703 100644 --- a/app/tests/test_standard_options.py +++ b/app/tests/test_standard_options.py @@ -9,6 +9,7 @@ import re import shutil import tempfile +import tomllib import unittest from nullius.standard import cli @@ -64,6 +65,15 @@ def test_a_bundled_pattern_has_an_example_only_beside_a_word_default(self): if "pattern" in o: self.assertEqual("example" in o, not number.match(str(o.get("default"))), f"{d['_ref']} {n}") + def test_writes_names_some_of_its_values_and_the_text_each_puts_in_its_slot(self): + self.assertEqual(definitions.problems(agent(options={"effort": dict(EFFORT, writes={"high": "max", "low": ""})}), "agent"), []) + for writes in ({}, {"max": "x"}, {"high": 3}, ["high"]): + with self.subTest(writes=writes): + self.assertIn("options.effort.writes: {value: the text its slot writes for it}, for some of its values", + definitions.problems(agent(options={"effort": dict(EFFORT, writes=writes)}), "agent")) + pattern = {"summary": "s", "pattern": "^[0-9]+$", "default": "40", "writes": {"40": "x"}} + self.assertTrue(definitions.problems(agent(options={"effort": pattern}), "agent")) + def test_a_name_and_a_summary(self): bad = definitions.problems(agent(options={"Effort": dict(EFFORT), "effort": dict(EFFORT, summary="")}), "agent") self.assertIn("options: 'Effort' is not a name (lower case letters and _)", bad) @@ -121,6 +131,67 @@ def test_the_slots_are_filled_in_variables_files_and_its_own_env(self): self.assertEqual(env["BOT_EFFORT"], "medium") # nothing set: the vendor's default, written out +class Writes(unittest.TestCase): + def test_a_value_writes_its_own_text_and_the_others_themselves(self): + here, home = tempfile.mkdtemp(), tempfile.mkdtemp() + self.addCleanup(shutil.rmtree, here) + self.addCleanup(shutil.rmtree, home) + with open(os.path.join(here, "conf.json"), "w") as f: + f.write('{"deny": [{opt_effort}]}') + d = agent(_here=here, model={"apis": ["chat"], "env": {"BOT_EFFORT": "{opt_effort}"}, "files": {"{home}/conf.json": "conf.json"}}, + options={"effort": dict(EFFORT, writes={"high": '"Web"', "medium": ""})}) + for value, deny, env in (("high", ["Web"], '"Web"'), ("medium", [], ""), ("low", None, "low")): + with self.subTest(value=value): + got = run.agent_env(d, here, home, "http://relay/v1", "m-1", {"effort": value}) + self.assertEqual(got["BOT_EFFORT"], env) + with open(os.path.join(home, "conf.json")) as f: + text = f.read() + self.assertEqual(json.loads(text)["deny"] if deny is not None else text, deny if deny is not None else '{"deny": [low]}') + + def test_each_bundled_web_switch_keeps_its_file_valid_and_turns_the_tools_off(self): + """Claude Code, Codex and OpenCode: what `web_tools` writes into each one's settings, as the vendor reads it.""" + files = {"claude-code": (".claude/settings.json", json.loads, lambda d: d["permissions"]["deny"], [], ["WebSearch", "WebFetch"]), + "codex": (".codex/config.toml", tomllib.loads, lambda d: d.get("web_search"), None, "disabled"), + "opencode": (".config/opencode/opencode.json", json.loads, lambda d: d["permission"]["webfetch"], "allow", "deny")} + for key, (path, parse, switch, on, off) in files.items(): + for value, expected in (("default", on), ("off", off)): + with self.subTest(agent=key, value=value): + home = tempfile.mkdtemp() + self.addCleanup(shutil.rmtree, home) + run.agent_env(definitions.get("agent", key, definitions.CATALOGUE), "/inst", home, "http://relay/u/v1", "m-1", {"web_tools": value}) + with open(os.path.join(home, path)) as f: + self.assertEqual(switch(parse(f.read())), expected) + + +class ABenchmarksOwn(unittest.TestCase): + """A benchmark whose rules fix an agent setting (``agent_options``): every agent that has it runs with that value.""" + BENCH = {"key": "fixed", "label": "Fixed", "agent_options": {"effort": "high"}} + + def test_an_agent_that_has_the_option_runs_with_the_benchmarks_value(self): + a = dict(agent(), _kind="agent") + self.assertEqual(definitions.agent_options_of(self.BENCH, a), ({"effort": "high"}, [])) + self.assertEqual(definitions.agent_options_of(self.BENCH, a, {"effort": "high"}), ({"effort": "high"}, [])) + vals, bad = definitions.agent_options_of(self.BENCH, a, {"effort": "low"}) + self.assertEqual(bad, ["Fixed runs every agent with effort=high, not low"]) + + def test_an_agent_without_it_or_another_kind_runs_as_it_is(self): + self.assertEqual(definitions.agent_options_of(self.BENCH, dict(agent(options={}), _kind="agent")), ({}, [])) + self.assertEqual(definitions.agent_options_of(self.BENCH, dict(agent(), _kind="capability")), ({"effort": "medium"}, [])) + + def test_a_value_the_agent_does_not_allow_is_said(self): + bench = dict(self.BENCH, agent_options={"effort": "max"}) + self.assertEqual(definitions.agent_options_of(bench, dict(agent(), _kind="agent"))[1], + ["option effort: 'max' is not one of low, medium, high, and Fixed runs every agent with effort=max"]) + + def test_the_field_is_names_and_plain_words(self): + bench = definitions.get("benchmark", "fakebench", ROOT) + self.assertEqual(definitions.problems(dict(bench, agent_options={"web_tools": "off"}), "benchmark"), []) + for bad in (["web_tools"], {"Web": "off"}, {"web_tools": "a b"}, {"web_tools": 1}): + with self.subTest(agent_options=bad): + self.assertIn("agent_options: {an agent option's name: the value every agent that has it runs with}", + definitions.problems(dict(bench, agent_options=bad), "benchmark")) + + class InARun(unittest.TestCase): def setUp(self): self.tmp = tempfile.mkdtemp() @@ -152,6 +223,17 @@ def test_a_value_it_does_not_allow_is_refused_before_anything_starts(self): unsandboxed=True, options={"effort": "max"}) self.assertIn("'max' is not one of low, medium, high", str(e.exception)) + def test_the_benchmarks_own_value_is_the_runs_and_another_is_refused(self): + bench = dict(definitions.get("benchmark", "fakebench", ROOT), agent_options={"effort": "high"}) + job = run.run(bench, self.fake(), model="m-1", provider="custom", jobs_root=self.tmp, limit=1, concurrency=1, + env={"MODEL_API_URL": "http://127.0.0.1:9/v1"}, say=lambda s: None, unsandboxed=True) + with open(os.path.join(job, "config.json")) as f: + self.assertEqual(json.load(f)["standard"]["options"], {"effort": "high"}) + with self.assertRaises(run.Refused) as e: + run.Run(bench, self.fake(), model="m-1", provider="custom", jobs_root=self.tmp, env={"MODEL_API_URL": "http://x/v1"}, + unsandboxed=True, options={"effort": "low"}) + self.assertIn("runs every agent with effort=high, not low", str(e.exception)) + def test_the_cli_reads_name_equals_value(self): self.assertEqual(cli.options(["effort=high", "speed = a"]), {"effort": "high", "speed": "a"}) with self.assertRaises(SystemExit): @@ -208,6 +290,16 @@ def test_an_option_with_a_label_is_named_by_it(self): d["agent"] = [dict(a, options={"effort": dict(EFFORT, label="Thinking")}) for a in d["agent"]] self.assertIn(["Options", "Thinking medium (its default)"], [r[1:] for r in recipe.compile(self.recipe(), d)["review"]]) + def test_the_benchmarks_own_value_is_shown_fixed_and_never_sent_otherwise(self): + d = self.defs() + d["benchmark"] = [dict(b, agent_options={"effort": "high"}) for b in d["benchmark"]] + label = next(b["label"] for b in d["benchmark"] if b["key"] == "fakebench") + out = recipe.compile(self.recipe(options={"effort": "low"}), d) # a recipe saved before: its value gives way + self.assertEqual(out["errors"], []) + self.assertNotIn("--option", out["script"]) + self.assertIn(["Options", f"Effort high ({label}'s)"], [r[1:] for r in out["review"]]) + self.assertEqual(recipe._bench_page(d["benchmark"][0])["agent_options"], {"effort": "high"}) + def test_a_value_it_does_not_allow_is_the_agent_steps_error(self): out = recipe.compile(self.recipe(options={"effort": "x; rm -rf"}), self.defs()) self.assertEqual([e["step"] for e in out["errors"]], [recipe.STEP["agent"]]) diff --git a/docs/agents/supported/claude-code.md b/docs/agents/supported/claude-code.md index 51147c567..a2da38a89 100644 --- a/docs/agents/supported/claude-code.md +++ b/docs/agents/supported/claude-code.md @@ -27,6 +27,7 @@ Anthropic's coding agent. | Option | Values, default in bold | What it sets | Versions | |---|---|---|---| | `reasoning_effort` | **`default`**, `low`, `medium`, `high`, `xhigh`, `max` | How much effort a supported model spends, with `default` leaving Claude Code's own level. | every version | +| `web_tools` | **`default`**, `off` | WebSearch and WebFetch, Claude Code's web tools: `off` denies both in its settings, `default` leaves them as it ships. | every version | ## Benchmarks it fits diff --git a/docs/agents/supported/codex.md b/docs/agents/supported/codex.md index f1f595e28..9c576ca46 100644 --- a/docs/agents/supported/codex.md +++ b/docs/agents/supported/codex.md @@ -30,6 +30,7 @@ OpenAI's coding agent. | Option | Values, default in bold | What it sets | Versions | |---|---|---|---| | `reasoning_effort` | `minimal`, `low`, **`medium`**, `high` | How much reasoning the model uses before answering. | every version | +| `web_tools` | **`default`**, `off` | web_search, the search OpenAI runs for Codex: `off` writes web_search = "disabled" into its config.toml, `default` leaves Codex's own. | every version | ## Benchmarks it fits diff --git a/docs/agents/supported/opencode.md b/docs/agents/supported/opencode.md index 004f8ba11..df46c1419 100644 --- a/docs/agents/supported/opencode.md +++ b/docs/agents/supported/opencode.md @@ -26,6 +26,7 @@ The open-source terminal coding agent. | Option | Values, default in bold | What it sets | Versions | |---|---|---|---| | `reasoning_effort` | `none`, `minimal`, `low`, **`medium`**, `high`, `xhigh` | How much reasoning a supported model uses before answering. | every version | +| `web_tools` | **`default`**, `off` | webfetch, OpenCode's web tool: `off` denies it in its permissions, `default` allows it, as Nullius runs OpenCode without asking. | every version | ## Benchmarks it fits diff --git a/docs/cli/run.md b/docs/cli/run.md index 4b0fec5fd..eb345cba3 100644 --- a/docs/cli/run.md +++ b/docs/cli/run.md @@ -32,7 +32,7 @@ nullius standard run locomo model --model gpt-4o-mini | `--unsandboxed` | An agent runs as you; else `--backend container` | | `--backend` | `local` (default); `container`, each unit in a container with its relay; or [`boat`](../standard.md#the-boat-backend), a VM per unit | | `--boat-size` | Boat's VM size: `small` (default), `default`, `large`, `xlarge` | -| `--option NAME=VALUE` | An agent's or capability's option (repeatable) | +| `--option NAME=VALUE` | An agent's or capability's option (repeatable); one the benchmark sets for every agent (`agent_options`) cannot be given another value | | `--bench-option NAME=VALUE` | A benchmark's option (repeatable) | | `--price MODEL=INPUT,OUTPUT[,CACHED,WRITE,WRITE_1H]` | This run's price for a model in USD per million tokens (repeatable), over your [price list](../settings/model-prices.md) | | `--max-usd USD`, `--max-usd-per-unit USD` | A spending cap for the run, for each unit: [below](#a-spending-cap) | diff --git a/docs/standard.md b/docs/standard.md index 2700c1d9a..e0a23eed2 100644 --- a/docs/standard.md +++ b/docs/standard.md @@ -447,6 +447,7 @@ An `answer` or `score` error that begins `EnvironmentSetupError: `, `VerifierErr | `score.experiment_judge` | `{label, model, says}`: a judge beside the score, never in its place, on a benchmark with no official one. Runs only on `--judge-model`, on the same route; `model` is the one its source used, never a default | | `simulator` | `{model, says, served_as?}`, only with `agent.conversation/v1`: the user's model, on `-simulator`. The conversation opens with a `turn` on an empty transcript, its message after `setup`'s prompt and a blank line. A control never asks it. `cli run --simulator-model` asks another | | `leaderboard` | `{says, simulator?, judge?, bench_options?, repeat?}`: what the upstream's leaderboard fixes besides the ranked model, from its own submission rules - the user simulator's and judge's models, the benchmark's options it sets and the fewest attempts per unit. The builder then offers **Like the leaderboard** | +| `agent_options` | `{option: value}`: what every agent that has the option runs with on this benchmark, as its rules require (`web_tools: off`). A run giving another value is refused; the builder shows it fixed. An agent without the option runs as it is | | `limits.turns` | At most this many agent turns in a conversation (default 20; `cli run --max-turns` forces another) | | `limits.turn_seconds` | The agent's whole work on a unit, every turn of a conversation included (default 900; a task's `agent_seconds`, a setup's own `turn_seconds` or `cli run --timeout agent=` before it) | | `limits.setup_seconds` | How long `setup` may take, in seconds, for a unit an agent runs; every other unit keeps 600; `cli run --timeout setup=` forces either. A driver's own bound still applies | @@ -562,10 +563,10 @@ An agent or a capability may keep several versions in its one file: an older rel | Rule | Detail | | --- | --- | | Shape | A `summary`, `values` (or a `pattern`, with an optional `example`) and a `default`, the vendor's own; the summary says where it comes from | -| Reaches the agent | As `{opt_}` in `model.env`, `env`, or a file `model.files` writes; `cli check` refuses a slot naming no option, and a default the option does not allow | +| Reaches the agent | As `{opt_}` in `model.env`, `env`, or a file `model.files` writes; `writes: {value: text}` puts other text there for a value (`off` as `"WebSearch", "WebFetch"`). `cli check` refuses a slot naming no option, and a default the option does not allow | | Set | `cli run` and `cli conform` take `--option name=value` (repeatable) | | Recorded | Every value under `standard.options` in `config.json`, defaults included | -| Fair by construction | A setting one agent has, every agent whose upstream has it declares under the same name (`reasoning_effort`). `default` leaves it unset where the vendor sends nothing; the relay records the effort each request asked for (`request.reasoning_effort`) | +| Fair by construction | A setting one agent has, every agent whose upstream has it declares under the same name (`reasoning_effort`; `web_tools`, `default` or `off`, for the agent's own web search and fetch). `default` leaves it unset where the vendor sends nothing; the relay records the effort each request asked for (`request.reasoning_effort`) | !!! tip "Write a setting explicitly when an adapter and the CLI would each fill it their own way" Codex's `reasoning_effort` is always written into its `config.toml` as `model_reasoning_effort`, default `medium`. From d281196b7f9fdd55a619217cc5189dcf6822ee7b Mon Sep 17 00:00:00 2001 From: Etienne Filhol Date: Mon, 30 Nov 2026 17:22:49 +0100 Subject: [PATCH 5/9] feat(catalogue): HealthAgentBench V2 runs every agent with its web tools off, as its authors require --- .../catalogue/benchmarks/healthagentbench/benchmark.json | 3 +-- .../catalogue/benchmarks/healthagentbench/standard.json | 3 +++ .../benchmarks/healthagentbench/upstream-settings.json | 2 +- docs/benchmarks/supported/healthagentbench.md | 3 +-- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/app/nullius/catalogue/benchmarks/healthagentbench/benchmark.json b/app/nullius/catalogue/benchmarks/healthagentbench/benchmark.json index 8b020c5c4..2b4116c13 100644 --- a/app/nullius/catalogue/benchmarks/healthagentbench/benchmark.json +++ b/app/nullius/catalogue/benchmarks/healthagentbench/benchmark.json @@ -19,7 +19,7 @@ "Plan 250 GB of disk for all 75 tasks. The first run downloads the data.", "Each task's agent time limit comes from the task: 1 to 2 hours.", "The provider must serve the X-ray judge, gpt-5.4, or the run another judge model, even when no X-ray task is run.", - "The leaderboard runs xhigh reasoning effort and no web tools. Set the same to compare.", + "Every agent runs with its web tools off, as the authors require. The leaderboard runs xhigh reasoning effort: set the same to compare.", "Data use agreements forbid sending MIMIC, EHRSHOT and similar records to providers they do not allow. Check yours first." ], "upstream_limitations": [ @@ -29,7 +29,6 @@ ], "limitations": [ "Tasks need Docker with Compose on the machine. Podman and Boat cannot run them.", - "The agent reaches only its model. A web search its provider runs is not blocked, and Claude Code's has no switch here yet.", "The X-ray verifier shares this machine's network, to reach its judge through the relay.", "X-ray, CT, MRI and event modelling have not been run through Nullius." ], diff --git a/app/nullius/catalogue/benchmarks/healthagentbench/standard.json b/app/nullius/catalogue/benchmarks/healthagentbench/standard.json index ae24dad2c..a2018d8c9 100644 --- a/app/nullius/catalogue/benchmarks/healthagentbench/standard.json +++ b/app/nullius/catalogue/benchmarks/healthagentbench/standard.json @@ -165,6 +165,9 @@ "upstream": { "tested": "6f070d7b7c3380cbdf8a2981febfc1ea2560797a", "tested_date": "2026-10-25" + }, + "agent_options": { + "web_tools": "off" } }, "v1": { diff --git a/app/nullius/catalogue/benchmarks/healthagentbench/upstream-settings.json b/app/nullius/catalogue/benchmarks/healthagentbench/upstream-settings.json index a08da74e7..8c4a4aa77 100644 --- a/app/nullius/catalogue/benchmarks/healthagentbench/upstream-settings.json +++ b/app/nullius/catalogue/benchmarks/healthagentbench/upstream-settings.json @@ -15,7 +15,7 @@ {"entry": "harbor run", "setting": "--agent", "values": "claude-code, codex", "default": "claude-code", "nullius": "fixed:the run's agent - any that proved the workspace port"}, {"entry": "harbor run", "setting": "--model", "values": "the agent's model", "default": "claude-opus-5", "nullius": "fixed:the run's model - sent through the relay"}, {"entry": "harbor run", "setting": "--agent-kwarg reasoning_effort", "values": "xhigh on the leaderboard", "default": "xhigh", "nullius": "fixed:the agent's own reasoning_effort option - an agent setting"}, - {"entry": "harbor run", "setting": "--agent-kwarg disallowed_tools / web_search", "values": "web tools off", "default": "off", "nullius": "fixed:the agent's own - the container has no web; a search the provider hosts is said in the limitations"}, + {"entry": "harbor run", "setting": "--agent-kwarg disallowed_tools / web_search", "values": "web tools off", "default": "off", "nullius": "fixed:off on V2 - each agent's own web_tools switch, where it has one"}, {"entry": "harbor run", "setting": "--allow-agent-host", "values": "a model API's host", "default": "none", "nullius": "fixed:the relay alone - no host is opened"}, {"entry": "harbor run", "setting": "--n-attempts", "values": "attempts per task", "default": "1 (V1's leaderboard: 3)", "nullius": "fixed:the run's attempts - 1 by default"}, {"entry": "harbor run", "setting": "--n-concurrent", "values": "5 in the README", "default": "5", "nullius": "fixed:the run's concurrency - not what is measured"}, diff --git a/docs/benchmarks/supported/healthagentbench.md b/docs/benchmarks/supported/healthagentbench.md index 8a35a9038..e56cbb8d0 100644 --- a/docs/benchmarks/supported/healthagentbench.md +++ b/docs/benchmarks/supported/healthagentbench.md @@ -50,7 +50,7 @@ Clinical imaging, pathology and health records: read the data, submit the findin - Plan 250 GB of disk for all 75 tasks. The first run downloads the data. - Each task's agent time limit comes from the task: 1 to 2 hours. - The provider must serve the X-ray judge, gpt-5.4, or the run another judge model, even when no X-ray task is run. -- The leaderboard runs xhigh reasoning effort and no web tools. Set the same to compare. +- Every agent runs with its web tools off, as the authors require. The leaderboard runs xhigh reasoning effort: set the same to compare. - Data use agreements forbid sending MIMIC, EHRSHOT and similar records to providers they do not allow. Check yours first. ## Upstream limitations @@ -62,7 +62,6 @@ Clinical imaging, pathology and health records: read the data, submit the findin ## Nullius limitations - Tasks need Docker with Compose on the machine. Podman and Boat cannot run them. -- The agent reaches only its model. A web search its provider runs is not blocked, and Claude Code's has no switch here yet. - The X-ray verifier shares this machine's network, to reach its judge through the relay. - X-ray, CT, MRI and event modelling have not been run through Nullius. From ddaab4f39710443536bf578f329d7821d6e9c0f5 Mon Sep 17 00:00:00 2001 From: Etienne Filhol Date: Mon, 30 Nov 2026 17:25:19 +0100 Subject: [PATCH 6/9] test(standard): Codex's review line lists its web tools option --- app/tests/test_standard_bench_options.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/tests/test_standard_bench_options.py b/app/tests/test_standard_bench_options.py index 4f24a290f..b6c28605d 100644 --- a/app/tests/test_standard_bench_options.py +++ b/app/tests/test_standard_bench_options.py @@ -523,7 +523,7 @@ def test_a_setting_every_dataset_shares_names_no_dataset(self): def test_an_agent_option_reads_by_its_label_not_its_key(self): self.assertNotIn("reasoning_effort", self.rows()["Options of Codex 2.2.2"]) - self.assertEqual(self.rows()["Options of Codex 2.2.2"], "Reasoning effort medium (its default)") # as the Agent step words it + self.assertEqual(self.rows()["Options of Codex 2.2.2"], "Reasoning effort medium (its default), Web tools default (its default)") # as the Agent step words it def test_a_capability_option_reads_by_its_label_not_its_key(self): out = recipe.compile(dict(GSM8K, benchmark="locomo", datasets=["locomo10"], others=["mem0"], options={})) From 63e2a5a5c365d98a79c9680701af0cb4cae09367 Mon Sep 17 00:00:00 2001 From: Etienne Filhol Date: Mon, 30 Nov 2026 18:26:19 +0100 Subject: [PATCH 7/9] docs(catalogue): HealthAgentBench's web search is off only through each agent's own switch --- .../catalogue/benchmarks/healthagentbench/benchmark.json | 3 ++- docs/benchmarks/supported/healthagentbench.md | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/nullius/catalogue/benchmarks/healthagentbench/benchmark.json b/app/nullius/catalogue/benchmarks/healthagentbench/benchmark.json index 2b4116c13..741f4563e 100644 --- a/app/nullius/catalogue/benchmarks/healthagentbench/benchmark.json +++ b/app/nullius/catalogue/benchmarks/healthagentbench/benchmark.json @@ -25,7 +25,8 @@ "upstream_limitations": [ "Some images install unpinned packages, so a rebuild can differ.", "Survival scores break ties by row order.", - "Harbor sets no disk limit on Docker, so the tasks' disk sizes are not enforced." + "Harbor sets no disk limit on Docker, so the tasks' disk sizes are not enforced.", + "The network does not block a web search the model's provider runs: each agent needs its own switch to turn web search off, for a fair comparison." ], "limitations": [ "Tasks need Docker with Compose on the machine. Podman and Boat cannot run them.", diff --git a/docs/benchmarks/supported/healthagentbench.md b/docs/benchmarks/supported/healthagentbench.md index e56cbb8d0..df9129689 100644 --- a/docs/benchmarks/supported/healthagentbench.md +++ b/docs/benchmarks/supported/healthagentbench.md @@ -58,6 +58,7 @@ Clinical imaging, pathology and health records: read the data, submit the findin - Some images install unpinned packages, so a rebuild can differ. - Survival scores break ties by row order. - Harbor sets no disk limit on Docker, so the tasks' disk sizes are not enforced. +- The network does not block a web search the model's provider runs: each agent needs its own switch to turn web search off, for a fair comparison. ## Nullius limitations From 7f734acec48974f84a882f1172483d437f20c226 Mon Sep 17 00:00:00 2001 From: Etienne Filhol Date: Mon, 30 Nov 2026 18:39:11 +0100 Subject: [PATCH 8/9] fix(catalogue): HealthAgentBench's podman runs with the user's home, where its images and compose provider are --- .../catalogue/benchmarks/healthagentbench/driver.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/nullius/catalogue/benchmarks/healthagentbench/driver.py b/app/nullius/catalogue/benchmarks/healthagentbench/driver.py index 4b65643f1..6aff0e756 100644 --- a/app/nullius/catalogue/benchmarks/healthagentbench/driver.py +++ b/app/nullius/catalogue/benchmarks/healthagentbench/driver.py @@ -59,18 +59,19 @@ # The tasks' own base, as the data-quality tasks pin it, named in full for podman: here it only handles folders root wrote. IMAGE = "docker.io/library/python:3.12-slim@sha256:090ba77e2958f6af52a5341f788b50b032dd4ca28377d2893dcf1ecbdfdfe203" -# The run gives the driver a home of its own; docker's plugins (compose) are in the user's, and podman's images and settings. +# The run gives the driver a home of its own; docker's plugins (compose) are in the user's. Podman keeps its images, +# settings and compose provider under the user's home and runtime folder: it runs with those, as Nullius's own podman does. HOME = pwd.getpwuid(os.getuid()).pw_dir os.environ.setdefault("DOCKER_CONFIG", os.path.join(HOME, ".docker")) -if ENGINE == "podman": - for name, under in (("XDG_DATA_HOME", ".local/share"), ("XDG_CONFIG_HOME", ".config")): - os.environ.setdefault(name, os.path.join(HOME, under)) +RUNTIME = f"/run/user/{os.getuid()}" +OWN = {"HOME": HOME, **({"XDG_RUNTIME_DIR": RUNTIME} if os.path.isdir(RUNTIME) else {})} if ENGINE == "podman" else {} made = set() # the staging folders of this process's units staged = {} # each unit's last staging here: a proof's oracle gets a copy of its folder def docker(*args, seconds=600, check=True, env=None): + env = {**(env or os.environ), **OWN} if OWN else env r = subprocess.run([ENGINE, *args], capture_output=True, text=True, timeout=seconds, stdin=subprocess.DEVNULL, env=env) if check and r.returncode: said = r.stderr + r.stdout From 61a1a7a047824104c2d1eb1cb0ae08f7bffc53a7 Mon Sep 17 00:00:00 2001 From: Etienne Filhol Date: Mon, 30 Nov 2026 18:53:33 +0100 Subject: [PATCH 9/9] docs(catalogue): HealthAgentBench runs on Podman too, with Docker's Compose plugin and Podman's socket --- .../catalogue/benchmarks/healthagentbench/benchmark.json | 4 ++-- docs/benchmarks/supported/healthagentbench.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/nullius/catalogue/benchmarks/healthagentbench/benchmark.json b/app/nullius/catalogue/benchmarks/healthagentbench/benchmark.json index 741f4563e..e7c46461e 100644 --- a/app/nullius/catalogue/benchmarks/healthagentbench/benchmark.json +++ b/app/nullius/catalogue/benchmarks/healthagentbench/benchmark.json @@ -29,7 +29,7 @@ "The network does not block a web search the model's provider runs: each agent needs its own switch to turn web search off, for a fair comparison." ], "limitations": [ - "Tasks need Docker with Compose on the machine. Podman and Boat cannot run them.", + "Tasks need Docker, or Podman with Docker's Compose plugin and its socket on (systemctl --user enable --now podman.socket). Boat cannot run them.", "The X-ray verifier shares this machine's network, to reach its judge through the relay.", "X-ray, CT, MRI and event modelling have not been run through Nullius." ], @@ -69,7 +69,7 @@ "The authors retired EHR format conversion as too easy, and clinical trial matching for ambiguous cases." ], "limitations": [ - "Tasks need Docker with Compose on the machine. Podman and Boat cannot run them.", + "Tasks need Docker, or Podman with Docker's Compose plugin and its socket on (systemctl --user enable --now podman.socket). Boat cannot run them.", "Upstream gives X-ray agents its credentials. Nullius does not.", "The X-ray verifier shares this machine's network, to reach its judge through the relay.", "X-ray, CT and event modelling have not been run through Nullius." diff --git a/docs/benchmarks/supported/healthagentbench.md b/docs/benchmarks/supported/healthagentbench.md index df9129689..02e38ac71 100644 --- a/docs/benchmarks/supported/healthagentbench.md +++ b/docs/benchmarks/supported/healthagentbench.md @@ -62,7 +62,7 @@ Clinical imaging, pathology and health records: read the data, submit the findin ## Nullius limitations -- Tasks need Docker with Compose on the machine. Podman and Boat cannot run them. +- Tasks need Docker, or Podman with Docker's Compose plugin and its socket on (systemctl --user enable --now podman.socket). Boat cannot run them. - The X-ray verifier shares this machine's network, to reach its judge through the relay. - X-ray, CT, MRI and event modelling have not been run through Nullius.