feat(retrieval): Phase 6 — integration suite (real valkey-search)#245
Conversation
98fc992 to
e1c6b81
Compare
a7ef1e0 to
94a8bf3
Compare
e1c6b81 to
7d97a4d
Compare
94a8bf3 to
bd4a678
Compare
KIvanow
left a comment
There was a problem hiding this comment.
Approving. Solid end-to-end coverage: graceful FT._LIST skip, pollUntil over fixed sleeps for HNSW propagation, NaN-safe score assertion, and a clean unique-per-run index. Two non-blocking notes for a follow-up:
-
The suite shares and mutates one index, so it is order-dependent despite the "no order-dependence" note. All tests run against the index built in
beforeAll, and thedeletetest (line 176) permanently removesdoc:2, which the NUMERIC-filter test (line 135) andhealthtest rely on. It is green today because Vitest preserves in-file order, but under--sequence.shuffleorconcurrentthe delete could race ahead and break the earlier assertions. Worth isolating the destructive case (its own doc or its own index, like thedropIndextest) or softening the wording. -
The iovalkey
'error'handler is only attached on the skip path (line 62). If the connection drops mid-suite in the non-skip case, an unhandlederrorevent can crash the runner. Attaching it right after construction would harden it.
bd4a678 to
7a8e651
Compare
ac1cd7d to
d857536
Compare
- Add Retriever.integration.test.ts (skip-guarded, VALKEY_URL default 6384) - Cover create index, upsert, vector query returning the upserted doc, TAG and NUMERIC filters, delete, health, and drop end-to-end - Add iovalkey devDependency for the integration client
7a8e651 to
ce5813d
Compare
Phase 6 — Integration suite (real Valkey + valkey-search)
Stacked on #243 (Phase 5) — base is the Phase 5 branch. Final phase of the Retrieval SDK.
What's new
Retriever.integration.test.ts— skip-guarded end-to-end suite against a real valkey-bundle (search module),VALKEY_URLdefaultredis://:devpassword@localhost:6384. Deterministic sha256fakeEmbed(8-dim).Covers the full SDK lifecycle:
createIndex(idempotent — called twice) →upsert→ vector query returns the upserted docid/text/fields/finitescore)register/unregisterdiscovery marker round-trip on__betterdb:cacheshealthsnapshot ·deleteremoves (polls for HNSW propagation) ·dropIndexcleans upReliability
HNSW indexing/deletion is asynchronous, so
beforeAllpolls until every doc is queryable and the delete test polls until propagation completes — no fixed sleeps, no order-dependence. Verified green and non-flaky across multiple live runs (9 integration tests; full package suite 101/101). Addediovalkeyas a devDependency (the library client is caller-supplied; iovalkey is only used by the test).Review-driven changes
A pre-PR review flagged indexing-lag races (filter/delete/hit-shape tests), a NaN-passes-
typeofscore check, and missing FT-capability skip-probe — all fixed; added precomputed-vector + register coverage.Note
Low Risk
Test-only changes with no production SDK or runtime dependency changes beyond lockfile resolution metadata.
Overview
Adds end-to-end integration tests for
Retrieveragainst a live Valkey instance with the search module (VALKEY_URL, defaultlocalhost:6384). The suite skips when Valkey orFT.*is unavailable (FT._LISTprobe).Coverage exercises index lifecycle (idempotent
createIndex), upsert, text and precomputed vector queries, TAG/NUMERIC filters, discovery register/unregister, health, delete, and dropIndex. Setup and assertions use polling instead of fixed sleeps to tolerate async HNSW indexing and deletion.iovalkeyis added as a devDependency for the test client only; runtime SDK behavior is unchanged.Reviewed by Cursor Bugbot for commit ce5813d. Bugbot is set up for automated code reviews on this repo. Configure here.