MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / test_informed_commit

Function test_informed_commit

atomic-agent/src/provenance/consolidate.rs:900–926  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

898
899 #[test]
900 fn test_informed_commit() {
901 let mut nodes = vec![
902 goal("g1", "Fix the bug"),
903 exploration("e1", "src/auth.rs"),
904 exploration("e2", "src/jwt.rs"),
905 commitment("c1", "src/auth.rs"),
906 ];
907 let mut edges = Vec::new();
908 let mut stats = GraphStats::default();
909 stats.goal_count = 1;
910 stats.exploration_count = 2;
911 stats.commitment_count = 1;
912
913 let created = run_consolidate(&mut nodes, &mut edges, &mut stats);
914
915 assert_eq!(created, 1);
916
917 let decision = nodes.iter().find(|n| n.kind == NodeKind::Decision).unwrap();
918 assert!(decision.summary.contains("2 files"));
919 assert!(decision.summary.contains("auth.rs"));
920
921 let detail = decision.detail.as_ref().unwrap();
922 assert_eq!(
923 detail.get("pattern").unwrap().as_str().unwrap(),
924 "informed_commit"
925 );
926 }
927
928 // ---- Commit and verify ----
929

Callers

nothing calls this directly

Calls 4

run_consolidateFunction · 0.85
as_refMethod · 0.80
unwrapMethod · 0.45
iterMethod · 0.45

Tested by

no test coverage detected