T3: 1:1 port of the artist_vectors vector store into qbz-reco. open_at(base) opens <base>/cache/artist_vectors.db (WAL) with the 3-table schema kept byte-identical (CREATE IF NOT EXISTS) for cross-frontend reuse. Ports the in-memory artist index, get_or_create_idx, set_vector (delete-then-insert per (artist,source) + metadata nnz), get_vector (SUM GROUP BY), has_fresh_vector, get_artist_name, and the production ranking get_related_artists / get_all_related_artists (SUM ORDER BY total_weight DESC). Drops the dead find_nearest cosine path (D3) and the Tauri State/tokio wrapper (lifecycle in the frontend/core per ADR-006). 4 store tests, 20 qbz-reco tests green. cc
18 lines
707 B
Rust
18 lines
707 B
Rust
//! Frontend-agnostic artist-vector recommendation engine (ADR-006).
|
|
//!
|
|
//! Cleanroom port of Tauri's `src-tauri/src/artist_vectors/` into a shared
|
|
//! crate so the Slint frontend (and any headless caller) can produce a
|
|
//! playlist's "Suggested Songs" without a `tauri::State` dependency.
|
|
//!
|
|
//! Modules are ported 1:1 from the Tauri source. The dead cosine-similarity /
|
|
//! `find_nearest` ranking path is dropped (production ranks by summed
|
|
//! relationship weight via the vector store) per the epic's decision D3.
|
|
|
|
mod sparse_vector;
|
|
mod store;
|
|
mod weights;
|
|
|
|
pub use sparse_vector::SparseVector;
|
|
pub use store::{ArtistVectorStore, SimilarArtist, VECTOR_TTL_SECS};
|
|
pub use weights::RelationshipWeights;
|