Add dedicated reconciler capability for closing already-landed open PRs #306

Closed
opened 2026-07-07 00:45:55 -05:00 by jcwalker3 · 1 comment
Owner

Already-landed PR reconciliation is blocked because no available MCP execution profile has gitea.pr.close.

Observed behavior:

  • PR #278 is open in Gitea.

  • PR #278 head SHA 2a544b78d1371925761d16f1c451bb3b2984470e is already an ancestor of prgs/master.

  • Issue #263 is already closed.

  • The reconciliation workflow proved:

    • PR inspect allowed
    • issue inspect allowed
    • comment_pr allowed
    • comment_issue allowed
    • close_issue allowed
    • close_pr blocked
  • The workflow correctly did not close PR #278.

Problem:

The queue remains blocked by already-landed PRs unless an authorized human closes them manually. Adding broad PR-close permission to normal author/reviewer profiles may be too permissive.

Required behavior:

  1. Add a dedicated reconciler capability/profile, such as prgs-reconciler.

  2. The reconciler path must only close already-landed PRs after all reconciliation gates pass.

  3. Required gates:

    • PR fetched live
    • PR state is open
    • PR head SHA pinned
    • target branch freshly fetched
    • PR head SHA is ancestor of target branch
    • linked issue fetched live
    • no normal review/merge action is required
    • exact close_pr capability proven
  4. Reconciler capability must not imply normal approve, request-changes, or merge capability.

  5. Final report must include exact capability proof, ancestor proof, close result, and linked issue result.

Acceptance criteria:

  • Already-landed PRs can be closed through a dedicated reconciler path.
  • Non-landed PRs cannot be closed by the reconciler path.
  • Missing close capability produces a recovery handoff.
  • Tests cover already-landed PR, not-landed PR, stale target branch, missing issue proof, missing close capability, and successful close.
Already-landed PR reconciliation is blocked because no available MCP execution profile has `gitea.pr.close`. Observed behavior: * PR #278 is open in Gitea. * PR #278 head SHA `2a544b78d1371925761d16f1c451bb3b2984470e` is already an ancestor of `prgs/master`. * Issue #263 is already closed. * The reconciliation workflow proved: * PR inspect allowed * issue inspect allowed * `comment_pr` allowed * `comment_issue` allowed * `close_issue` allowed * `close_pr` blocked * The workflow correctly did not close PR #278. Problem: The queue remains blocked by already-landed PRs unless an authorized human closes them manually. Adding broad PR-close permission to normal author/reviewer profiles may be too permissive. Required behavior: 1. Add a dedicated reconciler capability/profile, such as `prgs-reconciler`. 2. The reconciler path must only close already-landed PRs after all reconciliation gates pass. 3. Required gates: * PR fetched live * PR state is open * PR head SHA pinned * target branch freshly fetched * PR head SHA is ancestor of target branch * linked issue fetched live * no normal review/merge action is required * exact `close_pr` capability proven 4. Reconciler capability must not imply normal approve, request-changes, or merge capability. 5. Final report must include exact capability proof, ancestor proof, close result, and linked issue result. Acceptance criteria: * Already-landed PRs can be closed through a dedicated reconciler path. * Non-landed PRs cannot be closed by the reconciler path. * Missing close capability produces a recovery handoff. * Tests cover already-landed PR, not-landed PR, stale target branch, missing issue proof, missing close capability, and successful close.
jcwalker3 added the status:in-progress label 2026-07-07 11:58:14 -05:00
Author
Owner

Issue claim heartbeat

<!-- gitea-issue-claim-heartbeat:v1 --> **Issue claim heartbeat** - kind: claim - issue: #306 - branch: feat/issue-306-reconciler-close-proof - phase: claimed - profile: prgs-author - pr: none - blocker: none - next_action: create worktree and begin implementation
sysadmin removed the status:in-progress label 2026-07-08 21:32:34 -05:00
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Scaled-Tech-Consulting/Gitea-Tools#306