Repository navigation
Fuse pre-merge pr_state gate into Merge and close host PR tool bypasses - #229
Merged
Merged
Conversation
Restructure skills/merge/SKILL.md so pr_state.py is explicitly the sole readiness gate and the pre-merge checklist sits directly above the merge call in Land, requiring the agent to name each PR's verified head SHA and passing review-fix-loop status before calling pull_request_merge, gh pr merge, gh stack merge, or a GitHub connector. Clarify in pr's watch and publish references that host PR tools do not replace pr_state.py and that commit statuses still use gh. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…erge guards - Align Step 3 Pre-merge gate with watch.md#ready-or-blocked so valid current-head CI dismissals, filtered stack workflows, user-approved review waits, and newly arrived to_settle items are handled properly. - Order stop handling and armed-landing cancellation ahead of repair dispatch and caller-owned repair returns in Step 2 and Shared rules. - Guard T3 pull_request_merge against auto: true and stack: true, requiring explicit deferred-landing and per-layer protections. - Use the runnable pr_state.py command syntax, restore missing verification and status-posting steps in Step 2, and keep publish.md focused on PR creation and updates. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
… guards, and pass --head on merge confirmation - Make Step 2 stop handling explicitly terminate without repairing or landing, and update Step 3 gate failures so stops terminate rather than chaining into repair routing. - Reorder the Step 3 readiness bullet so to_settle and feedback settlement unambiguously apply even with watch.md CI-dismissal or user-approved review-wait exceptions. - Forbid auto: true / --auto on single-PR merges, state plainly that neither gh stack merge nor pull_request_merge guards per-layer heads at submission (requiring landing-branch protection for stacks), and pass --head <verified head> to pr_state.py during merge confirmation so moved-head detection actually triggers. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
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
Rewrites
skills/merge/SKILL.mdfrom scratch and updatesskills/pr/references/watch.mdandskills/pr/references/publish.mdso host PR tools (such as T3'spull_request_*tools) cannot implicitly bypasspr_state.py,review-fix-loop, or provisional-PR stops when landing changes.Root cause: Under host prompts that prefer
pull_request_*overgh, agents skippedpr_state.pyand calledpull_request_merge(which enforcesexpectedHeadShabut does not checkreview-fix-loopcommit statuses or provisional blocks), whileskills/merge/SKILL.mdpreviously buried the review check in a separate step aboveLand.Key changes:
## Shared rulesonce up front:pr_state.pyis the sole readiness/merge gate (host PR tools do not run or replace it), and caller-owned repair mode handles stops first before returning gaps without repairing.Bring to ready), terminates cleanly on stops, movesPreserve local filesinto Step 2 where local history edits occur, and requires posting thereview-fix-loopstatus on clean review.Land) with a runnablepr_state.py --headpre-merge checklist aligned withwatch.md#ready-or-blocked, requiring the agent to name each PR's exact verified head SHA and passingreview-fix-loopstatus before submitting any merge.pull_request_mergewithexpectedHeadShaand withoutauto: true, orgh pr merge --match-head-commit), disallows single-PR auto-merge andpull_request_mergestack: true, states plainly that stack merges require landing-branch protections enforcing current-head review on every layer, and passes--head <verified head>to post-merge confirmation so moved-head detection triggers.Read the statethat host PR tools do not replacepr_state.pybecause they skipreview-fix-loop, provisional checks, and complete paginated readiness.ghfor missing capabilities, current-branch discovery, and cross-repo heads.Evidence
c98fc839e0a1d956775a312e3cc1016134b2638c):python3 scripts/check.pypassed — 63 skills checked (frontmatter, Markdown links/anchors, skill link hygiene, whitespace) and 564 tests across 26 files passed (exit 0).rfl-merge-gate-20261122, 3 passes): Wave 1 (Primary Antigravity Gemini 4 Neon High, Ponytail Claude Opus 5.5 High, Thermo Codex GPT-6.2 Sol High), Wave 2 Adversarial (first discovery, Claude Opus 5.5 High), and Pass 2/3 Primary repair & cumulative verification (Antigravity Gemini 4 Neon High) converged with zero remaining issues onc98fc839.pull_request_*host prompt (blocked unreviewed PR viapr_state.py, merged ready single PR viapull_request_mergewithexpectedHeadShawithoutauto/stackand confirmed viapr_state.py --head, and reported the branch-protection blocker on an unprotected 2-layer stack).pull_request_mergeexecution trials were not run (stubbed T3 MCP harness unavailable; live merge calls risk forge side effects). Enforcement without GitHub branch protection still depends on agents following the skill instructions.Merge Danger
Two-way door: markdown-only changes to
skills/merge/SKILL.md,skills/pr/references/watch.md, andskills/pr/references/publish.md. Reverting the merge commit restores prior skill wording cleanly with no data, schema, or script state affected.