[search] Reconcile duplicate search implementations (#771) #856

Closed
sleepy wants to merge 0 commits from fix/dedup-search-impl-771 into main
Owner

Summary

Converts services/search/ sub-modules to thin re-export wrappers around the canonical implementations in src/search/.

Changes

File Before After
analytics.py 149-line duplicate Re-export from src.search.analytics
cache.py 62-line duplicate Re-export from src.search.cache
query.py 131-line duplicate Re-export from src.search.query
ranking.py 132-line duplicate Re-export from src.search.ranking
core.py 449-line duplicate (diverged) Re-export from src.search.core
providers.py 543-line duplicate (diverged) Re-export from src.search.providers
content.py Already a re-export (PR #845) Unchanged
service.py Imported from local modules Imports from src.search directly
init.py Imported from local sub-modules Imports from src.search directly

Why src/search/ is canonical

  • Has improved docstrings and error tracking (PR #784)
  • Has the provider retry logic with better diagnostics
  • Used by src/chat_processor.py, src/tool_execution.py, src/deep_research.py, etc.

Testing

  • All 541 tests pass (0 regressions)
  • All existing from services.search import ... paths continue to work

Net: -1420 lines of duplicated code

Closes #771

## Summary Converts services/search/ sub-modules to thin re-export wrappers around the canonical implementations in src/search/. ### Changes | File | Before | After | |------|--------|-------| | analytics.py | 149-line duplicate | Re-export from src.search.analytics | | cache.py | 62-line duplicate | Re-export from src.search.cache | | query.py | 131-line duplicate | Re-export from src.search.query | | ranking.py | 132-line duplicate | Re-export from src.search.ranking | | core.py | 449-line duplicate (diverged) | Re-export from src.search.core | | providers.py | 543-line duplicate (diverged) | Re-export from src.search.providers | | content.py | Already a re-export (PR #845) | Unchanged | | service.py | Imported from local modules | Imports from src.search directly | | __init__.py | Imported from local sub-modules | Imports from src.search directly | ### Why src/search/ is canonical - Has improved docstrings and error tracking (PR #784) - Has the provider retry logic with better diagnostics - Used by src/chat_processor.py, src/tool_execution.py, src/deep_research.py, etc. ### Testing - All 541 tests pass (0 regressions) - All existing from services.search import ... paths continue to work **Net: -1420 lines of duplicated code** Closes #771
Convert services/search/ sub-modules to thin re-export wrappers
around the canonical implementations in src/search/.

- analytics.py, cache.py, query.py, ranking.py: identical files → re-exports
- core.py: src/ has improved docstrings and provider retry tracking → re-export
- providers.py: src/ has improved comments/errata → re-export
- content.py: already a re-export (PR #845)
- service.py: updated to import from src.search directly
- __init__.py: updated to import from src.search directly

No behavioral changes. All existing imports via services.search
continue to work. 541 tests pass (0 regressions).

Closes #771
sleepy closed this pull request 2026-06-04 11:42:26 +02:00

Pull request closed

Sign in to join this conversation.
No description provided.