Own-PR flow: the operator-approval gate parks before the PR exists and can close the issue on approval #1125

Closed
opened 2026-10-27 13:39:07 +00:00 by sam · 0 comments
Owner

StagePRReviewAndOpenPR splices prReviewDecisionStages() -- the same list PRReview() uses -- into the implement workflow, so stagePROperatorApproval is reachable from two triggers. With review.approve_before_post set, an implement run parks in waiting_human BEFORE it opens its PR.

The only resume re-runs the workflow from its first stage (taskactions.Service.apply and chatTaskControllerAdapter.ApproveChatTask requeue waiting_human -> implement; workflow.Route with a non-empty t.Workflow picks the whole workflow again). Approving such a wait therefore re-enters prepare/baseline/plan/build/commit-push against a worktree that already carries the change. If the builder reports no changes, BuildNoChanges makes StageCommitPush call closeNoChangesIssue: the issue is closed, the task completes, and the PR is never opened.

Fix: the gate belongs to the standalone pr-review workflow only, so the own-PR splice drops it -- one line in the splice. The own-PR trigger's human decision point is its existing park on an unchallenged blocking finding, and "which findings to post" has no referent before the PR exists.

Decided while writing the operator-approval decision doc for afbk.11, which records the hazard and this follow-up. The alternative -- the gate gating both triggers, with a post decision short-circuiting every stage whose work the wait already completed -- was rejected: it needs conditional no-ops across seven unrelated stages plus a notion of "work the wait already completed" inside the waiting_human re-pin path, which is the most delicate machinery in this pipeline. Full re-entry is acceptable in the standalone pipeline precisely because it has no write-then-close stage.

Acceptance criteria

The own-PR path cannot park on the operator-approval gate. A regression test proves an implement run with review.approve_before_post set still opens its PR. The standalone pr-review workflow still parks in waiting_human and re-reviews as the PRD requires.

Close reason

Closed


Imported from beads archie-core-7nst · GitHub #1424 · type bug · priority P1 · created 2026-09-29 · closed 2026-09-29

StagePRReviewAndOpenPR splices prReviewDecisionStages() -- the same list PRReview() uses -- into the implement workflow, so stagePROperatorApproval is reachable from two triggers. With review.approve_before_post set, an implement run parks in waiting_human BEFORE it opens its PR. The only resume re-runs the workflow from its first stage (taskactions.Service.apply and chatTaskControllerAdapter.ApproveChatTask requeue waiting_human -> implement; workflow.Route with a non-empty t.Workflow picks the whole workflow again). Approving such a wait therefore re-enters prepare/baseline/plan/build/commit-push against a worktree that already carries the change. If the builder reports no changes, BuildNoChanges makes StageCommitPush call closeNoChangesIssue: the issue is closed, the task completes, and the PR is never opened. Fix: the gate belongs to the standalone pr-review workflow only, so the own-PR splice drops it -- one line in the splice. The own-PR trigger's human decision point is its existing park on an unchallenged blocking finding, and "which findings to post" has no referent before the PR exists. Decided while writing the operator-approval decision doc for afbk.11, which records the hazard and this follow-up. The alternative -- the gate gating both triggers, with a post decision short-circuiting every stage whose work the wait already completed -- was rejected: it needs conditional no-ops across seven unrelated stages plus a notion of "work the wait already completed" inside the waiting_human re-pin path, which is the most delicate machinery in this pipeline. Full re-entry is acceptable in the standalone pipeline precisely because it has no write-then-close stage. ### Acceptance criteria The own-PR path cannot park on the operator-approval gate. A regression test proves an implement run with review.approve_before_post set still opens its PR. The standalone pr-review workflow still parks in waiting_human and re-reviews as the PRD requires. ### Close reason Closed --- _Imported from beads `archie-core-7nst` · GitHub #1424 · type bug · priority P1 · created 2026-09-29 · closed 2026-09-29_
sam added the highbug labels 2026-10-27 13:39:07 +00:00
sam self-assigned this 2026-10-27 13:39:07 +00:00
sam closed this issue 2026-10-27 13:39:07 +00:00
sam added a new dependency 2026-10-27 13:42:15 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Reference: sam/archie#1125