Deploy Poimen Memory K8s cluster with ArgoCD tracking (M2.2, M3.5-M3.7)
ci / markdown (push) Waiting to run

This commit is contained in:
Story Crater Bot
2026-08-22 23:13:42 -07:00
parent 9c723fe66f
commit d3be7f6fd4
105 changed files with 10973 additions and 113 deletions
+108
View File
@@ -0,0 +1,108 @@
use mem_core::parse_gate_response;
#[test]
fn a1_wellformed_yes_continue() {
let response = r#"<think>This is useful</think>
<check>yes</check>
<update>New memory text here</update>
<next>continue</next>"#;
let result = parse_gate_response(response).expect("Should parse");
assert_eq!(result.think, "This is useful");
assert!(result.update_gate);
assert_eq!(result.candidate, "New memory text here");
assert!(!result.exit_gate);
}
#[test]
fn a2_wellformed_no_end() {
let response = r#"<think>Not relevant</think>
<check>no</check>
<update>Memory stays same</update>
<next>end</next>"#;
let result = parse_gate_response(response).expect("Should parse");
assert_eq!(result.think, "Not relevant");
assert!(!result.update_gate);
assert_eq!(result.candidate, "Memory stays same");
assert!(result.exit_gate);
}
#[test]
fn a3_missing_check_errors() {
let response = r#"<think>Thinking</think>
<update>Memory text</update>
<next>continue</next>"#;
let err = parse_gate_response(response).expect_err("Should error");
assert_eq!(err.tag, "check");
}
#[test]
fn a4_invalid_check_value() {
let response = r#"<think>Thinking</think>
<check>maybe</check>
<update>Memory text</update>
<next>continue</next>"#;
let err = parse_gate_response(response).expect_err("Should error");
assert_eq!(err.tag, "check");
assert!(err.message.contains("yes") || err.message.contains("no"));
}
#[test]
fn a5_invalid_next_value() {
let response = r#"<think>Thinking</think>
<check>yes</check>
<update>Memory text</update>
<next>maybe</next>"#;
let err = parse_gate_response(response).expect_err("Should error");
assert_eq!(err.tag, "next");
}
#[test]
fn a6_missing_update_errors() {
let response = r#"<think>Thinking</think>
<check>yes</check>
<next>continue</next>"#;
let err = parse_gate_response(response).expect_err("Should error");
assert_eq!(err.tag, "update");
}
#[test]
fn a7_nested_think_uses_last() {
let response = r#"<think>First thought</think>
<think>Second thought that matters</think>
<check>yes</check>
<update>Memory text</update>
<next>continue</next>"#;
let result = parse_gate_response(response).expect("Should parse");
assert_eq!(result.think, "Second thought that matters");
}
#[test]
fn a8_duplicate_check_errors() {
let response = r#"<think>Thinking</think>
<check>yes</check>
<check>no</check>
<update>Memory text</update>
<next>continue</next>"#;
let err = parse_gate_response(response).expect_err("Should error");
assert_eq!(err.tag, "check");
assert!(err.message.contains("appears"));
}
#[test]
fn a9_unclosed_tag_errors() {
let response = r#"<think>Thinking
<check>yes</check>
<update>Memory text</update>
<next>continue</next>"#;
let err = parse_gate_response(response).expect_err("Should error");
assert_eq!(err.tag, "think");
}