@trygentic/agentloop 0.16.0-alpha.11 → 0.18.0-alpha.11
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.
- package/README.md +1 -12
- package/package.json +3 -3
- package/templates/agents/_base/proactive.bt.json +43 -0
- package/templates/agents/_base/reactive-delegation.bt.json +73 -0
- package/templates/agents/_base/reactive-message.bt.json +58 -0
- package/templates/agents/_base/reactive-task.bt.json +51 -0
- package/templates/agents/chat/chat.bt.json +70 -20
- package/templates/agents/chat/chat.md +36 -19
- package/templates/agents/engineer/engineer.bt.json +951 -346
- package/templates/agents/engineer/engineer.md +86 -33
- package/templates/agents/merge-resolver/merge-resolver.bt.json +217 -0
- package/templates/agents/merge-resolver/merge-resolver.md +297 -0
- package/templates/agents/orchestrator/orchestrator.bt.json +1 -0
- package/templates/agents/orchestrator/orchestrator.md +17 -92
- package/templates/agents/product-manager/product-manager.bt.json +215 -25
- package/templates/agents/product-manager/product-manager.md +86 -13
- package/templates/agents/qa-tester/qa-tester.bt.json +299 -88
- package/templates/agents/qa-tester/qa-tester.md +59 -12
- package/templates/agents/release/release.bt.json +219 -0
- package/templates/agents/release/release.md +164 -0
- package/templates/examples/engineer.md.example +4 -4
- package/templates/examples/example-custom-agent.md.example +4 -4
- package/templates/examples/example-plugin.js.example +1 -1
- package/templates/plugins/qa-e2e-maestro/qa-e2e-maestro.bt.json +1191 -0
- package/templates/plugins/qa-e2e-maestro/qa-e2e-maestro.md +923 -0
- package/templates/plugins/qa-e2e-scenario/qa-e2e-scenario.md +85 -0
- package/templates/non-core-templates/container.md +0 -173
- package/templates/non-core-templates/dag-planner.md +0 -96
- package/templates/non-core-templates/internal/cli-tester.md +0 -218
- package/templates/non-core-templates/internal/qa-tester.md +0 -300
- package/templates/non-core-templates/internal/tui-designer.md +0 -370
- package/templates/non-core-templates/internal/tui-tester.md +0 -125
- package/templates/non-core-templates/maestro-qa.md +0 -240
- package/templates/non-core-templates/merge-resolver.md +0 -150
- package/templates/non-core-templates/project-detection.md +0 -75
- package/templates/non-core-templates/questionnaire.md +0 -124
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
"name": "engineer-continuous-agent-tree",
|
|
3
3
|
"description": "Continuous behavior tree for the Engineer agent. Loops forever, waiting for task assignments from the orchestrator. Handles both new tasks and QA rejection re-work cycles without process restarts. Uses a retry loop around implementation+validation to fix issues before committing.",
|
|
4
4
|
"version": "2.0.0",
|
|
5
|
+
"mode": "reactive",
|
|
5
6
|
"tree": {
|
|
6
7
|
"type": "root",
|
|
7
8
|
"child": {
|
|
@@ -78,385 +79,980 @@
|
|
|
78
79
|
},
|
|
79
80
|
{
|
|
80
81
|
"type": "selector",
|
|
81
|
-
"comment": "
|
|
82
|
+
"comment": "Implementation + Validation wrapper with catastrophic failure fallback. If EITHER the implementation LLM calls OR the retry/validation loop fail completely (timeout, API error, etc.), the fallback escalates and loops to the next task.",
|
|
82
83
|
"children": [
|
|
83
84
|
{
|
|
84
85
|
"type": "sequence",
|
|
85
|
-
"comment": "
|
|
86
|
+
"comment": "Happy path - implementation followed by validation+retry",
|
|
86
87
|
"children": [
|
|
87
88
|
{
|
|
88
|
-
"type": "
|
|
89
|
-
"
|
|
90
|
-
"
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
"
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
89
|
+
"type": "selector",
|
|
90
|
+
"comment": "Branch based on whether this is a QA rejection re-work or a new task",
|
|
91
|
+
"children": [
|
|
92
|
+
{
|
|
93
|
+
"type": "sequence",
|
|
94
|
+
"comment": "QA Rejection path - task was previously in review and bounced back with feedback",
|
|
95
|
+
"children": [
|
|
96
|
+
{
|
|
97
|
+
"type": "condition",
|
|
98
|
+
"call": "IsQARejection",
|
|
99
|
+
"comment": "Returns true if task has qaBounceCount > 0 or was previously in review status"
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
"type": "llm-action",
|
|
103
|
+
"name": "AnalyzeQAFeedbackAndFix",
|
|
104
|
+
"prompt": "You are an engineer agent handling a QA rejection. The task was previously submitted for review but QA found issues that need to be fixed.\n\nTask: {{taskDescription}}\n\nQA Feedback and Previous Comments:\n{{taskComments}}\n\nCodebase Context:\n{{codebaseContext}}\n\nPrevious Analysis (if any):\n{{taskAnalysis}}\n\n## CRITICAL: YOU MUST MAKE CODE CHANGES\nQA found issues during actual app testing (E2E/runtime). This means the current code has bugs that MUST be fixed with code changes. DO NOT just run unit tests and conclude nothing needs fixing. Unit tests passing does NOT mean runtime errors are fixed \u2014 QA tests the actual running app and found real problems.\n\nIf unit tests pass but QA reported runtime errors, that means:\n- The unit tests don't cover the failing scenario, OR\n- The bug only manifests at runtime (wrong imports, missing props, incorrect component rendering, etc.)\n\nYou MUST:\n1. Read the QA feedback carefully to understand the EXACT runtime error\n2. Find the root cause in the source code (not just the test code)\n3. Make actual code changes to fix the issue\n4. If the bug isn't obvious, add a NEW test that reproduces the QA-reported failure\n5. Verify your fix with tests\n\nDO NOT conclude 'no changes needed' \u2014 QA rejected this task because something is broken. Find it and fix it.\n\n**Codebase Exploration Strategy (FOLLOW THIS ORDER):**\n1. FIRST use agentloop-memory MCP tools for intelligent code discovery (the code graph was already indexed):\n - `mcp__agentloop-memory__semantic_search` \u2014 find relevant code by natural language description\n - `mcp__agentloop-memory__query` \u2014 combined semantic + structural search\n - `mcp__agentloop-memory__find_similar_code` \u2014 find existing patterns similar to what you need\n - `mcp__agentloop-memory__list_file_entities` \u2014 enumerate functions, classes, and exports in a file\n - `mcp__agentloop-memory__list_entity_relationships` \u2014 trace imports, references, and dependencies\n - `mcp__agentloop-memory__analyze_code_impact` \u2014 understand what depends on code you plan to change\n2. THEN use Read to examine specific file contents, and Grep/Glob for targeted text searches or file pattern matching\n3. If agentloop-memory tools fail or return no results after 2-3 attempts, fall back to Grep/Glob\n\nIMPORTANT: Each change must include the full 'code' field with the complete file content to write. Address ALL QA feedback - partial fixes will result in another rejection.\n\nYou MUST produce at least one code change. If you cannot find the exact bug, at minimum add a regression test that verifies the scenario QA reported.",
|
|
105
|
+
"minTurns": 5,
|
|
106
|
+
"contextKeys": [
|
|
107
|
+
"taskDescription",
|
|
108
|
+
"taskTitle",
|
|
109
|
+
"taskComments",
|
|
110
|
+
"codebaseContext",
|
|
111
|
+
"taskAnalysis"
|
|
112
|
+
],
|
|
113
|
+
"subagent": "engineer",
|
|
114
|
+
"maxTurns": 50,
|
|
115
|
+
"outputSchema": {
|
|
116
|
+
"type": "object",
|
|
117
|
+
"properties": {
|
|
118
|
+
"qaFeedbackSummary": {
|
|
119
|
+
"type": "string",
|
|
120
|
+
"description": "Summary of QA feedback that needed to be addressed"
|
|
121
|
+
},
|
|
122
|
+
"changes": {
|
|
123
|
+
"type": "array",
|
|
124
|
+
"minItems": 1,
|
|
125
|
+
"description": "List of file changes to fix the QA issues",
|
|
126
|
+
"items": {
|
|
127
|
+
"type": "object",
|
|
128
|
+
"properties": {
|
|
129
|
+
"filePath": {
|
|
130
|
+
"type": "string",
|
|
131
|
+
"description": "Absolute or relative path to the file"
|
|
132
|
+
},
|
|
133
|
+
"action": {
|
|
134
|
+
"type": "string",
|
|
135
|
+
"enum": [
|
|
136
|
+
"create",
|
|
137
|
+
"modify",
|
|
138
|
+
"delete"
|
|
139
|
+
],
|
|
140
|
+
"description": "The type of file operation"
|
|
141
|
+
},
|
|
142
|
+
"description": {
|
|
143
|
+
"type": "string",
|
|
144
|
+
"description": "Brief description of what this change fixes"
|
|
145
|
+
},
|
|
146
|
+
"code": {
|
|
147
|
+
"type": "string",
|
|
148
|
+
"description": "The complete file content to write (required for create/modify)"
|
|
149
|
+
},
|
|
150
|
+
"qaIssueAddressed": {
|
|
151
|
+
"type": "string",
|
|
152
|
+
"description": "Which QA issue this change addresses"
|
|
153
|
+
}
|
|
154
|
+
},
|
|
155
|
+
"required": [
|
|
156
|
+
"filePath",
|
|
157
|
+
"action",
|
|
158
|
+
"description",
|
|
159
|
+
"code"
|
|
160
|
+
]
|
|
161
|
+
}
|
|
162
|
+
},
|
|
163
|
+
"summary": {
|
|
164
|
+
"type": "string",
|
|
165
|
+
"description": "Brief summary of all fixes made"
|
|
166
|
+
},
|
|
167
|
+
"allQAIssuesAddressed": {
|
|
168
|
+
"type": "boolean",
|
|
169
|
+
"description": "Whether all QA issues have been addressed"
|
|
170
|
+
},
|
|
171
|
+
"testsVerified": {
|
|
172
|
+
"type": "boolean",
|
|
173
|
+
"description": "Whether tests were run to verify the fixes"
|
|
174
|
+
}
|
|
175
|
+
},
|
|
176
|
+
"required": [
|
|
177
|
+
"qaFeedbackSummary",
|
|
178
|
+
"changes",
|
|
179
|
+
"summary",
|
|
180
|
+
"allQAIssuesAddressed"
|
|
181
|
+
]
|
|
115
182
|
},
|
|
116
|
-
"
|
|
183
|
+
"outputKey": "implementation",
|
|
184
|
+
"temperature": 0.5,
|
|
185
|
+
"allowedTools": [
|
|
186
|
+
"read",
|
|
187
|
+
"edit",
|
|
188
|
+
"write",
|
|
189
|
+
"bash",
|
|
190
|
+
"glob",
|
|
191
|
+
"grep",
|
|
192
|
+
"webfetch",
|
|
193
|
+
"websearch",
|
|
194
|
+
"question",
|
|
195
|
+
"skill",
|
|
196
|
+
"plan_enter",
|
|
197
|
+
"plan_exit",
|
|
198
|
+
"mcp__agentloop__get_task",
|
|
199
|
+
"mcp__agentloop__list_tasks",
|
|
200
|
+
"mcp__agentloop__send_agent_message",
|
|
201
|
+
"mcp__agentloop__receive_messages",
|
|
202
|
+
"mcp__agentloop__broadcast_message",
|
|
203
|
+
"mcp__git-worktree-toolbox__listProjects",
|
|
204
|
+
"mcp__git-worktree-toolbox__worktreeChanges",
|
|
205
|
+
"mcp__git-worktree-toolbox__generateMrLink",
|
|
206
|
+
"mcp__git-worktree-toolbox__mergeRemoteWorktreeChangesIntoLocal",
|
|
207
|
+
"mcp__agentloop-memory__index",
|
|
208
|
+
"mcp__agentloop-memory__semantic_search",
|
|
209
|
+
"mcp__agentloop-memory__find_similar_code",
|
|
210
|
+
"mcp__agentloop-memory__query",
|
|
211
|
+
"mcp__agentloop-memory__list_file_entities",
|
|
212
|
+
"mcp__agentloop-memory__list_entity_relationships",
|
|
213
|
+
"mcp__agentloop-memory__find_related_concepts",
|
|
214
|
+
"mcp__agentloop-memory__analyze_code_impact",
|
|
215
|
+
"mcp__agentloop-memory__analyze_hotspots",
|
|
216
|
+
"mcp__agentloop-memory__detect_code_clones",
|
|
217
|
+
"mcp__agentloop-memory__jscpd_detect_clones",
|
|
218
|
+
"mcp__agentloop-memory__suggest_refactoring",
|
|
219
|
+
"mcp__agentloop-memory__cross_language_search",
|
|
220
|
+
"mcp__agentloop-memory__get_graph_stats",
|
|
221
|
+
"mcp__agentloop-memory__get_graph_health",
|
|
222
|
+
"mcp__agentloop-memory__get_metrics",
|
|
223
|
+
"mcp__agentloop-memory__get_version",
|
|
224
|
+
"mcp__agentloop-memory__clean_index",
|
|
225
|
+
"mcp__agentloop-memory__reset_graph",
|
|
226
|
+
"mcp__agentloop-memory__get_graph"
|
|
227
|
+
]
|
|
117
228
|
}
|
|
118
|
-
|
|
119
|
-
"summary": { "type": "string", "description": "Brief summary of all fixes made" },
|
|
120
|
-
"allQAIssuesAddressed": { "type": "boolean", "description": "Whether all QA issues have been addressed" },
|
|
121
|
-
"testsVerified": { "type": "boolean", "description": "Whether tests were run to verify the fixes" }
|
|
229
|
+
]
|
|
122
230
|
},
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
"subagent": "engineer",
|
|
169
|
-
"maxTurns": 50,
|
|
170
|
-
"outputSchema": {
|
|
171
|
-
"type": "object",
|
|
172
|
-
"properties": {
|
|
173
|
-
"changes": {
|
|
174
|
-
"type": "array",
|
|
175
|
-
"minItems": 1,
|
|
176
|
-
"description": "List of file changes to apply - must include both implementation files AND test files",
|
|
177
|
-
"items": {
|
|
178
|
-
"type": "object",
|
|
179
|
-
"properties": {
|
|
180
|
-
"filePath": { "type": "string", "description": "Absolute or relative path to the file" },
|
|
181
|
-
"action": { "type": "string", "enum": ["create", "modify", "delete"], "description": "The type of file operation" },
|
|
182
|
-
"description": { "type": "string", "description": "Brief description of what this change does" },
|
|
183
|
-
"code": { "type": "string", "description": "The complete file content to write (required for create/modify)" },
|
|
184
|
-
"isTest": { "type": "boolean", "description": "Whether this file is a test file" }
|
|
231
|
+
{
|
|
232
|
+
"type": "sequence",
|
|
233
|
+
"comment": "New task path - standard implementation flow",
|
|
234
|
+
"children": [
|
|
235
|
+
{
|
|
236
|
+
"type": "llm-action",
|
|
237
|
+
"name": "AnalyzeTask",
|
|
238
|
+
"prompt": "You are an engineer agent analyzing a task. Examine the task requirements and the codebase context provided. Determine the complexity of the task and identify which files will likely need to be modified.\n\nTask: {{taskDescription}}\n\n{{taskComments}}\n\nIMPORTANT: Only reference files and directories that appear in the codebase context. Do NOT guess or hallucinate file paths that are not listed there.\n\nIf this task was previously rejected by QA, pay close attention to the feedback in the comments above. Address ALL issues mentioned by QA in your implementation.\n\nIMPORTANT: Always plan to include tests for your implementation. Use the project's EXISTING test framework \u2014 check codebase context for test runner, test scripts, and existing test files. Do NOT add a new test framework or test runner configuration (no jest.config, vitest.config, etc.). Follow the naming conventions and import patterns found in existing test files.\n\nProvide a thorough analysis of what needs to be done, including what tests you will create.",
|
|
239
|
+
"contextKeys": [
|
|
240
|
+
"taskDescription",
|
|
241
|
+
"taskTitle",
|
|
242
|
+
"codebaseContext",
|
|
243
|
+
"taskComments"
|
|
244
|
+
],
|
|
245
|
+
"outputSchema": {
|
|
246
|
+
"type": "object",
|
|
247
|
+
"properties": {
|
|
248
|
+
"analysis": {
|
|
249
|
+
"type": "string",
|
|
250
|
+
"description": "Detailed analysis of the task requirements"
|
|
251
|
+
},
|
|
252
|
+
"complexity": {
|
|
253
|
+
"type": "string",
|
|
254
|
+
"enum": [
|
|
255
|
+
"simple",
|
|
256
|
+
"moderate",
|
|
257
|
+
"complex"
|
|
258
|
+
],
|
|
259
|
+
"description": "Task complexity assessment"
|
|
260
|
+
},
|
|
261
|
+
"affectedFiles": {
|
|
262
|
+
"type": "array",
|
|
263
|
+
"items": {
|
|
264
|
+
"type": "string"
|
|
265
|
+
},
|
|
266
|
+
"description": "List of files that will likely need modification"
|
|
267
|
+
},
|
|
268
|
+
"estimatedSteps": {
|
|
269
|
+
"type": "number",
|
|
270
|
+
"description": "Estimated number of implementation steps"
|
|
271
|
+
},
|
|
272
|
+
"risks": {
|
|
273
|
+
"type": "array",
|
|
274
|
+
"items": {
|
|
275
|
+
"type": "string"
|
|
185
276
|
},
|
|
186
|
-
"
|
|
277
|
+
"description": "Potential risks or challenges"
|
|
278
|
+
},
|
|
279
|
+
"qaFeedbackAddressed": {
|
|
280
|
+
"type": "string",
|
|
281
|
+
"description": "If QA rejected this task before, summarize how you will address their feedback"
|
|
282
|
+
},
|
|
283
|
+
"testsPlanned": {
|
|
284
|
+
"type": "array",
|
|
285
|
+
"items": {
|
|
286
|
+
"type": "string"
|
|
287
|
+
},
|
|
288
|
+
"description": "List of tests that will be created to verify the implementation"
|
|
187
289
|
}
|
|
188
290
|
},
|
|
189
|
-
"
|
|
190
|
-
|
|
191
|
-
|
|
291
|
+
"required": [
|
|
292
|
+
"analysis",
|
|
293
|
+
"complexity",
|
|
294
|
+
"affectedFiles",
|
|
295
|
+
"testsPlanned"
|
|
296
|
+
]
|
|
192
297
|
},
|
|
193
|
-
"
|
|
298
|
+
"outputKey": "taskAnalysis",
|
|
299
|
+
"temperature": 0.3,
|
|
300
|
+
"allowedTools": []
|
|
194
301
|
},
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
302
|
+
{
|
|
303
|
+
"type": "llm-selector",
|
|
304
|
+
"name": "ChooseImplementationStrategy",
|
|
305
|
+
"prompt": "Based on the task analysis, choose the best implementation strategy.\n\nAnalysis: {{taskAnalysis}}\n\nSimple changes can be implemented directly. Complex changes need a detailed plan first.",
|
|
306
|
+
"contextKeys": [
|
|
307
|
+
"taskAnalysis",
|
|
308
|
+
"taskDescription",
|
|
309
|
+
"taskComments"
|
|
310
|
+
],
|
|
311
|
+
"branches": {
|
|
312
|
+
"direct": {
|
|
313
|
+
"description": "Implement directly - for simple, straightforward changes with low risk",
|
|
314
|
+
"child": {
|
|
315
|
+
"type": "llm-action",
|
|
316
|
+
"name": "ImplementDirectly",
|
|
317
|
+
"prompt": "Implement the task directly. Generate the code changes needed.\n\nTask: {{taskDescription}}\nAnalysis: {{taskAnalysis}}\n\n{{taskComments}}\n\nIf this task was previously rejected by QA, make sure your implementation addresses ALL the issues mentioned in their feedback.\n\nYou already have codebase context, task analysis, and task details in your context. Start implementing immediately \u2014 do NOT return empty changes or claim you need more exploration.\n\n**Codebase Exploration Strategy (FOLLOW THIS ORDER):**\n1. FIRST use agentloop-memory MCP tools for intelligent code discovery (the code graph was already indexed):\n - `mcp__agentloop-memory__semantic_search` \u2014 find relevant code by natural language description (e.g., search for concepts, function purposes, feature areas)\n - `mcp__agentloop-memory__query` \u2014 combined semantic + structural search for broader discovery\n - `mcp__agentloop-memory__find_similar_code` \u2014 find existing patterns similar to what you need to implement\n - `mcp__agentloop-memory__list_file_entities` \u2014 enumerate functions, classes, and exports in a specific file\n - `mcp__agentloop-memory__list_entity_relationships` \u2014 trace imports, references, and dependencies between entities\n - `mcp__agentloop-memory__analyze_code_impact` \u2014 understand what depends on code you plan to change (blast radius)\n2. THEN use Read to examine specific file contents, and Grep/Glob for targeted text searches or file pattern matching\n3. If agentloop-memory tools fail or return no results after 2-3 attempts, fall back to Grep/Glob\n\nIMPORTANT: Always include test files alongside your implementation. Create at least one test file that verifies the core functionality. Use the project's EXISTING test framework and test runner \u2014 check codebase context for what test framework the project uses, what test scripts are available, and how existing test files are structured. Do NOT install or configure a new test framework (no jest.config.js, no vitest.config.ts, etc.). Follow the naming conventions, import patterns, and directory structure of existing test files in the project.\n\n**CRITICAL: Read Before Edit Rule:**\nYou MUST call the `read` tool on any existing file BEFORE calling `edit` on it. The edit tool validates that you've read the file first. If you skip the read, the edit will fail with \"You must read file X before overwriting it.\" For new files, use the `write` tool instead of `edit`.\n\nProvide the implementation with file paths and complete code content for each file.\n\nIMPORTANT: Each change must include the full 'code' field with the complete file content to write. Include both implementation files AND test files in the changes array. You MUST produce at least one file change.\n\n**Test Configuration Rules (CRITICAL):**\n- Tests run in a non-interactive CI-like environment. NEVER configure tests to use watch mode.\n- When creating vitest.config.ts/js, always set `test: { watch: false }` or use `defineConfig({ test: { watch: false } })`.\n- When writing package.json test scripts with vitest, ALWAYS use `\"test\": \"vitest run\"` (NOT `\"test\": \"vitest\"`).\n- For jest, always include `--watchAll=false` in the test script if needed.\n- Never add `--watch` or `--watchAll` flags to test scripts.",
|
|
318
|
+
"contextKeys": [
|
|
319
|
+
"taskDescription",
|
|
320
|
+
"taskAnalysis",
|
|
321
|
+
"codebaseContext",
|
|
322
|
+
"taskComments"
|
|
323
|
+
],
|
|
324
|
+
"subagent": "engineer",
|
|
325
|
+
"maxTurns": 500,
|
|
326
|
+
"outputSchema": {
|
|
327
|
+
"type": "object",
|
|
328
|
+
"properties": {
|
|
329
|
+
"changes": {
|
|
330
|
+
"type": "array",
|
|
331
|
+
"minItems": 1,
|
|
332
|
+
"description": "List of file changes to apply - must include both implementation files AND test files",
|
|
333
|
+
"items": {
|
|
334
|
+
"type": "object",
|
|
335
|
+
"properties": {
|
|
336
|
+
"filePath": {
|
|
337
|
+
"type": "string",
|
|
338
|
+
"description": "Absolute or relative path to the file"
|
|
339
|
+
},
|
|
340
|
+
"action": {
|
|
341
|
+
"type": "string",
|
|
342
|
+
"enum": [
|
|
343
|
+
"create",
|
|
344
|
+
"modify",
|
|
345
|
+
"delete"
|
|
346
|
+
],
|
|
347
|
+
"description": "The type of file operation"
|
|
348
|
+
},
|
|
349
|
+
"description": {
|
|
350
|
+
"type": "string",
|
|
351
|
+
"description": "Brief description of what this change does"
|
|
352
|
+
},
|
|
353
|
+
"code": {
|
|
354
|
+
"type": "string",
|
|
355
|
+
"description": "The complete file content to write (required for create/modify)"
|
|
356
|
+
},
|
|
357
|
+
"isTest": {
|
|
358
|
+
"type": "boolean",
|
|
359
|
+
"description": "Whether this file is a test file"
|
|
360
|
+
}
|
|
361
|
+
},
|
|
362
|
+
"required": [
|
|
363
|
+
"filePath",
|
|
364
|
+
"action",
|
|
365
|
+
"description",
|
|
366
|
+
"code"
|
|
367
|
+
]
|
|
368
|
+
}
|
|
369
|
+
},
|
|
370
|
+
"summary": {
|
|
371
|
+
"type": "string",
|
|
372
|
+
"description": "Brief summary of all changes made"
|
|
373
|
+
},
|
|
374
|
+
"qaFeedbackAddressed": {
|
|
375
|
+
"type": "string",
|
|
376
|
+
"description": "If QA rejected this task before, explain how you addressed their feedback"
|
|
377
|
+
},
|
|
378
|
+
"testsCreated": {
|
|
379
|
+
"type": "array",
|
|
380
|
+
"items": {
|
|
381
|
+
"type": "string"
|
|
382
|
+
},
|
|
383
|
+
"description": "List of test files created"
|
|
384
|
+
}
|
|
385
|
+
},
|
|
386
|
+
"required": [
|
|
387
|
+
"changes",
|
|
388
|
+
"summary",
|
|
389
|
+
"testsCreated"
|
|
390
|
+
]
|
|
391
|
+
},
|
|
392
|
+
"outputKey": "implementation",
|
|
393
|
+
"temperature": 0.5,
|
|
394
|
+
"allowedTools": [
|
|
395
|
+
"read",
|
|
396
|
+
"edit",
|
|
397
|
+
"write",
|
|
398
|
+
"bash",
|
|
399
|
+
"glob",
|
|
400
|
+
"grep",
|
|
401
|
+
"webfetch",
|
|
402
|
+
"websearch",
|
|
403
|
+
"question",
|
|
404
|
+
"skill",
|
|
405
|
+
"plan_enter",
|
|
406
|
+
"plan_exit",
|
|
407
|
+
"mcp__agentloop__get_task",
|
|
408
|
+
"mcp__agentloop__list_tasks",
|
|
409
|
+
"mcp__agentloop__send_agent_message",
|
|
410
|
+
"mcp__agentloop__receive_messages",
|
|
411
|
+
"mcp__agentloop__broadcast_message",
|
|
412
|
+
"mcp__git-worktree-toolbox__listProjects",
|
|
413
|
+
"mcp__git-worktree-toolbox__worktreeChanges",
|
|
414
|
+
"mcp__git-worktree-toolbox__generateMrLink",
|
|
415
|
+
"mcp__git-worktree-toolbox__mergeRemoteWorktreeChangesIntoLocal",
|
|
416
|
+
"mcp__agentloop-memory__index",
|
|
417
|
+
"mcp__agentloop-memory__semantic_search",
|
|
418
|
+
"mcp__agentloop-memory__find_similar_code",
|
|
419
|
+
"mcp__agentloop-memory__query",
|
|
420
|
+
"mcp__agentloop-memory__list_file_entities",
|
|
421
|
+
"mcp__agentloop-memory__list_entity_relationships",
|
|
422
|
+
"mcp__agentloop-memory__find_related_concepts",
|
|
423
|
+
"mcp__agentloop-memory__analyze_code_impact",
|
|
424
|
+
"mcp__agentloop-memory__analyze_hotspots",
|
|
425
|
+
"mcp__agentloop-memory__detect_code_clones",
|
|
426
|
+
"mcp__agentloop-memory__jscpd_detect_clones",
|
|
427
|
+
"mcp__agentloop-memory__suggest_refactoring",
|
|
428
|
+
"mcp__agentloop-memory__cross_language_search",
|
|
429
|
+
"mcp__agentloop-memory__get_graph_stats",
|
|
430
|
+
"mcp__agentloop-memory__get_graph_health",
|
|
431
|
+
"mcp__agentloop-memory__get_metrics",
|
|
432
|
+
"mcp__agentloop-memory__get_version",
|
|
433
|
+
"mcp__agentloop-memory__clean_index",
|
|
434
|
+
"mcp__agentloop-memory__reset_graph",
|
|
435
|
+
"mcp__agentloop-memory__get_graph"
|
|
436
|
+
]
|
|
437
|
+
}
|
|
438
|
+
},
|
|
439
|
+
"planned": {
|
|
440
|
+
"description": "Create a detailed plan first - for complex changes that need careful coordination",
|
|
441
|
+
"child": {
|
|
442
|
+
"type": "sequence",
|
|
443
|
+
"children": [
|
|
444
|
+
{
|
|
445
|
+
"type": "llm-action",
|
|
446
|
+
"name": "CreateImplementationPlan",
|
|
447
|
+
"prompt": "Create a detailed implementation plan for this complex task.\n\nTask: {{taskDescription}}\nAnalysis: {{taskAnalysis}}\n\n{{taskComments}}\n\nIMPORTANT: Only reference files and directories that appear in the codebase context. Do NOT guess or hallucinate file paths that are not listed there. Adapt your plan to match the actual project layout.\n\nIf this task was previously rejected by QA, incorporate their feedback into your plan.\n\nIMPORTANT: Include test creation as part of your implementation steps. Each step that creates functionality should have a corresponding test step or include tests within it.\n\nBreak down the implementation into clear steps with dependencies.",
|
|
448
|
+
"contextKeys": [
|
|
449
|
+
"taskDescription",
|
|
450
|
+
"taskAnalysis",
|
|
451
|
+
"codebaseContext",
|
|
452
|
+
"taskComments"
|
|
453
|
+
],
|
|
454
|
+
"outputSchema": {
|
|
455
|
+
"type": "object",
|
|
456
|
+
"properties": {
|
|
457
|
+
"steps": {
|
|
458
|
+
"type": "array",
|
|
459
|
+
"items": {
|
|
460
|
+
"type": "object",
|
|
461
|
+
"properties": {
|
|
462
|
+
"stepNumber": {
|
|
463
|
+
"type": "number"
|
|
464
|
+
},
|
|
465
|
+
"description": {
|
|
466
|
+
"type": "string"
|
|
467
|
+
},
|
|
468
|
+
"files": {
|
|
469
|
+
"type": "array",
|
|
470
|
+
"items": {
|
|
471
|
+
"type": "string"
|
|
472
|
+
}
|
|
473
|
+
},
|
|
474
|
+
"dependencies": {
|
|
475
|
+
"type": "array",
|
|
476
|
+
"items": {
|
|
477
|
+
"type": "number"
|
|
478
|
+
}
|
|
479
|
+
},
|
|
480
|
+
"testStrategy": {
|
|
481
|
+
"type": "string"
|
|
482
|
+
},
|
|
483
|
+
"includesTests": {
|
|
484
|
+
"type": "boolean",
|
|
485
|
+
"description": "Whether this step creates or modifies test files"
|
|
486
|
+
}
|
|
487
|
+
},
|
|
488
|
+
"required": [
|
|
489
|
+
"stepNumber",
|
|
490
|
+
"description",
|
|
491
|
+
"files",
|
|
492
|
+
"includesTests"
|
|
493
|
+
]
|
|
494
|
+
}
|
|
495
|
+
},
|
|
496
|
+
"totalEstimate": {
|
|
497
|
+
"type": "string"
|
|
498
|
+
},
|
|
499
|
+
"criticalPath": {
|
|
500
|
+
"type": "array",
|
|
501
|
+
"items": {
|
|
502
|
+
"type": "number"
|
|
503
|
+
}
|
|
504
|
+
},
|
|
505
|
+
"qaFeedbackAddressed": {
|
|
506
|
+
"type": "string",
|
|
507
|
+
"description": "If QA rejected this task before, explain how your plan addresses their feedback"
|
|
508
|
+
}
|
|
509
|
+
},
|
|
510
|
+
"required": [
|
|
511
|
+
"steps"
|
|
512
|
+
]
|
|
513
|
+
},
|
|
514
|
+
"outputKey": "implementationPlan",
|
|
515
|
+
"temperature": 0.3,
|
|
516
|
+
"allowedTools": []
|
|
517
|
+
},
|
|
518
|
+
{
|
|
519
|
+
"type": "llm-action",
|
|
520
|
+
"name": "ImplementIncrementally",
|
|
521
|
+
"prompt": "Execute the implementation plan step by step.\n\nPlan: {{implementationPlan}}\nTask: {{taskDescription}}\n\n{{taskComments}}\n\nGenerate all the code changes according to the plan. Make sure to address any QA feedback from previous attempts.\n\nYou already have the codebase context, task analysis, and implementation plan in your context. Start implementing immediately \u2014 do NOT return empty changes or claim you need more exploration.\n\n**Codebase Exploration Strategy (FOLLOW THIS ORDER):**\n1. FIRST use agentloop-memory MCP tools for intelligent code discovery (the code graph was already indexed):\n - `mcp__agentloop-memory__semantic_search` \u2014 find relevant code by natural language description (e.g., search for concepts, function purposes, feature areas)\n - `mcp__agentloop-memory__query` \u2014 combined semantic + structural search for broader discovery\n - `mcp__agentloop-memory__find_similar_code` \u2014 find existing patterns similar to what you need to implement\n - `mcp__agentloop-memory__list_file_entities` \u2014 enumerate functions, classes, and exports in a specific file\n - `mcp__agentloop-memory__list_entity_relationships` \u2014 trace imports, references, and dependencies between entities\n - `mcp__agentloop-memory__analyze_code_impact` \u2014 understand what depends on code you plan to change (blast radius)\n2. THEN use Read to examine specific file contents, and Grep/Glob for targeted text searches or file pattern matching\n3. If agentloop-memory tools fail or return no results after 2-3 attempts, fall back to Grep/Glob\n\nIMPORTANT: Always include test files alongside your implementation. Create at least one test file that verifies the core functionality. Use the project's EXISTING test framework and test runner \u2014 check codebase context for what test framework the project uses, what test scripts are available, and how existing test files are structured. Do NOT install or configure a new test framework (no jest.config.js, no vitest.config.ts, etc.). Follow the naming conventions, import patterns, and directory structure of existing test files in the project.\n\n**CRITICAL: Read Before Edit Rule:**\nYou MUST call the `read` tool on any existing file BEFORE calling `edit` on it. The edit tool validates that you've read the file first. If you skip the read, the edit will fail with \"You must read file X before overwriting it.\" For new files, use the `write` tool instead of `edit`.\n\nIMPORTANT: Each change must include the full 'code' field with the complete file content to write. Include both implementation files AND test files in the changes array. You MUST produce at least one file change.\n\n**Test Configuration Rules (CRITICAL):**\n- Tests run in a non-interactive CI-like environment. NEVER configure tests to use watch mode.\n- When creating vitest.config.ts/js, always set `test: { watch: false }` or use `defineConfig({ test: { watch: false } })`.\n- When writing package.json test scripts with vitest, ALWAYS use `\"test\": \"vitest run\"` (NOT `\"test\": \"vitest\"`).\n- For jest, always include `--watchAll=false` in the test script if needed.\n- Never add `--watch` or `--watchAll` flags to test scripts.",
|
|
522
|
+
"contextKeys": [
|
|
523
|
+
"implementationPlan",
|
|
524
|
+
"taskDescription",
|
|
525
|
+
"taskAnalysis",
|
|
526
|
+
"codebaseContext",
|
|
527
|
+
"taskComments"
|
|
528
|
+
],
|
|
529
|
+
"subagent": "engineer",
|
|
530
|
+
"maxTurns": 500,
|
|
531
|
+
"outputSchema": {
|
|
532
|
+
"type": "object",
|
|
533
|
+
"properties": {
|
|
534
|
+
"changes": {
|
|
535
|
+
"type": "array",
|
|
536
|
+
"description": "List of file changes to apply - must include both implementation files AND test files",
|
|
537
|
+
"items": {
|
|
538
|
+
"type": "object",
|
|
539
|
+
"properties": {
|
|
540
|
+
"filePath": {
|
|
541
|
+
"type": "string",
|
|
542
|
+
"description": "Absolute or relative path to the file"
|
|
543
|
+
},
|
|
544
|
+
"action": {
|
|
545
|
+
"type": "string",
|
|
546
|
+
"enum": [
|
|
547
|
+
"create",
|
|
548
|
+
"modify",
|
|
549
|
+
"delete"
|
|
550
|
+
],
|
|
551
|
+
"description": "The type of file operation"
|
|
552
|
+
},
|
|
553
|
+
"description": {
|
|
554
|
+
"type": "string",
|
|
555
|
+
"description": "Brief description of what this change does"
|
|
556
|
+
},
|
|
557
|
+
"code": {
|
|
558
|
+
"type": "string",
|
|
559
|
+
"description": "The complete file content to write (required for create/modify)"
|
|
560
|
+
},
|
|
561
|
+
"stepNumber": {
|
|
562
|
+
"type": "number",
|
|
563
|
+
"description": "Which plan step this change implements"
|
|
564
|
+
},
|
|
565
|
+
"isTest": {
|
|
566
|
+
"type": "boolean",
|
|
567
|
+
"description": "Whether this file is a test file"
|
|
568
|
+
}
|
|
569
|
+
},
|
|
570
|
+
"required": [
|
|
571
|
+
"filePath",
|
|
572
|
+
"action",
|
|
573
|
+
"description",
|
|
574
|
+
"code"
|
|
575
|
+
]
|
|
576
|
+
}
|
|
577
|
+
},
|
|
578
|
+
"summary": {
|
|
579
|
+
"type": "string",
|
|
580
|
+
"description": "Brief summary of all changes made"
|
|
581
|
+
},
|
|
582
|
+
"completedSteps": {
|
|
583
|
+
"type": "array",
|
|
584
|
+
"items": {
|
|
585
|
+
"type": "number"
|
|
586
|
+
},
|
|
587
|
+
"description": "List of step numbers completed"
|
|
588
|
+
},
|
|
589
|
+
"qaFeedbackAddressed": {
|
|
590
|
+
"type": "string",
|
|
591
|
+
"description": "If QA rejected this task before, explain how you addressed their feedback"
|
|
592
|
+
},
|
|
593
|
+
"testsCreated": {
|
|
594
|
+
"type": "array",
|
|
595
|
+
"items": {
|
|
596
|
+
"type": "string"
|
|
597
|
+
},
|
|
598
|
+
"description": "List of test files created"
|
|
599
|
+
}
|
|
600
|
+
},
|
|
601
|
+
"required": [
|
|
602
|
+
"changes",
|
|
603
|
+
"summary",
|
|
604
|
+
"testsCreated"
|
|
605
|
+
]
|
|
606
|
+
},
|
|
607
|
+
"outputKey": "implementation",
|
|
608
|
+
"temperature": 0.5,
|
|
609
|
+
"allowedTools": [
|
|
610
|
+
"read",
|
|
611
|
+
"edit",
|
|
612
|
+
"write",
|
|
613
|
+
"bash",
|
|
614
|
+
"glob",
|
|
615
|
+
"grep",
|
|
616
|
+
"webfetch",
|
|
617
|
+
"websearch",
|
|
618
|
+
"question",
|
|
619
|
+
"skill",
|
|
620
|
+
"plan_enter",
|
|
621
|
+
"plan_exit",
|
|
622
|
+
"mcp__agentloop__get_task",
|
|
623
|
+
"mcp__agentloop__list_tasks",
|
|
624
|
+
"mcp__agentloop__send_agent_message",
|
|
625
|
+
"mcp__agentloop__receive_messages",
|
|
626
|
+
"mcp__agentloop__broadcast_message",
|
|
627
|
+
"mcp__git-worktree-toolbox__listProjects",
|
|
628
|
+
"mcp__git-worktree-toolbox__worktreeChanges",
|
|
629
|
+
"mcp__git-worktree-toolbox__generateMrLink",
|
|
630
|
+
"mcp__git-worktree-toolbox__mergeRemoteWorktreeChangesIntoLocal",
|
|
631
|
+
"mcp__agentloop-memory__index",
|
|
632
|
+
"mcp__agentloop-memory__semantic_search",
|
|
633
|
+
"mcp__agentloop-memory__find_similar_code",
|
|
634
|
+
"mcp__agentloop-memory__query",
|
|
635
|
+
"mcp__agentloop-memory__list_file_entities",
|
|
636
|
+
"mcp__agentloop-memory__list_entity_relationships",
|
|
637
|
+
"mcp__agentloop-memory__find_related_concepts",
|
|
638
|
+
"mcp__agentloop-memory__analyze_code_impact",
|
|
639
|
+
"mcp__agentloop-memory__analyze_hotspots",
|
|
640
|
+
"mcp__agentloop-memory__detect_code_clones",
|
|
641
|
+
"mcp__agentloop-memory__jscpd_detect_clones",
|
|
642
|
+
"mcp__agentloop-memory__suggest_refactoring",
|
|
643
|
+
"mcp__agentloop-memory__cross_language_search",
|
|
644
|
+
"mcp__agentloop-memory__get_graph_stats",
|
|
645
|
+
"mcp__agentloop-memory__get_graph_health",
|
|
646
|
+
"mcp__agentloop-memory__get_metrics",
|
|
647
|
+
"mcp__agentloop-memory__get_version",
|
|
648
|
+
"mcp__agentloop-memory__clean_index",
|
|
649
|
+
"mcp__agentloop-memory__reset_graph",
|
|
650
|
+
"mcp__agentloop-memory__get_graph"
|
|
651
|
+
]
|
|
652
|
+
}
|
|
653
|
+
]
|
|
654
|
+
}
|
|
655
|
+
}
|
|
656
|
+
},
|
|
657
|
+
"defaultBranch": "planned",
|
|
658
|
+
"confidenceThreshold": 0.7,
|
|
659
|
+
"allowedTools": []
|
|
660
|
+
}
|
|
661
|
+
]
|
|
662
|
+
}
|
|
663
|
+
]
|
|
664
|
+
},
|
|
665
|
+
{
|
|
666
|
+
"type": "selector",
|
|
667
|
+
"comment": "Implementation+Validation with escalation fallback. The retry(3) loop tries apply+validate up to 3 times, fixing issues between retries. If all retries fail, the escalation fallback blocks the task.",
|
|
668
|
+
"children": [
|
|
669
|
+
{
|
|
670
|
+
"type": "retry",
|
|
671
|
+
"attempts": 3,
|
|
672
|
+
"comment": "Happy path - apply changes, validate, succeed. On failure, FixValidationFailures re-implements and retries.",
|
|
201
673
|
"child": {
|
|
202
674
|
"type": "sequence",
|
|
203
675
|
"children": [
|
|
204
676
|
{
|
|
205
|
-
"type": "
|
|
206
|
-
"
|
|
207
|
-
"
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
"
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
677
|
+
"type": "selector",
|
|
678
|
+
"comment": "On first attempt, implementation is already on blackboard (NoOp path). On retries, validationFailed is true so FixValidationFailures runs to re-implement based on validation feedback.",
|
|
679
|
+
"children": [
|
|
680
|
+
{
|
|
681
|
+
"type": "sequence",
|
|
682
|
+
"comment": "Retry path - fix validation failures from previous attempt",
|
|
683
|
+
"children": [
|
|
684
|
+
{
|
|
685
|
+
"type": "condition",
|
|
686
|
+
"call": "IsValidationRetry",
|
|
687
|
+
"comment": "Returns true if validationFailed flag is set (i.e., this is a retry after failed validation)"
|
|
688
|
+
},
|
|
689
|
+
{
|
|
690
|
+
"type": "llm-action",
|
|
691
|
+
"name": "FixValidationFailures",
|
|
692
|
+
"prompt": "You are an engineer agent fixing validation failures from a pre-commit code review. The previous implementation attempt had issues that need to be resolved.\n\nTask: {{taskDescription}}\n\nPrevious Implementation:\n{{implementation}}\n\nValidation Results (ISSUES TO FIX):\n{{preCommitValidation}}\n\nCodebase Context:\n{{codebaseContext}}\n\n{{taskComments}}\n\n## CRITICAL: YOU MUST PRODUCE CODE CHANGES\nIf the validation error is 'No changes detected', your previous attempt made ZERO code modifications. This is unacceptable \u2014 the task requires actual code changes. Do NOT just run tests and conclude nothing needs fixing.\n\nIf this task was rejected by QA:\n- QA tested the RUNNING APP and found real bugs (runtime errors, crashes, wrong UI)\n- Unit tests passing does NOT mean the bug is fixed \u2014 the bug may only manifest at runtime\n- You MUST find the root cause in the source code and fix it\n- If you can't find the bug, add a regression test that reproduces the QA-reported failure\n\nYour job is to:\n1. Read the validation results and QA feedback \u2014 they contain specific issues to fix\n2. Read the actual source files on disk to find the bug\n3. Make actual code changes (edit/write files) to fix the issue\n4. Run tests to verify your fix works\n5. Make sure no regressions are introduced\n\n**Codebase Exploration Strategy (FOLLOW THIS ORDER):**\n1. FIRST use agentloop-memory MCP tools for intelligent code discovery (the code graph was already indexed):\n - `mcp__agentloop-memory__semantic_search` \u2014 find relevant code by natural language description\n - `mcp__agentloop-memory__query` \u2014 combined semantic + structural search\n - `mcp__agentloop-memory__find_similar_code` \u2014 find existing patterns similar to what you need\n - `mcp__agentloop-memory__list_file_entities` \u2014 enumerate functions, classes, and exports in a file\n - `mcp__agentloop-memory__list_entity_relationships` \u2014 trace imports, references, and dependencies\n - `mcp__agentloop-memory__analyze_code_impact` \u2014 understand what depends on code you plan to change\n2. THEN use Read to examine specific file contents, and Grep/Glob for targeted text searches or file pattern matching\n3. If agentloop-memory tools fail or return no results after 2-3 attempts, fall back to Grep/Glob\n\n**CRITICAL: Read Before Edit Rule:**\nYou MUST call the `read` tool on any existing file BEFORE calling `edit` on it. The edit tool validates that you've read the file first. If you skip the read, the edit will fail with \"You must read file X before overwriting it.\" For new files, use the `write` tool instead of `edit`.\n\nIMPORTANT: You MUST produce at least one file change. Fix ALL validation issues - partial fixes will result in another retry.",
|
|
693
|
+
"minTurns": 5,
|
|
694
|
+
"contextKeys": [
|
|
695
|
+
"taskDescription",
|
|
696
|
+
"implementation",
|
|
697
|
+
"preCommitValidation",
|
|
698
|
+
"codebaseContext",
|
|
699
|
+
"taskComments",
|
|
700
|
+
"taskAnalysis"
|
|
701
|
+
],
|
|
702
|
+
"subagent": "engineer",
|
|
703
|
+
"maxTurns": 40,
|
|
704
|
+
"outputSchema": {
|
|
705
|
+
"type": "object",
|
|
706
|
+
"properties": {
|
|
707
|
+
"changes": {
|
|
708
|
+
"type": "array",
|
|
709
|
+
"minItems": 1,
|
|
710
|
+
"description": "List of file changes to fix validation issues",
|
|
711
|
+
"items": {
|
|
712
|
+
"type": "object",
|
|
713
|
+
"properties": {
|
|
714
|
+
"filePath": {
|
|
715
|
+
"type": "string",
|
|
716
|
+
"description": "Absolute or relative path to the file"
|
|
717
|
+
},
|
|
718
|
+
"action": {
|
|
719
|
+
"type": "string",
|
|
720
|
+
"enum": [
|
|
721
|
+
"create",
|
|
722
|
+
"modify",
|
|
723
|
+
"delete"
|
|
724
|
+
],
|
|
725
|
+
"description": "The type of file operation"
|
|
726
|
+
},
|
|
727
|
+
"description": {
|
|
728
|
+
"type": "string",
|
|
729
|
+
"description": "Brief description of what this change fixes"
|
|
730
|
+
},
|
|
731
|
+
"code": {
|
|
732
|
+
"type": "string",
|
|
733
|
+
"description": "The complete file content to write (required for create/modify)"
|
|
734
|
+
},
|
|
735
|
+
"isTest": {
|
|
736
|
+
"type": "boolean",
|
|
737
|
+
"description": "Whether this file is a test file"
|
|
738
|
+
}
|
|
739
|
+
},
|
|
740
|
+
"required": [
|
|
741
|
+
"filePath",
|
|
742
|
+
"action",
|
|
743
|
+
"description",
|
|
744
|
+
"code"
|
|
745
|
+
]
|
|
746
|
+
}
|
|
747
|
+
},
|
|
748
|
+
"summary": {
|
|
749
|
+
"type": "string",
|
|
750
|
+
"description": "Brief summary of all fixes made"
|
|
751
|
+
},
|
|
752
|
+
"validationIssuesFixed": {
|
|
753
|
+
"type": "array",
|
|
754
|
+
"items": {
|
|
755
|
+
"type": "string"
|
|
756
|
+
},
|
|
757
|
+
"description": "List of validation issues that were fixed"
|
|
758
|
+
},
|
|
759
|
+
"testsCreated": {
|
|
760
|
+
"type": "array",
|
|
761
|
+
"items": {
|
|
762
|
+
"type": "string"
|
|
763
|
+
},
|
|
764
|
+
"description": "List of test files created or modified"
|
|
765
|
+
}
|
|
766
|
+
},
|
|
767
|
+
"required": [
|
|
768
|
+
"changes",
|
|
769
|
+
"summary",
|
|
770
|
+
"validationIssuesFixed"
|
|
771
|
+
]
|
|
223
772
|
},
|
|
224
|
-
"
|
|
773
|
+
"outputKey": "implementation",
|
|
774
|
+
"temperature": 0.5,
|
|
775
|
+
"allowedTools": [
|
|
776
|
+
"read",
|
|
777
|
+
"edit",
|
|
778
|
+
"write",
|
|
779
|
+
"bash",
|
|
780
|
+
"glob",
|
|
781
|
+
"grep",
|
|
782
|
+
"webfetch",
|
|
783
|
+
"websearch",
|
|
784
|
+
"question",
|
|
785
|
+
"skill",
|
|
786
|
+
"plan_enter",
|
|
787
|
+
"plan_exit",
|
|
788
|
+
"mcp__agentloop__get_task",
|
|
789
|
+
"mcp__agentloop__list_tasks",
|
|
790
|
+
"mcp__agentloop__send_agent_message",
|
|
791
|
+
"mcp__agentloop__receive_messages",
|
|
792
|
+
"mcp__agentloop__broadcast_message",
|
|
793
|
+
"mcp__git-worktree-toolbox__listProjects",
|
|
794
|
+
"mcp__git-worktree-toolbox__worktreeChanges",
|
|
795
|
+
"mcp__git-worktree-toolbox__generateMrLink",
|
|
796
|
+
"mcp__git-worktree-toolbox__mergeRemoteWorktreeChangesIntoLocal",
|
|
797
|
+
"mcp__agentloop-memory__index",
|
|
798
|
+
"mcp__agentloop-memory__semantic_search",
|
|
799
|
+
"mcp__agentloop-memory__find_similar_code",
|
|
800
|
+
"mcp__agentloop-memory__query",
|
|
801
|
+
"mcp__agentloop-memory__list_file_entities",
|
|
802
|
+
"mcp__agentloop-memory__list_entity_relationships",
|
|
803
|
+
"mcp__agentloop-memory__find_related_concepts",
|
|
804
|
+
"mcp__agentloop-memory__analyze_code_impact",
|
|
805
|
+
"mcp__agentloop-memory__analyze_hotspots",
|
|
806
|
+
"mcp__agentloop-memory__detect_code_clones",
|
|
807
|
+
"mcp__agentloop-memory__jscpd_detect_clones",
|
|
808
|
+
"mcp__agentloop-memory__suggest_refactoring",
|
|
809
|
+
"mcp__agentloop-memory__cross_language_search",
|
|
810
|
+
"mcp__agentloop-memory__get_graph_stats",
|
|
811
|
+
"mcp__agentloop-memory__get_graph_health",
|
|
812
|
+
"mcp__agentloop-memory__get_metrics",
|
|
813
|
+
"mcp__agentloop-memory__get_version",
|
|
814
|
+
"mcp__agentloop-memory__clean_index",
|
|
815
|
+
"mcp__agentloop-memory__reset_graph",
|
|
816
|
+
"mcp__agentloop-memory__get_graph"
|
|
817
|
+
]
|
|
225
818
|
}
|
|
226
|
-
|
|
227
|
-
"totalEstimate": { "type": "string" },
|
|
228
|
-
"criticalPath": { "type": "array", "items": { "type": "number" } },
|
|
229
|
-
"qaFeedbackAddressed": { "type": "string", "description": "If QA rejected this task before, explain how your plan addresses their feedback" }
|
|
819
|
+
]
|
|
230
820
|
},
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
821
|
+
{
|
|
822
|
+
"type": "action",
|
|
823
|
+
"call": "NoOp",
|
|
824
|
+
"comment": "First attempt - implementation is already on the blackboard from the QA/new-task selector above"
|
|
825
|
+
}
|
|
826
|
+
]
|
|
235
827
|
},
|
|
236
828
|
{
|
|
237
|
-
"type": "
|
|
238
|
-
"
|
|
239
|
-
"
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
"type": "
|
|
251
|
-
"
|
|
252
|
-
|
|
253
|
-
"action": { "type": "string", "enum": ["create", "modify", "delete"], "description": "The type of file operation" },
|
|
254
|
-
"description": { "type": "string", "description": "Brief description of what this change does" },
|
|
255
|
-
"code": { "type": "string", "description": "The complete file content to write (required for create/modify)" },
|
|
256
|
-
"stepNumber": { "type": "number", "description": "Which plan step this change implements" },
|
|
257
|
-
"isTest": { "type": "boolean", "description": "Whether this file is a test file" }
|
|
258
|
-
},
|
|
259
|
-
"required": ["filePath", "action", "description", "code"]
|
|
829
|
+
"type": "selector",
|
|
830
|
+
"comment": "Apply structured output changes OR detect direct subagent file writes",
|
|
831
|
+
"children": [
|
|
832
|
+
{
|
|
833
|
+
"type": "sequence",
|
|
834
|
+
"comment": "Primary path: apply structured output and stage specific files",
|
|
835
|
+
"children": [
|
|
836
|
+
{
|
|
837
|
+
"type": "action",
|
|
838
|
+
"call": "ApplyChanges",
|
|
839
|
+
"comment": "Apply the implementation changes from structured output to disk"
|
|
840
|
+
},
|
|
841
|
+
{
|
|
842
|
+
"type": "action",
|
|
843
|
+
"call": "StageChanges",
|
|
844
|
+
"comment": "Stage files listed in implementation.changes"
|
|
260
845
|
}
|
|
261
|
-
|
|
262
|
-
"summary": { "type": "string", "description": "Brief summary of all changes made" },
|
|
263
|
-
"completedSteps": { "type": "array", "items": { "type": "number" }, "description": "List of step numbers completed" },
|
|
264
|
-
"qaFeedbackAddressed": { "type": "string", "description": "If QA rejected this task before, explain how you addressed their feedback" },
|
|
265
|
-
"testsCreated": { "type": "array", "items": { "type": "string" }, "description": "List of test files created" }
|
|
846
|
+
]
|
|
266
847
|
},
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
}
|
|
275
|
-
},
|
|
276
|
-
"defaultBranch": "planned",
|
|
277
|
-
"confidenceThreshold": 0.7
|
|
278
|
-
}
|
|
279
|
-
]
|
|
280
|
-
}
|
|
281
|
-
]
|
|
282
|
-
},
|
|
283
|
-
{
|
|
284
|
-
"type": "selector",
|
|
285
|
-
"comment": "Implementation+Validation with escalation fallback. The retry(3) loop tries apply+validate up to 3 times, fixing issues between retries. If all retries fail, the escalation fallback blocks the task.",
|
|
286
|
-
"children": [
|
|
287
|
-
{
|
|
288
|
-
"type": "retry",
|
|
289
|
-
"attempts": 3,
|
|
290
|
-
"comment": "Happy path - apply changes, validate, succeed. On failure, FixValidationFailures re-implements and retries.",
|
|
291
|
-
"child": {
|
|
292
|
-
"type": "sequence",
|
|
293
|
-
"children": [
|
|
294
|
-
{
|
|
295
|
-
"type": "selector",
|
|
296
|
-
"comment": "On first attempt, implementation is already on blackboard (NoOp path). On retries, validationFailed is true so FixValidationFailures runs to re-implement based on validation feedback.",
|
|
297
|
-
"children": [
|
|
298
|
-
{
|
|
299
|
-
"type": "sequence",
|
|
300
|
-
"comment": "Retry path - fix validation failures from previous attempt",
|
|
301
|
-
"children": [
|
|
848
|
+
{
|
|
849
|
+
"type": "action",
|
|
850
|
+
"call": "DetectAndStageChanges",
|
|
851
|
+
"comment": "Fallback: the subagent wrote files directly via Claude Code tools. Detect and stage all worktree changes."
|
|
852
|
+
}
|
|
853
|
+
]
|
|
854
|
+
},
|
|
302
855
|
{
|
|
303
|
-
"type": "
|
|
304
|
-
"call": "
|
|
305
|
-
"comment": "
|
|
856
|
+
"type": "action",
|
|
857
|
+
"call": "DetectProjectType",
|
|
858
|
+
"comment": "Detect project type, test framework, and available test/lint commands"
|
|
859
|
+
},
|
|
860
|
+
{
|
|
861
|
+
"type": "selector",
|
|
862
|
+
"comment": "Try to install dependencies, continue if it fails",
|
|
863
|
+
"children": [
|
|
864
|
+
{
|
|
865
|
+
"type": "action",
|
|
866
|
+
"call": "InstallDependencies",
|
|
867
|
+
"comment": "Ensure dependencies are installed for test execution"
|
|
868
|
+
},
|
|
869
|
+
{
|
|
870
|
+
"type": "action",
|
|
871
|
+
"call": "NoOp",
|
|
872
|
+
"comment": "Continue even if dependency installation fails"
|
|
873
|
+
}
|
|
874
|
+
]
|
|
306
875
|
},
|
|
307
876
|
{
|
|
308
877
|
"type": "llm-action",
|
|
309
|
-
"name": "
|
|
310
|
-
"prompt": "You are
|
|
311
|
-
"contextKeys": [
|
|
878
|
+
"name": "PreCommitCodeReview",
|
|
879
|
+
"prompt": "You are performing pre-commit code quality validation. Your job is to catch and fix issues BEFORE the code is sent to QA review.\n\nThe implementation has been applied to disk. You MUST read the actual files from disk using Read/Grep/Glob tools, run the test suite (if one exists), and fix any issues found.\n\n## Required Checks\n\n### 1. Import/Export Verification\nFor every source and test file in the implementation, verify that all imports reference actual exports:\n- Read each file and identify all imports\n- Read the corresponding source modules and verify those exports exist\n- Common issues: tests importing non-existent functions, selectors, types, or constants\n- Fix: Add missing exports to source files, or correct invalid imports in tests\n\n### 2. Test Isolation\nVerify each test file properly isolates state between test cases:\n- State stores (Redux, Zustand, MobX, etc.): Each test must create a fresh store or reset state in beforeEach/afterEach\n- Mocks: Cleared between tests (jest.clearAllMocks, sinon.restore, vi.restoreAllMocks, etc.)\n- Singletons: Reset between tests if tested\n- Global/module-level state: No test should depend on side effects from previous tests\n- Database/API mocks: Mock responses scoped per-test, not shared\n- Fix: Add proper setup/teardown hooks to test files\n\n### 3. Implementation Completeness\nCross-reference the task acceptance criteria with actual code:\n- Verify functions and methods have real logic, not empty shells or stubs\n- Check that event listeners, callbacks, and subscriptions are actually wired up and functional\n- Ensure all integration points are connected, not just type-correct\n- Verify module wiring: if module A should respond to events from module B, trace the actual connection\n- Fix: Complete any incomplete implementations\n\n### 4. Run Tests\nExecute the project test suite and analyze results:\n- Use the detected test command for this project type\n- If tests fail, analyze failure output to identify root causes (not just symptoms)\n- Fix the root causes in source or test files\n- Re-run tests to confirm fixes work\n- Repeat fix-and-rerun up to 2 cycles\n\n**IMPORTANT: Greenfield / New Projects Without Test Infrastructure**\nIf this is a brand-new project being created from scratch (greenfield) and there is NO existing test framework, test runner, or test configuration:\n- Set `testsRun: false` and `testsPassed: false`\n- Set `noTestInfrastructure: true`\n- Set `allIssuesResolved: true` if the code review checks (import/export, completeness, isolation) all pass\n- In `testOutput`, explain that no test framework exists in the project\n- Do NOT waste retries trying to install a test framework just to pass validation\n- The implementation itself (created files, working code, proper structure) is what matters for greenfield tasks\n\nSigns that a project has no test infrastructure:\n- No test runner configured (no jest, vitest, mocha, pytest, etc. in dependencies)\n- No test scripts in package.json (no \"test\" script, or test script is the default npm placeholder)\n- No test configuration files (no jest.config.*, vitest.config.*, etc.)\n- No existing test files in the project\n- Project was just created by the engineer in this task\n\n### 5. Distinguish Pre-Existing Failures from Task-Related Failures\nWhen analyzing test results, carefully distinguish between:\n- **Task-related failures**: Tests that fail because of code YOU changed or created in this task. These MUST be fixed.\n- **Pre-existing failures**: Tests that were already failing BEFORE your changes \u2014 e.g., dependency version mismatches, flaky infrastructure tests, tests for features not yet implemented by other tasks, environment-specific issues. These are NOT your responsibility to fix.\n\nTo determine if a failure is pre-existing:\n- Check if the failing test file is unrelated to any files you modified\n- Check if the error is about missing dependencies, version mismatches, or environment issues that exist independently of your changes\n- If ALL test failures are pre-existing and unrelated to your task, set `testsPassed: true` (your task's tests pass) and `preExistingFailuresOnly: true`\n- If ANY failure is related to your task changes, set `testsPassed: false` and `preExistingFailuresOnly: false`\n\nTask: {{taskDescription}}\nImplementation: {{implementation}}\n\n{{taskComments}}\n\nFix all task-related issues you find. Report what was found and fixed. For pre-existing failures, document them in testOutput but do not waste time trying to fix them.",
|
|
880
|
+
"contextKeys": [
|
|
881
|
+
"implementation",
|
|
882
|
+
"taskDescription",
|
|
883
|
+
"codebaseContext",
|
|
884
|
+
"projectInfo",
|
|
885
|
+
"taskComments"
|
|
886
|
+
],
|
|
312
887
|
"subagent": "engineer",
|
|
313
|
-
"maxTurns":
|
|
888
|
+
"maxTurns": 200,
|
|
314
889
|
"outputSchema": {
|
|
315
890
|
"type": "object",
|
|
316
891
|
"properties": {
|
|
317
|
-
"
|
|
892
|
+
"importExportIssues": {
|
|
318
893
|
"type": "array",
|
|
319
|
-
"minItems": 1,
|
|
320
|
-
"description": "List of file changes to fix validation issues",
|
|
321
894
|
"items": {
|
|
322
|
-
"type": "
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
895
|
+
"type": "string"
|
|
896
|
+
},
|
|
897
|
+
"description": "Import/export issues found and fixed"
|
|
898
|
+
},
|
|
899
|
+
"testIsolationIssues": {
|
|
900
|
+
"type": "array",
|
|
901
|
+
"items": {
|
|
902
|
+
"type": "string"
|
|
903
|
+
},
|
|
904
|
+
"description": "Test isolation issues found and fixed"
|
|
905
|
+
},
|
|
906
|
+
"completenessIssues": {
|
|
907
|
+
"type": "array",
|
|
908
|
+
"items": {
|
|
909
|
+
"type": "string"
|
|
910
|
+
},
|
|
911
|
+
"description": "Implementation completeness issues found and fixed"
|
|
912
|
+
},
|
|
913
|
+
"testsRun": {
|
|
914
|
+
"type": "boolean",
|
|
915
|
+
"description": "Whether tests were executed"
|
|
916
|
+
},
|
|
917
|
+
"testsPassed": {
|
|
918
|
+
"type": "boolean",
|
|
919
|
+
"description": "Whether all tests passed after fixes"
|
|
920
|
+
},
|
|
921
|
+
"testOutput": {
|
|
922
|
+
"type": "string",
|
|
923
|
+
"description": "Summary of final test run output including any error messages. Always provide this even if tests were not run - describe what prevented them from running."
|
|
924
|
+
},
|
|
925
|
+
"filesModified": {
|
|
926
|
+
"type": "array",
|
|
927
|
+
"items": {
|
|
928
|
+
"type": "string"
|
|
929
|
+
},
|
|
930
|
+
"description": "Files modified during validation"
|
|
931
|
+
},
|
|
932
|
+
"allIssuesResolved": {
|
|
933
|
+
"type": "boolean",
|
|
934
|
+
"description": "Whether all found issues were successfully resolved"
|
|
332
935
|
},
|
|
333
|
-
"
|
|
334
|
-
|
|
335
|
-
|
|
936
|
+
"preExistingFailuresOnly": {
|
|
937
|
+
"type": "boolean",
|
|
938
|
+
"description": "Set to true ONLY when testsPassed is false AND every single test failure is a pre-existing issue completely unrelated to this task's changes (e.g., dependency version mismatches, environment issues, tests for other features). If ANY failure is related to your task changes, this MUST be false. Defaults to false.",
|
|
939
|
+
"default": false
|
|
940
|
+
},
|
|
941
|
+
"noTestInfrastructure": {
|
|
942
|
+
"type": "boolean",
|
|
943
|
+
"description": "Set to true when the project has NO test framework, test runner, or test configuration installed. This is expected for greenfield projects created from scratch. When true, testsRun should be false and allIssuesResolved can be true if code review checks pass. Defaults to false.",
|
|
944
|
+
"default": false
|
|
945
|
+
}
|
|
336
946
|
},
|
|
337
|
-
"required": [
|
|
947
|
+
"required": [
|
|
948
|
+
"testsRun",
|
|
949
|
+
"testsPassed",
|
|
950
|
+
"testOutput",
|
|
951
|
+
"allIssuesResolved"
|
|
952
|
+
]
|
|
338
953
|
},
|
|
339
|
-
"outputKey": "
|
|
340
|
-
"temperature": 0.
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
954
|
+
"outputKey": "preCommitValidation",
|
|
955
|
+
"temperature": 0.3,
|
|
956
|
+
"allowedTools": [
|
|
957
|
+
"read",
|
|
958
|
+
"edit",
|
|
959
|
+
"write",
|
|
960
|
+
"bash",
|
|
961
|
+
"glob",
|
|
962
|
+
"grep",
|
|
963
|
+
"webfetch",
|
|
964
|
+
"websearch",
|
|
965
|
+
"question",
|
|
966
|
+
"skill",
|
|
967
|
+
"plan_enter",
|
|
968
|
+
"plan_exit",
|
|
969
|
+
"mcp__agentloop__get_task",
|
|
970
|
+
"mcp__agentloop__list_tasks",
|
|
971
|
+
"mcp__agentloop__send_agent_message",
|
|
972
|
+
"mcp__agentloop__receive_messages",
|
|
973
|
+
"mcp__agentloop__broadcast_message",
|
|
974
|
+
"mcp__git-worktree-toolbox__listProjects",
|
|
975
|
+
"mcp__git-worktree-toolbox__worktreeChanges",
|
|
976
|
+
"mcp__git-worktree-toolbox__generateMrLink",
|
|
977
|
+
"mcp__git-worktree-toolbox__mergeRemoteWorktreeChangesIntoLocal",
|
|
978
|
+
"mcp__agentloop-memory__index",
|
|
979
|
+
"mcp__agentloop-memory__semantic_search",
|
|
980
|
+
"mcp__agentloop-memory__find_similar_code",
|
|
981
|
+
"mcp__agentloop-memory__query",
|
|
982
|
+
"mcp__agentloop-memory__list_file_entities",
|
|
983
|
+
"mcp__agentloop-memory__list_entity_relationships",
|
|
984
|
+
"mcp__agentloop-memory__find_related_concepts",
|
|
985
|
+
"mcp__agentloop-memory__analyze_code_impact",
|
|
986
|
+
"mcp__agentloop-memory__analyze_hotspots",
|
|
987
|
+
"mcp__agentloop-memory__detect_code_clones",
|
|
988
|
+
"mcp__agentloop-memory__jscpd_detect_clones",
|
|
989
|
+
"mcp__agentloop-memory__suggest_refactoring",
|
|
990
|
+
"mcp__agentloop-memory__cross_language_search",
|
|
991
|
+
"mcp__agentloop-memory__get_graph_stats",
|
|
992
|
+
"mcp__agentloop-memory__get_graph_health",
|
|
993
|
+
"mcp__agentloop-memory__get_metrics",
|
|
994
|
+
"mcp__agentloop-memory__get_version",
|
|
995
|
+
"mcp__agentloop-memory__clean_index",
|
|
996
|
+
"mcp__agentloop-memory__reset_graph",
|
|
997
|
+
"mcp__agentloop-memory__get_graph"
|
|
998
|
+
]
|
|
999
|
+
},
|
|
359
1000
|
{
|
|
360
1001
|
"type": "action",
|
|
361
|
-
"call": "
|
|
362
|
-
"comment": "
|
|
1002
|
+
"call": "DetectAndStageChanges",
|
|
1003
|
+
"comment": "Re-stage all changes including any fixes applied during validation"
|
|
363
1004
|
},
|
|
364
1005
|
{
|
|
365
1006
|
"type": "action",
|
|
366
|
-
"call": "
|
|
367
|
-
"comment": "
|
|
1007
|
+
"call": "CheckValidationPassed",
|
|
1008
|
+
"comment": "Check if preCommitValidation.allIssuesResolved is true. If false, sets validationFailed=true and FAILs the sequence, triggering a retry."
|
|
368
1009
|
}
|
|
369
1010
|
]
|
|
370
|
-
},
|
|
371
|
-
{
|
|
372
|
-
"type": "action",
|
|
373
|
-
"call": "DetectAndStageChanges",
|
|
374
|
-
"comment": "Fallback: the subagent wrote files directly via Claude Code tools. Detect and stage all worktree changes."
|
|
375
|
-
}
|
|
376
|
-
]
|
|
377
|
-
},
|
|
378
|
-
{
|
|
379
|
-
"type": "action",
|
|
380
|
-
"call": "DetectProjectType",
|
|
381
|
-
"comment": "Detect project type, test framework, and available test/lint commands"
|
|
382
|
-
},
|
|
383
|
-
{
|
|
384
|
-
"type": "selector",
|
|
385
|
-
"comment": "Try to install dependencies, continue if it fails",
|
|
386
|
-
"children": [
|
|
387
|
-
{
|
|
388
|
-
"type": "action",
|
|
389
|
-
"call": "InstallDependencies",
|
|
390
|
-
"comment": "Ensure dependencies are installed for test execution"
|
|
391
|
-
},
|
|
392
|
-
{
|
|
393
|
-
"type": "action",
|
|
394
|
-
"call": "NoOp",
|
|
395
|
-
"comment": "Continue even if dependency installation fails"
|
|
396
1011
|
}
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
"outputSchema": {
|
|
407
|
-
"type": "object",
|
|
408
|
-
"properties": {
|
|
409
|
-
"importExportIssues": {
|
|
410
|
-
"type": "array",
|
|
411
|
-
"items": { "type": "string" },
|
|
412
|
-
"description": "Import/export issues found and fixed"
|
|
413
|
-
},
|
|
414
|
-
"testIsolationIssues": {
|
|
415
|
-
"type": "array",
|
|
416
|
-
"items": { "type": "string" },
|
|
417
|
-
"description": "Test isolation issues found and fixed"
|
|
1012
|
+
},
|
|
1013
|
+
{
|
|
1014
|
+
"type": "sequence",
|
|
1015
|
+
"comment": "Escalation fallback - all 3 retry attempts failed validation. Record the failure, return the task for a fresh engineer retry, and continue to next task.",
|
|
1016
|
+
"children": [
|
|
1017
|
+
{
|
|
1018
|
+
"type": "action",
|
|
1019
|
+
"call": "EscalateValidationFailure",
|
|
1020
|
+
"comment": "Add detailed validation failure context and prepare a fresh engineer retry"
|
|
418
1021
|
},
|
|
419
|
-
|
|
420
|
-
"type": "
|
|
421
|
-
"
|
|
422
|
-
"
|
|
1022
|
+
{
|
|
1023
|
+
"type": "action",
|
|
1024
|
+
"call": "ReportTriggerFail",
|
|
1025
|
+
"comment": "Report trigger fail after validation exhaustion - the task will be returned for a fresh engineer retry"
|
|
423
1026
|
},
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
"type": "array",
|
|
429
|
-
"items": { "type": "string" },
|
|
430
|
-
"description": "Files modified during validation"
|
|
1027
|
+
{
|
|
1028
|
+
"type": "action",
|
|
1029
|
+
"call": "ClearTaskContext",
|
|
1030
|
+
"comment": "Reset task-specific blackboard keys to prepare for next task assignment"
|
|
431
1031
|
},
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
"comment": "Re-stage all changes including any fixes applied during validation"
|
|
443
|
-
},
|
|
444
|
-
{
|
|
445
|
-
"type": "action",
|
|
446
|
-
"call": "CheckValidationPassed",
|
|
447
|
-
"comment": "Check if preCommitValidation.allIssuesResolved is true. If false, sets validationFailed=true and FAILs the sequence, triggering a retry."
|
|
448
|
-
}
|
|
449
|
-
]
|
|
450
|
-
}
|
|
1032
|
+
{
|
|
1033
|
+
"type": "action",
|
|
1034
|
+
"call": "Loop",
|
|
1035
|
+
"comment": "Return RUNNING to restart the BT from the root - wait for next task"
|
|
1036
|
+
}
|
|
1037
|
+
]
|
|
1038
|
+
}
|
|
1039
|
+
]
|
|
1040
|
+
}
|
|
1041
|
+
]
|
|
451
1042
|
},
|
|
452
1043
|
{
|
|
453
1044
|
"type": "sequence",
|
|
454
|
-
"comment": "
|
|
1045
|
+
"comment": "Catastrophic failure fallback - implementation LLM call or entire validation loop failed (timeout, API error, etc.). EscalateValidationFailure detects that preCommitValidation is null and produces an [IMPLEMENTATION FAILURE] message instead of a misleading validation exhaustion message.",
|
|
455
1046
|
"children": [
|
|
456
1047
|
{
|
|
457
1048
|
"type": "action",
|
|
458
1049
|
"call": "EscalateValidationFailure",
|
|
459
|
-
"comment": "
|
|
1050
|
+
"comment": "Detects catastrophic vs validation failure and adds appropriate failure comment. When preCommitValidation is null (implementation failed), uses [IMPLEMENTATION FAILURE] message."
|
|
1051
|
+
},
|
|
1052
|
+
{
|
|
1053
|
+
"type": "action",
|
|
1054
|
+
"call": "ReportTriggerFail",
|
|
1055
|
+
"comment": "Report trigger fail - orchestrator will block the task"
|
|
460
1056
|
},
|
|
461
1057
|
{
|
|
462
1058
|
"type": "action",
|
|
@@ -480,17 +1076,35 @@
|
|
|
480
1076
|
"type": "llm-action",
|
|
481
1077
|
"name": "PrepareCommit",
|
|
482
1078
|
"prompt": "Prepare a commit message for the changes.\n\nImplementation: {{implementation}}\nTask: {{taskDescription}}\n\n{{taskComments}}\n\nWrite a clear, concise commit message following conventional commits format. If this was a re-work due to QA feedback, mention that in the commit message.",
|
|
483
|
-
"contextKeys": [
|
|
1079
|
+
"contextKeys": [
|
|
1080
|
+
"implementation",
|
|
1081
|
+
"taskDescription",
|
|
1082
|
+
"taskAnalysis",
|
|
1083
|
+
"taskComments"
|
|
1084
|
+
],
|
|
484
1085
|
"outputSchema": {
|
|
485
1086
|
"type": "object",
|
|
486
1087
|
"properties": {
|
|
487
|
-
"commitMessage": {
|
|
488
|
-
|
|
1088
|
+
"commitMessage": {
|
|
1089
|
+
"type": "string",
|
|
1090
|
+
"description": "The commit message"
|
|
1091
|
+
},
|
|
1092
|
+
"files": {
|
|
1093
|
+
"type": "array",
|
|
1094
|
+
"items": {
|
|
1095
|
+
"type": "string"
|
|
1096
|
+
},
|
|
1097
|
+
"description": "Files to be committed"
|
|
1098
|
+
}
|
|
489
1099
|
},
|
|
490
|
-
"required": [
|
|
1100
|
+
"required": [
|
|
1101
|
+
"commitMessage",
|
|
1102
|
+
"files"
|
|
1103
|
+
]
|
|
491
1104
|
},
|
|
492
1105
|
"outputKey": "commitInfo",
|
|
493
|
-
"temperature": 0.3
|
|
1106
|
+
"temperature": 0.3,
|
|
1107
|
+
"allowedTools": []
|
|
494
1108
|
},
|
|
495
1109
|
{
|
|
496
1110
|
"type": "action",
|
|
@@ -510,19 +1124,9 @@
|
|
|
510
1124
|
"comment": "Push the branch to remote so QA and CI can access the changes"
|
|
511
1125
|
},
|
|
512
1126
|
{
|
|
513
|
-
"type": "
|
|
514
|
-
"
|
|
515
|
-
"
|
|
516
|
-
"contextKeys": ["taskDescription", "implementation", "preCommitValidation", "projectInfo"],
|
|
517
|
-
"outputSchema": {
|
|
518
|
-
"type": "object",
|
|
519
|
-
"properties": {
|
|
520
|
-
"comment": { "type": "string", "description": "The full completion comment including [TASK_FILES] and [TEST_SETUP] blocks" }
|
|
521
|
-
},
|
|
522
|
-
"required": ["comment"]
|
|
523
|
-
},
|
|
524
|
-
"outputKey": "completionComment",
|
|
525
|
-
"temperature": 0.3
|
|
1127
|
+
"type": "action",
|
|
1128
|
+
"call": "PrepareCompletionComment",
|
|
1129
|
+
"comment": "Build the completion comment deterministically from blackboard data (implementation, projectInfo, preCommitValidation). Previously an llm-action that hung on non-Anthropic models like MiniMax-M2.5."
|
|
526
1130
|
},
|
|
527
1131
|
{
|
|
528
1132
|
"type": "action",
|
|
@@ -547,12 +1151,12 @@
|
|
|
547
1151
|
{
|
|
548
1152
|
"type": "action",
|
|
549
1153
|
"call": "ReportVerification",
|
|
550
|
-
"comment": "Report verification results (from PreCommitCodeReview)
|
|
1154
|
+
"comment": "Report verification results (from PreCommitCodeReview) before reporting trigger pass"
|
|
551
1155
|
},
|
|
552
1156
|
{
|
|
553
1157
|
"type": "action",
|
|
554
|
-
"call": "
|
|
555
|
-
"comment": "
|
|
1158
|
+
"call": "ReportTriggerPass",
|
|
1159
|
+
"comment": "Report trigger pass - orchestrator will advance task to next column"
|
|
556
1160
|
},
|
|
557
1161
|
{
|
|
558
1162
|
"type": "selector",
|
|
@@ -612,6 +1216,7 @@
|
|
|
612
1216
|
"loopCount": 0,
|
|
613
1217
|
"incomingMessages": [],
|
|
614
1218
|
"coordinationMessage": null,
|
|
615
|
-
"messageResponse": null
|
|
1219
|
+
"messageResponse": null,
|
|
1220
|
+
"isColumnTriggered": false
|
|
616
1221
|
}
|
|
617
1222
|
}
|