From aa08b4f5cd963970556003734317aa092b9bc5ea Mon Sep 17 00:00:00 2001 From: Aidan Cunniffe Date: Tue, 25 Nov 2025 15:06:44 -0500 Subject: [PATCH 1/2] no human prompts --- src/authorship/virtual_attribution.rs | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/authorship/virtual_attribution.rs b/src/authorship/virtual_attribution.rs index 3ad10911..070a00de 100644 --- a/src/authorship/virtual_attribution.rs +++ b/src/authorship/virtual_attribution.rs @@ -523,6 +523,11 @@ impl VirtualAttributions { // Group line attributions by author let mut author_lines: HashMap> = HashMap::new(); for line_attr in line_attrs { + // Skip human attributions - we only track AI attributions + if line_attr.author_id == CheckpointKind::Human.to_str() { + continue; + } + for line in line_attr.start_line..=line_attr.end_line { author_lines .entry(line_attr.author_id.clone()) @@ -818,6 +823,11 @@ impl VirtualAttributions { let file_committed_hunks = committed_hunks.get(file_path); for line_attr in line_attrs { + // Skip human attributions - we only track AI attributions + if line_attr.author_id == CheckpointKind::Human.to_str() { + continue; + } + // Check each line individually for workdir_line_num in line_attr.start_line..=line_attr.end_line { // Check if this line is unstaged (in working directory but not in commit) @@ -1036,6 +1046,11 @@ impl VirtualAttributions { let mut committed_lines_map: StdHashMap> = StdHashMap::new(); for line_attr in line_attrs { + // Skip human attributions - we only track AI attributions + if line_attr.author_id == CheckpointKind::Human.to_str() { + continue; + } + // Since we're not dealing with unstaged hunks, the line numbers in VirtualAttributions // are already in the right coordinates (working log coordinates = commit coordinates) for line_num in line_attr.start_line..=line_attr.end_line { @@ -1185,6 +1200,11 @@ impl VirtualAttributions { let mut session_accepted_lines: HashMap = HashMap::new(); for (_file_path, (_char_attrs, line_attrs)) in attributions { for line_attr in line_attrs { + // Skip human attributions - we only track AI prompt metrics + if line_attr.author_id == CheckpointKind::Human.to_str() { + continue; + } + let line_count = line_attr.end_line - line_attr.start_line + 1; *session_accepted_lines .entry(line_attr.author_id.clone()) @@ -1195,6 +1215,11 @@ impl VirtualAttributions { // Calculate overridden_lines: count lines where overrode field matches session_id let mut session_overridden_lines: HashMap = HashMap::new(); for line_attr in &all_line_attributions { + // Skip human attributions - we only track AI prompt metrics + if line_attr.author_id == CheckpointKind::Human.to_str() { + continue; + } + if let Some(overrode_id) = &line_attr.overrode { let mut overridden_lines: HashSet = HashSet::new(); for line in line_attr.start_line..=line_attr.end_line { From 3c08cba3f2c562974b7f5f26e1aae221c12958c9 Mon Sep 17 00:00:00 2001 From: Aidan Cunniffe Date: Tue, 25 Nov 2025 16:49:28 -0500 Subject: [PATCH 2/2] change filter location to preserve stats --- src/authorship/virtual_attribution.rs | 32 ++++++++++++++------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/src/authorship/virtual_attribution.rs b/src/authorship/virtual_attribution.rs index 070a00de..cb34b91f 100644 --- a/src/authorship/virtual_attribution.rs +++ b/src/authorship/virtual_attribution.rs @@ -823,11 +823,6 @@ impl VirtualAttributions { let file_committed_hunks = committed_hunks.get(file_path); for line_attr in line_attrs { - // Skip human attributions - we only track AI attributions - if line_attr.author_id == CheckpointKind::Human.to_str() { - continue; - } - // Check each line individually for workdir_line_num in line_attr.start_line..=line_attr.end_line { // Check if this line is unstaged (in working directory but not in commit) @@ -874,6 +869,11 @@ impl VirtualAttributions { if !committed_lines_map.is_empty() { // Create attestation entries from committed lines for (author_id, mut lines) in committed_lines_map { + // Skip human attributions - we only track AI attributions in the output + if author_id == CheckpointKind::Human.to_str() { + continue; + } + lines.sort(); lines.dedup(); @@ -932,6 +932,11 @@ impl VirtualAttributions { // Convert the map into line attributions let mut uncommitted_line_attrs = Vec::new(); for (author_id, mut lines) in uncommitted_lines_map { + // Skip human attributions - we only track AI attributions in the output + if author_id == CheckpointKind::Human.to_str() { + continue; + } + lines.sort(); lines.dedup(); @@ -1046,11 +1051,6 @@ impl VirtualAttributions { let mut committed_lines_map: StdHashMap> = StdHashMap::new(); for line_attr in line_attrs { - // Skip human attributions - we only track AI attributions - if line_attr.author_id == CheckpointKind::Human.to_str() { - continue; - } - // Since we're not dealing with unstaged hunks, the line numbers in VirtualAttributions // are already in the right coordinates (working log coordinates = commit coordinates) for line_num in line_attr.start_line..=line_attr.end_line { @@ -1072,6 +1072,11 @@ impl VirtualAttributions { if !committed_lines_map.is_empty() { // Create attestation entries from committed lines for (author_id, mut lines) in committed_lines_map { + // Skip human attributions - we only track AI attributions in the output + if author_id == CheckpointKind::Human.to_str() { + continue; + } + lines.sort(); lines.dedup(); @@ -1213,13 +1218,10 @@ impl VirtualAttributions { } // Calculate overridden_lines: count lines where overrode field matches session_id + // NOTE: We intentionally include human attributions here because when a human + // overrides an AI line, the attribution has author_id="human" and overrode="ai_prompt_id" let mut session_overridden_lines: HashMap = HashMap::new(); for line_attr in &all_line_attributions { - // Skip human attributions - we only track AI prompt metrics - if line_attr.author_id == CheckpointKind::Human.to_str() { - continue; - } - if let Some(overrode_id) = &line_attr.overrode { let mut overridden_lines: HashSet = HashSet::new(); for line in line_attr.start_line..=line_attr.end_line {