Expand description
Model-identity vocabulary — the names a task, a model, and a vector space are identified by.
These types are shared vocabulary, not ML behaviour. Two very different layers need them:
- the vector index names its
vec0tables after aTaskKind, sizes their columns with anEmbeddingDim, ranks them by aDistanceMetric, and partitions them by aModelVersion— all before any model has run; - the model registry uses the same names to describe the models it declares.
They used to live in ml::registry, which forced db to use crate::ml merely to spell its
own column types — closing a db -> ml -> db module cycle. Hoisting them into domain (a leaf
with no outgoing crate edges) turns that cycle into the DAG domain <- db <- ml. The behaviour
that reads these names — the canonical inventory, the swap primitive, and the provenance gate —
stays in crate::ml::Registry; only the vocabulary moved. Every name here is re-exported
from crate::ml, so capsule_core::ml::TaskKind and friends resolve unchanged.
RegistryError rides along because it is vocabulary: it names a task and a model id and
nothing else, and the vector index has to be able to spell it to carry a refusal outward.
Structs§
- Embedding
Dim - The dimensionality of an embedding vector for an embedding-producing task.
- ModelId
- A model identifier (stable across versions; e.g.
mobileclip-b). Declared in exactly oneModelRow. Serializes transparently as its string so it interoperates with themodel_idfields onAiTagandDerivativeCore. - Model
Version - A model version. Bumped on every model swap for a task; old embeddings at a prior version are
flagged stale. Serializes transparently as its string (see
ModelId).
Enums§
- Distance
Metric - The distance metric a vector index ranks an embedding task by.
- Registry
Error - Refusals from the embedding-provenance invariant — produced by the
gate the vector index calls on every insert, and
carried outward by
VectorIndexError. - Task
Kind - A canonical ML task — the v1-committed launch pipeline (AI/ML — Pipeline Slots).