{"record":{"id":"7cbca85e84a22c47","repo":"abhigyanpatwari/GitNexus","slug":"candidate-overlay-is-not-a-directory-overlay","errorCode":null,"errorMessage":"candidate overlay is not a directory: {overlay}","messagePattern":"candidate overlay is not a directory: (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"eval/workflow_bench/evolution.py","lineNumber":277,"sourceCode":"        command,\n        timeout=60,\n        env=build_sandbox_environment(),\n    )\n    return command, result\n\n\ndef candidate_overlay_files(overlay: Path) -> list[Path]:\n    \"\"\"Return a candidate's files after enforcing the benchmark trust boundary.\n\n    Candidates may change only the canonical repo-local skill prompts. They\n    cannot modify task code, tests, or verification commands and thereby game\n    the promotion gate.\n    \"\"\"\n    overlay = overlay.expanduser().absolute()\n    try:\n        resolved_overlay = overlay.resolve(strict=True)\n    except OSError as exc:\n        raise ValueError(f\"candidate overlay is not a directory: {overlay}\") from exc\n    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:","sourceCodeStart":259,"sourceCodeEnd":295,"githubUrl":"https://github.com/abhigyanpatwari/GitNexus/blob/d540b00184d71a896261ee02670da9a92d59d8f7/eval/workflow_bench/evolution.py#L259-L295","documentation":"Thrown by candidate_overlay_files (evolution.py:277) when overlay.resolve(strict=True) raises OSError. strict=True fails if the path or any component does not exist (or is a broken symlink). Despite the 'is not a directory' wording, this fires for any resolve failure — the overlay path is missing or unreachable.","triggerScenarios":"The overlay path does not exist; a parent component is a broken symlink; the path points to a regular file rather than a directory; permission denied traversing to it.","commonSituations":"Typo or stale relative path passed as the overlay; CI deleted/moved the overlay artifact before the harness read it; pointing at a path inside an unmounted volume.","solutions":["Verify the overlay directory exists and is reachable: assert overlay.exists() and overlay.is_dir() before calling.","Pass an absolute path; re-check for typos and that the artifact was produced.","Ensure the parent volume/mount is present."],"exampleFix":"# before: path typo or missing artifact\napply_candidate_overlay(Path('overlays/candiate'), ...)  # typo\n\n# after: validate existence first\noverlay = Path('overlays/candidate').resolve()\nassert overlay.exists() and overlay.is_dir(), f'overlay missing: {overlay}'\napply_candidate_overlay(overlay, ...)","handlingStrategy":"validation","validationCode":"from pathlib import Path\n\ndef overlay_exists_and_is_dir(p: Path) -> bool:\n    return p.exists() and p.is_dir() and not p.is_symlink()","typeGuard":"from pathlib import Path\n\ndef is_real_directory(p: Path) -> bool:\n    return p.exists() and p.is_dir() and not p.is_symlink()","tryCatchPattern":"try:\n    apply_candidate_overlay(overlay, worktree, sandbox=sandbox)\nexcept ValueError as exc:\n    if 'is not a directory' in str(exc):\n        # verify the path exists; fix typo or regenerate the artifact\n        ...","preventionTips":["Assert overlay.exists() and overlay.is_dir() before calling.","Pass absolute paths to avoid cwd-relative surprises.","Confirm upstream artifact production actually wrote the directory."],"tags":["filesystem","overlay","config","empty-state"],"backgroundTag":null,"analyzedSha":"d540b00184d71a896261ee02670da9a92d59d8f7","analyzedAt":"2026-08-12T19:50:25.132Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}