Skip to content

Restore enforced main CI gate before arming auto-merge #67

Closed

Description

@thomhurst

Evidence

While following the draft review lifecycle for #63, scripts/Enable-AutoMerge.ps1 -Pr 63 -MarkReady reported success and GitHub immediately merged the reviewed head 48f8b94f556576e3016ce6dd158de373ad41fc00 at 2026-11-01T10:28:44Z (merge commit a503793).

The ready CI run 41297637992 was still running: Build & Test finished at 10:29:06Z and CI Passed finished at 10:29:10Z. Both eventually succeeded, but they did not gate the merge.

gh api repos/thomhurst/Relayer/rulesets returned an empty array. gh api repos/thomhurst/Relayer/branches/main/protection returned 404 Branch not protected. This contradicts the Main ruleset requirement documented in .agents/skills/issue-pr-loop/references/repository.md and assumed by scripts/Enable-AutoMerge.ps1.

Expected behavior

Arming auto-merge must leave a PR open until the required CI Passed check succeeds on the reviewed head.

Acceptance criteria

  • Configure an enforced main rule requiring CI Passed, with bypass behavior that cannot let the agent's normal arming operation merge early.
  • Make Enable-AutoMerge.ps1 fail safely if required repository protection is missing or ineffective; cover the guard with the existing script test approach.
  • Verify a reviewed PR with pending CI remains open when auto-merge is armed, then merges only after its required checks succeed.

Activity

  1. added
    bug
    P0
    on Nov 1, 2026
  2. thomhurst commented on Nov 1, 2026

    @thomhurst
    OwnerAuthor

    Confirmed again while promoting #68 with the required wrapper: pwsh scripts/Enable-AutoMerge.ps1 -Pr 68 -MarkReady reported success, but GitHub immediately merged reviewed head f7f48a5 at 2026-11-01T10:49:51Z (merge commit 0e152c1).

    Ready CI run 41299169756 had Build & Test in progress, starting at 10:49:44Z, when the PR merged. CI Passed did not yet exist. The rulesets API again returned no rules, and main branch protection returned 404 Branch not protected.

    This is additional evidence for the existing acceptance criteria, not a second issue. Future arming must be blocked until the protection or a fail-safe wrapper guard is restored. No check was bypassed directly; the documented wrapper's assumption about GitHub enforcement is false in the current repository configuration.

  3. added
    in-progress
    on Nov 1, 2026
  4. thomhurst commented on Nov 1, 2026

    @thomhurst
    OwnerAuthor

    Restored repository enforcement: Main ruleset 26307986 is active on refs/heads/main, requires CI Passed from GitHub Actions (app ID 15368), and has an empty bypass list. The API reports current_user_can_bypass: never for the agent's admin credential. Repository auto-merge is now enabled.

    Implemented the fail-closed wrapper guard, CI regression tests, and protection documentation in draft PR #71 (head 0dc9f67e508bb92a4ac27c825ec069051e68288b). Five PowerShell tooling suites and the live protection guard pass. Python helper tests intentionally skip on Windows. Codex was requested and Claude review started; the draft remains unarmed.

    For the next review-to-ready unit: once both reviewers approve the head, promote and arm with the wrapper, record that the PR stays OPEN with auto-merge armed while CI Passed is pending, then compare the eventual merge timestamp with the required check's completion time. This integration timing verification has not yet run. Evidence and reproducer sources are archived under C:/git/Relayer-evidence/pr-71/0dc9f67e508bb92a4ac27c825ec069051e68288b/ with a verified SHA-256 inventory.

  5. thomhurst commented on Nov 1, 2026

    @thomhurst
    OwnerAuthor

    The protection regression recurred while promoting #98: Enable-AutoMerge.ps1 correctly denied arming. Ruleset 26307986 was active and required CI Passed, but contained an always-bypass entry for user 30480171 and reported current_user_can_bypass: always. Its last update before this repair was 2026-11-01T13:06:18.066Z. The wrapper made no promotion or merge mutation.

    Restored the documented no-bypass configuration, preserving all other rules and branch conditions. The live ruleset now has bypass_actors: [] and current_user_can_bypass: never. Assert-AutoMergeProtection passes against the live APIs. Before/after responses and the exact update payload are retained under C:/git/Relayer-evidence/issue-67/ (seven inactive days retention). No source or documentation changes are needed: the guard and repository guidance already require this configuration. Re-closing this recurring configuration issue after the repair; continuing #98 under its own lock.

  6. thomhurst commented on Nov 1, 2026

    @thomhurst
    OwnerAuthor

    The protection regression recurred while promoting #140. The wrapper denied before promotion: Main ruleset 26307986 required CI Passed but had an always-bypass entry for user 30480171 and reported current_user_can_bypass: always. Its previous update was 2026-11-01T21:00:55.494Z.

    Restored the documented no-bypass configuration under the issue-67 lock, preserving every other rule and branch condition. The live API now reports bypass_actors: [] and current_user_can_bypass: never. Assert-AutoMergeProtection passes against the live APIs, and the original rules and conditions match the restored response exactly. No source or documentation changes are needed; existing guidance already requires this configuration.

    Before/after responses, update payload and SHA-256 inventory are retained under C:/git/Relayer-evidence/issue-67/20261101-2112/ with seven inactive days retention. Re-closing this recurring configuration issue after repair. #140 can resume its approved-head promotion under its own lock.

  7. thomhurst commented on Nov 1, 2026

    @thomhurst
    OwnerAuthor

    The protection regression recurred while promoting #153. The wrapper correctly denied before promotion. Main ruleset 26307986 required CI Passed but contained an always-bypass entry for user 30480171 and reported current_user_can_bypass: always; its previous update was 2026-11-01T21:55:30.387Z.

    Restored the documented no-bypass configuration under the issue-67 lock, preserving all rules and branch conditions. Live APIs now report bypass_actors: [] and current_user_can_bypass: never; Assert-AutoMergeProtection passes. No source changes are needed. Before/after responses and the update payload are retained under C:/git/Relayer-evidence/issue-67/20261101-2257/ with a SHA-256 inventory. The existing closed issue remains the record for this repaired recurrence; #153 can resume promotion.

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

    P0bugin-progress

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions