{"record":{"id":"b82010ffc898b8f8","repo":"abhigyanpatwari/GitNexus","slug":"pinned-gitnexus-shared-runtime-metadata-is-invalid","errorCode":null,"errorMessage":"pinned GitNexus shared runtime metadata is invalid: {exc}","messagePattern":"pinned GitNexus shared runtime metadata is invalid: (.+?)","errorType":"exception","errorClass":"SandboxError","httpStatus":null,"severity":"error","filePath":"eval/workflow_bench/runtime_mounts.py","lineNumber":248,"sourceCode":"        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\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","sourceCodeStart":230,"sourceCodeEnd":266,"githubUrl":"https://github.com/abhigyanpatwari/GitNexus/blob/d540b00184d71a896261ee02670da9a92d59d8f7/eval/workflow_bench/runtime_mounts.py#L230-L266","documentation":"After the shared package link is verified, the harness reads and parses gitnexus-shared/package.json. OSError (missing/unreadable) or json.JSONDecodeError (corrupt JSON) here means the shared runtime's identity cannot be confirmed.","triggerScenarios":"gitnexus-shared/package.json is absent, has been truncated by a failed merge, or is unreadable to the harness user.","commonSituations":"Partial checkout that omitted the shared subproject; manual edit that broke JSON syntax; restrictive file permissions applied to the directory.","solutions":["Restore the file from git: `git checkout HEAD -- gitnexus-shared/package.json`.","Validate JSON: `node -e \"JSON.parse(require('fs').readFileSync('gitnexus-shared/package.json'))\"`.","Check perms: `ls -l gitnexus-shared/package.json` as the harness user."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"import json\nfrom pathlib import Path\n\ndef shared_package_parses(shared_root: Path) -> bool:\n    try:\n        json.loads((shared_root / \"package.json\").read_text())\n        return True\n    except (OSError, json.JSONDecodeError):\n        return False","typeGuard":null,"tryCatchPattern":"try:\n    mounts = trusted_gitnexus_runtime_mounts()\nexcept SandboxError as exc:\n    if \"shared runtime metadata is invalid\" in str(exc):\n        # restore gitnexus-shared/package.json from git\n        ...\n    raise","preventionTips":["Keep gitnexus-shared/package.json under version control and restore from git on suspicion of corruption.","Validate JSON before committing: `node -e \"JSON.parse(...)\"`."],"tags":["validation","gitnexus-shared","metadata"],"backgroundTag":null,"analyzedSha":"d540b00184d71a896261ee02670da9a92d59d8f7","analyzedAt":"2026-08-12T19:50:25.132Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}