Allow reconciler profile to run merged cleanup without switching to author #523

Closed
opened 2026-07-08 03:38:02 -05:00 by jcwalker3 · 0 comments
Owner

Problem:
During post-merge cleanup for PR #415 / issue #402, the session started as prgs-reconciler but had to temporarily switch to prgs-author to run gitea_reconcile_merged_cleanups. The cleanup succeeded, but this role switch is a workflow smell: post-merge cleanup is reconciler work and should not require assuming an author profile.

Observed:

  • PR #415 was already merged/closed.
  • Issue #402 was already closed.
  • gitea_reconcile_merged_cleanups removed the merged author worktree:
    branches/feat-issue-402-post-merge-cleanup-proof
  • Active profile had to switch from prgs-reconciler to prgs-author to satisfy the tool/task contract.
  • Session then switched back to prgs-reconciler.
  • Remote branch deletion was skipped because delete_branch capability was not allowed.

Required behavior:

  • gitea_reconcile_merged_cleanups should be callable from a reconciler-capable profile for post-merge cleanup.
  • Reconciler cleanup should be scoped to already-merged PRs/issues only.
  • The tool should not require author profile for deleting merged author worktrees.
  • The tool should fail closed if the PR is not merged, the issue is not closed, or the target worktree does not match the merged PR/issue branch.
  • Reports should clearly distinguish reconciler cleanup from author mutation.

Acceptance criteria:

  1. Update task/capability mapping so reconciler can run merged cleanup directly.
  2. Preserve fail-closed behavior for non-merged PRs and mismatched worktrees.
  3. Add tests proving prgs-reconciler can clean a merged author worktree.
  4. Add tests proving prgs-author is not required for post-merge reconciler cleanup.
  5. Add tests proving cleanup remains blocked for active/unmerged author work.
  6. Update runbook guidance for post-merge cleanup ownership.
Problem: During post-merge cleanup for PR #415 / issue #402, the session started as prgs-reconciler but had to temporarily switch to prgs-author to run gitea_reconcile_merged_cleanups. The cleanup succeeded, but this role switch is a workflow smell: post-merge cleanup is reconciler work and should not require assuming an author profile. Observed: - PR #415 was already merged/closed. - Issue #402 was already closed. - gitea_reconcile_merged_cleanups removed the merged author worktree: branches/feat-issue-402-post-merge-cleanup-proof - Active profile had to switch from prgs-reconciler to prgs-author to satisfy the tool/task contract. - Session then switched back to prgs-reconciler. - Remote branch deletion was skipped because delete_branch capability was not allowed. Required behavior: - gitea_reconcile_merged_cleanups should be callable from a reconciler-capable profile for post-merge cleanup. - Reconciler cleanup should be scoped to already-merged PRs/issues only. - The tool should not require author profile for deleting merged author worktrees. - The tool should fail closed if the PR is not merged, the issue is not closed, or the target worktree does not match the merged PR/issue branch. - Reports should clearly distinguish reconciler cleanup from author mutation. Acceptance criteria: 1. Update task/capability mapping so reconciler can run merged cleanup directly. 2. Preserve fail-closed behavior for non-merged PRs and mismatched worktrees. 3. Add tests proving prgs-reconciler can clean a merged author worktree. 4. Add tests proving prgs-author is not required for post-merge reconciler cleanup. 5. Add tests proving cleanup remains blocked for active/unmerged author work. 6. Update runbook guidance for post-merge cleanup ownership.
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#523