{"record":{"id":"4a55c40b748b5c61","repo":"abhigyanpatwari/GitNexus","slug":"oracle-sanitization-did-not-retain-its-parentless","errorCode":null,"errorMessage":"oracle sanitization did not retain its parentless task snapshot","messagePattern":"oracle sanitization did not retain its parentless task snapshot","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"eval/workflow_bench/oracle_assets.py","lineNumber":451,"sourceCode":"            [\"git\", \"-C\", str(root), \"cat-file\", \"-e\", forbidden_object],\n            timeout=60,\n        )\n        if probe.ok:\n            raise ValueError(f\"oracle sanitization left the {label} recoverable\")\n        if probe.state != \"exited\" or probe.returncode not in {1, 128}:\n            raise ValueError(f\"oracle sanitization could not verify removal of the {label}\")\n\n    hidden_listing = _git_checked(\n        root,\n        [\"ls-tree\", \"-r\", \"--name-only\", \"HEAD\", \"--\", HIDDEN_HARNESS_PATH.as_posix()],\n        timeout=60,\n    )\n    if hidden_listing or current.exists() or current.is_symlink():\n        raise ValueError(\"oracle sanitization left the benchmark harness visible\")\n    if _git_checked(root, [\"status\", \"--porcelain=v1\", \"--untracked-files=all\"], timeout=60):\n        raise ValueError(\"oracle sanitization did not produce a clean task snapshot\")\n    if _git_checked(root, [\"rev-parse\", \"--verify\", \"HEAD^{commit}\"], timeout=60) != sanitized_head:\n        raise ValueError(\"oracle sanitization did not retain its parentless task snapshot\")\n    parents = _git_checked(root, [\"show\", \"-s\", \"--format=%P\", \"HEAD\"], timeout=60)\n    if parents:\n        raise ValueError(\"oracle sanitization snapshot unexpectedly retained parent history\")\n    if _git_checked(root, [\"remote\"], timeout=60):\n        raise ValueError(\"oracle sanitization retained a repository remote\")\n    if logs.exists() or logs.is_symlink():\n        raise ValueError(\"oracle sanitization retained reflog metadata\")\n    return sanitized_head\n\n\ndef _write_stage_file(stage_root: Path, item: OracleFileSnapshot) -> None:\n    destination = stage_root.joinpath(*PurePosixPath(item.target).parts)\n    destination.parent.mkdir(parents=True, mode=0o700, exist_ok=True)\n    current = stage_root\n    for part in PurePosixPath(item.target).parts[:-1]:\n        current /= part\n        metadata = current.lstat()\n        if stat.S_ISLNK(metadata.st_mode) or not stat.S_ISDIR(metadata.st_mode):","sourceCodeStart":433,"sourceCodeEnd":469,"githubUrl":"https://github.com/abhigyanpatwari/GitNexus/blob/d540b00184d71a896261ee02670da9a92d59d8f7/eval/workflow_bench/oracle_assets.py#L433-L469","documentation":"Post-condition: `git rev-parse --verify HEAD^{commit}` must equal the sanitized_head computed earlier from `git commit-tree`. A mismatch means HEAD moved between writing the parentless commit and verifying it, so the harness cannot trust the snapshot identity.","triggerScenarios":"Triggered when HEAD changes after `update-ref HEAD <sanitized_head>` — e.g., a git hook (post-commit, post-rewrite), a concurrent git process, or an IDE that auto-checks-out another ref during the sanitization window.","commonSituations":"A core.hooksPath hook that runs git operations on commit; a concurrent `git checkout` from an IDE or another task; a reflog rewrite by gc running in the background.","solutions":["Compare: `git -C <clone> rev-parse HEAD^{commit}` vs the sanitized_head from commit-tree.","Disable hooks for the clone: `git -C <clone> config core.hooksFile /dev/null` and run with `-c core.hooksPath=/dev/null`.","Ensure no other git process (IDE, daemon, concurrent task) touches the clone during sanitization.","Re-clone and sanitize in a single-process, hooks-disabled environment."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"from pathlib import Path\nfrom eval.workflow_bench.process_control import run_checked\n\ndef head_matches(clone: Path, expected_sha: str) -> bool:\n    got = run_checked([\"git\",\"-C\",str(clone),\"rev-parse\",\"--verify\",\"HEAD^{commit}\"], timeout=60).stdout_tail.strip()\n    return got == expected_sha\n","typeGuard":"def is_head_drift(exc: BaseException) -> bool:\n    return isinstance(exc, ValueError) and \"did not retain its parentless task snapshot\" in str(exc)\n","tryCatchPattern":"try:\n    oracle_assets.sanitize_clone_for_hidden_oracles(clone)\nexcept ValueError as exc:\n    quarantine(clone)\n    raise AbortTask(str(exc)) from exc\n","preventionTips":["Disable hooks (core.hooksPath=/dev/null) on benchmark clones.","Never share a benchmark clone across concurrent processes."],"tags":["git","head","hooks","concurrency","oracle","sanitization","postcondition","invariant"],"backgroundTag":null,"analyzedSha":"d540b00184d71a896261ee02670da9a92d59d8f7","analyzedAt":"2026-08-12T19:50:25.132Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}