feat(flows): NF-6 Phase 4C — review-requested baked-in flow #382
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!382
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/flows-review-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::handleReviewRequestedinto a baked-in node-flow graph. Shipsreview-requestedas the fourth seeded flow on thepull_request_review.review_requestedtrigger.DSL extensions
agent.dispatch.stateless_sessionarg/input →TaskRequest.stateless_session. Mirrors legacybuildAgentRequest(..., { stateless_session: true })for review dispatch — without it, a resumed reviewer rubber-stamps "same diff, same verdict" and silently shadows updated skill instructions.agent.render_skillauto-appliesskillForAgent(agent.type, base). Designer pair getsdesign-implement.md/design-review.mdinstead of the generic templates. Without this the flow path silently switched designer dispatches to genericimplement.md— a real divergence on every designer/design-reviewer dispatch.Two new injection-shaped forge. nodes*:
forge.guard_reviewer_dispatch→ wrapsguardReviewerDispatchfromdomain/workflow/review-loop.ts. Two ports:dispatch(forwards on pass) /skip(carries reason on trip).forge.fetch_pr_dispatch_labels→ wrapsfetchPrDispatchLabelsfromwebhook-handlers.ts(newly exported). Returns merged PR + linked-issue label set.Both follow the soft-fail-on-probe-error convention from
forge.detect_outstanding_change_requestso a transient 5xx degrades gracefully.Cutover
node_flows.suppress_legacy: ["pull_request_review.review_requested"]skips the legacy switch arms atwebhook.ts:263-292(bothpull_request_review_requestevent and thepull_requestaction=review_requested fallback) once the flow soaks clean.Test plan
mode: "live"against real review request, confirm parity viaGET /flows/divergence/summarysuppress_legacy: ["pull_request_review.review_requested"]after clean soak🤖 Generated with Claude Code
Ports `webhook-handlers.ts::handleReviewRequested` into a baked-in node-flow graph. Ships `review-requested` as the fourth seeded flow on the `pull_request_review.review_requested` trigger: src → agent.resolve_by_login (requested reviewer) → forge.get_pull_request (using reviewer token) → forge.guard_reviewer_dispatch (same-SHA verdict guard, #117) → forge.fetch_pr_dispatch_labels (PR + linked-issue label merge) → agent.render_skill (review skill, per-agent variant) → agent.dispatch (stateless_session: true, branch=pr.headRef) Three DSL extensions land alongside the flow: 1. `agent.dispatch` gains a `stateless_session: true` arg/input that propagates to `TaskRequest.stateless_session`. Mirrors the legacy `buildAgentRequest(..., { stateless_session: true })` wrapper used for review dispatch — without it, a resumed reviewer rubber-stamps "same diff, same verdict" and silently shadows updated skill instructions. 2. `agent.render_skill` now applies `skillForAgent(agent.type, base)` automatically. The designer pair gets `design-implement.md` / `design-review.md` / etc. instead of the generic templates. Without this the flow path silently switched designer dispatches to the generic `implement.md` — a real divergence on every designer/design-reviewer dispatch. 3. Two new injection-shaped forge.* nodes wrap legacy helpers: - `forge.guard_reviewer_dispatch` → `guardReviewerDispatch` from `domain/workflow/review-loop.ts`. Two ports: `dispatch` (forwards when guard passes) / `skip` (carries the reason when it trips). - `forge.fetch_pr_dispatch_labels` → `fetchPrDispatchLabels` from `webhook-handlers.ts` (newly exported). Returns the merged PR + linked-issue label set on the `labels` port. Both new nodes follow the soft-fail-on-probe-error convention from `forge.detect_outstanding_change_request` so a transient 5xx degrades gracefully rather than dropping the dispatch. Cutover gate: `node_flows.suppress_legacy: ["pull_request_review.review_requested"]` skips the legacy switch arms at `webhook.ts:263-292` (both `pull_request_review_request` and the `pull_request` action=review_requested fallback) once the flow soaks clean on `GET /flows/divergence/summary`. Tests: 11 new e2e tests covering happy path, same-SHA guard skip, unresolved reviewer drop, designer per-agent skill override. AGENT_NODE_COUNT bumped from 8 to 10. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>