{"record":{"id":"76f72db6ab446e42","repo":"abhigyanpatwari/GitNexus","slug":"task-task-id-did-not-resolve-to-an-immutable","errorCode":null,"errorMessage":"task {task['id']} did not resolve to an immutable commit","messagePattern":"task (.+?) did not resolve to an immutable commit","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"eval/workflow_bench/runner_tasks.py","lineNumber":138,"sourceCode":"        repo_identity = Path(repo_output).resolve()\n        if expected is None:\n            resolved_sha = run_checked(\n                [\n                    \"git\",\n                    \"-C\",\n                    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","sourceCodeStart":120,"sourceCodeEnd":156,"githubUrl":"https://github.com/abhigyanpatwari/GitNexus/blob/d540b00184d71a896261ee02670da9a92d59d8f7/eval/workflow_bench/runner_tasks.py#L120-L156","documentation":"Raised by resolve_task_bindings when resolved_sha does not match `[0-9a-fA-F]{40,64}` (runner_tasks.py:137-138). This covers both the freshly-resolved ref path and the supplied-pin path: the value must be a raw git object id (40-char SHA-1 or 64-char SHA-256), not a ref name, abbreviated id, or empty string.","triggerScenarios":"`git rev-parse <ref>^{commit}` returned empty or a symbolic ref (e.g. because the ref is ambiguous/unborn); a supplied pin's resolved_sha is an abbreviated id, a branch name, or missing; the pin JSON has a typo.","commonSituations":"Pointing ref at an empty repo; using a 7-char short SHA in the pin; the rev-parse failed silently and left resolved_sha blank.","solutions":["Confirm the repo/ref resolves to a real commit: `git -C <repo> rev-parse <ref>^{commit}`.","If using a pin, ensure resolved_sha is the full 40-char (or 64-char) object id.","For an unborn/empty repo, point ref at an existing commit first."],"exampleFix":"// before pin: {\"resolved_sha\": \"abc1234\"}\n// after pin:  {\"resolved_sha\": \"abc1234567890abcdef0123456789abcdef0123456\"}","handlingStrategy":"validation","validationCode":"import subprocess, re\nsha = subprocess.check_output(\n    [\"git\", \"-C\", repo, \"rev-parse\", f\"{ref}^{{commit}}\"], text=True\n).strip()\nif not re.fullmatch(r\"[0-9a-fA-F]{40,64}\", sha):\n    raise SystemExit(f\"ref did not resolve to a commit object: {sha!r}\")","typeGuard":"import re\ndef is_full_object_id(sha: str) -> bool:\n    return bool(re.fullmatch(r\"[0-9a-fA-F]{40,64}\", sha))","tryCatchPattern":"try:\n    bindings = resolve_task_bindings(tasks, expected)\nexcept ValueError as exc:\n    if \"did not resolve to an immutable commit\" in str(exc):\n        # regenerate pin from a resolvable ref\n        expected = None\n        bindings = resolve_task_bindings(tasks, expected)\n    else:\n        raise","preventionTips":["Pin full 40/64-char object ids, never abbreviated SHAs or branch names.","Resolve refs with `git rev-parse <ref>^{commit}` and store the result."],"tags":["workflow-bench","task-binding","git","reproducibility"],"backgroundTag":null,"analyzedSha":"d540b00184d71a896261ee02670da9a92d59d8f7","analyzedAt":"2026-08-12T19:50:25.132Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}