feat(flows): NF-6 Phase 4G — check-suite-completed baked-in flow #386
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!386
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/flows-pr-fixci-probe"
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
Final flow in the Phase 4 set. Ports the post-CI routing path that legacy
webhook-handlers.ts::handleStatusEvent+handleActionRunEventcover into one baked-in node-flow graph.One monolithic node wraps the new
handleCheckSuiteCompletedhelper (added in this PR) which unifieshandleStatusEvent+handleActionRunEventinto one canonical entry point so the flow node can call into one symbol instead of branching on the wire event name.Routing tree
3 arms, plus
decidePostCiAction's 6 sub-arms on the success path:failure/error→dispatchFixCito PR author with the fix-ci skill template.success→ confirm aggregate is green (other workflows may still be running), then route viadecidePostCiAction(self-review skip, approved+merge, verdict-at-head skip, stale-bounce, pending skip, fresh-request POST).Monolithic because the legacy routing tree is monolithic — splitting into granular nodes would either duplicate the entire 6-arm
decidePostCiActiontable in the flow JSON (which would routinely drift from legacy) or expose 6+ new node types operators can't customise meaningfully.Cutover
node_flows.suppress_legacy: ["check_suite.completed"]skips the legacystatus,action_run_failure,action_run_success, ANDaction_run_recoverswitch arms atwebhook.ts:341-361. The trigger normaliser collapses every wire variant (Forgejostatus/action_run_*, GitHubworkflow_run/check_suite, GitLabPipeline Hook) into onecheck_suite.completedkind, so one suppression entry covers all of them.Test plan
mode: "live"against real CI completion, confirm parity viaGET /flows/divergence/summarysuppress_legacy: ["check_suite.completed"]after clean soakPhase 4 set complete
This is the seventh and final baked-in flow in the Phase 4 set. Phase 4 ships:
issue-labeled-route(#380)pr-approved-merge(#381)review-requested(#382)slash-breakdown(#383)pr-changes-requested(#384)issue-closed-deps(#385)check-suite-completed(this PR)After every flow soaks clean on
GET /flows/divergence/summary, the operator can flip everysuppress_legacyentry in one go and the legacy webhook switch inwebhook.tsbecomes deletable.🤖 Generated with Claude Code
Final flow in the Phase 4 set. Ports the post-CI routing path that legacy `webhook-handlers.ts::handleStatusEvent` + `handleActionRunEvent` cover into one baked-in node-flow graph `check-suite-completed`: src → forge.handle_check_suite_completed One monolithic node wraps `handleCheckSuiteCompleted` (a new helper added in this PR that unifies `handleStatusEvent` + `handleActionRunEvent` into one canonical entry point so the flow node can call into one symbol instead of branching on the wire event name). Routing tree (3 arms, plus `decidePostCiAction`'s 6 sub-arms on the success path): - `failure` / `error` → `dispatchFixCi` to PR author with the fix-ci skill template. - `success` → confirm aggregate is green (other workflows may still be running), then route via `decidePostCiAction` (self-review skip, approved+merge, verdict-at-head skip, stale-bounce, pending skip, fresh-request POST). Monolithic because the legacy routing tree is monolithic — splitting into granular nodes would either duplicate the entire `decidePostCiAction` 6-arm table in the flow JSON (which would routinely drift from legacy) or expose 6+ new node types operators can't customise meaningfully. Returns `taskId` when fix-ci dispatches; `taskId: FILTER_DROP` on the success path (no single taskId summarises the post-CI action — could be a forge `requestReview` POST, a forge `removeReviewRequest` + `requestReview` bounce, a boss merge dispatch, or just a log line). Cutover gate: `node_flows.suppress_legacy: ["check_suite.completed"]` skips the legacy `status`, `action_run_failure`, `action_run_success`, AND `action_run_recover` switch arms at `webhook.ts:341-361`. The trigger normaliser collapses every wire variant (Forgejo `status`/ `action_run_*`, GitHub `workflow_run`/`check_suite`, GitLab `Pipeline Hook`) into one `check_suite.completed` kind, so one suppression entry covers all of them. Tests: 13 e2e tests covering failure / error / success arms, empty-runs defensive path, invalid-conclusion error surface, not-wired guard. AGENT_NODE_COUNT bumped from 15 to 16. This is the seventh and final baked-in flow in the Phase 4 set. After it soaks clean alongside the six earlier flows, the operator can flip every `suppress_legacy` entry in one go and the legacy webhook switch becomes deletable. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>