checkpoint: rename InitialAttribution to Attribution · Entire
checkpoint: rename InitialAttribution to Attribution
dee4e53→main··Soph·3w ago·14 files·+131 added/-131 removed
There is only one attribution struct; 'Initial' was misleading because the same type also carries the combined, post-commit attribution (CombinedAttribution *Attribution). Drop the qualifier. Whole-codebase rename, no behavior change.
Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com
Sessions
64c76c6df888View transcript
Changes
14
cmd/entire/cli
Mattribution.go+3/-3
Mattribution_test.go+7/-7
checkpoint
Mcheckpoint.go+17/-17
- Mcommitted.go+2/-2
- Mcommitted_write.go+1/-1
- Mcommitted_write_test.go+1/-1
integration_test
Mattribution_test.go+15/-15
strategy
Mcommon.go+2/-2
- Mmanual_commit_attribution.go+2/-2
- Mmanual_commit_condensation.go+3/-3
- Mmanual_commit_hooks.go+1/-1
- Mmanual_commit_test.go+51/-51
e2e
tests
Mattribution_test.go+13/-13
testutil
Mmetadata.go+13/-13
563 unmodified lines
func (r *attributionResolver) readSessionForCheckpoint(cpID id.CheckpointID, index int) (checkpointSessionForFile, error) {
Prompt: prompt,
Intent: intent,
FilesTouched: normalizePathSlice(meta.FilesTouched),
Attribution: meta.InitialAttribution,
Attribution: meta.Attribution,
}, nil
}
func attributionIsMixed(attr *checkpoint.InitialAttribution) bool {
func attributionIsMixed(attr *checkpoint.Attribution) bool {
if attr == nil {
return false
}
}
Checkpoint Summary Structure
// InitialAttribution captures line-level attribution metrics at commit time. // Attribution captures line-level attribution metrics at commit time. // This is a point-in-time snapshot comparing the checkpoint tree (agent work) // against the committed tree (may include human edits).
type InitialAttribution struct {
CalculatedAt time.Time json:"calculated_at"
AgentLines int json:"agent_lines" // Lines added by agent that remain in the commit
AgentRemoved int json:"agent_removed" // Lines removed by agent that remain removed in the commit
}
// TestCondenseSession_AttributionWithoutShadowBranch verifies that when an agent
// condenses a session, it calculates Attribution by comparing the shadow branch
func TestCondenseSession_AttributionWithoutShadowBranch(t *testing.T) {
dir := t.TempDir()
testutil.InitRepo(t, dir)
repo, err := git.PlainOpen(dir)
tif err != nil {
t.Fatal(err)
}
checkpointID := id.MustCheckpointID("a1b2c3d4e5f6")
result, err := s.CondenseSession(context.Background(), repo, checkpointID, state, nil)
if err != nil {
t.Errorf("CheckpointID = %q, want %q", result.CheckpointID, checkpointID)
}
}