microclaw_engine/
relationship.rs1const NEW_MAX: i64 = 6;
11const FAMILIAR_MIN: i64 = 200;
13
14pub fn familiarity_hint(message_count: i64) -> Option<&'static str> {
17 if message_count < NEW_MAX {
18 Some(
19 "This looks like one of your first conversations with this person. Be welcoming and a \
20touch more explicit — you don't share much history yet, so don't assume prior context.",
21 )
22 } else if message_count >= FAMILIAR_MIN {
23 Some(
24 "You and this person go back a long way. You can be relaxed and familiar, and lean on \
25the history and context you already share.",
26 )
27 } else {
28 None
29 }
30}
31
32#[cfg(test)]
33mod tests {
34 use super::*;
35
36 #[test]
37 fn new_chats_get_a_welcoming_nudge() {
38 assert!(familiarity_hint(0).unwrap().contains("first conversations"));
39 assert!(familiarity_hint(5).is_some());
40 }
41
42 #[test]
43 fn the_middle_stays_silent() {
44 assert!(familiarity_hint(6).is_none());
45 assert!(familiarity_hint(50).is_none());
46 assert!(familiarity_hint(199).is_none());
47 }
48
49 #[test]
50 fn long_running_chats_get_a_familiar_nudge() {
51 assert!(familiarity_hint(200)
52 .unwrap()
53 .contains("go back a long way"));
54 assert!(familiarity_hint(5000).is_some());
55 }
56}