{"record":{"id":"b98b7bbf9832901b","repo":"abhigyanpatwari/GitNexus","slug":"task-task-id-oracle-command-must-be-nonblank-and","errorCode":null,"errorMessage":"task {task_id} oracle command must be nonblank and bounded","messagePattern":"task (.+?) oracle command must be nonblank and bounded","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"eval/workflow_bench/oracle_assets.py","lineNumber":97,"sourceCode":"        raise ValueError(f\"{label} cannot target git metadata: {value!r}\")\n    return relative\n\n\ndef validate_oracle_declaration(task: dict[str, Any]) -> None:\n    \"\"\"Validate the declarative shape without reading harness-owned files.\"\"\"\n\n    task_id = str(task.get(\"id\", \"<unknown>\"))\n    oracle = task.get(\"oracle\")\n    if not isinstance(oracle, dict) or set(oracle) != {\"command\", \"files\"}:\n        raise ValueError(f\"task {task_id} oracle requires exactly command and files\")\n    command = oracle.get(\"command\")\n    if (\n        not isinstance(command, str)\n        or not command.strip()\n        or len(command.encode()) > MAX_ORACLE_COMMAND_BYTES\n        or \"\\x00\" in command\n    ):\n        raise ValueError(f\"task {task_id} oracle command must be nonblank and bounded\")\n    files = oracle.get(\"files\")\n    if not isinstance(files, list) or not files or len(files) > MAX_ORACLE_FILES:\n        raise ValueError(f\"task {task_id} oracle files must contain 1..{MAX_ORACLE_FILES} entries\")\n    sources: set[str] = set()\n    targets: set[str] = set()\n    for index, declaration in enumerate(files):\n        if not isinstance(declaration, dict) or set(declaration) != {\"source\", \"target\"}:\n            raise ValueError(f\"task {task_id} oracle file {index} requires exactly source and target\")\n        source = _bounded_relative_path(declaration.get(\"source\"), label=f\"task {task_id} oracle source\")\n        target = _bounded_relative_path(declaration.get(\"target\"), label=f\"task {task_id} oracle target\")\n        if source.as_posix() in sources:\n            raise ValueError(f\"task {task_id} oracle source is duplicated: {source}\")\n        if target.as_posix() in targets:\n            raise ValueError(f\"task {task_id} oracle target is duplicated: {target}\")\n        sources.add(source.as_posix())\n        targets.add(target.as_posix())\n\n","sourceCodeStart":79,"sourceCodeEnd":115,"githubUrl":"https://github.com/abhigyanpatwari/GitNexus/blob/d540b00184d71a896261ee02670da9a92d59d8f7/eval/workflow_bench/oracle_assets.py#L79-L115","documentation":"Raised when the oracle 'command' string fails one of four bounds: it must be a non-empty str, non-blank after strip(), its UTF-8 encoding must be ≤ MAX_ORACLE_COMMAND_BYTES (8192 bytes), and it must not contain a NUL byte (\\x00). These bounds keep the command deterministic, portable, and free of injection-prone control characters. The check runs after the key-set check in validate_oracle_declaration.","triggerScenarios":"oracle[\"command\"] is None or a non-string; an empty string or whitespace-only string; a command longer than 8 KiB once UTF-8 encoded; a command containing an embedded NUL byte.","commonSituations":"Leaving command as an empty placeholder while drafting a task; pasting a huge multi-line shell script into command instead of a short invocation; a command string that accidentally includes a literal \\x00 from binary copy-paste; using a non-string type (e.g. a list of argv tokens) instead of a single shell string.","solutions":["Provide a short, non-empty command string like \"pytest -q\".","If the command is large, move the logic into a script file referenced by the command instead of inlining it.","Ensure command is a str, not a list — this field is a single shell command line.","Strip any embedded NUL or control bytes from the value before assignment."],"exampleFix":"// before\noracle = {\"command\": \"\", \"files\": [...]}\n// after\noracle = {\"command\": \"pytest -q tests/test_oracle.py\", \"files\": [...]}","handlingStrategy":"validation","validationCode":"from eval.workflow_bench.oracle_assets import MAX_ORACLE_COMMAND_BYTES\n\ndef valid_command(cmd):\n    return (\n        isinstance(cmd, str)\n        and cmd.strip()\n        and \"\\x00\" not in cmd\n        and len(cmd.encode()) <= MAX_ORACLE_COMMAND_BYTES\n    )","typeGuard":"def is_valid_oracle_command(cmd) -> bool:\n    return isinstance(cmd, str) and bool(cmd.strip()) and \"\\x00\" not in cmd and len(cmd.encode()) <= 8192","tryCatchPattern":"try:\n    validate_oracle_declaration(task)\nexcept ValueError as exc:\n    print(f\"Fix the oracle command for task {task.get('id')}: {exc}\")","preventionTips":["Keep oracle commands short and shell-like; externalize large scripts into a source file.","Validate command length and content in your task-authoring tooling.","Never embed NUL or binary data in the command string."],"tags":["python","benchmark","validation","oracle","input-bounds"],"backgroundTag":null,"analyzedSha":"d540b00184d71a896261ee02670da9a92d59d8f7","analyzedAt":"2026-08-12T19:50:25.132Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}