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:
@@ -421,10 +421,13 @@ 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
|
||||||
docs = await db.list_documents(case_id)
|
if allowed is None:
|
||||||
if allowed:
|
docs = [] # mirror _build_source_context: this block consumes no raw source docs
|
||||||
docs = [d for d in docs if d.get("doc_type") in allowed]
|
else:
|
||||||
|
docs = await db.list_documents(case_id)
|
||||||
|
if allowed:
|
||||||
|
docs = [d for d in docs if d.get("doc_type") in allowed]
|
||||||
claims = await db.get_claims(case_id)
|
claims = await db.get_claims(case_id)
|
||||||
return {
|
return {
|
||||||
"document_ids": [str(d["id"]) for d in docs],
|
"document_ids": [str(d["id"]) for d in docs],
|
||||||
|
|||||||
Reference in New Issue
Block a user