Compare commits

..

1 Commits

Author SHA1 Message Date
Alexander Whitestone
bbc513821f fix: point footer about link at about.html (#59)
All checks were successful
Sanity Checks / sanity-test (pull_request) Successful in 7s
Smoke Test / smoke (pull_request) Successful in 15s
2026-04-15 23:46:13 -04:00
2 changed files with 40 additions and 21 deletions

View File

@@ -680,7 +680,7 @@ html, body {
<!-- Footer -->
<footer id="footer">
<a href="/about" aria-label="About The Door">about</a>
<a href="/about.html" 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>
@@ -854,23 +854,21 @@ Sovereignty and service always.`;
// ===== CRISIS KEYWORDS =====
// Tier 1: General crisis indicators - triggers enhanced 988 panel
// HIGH: suicidal ideation, self-harm — triggers level 3
var highKeywords = [
var crisisKeywords = [
// Original keywords
'suicide', 'kill myself', 'end it all', 'no reason to live',
'want to die', 'end my life', 'not worth living', 'goodbye forever',
'better off without me',
'want to die', "can't go on", 'nobody cares', 'better off without me',
'goodbye forever', 'end my life', 'not worth living', 'no way out',
// Self-harm (NEW)
'hurt myself', 'self harm', 'self-harm', 'cutting myself', 'cut myself',
'burn myself', 'scratch myself', 'hitting myself', 'harm myself',
// Passive suicidal ideation (NEW)
"don't want to exist", 'not exist anymore', 'disappear forever',
'never wake up', 'sleep forever', 'end the pain'
];
// MEDIUM: distress, hopelessness — triggers level 2
var mediumKeywords = [
'no way out', "can't go on", 'cant go on', 'cannot go on',
'nobody cares', 'nothing matters', 'no purpose', 'giving up on life',
"can't take it", 'too much pain', 'no hope left', 'burden',
'waste of space', 'stop the pain'
'never wake up', 'sleep forever', 'end the pain', 'stop the pain',
// Hopelessness (NEW) - context-aware phrases to reduce false positives
'no purpose', 'nothing matters', 'giving up on life',
'cant go on', 'cannot go on', "can't take it", 'too much pain',
'no hope left', 'burden', 'waste of space'
];
// Tier 2: Explicit intent - triggers full-screen overlay
@@ -958,13 +956,10 @@ Sovereignty and service always.`;
function getCrisisLevel(text) {
var lower = text.toLowerCase();
for (var i = 0; i < explicitPhrases.length; i++) {
if (lower.indexOf(explicitPhrases[i]) !== -1) return 4;
if (lower.indexOf(explicitPhrases[i]) !== -1) return 2;
}
for (var j = 0; j < highKeywords.length; j++) {
if (lower.indexOf(highKeywords[j]) !== -1) return 3;
}
for (var k = 0; k < mediumKeywords.length; k++) {
if (lower.indexOf(mediumKeywords[k]) !== -1) return 2;
for (var j = 0; j < crisisKeywords.length; j++) {
if (lower.indexOf(crisisKeywords[j]) !== -1) return 1;
}
return 0;
}
@@ -974,7 +969,7 @@ Sovereignty and service always.`;
var level = getCrisisLevel(userText);
if (level === 0) return SYSTEM_PROMPT;
var levelMap = { 0: 'NONE', 1: 'LOW', 2: 'MEDIUM', 3: 'HIGH', 4: 'CRITICAL' };
var levelMap = { 0: 'NONE', 1: 'MEDIUM', 2: 'CRITICAL' };
var profileName = levelMap[level] || 'NONE';
var profile = COMPASSION_PROFILES[profileName];

24
tests/test_about_link.py Normal file
View File

@@ -0,0 +1,24 @@
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()