{"record":{"id":"3148c8a8e7df0c49","repo":"abhigyanpatwari/GitNexus","slug":"task-index-requires-a-nonblank-string-field","errorCode":null,"errorMessage":"task {index} requires a nonblank string {field}","messagePattern":"task (.+?) requires a nonblank string (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"eval/workflow_bench/runner_tasks.py","lineNumber":39,"sourceCode":"        raise ValueError(f\"{flag} must not use a mutable auto/latest model alias: {model!r}\")\n    return model\n\n\ndef select_tasks(tasks: list[Any], *, include_expensive: bool) -> tuple[list[dict[str, Any]], list[str]]:\n    \"\"\"Validate task metadata and filter opt-in expensive scenarios.\"\"\"\n\n    selected: list[dict[str, Any]] = []\n    skipped: list[str] = []\n    seen: set[str] = set()\n    required_strings = (\"id\", \"class\", \"repo\", \"prompt\", \"verify\")\n    optional_strings = (\"ref\", \"setup\")\n    for index, raw_task in enumerate(tasks):\n        if not isinstance(raw_task, Mapping):\n            raise ValueError(f\"task {index} must be a mapping\")\n        task = dict(raw_task)\n        for field in required_strings:\n            if not isinstance(task.get(field), str) or not task[field].strip():\n                raise ValueError(f\"task {index} requires a nonblank string {field}\")\n        for field in optional_strings:\n            if field in task and not isinstance(task[field], str):\n                raise ValueError(f\"task {task['id']} field {field} must be a string\")\n        task_id = task[\"id\"]\n        if not re.fullmatch(r\"[A-Za-z0-9][A-Za-z0-9._-]{0,127}\", task_id):\n            raise ValueError(f\"task id must be a simple artifact-safe slug: {task_id!r}\")\n        if task_id in seen:\n            raise ValueError(f\"duplicate task id: {task_id}\")\n        seen.add(task_id)\n        expensive = task.get(\"expensive\", False)\n        if not isinstance(expensive, bool):\n            raise ValueError(f\"task {task_id} expensive metadata must be boolean\")\n        copies = task.get(\"sandbox_copy\", [])\n        if not isinstance(copies, list) or not all(isinstance(path, str) and path for path in copies):\n            raise ValueError(f\"task {task_id} sandbox_copy must be a string list\")\n        dependencies = task.get(\"sandbox_dependencies\", [])\n        if not isinstance(dependencies, list):\n            raise ValueError(f\"task {task_id} sandbox_dependencies must be a list\")","sourceCodeStart":21,"sourceCodeEnd":57,"githubUrl":"https://github.com/abhigyanpatwari/GitNexus/blob/d540b00184d71a896261ee02670da9a92d59d8f7/eval/workflow_bench/runner_tasks.py#L21-L57","documentation":"Raised by select_tasks while validating each entry of the YAML task list. The harness requires five nonblank string fields per task — id, class, repo, prompt, verify (see required_strings at runner_tasks.py:31). This error fires when any of those is missing, is not a str instance, or strips to empty. The runner converts it into a CLI exit via parser.error (runner.py:942).","triggerScenarios":"A task mapping omits one of the required keys, supplies None / a number / a list, or uses a whitespace-only value. YAML nulls (bare key with no value), unquoted numbers for class, or an empty prompt/verify string all trip it.","commonSituations":"Editing the tasks YAML and forgetting the verify key; setting prompt to a YAML anchor that resolves to empty; quoting id but leaving prompt blank; converting a hand-written task list and dropping a field.","solutions":["Open the tasks file named in the error and jump to task index {index}; ensure the named {field} is present as a nonempty quoted string.","Run `yq '.tasks[].{field}' tasks.yaml` (or a quick python yaml.safe_load) to find null/blank entries.","Re-run with the corrected YAML."],"exampleFix":"# before\n- id: refactor-cli\n  class: ts\n  repo: /repos/gitnexus\n  prompt: \"\"\n  verify: \"true\"\n# after\n- id: refactor-cli\n  class: ts\n  repo: /repos/gitnexus\n  prompt: \"Refactor the CLI entrypoint\"\n  verify: \"true\"","handlingStrategy":"validation","validationCode":"import yaml\nREQUIRED = (\"id\", \"class\", \"repo\", \"prompt\", \"verify\")\ndoc = yaml.safe_load(open(\"tasks.yaml\"))\nfor i, t in enumerate(doc.get(\"tasks\", [])):\n    for f in REQUIRED:\n        v = t.get(f)\n        if not isinstance(v, str) or not v.strip():\n            raise SystemExit(f\"task {i} requires a nonblank string {f}\")","typeGuard":"def has_required_strings(task: object) -> bool:\n    if not isinstance(task, dict):\n        return False\n    return all(\n        isinstance(task.get(f), str) and task.get(f).strip()\n        for f in (\"id\", \"class\", \"repo\", \"prompt\", \"verify\")\n    )","tryCatchPattern":null,"preventionTips":["Lint the tasks YAML in CI with a schema check before invoking the runner.","Use a YAML schema/validator (e.g. jsonschema) for the task list.","Treat the canonical task_row fixture in tests/test_workflow_bench.py as the template."],"tags":["workflow-bench","task-validation","yaml"],"backgroundTag":null,"analyzedSha":"d540b00184d71a896261ee02670da9a92d59d8f7","analyzedAt":"2026-08-12T19:50:25.132Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}