vestige/crates
Jan De Landtsheer a4a6e877c5 feat(storage): swap async-trait for trait_variant + dyn adapter (0001a)
Replaces #[async_trait::async_trait] on the storage trait with a
trait_variant-driven layout plus a hand-written dyn-compatible adapter.

- memory_store.rs: LocalMemoryStore is the source trait declared with
  native async-fn-in-trait. #[trait_variant::make(MemoryStoreSend: Send)]
  derives the Send-bounded variant that backends actually implement (the
  blanket impl in 0.1.x goes variant -> source). A hand-written
  MemoryStore trait wraps every method in
  Pin<Box<dyn Future<Output = MemoryStoreResult<T>> + Send + 'a>> with
  a BoxedStoreFuture<'a, T> alias, and a blanket impl<T: MemoryStoreSend>
  MemoryStore for T adapts every Send-variant implementation. This keeps
  Arc<dyn MemoryStore> dyn-safe for Phase 1 cognitive-module tests --
  trait_variant 0.1 alone does NOT produce a dyn-safe variant (RPITIT),
  so the hand-written adapter is required and supersedes the plan claim
  that trait_variant gives dyn-compat for free.
- sqlite.rs: drop the #[async_trait::async_trait] attribute on the impl
  block and retarget it to MemoryStoreSend. Two pre-existing clippy
  issues that the macro had been masking are fixed in the same body
  (return Ok(out) tail expression in vector_search; DomainRow tuple
  alias in get_domain).
- mod.rs: export MemoryStoreSend alongside the existing LocalMemoryStore
  and MemoryStore re-exports.

Verification: cargo test -p vestige-core --features embeddings,vector-search
passes (428 lib tests). All five Phase 1 integration test binaries pass
(trait_round_trip, send_bound_variant including
arc_dyn_memory_store_moves_across_tokio_tasks, cognitive_module_isolation,
embedding_model_registry, domain_column_migration). cargo test --workspace
green across every test binary. cargo build --workspace --release green.
cargo clippy --workspace --features embeddings,vector-search -- -D warnings
clean. grep -rn async_trait crates/vestige-core/src/storage/ returns
zero hits.

Supersedes plan claim in docs/plans/0001a-trait-rewrite.md about
trait_variant emitting a dyn-compatible Send variant; option (c) from
the design conversation (hand-written dyn adapter) was selected
explicitly because trait_variant 0.1.2 does not.
2026-06-18 19:08:23 -05:00
..
vestige-core feat(storage): swap async-trait for trait_variant + dyn adapter (0001a) 2026-06-18 19:08:23 -05:00
vestige-mcp Fix ComposedGraph clippy warnings 2026-06-18 16:08:51 -05:00