pub trait EmbeddingProvenance {
// Required methods
fn check_insert(
&self,
task: TaskKind,
model_id: &ModelId,
version: &ModelVersion,
) -> Result<(EmbeddingDim, DistanceMetric), RegistryError>;
fn embedding_spec(
&self,
task: TaskKind,
) -> Option<(EmbeddingDim, DistanceMetric)>;
fn canonical_version(&self, task: TaskKind) -> Option<ModelVersion>;
// Provided method
fn vector_table(&self, task: TaskKind) -> Option<VectorTableSpec> { ... }
}Expand description
The embedding-provenance gate the vector index calls before it stores or ranks anything —
the seam through which the model inventory reaches the index without the index depending on
ml.
Implemented by the ML layer’s Registry, which owns the canonical rows and the version-bump
swap primitive. The index only ever asks the three questions below, so the rest of the
inventory (display names, fallbacks, swap history) stays out of that layer entirely.
Required Methods§
Sourcefn check_insert(
&self,
task: TaskKind,
model_id: &ModelId,
version: &ModelVersion,
) -> Result<(EmbeddingDim, DistanceMetric), RegistryError>
fn check_insert( &self, task: TaskKind, model_id: &ModelId, version: &ModelVersion, ) -> Result<(EmbeddingDim, DistanceMetric), RegistryError>
The gate on every insert: accept any version of a known model for an embedding task,
returning the (dim, metric) its vectors must match. An unknown model or a
non-embedding task is refused; a superseded-but-known version is not refused — it is
admitted and lands as a stale-flagged row.
Sourcefn embedding_spec(
&self,
task: TaskKind,
) -> Option<(EmbeddingDim, DistanceMetric)>
fn embedding_spec( &self, task: TaskKind, ) -> Option<(EmbeddingDim, DistanceMetric)>
The (dim, metric) of task’s vector space, or None if task stores no embeddings.
Sourcefn canonical_version(&self, task: TaskKind) -> Option<ModelVersion>
fn canonical_version(&self, task: TaskKind) -> Option<ModelVersion>
The current canonical model_version for task — the partition queries are answered
from — or None if the task has no canonical model.
Provided Methods§
Sourcefn vector_table(&self, task: TaskKind) -> Option<VectorTableSpec>
fn vector_table(&self, task: TaskKind) -> Option<VectorTableSpec>
The partition table shape for task, if it stores embeddings.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
impl EmbeddingProvenance for Registry
The inventory seen through the vector index’s eyes: the three questions db asks, answered by
delegating to the inherent inventory methods. This impl is the inverted db -> ml edge —
db names the trait, ml supplies the implementation, so the dependency now runs one way.