fix(engine): implementation-incomplete merge failures fail-closed/resumable (#1991)#2091
Conversation
… graph failures (Runfusion#1991) Merge graph failures classified 'implementation-incomplete' (missing implementation proof) can no longer be routed to a no-branch no-op merge requester and false-complete as done. They now fail closed when there is no executable proof to resume, or requeue resumable parsed steps back to todo for execution. Defense-in-depth guards added in isRetryableBenignMergePauseAbort and the merge-requester route, plus a dedicated routeImplementationIncompleteMergeGraphFailure classifier. Adds regression tests (fail-closed + requeue) and a changeset. Refs Runfusion#1991 (no-op merge truthfulness); sibling of Runfusion#1946 no-verdict dispatch defect. Co-authored-by: Fusion <noreply@runfusion.ai>
|
Warning Review limit reached
Next review available in: 13 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe executor now routes ChangesMerge failure truthfulness
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant GraphFailure
participant TaskExecutor
participant RecoveryRouting
participant TaskState
GraphFailure->>TaskExecutor: implementation-incomplete merge failure
TaskExecutor->>RecoveryRouting: route failure
RecoveryRouting->>TaskState: requeue resumable steps
RecoveryRouting->>TaskState: or mark task failed without executable proof
Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Greptile SummaryThis PR makes implementation-incomplete merge failures fail closed or resume execution instead of completing as no-op merges.
Confidence Score: 5/5This looks safe to merge.
Important Files Changed
Reviews (4): Last reviewed commit: "fix(engine): use undefined for in-memory..." | Re-trigger Greptile |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/engine/src/__tests__/executor-fast-mode-workflows.test.ts`:
- Around line 431-436: Update the negative store.logEntry assertion in the
fast-mode workflow test to use undefined for the argument that may be undefined,
replacing the corresponding expect.anything() matcher so the assertion catches
emitted calls with an undefined value.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: e897375e-5914-4d56-b041-80894fdbde88
📒 Files selected for processing (4)
.changeset/fn-1165-noop-merge-truthfulness.mdpackages/engine/src/__tests__/executor-fast-mode-workflows.test.tspackages/engine/src/__tests__/reliability-interactions/merge-node-paused-abort-retryable.test.tspackages/engine/src/executor.ts
…ntry guard (Runfusion#1991) expect.anything() does not match undefined, so the .not.toHaveBeenCalledWith guard was vacuous. Match the real 4-arg call shape (taskId, message, undefined, undefined). Addresses CodeRabbit review on PR Runfusion#2091.
|
Addressed the CodeRabbit review on |
|
Thanks so much for this! Can you address the two greptile P1s? Will merge after that |
…ee tracking (FN-1165) Address greptile P1s on Runfusion#2091: - System pause (paused without user/global pause) still enters the implementation-incomplete merge classifier for fail-closed/resumable routing instead of parking as a pause-abort. - Resumable path keeps activeWorktrees registration when progress/worktree is preserved; only fail-closed releases tracking. Adds regression coverage for both invariants.
TaskDetail.pausedReason is string|undefined; assigning null broke tsc. Keep store updateTask clear as null (store accepts null) and set the resume snapshot to undefined.
What & why
Workflow graph merge failures classified
implementation-incomplete(i.e. the merge node reports there is no implementation proof — no branch / no committed work) could still be routed to the no-op merge requester and false-complete the task as done. This hides genuinely unlanded work behind a green "merge" and is the merge-side sibling of the "(no feedback captured)" no-verdict dispatch defect.Closes the truthfulness gap: an
implementation-incompletemerge-graph failure now fails closed when there is no executable proof to resume, or requeues resumable parsed steps back totodofor execution — it is never handed to a no-branch no-op merge requester.Refs #1991 (no-op merge truthfulness). Sibling of #1946 (no-verdict "(no feedback captured)" dispatch defect).
Change
routeImplementationIncompleteMergeGraphFailure(live, failedNode):status: "failed"with a logged, explicit reason).isRetryableBenignMergePauseAbortand the merge-requester route both short-circuit (return false) forimplementation-incomplete, so this value can never reach the no-op merge requester.handleGraphFailureroutes genuine (non-global-pause, non-completion-finalize, non-user-paused)implementation-incompletemerge-graph failures through the new classifier.implementation-incompletemerge failure with no incomplete steps as fail-closed, and keeps the premature-merge-with-incomplete-steps requeue path.Legitimate
noCommitsExpectedno-op merges are explicitly preserved (regression test included).Tests
New regression coverage in:
packages/engine/src/__tests__/reliability-interactions/merge-node-paused-abort-retryable.test.ts— parametrized across merge node ids: (a) no-proofimplementation-incompletefails closed without requesting a no-op merge; (b) resumable parsed steps are requeued totodofor execution resume, not no-op-merged.packages/engine/src/__tests__/executor-fast-mode-workflows.test.ts— a legitimatenoCommitsExpectedbuiltin:coding merge is still allowed (guard does not over-block).Verification (engine package):
A
patchchangeset for@runfusion/fusionis included.Summary by CodeRabbit