Compare commits
3 Commits
fix/131-vo
...
fix/141-cr
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f007808228 | ||
|
|
c494bba728 | ||
| d412939b4f |
19
crisis/bridge.py
Normal file
19
crisis/bridge.py
Normal file
@@ -0,0 +1,19 @@
|
||||
"""Compatibility bridge for the-door crisis gateway.
|
||||
|
||||
Issue #141 describes the shared bridge API as `crisis.bridge`.
|
||||
The canonical implementation lives in `crisis.gateway`. Re-export the public
|
||||
entrypoints here so downstream hermes-agent wiring can import the stable name
|
||||
without copying logic out of the-door.
|
||||
"""
|
||||
|
||||
from .gateway import (
|
||||
check_crisis,
|
||||
get_system_prompt,
|
||||
format_gateway_response,
|
||||
)
|
||||
|
||||
__all__ = [
|
||||
"check_crisis",
|
||||
"get_system_prompt",
|
||||
"format_gateway_response",
|
||||
]
|
||||
19
crisis/tracker.py
Normal file
19
crisis/tracker.py
Normal file
@@ -0,0 +1,19 @@
|
||||
"""Compatibility bridge for crisis session tracking.
|
||||
|
||||
Issue #141 describes the shared the-door tracker surface as `crisis.tracker`.
|
||||
The canonical implementation lives in `crisis.session_tracker`, but hermes-agent
|
||||
integration should be able to import the shorter path without caring about
|
||||
internal file layout.
|
||||
"""
|
||||
|
||||
from .session_tracker import (
|
||||
CrisisSessionTracker,
|
||||
SessionState,
|
||||
check_crisis_with_session,
|
||||
)
|
||||
|
||||
__all__ = [
|
||||
"CrisisSessionTracker",
|
||||
"SessionState",
|
||||
"check_crisis_with_session",
|
||||
]
|
||||
@@ -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>
|
||||
|
||||
26
tests/test_crisis_hermes_contract.py
Normal file
26
tests/test_crisis_hermes_contract.py
Normal file
@@ -0,0 +1,26 @@
|
||||
"""Regression tests for the crisis integration contract expected by hermes-agent.
|
||||
|
||||
Issue #141 names the-door-side shared modules as `crisis.tracker` and
|
||||
`crisis.bridge`. Keep those import paths available even if the canonical
|
||||
implementation lives in `session_tracker.py` and `gateway.py`.
|
||||
"""
|
||||
|
||||
import importlib
|
||||
|
||||
|
||||
def test_crisis_tracker_module_exports_session_tracker_contract():
|
||||
tracker = importlib.import_module("crisis.tracker")
|
||||
session_tracker = importlib.import_module("crisis.session_tracker")
|
||||
|
||||
assert tracker.CrisisSessionTracker is session_tracker.CrisisSessionTracker
|
||||
assert tracker.SessionState is session_tracker.SessionState
|
||||
assert tracker.check_crisis_with_session is session_tracker.check_crisis_with_session
|
||||
|
||||
|
||||
def test_crisis_bridge_module_exports_gateway_contract():
|
||||
bridge = importlib.import_module("crisis.bridge")
|
||||
gateway = importlib.import_module("crisis.gateway")
|
||||
|
||||
assert bridge.check_crisis is gateway.check_crisis
|
||||
assert bridge.get_system_prompt is gateway.get_system_prompt
|
||||
assert bridge.format_gateway_response is gateway.format_gateway_response
|
||||
Reference in New Issue
Block a user