@covibes/zeroshot 5.4.0 → 5.4.1

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.
Files changed (136) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +8 -465
  3. package/cli/index.js +101 -5231
  4. package/package.json +16 -130
  5. package/CHANGELOG.md +0 -537
  6. package/cli/commands/providers.js +0 -149
  7. package/cli/lib/first-run.js +0 -211
  8. package/cli/lib/update-checker.js +0 -281
  9. package/cli/message-formatter-utils.js +0 -75
  10. package/cli/message-formatters-normal.js +0 -275
  11. package/cli/message-formatters-watch.js +0 -181
  12. package/cluster-templates/base-templates/debug-workflow.json +0 -375
  13. package/cluster-templates/base-templates/full-workflow.json +0 -581
  14. package/cluster-templates/base-templates/single-worker.json +0 -63
  15. package/cluster-templates/base-templates/worker-validator.json +0 -208
  16. package/cluster-templates/conductor-bootstrap.json +0 -124
  17. package/docker/zeroshot-cluster/Dockerfile +0 -152
  18. package/docker/zeroshot-cluster/pre-baked-deps.json +0 -28
  19. package/lib/completion.js +0 -174
  20. package/lib/docker-config.js +0 -220
  21. package/lib/git-remote-utils.js +0 -165
  22. package/lib/id-detector.js +0 -56
  23. package/lib/provider-defaults.js +0 -62
  24. package/lib/provider-detection.js +0 -59
  25. package/lib/provider-names.js +0 -57
  26. package/lib/settings/claude-auth.js +0 -78
  27. package/lib/settings.js +0 -503
  28. package/lib/stream-json-parser.js +0 -10
  29. package/scripts/fix-node-pty-permissions.js +0 -75
  30. package/scripts/record-demo.sh +0 -279
  31. package/scripts/setup-merge-queue.sh +0 -170
  32. package/scripts/test-install.sh +0 -40
  33. package/scripts/validate-templates.js +0 -100
  34. package/src/agent/agent-config.js +0 -246
  35. package/src/agent/agent-context-builder.js +0 -444
  36. package/src/agent/agent-hook-executor.js +0 -599
  37. package/src/agent/agent-lifecycle.js +0 -743
  38. package/src/agent/agent-stuck-detector.js +0 -256
  39. package/src/agent/agent-task-executor.js +0 -1690
  40. package/src/agent/agent-trigger-evaluator.js +0 -67
  41. package/src/agent/output-extraction.js +0 -217
  42. package/src/agent/output-reformatter.js +0 -175
  43. package/src/agent/schema-utils.js +0 -146
  44. package/src/agent-wrapper.js +0 -579
  45. package/src/agents/git-pusher-template.js +0 -285
  46. package/src/attach/attach-client.js +0 -438
  47. package/src/attach/attach-server.js +0 -543
  48. package/src/attach/index.js +0 -35
  49. package/src/attach/protocol.js +0 -220
  50. package/src/attach/ring-buffer.js +0 -121
  51. package/src/attach/socket-discovery.js +0 -267
  52. package/src/claude-task-runner.js +0 -574
  53. package/src/config-router.js +0 -80
  54. package/src/config-validator.js +0 -1925
  55. package/src/copy-worker.js +0 -43
  56. package/src/input-helpers.js +0 -65
  57. package/src/isolation-manager.js +0 -1471
  58. package/src/issue-providers/README.md +0 -305
  59. package/src/issue-providers/azure-devops-provider.js +0 -273
  60. package/src/issue-providers/base-provider.js +0 -232
  61. package/src/issue-providers/github-provider.js +0 -179
  62. package/src/issue-providers/gitlab-provider.js +0 -241
  63. package/src/issue-providers/index.js +0 -196
  64. package/src/issue-providers/jira-provider.js +0 -239
  65. package/src/ledger.js +0 -631
  66. package/src/lib/safe-exec.js +0 -88
  67. package/src/logic-engine.js +0 -223
  68. package/src/message-bus-bridge.js +0 -139
  69. package/src/message-bus.js +0 -249
  70. package/src/name-generator.js +0 -232
  71. package/src/orchestrator.js +0 -2815
  72. package/src/preflight.js +0 -639
  73. package/src/process-metrics.js +0 -608
  74. package/src/providers/anthropic/cli-builder.js +0 -73
  75. package/src/providers/anthropic/index.js +0 -204
  76. package/src/providers/anthropic/models.js +0 -23
  77. package/src/providers/anthropic/output-parser.js +0 -177
  78. package/src/providers/base-provider.js +0 -251
  79. package/src/providers/capabilities.js +0 -60
  80. package/src/providers/google/cli-builder.js +0 -55
  81. package/src/providers/google/index.js +0 -116
  82. package/src/providers/google/models.js +0 -24
  83. package/src/providers/google/output-parser.js +0 -101
  84. package/src/providers/index.js +0 -91
  85. package/src/providers/openai/cli-builder.js +0 -133
  86. package/src/providers/openai/index.js +0 -136
  87. package/src/providers/openai/models.js +0 -21
  88. package/src/providers/openai/output-parser.js +0 -143
  89. package/src/providers/opencode/cli-builder.js +0 -42
  90. package/src/providers/opencode/index.js +0 -103
  91. package/src/providers/opencode/models.js +0 -55
  92. package/src/providers/opencode/output-parser.js +0 -122
  93. package/src/schemas/sub-cluster.js +0 -185
  94. package/src/status-footer.js +0 -1026
  95. package/src/sub-cluster-wrapper.js +0 -601
  96. package/src/task-runner.js +0 -30
  97. package/src/template-resolver.js +0 -372
  98. package/src/tui/CHANGES.txt +0 -133
  99. package/src/tui/LAYOUT.md +0 -261
  100. package/src/tui/README.txt +0 -192
  101. package/src/tui/TWO-LEVEL-NAVIGATION.md +0 -186
  102. package/src/tui/data-poller.js +0 -349
  103. package/src/tui/demo.js +0 -208
  104. package/src/tui/formatters.js +0 -129
  105. package/src/tui/index.js +0 -193
  106. package/src/tui/keybindings.js +0 -324
  107. package/src/tui/layout.js +0 -334
  108. package/src/tui/renderer.js +0 -184
  109. package/task-lib/attachable-watcher.js +0 -309
  110. package/task-lib/claude-recovery.js +0 -156
  111. package/task-lib/commands/clean.js +0 -50
  112. package/task-lib/commands/episodes.js +0 -105
  113. package/task-lib/commands/get-log-path.js +0 -23
  114. package/task-lib/commands/kill.js +0 -32
  115. package/task-lib/commands/list.js +0 -105
  116. package/task-lib/commands/logs.js +0 -453
  117. package/task-lib/commands/resume.js +0 -42
  118. package/task-lib/commands/run.js +0 -57
  119. package/task-lib/commands/schedule.js +0 -105
  120. package/task-lib/commands/scheduler-cmd.js +0 -96
  121. package/task-lib/commands/schedules.js +0 -148
  122. package/task-lib/commands/status.js +0 -44
  123. package/task-lib/commands/unschedule.js +0 -16
  124. package/task-lib/completion.js +0 -9
  125. package/task-lib/config.js +0 -8
  126. package/task-lib/name-generator.js +0 -230
  127. package/task-lib/package.json +0 -3
  128. package/task-lib/runner.js +0 -201
  129. package/task-lib/scheduler.js +0 -252
  130. package/task-lib/store.js +0 -529
  131. package/task-lib/tui/formatters.js +0 -215
  132. package/task-lib/tui/index.js +0 -197
  133. package/task-lib/tui/layout.js +0 -111
  134. package/task-lib/tui/renderer.js +0 -129
  135. package/task-lib/tui.js +0 -425
  136. package/task-lib/watcher.js +0 -226
@@ -1,581 +0,0 @@
1
- {
2
- "name": "Full Workflow",
3
- "description": "Planner → Worker → Validators. For STANDARD/CRITICAL tasks.",
4
- "params": {
5
- "planner_level": {
6
- "type": "string",
7
- "enum": ["level1", "level2", "level3"],
8
- "default": "level2"
9
- },
10
- "worker_level": {
11
- "type": "string",
12
- "enum": ["level1", "level2", "level3"],
13
- "default": "level2"
14
- },
15
- "validator_level": {
16
- "type": "string",
17
- "enum": ["level1", "level2", "level3"],
18
- "default": "level2"
19
- },
20
- "validator_count": {
21
- "type": "number",
22
- "default": 2,
23
- "description": "Number of validators (1-4)"
24
- },
25
- "max_iterations": {
26
- "type": "number",
27
- "default": 5
28
- },
29
- "max_tokens": {
30
- "type": "number",
31
- "default": 100000
32
- },
33
- "timeout": {
34
- "type": "number",
35
- "default": 0,
36
- "description": "Task timeout in milliseconds (0 = no timeout)"
37
- },
38
- "task_type": {
39
- "type": "string",
40
- "enum": ["INQUIRY", "TASK", "DEBUG"],
41
- "description": "Type of work"
42
- },
43
- "complexity": {
44
- "type": "string",
45
- "enum": ["STANDARD", "CRITICAL"],
46
- "default": "STANDARD"
47
- }
48
- },
49
- "agents": [
50
- {
51
- "id": "planner",
52
- "role": "planning",
53
- "modelLevel": "{{planner_level}}",
54
- "timeout": "{{timeout}}",
55
- "outputFormat": "json",
56
- "jsonSchema": {
57
- "type": "object",
58
- "properties": {
59
- "plan": {
60
- "type": "string",
61
- "description": "THE SINGULAR STAFF-LEVEL IMPLEMENTATION PLAN. ONE approach only. NO alternatives. NO 'Option 1 vs Option 2'. The plan a FAANG principal engineer would create. Clean, decisive, no hedging."
62
- },
63
- "summary": {
64
- "type": "string",
65
- "description": "One-line summary"
66
- },
67
- "filesAffected": {
68
- "type": "array",
69
- "items": {
70
- "type": "string"
71
- }
72
- },
73
- "risks": {
74
- "type": "array",
75
- "items": {
76
- "type": "string"
77
- }
78
- },
79
- "acceptanceCriteria": {
80
- "type": "array",
81
- "description": "EXPLICIT, TESTABLE acceptance criteria. Each must be verifiable. NO VAGUE BULLSHIT.",
82
- "items": {
83
- "type": "object",
84
- "properties": {
85
- "id": {
86
- "type": "string",
87
- "description": "AC1, AC2, etc."
88
- },
89
- "criterion": {
90
- "type": "string",
91
- "description": "MUST be testable - if you can't verify it, rewrite it"
92
- },
93
- "verification": {
94
- "type": "string",
95
- "description": "EXACT steps to verify (command, URL, test name)"
96
- },
97
- "priority": {
98
- "type": "string",
99
- "enum": ["MUST", "SHOULD", "NICE"],
100
- "description": "MUST = blocks completion"
101
- }
102
- },
103
- "required": ["id", "criterion", "verification", "priority"]
104
- },
105
- "minItems": 3
106
- }
107
- },
108
- "required": ["plan", "summary", "filesAffected", "acceptanceCriteria"]
109
- },
110
- "prompt": {
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."
112
- },
113
- "contextStrategy": {
114
- "sources": [
115
- {
116
- "topic": "ISSUE_OPENED",
117
- "limit": 1
118
- }
119
- ],
120
- "format": "chronological",
121
- "maxTokens": "{{max_tokens}}"
122
- },
123
- "triggers": [
124
- {
125
- "topic": "ISSUE_OPENED",
126
- "action": "execute_task"
127
- }
128
- ],
129
- "hooks": {
130
- "onComplete": {
131
- "action": "publish_message",
132
- "config": {
133
- "topic": "PLAN_READY",
134
- "content": {
135
- "text": "{{result.plan}}",
136
- "data": {
137
- "summary": "{{result.summary}}",
138
- "filesAffected": "{{result.filesAffected}}",
139
- "risks": "{{result.risks}}",
140
- "acceptanceCriteria": "{{result.acceptanceCriteria}}"
141
- }
142
- }
143
- }
144
- }
145
- }
146
- },
147
- {
148
- "id": "worker",
149
- "role": "implementation",
150
- "modelLevel": "{{worker_level}}",
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
- },
188
- "prompt": {
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}}"
191
- },
192
- "contextStrategy": {
193
- "sources": [
194
- {
195
- "topic": "ISSUE_OPENED",
196
- "limit": 1
197
- },
198
- {
199
- "topic": "PLAN_READY",
200
- "limit": 1
201
- },
202
- {
203
- "topic": "WORKER_PROGRESS",
204
- "since": "last_task_end",
205
- "limit": 3
206
- },
207
- {
208
- "topic": "VALIDATION_RESULT",
209
- "since": "last_task_end",
210
- "limit": 10
211
- }
212
- ],
213
- "format": "chronological",
214
- "maxTokens": "{{max_tokens}}"
215
- },
216
- "triggers": [
217
- {
218
- "topic": "PLAN_READY",
219
- "action": "execute_task"
220
- },
221
- {
222
- "topic": "WORKER_PROGRESS",
223
- "logic": {
224
- "engine": "javascript",
225
- "script": "return message.sender === 'worker';"
226
- },
227
- "action": "execute_task"
228
- },
229
- {
230
- "topic": "VALIDATION_RESULT",
231
- "logic": {
232
- "engine": "javascript",
233
- "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;\nreturn responses.some(r => r.content?.data?.approved === false || r.content?.data?.approved === 'false');"
234
- },
235
- "action": "execute_task"
236
- }
237
- ],
238
- "hooks": {
239
- "onComplete": {
240
- "action": "publish_message",
241
- "config": {
242
- "topic": "IMPLEMENTATION_READY",
243
- "content": {
244
- "text": "{{result.summary}}",
245
- "data": {
246
- "completionStatus": "{{result.completionStatus}}"
247
- }
248
- }
249
- },
250
- "logic": {
251
- "engine": "javascript",
252
- "script": "if (!result.completionStatus?.canValidate) return { topic: 'WORKER_PROGRESS' };"
253
- }
254
- }
255
- },
256
- "maxIterations": "{{max_iterations}}"
257
- },
258
- {
259
- "id": "validator-requirements",
260
- "role": "validator",
261
- "modelLevel": "{{validator_level}}",
262
- "timeout": "{{timeout}}",
263
- "maxRetries": 3,
264
- "outputFormat": "json",
265
- "jsonSchema": {
266
- "type": "object",
267
- "properties": {
268
- "approved": {
269
- "type": "boolean"
270
- },
271
- "summary": {
272
- "type": "string"
273
- },
274
- "errors": {
275
- "type": "array",
276
- "items": {
277
- "type": "string"
278
- }
279
- },
280
- "criteriaResults": {
281
- "type": "array",
282
- "description": "Status for each acceptance criterion. PASS/FAIL require evidence. CANNOT_VALIDATE requires reason.",
283
- "items": {
284
- "type": "object",
285
- "properties": {
286
- "id": {
287
- "type": "string",
288
- "description": "AC1, AC2, etc. from plan"
289
- },
290
- "status": {
291
- "type": "string",
292
- "enum": ["PASS", "FAIL", "SKIPPED", "CANNOT_VALIDATE"],
293
- "description": "CANNOT_VALIDATE = verification impossible (missing tools, permissions, etc). Treated as PASS with warning."
294
- },
295
- "evidence": {
296
- "type": "object",
297
- "description": "REQUIRED for PASS/FAIL. Proof of verification - actual command output.",
298
- "properties": {
299
- "command": {
300
- "type": "string"
301
- },
302
- "exitCode": {
303
- "type": "integer"
304
- },
305
- "output": {
306
- "type": "string"
307
- }
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')."
313
- }
314
- },
315
- "required": ["id", "status"]
316
- }
317
- }
318
- },
319
- "required": ["approved", "summary", "criteriaResults"]
320
- },
321
- "prompt": {
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."
323
- },
324
- "contextStrategy": {
325
- "sources": [
326
- {
327
- "topic": "ISSUE_OPENED",
328
- "limit": 1
329
- },
330
- {
331
- "topic": "PLAN_READY",
332
- "limit": 1
333
- },
334
- {
335
- "topic": "IMPLEMENTATION_READY",
336
- "since": "last_agent_start",
337
- "limit": 1
338
- }
339
- ],
340
- "format": "chronological",
341
- "maxTokens": "{{max_tokens}}"
342
- },
343
- "triggers": [
344
- {
345
- "topic": "IMPLEMENTATION_READY",
346
- "action": "execute_task"
347
- }
348
- ],
349
- "hooks": {
350
- "onComplete": {
351
- "action": "publish_message",
352
- "config": {
353
- "topic": "VALIDATION_RESULT",
354
- "content": {
355
- "text": "{{result.summary}}",
356
- "data": {
357
- "approved": "{{result.approved}}",
358
- "errors": "{{result.errors}}",
359
- "criteriaResults": "{{result.criteriaResults}}"
360
- }
361
- }
362
- }
363
- }
364
- }
365
- },
366
- {
367
- "id": "validator-code",
368
- "role": "validator",
369
- "modelLevel": "{{validator_level}}",
370
- "timeout": "{{timeout}}",
371
- "maxRetries": 3,
372
- "condition": "{{validator_count}} >= 2",
373
- "outputFormat": "json",
374
- "jsonSchema": {
375
- "type": "object",
376
- "properties": {
377
- "approved": {
378
- "type": "boolean"
379
- },
380
- "summary": {
381
- "type": "string"
382
- },
383
- "errors": {
384
- "type": "array",
385
- "items": {
386
- "type": "string"
387
- }
388
- }
389
- },
390
- "required": ["approved", "summary"]
391
- },
392
- "prompt": {
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."
394
- },
395
- "contextStrategy": {
396
- "sources": [
397
- {
398
- "topic": "ISSUE_OPENED",
399
- "limit": 1
400
- },
401
- {
402
- "topic": "PLAN_READY",
403
- "limit": 1
404
- },
405
- {
406
- "topic": "IMPLEMENTATION_READY",
407
- "since": "last_agent_start",
408
- "limit": 1
409
- }
410
- ],
411
- "format": "chronological",
412
- "maxTokens": "{{max_tokens}}"
413
- },
414
- "triggers": [
415
- {
416
- "topic": "IMPLEMENTATION_READY",
417
- "action": "execute_task"
418
- }
419
- ],
420
- "hooks": {
421
- "onComplete": {
422
- "action": "publish_message",
423
- "config": {
424
- "topic": "VALIDATION_RESULT",
425
- "content": {
426
- "text": "{{result.summary}}",
427
- "data": {
428
- "approved": "{{result.approved}}",
429
- "errors": "{{result.errors}}"
430
- }
431
- }
432
- }
433
- }
434
- }
435
- },
436
- {
437
- "id": "validator-security",
438
- "role": "validator",
439
- "modelLevel": "{{validator_level}}",
440
- "timeout": "{{timeout}}",
441
- "maxRetries": 3,
442
- "condition": "{{validator_count}} >= 3",
443
- "outputFormat": "json",
444
- "jsonSchema": {
445
- "type": "object",
446
- "properties": {
447
- "approved": {
448
- "type": "boolean"
449
- },
450
- "summary": {
451
- "type": "string"
452
- },
453
- "errors": {
454
- "type": "array",
455
- "items": {
456
- "type": "string"
457
- }
458
- }
459
- },
460
- "required": ["approved", "summary"]
461
- },
462
- "prompt": {
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"
464
- },
465
- "contextStrategy": {
466
- "sources": [
467
- {
468
- "topic": "ISSUE_OPENED",
469
- "limit": 1
470
- },
471
- {
472
- "topic": "PLAN_READY",
473
- "limit": 1
474
- },
475
- {
476
- "topic": "IMPLEMENTATION_READY",
477
- "since": "last_agent_start",
478
- "limit": 1
479
- }
480
- ],
481
- "format": "chronological",
482
- "maxTokens": "{{max_tokens}}"
483
- },
484
- "triggers": [
485
- {
486
- "topic": "IMPLEMENTATION_READY",
487
- "action": "execute_task"
488
- }
489
- ],
490
- "hooks": {
491
- "onComplete": {
492
- "action": "publish_message",
493
- "config": {
494
- "topic": "VALIDATION_RESULT",
495
- "content": {
496
- "text": "{{result.summary}}",
497
- "data": {
498
- "approved": "{{result.approved}}",
499
- "errors": "{{result.errors}}"
500
- }
501
- }
502
- }
503
- }
504
- }
505
- },
506
- {
507
- "id": "validator-tester",
508
- "role": "validator",
509
- "modelLevel": "{{validator_level}}",
510
- "timeout": "{{timeout}}",
511
- "maxRetries": 3,
512
- "condition": "{{validator_count}} >= 4",
513
- "outputFormat": "json",
514
- "jsonSchema": {
515
- "type": "object",
516
- "properties": {
517
- "approved": {
518
- "type": "boolean"
519
- },
520
- "summary": {
521
- "type": "string"
522
- },
523
- "errors": {
524
- "type": "array",
525
- "items": {
526
- "type": "string"
527
- }
528
- },
529
- "testResults": {
530
- "type": "string"
531
- }
532
- },
533
- "required": ["approved", "summary"]
534
- },
535
- "prompt": {
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"
537
- },
538
- "contextStrategy": {
539
- "sources": [
540
- {
541
- "topic": "ISSUE_OPENED",
542
- "limit": 1
543
- },
544
- {
545
- "topic": "PLAN_READY",
546
- "limit": 1
547
- },
548
- {
549
- "topic": "IMPLEMENTATION_READY",
550
- "since": "last_agent_start",
551
- "limit": 1
552
- }
553
- ],
554
- "format": "chronological",
555
- "maxTokens": "{{max_tokens}}"
556
- },
557
- "triggers": [
558
- {
559
- "topic": "IMPLEMENTATION_READY",
560
- "action": "execute_task"
561
- }
562
- ],
563
- "hooks": {
564
- "onComplete": {
565
- "action": "publish_message",
566
- "config": {
567
- "topic": "VALIDATION_RESULT",
568
- "content": {
569
- "text": "{{result.summary}}",
570
- "data": {
571
- "approved": "{{result.approved}}",
572
- "errors": "{{result.errors}}",
573
- "testResults": "{{result.testResults}}"
574
- }
575
- }
576
- }
577
- }
578
- }
579
- }
580
- ]
581
- }
@@ -1,63 +0,0 @@
1
- {
2
- "name": "Single Worker",
3
- "description": "One agent executes and completes. For TRIVIAL tasks and simple INQUIRY.",
4
- "params": {
5
- "worker_level": {
6
- "type": "string",
7
- "enum": ["level1", "level2", "level3"],
8
- "default": "level1"
9
- },
10
- "max_tokens": {
11
- "type": "number",
12
- "default": 50000
13
- },
14
- "timeout": {
15
- "type": "number",
16
- "default": 0,
17
- "description": "Task timeout in milliseconds (0 = no timeout)"
18
- },
19
- "task_type": {
20
- "type": "string",
21
- "enum": ["INQUIRY", "TASK", "DEBUG"],
22
- "description": "Type of work"
23
- }
24
- },
25
- "agents": [
26
- {
27
- "id": "worker",
28
- "role": "implementation",
29
- "modelLevel": "{{worker_level}}",
30
- "timeout": "{{timeout}}",
31
- "prompt": {
32
- "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 an agent handling a {{task_type}} task.\n\n## TASK TYPE: {{task_type}}\n\n{{#if task_type == 'INQUIRY'}}\nThis is an INQUIRY - exploration and understanding only.\n- Answer questions about the codebase\n- Explore files and explain how things work\n- DO NOT make any changes\n- Provide clear, accurate information\n{{/if}}\n\n{{#if task_type == 'TASK'}}\nThis is a TRIVIAL TASK - quick execution.\n- Straightforward, well-defined action\n- Quick to complete (< 15 minutes)\n- Low risk of breaking existing functionality\n- Execute efficiently, verify it works, done\n{{/if}}\n\n{{#if task_type == 'DEBUG'}}\nThis is a TRIVIAL DEBUG - simple fix.\n- Obvious issue with clear solution\n- Fix the root cause, not symptoms\n- Verify the fix works\n{{/if}}"
33
- },
34
- "contextStrategy": {
35
- "sources": [
36
- {
37
- "topic": "ISSUE_OPENED",
38
- "limit": 1
39
- }
40
- ],
41
- "format": "chronological",
42
- "maxTokens": "{{max_tokens}}"
43
- },
44
- "triggers": [
45
- {
46
- "topic": "ISSUE_OPENED",
47
- "action": "execute_task"
48
- }
49
- ],
50
- "hooks": {
51
- "onComplete": {
52
- "action": "publish_message",
53
- "config": {
54
- "topic": "CLUSTER_COMPLETE",
55
- "content": {
56
- "text": "Task completed."
57
- }
58
- }
59
- }
60
- }
61
- }
62
- ]
63
- }