fix(audit): _collect_block_sources mirrors None-doc-types (provenance accuracy, FU-7 review)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-30 21:40:42 +00:00
parent d28f7b8398
commit 9bfb912bdf

View File

@@ -421,7 +421,10 @@ async def _collect_block_sources(case_id: UUID, block_id: str) -> dict:
claim_ids: extracted claims for the case. (case_law_ids are captured claim_ids: extracted claims for the case. (case_law_ids are captured
separately from the precedent search inside write_block.) separately from the precedent search inside write_block.)
""" """
allowed = _BLOCK_DOC_TYPES.get(block_id, []) allowed = _BLOCK_DOC_TYPES.get(block_id, []) # [] = all docs; None = no source docs
if allowed is None:
docs = [] # mirror _build_source_context: this block consumes no raw source docs
else:
docs = await db.list_documents(case_id) docs = await db.list_documents(case_id)
if allowed: if allowed:
docs = [d for d in docs if d.get("doc_type") in allowed] docs = [d for d in docs if d.get("doc_type") in allowed]