diff --git a/.changeset/feat-compound-engineering-workflow-integration.md b/.changeset/feat-compound-engineering-workflow-integration.md new file mode 100644 index 0000000000..07ad741e2e --- /dev/null +++ b/.changeset/feat-compound-engineering-workflow-integration.md @@ -0,0 +1,5 @@ +--- +"@runfusion/fusion": minor +--- + +Make the built-in compound-engineering workflow run the CE way end-to-end. The execute stage now invokes the `compound-engineering:ce-work` skill in coding mode instead of the generic executor prompt, so implementation follows the compound-engineering workflow. (Further stages — CE commit/PR merge flow, human-in-the-loop planning questions, and subagent enablement — land in follow-up commits on this feature.) diff --git a/packages/core/src/__tests__/builtin-workflows.test.ts b/packages/core/src/__tests__/builtin-workflows.test.ts index d0d0bd14e3..51c0b2f847 100644 --- a/packages/core/src/__tests__/builtin-workflows.test.ts +++ b/packages/core/src/__tests__/builtin-workflows.test.ts @@ -268,11 +268,26 @@ describe("built-in workflows", () => { it("compound-engineering compiles its skill nodes to steps", () => { const ce = getBuiltinWorkflow("builtin:compound-engineering")!; const steps = compileWorkflowToSteps(ce.ir); - // plan + code-review (pre-merge) + document (post-merge) — seams are skipped. - expect(steps.length).toBeGreaterThanOrEqual(3); + // plan + execute (ce-work) + code-review (pre-merge) + document (post-merge) + // — review/merge seams are skipped. + expect(steps.length).toBeGreaterThanOrEqual(4); expect(steps.some((s) => s.name === "Plan")).toBe(true); }); + it("compound-engineering runs ce-work for the execute step in coding mode", () => { + const ce = getBuiltinWorkflow("builtin:compound-engineering")!; + // The IR node declares the ce-work skill executor (engine wraps the prompt + // with the invoke-skill preamble on the graph-interpreter path). + const executeNode = ce.ir.nodes.find((n) => n.id === "execute"); + expect(executeNode?.config?.executor).toBe("skill"); + expect(executeNode?.config?.skillName).toBe("compound-engineering:ce-work"); + // The compiled step runs in coding mode so write/spawn tools are available. + const steps = compileWorkflowToSteps(ce.ir); + const execute = steps.find((s) => s.name === "Execute"); + expect(execute).toBeDefined(); + expect(execute!.toolMode).toBe("coding"); + }); + describe("store integration", () => { const harness = createTaskStoreTestHarness(); let store: ReturnType; diff --git a/packages/core/src/builtin-workflows.ts b/packages/core/src/builtin-workflows.ts index bcca6fe7e2..601b217cca 100644 --- a/packages/core/src/builtin-workflows.ts +++ b/packages/core/src/builtin-workflows.ts @@ -165,7 +165,20 @@ export const BUILTIN_WORKFLOWS: WorkflowDefinition[] = [ prompt: "Produce a short implementation plan for this task before any code is written.", }, }, - { id: "execute", kind: "prompt", config: builtinPromptConfig("execute", "Execute") }, + { + id: "execute", + kind: "prompt", + config: { + name: "Execute", + executor: "skill", + skillName: "compound-engineering:ce-work", + // Coding mode so the step has write + spawn tools (readonly is the + // default and would strip them). ce-work does the implementation the + // CE way instead of the generic executor seam. + toolMode: "coding", + prompt: "Execute the plan for this task, following existing patterns and maintaining quality throughout.", + }, + }, { id: "review", kind: "prompt", config: builtinPromptConfig("review", "Review") }, { id: "code-review",