mirror of
https://github.com/norandom/OpenUltraSAST.git
synced 2026-12-05 03:08:19 +00:00
fix(hunt): label every verified target of a change; undo an inherited sparse-checkout in the worktree
label_rows honoured only a change's primary site, so 43 of the 48 accepted access-control locations were unlabelled; every entry of targets is now a positive with its own label_ref and span. The training clones were emptied with sparse-checkout to save disk and a new worktree inherits it: every file read failed and the source and semantic producers reported an unread tree on all 599 rows. The runner now disables sparse-checkout in the worktree it adds. Co-Authored-By: Claude Fable 5.1 <[email protected]>
This commit is contained in:
co-authored by
Claude Fable 5.1
parent
30921a12b9
commit
499f6c4474
@@ -118,6 +118,7 @@ def hunt_change(
|
||||
try:
|
||||
_git(repo_root, "worktree", "add", "--detach", str(root), change["head"])
|
||||
added = True
|
||||
_full_checkout(root)
|
||||
if _git(root, "rev-parse", "HEAD").strip() != change["head"]:
|
||||
raise InstrumentFailure("head_mismatch")
|
||||
instrument["head_verified"] = True
|
||||
@@ -160,6 +161,19 @@ def hunt_change(
|
||||
return record
|
||||
|
||||
|
||||
def _full_checkout(root: Path) -> None:
|
||||
"""Undo a sparse-checkout a worktree inherits from a clone whose working tree was emptied to save disk.
|
||||
|
||||
Without this every file read fails and the producers report an unread tree, which must never pass as a
|
||||
clean result."""
|
||||
try:
|
||||
sparse = _git(root, "config", "--get", "core.sparseCheckout").strip()
|
||||
except subprocess.CalledProcessError:
|
||||
return
|
||||
if sparse == "true":
|
||||
_git(root, "sparse-checkout", "disable")
|
||||
|
||||
|
||||
def _function_at(root: Path, finding: Mapping[str, Any]) -> str | None:
|
||||
try:
|
||||
path = str(finding["path"])
|
||||
|
||||
Reference in New Issue
Block a user