{"record":{"id":"7e1538069165dd0c","repo":"abhigyanpatwari/GitNexus","slug":"sandbox-dependencies-must-be-a-list-7e1538","errorCode":null,"errorMessage":"sandbox_dependencies must be a list","messagePattern":"sandbox_dependencies must be a list","errorType":"exception","errorClass":"SandboxError","httpStatus":null,"severity":"error","filePath":"eval/workflow_bench/task_assets.py","lineNumber":566,"sourceCode":"    for raw in declarations:\n        relative = PurePosixPath(raw)\n        if relative.is_absolute() or not relative.parts or \"..\" in relative.parts:\n            raise SandboxError(f\"sandbox_copy must be a repository-relative path: {raw!r}\")\n        _validate_manifest_path(relative)\n        paths.append(relative)\n    for index, path in enumerate(paths):\n        for other in paths[index + 1 :]:\n            if path == other or path in other.parents or other in path.parents:\n                raise SandboxError(f\"sandbox_copy declarations overlap: {path} and {other}\")\n    return declarations, tuple(paths)\n\n\ndef _sandbox_dependency_declarations(\n    task: Mapping[str, Any],\n) -> tuple[_DependencyDeclaration, ...]:\n    raw_declarations = task.get(\"sandbox_dependencies\", [])\n    if not isinstance(raw_declarations, list):\n        raise SandboxError(\"sandbox_dependencies must be a list\")\n    declarations: list[_DependencyDeclaration] = []\n    for item in raw_declarations:\n        if (\n            not isinstance(item, Mapping)\n            or set(item) != {\"source\", \"target\"}\n            or not all(isinstance(item[field], str) and item[field] for field in (\"source\", \"target\"))\n        ):\n            raise SandboxError(\"sandbox_dependencies entries require only nonblank source and target\")\n        source = str(item[\"source\"])\n        target = str(item[\"target\"])\n        source_path = PurePosixPath(source)\n        target_path = PurePosixPath(target)\n        if source_path.is_absolute() or \"..\" in source_path.parts or not source_path.parts:\n            raise SandboxError(f\"dependency source must stay inside the repository: {source_path}\")\n        if target_path.is_absolute() or \"..\" in target_path.parts or not target_path.parts:\n            raise SandboxError(f\"dependency target must stay inside the clone: {target_path}\")\n        _validate_manifest_path(source_path)\n        _validate_manifest_path(target_path)","sourceCodeStart":548,"sourceCodeEnd":584,"githubUrl":"https://github.com/abhigyanpatwari/GitNexus/blob/d540b00184d71a896261ee02670da9a92d59d8f7/eval/workflow_bench/task_assets.py#L548-L584","documentation":"Raised by _sandbox_dependency_declarations when the task's `sandbox_dependencies` field exists but is not a list. This is the top-level type gate for dependency declarations, evaluated before any per-entry validation. An absent field defaults to `[]` (accepted); a present-but-wrong-type field (string, dict, number) is rejected.","triggerScenarios":"Task JSON has `\"sandbox_dependencies\": {\"source\": \"a\", \"target\": \"b\"}` (a single dict instead of a list of dicts), or `\"sandbox_dependencies\": \"node_modules\"` (a bare string), or any non-list scalar. The check is `if not isinstance(raw_declarations, list)`.","commonSituations":"Author writes a single dependency as a dict instead of wrapping it in a list. Schema drift from a tool that emits a single object for a one-element array. Copy-paste from a config format that allows a bare value.","solutions":["Wrap dependency declarations in a list, even for a single entry: `[{\"source\": \"...\", \"target\": \"...\"}]`.","Omit the field entirely if there are no dependencies — both absent and `[]` are valid.","Validate the task schema before prepare() (see validationCode).","If templating, ensure the template always emits an array even for one element."],"exampleFix":"// before\n{\"sandbox_dependencies\": {\"source\": \"node_modules\", \"target\": \"node_modules\"}}\n\n// after\n{\"sandbox_dependencies\": [{\"source\": \"node_modules\", \"target\": \"node_modules\"}]}","handlingStrategy":"type-guard","validationCode":"def validate_sandbox_dependencies_list(task: dict) -> None:\n    raw = task.get(\"sandbox_dependencies\", [])\n    if not isinstance(raw, list):\n        raise ValueError(\"sandbox_dependencies must be a list\")\n\nvalidate_sandbox_dependencies_list(task)","typeGuard":"from typing import Any\n\ndef is_sandbox_dependencies_list(value: Any) -> bool:\n    return value is None or isinstance(value, list) or value == []","tryCatchPattern":"from eval.workflow_bench.propposer_sandbox import SandboxError\n\ntry:\n    snapshot = cache.prepare(task, repo=repo, resolved_sha=sha)\nexcept SandboxError as exc:\n    if \"sandbox_dependencies must be a list\" in str(exc):\n        # wrap the value in a list, or omit the field\n        raise\n    raise","preventionTips":["Always author sandbox_dependencies as a list, even for a single dependency.","Omit the field when there are no dependencies.","Validate the task schema before prepare."],"tags":["sandbox","config","validation","dependencies","schema","task-declaration"],"backgroundTag":null,"analyzedSha":"d540b00184d71a896261ee02670da9a92d59d8f7","analyzedAt":"2026-08-12T19:50:25.132Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}