fix(evidence): distinguish implicit corpus ownership
This commit is contained in:
@@ -135,3 +135,10 @@ run reached unrelated Task 6 immutable-file tamper tests; those files were delib
|
||||
manifest, and that mismatched job, GC, and search paths perform no vector/filesystem mutations.
|
||||
|
||||
Focused workspace-binding, search-pack, preprocess JSON, and scoped Ruff/diff tests pass.
|
||||
|
||||
Compatibility follow-up: direct/internal `CorpusPipeline` instances now distinguish an omitted
|
||||
workspace identity from an explicit config/job identity. An unbound instance adopts the persisted
|
||||
ACTIVE owner (or `default` only for a brand-new direct corpus), preserving safe resume/GC tests and
|
||||
the real pgvector lifecycle. Explicit config/job identities still fail closed on any mismatch. The
|
||||
two reported regressions, workspace mismatch guards, real Docker lifecycle, scoped Ruff/diff, and
|
||||
the full harness suite all pass.
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user