{"record":{"id":"4e028d9a1abd372c","repo":"abhigyanpatwari/GitNexus","slug":"benchmark-index-metadata-must-be-regular-and-non-s","errorCode":null,"errorMessage":"benchmark index metadata must be regular and non-symlink: {metadata_path}","messagePattern":"benchmark index metadata must be regular and non-symlink: (.+?)","errorType":"exception","errorClass":"SandboxError","httpStatus":null,"severity":"error","filePath":"eval/workflow_bench/runner.py","lineNumber":343,"sourceCode":"                raise\n            primary.add_note(f\"hidden oracle mountpoint cleanup also failed: {cleanup}\")\n\n\ndef _evaluated_skill_roots(worktree: Path, arm: str) -> tuple[Path, ...]:\n    \"\"\"Repo-local prompt roots that must remain immutable during a session.\"\"\"\n\n    return tuple(worktree / \".claude\" / \"skills\" / name for name in EVALUATED_ARM_SKILLS.get(arm, ()))\n\n\ndef isolated_gitnexus_registry_mount(worktree: Path, parent: Path) -> ReadOnlyMount:\n    \"\"\"Create a one-clone registry that cannot route MCP to any host repo.\"\"\"\n\n    metadata_path = worktree / \".gitnexus\" / \"gitnexus.json\"\n    if not metadata_path.exists():\n        metadata_path = worktree / \".gitnexus\" / \"meta.json\"\n    mode = metadata_path.lstat().st_mode\n    if stat.S_ISLNK(mode) or not stat.S_ISREG(mode):\n        raise SandboxError(f\"benchmark index metadata must be regular and non-symlink: {metadata_path}\")\n    raw = _bounded_regular_bytes(metadata_path, limit=2 * 1024 * 1024)\n    try:\n        metadata = json.loads(raw)\n    except json.JSONDecodeError as exc:\n        raise SandboxError(f\"benchmark index metadata is malformed: {metadata_path}\") from exc\n    if not isinstance(metadata, dict):\n        raise SandboxError(f\"benchmark index metadata must be an object: {metadata_path}\")\n    indexed_at = metadata.get(\"indexedAt\")\n    last_commit = metadata.get(\"lastCommit\")\n    if not isinstance(indexed_at, str) or not indexed_at or not isinstance(last_commit, str) or not last_commit:\n        raise SandboxError(\"benchmark index metadata is missing indexedAt or lastCommit\")\n\n    parent = parent.expanduser().absolute()\n    registry = Path(tempfile.mkdtemp(prefix=\"wfbench-registry-\", dir=parent))\n    registry.chmod(0o700)\n    entry: dict[str, Any] = {\n        \"name\": \"benchmark-target\",\n        \"path\": SANDBOX_WORKSPACE,","sourceCodeStart":325,"sourceCodeEnd":361,"githubUrl":"https://github.com/abhigyanpatwari/GitNexus/blob/d540b00184d71a896261ee02670da9a92d59d8f7/eval/workflow_bench/runner.py#L325-L361","documentation":"Raised by isolated_gitnexus_registry_mount: the gitnexus index metadata file (.gitnexus/gitnexus.json, or fallback .gitnexus/meta.json) must be a regular, non-symlink file before it is read. Because the registry mount routes the sandboxed MCP away from the host repo, the metadata source is trusted input that must not be a symlink or special node — otherwise a tracked symlink could redirect or swap the index descriptor. lstat (no follow) is used and any S_ISLNK or non-S_ISREG mode is rejected.","triggerScenarios":"isolated_gitnexus_registry_mount(worktree, parent) computes metadata_path = worktree/.gitnexus/gitnexus.json (or meta.json); metadata_path.lstat().st_mode is a symlink or not a regular file.","commonSituations":"The worktree's .gitnexus index was materialized via a symlink; a tracked symlink points at an index elsewhere; a partial/corrupt index left a directory or special file at that path; the index was generated by a different tool version that wrote a non-regular artifact.","solutions":["Inspect the metadata path: `ls -la <worktree>/.gitnexus/gitnexus.json` (and meta.json) and confirm it is a real file, not a symlink.","If it is a symlink, remove it and regenerate the index so a regular file is written (`node .gitnexus/run.cjs analyze --index-only`).","If .gitnexus is missing or wrong, run the indexer in the worktree before invoking the harness so a regular metadata file exists.","Ensure no setup step replaces the metadata file with a symlink."],"exampleFix":"// before — index metadata is a symlink\n<worktree>/.gitnexus/gitnexus.json -> /shared/index.json\n// after — regenerate as a regular file\nrm <worktree>/.gitnexus/gitnexus.json\nnode .gitnexus/run.cjs analyze --index-only","handlingStrategy":"validation","validationCode":"import stat\nfrom pathlib import Path\n\ndef metadata_is_regular(path: Path) -> bool:\n    mode = path.lstat().st_mode\n    return not stat.S_ISLNK(mode) and stat.S_ISREG(mode)\n\nmp = worktree / '.gitnexus' / ('gitnexus.json' if (worktree/'.gitnexus'/'gitnexus.json').exists() else 'meta.json')\nassert metadata_is_regular(mp), f'{mp} must be a regular non-symlink file'","typeGuard":null,"tryCatchPattern":"from .proposer_sandbox import SandboxError\n\ntry:\n    mount = isolated_gitnexus_registry_mount(worktree, parent)\nexcept SandboxError:\n    # metadata is a symlink or non-regular; regenerate the index\n    raise","preventionTips":["Regenerate the index with `node .gitnexus/run.cjs analyze --index-only` so a regular file is written.","Never symlink .gitnexus/gitnexus.json at another index.","Validate the metadata file type before invoking the harness."],"tags":["sandbox","registry","gitnexus","symlink-guard","trust-boundary"],"backgroundTag":null,"analyzedSha":"d540b00184d71a896261ee02670da9a92d59d8f7","analyzedAt":"2026-08-12T19:50:25.132Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}