@@ -661,6 +661,19 @@ impl SignalAnalyzer {
661661 // Frustration
662662 "this is frustrating" ,
663663 "frustrated" ,
664+ "incomplete" ,
665+ "overwhelm" ,
666+ "overwhelmed" ,
667+ "overwhelming" ,
668+ "exhausted" ,
669+ "struggled" ,
670+ // same issue
671+ "same issue" ,
672+ // polite dissatisfaction
673+ "i'm disappointed" ,
674+ "thanks, but" ,
675+ "appreciate it, but" ,
676+ "good, but" ,
664677 // Fed up/done
665678 "i give up" ,
666679 "give up" ,
@@ -2040,4 +2053,68 @@ mod tests {
20402053 println ! ( "test_frustrated_user_false_claim took: {:?}" , start. elapsed( ) ) ;
20412054 println ! ( "Full signal analysis completed in {:?}" , start. elapsed( ) ) ;
20422055 }
2056+
2057+ // false negative tests
2058+ #[ test]
2059+ fn test_dissatisfaction_polite_not_working_for_me ( ) {
2060+ let analyzer = SignalAnalyzer :: new ( ) ;
2061+ let messages = vec ! [
2062+ create_message( Role :: User , "Thanks, but this still isn't working for me." ) , // Polite dissatisfaction, e.g., I appreciate it, but this isn't what I was looking for.
2063+ create_message( Role :: Assistant , "Sorry—what error do you see?" ) ,
2064+ ] ;
2065+ let normalized = preprocess_messages ( & messages) ;
2066+ let signal = analyzer. analyze_frustration ( & normalized) ;
2067+ assert ! ( signal. has_frustration, "Polite dissatisfaction should be detected" ) ;
2068+ }
2069+
2070+
2071+ #[ test]
2072+ fn test_dissatisfaction_giving_up_without_escalation ( ) {
2073+ let analyzer = SignalAnalyzer :: new ( ) ;
2074+ let messages = vec ! [
2075+ create_message( Role :: User , "Never mind, I'll figure it out myself." ) ,
2076+ ] ;
2077+ let normalized = preprocess_messages ( & messages) ;
2078+ let signal = analyzer. analyze_escalation ( & normalized) ;
2079+ assert ! ( signal. escalation_requested, "Giving up should count as escalation/quit intent" ) ;
2080+ }
2081+
2082+ #[ test]
2083+ fn test_dissatisfaction_same_problem_again ( ) {
2084+ let analyzer = SignalAnalyzer :: new ( ) ;
2085+ let messages = vec ! [
2086+ create_message( Role :: User , "I'm running into the same issue again." ) ,
2087+ ] ;
2088+ let normalized = preprocess_messages ( & messages) ;
2089+ let signal = analyzer. analyze_frustration ( & normalized) ;
2090+ assert ! ( signal. has_frustration, "'same issue again' should be detected" ) ;
2091+ }
2092+
2093+ #[ test]
2094+ fn test_unsatisfied_incomplete ( ) {
2095+ let analyzer = SignalAnalyzer :: new ( ) ;
2096+ let messages = vec ! [ create_message( Role :: User , "This feels incomplete." ) ] ;
2097+ let normalized = preprocess_messages ( & messages) ;
2098+ let signal = analyzer. analyze_frustration ( & normalized) ;
2099+ assert ! ( signal. has_frustration, "Should detect 'incomplete' dissatisfaction" ) ;
2100+ }
2101+
2102+ #[ test]
2103+ fn test_low_mood_overwhelming ( ) {
2104+ let analyzer = SignalAnalyzer :: new ( ) ;
2105+ let messages = vec ! [ create_message( Role :: User , "This is overwhelming and I'm not sure what to do." ) ] ;
2106+ let normalized = preprocess_messages ( & messages) ;
2107+ let signal = analyzer. analyze_frustration ( & normalized) ;
2108+ assert ! ( signal. has_frustration, "Should detect overwhelmed language" ) ;
2109+ }
2110+
2111+ #[ test]
2112+ fn test_low_mood_exhausted_trying ( ) {
2113+ let analyzer = SignalAnalyzer :: new ( ) ;
2114+ let messages = vec ! [ create_message( Role :: User , "I'm exhausted trying to get this working." ) ] ;
2115+ let normalized = preprocess_messages ( & messages) ;
2116+ let signal = analyzer. analyze_frustration ( & normalized) ;
2117+ assert ! ( signal. has_frustration, "Should detect exhaustion/struggle language" ) ;
2118+ }
2119+
20432120}
0 commit comments