()
| 711 | |
| 712 | #[test] |
| 713 | fn test_append_and_read_back() { |
| 714 | let graph = sherpa_graph(); |
| 715 | let tmp = tempfile::tempdir().unwrap(); |
| 716 | let record = to_agent_trace_record(&graph, tmp.path()); |
| 717 | |
| 718 | append_agent_trace(&record, tmp.path()); |
| 719 | |
| 720 | let path = tmp.path().join(".agent-trace").join("traces.jsonl"); |
| 721 | assert!(path.exists()); |
| 722 | |
| 723 | let contents = std::fs::read_to_string(&path).unwrap(); |
| 724 | let parsed: TraceRecord = serde_json::from_str(contents.trim()).unwrap(); |
| 725 | assert_eq!(parsed.version, "0.1.0"); |
| 726 | assert_eq!( |
| 727 | parsed.metadata["dev.atomic"]["profile"]["schema"], |
| 728 | "sherpa-trace" |
| 729 | ); |
| 730 | } |
| 731 | |
| 732 | #[test] |
| 733 | fn test_append_multiple_records_produces_valid_jsonl() { |
nothing calls this directly
no test coverage detected