checkpoint: rename InitialAttribution to Attribution · Entire

checkpoint: rename InitialAttribution to Attribution

dee4e53main··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

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)
    }
}