From dab3bb2437d180e644c78b9d10343f219c4a747f Mon Sep 17 00:00:00 2001 From: typosaurus Date: Sat, 8 Aug 2026 02:56:05 +0000 Subject: [PATCH] feat(nadia): @nadia: Fix the two review findings in the research engine: (1) retry failed wor Outcome: done Changed: src/typosaurus_sandbox/research/engine.py:108-111,156-163,173-177, src/typosaurus_sandbox/research/pipeline.py:20-23,187-234,296-312, tests/test_research_engine.py:186-290, tests/test_research_pipeline.py:292-354 Verified by: verify() -> "make verify" exit_code 0, "Ran 226 tests OK verification passed"; only pre-existing StarletteDeprecationWarning from fastapi/testclient.py import in tests/test_api.py, none introduced Findings: Retry: pipeline.py:192-211 retries RsearchError status>=500 with backoff min(0.5*2^(attempt-1),8.0) up to RETRY_MAX_ATTEMPTS=3 (pipeline.py:20-23); status<500 or None not retried. Unexpected exceptions recorded as failure WorkOutcome in consume (pipeline.py:296-312), appended to outcomes. Closure gated on requests_failed==0 (engine.py:159-163); report.closed=requests_failed==0 (engine.py:177); failed round prevents closure, later clean round keeps report.closed False (tests/test_research_engine.py:229-290). Deep/ai wired: every popped query yields WorkItem("web",query,deep=True,ai=True) (engine.py:111); pipeline passes deep/ai to client.search and cache probe (pipeline.py:157-158,170-176); test proves seed+subtopic web calls all carry deep=True and ai=True (tests/test_research_engine.py:203-222). Fix committed as 472a59e; this node's working-tree delta is only trailing-blank cleanup; no new dependencies, client.py/cache.py/config.py/frontier.py untouched. Open: none Confidence: high - all six acceptance criteria met with direct Typosaurus-Run: 4e2afb673c7f4578a12276d9181b982d Typosaurus-Node: e6071c7595ab487b84f99476243abe28 Typosaurus-Agent: @nadia Refs: #31 --- src/typosaurus_sandbox/research/engine.py | 3 --- src/typosaurus_sandbox/research/pipeline.py | 4 ---- tests/test_research_engine.py | 6 ------ tests/test_research_pipeline.py | 5 ----- 4 files changed, 18 deletions(-) diff --git a/src/typosaurus_sandbox/research/engine.py b/src/typosaurus_sandbox/research/engine.py index 30ecfdf..2f1741c 100644 --- a/src/typosaurus_sandbox/research/engine.py +++ b/src/typosaurus_sandbox/research/engine.py @@ -208,6 +208,3 @@ class ResearchEngine: report.cache_misses = total_items - report.cache_hits - - - diff --git a/src/typosaurus_sandbox/research/pipeline.py b/src/typosaurus_sandbox/research/pipeline.py index 9bb8f46..8b59056 100644 --- a/src/typosaurus_sandbox/research/pipeline.py +++ b/src/typosaurus_sandbox/research/pipeline.py @@ -343,7 +343,3 @@ class ResearchPipeline: report.contents_seen += outcome.contents_seen return report - - - - diff --git a/tests/test_research_engine.py b/tests/test_research_engine.py index 51381ad..dc2e3d3 100644 --- a/tests/test_research_engine.py +++ b/tests/test_research_engine.py @@ -303,9 +303,3 @@ if __name__ == "__main__": - - - - - - diff --git a/tests/test_research_pipeline.py b/tests/test_research_pipeline.py index 0e6fae6..1dc5d5d 100644 --- a/tests/test_research_pipeline.py +++ b/tests/test_research_pipeline.py @@ -354,8 +354,3 @@ class TestPipelineRetryAndFailureAccounting(unittest.IsolatedAsyncioTestCase): if __name__ == "__main__": unittest.main() - - - - -