Skip to content

Commit ce1e7da

Browse files
karthiknadigCopilot
andcommitted
chore: harden maintainer completion workflow (Fixes #485)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 8296b5a commit ce1e7da

1 file changed

Lines changed: 26 additions & 1 deletion

File tree

.github/agents/Maintainer.agent.md

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,16 @@ Create a Draft PR via `github/create_pull_request`:
231231

232232
After pushing and creating the PR, request review from Copilot using `github/request_copilot_review`.
233233

234+
If `github/request_copilot_review` is unavailable, use the requested-reviewers API with Copilot's bot identity and verify the assignment rather than trusting only the command exit code:
235+
236+
```powershell
237+
$body = @{ reviewers = @("copilot-pull-request-reviewer[bot]") } | ConvertTo-Json -Compress
238+
$body | gh api --method POST repos/OWNER/REPO/pulls/N/requested_reviewers --input -
239+
gh api repos/OWNER/REPO/pulls/N/requested_reviewers --jq '.users[].login'
240+
```
241+
242+
The verification output must include `Copilot` before entering the review polling loop.
243+
234244
## 2. Wait for Review
235245

236246
Poll for review completion:
@@ -290,6 +300,17 @@ Review is considered complete when:
290300

291301
---
292302

303+
## 5. Inspect the Quality Snapshot (REQUIRED)
304+
305+
Before merging, inspect the completed workflow results and PR comments, not just their success status:
306+
307+
- Review performance snapshots for every reported platform and compare PR medians/deltas with the baseline.
308+
- Review coverage deltas and CodeQL/analysis results.
309+
- Treat a meaningful negative performance or coverage drift as actionable even when the workflow itself passed.
310+
- Record the snapshot conclusion before merge, including any known noisy metric that was deliberately accepted.
311+
312+
---
313+
293314
# Merge & Cleanup
294315

295316
Once review is complete and all checks pass:
@@ -311,7 +332,11 @@ Once review is complete and all checks pass:
311332

312333
Skip `git push origin --delete <branch>` if GitHub already auto-deleted the remote branch.
313334

314-
3. **CI triggers:** Push to main runs the full CI pipeline (builds, tests, artifact uploads).
335+
3. **Verify the merge postcondition:** Query the PR after requesting merge or auto-merge. Do not treat a zero exit code as sufficient; require `state: MERGED`, or a populated auto-merge request when required checks are still pending.
336+
337+
4. **CI triggers:** Push to main runs the full CI pipeline (builds, tests, artifact uploads).
338+
339+
5. **Continuous maintenance mode:** When the user explicitly asks for autonomous continuation, refresh the open issue/PR queue after cleanup, select the highest-impact ready issue with no overlapping PR, and restart the Development Phase. Do not yield merely because one PR merged. Auto-merge remains opt-in and may be enabled only when the user has explicitly requested it.
315340

316341
---
317342

0 commit comments

Comments
 (0)