Skip to content

fix: add acceptance matrix for vectors#1132

Merged
ferhatelmas merged 2 commits into
masterfrom
ferhat/vector-acceptance
Jun 4, 2026
Merged

fix: add acceptance matrix for vectors#1132
ferhatelmas merged 2 commits into
masterfrom
ferhat/vector-acceptance

Conversation

@ferhatelmas

Copy link
Copy Markdown
Member

What kind of change does this PR introduce?

Bug fix

What is the current behavior?

  • no acceptance tests or orioledb support
  • there are cases validation is missed such as metadata size, duplicate keys, etc.
  • adapters can differ from each other
  • certain failure scenarios exist such as create index can leave physical index, delete index can be reusable before teardown, etc.

What is the new behavior?

  • add acceptance tests and orioledb support
  • harden validation and improve schema/docs
  • make pgvector closer to s3vectors
  • improve lifecycle management

Additional context

Acceptance coverage for #1094
Addresses #1127 as well

Copilot AI review requested due to automatic review settings June 3, 2026 16:32
@ferhatelmas ferhatelmas requested a review from a team as a code owner June 3, 2026 16:32

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/http/routes/vector/create-index.ts Outdated
@coveralls

coveralls commented Jun 3, 2026

Copy link
Copy Markdown

Coverage Report for CI Build 26940644363

Coverage increased (+0.9%) to 76.309%

Details

  • Coverage increased (+0.9%) from the base build.
  • Patch coverage: 29 uncovered changes across 7 files (429 of 458 lines covered, 93.67%).
  • 2 coverage regressions across 2 files.

Uncovered Changes

File Changed Covered %
src/storage/protocols/vector/vector-store.ts 181 161 88.95%
src/storage/protocols/vector/adapter/pgvector/index.ts 138 134 97.1%
src/http/plugins/vector.ts 1 0 0.0%
src/internal/database/migrations/migrate.ts 11 10 90.91%
src/storage/protocols/vector/adapter/pgvector/errors.ts 1 0 0.0%
src/storage/protocols/vector/adapter/pgvector/filter.ts 44 43 97.73%
src/storage/protocols/vector/knex.ts 17 16 94.12%
Total (27 files) 458 429 93.67%

Coverage Regressions

2 previously-covered lines in 2 files lost coverage.

File Lines Losing Coverage Coverage
src/storage/protocols/vector/adapter/s3-vector.ts 1 39.58%
src/storage/protocols/vector/vector-store.ts 1 79.31%

Coverage Stats

Coverage Status
Relevant Lines: 11012
Covered Lines: 8837
Line Coverage: 80.25%
Relevant Branches: 6438
Covered Branches: 4479
Branch Coverage: 69.57%
Branches in Coverage %: Yes
Coverage Strength: 365.41 hits per line

💛 - Coveralls

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 49 out of 49 changed files in this pull request and generated 1 comment.

Comment thread src/storage/protocols/vector/adapter/pgvector/filter.ts
@blacksmith-sh

This comment has been minimized.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 49 out of 49 changed files in this pull request and generated 2 comments.

Comment thread src/test/vectors.test.ts
Comment thread src/http/error-handler.ts Outdated
@ferhatelmas ferhatelmas force-pushed the ferhat/vector-acceptance branch 2 times, most recently from e1e68f8 to fae000e Compare June 3, 2026 17:07
@ferhatelmas ferhatelmas requested a review from Copilot June 3, 2026 17:08

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 49 out of 49 changed files in this pull request and generated 1 comment.

Comment thread src/http/error-handler.ts
* add orioledb support
* harden validation
* make pgvector closer to s3vectors
* improve lifecycle management

Signed-off-by: ferhat elmas <elmas.ferhat@gmail.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 49 out of 49 changed files in this pull request and generated no new comments.

Signed-off-by: ferhat elmas <elmas.ferhat@gmail.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 49 out of 49 changed files in this pull request and generated no new comments.

@ferhatelmas ferhatelmas merged commit 8e2704e into master Jun 4, 2026
23 checks passed
@ferhatelmas ferhatelmas deleted the ferhat/vector-acceptance branch June 4, 2026 08:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants