{"record":{"id":"d4557c0db188e1f3","repo":"abhigyanpatwari/GitNexus","slug":"pinned-gitnexus-runtime-has-an-unexpected-gitnexus","errorCode":null,"errorMessage":"pinned GitNexus runtime has an unexpected gitnexus-shared dependency","messagePattern":"pinned GitNexus runtime has an unexpected gitnexus-shared dependency","errorType":"exception","errorClass":"SandboxError","httpStatus":null,"severity":"error","filePath":"eval/workflow_bench/runtime_mounts.py","lineNumber":244,"sourceCode":"    )\n\n    entrypoint = mounts[0].source / \"cli\" / \"index.js\"\n    try:\n        entrypoint_mode = entrypoint.lstat().st_mode\n        package = json.loads(mounts[1].source.read_text())\n    except (OSError, json.JSONDecodeError) as exc:\n        raise SandboxError(f\"pinned GitNexus runtime metadata is invalid: {exc}\") from exc\n    if stat.S_ISLNK(entrypoint_mode) or not stat.S_ISREG(entrypoint_mode):\n        raise SandboxError(f\"pinned GitNexus runtime entrypoint must be regular and non-symlink: {entrypoint}\")\n    if package.get(\"version\") != PINNED_GITNEXUS_VERSION:\n        raise SandboxError(\n            \"pinned GitNexus runtime version drifted: \"\n            f\"expected {PINNED_GITNEXUS_VERSION}, got {package.get('version')!r}\"\n        )\n\n    linked_shared = mounts[2].source / \"gitnexus-shared\"\n    if not linked_shared.is_symlink() or linked_shared.resolve(strict=True) != shared:\n        raise SandboxError(\"pinned GitNexus runtime has an unexpected gitnexus-shared dependency\")\n    try:\n        shared_package = json.loads(mounts[5].source.read_text())\n    except (OSError, json.JSONDecodeError) as exc:\n        raise SandboxError(f\"pinned GitNexus shared runtime metadata is invalid: {exc}\") from exc\n    if shared_package.get(\"name\") != \"gitnexus-shared\":\n        raise SandboxError(\"pinned GitNexus shared runtime has an unexpected package identity\")\n    return mounts\n\n\ndef validate_ce_plugin_inputs(\n    arms: Sequence[str],\n    plugin_dir: Path | None,\n    plugin_version: str | None,\n) -> CePluginConfig | None:\n    \"\"\"Require an explicit directory and exact version iff a CE arm is selected.\"\"\"\n\n    has_ce_arm = any(arm in CE_ARMS for arm in arms)\n    supplied = plugin_dir is not None or plugin_version is not None","sourceCodeStart":226,"sourceCodeEnd":262,"githubUrl":"https://github.com/abhigyanpatwari/GitNexus/blob/d540b00184d71a896261ee02670da9a92d59d8f7/eval/workflow_bench/runtime_mounts.py#L226-L262","documentation":"The harness expects gitnexus/node_modules/gitnexus-shared to be a symlink that resolves exactly to the sibling gitnexus-shared/ directory (a workspace-style link). If it is missing, a regular directory, or a symlink to anywhere else, the runtime's dependency wiring is untrusted and the run aborts.","triggerScenarios":"Running `npm install gitnexus-shared` inside gitnexus/ produced a copied install rather than the workspace link; node_modules was partially cleaned; the repo was unpacked without restoring the workspace symlink.","commonSituations":"Switching between workspace-aware npm invocations and standalone installs; CI caching that drops symlinks; extracting a tarball that materialized the link target as a real directory.","solutions":["Reinstall from the workspace root so npm re-creates the link: `rm -rf gitnexus/node_modules && cd gitnexus && npm install`.","Verify the link: `ls -l gitnexus/node_modules/gitnexus-shared` should show `-> ../../gitnexus-shared`.","If the workspace root is not configured, add gitnexus-shared to workspaces in the root package.json before reinstalling."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"from pathlib import Path\n\ndef shared_link_ok(runtime: Path, shared: Path) -> bool:\n    link = runtime / \"node_modules\" / \"gitnexus-shared\"\n    try:\n        return link.is_symlink() and link.resolve(strict=True) == shared.resolve(strict=True)\n    except OSError:\n        return False","typeGuard":null,"tryCatchPattern":"try:\n    mounts = trusted_gitnexus_runtime_mounts()\nexcept SandboxError as exc:\n    if \"unexpected gitnexus-shared dependency\" in str(exc):\n        # reinstall from workspace root to re-create the link\n        ...\n    raise","preventionTips":["Always install via `npm install` from the workspace root so the link is created correctly.","Never `npm install gitnexus-shared` inside gitnexus/ directly.","After install, verify with `ls -l gitnexus/node_modules/gitnexus-shared`."],"tags":["workspace","dependency-linking","gitnexus-runtime","node-modules"],"backgroundTag":null,"analyzedSha":"d540b00184d71a896261ee02670da9a92d59d8f7","analyzedAt":"2026-08-12T19:50:25.132Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}