{"record":{"id":"1dfcf7686e16dba1","repo":"abhigyanpatwari/GitNexus","slug":"compound-engineering-plugin-exceeds-the-file-count","errorCode":null,"errorMessage":"Compound Engineering plugin exceeds the file-count limit","messagePattern":"Compound Engineering plugin exceeds the file-count limit","errorType":"exception","errorClass":"SandboxError","httpStatus":null,"severity":"error","filePath":"eval/workflow_bench/runtime_mounts.py","lineNumber":430,"sourceCode":"        for name in files:\n            (Path(directory) / name).chmod(0o600)\n        Path(directory).chmod(0o700)\n    shutil.rmtree(root)\n\n\ndef _build_ce_plugin_snapshot(config: CePluginConfig, destination_parent: Path) -> CePluginSnapshot:\n    parent = _validated_runtime_root(destination_parent, label=\"CE plugin snapshot parent\")\n    root = Path(tempfile.mkdtemp(prefix=\"wfbench-ce-plugin-\", dir=parent))\n    root.chmod(0o700)\n    entries: list[dict[str, Any]] = []\n    total_bytes = 0\n    try:\n        for relative, source in _plugin_files(config.source):\n            relative_text = relative.as_posix()\n            if len(relative_text.encode()) > MAX_CE_PLUGIN_PATH_BYTES:\n                raise SandboxError(f\"Compound Engineering plugin path exceeds the byte limit: {relative_text}\")\n            if len(entries) >= MAX_CE_PLUGIN_FILES:\n                raise SandboxError(\"Compound Engineering plugin exceeds the file-count limit\")\n            payload, executable = _bounded_plugin_bytes(source)\n            total_bytes += len(payload)\n            if total_bytes > MAX_CE_PLUGIN_TOTAL_BYTES:\n                raise SandboxError(\"Compound Engineering plugin exceeds the total byte limit\")\n            _write_snapshot_file(\n                root / Path(*relative.parts),\n                payload,\n                executable=executable,\n            )\n            entries.append(\n                {\n                    \"path\": relative_text,\n                    \"sha256\": hashlib.sha256(payload).hexdigest(),\n                    \"size\": len(payload),\n                    \"executable\": executable,\n                }\n            )\n","sourceCodeStart":412,"sourceCodeEnd":448,"githubUrl":"https://github.com/abhigyanpatwari/GitNexus/blob/d540b00184d71a896261ee02670da9a92d59d8f7/eval/workflow_bench/runtime_mounts.py#L412-L448","documentation":"File-count guard in _build_ce_plugin_snapshot. The plugin may contain at most MAX_CE_PLUGIN_FILES (2048) entries; once that many have been admitted, the next file triggers this error and aborts the snapshot. The bound keeps snapshot materialization and the manifest finite.","triggerScenarios":"The plugin tree under skills/scripts/assets + .claude-plugin contains more than 2048 files. Common producers: a vendored node_modules folder, a checked-in dist tree with many chunks, a corpus of fixtures, generated per-test artifacts.","commonSituations":"Shipping node_modules or a compiled output tree inside the plugin; committing a large fixture set; bundling per-language grammar files.","solutions":["Count files: 'find <plugin_dir> -type f | wc -l' and prune the largest contributors (usually node_modules or dist).","Add the plugin's own .gitignore-style exclusion so build output is not snapshotted; clean before running.","Vendor only the runtime files the skill executes, not the full dependency closure.","Split the plugin into multiple versioned releases if it legitimately needs more files."],"exampleFix":"# before\nfind ce-plugin -type f | wc -l   # 5300 (includes node_modules)\n# after\nrm -rf ce-plugin/**/node_modules\nfind ce-plugin -type f | wc -l   # 410","handlingStrategy":"validation","validationCode":"from pathlib import Path\n\nMAX_FILES = 2048\nplugin = Path(\"ce-plugin\")\ncount = sum(1 for p in plugin.rglob(\"*\") if p.is_file())\nif count > MAX_FILES:\n    raise SystemExit(f\"plugin has {count} files; limit is {MAX_FILES}\")","typeGuard":"MAX_CE_PLUGIN_FILES = 2048\n\ndef file_count_within_bound(count: int) -> bool:\n    return count <= MAX_CE_PLUGIN_FILES","tryCatchPattern":"try:\n    snapshot = _build_ce_plugin_snapshot(config, destination_parent)\nexcept SandboxError as exc:\n    if \"file-count limit\" in str(exc):\n        log.error(\"plugin has > 2048 files; prune node_modules/dist\")\n    raise","preventionTips":["Never ship node_modules or full dist trees inside the plugin.","Clean build outputs before packaging: 'rm -rf **/node_modules **/dist'.","CI gate: file count must stay under 2048."],"tags":["sandbox","ce-plugin","count-limit","validation","workflow-bench"],"backgroundTag":null,"analyzedSha":"d540b00184d71a896261ee02670da9a92d59d8f7","analyzedAt":"2026-08-12T19:50:25.132Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}