Temporal_Exploration / tests /test_rhythma_profiles.py
ciaochris's picture
Introduce session profiles for Rhythma analysis
b50aae8
from rhythma_analysis import RhythmaSymphAICore
def test_build_session_profile_for_anxious_text():
core = RhythmaSymphAICore(use_groq=False, use_embeddings=False)
result = core.analyze_input("I feel anxious and need to settle down")
assert result["emotional_state"] == "anxious"
assert result["session_profile"]["title"] == "Grounding Tide"
assert result["session_profile"]["pattern"] == "calm"
assert result["session_profile"]["modulation_type"] == "sine"
assert result["session_profile"]["guidance"].startswith("Let your breath")
def test_apply_profile_overrides_keeps_session_shape():
core = RhythmaSymphAICore(use_groq=False, use_embeddings=False)
result = core.analyze_input("I want to focus on deep work")
profile = core.apply_profile_overrides(
result["session_profile"],
tone_center=512.0,
modulation_type="pulse",
session_pattern="focused",
)
assert profile["tone_center"] == 512.0
assert profile["modulation_type"] == "pulse"
assert profile["pattern"] == "focused"
assert profile["title"] == result["session_profile"]["title"]
def test_build_session_profile_for_stressed_text():
core = RhythmaSymphAICore(use_groq=False, use_embeddings=False)
result = core.analyze_input("I feel stressed and overloaded")
assert result["emotional_state"] == "stressed"
assert result["session_profile"]["key"] == "stressed"
assert result["session_profile"]["title"] == "Soft Landing"
assert result["session_profile"]["pattern"] == "relaxed"
def test_explicit_emotion_wins_over_focus_heuristic():
core = RhythmaSymphAICore(use_groq=False, use_embeddings=False)
result = core.analyze_input("I feel anxious and need to focus")
assert result["emotional_state"] == "anxious"
assert result["session_profile"]["key"] == "anxious"
assert result["session_profile"]["title"] == "Grounding Tide"