Skip to content

bug: stacked_prs direct merge path bypasses the required Merge Queue Gate #7407

Description

@ll7

*This was generated by AI during triage.

Defect

Robot SF has an independent direct merge path in scripts/dev/stacked_prs.py. Its merge-cascade operation eventually sends a direct PUT repos/{repo}/pulls/{pr}/merge with an exact SHA. The status snapshot checks ordinary CI, metadata, and an exact-head trailer, but it does not require the live Merge Queue Gate / merge-queue-gate check context or evaluate the canonical explicit merge/domain hold before that CAS path.

This leaves a second merge authority outside the fail-closed workflow delivered by #7343. PR #7343 itself documents that the workflow does not locate or control direct dispatchers.

Evidence

  • Current Robot SF main: 462032df2abc3e086655935288c806b9df8bda2b.
  • Current stacked_prs.py direct merge call: _merge_pr, PUT repos/{repo}/pulls/{pr}/merge.
  • fix: fail closed on Robot SF gate evidence #7343 is still draft at exact head bd2c834e7c6f81bbc53f02d18289204bf22abf6e.
  • Ruleset main-protection (ID 18917814) currently has no required status checks or merge-queue rule.

Required repair

  • Make the direct coordinator require the newest exact-head merge-queue-gate check to be present, completed, and successful; missing, stale, pending, malformed, or failed gate evidence must block.
  • Reuse the canonical raw comment/review authority parser so edited, dismissed, changes-requested, pending, or malformed carriers cannot revive an older acceptance.
  • Preserve explicit merge-ready: no / domain-approval: pending holds at the final pre-CAS snapshot.
  • Keep the exact expected head guard and add regression fixtures for missing/failed gate check, current exact-head pass, review mutation, and explicit hold.

Non-goals

Do not change historical merge records or enable the ruleset in this issue. The maintainer rollout and healthy post-merge observation are tracked separately. Related: #7343, ll7/codex-orchestrator#1645, and #7287.

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority:0P0: correctness, safety, or CI-critical worktype:bug

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions