fix: add acceptance matrix for vectors#1132
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR expands the vector bucket implementation to support a pgvector-backed local provider (including OrioleDB), adds a broad acceptance matrix for vector operations, and hardens request/runtime validation so pgvector behavior aligns more closely with S3Vectors.
Changes:
- Add vector acceptance coverage (pagination, filters, metadata constraints, distance semantics) and enable it in the GitHub Actions acceptance matrix, including an OrioleDB+pgvector image path.
- Harden vector API validation to avoid type coercion, enforce limits (dimensions, keys, counts), and improve lifecycle/cleanup semantics around index creation/deletion with sharding reservations.
- Enhance pgvector adapter behavior (segmented listing, list-valued metadata, OrioleDB bridged-HNSW fallbacks, capability caching) and add extensive unit/integration tests.
Reviewed changes
Copilot reviewed 49 out of 49 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/test/webhooks.test.ts | Stabilizes webhook test timestamps by inserting deterministic object created_at/updated_at values. |
| src/test/vectors.test.ts | Adds many API-level validation tests (no coercion, bounds, metadata config constraints, error mapping). |
| src/test/vectors-pgvector.test.ts | Extends real pgvector integration coverage (pagination and segment disjointness). |
| src/test/sharding.test.ts | Ensures confirmed reservations are not cancelled. |
| src/test/pgvector-adapter.test.ts | Adds extensive pgvector adapter tests including OrioleDB-bridged behavior and validation parity. |
| src/storage/protocols/vector/vector-store.ts | Adds stricter limits/validation, filter key enforcement, and robust shard reservation + physical index cleanup logic. |
| src/storage/protocols/vector/pagination.ts | Introduces shared “N+1” pagination helper for consistent nextToken behavior. |
| src/storage/protocols/vector/limits.ts | Centralizes S3Vectors-aligned limits and shared validation helpers (keys, duplicate put keys, etc.). |
| src/storage/protocols/vector/knex.ts | Adds AsyncLocalStorage-based resolver to reuse an active transaction for pgvector DDL in multitenant mode; uses shared pagination helper. |
| src/storage/protocols/vector/errors.ts | Adds helpers to classify vector conflict/not-found errors by code. |
| src/storage/protocols/vector/adapter/s3-vector.ts | Maps upstream S3Vectors ValidationException to InvalidParameter. |
| src/storage/protocols/vector/adapter/s3-vector.test.ts | Tests mapping of S3Vectors validation errors into storage errors. |
| src/storage/protocols/vector/adapter/pgvector/index.ts | Adds limits enforcement, OrioleDB bridged-HNSW fallbacks (manual upsert, exact scan), segmentation, and pagination helper usage. |
| src/storage/protocols/vector/adapter/pgvector/filter.ts | Extends filter translation to support scalar filters against list-valued metadata. |
| src/storage/protocols/vector/adapter/pgvector/filter.test.ts | Updates filter SQL expectations and adds list-valued metadata matching coverage. |
| src/storage/protocols/vector/adapter/pgvector/errors.ts | Maps pgvector cardinality violations (duplicate keys) to InvalidParameter. |
| src/internal/sharding/strategy/catalog.ts | Prevents cancelling non-pending reservations. |
| src/internal/errors/codes.ts | Exposes getErrorCode for reuse. |
| src/internal/errors/codes.test.ts | Adds tests for getErrorCode mapping (Fastify validation → InvalidRequest, etc.). |
| src/internal/database/migrations/vector-store-migrations.test.ts | Adds test ensuring Oriole-specific vector DB setup and vector migrations run correctly. |
| src/internal/database/migrations/migrate.ts | Configures storage_vectors DB default access method for Oriole (and installs Oriole extension) when needed. |
| src/http/routes/vector/validation.ts | Adds shared Ajv validator compiler with coerceTypes: false to prevent scalar coercion. |
| src/http/routes/vector/validation.test.ts | Tests referenced-schema validation without coercion. |
| src/http/routes/vector/query-vectors.ts | Tightens schema (topK bounds, query vector non-empty) and adopts shared no-coercion validator. |
| src/http/routes/vector/put-vectors.ts | Tightens schema (required key, key length, vector non-empty, list-valued metadata) and adopts no-coercion validator. |
| src/http/routes/vector/list-vectors.ts | Updates schema limits and adds explicit segment invariants + no-coercion validator. |
| src/http/routes/vector/list-indexes.ts | Uses shared no-coercion validator. |
| src/http/routes/vector/list-buckets.ts | Uses shared no-coercion validator. |
| src/http/routes/vector/get-vectors.ts | Tightens keys schema (min/max items, key length) and uses no-coercion validator. |
| src/http/routes/vector/get-index.ts | Uses shared no-coercion validator. |
| src/http/routes/vector/get-bucket.ts | Uses shared no-coercion validator. |
| src/http/routes/vector/delete-vectors.ts | Tightens keys schema (min/max items, key length) and uses no-coercion validator. |
| src/http/routes/vector/delete-index.ts | Uses shared no-coercion validator. |
| src/http/routes/vector/delete-bucket.ts | Uses shared no-coercion validator. |
| src/http/routes/vector/create-index.ts | Tightens schema (integer dimensions, metadata config constraints) and uses no-coercion validator. |
| src/http/routes/vector/create-bucket.ts | Fixes request type name and uses shared no-coercion validator. |
| src/http/plugins/vector.ts | Wires pgvector to use transaction-aware knex resolver in multitenant mode. |
| src/http/error-handler.ts | Uses getErrorCode to return more accurate error codes for Fastify errors (e.g., InvalidRequest). |
| src/http/error-handler.test.ts | Tests Fastify schema validation error mapping to InvalidRequest. |
| package.json | Adds Oriole+pgvector infra/test scripts. |
| acceptance/specs/vector.test.ts | Adds broad acceptance coverage for vectors (pagination, distance, filters, non-filterable keys, limits). |
| acceptance/scripts/run-managed-local.ts | Allows Oriole+pgvector infra restart script for local managed runs. |
| acceptance/README.md | Documents vector acceptance behavior on local pgvector and OrioleDB matrix rows. |
| acceptance/API_COVERAGE.md | Updates vector acceptance coverage description to include added cases. |
| .github/workflows/acceptance.yml | Enables vector acceptance in matrix and configures pgvector provider/migrations vars. |
| .env.acceptance.sample | Updates vector acceptance prerequisites (local pgvector or S3Vectors). |
| .docker/orioledb-pgvector.Dockerfile | Adds OrioleDB image build that compiles/installs pgvector. |
| .docker/docker-compose-infra-oriole-pgvector-override.yml | Adds compose override to build/use OrioleDB+pgvector image for infra. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Coverage Report for CI Build 26940644363Coverage increased (+0.9%) to 76.309%Details
Uncovered Changes
Coverage Regressions2 previously-covered lines in 2 files lost coverage.
Coverage Stats💛 - Coveralls |
b68558e to
851b7ac
Compare
851b7ac to
9c68b15
Compare
This comment has been minimized.
This comment has been minimized.
e1e68f8 to
fae000e
Compare
* add orioledb support * harden validation * make pgvector closer to s3vectors * improve lifecycle management Signed-off-by: ferhat elmas <elmas.ferhat@gmail.com>
fae000e to
ce6e4f9
Compare
itslenny
approved these changes
Jun 3, 2026
fenos
approved these changes
Jun 4, 2026
Signed-off-by: ferhat elmas <elmas.ferhat@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What kind of change does this PR introduce?
Bug fix
What is the current behavior?
What is the new behavior?
Additional context
Acceptance coverage for #1094
Addresses #1127 as well