{"record":{"id":"fd20396d5084538d","repo":"abhigyanpatwari/GitNexus","slug":"task-bindings-json-must-contain-a-list","errorCode":null,"errorMessage":"--task-bindings-json must contain a list","messagePattern":"--task-bindings-json must contain a list","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"eval/workflow_bench/runner.py","lineNumber":928,"sourceCode":"    args = parser.parse_args()\n    try:\n        args.model = normalized_model_identifier(args.model)\n        args.proposer_model = (\n            normalized_model_identifier(args.proposer_model, flag=\"--proposer-model\")\n            if args.proposer_model is not None\n            else None\n        )\n        task_document = yaml.safe_load(args.tasks.read_text())\n        if not isinstance(task_document, Mapping) or not isinstance(task_document.get(\"tasks\"), list):\n            raise ValueError(\"task file must contain a tasks list\")\n        tasks, skipped_expensive = select_tasks(\n            task_document[\"tasks\"],\n            include_expensive=args.include_expensive,\n        )\n        oracle_snapshots = capture_task_oracles(tasks)\n        expected_task_bindings = json.loads(args.task_bindings_json) if args.task_bindings_json else None\n        if expected_task_bindings is not None and not isinstance(expected_task_bindings, list):\n            raise ValueError(\"--task-bindings-json must contain a list\")\n        supplied_promotion_target_bases = (\n            json.loads(args.promotion_target_bases_json) if args.promotion_target_bases_json else {}\n        )\n        if not isinstance(supplied_promotion_target_bases, dict) or not all(\n            isinstance(path, str) and isinstance(digest, str)\n            for path, digest in supplied_promotion_target_bases.items()\n        ):\n            raise ValueError(\"--promotion-target-bases-json must contain a string mapping\")\n        ce_plugin_config = validate_ce_plugin_inputs(\n            args.arms,\n            args.ce_plugin_dir,\n            args.ce_plugin_version,\n        )\n    except (OSError, SandboxError, ValueError, yaml.YAMLError) as exc:\n        parser.error(str(exc))\n        raise AssertionError(\"ArgumentParser.error() returned unexpectedly\")\n\n    candidate_arms = [arm for arm in args.arms if arm in CANDIDATE_ARMS]","sourceCodeStart":910,"sourceCodeEnd":946,"githubUrl":"https://github.com/abhigyanpatwari/GitNexus/blob/d540b00184d71a896261ee02670da9a92d59d8f7/eval/workflow_bench/runner.py#L910-L946","documentation":"Raised in main() when --task-bindings-json is supplied but json.loads does not yield a list. The flag carries an ordered list of expected task bindings that the harness verifies, so any other JSON type (object, string, number, bool, null) is rejected. It is caught with the other input-validation errors and reported via parser.error (exit 2).","triggerScenarios":"args.task_bindings_json is non-empty, json.loads succeeds, but the result is not a list — e.g. the flag was given a JSON object `{...}` or a bare scalar string.","commonSituations":"Confusing --task-bindings-json (a list) with --promotion-target-bases-json (an object); pasting a single binding object instead of a one-element array; emitting from a script whose serializer defaulted to an object/dict.","solutions":["Re-emit the value as a JSON array, e.g. `[ {\"task\": \"t-a\", \"binding\": \"...\"} ]`.","Validate before passing: `python3 -c \"import json,sys; assert isinstance(json.load(open(sys.argv[1])), list)\" bindings.json`.","Double-check the flag name in the docs — task-bindings is a list, promotion-target-bases is a string map.","If empty/unneeded, omit the flag entirely (None is allowed)."],"exampleFix":"# before — object passed where a list is required\n--task-bindings-json '{\"task-a\": \"sha1:abc\"}'\n# after — a JSON list\n--task-bindings-json '[{\"task\":\"task-a\",\"binding\":\"sha1:abc\"}]'","handlingStrategy":"validation","validationCode":"import json\n\nv = json.loads(args.task_bindings_json) if args.task_bindings_json else None\nassert v is None or isinstance(v, list), '--task-bindings-json must contain a list'","typeGuard":"def is_bindings_list(raw: str | None) -> bool:\n    if raw is None:\n        return True\n    try:\n        return isinstance(json.loads(raw), list)\n    except json.JSONDecodeError:\n        return False","tryCatchPattern":null,"preventionTips":["Emit --task-bindings-json as a JSON array from the producing script.","Do not confuse it with the object-shaped --promotion-target-bases-json.","Omit the flag when unused (None is allowed)."],"tags":["cli","json","validation","task-config"],"backgroundTag":null,"analyzedSha":"d540b00184d71a896261ee02670da9a92d59d8f7","analyzedAt":"2026-08-12T19:50:25.132Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}