{"record":{"id":"ccc958744eb15660","repo":"abhigyanpatwari/GitNexus","slug":"candidate-overlay-exceeds-the-max-candidate-files","errorCode":null,"errorMessage":"candidate overlay exceeds the {MAX_CANDIDATE_FILES}-file limit","messagePattern":"candidate overlay exceeds the (.+?)-file limit","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"eval/workflow_bench/evolution.py","lineNumber":310,"sourceCode":"        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:\n        raise ValueError(f\"candidate overlay contains no files: {overlay}\")\n\n    for path in entries:\n        relative = path.relative_to(overlay)\n        parts = relative.parts\n        if (\n            len(parts) < 4\n            or parts[:2] != (\".claude\", \"skills\")\n            or parts[2] not in CANDIDATE_SKILLS\n            or path.suffix.lower() != \".md\"\n        ):\n            raise ValueError(\n                \"candidate overlays may only contain Markdown files under \"\n                \".claude/skills/gitnexus-{plan,work}: \"","sourceCodeStart":292,"sourceCodeEnd":328,"githubUrl":"https://github.com/abhigyanpatwari/GitNexus/blob/d540b00184d71a896261ee02670da9a92d59d8f7/eval/workflow_bench/evolution.py#L292-L328","documentation":"Thrown by candidate_overlay_files (evolution.py:310) when the count of collected regular files exceeds MAX_CANDIDATE_FILES (64). This is the file-count cap, separate from the 256-entry cap (which also counts directories). The check runs after each file is appended to the entries list.","triggerScenarios":"More than 64 regular files anywhere in the overlay tree. Typically caused by including non-skill files, generated fragments, or many small prompt shards.","commonSituations":"Copying extra docs, examples, or generated snippets into the overlay; splitting a single skill into dozens of tiny includes; accidentally bundling unrelated skill sets.","solutions":["Reduce the overlay to only the necessary .claude/skills/gitnexus-{plan,work}/*.md files.","Consolidate many small Markdown fragments into fewer files.","Count files up front: assert len(candidate_overlay_files(overlay)) <= 64 before the real run."],"exampleFix":"# before: 90 markdown files in the overlay -> exceeds 64-file limit\n\n# after: consolidate to <=64 real skill files\nfrom pathlib import Path\nfiles = [p for p in Path('overlay').rglob('*.md')]\nassert len(files) <= 64, f'{len(files)} files, cap is 64'","handlingStrategy":"validation","validationCode":"from pathlib import Path\nfrom workflow_bench.evolution import MAX_CANDIDATE_FILES\n\ndef file_count_ok(root: Path) -> bool:\n    return sum(1 for p in Path(root).rglob('*') if p.is_file()) <= MAX_CANDIDATE_FILES","typeGuard":"null","tryCatchPattern":"try:\n    apply_candidate_overlay(overlay, worktree, sandbox=sandbox)\nexcept ValueError as exc:\n    if 'file limit' in str(exc):\n        # remove non-skill files, then retry\n        ...","preventionTips":["Limit the overlay to necessary skill .md files.","Consolidate small fragments into fewer files.","Pre-count files against MAX_CANDIDATE_FILES (64)."],"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"}