fix: wave 5b review blockers - suppressed memory key, finalizer merge, zero-image guard
This commit is contained in:
@@ -7,7 +7,8 @@ import threading
|
||||
from typing import Any, Dict, Iterable, Optional
|
||||
|
||||
|
||||
_COLLECTION_KEYS = {"sheets", "clusters", "findings", "decisions", "rfis"}
|
||||
_COLLECTION_KEYS = {"sheets", "clusters", "findings", "decisions", "rfis",
|
||||
"suppressed"}
|
||||
_MAPPING_KEYS = {"sheet_index", "jurisdiction", "object_graph"}
|
||||
_MEMORY_KEYS = _COLLECTION_KEYS | _MAPPING_KEYS
|
||||
|
||||
|
||||
+14
-11
@@ -173,28 +173,31 @@ def run_agent_pipeline(
|
||||
]
|
||||
|
||||
orchestrator.stage("Agent wave 5b: evidence verification")
|
||||
sheet_to_page = {s.get("sheet_number"): s.get("page_number") for s in sheets}
|
||||
sheet_to_page = {str(s.get("sheet_number")): s.get("page_number")
|
||||
for s in sheets}
|
||||
verify_targets = select_findings(
|
||||
specialist_findings, clusters,
|
||||
max_checks=config.AGENT_VERIFY_MAX_CHECKS,
|
||||
severities=config.AGENT_VERIFY_SEVERITIES,
|
||||
)
|
||||
target_indexes = {id(f): i for i, f in enumerate(specialist_findings)}
|
||||
verify_scopes = [
|
||||
AgentScope(
|
||||
verify_scopes = []
|
||||
for finding in verify_targets:
|
||||
images = [
|
||||
page_to_b64[sheet_to_page[str(name)]]
|
||||
for name in (finding.get("sheets") or [])[:config.AGENT_CONFLICT_MAX_IMAGES]
|
||||
if sheet_to_page.get(str(name)) in page_to_b64
|
||||
]
|
||||
if not images:
|
||||
continue # never judge evidence against images we could not load
|
||||
verify_scopes.append(AgentScope(
|
||||
scope_id=f"verify:{target_indexes[id(finding)]}",
|
||||
payload={
|
||||
"finding_index": target_indexes[id(finding)],
|
||||
"finding": finding,
|
||||
"images_b64": [
|
||||
page_to_b64[sheet_to_page[name]]
|
||||
for name in (finding.get("sheets") or [])[:config.AGENT_CONFLICT_MAX_IMAGES]
|
||||
if sheet_to_page.get(name) in page_to_b64
|
||||
],
|
||||
"images_b64": images,
|
||||
},
|
||||
)
|
||||
for finding in verify_targets
|
||||
]
|
||||
))
|
||||
verify_results = orchestrator.run_scopes(
|
||||
EvidenceVerifierAgent(usage), verify_scopes, config.AGENT_VERIFY_CONCURRENCY)
|
||||
suppressed = apply_verdicts(specialist_findings, verify_results)
|
||||
|
||||
@@ -216,7 +216,7 @@ def finalize_review(job_id: str, out_dir: str) -> dict:
|
||||
rfis = _draft_rfis(kept)
|
||||
|
||||
report["validated_issues"] = kept
|
||||
report["suppressed_issues"] = suppressed
|
||||
report["suppressed_issues"] = (report.get("suppressed_issues") or []) + suppressed
|
||||
report["rfis"] = rfis
|
||||
summary = report.setdefault("summary", {})
|
||||
summary["agent_status"] = "complete"
|
||||
|
||||
Reference in New Issue
Block a user