Merge pull request #1186 from MuskanPaliwal/improve-human-added-attribution-docs · Entire
Merge pull request #1186 from MuskanPaliwal/improve-human-added-attribution-docs
3ebc57d→main·blackgirlbytes·4d ago·1 file·+33 added/-0 removed
Changes
1
docs/architecture
- Mattribution.md+33
49 unmodified lines
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
49 unmodified lines
3. Calculating agent work (base → shadow minus accumulated user edits)
4. Computing the final percentage
### Attribution Metadata Fields
Attribution is calculated for commits associated with an Entire-tracked agent session/checkpoint. It does not track keystrokes or exact authorship. The metrics are inferred from line diffs and hook timing. Changes made after a completed checkpoint and detected before the next agent turn, or after the latest checkpoint before commit, are treated as user-side changes. Changes already present before the first agent turn are treated as a pre-session baseline and excluded from the final human contribution counts.
- `agent_lines` - agent-attributed added lines that remain in the commit
- `agent_removed` - agent-attributed deletions that remain deleted in the commit
- `human_added` - user-side additions that are not paired with removals as modifications
- `human_modified` - aggregate estimate calculated as the smaller of eligible user-side additions and removals; pairing is not tracked per hunk or file
- `human_removed` - estimated unpaired user-side removals captured between prompts or after the latest checkpoint in agent-touched files
- `total_committed` - legacy additions-focused compatibility metric; not guaranteed to equal the commit's literal net line count
- `total_lines_changed` - total changed lines used as the attribution denominator
- `agent_percentage` - agent changed lines divided by total changed lines
For example, if a user-side diff removes 5 lines and adds 2 replacement lines,
the model classifies that as:
```text
human_modified: 2
human_removed: 3
human_added: 0
The 2 added lines are still counted as user-side work, but under human_modified because they replaced existing lines. If the user instead adds 2 lines on top of the existing content without removing anything, those lines count as human_added: 2.
Key Files
manual_commit_attribution.go- Core attribution calculation logic