Skip to content

fix: discard stale raw vectors when overwriting snapshots - #87

Merged
Pringled merged 2 commits into
MinishLab:mainfrom
N7766:codex/fix-overwrite-vector-store
Nov 27, 2026
Merged

Pringled merged 2 commits into
MinishLab:mainfrom
N7766:codex/fix-overwrite-vector-store

Conversation

@N7766

@N7766 N7766 commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #86.

Overwriting a snapshot saved with store_vectors=True using an instance with store_vectors=False currently leaves the old raw vectors attached to the new items. Remove the library-owned store/ directory when the new instance has no vector store. The original load check and overwrite documentation remain unchanged.

Following review, regression coverage is one test in tests/test_vicinity.py: save stored vectors, overwrite without them, reload, and verify current items/query results with raw-vector access unavailable.

Validation (Python 3.11.13, NumPy 2.0.2):

  • New regression fails on unchanged main 2fd706d because the old vector store is loaded; passes with this fix.
  • pytest tests/test_vicinity.py -k 'BASIC or overwrite_without_vector_store' -q: 16 passed.
  • Three existing stored-vector tests plus tests/test_utils.py: 6 passed.
  • Pinned Ruff 0.4.10 lint/format, pydoclint 0.5.3 with repository configuration, and git diff --check: passed.

The full multi-backend suite and upstream CI were not run locally. Tests use local synthetic arrays; no model or embedding service was called. Prepared with Codex assistance.

Comment thread vicinity/vicinity.py Resolved
Comment thread vicinity/vicinity.py Resolved
Comment thread tests/test_snapshot_overwrite.py Resolved
@N7766

N7766 commented Nov 27, 2026

Copy link
Copy Markdown
Contributor Author

Updated as requested: remove the entire library-owned store/, restore the original load check, drop the extra docstring line, and keep one regression in tests/test_vicinity.py. It fails on unchanged main; the fix passes 22 focused checks plus lint/format. Full multi-backend tests were not run. Thanks!

@codecov

codecov Bot commented Nov 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Files with missing lines Coverage Δ
tests/test_vicinity.py 100.00% <100.00%> (ø)
vicinity/vicinity.py 96.15% <100.00%> (-2.40%) ⬇️

... and 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Pringled

Copy link
Copy Markdown
Member

@N7766 thanks for making the changes, LGTM

@Pringled
Pringled merged commit 6f54ed5 into MinishLab:main Nov 27, 2026
5 checks passed
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.

Overwriting a snapshot without raw vectors reloads the previous snapshot's vectors

2 participants