{"record":{"id":"0aee67f5e783eb4e","repo":"abhigyanpatwari/GitNexus","slug":"task-task-id-expensive-metadata-must-be-boolean","errorCode":null,"errorMessage":"task {task_id} expensive metadata must be boolean","messagePattern":"task (.+?) expensive metadata must be boolean","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"eval/workflow_bench/runner_tasks.py","lineNumber":51,"sourceCode":"    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\"\n                )\n        validate_oracle_declaration(task)\n        if expensive and not include_expensive:\n            skipped.append(task_id)","sourceCodeStart":33,"sourceCodeEnd":69,"githubUrl":"https://github.com/abhigyanpatwari/GitNexus/blob/d540b00184d71a896261ee02670da9a92d59d8f7/eval/workflow_bench/runner_tasks.py#L33-L69","documentation":"Raised by select_tasks when the optional `expensive` metadata flag is present but is not a Python bool (runner_tasks.py:50-51). Expensive tasks are opt-in (filtered unless --include-expensive), so the type must be strictly boolean — truthy ints/strings are rejected to avoid silent opt-in.","triggerScenarios":"Setting `expensive: true` (correct) vs `expensive: \"true\"`, `expensive: 1`, `expensive: yes`-coerced-to-non-bool, or `expensive: null`. YAML parses bare `true`/`false` to bool, but quoted strings or ints slip through as non-bool.","commonSituations":"Quoting `expensive: \"true\"`; using 1/0 from a generator; a templating system emitting a string.","solutions":["Set expensive as a bare YAML boolean: `expensive: true` or `expensive: false`.","If the task is not expensive, remove the key (it defaults to False).","Check your task generator emits bool, not stringified bool."],"exampleFix":"# before\n- id: t1\n  expensive: \"true\"\n# after\n- id: t1\n  expensive: true","handlingStrategy":"type-guard","validationCode":"for i, t in enumerate(doc.get(\"tasks\", [])):\n    if \"expensive\" in t and not isinstance(t[\"expensive\"], bool):\n        raise SystemExit(f\"task {i} expensive must be boolean\")","typeGuard":"def expensive_is_bool(task: dict) -> bool:\n    return \"expensive\" not in task or isinstance(task[\"expensive\"], bool)","tryCatchPattern":null,"preventionTips":["Use bare YAML booleans (true/false), never quoted.","Audit task generators to emit bool, not stringified truthiness."],"tags":["workflow-bench","task-validation","yaml","types"],"backgroundTag":null,"analyzedSha":"d540b00184d71a896261ee02670da9a92d59d8f7","analyzedAt":"2026-08-12T19:50:25.132Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}