Files
silo-server/internal/recommendations/search_query_vector_test.go
QuickandClaude Opus 4.8 ed6c084c68 feat(search): gate index events by active provider and harden rebuild reconcile
Completes the search-provider-interface wiring that the catalog hardening
commits already call into:

- Skip the transactional search-index-event write path when Meilisearch is
  not the active provider (ItemRepository.WithActiveSearchProvider /
  SearchIndexEventRepository.disabledByActiveProvider).
- Dead-letter catalog_search_index_events after 10 attempts instead of
  retrying forever.
- Track the rebuild high-water mark (MaxEventID / MarkProcessedThrough) and
  persist last_processed_event_id in UpdateStateAfterRebuild so a rebuild
  reconciles events enqueued during the rebuild.
- Validate (read-only) the embedding lock when embedding a search query
  instead of establishing/mutating it.
- Surface total_exact on the legacy /items browse response.
- Wire the active catalog search provider into the scanner and item repo at
  startup.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-26 08:34:04 -04:00

23 lines
682 B
Go

package recommendations
import "testing"
func TestValidateQueryEmbeddingLockAllowsMissingLock(t *testing.T) {
if err := validateQueryEmbeddingLock(nil, "http://embeddings", "model-a", 1536); err != nil {
t.Fatalf("missing query embedding lock returned error: %v", err)
}
}
func TestValidateQueryEmbeddingLockChecksExistingLock(t *testing.T) {
lock := &EmbeddingLock{
BaseURL: "http://embeddings",
Model: "model-a",
SourceDimensions: 384,
StorageDimensions: CanonicalEmbeddingDimensions,
}
if err := validateQueryEmbeddingLock(lock, "http://embeddings", "model-a", 1536); err == nil {
t.Fatal("dimension mismatch returned nil error")
}
}