Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -747,17 +747,22 @@ def analyze_composite(msg1, date1, msg2, date2, msg3, date3, *answers_and_none):
|
|
747 |
pattern_escalation_risk = "Moderate"
|
748 |
|
749 |
# --- Step 2: Checklist escalation logic ---
|
750 |
-
if
|
751 |
-
|
752 |
-
|
|
|
753 |
else:
|
754 |
-
|
755 |
-
|
756 |
-
"
|
757 |
-
"
|
758 |
-
"
|
759 |
-
|
760 |
-
|
|
|
|
|
|
|
|
|
761 |
|
762 |
# --- Step 3: Escalation bump from DARVO, tone, abuse score, etc.
|
763 |
escalation_bump = 0
|
|
|
747 |
pattern_escalation_risk = "Moderate"
|
748 |
|
749 |
# --- Step 2: Checklist escalation logic ---
|
750 |
+
if escalation_score is None:
|
751 |
+
escalation_text = "π« **Escalation Potential: Unknown** (Checklist not completed)\n"
|
752 |
+
escalation_text += "β οΈ This section was not completed. Escalation potential cannot be calculated.\n"
|
753 |
+
hybrid_score = 0
|
754 |
else:
|
755 |
+
hybrid_score = escalation_score + escalation_bump
|
756 |
+
risk_level = (
|
757 |
+
"π΄ High" if hybrid_score >= 16 else
|
758 |
+
"π Moderate" if hybrid_score >= 8 else
|
759 |
+
"π’ Low"
|
760 |
+
)
|
761 |
+
|
762 |
+
escalation_text = f"π **Escalation Potential: {risk_level} ({hybrid_score}/29)**\n"
|
763 |
+
escalation_text += "π This score comes from your checklist *and* detected high-risk patterns.\n"
|
764 |
+
escalation_text += "π§ It reflects both situational risk and behavioral red flags."
|
765 |
+
)
|
766 |
|
767 |
# --- Step 3: Escalation bump from DARVO, tone, abuse score, etc.
|
768 |
escalation_bump = 0
|