Repository navigation
fix(memory): preserve vector data and harden persistence - #1819
Draft
EmersonBraun wants to merge 4 commits into
Draft
EmersonBraun wants to merge 4 commits into
EmersonBraun wants to merge 4 commits into
Conversation
Use isolated temporary directories in memory file-store tests.
This branch has not been deployed
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.
Redis vector commands previously converted binary embeddings to strings, corrupting their bytes. This change preserves Buffer arguments, uses stable Vectra IDs and ordered Mongo ID upserts when supported, and protects adapter-owned ID/content fields.
It also preserves synchronous localStorage writes and expiry purges, uses atomic file replacement for the localStorage fallback, includes SQLite KV eviction in supported transactions, continues multi-backend erasure after failures, and retries failed lazy initialization after best-effort cleanup of owned resources. Tests cover local Vectra reopen/deletion, SQLite rollback, file corruption/rename failures, and mocked Redis/Mongo adapter behavior.
Vector KV TTL remains logical visibility only; physical deletion and maxMessages eviction are not implemented. Bounded over-fetch can miss live rows. Legacy Vectra duplicates and insert-only injected collection behavior are retained. Metadata-filter and legacy namespace contracts require separate work.
Validation: package tests/coverage, TypeScript lint, CJS/ESM/declaration build, and diff checks pass. The configured documentation gate and memory handoff query pass after local index regeneration; broad generated index changes are excluded from this PR. Live Redis/Mongo services were not exercised.
Final local evidence: 33 test files / 268 tests pass; 95.01% line coverage (90% required). The official gzip measurement is 15,998 bytes against the configured 16,000-byte limit; its margin is small, so CI size validation remains important.
The CI quality job builds all package artifacts required by the packed-consumer contract before evaluating it. The temporary-file regression fixtures use isolated directories and verify cleanup within those directories. Existing publication checks and size/coverage limits remain enforced.