Pull requests and closing the loop
What a fix pull request contains, what Mendloop never does, and what happens after the merge.
Mendloop opens a pull request once a fix passed its checks and an owner approved it, then follows it to the end: CI, merge, the ticket, the next release.
What the pull request contains#
- Title:
Fix <short id>: <issue title>. - Body: the root cause with numbered citations, the fix (plan steps and changed files), a checks table, the regression test, the risk and anything the safety gate flagged, the ticket link and a Mendloop footer. Secrets are redacted before it is sent.
- Draft when the safety gate flagged the diff or the regression test couldn't be proven.
- Reviewers: the CODEOWNERS of the changed files, then the issue owner's GitHub login.
- Labels:
mendloop,fix,severity:pN, andneeds-verificationorneeds-second-approverwhen they apply. - Ticket: a status comment, and the ticket moves to In Review.
What Mendloop never does#
- Write without the fix's recorded approval.
- Write while read-only mode or a kill switch is on.
- Use the default branch or a protected branch as the head, or force-push.
- Write to another repository than the approved one: the write token covers that one repository only.
Every write (branch, commit, pull request, reviewers, labels, comments) is in the audit log.
After the pull request opens#
| Event | What happens |
|---|---|
| CI fails | Mendloop asks the fixer for one more attempt with the check output and pushes it as a follow-up commit, at most 2 times. Then it stops and notifies the approver and the issue owner. |
| Merged | The pull request shows merged, linked tickets move to Done, the issue is resolved at the current release ("fixed, awaiting release"), and workflows waiting on git.pr.merged continue. |
| Regression | If the same error shows up in a newer release than the one current at merge, the issue reopens (regressed), the ticket moves back to In Progress, and the people behind the pull request are notified. Events from older releases still running don't count. |
| Revert | The Revert button on a merged fix opens a pull request that undoes it, never a push to the base branch. It needs the "approve fixes" permission. |
Where you see it#
- Run timeline: select the "Fix, verify, open PR" step. Its Fix tab shows the fix run's status, the pull request, the last attempt's checks with their duration and scrubbed output and, after a retry, every attempt.
- Approvals → Decided: each approved fix shows its pull request, its state and, while open, its CI.
- War room: the decision column lists the issue's pull requests. A merged one has Revert, which asks first. Viewers don't see it.
Test mode#
No GitHub calls: the pull request is simulated, reads come from fixture repositories, and Simulate merge closes the loop so the whole flow can be demoed offline.
GitHub setup#
The GitHub App's webhook must send pull_request, check_run and check_suite events (the app Mendloop creates
does). Write access ("turn on fixes") is a separate grant an Admin gives in Integrations → GitHub.