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:
entire blame <file> [--line N|N-M] [--json]— likegit blame, but labels lines[AI],[HU],[MX], or[??](uncommitted)entire why <file[:line]> [--json]— resolves a line back to its Entire checkpoint, agent prompt, session, model, etc.
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:
cmd/entire/cli/attribution.go— addedHidden: trueto bothnewBlameCmdandnewWhyCmd, with the same "hidden during maturation" comment style used byreview/org/etc.cmd/entire/cli/labs.go— registeredblameandwhyin theexperimentalCommandsslice and addedentire blame --help/entire why --helpto the "Try:" block in the labs overview.README.md— removed the two command-table rows (no other Labs command appears in that table) and reworded the prose to point users atentire labsfor discovery.
Verified behavior:
entire --help→ blame/why absent from root help ✓entire labs→ both listed as experimental commands ✓entire blame --help/entire why --help→ still fully functional ✓- Existing tests pass (
TestRootHelp_ShowsLabsButHidesReview,TestLabsRegistryCommandsExistAtCanonicalPaths, etc.),mise run fmt && mise run lintclean.
Full Review Findings
[AI]flips to[MX]betweenblameandwhy— inconsistent authorship rules (attribution.go:479vs:372) - address before merge.Mixedis checkpoint-scoped, not session/file-scoped — over-reports[MX](attribution.go:420) - fix is necessary.- Renamed files silently fall back to the wrong session (
attribution.go:437,pathsContainFileat:1081) - requires correction. - All-sessions-read-failure yields a blank-but-confident
[AI]line (attribution.go:442) - improve user feedback.
Cleanup (non-blocking)
- Three structurally identical structs (
attribution.go:73,:85, partially:516) - suggest collapsing into one. renderAttributionBlameCompact/renderAttributionBlameLongduplicate scaffolding (attribution.go:743,:784) - optimization needed.- Summary percentages can sum to 99% (
attribution.go:727) - fix for cleaner output.
Summary of the Work Done
- Small changes to unify authorship rules, set the Mixed flag correctly, and improve user feedback concerning session fallback and invalid metadata.
Completing all fixes and adding regression tests, with all parts verified to ensure accuracy.