From 76cd716de65c4d45867b084eb8fbcc8df1a1779d Mon Sep 17 00:00:00 2001 From: Chris Coutinho Date: Thu, 18 Jun 2026 00:38:28 +0200 Subject: [PATCH] test(integration): str-coerce id comparison in document_is_searchable Round-10 review nit: match the defensive `str(id) == str(note_id)` pattern used by _poll_astrolabe_search_for_note. nc_semantic_search returns int ids today (behaviour-neutral now), but the coercion guards against a future schema change serialising ids as strings, which would otherwise silently break the match and time out with a generic message. Co-Authored-By: Claude Opus 4.8 (1M context) --- tests/integration/_search_helpers.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/integration/_search_helpers.py b/tests/integration/_search_helpers.py index b7414095..404d6835 100644 --- a/tests/integration/_search_helpers.py +++ b/tests/integration/_search_helpers.py @@ -46,7 +46,11 @@ async def document_is_searchable( tokens = search_term.lower().split() for r in results: if note_id is not None: - if r.get("id") == note_id: + # str-coerce both sides: nc_semantic_search returns int ids today, + # but the Astrolabe API serialises some ids as strings — match the + # defensive comparison in _poll_astrolabe_search_for_note so a future + # schema change can't silently break the match. + if str(r.get("id")) == str(note_id): if r.get("doc_type") == "note": return True # id matched but not a note — surface possible schema drift at