mirror of
https://github.com/norandom/OpenUltraSAST.git
synced 2026-10-16 03:49:26 +00:00
fix(hunt): diff producer records where a push removed lines; worktree checkout is proven complete
Two instrument findings from the first access-control feature table (952 rows, 74 positive rows): 1. A fix that adds a guard is, replayed base-to-head, a push that removes it. The diff producer only kept hunks with added lines at head, so 38 of 74 positive rows had no hunk in their file at all and 69 of 74 were "not on a changed line", while 60% of ordinary rows were. The diff annotation separated the labels by construction and was blind to exactly the access-control shape. The producer (version 2) now records per file the head lines after which the push removed code; distance and on_changed_line count them, the model's hunks input renders them as removed_after_line, and diff.deletion_count is an engineered feature. 2. 150 rows (16%, every positive of one repository) read empty files from the worktree although git holds the blobs; the build ran while another process checked out from the same clone. _full_checkout now proves the checkout: git status must be clean, a dirty tree is restored once, then InstrumentFailure checkout_incomplete. The table script cross-checks every unread row against the blob size and refuses to screen a partly unread tree, and records the diff-scoped recall ceiling (positive rows a label-blind enumeration would reach). Co-Authored-By: Claude Fable 5.1 <[email protected]>
This commit is contained in:
co-authored by
Claude Fable 5.1
parent
60cbefec9b
commit
537b61e8d9
@@ -43,7 +43,7 @@ def test_signature_drops_masked_inputs_and_keeps_the_order():
|
||||
def test_render_rows_numbers_the_function_and_omits_masked_inputs():
|
||||
inputs = hp.render_rows(CHANGE, ROWS, TEXT)
|
||||
assert inputs["change_summary"] == "app.py::second"
|
||||
assert json.loads(inputs["hunks"]) == {"app.py": [[3, 3]]}
|
||||
assert json.loads(inputs["hunks"]) == {"app.py": {"changed": [[3, 3]], "removed_after_line": []}}
|
||||
assert " 5 def second():" in inputs["function_text"] and " 6 " in inputs["function_text"]
|
||||
assert "input()" not in inputs["function_text"] # only the span is shown
|
||||
assert inputs["families"].startswith("injection: ")
|
||||
|
||||
Reference in New Issue
Block a user