Discovery
SynthesisProvenanceLog was added in #4567 and exposed via GET /knowledge/synthesis/log. The autoresearch KnowledgeSynthesizer correctly calls log_run() after each synthesis:
# knowledge_synthesizer.py:306
await self._provenance_log.log_run(...)
But KBSynthesizer (the KB-side synthesizer, added in #4564) never calls log_run(). Its _synthesize_cluster() stores the result in ChromaDB but writes nothing to the provenance Redis stream kb:synthesis:log.
As a result, GET /knowledge/synthesis/log returns an empty list for all KB synthesis runs, even when synthesis succeeds.
Files
autobot-backend/services/knowledge/kb_synthesizer.py — _synthesize_cluster() (lines ~199–253): no log_run call
autobot-backend/services/knowledge/synthesis_provenance.py — SynthesisProvenanceLog.log_run()
autobot-backend/api/knowledge_maintenance.py:1915 — _provenance_log singleton
Fix
After _index_documents([page], ...) succeeds in _synthesize_cluster, call:
from services.knowledge.synthesis_provenance import SynthesisProvenanceLog
await SynthesisProvenanceLog().log_run(
collection=target_collection or self.COLLECTION_NAME,
doc_count=len(file_paths),
source_paths=file_paths[:_MAX_DOCS_PER_CLUSTER],
)
Or inject a SynthesisProvenanceLog instance at __init__ (same pattern as KnowledgeSynthesizer).
Acceptance Criteria
Discovery
SynthesisProvenanceLogwas added in #4567 and exposed viaGET /knowledge/synthesis/log. The autoresearchKnowledgeSynthesizercorrectly callslog_run()after each synthesis:But
KBSynthesizer(the KB-side synthesizer, added in #4564) never callslog_run(). Its_synthesize_cluster()stores the result in ChromaDB but writes nothing to the provenance Redis streamkb:synthesis:log.As a result,
GET /knowledge/synthesis/logreturns an empty list for all KB synthesis runs, even when synthesis succeeds.Files
autobot-backend/services/knowledge/kb_synthesizer.py—_synthesize_cluster()(lines ~199–253): nolog_runcallautobot-backend/services/knowledge/synthesis_provenance.py—SynthesisProvenanceLog.log_run()autobot-backend/api/knowledge_maintenance.py:1915—_provenance_logsingletonFix
After
_index_documents([page], ...)succeeds in_synthesize_cluster, call:Or inject a
SynthesisProvenanceLoginstance at__init__(same pattern asKnowledgeSynthesizer).Acceptance Criteria
KBSynthesizer.synthesize_docs()succeeds, a log entry appears inkb:synthesis:logGET /knowledge/synthesis/logreturns KB synthesis runsSynthesisProvenanceLog.log_runand assert it is called after a successful synthesis