{"record":{"id":"b6d8ecaecd84feff","repo":"abhigyanpatwari/GitNexus","slug":"pinned-gitnexus-shared-runtime-has-an-unexpected-p","errorCode":null,"errorMessage":"pinned GitNexus shared runtime has an unexpected package identity","messagePattern":"pinned GitNexus shared runtime has an unexpected package identity","errorType":"exception","errorClass":"SandboxError","httpStatus":null,"severity":"error","filePath":"eval/workflow_bench/runtime_mounts.py","lineNumber":250,"sourceCode":"    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\n    if not has_ce_arm:\n        if supplied:\n            raise ValueError(\"--ce-plugin-dir and --ce-plugin-version require at least one ce_* arm\")\n        return None\n    if plugin_dir is None or plugin_version is None:\n        raise ValueError(\"ce_* arms require both --ce-plugin-dir and --ce-plugin-version\")","sourceCodeStart":232,"sourceCodeEnd":268,"githubUrl":"https://github.com/abhigyanpatwari/GitNexus/blob/d540b00184d71a896261ee02670da9a92d59d8f7/eval/workflow_bench/runtime_mounts.py#L232-L268","documentation":"Even when gitnexus-shared/package.json parses, the harness asserts its `name` field equals exactly \"gitnexus-shared\". A different name implies the symlink points to the wrong package, which would silently swap dependencies under the benchmark.","triggerScenarios":"gitnexus/node_modules/gitnexus-shared resolves to a directory whose package.json `name` is anything other than \"gitnexus-shared\" (e.g., a fork, a renamed experiment, or a placeholder).","commonSituations":"Operator relinked node_modules/gitnexus-shared to a sibling experiment; the shared package was temporarily renamed during a refactor and not reverted; vendored copy with a different name.","solutions":["Confirm the resolved target identity: `node -p \"require('./gitnexus-shared/package.json').name\"` must print `gitnexus-shared`.","Re-point the link to the real shared package and reinstall from the workspace root."],"exampleFix":"// before\n// gitnexus-shared/package.json\n{ \"name\": \"gitnexus-shared-dev\" }\n// after\n{ \"name\": \"gitnexus-shared\" }","handlingStrategy":"validation","validationCode":"import json\nfrom pathlib import Path\n\ndef shared_package_identity_ok(shared_root: Path) -> bool:\n    try:\n        return json.loads((shared_root / \"package.json\").read_text()).get(\"name\") == \"gitnexus-shared\"\n    except (OSError, json.JSONDecodeError):\n        return False","typeGuard":null,"tryCatchPattern":"try:\n    mounts = trusted_gitnexus_runtime_mounts()\nexcept SandboxError as exc:\n    if \"unexpected package identity\" in str(exc):\n        # relink node_modules to the real shared package\n        ...\n    raise","preventionTips":["Never rename the gitnexus-shared package, even temporarily.","Verify `node -p \"require('./gitnexus-shared/package.json').name\"` after any relink."],"tags":["package-identity","validation","gitnexus-shared"],"backgroundTag":null,"analyzedSha":"d540b00184d71a896261ee02670da9a92d59d8f7","analyzedAt":"2026-08-12T19:50:25.132Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}