{"record":{"id":"357f3d8b5b3eae8e","repo":"abhigyanpatwari/GitNexus","slug":"pinned-gitnexus-runtime-component-must-be-a-real","errorCode":null,"errorMessage":"pinned GitNexus runtime component must be a real {kind}: {source}","messagePattern":"pinned GitNexus runtime component must be a real (.+?): (.+?)","errorType":"exception","errorClass":"SandboxError","httpStatus":null,"severity":"error","filePath":"eval/workflow_bench/runtime_mounts.py","lineNumber":168,"sourceCode":"def _validated_runtime_component(\n    root: Path,\n    relative: str,\n    target: str,\n    *,\n    directory: bool,\n) -> ReadOnlyMount:\n    \"\"\"Validate one direct runtime component before exposing only that path.\"\"\"\n\n    source = root / relative\n    try:\n        mode = source.lstat().st_mode\n        resolved = source.resolve(strict=True)\n    except OSError as exc:\n        raise SandboxError(f\"pinned GitNexus runtime component is unavailable: {source}: {exc}\") from exc\n    expected_type = stat.S_ISDIR(mode) if directory else stat.S_ISREG(mode)\n    if stat.S_ISLNK(mode) or not expected_type or resolved != source:\n        kind = \"directory\" if directory else \"file\"\n        raise SandboxError(f\"pinned GitNexus runtime component must be a real {kind}: {source}\")\n    return ReadOnlyMount(source=source, target=target)\n\n\ndef trusted_gitnexus_runtime_mounts() -> tuple[ReadOnlyMount, ...]:\n    \"\"\"Expose only the files needed by the pinned CLI and linked shared package.\"\"\"\n\n    runtime = _validated_runtime_root(\n        HARNESS_ROOT / \"gitnexus\",\n        label=\"pinned GitNexus runtime\",\n    )\n    shared = _validated_runtime_root(\n        HARNESS_ROOT / \"gitnexus-shared\",\n        label=\"pinned GitNexus shared runtime\",\n    )\n    mounts = (\n        _validated_runtime_component(\n            runtime,\n            \"dist\",","sourceCodeStart":150,"sourceCodeEnd":186,"githubUrl":"https://github.com/abhigyanpatwari/GitNexus/blob/d540b00184d71a896261ee02670da9a92d59d8f7/eval/workflow_bench/runtime_mounts.py#L150-L186","documentation":"Raised by _validated_runtime_component (runtime_mounts.py:165-168) when the component exists but is the wrong type or is a symlink: it is a symlink (S_ISLNK), its type does not match the expected kind (directory vs file), or resolve(strict=True) differs from source (a symlink hop in the path). The kind in the message is 'directory' or 'file' per the call site.","triggerScenarios":"dist is a symlink to a build cache; node_modules is a symlinked global store; package.json is a symlink; a file path points at a directory or vice-versa; a component path includes a symlinked parent.","commonSituations":"pnpm/npm global link setups that symlink node_modules; monorepo workspaces surfacing symlinks; a directory replaced by a file or vice-versa after a partial build.","solutions":["Replace the symlinked component with the real artifact (copy the directory/file into place).","Run `realpath <source>` and ensure it equals the source path with no hop.","For node_modules, use a real local install rather than a symlinked global store.","Confirm the component kind matches expectation (dir vs file) at each call site."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"import stat\nfrom pathlib import Path\nsource = Path(root) / relative\nmode = source.lstat().st_mode\nkind_ok = stat.S_ISDIR(mode) if expect_dir else stat.S_ISREG(mode)\nif stat.S_ISLNK(mode) or not kind_ok or source.resolve(strict=True) != source:\n    raise SystemExit(f\"component must be a real {'directory' if expect_dir else 'file'}: {source}\")","typeGuard":"import stat\nfrom pathlib import Path\ndef component_is_real(root: str, relative: str, *, directory: bool) -> bool:\n    source = Path(root) / relative\n    try:\n        mode = source.lstat().st_mode\n        kind_ok = stat.S_ISDIR(mode) if directory else stat.S_ISREG(mode)\n        return not stat.S_ISLNK(mode) and kind_ok and source.resolve(strict=True) == source\n    except OSError:\n        return False","tryCatchPattern":null,"preventionTips":["Use a real local node_modules, not a symlinked global store.","Build dist/ in place; do not symlink it from a cache.","Run `realpath` on each component to confirm no symlink hop before benchmarking."],"tags":["workflow-bench","sandbox","filesystem","symlink","security","build"],"backgroundTag":null,"analyzedSha":"d540b00184d71a896261ee02670da9a92d59d8f7","analyzedAt":"2026-08-12T19:50:25.132Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}