From 4b1d488f147590b872fe496a5e6388fc37a6bff7 Mon Sep 17 00:00:00 2001 From: Steve Yegge Date: Sun, 28 Dec 2025 16:29:24 -0800 Subject: [PATCH] fix: Make MERGED notification and MR close mandatory in refinery formula (gt-kfznm) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Updated mol-refinery-patrol.formula.toml: - Added MR bead ID tracking to inbox-check MERGE_READY parsing - Restructured merge-push into 3 clear steps with REQUIRED callouts - Added Step 2: MERGED notification (DO NOT SKIP) - Added Step 3: Close MR bead (DO NOT SKIP) - Added verification checklist before proceeding - Added generate-summary verification to catch missed notifications This ensures refinery agents complete the full lifecycle and trigger witness cleanup (gt polecat nuke) after merge. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- .../formulas/mol-refinery-patrol.formula.toml | 44 ++++++++++++++++--- 1 file changed, 39 insertions(+), 5 deletions(-) diff --git a/.beads/formulas/mol-refinery-patrol.formula.toml b/.beads/formulas/mol-refinery-patrol.formula.toml index 2686eaae..0d6de76a 100644 --- a/.beads/formulas/mol-refinery-patrol.formula.toml +++ b/.beads/formulas/mol-refinery-patrol.formula.toml @@ -55,13 +55,19 @@ A polecat's work is ready for merge. Extract details and track for processing. # Branch: # Issue: # Polecat: +# MR: # Verified: clean git state, issue closed # Track in your merge queue for this patrol cycle: # - Branch name # - Issue ID -# - Polecat name (for MERGED response) +# - Polecat name (REQUIRED for MERGED notification) +# - MR bead ID (REQUIRED for closing after merge) ``` + +**IMPORTANT**: You MUST track the polecat name and MR bead ID - you will need them +in merge-push step to send MERGED notification and close the MR bead. + Mark as read. The work will be processed in queue-scan/process-branch. **PATROL: Wake up**: @@ -157,6 +163,7 @@ needs = ["handle-failures"] description = """ Merge to main and push immediately. +**Step 1: Merge** ```bash git checkout main git merge --ff-only temp @@ -165,7 +172,9 @@ git branch -d temp git push origin --delete # Delete remote polecat branch ``` -**CRITICAL**: After successful merge, send MERGED mail to Witness: +**Step 2: Notify Witness (REQUIRED - DO NOT SKIP)** + +After successful merge, you MUST send MERGED mail to Witness: ```bash gt mail send /witness -s "MERGED " -m "Branch: @@ -173,7 +182,25 @@ Issue: Merged-At: $(date -u +%Y-%m-%dT%H:%M:%SZ)" ``` -This signals the Witness to complete cleanup (nuke polecat worktree). +This signals the Witness to nuke the polecat worktree. Without this notification, +polecat worktrees accumulate indefinitely. + +**Step 3: Close MR bead (REQUIRED - DO NOT SKIP)** + +Close the merge-request bead that was created when polecat ran `gt done`: + +```bash +bd close --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: +```bash +bd list --type=merge-request --status=open | grep +``` + +**Verification**: Before proceeding, confirm: +- [ ] MERGED mail sent to witness +- [ ] MR bead closed Main has moved. Any remaining branches need rebasing on new baseline.""" @@ -196,9 +223,16 @@ needs = ["loop-check"] description = """ Summarize this patrol cycle. -Include: +**VERIFICATION**: Before generating summary, confirm for each merged branch: +- [ ] MERGED mail was sent to witness +- [ ] MR bead was closed + +If any MERGED notifications were missed, send them now! + +Include in summary: - Branches processed (count, names) -- MERGED mails sent +- MERGED mails sent (count - should match branches processed) +- MR beads closed (count - should match branches processed) - Test results (pass/fail) - Issues filed (if any) - Branches skipped (with reasons)