feat: coverage-driven extraction retry ladder (agent path)
Docker Release / build-and-push (push) Successful in 1m14s
Docker Release / release (push) Skipped

This commit is contained in:
2026-08-18 13:38:30 -05:00
parent 48fefa4007
commit fe09e4a66b
4 changed files with 195 additions and 7 deletions
@@ -68,9 +68,12 @@ def test_run_compact_retry_after_hard_failure():
assert "COMPACT RETRY" in mock_call.call_args_list[1].kwargs["user_text"]
def test_run_fails_only_after_both_attempts_miss():
def test_run_returns_empty_sheet_after_both_attempts_miss():
agent = SheetExtractorAgent(usage=AgentUsage())
with patch("backend.agents.extractors.call_json", return_value=None) as mock_call:
result = agent.run(_scope())
assert result.error == "no structured extraction returned"
# Coverage ladder: no text layer to rescue the page -> empty sheet,
# but no hard failure (the ladder replaced the old raise).
assert not result.error
assert result.artifacts[0]["assertions"] == []
assert mock_call.call_count == 2