{"record":{"id":"feb6ebbc44eb2c40","repo":"abhigyanpatwari/GitNexus","slug":"oracle-sanitization-did-not-produce-a-clean-task-s","errorCode":null,"errorMessage":"oracle sanitization did not produce a clean task snapshot","messagePattern":"oracle sanitization did not produce a clean task snapshot","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"eval/workflow_bench/oracle_assets.py","lineNumber":449,"sourceCode":"    for forbidden_object, label in forbidden_objects:\n        probe = run_managed(\n            [\"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","sourceCodeStart":431,"sourceCodeEnd":467,"githubUrl":"https://github.com/abhigyanpatwari/GitNexus/blob/d540b00184d71a896261ee02670da9a92d59d8f7/eval/workflow_bench/oracle_assets.py#L431-L467","documentation":"Post-condition: `git status --porcelain=v1 --untracked-files=all` must be empty after building the parentless commit. Any output means the worktree has uncommitted or untracked changes, so the 'clean task snapshot' invariant fails.","triggerScenarios":"Triggered when the worktree is dirty after sanitization — stray files, the harness dir recreated, index/worktree drift after write-tree, or a setup step that wrote into the clone.","commonSituations":"A leftover untracked file from a prior run; git rm modified the index but a parallel process wrote a new file; editor swap files; OS-index/Thumbs.db-style artifacts.","solutions":["Run `git -C <clone> status --porcelain=v1 --untracked-files=all` to see the offenders.","Remove untracked files: `git -C <clone> clean -fdx`, then re-verify and rebuild the snapshot.","Ensure no process writes to the clone during sanitization."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"from pathlib import Path\nfrom eval.workflow_bench.process_control import run_checked\n\ndef worktree_is_clean(clone: Path) -> bool:\n    out = run_checked([\"git\",\"-C\",str(clone),\"status\",\"--porcelain=v1\",\"--untracked-files=all\"], timeout=60).stdout_tail.strip()\n    return not out\n","typeGuard":"def is_dirty_snapshot(exc: BaseException) -> bool:\n    return isinstance(exc, ValueError) and \"did not produce a clean 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":["Sanitize in an isolated clone with no background writers.","Run `git clean -fdx` if reusing a clone (though fresh clone is preferred)."],"tags":["git","status","worktree","oracle","sanitization","postcondition","invariant"],"backgroundTag":null,"analyzedSha":"d540b00184d71a896261ee02670da9a92d59d8f7","analyzedAt":"2026-08-12T19:50:25.132Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}