{"record":{"id":"eabbde0a01a7da0c","repo":"abhigyanpatwari/GitNexus","slug":"task-file-must-contain-a-tasks-list-eabbde","errorCode":null,"errorMessage":"task file must contain a tasks list","messagePattern":"task file must contain a tasks list","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"eval/workflow_bench/runner.py","lineNumber":920,"sourceCode":"    parser.add_argument(\"--promotion-max-task-regression\", type=float, default=20.0)\n    parser.add_argument(\"--task-bindings-json\", default=None, help=argparse.SUPPRESS)\n    parser.add_argument(\"--promotion-target-bases-json\", default=None, help=argparse.SUPPRESS)\n    return parser\n\n\ndef main() -> None:\n    parser = build_parser()\n    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,","sourceCodeStart":902,"sourceCodeEnd":938,"githubUrl":"https://github.com/abhigyanpatwari/GitNexus/blob/d540b00184d71a896261ee02670da9a92d59d8f7/eval/workflow_bench/runner.py#L902-L938","documentation":"Raised in main() right after YAML-loading the --tasks file: the parsed document must be a Mapping with a top-level 'tasks' key that is a list. The harness selects runs from that list, so any other shape (a bare list, a scalar, a mapping without 'tasks', or 'tasks' that is not a list) is rejected before any task is selected. It is caught alongside YAMLError and routed through parser.error (exit 2).","triggerScenarios":"`yaml.safe_load(args.tasks.read_text())` succeeded but `not isinstance(task_document, Mapping) or not isinstance(task_document.get('tasks'), list)` — e.g. the file is a YAML list of tasks instead of an object with a tasks: key, or tasks: is a mapping/null.","commonSituations":"Author wrote a bare YAML list `- name: ...` instead of `tasks: [- name: ...]`; mis-indented so tasks became a mapping; wrong file passed to --tasks (a scenario YAML that uses a different schema); copy-paste from docs that showed a fragment without the wrapper.","solutions":["Open the --tasks file and confirm the top level is a mapping with a list-valued 'tasks' key.","Wrap a bare list: prefix the document with `tasks:` and indent the entries.","Validate locally before running: `python3 -c \"import yaml,sys; d=yaml.safe_load(open(sys.argv[1])); assert isinstance(d,dict) and isinstance(d['tasks'],list)\" your_tasks.yaml`.","If you passed the wrong file, point --tasks at the actual scenarios file."],"exampleFix":"# before — bare list at top level\n- name: task-a\n  prompt: ...\n# after — object with a tasks list\ntasks:\n  - name: task-a\n    prompt: ...","handlingStrategy":"validation","validationCode":"import yaml\n\ndoc = yaml.safe_load(open('tasks.yaml'))\nassert isinstance(doc, dict) and isinstance(doc.get('tasks'), list), (\n    'task file must be a mapping with a list-valued \"tasks\" key'\n)","typeGuard":"from collections.abc import Mapping\n\ndef is_task_document(doc: object) -> bool:\n    return isinstance(doc, Mapping) and isinstance(doc.get('tasks'), list)","tryCatchPattern":null,"preventionTips":["Always wrap task entries under a top-level `tasks:` list.","Validate the task file shape in CI before running the harness.","Keep a schema/lint for the task YAML and check it on every change."],"tags":["cli","yaml","validation","task-config"],"backgroundTag":null,"analyzedSha":"d540b00184d71a896261ee02670da9a92d59d8f7","analyzedAt":"2026-08-12T19:50:25.132Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}