Documentation
¶
Overview ¶
Package embeddingstest provides a deterministic, test-grade `embeddings.Embedder` for conformance suites and integration tests that need meaningful similarity without provider traffic.
The embedder is NEVER registered with the embeddings driver registry and is never a production default (AGENTS.md §13 — test stubs stay out of operator-facing seams). It lives in its own clearly-named subpackage, mirroring the conformance-suite precedent, so test authors across subsystems (memory, skills, integration) share one implementation instead of growing private fakes.
Vector model: a bag-of-words hash projection. Each lowercase whitespace-separated token hashes (FNV-1a) onto one of `Dim` buckets; the bucket counts are L2-normalised. Texts sharing more tokens therefore land closer under cosine similarity — enough signal for retrieval-ranking assertions, fully deterministic, and identity-respecting (the embedder itself holds no per-call state).
Index ¶
Constants ¶
const Dim = 64
Dim is the fixed vector dimension the deterministic embedder produces.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Deterministic ¶
type Deterministic struct {
// Calls counts Embed invocations (not texts). Tests assert on it
// to prove a consumer actually drove the embedder.
Calls atomic.Int64
// contains filtered or unexported fields
}
Deterministic is the test-grade embedder. Construct with `New`. Safe for concurrent use: the only mutable field is the atomic closed flag; `Calls` is an atomic counter tests may assert on.