fix: harden model catalog projections
This commit is contained in:
@@ -105,11 +105,13 @@ def item(name, fingerprint):
|
||||
)
|
||||
|
||||
|
||||
def pipeline(tmp_path, source, *, embedder=None, vectors=None, model="model-a", policy=None,
|
||||
def pipeline(tmp_path, source, *, embedder=None, vectors=None, model="model-a",
|
||||
embedding_id=None, policy=None,
|
||||
retain=3, candidate_evaluator=None):
|
||||
return CorpusPipeline(
|
||||
store=CorpusStore(tmp_path / "corpus"), sources=[source],
|
||||
embedder=embedder or Embedder(), vector_store=vectors or Vectors(),
|
||||
embedding_id=embedding_id,
|
||||
embedding_model=model, embedding_dimensions=3,
|
||||
chunk_policy=policy or ChunkPolicy(version="chunk-v1", max_chars=100),
|
||||
pipeline_version="evidence-v1",
|
||||
@@ -875,6 +877,24 @@ def test_model_or_chunk_policy_change_forces_full_rebuild(tmp_path):
|
||||
assert source.acquire_calls == ["fs:one"]
|
||||
|
||||
|
||||
def test_canonical_embedding_id_change_forces_full_rebuild_and_is_persisted(tmp_path):
|
||||
one = item("one", "a")
|
||||
first = pipeline(
|
||||
tmp_path, Source([(one, "hello")]), model="same-upstream",
|
||||
embedding_id="ollama/catalog-a",
|
||||
).run()
|
||||
assert first.manifest.embedding_id == "ollama/catalog-a"
|
||||
|
||||
source = Source([(one, "hello")])
|
||||
changed = pipeline(
|
||||
tmp_path, source, model="same-upstream", embedding_id="ollama/catalog-b",
|
||||
).run()
|
||||
|
||||
assert changed.changed == ("fs:one",)
|
||||
assert changed.manifest.embedding_id == "ollama/catalog-b"
|
||||
assert source.acquire_calls == ["fs:one"]
|
||||
|
||||
|
||||
def test_partial_vector_failure_never_changes_active_or_exposes_generation(tmp_path):
|
||||
one = item("one", "a")
|
||||
good = pipeline(tmp_path, Source([(one, "old")]))
|
||||
|
||||
Reference in New Issue
Block a user