fix(evidence): retain referenced vector generations
This commit is contained in:
@@ -36,8 +36,6 @@ class ActiveEvidenceSearcher:
|
||||
|
||||
def active_searcher(cfg, delegate):
|
||||
corpus_root = cfg.paths.artifacts.parent / "corpus"
|
||||
if not corpus_root.exists():
|
||||
return delegate
|
||||
return ActiveEvidenceSearcher(CorpusStore(corpus_root), delegate)
|
||||
|
||||
|
||||
@@ -59,15 +57,18 @@ def active_evidence_hits(store: CorpusStore, vector_store, embedding, *, limit:
|
||||
def resolve_evidence_file(
|
||||
store: CorpusStore, evidence_id: str, *, materialized_root=None,
|
||||
) -> str:
|
||||
manifest = store.active_manifest()
|
||||
if manifest is None:
|
||||
return ""
|
||||
for document in manifest.documents:
|
||||
frontmatter = document.metadata.get("frontmatter", {})
|
||||
identifiers = {document.document_id, document.source_id, str(frontmatter.get("id", ""))}
|
||||
if evidence_id in identifiers:
|
||||
root = materialized_root or (store.root / "runtime")
|
||||
filename = document.document_id.removeprefix("doc:") + ".md"
|
||||
path = store.materialize_document(document.document_id, root / filename)
|
||||
return str(path) if path else ""
|
||||
with store.writer_lock():
|
||||
manifest = store.active_manifest()
|
||||
if manifest is None:
|
||||
return ""
|
||||
for document in manifest.documents:
|
||||
frontmatter = document.metadata.get("frontmatter", {})
|
||||
identifiers = {document.document_id, document.source_id, str(frontmatter.get("id", ""))}
|
||||
if evidence_id in identifiers:
|
||||
root = materialized_root or (store.root / "runtime")
|
||||
filename = document.document_id.removeprefix("doc:") + ".md"
|
||||
path = store.materialize_document(
|
||||
document.document_id, root / filename, generation=manifest.manifest_id,
|
||||
)
|
||||
return str(path) if path else ""
|
||||
return ""
|
||||
|
||||
Reference in New Issue
Block a user