Attribution Bugs and Refactoring in CLI · Entire

PR #1305 — "Add Entire blame and why commands" by suhaanthayyil

You're now on branch codex/entire-blame-why. The PR adds two AI-aware line attribution commands:

It works by running git blame --line-porcelain, then enriching the blamed commits with Entire-Checkpoint trailers and checkpoint/session metadata from the entire/checkpoints/v1 branch.

Changes Made

Done. blame and why are now hidden Labs commands. Here's what changed:

Verified behavior:

Full Review Findings

  1. [AI] flips to [MX] between blame and why — inconsistent authorship rules (attribution.go:479 vs :372) - address before merge.
  2. Mixed is checkpoint-scoped, not session/file-scoped — over-reports [MX] (attribution.go:420) - fix is necessary.
  3. Renamed files silently fall back to the wrong session (attribution.go:437, pathsContainFile at :1081) - requires correction.
  4. All-sessions-read-failure yields a blank-but-confident [AI] line (attribution.go:442) - improve user feedback.

Cleanup (non-blocking)

  1. Three structurally identical structs (attribution.go:73, :85, partially :516) - suggest collapsing into one.
  2. renderAttributionBlameCompact / renderAttributionBlameLong duplicate scaffolding (attribution.go:743, :784) - optimization needed.
  3. Summary percentages can sum to 99% (attribution.go:727) - fix for cleaner output.

Summary of the Work Done

Completing all fixes and adding regression tests, with all parts verified to ensure accuracy.