agentweaver 0.1.15 → 0.1.17

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 (110) hide show
  1. package/README.md +76 -19
  2. package/dist/artifact-manifest.js +219 -0
  3. package/dist/artifacts.js +88 -3
  4. package/dist/doctor/checks/env-diagnostics.js +25 -0
  5. package/dist/doctor/checks/executors.js +2 -2
  6. package/dist/doctor/checks/flow-readiness.js +15 -18
  7. package/dist/flow-state.js +212 -15
  8. package/dist/index.js +539 -209
  9. package/dist/interactive/blessed-session.js +361 -0
  10. package/dist/interactive/controller.js +1326 -0
  11. package/dist/interactive/create-interactive-session.js +5 -0
  12. package/dist/interactive/ink/index.js +597 -0
  13. package/dist/interactive/progress.js +245 -0
  14. package/dist/interactive/selectors.js +14 -0
  15. package/dist/interactive/session.js +1 -0
  16. package/dist/interactive/state.js +34 -0
  17. package/dist/interactive/tree.js +155 -0
  18. package/dist/interactive/types.js +1 -0
  19. package/dist/interactive/view-model.js +1 -0
  20. package/dist/interactive-ui.js +159 -194
  21. package/dist/pipeline/auto-flow.js +9 -6
  22. package/dist/pipeline/context.js +7 -5
  23. package/dist/pipeline/declarative-flow-runner.js +212 -6
  24. package/dist/pipeline/declarative-flows.js +63 -17
  25. package/dist/pipeline/execution-routing-config.js +15 -0
  26. package/dist/pipeline/flow-catalog.js +50 -12
  27. package/dist/pipeline/flow-run-resume.js +29 -0
  28. package/dist/pipeline/flow-specs/auto-common.json +90 -360
  29. package/dist/pipeline/flow-specs/auto-golang.json +81 -360
  30. package/dist/pipeline/flow-specs/auto-simple.json +141 -0
  31. package/dist/pipeline/flow-specs/bugz/bug-analyze.json +2 -0
  32. package/dist/pipeline/flow-specs/bugz/bug-fix.json +1 -0
  33. package/dist/pipeline/flow-specs/design-review/design-review-loop.json +316 -0
  34. package/dist/pipeline/flow-specs/design-review.json +10 -0
  35. package/dist/pipeline/flow-specs/gitlab/gitlab-diff-review.json +11 -0
  36. package/dist/pipeline/flow-specs/gitlab/gitlab-review.json +2 -0
  37. package/dist/pipeline/flow-specs/gitlab/mr-description.json +1 -0
  38. package/dist/pipeline/flow-specs/go/run-go-linter-loop.json +2 -0
  39. package/dist/pipeline/flow-specs/go/run-go-tests-loop.json +2 -0
  40. package/dist/pipeline/flow-specs/implement.json +13 -6
  41. package/dist/pipeline/flow-specs/instant-task.json +177 -0
  42. package/dist/pipeline/flow-specs/normalize-task-source.json +311 -0
  43. package/dist/pipeline/flow-specs/plan-revise.json +7 -1
  44. package/dist/pipeline/flow-specs/plan.json +51 -71
  45. package/dist/pipeline/flow-specs/review/review-fix.json +24 -4
  46. package/dist/pipeline/flow-specs/review/review-loop.json +351 -45
  47. package/dist/pipeline/flow-specs/review/review-project-loop.json +590 -0
  48. package/dist/pipeline/flow-specs/review/review-project.json +12 -0
  49. package/dist/pipeline/flow-specs/review/review.json +37 -31
  50. package/dist/pipeline/flow-specs/task-describe.json +2 -0
  51. package/dist/pipeline/flow-specs/task-source/jira-fetch.json +70 -0
  52. package/dist/pipeline/flow-specs/task-source/manual-input.json +216 -0
  53. package/dist/pipeline/launch-profile-config.js +30 -18
  54. package/dist/pipeline/node-contract.js +1 -0
  55. package/dist/pipeline/node-registry.js +115 -6
  56. package/dist/pipeline/node-runner.js +3 -2
  57. package/dist/pipeline/nodes/build-review-fix-prompt-node.js +5 -1
  58. package/dist/pipeline/nodes/clear-ready-to-merge-node.js +11 -0
  59. package/dist/pipeline/nodes/commit-message-form-node.js +8 -0
  60. package/dist/pipeline/nodes/design-review-verdict-node.js +36 -0
  61. package/dist/pipeline/nodes/ensure-summary-json-node.js +13 -2
  62. package/dist/pipeline/nodes/fetch-gitlab-diff-node.js +19 -2
  63. package/dist/pipeline/nodes/fetch-gitlab-review-node.js +19 -2
  64. package/dist/pipeline/nodes/flow-run-node.js +242 -8
  65. package/dist/pipeline/nodes/git-commit-form-node.js +8 -0
  66. package/dist/pipeline/nodes/gitlab-review-artifacts-node.js +19 -2
  67. package/dist/pipeline/nodes/jira-fetch-node.js +50 -4
  68. package/dist/pipeline/nodes/llm-prompt-node.js +38 -36
  69. package/dist/pipeline/nodes/planning-bundle-node.js +10 -0
  70. package/dist/pipeline/nodes/review-verdict-node.js +86 -0
  71. package/dist/pipeline/nodes/select-files-form-node.js +8 -0
  72. package/dist/pipeline/nodes/structured-summary-node.js +24 -0
  73. package/dist/pipeline/nodes/user-input-node.js +38 -3
  74. package/dist/pipeline/nodes/write-selection-file-node.js +20 -4
  75. package/dist/pipeline/plugin-loader.js +389 -0
  76. package/dist/pipeline/plugin-types.js +1 -0
  77. package/dist/pipeline/prompt-registry.js +3 -1
  78. package/dist/pipeline/prompt-runtime.js +4 -1
  79. package/dist/pipeline/registry.js +71 -4
  80. package/dist/pipeline/review-iteration.js +26 -0
  81. package/dist/pipeline/spec-compiler.js +3 -0
  82. package/dist/pipeline/spec-loader.js +14 -0
  83. package/dist/pipeline/spec-types.js +3 -0
  84. package/dist/pipeline/spec-validator.js +20 -0
  85. package/dist/pipeline/value-resolver.js +76 -2
  86. package/dist/plugin-sdk.js +1 -0
  87. package/dist/prompts.js +36 -14
  88. package/dist/review-severity.js +45 -0
  89. package/dist/runtime/artifact-registry.js +405 -0
  90. package/dist/runtime/design-review-input-contract.js +17 -16
  91. package/dist/runtime/env-loader.js +3 -0
  92. package/dist/runtime/execution-routing-store.js +134 -0
  93. package/dist/runtime/execution-routing.js +233 -0
  94. package/dist/runtime/interactive-execution-routing.js +471 -0
  95. package/dist/runtime/plan-revise-input-contract.js +35 -32
  96. package/dist/runtime/planning-bundle.js +123 -0
  97. package/dist/runtime/ready-to-merge.js +22 -1
  98. package/dist/runtime/review-input-contract.js +100 -0
  99. package/dist/structured-artifact-schema-registry.js +9 -0
  100. package/dist/structured-artifact-schemas.json +140 -1
  101. package/dist/structured-artifacts.js +77 -6
  102. package/dist/user-input.js +70 -3
  103. package/docs/example/.flows/examples/claude-example.json +50 -0
  104. package/docs/example/.plugins/claude-example-plugin/index.js +149 -0
  105. package/docs/example/.plugins/claude-example-plugin/plugin.json +8 -0
  106. package/docs/examples/.flows/claude-example.json +50 -0
  107. package/docs/examples/.plugins/claude-example-plugin/index.js +149 -0
  108. package/docs/examples/.plugins/claude-example-plugin/plugin.json +8 -0
  109. package/docs/plugin-sdk.md +731 -0
  110. package/package.json +11 -4
@@ -1,11 +1,26 @@
1
1
  {
2
2
  "kind": "review-loop-flow",
3
3
  "version": 1,
4
- "description": "Iteratively runs review → review-fix cycles up to 5 times. Stops early when ready-to-merge is achieved. Each iteration auto-selects blockers and critical findings for fixing.",
4
+ "description": "Iteratively runs review → review-fix cycles up to 5 times. Stops early when ready-to-merge is achieved. Each iteration auto-selects the configured blocking severities for fixing. After iteration 5, runs a terminal verification review to confirm the post-fix state.",
5
5
  "constants": {
6
- "autoReviewFixExtraPrompt": "Fix only blockers and criticals. Skip minor and warning severity."
6
+ "autoReviewFixExtraPrompt": "Fix only configured blocking severities."
7
7
  },
8
8
  "phases": [
9
+ {
10
+ "id": "entry_cleanup",
11
+ "steps": [
12
+ {
13
+ "id": "clear_stale_ready_to_merge",
14
+ "node": "clear-ready-to-merge",
15
+ "when": {
16
+ "not": { "ref": "context.dryRun" }
17
+ },
18
+ "params": {
19
+ "taskKey": { "ref": "params.taskKey" }
20
+ }
21
+ }
22
+ ]
23
+ },
9
24
  {
10
25
  "id": "review_iteration_1",
11
26
  "steps": [
@@ -14,22 +29,48 @@
14
29
  "node": "flow-run",
15
30
  "params": {
16
31
  "fileName": { "const": "review.json" },
17
- "labelText": { "const": "Running review (iteration 1)" },
32
+ "labelText": {
33
+ "template": "Running review (iteration {iteration})",
34
+ "vars": {
35
+ "iteration": { "ref": "params.baseIteration" }
36
+ }
37
+ },
18
38
  "taskKey": { "ref": "params.taskKey" },
19
- "iteration": { "const": 1 },
39
+ "iteration": { "ref": "params.baseIteration" },
20
40
  "extraPrompt": { "ref": "params.extraPrompt" },
41
+ "reviewBlockingSeverities": { "ref": "params.reviewBlockingSeverities" },
21
42
  "llmModel": { "ref": "params.llmModel" },
22
43
  "llmExecutor": { "ref": "params.llmExecutor" }
23
44
  }
24
45
  },
46
+ {
47
+ "id": "load_review_summary",
48
+ "node": "structured-summary",
49
+ "when": {
50
+ "not": { "ref": "context.dryRun" }
51
+ },
52
+ "params": {
53
+ "path": {
54
+ "artifact": {
55
+ "kind": "review-json-file",
56
+ "taskKey": { "ref": "params.taskKey" },
57
+ "iteration": { "ref": "params.baseIteration" }
58
+ }
59
+ }
60
+ }
61
+ },
25
62
  {
26
63
  "id": "notify_review_complete",
27
64
  "node": "telegram-notify",
65
+ "when": {
66
+ "not": { "ref": "context.dryRun" }
67
+ },
28
68
  "params": {
29
69
  "message": {
30
- "template": "Review for {taskKey} complete.",
70
+ "template": "Review iteration {iteration}: {summary}",
31
71
  "vars": {
32
- "taskKey": { "ref": "params.taskKey" }
72
+ "iteration": { "ref": "params.baseIteration" },
73
+ "summary": { "ref": "steps.review_iteration_1.load_review_summary.value.summary" }
33
74
  }
34
75
  }
35
76
  }
@@ -37,6 +78,9 @@
37
78
  {
38
79
  "id": "check_ready_to_merge",
39
80
  "node": "file-check",
81
+ "when": {
82
+ "not": { "ref": "context.dryRun" }
83
+ },
40
84
  "params": {
41
85
  "path": {
42
86
  "artifact": {
@@ -59,9 +103,12 @@
59
103
  "id": "write_auto_selection",
60
104
  "node": "write-selection-file",
61
105
  "when": {
62
- "equals": [
63
- { "ref": "steps.review_iteration_1.check_ready_to_merge.value.exists" },
64
- { "const": false }
106
+ "all": [
107
+ { "not": { "ref": "context.dryRun" } },
108
+ { "equals": [
109
+ { "ref": "steps.review_iteration_1.check_ready_to_merge.value.exists" },
110
+ { "const": false }
111
+ ]}
65
112
  ]
66
113
  },
67
114
  "params": {
@@ -70,63 +117,103 @@
70
117
  "vars": {
71
118
  "workspace": { "ref": "params.workspaceDir" },
72
119
  "taskKey": { "ref": "params.taskKey" },
73
- "iteration": { "const": 1 }
120
+ "iteration": { "ref": "params.baseIteration" }
74
121
  }
75
122
  },
76
123
  "reviewFindingsJsonFile": {
77
124
  "artifact": {
78
125
  "kind": "review-json-file",
79
126
  "taskKey": { "ref": "params.taskKey" },
80
- "iteration": { "const": 1 }
127
+ "iteration": { "ref": "params.baseIteration" }
81
128
  }
82
129
  },
83
- "selectionMode": { "const": "auto-blockers-criticals" }
130
+ "selectionMode": { "const": "auto-blocking-severities" },
131
+ "blockingSeverities": { "ref": "params.reviewBlockingSeverities" }
84
132
  }
85
133
  },
86
134
  {
87
135
  "id": "run_review_fix",
88
136
  "node": "flow-run",
89
137
  "when": {
90
- "equals": [
91
- { "ref": "steps.review_iteration_1.check_ready_to_merge.value.exists" },
92
- { "const": false }
138
+ "all": [
139
+ { "not": { "ref": "context.dryRun" } },
140
+ { "equals": [
141
+ { "ref": "steps.review_iteration_1.check_ready_to_merge.value.exists" },
142
+ { "const": false }
143
+ ]}
93
144
  ]
94
145
  },
95
146
  "params": {
96
147
  "fileName": { "const": "review-fix.json" },
97
148
  "labelText": {
98
- "template": "Running review-fix (iteration 1)"
149
+ "template": "Running review-fix (iteration {iteration})",
150
+ "vars": {
151
+ "iteration": { "ref": "params.baseIteration" }
152
+ }
99
153
  },
100
154
  "taskKey": { "ref": "params.taskKey" },
101
- "latestIteration": { "const": 1 },
155
+ "latestIteration": { "ref": "params.baseIteration" },
102
156
  "reviewAssessmentJsonFile": { "const": null },
103
157
  "reviewFixSelectionJsonFile": {
104
158
  "template": "{workspace}/review-fix-selection-{taskKey}-iter-{iteration}.json",
105
159
  "vars": {
106
160
  "workspace": { "ref": "params.workspaceDir" },
107
161
  "taskKey": { "ref": "params.taskKey" },
108
- "iteration": { "const": 1 }
162
+ "iteration": { "ref": "params.baseIteration" }
109
163
  }
110
164
  },
111
165
  "reviewFixPoints": { "ref": "params.reviewFixPoints" },
166
+ "reviewBlockingSeverities": { "ref": "params.reviewBlockingSeverities" },
112
167
  "extraPrompt": {
113
168
  "appendPrompt": {
114
169
  "base": { "ref": "params.extraPrompt" },
115
- "suffix": { "const": "Fix only blockers and criticals." }
170
+ "suffix": { "const": "Fix only configured blocking severities." }
116
171
  }
117
172
  },
118
173
  "llmModel": { "ref": "params.llmModel" },
119
174
  "llmExecutor": { "ref": "params.llmExecutor" }
120
175
  }
121
176
  },
177
+ {
178
+ "id": "load_review_fix_summary",
179
+ "node": "structured-summary",
180
+ "when": {
181
+ "all": [
182
+ { "not": { "ref": "context.dryRun" } },
183
+ { "equals": [
184
+ { "ref": "steps.review_iteration_1.check_ready_to_merge.value.exists" },
185
+ { "const": false }
186
+ ]}
187
+ ]
188
+ },
189
+ "params": {
190
+ "path": {
191
+ "artifact": {
192
+ "kind": "review-fix-json-file",
193
+ "taskKey": { "ref": "params.taskKey" },
194
+ "iteration": { "ref": "params.baseIteration" }
195
+ }
196
+ }
197
+ }
198
+ },
122
199
  {
123
200
  "id": "notify_review_fix_complete",
124
201
  "node": "telegram-notify",
202
+ "when": {
203
+ "all": [
204
+ { "not": { "ref": "context.dryRun" } },
205
+ { "equals": [
206
+ { "ref": "steps.review_iteration_1.check_ready_to_merge.value.exists" },
207
+ { "const": false }
208
+ ]}
209
+ ]
210
+ },
125
211
  "params": {
126
212
  "message": {
127
- "template": "Review fix for {taskKey} complete.",
213
+ "template": "Review fix iteration {iteration}: {summary}",
128
214
  "vars": {
129
- "taskKey": { "ref": "params.taskKey" }
215
+ "iteration": { "ref": "params.baseIteration" },
216
+ "summary": { "ref": "steps.review_iteration_1.load_review_fix_summary.value.summary" }
130
217
  }
131
218
  }
132
219
  }
@@ -149,24 +236,71 @@
149
236
  "params": {
150
237
  "fileName": { "const": "review.json" },
151
238
  "labelText": {
152
- "template": "Running review (iteration ${iteration})"
239
+ "template": "Running review (iteration {iteration})",
240
+ "vars": {
241
+ "iteration": {
242
+ "add": [
243
+ { "ref": "params.baseIteration" },
244
+ { "ref": "repeat.iteration" },
245
+ { "const": -1 }
246
+ ]
247
+ }
248
+ }
153
249
  },
154
250
  "taskKey": { "ref": "params.taskKey" },
155
- "iteration": { "ref": "repeat.iteration" },
251
+ "iteration": {
252
+ "add": [
253
+ { "ref": "params.baseIteration" },
254
+ { "ref": "repeat.iteration" },
255
+ { "const": -1 }
256
+ ]
257
+ },
156
258
  "extraPrompt": { "ref": "params.extraPrompt" },
259
+ "reviewBlockingSeverities": { "ref": "params.reviewBlockingSeverities" },
157
260
  "llmModel": { "ref": "params.llmModel" },
158
261
  "llmExecutor": { "ref": "params.llmExecutor" }
159
262
  }
160
263
  },
264
+ {
265
+ "id": "load_review_summary",
266
+ "node": "structured-summary",
267
+ "when": {
268
+ "not": { "ref": "context.dryRun" }
269
+ },
270
+ "params": {
271
+ "path": {
272
+ "artifact": {
273
+ "kind": "review-json-file",
274
+ "taskKey": { "ref": "params.taskKey" },
275
+ "iteration": {
276
+ "add": [
277
+ { "ref": "params.baseIteration" },
278
+ { "ref": "repeat.iteration" },
279
+ { "const": -1 }
280
+ ]
281
+ }
282
+ }
283
+ }
284
+ }
285
+ },
161
286
  {
162
287
  "id": "notify_review_complete",
163
288
  "node": "telegram-notify",
289
+ "when": {
290
+ "not": { "ref": "context.dryRun" }
291
+ },
164
292
  "params": {
165
293
  "message": {
166
- "template": "Review iteration ${iteration} for {taskKey} complete.",
294
+ "template": "Review iteration {iteration}: {summary}",
167
295
  "vars": {
168
- "taskKey": { "ref": "params.taskKey" },
169
- "iteration": { "ref": "repeat.iteration" }
296
+ "summary": { "ref": "steps.review_iteration_${iteration}.load_review_summary.value.summary" },
297
+ "iteration": {
298
+ "add": [
299
+ { "ref": "params.baseIteration" },
300
+ { "ref": "repeat.iteration" },
301
+ { "const": -1 }
302
+ ]
303
+ }
170
304
  }
171
305
  }
172
306
  }
@@ -174,6 +308,9 @@
174
308
  {
175
309
  "id": "check_ready_to_merge",
176
310
  "node": "file-check",
311
+ "when": {
312
+ "not": { "ref": "context.dryRun" }
313
+ },
177
314
  "params": {
178
315
  "path": {
179
316
  "artifact": {
@@ -196,9 +333,12 @@
196
333
  "id": "write_auto_selection",
197
334
  "node": "write-selection-file",
198
335
  "when": {
199
- "equals": [
200
- { "ref": "steps.review_iteration_${iteration}.check_ready_to_merge.value.exists" },
201
- { "const": false }
336
+ "all": [
337
+ { "not": { "ref": "context.dryRun" } },
338
+ { "equals": [
339
+ { "ref": "steps.review_iteration_${iteration}.check_ready_to_merge.value.exists" },
340
+ { "const": false }
341
+ ]}
202
342
  ]
203
343
  },
204
344
  "params": {
@@ -207,70 +347,145 @@
207
347
  "vars": {
208
348
  "workspace": { "ref": "params.workspaceDir" },
209
349
  "taskKey": { "ref": "params.taskKey" },
210
- "iteration": { "ref": "repeat.iteration" }
350
+ "iteration": {
351
+ "add": [
352
+ { "ref": "params.baseIteration" },
353
+ { "ref": "repeat.iteration" },
354
+ { "const": -1 }
355
+ ]
356
+ }
211
357
  }
212
358
  },
213
359
  "reviewFindingsJsonFile": {
214
360
  "artifact": {
215
361
  "kind": "review-json-file",
216
362
  "taskKey": { "ref": "params.taskKey" },
217
- "iteration": { "ref": "repeat.iteration" }
363
+ "iteration": {
364
+ "add": [
365
+ { "ref": "params.baseIteration" },
366
+ { "ref": "repeat.iteration" },
367
+ { "const": -1 }
368
+ ]
369
+ }
218
370
  }
219
371
  },
220
- "selectionMode": { "const": "auto-blockers-criticals" }
372
+ "selectionMode": { "const": "auto-blocking-severities" },
373
+ "blockingSeverities": { "ref": "params.reviewBlockingSeverities" }
221
374
  }
222
375
  },
223
376
  {
224
377
  "id": "run_review_fix",
225
378
  "when": {
226
- "equals": [
227
- { "ref": "steps.review_iteration_${iteration}.check_ready_to_merge.value.exists" },
228
- { "const": false }
379
+ "all": [
380
+ { "not": { "ref": "context.dryRun" } },
381
+ { "equals": [
382
+ { "ref": "steps.review_iteration_${iteration}.check_ready_to_merge.value.exists" },
383
+ { "const": false }
384
+ ]}
229
385
  ]
230
386
  },
231
387
  "node": "flow-run",
232
388
  "params": {
233
389
  "fileName": { "const": "review-fix.json" },
234
390
  "labelText": {
235
- "template": "Running review-fix (iteration ${iteration})"
391
+ "template": "Running review-fix (iteration {iteration})",
392
+ "vars": {
393
+ "iteration": {
394
+ "add": [
395
+ { "ref": "params.baseIteration" },
396
+ { "ref": "repeat.iteration" },
397
+ { "const": -1 }
398
+ ]
399
+ }
400
+ }
236
401
  },
237
402
  "taskKey": { "ref": "params.taskKey" },
238
- "latestIteration": { "ref": "repeat.iteration" },
403
+ "latestIteration": {
404
+ "add": [
405
+ { "ref": "params.baseIteration" },
406
+ { "ref": "repeat.iteration" },
407
+ { "const": -1 }
408
+ ]
409
+ },
239
410
  "reviewAssessmentJsonFile": { "const": null },
240
411
  "reviewFixSelectionJsonFile": {
241
412
  "template": "{workspace}/review-fix-selection-{taskKey}-iter-{iteration}.json",
242
413
  "vars": {
243
414
  "workspace": { "ref": "params.workspaceDir" },
244
415
  "taskKey": { "ref": "params.taskKey" },
245
- "iteration": { "ref": "repeat.iteration" }
416
+ "iteration": {
417
+ "add": [
418
+ { "ref": "params.baseIteration" },
419
+ { "ref": "repeat.iteration" },
420
+ { "const": -1 }
421
+ ]
422
+ }
246
423
  }
247
424
  },
248
425
  "reviewFixPoints": { "ref": "params.reviewFixPoints" },
426
+ "reviewBlockingSeverities": { "ref": "params.reviewBlockingSeverities" },
249
427
  "extraPrompt": {
250
428
  "appendPrompt": {
251
429
  "base": { "ref": "params.extraPrompt" },
252
- "suffix": { "const": "Fix only blockers and criticals." }
430
+ "suffix": { "const": "Fix only configured blocking severities." }
253
431
  }
254
432
  },
255
433
  "llmModel": { "ref": "params.llmModel" },
256
434
  "llmExecutor": { "ref": "params.llmExecutor" }
257
435
  }
258
436
  },
437
+ {
438
+ "id": "load_review_fix_summary",
439
+ "node": "structured-summary",
440
+ "when": {
441
+ "all": [
442
+ { "not": { "ref": "context.dryRun" } },
443
+ { "equals": [
444
+ { "ref": "steps.review_iteration_${iteration}.check_ready_to_merge.value.exists" },
445
+ { "const": false }
446
+ ]}
447
+ ]
448
+ },
449
+ "params": {
450
+ "path": {
451
+ "artifact": {
452
+ "kind": "review-fix-json-file",
453
+ "taskKey": { "ref": "params.taskKey" },
454
+ "iteration": {
455
+ "add": [
456
+ { "ref": "params.baseIteration" },
457
+ { "ref": "repeat.iteration" },
458
+ { "const": -1 }
459
+ ]
460
+ }
461
+ }
462
+ }
463
+ }
464
+ },
259
465
  {
260
466
  "id": "notify_review_fix_complete",
261
467
  "node": "telegram-notify",
262
468
  "when": {
263
- "equals": [
264
- { "ref": "steps.review_iteration_${iteration}.check_ready_to_merge.value.exists" },
265
- { "const": false }
469
+ "all": [
470
+ { "not": { "ref": "context.dryRun" } },
471
+ { "equals": [
472
+ { "ref": "steps.review_iteration_${iteration}.check_ready_to_merge.value.exists" },
473
+ { "const": false }
474
+ ]}
266
475
  ]
267
476
  },
268
477
  "params": {
269
478
  "message": {
270
- "template": "Review fix iteration ${iteration} for {taskKey} complete.",
479
+ "template": "Review fix iteration {iteration}: {summary}",
271
480
  "vars": {
272
- "taskKey": { "ref": "params.taskKey" },
273
- "iteration": { "ref": "repeat.iteration" }
481
+ "summary": { "ref": "steps.review_iteration_${iteration}.load_review_fix_summary.value.summary" },
482
+ "iteration": {
483
+ "add": [
484
+ { "ref": "params.baseIteration" },
485
+ { "ref": "repeat.iteration" },
486
+ { "const": -1 }
487
+ ]
488
+ }
274
489
  }
275
490
  }
276
491
  }
@@ -278,6 +493,97 @@
278
493
  ]
279
494
  }
280
495
  ]
496
+ },
497
+ {
498
+ "id": "terminal_verification",
499
+ "when": {
500
+ "not": { "ref": "context.dryRun" }
501
+ },
502
+ "steps": [
503
+ {
504
+ "id": "clear_ready_to_merge_before_verification",
505
+ "node": "clear-ready-to-merge",
506
+ "when": {
507
+ "not": { "ref": "context.dryRun" }
508
+ },
509
+ "params": {
510
+ "taskKey": { "ref": "params.taskKey" }
511
+ }
512
+ },
513
+ {
514
+ "id": "run_terminal_review",
515
+ "node": "flow-run",
516
+ "params": {
517
+ "fileName": { "const": "review.json" },
518
+ "labelText": {
519
+ "template": "Running terminal verification review (iteration {iteration})",
520
+ "vars": {
521
+ "iteration": {
522
+ "add": [
523
+ { "ref": "params.baseIteration" },
524
+ { "const": 5 }
525
+ ]
526
+ }
527
+ }
528
+ },
529
+ "taskKey": { "ref": "params.taskKey" },
530
+ "iteration": {
531
+ "add": [
532
+ { "ref": "params.baseIteration" },
533
+ { "const": 5 }
534
+ ]
535
+ },
536
+ "extraPrompt": { "ref": "params.extraPrompt" },
537
+ "reviewBlockingSeverities": { "ref": "params.reviewBlockingSeverities" },
538
+ "llmModel": { "ref": "params.llmModel" },
539
+ "llmExecutor": { "ref": "params.llmExecutor" }
540
+ }
541
+ },
542
+ {
543
+ "id": "check_terminal_ready_to_merge",
544
+ "node": "file-check",
545
+ "when": {
546
+ "not": { "ref": "context.dryRun" }
547
+ },
548
+ "params": {
549
+ "path": {
550
+ "artifact": {
551
+ "kind": "ready-to-merge-file",
552
+ "taskKey": { "ref": "params.taskKey" }
553
+ }
554
+ },
555
+ "panelTitle": { "const": "Ready To Merge" },
556
+ "foundMessage": { "const": "Changes are ready to merge.\nready-to-merge.md file created." },
557
+ "tone": { "const": "green" }
558
+ }
559
+ },
560
+ {
561
+ "id": "assert_terminal_success",
562
+ "node": "file-check",
563
+ "when": {
564
+ "not": { "ref": "context.dryRun" }
565
+ },
566
+ "params": {
567
+ "path": {
568
+ "artifact": {
569
+ "kind": "ready-to-merge-file",
570
+ "taskKey": { "ref": "params.taskKey" }
571
+ }
572
+ },
573
+ "panelTitle": { "const": "Terminal Verification" },
574
+ "foundMessage": { "const": "Terminal verification passed." },
575
+ "tone": { "const": "green" }
576
+ },
577
+ "expect": [
578
+ {
579
+ "kind": "step-output",
580
+ "value": { "ref": "steps.terminal_verification.check_terminal_ready_to_merge.value.exists" },
581
+ "equals": { "const": true },
582
+ "message": "Terminal verification failed: ready-to-merge.md was not produced after the terminal review iteration. review-loop must fail."
583
+ }
584
+ ]
585
+ }
586
+ ]
281
587
  }
282
588
  ]
283
589
  }