{"record":{"id":"103e72e1b4703570","repo":"abhigyanpatwari/GitNexus","slug":"label-is-unavailable-path-exc","errorCode":null,"errorMessage":"{label} is unavailable: {path}: {exc}","messagePattern":"(.+?) is unavailable: (.+?): (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"eval/workflow_bench/evolution.py","lineNumber":69,"sourceCode":"    \"is invisible to them and systematically flatters subagent-heavy \"\n    \"candidates. Prefer cost_usd (the only CLI-reported field that includes \"\n    \"subagents), or sum usage from the digest-bound transcript_artifacts in \"\n    \"each run output, deduplicating events \"\n    \"that share one message.id.\"\n)\nEVIDENCE_MAX_AGE_DAYS = 90\nMAX_CANDIDATE_OVERLAY_BYTES = 4 * 1024 * 1024\nMAX_SKILL_FINGERPRINT_BYTES = 4 * 1024 * 1024\nMAX_CANDIDATE_ENTRIES = 256\nMAX_CANDIDATE_FILES = 64\nMAX_CANDIDATE_PATH_BYTES = 512\n\n\ndef _require_real_directory(path: Path, *, label: str) -> None:\n    try:\n        metadata = path.lstat()\n    except OSError as exc:\n        raise ValueError(f\"{label} is unavailable: {path}: {exc}\") from exc\n    if stat.S_ISLNK(metadata.st_mode) or not stat.S_ISDIR(metadata.st_mode):\n        raise ValueError(f\"{label} must be a real non-symlink directory: {path}\")\n\n\ndef _require_directory_chain(root: Path, relative: Path, *, label: str) -> None:\n    \"\"\"Validate each lexical directory without erasing links via resolve().\"\"\"\n\n    _require_real_directory(root, label=label)\n    current = root\n    for part in relative.parts:\n        if part in {\"\", \".\", \"..\"}:\n            raise ValueError(f\"{label} contains an unsafe path component: {relative}\")\n        current /= part\n        _require_real_directory(current, label=label)\n\n\ndef _bounded_regular_bytes(path: Path, *, limit: int, label: str) -> bytes:\n    \"\"\"Read one bounded regular file without following its leaf link.\"\"\"","sourceCodeStart":51,"sourceCodeEnd":87,"githubUrl":"https://github.com/abhigyanpatwari/GitNexus/blob/d540b00184d71a896261ee02670da9a92d59d8f7/eval/workflow_bench/evolution.py#L51-L87","documentation":"Thrown by _require_real_directory() in eval/workflow_bench/evolution.py when path.lstat() raises OSError: the path does not exist, is not reachable, or permission was denied. The label identifies which logical input failed (e.g. 'candidate overlay directory'). The original OSError is chained via 'from exc'.","triggerScenarios":"candidate_overlay_payload() / _require_directory_chain() walking an overlay whose root or an intermediate directory does not exist or is inaccessible. Example: passing --overlay /tmp/missing where /tmp/missing was never created; permission denied reading a parent directory.","commonSituations":"Overlay path typo; CI artifact not downloaded before the run; permissions on the runner block access; broken parent symlink resolved to a missing target; path constructed dynamically and the variable was empty.","solutions":["Verify the path exists and is readable before invoking the bench: `test -d <path>` in shell, or Path.exists() in Python.","Check the OSError detail in the message (ENOENT vs EACCES) — fix the typo or chmod/chown the directory.","Ensure the artifact/overlay is staged to that exact absolute path before the workflow_bench run.","If the path comes from a variable, assert it is non-empty and absolute before use."],"exampleFix":"# before\noverlay = Path(os.environ['OVERLAY'])   # unset -> Path('')\ncandidate_overlay_payload(overlay)\n# ValueError: candidate overlay directory is unavailable: : [Errno 2] No such file...\n\n# after\noverlay = Path(os.environ['OVERLAY'])\nassert overlay.is_dir(), f'overlay missing: {overlay}'\ncandidate_overlay_payload(overlay)","handlingStrategy":"validation","validationCode":"from pathlib import Path\ndef ensure_dir(p: Path, label: str) -> None:\n    if not p.exists():\n        raise SystemExit(f'{label} missing: {p}')\n    if not p.is_dir():\n        raise SystemExit(f'{label} is not a directory: {p}')\n# call before candidate_overlay_payload / _require_real_directory","typeGuard":"def is_unavailable_value_error(exc: ValueError) -> bool:\n    return 'is unavailable:' in str(exc)","tryCatchPattern":"try:\n    candidate_overlay_payload(overlay)\nexcept ValueError as e:\n    if is_unavailable_value_error(e):\n        logger.error('Overlay path missing/unreadable: %s', e); raise\n    raise","preventionTips":["Assert the overlay path exists and is readable before invoking the bench.","Stage the overlay to a deterministic absolute path.","Fail fast on empty path variables at config time."],"tags":["workflow-bench","validation","path","sandbox","evolution"],"backgroundTag":null,"analyzedSha":"d540b00184d71a896261ee02670da9a92d59d8f7","analyzedAt":"2026-08-12T19:50:25.132Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}