返回 CodeWhale
operate_staged_fix.workflow.js
根目录 / workflows / operate_staged_fix.workflow.js
1 /**
2 * Operate starter — staged bugfix (worktree implementer → verifier).
3 *
4 * Dogfood source: docs/examples/dogfood-automatic/wf_a2_staged_bugfix.workflow.js
5 * Run: /workflow run workflows/operate_staged_fix.workflow.js
6 */
7 export default async function (args) {
8 const target = args?.target ?? "docs/AUTOMATIC_WORKFLOWS.md";
9 const change =
10 args?.change ??
11 "Add a one-line note that #4131 example scenarios live in docs/examples/dogfood-automatic/.";
12
13 phase("Implement");
14 const implement = await task({
15 description: `Implement minimal docs fix in an isolated worktree: ${target}`,
16 label: "implementer",
17 type: "implementer",
18 // Prefer worktree isolation for write children (product default #4120).
19 worktree: true,
20 writeAuthority: "worktree_write",
21 exactFiles: [target],
22 coordinationContracts: ["wf-a2-doc-fix"],
23 dependencies: ["The parent workspace must remain unchanged."],
24 acceptance: [
25 `Only ${target} changes in the isolated worktree.`,
26 "The handoff reports the exact path and diff summary.",
27 ],
28 prompt: [
29 `Edit only ${target}.`,
30 change,
31 "Keep the change minimal and reversible. Do not push. Do not touch unrelated files.",
32 "Return: path edited, unified-diff summary, worktree path if any.",
33 ].join("\n"),
34 });
35
36 phase("Verify");
37 const verify = await task({
38 description: "Verify the isolated implementer handoff without further edits.",
39 label: "verifier",
40 type: "verifier",
41 worktree: false,
42 prompt: [
43 "Read the implementer result and validate its reported path and diff summary.",
44 "Confirm the intended one-line clarification was made only in the isolated worktree.",
45 "Confirm the parent workspace remains unchanged until an explicit apply or merge.",
46 "Do not implement further edits. Return PASS/FAIL with evidence.",
47 "",
48 "implementer_result:",
49 String(implement ?? "(missing)"),
50 ].join("\n"),
51 });
52
53 return {
54 scenario: "WF-A2",
55 target,
56 implement,
57 verify,
58 };
59 }
60
60 lines JAVASCRIPT