Spaces:
Running
Running
Commit ·
33471e1
1
Parent(s): c00c978
Sync with main branch - updated UI and requirements
Browse files
app.py
CHANGED
|
@@ -302,6 +302,7 @@ def normalize_result(result: dict[str, Any]) -> dict[str, Any]:
|
|
| 302 |
"adversarial_audit": adversarial,
|
| 303 |
"next_steps": next_steps(findings),
|
| 304 |
"deletion_cert": full.get("deletion_cert", ""),
|
|
|
|
| 305 |
}
|
| 306 |
|
| 307 |
if "full_result" in result and "agent_findings" not in result:
|
|
@@ -319,6 +320,7 @@ def normalize_result(result: dict[str, Any]) -> dict[str, Any]:
|
|
| 319 |
"narrative_synthesis": synthesize([]),
|
| 320 |
"next_steps": next_steps([]),
|
| 321 |
"deletion_cert": full.get("deletion_cert", ""),
|
|
|
|
| 322 |
}
|
| 323 |
|
| 324 |
return result
|
|
@@ -506,6 +508,14 @@ def build_dashboard_html(raw_result: dict[str, Any]) -> str:
|
|
| 506 |
rows += f"<div class='dossier-row' style='flex-direction:column;align-items:flex-start'><span class='data-label text-pass'>Applicant rebuttal path</span><div style='color:var(--text-muted);margin-top:4px;line-height:1.5'>{adversarial['rebuttal_case']}</div></div>"
|
| 507 |
left_col_html += f"<div class='dossier-card card-6'><span class='dossier-card-title'>Adversarial audit</span>{rows}</div>"
|
| 508 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 509 |
right_col_html = ""
|
| 510 |
|
| 511 |
parties_html = f"""
|
|
|
|
| 302 |
"adversarial_audit": adversarial,
|
| 303 |
"next_steps": next_steps(findings),
|
| 304 |
"deletion_cert": full.get("deletion_cert", ""),
|
| 305 |
+
"extraction_trace": result.get("extraction_trace", []),
|
| 306 |
}
|
| 307 |
|
| 308 |
if "full_result" in result and "agent_findings" not in result:
|
|
|
|
| 320 |
"narrative_synthesis": synthesize([]),
|
| 321 |
"next_steps": next_steps([]),
|
| 322 |
"deletion_cert": full.get("deletion_cert", ""),
|
| 323 |
+
"extraction_trace": result.get("extraction_trace", []),
|
| 324 |
}
|
| 325 |
|
| 326 |
return result
|
|
|
|
| 508 |
rows += f"<div class='dossier-row' style='flex-direction:column;align-items:flex-start'><span class='data-label text-pass'>Applicant rebuttal path</span><div style='color:var(--text-muted);margin-top:4px;line-height:1.5'>{adversarial['rebuttal_case']}</div></div>"
|
| 509 |
left_col_html += f"<div class='dossier-card card-6'><span class='dossier-card-title'>Adversarial audit</span>{rows}</div>"
|
| 510 |
|
| 511 |
+
extraction_trace = result.get("extraction_trace", [])
|
| 512 |
+
if extraction_trace:
|
| 513 |
+
# Since extraction_trace is already a list of strings (the scratchpads)
|
| 514 |
+
trace_content = "\n\n".join(extraction_trace)
|
| 515 |
+
# Ensure HTML escapes to prevent layout breaking
|
| 516 |
+
trace_content = trace_content.replace("<", "<").replace(">", ">")
|
| 517 |
+
left_col_html += f"<details class='dossier-card card-4' style='border-color:rgba(0,240,255,0.3); background:rgba(0,240,255,0.02); margin-top:16px;'><summary class='dossier-card-title' style='color:var(--cyber-cyan); cursor:pointer; outline:none;'>Forensic VLM Trace (Scratchpad)</summary><div style='margin-top:12px; padding-top:12px; border-top:1px dashed rgba(0,240,255,0.2);'><pre class='mono-text' style='white-space:pre-wrap;font-size:11px;color:var(--text-main);margin:0;line-height:1.4'>{trace_content}</pre></div></details>"
|
| 518 |
+
|
| 519 |
right_col_html = ""
|
| 520 |
|
| 521 |
parties_html = f"""
|