abhigyanpatwari/GitNexus · critical · ValueError

committed benchmark harness is not a single bounded tree

Error message

committed benchmark harness is not a single bounded tree

What it means

Raised by sanitize_clone_for_hidden_oracles when `git ls-tree -d HEAD -- eval/workflow_bench` succeeds (ok=True) but its output is non-empty and not a single 40- or 64-char hexadecimal object id. The harness expects the committed benchmark harness to be a single, bounded tree object under that path; a malformed or multi-object response indicates the repository shape is not what the sanitizer is built to handle.

Source

Thrown at eval/workflow_bench/oracle_assets.py:295

            "-C",
            str(root),
            "ls-tree",
            "-d",
            "--format=%(objectname)",
            "HEAD",
            "--",
            HIDDEN_HARNESS_PATH.as_posix(),
        ],
        timeout=60,
        tail_bytes=1024,
    )
    if not hidden_tree_result.ok:
        raise ValueError("cannot inspect the clone for committed benchmark harness data")
    hidden_tree = hidden_tree_result.stdout_tail.strip()
    if hidden_tree and (
        len(hidden_tree) not in {40, 64} or any(character not in "0123456789abcdefABCDEF" for character in hidden_tree)
    ):
        raise ValueError("committed benchmark harness is not a single bounded tree")

    current = root.joinpath(*HIDDEN_HARNESS_PATH.parts)
    if hidden_tree:
        parent = root
        for part in HIDDEN_HARNESS_PATH.parts:
            parent /= part
            try:
                metadata = parent.lstat()
            except OSError as exc:
                raise ValueError("committed benchmark harness is missing from the clone checkout") from exc
            if stat.S_ISLNK(metadata.st_mode) or not stat.S_ISDIR(metadata.st_mode):
                raise ValueError("benchmark harness checkout must contain only real directories")
    elif current.exists() or current.is_symlink():
        raise ValueError("untracked benchmark harness data blocks oracle sanitization")

    _git_checked(
        root,
        [

View on GitHub (pinned to d540b00184)

Solutions

  1. Run the exact command manually: `git -C <clone> ls-tree -d --format=%(objectname) HEAD -- eval/workflow_bench` and inspect output — it must be empty or a single 40/64-char hex SHA.
  2. Remove any git aliases, wrappers, or pager settings that alter ls-tree output.
  3. Re-clone from source so the harness path is committed in the expected single-tree shape.
  4. If the harness path should not be in HEAD at all, ensure ls-tree returns empty (no committed harness) rather than malformed output.
Defensive patterns

Strategy: validation

Validate before calling

import re
from eval.workflow_bench.oracle_assets import run_managed

def assert_single_bounded_tree(clone) -> None:
    res = run_managed(["git", "-C", str(clone), "ls-tree", "-d", "--format=%(objectname)", "HEAD", "--", "eval/workflow_bench"], timeout=60, tail_bytes=1024)
    out = res.stdout_tail.strip()
    if out and not re.fullmatch(r"[0-9a-fA-F]{40}|[0-9a-fA-F]{64}", out):
        raise ValueError(f"unexpected ls-tree output: {out!r}")

Type guard

def harness_tree_is_bounded(clone) -> bool:
    import re
    from eval.workflow_bench.oracle_assets import run_managed
    res = run_managed(["git", "-C", str(clone), "ls-tree", "-d", "--format=%(objectname)", "HEAD", "--", "eval/workflow_bench"], timeout=60, tail_bytes=1024)
    out = res.stdout_tail.strip()
    return not out or bool(re.fullmatch(r"[0-9a-fA-F]{40}|[0-9a-fA-F]{64}", out))

Try / catch

try:
    head = sanitize_clone_for_hidden_oracles(clone)
except ValueError as exc:
    if "single bounded tree" in str(exc):
        raise SystemExit("ls-tree output malformed; remove git aliases/wrappers and re-clone") from exc
    raise

Prevention

When it happens

Trigger: ls-tree prints multiple lines (unexpected for -d on a single path), garbage/extra whitespace beyond a single SHA, an object id of unusual length, or output polluted by a git wrapper/alias.

Common situations: A custom git wrapper or alias that decorates output; a repository where eval/workflow_bench was committed in an unusual way (e.g. multiple mode entries); git version differences in ls-tree formatting; tampered git installation.

Related errors


AI-assisted analysis of abhigyanpatwari/GitNexus@d540b00184 (2026-08-12). Data as JSON: /api/errors/113bbaa99f58debd. Report an issue: GitHub.