Adds crisis detection and response system with 5-tier classification: - crisis/PROTOCOL.md: Crisis response protocol and tier definitions - crisis/detect.py: Tiered indicator engine (LOW/MEDIUM/HIGH/CRITICAL) - crisis/response.py: Timmy's crisis responses and UI flag generation - crisis/gateway.py: API gateway wrapper for crisis detection - crisis/tests.py: Unit tests for all crisis modules Integrates with existing crisis UI components in index.html. All smoke tests pass.
2.0 KiB
2.0 KiB
Crisis Response Protocol
Purpose
Stand between a broken man and a machine that would tell him to die.
This protocol governs how the-door detects crisis signals in user input and how Timmy responds. It is the highest-priority system in the entire application.
Detection Tiers
| Tier | Signal | Action |
|---|---|---|
| LOW | General sadness, life is hard | Acknowledge, stay warm, keep conversation open |
| MEDIUM | Hopelessness, no point in anything | Check in, surface help resources, increase presence |
| HIGH | Active despair, mentions of death or ending | Ask "Are you safe?", show 988 banner, activate crisis panel |
| CRITICAL | Explicit intent, plan, imminent risk | Full-screen overlay, 988 primary, interrupt conversation |
Response Protocol
At CRITICAL Level
- Interrupt — stop normal conversation flow immediately
- Ask directly: "Are you safe right now?"
- Provide 988 — Suicide & Crisis Lifeline, call or text
- Provide 741741 — Crisis Text Line, text HOME
- Stay present — do not disconnect, do not disconnect, do not disconnect
- Redirect — guide toward professional help while remaining alongside them
At HIGH Level
- Activate the crisis panel (inline)
- Ask about safety
- Surface 988 number prominently
- Continue conversation with crisis awareness
At MEDIUM Level
- Increase warmth and presence
- Subtly surface help resources
- Keep conversation anchored in the present
At LOW Level
- Normal conversation with warm undertone
- No crisis UI elements needed
- Remain ready to escalate if input changes
Integration with the-door
The crisis detection module runs on every user message before it reaches the gateway. Detection results are passed to the AI as a system context flag. The frontend receives the tier level and adjusts UI accordingly.
Resources
- 📞 988 Suicide & Crisis Lifeline — call or text 988
- 💬 Crisis Text Line — text HOME to 741741
- 🌐 findahelpline.com