{"record":{"id":"86beee81d4d73523","repo":"abhigyanpatwari/GitNexus","slug":"duplicate-task-id-task-id","errorCode":null,"errorMessage":"duplicate task id: {task_id}","messagePattern":"duplicate task id: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"eval/workflow_bench/runner_tasks.py","lineNumber":47,"sourceCode":"    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\")\n        for dependency in dependencies:\n            if (\n                not isinstance(dependency, Mapping)\n                or set(dependency) != {\"source\", \"target\"}\n                or not all(isinstance(dependency[field], str) and dependency[field] for field in (\"source\", \"target\"))\n            ):\n                raise ValueError(\n                    f\"task {task_id} sandbox_dependencies entries require nonblank source and target strings\"","sourceCodeStart":29,"sourceCodeEnd":65,"githubUrl":"https://github.com/abhigyanpatwari/GitNexus/blob/d540b00184d71a896261ee02670da9a92d59d8f7/eval/workflow_bench/runner_tasks.py#L29-L65","documentation":"Raised by select_tasks when a task id has already been added to the `seen` set during the same pass (runner_tasks.py:46-47). Ids must be unique because they key the bindings JSONL, the results aggregation, and the per-task output paths.","triggerScenarios":"Two task mappings share the same id string; copy-pasting a task block and forgetting to rename the id.","commonSituations":"Duplicating a task to vary only the prompt/ref but leaving the id; merging two YAML task files that both define `baseline`.","solutions":["Search the tasks file for the duplicated id and give each occurrence a distinct slug.","Use `yq '.tasks[].id' tasks.yaml | sort | uniq -d` to list all duplicate ids at once.","Re-run after renaming."],"exampleFix":"# before\n- id: baseline\n  prompt: A\n- id: baseline\n  prompt: B\n# after\n- id: baseline-a\n  prompt: A\n- id: baseline-b\n  prompt: B","handlingStrategy":"validation","validationCode":"ids = [t.get(\"id\") for t in doc.get(\"tasks\", [])]\ndups = {i for i in ids if ids.count(i) > 1}\nif dups:\n    raise SystemExit(f\"duplicate task ids: {sorted(dups)}\")","typeGuard":"def ids_are_unique(tasks: list[dict]) -> bool:\n    ids = [t.get(\"id\") for t in tasks]\n    return len(ids) == len(set(ids))","tryCatchPattern":null,"preventionTips":["Run `yq '.tasks[].id' tasks.yaml | sort | uniq -d` before committing.","Generate ids from a single source of truth to avoid collisions when merging task files."],"tags":["workflow-bench","task-validation","uniqueness"],"backgroundTag":null,"analyzedSha":"d540b00184d71a896261ee02670da9a92d59d8f7","analyzedAt":"2026-08-12T19:50:25.132Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}