Sandcastle reworks PRs with requested changes #21
Labels
No labels
in-review
ready-for-agent
ready-for-human
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
weiwen/evie#21
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?
What to build
Add the second PR-rework signal on top of the CI-fail path (#20): when a human requests changes on an open PR, sandcastle labels it for the agent and the planner prioritises reworking it.
Trigger:
on: pull_request+ a reviews-API check.pull_request_reviewis not a valid Forgejo Actions trigger, buton: pull_requestfires when a comment is made on the PR in this instance, which covers a changes-requested review (reviews normally carry comments). Thepull_requestpayload carries the PR, not the review state, so the workflow step must query the reviews API (GET /repos/weiwen/evie/pulls/<n>/reviews) and act only when the latest human review isREQUEST_CHANGES.End-to-end behaviour:
.github/workflows/pr-triage.yml, since a Forgejo runner already executes that folder) triggers onpull_request. If the PR's latest human review isREQUEST_CHANGES, it addsready-for-agentand removesready-for-human. It must NOT label on approvals or ordinary comments. Authenticate with the runner's automatic token, falling back to aFORGEJO_TOKENActions secret if that token can't edit labels.ready-for-agentneeds rework (in addition to #20'sci == "failure").tea pulls review-comments <n>/ reviews API), address them on the branch, push, then relabelready-for-agent→ready-for-humanand comment summarising the feedback addressed. The relabel is what stops the planner re-picking it.Accepted limitation: a changes-requested review submitted with no comment and no commit may not fire
pull_request; the human can leave a comment to trigger, or the next interaction will. Document this.Acceptance criteria
.github/workflowsfires onpull_requestand, when the PR's latest human review isREQUEST_CHANGES, addsready-for-agentand removesready-for-human.FORGEJO_TOKENsecret) is settled and documented.ready-for-agentfor rework even when its CI is passing.ready-for-agent→ready-for-humanwith a summary comment.docs/agents/triage-labels.mddocuments the review-driven rework path, thepull_request-trigger + reviews-API-check mechanism, and whypull_request_reviewcannot be used.Blocked by
Done (branch: sandcastle/issue-21)
All acceptance criteria addressed:
Workflow (.github/workflows/pr-triage.yml):
on: pull_requestPlanner (.sandcastle/plan-prompt.md):
Orchestrator (.sandcastle/main.mts):
PR-fixer (.sandcastle/pr-fixer-prompt.md):
Docs (docs/agents/triage-labels.md):