Define partial reconciliation behavior when PR close capability is missing #302

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

Already-landed PR reconciliation can prove that a PR should be closed, but may lack gitea.pr.close capability. In that case, the workflow currently stops without posting a comment even when comment_pr capability is available.

Observed behavior:

  • comment_pr capability was allowed.
  • comment_issue capability was allowed.
  • close_issue capability was allowed.
  • close_pr capability was blocked.
  • The workflow posted no comment and stopped.

Problem:

It is unclear whether the workflow should:

  1. stop without any Gitea mutation when close_pr is missing, or
  2. post a reconciliation comment with ancestor proof, then stop for human/authorized close.

Required behavior:

Define a durable policy for partial reconciliation.

Option A: strict all-or-nothing

  • If close_pr is missing, do not comment.
  • Produce recovery handoff only.

Option B: comment-then-stop

  • If comment_pr is allowed but close_pr is missing, post a reconciliation comment with:

    • PR head SHA
    • target branch SHA
    • ancestor proof
    • linked issue status
    • required missing capability
  • Then stop without closing.

Acceptance criteria:

  • Policy is documented in the PR reconciliation workflow.
  • MCP/tooling enforces the chosen policy.
  • Final reports explain why comments were or were not posted.
  • Tests cover close capability present, close capability missing with comment allowed, comment capability missing, and all capabilities missing.
Already-landed PR reconciliation can prove that a PR should be closed, but may lack `gitea.pr.close` capability. In that case, the workflow currently stops without posting a comment even when `comment_pr` capability is available. Observed behavior: * `comment_pr` capability was allowed. * `comment_issue` capability was allowed. * `close_issue` capability was allowed. * `close_pr` capability was blocked. * The workflow posted no comment and stopped. Problem: It is unclear whether the workflow should: 1. stop without any Gitea mutation when `close_pr` is missing, or 2. post a reconciliation comment with ancestor proof, then stop for human/authorized close. Required behavior: Define a durable policy for partial reconciliation. Option A: strict all-or-nothing * If `close_pr` is missing, do not comment. * Produce recovery handoff only. Option B: comment-then-stop * If `comment_pr` is allowed but `close_pr` is missing, post a reconciliation comment with: * PR head SHA * target branch SHA * ancestor proof * linked issue status * required missing capability * Then stop without closing. Acceptance criteria: * Policy is documented in the PR reconciliation workflow. * MCP/tooling enforces the chosen policy. * Final reports explain why comments were or were not posted. * Tests cover close capability present, close capability missing with comment allowed, comment capability missing, and all capabilities missing.
jcwalker3 added the status:in-progress label 2026-07-07 04:42:17 -05:00
Author
Owner

Implementation PR opened: #375 (branch feat/issue-302-partial-reconciliation-policy, head 852ac1f).

Policy decision: Option B — comment-then-stop. resolve_partial_reconciliation_plan maps proven capabilities to FULL_RECONCILE_CLOSE_ALLOWED / PARTIAL_RECONCILE_COMMENT_THEN_STOP / RECOVERY_HANDOFF_ONLY / GATE_NOT_PROVEN (fail-closed on missing capability dict or unproven ancestry). assess_partial_reconciliation_report forces reports to explain why the comment was or was not posted. Documented as §12A in workflows/reconcile-landed-pr.md with contract-test markers. 9 new tests + doc contract. Awaiting reviewer.

Implementation PR opened: #375 (branch `feat/issue-302-partial-reconciliation-policy`, head 852ac1f). Policy decision: **Option B — comment-then-stop**. `resolve_partial_reconciliation_plan` maps proven capabilities to FULL_RECONCILE_CLOSE_ALLOWED / PARTIAL_RECONCILE_COMMENT_THEN_STOP / RECOVERY_HANDOFF_ONLY / GATE_NOT_PROVEN (fail-closed on missing capability dict or unproven ancestry). `assess_partial_reconciliation_report` forces reports to explain why the comment was or was not posted. Documented as §12A in workflows/reconcile-landed-pr.md with contract-test markers. 9 new tests + doc contract. Awaiting reviewer.
sysadmin removed the status:in-progress label 2026-07-07 08:51:18 -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#302