{"record":{"id":"6789301ac028c523","repo":"abhigyanpatwari/GitNexus","slug":"sandbox-dependency-targets-overlap-declaration-t","errorCode":null,"errorMessage":"sandbox dependency targets overlap: {declaration.target} and {other.target}","messagePattern":"sandbox dependency targets overlap: (.+?) and (.+?)","errorType":"exception","errorClass":"SandboxError","httpStatus":null,"severity":"error","filePath":"eval/workflow_bench/task_assets.py","lineNumber":600,"sourceCode":"            raise SandboxError(f\"dependency target must stay inside the clone: {target_path}\")\n        _validate_manifest_path(source_path)\n        _validate_manifest_path(target_path)\n        declarations.append(\n            _DependencyDeclaration(\n                source=source,\n                target=target,\n                source_path=source_path,\n                target_path=target_path,\n            )\n        )\n    for index, declaration in enumerate(declarations):\n        for other in declarations[index + 1 :]:\n            if (\n                declaration.target_path == other.target_path\n                or declaration.target_path in other.target_path.parents\n                or other.target_path in declaration.target_path.parents\n            ):\n                raise SandboxError(f\"sandbox dependency targets overlap: {declaration.target} and {other.target}\")\n    return tuple(declarations)\n\n\ndef _open_relative(repo_descriptor: int, relative: PurePosixPath) -> int:\n    current = os.dup(repo_descriptor)\n    try:\n        for index, part in enumerate(relative.parts):\n            last = index == len(relative.parts) - 1\n            child = _open_child(current, part, PurePosixPath(*relative.parts[: index + 1]), require_directory=not last)\n            os.close(current)\n            current = child\n        return current\n    except BaseException:\n        os.close(current)\n        raise\n\n\ndef _open_child(","sourceCodeStart":582,"sourceCodeEnd":618,"githubUrl":"https://github.com/abhigyanpatwari/GitNexus/blob/d540b00184d71a896261ee02670da9a92d59d8f7/eval/workflow_bench/task_assets.py#L582-L618","documentation":"Raised by _sandbox_dependency_declarations during a pairwise comparison of all dependency declarations: if any two share the same target, or one target is an ancestor of the other, the targets overlap and are rejected. Two dependencies mounting at overlapping clone paths would contest ownership of the mount point, so the harness requires disjoint targets. Only targets are checked — sources may overlap because the same source can back distinct mount points.","triggerScenarios":"Two dependencies with the same target (`node_modules` twice), or targets where one is a parent of the other (`node_modules` and `node_modules/foo`). The check is on target_path equality or ancestry in either direction.","commonSituations":"Merging dependency lists from multiple tasks without de-duplicating targets. Mounting two different sources at the same target by mistake. Mounting a parent and a child path (e.g. `node_modules` and `node_modules/.vite-temp`) when only the parent is needed.","solutions":["Ensure each dependency has a unique, non-overlapping target path; merge sources that map to the same target.","If a parent target covers a child, declare only the parent.","Sort and review targets: `sorted(d['target'] for d in deps)` and check for nesting.","Validate with the provided overlap guard before prepare() (see validationCode)."],"exampleFix":"// before\n{\"sandbox_dependencies\": [\n  {\"source\": \"a/node_modules\", \"target\": \"node_modules\"},\n  {\"source\": \"b/node_modules\", \"target\": \"node_modules\"}\n]}\n\n// after — merge into one source\n{\"sandbox_dependencies\": [\n  {\"source\": \"node_modules\", \"target\": \"node_modules\"}\n]}","handlingStrategy":"validation","validationCode":"from pathlib import PurePosixPath\n\ndef validate_no_target_overlap(task: dict) -> None:\n    targets = [PurePosixPath(d[\"target\"]) for d in task.get(\"sandbox_dependencies\", [])]\n    for i, a in enumerate(targets):\n        for b in targets[i+1:]:\n            if a == b or a in b.parents or b in a.parents:\n                raise ValueError(f\"dependency targets overlap: {a} and {b}\")\n\nvalidate_no_target_overlap(task)","typeGuard":"from pathlib import PurePosixPath\n\ndef dependency_targets_are_disjoint(deps: list[dict]) -> bool:\n    ts = [PurePosixPath(d[\"target\"]) for d in deps]\n    for i, a in enumerate(ts):\n        for b in ts[i+1:]:\n            if a == b or a in b.parents or b in a.parents:\n                return False\n    return True","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 \"dependency targets overlap\" in str(exc):\n        # merge sources mapping to the same target, or drop nested targets\n        raise\n    raise","preventionTips":["Ensure each dependency target is unique and not a parent/child of another.","When merging dependency lists, de-duplicate targets.","Sort and review targets before running the benchmark."],"tags":["sandbox","config","validation","overlap","dependencies","task-declaration"],"backgroundTag":null,"analyzedSha":"d540b00184d71a896261ee02670da9a92d59d8f7","analyzedAt":"2026-08-12T19:50:25.132Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}