You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(guardrails): fail block-unresolved-pr-merge closed when it cannot resolve the merge target #8598
needs-humanHuman-in-the-loop required; autonomous sessions must not resolve items carrying this.status: confirmedA maintainer confirmed the item is real and in scope; ready to be worked.
block-unresolved-pr-merge (guardrails) fails open when it cannot resolve which pull request a gh pr merge targets. When the repository or PR number reaches the command through a shell variable or substitution, the hook prints that it "could not check this pull request ... so this merge will run unchecked" and lets the merge run. The unresolved-thread, change-request and failing-check gate is then skipped entirely.
A safety gate that any $R or $n bypasses lets a steered agent skip the thread and check gate at will.
Evidence (2026-10-20, overnight run)
A session merged a PR with the repository passed as a shell variable (-R $VAR shape). The hook could not resolve it and let the merge through unchecked. The session had verified threads, checks and statuses by hand just before, so nothing unsafe landed; the action is recorded in the overnight audit log.
Earlier the same night, a merge written inside a shell loop with the PR number as a loop variable ($n shape) produced the same "will run unchecked" notice.
Fix
An unresolvable target must fail closed: refuse the merge with a message telling the caller to write the repository and PR number literally (-R owner/repo <number>).
Acceptance criteria
A gh pr merge whose repository or PR number the hook cannot resolve to a literal value is refused, and the refusal message names the literal form to use.
Stay-quiet (must still pass through to the normal check): the literal form gh pr merge 123 -R melodic-software/x --squash --match-head-commit <sha>, plus the URL and branch-name target forms if the hook supports them today.
Stay-loud (must be refused): -R $R, -R ${R}, a number from $(...), a number from backticks, and a bare gh pr merge with no resolvable target.
Tests for criteria 2 and 3 land with the change, per the hook-precision convention (docs/conventions/hook-precision/README.md): each stay-loud case fails before the fix.
Notes
Merges that need a loop must write each command literally.
Security review: GitHub Security & Cost passes the PR before merge.
needs-humanHuman-in-the-loop required; autonomous sessions must not resolve items carrying this.status: confirmedA maintainer confirmed the item is real and in scope; ready to be worked.
Activity
github-actions commentedon Oct 20, 2026
Thanks for the report. Automated triage handed this issue to a maintainer.
Proposed work class: work-class: scoped
Basis: automated intake triage; a maintainer confirms or changes it.
Automated triage. A maintainer reviews it.