Skip to content

The first exam for code agents in the physical world: frozen robot tasks from many benchmark suites, each answered with a program and verified in a separate sandbox. Runs on Harbor.

Merge pull request #30 from JamesKrW/dev/pingyue-shared-checks

Pingyue Zhang0d6bb66bec6d
diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS
index dcee5d6964..5549460b11 100644
--- a/.github/CODEOWNERS
+++ b/.github/CODEOWNERS
@@ -3,6 +3,7 @@
/docs/LIMITED_MODE_PROTOCOL.md @JamesKrW @williamzhangNU @QinengWang-Aiden @changhechen @CHIGUI0
/docs/TAXONOMY.md @JamesKrW @williamzhangNU @QinengWang-Aiden @changhechen @CHIGUI0
/docs/REVIEWING.md @JamesKrW @williamzhangNU @QinengWang-Aiden @changhechen @CHIGUI0
+/docs/LEAKAGE.md @JamesKrW @williamzhangNU @QinengWang-Aiden @changhechen @CHIGUI0
/ci_checks/ @JamesKrW @williamzhangNU @QinengWang-Aiden @changhechen @CHIGUI0
/.github/ @JamesKrW @williamzhangNU @QinengWang-Aiden @changhechen @CHIGUI0
/scripts/build_images.sh @JamesKrW @williamzhangNU @QinengWang-Aiden @changhechen @CHIGUI0
diff --git a/.github/workflows/static-checks.yml b/.github/workflows/static-checks.yml
index 8d77fdc6c2..2a8edce08b 100644
--- a/.github/workflows/static-checks.yml
+++ b/.github/workflows/static-checks.yml
@@ -19,7 +19,3 @@ jobs:
run: bash ci_checks/run_all.sh
- name: Task conventions (README, task.toml, test.sh are what scripts/task_conventions.py writes)
run: python3 scripts/task_conventions.py --check tasks/*/
- - name: KinDER and HumanoidBench task dirs are what their generators render
- run: |
- python3 scripts/kinder/gen_tasks.py check
- python3 scripts/humanoidbench/gen_tasks.py check
diff --git a/README.md b/README.md
index 4e431c296d..7e41bd9af1 100644
--- a/README.md
+++ b/README.md
@@ -115,7 +115,8 @@ scripts/ task generators, image build/push, egress switch, results
ci_checks/ contract checks run on every pull request (ci_checks/run_all.sh)
docs/ PROTOCOL.md (contract), LIMITED_MODE_PROTOCOL.md (standard-mode wire protocol),
TAXONOMY.md (metadata vocabulary), REVIEWING.md (maintainer guide),
- RUNNING.md (batches, logs, recordings), benchmarks/ (per-benchmark notes)
+ RUNNING.md (batches, logs, recordings), LEAKAGE.md (where answer keys survive),
+ benchmarks/ (per-benchmark notes)
third_party/ upstream sources used by the base images (cap-x, RoboTwin)
```
diff --git a/ci_checks/check-generated-tasks.sh b/ci_checks/check-generated-tasks.sh
new file mode 100755
index 0000000000..5809bf6650
--- /dev/null
+++ b/ci_checks/check-generated-tasks.sh
@@ -0,0 +1,18 @@
+#!/usr/bin/env bash
+# Generated task dirs are what their generator writes from today's sources (PROTOCOL §2.1): runs the check mode of
+# every generator that has one (no simulator needed), which compares tasks/ with a fresh render. Whether it also flags
+# a task dir the generator no longer writes is up to the generator. Generators without a check mode
+# (scripts/robotwin_mk_*.py, dtb_mk_task.py, mj_mk_limited.py, robopaint_brush_mk_task.py) are re-run by hand.
+# Usage: check-generated-tasks.sh (repo-level; run_all.sh calls it once)
+set -uo pipefail
+root="$(cd "$(dirname "$0")/.." && pwd)"; rc=0
+for gen in "kinder/gen_tasks.py check" "humanoidbench/gen_tasks.py check" "behavior/mk_tasks.py --check" \
+ "robolab/mk_tasks.py --check" "robowits/mk_tasks.py --check"; do
+ read -r script mode <<<"$gen"
+ if out=$(python3 "$root/scripts/$script" "$mode" 2>&1); then
+ echo "ok scripts/$script: ${out##*$'\n'}"
+ else
+ echo "FAIL scripts/$gen:"; echo "$out" | tail -n 40; rc=1
+ fi
+done
+exit $rc
diff --git a/ci_checks/check-instance-copies.sh b/ci_checks/check-instance-copies.sh
new file mode 100755
index 0000000000..cc838b0fbc
--- /dev/null
+++ b/ci_checks/check-instance-copies.sh
@@ -0,0 +1,20 @@
+#!/usr/bin/env bash
+# One frozen instance per task pair (PROTOCOL §2.2: a standard task shares its privileged twin's frozen instance; §3:
+# the privileged instance is copied into environment/ and tests/). The verifier's copy, the privileged task's
+# tests/instance.{json,npz}, and the copy the task runs from (privileged: environment/; standard: the sim sidecar's
+# environment/sim/) are byte-identical, and neither exists without the other. RoboPaint's privileged environment/ copy
+# is reduced by design (check-robopaint-leak.sh), so its scorer sidecar's environment/scorer/ copy is compared instead.
+# Usage: check-instance-copies.sh tasks/<task-dir>
+set -uo pipefail
+t="${1%/}"; n="$(basename "$t")"; rc=0
+case "$n" in
+ *-standard) ref="${n%-standard}-privileged/tests"; copy="environment/sim" ;;
+ robopaint-*) ref="$n/tests"; copy="environment/scorer" ;;
+ *) ref="$n/tests"; copy="environment" ;;
+esac
+for f in instance.json instance.npz; do
+ a="$(dirname "$t")/$ref/$f"; b="$t/$copy/$f"
+ [ -f "$a" ] || [ -f "$b" ] || continue
+ cmp -s "$a" "$b" 2>/dev/null || { echo "FAIL $t: $copy/$f and $ref/$f differ, or one is missing"; rc=1; }
+done
+exit $rc
diff --git a/ci_checks/check-standard-agent-image.sh b/ci_checks/check-standard-agent-image.sh
new file mode 100755
index 0000000000..060865dce6
--- /dev/null
+++ b/ci_checks/check-standard-agent-image.sh
@@ -0,0 +1,29 @@
+#!/usr/bin/env bash
+# Standard mode (PROTOCOL §4.1: no simulator or simulation code in the agent container): the agent's image is built
+# from environment/, but never takes environment/sim/, which compose mounts into the sim sidecar only (and which may
+# hold the scoring code). Every COPY / ADD source of environment/Dockerfile is therefore a named path outside sim/:
+# not `.` or `..`, not a wildcard. Sources from another stage or image (--from) and ADD URLs are not from environment/.
+# Usage: check-standard-agent-image.sh tasks/<task-dir>
+set -uo pipefail
+t="${1%/}"
+case "$(basename "$t")" in *-standard) ;; *) exit 0 ;; esac
+python3 - "$t" <<'PY'
+import json, pathlib, posixpath, re, sys
+t = pathlib.Path(sys.argv[1]); rc = 0
+lines = [ln for ln in (t / "environment/Dockerfile").read_text().splitlines() if not ln.lstrip().startswith("#")]
+text = re.sub(r"\\[ \t]*\n", " ", "\n".join(lines)) # join continued lines (comment lines are not part of them)
+for line in text.splitlines():
+ m = re.match(r"\s*(COPY|ADD)\s+((?:--\S+\s+)*)(.*)", line, re.I)
+ if not m or "--from" in m.group(2):
+ continue
+ body = m.group(3).strip()
+ srcs = (json.loads(body) if body.startswith("[") else body.split())[:-1]
+ for src in srcs:
+ if "://" in src:
+ continue # ADD <url>
+ p = posixpath.normpath("/" + src).lstrip("/") # inside the context: ".", "..", "x/.." are its root
+ if not p or any(c in p for c in "*?[") or p.split("/")[0] == "sim":
+ print(f"FAIL {t}: environment/Dockerfile: {m.group(1)} {src}: name files outside sim/ only")
+ rc = 1
+sys.exit(rc)
+PY
diff --git a/ci_checks/run_all.sh b/ci_checks/run_all.sh
index c9303f9421..3212cafba5 100755
--- a/ci_checks/run_all.sh
+++ b/ci_checks/run_all.sh
@@ -5,13 +5,15 @@ root="$(cd "$(dirname "$0")/.." && pwd)"; rc=0
tasks=("$@"); [ ${#tasks[@]} -eq 0 ] && tasks=("$root"/tasks/*/)
for t in "${tasks[@]}"; do
t="${t%/}"; [ -f "$t/task.toml" ] || continue
- for c in check-task-structure check-task-fields check-dockerfile check-instruction check-verifier-isolation; do
+ for c in check-task-structure check-task-fields check-dockerfile check-instruction check-verifier-isolation \
+ check-instance-copies check-standard-agent-image; do
bash "$root/ci_checks/$c.sh" "$t" || rc=1
done
bash "$root/ci_checks/check-robopaint-leak.sh" "$t" || rc=1 # RoboPaint tasks only (the script skips others)
bash "$root/ci_checks/check-limited-texts.sh" "$t" || rc=1 # D7, declared by BEHAVIOR, RoboLab, RoboWits, RoboPaint: no world coordinates
done
bash "$root/ci_checks/check-dataset-manifest.sh" || rc=1
+bash "$root/ci_checks/check-generated-tasks.sh" || rc=1 # generators with a check mode: tasks/ is what they write
bash "$root/ci_checks/check-robopaint-tooling.sh" || rc=1 # RoboPaint: tooling byte-identical within a family / stack
bash "$root/ci_checks/check-tooling-identity.sh" || rc=1 # D9 shared sources; the eai-standard/2.2 layer = scripts/eai_standard/
bash "$root/ci_checks/check-standard-client.sh" || rc=1 # standard agent + verifier images: the pinned client base and pins
diff --git a/docs/LEAKAGE.md b/docs/LEAKAGE.md
new file mode 100644
index 0000000000..8bba2c6f18
--- /dev/null
+++ b/docs/LEAKAGE.md
@@ -0,0 +1,109 @@
+# Answer-key leakage
+
+Tasks are built from public research repositories, and those usually ship the thing that grades the task:
+a reward function, a success predicate, a trained policy, a demonstration set.
+
+> **Removing an answer key from what we ship is not the same as the agent being unable to get it.**
+> The first is a set we control. The second is everything the container can reach.
+
+## 1. Where it survives
+
+| Place | Why it is still readable | Check |
+|---|---|---|
+| Dead code | unreachable ≠ unreadable | scan the whole package, not the import graph |
+| Constants the grader read | a constant whose only reader was the grader still describes it; so does a comment on one that stays (`# Horizontal speeds above which move reward is 1.`) | no module-level name may be write-only afterwards; no comment may mention the reward |
+| Attributes set at construction | weights in `__init__` are not "functions with a matching name", and a snapshot of the object keeps them: HumanoidBench push's frozen instance carried its reward weights until 2026-09-29 | enumerate instance attributes at runtime; leave them out of anything saved from one |
+| Class attributes | a class body's `_move_speed = _WALK_SPEED` keeps the module constant alive once `get_reward`, its only reader, is gone: HumanoidBench's `_WALK_SPEED = 1` and `_RUN_SPEED = 5` (the move term's bound and margin for walk, stair, hurdle) are still in the 0.1.6 image | **open**: extend the scrub's dead-name rule to class bodies, restore the attributes in `rcb_rewards`, and build a new image |
+| Helpers the grader called | not named like the grader, so the name match keeps them: HumanoidBench maze's `update_move_direction` returned the checkpoint bonus, truck's `upon_table` held the table test (both until the 0.1.6 image) | list what every removed method calls; delete what nothing else calls, keep only the effect of what the tooling still calls |
+| Compiled bytecode | `*.pyc` built before the removal keeps the old code | clear caches *before* removing, assert after |
+| Earlier Docker layers | a layer is an immutable tarball; a later `rm` does not unwrite it | download and remove in the **same `RUN`**; verify with `docker save` |
+| `.git` | `git show` reconstructs every file ever committed | delete it in that same `RUN` |
+| The network | upstream is public and pinned, one `curl` away | `[agent] network_mode = "allowlist"` of the model-API hosts (`scripts/set_agent_egress.py`): DexToolBench, KinDER, HumanoidBench and RoboPaint set it; the other benchmarks are public by default and switched per run (PROTOCOL §2.7) |
+| The model API | the harness's web search runs on the provider, reached through an allowed model-API host: Codex's `web_search` and Claude Code's `WebSearch` | **open** outside two Codex configs: `web_search: disabled` in `scripts/{kinder,humanoidbench}/configs/codex-openrouter.yaml` (Harbor 0.23.0 passes `-c web_search=disabled`; audit below). `scripts/run_agent_batch.sh` sets it only through `AK`; nothing on `main` turns Claude Code's `WebSearch` off (`--ak disallowed_tools=WebSearch` would) |
+| The model-API key | Harbor's native agents put it in the agent's container. Codex: `OPENAI_API_KEY` in its environment and in `/tmp/codex-secrets/auth.json` (linked from `$CODEX_HOME/auth.json`), removed only after the run; Claude Code: `ANTHROPIC_API_KEY` (or its OAuth token) in its environment. With the model API allowed, the agent can spend it on any model, a search-enabled one included, which undoes the row above | **open**: the one fix measured so far, a model gateway beside the harness that holds the key, is ruled out by D11. Meanwhile one key per batch with a spending cap (`docs/RUNNING.md`), and read the transcript for direct API calls |
+| The model's memory | the benchmark's source is public, so it is in pretraining data: Opus 5.5 recalled H1's 19 actuator ranges exactly and the sit reward's seat-height band, with no tool | nothing in the harness removes it; report it with the result |
+| Package metadata | `*.egg-info/SOURCES.txt` lists files you deleted | generate metadata after the removal |
+| Sibling tasks | one task's `tests/` must not carry another's answer | ship one task's answer per task |
+
+Layers and `.git` are invisible from inside the container — overlayfs shows the agent only the merged
+view. They leak to whoever pulls the image, which for a public benchmark is the same people.
+
+**Read the agent's transcript.** Two of these rows came from watching one go looking: `grep -rn` over the
+package, `cat` on the likely file, then `import dis, marshal` against the bytecode caches.
+
+**Audit a harness** by pointing it at a local fake API and reading the tools of its first request (Codex 0.159
+sends them in an `additional_tools` input item, not in `tools`). 2026-10-01, Codex 0.159.2 with the configs'
+OpenRouter provider: the tool set follows the model. `gpt-5` and `gpt-5.5` get a `web_search` tool by default and
+with `cached` or `live`, none with `disabled`; `gpt-6-luna` gets none in any mode. Where the key goes: Harbor 0.23.0,
+`agents/installed/codex.py` (`run()`) and `claude_code.py` (`_resolve_auth_env()`).
+
+## 2. Deciding what to remove
+
+A name match (`*reward*`, `*success*`, `*solve*`) **proposes candidates**; it never decides. Deleting on a
+name alone removes things the environment needs and keeps everything named something else. Settle each
+candidate with a rule a script can evaluate, so the removal rediscovers itself on every build instead of
+following a hand-written list that rots.
+
+**A. Falls through to a safe base.** Delete an override when the language guarantees a harmless
+replacement — removing a subclass method when the base returns a neutral value. Correctness comes from the
+language, not our judgement, so over-matching is cheap. Assert it: the package must still import and run,
+and the same actions must give the same observations and terminations as with the grader restored — upstream
+sometimes advances task state inside it (HumanoidBench: a stirring target's phase, the current checkpoint).
+
+**B. Dead *because of* the removal.** Delete a definition when **both** hold: something we removed read it,
+**and** nothing that remains reads it. Without the first you delete upstream's own unused code and
+anything reached in a way your analysis does not model; without the second you keep constants that exist
+only to parameterise the grader. Search the whole package — another module may import the name.
+
+**C. Kept only by a surviving reader.** When one container mixes grading data with operational data — a
+dict of weights that also holds a control flag — keep exactly the entries surviving code still reads.
+
+Two properties make it auditable:
+
+- **Idempotence.** Running the removal again must be a no-op, which turns "did we miss anything?" into a
+ build-time assertion that also fixes the problem if it fires.
+- **One source of truth.** Whatever the image loses, the verifier needs back. Derive that list by running
+ the real removal against a copy and diffing — never by re-deriving the rule in a second script.
+
+**Third-party dependencies are out of reach, and that is usually fine.** A grader copied from a library
+leaves the library's version installed — `dm_control/suite/` carries the very pattern HumanoidBench's
+rewards were written from. Removing it raises the bar but cannot close the channel, because the pattern is
+public and in the model's training data. Judge by what leaks: a *convention* is acceptable, a *parameter*
+is not.
+
+**What stays:** termination conditions (one rollout reveals them — that is dynamics), observations, the
+pass mark, the scene layout, and constants surviving code reads. These *describe* the task; the grader
+*scores* it. When in doubt: would the task statement name it anyway?
+
+## 3. Giving it back to the verifier
+
+The verifier runs in a container of its own, built from `tests/` (`[verifier] environment_mode = "separate"`):
+the agent's container, where it was root, is gone by then, and only the declared deliverable crosses over. In
+standard mode the `sim` sidecar scores the episode, from `environment/sim/`, which the agent's image never copies.
+
+| Stage | What it does |
+|---|---|
+| build | remove, then assert nothing survived and the package still runs |
+| once, offline | lift what was removed into a committed data file, by diffing against a real removal |
+| render | copy **one task's** entry into that task's `tests/` (standard: `environment/sim/`) |
+| verify | restore, then assert the restore worked — a failed restore is a grader error, never a 0 |
+| CI | the scoring side has it, the agent's side does not, `instruction.md` quotes no parameters, `[agent]` is on an allowlist |
+
+Restore code against the **defining module's own namespace** so it closes over what it did upstream. Agent
+tooling should report that scoring is unavailable rather than return a zero.
+
+*Worked example:* HumanoidBench's grader is a dense reward — `images/humanoidbench/scrub_oracles.py`
+(remove), `scripts/humanoidbench/extract_rewards.py` (diff), `scripts/humanoidbench/shared/rcb_rewards.py` (restore),
+`scripts/humanoidbench/gen_tasks.py check` (enforce; CI runs it through `ci_checks/check-generated-tasks.sh`). For
+every standard task, `ci_checks/check-standard-agent-image.sh` keeps `environment/sim/` out of the agent's image.
+
+## 4. The task statement is then the only account
+
+- **Say** which quantities are judged and how they combine, the order of magnitude of a target, what ends
+ the episode.
+- **Do not say** tolerance parameters, exact weights, the reward's per-step scale, or what any particular
+ policy scores. What the pass mark *requires* is fine.
+
+The test: *an engineer reading only this should be able to build a reasonable objective and optimise it,
+and should not be able to skip the robot and solve for the number.* If a task proves unsolvable because
+the statement is too vague, fix the statement — do not give the grader back.