Repository navigation
chore(harness): encode post-merge cleanup into ship-pr + session-start - #63
Merged
Merged
Conversation
Closes the last gap in the post-edit harness loop. Previously, after auto-merge landed a PR, the local feature branch lingered as an orphan and cleanup was oral tradition. Two complementary controls: - session-start.sh now runs a lightweight stale-branch sensor before the cache-warming section. It runs unconditionally (local + remote), fetches with --prune, and prints a one-line cleanup hint if the current branch's upstream ref is gone. No-op on main and on fresh unpushed branches. - ship-pr SKILL.md gains a Step 8 that polls `gh pr view` once after enabling auto-merge. If the PR landed immediately, the in-session cleanup runs right away. If still OPEN, the session-start sensor picks it up next time. docs/HARNESS.md gets two new rows so the controls are discoverable from the steering meta-doc.
fullstackjam
enabled auto-merge (squash)
May 16, 2026 13:54
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
1 of 2 tasks
fullstackjam
added a commit
that referenced
this pull request
May 16, 2026
…65) The sensor in .claude/hooks/session-start.sh was introduced when ship-pr used `gh pr merge --auto` — merges happened asynchronously after the session ended, so a feature branch could linger checked out into the next session and the sensor nagged the user to clean it up. PR #64 dropped --auto. Merges are now synchronous and cleanup is Step 8 of the ship-pr loop, which always runs before the session can end on a shipped PR. The sensor's trigger condition can no longer occur in normal flow, so it's dead code paying for a per-session `git fetch`. - session-start.sh restored to the pre-#63 shape (cache warming only). - ship-pr SKILL.md drops the 'sensor will catch lingering branches' fallback paragraph; the cleanup step is now described as part of the loop, not optional. - docs/HARNESS.md drops the sensor row from the controls table and adds a note in 'What's intentionally NOT in the harness' explaining the removal — so a future agent doesn't re-add it without also re-adding --auto.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes the last gap in the post-edit harness loop: after auto-merge lands a PR, the local feature branch lingers as an orphan, and cleanup was previously oral tradition. Two complementary controls encode it:
.claude/hooks/session-start.sh— adds a stale-branch sensor that runs unconditionally (local + remote, before the cache-warming gate).git fetch --pruneis silent and cheap; if the current branch's upstream ref is gone, it prints a one-line cleanup hint. No-op onmainand on fresh unpushed branches..claude/skills/ship-pr/SKILL.md— gains a Step 8 that pollsgh pr viewonce after enabling auto-merge. If the PR landed immediately, in-session cleanup runs right away. If stillOPEN, the session-start sensor catches it on the next session.docs/HARNESS.md— two new rows in the controls table so both are discoverable from the steering meta-doc.Verified by running
bash .claude/hooks/session-start.shon a fresh feature branch (silent) and on this branch before push (silent).Test plan
bash -n .claude/hooks/session-start.sh(syntax)make test-unitpasses