{"record":{"id":"d3ef3654f5df188b","repo":"abhigyanpatwari/GitNexus","slug":"oracle-parent-is-unreadable-relative","errorCode":null,"errorMessage":"oracle parent is unreadable: {relative}","messagePattern":"oracle parent is unreadable: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"eval/workflow_bench/oracle_assets.py","lineNumber":135,"sourceCode":"    lexical = root.expanduser().absolute()\n    try:\n        metadata = lexical.lstat()\n        resolved = lexical.resolve(strict=True)\n    except OSError as exc:\n        raise ValueError(f\"oracle root is unavailable: {lexical}\") from exc\n    if stat.S_ISLNK(metadata.st_mode) or not stat.S_ISDIR(metadata.st_mode) or resolved != lexical:\n        raise ValueError(f\"oracle root must be a real non-symlink directory: {lexical}\")\n    return lexical\n\n\ndef _read_oracle_file(root: Path, relative: PurePosixPath) -> bytes:\n    current = root\n    for part in relative.parts[:-1]:\n        current /= part\n        try:\n            metadata = current.lstat()\n        except OSError as exc:\n            raise ValueError(f\"oracle parent is unreadable: {relative}\") from exc\n        if stat.S_ISLNK(metadata.st_mode) or not stat.S_ISDIR(metadata.st_mode):\n            raise ValueError(f\"oracle parents must be real directories: {relative}\")\n\n    path = root.joinpath(*relative.parts)\n    try:\n        before = path.lstat()\n        if stat.S_ISLNK(before.st_mode) or not stat.S_ISREG(before.st_mode):\n            raise ValueError(f\"oracle source must be a bounded regular non-symlink file: {relative}\")\n        descriptor = os.open(path, os.O_RDONLY | getattr(os, \"O_NOFOLLOW\", 0))\n    except ValueError:\n        raise\n    except OSError as exc:\n        raise ValueError(f\"oracle source is unreadable: {relative}\") from exc\n    try:\n        opened = os.fstat(descriptor)\n        if (\n            stat.S_ISLNK(before.st_mode)\n            or not stat.S_ISREG(before.st_mode)","sourceCodeStart":117,"sourceCodeEnd":153,"githubUrl":"https://github.com/abhigyanpatwari/GitNexus/blob/d540b00184d71a896261ee02670da9a92d59d8f7/eval/workflow_bench/oracle_assets.py#L117-L153","documentation":"Raised by _read_oracle_file when lstat() on an intermediate parent directory of an oracle source file raises OSError while walking the path components. This means a directory component of the declared source path does not exist or is inaccessible, so the harness cannot safely reach the oracle file.","triggerScenarios":"A declared oracle 'source' whose intermediate directories do not exist under the oracle root; a parent directory with permissions denying lstat; a path component that has been removed since declaration validation.","commonSituations":"Declaring source='a/b/c.txt' when 'a/b' does not exist in the oracle root; the oracle asset tree was partially deleted; permission mismatch on an intermediate directory; race where a parent dir disappears between validation and capture.","solutions":["Create the missing parent directories under the oracle root so the full source path is reachable.","Correct the declared 'source' path to match the actual location of the oracle file.","Fix directory permissions so the harness process can lstat each component."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"from pathlib import Path\n\ndef parents_exist(root: Path, relative) -> None:\n    cur = root\n    for part in Path(relative).parts[:-1]:\n        cur /= part\n        if not cur.exists():\n            raise FileNotFoundError(f\"missing oracle parent directory: {cur}\")","typeGuard":"def oracle_parents_readable(root, relative) -> bool:\n    import stat\n    cur = Path(root)\n    for part in Path(relative).parts[:-1]:\n        cur /= part\n        try:\n            md = cur.lstat()\n        except OSError:\n            return False\n        if stat.S_ISLNK(md.st_mode) or not stat.S_ISDIR(md.st_mode):\n            return False\n    return True","tryCatchPattern":"try:\n    payload = _read_oracle_file(root, relative)\nexcept ValueError as exc:\n    if \"parent is unreadable\" in str(exc):\n        raise SystemExit(f\"Oracle source path has a missing parent: {relative}\") from exc\n    raise","preventionTips":["Verify the full source path exists before capture with a pre-flight walk.","Keep the oracle asset tree under configuration management so missing dirs are caught in review."],"tags":["python","benchmark","oracle","filesystem","path-traversal"],"backgroundTag":null,"analyzedSha":"d540b00184d71a896261ee02670da9a92d59d8f7","analyzedAt":"2026-08-12T19:50:25.132Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}