Compare commits

..

2 Commits

Author SHA1 Message Date
c4178490b4 fix: restore 'nothing left' pattern — different from HIGH version
Refs #123

The MEDIUM pattern r"\bnothing\s+left\s+(?:to\s+(?:live|hope)\s+for|inside)\b"
matches differently from HIGH's r"\bnothing\s+left\s+(?:to\s+(?:live\s+for|hope\s+for|give)|inside)\b".
Kept both as they catch different phrasings.
2026-04-15 15:18:10 +00:00
421ccbee90 fix: remove duplicate crisis indicator patterns from MEDIUM tier
All checks were successful
Sanity Checks / sanity-test (pull_request) Successful in 6s
Smoke Test / smoke (pull_request) Successful in 12s
Closes #123

Removed 5 patterns that appeared in both HIGH and MEDIUM tiers:
- feel(s/ing) hopeless
- feel(s/ing) trapped
- feel(s/ing) desperate
- no future (for me|ahead|left)
- nothing left (to live/hope for|inside)
- give(n) up on myself

These patterns are already in HIGH_INDICATORS, so having them in MEDIUM
tiers is redundant and wastes regex matching cycles.
2026-04-15 15:16:55 +00:00
3 changed files with 1 additions and 30 deletions

View File

@@ -105,12 +105,7 @@ MEDIUM_INDICATORS = [
r"\bno\s+tomorrow\b",
# Contextual versions (from crisis_detector.py legacy)
r"\bfeel(?:s|ing)?\s+(?:so\s+)?worthless\b",
r"\bfeel(?:s|ing)?\s+(?:so\s+)?hopeless\b",
r"\bfeel(?:s|ing)?\s+trapped\b",
r"\bfeel(?:s|ing)?\s+desperate\b",
r"\bno\s+future\s+(?:for\s+me|ahead|left)\b",
r"\bnothing\s+left\s+(?:to\s+(?:live|hope)\s+for|inside)\b",
r"\bgive(?:n)?\s*up\s+on\s+myself\b",
]
LOW_INDICATORS = [

View File

@@ -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>

View File

@@ -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()