Add dedicated reconciler capability to close already-landed open PRs #309

Closed
opened 2026-07-07 00:54:12 -05:00 by jcwalker3 · 1 comment
Owner

Already-landed open PRs are blocking the PR review queue because the normal reviewer workflow correctly stops before approval/merge, but no available profile can close the redundant PR.

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.
  • Reviewer workflow correctly classifies PR #278 as ALREADY_LANDED_RECONCILE_REQUIRED.
  • Reviewer workflow correctly does not approve, request changes, or merge.
  • Queue remains blocked because no profile has exact gitea.pr.close capability.
  • Every normal review run encounters PR #278 again and stops.

Problem:

The already-landed gate is safe, but without a close/reconciliation capability the queue cannot progress.

Required behavior:

  1. Add a dedicated reconciler profile or tool path, such as prgs-reconciler.

  2. The reconciler path must prove exact gitea.pr.close capability.

  3. The reconciler path must not imply normal review, approval, request-changes, or merge capability.

  4. The reconciler path may close a PR only if all gates pass:

    • PR fetched live
    • PR state is open
    • PR head SHA pinned
    • target branch freshly fetched
    • target branch SHA recorded
    • PR head SHA is an ancestor of target branch
    • linked issue fetched live, if present
    • no normal review/merge is required
  5. If linked issue is already closed, do not attempt issue close.

  6. If linked issue is open and resolved by the landed commits, close it only if exact gitea.issue.close capability is proven.

  7. Final report must include:

    • identity/profile
    • exact close capability proof
    • PR live state
    • candidate head SHA
    • target branch SHA
    • ancestor proof
    • linked issue status
    • PR close result
    • issue close result
    • no review/merge confirmation

Acceptance criteria:

  • Already-landed PR #278 can be closed through the reconciler path after proof.
  • Non-landed PRs cannot be closed through the reconciler path.
  • Missing gitea.pr.close produces a recovery handoff.
  • Normal reviewer profile does not need broad PR-close authority.
  • Tests cover already-landed PR, not-landed PR, stale target branch, missing close capability, linked issue already closed, linked issue open, and successful PR close.
Already-landed open PRs are blocking the PR review queue because the normal reviewer workflow correctly stops before approval/merge, but no available profile can close the redundant PR. 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. * Reviewer workflow correctly classifies PR #278 as `ALREADY_LANDED_RECONCILE_REQUIRED`. * Reviewer workflow correctly does not approve, request changes, or merge. * Queue remains blocked because no profile has exact `gitea.pr.close` capability. * Every normal review run encounters PR #278 again and stops. Problem: The already-landed gate is safe, but without a close/reconciliation capability the queue cannot progress. Required behavior: 1. Add a dedicated reconciler profile or tool path, such as `prgs-reconciler`. 2. The reconciler path must prove exact `gitea.pr.close` capability. 3. The reconciler path must not imply normal review, approval, request-changes, or merge capability. 4. The reconciler path may close a PR only if all gates pass: * PR fetched live * PR state is open * PR head SHA pinned * target branch freshly fetched * target branch SHA recorded * PR head SHA is an ancestor of target branch * linked issue fetched live, if present * no normal review/merge is required 5. If linked issue is already closed, do not attempt issue close. 6. If linked issue is open and resolved by the landed commits, close it only if exact `gitea.issue.close` capability is proven. 7. Final report must include: * identity/profile * exact close capability proof * PR live state * candidate head SHA * target branch SHA * ancestor proof * linked issue status * PR close result * issue close result * no review/merge confirmation Acceptance criteria: * Already-landed PR #278 can be closed through the reconciler path after proof. * Non-landed PRs cannot be closed through the reconciler path. * Missing `gitea.pr.close` produces a recovery handoff. * Normal reviewer profile does not need broad PR-close authority. * Tests cover already-landed PR, not-landed PR, stale target branch, missing close capability, linked issue already closed, linked issue open, and successful PR close.
jcwalker3 added the status:in-progress label 2026-07-07 08:09:03 -05:00
Author
Owner

Implementation PR opened: #379 (branch feat/issue-309-reconciler-close-capability, head 958d470).

Adds reconcile_close_landed_pr / reconcile_close_landed_issue tasks (exact gitea.pr.close / gitea.issue.close) under a dedicated reconciler role, wrong-role routing (wrong_role_stop in author/reviewer sessions), and assess_reconciler_close_gate with outcomes CLOSE_ALLOWED / NOT_LANDED_CLOSE_BLOCKED / RECOVERY_HANDOFF_REQUIRED / GATE_NOT_PROVEN — review/approve/request-changes/merge never granted. 17 new tests.

Scope: profile provisioning for a concrete prgs-reconciler profile stays with #310/#304; #306 duplicates this issue. Awaiting reviewer.

Implementation PR opened: #379 (branch `feat/issue-309-reconciler-close-capability`, head 958d470). Adds `reconcile_close_landed_pr` / `reconcile_close_landed_issue` tasks (exact `gitea.pr.close` / `gitea.issue.close`) under a dedicated `reconciler` role, wrong-role routing (`wrong_role_stop` in author/reviewer sessions), and `assess_reconciler_close_gate` with outcomes CLOSE_ALLOWED / NOT_LANDED_CLOSE_BLOCKED / RECOVERY_HANDOFF_REQUIRED / GATE_NOT_PROVEN — review/approve/request-changes/merge never granted. 17 new tests. Scope: profile provisioning for a concrete `prgs-reconciler` profile stays with #310/#304; #306 duplicates this issue. Awaiting reviewer.
sysadmin removed the status:in-progress label 2026-07-07 08:57:06 -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#309