Expand description
Failure attribution using git blame.
Maps validation errors to specific tasks by parsing error output for
file:line references and using git blame to find which commits changed
those lines. Task IDs are extracted from commit message prefixes like [TASK-ID].
§Example
use scud::attribution::{attribute_failure, AttributionConfidence};
use std::path::Path;
let working_dir = Path::new(".");
let wave_tasks = vec!["auth:1".to_string(), "auth:2".to_string()];
let attribution = attribute_failure(
working_dir,
"error: src/main.rs:42: undefined variable",
"",
&wave_tasks,
None,
).unwrap();
match attribution.confidence {
AttributionConfidence::High => println!("Clear responsible: {:?}", attribution.responsible_tasks),
AttributionConfidence::Medium => println!("Multiple suspects: {:?}", attribution.responsible_tasks),
AttributionConfidence::Low => println!("Cannot determine - all tasks suspect"),
}Failure attribution using git blame
Maps validation errors to specific tasks by:
- Parsing error output for file:line references
- Using git blame to find which commit changed each line
- Extracting task IDs from commit messages ([TASK-ID] prefix)
Structs§
- Attribution
- Result of attributing a failure to tasks
- Attribution
Evidence
Enums§
Functions§
- attribute_
failure - Main attribution function - attributes validation failure to tasks
- blame_
line - Use git blame to find which task changed a specific line
- extract_
task_ id_ from_ commit - Get task ID from a commit message (looks for [TASK-ID] prefix)
- get_
task_ changed_ files - Get files changed by a specific task (via its commits)
- get_
task_ commits - Get all commits in range that match task ID pattern
- parse_
error_ locations - Parse error output for file:line references