Skip to content

audit(#961): /merger's gh pr merge needs a Named-Set Boundary rule, not an --auto-merge gate - #967

Merged
admarble merged 2 commits into
mainfrom
feature/961-audit-merger-determine-whether-the-unconditional-g
Aug 26, 2026
Merged

admarble merged 2 commits into
mainfrom
feature/961-audit-merger-determine-whether-the-unconditional-g

Conversation

@admarble

@admarble admarble commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Audit of /merger's merge/close/push sites, following #958's deferred question of whether /merger needs the same --auto-merge gate /fullsolve got.

Conclusion: /merger <issue-numbers> merging the named issues is the skill's stated purpose and the user's explicit consent — unlike /fullsolve's pre-#958 hidden side effect, gating it with --auto-merge would defeat the skill. But two silent widen paths existed where merge ordering could pull in an unnamed issue's PR. Added a Named-Set Boundary rule instead: halt and report rather than merge beyond the invocation's arg list.

AC-1: Audit — every merge/close/push site in /merger (3 mirrors, byte-identical)

Site File:line In/out of named-set risk
gh pr merge <PR_NUMBER> --squash merger/SKILL.md:271 (clean-merge path) Bounded — only runs per-issue inside the loop over the named set
gh pr create --title "feat: Integrate ..." merger/SKILL.md:315 (integration-branch path) Creates a new integration PR; never merges anything, left for a human
gh pr close none found No actual close command anywhere; only prose in the example report ("Closed: PR #15, PR #16")
git push origin main none found /merger never pushes to main directly
Dependency Detection ("If dependencies found, enforce merge order") merger/SKILL.md (pre-fix) ⚠️ Silent on whether an unmerged dependency outside the named set may be pulled in
Stacked PR Detection (#605) step 3 ("Continue anyway? (y/N)") merger/SKILL.md (pre-fix) ⚠️ Confirmation covers reordering within the named set only; silent on a stack predecessor that isn't named at all

Both ⚠️ rows are the two out-of-named-set ambiguities this PR closes.

AC-2: Decision — Named-Set Boundary rule (implemented)

Outcome chosen: narrow rule, not a flag gate (rejected --auto-merge-style gating as defeating /merger's core purpose; rejected a blanket y/N prompt on every merge as breaking batch use, since the stacked-PR section already has a targeted one).

Added a delimited <!-- BEGIN/END: named-set-boundary (#961) --> section to merger/SKILL.md (all 3 mirrors) stating: never merge a PR whose issue isn't in the invocation's arg list; on an unmerged out-of-set dependency or stack predecessor, halt and report the widened command instead of silently including it. Amended both Dependency Detection and Stacked PR Detection to reference and defer to this rule.

Gate test: src/lib/__tests__/merger-named-set-boundary-skill.test.ts — asserts the boundary section text and that both amended sections reference it, across all 3 skill-root mirrors.

Mutation-verified: AC-2 — replaced "Named-Set Boundary" phrase in skills/merger/SKILL.md; 2 of 9 tests in merger-named-set-boundary-skill.test.ts failed (exactly the two section-reference checks for the mutated root); restored.

AC-3: /release merge-adjacent audit

Confirmed: /release has no gh pr merge sites anywhere. Its two git push origin main sites (Step 6, and the tag-recovery block) are core to releasing (committing the version bump, pushing the release commit) and already checkout-lock-protected since #911 (ace4a9be). Verdict: no change needed.

Non-Goals (unchanged from issue)

Sibling observation (not fixed here, filed as follow-up scope)

/merger's regression gate (Step 7) says "merge is blocked," but the gh pr merge calls in Step 5 have already landed by then — the gate is post-hoc wording over an already-executed side effect. Out of #961's consent-gate scope per the spec's Open Question 2; left as a follow-up candidate.

Test plan

  • npx vitest run src/lib/__tests__/merger-named-set-boundary-skill.test.ts — 9/9 pass
  • npx vitest run src/lib/__tests__/merger-checkout-lock-skill.test.ts — 24/24 pass (regression check, unaffected)
  • npm run build — clean
  • npm run lint — clean
  • npm run lint:skill-sync — 44/44 synced, including merger/SKILL.md
  • Mutation-verified per CLAUDE.md testing rule (see AC-2 marker above)

Closes #961

@admarble
admarble merged commit f13592d into main Aug 26, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

audit(/merger): determine whether the unconditional gh pr merge needs a confirmation gate, following #958

1 participant