You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The new IVectorStorage contract runs on 6 of 8 implementations — the two left out are the one the KnowledgeBase uses on SQLite and the Supabase backend #941
027dfa713 added packages/test/src/contract/vector-storage/ — eight assertion modules (similarity ranking, vector round-trip, dimension validation, metadata filter, search options, legacy encoding, the similaritySearch event) behind runVectorStorageContract. It is the right answer to the 2026-09-07 finding that eight vector implementations shared no contract, and the two defects that motivated it (#889's double-decode, and 0dc61428e's JSONB-instead-of-vector column) were both of the class a contract catches and a hand-written test does not.
SqliteAiVectorStorage is the one that ships. It is what packages/test/src/test/helpers/createSqliteKnowledgeBase.ts:77 builds, i.e. the implementation @workglow/knowledge-base actually uses on SQLite. It has its own vector-encoding INSERT path distinct from SqliteVectorStorage's — its _putInternal override exists precisely because "the parent's _putInternal … binds vectors as JSON BLOBs that vector_full_scan cannot decode" (SqliteAiVectorStorage.ts:442-450, whose docstring was rewritten this window). That is the exact shape of #889. Its only coverage is packages/test/src/test/vector/SqliteAiVectorStorage.integration.test.ts, hand-written.
SupabaseVectorStorage has SupabaseVectorStorage.validation.test.ts (validation only) and SupabaseVectorStorage.integration.test.ts (skipped without live Supabase credentials). Nothing exercises its ranking, its returned vector type, its topK/scoreThreshold, its metadata filter, or its similaritySearch event.
Why it matters
The two vector defects this repo found in the last fortnight both presented as "the store accepts writes and looks healthy from every angle except a query":
Nothing failed: the fallback returns the same values, which is why the contract suite passed over SQL it never ran. — 0dc61428e
a store that accepts writes and fails every query looks healthy from anywhere except a query. — 1d3b297 (#889)
A shared contract is the only thing that generalises that. Six of eight leaves the generalisation half-made, and the omitted half includes the implementation a downstream actually runs.
Proposed fix
Add runVectorStorageContract to a SqliteAiVectorStorage.search.test.ts (unit kind, not .integration., for the same reason 1d3b297's commit message gave for naming its own file that way: "a test excluded from CI would not have caught this either").
Add it to the Supabase suite behind the same live-credential skip the integration file already uses, so it runs where credentials exist and is at least written everywhere.
What
027dfa713addedpackages/test/src/contract/vector-storage/— eight assertion modules (similarity ranking, vector round-trip, dimension validation, metadata filter, search options, legacy encoding, thesimilaritySearchevent) behindrunVectorStorageContract. It is the right answer to the 2026-09-07 finding that eight vector implementations shared no contract, and the two defects that motivated it (#889's double-decode, and0dc61428e's JSONB-instead-of-vectorcolumn) were both of the class a contract catches and a hand-written test does not.It runs on six:
There are eight:
Why these two in particular
SqliteAiVectorStorageis the one that ships. It is whatpackages/test/src/test/helpers/createSqliteKnowledgeBase.ts:77builds, i.e. the implementation@workglow/knowledge-baseactually uses on SQLite. It has its own vector-encoding INSERT path distinct fromSqliteVectorStorage's — its_putInternaloverride exists precisely because "the parent's_putInternal… binds vectors as JSON BLOBs thatvector_full_scancannot decode" (SqliteAiVectorStorage.ts:442-450, whose docstring was rewritten this window). That is the exact shape of #889. Its only coverage ispackages/test/src/test/vector/SqliteAiVectorStorage.integration.test.ts, hand-written.SupabaseVectorStoragehasSupabaseVectorStorage.validation.test.ts(validation only) andSupabaseVectorStorage.integration.test.ts(skipped without live Supabase credentials). Nothing exercises its ranking, its returned vector type, itstopK/scoreThreshold, its metadata filter, or itssimilaritySearchevent.Why it matters
The two vector defects this repo found in the last fortnight both presented as "the store accepts writes and looks healthy from every angle except a query":
A shared contract is the only thing that generalises that. Six of eight leaves the generalisation half-made, and the omitted half includes the implementation a downstream actually runs.
Proposed fix
runVectorStorageContractto aSqliteAiVectorStorage.search.test.ts(unit kind, not.integration., for the same reason1d3b297's commit message gave for naming its own file that way: "a test excluded from CI would not have caught this either").BACKENDSrecord the contract iterates, so a newIVectorStorageimplementation missing from it is a type error rather than a review miss. That is what stops this recurring; the tabular suite has had the same gap for six cycles.Found during the 2026-09-14 review of
providers/. Verified againstorigin/main@2d36880. Relates to #701 (box 2).