fix(FN-7242): keep code review remediation recovering

This commit is contained in:
gsxdsm
2026-06-29 18:41:43 -07:00
parent 03d4f95e8a
commit 9fd286b1d3
8 changed files with 35 additions and 18 deletions

View File

@@ -0,0 +1,7 @@
---
"@runfusion/fusion": patch
---
summary: Keep built-in Code Review remediation recovering until review passes.
category: fix
dev: Built-in Code Review now defaults maxRevisions to unbounded while preserving workflow-authored numeric caps.

View File

@@ -24,6 +24,10 @@ U6 deleted the `WORKFLOW_STEP_TEMPLATES` catalog. The former "code-review catalo
fields" assertions are gone; the inlined literal values (name/toolMode/gateMode/prompt
verdict convention) are now asserted directly on the built group node below, which is the
parity oracle.
FNXC:CodeReviewStep 2026-06-29-17:55:
Built-in Code Review defaults to unbounded remediation so repeated REVISE feedback
keeps cycling through implementation fixes instead of terminal-failing the task.
*/
describe("codeReviewOptionalGroupNode", () => {
@@ -52,7 +56,7 @@ describe("codeReviewOptionalGroupNode", () => {
expect(node.config?.name).toBe("Code Review");
// Default-ON (runs by default), but still an optional-group → toggleable per task.
expect(node.config?.defaultOn).toBe(true);
expect(node.config?.maxRevisions).toBe(3);
expect(node.config?.maxRevisions).toBe("unbounded");
const template = node.config?.template as { nodes: { id: string; kind: string; config?: Record<string, unknown> }[] };
expect(template.nodes).toHaveLength(1);

View File

@@ -139,7 +139,7 @@ describe("built-in workflows", () => {
expect(workflow.ir.nodes.find((node) => node.id === gate)?.config, `${workflow.id}:${gate}:reworkRegion`).toMatchObject({
reworkRegion: true,
maxReworkCycles: 3,
maxRevisions: 3,
maxRevisions: gate === "code-review" ? "unbounded" : 3,
});
}
}

View File

@@ -29,6 +29,12 @@ because the generic built-in was authored as advisory and the graph continued af
remediation budget was exhausted. Keep browser verification advisory, but make Code
Review a gate so REVISE records a blocking failed workflow step and cannot advance to
review or merge.
FNXC:CodeReviewStep 2026-06-29-17:55:
Code Review REVISE is ordinary repair feedback, not a terminal task failure. FN-7242
exhausted the old built-in three-pass default and parked failed at
`code-review-remediation`; default built-in Code Review must keep recovering until it
passes unless a workflow author explicitly sets a numeric maxRevisions cap.
*/
/** Stable per-task enable key + group node id. */
@@ -94,10 +100,10 @@ export function codeReviewOptionalGroupNode(
reworkRegion: true,
maxReworkCycles: 3,
/*
* FNXC:WorkflowRemediationBudget 2026-06-29-13:56:
* Built-in workflows own their optional-step remediation policy. Default Code Review to three fix→review attempts while preserving workflow-authored overrides through `config.maxRevisions`.
* FNXC:WorkflowRemediationBudget 2026-06-29-17:55:
* Built-in Code Review should never terminal-fail merely because repair feedback repeated. Default to unbounded fix→review recovery while preserving workflow-authored numeric caps through `config.maxRevisions`.
*/
maxRevisions: options.maxRevisions ?? 3,
maxRevisions: options.maxRevisions ?? "unbounded",
template: {
nodes: [
{

View File

@@ -126,8 +126,8 @@ export const BUILTIN_MOVED_WORKFLOW_SETTINGS: WorkflowSettingDefinition[] = [
name: "Max post-review fixes",
type: "number",
/*
* FNXC:WorkflowOptionalStepCycle 2026-06-27-11:11:
* Built-in Code Review and Browser Verification must cycle through executor fixes and re-review until they pass, bounded by this default budget of three passes. FN-7129 owns future per-step configurable or unbounded budgets.
* FNXC:WorkflowOptionalStepCycle 2026-06-29-17:55:
* This global budget remains the fallback for custom optional gates and explicitly capped built-in gates. Built-in Code Review now sets `maxRevisions: "unbounded"` so ordinary reviewer feedback keeps recovering instead of terminal-failing after three passes.
*/
default: 3,
description: "Maximum automatic fix passes after review/optional-step feedback; the step re-runs each pass until it passes or this budget is exhausted.",
@@ -401,4 +401,3 @@ export function renderTriagePolicyPlaceholders(prompt: string, settings: Partial
}
return rendered;
}

View File

@@ -60,10 +60,10 @@ function ceCodeReviewOptionalGroupNode(column: string): WorkflowIrNode {
reworkRegion: true,
maxReworkCycles: 3,
/*
* FNXC:WorkflowRemediationBudget 2026-06-29-13:56:
* The CE Code Review group is custom because it invokes the CE skill, but its workflow-owned remediation budget must match the other built-in optional gates by defaulting to three attempts while remaining editable in workflow config.
* FNXC:WorkflowRemediationBudget 2026-06-29-17:55:
* The CE Code Review group is custom because it invokes the CE skill, but Code Review REVISE is still ordinary repair feedback. Default CE review remediation to unbounded so CE tasks do not terminal-fail after repeated reviewer feedback unless a workflow author sets a numeric cap.
*/
maxRevisions: 3,
maxRevisions: "unbounded",
template: {
nodes: [
{

View File

@@ -2313,11 +2313,12 @@ export interface Task {
/** Compact execution-progress snapshot captured at the last reclaim/unpause
* attempt (current step + step statuses) for resume-limbo detection. */
resumeLimboStepSignature?: string;
/** Number of times the self-healing manager has auto-revived this task from
* `in-review` after a failed pre-merge workflow step. Incremented each time the
* `recoverReviewTasksWithFailedPreMergeSteps` scan sends the task back with the
* failure feedback injected. Capped by `maxPostReviewFixes`; when exhausted the
* task remains parked in `in-review` for human intervention. */
/** Number of times workflow remediation has auto-revived this task after
* failed pre-merge review feedback. Incremented each time the engine sends the
* task back with failure feedback injected. Capped only when the workflow step
* resolves to a numeric maxRevisions/maxPostReviewFixes budget; built-in Code
* Review defaults to unbounded recovery so ordinary REVISE feedback does not
* terminal-fail the task. */
postReviewFixCount?: number;
/** Number of bounded recovery retry attempts for transient executor/triage failures.
* Distinct from `mergeRetries` (merge-conflict-specific). Incremented by the

View File

@@ -816,7 +816,7 @@ describe("WorkflowGraphExecutor optional-group", () => {
stepName: groupId === "code-review" ? "Code Review" : "Browser Verification",
feedback: `${groupId} finding`,
nodeId: groupId,
maxRevisions: undefined,
maxRevisions: groupId === "code-review" ? "unbounded" : 3,
}));
expect(calls).not.toContain("review");
expect(result.context[`node:${groupId}:fixScheduled`]).toBe(true);
@@ -868,7 +868,7 @@ describe("WorkflowGraphExecutor optional-group", () => {
stepName: groupId === "code-review" ? "Code Review" : "Browser Verification",
feedback: `stepwise ${groupId} finding`,
nodeId: groupId,
maxRevisions: undefined,
maxRevisions: groupId === "code-review" ? "unbounded" : 3,
}));
expect(stepwiseResult.context[`node:${groupId}:fixScheduled`]).toBe(true);
}