qaa-agent 1.6.2 → 1.7.0
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/.mcp.json +8 -8
- package/CHANGELOG.md +93 -71
- package/CLAUDE.md +553 -553
- package/agents/qa-pipeline-orchestrator.md +1378 -1378
- package/agents/qaa-analyzer.md +539 -524
- package/agents/qaa-bug-detective.md +479 -446
- package/agents/qaa-codebase-mapper.md +935 -935
- package/agents/qaa-discovery.md +384 -0
- package/agents/qaa-e2e-runner.md +416 -415
- package/agents/qaa-executor.md +651 -651
- package/agents/qaa-planner.md +405 -390
- package/agents/qaa-project-researcher.md +319 -319
- package/agents/qaa-scanner.md +424 -424
- package/agents/qaa-testid-injector.md +643 -585
- package/agents/qaa-validator.md +490 -452
- package/bin/install.cjs +200 -198
- package/bin/lib/commands.cjs +709 -709
- package/bin/lib/config.cjs +307 -307
- package/bin/lib/core.cjs +497 -497
- package/bin/lib/frontmatter.cjs +299 -299
- package/bin/lib/init.cjs +989 -989
- package/bin/lib/milestone.cjs +241 -241
- package/bin/lib/model-profiles.cjs +60 -60
- package/bin/lib/phase.cjs +911 -911
- package/bin/lib/roadmap.cjs +306 -306
- package/bin/lib/state.cjs +748 -748
- package/bin/lib/template.cjs +222 -222
- package/bin/lib/verify.cjs +842 -842
- package/bin/qaa-tools.cjs +607 -607
- package/commands/qa-audit.md +119 -0
- package/commands/qa-create-test.md +288 -0
- package/commands/qa-fix.md +147 -0
- package/commands/qa-map.md +137 -0
- package/{.claude/commands → commands}/qa-pr.md +23 -23
- package/{.claude/commands → commands}/qa-start.md +22 -22
- package/{.claude/commands → commands}/qa-testid.md +19 -19
- package/docs/COMMANDS.md +341 -341
- package/docs/DEMO.md +182 -182
- package/docs/TESTING.md +156 -156
- package/package.json +6 -7
- package/{.claude/settings.json → settings.json} +1 -2
- package/templates/failure-classification.md +391 -391
- package/templates/gap-analysis.md +409 -409
- package/templates/pr-template.md +48 -48
- package/templates/qa-analysis.md +381 -381
- package/templates/qa-audit-report.md +465 -465
- package/templates/qa-repo-blueprint.md +636 -636
- package/templates/scan-manifest.md +312 -312
- package/templates/test-inventory.md +582 -582
- package/templates/testid-audit-report.md +354 -354
- package/templates/validation-report.md +243 -243
- package/workflows/qa-analyze.md +296 -296
- package/workflows/qa-from-ticket.md +536 -536
- package/workflows/qa-gap.md +309 -303
- package/workflows/qa-pr.md +389 -389
- package/workflows/qa-start.md +1192 -1168
- package/workflows/qa-testid.md +384 -356
- package/workflows/qa-validate.md +299 -295
- package/.claude/commands/create-test.md +0 -164
- package/.claude/commands/qa-audit.md +0 -37
- package/.claude/commands/qa-blueprint.md +0 -54
- package/.claude/commands/qa-fix.md +0 -36
- package/.claude/commands/qa-from-ticket.md +0 -24
- package/.claude/commands/qa-gap.md +0 -20
- package/.claude/commands/qa-map.md +0 -47
- package/.claude/commands/qa-pom.md +0 -36
- package/.claude/commands/qa-pyramid.md +0 -37
- package/.claude/commands/qa-report.md +0 -38
- package/.claude/commands/qa-research.md +0 -33
- package/.claude/commands/qa-validate.md +0 -42
- package/.claude/commands/update-test.md +0 -58
- package/.claude/skills/qa-learner/SKILL.md +0 -150
- /package/{.claude/skills → skills}/qa-bug-detective/SKILL.md +0 -0
- /package/{.claude/skills → skills}/qa-repo-analyzer/SKILL.md +0 -0
- /package/{.claude/skills → skills}/qa-self-validator/SKILL.md +0 -0
- /package/{.claude/skills → skills}/qa-template-engine/SKILL.md +0 -0
- /package/{.claude/skills → skills}/qa-testid-injector/SKILL.md +0 -0
- /package/{.claude/skills → skills}/qa-workflow-documenter/SKILL.md +0 -0
package/workflows/qa-validate.md
CHANGED
|
@@ -1,295 +1,299 @@
|
|
|
1
|
-
<purpose>
|
|
2
|
-
Validate existing test files against CLAUDE.md QA standards using a 4-layer check (Syntax, Structure, Dependencies, Logic). Runs a fix loop (validate, fix, re-validate) up to 3 times. If failures remain after the fix loop, optionally spawns the bug-detective agent to classify failures. Produces VALIDATION_REPORT.md and optionally FAILURE_CLASSIFICATION_REPORT.md. Use this workflow to audit test quality in any test suite -- whether generated by the QA pipeline or hand-written.
|
|
3
|
-
</purpose>
|
|
4
|
-
|
|
5
|
-
<required_reading>
|
|
6
|
-
- `CLAUDE.md` -- QA automation standards, quality gates, locator strategy, POM rules, assertion specificity rules
|
|
7
|
-
- `agents/qaa-validator.md` -- Validator agent definition (4-layer validation, fix loop, confidence assessment)
|
|
8
|
-
- `agents/qaa-bug-detective.md` -- Bug detective agent definition (failure classification, auto-fix for test errors)
|
|
9
|
-
- `templates/validation-report.md` -- VALIDATION_REPORT.md format contract
|
|
10
|
-
- `templates/failure-classification.md` -- FAILURE_CLASSIFICATION_REPORT.md format contract
|
|
11
|
-
</required_reading>
|
|
12
|
-
|
|
13
|
-
<process>
|
|
14
|
-
|
|
15
|
-
<step name="parse_arguments">
|
|
16
|
-
## Step 1: Parse Arguments
|
|
17
|
-
|
|
18
|
-
Parse `$ARGUMENTS` for the test directory path and optional flags.
|
|
19
|
-
|
|
20
|
-
**Supported arguments:**
|
|
21
|
-
- `<path>` -- Path to the test directory to validate (positional)
|
|
22
|
-
- `--classify` -- If set, spawn bug-detective after validation to classify remaining failures
|
|
23
|
-
- No arguments -- auto-detect test directories
|
|
24
|
-
|
|
25
|
-
**Parsing logic:**
|
|
26
|
-
|
|
27
|
-
```bash
|
|
28
|
-
TEST_DIR=""
|
|
29
|
-
CLASSIFY_FAILURES=false
|
|
30
|
-
|
|
31
|
-
# Parse positional path argument
|
|
32
|
-
# Parse --classify flag
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
**Validation:**
|
|
36
|
-
- If a path is provided, verify it exists and is a directory. If not, print error: `"Error: Test directory does not exist: {path}"` and STOP.
|
|
37
|
-
- If no path provided, proceed to auto-detection in the next step.
|
|
38
|
-
</step>
|
|
39
|
-
|
|
40
|
-
<step name="detect_test_directories">
|
|
41
|
-
## Step 2: Detect Test Directories
|
|
42
|
-
|
|
43
|
-
If no test directory was specified, auto-detect by searching for common test directory patterns.
|
|
44
|
-
|
|
45
|
-
**Detection order (check each, use the first match):**
|
|
46
|
-
|
|
47
|
-
1. `tests/` -- Standard test directory
|
|
48
|
-
2. `__tests__/` -- Jest convention
|
|
49
|
-
3. `cypress/` -- Cypress test directory
|
|
50
|
-
4. `e2e/` -- E2E test directory
|
|
51
|
-
5. `test/` -- Alternative singular form
|
|
52
|
-
6. `spec/` -- RSpec/generic spec directory
|
|
53
|
-
|
|
54
|
-
**Detection logic:**
|
|
55
|
-
|
|
56
|
-
```bash
|
|
57
|
-
if TEST_DIR is empty:
|
|
58
|
-
for dir in tests __tests__ cypress e2e test spec:
|
|
59
|
-
if directory exists at "${dir}":
|
|
60
|
-
TEST_DIR="${dir}"
|
|
61
|
-
break
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
**If no test directory found:**
|
|
65
|
-
|
|
66
|
-
Print error and STOP:
|
|
67
|
-
```
|
|
68
|
-
Error: No test directory found.
|
|
69
|
-
Searched for: tests/, __tests__/, cypress/, e2e/, test/, spec/
|
|
70
|
-
Provide the test directory path as an argument: /qa-validate <path>
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
**Count test files:**
|
|
74
|
-
|
|
75
|
-
```bash
|
|
76
|
-
TEST_FILE_COUNT=$(find "${TEST_DIR}" -type f \( -name "*.test.*" -o -name "*.spec.*" -o -name "*.cy.*" -o -name "*.e2e.*" \) | wc -l)
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
If `TEST_FILE_COUNT` is 0, print error: `"Error: No test files found in {TEST_DIR}. Expected files matching *.test.*, *.spec.*, *.cy.*, or *.e2e.*"` and STOP.
|
|
80
|
-
|
|
81
|
-
**Print detection results:**
|
|
82
|
-
|
|
83
|
-
```
|
|
84
|
-
Test directory: {TEST_DIR}
|
|
85
|
-
Test files found: {TEST_FILE_COUNT}
|
|
86
|
-
```
|
|
87
|
-
</step>
|
|
88
|
-
|
|
89
|
-
<step name="build_file_list">
|
|
90
|
-
## Step 3: Build File List for Validation
|
|
91
|
-
|
|
92
|
-
Enumerate all test files and supporting files (page objects, fixtures) to validate.
|
|
93
|
-
|
|
94
|
-
**File discovery:**
|
|
95
|
-
|
|
96
|
-
Glob for test-related files in the detected directory:
|
|
97
|
-
- Test specs: `**/*.test.*`, `**/*.spec.*`, `**/*.cy.*`, `**/*.e2e.*`
|
|
98
|
-
- Page objects: `**/pages/**/*`, `**/page-objects/**/*`, `**/support/page-objects/**/*`
|
|
99
|
-
- Fixtures: `**/fixtures/**/*`
|
|
100
|
-
- Config files: test framework configs at the project root
|
|
101
|
-
|
|
102
|
-
**Build a generation-plan-equivalent file list:**
|
|
103
|
-
|
|
104
|
-
The validator agent expects a file list (normally from the generation plan). For this workflow, construct a synthetic file list from the discovered files:
|
|
105
|
-
|
|
106
|
-
```markdown
|
|
107
|
-
## Files to Validate
|
|
108
|
-
|
|
109
|
-
| File Path | Type |
|
|
110
|
-
|-----------|------|
|
|
111
|
-
| tests/unit/auth.unit.spec.ts | test_spec |
|
|
112
|
-
| tests/api/users.api.spec.ts | test_spec |
|
|
113
|
-
| pages/auth/LoginPage.ts | page_object |
|
|
114
|
-
| fixtures/auth-data.ts | fixture |
|
|
115
|
-
| ... | ... |
|
|
116
|
-
```
|
|
117
|
-
|
|
118
|
-
**Set output directory:**
|
|
119
|
-
|
|
120
|
-
```bash
|
|
121
|
-
OUTPUT_DIR=".qa-output"
|
|
122
|
-
mkdir -p "${OUTPUT_DIR}"
|
|
123
|
-
```
|
|
124
|
-
</step>
|
|
125
|
-
|
|
126
|
-
<step name="run_validator">
|
|
127
|
-
## Step 4: Spawn Validator Agent
|
|
128
|
-
|
|
129
|
-
Spawn the validator agent to perform 4-layer validation with fix loop.
|
|
130
|
-
|
|
131
|
-
```
|
|
132
|
-
Task(
|
|
133
|
-
prompt="
|
|
134
|
-
<objective>Validate test files against CLAUDE.md standards across 4 layers (Syntax, Structure, Dependencies, Logic)
|
|
135
|
-
<execution_context>@agents/qaa-validator.md</execution_context>
|
|
136
|
-
<files_to_read>
|
|
137
|
-
- CLAUDE.md
|
|
138
|
-
- {synthetic file list or generation plan path}
|
|
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
|
-
|
|
1
|
+
<purpose>
|
|
2
|
+
Validate existing test files against CLAUDE.md QA standards using a 4-layer check (Syntax, Structure, Dependencies, Logic). Runs a fix loop (validate, fix, re-validate) up to 3 times. If failures remain after the fix loop, optionally spawns the bug-detective agent to classify failures. Produces VALIDATION_REPORT.md and optionally FAILURE_CLASSIFICATION_REPORT.md. Use this workflow to audit test quality in any test suite -- whether generated by the QA pipeline or hand-written.
|
|
3
|
+
</purpose>
|
|
4
|
+
|
|
5
|
+
<required_reading>
|
|
6
|
+
- `CLAUDE.md` -- QA automation standards, quality gates, locator strategy, POM rules, assertion specificity rules
|
|
7
|
+
- `agents/qaa-validator.md` -- Validator agent definition (4-layer validation, fix loop, confidence assessment)
|
|
8
|
+
- `agents/qaa-bug-detective.md` -- Bug detective agent definition (failure classification, auto-fix for test errors)
|
|
9
|
+
- `templates/validation-report.md` -- VALIDATION_REPORT.md format contract
|
|
10
|
+
- `templates/failure-classification.md` -- FAILURE_CLASSIFICATION_REPORT.md format contract
|
|
11
|
+
</required_reading>
|
|
12
|
+
|
|
13
|
+
<process>
|
|
14
|
+
|
|
15
|
+
<step name="parse_arguments">
|
|
16
|
+
## Step 1: Parse Arguments
|
|
17
|
+
|
|
18
|
+
Parse `$ARGUMENTS` for the test directory path and optional flags.
|
|
19
|
+
|
|
20
|
+
**Supported arguments:**
|
|
21
|
+
- `<path>` -- Path to the test directory to validate (positional)
|
|
22
|
+
- `--classify` -- If set, spawn bug-detective after validation to classify remaining failures
|
|
23
|
+
- No arguments -- auto-detect test directories
|
|
24
|
+
|
|
25
|
+
**Parsing logic:**
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
TEST_DIR=""
|
|
29
|
+
CLASSIFY_FAILURES=false
|
|
30
|
+
|
|
31
|
+
# Parse positional path argument
|
|
32
|
+
# Parse --classify flag
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
**Validation:**
|
|
36
|
+
- If a path is provided, verify it exists and is a directory. If not, print error: `"Error: Test directory does not exist: {path}"` and STOP.
|
|
37
|
+
- If no path provided, proceed to auto-detection in the next step.
|
|
38
|
+
</step>
|
|
39
|
+
|
|
40
|
+
<step name="detect_test_directories">
|
|
41
|
+
## Step 2: Detect Test Directories
|
|
42
|
+
|
|
43
|
+
If no test directory was specified, auto-detect by searching for common test directory patterns.
|
|
44
|
+
|
|
45
|
+
**Detection order (check each, use the first match):**
|
|
46
|
+
|
|
47
|
+
1. `tests/` -- Standard test directory
|
|
48
|
+
2. `__tests__/` -- Jest convention
|
|
49
|
+
3. `cypress/` -- Cypress test directory
|
|
50
|
+
4. `e2e/` -- E2E test directory
|
|
51
|
+
5. `test/` -- Alternative singular form
|
|
52
|
+
6. `spec/` -- RSpec/generic spec directory
|
|
53
|
+
|
|
54
|
+
**Detection logic:**
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
if TEST_DIR is empty:
|
|
58
|
+
for dir in tests __tests__ cypress e2e test spec:
|
|
59
|
+
if directory exists at "${dir}":
|
|
60
|
+
TEST_DIR="${dir}"
|
|
61
|
+
break
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
**If no test directory found:**
|
|
65
|
+
|
|
66
|
+
Print error and STOP:
|
|
67
|
+
```
|
|
68
|
+
Error: No test directory found.
|
|
69
|
+
Searched for: tests/, __tests__/, cypress/, e2e/, test/, spec/
|
|
70
|
+
Provide the test directory path as an argument: /qa-validate <path>
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
**Count test files:**
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
TEST_FILE_COUNT=$(find "${TEST_DIR}" -type f \( -name "*.test.*" -o -name "*.spec.*" -o -name "*.cy.*" -o -name "*.e2e.*" \) | wc -l)
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
If `TEST_FILE_COUNT` is 0, print error: `"Error: No test files found in {TEST_DIR}. Expected files matching *.test.*, *.spec.*, *.cy.*, or *.e2e.*"` and STOP.
|
|
80
|
+
|
|
81
|
+
**Print detection results:**
|
|
82
|
+
|
|
83
|
+
```
|
|
84
|
+
Test directory: {TEST_DIR}
|
|
85
|
+
Test files found: {TEST_FILE_COUNT}
|
|
86
|
+
```
|
|
87
|
+
</step>
|
|
88
|
+
|
|
89
|
+
<step name="build_file_list">
|
|
90
|
+
## Step 3: Build File List for Validation
|
|
91
|
+
|
|
92
|
+
Enumerate all test files and supporting files (page objects, fixtures) to validate.
|
|
93
|
+
|
|
94
|
+
**File discovery:**
|
|
95
|
+
|
|
96
|
+
Glob for test-related files in the detected directory:
|
|
97
|
+
- Test specs: `**/*.test.*`, `**/*.spec.*`, `**/*.cy.*`, `**/*.e2e.*`
|
|
98
|
+
- Page objects: `**/pages/**/*`, `**/page-objects/**/*`, `**/support/page-objects/**/*`
|
|
99
|
+
- Fixtures: `**/fixtures/**/*`
|
|
100
|
+
- Config files: test framework configs at the project root
|
|
101
|
+
|
|
102
|
+
**Build a generation-plan-equivalent file list:**
|
|
103
|
+
|
|
104
|
+
The validator agent expects a file list (normally from the generation plan). For this workflow, construct a synthetic file list from the discovered files:
|
|
105
|
+
|
|
106
|
+
```markdown
|
|
107
|
+
## Files to Validate
|
|
108
|
+
|
|
109
|
+
| File Path | Type |
|
|
110
|
+
|-----------|------|
|
|
111
|
+
| tests/unit/auth.unit.spec.ts | test_spec |
|
|
112
|
+
| tests/api/users.api.spec.ts | test_spec |
|
|
113
|
+
| pages/auth/LoginPage.ts | page_object |
|
|
114
|
+
| fixtures/auth-data.ts | fixture |
|
|
115
|
+
| ... | ... |
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
**Set output directory:**
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
OUTPUT_DIR=".qa-output"
|
|
122
|
+
mkdir -p "${OUTPUT_DIR}"
|
|
123
|
+
```
|
|
124
|
+
</step>
|
|
125
|
+
|
|
126
|
+
<step name="run_validator">
|
|
127
|
+
## Step 4: Spawn Validator Agent
|
|
128
|
+
|
|
129
|
+
Spawn the validator agent to perform 4-layer validation with fix loop.
|
|
130
|
+
|
|
131
|
+
```
|
|
132
|
+
Task(
|
|
133
|
+
prompt="
|
|
134
|
+
<objective>Validate test files against CLAUDE.md standards across 4 layers (Syntax, Structure, Dependencies, Logic). Use codebase map for context and locator registry to verify locator accuracy.</objective>
|
|
135
|
+
<execution_context>@agents/qaa-validator.md</execution_context>
|
|
136
|
+
<files_to_read>
|
|
137
|
+
- CLAUDE.md
|
|
138
|
+
- {synthetic file list or generation plan path}
|
|
139
|
+
- .qa-output/locators/LOCATOR_REGISTRY.md (if exists -- real locators for cross-checking POM accuracy)
|
|
140
|
+
- .qa-output/codebase/CODE_PATTERNS.md (if exists -- naming conventions for structure validation)
|
|
141
|
+
- .qa-output/codebase/TEST_SURFACE.md (if exists -- function signatures for target verification)
|
|
142
|
+
- .qa-output/codebase/API_CONTRACTS.md (if exists -- API shapes for assertion verification)
|
|
143
|
+
</files_to_read>
|
|
144
|
+
<parameters>
|
|
145
|
+
test_dir: {TEST_DIR}
|
|
146
|
+
output_path: {OUTPUT_DIR}/VALIDATION_REPORT.md
|
|
147
|
+
file_list: {list of test file paths}
|
|
148
|
+
mode: validation
|
|
149
|
+
</parameters>
|
|
150
|
+
"
|
|
151
|
+
)
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
**Handle validator return:**
|
|
155
|
+
|
|
156
|
+
Extract from the validator's return values:
|
|
157
|
+
- `overall_status` -- PASS, PASS_WITH_WARNINGS, or FAIL
|
|
158
|
+
- `confidence` -- HIGH, MEDIUM, or LOW
|
|
159
|
+
- `layers_summary` -- per-layer PASS/FAIL status
|
|
160
|
+
- `fix_loops_used` -- number of fix iterations (1-3)
|
|
161
|
+
- `issues_found` -- total issues discovered
|
|
162
|
+
- `issues_fixed` -- issues auto-fixed (HIGH confidence only)
|
|
163
|
+
- `unresolved_count` -- issues remaining after fix loops
|
|
164
|
+
|
|
165
|
+
**Verify VALIDATION_REPORT.md exists:**
|
|
166
|
+
|
|
167
|
+
```bash
|
|
168
|
+
[ -f "${OUTPUT_DIR}/VALIDATION_REPORT.md" ] && echo "FOUND" || echo "MISSING"
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
If missing, print error: `"Error: Validator did not produce VALIDATION_REPORT.md."` and STOP.
|
|
172
|
+
</step>
|
|
173
|
+
|
|
174
|
+
<step name="classify_failures">
|
|
175
|
+
## Step 5: Optionally Spawn Bug Detective
|
|
176
|
+
|
|
177
|
+
If the `--classify` flag was set AND the validator reported failures (unresolved_count > 0), spawn the bug-detective agent to classify the remaining failures.
|
|
178
|
+
|
|
179
|
+
**Gate check:**
|
|
180
|
+
|
|
181
|
+
```
|
|
182
|
+
if CLASSIFY_FAILURES is false:
|
|
183
|
+
Skip this step -- print note: "Skipping failure classification. Use --classify flag to enable."
|
|
184
|
+
|
|
185
|
+
if unresolved_count is 0:
|
|
186
|
+
Skip this step -- print note: "No unresolved failures to classify."
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
**Spawn bug-detective agent:**
|
|
190
|
+
|
|
191
|
+
```
|
|
192
|
+
Task(
|
|
193
|
+
prompt="
|
|
194
|
+
<objective>Run test suite and classify failures into APPLICATION BUG, TEST CODE ERROR, ENVIRONMENT ISSUE, or INCONCLUSIVE</objective>
|
|
195
|
+
<execution_context>@agents/qaa-bug-detective.md</execution_context>
|
|
196
|
+
<files_to_read>
|
|
197
|
+
- CLAUDE.md
|
|
198
|
+
- {test file paths with failures}
|
|
199
|
+
</files_to_read>
|
|
200
|
+
<parameters>
|
|
201
|
+
test_dir: {TEST_DIR}
|
|
202
|
+
output_path: {OUTPUT_DIR}/FAILURE_CLASSIFICATION_REPORT.md
|
|
203
|
+
</parameters>
|
|
204
|
+
"
|
|
205
|
+
)
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
**Handle detective return:**
|
|
209
|
+
|
|
210
|
+
Extract from the detective's return values:
|
|
211
|
+
- `total_failures` -- number of failures analyzed
|
|
212
|
+
- `classification_breakdown` -- counts per category (app_bug, test_error, env_issue, inconclusive)
|
|
213
|
+
- `auto_fixes_applied` -- count of TEST CODE ERROR fixes at HIGH confidence
|
|
214
|
+
- `auto_fixes_verified` -- count of fixes that passed re-verification
|
|
215
|
+
|
|
216
|
+
**Verify FAILURE_CLASSIFICATION_REPORT.md exists (if detective was spawned):**
|
|
217
|
+
|
|
218
|
+
```bash
|
|
219
|
+
[ -f "${OUTPUT_DIR}/FAILURE_CLASSIFICATION_REPORT.md" ] && echo "FOUND" || echo "MISSING"
|
|
220
|
+
```
|
|
221
|
+
</step>
|
|
222
|
+
|
|
223
|
+
<step name="print_summary">
|
|
224
|
+
## Step 6: Print Validation Summary
|
|
225
|
+
|
|
226
|
+
Print a human-readable summary of the validation results.
|
|
227
|
+
|
|
228
|
+
```
|
|
229
|
+
=== Validation Complete ===
|
|
230
|
+
|
|
231
|
+
Test Directory: {TEST_DIR}
|
|
232
|
+
Files Validated: {file_count}
|
|
233
|
+
Fix Loops Used: {fix_loops_used} of 3
|
|
234
|
+
|
|
235
|
+
Layer Results:
|
|
236
|
+
Syntax: {PASS|FAIL}
|
|
237
|
+
Structure: {PASS|FAIL}
|
|
238
|
+
Dependencies: {PASS|FAIL}
|
|
239
|
+
Logic: {PASS|FAIL}
|
|
240
|
+
|
|
241
|
+
Issues:
|
|
242
|
+
Found: {issues_found}
|
|
243
|
+
Auto-fixed: {issues_fixed}
|
|
244
|
+
Unresolved: {unresolved_count}
|
|
245
|
+
|
|
246
|
+
Overall Status: {PASS|PASS_WITH_WARNINGS|FAIL}
|
|
247
|
+
Confidence: {HIGH|MEDIUM|LOW}
|
|
248
|
+
|
|
249
|
+
Artifacts Produced:
|
|
250
|
+
- {OUTPUT_DIR}/VALIDATION_REPORT.md
|
|
251
|
+
- {OUTPUT_DIR}/FAILURE_CLASSIFICATION_REPORT.md (if --classify used)
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
**If bug detective ran, add classification summary:**
|
|
255
|
+
|
|
256
|
+
```
|
|
257
|
+
Failure Classification:
|
|
258
|
+
APPLICATION BUG: {app_bug_count}
|
|
259
|
+
TEST CODE ERROR: {test_error_count}
|
|
260
|
+
ENVIRONMENT ISSUE: {env_issue_count}
|
|
261
|
+
INCONCLUSIVE: {inconclusive_count}
|
|
262
|
+
Auto-fixed: {auto_fixes_applied}
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
```
|
|
266
|
+
===========================
|
|
267
|
+
```
|
|
268
|
+
</step>
|
|
269
|
+
|
|
270
|
+
</process>
|
|
271
|
+
|
|
272
|
+
<output>
|
|
273
|
+
This workflow validates existing test files and produces quality reports.
|
|
274
|
+
|
|
275
|
+
**Artifacts produced:**
|
|
276
|
+
|
|
277
|
+
| Artifact | When Produced | Description |
|
|
278
|
+
|----------|---------------|-------------|
|
|
279
|
+
| VALIDATION_REPORT.md | Always | 4-layer validation results (Syntax, Structure, Dependencies, Logic) with fix loop history and confidence level |
|
|
280
|
+
| FAILURE_CLASSIFICATION_REPORT.md | When --classify flag set AND failures exist | Per-failure classification (APPLICATION BUG, TEST CODE ERROR, ENVIRONMENT ISSUE, INCONCLUSIVE) with evidence and auto-fix log |
|
|
281
|
+
|
|
282
|
+
**Side effects:**
|
|
283
|
+
- Test files may be modified in-place by HIGH-confidence auto-fixes from the validator
|
|
284
|
+
- Test files may be modified by HIGH-confidence TEST CODE ERROR fixes from the bug detective
|
|
285
|
+
- No git branches created (fixes applied to working tree)
|
|
286
|
+
- No PRs created
|
|
287
|
+
</output>
|
|
288
|
+
|
|
289
|
+
<error_handling>
|
|
290
|
+
| Error | Cause | Action |
|
|
291
|
+
|-------|-------|--------|
|
|
292
|
+
| Test directory does not exist | Invalid path argument | Print error with path, STOP |
|
|
293
|
+
| No test directory found | No common test dirs in project | Print error listing searched dirs, suggest providing path, STOP |
|
|
294
|
+
| No test files found in directory | Directory exists but contains no test files | Print error with expected patterns, STOP |
|
|
295
|
+
| VALIDATION_REPORT.md missing | Validator failed silently | Print error, STOP |
|
|
296
|
+
| Fix loop exhausted (3 loops) | Issues cannot be auto-resolved | Validator checkpoints with unresolved issue details |
|
|
297
|
+
| Test runner not detected | No test framework config found | Bug detective checkpoints for user to specify runner |
|
|
298
|
+
| Test runner fails to start | Missing dependencies or broken config | Bug detective classifies as ENVIRONMENT ISSUE |
|
|
299
|
+
</error_handling>
|