{"record":{"id":"351aaa1cb34f8f95","repo":"abhigyanpatwari/GitNexus","slug":"sandbox-dependencies-must-be-a-list","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/sanitized_graph.py","lineNumber":96,"sourceCode":"        return False\n    return (\n        relative.parts[0] == \".gitnexus\" or relative == HIDDEN_HARNESS_PATH or HIDDEN_HARNESS_PATH in relative.parents\n    )\n\n\ndef validate_no_prebuilt_graph_assets(task: Mapping[str, Any]) -> None:\n    \"\"\"Reject declarations that could reintroduce an unsanitized graph/oracle.\"\"\"\n\n    sandbox_copy = task.get(\"sandbox_copy\", [])\n    if not isinstance(sandbox_copy, list):\n        raise SandboxError(\"sandbox_copy must be a list\")\n    for value in sandbox_copy:\n        if isinstance(value, str) and _is_restricted_path(value):\n            raise SandboxError(f\"sandbox_copy cannot import prebuilt graph or harness data: {value}\")\n\n    dependencies = task.get(\"sandbox_dependencies\", [])\n    if not isinstance(dependencies, list):\n        raise SandboxError(\"sandbox_dependencies must be a list\")\n    for item in dependencies:\n        if not isinstance(item, Mapping):\n            continue\n        for field in (\"source\", \"target\"):\n            value = item.get(field)\n            if isinstance(value, str) and _is_restricted_path(value):\n                raise SandboxError(f\"sandbox dependency cannot expose prebuilt graph or harness data: {value}\")\n\n\ndef _replace_control_file(root: Path, name: str, payload: bytes) -> None:\n    path = root / name\n    try:\n        metadata = path.lstat()\n    except FileNotFoundError:\n        metadata = None\n    if metadata is not None:\n        if stat.S_ISDIR(metadata.st_mode):\n            raise SandboxError(f\"target-controlled {name} must not be a directory\")","sourceCodeStart":78,"sourceCodeEnd":114,"githubUrl":"https://github.com/abhigyanpatwari/GitNexus/blob/d540b00184d71a896261ee02670da9a92d59d8f7/eval/workflow_bench/sanitized_graph.py#L78-L114","documentation":"Type guard in validate_no_prebuilt_graph_assets, symmetric to error 553. The task spec's 'sandbox_dependencies' field must be a list; non-list values are rejected before any per-item source/target scan. Omitting the field defaults to an empty list and is allowed.","triggerScenarios":"sandbox_dependencies is declared as a single mapping or a scalar rather than a sequence of dependency mappings. Each entry is later expected to be a Mapping with 'source' and 'target' fields.","commonSituations":"Author wrote a single dependency as a bare mapping instead of a one-element list; YAML indentation collapsed a list into a mapping; schema drift after a task-format revision.","solutions":["Wrap the dependency in a list: 'sandbox_dependencies: [{source: a, target: b}]' or use a YAML block sequence.","Validate locally: assert isinstance(spec.get('sandbox_dependencies', []), list) before submitting the task.","Check each entry is a Mapping with source/target if you want to fail fast before the harness does.","Consult the task schema for the canonical dependency entry shape."],"exampleFix":"# before\nsandbox_dependencies: {source: vendor/lib, target: lib}\n# after\nsandbox_dependencies:\n  - source: vendor/lib\n    target: lib","handlingStrategy":"type-guard","validationCode":"import yaml\nfrom pathlib import Path\n\ntask = yaml.safe_load(Path(\"task.yaml\").read_text())\nif \"sandbox_dependencies\" in task and not isinstance(task[\"sandbox_dependencies\"], list):\n    raise SystemExit(\n        f\"sandbox_dependencies must be a list, got {type(task['sandbox_dependencies']).__name__}\"\n    )","typeGuard":"from collections.abc import Mapping\n\ndef sandbox_dependencies_well_formed(task: Mapping) -> bool:\n    sd = task.get(\"sandbox_dependencies\", [])\n    return isinstance(sd, list) and all(isinstance(i, Mapping) for i in sd)","tryCatchPattern":"try:\n    validate_no_prebuilt_graph_assets(task)\nexcept SandboxError as exc:\n    if \"sandbox_dependencies must be a list\" in str(exc):\n        log.error(\"task.sandbox_dependencies must be a YAML/JSON list of mappings\")\n    raise","preventionTips":["Declare sandbox_dependencies as a sequence, even for one dependency.","Lint task specs with a schema requiring sandbox_dependencies to be an array of objects.","Run validate_no_prebuilt_graph_assets on every task before submission."],"tags":["sandbox","task-spec","validation","type-error","workflow-bench"],"backgroundTag":null,"analyzedSha":"d540b00184d71a896261ee02670da9a92d59d8f7","analyzedAt":"2026-08-12T19:50:25.132Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}