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

Function extract_file

atomic-agent/src/provenance/consolidate.rs:601–618  ·  view source on GitHub ↗

Extract a file path from a node's detail or summary.

(node: &GraphNode)

Source from the content-addressed store, hash-verified

599
600/// Extract a file path from a node's detail or summary.
601fn extract_file(node: &GraphNode) -> Option<String> {
602 // Try detail first
603 if let Some(ref detail) = node.detail {
604 // For commitment nodes: detail.file
605 if let Some(file) = detail.get("file").and_then(|v| v.as_str()) {
606 if !file.is_empty() {
607 return Some(file.to_string());
608 }
609 }
610 // For exploration nodes: detail.target
611 if let Some(target) = detail.get("target").and_then(|v| v.as_str()) {
612 if !target.is_empty() {
613 return Some(target.to_string());
614 }
615 }
616 }
617 None
618}
619
620/// Extract a command string from a verification node's detail.
621fn extract_command(node: &GraphNode) -> Option<String> {

Callers 6

detect_backtrackingFunction · 0.85
detect_full_cycleFunction · 0.85
detect_commit_and_verifyFunction · 0.85
detect_informed_commitFunction · 0.85

Calls 3

getMethod · 0.65
as_strMethod · 0.45
is_emptyMethod · 0.45

Tested by

no test coverage detected