abhigyanpatwari/GitNexus · error · SandboxError

pinned GitNexus runtime metadata is invalid: {exc}

Error message

pinned GitNexus runtime metadata is invalid: {exc}

What it means

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.

Source

Thrown at eval/workflow_bench/runtime_mounts.py:233

            shared,
            "package.json",
            f"{SANDBOX_GITNEXUS_SHARED}/package.json",
            directory=False,
        ),
        _validated_runtime_component(
            runtime,
            "hooks/claude",
            f"{SANDBOX_GITNEXUS}/hooks/claude",
            directory=True,
        ),
    )

    entrypoint = mounts[0].source / "cli" / "index.js"
    try:
        entrypoint_mode = entrypoint.lstat().st_mode
        package = json.loads(mounts[1].source.read_text())
    except (OSError, json.JSONDecodeError) as exc:
        raise SandboxError(f"pinned GitNexus runtime metadata is invalid: {exc}") from exc
    if stat.S_ISLNK(entrypoint_mode) or not stat.S_ISREG(entrypoint_mode):
        raise SandboxError(f"pinned GitNexus runtime entrypoint must be regular and non-symlink: {entrypoint}")
    if package.get("version") != PINNED_GITNEXUS_VERSION:
        raise SandboxError(
            "pinned GitNexus runtime version drifted: "
            f"expected {PINNED_GITNEXUS_VERSION}, got {package.get('version')!r}"
        )

    linked_shared = mounts[2].source / "gitnexus-shared"
    if not linked_shared.is_symlink() or linked_shared.resolve(strict=True) != shared:
        raise SandboxError("pinned GitNexus runtime has an unexpected gitnexus-shared dependency")
    try:
        shared_package = json.loads(mounts[5].source.read_text())
    except (OSError, json.JSONDecodeError) as exc:
        raise SandboxError(f"pinned GitNexus shared runtime metadata is invalid: {exc}") from exc
    if shared_package.get("name") != "gitnexus-shared":
        raise SandboxError("pinned GitNexus shared runtime has an unexpected package identity")
    return mounts

View on GitHub (pinned to d540b00184)

Solutions

  1. Run `cd gitnexus && npm install && npm run build` so dist/cli/index.js exists and is up to date.
  2. Validate the manifest: `node -e "JSON.parse(require('fs').readFileSync('gitnexus/package.json'))"` and fix any syntax error.
  3. Confirm read access: `ls -l gitnexus/dist/cli/index.js gitnexus/package.json` as the harness user.
Defensive patterns

Strategy: validation

Validate before calling

import json, stat
from pathlib import Path

def gitnexus_runtime_metadata_ok(root: Path) -> bool:
    entry = root / "dist" / "cli" / "index.js"
    pkg = root / "package.json"
    try:
        mode = entry.lstat().st_mode
        json.loads(pkg.read_text())
    except (OSError, json.JSONDecodeError):
        return False
    return stat.S_ISREG(mode)

Try / catch

from .proposer_sandbox import SandboxError

try:
    mounts = trusted_gitnexus_runtime_mounts()
except SandboxError as exc:
    # surface to operator; do not retry without fixing the runtime
    raise SystemExit(f"runtime setup failed: {exc}") from exc

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of abhigyanpatwari/GitNexus@d540b00184 (2026-08-12). Data as JSON: /api/errors/3b63992e1566b0c6. Report an issue: GitHub.