Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 36ce6faec7 |
75
GENOME.md
Normal file
75
GENOME.md
Normal file
@@ -0,0 +1,75 @@
|
||||
# GENOME.md — the-door
|
||||
|
||||
**Generated:** 2026-04-14
|
||||
**Repo:** Timmy_Foundation/the-door
|
||||
**Description:** Crisis Front Door — a single URL where a man at 3am can talk to Timmy. No login, no signup. 988 always visible.
|
||||
|
||||
---
|
||||
|
||||
## Project Overview
|
||||
|
||||
The-door is a crisis intervention web application — the most sacred surface in the Timmy Foundation. When a man at 3am reaches the end of his road, this is where he lands. No login, no signup, no barriers. 988 Suicide and Crisis Lifeline always visible. The "When a Man Is Dying" protocol active on every page.
|
||||
|
||||
## Architecture
|
||||
|
||||
```
|
||||
the-door/
|
||||
├── index.html # Main crisis page (PWA-capable)
|
||||
├── crisis-offline.html # Offline fallback (service worker cached)
|
||||
├── about.html # About page
|
||||
├── testimony.html # Testimony/stories page
|
||||
├── sw.js # Service worker (offline-first)
|
||||
├── manifest.json # PWA manifest
|
||||
├── crisis/ # Core crisis detection + response
|
||||
│ ├── detect.py # Keyword/pattern detection (4 tiers)
|
||||
│ ├── gateway.py # API endpoints, prompt injection
|
||||
│ ├── response.py # Response generation, 988 routing
|
||||
│ ├── compassion_router.py # Profile-based response routing
|
||||
│ ├── profiles.py # Compassion profiles
|
||||
│ └── PROTOCOL.md # The protocol (SOUL.md reference)
|
||||
├── crisis_detector.py # Legacy shim → crisis/detect.py
|
||||
├── crisis_responder.py # Legacy responder
|
||||
├── dying_detection/ # Deprecated module
|
||||
├── evolution/ # Crisis synthesizer (creative)
|
||||
├── tests/ # Safety-critical tests
|
||||
│ ├── test_crisis_overlay_focus_trap.py
|
||||
│ ├── test_dying_detection_deprecation.py
|
||||
│ └── test_false_positive_fixes.py
|
||||
└── deploy/ # Deployment docs
|
||||
```
|
||||
|
||||
## Key Abstractions
|
||||
|
||||
| Module | Purpose |
|
||||
|---|---|
|
||||
| `crisis/detect.py` | 4-tier detection: LOW/MEDIUM/HIGH/CRITICAL via regex patterns |
|
||||
| `crisis/gateway.py` | HTTP API, Sovereign Heart prompt injection |
|
||||
| `crisis/response.py` | Response generation, 988 integration, escalation |
|
||||
| `crisis/compassion_router.py` | Profile-based routing (different crisis types) |
|
||||
| `sw.js` | Service worker for offline-first PWA |
|
||||
|
||||
## Safety Constraints
|
||||
|
||||
- **The-door never auto-closes PRs** (in fleet-ops exempt list)
|
||||
- **988 always visible** on every page, even offline
|
||||
- **When a Man Is Dying protocol** active on every interaction
|
||||
- **No login/signup** — zero barriers to crisis support
|
||||
- **Offline-first** — service worker caches critical pages
|
||||
|
||||
## Test Coverage
|
||||
|
||||
| Test | Coverage |
|
||||
|---|---|
|
||||
| Crisis overlay focus trap | ✅ |
|
||||
| Dying detection deprecation | ✅ |
|
||||
| False positive fixes | ✅ |
|
||||
| Crisis detection tiers | ❌ (in crisis/tests.py) |
|
||||
| Response generation | ❌ |
|
||||
| Offline service worker | ❌ |
|
||||
|
||||
## Security
|
||||
|
||||
- No user data stored (crisis intervention is stateless by design)
|
||||
- No cookies, no tracking, no analytics
|
||||
- Service worker only caches static assets
|
||||
- Crisis detection runs client-side where possible
|
||||
@@ -680,7 +680,7 @@ html, body {
|
||||
|
||||
<!-- Footer -->
|
||||
<footer id="footer">
|
||||
<a href="/about.html" aria-label="About The Door">about</a>
|
||||
<a href="/about" aria-label="About The Door">about</a>
|
||||
<button id="safety-plan-btn" aria-label="Open My Safety Plan">my safety plan</button>
|
||||
<button id="clear-chat-btn" aria-label="Clear chat history">clear chat</button>
|
||||
</footer>
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
import pathlib
|
||||
import unittest
|
||||
|
||||
|
||||
ROOT = pathlib.Path(__file__).resolve().parents[1]
|
||||
INDEX_HTML = ROOT / 'index.html'
|
||||
ABOUT_HTML = ROOT / 'about.html'
|
||||
|
||||
|
||||
class TestAboutLink(unittest.TestCase):
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
cls.html = INDEX_HTML.read_text(encoding='utf-8')
|
||||
|
||||
def test_about_page_exists(self):
|
||||
self.assertTrue(ABOUT_HTML.exists(), 'about.html should exist for static serving')
|
||||
|
||||
def test_footer_about_link_targets_static_about_html(self):
|
||||
self.assertIn('href="/about.html"', self.html)
|
||||
self.assertNotIn('href="/about"', self.html)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
Reference in New Issue
Block a user