Skip to content

refactor(memory): enforce VectorStore search clamp via template method#6627

Merged
bug-ops merged 1 commit into
mainfrom
fix/6623-vectorstore-clamp-structural
Jul 21, 2026
Merged

refactor(memory): enforce VectorStore search clamp via template method#6627
bug-ops merged 1 commit into
mainfrom
fix/6623-vectorstore-clamp-structural

Conversation

@bug-ops

@bug-ops bug-ops commented Jul 21, 2026

Copy link
Copy Markdown
Owner

Summary

Closes #6623

Test plan

  • cargo nextest run --config-file .github/nextest.toml -p zeph-memory — 1702 passed, 31 skipped, 0 failed (includes 2 new clamp-enforcement tests)
  • cargo +nightly fmt --check
  • cargo clippy --profile ci --workspace --all-targets --features "desktop,ide,server,chat,pdf,scheduler,testing" -- -D warnings
  • cargo nextest run --config-file .github/nextest.toml --workspace --features "desktop,ide,server,chat,pdf,scheduler" --lib --bins — 15033 passed, 36 skipped, 0 failed
  • RUSTFLAGS="-D warnings" RUSTDOCFLAGS="--deny rustdoc::broken_intra_doc_links" cargo doc --no-deps --workspace --features "desktop,ide,server,chat,pdf,scheduler"
  • cargo test --doc -p zeph-memory — 61 passed
  • gitleaks protect --staged

@github-actions github-actions Bot added documentation Improvements or additions to documentation memory zeph-memory crate (SQLite) rust Rust code changes refactor Code refactoring without functional changes size/M Medium PR (51-200 lines) labels Jul 21, 2026
@bug-ops
bug-ops enabled auto-merge (squash) July 21, 2026 00:46
Convert VectorStore::search from a single required method into a
template-method pair: search is now trait-provided and clamps limit
before delegating to a new required search_clamped method that
implementors supply. Closes the gap flagged in #6623, where the
clamp added in #6622 relied on every implementor remembering to call
clamp_search_limit itself — a convention a 4th implementor (the
FailingSearchStore test mock) had already silently skipped.

Migrates QdrantOps, DbVectorStore, InMemoryVectorStore, and
FailingSearchStore to the new contract. Public search API and
behavior are unchanged for all callers.

Closes #6623
@bug-ops
bug-ops force-pushed the fix/6623-vectorstore-clamp-structural branch from e641e5f to 7d58019 Compare July 21, 2026 00:47
@bug-ops
bug-ops merged commit f34783c into main Jul 21, 2026
43 checks passed
@bug-ops
bug-ops deleted the fix/6623-vectorstore-clamp-structural branch July 21, 2026 00:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation memory zeph-memory crate (SQLite) refactor Code refactoring without functional changes rust Rust code changes size/M Medium PR (51-200 lines)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

zeph-memory: VectorStore search clamp is convention-based per-impl, not structurally enforced

1 participant