fix(evidence): distinguish implicit corpus ownership

This commit is contained in:
2026-07-12 05:59:13 +02:00
parent 6bb158233f
commit 950f88f23e
2 changed files with 13 additions and 1 deletions
+6 -1
View File
@@ -70,7 +70,7 @@ class CorpusPipeline:
self, *, store: CorpusStore, sources: list[EvidenceSource], embedder,
vector_store: VectorStore, embedding_model: str, embedding_dimensions: int,
chunk_policy: ChunkPolicy, pipeline_version: str, retain_published_generations: int = 3,
workspace_id: str = "default",
workspace_id: str | None = None,
) -> None:
self.store = store
self.sources = sources
@@ -88,8 +88,13 @@ class CorpusPipeline:
def _assert_workspace_binding(self) -> None:
manifest = self.store.active_manifest()
if manifest is None:
if self.workspace_id is None:
self.workspace_id = "default"
return
persisted = manifest.metadata.get("workspace_id")
if self.workspace_id is None and isinstance(persisted, str):
self.workspace_id = persisted
return
if persisted != self.workspace_id:
raise PipelineError(
"corpus belongs to a different workspace; use a new corpus root or explicit rebuild"