refinery patrol: Reorder merge-push for reliable MERGED notification (gt-kfznm)

- Notifications now come immediately after push, before cleanup
- Added STOP HERE warning after push
- Made verification gate more emphatic
- Cleanup happens only after notifications confirmed

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Steve Yegge
2025-12-28 16:31:04 -08:00
parent 4b1d488f14
commit b68cbf582f

View File

@@ -161,20 +161,20 @@ id = "merge-push"
title = "Merge and push to main" title = "Merge and push to main"
needs = ["handle-failures"] needs = ["handle-failures"]
description = """ description = """
Merge to main and push immediately. Merge to main and push. CRITICAL: Notifications come IMMEDIATELY after push.
**Step 1: Merge** **Step 1: Merge and Push**
```bash ```bash
git checkout main git checkout main
git merge --ff-only temp git merge --ff-only temp
git push origin main git push origin main
git branch -d temp
git push origin --delete <polecat-branch> # Delete remote polecat branch
``` ```
**Step 2: Notify Witness (REQUIRED - DO NOT SKIP)** ⚠️ **STOP HERE - DO NOT PROCEED UNTIL STEPS 2-3 COMPLETE**
After successful merge, you MUST send MERGED mail to Witness: **Step 2: Send MERGED Notification (REQUIRED - DO THIS IMMEDIATELY)**
RIGHT NOW, before any cleanup, send MERGED mail to Witness:
```bash ```bash
gt mail send <rig>/witness -s "MERGED <polecat-name>" -m "Branch: <branch> gt mail send <rig>/witness -s "MERGED <polecat-name>" -m "Branch: <branch>
@@ -182,25 +182,31 @@ Issue: <issue-id>
Merged-At: $(date -u +%Y-%m-%dT%H:%M:%SZ)" Merged-At: $(date -u +%Y-%m-%dT%H:%M:%SZ)"
``` ```
This signals the Witness to nuke the polecat worktree. Without this notification, This signals the Witness to nuke the polecat worktree. WITHOUT THIS NOTIFICATION,
polecat worktrees accumulate indefinitely. POLECAT WORKTREES ACCUMULATE INDEFINITELY AND THE LIFECYCLE BREAKS.
**Step 3: Close MR bead (REQUIRED - DO NOT SKIP)** **Step 3: Close MR Bead (REQUIRED - DO THIS IMMEDIATELY)**
Close the merge-request bead that was created when polecat ran `gt done`:
```bash ```bash
bd close <mr-bead-id> --reason "Merged to main at $(git rev-parse --short HEAD)" bd close <mr-bead-id> --reason "Merged to main at $(git rev-parse --short HEAD)"
``` ```
The MR bead ID was included in the MERGE_READY message or can be found via: The MR bead ID was in the MERGE_READY message or find via:
```bash ```bash
bd list --type=merge-request --status=open | grep <polecat-name> bd list --type=merge-request --status=open | grep <polecat-name>
``` ```
**Verification**: Before proceeding, confirm: **Step 4: Cleanup (only after Steps 2-3 confirmed)**
- [ ] MERGED mail sent to witness ```bash
- [ ] MR bead closed git branch -d temp
git push origin --delete <polecat-branch>
```
**VERIFICATION GATE**: You CANNOT proceed to loop-check without:
- [x] MERGED mail sent to witness
- [x] MR bead closed
If you skipped notifications, GO BACK AND SEND THEM NOW.
Main has moved. Any remaining branches need rebasing on new baseline.""" Main has moved. Any remaining branches need rebasing on new baseline."""