diff --git a/packages/core/src/__tests__/builtin-workflows.test.ts b/packages/core/src/__tests__/builtin-workflows.test.ts index 51c0b2f847..301508c5f1 100644 --- a/packages/core/src/__tests__/builtin-workflows.test.ts +++ b/packages/core/src/__tests__/builtin-workflows.test.ts @@ -288,6 +288,22 @@ describe("built-in workflows", () => { expect(execute!.toolMode).toBe("coding"); }); + it("compound-engineering merge stage uses the CE commit/PR + resolve-feedback skills", () => { + const ce = getBuiltinWorkflow("builtin:compound-engineering")!; + const byId = (id: string) => ce.ir.nodes.find((n) => n.id === id); + expect(byId("commit-pr")?.config?.skillName).toBe("compound-engineering:ce-commit-push-pr"); + expect(byId("commit-pr")?.config?.toolMode).toBe("coding"); + expect(byId("resolve-feedback")?.config?.skillName).toBe("compound-engineering:ce-resolve-pr-feedback"); + // KTD-6: the Fusion board-merge seam is preserved (CE prepares the PR, Fusion + // owns the merge transition). + expect(byId("merge")?.config?.seam).toBe("merge"); + // Ordering: commit-pr → resolve-feedback → merge → document. + const ids = ce.ir.nodes.map((n) => n.id); + expect(ids.indexOf("commit-pr")).toBeLessThan(ids.indexOf("resolve-feedback")); + expect(ids.indexOf("resolve-feedback")).toBeLessThan(ids.indexOf("merge")); + expect(ids.indexOf("merge")).toBeLessThan(ids.indexOf("document")); + }); + 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 601b217cca..e777a6c556 100644 --- a/packages/core/src/builtin-workflows.ts +++ b/packages/core/src/builtin-workflows.ts @@ -191,6 +191,35 @@ export const BUILTIN_WORKFLOWS: WorkflowDefinition[] = [ prompt: "Run a structured code review of the changes. Block merge on P0/P1 findings.", }, }, + { + id: "commit-pr", + kind: "prompt", + config: { + name: "Commit & open PR", + executor: "skill", + skillName: "compound-engineering:ce-commit-push-pr", + // Coding mode: this step runs git + gh. Per KTD-6 it OWNS commit / + // push / PR creation; it does NOT perform the board-state merge — that + // stays with Fusion's merge seam below (workflow-owned merge), so the + // two never race the same branch state. + toolMode: "coding", + prompt: "Commit the work in logical commits, push the branch, and open a pull request with a value-first description.", + }, + }, + { + id: "resolve-feedback", + kind: "prompt", + config: { + name: "Resolve PR feedback", + executor: "skill", + skillName: "compound-engineering:ce-resolve-pr-feedback", + toolMode: "coding", + // Resolves open PR review threads. On the first autonomous pass there + // may be no feedback yet (review is async); the skill no-ops when there + // are no threads, and a re-run picks up later feedback. + prompt: "Resolve open PR review feedback: evaluate each thread, fix valid issues, and reply.", + }, + }, { id: "merge", kind: "prompt", config: builtinPromptConfig("merge", "Merge boundary") }, { id: "document",