abhigyanpatwari/GitNexus · error · ValueError

task {task_id} oracle files must contain 1..{MAX_ORACLE_FILE

Error message

task {task_id} oracle files must contain 1..{MAX_ORACLE_FILES} entries

What it means

Raised when oracle['files'] is not a list, is empty, or contains more than MAX_ORACLE_FILES (8) entries. The harness bounds the oracle file count so capture and verification stay deterministic and fast. An oracle with zero files is meaningless; an oracle with more than eight files is considered out of spec.

Source

Thrown at eval/workflow_bench/oracle_assets.py:100

def validate_oracle_declaration(task: dict[str, Any]) -> None:
    """Validate the declarative shape without reading harness-owned files."""

    task_id = str(task.get("id", "<unknown>"))
    oracle = task.get("oracle")
    if not isinstance(oracle, dict) or set(oracle) != {"command", "files"}:
        raise ValueError(f"task {task_id} oracle requires exactly command and files")
    command = oracle.get("command")
    if (
        not isinstance(command, str)
        or not command.strip()
        or len(command.encode()) > MAX_ORACLE_COMMAND_BYTES
        or "\x00" in command
    ):
        raise ValueError(f"task {task_id} oracle command must be nonblank and bounded")
    files = oracle.get("files")
    if not isinstance(files, list) or not files or len(files) > MAX_ORACLE_FILES:
        raise ValueError(f"task {task_id} oracle files must contain 1..{MAX_ORACLE_FILES} entries")
    sources: set[str] = set()
    targets: set[str] = set()
    for index, declaration in enumerate(files):
        if not isinstance(declaration, dict) or set(declaration) != {"source", "target"}:
            raise ValueError(f"task {task_id} oracle file {index} requires exactly source and target")
        source = _bounded_relative_path(declaration.get("source"), label=f"task {task_id} oracle source")
        target = _bounded_relative_path(declaration.get("target"), label=f"task {task_id} oracle target")
        if source.as_posix() in sources:
            raise ValueError(f"task {task_id} oracle source is duplicated: {source}")
        if target.as_posix() in targets:
            raise ValueError(f"task {task_id} oracle target is duplicated: {target}")
        sources.add(source.as_posix())
        targets.add(target.as_posix())


def _real_oracle_root(root: Path) -> Path:
    lexical = root.expanduser().absolute()
    try:

View on GitHub (pinned to d540b00184)

Solutions

  1. Ensure oracle['files'] is a list with 1 to 8 dict entries, each shaped {"source": ..., "target": ...}.
  2. If you need more than 8 files, consolidate oracle data into fewer, larger files (still under per-file and total byte limits).
  3. Confirm the value is a list literal, not a single mapping.

Example fix

// before
oracle = {"command": "pytest", "files": []}
// after
oracle = {"command": "pytest", "files": [{"source": "expected.txt", "target": "expected.txt"}]}
Defensive patterns

Strategy: validation

Validate before calling

from eval.workflow_bench.oracle_assets import MAX_ORACLE_FILES, validate_oracle_declaration

def safe_files_check(task):
    files = task.get("oracle", {}).get("files")
    if not isinstance(files, list) or not files or len(files) > MAX_ORACLE_FILES:
        raise ValueError(f"files must be a list of 1..{MAX_ORACLE_FILES} entries")
    validate_oracle_declaration(task)

Type guard

def is_valid_oracle_files(files) -> bool:
    return isinstance(files, list) and 1 <= len(files) <= 8

Try / catch

try:
    validate_oracle_declaration(task)
except ValueError as exc:
    raise SystemExit(str(exc)) from exc

Prevention

When it happens

Trigger: oracle['files'] is None, a dict, or a string; an empty list []; a list with 9 or more entries.

Common situations: Dropping the files list to [] while editing; accidentally setting files to a single dict instead of a list of dicts; a task that genuinely needs many oracle files exceeding the cap of 8.

Related errors


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