calculate_link_confidence

Function calculate_link_confidence 

Source
pub fn calculate_link_confidence(
    session_branch: Option<&str>,
    session_files: &[String],
    commit_branch: &str,
    commit_files: &[String],
    time_diff_minutes: i64,
) -> f64
Expand description

Calculates a confidence score for auto-linking a session to a commit.

The score is based on multiple factors:

  • Branch match (20%): Session and commit are on the same branch
  • File overlap (40%): Proportion of commit files mentioned in the session
  • Time proximity (30%): Decays over 30 minutes
  • Recent activity bonus (10%): Extra weight for commits within 5 minutes

Returns a value between 0.0 and 1.0.