The crisis detection pipeline existed but was never called from the
actual chat endpoint. The AI got no crisis context. Now it does.
Frontend (index.html):
- Added COMPASSION_PROFILES (Guardian, Witness, Friend) in JS
- checkCrisis() now returns the level (was void)
- New getSystemPrompt() wraps SYSTEM_PROMPT with active profile
- sendMessage() uses getSystemPrompt() instead of raw checkCrisis()
- Visual crisis indicator ('I'm right here with you') when active
Backend (crisis/gateway.py):
- get_system_prompt() now delegates to compassion_router.wrap_system_prompt()
- New process_chat_message() as unified entry point
Tests: 118 passing (16 new integration + 102 existing)
6 lines
117 B
INI
6 lines
117 B
INI
[pytest]
|
|
testpaths = crisis tests
|
|
python_files = tests.py test_*.py
|
|
python_classes = Test*
|
|
python_functions = test_*
|