{"record":{"id":"3b63992e1566b0c6","repo":"abhigyanpatwari/GitNexus","slug":"pinned-gitnexus-runtime-metadata-is-invalid-exc","errorCode":null,"errorMessage":"pinned GitNexus runtime metadata is invalid: {exc}","messagePattern":"pinned GitNexus runtime metadata is invalid: (.+?)","errorType":"exception","errorClass":"SandboxError","httpStatus":null,"severity":"error","filePath":"eval/workflow_bench/runtime_mounts.py","lineNumber":233,"sourceCode":"            shared,\n            \"package.json\",\n            f\"{SANDBOX_GITNEXUS_SHARED}/package.json\",\n            directory=False,\n        ),\n        _validated_runtime_component(\n            runtime,\n            \"hooks/claude\",\n            f\"{SANDBOX_GITNEXUS}/hooks/claude\",\n            directory=True,\n        ),\n    )\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","sourceCodeStart":215,"sourceCodeEnd":251,"githubUrl":"https://github.com/abhigyanpatwari/GitNexus/blob/d540b00184d71a896261ee02670da9a92d59d8f7/eval/workflow_bench/runtime_mounts.py#L215-L251","documentation":"Raised by trusted_gitnexus_runtime_mounts() when either lstat on gitnexus/dist/cli/index.js fails (OSError) or parsing gitnexus/package.json fails (json.JSONDecodeError). The harness refuses to mount a runtime whose entrypoint or manifest cannot be inspected, because the sandbox's reproducibility contract depends on a known-good pinned CLI.","triggerScenarios":"Calling trusted_gitnexus_runtime_mounts() when gitnexus/dist/ has not been built (no cli/index.js), when package.json has been hand-edited into invalid JSON, or when file permissions deny the harness user read access to either file.","commonSituations":"Fresh checkout where `cd gitnexus && npm install && npm run build` was skipped; a botched merge that left package.json truncated; running the benchmark as a user without read perms on the gitnexus/ tree.","solutions":["Run `cd gitnexus && npm install && npm run build` so dist/cli/index.js exists and is up to date.","Validate the manifest: `node -e \"JSON.parse(require('fs').readFileSync('gitnexus/package.json'))\"` and fix any syntax error.","Confirm read access: `ls -l gitnexus/dist/cli/index.js gitnexus/package.json` as the harness user."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"import json, stat\nfrom pathlib import Path\n\ndef gitnexus_runtime_metadata_ok(root: Path) -> bool:\n    entry = root / \"dist\" / \"cli\" / \"index.js\"\n    pkg = root / \"package.json\"\n    try:\n        mode = entry.lstat().st_mode\n        json.loads(pkg.read_text())\n    except (OSError, json.JSONDecodeError):\n        return False\n    return stat.S_ISREG(mode)","typeGuard":null,"tryCatchPattern":"from .proposer_sandbox import SandboxError\n\ntry:\n    mounts = trusted_gitnexus_runtime_mounts()\nexcept SandboxError as exc:\n    # surface to operator; do not retry without fixing the runtime\n    raise SystemExit(f\"runtime setup failed: {exc}\") from exc","preventionTips":["Always run `cd gitnexus && npm install && npm run build` before invoking the benchmark.","Treat package.json and dist/ as build artifacts — restore them from git rather than hand-editing.","Run the benchmark as a user with read access to the whole gitnexus/ tree."],"tags":["sandbox","gitnexus-runtime","build","metadata"],"backgroundTag":null,"analyzedSha":"d540b00184d71a896261ee02670da9a92d59d8f7","analyzedAt":"2026-08-12T19:50:25.132Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}