Detect full cycle: explore → commit → verify. The agent reads files, makes a change, then validates it.
(
nodes: &[GraphNode],
seq: &[usize],
counter: &mut u64,
prefix: &str,
)
| 343 | /// |
| 344 | /// The agent reads files, makes a change, then validates it. |
| 345 | fn detect_full_cycle( |
| 346 | nodes: &[GraphNode], |
| 347 | seq: &[usize], |
| 348 | counter: &mut u64, |
| 349 | prefix: &str, |
| 350 | ) -> Option<(GraphNode, Vec<GraphEdge>)> { |
| 351 | let mut has_exploration = false; |
| 352 | let mut has_commitment = false; |
| 353 | let mut has_verification = false; |
| 354 | let mut committed_file = None; |
| 355 | let mut verify_cmd = None; |
| 356 | |
| 357 | for &idx in seq { |
| 358 | let node = &nodes[idx]; |
| 359 | match node.kind { |
| 360 | NodeKind::Exploration => has_exploration = true, |
| 361 | NodeKind::Commitment => { |
| 362 | has_commitment = true; |
| 363 | if committed_file.is_none() { |
| 364 | committed_file = extract_file(node); |
| 365 | } |
| 366 | } |
| 367 | NodeKind::Verification => { |
| 368 | has_verification = true; |
| 369 | if verify_cmd.is_none() { |
| 370 | verify_cmd = extract_command(node); |
| 371 | } |
| 372 | } |
| 373 | _ => {} |
| 374 | } |
| 375 | } |
| 376 | |
| 377 | if !(has_exploration && has_commitment && has_verification) { |
| 378 | return None; |
| 379 | } |
| 380 | |
| 381 | let file_display = committed_file |
| 382 | .as_deref() |
| 383 | .map(short_path) |
| 384 | .unwrap_or_else(|| "file".to_string()); |
| 385 | |
| 386 | let cmd_display = verify_cmd |
| 387 | .as_deref() |
| 388 | .map(|c| truncate(c, 40)) |
| 389 | .unwrap_or_else(|| "tests".to_string()); |
| 390 | |
| 391 | let exploration_count = seq |
| 392 | .iter() |
| 393 | .filter(|&&i| nodes[i].kind == NodeKind::Exploration) |
| 394 | .count(); |
| 395 | |
| 396 | let summary = format!( |
| 397 | "Investigated ({} files) → fixed {} → verified with {}", |
| 398 | exploration_count, file_display, cmd_display |
| 399 | ); |
| 400 | |
| 401 | let consolidated_ids: Vec<String> = seq.iter().map(|&i| nodes[i].id.clone()).collect(); |
| 402 |
no test coverage detected