feat(workflow): run ce-work for compound-engineering execute step (U4)

Swap the compound-engineering workflow's execute seam for a
compound-engineering:ce-work skill node in coding mode, so the
implementation stage actually runs the CE way (R1). Add tests asserting
the ce-work skill executor and coding toolMode.

Part of the compound-engineering workflow integration plan
(docs/plans/2026-06-13-002).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
gsxdsm
2026-06-13 01:01:50 -07:00
parent f43e01f4d9
commit 64de883d6c
3 changed files with 36 additions and 3 deletions

View File

@@ -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.)

View File

@@ -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<typeof harness.store>;

View File

@@ -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",