add codeline agent attribution for manual commits#101
Merged
gtrrz-victor merged 32 commits intomainfrom Jan 28, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds line-level agent attribution tracking for manual commits by comparing the shadow branch (agent work) against HEAD (what was actually committed). The calculated metrics show how much of the committed code came from the agent unchanged versus human edits, including an agent percentage.
Changes:
- Adds
InitialAttributionstruct to capture line-level metrics (agent lines, human added/modified/removed, total committed, agent percentage) - Implements diffing logic using
github.com/sergi/go-diff/diffmatchpatchto compare checkpoint tree vs committed tree - Integrates attribution calculation into the manual-commit condensation flow
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| cmd/entire/cli/checkpoint/checkpoint.go | Defines InitialAttribution struct and adds it to WriteCommittedOptions and CommittedMetadata |
| cmd/entire/cli/checkpoint/committed.go | Passes InitialAttribution through to metadata.json during checkpoint write |
| cmd/entire/cli/strategy/manual_commit_attribution.go | Implements CalculateAttribution with line-level diff logic, binary file handling, and edge case handling |
| cmd/entire/cli/strategy/manual_commit_attribution_test.go | Unit tests for diffLines, countLinesStr, and attribution calculation edge cases |
| cmd/entire/cli/strategy/manual_commit_condensation.go | Integrates attribution calculation into CondenseSession by comparing shadow tree to HEAD tree |
| cmd/entire/cli/strategy/manual_commit_test.go | Integration test verifying attribution is calculated and written to metadata.json |
3f3384a to
164ceba
Compare
Collaborator
Author
|
bugbot run |
Entire-Checkpoint: 764ea1a5fad1
Entire-Checkpoint: 4902a08f9b18
Entire-Checkpoint: 646566222911
Entire-Checkpoint: ea217859e24e
Entire-Checkpoint: 915ce19ee748
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Entire-Checkpoint: aa778e725b89
Entire-Checkpoint: b59708d80b7f
Entire-Checkpoint: cf94b61f8eef
c65f190 to
ce6c7cb
Compare
Entire-Checkpoint: e577a6f39913
…pturing the design Entire-Checkpoint: 47db6946d2e9
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 3 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
Entire-Checkpoint: 727155f451db
Entire-Checkpoint: e14c4e9a2298
Entire-Checkpoint: 7a0f7b5d6c56
Entire-Checkpoint: 8533ba3a79ea
gtrrz-victor
approved these changes
Jan 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds new fields to the
metadata.json:This is done by comparing the shadow branch against the commit that was made. Any change not in the shadow branch was made by the user. Based on that we calculate a percentage.
Note
Introduces commit-time attribution metrics and prompt-time tracking to quantify agent vs. human contributions in manual-commit flow.
initial_attributiontometadata.jsonwith fields likeagent_lines,human_added,human_modified,human_removed,total_committed, andagent_percentage; timestamps UTCbase → shadow(agent work) andshadow → head(post-checkpoint user edits), excluding binary files; retains attribution across multi-session mergesPromptAttributions,PendingPromptAttribution) computed at prompt start from the worktree; stored on checkpoint save and cleared after condensationgo-diffdependencyWritten by Cursor Bugbot for commit 6faf363. This will update automatically on new commits. Configure here.