Wire pr-review operator-approval responses: post/reject/re-review #122

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

archie-core-afbk.8 built the pipeline-side contract for the PRD's Operator approval gate: when review.approve_before_post is set and synthesis produced findings, stagePROperatorApproval ends the run in waiting_human right before the merge gate (docs/prds/pr-review-agent.md, Operator approval section). What is NOT built: the actual operator response channel and its three outcomes (post selected findings, reject the review, or re-review with instructions), and the PRD's 'at most 2 times' re-review cap.

Real blocker found while scoping afbk.8: there is no existing Task-level structured scratch field for an operator's decision, no per-round counter distinct from Task.Attempt (which counts every requeue, including unrelated retries, not just review rounds), and no existing mechanism in this codebase for resuming a workflow run partway through its Stage list -- every existing waiting_human resume (see feasibility.go, chatTaskControllerAdapter.ApproveChatTask) re-runs the requeued workflow from stage 1, it does not resume later stages. A real re-review 'reruns phases 3 to 8' per the PRD, which this full-restart semantics happens to satisfy for free (intake/anatomy recompute deterministically to the same values, modulo their own agent calls re-running at extra cost) PROVIDED operator instructions and a round counter can be threaded into the new attempt.

Recommended approach for whoever picks this up: reuse Task.Notes (already exists, already carries free-text context forward across attempts) to hold the operator's re-review instructions, threaded explicitly into stagePRLenses' and runReviewer's mission text (NOT generic AgentStage.buildRequest threading, since pr-review's stages build agentexec.Request directly and bypass that path). For the 2-round cap and reject/post decision, evaluate whether a small Task schema addition (one int column via a goose migration, regenerated sqlc code, threaded through TaskForge-style plumbing) is warranted, or whether encoding a round marker in Notes is acceptable -- this needs a maintainer call, it's exactly the kind of small-schema-change decision docs/architecture/configuration.md and the archie-config-and-flags skill should inform.

This likely belongs with archie-core-afbk.7 (review triggers: operator, watched repositories) since that bead already owns the operator response surface (chat/dashboard), or as its own follow-up if .7 is scoped narrower than that. Parent epic: archie-core-afbk.

Notes

Follow-up noted by the 7nst lane: docs/prds/pr-review-agent.md's Operator approval section still reads as if the gate applies to the pipeline generally, while the decision is that the own-PR splice drops it. Needs a one-line scoping sentence in a docs-carrying change (the decision itself is recorded in docs/prds/pr-review-operator-response.md).

Close reason

Closed


Imported from beads archie-core-afbk.11 · GitHub #1428 · type task · priority P1 · created 2026-09-28 · closed 2026-10-01

archie-core-afbk.8 built the pipeline-side contract for the PRD's Operator approval gate: when review.approve_before_post is set and synthesis produced findings, stagePROperatorApproval ends the run in waiting_human right before the merge gate (docs/prds/pr-review-agent.md, Operator approval section). What is NOT built: the actual operator response channel and its three outcomes (post selected findings, reject the review, or re-review with instructions), and the PRD's 'at most 2 times' re-review cap. Real blocker found while scoping afbk.8: there is no existing Task-level structured scratch field for an operator's decision, no per-round counter distinct from Task.Attempt (which counts every requeue, including unrelated retries, not just review rounds), and no existing mechanism in this codebase for resuming a workflow run partway through its Stage list -- every existing waiting_human resume (see feasibility.go, chatTaskControllerAdapter.ApproveChatTask) re-runs the requeued workflow from stage 1, it does not resume later stages. A real re-review 'reruns phases 3 to 8' per the PRD, which this full-restart semantics happens to satisfy for free (intake/anatomy recompute deterministically to the same values, modulo their own agent calls re-running at extra cost) PROVIDED operator instructions and a round counter can be threaded into the new attempt. Recommended approach for whoever picks this up: reuse Task.Notes (already exists, already carries free-text context forward across attempts) to hold the operator's re-review instructions, threaded explicitly into stagePRLenses' and runReviewer's mission text (NOT generic AgentStage.buildRequest threading, since pr-review's stages build agentexec.Request directly and bypass that path). For the 2-round cap and reject/post decision, evaluate whether a small Task schema addition (one int column via a goose migration, regenerated sqlc code, threaded through TaskForge-style plumbing) is warranted, or whether encoding a round marker in Notes is acceptable -- this needs a maintainer call, it's exactly the kind of small-schema-change decision docs/architecture/configuration.md and the archie-config-and-flags skill should inform. This likely belongs with archie-core-afbk.7 (review triggers: operator, watched repositories) since that bead already owns the operator response surface (chat/dashboard), or as its own follow-up if .7 is scoped narrower than that. Parent epic: archie-core-afbk. ### Notes Follow-up noted by the 7nst lane: docs/prds/pr-review-agent.md's Operator approval section still reads as if the gate applies to the pipeline generally, while the decision is that the own-PR splice drops it. Needs a one-line scoping sentence in a docs-carrying change (the decision itself is recorded in docs/prds/pr-review-operator-response.md). ### Close reason Closed --- _Imported from beads `archie-core-afbk.11` · GitHub #1428 · type task · priority P1 · created 2026-09-28 · closed 2026-10-01_
sam added the hightask labels 2026-10-27 13:35:02 +00:00
sam self-assigned this 2026-10-27 13:35:02 +00:00
sam closed this issue 2026-10-27 13:35:02 +00:00
sam added a new dependency 2026-11-14 14:45:17 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Reference: sam/archie#122