Crisis-aware system prompt + API wiring #11

Closed
Timmy wants to merge 0 commits from feature/crisis-system-prompt into main
Owner

Crisis Detection & Response System

Adds a complete crisis-aware system prompt and API wiring to the-door.

Files Created

  • crisis/PROTOCOL.md — Crisis response protocol with tier definitions and action guidelines
  • crisis/detect.py — Tiered indicator detection engine classifying text into LOW/MEDIUM/HIGH/CRITICAL
  • crisis/response.py — Timmy crisis response generator with UI flags and system prompt modifiers
  • crisis/gateway.py — API gateway wrapper for integrating crisis detection into the message pipeline
  • crisis/tests.py — Unit tests covering all tiers and response logic

Features

  • 4-tier crisis classification (LOW/MEDIUM/HIGH/CRITICAL) based on regex indicator matching
  • Structured response: {level, indicators, recommended_action}
  • CRITICAL actions: interrupt, ask "Are you safe?", provide 988, redirect to help
  • System prompt modifiers for AI-level crisis awareness
  • Full test suite with 20+ test cases
## Crisis Detection & Response System Adds a complete crisis-aware system prompt and API wiring to the-door. ### Files Created - **crisis/PROTOCOL.md** — Crisis response protocol with tier definitions and action guidelines - **crisis/detect.py** — Tiered indicator detection engine classifying text into LOW/MEDIUM/HIGH/CRITICAL - **crisis/response.py** — Timmy crisis response generator with UI flags and system prompt modifiers - **crisis/gateway.py** — API gateway wrapper for integrating crisis detection into the message pipeline - **crisis/tests.py** — Unit tests covering all tiers and response logic ### Features - 4-tier crisis classification (LOW/MEDIUM/HIGH/CRITICAL) based on regex indicator matching - Structured response: `{level, indicators, recommended_action}` - CRITICAL actions: interrupt, ask "Are you safe?", provide 988, redirect to help - System prompt modifiers for AI-level crisis awareness - Full test suite with 20+ test cases
Timmy added 1 commit 2026-04-05 21:18:17 +00:00
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.
Timmy closed this pull request 2026-04-05 21:25:41 +00:00

Pull request closed

Sign in to join this conversation.