Module attribution

Module attribution 

Source
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:

  1. Parsing error output for file:line references
  2. Using git blame to find which commit changed each line
  3. Extracting task IDs from commit messages ([TASK-ID] prefix)

Structs§

Attribution
Result of attributing a failure to tasks
AttributionEvidence

Enums§

AttributionConfidence

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