fix(bench): an unparsable file in one ordinary commit no longer ends a repository's history walk

The combined access-control freeze stopped at its 31st repository: one ordinary commit of a PHP tree touched a
Python file that does not parse, functions() raised Rejected, and ordinary_history let it end the walk. The
file is now marked parse_failed on its row and such a commit is rejected as an ordinary push (reason
function_parse), which keeps the draw conservative without losing the repository.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
This commit is contained in:
Marius Ciepluch
2026-10-14 08:42:25 +02:00
co-authored by Claude Fable 5.1
parent 351d73079a
commit 30ad197d3f
2 changed files with 21 additions and 1 deletions
+10 -1
View File
@@ -417,6 +417,8 @@ def ordinary_rejection(row: dict, fixes: set[str], known_functions: set[tuple[st
return "no_source"
if all(f["generated"] or generated_path(f["path"]) for f in source):
return "generated"
if any(f.get("parse_failed") for f in source):
return "function_parse"
if any((f["path"], name) in known_functions for f in files for name in f["functions"]):
return "vulnerable_function"
if any((f["path"], "<global>") in known_functions for f in files):
@@ -521,6 +523,7 @@ def ordinary_history(git, head: str, *, cache_dir: Path | None = None, limit: in
"head_lines": [[max(1, n), max(1, n + max(c, 1) - 1)] for _, _, n, c in hunks],
"functions": [],
"generated": False,
"parse_failed": False,
}
if Path(path).suffix in LANGUAGES:
# Inspect both sides: deleting a vulnerable function is still touching it.
@@ -528,7 +531,13 @@ def ordinary_history(git, head: str, *, cache_dir: Path | None = None, limit: in
text = git.blob(revision, path)
if text is None:
continue
spans = functions(path, text)
try:
spans = functions(path, text)
except Rejected:
# One unparsable file in one ordinary commit (a Python 2 script in a PHP tree, say)
# marks that commit; it must not end the repository's walk.
info["parse_failed"] = True
continue
for hunk in hunks:
start, count = hunk[side : side + 2]
for name, lo, hi in spans: