Skip to content

Coding harness discovery, previews, and wrapper examples disagree with execution #1306

Todo

Description

@vchamarthi

Summary

The coding harness guide and CLI differ on which inputs are discovered and validated, what a dry run promises, and how custom wrappers are invoked and read. Users need previews and examples they can rely on before starting a run.

Scenarios (7)

1. An empty task.md mapping falls back to task.toml beside it

dual/task.md and lone/task.md both have {} as their YAML frontmatter. dual/ also contains task.toml and instruction.md.

On 50ea6312, tasks run --dry-run exits 0, warns its frontmatter is empty, and records dual as harbor and lone as task-md.

The layout rule in docs/coding-harnesses.md lists known keys and mapping types. Document that a task.md beside task.toml also needs a nonempty mapping to take precedence.

set -e
d=$(mktemp -d)
mkdir -p "$d/tasks/dual" "$d/tasks/lone"
printf '[metadata]\ntags = ["split"]\n' > "$d/tasks/dual/task.toml"
printf 'Split prompt.\n' > "$d/tasks/dual/instruction.md"
printf '%s\n' '---' '{}' '---' 'Markdown prompt.' > "$d/tasks/dual/task.md"
cp "$d/tasks/dual/task.md" "$d/tasks/lone/task.md"
python cli.py tasks run --tasks-root "$d/tasks" --all \
  --harness command --command-template true --out-dir "$d/run" --dry-run
python -c 'import json,sys; print([(t["name"],t["format"]) for t in json.load(open(sys.argv[1]))["tasks"]])' \
  "$d/run/task_runs.json"

2. SWE-bench --tasks stages a selected row from a file with an incomplete unselected row

rows.jsonl contains the complete pytest-dev__pytest-5227 fixture row and a second row with only instance_id: example__broken-1.

On 50ea6312, --tasks pytest-dev__pytest-5227 --dry-run exits 0, prints Plan: 2 supported cells; not executed and writes swe-bench-tasks/pytest-dev__pytest-5227/tests/eval.sh. With --all, the same file exits 2 and names example__broken-1 before staging.

docs/coding-harnesses.md says the file is checked row by row before any task is written. Say that required fields are checked on the selected rows before staging.

set -e
d=$(mktemp -d)
python -c 'import json; rows=json.load(open("tests/fixtures/swebench/lite-2.json")); print(json.dumps(next(r for r in rows if r["instance_id"]=="pytest-dev__pytest-5227"))); print(json.dumps({"instance_id":"example__broken-1"}))' \
  > "$d/rows.jsonl"
python cli.py tasks run --swe-bench "$d/rows.jsonl" --tasks pytest-dev__pytest-5227 \
  --harness docker-oracle,docker-claude --out-dir "$d/named" --dry-run
ls "$d/named/swe-bench-tasks/pytest-dev__pytest-5227/tests/eval.sh"
python cli.py tasks run --swe-bench "$d/rows.jsonl" --all \
  --harness docker-oracle,docker-claude --out-dir "$d/all" --dry-run
swe-bench-tasks/pytest-dev__pytest-5227/tests/eval.sh
#!/bin/bash
set -uxo pipefail
source /opt/miniconda3/bin/activate
conda activate testbed
cd /testbed
git config --global --add safe.directory '*'
git status
git -c core.fileMode=false diff 2051e30b9b596e944524ccb787ed20f9f5be93e3
source /opt/miniconda3/bin/activate
conda activate testbed
python -m pip install -e .
git checkout 2051e30b9b596e944524ccb787ed20f9f5be93e3 testing/test_x.py
rm -f -- testing/data.json
git apply -v - <<'EOF_114329324912'
diff --git a/testing/test_x.py b/testing/test_x.py
--- a/testing/test_x.py
+++ b/testing/test_x.py
@@ -1 +1,2 @@
 def test_a(): pass
+def test_b(): assert 1
diff --git a/testing/data.json b/testing/data.json
new file mode 100644
--- /dev/null
+++ b/testing/data.json
@@ -0,0 +1 @@
+{}

EOF_114329324912
: '>>>>> Start Test Output'
pytest -rA testing/test_x.py
: '>>>>> End Test Output'
git checkout 2051e30b9b596e944524ccb787ed20f9f5be93e3 testing/test_x.py
rm -f -- testing/data.json

3. eval inspect omits an unclaimed JSON file when scanning a mixed tree

The tree contains notes.json with {"note":"draft"} and questions.json from tests/fixtures/task_formats/writers/.

On 50ea6312, inspecting notes.json directly exits 0 and reports unknown with the key note. Inspecting the tree also exits 0 and reports only questions.json as dokimi-questions.

docs/coding-harnesses.md says eval inspect reports every item under a tree and labels unclaimed paths unknown. Clarify when a tree scan skips unclaimed files.

set -e
d=$(mktemp -d)
printf '{"note":"draft"}\n' > "$d/notes.json"
cp tests/fixtures/task_formats/writers/questions.json "$d/questions.json"
for path in "$d/notes.json" "$d"; do
  python cli.py eval inspect "$path" --json |
    python -c 'import json,sys; from pathlib import Path; print([(Path(r["path"]).name,r["format"],r["details"].get("keys")) for r in json.load(sys.stdin)["data"]["items"]])'
done
questions.json
{
  "schema_version": "questions.v2",
  "questions": [
    {
      "id": "q1",
      "question": "Fill in this PDF form for me",
      "trigger_lint": {},
      "expected_skill": "pdf-forms"
    },
    {
      "id": "q2",
      "question": "Plot this CSV as a bar chart",
      "trigger_lint": {},
      "expected_skill": [
        "charts",
        "pdf-forms"
      ]
    },
    {
      "id": "q3",
      "question": "What is the capital of France?",
      "trigger_lint": {},
      "expected_skill": null
    }
  ]
}

4. The custom wrapper example splits {task_path} when the checkout path contains a space

The custom wrapper example in docs/coding-harnesses.md uses my-agent --task {task_path} --model {model} --out {output_dir}. The task is under content checkout/evaluation/harbor/tasks/onetbb-parallel-reduce and --tasks-root is quoted.

On 50ea6312, the command exits 0 and prints Plan: 1 supported cells; not executed. The recorded command splits the path after content into two arguments.

The argument immediately after --task should match the full task path in task_runs.json.

set -e
d=$(mktemp -d)
root="$d/content checkout/evaluation/harbor/tasks"
mkdir -p "$root"
cp -R tests/fixtures/task_formats/catalog/evaluation/harbor/tasks/onetbb-nstream "$root/onetbb-parallel-reduce"
python cli.py tasks run --tasks-root "$root" --all --harness command \
  --command-template 'my-agent --task {task_path} --model {model} --out {output_dir}' \
  --model my-model --out-dir "$d/run" --dry-run
python -c 'import json,sys; d=json.load(open(sys.argv[1])); print(d["tasks"][0]["path"]); print(d["results"][0]["command"])' \
  "$d/run/task_runs.json"

5. The skill arm dry run marks a SKILL.md with model: sonnet as supported

counting/SKILL.md sets model: sonnet. Run onetbb-nstream with docker-claude and docker-claude-skill, with --reps 3 and --dry-run.

On 50ea6312, the preview exits 0 and says Plan: 6 supported cells; not executed. The three skill arm rows have dry_run: true and no error.

docs/coding-harnesses.md says the skill arm refuses model: before image build. The preview should flag those three cells as unsupported.

set -e
d=$(mktemp -d)
mkdir -p "$d/counting"
printf '%s\n' '---' 'name: counting' 'description: Use when asked to count values.' \
  'model: sonnet' '---' 'Count the values.' > "$d/counting/SKILL.md"
python cli.py tasks run --tasks-root tests/fixtures/task_formats/catalog/evaluation/harbor/tasks \
  --tasks onetbb-nstream --harness "docker-claude,docker-claude-skill:$d/counting/SKILL.md" \
  --baseline-harness docker-claude --model us.anthropic.claude-haiku-4-5-20251001-v1:0 \
  --reps 3 --out-dir "$d/run" --dry-run
python -c 'import json,sys; print([r["metrics"] for r in json.load(open(sys.argv[1]))["results"] if r["harness"].startswith("docker-claude-skill:")])' \
  "$d/run/task_runs.json"

6. tasks run --dry-run counts an unexecuted pair under n_both_failed

onetbb-nstream has two planned cells, command:true as the baseline and command:false as the treatment.

On 50ea6312, --dry-run exits 0 and prints Plan: 2 supported cells; not executed. Both rewards are null. The McNemar summary has n: 1 and n_both_failed: 1.

docs/coding-harnesses.md says McNemar pairs cells that both arms scored. The preview should report zero scored pairs.

set -e
d=$(mktemp -d)
python cli.py tasks run --tasks-root tests/fixtures/task_formats/catalog/evaluation/harbor/tasks \
  --tasks onetbb-nstream --harness 'command:true,command:false' \
  --baseline-harness 'command:true' --out-dir "$d" --dry-run
python - "$d/task_runs.json" <<'PY'
import json
import sys

with open(sys.argv[1]) as f:
    data = json.load(f)
print([(r["metrics"]["dry_run"], r["reward"]) for r in data["results"]])
m = data["summary"]["comparisons"]["command:false"]["mcnemar"]
print({k: m[k] for k in ("n", "n_both_failed")})
PY

7. A wrapper’s ordinary stdout sentence containing DOKIMI_OP adds a parse error

The wrapper prints The wrapper mentions DOKIMI_OP in its usage. along with a prefixed marker and writes one record to DOKIMI_OPERATIONS_FILE.

On 50ea6312, tasks run exits 0 and reports command: 1/1 pass (100.00%), ops=5. The operations include a log_parse_error named marker.

docs/coding-harnesses.md specifies a DOKIMI_OP prefix for structured operations. The plain sentence should add no parse error, leaving four operations.

set -e
d=$(mktemp -d)
cat > "$d/wrapper.py" <<'PY'
import os
import sys
from pathlib import Path

with Path(os.environ["DOKIMI_OPERATIONS_FILE"]).open("a") as output:
    output.write('{"type":"tool","name":"edit","elapsed_sec":0.12}\n')
print('DOKIMI_OP {"type":"subagent","name":"reviewer","status":"ok"}')
print("The wrapper mentions DOKIMI_OP in its usage.")
print("The loop finished.", file=sys.stderr)
PY
python cli.py tasks run --tasks-root tests/fixtures/task_formats/catalog/evaluation/harbor/tasks \
  --all --harness command --command-template "python '$d/wrapper.py'" \
  --model my-model --out-dir "$d/run"
python -c 'import json,sys; r=json.load(open(sys.argv[1]))["results"][0]; print([(o["type"],o["name"]) for o in r["operations"]])' \
  "$d/run/task_runs.json"

Related

Activity

  1. added
    documentation
    on Nov 26, 2026
  2. self-assigned this
    on Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

documentation

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions