Add dedicated reconciler profile for already-landed PR closure #304

Closed
opened 2026-07-07 00:43:22 -05:00 by jcwalker3 · 1 comment
Owner

Already-landed PR reconciliation currently stops 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:

    • comment_pr: allowed
    • comment_issue: allowed
    • close_issue: allowed
    • close_pr: blocked
  • The workflow correctly did not close PR #278 because gitea.pr.close could not be proven.

  • The queue remains blocked because PR #278 stays open.

Problem

Adding broad gitea.pr.close to prgs-author may be too permissive. Already-landed reconciliation needs a narrow, auditable close path.

Required behavior

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

  2. The reconciler profile must be narrowly scoped to already-landed PR reconciliation.

  3. close_pr must only be allowed when all gates pass:

    • PR is open
    • PR head SHA is fetched live
    • target branch is freshly fetched
    • PR head SHA is an ancestor of target branch
    • linked issue status is fetched live
    • no normal review/merge is required
    • reconciliation comment is prepared or posted if policy requires it
  4. Reconciler capability must not imply normal review, approval, merge, or arbitrary PR closure.

  5. Final report must include:

    • identity/profile
    • exact close capability proof
    • PR live state
    • target branch SHA
    • ancestor proof
    • linked issue proof
    • close result

Acceptance criteria

  • Already-landed PRs can be closed through a dedicated reconciler path.
  • Arbitrary open PRs cannot be closed by the reconciler path.
  • prgs-author does not need broad PR-close permission unless explicitly approved.
  • Missing close capability produces a recovery handoff.
  • Tests cover already-landed PR, not-landed PR, stale target branch, missing linked issue proof, missing close capability, and successful close.
Already-landed PR reconciliation currently stops 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: * `comment_pr`: allowed * `comment_issue`: allowed * `close_issue`: allowed * `close_pr`: blocked * The workflow correctly did not close PR #278 because `gitea.pr.close` could not be proven. * The queue remains blocked because PR #278 stays open. ## Problem Adding broad `gitea.pr.close` to `prgs-author` may be too permissive. Already-landed reconciliation needs a narrow, auditable close path. ## Required behavior 1. Add a dedicated reconciler capability/profile, such as `prgs-reconciler`. 2. The reconciler profile must be narrowly scoped to already-landed PR reconciliation. 3. `close_pr` must only be allowed when all gates pass: * PR is open * PR head SHA is fetched live * target branch is freshly fetched * PR head SHA is an ancestor of target branch * linked issue status is fetched live * no normal review/merge is required * reconciliation comment is prepared or posted if policy requires it 4. Reconciler capability must not imply normal review, approval, merge, or arbitrary PR closure. 5. Final report must include: * identity/profile * exact close capability proof * PR live state * target branch SHA * ancestor proof * linked issue proof * close result ## Acceptance criteria * Already-landed PRs can be closed through a dedicated reconciler path. * Arbitrary open PRs cannot be closed by the reconciler path. * `prgs-author` does not need broad PR-close permission unless explicitly approved. * Missing close capability produces a recovery handoff. * Tests cover already-landed PR, not-landed PR, stale target branch, missing linked issue proof, missing close capability, and successful close.
jcwalker3 added the status:in-progress label 2026-07-07 08:37:06 -05:00
Author
Owner

Opened PR #388 for the reconciler profile model and role detection.

This PR adds reconciler_profile.py, wires role_kind: reconciler into runtime context, updates migrate_profiles.infer_role(), and documents the prgs-reconciler profile shape.

The already_landed_reconcile close MCP tool and ancestry gates remain in the #310 stack (PR #381).

Opened PR #388 for the reconciler profile model and role detection. This PR adds `reconciler_profile.py`, wires `role_kind: reconciler` into runtime context, updates `migrate_profiles.infer_role()`, and documents the `prgs-reconciler` profile shape. The `already_landed_reconcile` close MCP tool and ancestry gates remain in the #310 stack (PR #381).
sysadmin removed the status:in-progress label 2026-07-07 10:27:14 -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#304