fix: retry transient verifier inconclusive results

This commit is contained in:
yoni 2026-09-28 01:53:04 +00:00
parent a41000d5bf
commit c510f58ef3
2 changed files with 39 additions and 0 deletions

View file

@ -660,6 +660,7 @@ async def prepare_fix( # noqa: PLR0915
if (
previous_workspace_digest == workspace_digest
and previous_verification_fingerprint == verification_fingerprint
and verifier.decision is not VerificationDecision.INCONCLUSIVE
):
manifest, summary, artifact_ref = await manifest_builder(workspace)
return _result(

View file

@ -514,6 +514,44 @@ async def test_prepare_fix_retries_when_unchanged_state_has_new_feedback(
assert len(result.attempt_history) == 3
@pytest.mark.asyncio
async def test_prepare_fix_retries_transient_inconclusive_verification(
tmp_path: Path,
) -> None:
workspace, commit = _workspace(tmp_path)
verifier_calls = 0
async def verify(
context: PreparationContext,
checks: list[CheckResult],
reproduction: CheckResult | None,
) -> VerifierResult:
nonlocal verifier_calls
verifier_calls += 1
if verifier_calls < 3:
return VerifierResult(
decision=VerificationDecision.INCONCLUSIVE,
summary="The independent verifier reached its turn limit.",
gaps=["Independent verification did not complete within 30 turns."],
)
return await _verified(context, checks, reproduction)
result = await prepare_fix(
_request(_candidate(commit), attempts=4),
workspace,
repair=_noop_repair,
verify=verify,
)
assert result.state is PreparationState.READY
assert result.attempts == 3
assert [attempt.verifier.decision for attempt in result.attempt_history] == [
VerificationDecision.INCONCLUSIVE,
VerificationDecision.INCONCLUSIVE,
VerificationDecision.VERIFIED,
]
@pytest.mark.asyncio
async def test_prepare_fix_evaluates_budget_exhausted_patch(tmp_path: Path) -> None:
workspace, commit = _workspace(tmp_path)