diff --git a/crates/vestige-core/src/embedder/mod.rs b/crates/vestige-core/src/embedder/mod.rs index e8e654a..c13368b 100644 --- a/crates/vestige-core/src/embedder/mod.rs +++ b/crates/vestige-core/src/embedder/mod.rs @@ -24,8 +24,7 @@ pub type EmbedderResult = std::result::Result; /// Boxed Send future returning an `EmbedderResult`, bound to the lifetime /// of the borrows captured by the call. Used as the return type of every /// async method on the dyn-compatible `Embedder` trait below. -pub type BoxedEmbedderFuture<'a, T> = - Pin> + Send + 'a>>; +pub type BoxedEmbedderFuture<'a, T> = Pin> + Send + 'a>>; /// Pluggable embedder. The storage layer NEVER calls fastembed directly; /// callers compute vectors via this trait and pass them into `MemoryStore`. @@ -78,10 +77,7 @@ pub trait LocalEmbedder: Sync + 'static { /// implementation automatically. pub trait Embedder: Send + Sync + 'static { fn embed<'a>(&'a self, text: &'a str) -> BoxedEmbedderFuture<'a, Vec>; - fn embed_batch<'a>( - &'a self, - texts: &'a [&'a str], - ) -> BoxedEmbedderFuture<'a, Vec>>; + fn embed_batch<'a>(&'a self, texts: &'a [&'a str]) -> BoxedEmbedderFuture<'a, Vec>>; fn model_name(&self) -> &str; fn dimension(&self) -> usize; fn model_hash(&self) -> String; @@ -95,10 +91,7 @@ where fn embed<'a>(&'a self, text: &'a str) -> BoxedEmbedderFuture<'a, Vec> { Box::pin(::embed(self, text)) } - fn embed_batch<'a>( - &'a self, - texts: &'a [&'a str], - ) -> BoxedEmbedderFuture<'a, Vec>> { + fn embed_batch<'a>(&'a self, texts: &'a [&'a str]) -> BoxedEmbedderFuture<'a, Vec>> { Box::pin(::embed_batch(self, texts)) } fn model_name(&self) -> &str { diff --git a/crates/vestige-core/src/storage/memory_store.rs b/crates/vestige-core/src/storage/memory_store.rs index 2869a4e..010ee97 100644 --- a/crates/vestige-core/src/storage/memory_store.rs +++ b/crates/vestige-core/src/storage/memory_store.rs @@ -267,8 +267,7 @@ pub trait LocalMemoryStore: Sync + 'static { /// of the borrows captured by the call (typically `&self` plus any reference /// arguments). Used as the return type of every method on the dyn-compatible /// `MemoryStore` trait below. -pub type BoxedStoreFuture<'a, T> = - Pin> + Send + 'a>>; +pub type BoxedStoreFuture<'a, T> = Pin> + Send + 'a>>; /// Dyn-compatible storage trait. /// @@ -387,7 +386,9 @@ where embedding: &'a [f32], limit: usize, ) -> BoxedStoreFuture<'a, Vec> { - Box::pin(::vector_search(self, embedding, limit)) + Box::pin(::vector_search( + self, embedding, limit, + )) } fn get_scheduling<'a>( @@ -404,7 +405,9 @@ where before: DateTime, limit: usize, ) -> BoxedStoreFuture<'a, Vec<(MemoryRecord, SchedulingState)>> { - Box::pin(::get_due_memories(self, before, limit)) + Box::pin(::get_due_memories( + self, before, limit, + )) } fn add_edge<'a>(&'a self, edge: &'a MemoryEdge) -> BoxedStoreFuture<'a, ()> { diff --git a/tests/phase_1/domain_column_migration.rs b/tests/phase_1/domain_column_migration.rs index 67e318b..031ca65 100644 --- a/tests/phase_1/domain_column_migration.rs +++ b/tests/phase_1/domain_column_migration.rs @@ -6,7 +6,7 @@ use uuid::Uuid; use vestige_core::storage::{MemoryRecord, MemoryStore, SqliteMemoryStore}; #[tokio::test] -async fn fresh_db_has_v12_schema() { +async fn fresh_db_has_v16_schema() { let dir = tempdir().unwrap(); let db = dir.path().join("fresh.db"); let _store = SqliteMemoryStore::new(Some(db.clone())).expect("create"); @@ -50,13 +50,13 @@ async fn v11_db_upgrades_cleanly() { next_review, scheduled_days, has_embedding) \ VALUES (?1, ?2, 'fact', datetime('now'), datetime('now'), datetime('now'), \ 1.0, 0.3, 0, 0, 'new', 1.0, 1.0, 1.0, datetime('now'), 1, 0)", - rusqlite::params![format!("pre-v12-{i}"), format!("content {i}"),], + rusqlite::params![format!("pre-v16-{i}"), format!("content {i}"),], ) - .expect("insert pre-v12 row"); + .expect("insert pre-v16 row"); } } // Upgrade by opening through SqliteMemoryStore (triggers full migration) - let _store = SqliteMemoryStore::new(Some(db.clone())).expect("open with v12"); + let _store = SqliteMemoryStore::new(Some(db.clone())).expect("open with v16"); // Check all 5 rows have empty domains/domain_scores let conn = rusqlite::Connection::open(&db).expect("open raw"); let count: i64 = conn @@ -68,7 +68,7 @@ async fn v11_db_upgrades_cleanly() { .expect("count"); assert_eq!( count, 5, - "all pre-v12 rows must have empty domains/domain_scores" + "all pre-v16 rows must have empty domains/domain_scores" ); } @@ -157,5 +157,5 @@ async fn domains_table_exists() { |row| row.get(0), ) .expect("query"); - assert_eq!(count, 1, "domains table must exist after V12 migration"); + assert_eq!(count, 1, "domains table must exist after V16 migration"); }