forked from SynkraAI/aiox-core
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathqa-loop.yaml
More file actions
443 lines (353 loc) · 18.3 KB
/
Copy pathqa-loop.yaml
File metadata and controls
443 lines (353 loc) · 18.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
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
115
116
117
118
119
120
121
122
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
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
workflow:
id: qa-loop
name: QA Loop Orchestrator - Review Fix Re-review Cycle
version: "1.0"
description: >-
Automated QA loop that orchestrates the review → fix → re-review cycle.
Runs up to maxIterations (default 5), tracking each iteration's results.
Escalates to human when max iterations reached or manual stop requested.
Part of Epic 6 - QA Evolution: Autonomous Development Engine (ADE).
type: loop
project_types:
- aiox-development
- autonomous-development
- qa-automation
# ═══════════════════════════════════════════════════════════════════════════════════
# TRIGGER CONFIGURATION
# ═══════════════════════════════════════════════════════════════════════════════════
triggers:
# Primary trigger: Explicit command to start loop
- event: command
command: "*qa-loop"
action: start_loop
# Start from specific phase
- event: command
command: "*qa-loop-review"
action: run_step
step: review
- event: command
command: "*qa-loop-fix"
action: run_step
step: fix
# Stop command (AC5)
- event: command
command: "*stop-qa-loop"
action: stop_loop
# Resume command
- event: command
command: "*resume-qa-loop"
action: resume_loop
# Force escalation
- event: command
command: "*escalate-qa-loop"
action: escalate
# ═══════════════════════════════════════════════════════════════════════════════════
# CONFIGURATION
# ═══════════════════════════════════════════════════════════════════════════════════
config:
# AC2: Maximum iterations (configurable)
maxIterations: 5
configPath: autoClaude.qaLoop.maxIterations
# Progress tracking
showProgress: true
verbose: true
# Status file location (AC4)
statusFile: qa/loop-status.json
# Dashboard integration (AC7)
dashboardStatusPath: .aiox/dashboard/status.json
legacyStatusPath: .aiox/status.json
# Timeout per phase (milliseconds)
reviewTimeout: 1800000 # 30 minutes
fixTimeout: 3600000 # 60 minutes
# Retry configuration
maxRetries: 2
retryDelay: 5000
# ═══════════════════════════════════════════════════════════════════════════════════
# LOOP STATUS SCHEMA (AC4)
# ═══════════════════════════════════════════════════════════════════════════════════
status_schema:
storyId: string
currentIteration: number
maxIterations: number
status: "pending | in_progress | completed | stopped | escalated"
startedAt: ISO-8601
updatedAt: ISO-8601
history:
- iteration: number
reviewedAt: ISO-8601
verdict: "APPROVE | REJECT | BLOCKED"
issuesFound: number
fixedAt: ISO-8601 | null
issuesFixed: number | null
duration: number # milliseconds
# ═══════════════════════════════════════════════════════════════════════════════════
# WORKFLOW SEQUENCE
# ═══════════════════════════════════════════════════════════════════════════════════
sequence:
# ═════════════════════════════════════════════════════════════════════════════════
# STEP 1: REVIEW (QA Agent)
# ═════════════════════════════════════════════════════════════════════════════════
- step: review
phase: 1
phase_name: "QA Review"
agent: qa
description: >-
Execute comprehensive QA review of the story implementation.
Produces a verdict: APPROVE, REJECT, or BLOCKED.
task: qa-review-story.md
inputs:
storyId: "{storyId}"
iteration: "{currentIteration}"
previousIssues: "{history[-1].issuesFound|0}"
outputs:
- gate-file.yaml
- verdict
- issuesFound
timeout: "{config.reviewTimeout}"
on_success:
log: "Review complete: {verdict} ({issuesFound} issues)"
next: check_verdict
on_failure:
action: retry
max_retries: "{config.maxRetries}"
on_exhausted: escalate
# ═════════════════════════════════════════════════════════════════════════════════
# STEP 2: CHECK VERDICT (AC1)
# ═════════════════════════════════════════════════════════════════════════════════
- step: check_verdict
phase: 2
phase_name: "Verdict Check"
agent: system
description: >-
Evaluate the review verdict and determine next action.
APPROVE = complete, REJECT = continue to fix, BLOCKED = escalate.
condition_check:
- condition: verdict == "APPROVE"
action: complete
log: "Story APPROVED after {currentIteration} iteration(s)"
- condition: verdict == "BLOCKED"
action: escalate
reason: "QA review BLOCKED - requires human intervention"
- condition: verdict == "REJECT"
action: continue
next: create_fix_request
# ═════════════════════════════════════════════════════════════════════════════════
# STEP 3: CREATE FIX REQUEST (QA Agent)
# ═════════════════════════════════════════════════════════════════════════════════
- step: create_fix_request
phase: 3
phase_name: "Create Fix Request"
agent: qa
description: >-
Generate a structured fix request document from review findings.
Prioritizes issues and provides actionable fix instructions.
task: qa-create-fix-request.md
inputs:
storyId: "{storyId}"
gateFile: "{outputs.review.gate-file}"
iteration: "{currentIteration}"
outputs:
- fix-request.md
- prioritizedIssues
on_success:
log: "Fix request created with {prioritizedIssues.length} prioritized issues"
next: fix_issues
on_failure:
action: continue
fallback: "Use raw gate file for fixes"
# ═════════════════════════════════════════════════════════════════════════════════
# STEP 4: FIX ISSUES (Dev Agent)
# ═════════════════════════════════════════════════════════════════════════════════
- step: fix_issues
phase: 4
phase_name: "Apply Fixes"
agent: dev
description: >-
Developer agent applies fixes based on the fix request.
Runs tests and validates changes.
task: dev-apply-qa-fixes.md
inputs:
storyId: "{storyId}"
fixRequest: "{outputs.create_fix_request.fix-request}"
iteration: "{currentIteration}"
outputs:
- fixes-applied.json
- issuesFixed
timeout: "{config.fixTimeout}"
on_success:
log: "Fixed {issuesFixed} of {issuesFound} issues"
next: increment_iteration
on_failure:
action: retry
max_retries: "{config.maxRetries}"
on_exhausted:
action: escalate
reason: "Dev agent unable to apply fixes after retries"
# ═════════════════════════════════════════════════════════════════════════════════
# STEP 5: INCREMENT ITERATION (AC2)
# ═════════════════════════════════════════════════════════════════════════════════
- step: increment_iteration
phase: 5
phase_name: "Check Iteration"
agent: system
description: >-
Increment iteration counter and check against max.
If max reached, escalate to human (AC3).
action: increment_and_check
condition_check:
- condition: currentIteration >= maxIterations
action: escalate
reason: "Max iterations ({maxIterations}) reached without APPROVE"
log: "Max iterations reached - escalating to human"
- condition: currentIteration < maxIterations
action: continue
next: review
log: "Starting iteration {currentIteration + 1}/{maxIterations}"
# ═══════════════════════════════════════════════════════════════════════════════════
# ESCALATION (AC3)
# ═══════════════════════════════════════════════════════════════════════════════════
escalation:
enabled: true
triggers:
- max_iterations_reached
- verdict_blocked
- fix_failure
- manual_escalate
action:
log: "Escalating to human with full context"
status: "escalated"
context_package:
- loop-status.json
- all gate files from history
- all fix requests
- summary of iterations
notification:
message: |
QA Loop Escalation for {storyId}
Reason: {escalation.reason}
Iterations completed: {currentIteration}
Last verdict: {history[-1].verdict}
Outstanding issues: {history[-1].issuesFound - history[-1].issuesFixed}
Review the context package and decide:
1. Resume loop: *resume-qa-loop {storyId}
2. Manually fix and approve
3. Reject story and create follow-up
channels: [log, console]
# ═══════════════════════════════════════════════════════════════════════════════════
# WORKFLOW COMPLETION (AC6)
# ═══════════════════════════════════════════════════════════════════════════════════
completion:
success_message: |
╔══════════════════════════════════════════════════════════════╗
║ QA Loop Complete ║
╚══════════════════════════════════════════════════════════════╝
Story: {storyId}
Status: {status}
Iterations: {currentIteration}/{maxIterations}
Final Verdict: {history[-1].verdict}
Iteration History:
{history.map(h => ` ${h.iteration}. ${h.verdict} - ${h.issuesFound} found, ${h.issuesFixed || 0} fixed`).join('\n')}
Duration: {totalDuration}
summary:
storyId: "{storyId}"
status: "{status}"
iterations: "{currentIteration}"
finalVerdict: "{history[-1].verdict}"
totalIssuesFound: "{history.reduce((sum, h) => sum + h.issuesFound, 0)}"
totalIssuesFixed: "{history.reduce((sum, h) => sum + (h.issuesFixed || 0), 0)}"
duration: "{totalDuration}"
outputs:
- loop-status.json
- summary.md
# ═══════════════════════════════════════════════════════════════════════════════════
# ERROR HANDLING
# ═══════════════════════════════════════════════════════════════════════════════════
error_handling:
missing_story_id:
message: "Story ID is required"
suggestion: "Usage: *qa-loop STORY-42"
action: prompt
review_timeout:
message: "Review phase timed out"
suggestion: "Check QA agent status and retry: *resume-qa-loop {storyId}"
action: escalate
fix_timeout:
message: "Fix phase timed out"
suggestion: "Check Dev agent status and retry: *resume-qa-loop {storyId}"
action: escalate
invalid_status:
message: "Loop status file is corrupted or invalid"
suggestion: "Reset loop: *qa-loop {storyId} --reset"
action: halt
# ═══════════════════════════════════════════════════════════════════════════════════
# STOP/RESUME SUPPORT (AC5)
# ═══════════════════════════════════════════════════════════════════════════════════
control:
stop:
command: "*stop-qa-loop"
action: |
- Set status to "stopped"
- Save current state to loop-status.json
- Log: "QA loop stopped at iteration {currentIteration}"
- Allow resume later
resume:
command: "*resume-qa-loop"
action: |
- Load state from loop-status.json
- Verify status was "stopped" or "escalated"
- Set status to "in_progress"
- Continue from last step
- Log: "QA loop resumed at iteration {currentIteration}"
reset:
command: "*qa-loop --reset"
action: |
- Delete loop-status.json
- Start fresh loop
- Log: "QA loop reset for {storyId}"
# ═══════════════════════════════════════════════════════════════════════════════════
# DASHBOARD INTEGRATION (AC7)
# ═══════════════════════════════════════════════════════════════════════════════════
integration:
status_json:
track_loop: true
field: qaLoop
update_on_each_iteration: true
schema:
storyId: string
status: string
currentIteration: number
maxIterations: number
lastVerdict: string
lastIssuesFound: number
updatedAt: ISO-8601
project_status:
update_story_status: true
status_field: qaLoopStatus
notifications:
on_approve:
message: "QA Loop APPROVED: {storyId}"
channels: [log]
on_escalate:
message: "QA Loop ESCALATED: {storyId} - needs attention"
channels: [log]
on_stop:
message: "QA Loop STOPPED: {storyId}"
channels: [log]
# ═══════════════════════════════════════════════════════════════════════════════════
# METADATA
# ═══════════════════════════════════════════════════════════════════════════════════
metadata:
story: "6.5"
epic: "Epic 6 - QA Evolution"
created: "2026-01-29"
author: "@architect (Aria)"
dependencies:
- qa-review-story.md
- qa-create-fix-request.md
- dev-apply-qa-fixes.md
tags:
- qa-loop
- workflow
- orchestration
- ade
- autonomous