Skip to main content

Module model_identity

Module model_identity 

Source
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:

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§

EmbeddingDim
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 one ModelRow. Serializes transparently as its string so it interoperates with the model_id fields on AiTag and DerivativeCore.
ModelVersion
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§

DistanceMetric
The distance metric a vector index ranks an embedding task by.
RegistryError
Refusals from the embedding-provenance invariant — produced by the gate the vector index calls on every insert, and carried outward by VectorIndexError.
TaskKind
A canonical ML task — the v1-committed launch pipeline (AI/ML — Pipeline Slots).