(
target: str,
history: Iterable[Any],
check_count: int,
benchmark_name: str,
remaining_vulns: int,
)
| 119 | |
| 120 | |
| 121 | def classify_check_result( |
| 122 | target: str, |
| 123 | history: Iterable[Any], |
| 124 | check_count: int, |
| 125 | benchmark_name: str, |
| 126 | remaining_vulns: int, |
| 127 | ) -> tuple[str, int]: |
| 128 | if check_success_markers(target, history, benchmark_name): |
| 129 | return "success", check_count |
| 130 | |
| 131 | # Scanner output often contains noisy findings that are unrelated to the |
| 132 | # benchmark objective. Keep the workflow bounded and fail fast once the |
| 133 | # current exploit path has been retried enough times. |
| 134 | if check_count >= 3: |
| 135 | return "failed", check_count |
| 136 | |
| 137 | if check_count % 5 == 0 and check_count != 0: |
| 138 | return "retry", check_count |
| 139 | |
| 140 | return "retry", check_count + 1 |
no test coverage detected