Repository navigation
refactor(search): name storage search DTOs honestly - #1565
Conversation
Problem: #873 calls out split ranked-hit models. The storage layer did need lightweight SQL/id DTOs, but naming them ConversationSearchHit and ConversationSearchEvidenceHit made them look like the public archive ranked-hit contract and invited future surface drift.\n\nWhat changed: renamed the storage-only id hit to ConversationSearchIdHit and the pre-hydration evidence DTO to ConversationSearchEvidenceRow. The repository still hydrates those rows into the public archive ConversationSearchHit before returning search-summary evidence to surfaces.\n\nVerification: pytest -q tests/unit/storage/test_archive_search_contracts.py tests/unit/storage/test_search_explanation_wiring.py --tb=short; ruff format --check on touched files; ruff check on touched files; mypy on touched files; devtools verify --json (630 selected tests passed).\n\nRef #873
|
Warning Review limit reached
Your plan includes 1 review of capacity. Refill in 48 minutes and 4 seconds. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more review capacity refills, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than trial, open-source, and free plans. In all cases, review capacity refills continuously over time. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (6)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
This narrows a #873 source of confusion by renaming storage-only search DTOs so they no longer masquerade as the public ranked-hit contract.
Problem
#873 still listed “split search hit models” as a residual. Reading the code showed the split is legitimate at the data-shape level: storage query helpers return lightweight SQL/id rows before repository hydration, while archive/query returns the public summary-plus-evidence
ConversationSearchHit. The problem was the storage names,ConversationSearchHitandConversationSearchEvidenceHit, which implied a second public ranked-hit model and made future drift more likely.Solution
Renamed the storage-only id DTO to
ConversationSearchIdHitand the pre-hydration evidence DTO toConversationSearchEvidenceRow. Repository search still maps those rows into the public archiveConversationSearchHitbefore surfaces see them. No compatibility aliases were added.Verification
pytest -q tests/unit/storage/test_archive_search_contracts.py tests/unit/storage/test_search_explanation_wiring.py --tb=short— 20 passed.ruff format --checkon touched files — passed.ruff checkon touched files — passed.mypyon touched files — passed.devtools verify --json— exit 0; 630 pytest-testmon selected tests passed; total 195.14s.devtools verify --quick— exit 0; total 34.88s.Ref #873