{"record":{"id":"ac8aa3bf979eeca0","repo":"abhigyanpatwari/GitNexus","slug":"sandbox-copy-exceeds-the-entry-limit","errorCode":null,"errorMessage":"sandbox_copy exceeds the entry limit","messagePattern":"sandbox_copy exceeds the entry limit","errorType":"exception","errorClass":"SandboxError","httpStatus":null,"severity":"error","filePath":"eval/workflow_bench/task_assets.py","lineNumber":523,"sourceCode":"        for part in relative.parts:\n            current /= part\n            existing = self.entries.get(current)\n            if existing is not None:\n                if existing.kind != \"directory\":\n                    raise SandboxError(f\"sandbox_copy paths collide at {current}\")\n                continue\n            self._record(AssetManifestEntry(path=current, kind=\"directory\"))\n            (self.destination / Path(*current.parts)).mkdir(mode=0o700, exist_ok=True)\n\n    def _record(self, entry: AssetManifestEntry) -> None:\n        _validate_manifest_path(entry.path)\n        existing = self.entries.get(entry.path)\n        if existing is not None:\n            if existing != entry:\n                raise SandboxError(f\"sandbox_copy paths collide at {entry.path}\")\n            return\n        if self.budget.entries >= MAX_TASK_ASSET_ENTRIES:\n            raise SandboxError(\"sandbox_copy exceeds the entry limit\")\n        self.entries[entry.path] = entry\n        self.budget.entries += 1\n\n    def ensure_directory(self, relative: PurePosixPath) -> None:\n        \"\"\"Record and create one extra directory inside this snapshot.\n\n        Used for harness-owned mount points that must exist in the captured\n        bytes rather than be created against a read-only bind at runtime.\n        \"\"\"\n\n        self._record_directory(relative)\n\n    def finished_entries(self) -> tuple[AssetManifestEntry, ...]:\n        return tuple(sorted(self.entries.values(), key=lambda entry: entry.path.as_posix()))\n\n\ndef _sandbox_copy_declarations(\n    task: Mapping[str, Any],","sourceCodeStart":505,"sourceCodeEnd":541,"githubUrl":"https://github.com/abhigyanpatwari/GitNexus/blob/d540b00184d71a896261ee02670da9a92d59d8f7/eval/workflow_bench/task_assets.py#L505-L541","documentation":"Raised by _SnapshotBuilder._record when the shared budget's entry count has reached MAX_TASK_ASSET_ENTRIES (100,000) and a new unique manifest entry would be added. This is a containment limit preventing a declaration from turning snapshot preparation into an unbounded walk over a pathological tree (e.g. a huge generated directory or a misdeclared vendor root). It counts distinct recorded paths, including auto-created parent directories.","triggerScenarios":"A declared sandbox_copy or sandbox_dependency source tree contains more than 100,000 distinct files plus directories. Common with a full `node_modules` of a large monorepo, a vendored dataset of many small files, or an accidentally-declared repo root that includes `.git/objects`.","commonSituations":"Declaring the entire repo root as sandbox_copy. Declaring a node_modules containing hundreds of packages with thousands of transitive files. A generated test corpus (property-based test outputs, fuzzing seeds) exceeding the entry ceiling.","solutions":["Narrow the declaration to the specific files or subdirectories needed: avoid declaring repo roots or whole node_modules trees.","Count entries first: `find <declared-root> -mindepth 1 | wc -l` — if it exceeds ~95k, trim.","Move large generated trees out of the captured snapshot and regenerate them inside the arm clone.","For dependencies, prefer read-only binds of curated node_modules rather than copying sprawling vendor trees."],"exampleFix":"// before — declaring an entire repo root\n{\"sandbox_copy\": [\".\"]}\n\n// after — declare only what the task reads\n{\"sandbox_copy\": [\"src\", \"tests\", \"package.json\"]}","handlingStrategy":"validation","validationCode":"from pathlib import Path\nimport os\n\nMAX_ENTRIES = 100_000\n\ndef count_declared_entries(repo: Path, declarations: list[str]) -> int:\n    n = 0\n    for raw in declarations:\n        root = repo / raw\n        for current, dirs, files in os.walk(root, followlinks=False):\n            n += len(dirs) + len(files)\n            if n > MAX_ENTRIES:\n                return n\n    return n\n\ncount = count_declared_entries(repo_path, task[\"sandbox_copy\"])\nif count > MAX_ENTRIES:\n    raise ValueError(f\"sandbox_copy declares {count} entries, limit is {MAX_ENTRIES}\")","typeGuard":null,"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 \"exceeds the entry limit\" in str(exc):\n        # narrow declarations to the specific subtree needed\n        raise\n    raise","preventionTips":["Count entries with `find <declared-root> -mindepth 1 | wc -l` before capture.","Never declare a whole repo root or sprawling node_modules as sandbox_copy.","Prefer read-only sandbox_dependencies for large vendored trees."],"tags":["sandbox","limits","entries","budget","validation"],"backgroundTag":null,"analyzedSha":"d540b00184d71a896261ee02670da9a92d59d8f7","analyzedAt":"2026-08-12T19:50:25.132Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}