Skip to content

fix(guardrails): fail open with a notice for a literal PR id merge mutation when gh is missing (#6463 item 5) #7376

Closed

Description

@kyle-sexton

Refs: #6463

Problem

#7056 shipped block-unresolved-pr-merge fail-closed when gh is missing or unauthenticated and the command is a GraphQL merge mutation (mergePullRequest, enablePullRequestAutoMerge or enqueuePullRequest) carrying a literal PR_ id. The owner's recorded decision on #6463 (2026-10-13, PR item 5) was option B: fail open with the two-channel "not checked" notice for a literal id, and fail closed only for a non-literal id. That matches #6463's acceptance bullet 4, which says the guard fails open with a visible warning when gh is missing or unauthenticated.

The edit was not made in #7056: the auto-mode classifier refused it as a security weakening, so it needs the owner to approve or make it.

Fix

In plugins/guardrails/hooks/block-unresolved-pr-merge.sh, when gh is missing or unauthenticated and the merge mutation's id is a literal PR_... value, let the command through and post the notice on both channels. Keep fail-closed for a non-literal id ($(...), a variable, or a file reference). Add contract cases for both shells: literal id with gh missing passes with the notice, and non-literal id with gh missing still blocks. Each case fails before the fix.

Done when

  • scripts/run-test-file.sh plugins/guardrails/hooks/block-unresolved-pr-merge.test.sh passes, with a new case for each shell: a literal PR_... id merge mutation with gh missing or unauthenticated exits 0 and both "not checked" notices appear.
  • A new case in the same file: a non-literal id ($(...), a variable, or a file reference) under the same conditions still blocks.
  • Each new case fails against the hook on main before the fix.
  • scripts/check-changelog-fragments.sh passes.

Related

Activity

  1. added
    needs-triageNot yet classified. Floor until a type and one priority tier are set.
    on Oct 13, 2026
  2. github-actions commented on Oct 13, 2026

    @github-actions
    Contributor

    Proposed work class: work-class: scoped
    Basis: automated intake triage; the lanes App applied this class.

    Size: Small
    Complexity: Low
    Uncertainty: Known
    Flags: none

    Understood: change block-unresolved-pr-merge.sh so that, when gh is missing or unauthenticated, a merge mutation with a literal PR_... id passes with the two-channel "not checked" notice. A non-literal id still blocks. Add contract cases for both shells, each failing before the fix. The issue also asks for a changelog fragment check to pass. The issue links the owner's decision on #6463, so nothing is missing. The existing hold on this issue says the PR body must carry 'Hold: a human merges this'. I found no likely duplicates.

    Automated triage, applied by the lanes App.

  3. added
    needs-humanHuman-in-the-loop required; autonomous sessions must not resolve items carrying this.
    on Oct 13, 2026
  4. kyle-sexton commented on Oct 13, 2026

    @kyle-sexton
    MemberAuthor

    Owner ratified this admission in an attended session on 2026-10-13: work-class: scoped. It touches a guard, CI script, settings or trust surface, so an agent may build it but the owner merges the PR: put 'Hold: a human merges this' in the PR body.

  5. added
    work-class: scopedA briefed fix or small feature; blast radius bounded by the brief, tests exist.
    agent-readyFully specified and briefed; eligible for autonomous pickup from the frontier.
    and removed
    needs-humanHuman-in-the-loop required; autonomous sessions must not resolve items carrying this.
    on Oct 13, 2026
  6. kyle-sexton commented on Oct 14, 2026

    @kyle-sexton
    MemberAuthor

    This was generated by AI during triage.

    Triage (work-loop intake sweep): this item already carries the owner's routing decision (agent-ready + work-class: scoped, applied by the owner, with the attended ratification comment of 2026-10-13). The bot-applied needs-triage marker is stale beside that routed state, so it is cleared; no other label changes. The owner's merge hold stands: the PR body must carry 'Hold: a human merges this'.

  7. removed
    needs-triageNot yet classified. Floor until a type and one priority tier are set.
    agent-readyFully specified and briefed; eligible for autonomous pickup from the frontier.
    on Oct 14, 2026
  8. added theissue type on Oct 15, 2026
  9. added
    needs-humanHuman-in-the-loop required; autonomous sessions must not resolve items carrying this.
    on Oct 15, 2026
  10. removed
    needs-humanHuman-in-the-loop required; autonomous sessions must not resolve items carrying this.
    on Oct 24, 2026
  11. kyle-sexton commented on Oct 24, 2026

    @kyle-sexton
    MemberAuthor

    Released by the owner's HITL session (2026-10-24, C12): it waited only on a removed gate. Intake triage re-runs on it to set its fields, then admission takes it.

  12. added
    status: readyTriaged, unblocked, and fully specified; eligible to pick up.
    agent-readyFully specified and briefed; eligible for autonomous pickup from the frontier.
    on Oct 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent-readyFully specified and briefed; eligible for autonomous pickup from the frontier.priority: mediumReal value, no hard deadline; normal backlog flow.status: readyTriaged, unblocked, and fully specified; eligible to pick up.work-class: scopedA briefed fix or small feature; blast radius bounded by the brief, tests exist.

    Type

    Fields

    No fields configured for Bug.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions