Compare commits
1 Commits
fix/141-cr
...
fix/41
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
51a197ae14 |
@@ -1,19 +0,0 @@
|
||||
"""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",
|
||||
]
|
||||
@@ -1,19 +0,0 @@
|
||||
"""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",
|
||||
]
|
||||
32
docs/issue-41-verification.md
Normal file
32
docs/issue-41-verification.md
Normal file
@@ -0,0 +1,32 @@
|
||||
# Issue #41 Verification
|
||||
|
||||
Status: already implemented on main
|
||||
|
||||
Issue:
|
||||
- #41 [P3] Service worker: cache crisis resources for offline
|
||||
|
||||
Acceptance criteria check:
|
||||
1. Passed — offline page includes 988 call button, Crisis Text Line, and grounding techniques
|
||||
2. Passed — service worker precaches `crisis-offline.html`
|
||||
3. Passed — phone number is clickable via `href="tel:988"`
|
||||
4. Passed — navigation timeout + offline fallback support intermittent connections
|
||||
|
||||
Evidence:
|
||||
- `sw.js` precaches `/crisis-offline.html`
|
||||
- `sw.js` contains `NAVIGATION_TIMEOUT_MS` and `AbortController`
|
||||
- `crisis-offline.html` contains:
|
||||
- `href="tel:988"`
|
||||
- Crisis Text Line / `741741`
|
||||
- grounding prompts for 5-4-3-2-1
|
||||
- `tests/test_service_worker_offline.py` already exists on main and passes
|
||||
|
||||
Verification run from fresh main clone:
|
||||
- `python3 -m pytest tests/test_service_worker_offline.py -q`
|
||||
- `10 passed`
|
||||
|
||||
Prior implementation trail:
|
||||
- Issue comment already states the core implementation is complete on main
|
||||
- Closed PR #122 documented the already-complete implementation and added the offline guarantees test coverage that is now present on main
|
||||
|
||||
Recommendation:
|
||||
- Close issue #41 as already implemented on main.
|
||||
@@ -1,26 +0,0 @@
|
||||
"""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