@covibes/zeroshot 5.2.1 → 5.4.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/CHANGELOG.md +174 -189
- package/README.md +226 -195
- package/cli/commands/providers.js +149 -0
- package/cli/index.js +3145 -2366
- package/cli/lib/first-run.js +40 -3
- package/cli/message-formatters-normal.js +28 -6
- package/cluster-templates/base-templates/debug-workflow.json +24 -78
- package/cluster-templates/base-templates/full-workflow.json +99 -316
- package/cluster-templates/base-templates/single-worker.json +23 -15
- package/cluster-templates/base-templates/worker-validator.json +105 -36
- package/cluster-templates/conductor-bootstrap.json +9 -7
- package/lib/docker-config.js +14 -1
- package/lib/git-remote-utils.js +165 -0
- package/lib/id-detector.js +10 -7
- package/lib/provider-defaults.js +62 -0
- package/lib/provider-detection.js +59 -0
- package/lib/provider-names.js +57 -0
- package/lib/settings/claude-auth.js +78 -0
- package/lib/settings.js +298 -15
- package/lib/stream-json-parser.js +4 -238
- package/package.json +27 -6
- package/scripts/setup-merge-queue.sh +170 -0
- package/scripts/validate-templates.js +100 -0
- package/src/agent/agent-config.js +140 -63
- package/src/agent/agent-context-builder.js +336 -165
- package/src/agent/agent-hook-executor.js +337 -67
- package/src/agent/agent-lifecycle.js +386 -287
- package/src/agent/agent-stuck-detector.js +7 -7
- package/src/agent/agent-task-executor.js +944 -683
- package/src/agent/output-extraction.js +217 -0
- package/src/agent/output-reformatter.js +175 -0
- package/src/agent/schema-utils.js +146 -0
- package/src/agent-wrapper.js +112 -31
- package/src/agents/git-pusher-template.js +285 -0
- package/src/claude-task-runner.js +145 -44
- package/src/config-router.js +13 -13
- package/src/config-validator.js +1049 -563
- package/src/input-helpers.js +65 -0
- package/src/isolation-manager.js +499 -320
- package/src/issue-providers/README.md +305 -0
- package/src/issue-providers/azure-devops-provider.js +273 -0
- package/src/issue-providers/base-provider.js +232 -0
- package/src/issue-providers/github-provider.js +179 -0
- package/src/issue-providers/gitlab-provider.js +241 -0
- package/src/issue-providers/index.js +196 -0
- package/src/issue-providers/jira-provider.js +239 -0
- package/src/ledger.js +50 -11
- package/src/lib/safe-exec.js +88 -0
- package/src/orchestrator.js +1348 -757
- package/src/preflight.js +306 -149
- package/src/process-metrics.js +98 -56
- package/src/providers/anthropic/cli-builder.js +73 -0
- package/src/providers/anthropic/index.js +204 -0
- package/src/providers/anthropic/models.js +23 -0
- package/src/providers/anthropic/output-parser.js +177 -0
- package/src/providers/base-provider.js +251 -0
- package/src/providers/capabilities.js +60 -0
- package/src/providers/google/cli-builder.js +55 -0
- package/src/providers/google/index.js +116 -0
- package/src/providers/google/models.js +24 -0
- package/src/providers/google/output-parser.js +101 -0
- package/src/providers/index.js +91 -0
- package/src/providers/openai/cli-builder.js +133 -0
- package/src/providers/openai/index.js +136 -0
- package/src/providers/openai/models.js +21 -0
- package/src/providers/openai/output-parser.js +143 -0
- package/src/providers/opencode/cli-builder.js +42 -0
- package/src/providers/opencode/index.js +103 -0
- package/src/providers/opencode/models.js +55 -0
- package/src/providers/opencode/output-parser.js +122 -0
- package/src/schemas/sub-cluster.js +68 -39
- package/src/status-footer.js +94 -48
- package/src/sub-cluster-wrapper.js +92 -36
- package/src/task-runner.js +8 -6
- package/src/template-resolver.js +12 -9
- package/src/tui/data-poller.js +123 -99
- package/src/tui/formatters.js +4 -3
- package/src/tui/keybindings.js +259 -318
- package/src/tui/layout.js +20 -3
- package/src/tui/renderer.js +11 -21
- package/task-lib/attachable-watcher.js +150 -111
- package/task-lib/claude-recovery.js +156 -0
- package/task-lib/commands/episodes.js +105 -0
- package/task-lib/commands/list.js +3 -3
- package/task-lib/commands/logs.js +231 -189
- package/task-lib/commands/resume.js +3 -2
- package/task-lib/commands/run.js +12 -3
- package/task-lib/commands/schedules.js +111 -61
- package/task-lib/config.js +0 -2
- package/task-lib/runner.js +128 -50
- package/task-lib/scheduler.js +3 -3
- package/task-lib/store.js +464 -152
- package/task-lib/tui/formatters.js +94 -45
- package/task-lib/tui/renderer.js +13 -3
- package/task-lib/tui.js +73 -32
- package/task-lib/watcher.js +157 -100
- package/src/agents/git-pusher-agent.json +0 -20
- package/src/github.js +0 -103
|
@@ -1,33 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "Full Workflow",
|
|
3
|
-
"description": "Planner
|
|
3
|
+
"description": "Planner → Worker → Validators. For STANDARD/CRITICAL tasks.",
|
|
4
4
|
"params": {
|
|
5
|
-
"
|
|
5
|
+
"planner_level": {
|
|
6
6
|
"type": "string",
|
|
7
|
-
"enum": [
|
|
8
|
-
|
|
9
|
-
"sonnet",
|
|
10
|
-
"opus"
|
|
11
|
-
],
|
|
12
|
-
"default": "sonnet"
|
|
7
|
+
"enum": ["level1", "level2", "level3"],
|
|
8
|
+
"default": "level2"
|
|
13
9
|
},
|
|
14
|
-
"
|
|
10
|
+
"worker_level": {
|
|
15
11
|
"type": "string",
|
|
16
|
-
"enum": [
|
|
17
|
-
|
|
18
|
-
"sonnet",
|
|
19
|
-
"opus"
|
|
20
|
-
],
|
|
21
|
-
"default": "sonnet"
|
|
12
|
+
"enum": ["level1", "level2", "level3"],
|
|
13
|
+
"default": "level2"
|
|
22
14
|
},
|
|
23
|
-
"
|
|
15
|
+
"validator_level": {
|
|
24
16
|
"type": "string",
|
|
25
|
-
"enum": [
|
|
26
|
-
|
|
27
|
-
"sonnet",
|
|
28
|
-
"opus"
|
|
29
|
-
],
|
|
30
|
-
"default": "sonnet"
|
|
17
|
+
"enum": ["level1", "level2", "level3"],
|
|
18
|
+
"default": "level2"
|
|
31
19
|
},
|
|
32
20
|
"validator_count": {
|
|
33
21
|
"type": "number",
|
|
@@ -49,19 +37,12 @@
|
|
|
49
37
|
},
|
|
50
38
|
"task_type": {
|
|
51
39
|
"type": "string",
|
|
52
|
-
"enum": [
|
|
53
|
-
"INQUIRY",
|
|
54
|
-
"TASK",
|
|
55
|
-
"DEBUG"
|
|
56
|
-
],
|
|
40
|
+
"enum": ["INQUIRY", "TASK", "DEBUG"],
|
|
57
41
|
"description": "Type of work"
|
|
58
42
|
},
|
|
59
43
|
"complexity": {
|
|
60
44
|
"type": "string",
|
|
61
|
-
"enum": [
|
|
62
|
-
"STANDARD",
|
|
63
|
-
"CRITICAL"
|
|
64
|
-
],
|
|
45
|
+
"enum": ["STANDARD", "CRITICAL"],
|
|
65
46
|
"default": "STANDARD"
|
|
66
47
|
}
|
|
67
48
|
},
|
|
@@ -69,7 +50,7 @@
|
|
|
69
50
|
{
|
|
70
51
|
"id": "planner",
|
|
71
52
|
"role": "planning",
|
|
72
|
-
"
|
|
53
|
+
"modelLevel": "{{planner_level}}",
|
|
73
54
|
"timeout": "{{timeout}}",
|
|
74
55
|
"outputFormat": "json",
|
|
75
56
|
"jsonSchema": {
|
|
@@ -95,90 +76,6 @@
|
|
|
95
76
|
"type": "string"
|
|
96
77
|
}
|
|
97
78
|
},
|
|
98
|
-
"delegation": {
|
|
99
|
-
"type": "object",
|
|
100
|
-
"description": "Optional sub-agent delegation for large tasks (50+ items)",
|
|
101
|
-
"properties": {
|
|
102
|
-
"strategy": {
|
|
103
|
-
"type": "string",
|
|
104
|
-
"enum": [
|
|
105
|
-
"parallel",
|
|
106
|
-
"sequential",
|
|
107
|
-
"phased"
|
|
108
|
-
]
|
|
109
|
-
},
|
|
110
|
-
"maxParallelTasks": {
|
|
111
|
-
"type": "number",
|
|
112
|
-
"default": 3,
|
|
113
|
-
"description": "Maximum tasks to run in parallel per batch (default 3, prevents context explosion)"
|
|
114
|
-
},
|
|
115
|
-
"tasks": {
|
|
116
|
-
"type": "array",
|
|
117
|
-
"items": {
|
|
118
|
-
"type": "object",
|
|
119
|
-
"properties": {
|
|
120
|
-
"id": {
|
|
121
|
-
"type": "string"
|
|
122
|
-
},
|
|
123
|
-
"description": {
|
|
124
|
-
"type": "string"
|
|
125
|
-
},
|
|
126
|
-
"model": {
|
|
127
|
-
"type": "string",
|
|
128
|
-
"enum": [
|
|
129
|
-
"haiku",
|
|
130
|
-
"sonnet",
|
|
131
|
-
"opus"
|
|
132
|
-
]
|
|
133
|
-
},
|
|
134
|
-
"scope": {
|
|
135
|
-
"type": "array",
|
|
136
|
-
"items": {
|
|
137
|
-
"type": "string"
|
|
138
|
-
}
|
|
139
|
-
},
|
|
140
|
-
"dependsOn": {
|
|
141
|
-
"type": "array",
|
|
142
|
-
"items": {
|
|
143
|
-
"type": "string"
|
|
144
|
-
}
|
|
145
|
-
},
|
|
146
|
-
"estimatedComplexity": {
|
|
147
|
-
"type": "string",
|
|
148
|
-
"enum": [
|
|
149
|
-
"trivial",
|
|
150
|
-
"moderate",
|
|
151
|
-
"complex"
|
|
152
|
-
]
|
|
153
|
-
}
|
|
154
|
-
},
|
|
155
|
-
"required": [
|
|
156
|
-
"id",
|
|
157
|
-
"description",
|
|
158
|
-
"model",
|
|
159
|
-
"scope"
|
|
160
|
-
]
|
|
161
|
-
}
|
|
162
|
-
},
|
|
163
|
-
"phases": {
|
|
164
|
-
"type": "array",
|
|
165
|
-
"items": {
|
|
166
|
-
"type": "object",
|
|
167
|
-
"properties": {
|
|
168
|
-
"name": {
|
|
169
|
-
"type": "string"
|
|
170
|
-
},
|
|
171
|
-
"taskIds": {
|
|
172
|
-
"type": "array",
|
|
173
|
-
"items": {
|
|
174
|
-
"type": "string"
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
},
|
|
182
79
|
"acceptanceCriteria": {
|
|
183
80
|
"type": "array",
|
|
184
81
|
"description": "EXPLICIT, TESTABLE acceptance criteria. Each must be verifiable. NO VAGUE BULLSHIT.",
|
|
@@ -199,33 +96,19 @@
|
|
|
199
96
|
},
|
|
200
97
|
"priority": {
|
|
201
98
|
"type": "string",
|
|
202
|
-
"enum": [
|
|
203
|
-
"MUST",
|
|
204
|
-
"SHOULD",
|
|
205
|
-
"NICE"
|
|
206
|
-
],
|
|
99
|
+
"enum": ["MUST", "SHOULD", "NICE"],
|
|
207
100
|
"description": "MUST = blocks completion"
|
|
208
101
|
}
|
|
209
102
|
},
|
|
210
|
-
"required": [
|
|
211
|
-
"id",
|
|
212
|
-
"criterion",
|
|
213
|
-
"verification",
|
|
214
|
-
"priority"
|
|
215
|
-
]
|
|
103
|
+
"required": ["id", "criterion", "verification", "priority"]
|
|
216
104
|
},
|
|
217
105
|
"minItems": 3
|
|
218
106
|
}
|
|
219
107
|
},
|
|
220
|
-
"required": [
|
|
221
|
-
"plan",
|
|
222
|
-
"summary",
|
|
223
|
-
"filesAffected",
|
|
224
|
-
"acceptanceCriteria"
|
|
225
|
-
]
|
|
108
|
+
"required": ["plan", "summary", "filesAffected", "acceptanceCriteria"]
|
|
226
109
|
},
|
|
227
110
|
"prompt": {
|
|
228
|
-
"system": "##
|
|
111
|
+
"system": "## 🚫 YOU CANNOT ASK QUESTIONS\n\nYou are running non-interactively. There is NO USER to answer.\n- NEVER use AskUserQuestion tool\n- NEVER say \"Should I...\" or \"Would you like...\"\n- When unsure: Make the SAFER choice and proceed.\n\nYou are a planning agent for a {{complexity}} {{task_type}} task.\n\n## Your Job\nCreate a FLAT LIST of executable steps. The worker will execute them IN ORDER.\n\n## Plan Scope: Single-Session Execution\n\nEvery step must be completable in ONE autonomous session.\n\n**Allowed:**\n- Code/test/doc changes\n- Immediate verification (run tests, check files exist)\n\n**Forbidden:**\n- Waiting periods (hours/days/weeks)\n- Deployment/operations tasks\n- Monitoring over time\n\nFinal step: \"Ready to deploy\" (NOT \"deploy it\").\n\n## 🔴 PLAN FORMAT (CRITICAL)\n\nOutput a flat list of numbered steps in the `plan` field. Each step is ONE concrete action.\n\n**EXAMPLE - CORRECT:**\n```\n1. Create server/services/rate-limiter.ts with RateLimiter class\n2. Add middleware registration in server/src/server.ts:45\n3. Add config constant in server/config/limits.ts\n4. Write test in tests/unit/rate-limiter.test.ts\n5. Run npm test to verify\n```\n\n**FORBIDDEN:**\n- \"Phase 1\", \"Phase 2\" → NO PHASES. Just steps.\n- \"Future work\" → NO. Everything NOW.\n- \"We could do X or Y\" → NO OPTIONS. Pick one.\n- Delegation to sub-agents → NO. Worker does it all.\n- Deferring anything → FORBIDDEN.\n\nJust numbered steps. Execute in order. Done.\n\n## 🔴 ONE PLAN. THE BEST PLAN.\n\n❌ ABSOLUTELY FORBIDDEN:\n- 'Option 1... Option 2...'\n- 'Alternative approaches include...'\n- 'We could either X or Y'\n- Hedging with 'alternatively'\n\n✅ REQUIRED:\n- ONE decisive implementation approach\n- The approach a FAANG Staff/Principal Engineer would choose\n- Clean architecture, no hacks\n\nYou are a STAFF LEVEL PRINCIPAL ENGINEER. Make THE decision. Present THE plan.\n\n## Planning Process\n1. Analyze requirements thoroughly\n2. Explore codebase to understand architecture\n3. Identify ALL files that need changes\n4. Break down into concrete, actionable steps\n5. Consider cross-component dependencies\n\n{{#if complexity == 'CRITICAL'}}\n## CRITICAL TASK - EXTRA SCRUTINY\n- This is HIGH RISK (auth, payments, security, production)\n- Plan must include rollback strategy\n- Consider blast radius of changes\n- Identify all possible failure modes\n{{/if}}\n\n## 🔴 ACCEPTANCE CRITERIA (REQUIRED - minItems: 3)\n\nYou MUST output explicit, testable acceptance criteria.\n\n### BAD vs GOOD Criteria:\n\n❌ BAD: \"Dark mode works correctly\"\n✅ GOOD: \"Toggle dark mode → all text readable (contrast ratio >4.5:1), background #1a1a1a\"\n\n❌ BAD: \"API handles errors\"\n✅ GOOD: \"POST /api/users with invalid email → returns 400 + {error: 'Invalid email format'}\"\n\n❌ BAD: \"Tests pass\"\n✅ GOOD: \"Test suite passes with 100% success, coverage >80% on new files\"\n\n### Criteria Format:\nEach criterion MUST have:\n- **id**: AC1, AC2, AC3, etc.\n- **criterion**: TESTABLE statement\n- **verification**: EXACT steps to verify\n- **priority**: MUST (blocks completion), SHOULD (important), NICE (bonus)\n\nMinimum 3 criteria. At least 1 MUST be priority=MUST.\n\n## 🔴 OUTPUT CONCISENESS (CRITICAL)\n\nYour plan will be consumed by other agents. Be CONCISE.\n\n**FORBIDDEN:**\n- ❌ Paragraphs explaining WHY\n- ❌ Background context\n- ❌ Explaining obvious steps\n- ❌ Code examples for trivial changes\n\n**REQUIRED:**\n- ✅ Steps as imperative commands (\"Add X to file.ts:123\")\n- ✅ File paths without explanations\n- ✅ Target: <2000 words total\n\n**EXAMPLE - BAD:**\n\"First, we need to update the health monitor service located at server/services/preview/health-monitor.ts. This file is responsible for monitoring container health...\"\n\n**EXAMPLE - GOOD:**\n\"Refactor health-monitor.ts:validateContainerHealth() - delegate to executor.checkContainerHealth()\"\n\nDO NOT implement - planning only."
|
|
229
112
|
},
|
|
230
113
|
"contextStrategy": {
|
|
231
114
|
"sources": [
|
|
@@ -254,7 +137,6 @@
|
|
|
254
137
|
"summary": "{{result.summary}}",
|
|
255
138
|
"filesAffected": "{{result.filesAffected}}",
|
|
256
139
|
"risks": "{{result.risks}}",
|
|
257
|
-
"delegation": "{{result.delegation}}",
|
|
258
140
|
"acceptanceCriteria": "{{result.acceptanceCriteria}}"
|
|
259
141
|
}
|
|
260
142
|
}
|
|
@@ -265,11 +147,47 @@
|
|
|
265
147
|
{
|
|
266
148
|
"id": "worker",
|
|
267
149
|
"role": "implementation",
|
|
268
|
-
"
|
|
150
|
+
"modelLevel": "{{worker_level}}",
|
|
269
151
|
"timeout": "{{timeout}}",
|
|
152
|
+
"outputFormat": "json",
|
|
153
|
+
"jsonSchema": {
|
|
154
|
+
"type": "object",
|
|
155
|
+
"properties": {
|
|
156
|
+
"summary": {
|
|
157
|
+
"type": "string",
|
|
158
|
+
"description": "Brief description of work done this iteration"
|
|
159
|
+
},
|
|
160
|
+
"completionStatus": {
|
|
161
|
+
"type": "object",
|
|
162
|
+
"description": "Self-assessment of completion state",
|
|
163
|
+
"properties": {
|
|
164
|
+
"canValidate": {
|
|
165
|
+
"type": "boolean",
|
|
166
|
+
"description": "true if work is ready for validator review, false if more work needed"
|
|
167
|
+
},
|
|
168
|
+
"percentComplete": {
|
|
169
|
+
"type": "number",
|
|
170
|
+
"description": "Estimated completion percentage (0-100)"
|
|
171
|
+
},
|
|
172
|
+
"blockers": {
|
|
173
|
+
"type": "array",
|
|
174
|
+
"items": { "type": "string" },
|
|
175
|
+
"description": "Issues preventing completion (empty if canValidate=true)"
|
|
176
|
+
},
|
|
177
|
+
"nextSteps": {
|
|
178
|
+
"type": "array",
|
|
179
|
+
"items": { "type": "string" },
|
|
180
|
+
"description": "Remaining work items (empty if canValidate=true)"
|
|
181
|
+
}
|
|
182
|
+
},
|
|
183
|
+
"required": ["canValidate", "percentComplete"]
|
|
184
|
+
}
|
|
185
|
+
},
|
|
186
|
+
"required": ["summary", "completionStatus"]
|
|
187
|
+
},
|
|
270
188
|
"prompt": {
|
|
271
|
-
"initial": "##
|
|
272
|
-
"subsequent": "##
|
|
189
|
+
"initial": "## 🚫 YOU CANNOT ASK QUESTIONS\n\nYou are running non-interactively. There is NO USER to answer.\n- NEVER use AskUserQuestion tool\n- NEVER say \"Should I...\" or \"Would you like...\"\n- When unsure: Make the SAFER choice and proceed.\n\nYou are an implementation agent for a {{complexity}} {{task_type}} task.\n\n## 🔴🔴🔴 DO THE WORK. DON'T REPORT STATUS. 🔴🔴🔴\n\n**YOUR JOB IS TO EXECUTE, NOT TO ANALYZE.**\n\n❌ FORBIDDEN OUTPUT:\n- \"Infrastructure exists but 0% migration completed\" → STATUS REPORT. DO THE MIGRATION.\n- \"Need actual migration of at least 1 domain\" → ANALYSIS. DO THE MIGRATION.\n- \"Validators correctly rejected\" → COMMENTARY. FIX THE CODE.\n- \"X exists but Y not done\" → OBSERVATION. DO Y.\n- ANY sentence describing what exists vs what doesn't → EXECUTE, DON'T DESCRIBE.\n\n✅ REQUIRED BEHAVIOR:\n- Read the plan → Execute step 1 → Execute step 2 → ... → Done\n- Write code. Edit files. Run commands. Make changes.\n- If plan says \"migrate 1 domain\" → PICK A DOMAIN AND MIGRATE IT. NOW.\n- If plan says \"add tests\" → WRITE THE TESTS. NOW.\n- EVERY response must include tool calls that MAKE CHANGES.\n\n**STATUS REPORTS ARE FAILURE.** You are paid to SHIP CODE, not describe the state of the codebase.\n\n## 🔴 EXECUTION PROTOCOL\n\n1. Read PLAN_READY → Get the numbered steps\n2. Execute step 1 (Edit files, Write files, Bash commands)\n3. Execute step 2\n4. ... continue until ALL steps done\n5. Run tests to verify\n6. Set canValidate: true\n\n**EVERY tool call should be Edit, Write, or Bash that CHANGES something.**\n\nRead/Grep/Glob are for understanding - but understanding is FAST. Spend 90% of time CHANGING, 10% READING.\n\n## 🔴 SCOPE IS NON-NEGOTIABLE\n\nYou MUST implement EVERYTHING in the plan. ALL OF IT.\n\n**FORBIDDEN EXCUSES:**\n- \"This is complex\" → DO IT ANYWAY.\n- \"This requires more work\" → DO THE WORK.\n- \"Deferred to future\" → NO. NOW.\n- \"NOT IMPLEMENTED\" → INSTANT FAILURE.\n\n## Code Quality\n\n### Error Handling (FAIL FAST)\n- NEVER return defaults to avoid throwing\n- NEVER swallow exceptions\n\n### Tests\n- Test BEHAVIOR, not implementation\n- Write tests for ALL new functionality\n- Run tests to verify\n\n## 🔴 COMPLETION STATUS\n\n**Set canValidate: true** when:\n- All plan steps executed\n- Code compiles/runs\n- Tests pass\n\n**Set canValidate: false** when:\n- Still executing steps (you'll continue next iteration)\n- Hit a blocker (describe briefly, then WORK AROUND IT)\n\n**NEVER set canValidate: false with a status report. If you're not done, KEEP WORKING.**\n\n{{#if complexity == 'CRITICAL'}}\n## CRITICAL TASK - EXTRA CARE\n- Double-check every change\n- No shortcuts or assumptions\n- Consider security implications\n{{/if}}",
|
|
190
|
+
"subsequent": "## 🚫 YOU CANNOT ASK QUESTIONS\n\nYou are running non-interactively. There is NO USER to answer.\n- NEVER use AskUserQuestion tool\n- NEVER say \"Should I...\" or \"Would you like...\"\n- When unsure: Make the SAFER choice and proceed.\n\nYou are an implementation agent for a {{complexity}} {{task_type}} task.\n\n## 🔴 YOU FAILED. FIX IT.\n\nValidators REJECTED your work. This is not nitpicking. They found REAL PROBLEMS.\n\nYou wasted time and money. Every rejection costs API credits. Every iteration delays the user.\n\n**THIS TIME, GET IT RIGHT.**\n\n## READ THE REJECTION CAREFULLY\n\nBefore writing a single line of code:\n1. Read EVERY VALIDATION_RESULT message. ALL of them.\n2. For each error: What EXACTLY is wrong? Not your interpretation. THEIR words.\n3. Why did you make this mistake? Be honest with yourself.\n4. Is your entire approach flawed? Sometimes you need to start over.\n\n## 🔴 ROOT CAUSE, NOT SYMPTOMS\n\nDon't just make the error message go away. FIX THE ACTUAL PROBLEM.\n\n**BAD:** Validator says \"missing null check\" → add `if (x != null)`\n**GOOD:** Validator says \"missing null check\" → Why is x null? Should it be? Fix the source.\n\n**BAD:** Test fails → change expected value to match actual\n**GOOD:** Test fails → Why is the actual value wrong? Fix the code.\n\n**BAD:** Type error → add `as any`\n**GOOD:** Type error → Why doesn't the type match? Fix the type or the code.\n\n## SELF-VERIFICATION BEFORE RESUBMITTING\n\nDo NOT submit until you can answer YES to ALL of these:\n\n1. Did I fix EVERY error from EVERY validator? (not just some of them)\n2. Did I run the tests myself? Do they pass?\n3. Did I try the feature myself? Does it work?\n4. Did I check EACH acceptance criterion? Can I prove they're satisfied?\n5. Would I bet my salary this passes validation?\n\nIf ANY answer is NO or \"I think so\", YOU'RE NOT DONE.\n\n## NO MORE EXCUSES\n\n- \"I thought that was optional\" → Read the requirements again. It wasn't.\n- \"That edge case is unlikely\" → Validators will test it. Handle it.\n- \"The test is wrong\" → No. Your code is wrong. Fix the code.\n- \"It works on my machine\" → Doesn't matter. Make it work everywhere.\n\n## MINDSET\n\nYou are a PROFESSIONAL. You got rejected because your work wasn't good enough.\n\nNow make it good enough. No shortcuts. No excuses. No band-aids.\n\nDeliver code you'd be PROUD of.\n\n{{#if complexity == 'CRITICAL'}}\n## CRITICAL TASK - YOU ESPECIALLY CANNOT FAIL\n- This is HIGH RISK code (auth, payments, security, production)\n- Your failure could cause real damage\n- Triple-check EVERYTHING\n- If you're not 100% certain, investigate more\n{{/if}}"
|
|
273
191
|
},
|
|
274
192
|
"contextStrategy": {
|
|
275
193
|
"sources": [
|
|
@@ -281,6 +199,11 @@
|
|
|
281
199
|
"topic": "PLAN_READY",
|
|
282
200
|
"limit": 1
|
|
283
201
|
},
|
|
202
|
+
{
|
|
203
|
+
"topic": "WORKER_PROGRESS",
|
|
204
|
+
"since": "last_task_end",
|
|
205
|
+
"limit": 3
|
|
206
|
+
},
|
|
284
207
|
{
|
|
285
208
|
"topic": "VALIDATION_RESULT",
|
|
286
209
|
"since": "last_task_end",
|
|
@@ -295,6 +218,14 @@
|
|
|
295
218
|
"topic": "PLAN_READY",
|
|
296
219
|
"action": "execute_task"
|
|
297
220
|
},
|
|
221
|
+
{
|
|
222
|
+
"topic": "WORKER_PROGRESS",
|
|
223
|
+
"logic": {
|
|
224
|
+
"engine": "javascript",
|
|
225
|
+
"script": "return message.sender === 'worker';"
|
|
226
|
+
},
|
|
227
|
+
"action": "execute_task"
|
|
228
|
+
},
|
|
298
229
|
{
|
|
299
230
|
"topic": "VALIDATION_RESULT",
|
|
300
231
|
"logic": {
|
|
@@ -310,8 +241,15 @@
|
|
|
310
241
|
"config": {
|
|
311
242
|
"topic": "IMPLEMENTATION_READY",
|
|
312
243
|
"content": {
|
|
313
|
-
"text": "
|
|
244
|
+
"text": "{{result.summary}}",
|
|
245
|
+
"data": {
|
|
246
|
+
"completionStatus": "{{result.completionStatus}}"
|
|
247
|
+
}
|
|
314
248
|
}
|
|
249
|
+
},
|
|
250
|
+
"logic": {
|
|
251
|
+
"engine": "javascript",
|
|
252
|
+
"script": "if (!result.completionStatus?.canValidate) return { topic: 'WORKER_PROGRESS' };"
|
|
315
253
|
}
|
|
316
254
|
}
|
|
317
255
|
},
|
|
@@ -320,7 +258,7 @@
|
|
|
320
258
|
{
|
|
321
259
|
"id": "validator-requirements",
|
|
322
260
|
"role": "validator",
|
|
323
|
-
"
|
|
261
|
+
"modelLevel": "{{validator_level}}",
|
|
324
262
|
"timeout": "{{timeout}}",
|
|
325
263
|
"maxRetries": 3,
|
|
326
264
|
"outputFormat": "json",
|
|
@@ -341,7 +279,7 @@
|
|
|
341
279
|
},
|
|
342
280
|
"criteriaResults": {
|
|
343
281
|
"type": "array",
|
|
344
|
-
"description": "
|
|
282
|
+
"description": "Status for each acceptance criterion. PASS/FAIL require evidence. CANNOT_VALIDATE requires reason.",
|
|
345
283
|
"items": {
|
|
346
284
|
"type": "object",
|
|
347
285
|
"properties": {
|
|
@@ -351,20 +289,12 @@
|
|
|
351
289
|
},
|
|
352
290
|
"status": {
|
|
353
291
|
"type": "string",
|
|
354
|
-
"enum": [
|
|
355
|
-
|
|
356
|
-
"FAIL",
|
|
357
|
-
"SKIPPED"
|
|
358
|
-
]
|
|
292
|
+
"enum": ["PASS", "FAIL", "SKIPPED", "CANNOT_VALIDATE"],
|
|
293
|
+
"description": "CANNOT_VALIDATE = verification impossible (missing tools, permissions, etc). Treated as PASS with warning."
|
|
359
294
|
},
|
|
360
295
|
"evidence": {
|
|
361
296
|
"type": "object",
|
|
362
|
-
"description": "
|
|
363
|
-
"required": [
|
|
364
|
-
"command",
|
|
365
|
-
"exitCode",
|
|
366
|
-
"output"
|
|
367
|
-
],
|
|
297
|
+
"description": "REQUIRED for PASS/FAIL. Proof of verification - actual command output.",
|
|
368
298
|
"properties": {
|
|
369
299
|
"command": {
|
|
370
300
|
"type": "string"
|
|
@@ -376,24 +306,20 @@
|
|
|
376
306
|
"type": "string"
|
|
377
307
|
}
|
|
378
308
|
}
|
|
309
|
+
},
|
|
310
|
+
"reason": {
|
|
311
|
+
"type": "string",
|
|
312
|
+
"description": "REQUIRED for CANNOT_VALIDATE. WHY verification is impossible (e.g., 'kubectl not installed', 'no SSH access')."
|
|
379
313
|
}
|
|
380
314
|
},
|
|
381
|
-
"required": [
|
|
382
|
-
"id",
|
|
383
|
-
"status",
|
|
384
|
-
"evidence"
|
|
385
|
-
]
|
|
315
|
+
"required": ["id", "status"]
|
|
386
316
|
}
|
|
387
317
|
}
|
|
388
318
|
},
|
|
389
|
-
"required": [
|
|
390
|
-
"approved",
|
|
391
|
-
"summary",
|
|
392
|
-
"criteriaResults"
|
|
393
|
-
]
|
|
319
|
+
"required": ["approved", "summary", "criteriaResults"]
|
|
394
320
|
},
|
|
395
321
|
"prompt": {
|
|
396
|
-
"system": "
|
|
322
|
+
"system": "# REQUIREMENTS VALIDATOR\n\nVerify implementation meets ALL requirements from issue. Hold a HIGH BAR.\n\n## WORKFLOW\n1. Read context files (CLAUDE.md, AGENTS.md, README) for repo-specific validation\n2. Parse acceptanceCriteria from PLAN_READY\n3. For EACH criterion: run verification, record evidence\n4. If repo has validation script (e.g. `./scripts/check-all.sh`), RUN IT\n\n## VERIFICATION\n- SEARCH before claiming 'missing' (Glob, Grep, Read)\n- RUN commands, capture output as evidence\n- CANNOT_VALIDATE only for: tool not installed, no network, permission denied\n\n## INSTANT REJECT\n- TODO/FIXME/placeholder = REJECT\n- Silent error swallowing = REJECT\n- 'Phase 2 deferred' = REJECT\n- 'Will add tests later' = REJECT\n- ANY priority=MUST criterion fails = REJECT\n\n## APPROVAL\n- approved:true = ALL MUST criteria pass + no blocking issues\n- approved:false = any MUST fails OR incomplete implementation\n\n🚫 NO questions. Make safe choice and proceed.\n\n## 🔴 OUTPUT FORMAT (CRITICAL)\n\nYou MUST return valid JSON with these REQUIRED fields:\n```json\n{\n \"approved\": boolean,\n \"summary\": \"<100 chars max>\",\n \"errors\": [\"blocking issue 1\", \"blocking issue 2\"],\n \"criteriaResults\": [{\"id\": \"AC1\", \"status\": \"PASS|FAIL|CANNOT_VALIDATE\", \"evidence\": {\"command\": \"...\", \"exitCode\": 0, \"output\": \"<200 chars>\"}, \"reason\": \"for CANNOT_VALIDATE only\"}]\n}\n```\nNo preamble. JSON only."
|
|
397
323
|
},
|
|
398
324
|
"contextStrategy": {
|
|
399
325
|
"sources": [
|
|
@@ -440,7 +366,7 @@
|
|
|
440
366
|
{
|
|
441
367
|
"id": "validator-code",
|
|
442
368
|
"role": "validator",
|
|
443
|
-
"
|
|
369
|
+
"modelLevel": "{{validator_level}}",
|
|
444
370
|
"timeout": "{{timeout}}",
|
|
445
371
|
"maxRetries": 3,
|
|
446
372
|
"condition": "{{validator_count}} >= 2",
|
|
@@ -461,13 +387,10 @@
|
|
|
461
387
|
}
|
|
462
388
|
}
|
|
463
389
|
},
|
|
464
|
-
"required": [
|
|
465
|
-
"approved",
|
|
466
|
-
"summary"
|
|
467
|
-
]
|
|
390
|
+
"required": ["approved", "summary"]
|
|
468
391
|
},
|
|
469
392
|
"prompt": {
|
|
470
|
-
"system": "
|
|
393
|
+
"system": "# CODE VALIDATOR\n\nSenior engineer code review. Catch REAL bugs, not style preferences.\n\n## WORKFLOW\n1. Read context files (CLAUDE.md, AGENTS.md, README) for repo-specific validation\n2. SEARCH before claiming 'missing' (Glob, Grep, Read)\n3. RUN validation scripts if specified\n\n## INSTANT REJECT\n- TODO/FIXME/placeholder = REJECT\n- Silent error swallowing = REJECT\n- Dangerous fallbacks hiding failures = REJECT\n\n## 🔴 GENERALIZATION CHECK (CRITICAL)\nWorker fixed a bug? Verify they fixed ALL instances:\n1. Identify the PATTERN (not just the line)\n2. `grep -rn \"pattern\" .` - search codebase\n3. If N > 1 exists → Did worker fix ALL? If NO → REJECT\n\nExamples: null check in one handler? Check ALL. SQL injection in one query? Check ALL. A fix that leaves identical bugs elsewhere is NOT a fix.\n\n## BLOCKING (reject with WHAT/HOW/WHY)\n- Logic/off-by-one bugs\n- Race conditions\n- Security holes (injection, auth bypass)\n- Resource leaks (timers, connections)\n- God functions (>50 lines) - SPLIT\n- DRY violation (same logic 2+ places)\n- Missing error handling\n- Hardcoded values that should be config\n\n## NOT BLOCKING (summary only)\n- Style/naming preferences\n- 'Could theoretically...' without proof\n\n🚫 NO questions. Make safe choice and proceed.\n\n## 🔴 OUTPUT FORMAT (CRITICAL)\n\nYou MUST return valid JSON:\n```json\n{\n \"approved\": boolean,\n \"summary\": \"<100 chars max>\",\n \"errors\": [\"WHAT: X. HOW: Y. WHY: Z\"]\n}\n```\nNo preamble. JSON only."
|
|
471
394
|
},
|
|
472
395
|
"contextStrategy": {
|
|
473
396
|
"sources": [
|
|
@@ -513,7 +436,7 @@
|
|
|
513
436
|
{
|
|
514
437
|
"id": "validator-security",
|
|
515
438
|
"role": "validator",
|
|
516
|
-
"
|
|
439
|
+
"modelLevel": "{{validator_level}}",
|
|
517
440
|
"timeout": "{{timeout}}",
|
|
518
441
|
"maxRetries": 3,
|
|
519
442
|
"condition": "{{validator_count}} >= 3",
|
|
@@ -534,13 +457,10 @@
|
|
|
534
457
|
}
|
|
535
458
|
}
|
|
536
459
|
},
|
|
537
|
-
"required": [
|
|
538
|
-
"approved",
|
|
539
|
-
"summary"
|
|
540
|
-
]
|
|
460
|
+
"required": ["approved", "summary"]
|
|
541
461
|
},
|
|
542
462
|
"prompt": {
|
|
543
|
-
"system": "## \
|
|
463
|
+
"system": "## 🔴 OUTPUT FORMAT (CRITICAL - READ FIRST)\n\nYour output MUST be MINIMAL and STRUCTURED:\n- Output ONLY the required JSON schema fields\n- NO preambles (\"Here is my analysis...\", \"Let me explain...\")\n- NO verbose summaries - be CONCISE (max 100 chars per string field)\n- NO redundant information\n- NO explanations before or after the JSON\n\n## 🚫 YOU CANNOT ASK QUESTIONS\n\nYou are running non-interactively. There is NO USER to answer.\n- NEVER use AskUserQuestion tool\n- NEVER say \"Should I...\" or \"Would you like...\"\n- When unsure: Make the SAFER choice and proceed.\n\n## 🔴 READ CONTEXT FILES FOR REPO-SPECIFIC VALIDATION\n\n**BEFORE approving any implementation:**\n1. Read the repo's context files (CLAUDE.md, AGENTS.md, README if they exist)\n2. Look for validation instructions, scripts, or commands the repo specifies\n3. If context files say to run a validation script (e.g., `./scripts/check-all.sh`), RUN IT\n4. If the validation script fails, the implementation is NOT complete - REJECT\n\nThis ensures you validate according to THIS repo's standards, not generic rules.\n\n## 🔴 VERIFICATION PROTOCOL (REQUIRED - PREVENTS FALSE CLAIMS)\n\nBefore making ANY claim about security vulnerabilities or missing protections:\n\n1. **SEARCH FIRST** - Use Glob to find ALL relevant files\n2. **READ THE CODE** - Use Read to inspect actual implementation\n3. **GREP FOR PATTERNS** - Use Grep to search for specific code (auth checks, validation, etc.)\n\n**NEVER claim a vulnerability exists without FIRST searching for the relevant code.**\n\nThe worker may have implemented security features in different files than originally planned. If you claim 'missing input validation' without searching, you may miss that validation exists in 'server/middleware/validator.ts' instead of the controller.\n\n### Example Verification Flow:\n```\n1. Claim: 'Missing SQL injection protection'\n2. BEFORE claiming → Grep for 'parameterized', 'prepared', 'escape' in relevant files\n3. BEFORE claiming → Read the actual database query code\n4. ONLY IF NOT FOUND → Add to errors array\n```\n\nYou are a security auditor for a {{complexity}} task.\n\n## Security Review Checklist\n1. Input validation (injection attacks)\n2. Authentication/authorization checks\n3. Sensitive data handling\n4. OWASP Top 10 vulnerabilities\n5. Secrets management\n6. Error messages don't leak info\n\n## Output\n- approved: true if no security issues\n- summary: Security assessment\n- errors: Security vulnerabilities found\n\n## 🔴 DEBUGGING METHODOLOGY CHECK\n\nBefore approving, verify the worker didn't take shortcuts:\n\n### Ad Hoc Fix Detection\n- Did worker fix ONE instance? → Grep for similar patterns. If N > 1 exists, REJECT.\n- Example: Fixed null check in `auth.ts:42`? → `grep -r \"similar pattern\" .` - are there others?\n\n### Root Cause vs Symptom\n- Did worker add a workaround? → Find the ACTUAL bug. If workaround hides real issue, REJECT.\n- Example: Added `|| []` fallback? → WHY is it undefined? Fix THAT.\n\n### Lazy Debugging Red Flags (INSTANT REJECT)\n- Worker suggests \"restart the service\" → REJECT (hides the bug)\n- Worker suggests \"clear the cache\" → REJECT (hides the bug)\n- Worker says \"works on my machine\" → REJECT (not a fix)\n- Worker blames the test → REJECT unless they PROVE test is wrong with evidence"
|
|
544
464
|
},
|
|
545
465
|
"contextStrategy": {
|
|
546
466
|
"sources": [
|
|
@@ -586,7 +506,7 @@
|
|
|
586
506
|
{
|
|
587
507
|
"id": "validator-tester",
|
|
588
508
|
"role": "validator",
|
|
589
|
-
"
|
|
509
|
+
"modelLevel": "{{validator_level}}",
|
|
590
510
|
"timeout": "{{timeout}}",
|
|
591
511
|
"maxRetries": 3,
|
|
592
512
|
"condition": "{{validator_count}} >= 4",
|
|
@@ -610,13 +530,10 @@
|
|
|
610
530
|
"type": "string"
|
|
611
531
|
}
|
|
612
532
|
},
|
|
613
|
-
"required": [
|
|
614
|
-
"approved",
|
|
615
|
-
"summary"
|
|
616
|
-
]
|
|
533
|
+
"required": ["approved", "summary"]
|
|
617
534
|
},
|
|
618
535
|
"prompt": {
|
|
619
|
-
"system": "##
|
|
536
|
+
"system": "## 🔴 OUTPUT FORMAT (CRITICAL - READ FIRST)\n\nYour output MUST be MINIMAL and STRUCTURED:\n- Output ONLY the required JSON schema fields\n- NO preambles (\"Here is my analysis...\", \"Let me explain...\")\n- NO verbose summaries - be CONCISE (max 100 chars per string field)\n- NO redundant information\n- NO explanations before or after the JSON\n- testResults field: ONLY include pass/fail counts and key errors, NOT full test output\n\n## 🚫 YOU CANNOT ASK QUESTIONS\n\nYou are running non-interactively. There is NO USER to answer.\n- NEVER use AskUserQuestion tool\n- NEVER say \"Should I...\" or \"Would you like...\"\n- When unsure: Make the SAFER choice and proceed.\n\nYou are a TEST EXECUTOR. Your job is to RUN TESTS, not read them.\n\n## 🔴 CORE PRINCIPLE: RUN THE TESTS, DON'T JUST READ THEM\n\n**Reading test code is NOT verification. You must EXECUTE tests.**\n\n- 'Tests look correct' = NOT ACCEPTABLE\n- 'Test output shows 15/15 passing' = ACTUAL VERIFICATION\n\n## 🔴 STEP 1: FIND AND RUN THE TEST SUITE (MANDATORY)\n\n1. Read context files (CLAUDE.md, AGENTS.md, README) for repo-specific test commands\n2. Find the test runner: `npm test`, `pytest`, `go test`, `cargo test`, etc.\n3. **RUN THE TESTS** using Bash tool\n4. Record FULL output in testResults field\n5. If ANY tests fail → REJECT immediately\n\n**This is not optional. You MUST run tests, not just search for them.**\n\n## 🔴 STEP 2: RUN REPO-SPECIFIC VALIDATION\n\nIf context files specify validation commands (e.g., `./scripts/check-all.sh`):\n1. RUN THEM\n2. Record output\n3. If they fail → REJECT\n\n## 🔴 STEP 3: VERIFY TEST QUALITY BY RUNNING\n\n**DO NOT assess quality by reading code. Assess by execution:**\n\n1. Run tests with verbose output: `npm test -- --verbose`\n2. Check coverage: `npm test -- --coverage`\n3. Record actual numbers in testResults\n\n**Quality indicators from EXECUTION:**\n- Coverage percentage (from actual run)\n- Number of test cases (from actual output)\n- Test duration (from actual output)\n\n## FORBIDDEN PATTERNS\n\n- ❌ 'Tests appear to have good coverage' without running them\n- ❌ 'Test assertions look correct' without executing them\n- ❌ 'The test file exists' as evidence of testing\n- ❌ Approving without testResults containing actual test output\n\n## APPROVAL CRITERIA\n\nONLY approve if:\n1. You RAN the test suite (actual output in testResults)\n2. All tests pass (verified by execution)\n3. Repo-specific validation commands pass (if specified)\n4. Coverage is acceptable for the repo (from actual coverage report)\n\n## Output\n- **approved**: true if tests RAN and PASSED\n- **summary**: Assessment based on ACTUAL test execution results\n- **errors**: Issues found (from running tests, not reading code)\n- **testResults**: ACTUAL OUTPUT from running test commands (REQUIRED)\n\n## 🔴 DEBUGGING METHODOLOGY CHECK\n\nBefore approving, verify the worker didn't take shortcuts:\n\n### Ad Hoc Fix Detection\n- Did worker fix ONE instance? → Grep for similar patterns. If N > 1 exists, REJECT.\n- Example: Fixed null check in `auth.ts:42`? → `grep -r \"similar pattern\" .` - are there others?\n\n### Root Cause vs Symptom\n- Did worker add a workaround? → Find the ACTUAL bug. If workaround hides real issue, REJECT.\n- Example: Added `|| []` fallback? → WHY is it undefined? Fix THAT.\n\n### Lazy Debugging Red Flags (INSTANT REJECT)\n- Worker suggests \"restart the service\" → REJECT (hides the bug)\n- Worker suggests \"clear the cache\" → REJECT (hides the bug)\n- Worker says \"works on my machine\" → REJECT (not a fix)\n- Worker blames the test → REJECT unless they PROVE test is wrong with evidence"
|
|
620
537
|
},
|
|
621
538
|
"contextStrategy": {
|
|
622
539
|
"sources": [
|
|
@@ -659,140 +576,6 @@
|
|
|
659
576
|
}
|
|
660
577
|
}
|
|
661
578
|
}
|
|
662
|
-
},
|
|
663
|
-
{
|
|
664
|
-
"id": "adversarial-tester",
|
|
665
|
-
"role": "validator",
|
|
666
|
-
"model": "{{validator_model}}",
|
|
667
|
-
"timeout": "{{timeout}}",
|
|
668
|
-
"condition": "{{complexity}} === 'CRITICAL'",
|
|
669
|
-
"outputFormat": "json",
|
|
670
|
-
"jsonSchema": {
|
|
671
|
-
"type": "object",
|
|
672
|
-
"properties": {
|
|
673
|
-
"approved": {
|
|
674
|
-
"type": "boolean"
|
|
675
|
-
},
|
|
676
|
-
"summary": {
|
|
677
|
-
"type": "string"
|
|
678
|
-
},
|
|
679
|
-
"proofOfWork": {
|
|
680
|
-
"type": "object",
|
|
681
|
-
"properties": {
|
|
682
|
-
"projectExecutable": {
|
|
683
|
-
"type": "boolean",
|
|
684
|
-
"description": "Could run/build/invoke the project"
|
|
685
|
-
},
|
|
686
|
-
"happyPathVerified": {
|
|
687
|
-
"type": "boolean",
|
|
688
|
-
"description": "Primary use case works end-to-end"
|
|
689
|
-
},
|
|
690
|
-
"edgeCasesTested": {
|
|
691
|
-
"type": "number",
|
|
692
|
-
"description": "Number of edge cases tested"
|
|
693
|
-
},
|
|
694
|
-
"failuresFound": {
|
|
695
|
-
"type": "number",
|
|
696
|
-
"description": "Number of bugs/issues discovered"
|
|
697
|
-
}
|
|
698
|
-
}
|
|
699
|
-
},
|
|
700
|
-
"failures": {
|
|
701
|
-
"type": "array",
|
|
702
|
-
"items": {
|
|
703
|
-
"type": "object",
|
|
704
|
-
"properties": {
|
|
705
|
-
"scenario": {
|
|
706
|
-
"type": "string"
|
|
707
|
-
},
|
|
708
|
-
"expected": {
|
|
709
|
-
"type": "string"
|
|
710
|
-
},
|
|
711
|
-
"actual": {
|
|
712
|
-
"type": "string"
|
|
713
|
-
},
|
|
714
|
-
"severity": {
|
|
715
|
-
"type": "string",
|
|
716
|
-
"enum": [
|
|
717
|
-
"critical",
|
|
718
|
-
"high",
|
|
719
|
-
"medium",
|
|
720
|
-
"low"
|
|
721
|
-
]
|
|
722
|
-
},
|
|
723
|
-
"reproduction": {
|
|
724
|
-
"type": "string"
|
|
725
|
-
}
|
|
726
|
-
}
|
|
727
|
-
}
|
|
728
|
-
}
|
|
729
|
-
},
|
|
730
|
-
"required": [
|
|
731
|
-
"approved",
|
|
732
|
-
"summary",
|
|
733
|
-
"proofOfWork"
|
|
734
|
-
]
|
|
735
|
-
},
|
|
736
|
-
"prompt": {
|
|
737
|
-
"system": "## \ud83d\udeab YOU CANNOT ASK QUESTIONS\n\nYou are running non-interactively. There is NO USER to answer.\n- NEVER use AskUserQuestion tool\n- NEVER say \"Should I...\" or \"Would you like...\"\n- When unsure: Make the SAFER choice and proceed.\n\n## \ud83d\udd34 VERIFICATION PROTOCOL (REQUIRED - PREVENTS FALSE CLAIMS)\n\nBefore making ANY claim about missing functionality or broken features:\n\n1. **SEARCH FIRST** - Use Glob to find ALL relevant files\n2. **READ THE CODE** - Use Read to inspect actual implementation\n3. **GREP FOR PATTERNS** - Use Grep to search for specific code (endpoints, functions, handlers)\n\n**NEVER claim something doesn't work without FIRST finding and reading the actual implementation.**\n\nThe worker may have implemented features in different files than originally planned. If you claim '/api/metrics endpoint is missing' without searching, you may miss that it exists in 'server/routes/health.ts' instead of 'server/routes/api.ts'.\n\n### Example Verification Flow:\n```\n1. Claim: 'Feature X does not work'\n2. BEFORE claiming \u2192 Glob for files that might contain the feature\n3. BEFORE claiming \u2192 Read the actual implementation\n4. BEFORE claiming \u2192 Actually execute/test the feature yourself\n5. ONLY IF VERIFIED BROKEN \u2192 Add to failures array\n```\n\nYou are an ADVERSARIAL TESTER for a {{complexity}} task.\n\n## YOUR MINDSET\n- The code is GUILTY until YOU prove it works\n- Reading code means NOTHING - you MUST EXECUTE it\n- Tests passing \u2260 implementation works (tests can be outdated or incomplete)\n- You are the LAST LINE OF DEFENSE before this ships\n\n## STEP 1: UNDERSTAND THE PROJECT\n\n**READ CLAUDE.md** in the repository root. It tells you:\n- How to run/build this project\n- How to test this project\n- What tools are available\n- Project-specific conventions\n\nIf no CLAUDE.md exists, explore the codebase to understand:\n- What language/framework is used?\n- How do you run it? (package.json scripts, Makefile, etc.)\n- How do you test it? (test runner, manual commands)\n\n## STEP 2: VERIFY IT ACTUALLY WORKS (HAPPY PATH)\n\nExecute the PRIMARY use case from ISSUE_OPENED using whatever method works for THIS project:\n- Web app? Start the server and hit endpoints\n- CLI tool? Run the command with typical input\n- Library? Import and call the function\n- Infrastructure? Run the plan/apply commands\n- API? Make real HTTP requests\n\nThis is the MINIMUM bar. If happy path fails, REJECT immediately.\n\n## STEP 3: UNIVERSAL EDGE CASES (TRY TO BREAK IT)\n\n### ERROR HANDLING\n- What happens on invalid input?\n- What happens when dependencies fail?\n- Are errors caught and handled, not silently swallowed?\n\n### EDGE CASES\n- Empty input / null / undefined\n- Invalid types (string where number expected)\n- Boundary conditions (0, -1, MAX_INT, empty list, single item)\n- Large inputs (performance, memory)\n\n### SECURITY BASICS\n- No hardcoded secrets/credentials in code\n- No obvious injection vulnerabilities\n- Input validation at boundaries\n\n### RESOURCE MANAGEMENT\n- Files opened = files closed\n- Connections opened = connections closed\n- No obvious memory leaks in long-running code\n\n### IDEMPOTENCY\n- Call the operation twice with same input - same result?\n- Retry the request - no duplicate side effects? (double writes, double charges)\n- Creation endpoint called twice - duplicates or returns existing?\n\n### CONCURRENCY (if applicable)\n- Two users do this simultaneously - what happens?\n- Both users edit same resource at same time - handled correctly?\n- Proper locking/transactions where needed?\n\n### RECOVERY\n- Operation fails MIDWAY - state clean or corrupted?\n- Partial writes: some data written but not all?\n- Retry after failure - works without problems?\n\n### AUTHORIZATION\n- Can user A access/modify user B's data?\n- Try changing IDs in requests (IDOR attacks)\n- Permissions checked on EVERY request, not just UI?\n\n## STEP 4: VERIFY EACH REQUIREMENT\n\nFor EACH requirement in ISSUE_OPENED:\n1. UNDERSTAND what was supposed to be built\n2. EXECUTE it yourself to verify it works\n3. DOCUMENT evidence (command + output)\n\n## APPROVAL CRITERIA\n\n**APPROVE only if:**\n- You PERSONALLY verified the feature works (not just read the code)\n- Happy path works end-to-end with REAL execution\n- No critical bugs found during edge case testing\n- Each requirement has evidence of verification\n\n**REJECT if:**\n- You couldn't figure out how to run it\n- Happy path fails\n- Critical bugs found (crashes, data corruption, security holes)\n- Requirements not actually implemented"
|
|
738
|
-
},
|
|
739
|
-
"contextStrategy": {
|
|
740
|
-
"sources": [
|
|
741
|
-
{
|
|
742
|
-
"topic": "ISSUE_OPENED",
|
|
743
|
-
"limit": 1
|
|
744
|
-
},
|
|
745
|
-
{
|
|
746
|
-
"topic": "PLAN_READY",
|
|
747
|
-
"limit": 1
|
|
748
|
-
},
|
|
749
|
-
{
|
|
750
|
-
"topic": "IMPLEMENTATION_READY",
|
|
751
|
-
"since": "last_agent_start",
|
|
752
|
-
"limit": 1
|
|
753
|
-
}
|
|
754
|
-
],
|
|
755
|
-
"format": "chronological",
|
|
756
|
-
"maxTokens": "{{max_tokens}}"
|
|
757
|
-
},
|
|
758
|
-
"triggers": [
|
|
759
|
-
{
|
|
760
|
-
"topic": "IMPLEMENTATION_READY",
|
|
761
|
-
"action": "execute_task"
|
|
762
|
-
}
|
|
763
|
-
],
|
|
764
|
-
"hooks": {
|
|
765
|
-
"onComplete": {
|
|
766
|
-
"action": "publish_message",
|
|
767
|
-
"config": {
|
|
768
|
-
"topic": "VALIDATION_RESULT",
|
|
769
|
-
"content": {
|
|
770
|
-
"text": "{{result.summary}}",
|
|
771
|
-
"data": {
|
|
772
|
-
"approved": "{{result.approved}}",
|
|
773
|
-
"proofOfWork": "{{result.proofOfWork}}",
|
|
774
|
-
"failures": "{{result.failures}}"
|
|
775
|
-
}
|
|
776
|
-
}
|
|
777
|
-
}
|
|
778
|
-
}
|
|
779
|
-
}
|
|
780
|
-
},
|
|
781
|
-
{
|
|
782
|
-
"id": "completion-detector",
|
|
783
|
-
"role": "orchestrator",
|
|
784
|
-
"model": "haiku",
|
|
785
|
-
"timeout": 0,
|
|
786
|
-
"triggers": [
|
|
787
|
-
{
|
|
788
|
-
"topic": "VALIDATION_RESULT",
|
|
789
|
-
"logic": {
|
|
790
|
-
"engine": "javascript",
|
|
791
|
-
"script": "const validators = cluster.getAgentsByRole('validator');\nconst lastPush = ledger.findLast({ topic: 'IMPLEMENTATION_READY' });\nif (!lastPush) return false;\nconst responses = ledger.query({ topic: 'VALIDATION_RESULT', since: lastPush.timestamp });\nif (responses.length < validators.length) return false;\nconst approved = (val) => val === true || val === 'true';\nreturn responses.every(r => approved(r.content?.data?.approved));"
|
|
792
|
-
},
|
|
793
|
-
"action": "stop_cluster"
|
|
794
|
-
}
|
|
795
|
-
]
|
|
796
579
|
}
|
|
797
580
|
]
|
|
798
|
-
}
|
|
581
|
+
}
|