Skip to content

fix(dev-loop): merging a finished PR is pre-authorized -- merge, close, clean up, then report - #507

Merged
MarkMichaelis merged 2 commits into
mainfrom
fix/499-merge-preauthorized
Sep 14, 2026
Merged

MarkMichaelis merged 2 commits into
mainfrom
fix/499-merge-preauthorized

Conversation

@MarkMichaelis

@MarkMichaelis MarkMichaelis commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Closes #499

What this changes

Merging a finished dev-loop PR is pre-authorized: when the exit criteria hold, merge, close the issue, clean up the worktree without asking, then report in the Task Complete Summary Format. The report replaces the permission prompt.

  • The independent review is mandatory; the permission is not. No quality gate is weakened -- different-model review with the reviewer's model recorded, behavior-first tests, evidence, and resolved threads all still gate the merge.
  • Hosted CI that cannot run is not "CI red". A recorded local run of the same checks satisfies the gate only when the switch to local CI is developer-confirmed and verifiable by any session or reviewer (a linked, timestamped developer comment cited in the PR, or the repository's committed instructions/config -- a personal or session-local memory note does not count), and the PR carries real counts. While on local CI, hosted CI is rechecked daily and the repo switches back as soon as it works (the shared local-CI runner's job). Hosted CI that ran and failed is still a hard stop unless shown, with evidence, to be pre-existing on main.
  • Stop and ask only when: the PR or issue carries hold; the reviewer's model is not recorded; the PR belongs to another session or author; the change is outside the approved design.

Stated canonically in CLAUDE.md (new section Merging a Finished PR Is Pre-Authorized), restated in the Merge Step of .github/copilot-instructions.md and Phase 8 of .github/agents/dev-loop.agent.md, and the dev-loop-phase-gate checklist's CI item carries the same exception. Every "CI is red" / "CI green" occurrence in the tree is now qualified.

Verification (local -- hosted CI is billing-blocked)

Scope Result
Invoke-Pester -Path .\.github (CI-equivalent, 71 files) Result=Passed, 871 passed, 0 failed, 5 skipped, FailedContainersCount=0
merge-preauthorized.Tests.ps1 (new) 43/43 -- written first (31/33 red on the unchanged files, then 10/43 red for the review round)
Ablation reverting each file fails exactly its own scoped assertions
Leak-scan patterns over changed files 0 hits

Independent review

Reviewer: Claude Sonnet 5 (author: Opus). Round 1: CHANGES REQUESTED -- 1 Critical (the "recorded" location was not verifiable), 2 Important (the owner's daily-recheck condition missing; the phase-gate checklist unqualified), 2 Minor (cross-references). All five accepted and fixed in e3c3627. Round 2: ACCEPT, no new findings.

Held for the owner

This PR changes the agents' own authorization rules, and an automated safety check flagged it as instruction-shaped. It is not being merged under the rule it introduces -- it waits for the owner's explicit go-ahead.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Fda3nBeB9rJBPdJSmD7sRN

MarkMichaelis and others added 2 commits September 13, 2026 20:30
…e, clean up, then report

Sessions stopped at the end of a finished dev loop to ask permission to
merge. State the durable authorization in CLAUDE.md, the copilot-instructions
Merge Step and dev-loop Phase 8; separate the mandatory independent review
from the permission that is not; replace the bare "never merge while CI is
red" with a hosted-CI-unavailable clause (developer-confirmed switch to local
CI, real counts in the PR; a hosted run that failed stays a hard stop); and
list the only cases that still stop and ask.

Refs #499

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Fda3nBeB9rJBPdJSmD7sRN
…very CI checkpoint

Address the independent review of the merge pre-authorization:

- The developer's confirmation of a switch to local CI must be verifiable
  by any session or reviewer: a linked, timestamped developer comment cited
  in the PR, or the repository's own committed instructions or config. A
  personal or session-local memory note does not count.
- Name the owner's second condition: while on local CI, hosted CI is
  rechecked daily and the repository switches back as soon as it works.
  That is the shared local-CI runner's job, not implemented by hand.
- The dev-loop-phase-gate Phase 7 checklist's "CI workflows are green" now
  carries the hosted-CI-unavailable exception and points at CLAUDE.md.
- dev-loop Phase 7 step 4 cross-references the Phase 8 exception for the
  case where no runs appear.
- Every bare "CI green" precondition in dev-loop and copilot-instructions
  now says "(or the hosted-CI-unavailable exception below applies)".

Refs #499

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Fda3nBeB9rJBPdJSmD7sRN
@MarkMichaelis
MarkMichaelis merged commit ed27db6 into main Sep 14, 2026
2 checks passed
@MarkMichaelis
MarkMichaelis deleted the fix/499-merge-preauthorized branch September 14, 2026 19:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(dev-loop): merging a finished PR is pre-authorized -- merge, close, clean up, then report

1 participant