refactor(search): address PR #750 round 11 review feedback
Three minor fixes from the round-11 review on PR #750: - bm25_hybrid.py:209 — Comment said `doc_id` is `int (notes) or str (files)`, which is backwards. Notes, news_items, and deck_cards are stored as `str` (scanner.py:241, 666, 867); files are stored as `int` (scanner.py:425). Updated to point readers at scanner.py as the source of truth. - verification.py:338 — Lowered the News-API 403/404 log line from `info` to `debug`. The News app being uninstalled or disabled is a predictable operational state (matching the other verifiers' debug-on-not-found paths), so this should not generate operator-dashboard noise. Transient errors immediately below stay at `warning` because they're unexpected. - semantic.py:809 — `nc_get_vector_sync_status` was reading `document_receive_stream` via `getattr(..., None)`, but the attribute is guaranteed-defined on both `AppContext` and `OAuthAppContext` (as a field with `None` default). The defensive `getattr` masked typos that the eviction_task_group access at semantic.py:197-199 deliberately surfaces. Switched to direct access; the `if … is None:` value-check below is preserved (the attribute can legitimately be None before sync starts). Items deliberately deferred (with rationale in the plan file): - News verifier semaphore-hold during get_items (reviewer: "not required here, just worth tracking"; ADR already lists follow-ups). - Hardcoded 2× over-fetch / VERIFICATION_OVERFETCH (TODO already in code). - Integration test for the real Qdrant eviction filter (reviewer marked low-priority; type-preservation chain is unit-tested). 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
15ffeca312
commit
1ed8362f78
@@ -335,7 +335,10 @@ async def _verify_news_items(
|
||||
# If the News API itself is gone (app disabled, user lost access),
|
||||
# treat *all* requested items as inaccessible. Eviction will reclaim.
|
||||
if _is_definitive_404_or_403(e):
|
||||
logger.info(
|
||||
# News app commonly disabled/uninstalled — debug-level keeps
|
||||
# this off operator dashboards; transient errors below stay
|
||||
# at warning because they're unexpected.
|
||||
logger.debug(
|
||||
"News API returned %s for user %s; treating all %d news_items as inaccessible",
|
||||
e.response.status_code,
|
||||
client.username,
|
||||
|
||||
Reference in New Issue
Block a user