@qball-inc/the-bulwark 1.0.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/.claude-plugin/plugin.json +43 -0
- package/agents/bulwark-fix-validator.md +633 -0
- package/agents/bulwark-implementer.md +391 -0
- package/agents/bulwark-issue-analyzer.md +308 -0
- package/agents/bulwark-standards-reviewer.md +221 -0
- package/agents/plan-creation-architect.md +323 -0
- package/agents/plan-creation-eng-lead.md +352 -0
- package/agents/plan-creation-po.md +300 -0
- package/agents/plan-creation-qa-critic.md +334 -0
- package/agents/product-ideation-competitive-analyzer.md +298 -0
- package/agents/product-ideation-idea-validator.md +268 -0
- package/agents/product-ideation-market-researcher.md +292 -0
- package/agents/product-ideation-pattern-documenter.md +308 -0
- package/agents/product-ideation-segment-analyzer.md +303 -0
- package/agents/product-ideation-strategist.md +259 -0
- package/agents/statusline-setup.md +97 -0
- package/hooks/hooks.json +59 -0
- package/package.json +45 -0
- package/scripts/hooks/cleanup-stale.sh +13 -0
- package/scripts/hooks/enforce-quality.sh +166 -0
- package/scripts/hooks/implementer-quality.sh +256 -0
- package/scripts/hooks/inject-protocol.sh +52 -0
- package/scripts/hooks/suggest-pipeline.sh +175 -0
- package/scripts/hooks/track-pipeline-start.sh +37 -0
- package/scripts/hooks/track-pipeline-stop.sh +52 -0
- package/scripts/init-rules.sh +35 -0
- package/scripts/init.sh +151 -0
- package/skills/anthropic-validator/SKILL.md +607 -0
- package/skills/anthropic-validator/references/agents-checklist.md +131 -0
- package/skills/anthropic-validator/references/commands-checklist.md +102 -0
- package/skills/anthropic-validator/references/hooks-checklist.md +151 -0
- package/skills/anthropic-validator/references/mcp-checklist.md +136 -0
- package/skills/anthropic-validator/references/plugins-checklist.md +148 -0
- package/skills/anthropic-validator/references/skills-checklist.md +85 -0
- package/skills/assertion-patterns/SKILL.md +296 -0
- package/skills/bug-magnet-data/SKILL.md +284 -0
- package/skills/bug-magnet-data/context/cli-args.md +91 -0
- package/skills/bug-magnet-data/context/db-query.md +104 -0
- package/skills/bug-magnet-data/context/file-contents.md +103 -0
- package/skills/bug-magnet-data/context/http-body.md +91 -0
- package/skills/bug-magnet-data/context/process-spawn.md +123 -0
- package/skills/bug-magnet-data/data/booleans/boundaries.yaml +143 -0
- package/skills/bug-magnet-data/data/collections/arrays.yaml +114 -0
- package/skills/bug-magnet-data/data/collections/objects.yaml +123 -0
- package/skills/bug-magnet-data/data/concurrency/race-conditions.yaml +118 -0
- package/skills/bug-magnet-data/data/concurrency/state-machines.yaml +115 -0
- package/skills/bug-magnet-data/data/dates/boundaries.yaml +137 -0
- package/skills/bug-magnet-data/data/dates/invalid.yaml +132 -0
- package/skills/bug-magnet-data/data/dates/timezone.yaml +118 -0
- package/skills/bug-magnet-data/data/encoding/charset.yaml +79 -0
- package/skills/bug-magnet-data/data/encoding/normalization.yaml +105 -0
- package/skills/bug-magnet-data/data/formats/email.yaml +154 -0
- package/skills/bug-magnet-data/data/formats/json.yaml +187 -0
- package/skills/bug-magnet-data/data/formats/url.yaml +165 -0
- package/skills/bug-magnet-data/data/language-specific/javascript.yaml +182 -0
- package/skills/bug-magnet-data/data/language-specific/python.yaml +174 -0
- package/skills/bug-magnet-data/data/language-specific/rust.yaml +148 -0
- package/skills/bug-magnet-data/data/numbers/boundaries.yaml +161 -0
- package/skills/bug-magnet-data/data/numbers/precision.yaml +89 -0
- package/skills/bug-magnet-data/data/numbers/special.yaml +69 -0
- package/skills/bug-magnet-data/data/strings/boundaries.yaml +109 -0
- package/skills/bug-magnet-data/data/strings/injection.yaml +208 -0
- package/skills/bug-magnet-data/data/strings/special-chars.yaml +190 -0
- package/skills/bug-magnet-data/data/strings/unicode.yaml +139 -0
- package/skills/bug-magnet-data/references/external-lists.md +115 -0
- package/skills/bulwark-brainstorm/SKILL.md +563 -0
- package/skills/bulwark-brainstorm/references/at-teammate-prompts.md +60 -0
- package/skills/bulwark-brainstorm/references/role-critical-analyst.md +78 -0
- package/skills/bulwark-brainstorm/references/role-development-lead.md +66 -0
- package/skills/bulwark-brainstorm/references/role-product-delivery-lead.md +79 -0
- package/skills/bulwark-brainstorm/references/role-product-manager.md +62 -0
- package/skills/bulwark-brainstorm/references/role-project-sme.md +59 -0
- package/skills/bulwark-brainstorm/references/role-technical-architect.md +66 -0
- package/skills/bulwark-research/SKILL.md +298 -0
- package/skills/bulwark-research/references/viewpoint-contrarian.md +63 -0
- package/skills/bulwark-research/references/viewpoint-direct-investigation.md +62 -0
- package/skills/bulwark-research/references/viewpoint-first-principles.md +65 -0
- package/skills/bulwark-research/references/viewpoint-practitioner.md +62 -0
- package/skills/bulwark-research/references/viewpoint-prior-art.md +66 -0
- package/skills/bulwark-scaffold/SKILL.md +330 -0
- package/skills/bulwark-statusline/SKILL.md +161 -0
- package/skills/bulwark-statusline/scripts/statusline.sh +144 -0
- package/skills/bulwark-verify/SKILL.md +519 -0
- package/skills/code-review/SKILL.md +428 -0
- package/skills/code-review/examples/anti-patterns/linting.ts +181 -0
- package/skills/code-review/examples/anti-patterns/security.ts +91 -0
- package/skills/code-review/examples/anti-patterns/standards.ts +195 -0
- package/skills/code-review/examples/anti-patterns/type-safety.ts +108 -0
- package/skills/code-review/examples/recommended/linting.ts +195 -0
- package/skills/code-review/examples/recommended/security.ts +154 -0
- package/skills/code-review/examples/recommended/standards.ts +231 -0
- package/skills/code-review/examples/recommended/type-safety.ts +181 -0
- package/skills/code-review/frameworks/angular.md +218 -0
- package/skills/code-review/frameworks/django.md +235 -0
- package/skills/code-review/frameworks/express.md +207 -0
- package/skills/code-review/frameworks/flask.md +298 -0
- package/skills/code-review/frameworks/generic.md +146 -0
- package/skills/code-review/frameworks/react.md +152 -0
- package/skills/code-review/frameworks/vue.md +244 -0
- package/skills/code-review/references/linting-patterns.md +221 -0
- package/skills/code-review/references/security-patterns.md +125 -0
- package/skills/code-review/references/standards-patterns.md +246 -0
- package/skills/code-review/references/type-safety-patterns.md +130 -0
- package/skills/component-patterns/SKILL.md +131 -0
- package/skills/component-patterns/references/pattern-cli-command.md +118 -0
- package/skills/component-patterns/references/pattern-database.md +166 -0
- package/skills/component-patterns/references/pattern-external-api.md +139 -0
- package/skills/component-patterns/references/pattern-file-parser.md +168 -0
- package/skills/component-patterns/references/pattern-http-server.md +162 -0
- package/skills/component-patterns/references/pattern-process-spawner.md +133 -0
- package/skills/continuous-feedback/SKILL.md +327 -0
- package/skills/continuous-feedback/references/collect-instructions.md +81 -0
- package/skills/continuous-feedback/references/specialize-code-review.md +82 -0
- package/skills/continuous-feedback/references/specialize-general.md +98 -0
- package/skills/continuous-feedback/references/specialize-test-audit.md +81 -0
- package/skills/create-skill/SKILL.md +359 -0
- package/skills/create-skill/references/agent-conventions.md +194 -0
- package/skills/create-skill/references/agent-template.md +195 -0
- package/skills/create-skill/references/content-guidance.md +291 -0
- package/skills/create-skill/references/decision-framework.md +124 -0
- package/skills/create-skill/references/template-pipeline.md +217 -0
- package/skills/create-skill/references/template-reference-heavy.md +111 -0
- package/skills/create-skill/references/template-research.md +210 -0
- package/skills/create-skill/references/template-script-driven.md +172 -0
- package/skills/create-skill/references/template-simple.md +80 -0
- package/skills/create-subagent/SKILL.md +353 -0
- package/skills/create-subagent/references/agent-conventions.md +268 -0
- package/skills/create-subagent/references/content-guidance.md +232 -0
- package/skills/create-subagent/references/decision-framework.md +134 -0
- package/skills/create-subagent/references/template-single-agent.md +192 -0
- package/skills/fix-bug/SKILL.md +241 -0
- package/skills/governance-protocol/SKILL.md +116 -0
- package/skills/init/SKILL.md +341 -0
- package/skills/issue-debugging/SKILL.md +385 -0
- package/skills/issue-debugging/references/anti-patterns.md +245 -0
- package/skills/issue-debugging/references/debug-report-schema.md +227 -0
- package/skills/mock-detection/SKILL.md +511 -0
- package/skills/mock-detection/references/false-positive-prevention.md +402 -0
- package/skills/mock-detection/references/stub-patterns.md +236 -0
- package/skills/pipeline-templates/SKILL.md +215 -0
- package/skills/pipeline-templates/references/code-change-workflow.md +277 -0
- package/skills/pipeline-templates/references/code-review.md +336 -0
- package/skills/pipeline-templates/references/fix-validation.md +421 -0
- package/skills/pipeline-templates/references/new-feature.md +335 -0
- package/skills/pipeline-templates/references/research-brainstorm.md +161 -0
- package/skills/pipeline-templates/references/research-planning.md +257 -0
- package/skills/pipeline-templates/references/test-audit.md +389 -0
- package/skills/pipeline-templates/references/test-execution-fix.md +238 -0
- package/skills/plan-creation/SKILL.md +497 -0
- package/skills/product-ideation/SKILL.md +372 -0
- package/skills/product-ideation/references/analysis-frameworks.md +161 -0
- package/skills/session-handoff/SKILL.md +139 -0
- package/skills/session-handoff/references/examples.md +223 -0
- package/skills/setup-lsp/SKILL.md +312 -0
- package/skills/setup-lsp/references/server-registry.md +85 -0
- package/skills/setup-lsp/references/troubleshooting.md +135 -0
- package/skills/subagent-output-templating/SKILL.md +415 -0
- package/skills/subagent-output-templating/references/examples.md +440 -0
- package/skills/subagent-prompting/SKILL.md +364 -0
- package/skills/subagent-prompting/references/examples.md +342 -0
- package/skills/test-audit/SKILL.md +531 -0
- package/skills/test-audit/references/known-limitations.md +41 -0
- package/skills/test-audit/references/priority-classification.md +30 -0
- package/skills/test-audit/references/prompts/deep-mode-detection.md +83 -0
- package/skills/test-audit/references/prompts/synthesis.md +57 -0
- package/skills/test-audit/references/rewrite-instructions.md +46 -0
- package/skills/test-audit/references/schemas/audit-output.yaml +100 -0
- package/skills/test-audit/references/schemas/diagnostic-output.yaml +49 -0
- package/skills/test-audit/scripts/data-flow-analyzer.ts +509 -0
- package/skills/test-audit/scripts/integration-mock-detector.ts +462 -0
- package/skills/test-audit/scripts/package.json +20 -0
- package/skills/test-audit/scripts/skip-detector.ts +211 -0
- package/skills/test-audit/scripts/verification-counter.ts +295 -0
- package/skills/test-classification/SKILL.md +310 -0
- package/skills/test-fixture-creation/SKILL.md +295 -0
|
@@ -0,0 +1,421 @@
|
|
|
1
|
+
# Fix Validation Pipeline
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
Fix bugs or issues and validate the fix through review and testing.
|
|
6
|
+
|
|
7
|
+
## When to Use
|
|
8
|
+
|
|
9
|
+
- Bug fixes
|
|
10
|
+
- Issue resolution
|
|
11
|
+
- Defect remediation
|
|
12
|
+
- Post-review fixes
|
|
13
|
+
|
|
14
|
+
## Pipeline Definition
|
|
15
|
+
|
|
16
|
+
```fsharp
|
|
17
|
+
// Fix Validation Pipeline
|
|
18
|
+
// Trigger: Bug report, issue, or review finding
|
|
19
|
+
// Output: Verified fix with passing tests and confidence assessment
|
|
20
|
+
|
|
21
|
+
IssueAnalyzer (root cause + debug report) // Sonnet - bulwark-issue-analyzer
|
|
22
|
+
|> FixWriter (implement fix) // Opus - bulwark-implementer
|
|
23
|
+
|> (if !tests_cover_scenario // Conditional: only if tests don't already exist
|
|
24
|
+
then TestWriter |> TestAudit // Opus writes, then audit for T1-T4
|
|
25
|
+
else Skip)
|
|
26
|
+
|> FixValidator (validate against debug report) // Sonnet - bulwark-fix-validator
|
|
27
|
+
|> CodeReviewer (review fix) // Sonnet - review
|
|
28
|
+
|> (if !approved
|
|
29
|
+
then IssueAnalyzer // Loop back
|
|
30
|
+
else Done)
|
|
31
|
+
|> LOOP(max=3) // Max 3 iterations
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
**TestWriter Condition**: The orchestrator evaluates whether existing tests cover the bug scenario using the debug report's `validation_plan.tests_to_execute` and `recommendation.new_tests_needed` fields.
|
|
35
|
+
|
|
36
|
+
### Key Artifacts
|
|
37
|
+
|
|
38
|
+
| Artifact | Producer | Consumer | Location |
|
|
39
|
+
|----------|----------|----------|----------|
|
|
40
|
+
| Debug Report | IssueAnalyzer | FixWriter, FixValidator | `logs/debug-reports/{issue-id}.yaml` |
|
|
41
|
+
| Validation Results | FixValidator | CodeReviewer | Standard log output |
|
|
42
|
+
|
|
43
|
+
## Stage Details
|
|
44
|
+
|
|
45
|
+
### Stage 1: IssueAnalyzer
|
|
46
|
+
|
|
47
|
+
**Agent**: `bulwark-issue-analyzer` (custom sub-agent)
|
|
48
|
+
|
|
49
|
+
**Model**: Sonnet (analytical task)
|
|
50
|
+
|
|
51
|
+
**Skills**: `issue-debugging`
|
|
52
|
+
|
|
53
|
+
**GOAL**: Understand root cause, map dependencies, produce debug report with validation plan.
|
|
54
|
+
|
|
55
|
+
**CONSTRAINTS**:
|
|
56
|
+
- Do NOT modify any files
|
|
57
|
+
- Trace full execution path
|
|
58
|
+
- Identify all affected areas (upstream/downstream)
|
|
59
|
+
- Document hypothesis before conclusion
|
|
60
|
+
- Include tiered validation plan in debug report
|
|
61
|
+
|
|
62
|
+
**CONTEXT**:
|
|
63
|
+
- Issue description / bug report
|
|
64
|
+
- Error logs / stack traces
|
|
65
|
+
- Reproduction steps (if available)
|
|
66
|
+
|
|
67
|
+
**OUTPUT**: Debug report at `logs/debug-reports/{issue-id}-{YYYYMMDD-HHMMSS}.yaml`
|
|
68
|
+
```yaml
|
|
69
|
+
debug_report:
|
|
70
|
+
metadata:
|
|
71
|
+
issue_id: BUG-123
|
|
72
|
+
timestamp: "2026-01-16T10:30:00Z"
|
|
73
|
+
analyzer: bulwark-issue-analyzer
|
|
74
|
+
|
|
75
|
+
analysis:
|
|
76
|
+
symptom: "Login fails with 500 error"
|
|
77
|
+
root_cause: "Null pointer when user has no profile"
|
|
78
|
+
complexity: medium # low | medium | high
|
|
79
|
+
fix_approach: "Add null check before profile access"
|
|
80
|
+
|
|
81
|
+
impact_analysis:
|
|
82
|
+
affected_files:
|
|
83
|
+
- src/auth/login.ts
|
|
84
|
+
- src/models/user.ts
|
|
85
|
+
upstream_dependencies:
|
|
86
|
+
- "src/api/auth-routes.ts calls login()"
|
|
87
|
+
downstream_effects:
|
|
88
|
+
- "User dashboard fetches profile on load"
|
|
89
|
+
risk_scope: medium # isolated | medium | broad
|
|
90
|
+
|
|
91
|
+
validation_plan:
|
|
92
|
+
tests_to_execute:
|
|
93
|
+
- path: tests/auth/login.test.ts
|
|
94
|
+
reason: "Direct test of affected function"
|
|
95
|
+
priority: 1 # P1=must, P2=should, P3=nice-to-have
|
|
96
|
+
- path: tests/api/auth-routes.test.ts
|
|
97
|
+
reason: "Integration test for upstream"
|
|
98
|
+
priority: 2
|
|
99
|
+
functionalities_to_validate:
|
|
100
|
+
- "User without profile can login"
|
|
101
|
+
- "Dashboard loads correctly for new users"
|
|
102
|
+
|
|
103
|
+
confidence_criteria:
|
|
104
|
+
high:
|
|
105
|
+
- "All P1-P2 tests pass"
|
|
106
|
+
- "No regression in existing tests"
|
|
107
|
+
medium:
|
|
108
|
+
- "P1 tests pass, some P2-P3 skipped"
|
|
109
|
+
low:
|
|
110
|
+
- "Tests cannot reliably validate"
|
|
111
|
+
- "Manual testing required"
|
|
112
|
+
|
|
113
|
+
debug_journey: # Required for medium/high complexity
|
|
114
|
+
hypotheses_tested:
|
|
115
|
+
- hypothesis: "Database connection timeout"
|
|
116
|
+
result: rejected
|
|
117
|
+
evidence: "DB logs show successful queries"
|
|
118
|
+
- hypothesis: "Null profile object"
|
|
119
|
+
result: confirmed
|
|
120
|
+
evidence: "Stack trace points to profile.name access"
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
**Summary**: Include debug report path in summary for orchestrator reference.
|
|
124
|
+
|
|
125
|
+
### Stage 2: FixWriter
|
|
126
|
+
|
|
127
|
+
**Agent**: `bulwark-implementer` (custom sub-agent)
|
|
128
|
+
|
|
129
|
+
**Model**: Opus (code writing with quality enforcement)
|
|
130
|
+
|
|
131
|
+
**GOAL**: Implement fix that addresses root cause.
|
|
132
|
+
|
|
133
|
+
**CONSTRAINTS**:
|
|
134
|
+
- Only fix the identified issue
|
|
135
|
+
- Follow existing code patterns
|
|
136
|
+
- Do NOT refactor unrelated code
|
|
137
|
+
- Maintain backward compatibility
|
|
138
|
+
- Max 3 quality gate retries before escalation
|
|
139
|
+
|
|
140
|
+
**CONTEXT** (must include for `context: fork`):
|
|
141
|
+
- Debug report path: `logs/debug-reports/{issue-id}-{timestamp}.yaml`
|
|
142
|
+
- Root cause from Stage 1 analysis
|
|
143
|
+
- Affected files from impact analysis
|
|
144
|
+
- Fix approach recommendation
|
|
145
|
+
- Project coding standards and patterns
|
|
146
|
+
|
|
147
|
+
**Invocation**:
|
|
148
|
+
```
|
|
149
|
+
Task: subagent_type=bulwark-implementer
|
|
150
|
+
Prompt:
|
|
151
|
+
GOAL: Fix the identified issue based on the debug report.
|
|
152
|
+
CONSTRAINTS: Only fix the identified issue. Write tests for the fix. Max 3 quality gate retries.
|
|
153
|
+
CONTEXT:
|
|
154
|
+
mode: fix
|
|
155
|
+
debug_report_path: logs/debug-reports/{issue-id}-{timestamp}.yaml
|
|
156
|
+
root_cause: {from Stage 1}
|
|
157
|
+
affected_files: {from Stage 1}
|
|
158
|
+
fix_approach: {from Stage 1}
|
|
159
|
+
OUTPUT: Implementation report at logs/implementer-{id}-{timestamp}.yaml
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
**OUTPUT**: Implementation report at `logs/implementer-{id}-{timestamp}.yaml`
|
|
163
|
+
```yaml
|
|
164
|
+
implementation_report:
|
|
165
|
+
changes:
|
|
166
|
+
files_modified:
|
|
167
|
+
- path: src/auth/login.ts
|
|
168
|
+
changes: "Added null check at line 42"
|
|
169
|
+
tests:
|
|
170
|
+
files_created:
|
|
171
|
+
- path: tests/auth/login-null-profile.test.ts
|
|
172
|
+
quality_gates:
|
|
173
|
+
typecheck: passed
|
|
174
|
+
lint: passed
|
|
175
|
+
retries: 0
|
|
176
|
+
pipeline_suggestions:
|
|
177
|
+
- pipeline: "Code Review"
|
|
178
|
+
target_files: [src/auth/login.ts]
|
|
179
|
+
reason: "Bug fix to authentication module"
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
**SA6 Note**: The implementer returns pipeline suggestions with MANDATORY language in its summary. The orchestrator MUST evaluate each suggestion per SA6.
|
|
183
|
+
|
|
184
|
+
### Stage 3: TestWriter
|
|
185
|
+
|
|
186
|
+
**Actor**: Orchestrator (Opus)
|
|
187
|
+
|
|
188
|
+
**Model**: Opus (test writing required)
|
|
189
|
+
|
|
190
|
+
**GOAL**: Add tests that verify the fix and prevent regression.
|
|
191
|
+
|
|
192
|
+
**CONSTRAINTS**:
|
|
193
|
+
- Tests must verify real behavior (T1 rule)
|
|
194
|
+
- No mocking the system under test (T2 rule)
|
|
195
|
+
- Cover the specific bug scenario
|
|
196
|
+
- Cover edge cases identified in analysis
|
|
197
|
+
- Reference debug report's validation plan for test targets
|
|
198
|
+
|
|
199
|
+
**CONTEXT**:
|
|
200
|
+
- Fix applied in Stage 2
|
|
201
|
+
- Debug report from Stage 1
|
|
202
|
+
- Existing test patterns
|
|
203
|
+
|
|
204
|
+
**OUTPUT**: New/updated tests
|
|
205
|
+
```yaml
|
|
206
|
+
tests:
|
|
207
|
+
new_tests:
|
|
208
|
+
- file: tests/auth/login.test.ts
|
|
209
|
+
name: "handles user without profile gracefully"
|
|
210
|
+
type: integration
|
|
211
|
+
updated_tests: []
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
### Stage 3b: TestAudit (Conditional)
|
|
215
|
+
|
|
216
|
+
**Trigger**: Runs if **any** test files were created or modified in Stage 2 (FixWriter) OR Stage 3 (TestWriter). This ensures implementer-written tests receive T1-T4 audit even when TestWriter is skipped.
|
|
217
|
+
|
|
218
|
+
**Model**: Haiku (classification) → Sonnet (detection)
|
|
219
|
+
|
|
220
|
+
**Skills**: `mock-detection` (lighter weight than full test-audit)
|
|
221
|
+
|
|
222
|
+
**GOAL**: Verify new/modified tests don't have T1-T4 violations before proceeding to validation.
|
|
223
|
+
|
|
224
|
+
**CONSTRAINTS**:
|
|
225
|
+
- Audit test files touched by FixWriter (Stage 2) and/or TestWriter (Stage 3)
|
|
226
|
+
- Block pipeline if T1 violation found (mocking system under test)
|
|
227
|
+
- Warn on T2-T4 violations but allow proceed
|
|
228
|
+
- Do NOT audit existing tests (only new/modified in this pipeline run)
|
|
229
|
+
|
|
230
|
+
**CONTEXT**:
|
|
231
|
+
- List of test files created/modified by FixWriter and/or TestWriter
|
|
232
|
+
- Debug report for understanding what's being tested
|
|
233
|
+
|
|
234
|
+
**OUTPUT**: Audit result
|
|
235
|
+
```yaml
|
|
236
|
+
test_audit:
|
|
237
|
+
files_audited:
|
|
238
|
+
- path: tests/auth/login.test.ts
|
|
239
|
+
status: passed | failed
|
|
240
|
+
violations: []
|
|
241
|
+
|
|
242
|
+
t1_violations: 0 # Critical - blocks pipeline
|
|
243
|
+
t2_violations: 0 # High - warning only
|
|
244
|
+
t3_violations: 0 # Medium - warning only
|
|
245
|
+
t4_violations: 0 # Low - warning only
|
|
246
|
+
|
|
247
|
+
proceed: true | false
|
|
248
|
+
notes: "All generated tests follow T1-T4 rules"
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
**Failure Handling**:
|
|
252
|
+
- If T1 violation: Return to TestWriter with feedback, request rewrite
|
|
253
|
+
- If T2-T4 violations: Log warning, proceed to FixValidator
|
|
254
|
+
- Max 2 audit iterations before escalating to user
|
|
255
|
+
|
|
256
|
+
### Stage 4: FixValidator
|
|
257
|
+
|
|
258
|
+
**Agent**: `bulwark-fix-validator` (custom sub-agent)
|
|
259
|
+
|
|
260
|
+
**Model**: Sonnet (validation task)
|
|
261
|
+
|
|
262
|
+
**Skills**: `issue-debugging`
|
|
263
|
+
|
|
264
|
+
**GOAL**: Execute validation plan from debug report, assess fix confidence.
|
|
265
|
+
|
|
266
|
+
**CONSTRAINTS**:
|
|
267
|
+
- Run only tests specified in validation plan (tiered: P1 → P2 → P3)
|
|
268
|
+
- Do NOT run full regression suite
|
|
269
|
+
- Assess confidence per rubric from debug report
|
|
270
|
+
- Escalate to manual testing when required
|
|
271
|
+
|
|
272
|
+
**CONTEXT**:
|
|
273
|
+
- Debug report from IssueAnalyzer (path in Stage 1 summary)
|
|
274
|
+
- Fix applied by FixWriter
|
|
275
|
+
- Tests written by TestWriter
|
|
276
|
+
|
|
277
|
+
**OUTPUT**: Validation results with confidence assessment
|
|
278
|
+
```yaml
|
|
279
|
+
validation_results:
|
|
280
|
+
debug_report_ref: "logs/debug-reports/BUG-123-20260116.yaml"
|
|
281
|
+
|
|
282
|
+
tests_executed:
|
|
283
|
+
p1_tests:
|
|
284
|
+
- path: tests/auth/login.test.ts
|
|
285
|
+
status: passed
|
|
286
|
+
- path: tests/auth/profile.test.ts
|
|
287
|
+
status: passed
|
|
288
|
+
p2_tests:
|
|
289
|
+
- path: tests/api/auth-routes.test.ts
|
|
290
|
+
status: passed
|
|
291
|
+
p3_tests:
|
|
292
|
+
- path: tests/e2e/login-flow.test.ts
|
|
293
|
+
status: skipped
|
|
294
|
+
reason: "E2E environment not available"
|
|
295
|
+
|
|
296
|
+
functionalities_validated:
|
|
297
|
+
- functionality: "User without profile can login"
|
|
298
|
+
status: validated
|
|
299
|
+
method: "P1 test coverage"
|
|
300
|
+
- functionality: "Dashboard loads correctly for new users"
|
|
301
|
+
status: not_validated
|
|
302
|
+
reason: "Requires manual testing"
|
|
303
|
+
|
|
304
|
+
confidence_assessment:
|
|
305
|
+
level: medium
|
|
306
|
+
rationale:
|
|
307
|
+
- "All P1 tests pass"
|
|
308
|
+
- "P2 tests pass"
|
|
309
|
+
- "One functionality requires manual validation"
|
|
310
|
+
|
|
311
|
+
escalation:
|
|
312
|
+
manual_testing_required: true
|
|
313
|
+
items:
|
|
314
|
+
- "Dashboard load for new users - UI verification needed"
|
|
315
|
+
message: "Orchestrator should inform user: Manual testing required for dashboard functionality"
|
|
316
|
+
```
|
|
317
|
+
|
|
318
|
+
**Escalation Triggers** (any triggers manual testing):
|
|
319
|
+
- Confidence level is `low`
|
|
320
|
+
- Risk scope is `broad` AND confidence is not `high`
|
|
321
|
+
- Any functionality cannot be validated via automated tests
|
|
322
|
+
|
|
323
|
+
### Stage 5: CodeReviewer
|
|
324
|
+
|
|
325
|
+
**Model**: Sonnet (review task)
|
|
326
|
+
|
|
327
|
+
**GOAL**: Verify fix is correct, complete, and safe. Consider validation results.
|
|
328
|
+
|
|
329
|
+
**CONSTRAINTS**:
|
|
330
|
+
- Do NOT modify any files
|
|
331
|
+
- Check fix addresses root cause (from debug report)
|
|
332
|
+
- Verify tests cover the scenario
|
|
333
|
+
- Check for introduced regressions
|
|
334
|
+
- Consider FixValidator confidence assessment
|
|
335
|
+
|
|
336
|
+
**CONTEXT**:
|
|
337
|
+
- Debug report from IssueAnalyzer
|
|
338
|
+
- Applied fix from FixWriter
|
|
339
|
+
- New tests from TestWriter
|
|
340
|
+
- Validation results from FixValidator
|
|
341
|
+
|
|
342
|
+
**OUTPUT**: Review decision
|
|
343
|
+
```yaml
|
|
344
|
+
review:
|
|
345
|
+
approved: true | false
|
|
346
|
+
validation_confidence: high | medium | low
|
|
347
|
+
concerns:
|
|
348
|
+
- "Test doesn't cover null profile case"
|
|
349
|
+
recommendations:
|
|
350
|
+
- "Add assertion for profile existence"
|
|
351
|
+
manual_testing_note: "User notified of manual testing requirement"
|
|
352
|
+
```
|
|
353
|
+
|
|
354
|
+
**Approval Criteria**:
|
|
355
|
+
- Fix addresses root cause identified in debug report
|
|
356
|
+
- Tests verify the specific bug scenario
|
|
357
|
+
- No new issues introduced
|
|
358
|
+
- Validation confidence is acceptable (high or medium with justification)
|
|
359
|
+
- If manual testing required, user has been notified
|
|
360
|
+
|
|
361
|
+
### Loop Condition
|
|
362
|
+
|
|
363
|
+
If `approved: false`, loop back to IssueAnalyzer with:
|
|
364
|
+
- Original issue context
|
|
365
|
+
- Previous fix attempt
|
|
366
|
+
- Review feedback
|
|
367
|
+
- Previous validation results
|
|
368
|
+
|
|
369
|
+
**Max iterations**: 3 (prevent infinite loops)
|
|
370
|
+
|
|
371
|
+
## Example Invocation
|
|
372
|
+
|
|
373
|
+
```markdown
|
|
374
|
+
## Pipeline: Fix Validation
|
|
375
|
+
|
|
376
|
+
### Stage 1: IssueAnalyzer
|
|
377
|
+
Task: subagent_type=bulwark-issue-analyzer, model=sonnet
|
|
378
|
+
Prompt: [4-part prompt with issue details]
|
|
379
|
+
Output: Debug report at logs/debug-reports/{issue-id}.yaml
|
|
380
|
+
|
|
381
|
+
### Stage 2: FixWriter
|
|
382
|
+
Task: subagent_type=bulwark-implementer
|
|
383
|
+
Prompt: [4-part prompt with debug report path, root cause, affected files, fix approach]
|
|
384
|
+
Output: Implementation report at logs/implementer-{id}-{timestamp}.yaml
|
|
385
|
+
|
|
386
|
+
### Stage 3: TestWriter (Orchestrator)
|
|
387
|
+
Actor: Orchestrator (Opus) - NOT a sub-agent
|
|
388
|
+
Action: Read debug report validation plan, write tests
|
|
389
|
+
Output: New/updated tests
|
|
390
|
+
|
|
391
|
+
### Stage 4: FixValidator
|
|
392
|
+
Task: subagent_type=bulwark-fix-validator, model=sonnet
|
|
393
|
+
Prompt: [4-part prompt, reads debug report, executes validation plan]
|
|
394
|
+
Output: Validation results with confidence assessment
|
|
395
|
+
|
|
396
|
+
### Stage 5: CodeReviewer
|
|
397
|
+
Task: subagent_type=general-purpose, model=sonnet
|
|
398
|
+
Prompt: [4-part prompt, reviews all stages including validation results]
|
|
399
|
+
Output: Approval decision
|
|
400
|
+
|
|
401
|
+
### Loop Check
|
|
402
|
+
If not approved and iterations < 3:
|
|
403
|
+
Go to Stage 1 with feedback + previous validation results
|
|
404
|
+
```
|
|
405
|
+
|
|
406
|
+
## Success Criteria
|
|
407
|
+
|
|
408
|
+
- Root cause identified and documented in debug report
|
|
409
|
+
- Impact analysis covers upstream/downstream dependencies
|
|
410
|
+
- Fix addresses root cause (not just symptom)
|
|
411
|
+
- Tests verify the fix with real behavior (T1-T4 rules)
|
|
412
|
+
- Validation plan executed (tiered: P1 → P2 → P3)
|
|
413
|
+
- Confidence assessment completed
|
|
414
|
+
- Manual testing escalated if required
|
|
415
|
+
- Review approves the fix
|
|
416
|
+
- No new issues introduced
|
|
417
|
+
|
|
418
|
+
## Related Pipelines
|
|
419
|
+
|
|
420
|
+
- **Code Review**: For reviewing without fixing
|
|
421
|
+
- **Test Execution & Fix**: For running tests after fix
|