Skip to content

fix(hooks): robust done-claim diff summary#23

Merged
azmym merged 3 commits into
mainfrom
fix/done-claim-diff-summary
Jun 22, 2026
Merged

fix(hooks): robust done-claim diff summary#23
azmym merged 3 commits into
mainfrom
fix/done-claim-diff-summary

Conversation

@azmym

@azmym azmym commented Jun 22, 2026

Copy link
Copy Markdown
Owner

What

stop-done-claim.sh used git diff --stat HEAD~1 for the validator's evidence. It failed in four cases:

  • Unborn HEAD (first commit not yet made): empty.
  • Root commit (no parent): HEAD~1 errors, empty.
  • Multi-commit task: only the last commit shown.
  • Uncommitted work: HEAD~1 ignores the working tree.

Change

Add build_diff_summary() to hooks/lib/common.sh. It shows staged work on an unborn HEAD, uncommitted changes vs HEAD, and the whole branch since it forked from the default branch (origin/mainmainmaster), falling back to HEAD~1 then the single commit.

Verification

  • All four cases validated in a scratch repo.
  • Smoke-tested against a real multi-commit repo.
  • bash -n clean; 117/117 bats tests pass.

azmym added 3 commits June 2, 2026 19:22
Replace 'git diff --stat HEAD~1' in stop-done-claim.sh, which produced
empty or misleading evidence for the validator in four cases:
- unborn HEAD (first commit not yet made)
- root commit (no parent: HEAD~1 errors)
- multi-commit task (only the last commit was shown)
- uncommitted work (HEAD~1 ignores the working tree)

Add build_diff_summary() to hooks/lib/common.sh: shows staged work on an
unborn HEAD, uncommitted changes vs HEAD, and the whole branch since it
forked from the default branch (origin/main, main, or master), falling
back to HEAD~1 then the single commit. All 117 bats tests still pass.
@azmym azmym added the Claude_Code Changes made by Claude Code label Jun 22, 2026
@azmym azmym self-assigned this Jun 22, 2026
@azmym azmym merged commit 7fddc9a into main Jun 22, 2026
2 checks passed
@azmym azmym deleted the fix/done-claim-diff-summary branch June 22, 2026 13:15
@azmym azmym mentioned this pull request Jun 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Claude_Code Changes made by Claude Code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant