attribution: surface session fallback and unreadable session metadata · Entire

attribution: surface session fallback and unreadable session metadata

cf66e7a→main·

Soph·1mo ago·2 files·+66 added/-0 removed

Two silent-degradation paths in readCheckpointContext gave the user false confidence:

Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com

Sessions

7f9d62c609b2View transcript

Changes

2

    65 unmodified lines
    ```

```go
package attribution

type fileAttributionResult struct {
    Lines []lineAttribution `json:"lines"`
}

type lineAttribution struct {
    Prompt          string                 `json:"prompt,omitempty"`
    Intent          string                 `json:"intent,omitempty"`
    MetadataMissing bool                   `json:"metadata_missing,omitempty"`
    SessionFallback bool                   `json:"session_fallback,omitempty"`
    Content         string                 `json:"content"`
    Candidates      []attributionCandidate `json:"candidates,omitempty"`
}

Tests

TestAttributionFlagsSessionFallbackForUnmatchedFile

func TestAttributionFlagsSessionFallbackForUnmatchedFile(t *testing.T) {
    repoRoot := newAttributionRepo(t)
    writeAttributionCheckpoint(t, repoRoot, "aab2c3d4e5f6", checkpoint.WriteCommittedOptions{
        SessionID:        "session-one-12345678",
        Prompts:          []string{"Edit the first file."},
        FilesTouched:     []string{"old_name.py"},
        Agent:            agent.AgentTypeClaudeCode,
        CheckpointsCount: 1,
    })
}

TestRunGitBlameWrapsExecError

func TestRunGitBlameWrapsExecError(t *testing.T) {
    repoRoot := newAttributionRepo(t)
}