Add reconciliation workflow for already-landed open PRs and linked issues #301

Closed
opened 2026-07-07 00:40:57 -05:00 by jcwalker3 · 1 comment
Owner

Reviewer workflows now correctly stop when an open PR is already landed on the target branch, but the PR remains open because review/merge capability does not authorize PR-close or issue-close actions.

Observed behavior

  • PR #278 is open.
  • PR #278 head SHA is already an ancestor of master.
  • The reviewer workflow correctly classifies it as ALREADY_LANDED_RECONCILE_REQUIRED.
  • The workflow does not approve or merge.
  • The workflow recommends closing PR #278 and Issue #263.
  • However, no close mutation happens because close capabilities are not part of the reviewer merge workflow.
  • The next reviewer run sees PR #278 again and blocks again.

Problem

Already-landed PRs need a separate reconciliation workflow. Otherwise, the queue remains blocked by open PRs that are already present on the target branch.

Required behavior

  1. Add a dedicated reconciliation task/capability for already-landed PRs.

  2. The reconciliation workflow must prove exact capabilities for:

    • PR inspect
    • issue inspect
    • PR comment, if used
    • issue comment, if used
    • PR close
    • issue close
  3. review_pr and merge_pr must not imply close capabilities.

  4. For each already-landed PR, the workflow must:

    • fetch target branch
    • verify PR head SHA is ancestor of target branch
    • fetch PR live
    • fetch linked issue live
    • post a reconciliation comment if capability exists
    • close the PR if exact PR-close capability exists
    • close the linked issue if exact issue-close capability exists and the issue is resolved
  5. If close capability is missing, the workflow must produce a recovery handoff with exact PR/issue, proof, and required capability.

  6. Normal PR review/merge workflow may stop on already-landed PRs, but there must be a separate path to reconcile and close them.

Acceptance criteria

  • Already-landed open PRs can be reconciled without invoking review/merge.
  • PR-close and issue-close require exact separate capability proof.
  • A missing close capability produces a recovery handoff instead of looping forever.
  • Reviewer queue no longer remains blocked by PRs already landed on the target branch.
  • Tests cover already-landed PR with close capability, without close capability, linked issue open, linked issue closed, no linked issue, and failed ancestry proof.
Reviewer workflows now correctly stop when an open PR is already landed on the target branch, but the PR remains open because review/merge capability does not authorize PR-close or issue-close actions. ## Observed behavior * PR #278 is open. * PR #278 head SHA is already an ancestor of `master`. * The reviewer workflow correctly classifies it as `ALREADY_LANDED_RECONCILE_REQUIRED`. * The workflow does not approve or merge. * The workflow recommends closing PR #278 and Issue #263. * However, no close mutation happens because close capabilities are not part of the reviewer merge workflow. * The next reviewer run sees PR #278 again and blocks again. ## Problem Already-landed PRs need a separate reconciliation workflow. Otherwise, the queue remains blocked by open PRs that are already present on the target branch. ## Required behavior 1. Add a dedicated reconciliation task/capability for already-landed PRs. 2. The reconciliation workflow must prove exact capabilities for: * PR inspect * issue inspect * PR comment, if used * issue comment, if used * PR close * issue close 3. `review_pr` and `merge_pr` must not imply close capabilities. 4. For each already-landed PR, the workflow must: * fetch target branch * verify PR head SHA is ancestor of target branch * fetch PR live * fetch linked issue live * post a reconciliation comment if capability exists * close the PR if exact PR-close capability exists * close the linked issue if exact issue-close capability exists and the issue is resolved 5. If close capability is missing, the workflow must produce a recovery handoff with exact PR/issue, proof, and required capability. 6. Normal PR review/merge workflow may stop on already-landed PRs, but there must be a separate path to reconcile and close them. ## Acceptance criteria * Already-landed open PRs can be reconciled without invoking review/merge. * PR-close and issue-close require exact separate capability proof. * A missing close capability produces a recovery handoff instead of looping forever. * Reviewer queue no longer remains blocked by PRs already landed on the target branch. * Tests cover already-landed PR with close capability, without close capability, linked issue open, linked issue closed, no linked issue, and failed ancestry proof.
jcwalker3 added the status:in-progress label 2026-07-07 08:23:47 -05:00
Author
Owner

Opened PR with read-only reconciliation MCP tools (gitea_assess_already_landed_reconciliation, gitea_scan_already_landed_open_prs), capability planning, and the gitea-reconcile-landed-pr skill entry.

Validation: 11 targeted tests passed.

Opened PR with read-only reconciliation MCP tools (`gitea_assess_already_landed_reconciliation`, `gitea_scan_already_landed_open_prs`), capability planning, and the `gitea-reconcile-landed-pr` skill entry. Validation: 11 targeted tests passed.
sysadmin removed the status:in-progress label 2026-07-07 09:42:33 -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#301