feat: coverage-driven extraction retry ladder (agent path)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user