agentweaver 0.1.17 → 0.1.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/README.md +112 -23
  2. package/dist/artifacts.js +41 -0
  3. package/dist/index.js +258 -29
  4. package/dist/interactive/controller.js +323 -13
  5. package/dist/interactive/ink/index.js +2 -2
  6. package/dist/interactive/state.js +10 -0
  7. package/dist/interactive/web/index.js +326 -0
  8. package/dist/interactive/web/protocol.js +160 -0
  9. package/dist/interactive/web/server.js +1011 -0
  10. package/dist/interactive/web/static/app.js +1580 -0
  11. package/dist/interactive/web/static/index.html +114 -0
  12. package/dist/interactive/web/static/styles.css +2 -0
  13. package/dist/interactive/web/static/styles.input.css +849 -0
  14. package/dist/pipeline/flow-catalog.js +4 -0
  15. package/dist/pipeline/flow-specs/auto-common-guided.json +313 -0
  16. package/dist/pipeline/flow-specs/auto-common.json +3 -1
  17. package/dist/pipeline/flow-specs/design-review/design-review-loop.json +2 -0
  18. package/dist/pipeline/flow-specs/design-review.json +2 -0
  19. package/dist/pipeline/flow-specs/implement.json +3 -1
  20. package/dist/pipeline/flow-specs/plan.json +4 -0
  21. package/dist/pipeline/flow-specs/playbook-init.json +199 -0
  22. package/dist/pipeline/flow-specs/review/review-fix.json +3 -1
  23. package/dist/pipeline/flow-specs/review/review-loop.json +4 -0
  24. package/dist/pipeline/flow-specs/review/review.json +2 -0
  25. package/dist/pipeline/node-registry.js +45 -0
  26. package/dist/pipeline/nodes/flow-run-node.js +13 -1
  27. package/dist/pipeline/nodes/playbook-ensure-node.js +115 -0
  28. package/dist/pipeline/nodes/playbook-inventory-node.js +51 -0
  29. package/dist/pipeline/nodes/playbook-questions-form-node.js +166 -0
  30. package/dist/pipeline/nodes/playbook-write-node.js +243 -0
  31. package/dist/pipeline/nodes/project-guidance-node.js +69 -0
  32. package/dist/pipeline/prompt-registry.js +4 -1
  33. package/dist/pipeline/prompt-runtime.js +6 -2
  34. package/dist/pipeline/spec-types.js +19 -0
  35. package/dist/pipeline/value-resolver.js +39 -1
  36. package/dist/playbook/practice-candidates.js +12 -0
  37. package/dist/playbook/repo-inventory.js +208 -0
  38. package/dist/prompts.js +31 -0
  39. package/dist/runtime/artifact-catalog.js +379 -0
  40. package/dist/runtime/playbook.js +485 -0
  41. package/dist/runtime/project-guidance.js +339 -0
  42. package/dist/structured-artifact-schema-registry.js +8 -0
  43. package/dist/structured-artifact-schemas.json +235 -0
  44. package/dist/structured-artifacts.js +7 -1
  45. package/docs/declarative-workflows.md +565 -0
  46. package/docs/features.md +77 -0
  47. package/docs/playbook.md +327 -0
  48. package/package.json +8 -3
@@ -5,6 +5,7 @@ import { collectFlowRoutingGroups, loadDeclarativeFlow } from "./declarative-flo
5
5
  import { globalFlowSpecsDir, listBuiltInFlowSpecFiles, listGlobalFlowSpecFiles, listProjectFlowSpecFiles, projectFlowSpecsDir } from "./spec-loader.js";
6
6
  export const BUILT_IN_COMMAND_FLOW_IDS = [
7
7
  "auto-golang",
8
+ "auto-common-guided",
8
9
  "auto-common",
9
10
  "auto-simple",
10
11
  "bug-analyze",
@@ -17,6 +18,7 @@ export const BUILT_IN_COMMAND_FLOW_IDS = [
17
18
  "mr-description",
18
19
  "plan",
19
20
  "plan-revise",
21
+ "playbook-init",
20
22
  "task-describe",
21
23
  "implement",
22
24
  "review",
@@ -27,6 +29,7 @@ export const BUILT_IN_COMMAND_FLOW_IDS = [
27
29
  ];
28
30
  const BUILT_IN_COMMAND_FLOW_FILES = {
29
31
  "auto-golang": "auto-golang.json",
32
+ "auto-common-guided": "auto-common-guided.json",
30
33
  "auto-common": "auto-common.json",
31
34
  "auto-simple": "auto-simple.json",
32
35
  "bug-analyze": "bugz/bug-analyze.json",
@@ -39,6 +42,7 @@ const BUILT_IN_COMMAND_FLOW_FILES = {
39
42
  "mr-description": "gitlab/mr-description.json",
40
43
  plan: "plan.json",
41
44
  "plan-revise": "plan-revise.json",
45
+ "playbook-init": "playbook-init.json",
42
46
  "task-describe": "task-describe.json",
43
47
  implement: "implement.json",
44
48
  review: "review/review.json",
@@ -0,0 +1,313 @@
1
+ {
2
+ "kind": "auto-common-guided-flow",
3
+ "version": 1,
4
+ "description": "End-to-end auto-common pipeline with compact manifest.yaml project guidance generated before guided LLM phases.",
5
+ "phases": [
6
+ {
7
+ "id": "source",
8
+ "steps": [
9
+ {
10
+ "id": "fetch_jira_source",
11
+ "node": "flow-run",
12
+ "params": {
13
+ "fileName": { "const": "jira-fetch.json" },
14
+ "labelText": { "const": "Fetching Jira task source" },
15
+ "jiraApiUrl": { "ref": "params.jiraApiUrl" },
16
+ "taskKey": { "ref": "params.taskKey" }
17
+ }
18
+ }
19
+ ]
20
+ },
21
+ {
22
+ "id": "normalize",
23
+ "steps": [
24
+ {
25
+ "id": "run_normalize_source",
26
+ "node": "flow-run",
27
+ "params": {
28
+ "fileName": { "const": "normalize-task-source.json" },
29
+ "labelText": { "const": "Normalizing task source" },
30
+ "taskKey": { "ref": "params.taskKey" },
31
+ "iteration": { "ref": "params.taskContextIteration" },
32
+ "llmExecutor": { "ref": "params.llmExecutor" },
33
+ "llmModel": { "ref": "params.llmModel" },
34
+ "extraPrompt": { "ref": "params.extraPrompt" }
35
+ }
36
+ }
37
+ ]
38
+ },
39
+ {
40
+ "id": "playbook",
41
+ "steps": [
42
+ {
43
+ "id": "ensure_playbook",
44
+ "node": "playbook-ensure",
45
+ "params": {
46
+ "writeResultJsonFile": { "artifact": { "kind": "playbook-write-result-json-file", "taskKey": { "ref": "params.taskKey" } } },
47
+ "acceptPlaybookDraft": { "ref": "params.acceptPlaybookDraft" }
48
+ },
49
+ "stopFlowIf": {
50
+ "any": [
51
+ { "equals": [{ "ref": "steps.playbook.ensure_playbook.value.status" }, { "const": "blocked" }] },
52
+ { "equals": [{ "ref": "steps.playbook.ensure_playbook.value.status" }, { "const": "invalid_manifest" }] },
53
+ { "equals": [{ "ref": "steps.playbook.ensure_playbook.value.status" }, { "const": "partial_manifest" }] },
54
+ { "equals": [{ "ref": "steps.playbook.ensure_playbook.value.status" }, { "const": "not_accepted" }] },
55
+ { "equals": [{ "ref": "steps.playbook.ensure_playbook.value.status" }, { "const": "failed" }] }
56
+ ]
57
+ },
58
+ "stopFlowOutcome": "stopped"
59
+ },
60
+ {
61
+ "id": "run_playbook_init",
62
+ "node": "flow-run",
63
+ "when": { "ref": "steps.playbook.ensure_playbook.value.shouldRunPlaybookInit" },
64
+ "params": {
65
+ "fileName": { "const": "playbook-init.json" },
66
+ "labelText": { "const": "Initializing manifest-based project playbook" },
67
+ "taskKey": { "ref": "params.taskKey" },
68
+ "taskContextJsonFile": { "artifact": { "kind": "task-context-json-file", "taskKey": { "ref": "params.taskKey" }, "iteration": { "ref": "params.taskContextIteration" } } },
69
+ "markdownLanguage": { "ref": "params.mdLang" },
70
+ "iteration": { "ref": "params.planIteration" },
71
+ "launchMode": { "ref": "params.launchMode" },
72
+ "targetManifestPath": { "ref": "steps.playbook.ensure_playbook.value.manifestPath" },
73
+ "acceptPlaybookDraft": { "ref": "params.acceptPlaybookDraft" },
74
+ "llmExecutor": { "ref": "params.llmExecutor" },
75
+ "llmModel": { "ref": "params.llmModel" },
76
+ "extraPrompt": { "ref": "params.extraPrompt" }
77
+ }
78
+ },
79
+ {
80
+ "id": "verify_playbook",
81
+ "node": "playbook-ensure",
82
+ "when": { "ref": "steps.playbook.ensure_playbook.value.shouldRunPlaybookInit" },
83
+ "params": {
84
+ "writeResultJsonFile": { "artifact": { "kind": "playbook-write-result-json-file", "taskKey": { "ref": "params.taskKey" } } },
85
+ "acceptPlaybookDraft": { "ref": "params.acceptPlaybookDraft" },
86
+ "verifyAfterInit": { "const": true }
87
+ },
88
+ "stopFlowIf": {
89
+ "not": {
90
+ "any": [
91
+ { "equals": [{ "ref": "steps.playbook.verify_playbook.value.status" }, { "const": "written" }] },
92
+ { "equals": [{ "ref": "steps.playbook.verify_playbook.value.status" }, { "const": "skipped_valid_existing" }] },
93
+ { "equals": [{ "ref": "steps.playbook.verify_playbook.value.status" }, { "const": "dry_run_written" }] }
94
+ ]
95
+ }
96
+ },
97
+ "stopFlowOutcome": "stopped"
98
+ }
99
+ ]
100
+ },
101
+ {
102
+ "id": "plan_guidance",
103
+ "steps": [
104
+ {
105
+ "id": "write_plan_guidance",
106
+ "node": "project-guidance",
107
+ "params": {
108
+ "taskContextJsonFile": { "artifact": { "kind": "task-context-json-file", "taskKey": { "ref": "params.taskKey" }, "iteration": { "ref": "params.taskContextIteration" } } },
109
+ "phase": { "const": "plan" },
110
+ "outputJsonFile": { "artifact": { "kind": "project-guidance-plan-json-file", "taskKey": { "ref": "params.taskKey" }, "iteration": { "ref": "params.planIteration" } } },
111
+ "outputFile": { "artifact": { "kind": "project-guidance-plan-file", "taskKey": { "ref": "params.taskKey" }, "iteration": { "ref": "params.planIteration" } } },
112
+ "markdownLanguage": { "ref": "params.mdLang" }
113
+ }
114
+ }
115
+ ]
116
+ },
117
+ {
118
+ "id": "plan",
119
+ "steps": [
120
+ {
121
+ "id": "run_plan_flow",
122
+ "node": "flow-run",
123
+ "params": {
124
+ "fileName": { "const": "plan.json" },
125
+ "labelText": { "const": "Running planning flow" },
126
+ "taskKey": { "ref": "params.taskKey" },
127
+ "taskContextIteration": { "ref": "params.taskContextIteration" },
128
+ "designIteration": { "ref": "params.designIteration" },
129
+ "planIteration": { "ref": "params.planIteration" },
130
+ "qaIteration": { "ref": "params.qaIteration" },
131
+ "projectGuidanceFile": { "ref": "steps.plan_guidance.write_plan_guidance.value.outputFile" },
132
+ "projectGuidanceJsonFile": { "ref": "steps.plan_guidance.write_plan_guidance.value.outputJsonFile" },
133
+ "llmExecutor": { "ref": "params.llmExecutor" },
134
+ "llmModel": { "ref": "params.llmModel" },
135
+ "extraPrompt": { "ref": "params.extraPrompt" },
136
+ "mdLang": { "ref": "params.mdLang" }
137
+ }
138
+ }
139
+ ]
140
+ },
141
+ {
142
+ "id": "design_review_guidance",
143
+ "steps": [
144
+ {
145
+ "id": "write_design_review_guidance",
146
+ "node": "project-guidance",
147
+ "params": {
148
+ "taskContextJsonFile": { "artifact": { "kind": "task-context-json-file", "taskKey": { "ref": "params.taskKey" }, "iteration": { "ref": "params.taskContextIteration" } } },
149
+ "phase": { "const": "design-review" },
150
+ "outputJsonFile": { "artifact": { "kind": "project-guidance-design-review-json-file", "taskKey": { "ref": "params.taskKey" }, "iteration": { "ref": "params.planIteration" } } },
151
+ "outputFile": { "artifact": { "kind": "project-guidance-design-review-file", "taskKey": { "ref": "params.taskKey" }, "iteration": { "ref": "params.planIteration" } } },
152
+ "markdownLanguage": { "ref": "params.mdLang" }
153
+ }
154
+ }
155
+ ]
156
+ },
157
+ {
158
+ "id": "design_review_loop",
159
+ "steps": [
160
+ {
161
+ "id": "run_design_review_loop",
162
+ "node": "flow-run",
163
+ "params": {
164
+ "fileName": { "const": "design-review-loop.json" },
165
+ "labelText": { "const": "Running design-review loop" },
166
+ "taskKey": { "ref": "params.taskKey" },
167
+ "baseIteration": { "ref": "params.designReviewBaseIteration" },
168
+ "workspaceDir": { "ref": "params.workspaceDir" },
169
+ "extraPrompt": { "ref": "params.extraPrompt" },
170
+ "projectGuidanceFile": { "ref": "steps.design_review_guidance.write_design_review_guidance.value.outputFile" },
171
+ "projectGuidanceJsonFile": { "ref": "steps.design_review_guidance.write_design_review_guidance.value.outputJsonFile" },
172
+ "llmExecutor": { "ref": "params.llmExecutor" },
173
+ "llmModel": { "ref": "params.llmModel" }
174
+ },
175
+ "stopFlowIf": {
176
+ "equals": [
177
+ { "ref": "steps.design_review_loop.run_design_review_loop.value.executionState.terminationOutcome" },
178
+ { "const": "stopped" }
179
+ ]
180
+ },
181
+ "stopFlowOutcome": "stopped"
182
+ }
183
+ ]
184
+ },
185
+ {
186
+ "id": "implement_guidance",
187
+ "steps": [
188
+ {
189
+ "id": "write_implement_guidance",
190
+ "node": "project-guidance",
191
+ "params": {
192
+ "taskContextJsonFile": { "artifact": { "kind": "task-context-json-file", "taskKey": { "ref": "params.taskKey" }, "iteration": { "ref": "params.taskContextIteration" } } },
193
+ "phase": { "const": "implement" },
194
+ "outputJsonFile": { "artifact": { "kind": "project-guidance-implement-json-file", "taskKey": { "ref": "params.taskKey" }, "iteration": { "ref": "params.planIteration" } } },
195
+ "outputFile": { "artifact": { "kind": "project-guidance-implement-file", "taskKey": { "ref": "params.taskKey" }, "iteration": { "ref": "params.planIteration" } } },
196
+ "markdownLanguage": { "ref": "params.mdLang" }
197
+ }
198
+ }
199
+ ]
200
+ },
201
+ {
202
+ "id": "implement",
203
+ "steps": [
204
+ {
205
+ "id": "resolve_planning_bundle",
206
+ "node": "planning-bundle",
207
+ "params": { "taskKey": { "ref": "params.taskKey" } }
208
+ },
209
+ {
210
+ "id": "run_implement",
211
+ "node": "llm-prompt",
212
+ "routingGroup": "implementation",
213
+ "prompt": {
214
+ "templateRef": "implement",
215
+ "vars": {
216
+ "design_file": { "ref": "steps.implement.resolve_planning_bundle.value.designFile" },
217
+ "design_json_file": { "ref": "steps.implement.resolve_planning_bundle.value.designJsonFile" },
218
+ "plan_file": { "ref": "steps.implement.resolve_planning_bundle.value.planFile" },
219
+ "plan_json_file": { "ref": "steps.implement.resolve_planning_bundle.value.planJsonFile" },
220
+ "qa_file": { "ref": "steps.implement.resolve_planning_bundle.value.qaFile" },
221
+ "qa_json_file": { "ref": "steps.implement.resolve_planning_bundle.value.qaJsonFile" },
222
+ "project_guidance_file": { "ref": "steps.implement_guidance.write_implement_guidance.value.outputFile" },
223
+ "project_guidance_json_file": { "ref": "steps.implement_guidance.write_implement_guidance.value.outputJsonFile" }
224
+ },
225
+ "extraPrompt": { "ref": "params.extraPrompt" },
226
+ "format": "task-prompt"
227
+ },
228
+ "params": {
229
+ "labelText": { "const": "Running implementation mode locally" },
230
+ "model": { "ref": "params.llmModel" },
231
+ "executor": { "ref": "params.llmExecutor" }
232
+ }
233
+ },
234
+ {
235
+ "id": "notify_implement_complete",
236
+ "node": "telegram-notify",
237
+ "params": { "message": { "template": "Implementation phase for {taskKey} complete.", "vars": { "taskKey": { "ref": "params.taskKey" } } } }
238
+ }
239
+ ]
240
+ },
241
+ {
242
+ "id": "review_guidance",
243
+ "steps": [
244
+ {
245
+ "id": "write_review_guidance",
246
+ "node": "project-guidance",
247
+ "params": {
248
+ "taskContextJsonFile": { "artifact": { "kind": "task-context-json-file", "taskKey": { "ref": "params.taskKey" }, "iteration": { "ref": "params.taskContextIteration" } } },
249
+ "phase": { "const": "review" },
250
+ "outputJsonFile": { "artifact": { "kind": "project-guidance-review-json-file", "taskKey": { "ref": "params.taskKey" }, "iteration": { "ref": "params.planIteration" } } },
251
+ "outputFile": { "artifact": { "kind": "project-guidance-review-file", "taskKey": { "ref": "params.taskKey" }, "iteration": { "ref": "params.planIteration" } } },
252
+ "markdownLanguage": { "ref": "params.mdLang" }
253
+ }
254
+ }
255
+ ]
256
+ },
257
+ {
258
+ "id": "repair_guidance",
259
+ "steps": [
260
+ {
261
+ "id": "write_repair_guidance",
262
+ "node": "project-guidance",
263
+ "params": {
264
+ "taskContextJsonFile": { "artifact": { "kind": "task-context-json-file", "taskKey": { "ref": "params.taskKey" }, "iteration": { "ref": "params.taskContextIteration" } } },
265
+ "phase": { "const": "repair/review-fix" },
266
+ "outputJsonFile": { "artifact": { "kind": "project-guidance-repair-review-fix-json-file", "taskKey": { "ref": "params.taskKey" }, "iteration": { "ref": "params.planIteration" } } },
267
+ "outputFile": { "artifact": { "kind": "project-guidance-repair-review-fix-file", "taskKey": { "ref": "params.taskKey" }, "iteration": { "ref": "params.planIteration" } } },
268
+ "markdownLanguage": { "ref": "params.mdLang" }
269
+ }
270
+ }
271
+ ]
272
+ },
273
+ {
274
+ "id": "review-loop",
275
+ "steps": [
276
+ {
277
+ "id": "run_review_loop",
278
+ "node": "flow-run",
279
+ "stopFlowIf": {
280
+ "not": {
281
+ "equals": [
282
+ { "ref": "steps.review-loop.run_review_loop.value.executionState.terminationOutcome" },
283
+ { "const": "success" }
284
+ ]
285
+ }
286
+ },
287
+ "stopFlowOutcome": "stopped",
288
+ "params": {
289
+ "fileName": { "const": "review-loop.json" },
290
+ "labelText": { "const": "Running review-loop" },
291
+ "taskKey": { "ref": "params.taskKey" },
292
+ "baseIteration": { "ref": "params.baseIteration" },
293
+ "workspaceDir": { "ref": "params.workspaceDir" },
294
+ "extraPrompt": { "ref": "params.extraPrompt" },
295
+ "reviewFixPoints": { "ref": "params.reviewFixPoints" },
296
+ "reviewBlockingSeverities": { "ref": "params.reviewBlockingSeverities" },
297
+ "projectGuidanceFile": { "ref": "steps.review_guidance.write_review_guidance.value.outputFile" },
298
+ "projectGuidanceJsonFile": { "ref": "steps.review_guidance.write_review_guidance.value.outputJsonFile" },
299
+ "repairProjectGuidanceFile": { "ref": "steps.repair_guidance.write_repair_guidance.value.outputFile" },
300
+ "repairProjectGuidanceJsonFile": { "ref": "steps.repair_guidance.write_repair_guidance.value.outputJsonFile" },
301
+ "llmExecutor": { "ref": "params.llmExecutor" },
302
+ "llmModel": { "ref": "params.llmModel" }
303
+ }
304
+ },
305
+ {
306
+ "id": "notify_task_complete",
307
+ "node": "telegram-notify",
308
+ "params": { "message": { "template": "Task {taskKey} complete.", "vars": { "taskKey": { "ref": "params.taskKey" } } } }
309
+ }
310
+ ]
311
+ }
312
+ ]
313
+ }
@@ -106,7 +106,9 @@
106
106
  "plan_file": { "ref": "steps.implement.resolve_planning_bundle.value.planFile" },
107
107
  "plan_json_file": { "ref": "steps.implement.resolve_planning_bundle.value.planJsonFile" },
108
108
  "qa_file": { "ref": "steps.implement.resolve_planning_bundle.value.qaFile" },
109
- "qa_json_file": { "ref": "steps.implement.resolve_planning_bundle.value.qaJsonFile" }
109
+ "qa_json_file": { "ref": "steps.implement.resolve_planning_bundle.value.qaJsonFile" },
110
+ "project_guidance_file": { "const": "not provided" },
111
+ "project_guidance_json_file": { "const": "not provided" }
110
112
  },
111
113
  "extraPrompt": { "ref": "params.extraPrompt" },
112
114
  "format": "task-prompt"
@@ -31,6 +31,8 @@
31
31
  },
32
32
  "workspaceDir": { "ref": "params.workspaceDir" },
33
33
  "extraPrompt": { "ref": "params.extraPrompt" },
34
+ "projectGuidanceFile": { "ref": "params.projectGuidanceFile" },
35
+ "projectGuidanceJsonFile": { "ref": "params.projectGuidanceJsonFile" },
34
36
  "llmExecutor": { "ref": "params.llmExecutor" },
35
37
  "llmModel": { "ref": "params.llmModel" }
36
38
  }
@@ -134,6 +134,8 @@
134
134
  "plan_json_file": { "ref": "params.planJsonFile" },
135
135
  "qa_file": { "ref": "params.qaFile" },
136
136
  "qa_json_file": { "ref": "params.qaJsonFile" },
137
+ "project_guidance_file": { "ref": "params.projectGuidanceFile" },
138
+ "project_guidance_json_file": { "ref": "params.projectGuidanceJsonFile" },
137
139
  "review_file": {
138
140
  "artifact": {
139
141
  "kind": "design-review-file",
@@ -54,7 +54,9 @@
54
54
  "taskKey": { "ref": "params.taskKey" },
55
55
  "iteration": { "ref": "params.planningIteration" }
56
56
  }
57
- }
57
+ },
58
+ "project_guidance_file": { "ref": "params.projectGuidanceFile" },
59
+ "project_guidance_json_file": { "ref": "params.projectGuidanceJsonFile" }
58
60
  },
59
61
  "extraPrompt": { "ref": "params.extraPrompt" },
60
62
  "format": "task-prompt"
@@ -65,6 +65,8 @@
65
65
  "iteration": { "ref": "params.taskContextIteration" }
66
66
  }
67
67
  },
68
+ "project_guidance_file": { "ref": "params.projectGuidanceFile" },
69
+ "project_guidance_json_file": { "ref": "params.projectGuidanceJsonFile" },
68
70
  "planning_questions_json_file": {
69
71
  "artifact": {
70
72
  "kind": "planning-questions-json-file",
@@ -203,6 +205,8 @@
203
205
  "taskKey": { "ref": "params.taskKey" }
204
206
  }
205
207
  },
208
+ "project_guidance_file": { "ref": "params.projectGuidanceFile" },
209
+ "project_guidance_json_file": { "ref": "params.projectGuidanceJsonFile" },
206
210
  "design_file": {
207
211
  "artifact": {
208
212
  "kind": "design-file",
@@ -0,0 +1,199 @@
1
+ {
2
+ "kind": "playbook-init-flow",
3
+ "version": 1,
4
+ "description": "Initializes an evidence-backed project playbook from deterministic repository inventory, candidate practices, targeted questions, structured answers, a draft, and a guarded final write.",
5
+ "phases": [
6
+ {
7
+ "id": "playbook_init",
8
+ "steps": [
9
+ {
10
+ "id": "repo_inventory",
11
+ "node": "playbook-inventory",
12
+ "params": {
13
+ "outputJsonFile": { "artifact": { "kind": "repo-inventory-json-file", "taskKey": { "ref": "params.taskKey" } } },
14
+ "outputFile": { "artifact": { "kind": "repo-inventory-file", "taskKey": { "ref": "params.taskKey" } } }
15
+ },
16
+ "expect": [
17
+ {
18
+ "kind": "require-structured-artifacts",
19
+ "items": [
20
+ { "path": { "artifact": { "kind": "repo-inventory-json-file", "taskKey": { "ref": "params.taskKey" } } }, "schemaId": "repo-inventory/v1" }
21
+ ],
22
+ "message": "Playbook initialization requires a valid deterministic repository inventory."
23
+ }
24
+ ]
25
+ },
26
+ {
27
+ "id": "practice_candidates",
28
+ "node": "llm-prompt",
29
+ "routingGroup": "planning",
30
+ "prompt": {
31
+ "templateRef": "playbook-practice-candidates",
32
+ "vars": {
33
+ "repo_inventory_json_file": { "artifact": { "kind": "repo-inventory-json-file", "taskKey": { "ref": "params.taskKey" } } },
34
+ "practice_candidates_json_file": { "artifact": { "kind": "practice-candidates-json-file", "taskKey": { "ref": "params.taskKey" } } },
35
+ "practice_candidates_file": { "artifact": { "kind": "practice-candidates-file", "taskKey": { "ref": "params.taskKey" } } }
36
+ },
37
+ "extraPrompt": { "ref": "params.extraPrompt" },
38
+ "format": "task-prompt"
39
+ },
40
+ "params": {
41
+ "labelText": { "const": "Generating evidence-backed practice candidates" },
42
+ "model": { "ref": "params.llmModel" },
43
+ "executor": { "ref": "params.llmExecutor" },
44
+ "requiredArtifacts": {
45
+ "list": [
46
+ { "artifact": { "kind": "practice-candidates-json-file", "taskKey": { "ref": "params.taskKey" } } },
47
+ { "artifact": { "kind": "practice-candidates-file", "taskKey": { "ref": "params.taskKey" } } }
48
+ ]
49
+ }
50
+ },
51
+ "expect": [
52
+ {
53
+ "kind": "require-structured-artifacts",
54
+ "when": { "not": { "ref": "context.dryRun" } },
55
+ "items": [
56
+ { "path": { "artifact": { "kind": "practice-candidates-json-file", "taskKey": { "ref": "params.taskKey" } } }, "schemaId": "practice-candidates/v1" }
57
+ ],
58
+ "message": "Practice candidate generation produced invalid structured artifacts."
59
+ }
60
+ ]
61
+ },
62
+ {
63
+ "id": "clarification_questions",
64
+ "node": "llm-prompt",
65
+ "routingGroup": "planning",
66
+ "prompt": {
67
+ "templateRef": "playbook-questions",
68
+ "vars": {
69
+ "repo_inventory_json_file": { "artifact": { "kind": "repo-inventory-json-file", "taskKey": { "ref": "params.taskKey" } } },
70
+ "practice_candidates_json_file": { "artifact": { "kind": "practice-candidates-json-file", "taskKey": { "ref": "params.taskKey" } } },
71
+ "playbook_questions_json_file": { "artifact": { "kind": "playbook-questions-json-file", "taskKey": { "ref": "params.taskKey" } } }
72
+ },
73
+ "extraPrompt": { "ref": "params.extraPrompt" },
74
+ "format": "task-prompt"
75
+ },
76
+ "params": {
77
+ "labelText": { "const": "Generating targeted playbook questions" },
78
+ "model": { "ref": "params.llmModel" },
79
+ "executor": { "ref": "params.llmExecutor" },
80
+ "requiredArtifacts": {
81
+ "list": [
82
+ { "artifact": { "kind": "playbook-questions-json-file", "taskKey": { "ref": "params.taskKey" } } }
83
+ ]
84
+ }
85
+ },
86
+ "expect": [
87
+ {
88
+ "kind": "require-structured-artifacts",
89
+ "when": { "not": { "ref": "context.dryRun" } },
90
+ "items": [
91
+ { "path": { "artifact": { "kind": "playbook-questions-json-file", "taskKey": { "ref": "params.taskKey" } } }, "schemaId": "playbook-questions/v1" }
92
+ ],
93
+ "message": "Playbook question generation produced invalid structured artifacts."
94
+ }
95
+ ]
96
+ },
97
+ {
98
+ "id": "user_answers",
99
+ "node": "playbook-questions-form",
100
+ "params": {
101
+ "questionsJsonFile": { "artifact": { "kind": "playbook-questions-json-file", "taskKey": { "ref": "params.taskKey" } } },
102
+ "answersJsonFile": { "artifact": { "kind": "playbook-answers-json-file", "taskKey": { "ref": "params.taskKey" } } },
103
+ "formId": { "const": "playbook-clarifications" },
104
+ "title": { "const": "Playbook Clarifications" },
105
+ "mode": { "const": "clarifications" },
106
+ "acceptDraft": { "ref": "params.acceptPlaybookDraft" }
107
+ },
108
+ "expect": [
109
+ {
110
+ "kind": "require-structured-artifacts",
111
+ "items": [
112
+ { "path": { "artifact": { "kind": "playbook-answers-json-file", "taskKey": { "ref": "params.taskKey" } } }, "schemaId": "playbook-answers/v1" }
113
+ ],
114
+ "message": "Playbook answers are missing or invalid."
115
+ }
116
+ ]
117
+ },
118
+ {
119
+ "id": "playbook_draft",
120
+ "node": "llm-prompt",
121
+ "routingGroup": "planning",
122
+ "prompt": {
123
+ "templateRef": "playbook-draft",
124
+ "vars": {
125
+ "repo_inventory_json_file": { "artifact": { "kind": "repo-inventory-json-file", "taskKey": { "ref": "params.taskKey" } } },
126
+ "practice_candidates_json_file": { "artifact": { "kind": "practice-candidates-json-file", "taskKey": { "ref": "params.taskKey" } } },
127
+ "playbook_questions_json_file": { "artifact": { "kind": "playbook-questions-json-file", "taskKey": { "ref": "params.taskKey" } } },
128
+ "playbook_answers_json_file": { "artifact": { "kind": "playbook-answers-json-file", "taskKey": { "ref": "params.taskKey" } } },
129
+ "playbook_draft_json_file": { "artifact": { "kind": "playbook-draft-json-file", "taskKey": { "ref": "params.taskKey" } } },
130
+ "playbook_draft_file": { "artifact": { "kind": "playbook-draft-file", "taskKey": { "ref": "params.taskKey" } } }
131
+ },
132
+ "extraPrompt": { "ref": "params.extraPrompt" },
133
+ "format": "task-prompt"
134
+ },
135
+ "params": {
136
+ "labelText": { "const": "Generating playbook draft" },
137
+ "model": { "ref": "params.llmModel" },
138
+ "executor": { "ref": "params.llmExecutor" },
139
+ "requiredArtifacts": {
140
+ "list": [
141
+ { "artifact": { "kind": "playbook-draft-json-file", "taskKey": { "ref": "params.taskKey" } } },
142
+ { "artifact": { "kind": "playbook-draft-file", "taskKey": { "ref": "params.taskKey" } } }
143
+ ]
144
+ }
145
+ },
146
+ "expect": [
147
+ {
148
+ "kind": "require-structured-artifacts",
149
+ "when": { "not": { "ref": "context.dryRun" } },
150
+ "items": [
151
+ { "path": { "artifact": { "kind": "playbook-draft-json-file", "taskKey": { "ref": "params.taskKey" } } }, "schemaId": "playbook-draft/v1" }
152
+ ],
153
+ "message": "Playbook draft generation produced invalid structured artifacts."
154
+ }
155
+ ]
156
+ },
157
+ {
158
+ "id": "acceptance_confirmation",
159
+ "node": "playbook-questions-form",
160
+ "params": {
161
+ "questionsJsonFile": { "artifact": { "kind": "playbook-questions-json-file", "taskKey": { "ref": "params.taskKey" } } },
162
+ "answersJsonFile": { "artifact": { "kind": "playbook-answers-json-file", "taskKey": { "ref": "params.taskKey" } } },
163
+ "formId": { "const": "playbook-final-acceptance" },
164
+ "title": { "const": "Playbook Final Acceptance" },
165
+ "mode": { "const": "acceptance" },
166
+ "acceptDraft": { "ref": "params.acceptPlaybookDraft" }
167
+ },
168
+ "expect": [
169
+ {
170
+ "kind": "require-structured-artifacts",
171
+ "items": [
172
+ { "path": { "artifact": { "kind": "playbook-answers-json-file", "taskKey": { "ref": "params.taskKey" } } }, "schemaId": "playbook-answers/v1" }
173
+ ],
174
+ "message": "Playbook final acceptance is missing or invalid."
175
+ }
176
+ ]
177
+ },
178
+ {
179
+ "id": "write_playbook",
180
+ "node": "playbook-write",
181
+ "params": {
182
+ "draftJsonFile": { "artifact": { "kind": "playbook-draft-json-file", "taskKey": { "ref": "params.taskKey" } } },
183
+ "answersJsonFile": { "artifact": { "kind": "playbook-answers-json-file", "taskKey": { "ref": "params.taskKey" } } },
184
+ "writeResultJsonFile": { "artifact": { "kind": "playbook-write-result-json-file", "taskKey": { "ref": "params.taskKey" } } }
185
+ },
186
+ "expect": [
187
+ {
188
+ "kind": "require-structured-artifacts",
189
+ "items": [
190
+ { "path": { "artifact": { "kind": "playbook-write-result-json-file", "taskKey": { "ref": "params.taskKey" } } }, "schemaId": "playbook-write-result/v1" }
191
+ ],
192
+ "message": "Playbook write result is missing or invalid."
193
+ }
194
+ ]
195
+ }
196
+ ]
197
+ }
198
+ ]
199
+ }
@@ -147,7 +147,9 @@
147
147
  "taskKey": { "ref": "params.taskKey" },
148
148
  "iteration": { "ref": "params.latestIteration" }
149
149
  }
150
- }
150
+ },
151
+ "project_guidance_file": { "ref": "params.projectGuidanceFile" },
152
+ "project_guidance_json_file": { "ref": "params.projectGuidanceJsonFile" }
151
153
  },
152
154
  "extraPrompt": {
153
155
  "appendPrompt": {
@@ -38,6 +38,8 @@
38
38
  "taskKey": { "ref": "params.taskKey" },
39
39
  "iteration": { "ref": "params.baseIteration" },
40
40
  "extraPrompt": { "ref": "params.extraPrompt" },
41
+ "projectGuidanceFile": { "ref": "params.projectGuidanceFile" },
42
+ "projectGuidanceJsonFile": { "ref": "params.projectGuidanceJsonFile" },
41
43
  "reviewBlockingSeverities": { "ref": "params.reviewBlockingSeverities" },
42
44
  "llmModel": { "ref": "params.llmModel" },
43
45
  "llmExecutor": { "ref": "params.llmExecutor" }
@@ -164,6 +166,8 @@
164
166
  },
165
167
  "reviewFixPoints": { "ref": "params.reviewFixPoints" },
166
168
  "reviewBlockingSeverities": { "ref": "params.reviewBlockingSeverities" },
169
+ "projectGuidanceFile": { "ref": "params.repairProjectGuidanceFile" },
170
+ "projectGuidanceJsonFile": { "ref": "params.repairProjectGuidanceJsonFile" },
167
171
  "extraPrompt": {
168
172
  "appendPrompt": {
169
173
  "base": { "ref": "params.extraPrompt" },