| 306 | |
| 307 | #[test] |
| 308 | fn test_reasoning_serde_roundtrip() { |
| 309 | let r = TurnReasoning { |
| 310 | intent: "intent".into(), |
| 311 | outcome: "outcome".into(), |
| 312 | learnings: Learnings { |
| 313 | repo: vec!["repo learning".into()], |
| 314 | code: vec![CodeLearning::new("f.rs", Some(1), "finding") |
| 315 | .with_function("main") |
| 316 | .with_category("bug")], |
| 317 | workflow: vec!["workflow".into()], |
| 318 | }, |
| 319 | friction: vec!["friction".into()], |
| 320 | open_items: vec!["open".into()], |
| 321 | }; |
| 322 | let json = serde_json::to_string_pretty(&r).unwrap(); |
| 323 | let parsed: TurnReasoning = serde_json::from_str(&json).unwrap(); |
| 324 | assert_eq!(r, parsed); |
| 325 | } |
| 326 | |
| 327 | // CodeLearning |
| 328 | |