{"record":{"id":"71943dd65fb284d5","repo":"abhigyanpatwari/GitNexus","slug":"pinned-task-commit-is-unavailable-for-task-id","errorCode":null,"errorMessage":"pinned task commit is unavailable for {task['id']}: {resolved_sha}","messagePattern":"pinned task commit is unavailable for (.+?): (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"eval/workflow_bench/runner_tasks.py","lineNumber":144,"sourceCode":"                    str(repo_identity),\n                    \"rev-parse\",\n                    f\"{task.get('ref', 'HEAD')}^{{commit}}\",\n                ],\n                timeout=60,\n            ).stdout_tail.strip()\n        else:\n            supplied = expected[index]\n            if not isinstance(supplied, dict):\n                raise ValueError(f\"task binding {index} must be an object\")\n            resolved_sha = str(supplied.get(\"resolved_sha\", \"\"))\n        if not re.fullmatch(r\"[0-9a-fA-F]{40,64}\", resolved_sha):\n            raise ValueError(f\"task {task['id']} did not resolve to an immutable commit\")\n        exists = run_managed(\n            [\"git\", \"-C\", str(repo_identity), \"cat-file\", \"-e\", f\"{resolved_sha}^{{commit}}\"],\n            timeout=60,\n        )\n        if not exists.ok:\n            raise ValueError(f\"pinned task commit is unavailable for {task['id']}: {resolved_sha}\")\n        if task_asset_cache is None:\n            dependency_binding = capture_task_dependency_binding(\n                task,\n                repo=repo_identity,\n                resolved_sha=resolved_sha.lower(),\n            )\n        else:\n            dependency_binding = task_asset_cache.prepare(\n                task,\n                repo=repo_identity,\n                resolved_sha=resolved_sha.lower(),\n            ).dependency_binding\n        definition = _task_definition_binding(\n            task,\n            repo_identity,\n            oracle_snapshot,\n            dependency_binding,\n        )","sourceCodeStart":126,"sourceCodeEnd":162,"githubUrl":"https://github.com/abhigyanpatwari/GitNexus/blob/d540b00184d71a896261ee02670da9a92d59d8f7/eval/workflow_bench/runner_tasks.py#L126-L162","documentation":"Raised by resolve_task_bindings after `git cat-file -e <sha>^{commit}` fails (run_managed returns not ok) — the pinned/resolved commit object is not present in the local repo object store (runner_tasks.py:139-144). This guards against pins that point at SHAs the checkout doesn't actually have.","triggerScenarios":"A pin referencing a SHA from a different fork/branch never fetched; a shallow clone missing the object; the repo was re-cloned and the commit no longer reachable; a garbage-collected object.","commonSituations":"Reusing a bindings JSON across repos; shallow clones in CI; a force-push that rewrote history away from the pinned SHA.","solutions":["Fetch the object: `git -C <repo> fetch --depth=1 origin <sha>` (or fetch the branch/tags).","If the SHA is genuinely gone, regenerate the pin from a current commit.","Avoid shallow clones for benchmark repos, or deepen them."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"import subprocess\nprobe = subprocess.run([\"git\", \"-C\", repo, \"cat-file\", \"-e\", f\"{sha}^{{commit}}\"])\nif probe.returncode != 0:\n    raise SystemExit(f\"commit {sha} not present in {repo}; fetch it first\")","typeGuard":null,"tryCatchPattern":"try:\n    bindings = resolve_task_bindings(tasks, expected)\nexcept ValueError as exc:\n    if \"unavailable for\" in str(exc):\n        subprocess.check_call([\"git\", \"-C\", repo, \"fetch\", \"--depth=1\", \"origin\", sha])\n        bindings = resolve_task_bindings(tasks, expected)\n    else:\n        raise","preventionTips":["Avoid shallow clones for benchmark repos, or run `git fetch --unshallow`.","Fetch the exact pinned SHA before resolving: `git fetch origin <sha>`.","Regenerate pins when upstream history is rewritten by force-push."],"tags":["workflow-bench","task-binding","git","clone"],"backgroundTag":null,"analyzedSha":"d540b00184d71a896261ee02670da9a92d59d8f7","analyzedAt":"2026-08-12T19:50:25.132Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}