@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,208 +0,0 @@
1
- {
2
- "name": "Worker + Validator",
3
- "description": "Worker implements, validator checks, rejection loop. For SIMPLE tasks.",
4
- "params": {
5
- "worker_level": {
6
- "type": "string",
7
- "enum": ["level1", "level2", "level3"],
8
- "default": "level2"
9
- },
10
- "validator_level": {
11
- "type": "string",
12
- "enum": ["level1", "level2", "level3"],
13
- "default": "level2"
14
- },
15
- "max_iterations": {
16
- "type": "number",
17
- "default": 3
18
- },
19
- "max_tokens": {
20
- "type": "number",
21
- "default": 100000
22
- },
23
- "timeout": {
24
- "type": "number",
25
- "default": 0,
26
- "description": "Task timeout in milliseconds (0 = no timeout)"
27
- },
28
- "task_type": {
29
- "type": "string",
30
- "enum": ["INQUIRY", "TASK", "DEBUG"],
31
- "description": "Type of work"
32
- }
33
- },
34
- "agents": [
35
- {
36
- "id": "worker",
37
- "role": "implementation",
38
- "modelLevel": "{{worker_level}}",
39
- "timeout": "{{timeout}}",
40
- "outputFormat": "json",
41
- "jsonSchema": {
42
- "type": "object",
43
- "properties": {
44
- "summary": {
45
- "type": "string",
46
- "description": "Brief description of work done this iteration"
47
- },
48
- "completionStatus": {
49
- "type": "object",
50
- "description": "Self-assessment of completion state",
51
- "properties": {
52
- "canValidate": {
53
- "type": "boolean",
54
- "description": "true if work is ready for validator review, false if more work needed"
55
- },
56
- "percentComplete": {
57
- "type": "number",
58
- "description": "Estimated completion percentage (0-100)"
59
- },
60
- "blockers": {
61
- "type": "array",
62
- "items": { "type": "string" },
63
- "description": "Issues preventing completion (empty if canValidate=true)"
64
- },
65
- "nextSteps": {
66
- "type": "array",
67
- "items": { "type": "string" },
68
- "description": "Remaining work items (empty if canValidate=true)"
69
- }
70
- },
71
- "required": ["canValidate", "percentComplete"]
72
- }
73
- },
74
- "required": ["summary", "completionStatus"]
75
- },
76
- "prompt": {
77
- "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 implementation agent for a SIMPLE {{task_type}} task.\n\n## FIRST ITERATION\n\n{{#if task_type == 'TASK'}}\nImplement the requested feature/change:\n- Well-defined scope (one feature, one fix)\n- Standard patterns apply\n- Complete the implementation fully\n{{/if}}\n\n{{#if task_type == 'DEBUG'}}\nInvestigate and fix the issue:\n- Reproduce the problem\n- Find the root cause (not just symptoms)\n- Apply the fix\n- Verify it works\n{{/if}}\n\n{{#if task_type == 'INQUIRY'}}\nResearch and provide detailed answers:\n- Explore relevant code and documentation\n- Explain how things work\n- Provide accurate, complete information\n{{/if}}\n\n## SUBSEQUENT ITERATIONS (after rejection)\n\nYou are being called back because validators REJECTED your implementation. This is NOT a minor issue.\n\n### FIX LIKE A SENIOR ENGINEER\n\n1. **STOP AND UNDERSTAND FIRST**\n - Read ALL VALIDATION_RESULT messages completely\n - Understand WHY each issue exists, not just WHAT it is\n - Trace the root cause - don't patch symptoms\n\n2. **FIX PROPERLY - NO SHORTCUTS**\n - Fix the ACTUAL problem, not the error message\n - If your approach was wrong, redesign it - don't add band-aids\n - Consider architectural implications of your fix\n - A senior dev would be embarrassed to submit a half-fix\n\n3. **VERIFY YOUR FIX**\n - Test your changes actually work\n - Check you didn't break anything else\n - If unsure, investigate before committing\n\n### MINDSET\n- Validators are senior engineers reviewing your code\n- They found REAL problems - take them seriously\n- Shortcuts will be caught and rejected again\n\n## 🔴 COMPLETION SELF-ASSESSMENT (REQUIRED)\n\nYour output MUST include a `completionStatus` object with honest self-assessment:\n\n**Set canValidate: true** when:\n- All work for this iteration is complete\n- Code compiles/runs without errors\n- You would be confident submitting for review\n\n**Set canValidate: false** when:\n- Work is partially complete\n- Blocked by an issue you're working around\n- Code doesn't compile or has obvious bugs\n\nValidators cost money. If you're not done, say so - your WORKER_PROGRESS message will let you continue."
78
- },
79
- "contextStrategy": {
80
- "sources": [
81
- {
82
- "topic": "ISSUE_OPENED",
83
- "limit": 1
84
- },
85
- {
86
- "topic": "WORKER_PROGRESS",
87
- "since": "last_task_end",
88
- "limit": 3
89
- },
90
- {
91
- "topic": "VALIDATION_RESULT",
92
- "since": "last_task_end",
93
- "limit": 3
94
- }
95
- ],
96
- "format": "chronological",
97
- "maxTokens": "{{max_tokens}}"
98
- },
99
- "triggers": [
100
- {
101
- "topic": "ISSUE_OPENED",
102
- "action": "execute_task"
103
- },
104
- {
105
- "topic": "WORKER_PROGRESS",
106
- "logic": {
107
- "engine": "javascript",
108
- "script": "return message.sender === 'worker';"
109
- },
110
- "action": "execute_task"
111
- },
112
- {
113
- "topic": "VALIDATION_RESULT",
114
- "logic": {
115
- "engine": "javascript",
116
- "script": "const lastPush = ledger.findLast({ topic: 'IMPLEMENTATION_READY' });\nif (!lastPush) return false;\nconst response = ledger.findLast({ topic: 'VALIDATION_RESULT', since: lastPush.timestamp });\nreturn response?.content?.data?.approved === false || response?.content?.data?.approved === 'false';"
117
- },
118
- "action": "execute_task"
119
- }
120
- ],
121
- "hooks": {
122
- "onComplete": {
123
- "action": "publish_message",
124
- "config": {
125
- "topic": "IMPLEMENTATION_READY",
126
- "content": {
127
- "text": "{{result.summary}}",
128
- "data": {
129
- "completionStatus": "{{result.completionStatus}}"
130
- }
131
- }
132
- },
133
- "logic": {
134
- "engine": "javascript",
135
- "script": "if (!result.completionStatus?.canValidate) return { topic: 'WORKER_PROGRESS' };"
136
- }
137
- }
138
- },
139
- "maxIterations": "{{max_iterations}}"
140
- },
141
- {
142
- "id": "validator",
143
- "role": "validator",
144
- "modelLevel": "{{validator_level}}",
145
- "timeout": "{{timeout}}",
146
- "outputFormat": "json",
147
- "jsonSchema": {
148
- "type": "object",
149
- "properties": {
150
- "approved": {
151
- "type": "boolean",
152
- "description": "true if implementation is correct"
153
- },
154
- "summary": {
155
- "type": "string",
156
- "description": "One-line validation result"
157
- },
158
- "errors": {
159
- "type": "array",
160
- "items": {
161
- "type": "string"
162
- },
163
- "description": "Issues found (empty if approved)"
164
- }
165
- },
166
- "required": ["approved", "summary", "errors"]
167
- },
168
- "prompt": {
169
- "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\nYou are a validator for a SIMPLE {{task_type}} task.\n\n## 🔴 VERIFICATION PROTOCOL (REQUIRED - PREVENTS FALSE CLAIMS)\n\nBefore making ANY claim about missing functionality or code issues:\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 (function names, endpoints, etc.)\n\n**NEVER claim something doesn't exist without FIRST searching for it.**\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: 'Missing error handling for network failures'\n2. BEFORE claiming → Grep for 'catch', 'error', 'try' in relevant files\n3. BEFORE claiming → Read the actual implementation\n4. ONLY IF NOT FOUND → Add to errors array\n```\n\n## VALIDATION CRITERIA\n\n**APPROVE** if:\n- Core functionality works as requested\n- Implementation is correct and complete\n- No obvious bugs or critical issues\n\n**REJECT** if:\n- Major functionality is missing or broken (VERIFIED by searching)\n- Implementation doesn't match requirements (VERIFIED by reading code)\n- Critical bugs present (VERIFIED by inspection)\n\n## TASK TYPE: {{task_type}}\n\n{{#if task_type == 'TASK'}}\nVerify the feature/change works correctly.\n{{/if}}\n\n{{#if task_type == 'DEBUG'}}\nVerify the bug is actually fixed at root cause.\n{{/if}}\n\n{{#if task_type == 'INQUIRY'}}\nVerify the information is accurate and complete.\n{{/if}}\n\nFor SIMPLE tasks, don't nitpick. Focus on: Does it work and meet requirements?\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"
170
- },
171
- "contextStrategy": {
172
- "sources": [
173
- {
174
- "topic": "ISSUE_OPENED",
175
- "limit": 1
176
- },
177
- {
178
- "topic": "IMPLEMENTATION_READY",
179
- "limit": 1
180
- }
181
- ],
182
- "format": "chronological",
183
- "maxTokens": "{{max_tokens}}"
184
- },
185
- "triggers": [
186
- {
187
- "topic": "IMPLEMENTATION_READY",
188
- "action": "execute_task"
189
- }
190
- ],
191
- "hooks": {
192
- "onComplete": {
193
- "action": "publish_message",
194
- "config": {
195
- "topic": "VALIDATION_RESULT",
196
- "content": {
197
- "text": "{{result.summary}}",
198
- "data": {
199
- "approved": "{{result.approved}}",
200
- "errors": "{{result.errors}}"
201
- }
202
- }
203
- }
204
- }
205
- }
206
- }
207
- ]
208
- }
@@ -1,124 +0,0 @@
1
- {
2
- "name": "Two-Tier Conductor (Complexity × TaskType)",
3
- "description": "Cost-optimized conductor: level1 junior for 2D classification (complexity + taskType), level2 senior for UNCERTAIN tasks. Routes to appropriate cluster config via helpers.getConfig().",
4
- "agents": [
5
- {
6
- "id": "junior-conductor",
7
- "role": "conductor",
8
- "modelLevel": "level1",
9
- "useDirectApi": true,
10
- "outputFormat": "json",
11
- "jsonSchema": {
12
- "type": "object",
13
- "properties": {
14
- "complexity": {
15
- "type": "string",
16
- "enum": ["TRIVIAL", "SIMPLE", "STANDARD", "CRITICAL", "UNCERTAIN"],
17
- "description": "Task complexity level"
18
- },
19
- "taskType": {
20
- "type": "string",
21
- "enum": ["INQUIRY", "TASK", "DEBUG"],
22
- "description": "Type of work: INQUIRY (read-only), TASK (implement / known fix), DEBUG (investigate unknown root cause)"
23
- },
24
- "reasoning": {
25
- "type": "string",
26
- "description": "Why this classification (1-2 sentences)"
27
- }
28
- },
29
- "required": ["complexity", "taskType", "reasoning"]
30
- },
31
- "prompt": {
32
- "system": "You are the JUNIOR CONDUCTOR - fast task classification.\n\n## Your Job\nClassify the task on TWO dimensions.\n\n## 🔴 COST REMINDER\n- CRITICAL uses Opus ($15/M tokens) + 4 validators = EXPENSIVE\n- STANDARD uses Sonnet ($3/M tokens) + 2 validators = NORMAL\n- Don't waste money on false positives. CRITICAL is rare.\n\n## COMPLEXITY (pick ONE)\n- TRIVIAL - One file, mechanical change; no behavior change.\n- SIMPLE - Small change, 1-2 files, low risk.\n- STANDARD - Multi-file work or user-visible behavior. **DEFAULT CHOICE.**\n- CRITICAL - ONLY when code DIRECTLY modifies: (1) authentication/authorization LOGIC, (2) payment processing/billing calculations, (3) secrets/credentials handling, (4) destructive database operations (DROP, DELETE), (5) production deployment or live infrastructure, (6) PII processing (not just displaying it).\n- UNCERTAIN - Escalate to senior conductor.\n\n**🔴 BIAS: If unsure between STANDARD and CRITICAL, choose STANDARD.** CRITICAL is expensive. Reserve it for actual risk.\n\n## NOT CRITICAL (Common False Positives)\n\nThese are STANDARD, not CRITICAL:\n- Refactoring code that MENTIONS auth/billing/security (not MODIFYING the logic)\n- Adding TypeScript types for existing structures\n- Code cleanup in infra-related files\n- Read-only queries to production data\n- Tests for auth/billing code (tests don't touch prod)\n- Extracting modules or services (code organization)\n- Factory patterns, dependency injection (architecture)\n- Config file reorganization (not production config values)\n\n## TASK TYPE (pick ONE)\n- INQUIRY - Questions, exploration, read-only\n- TASK - Implement something new\n- DEBUG - Fix something broken\n\n## Examples\n\nTask: \"Explain current auth flow (read-only)\"\n```json\n{\"complexity\": \"SIMPLE\", \"taskType\": \"INQUIRY\", \"reasoning\": \"Read-only explanation\"}\n```\n\nTask: \"Refactor auth service into smaller modules\"\n```json\n{\"complexity\": \"STANDARD\", \"taskType\": \"TASK\", \"reasoning\": \"Refactoring code organization, not modifying auth logic\"}\n```\n\nTask: \"Add TypeScript types to payment types\"\n```json\n{\"complexity\": \"STANDARD\", \"taskType\": \"TASK\", \"reasoning\": \"Adding types, not modifying billing logic\"}\n```\n\nTask: \"Fix bug in password validation logic\"\n```json\n{\"complexity\": \"CRITICAL\", \"taskType\": \"DEBUG\", \"reasoning\": \"Directly modifying authentication logic\"}\n```\n\nTask: \"Add new payment method integration\"\n```json\n{\"complexity\": \"CRITICAL\", \"taskType\": \"TASK\", \"reasoning\": \"New billing/payment processing code\"}\n```\n\nTask: \"Rotate production API keys\"\n```json\n{\"complexity\": \"CRITICAL\", \"taskType\": \"TASK\", \"reasoning\": \"Modifying production secrets\"}\n```\n\nTask: \"DROP TABLE users migration\"\n```json\n{\"complexity\": \"CRITICAL\", \"taskType\": \"TASK\", \"reasoning\": \"Destructive database operation\"}\n```\n\n## Critical Rules\n1. Output ONLY valid JSON - no other text\n2. complexity must be EXACTLY one of: TRIVIAL, SIMPLE, STANDARD, CRITICAL, UNCERTAIN\n3. taskType must be EXACTLY one of: INQUIRY, TASK, DEBUG\n\nTask: {{ISSUE_OPENED.content.text}}"
33
- },
34
- "contextStrategy": {
35
- "sources": [{ "topic": "ISSUE_OPENED", "limit": 1 }],
36
- "format": "chronological",
37
- "maxTokens": 100000
38
- },
39
- "triggers": [
40
- {
41
- "topic": "ISSUE_OPENED",
42
- "logic": {
43
- "engine": "javascript",
44
- "script": "return message.sender === 'system' && !message.metadata?._republished;"
45
- },
46
- "action": "execute_task"
47
- }
48
- ],
49
- "hooks": {
50
- "onComplete": {
51
- "action": "publish_message",
52
- "transform": {
53
- "engine": "javascript",
54
- "script": "const { complexity, taskType, reasoning } = result;\nconst taskText = triggeringMessage.content?.text || '';\n\nif (complexity === 'UNCERTAIN') {\n return {\n topic: 'CONDUCTOR_ESCALATE',\n content: {\n text: reasoning,\n data: { complexity, taskType, reasoning, taskText }\n }\n };\n}\n\nconst config = helpers.getConfig(complexity, taskType);\n\nreturn {\n topic: 'CLUSTER_OPERATIONS',\n content: {\n text: `[${complexity}:${taskType}] ${reasoning}`,\n data: {\n complexity,\n taskType,\n operations: [\n { action: 'load_config', config },\n { action: 'publish', topic: 'ISSUE_OPENED', content: { text: taskText }, metadata: { _republished: true } }\n ]\n }\n }\n};"
55
- }
56
- }
57
- }
58
- },
59
- {
60
- "id": "senior-conductor",
61
- "role": "conductor",
62
- "modelLevel": "level2",
63
- "useDirectApi": true,
64
- "outputFormat": "json",
65
- "jsonSchema": {
66
- "type": "object",
67
- "properties": {
68
- "complexity": {
69
- "type": "string",
70
- "enum": ["TRIVIAL", "SIMPLE", "STANDARD", "CRITICAL"],
71
- "description": "Task complexity (no UNCERTAIN - must decide)"
72
- },
73
- "taskType": {
74
- "type": "string",
75
- "enum": ["INQUIRY", "TASK", "DEBUG"],
76
- "description": "Type of work after analysis (INQUIRY/TASK/DEBUG)"
77
- },
78
- "reasoning": {
79
- "type": "string",
80
- "description": "Detailed explanation"
81
- }
82
- },
83
- "required": ["complexity", "taskType", "reasoning"]
84
- },
85
- "prompt": {
86
- "system": "You are the SENIOR CONDUCTOR - expert task analyzer.\n\nThe junior conductor was uncertain. Make a definitive classification.\n\n## 🔴 COST REMINDER\n- CRITICAL uses Opus ($15/M tokens) + 4 validators = EXPENSIVE\n- STANDARD uses Sonnet ($3/M tokens) + 2 validators = NORMAL\n- Don't waste money on false positives.\n\n## COMPLEXITY (pick ONE - no UNCERTAIN allowed)\n- TRIVIAL - One file, mechanical change; no behavior change.\n- SIMPLE - Small change, 1-2 files, low risk.\n- STANDARD - Multi-file work or user-visible behavior. **DEFAULT CHOICE.**\n- CRITICAL - ONLY when code DIRECTLY modifies: (1) authentication/authorization LOGIC, (2) payment processing/billing calculations, (3) secrets/credentials handling, (4) destructive database operations (DROP, DELETE), (5) production deployment or live infrastructure, (6) PII processing.\n\n**🔴 BIAS: If unsure between STANDARD and CRITICAL, choose STANDARD.** CRITICAL is expensive.\n\n## NOT CRITICAL (Common False Positives)\n- Refactoring code that MENTIONS auth/billing/security (not MODIFYING the logic)\n- Adding TypeScript types, tests, code organization\n- Read-only queries, config reorganization\n- Factory patterns, dependency injection\n\n## TASK TYPE (pick ONE)\n- INQUIRY - Questions, exploration (read-only)\n- TASK - Implement something new\n- DEBUG - Fix something broken\n\n## Examples\n\nTask: \"Refactor auth service into smaller modules\"\n```json\n{\"complexity\": \"STANDARD\", \"taskType\": \"TASK\", \"reasoning\": \"Code refactor, not modifying auth logic\"}\n```\n\nTask: \"Fix bug in password validation\"\n```json\n{\"complexity\": \"CRITICAL\", \"taskType\": \"DEBUG\", \"reasoning\": \"Directly modifying auth logic\"}\n```\n\nTask: \"Add payment method\"\n```json\n{\"complexity\": \"CRITICAL\", \"taskType\": \"TASK\", \"reasoning\": \"New billing code\"}\n```\n\n## Rules\n1. Output ONLY valid JSON - no other text\n2. YOU MUST DECIDE - pick exactly one value for each field\n3. When unsure between STANDARD and CRITICAL → STANDARD\n\nJunior was uncertain. Original task follows."
87
- },
88
- "contextStrategy": {
89
- "sources": [
90
- { "topic": "ISSUE_OPENED", "limit": 1 },
91
- {
92
- "topic": "CONDUCTOR_ESCALATE",
93
- "since": "last_agent_start",
94
- "limit": 1
95
- },
96
- {
97
- "topic": "CLUSTER_OPERATIONS_VALIDATION_FAILED",
98
- "since": "cluster_start",
99
- "limit": 3
100
- }
101
- ],
102
- "format": "chronological",
103
- "maxTokens": 100000
104
- },
105
- "maxRetries": 3,
106
- "triggers": [
107
- { "topic": "CONDUCTOR_ESCALATE", "action": "execute_task" },
108
- {
109
- "topic": "CLUSTER_OPERATIONS_VALIDATION_FAILED",
110
- "action": "execute_task"
111
- }
112
- ],
113
- "hooks": {
114
- "onComplete": {
115
- "action": "publish_message",
116
- "transform": {
117
- "engine": "javascript",
118
- "script": "const { complexity, taskType, reasoning } = result;\n\nlet taskText = triggeringMessage.content?.data?.taskText || '';\nif (!taskText) {\n taskText = triggeringMessage.content?.text || '';\n}\n\nconst config = helpers.getConfig(complexity, taskType);\n\nreturn {\n topic: 'CLUSTER_OPERATIONS',\n content: {\n text: `Senior: [${complexity}:${taskType}] ${reasoning}`,\n data: {\n complexity,\n taskType,\n operations: [\n { action: 'load_config', config },\n { action: 'publish', topic: 'ISSUE_OPENED', content: { text: taskText }, metadata: { _republished: true } }\n ]\n }\n }\n};"
119
- }
120
- }
121
- }
122
- }
123
- ]
124
- }
@@ -1,152 +0,0 @@
1
- # Base image for vibe cluster isolation mode
2
- # Provides: Node.js, Python, Git, Chromium, Claude CLI, Playwright deps, Infrastructure tools
3
- #
4
- # Build: docker build -t vibe-cluster-base vibe/cluster/docker/vibe-cluster/
5
- # Usage: zeroshot run <task> --docker
6
-
7
- FROM node:20-slim
8
-
9
- # Upgrade npm to fix Arborist isDescendantOf bug (npm 10.x crash on complex peer deps)
10
- # See: https://github.com/npm/cli/issues/7682
11
- RUN npm install -g npm@latest
12
-
13
- # Version pinning for infrastructure tools
14
- ARG AWS_CLI_VERSION=2.15.10
15
- ARG TERRAFORM_VERSION=1.6.6
16
- ARG KUBECTL_VERSION=1.29.0
17
- ARG HELM_VERSION=3.13.3
18
- ARG INFRACOST_VERSION=0.10.32
19
- ARG TFLINT_VERSION=0.50.0
20
- ARG TFSEC_VERSION=1.28.4
21
-
22
- # Install system dependencies for e2e testing and development
23
- RUN apt-get update && apt-get install -y --no-install-recommends \
24
- git \
25
- curl \
26
- # Build tools for native modules (node-gyp needs make, gcc, g++)
27
- build-essential \
28
- python3-dev \
29
- ca-certificates \
30
- gnupg \
31
- unzip \
32
- # Docker for starting services
33
- docker.io \
34
- docker-compose \
35
- # Python for general development
36
- python3 \
37
- python3-pip \
38
- python3-venv \
39
- # Chromium dependencies
40
- chromium \
41
- fonts-liberation \
42
- libasound2 \
43
- libatk-bridge2.0-0 \
44
- libatk1.0-0 \
45
- libcups2 \
46
- libdbus-1-3 \
47
- libdrm2 \
48
- libgbm1 \
49
- libgtk-3-0 \
50
- libnspr4 \
51
- libnss3 \
52
- libx11-xcb1 \
53
- libxcomposite1 \
54
- libxdamage1 \
55
- libxfixes3 \
56
- libxrandr2 \
57
- xdg-utils \
58
- && rm -rf /var/lib/apt/lists/* \
59
- # Create python symlink for compatibility
60
- && ln -sf /usr/bin/python3 /usr/bin/python
61
-
62
- # Install GitHub CLI for git authentication
63
- RUN curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg \
64
- && chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg \
65
- && echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | tee /etc/apt/sources.list.d/github-cli.list > /dev/null \
66
- && apt-get update && apt-get install -y gh \
67
- && rm -rf /var/lib/apt/lists/*
68
-
69
- # Install infrastructure tools
70
- # AWS CLI v2
71
- RUN curl -fsSL "https://awscli.amazonaws.com/awscli-exe-linux-x86_64-${AWS_CLI_VERSION}.zip" -o /tmp/awscliv2.zip \
72
- && unzip -q /tmp/awscliv2.zip -d /tmp \
73
- && /tmp/aws/install \
74
- && rm -rf /tmp/awscliv2.zip /tmp/aws
75
-
76
- # Terraform
77
- RUN curl -fsSL "https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_amd64.zip" -o /tmp/terraform.zip \
78
- && unzip -q /tmp/terraform.zip -d /usr/local/bin \
79
- && chmod +x /usr/local/bin/terraform \
80
- && rm /tmp/terraform.zip
81
-
82
- # kubectl
83
- RUN curl -fsSL "https://dl.k8s.io/release/v${KUBECTL_VERSION}/bin/linux/amd64/kubectl" -o /usr/local/bin/kubectl \
84
- && chmod +x /usr/local/bin/kubectl
85
-
86
- # Helm
87
- RUN curl -fsSL "https://get.helm.sh/helm-v${HELM_VERSION}-linux-amd64.tar.gz" -o /tmp/helm.tar.gz \
88
- && tar -xzf /tmp/helm.tar.gz -C /tmp \
89
- && mv /tmp/linux-amd64/helm /usr/local/bin/helm \
90
- && chmod +x /usr/local/bin/helm \
91
- && rm -rf /tmp/helm.tar.gz /tmp/linux-amd64
92
-
93
- # infracost (cost estimation)
94
- RUN curl -fsSL "https://github.com/infracost/infracost/releases/download/v${INFRACOST_VERSION}/infracost-linux-amd64.tar.gz" -o /tmp/infracost.tar.gz \
95
- && tar -xzf /tmp/infracost.tar.gz -C /tmp \
96
- && mv /tmp/infracost-linux-amd64 /usr/local/bin/infracost \
97
- && chmod +x /usr/local/bin/infracost \
98
- && rm /tmp/infracost.tar.gz
99
-
100
- # tflint (terraform linter)
101
- RUN curl -fsSL "https://github.com/terraform-linters/tflint/releases/download/v${TFLINT_VERSION}/tflint_linux_amd64.zip" -o /tmp/tflint.zip \
102
- && unzip -q /tmp/tflint.zip -d /usr/local/bin \
103
- && chmod +x /usr/local/bin/tflint \
104
- && rm /tmp/tflint.zip
105
-
106
- # tfsec (security scanner)
107
- RUN curl -fsSL "https://github.com/aquasecurity/tfsec/releases/download/v${TFSEC_VERSION}/tfsec-linux-amd64" -o /usr/local/bin/tfsec \
108
- && chmod +x /usr/local/bin/tfsec
109
-
110
- # Set AWS_PAGER to empty to disable paging in AWS CLI
111
- ENV AWS_PAGER=""
112
-
113
- # Set Chromium path for Playwright
114
- ENV CHROME_BIN=/usr/bin/chromium
115
- ENV PLAYWRIGHT_CHROMIUM_EXECUTABLE_PATH=/usr/bin/chromium
116
-
117
- # Copy zeroshot source into container and install globally
118
- # CRITICAL: This enables isolation mode to use 'zeroshot task run' inside container
119
- # which provides timeout, error handling, and log streaming infrastructure
120
- COPY --chown=node:node . /tmp/zeroshot/
121
- RUN cd /tmp/zeroshot && npm install && npm link
122
-
123
- # Pre-bake common npm dependencies (Issue #20: 30-40% startup reduction)
124
- # These are installed once at image build time, then copied to workspaces at runtime
125
- # if the project's dependencies are satisfied by the pre-baked set.
126
- COPY docker/zeroshot-cluster/pre-baked-deps.json /pre-baked-deps/package.json
127
- RUN cd /pre-baked-deps && npm install --ignore-scripts \
128
- && chown -R node:node /pre-baked-deps
129
-
130
- # Install Claude CLI globally
131
- RUN npm install -g @anthropic-ai/claude-code
132
-
133
- # Install Playwright (uses system Chromium)
134
- RUN npx playwright install-deps chromium 2>/dev/null || true
135
-
136
- # Add node user to docker group for Docker socket access
137
- RUN groupadd -f docker && usermod -aG docker node
138
-
139
- # Use existing 'node' user from base image (uid 1000)
140
- # Create directories with proper ownership for Claude CLI
141
- RUN mkdir -p /home/node/.claude /home/node/.config/gh \
142
- && chown -R node:node /home/node
143
-
144
- # Create workspace directory with node ownership
145
- RUN mkdir -p /workspace && chown node:node /workspace
146
- WORKDIR /workspace
147
-
148
- # Switch to non-root user (required for --dangerously-skip-permissions)
149
- USER node
150
-
151
- # Default command (overridden by vibe)
152
- CMD ["bash"]
@@ -1,28 +0,0 @@
1
- {
2
- "name": "pre-baked-deps",
3
- "version": "1.0.0",
4
- "description": "Pre-baked npm dependencies for zeroshot isolation containers",
5
- "private": true,
6
- "dependencies": {
7
- "typescript": "^5.3.0",
8
- "eslint": "^8.56.0",
9
- "@typescript-eslint/parser": "^6.19.0",
10
- "@typescript-eslint/eslint-plugin": "^6.19.0",
11
- "prettier": "^3.2.0",
12
- "jest": "^29.7.0",
13
- "@types/jest": "^29.5.0",
14
- "ts-jest": "^29.1.0",
15
- "@types/node": "^20.11.0",
16
- "tsx": "^4.7.0",
17
- "esbuild": "^0.19.0",
18
- "dotenv": "^16.4.0",
19
- "glob": "^10.3.0",
20
- "chalk": "^5.3.0",
21
- "commander": "^12.0.0",
22
- "axios": "^1.6.0",
23
- "node-fetch": "^3.3.0",
24
- "zod": "^3.22.0",
25
- "lodash": "^4.17.0",
26
- "@types/lodash": "^4.14.0"
27
- }
28
- }