- Removed 'saying goodbye' from CRITICAL tier (too common in innocent contexts)
- Narrowed 'wrote a will' to 'wrote a suicide note' (responsible behavior)
- Removed broad single-word matches from HIGH tier: give up, trapped, desperate, worthless, hopeless, no future, nothing left, can't see any light
- Added contextual HIGH tier phrases: feel hopeless, trapped in this, desperate for help, give up on life, etc.
- Updated MODERATE tier with contextual versions: feel worthless, feel hopeless, feel trapped, etc.
- Updated index.html JavaScript keywords to match Python changes
- Added comprehensive false positive test suite
All existing tests pass. New tests verify innocent messages no longer trigger false alarms.
crisis/detect.py:
- Add 'better off without me' CRITICAL pattern
- Add 'desperate' HIGH pattern
- Add extract_context() for match snippets
crisis/response.py:
- Add 5-4-3-2-1 grounding exercise
- Add breathing exercise
- Add generate_grounding_steps() and generate_breathing_exercise()
crisis/test_rescue.py: 5 tests for new features
- Add hermes-gateway.service with restart=always and security hardening
- Integrate service setup into deploy.sh
- Add --service flag for standalone install
- Add make service target
Resolves#2
Adds operational resilience tooling:
- resilience/health-check.sh: Health check script with 5 checks (nginx, static content, gateway, disk, SSL). Supports --auto-restart and --verbose modes.
- resilience/service-restart.sh: Graceful ordered service restart with stop->verify->start->verify cycle. Supports --force mode.
- Fallback logic for when gateway is unreachable (graceful degradation to static pages)
All scripts are self-contained, no external dependencies, work on common Linux distros.
Adds two standalone HTML pages matching the-door dark theme:
- testimony.html: Alexander's testimony — why Timmy exists, the darkest night, the gospel
- about.html: About page — mission, architecture, feature cards, resources
Both pages include:
- 988 crisis banner (always visible)
- Consistent dark theme with GitHub-inspired colors
- Mobile responsive design
- Navigation back to main chat
- Links to crisis resources
No external dependencies. Works on 3G.
Standalone despair/suicide detection module with 4-tier classification:
- LOW: General sadness, stress, difficult times
- MEDIUM: Hopelessness, isolation, worthlessness
- HIGH: Active despair, mentions of death, feeling trapped
- CRITICAL: Explicit intent, plan, imminent self-harm
Returns structured response: {level, indicators, recommended_action}
CRITICAL recommended_action:
- Interrupt conversation immediately
- Ask 'Are you safe right now?'
- Provide 988 Suicide & Crisis Lifeline
- Provide Crisis Text Line (HOME to 741741)
- Stay present. Do not disconnect.
Designed to integrate with crisis/ module from PR #4.
Falls back to internal pattern engine when crisis/ unavailable.
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.