{"record":{"id":"dfd71aaf3a0bc233","repo":"abhigyanpatwari/GitNexus","slug":"committed-benchmark-harness-is-missing-from-the-cl","errorCode":null,"errorMessage":"committed benchmark harness is missing from the clone checkout","messagePattern":"committed benchmark harness is missing from the clone checkout","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"eval/workflow_bench/oracle_assets.py","lineNumber":305,"sourceCode":"        tail_bytes=1024,\n    )\n    if not hidden_tree_result.ok:\n        raise ValueError(\"cannot inspect the clone for committed benchmark harness data\")\n    hidden_tree = hidden_tree_result.stdout_tail.strip()\n    if hidden_tree and (\n        len(hidden_tree) not in {40, 64} or any(character not in \"0123456789abcdefABCDEF\" for character in hidden_tree)\n    ):\n        raise ValueError(\"committed benchmark harness is not a single bounded tree\")\n\n    current = root.joinpath(*HIDDEN_HARNESS_PATH.parts)\n    if hidden_tree:\n        parent = root\n        for part in HIDDEN_HARNESS_PATH.parts:\n            parent /= part\n            try:\n                metadata = parent.lstat()\n            except OSError as exc:\n                raise ValueError(\"committed benchmark harness is missing from the clone checkout\") from exc\n            if stat.S_ISLNK(metadata.st_mode) or not stat.S_ISDIR(metadata.st_mode):\n                raise ValueError(\"benchmark harness checkout must contain only real directories\")\n    elif current.exists() or current.is_symlink():\n        raise ValueError(\"untracked benchmark harness data blocks oracle sanitization\")\n\n    _git_checked(\n        root,\n        [\n            \"rm\",\n            \"-r\",\n            \"--force\",\n            \"--quiet\",\n            \"--ignore-unmatch\",\n            \"--\",\n            HIDDEN_HARNESS_PATH.as_posix(),\n        ],\n        timeout=120,\n    )","sourceCodeStart":287,"sourceCodeEnd":323,"githubUrl":"https://github.com/abhigyanpatwari/GitNexus/blob/d540b00184d71a896261ee02670da9a92d59d8f7/eval/workflow_bench/oracle_assets.py#L287-L323","documentation":"Raised inside sanitize_clone_for_hidden_oracles while walking each component of the HIDDEN_HARNESS_PATH ('eval/workflow_bench') in the worktree. HEAD's ls-tree reported the harness as a committed tree (hidden_tree was non-empty), so the directory must exist in the checkout; lstat() on a path component raised OSError, meaning the worktree disagrees with HEAD.","triggerScenarios":"Called when git HEAD lists eval/workflow_bench as a tree but one of the eval/ or eval/workflow_bench/ directories cannot be lstat'd in the clone's working tree (sparse-checkout excluded it, a partial/--no-checkout clone, or the dir was deleted after checkout).","commonSituations":"Cloning with --no-checkout or a sparse-checkout cone that omits eval/; a prior task or setup command that rm'd eval/workflow_bench; an interrupted checkout.","solutions":["Re-clone with a full checkout: avoid --no-checkout and disable sparse-checkout for the benchmark clone.","Restore the path from HEAD before sanitizing: `git -C <clone> checkout HEAD -- eval/workflow_bench`.","If using a sparse cone, add eval/workflow_bench to the sparse paths so it is materialized.","Verify with `git -C <clone> ls-files -- eval/workflow_bench | head` shows the committed files."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"import subprocess, stat\nfrom pathlib import Path\n\ndef checkout_has_harness(clone: Path, parts=(\"eval\", \"workflow_bench\")) -> bool:\n    cur = clone\n    for part in parts:\n        cur = cur / part\n        try:\n            st = cur.lstat()\n        except OSError:\n            return False\n        if stat.S_ISLNK(st.st_mode) or not stat.S_ISDIR(st.st_mode):\n            return False\n    return True\n","typeGuard":"def is_harness_missing_from_checkout(exc: BaseException) -> bool:\n    return isinstance(exc, ValueError) and \"missing from the clone checkout\" in str(exc)\n","tryCatchPattern":"from eval.workflow_bench import oracle_assets\ntry:\n    oracle_assets.sanitize_clone_for_hidden_oracles(clone)\nexcept ValueError as exc:\n    # The clone is untrusted now; never fall back to a partially sanitized clone.\n    quarantine(clone)\n    raise AbortTask(f\"oracle sanitization failed: {exc}\") from exc\n","preventionTips":["Use a standard full clone for benchmark runs; do not combine --no-checkout or sparse-checkout with sanitize_clone_for_hidden_oracles.","Run sanitization before any setup command that could mutate the worktree.","Treat this as a hard abort: a mismatch between HEAD and the worktree means the clone state is undefined."],"tags":["git","clone","sparse-checkout","worktree","oracle","sanitization","invariant"],"backgroundTag":null,"analyzedSha":"d540b00184d71a896261ee02670da9a92d59d8f7","analyzedAt":"2026-08-12T19:50:25.132Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}