{"record":{"id":"e69d37633aab3572","repo":"abhigyanpatwari/GitNexus","slug":"candidate-overlay-exceeds-the-max-candidate-entri","errorCode":null,"errorMessage":"candidate overlay exceeds the {MAX_CANDIDATE_ENTRIES}-entry limit","messagePattern":"candidate overlay exceeds the (.+?)-entry limit","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"eval/workflow_bench/evolution.py","lineNumber":296,"sourceCode":"    if resolved_overlay != overlay:\n        raise ValueError(f\"candidate overlay cannot traverse symlinks: {overlay}\")\n    _require_real_directory(overlay, label=\"candidate overlay\")\n\n    entries: list[Path] = []\n    pending = [overlay]\n    entry_count = 0\n    while pending:\n        directory = pending.pop()\n        child_directories: list[Path] = []\n        try:\n            iterator = os.scandir(directory)\n        except OSError as exc:\n            raise ValueError(f\"candidate overlay directory is unreadable: {directory}: {exc}\") from exc\n        with iterator:\n            for item in iterator:\n                entry_count += 1\n                if entry_count > MAX_CANDIDATE_ENTRIES:\n                    raise ValueError(f\"candidate overlay exceeds the {MAX_CANDIDATE_ENTRIES}-entry limit\")\n                path = Path(item.path)\n                relative = path.relative_to(overlay)\n                if len(relative.as_posix().encode()) > MAX_CANDIDATE_PATH_BYTES:\n                    raise ValueError(f\"candidate overlay path exceeds {MAX_CANDIDATE_PATH_BYTES} bytes: {relative}\")\n                if item.is_symlink():\n                    raise ValueError(f\"candidate overlay cannot contain symlinks: {relative}\")\n                if item.is_dir(follow_symlinks=False):\n                    child_directories.append(path)\n                    continue\n                if not item.is_file(follow_symlinks=False):\n                    raise ValueError(f\"candidate overlay entries must be regular files: {relative}\")\n                entries.append(path)\n                if len(entries) > MAX_CANDIDATE_FILES:\n                    raise ValueError(f\"candidate overlay exceeds the {MAX_CANDIDATE_FILES}-file limit\")\n        pending.extend(child_directories)\n\n    entries.sort(key=lambda path: path.relative_to(overlay).as_posix())\n    if not entries:","sourceCodeStart":278,"sourceCodeEnd":314,"githubUrl":"https://github.com/abhigyanpatwari/GitNexus/blob/d540b00184d71a896261ee02670da9a92d59d8f7/eval/workflow_bench/evolution.py#L278-L314","documentation":"Thrown by candidate_overlay_files (evolution.py:296) when the running count of scandir entries (files plus directories) across the entire overlay tree exceeds MAX_CANDIDATE_ENTRIES (256). The count increments per item returned by scandir in any directory, so it is the total tree entry count, not just files.","triggerScenarios":"An overlay tree with more than 256 entries total — usually because unrelated directories (node_modules, .git, build artifacts, a copied repo) were included alongside the skill prompts.","commonSituations":"Copying the whole repository or a node_modules tree into the overlay by mistake; nested generated output or caches inflating entry count; a build step that emitted thousands of files under the overlay.","solutions":["Strip everything except the .claude/skills/gitnexus-{plan,work}/*.md files from the overlay.","Remove node_modules/.git/build/dist directories from the overlay.","Rebuild the overlay from scratch containing only the intended Markdown prompts."],"exampleFix":"# before: overlay contains a copied repo -> thousands of entries\n\n# after: keep only the skill markdown files\nimport shutil\nfrom pathlib import Path\nclean = Path('overlay-clean')\nclean.mkdir()\nfor p in Path('overlay').rglob('*.md'):\n    rel = p.relative_to('overlay')\n    if rel.parts[:2] == ('.claude', 'skills'):\n        dest = clean / rel\n        dest.parent.mkdir(parents=True, exist_ok=True)\n        shutil.copy2(p, dest)","handlingStrategy":"validation","validationCode":"from pathlib import Path\nfrom workflow_bench.evolution import MAX_CANDIDATE_ENTRIES\n\ndef entry_count_ok(root: Path) -> bool:\n    count = 0\n    for _ in root.rglob('*'):\n        count += 1\n        if count > MAX_CANDIDATE_ENTRIES:\n            return False\n    return True","typeGuard":"null","tryCatchPattern":"try:\n    apply_candidate_overlay(overlay, worktree, sandbox=sandbox)\nexcept ValueError as exc:\n    if 'entry limit' in str(exc):\n        # strip non-skill dirs (node_modules/.git/build), then retry\n        ...","preventionTips":["Keep the overlay to only .claude/skills/gitnexus-{plan,work}/*.md.","Never copy node_modules/.git/build output into the overlay.","Pre-count entries against MAX_CANDIDATE_ENTRIES (256)."],"tags":["size-limit","overlay","benchmark"],"backgroundTag":null,"analyzedSha":"d540b00184d71a896261ee02670da9a92d59d8f7","analyzedAt":"2026-08-12T19:50:25.132Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}