mirror of
https://github.com/norandom/OpenUltraSAST.git
synced 2026-10-16 03:49:26 +00:00
fix(bench): the pilot hunter arm undoes an inherited sparse checkout before it reads a hotspot
The training clones are sparse-checkout and a worktree inherits it; without this the hunter arm raises unreadable_hotspot on every change of the access-control pool. Same helper and checkout proof as the hunt runner. Co-Authored-By: Claude Fable 5.1 <[email protected]>
This commit is contained in:
co-authored by
Claude Fable 5.1
parent
537b61e8d9
commit
c01e61c4dd
@@ -14,6 +14,7 @@ from pathlib import Path
|
||||
from openultrasast import tool_hunter
|
||||
from openultrasast.complexity.map import Hotspot
|
||||
from openultrasast.config import load_config
|
||||
from openultrasast.hunt.runner import _full_checkout as full_checkout
|
||||
from openultrasast.hunter_tools import clamp_repo_path
|
||||
from openultrasast.learn.program import ANSWER_FORMAT, Caller, Prompt, classify
|
||||
from openultrasast.model.endpoint import resolve_models
|
||||
@@ -204,6 +205,10 @@ def _hunt_change(change, repos, *, client, model, max_steps, no_classify=False):
|
||||
try:
|
||||
git.run("-c", "core.hooksPath=/dev/null", "worktree", "add", "--detach", str(root), change["head"])
|
||||
added = True
|
||||
try:
|
||||
full_checkout(root) # training clones are sparse-checkout; the worktree inherits it
|
||||
except RuntimeError:
|
||||
raise InstrumentFailure("checkout_incomplete") from None
|
||||
if local_git(root).run("rev-parse", "HEAD").strip() != change["head"]:
|
||||
raise InstrumentFailure("head_mismatch")
|
||||
instrument["head_verified"] = True
|
||||
|
||||
Reference in New Issue
Block a user