AFK reject→requeue: bounce a rejected PR back to the ready queue with feedback for the next run #44
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Cloonar/coding-lab#44
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem / goal
Today an AFK run's only good ending is a merge. When a run produces a PR/CR a reviewer does not want to land, there is no way to send that work back to an AFK agent to try again. The reviewer's only lever is to close the PR — which, in lab's model, does close to the opposite of "retry":
afk/<N>branch. The auto-loop launches only on a claimable issue =ready-for-agentminus issues that already carry a claim branch (ClaimableIssues/FilterClaimable).tracker.PRPresent).afk/<N>claim in place → the issue stays claimed → not claimable → the auto-loop never re-picks it. The work is stranded as parked, not recycled.labctl issue comment <n>already exists for exactly that.Goal: a first-class reject → requeue action — a reviewer (and/or an agent) bounces a PR/CR back so its issue returns to the claimable ready queue, carrying the rejection feedback the next run will read.
Why this needs design (not just a labctl verb)
Requeue-on-reject brushes several deliberately-pinned invariants — branch-is-the-claim, closed-is-not-a-done-signal, guarded teardown (ADR-0010, ADR-0011, ADR-0013). It can't be
pr closewith a side effect bolted on. Open questions:afk/<N>branch on reject, a distinct reviewer action, or lift the Parked-view Unguarded Discard onto the agent/reviewer surface? Guarded teardown currently refuses to delete an unmerged branch on purpose.labctl(agent/reviewer-in-session), or both? Reject is a judgment call — does it belong on the agent surface at all, or is it reviewer-only?ready-for-agentthrough a requeue; confirm nothing needs a new state.pr close/pr comment. These smaller ops live in this family: a plainpr close(reject without requeue) andpr comment(a PR-thread note, as opposed to issue-level feedback). Decide whether reject is close+requeue as one action or composed from smaller verbs.Relationship
Sibling of #37 (
labctl pr merge, the land half of the same review loop). #37 stays merge-only; this issue owns everything about rejecting and recycling work.Suggested next step
A design / grill pass — and likely an ADR amending the done-signal / claim invariants (ADR-0010 / 0011 / 0013) — before this is agent-ready.
Triage: ready-for-human
Category: enhancement
Summary: confirmed the invariants this issue leans on are still exactly as
described in the current code —
ClaimableIssues/FilterClaimable(
internal/afk/decide.go,internal/afk/launch.go) filter the ready queue byclaim-branch presence, and
tracker.PRPresent(internal/tracker/pulls.go) isthe reaper's open-or-merged-only done-signal. A closed-unmerged PR/CR still
leaves the
afk/<N>claim branch in place, and the only requeue action todayis still the human-only Unguarded Discard. Nothing here has drifted since
filing.
Why this is
ready-for-human, notready-for-agent: this issue itselflists seven open design questions (what releases the claim, whether to keep or
discard the parked worktree, where/how rejection feedback accumulates across
retries, the stopping condition against the three-strikes pause and budget
clock, which surface can initiate a reject, state-label semantics, and the
relationship to
pr close/pr comment) and explicitly flags that this"brushes several deliberately-pinned invariants" (ADR-0010, ADR-0011,
ADR-0013) and likely needs an ADR amendment before it's agent-ready. These are
product/architecture trade-offs on invariants you pinned deliberately — not
gaps an agent should fill by guessing your intent, and picking wrong here
would mean re-litigating pinned ADR semantics later. This matches the issue's
own "Suggested next step: a design/grill pass" — that pass needs you, not an
agent brief.
Out of scope (for now):
questions above are resolved.
labctl pr merge) — sibling issue, stays merge-only regardless of howthis is decided.
Relabeling
needs-triage→ready-for-human.