refactor(search): address PR #750 round 12 review feedback
Six review items raised; four required code changes (#3, #4, #5, #6) and two were resolved without code changes (#1 audit-only, #2 informational). * search/verification.py — clarify the granularity asymmetry between the whole-batch fail-open (structural API failure) and the per-item fail-open (single bad stored doc_id). Future readers no longer need to derive why the two paths have different blast radii from the code alone. * models/semantic.py — `dropped_document_count` description now explicitly notes that subtracting it from `verified_chunk_count` is not a meaningful operation, since the two fields count different units (documents vs chunks). Surfaces the unit mismatch where MCP clients actually see it. * server/semantic.py — clarify the per-doc_type over-fetch comment so the N×2 pre-merge Qdrant cost (vs the cross-app branch's 1×2) is explicit rather than implied by "same 2× over-fetch budget". * tests/unit/search/test_verification.py — add four new 429 unit tests (notes/news/files/deck) mirroring the existing 5xx-keeps pattern. Locks in that `_is_definitive_404_or_403` returns False for 429 so a future refactor cannot accidentally treat rate-limit responses as permanent revocations. Audit confirmation for review item #1: all four `WebDAVClient.get_file_info` call sites already handle the new `HTTPStatusError`-on-404 contract (verification.py:156, tests/integration/test_rag.py:139, tests/unit/client/test_webdav.py:153/190). No silent breakage internal to this repo. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.7
parent
1ed8362f78
commit
104bbd390d
@@ -97,7 +97,11 @@ class SemanticSearchResponse(BaseResponse):
|
||||
"records during verify-on-read (ADR-019). A short result page "
|
||||
"(len(results) < limit) combined with a non-zero "
|
||||
"dropped_document_count indicates ghost density rather than "
|
||||
"scarcity of relevant content."
|
||||
"scarcity of relevant content. Note: this counter is sized in "
|
||||
"unique documents while verified_chunk_count is sized in "
|
||||
"chunks — a single document can contribute multiple chunks, "
|
||||
"so subtracting dropped_document_count from "
|
||||
"verified_chunk_count is NOT a meaningful operation."
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user