|
2 | 2 | AuditFlow - Agentic & Explainable Claims Processing |
3 | 3 | 5-Page App: Home, Process Claims, Claim History, Performance Analytics, Policy Library |
4 | 4 | Light mode optimized for modern UI |
5 | | -Cache bust: 2026-01-21T02:02 |
| 5 | +Cache bust: 2026-01-21T02:20 |
6 | 6 | """ |
7 | 7 |
|
8 | | -VERSION = "v1.3.1-fixes" # Bumped for PDF/Override/Claims verification |
| 8 | +VERSION = "v1.3.2-evidence" # Bumped for policy evidence fixes |
9 | 9 |
|
10 | 10 | import os |
11 | 11 | import base64 |
@@ -789,6 +789,7 @@ def compute_stats(): |
789 | 789 | "timestamp": datetime.now().strftime("%Y-%m-%d %H:%M:%S"), |
790 | 790 | "region": claim_region, |
791 | 791 | "category": claim_category, |
| 792 | + "citation": {"policy": policy_name, "section": section_cited}, |
792 | 793 | "summary": f"Claim analyzed based on policy coverage criteria. Decision: {expected} with {confidence*100:.1f}% confidence.", |
793 | 794 | "events": [ |
794 | 795 | {"time": "00:00.12", "component": "ROUTER", "icon": "🔀", "action": "Route Request", "details": f"Routing to {claim_region} / {claim_category} handler"}, |
@@ -851,6 +852,10 @@ def compute_stats(): |
851 | 852 | st.markdown("##### 🚩 Flagging Criteria") |
852 | 853 | for flag in active_flags: |
853 | 854 | st.warning(f"**{flag['criteria']}**: {flag['reason']}") |
| 855 | + # Policy Citations |
| 856 | + if result.get("citation"): |
| 857 | + st.markdown("##### 📋 Policy Evidence") |
| 858 | + st.success(f"**{result['citation']['policy']}**\n\nCited Section: *{result['citation']['section']}*") |
854 | 859 |
|
855 | 860 | # Agent Reasoning |
856 | 861 | with st.expander("🧠 Agent Reasoning & Explanations", expanded=False): |
@@ -892,7 +897,7 @@ def compute_stats(): |
892 | 897 | "confidence": result["confidence"], |
893 | 898 | "summary": result["summary"], |
894 | 899 | "reasoning_trace": [{"step_number": r["step"], "step_type": r["type"], "content": r["content"]} for r in result.get("reasoning", [])], |
895 | | - "evidence": [], |
| 900 | + "evidence": [f"{result['citation']['policy']} - {result['citation']['section']}"] if result.get("citation") else [], |
896 | 901 | "exclusions_found": [f["reason"] for f in active_flags], |
897 | 902 | "limits_found": [] |
898 | 903 | } |
|
0 commit comments