feat(flows): NF-6 Phase 4E — pr-changes-requested baked-in flow #384
No reviewers
Labels
No labels
area:agents
area:dashboard
area:database
area:design
area:design-review
area:flows
area:infra
area:meta
area:security
area:sessions
area:webhook
area:workdir
security
type:bug
type:chore
type:meta
type:user-story
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
charles/claude-hooks!384
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/flows-pr-changes-requested"
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?
Summary
Ports
webhook-handlers.ts::handleChangesRequested(lines 751-817) +domain/workflow/review-loop.ts::guardAuthorDispatchinto a baked-in node-flow graph. Shipspr-changes-requestedas the sixth seeded flow on thepull_request_review.submittedtrigger.DSL extensions (3 new nodes)
forge.guard_author_dispatch→ wrapsguardAuthorDispatch. Two ports:proceed(pass) /force_merge(carries{reviewer, rounds}on cap-trip).agent.reviewer_for_pr→ wrapsreviewerForPrfromwebhook-routing.ts. Picks reviewer agent type considering label match (M17-4 / #155) + author mapping. Without this the round-cap guard would count the wrong reviewer's submissions on dev-authoredarea:dashboardPRs.forge.dispatch_force_merge→ wrapsdispatchMerge(…, { force: true, reviewer, rounds }). Encapsulating the whole thing as one node preserves theforce_merge_dispatchedSSE broadcast (issue #141) and the⚠️ FORCE MERGEpreamble that instructs boss to skip the "latest review APPROVED" check. Splitting into render + dispatch primitives would require teachingagent.dispatchabout SSE.Also added
gateinput toforge.guard_author_dispatchandagent.reviewer_for_prso the rebase branch (mergeable=false) drops the entire guard + dispatch chain via FILTER_DROP propagation.Cutover
Same gate as
pr-approved-merge(Phase 4B):node_flows.suppress_legacy: ["pull_request_review.submitted"]skips BOTHpull_request_approvedANDpull_request_rejectedlegacy switch arms atwebhook.ts:300-316. Only flip once BOTHpr-approved-mergeAND this flow have soaked clean onGET /flows/divergence/summary. Documented in the loader header.Test plan
mode: "live"against real REQUEST_CHANGES review, confirm parity viaGET /flows/divergence/summaryMAX_ROUNDSon a test PRsuppress_legacy: ["pull_request_review.submitted"]after BOTH 4B + 4E soak🤖 Generated with Claude Code
Ports `webhook-handlers.ts::handleChangesRequested` (lines 751-817) + `domain/workflow/review-loop.ts::guardAuthorDispatch` into a baked-in node-flow graph. Ships `pr-changes-requested` as the sixth seeded flow on the `pull_request_review.submitted` trigger: src → router.filter (review.state === "changes_requested") → agent.resolve_by_login (PR author) → forge.get_pull_request (using author token) → router.switch on `mergeable` • not_mergeable → render `rebase` + dispatch to author • default → agent.reviewer_for_pr (label-aware reviewer pick) forge.guard_author_dispatch (round-cap, #117) • proceed → fetch labels + render `address-review` + dispatch to author • force_merge → forge.dispatch_force_merge to boss with FORCE MERGE preamble + SSE Three new injection-shaped nodes: 1. `forge.guard_author_dispatch` → wraps `guardAuthorDispatch` from `domain/workflow/review-loop.ts`. Two ports: `proceed` (fires on pass) / `force_merge` (carries `{ reviewer, rounds }` on cap-trip). 2. `agent.reviewer_for_pr` → wraps `reviewerForPr` from `webhook-routing.ts`. Picks reviewer agent type for the PR considering label match (M17-4 / #155) + author mapping. Without this the round-cap guard would count the wrong reviewer's submissions on dev-authored `area:dashboard` PRs. 3. `forge.dispatch_force_merge` → wraps `dispatchMerge(…, { force: true, reviewer, rounds })` from `webhook-ci.ts`. Encapsulating the whole thing as one node preserves the `force_merge_dispatched` SSE broadcast (issue #141) and the `⚠️ FORCE MERGE` preamble that instructs the boss skill to skip the "latest review APPROVED" precondition. Splitting into render + dispatch primitives would require teaching `agent.dispatch` about SSE. Also added `gate` input to `forge.guard_author_dispatch` and `agent.reviewer_for_pr` so the rebase branch (mergeable=false) drops the entire guard + dispatch chain via FILTER_DROP propagation. Cutover: `node_flows.suppress_legacy: ["pull_request_review.submitted"]` skips BOTH the `pull_request_approved` AND `pull_request_rejected` legacy switch arms at `webhook.ts:300-316`. Only flip once BOTH `pr-approved-merge` (Phase 4B) AND this flow have soaked clean on `GET /flows/divergence/summary`. Documented prominently in the loader header. Tests: 12 new e2e tests covering non-changes-requested no-op, happy path, rebase precheck, round-cap force-merge, author unresolved drop. AGENT_NODE_COUNT bumped from 11 to 14. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>53a9c4738732c392eb6e