{"record":{"id":"0f855c930a4cb28a","repo":"abhigyanpatwari/GitNexus","slug":"sandboxed-candidate-setup-did-not-produce-an-immut","errorCode":null,"errorMessage":"sandboxed candidate setup did not produce an immutable commit","messagePattern":"sandboxed candidate setup did not produce an immutable commit","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"critical","filePath":"eval/workflow_bench/runner.py","lineNumber":1160,"sourceCode":"                                base_skill_digest,\n                                phase=\"task setup\",\n                            )\n                            if arm in CANDIDATE_ARMS:\n                                assert candidate_overlay is not None\n                                applied_digest = apply_candidate_overlay(\n                                    candidate_overlay,\n                                    worktree,\n                                    sandbox=sandbox,\n                                )\n                                if applied_digest != overlay_digest:\n                                    raise RuntimeError(\"candidate overlay changed during the benchmark run\")\n                            # The digest the model must preserve during its run is the\n                            # post-overlay skill surface (candidate skills for\n                            # candidate arms; unchanged base skills otherwise).\n                            expected_skill_digest = skill_fingerprint(worktree, execution_arm)\n                            orig_sha = _sandbox_git(sandbox, [\"rev-parse\", \"HEAD\"]).strip()\n                            if not re.fullmatch(r\"[0-9a-fA-F]{40,64}\", orig_sha):\n                                raise RuntimeError(\"sandboxed candidate setup did not produce an immutable commit\")\n                            before_work_digest = (\n                                implementation_diff_digest(sandbox, orig_sha)\n                                if execution_arm in IMPLEMENTATION_ARMS\n                                else \"\"\n                            )\n                            record = run_arm(\n                                execution_arm,\n                                task,\n                                worktree,\n                                args,\n                                sandbox=sandbox,\n                                transcript_output_dir=out_dir,\n                                transcript_output_prefix=f\"{task['id']}-{arm}-run{run_idx}\",\n                                expected_skill_digest=expected_skill_digest,\n                                enforce_phase_boundary=True,\n                                ce_plugin_dir=ce_plugin_dir_for_arm(execution_arm, ce_plugin_snapshot),\n                                oracle_snapshot=oracle_snapshot,\n                            )","sourceCodeStart":1142,"sourceCodeEnd":1178,"githubUrl":"https://github.com/abhigyanpatwari/GitNexus/blob/d540b00184d71a896261ee02670da9a92d59d8f7/eval/workflow_bench/runner.py#L1142-L1178","documentation":"Raised when, after candidate overlay application and task setup, git rev-parse HEAD in the sandbox does not match a 40-64 hex SHA pattern. The harness needs an immutable starting commit (orig_sha) so it can later diff the model's work against a fixed baseline; a malformed or empty HEAD means there is no trustable before-state for the implementation diff. This guard prevents silently benchmarking against a non-reproducible baseline.","triggerScenarios":"_sandbox_git(sandbox, ['rev-parse','HEAD']) at runner.py:1158 returns empty or non-hex output, so the regex at runner.py:1159 fails. This happens when the sandbox git checkout failed silently (no commits on the detached HEAD), the worktree clone produced an empty repository, the git binary in the sandbox is not /usr/bin/git, or a setup step ran `git checkout --orphan` / reset HEAD to an unborn branch.","commonSituations":"Cloning a branch whose ref does not exist on the remote (make_worktree falls back to origin/<ref>); sandbox bind-mount hiding .git; a task setup script that runs git operations and leaves HEAD detached on an unborn branch; shallow clone with depth 0.","solutions":["Inspect results.jsonl error_detail and the run transcript to see what the sandbox HEAD actually was; run the same git rev-parse HEAD manually inside the sandbox clone to reproduce.","Check that the ref passed to make_worktree exists and has at least one commit (git -C <repo> log --oneline -1 <ref>).","Ensure the task setup script does not mutate git state (no checkout/reset/orphan); if setup must run git, snapshot orig_sha before setup instead of after."],"exampleFix":"# before: setup script that can wipe HEAD\nsetup = \"git checkout --orphan fresh\"\n\n# after: setup that keeps a real commit, and orig_sha captured after\nsetup = \"true\"  # or a non-git init step\n# orig_sha = git rev-parse HEAD validated at runner.py:1158-1160","handlingStrategy":"validation","validationCode":"import re, subprocess\n\n# Before running the harness, confirm the ref resolves to a real commit\n# in the source repo.\nsha = subprocess.run(\n    [\"git\", \"-C\", str(repo), \"rev-parse\", ref],\n    capture_output=True, text=True,\n).stdout.strip()\nassert re.fullmatch(r\"[0-9a-fA-F]{40,64}\", sha), f\"ref {ref!r} has no immutable commit: {sha!r}\"\nassert subprocess.run(\n    [\"git\", \"-C\", str(repo), \"log\", \"--oneline\", \"-1\", sha],\n    capture_output=True,\n).returncode == 0, f\"commit {sha} is not reachable\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Verify the branch/ref exists and has commits before cloning.","Do not let task setup scripts run git checkout/reset that can leave HEAD unborn.","Ensure the sandbox exposes /usr/bin/git and the .git directory of the clone."],"tags":["git","sandbox","benchmark","integrity"],"backgroundTag":null,"analyzedSha":"d540b00184d71a896261ee02670da9a92d59d8f7","analyzedAt":"2026-08-12T19:50:25.132Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}