Add prgs-reconciler profile with gated already-landed PR close capability #310

Closed
opened 2026-07-07 00:56:34 -05:00 by jcwalker3 · 1 comment
Owner

Already-landed open PRs are blocking the PR review queue because normal reviewer workflows correctly stop before approval/merge, but no available profile has exact gitea.pr.close capability.

Observed case:

  • PR #278 is open in Gitea.
  • PR #278 head SHA 2a544b78d1371925761d16f1c451bb3b2984470e is already an ancestor of prgs/master.
  • Issue #263 is already closed.
  • Reviewer/author workflows correctly do not approve, merge, or close without exact capability.
  • close_pr is blocked because no profile has permission gitea.pr.close.
  • The queue remains blocked by PR #278.

Required design:

  1. Do not add broad PR-close authority to normal prgs-author or prgs-reviewer profiles.

  2. Add a dedicated reconciler profile:

    prgs-reconciler

  3. The reconciler profile may include:

    • gitea.read
    • gitea.pr.comment
    • gitea.issue.comment
    • gitea.issue.close
    • gitea.pr.close
  4. Add a gated task/capability:

    reconcile_already_landed_pr

  5. The reconciler task must allow PR close only when all gates pass:

    • PR fetched live
    • PR state is open
    • PR head SHA is pinned
    • target branch is freshly fetched
    • target branch SHA is recorded
    • PR head SHA is an ancestor of target branch
    • linked issue is fetched live if present
    • no normal review/merge action is required
    • exact gitea.pr.close capability is proven
  6. The reconciler task must not allow:

    • normal PR approval
    • request changes
    • merge
    • arbitrary PR closure
    • closure of PRs whose head is not already landed
    • closure when target branch state is stale
    • closure when PR live state cannot be verified
  7. Add/update final-report and controller-handoff validation for reconciliation:

    • PR live state
    • candidate head SHA
    • target branch SHA
    • ancestor proof
    • linked issue live status
    • exact close capability proof
    • PR close result
    • issue close result
    • no review/merge confirmation
  8. Update project workflow docs/skills so agents use prgs-reconciler for already-landed PR cleanup instead of normal reviewer flow.

Acceptance criteria:

  • prgs-reconciler can close PR #278 only after already-landed proof passes.

  • A PR whose head SHA is not ancestor of the target branch cannot be closed by the reconciler path.

  • Normal prgs-author and prgs-reviewer do not gain broad arbitrary PR-close authority.

  • Missing gitea.pr.close produces a recovery handoff.

  • Tests cover:

    • already-landed PR close allowed
    • not-landed PR close denied
    • stale target branch denied
    • missing linked issue proof denied or marked according to policy
    • linked issue already closed
    • linked issue open and resolved
    • missing gitea.pr.close
    • successful reconciliation close
Already-landed open PRs are blocking the PR review queue because normal reviewer workflows correctly stop before approval/merge, but no available profile has exact `gitea.pr.close` capability. Observed case: * PR #278 is open in Gitea. * PR #278 head SHA `2a544b78d1371925761d16f1c451bb3b2984470e` is already an ancestor of `prgs/master`. * Issue #263 is already closed. * Reviewer/author workflows correctly do not approve, merge, or close without exact capability. * `close_pr` is blocked because no profile has permission `gitea.pr.close`. * The queue remains blocked by PR #278. Required design: 1. Do not add broad PR-close authority to normal `prgs-author` or `prgs-reviewer` profiles. 2. Add a dedicated reconciler profile: `prgs-reconciler` 3. The reconciler profile may include: * `gitea.read` * `gitea.pr.comment` * `gitea.issue.comment` * `gitea.issue.close` * `gitea.pr.close` 4. Add a gated task/capability: `reconcile_already_landed_pr` 5. The reconciler task must allow PR close only when all gates pass: * PR fetched live * PR state is open * PR head SHA is pinned * target branch is freshly fetched * target branch SHA is recorded * PR head SHA is an ancestor of target branch * linked issue is fetched live if present * no normal review/merge action is required * exact `gitea.pr.close` capability is proven 6. The reconciler task must not allow: * normal PR approval * request changes * merge * arbitrary PR closure * closure of PRs whose head is not already landed * closure when target branch state is stale * closure when PR live state cannot be verified 7. Add/update final-report and controller-handoff validation for reconciliation: * PR live state * candidate head SHA * target branch SHA * ancestor proof * linked issue live status * exact close capability proof * PR close result * issue close result * no review/merge confirmation 8. Update project workflow docs/skills so agents use `prgs-reconciler` for already-landed PR cleanup instead of normal reviewer flow. Acceptance criteria: * `prgs-reconciler` can close PR #278 only after already-landed proof passes. * A PR whose head SHA is not ancestor of the target branch cannot be closed by the reconciler path. * Normal `prgs-author` and `prgs-reviewer` do not gain broad arbitrary PR-close authority. * Missing `gitea.pr.close` produces a recovery handoff. * Tests cover: * already-landed PR close allowed * not-landed PR close denied * stale target branch denied * missing linked issue proof denied or marked according to policy * linked issue already closed * linked issue open and resolved * missing `gitea.pr.close` * successful reconciliation close
jcwalker3 added the status:in-progress label 2026-07-07 08:18:23 -05:00
Author
Owner

Opened PR #381 with the reconciler profile design, gitea_reconcile_already_landed_pr gated close tool, role routing, and docs for the gitea-reconciler namespace.

Validation: 38 targeted tests passed (test_already_landed_reconcile, test_reconcile_already_landed_pr_tool, test_role_session_router, test_resolve_task_capability).

Opened PR #381 with the reconciler profile design, `gitea_reconcile_already_landed_pr` gated close tool, role routing, and docs for the `gitea-reconciler` namespace. Validation: 38 targeted tests passed (`test_already_landed_reconcile`, `test_reconcile_already_landed_pr_tool`, `test_role_session_router`, `test_resolve_task_capability`).
sysadmin removed the status:in-progress label 2026-07-07 09:22:57 -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#310