@the-open-engine/zeroshot 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 +539 -0
- package/LICENSE +21 -0
- package/README.md +508 -0
- package/cli/commands/inspect-render.js +135 -0
- package/cli/commands/inspect.js +294 -0
- package/cli/commands/providers.js +149 -0
- package/cli/index.js +5431 -0
- package/cli/lib/first-run.js +211 -0
- package/cli/lib/update-checker.js +281 -0
- package/cli/message-formatter-utils.js +75 -0
- package/cli/message-formatters-normal.js +275 -0
- package/cli/message-formatters-watch.js +185 -0
- package/cluster-templates/base-templates/debug-workflow.json +422 -0
- package/cluster-templates/base-templates/full-workflow.json +727 -0
- package/cluster-templates/base-templates/heavy-validation.json +272 -0
- package/cluster-templates/base-templates/quick-validation.json +285 -0
- package/cluster-templates/base-templates/single-worker.json +71 -0
- package/cluster-templates/base-templates/worker-validator.json +230 -0
- package/cluster-templates/conductor-bootstrap.json +130 -0
- package/docker/zeroshot-cluster/Dockerfile +153 -0
- package/docker/zeroshot-cluster/pre-baked-deps.json +28 -0
- package/lib/agent-cli-provider/adapters/claude-parser.d.ts +3 -0
- package/lib/agent-cli-provider/adapters/claude-parser.d.ts.map +1 -0
- package/lib/agent-cli-provider/adapters/claude-parser.js +122 -0
- package/lib/agent-cli-provider/adapters/claude-parser.js.map +1 -0
- package/lib/agent-cli-provider/adapters/claude-recovery.d.ts +15 -0
- package/lib/agent-cli-provider/adapters/claude-recovery.d.ts.map +1 -0
- package/lib/agent-cli-provider/adapters/claude-recovery.js +165 -0
- package/lib/agent-cli-provider/adapters/claude-recovery.js.map +1 -0
- package/lib/agent-cli-provider/adapters/claude.d.ts +3 -0
- package/lib/agent-cli-provider/adapters/claude.d.ts.map +1 -0
- package/lib/agent-cli-provider/adapters/claude.js +181 -0
- package/lib/agent-cli-provider/adapters/claude.js.map +1 -0
- package/lib/agent-cli-provider/adapters/codex-parser.d.ts +3 -0
- package/lib/agent-cli-provider/adapters/codex-parser.d.ts.map +1 -0
- package/lib/agent-cli-provider/adapters/codex-parser.js +192 -0
- package/lib/agent-cli-provider/adapters/codex-parser.js.map +1 -0
- package/lib/agent-cli-provider/adapters/codex.d.ts +3 -0
- package/lib/agent-cli-provider/adapters/codex.d.ts.map +1 -0
- package/lib/agent-cli-provider/adapters/codex.js +151 -0
- package/lib/agent-cli-provider/adapters/codex.js.map +1 -0
- package/lib/agent-cli-provider/adapters/common.d.ts +28 -0
- package/lib/agent-cli-provider/adapters/common.d.ts.map +1 -0
- package/lib/agent-cli-provider/adapters/common.js +71 -0
- package/lib/agent-cli-provider/adapters/common.js.map +1 -0
- package/lib/agent-cli-provider/adapters/gemini.d.ts +3 -0
- package/lib/agent-cli-provider/adapters/gemini.d.ts.map +1 -0
- package/lib/agent-cli-provider/adapters/gemini.js +176 -0
- package/lib/agent-cli-provider/adapters/gemini.js.map +1 -0
- package/lib/agent-cli-provider/adapters/index.d.ts +9 -0
- package/lib/agent-cli-provider/adapters/index.d.ts.map +1 -0
- package/lib/agent-cli-provider/adapters/index.js +95 -0
- package/lib/agent-cli-provider/adapters/index.js.map +1 -0
- package/lib/agent-cli-provider/adapters/opencode.d.ts +3 -0
- package/lib/agent-cli-provider/adapters/opencode.d.ts.map +1 -0
- package/lib/agent-cli-provider/adapters/opencode.js +228 -0
- package/lib/agent-cli-provider/adapters/opencode.js.map +1 -0
- package/lib/agent-cli-provider/contract-actions.d.ts +5 -0
- package/lib/agent-cli-provider/contract-actions.d.ts.map +1 -0
- package/lib/agent-cli-provider/contract-actions.js +140 -0
- package/lib/agent-cli-provider/contract-actions.js.map +1 -0
- package/lib/agent-cli-provider/contract-env.d.ts +11 -0
- package/lib/agent-cli-provider/contract-env.d.ts.map +1 -0
- package/lib/agent-cli-provider/contract-env.js +113 -0
- package/lib/agent-cli-provider/contract-env.js.map +1 -0
- package/lib/agent-cli-provider/contract-envelope.d.ts +49 -0
- package/lib/agent-cli-provider/contract-envelope.d.ts.map +1 -0
- package/lib/agent-cli-provider/contract-envelope.js +52 -0
- package/lib/agent-cli-provider/contract-envelope.js.map +1 -0
- package/lib/agent-cli-provider/contract-errors.d.ts +22 -0
- package/lib/agent-cli-provider/contract-errors.d.ts.map +1 -0
- package/lib/agent-cli-provider/contract-errors.js +71 -0
- package/lib/agent-cli-provider/contract-errors.js.map +1 -0
- package/lib/agent-cli-provider/contract-fallback.d.ts +7 -0
- package/lib/agent-cli-provider/contract-fallback.d.ts.map +1 -0
- package/lib/agent-cli-provider/contract-fallback.js +102 -0
- package/lib/agent-cli-provider/contract-fallback.js.map +1 -0
- package/lib/agent-cli-provider/contract-invoke.d.ts +5 -0
- package/lib/agent-cli-provider/contract-invoke.d.ts.map +1 -0
- package/lib/agent-cli-provider/contract-invoke.js +89 -0
- package/lib/agent-cli-provider/contract-invoke.js.map +1 -0
- package/lib/agent-cli-provider/contract-options.d.ts +3 -0
- package/lib/agent-cli-provider/contract-options.d.ts.map +1 -0
- package/lib/agent-cli-provider/contract-options.js +140 -0
- package/lib/agent-cli-provider/contract-options.js.map +1 -0
- package/lib/agent-cli-provider/contract-parse.d.ts +15 -0
- package/lib/agent-cli-provider/contract-parse.d.ts.map +1 -0
- package/lib/agent-cli-provider/contract-parse.js +81 -0
- package/lib/agent-cli-provider/contract-parse.js.map +1 -0
- package/lib/agent-cli-provider/contract-support.d.ts +18 -0
- package/lib/agent-cli-provider/contract-support.d.ts.map +1 -0
- package/lib/agent-cli-provider/contract-support.js +154 -0
- package/lib/agent-cli-provider/contract-support.js.map +1 -0
- package/lib/agent-cli-provider/contract.d.ts +13 -0
- package/lib/agent-cli-provider/contract.d.ts.map +1 -0
- package/lib/agent-cli-provider/contract.js +30 -0
- package/lib/agent-cli-provider/contract.js.map +1 -0
- package/lib/agent-cli-provider/env-safety.d.ts +11 -0
- package/lib/agent-cli-provider/env-safety.d.ts.map +1 -0
- package/lib/agent-cli-provider/env-safety.js +83 -0
- package/lib/agent-cli-provider/env-safety.js.map +1 -0
- package/lib/agent-cli-provider/errors.d.ts +5 -0
- package/lib/agent-cli-provider/errors.d.ts.map +1 -0
- package/lib/agent-cli-provider/errors.js +115 -0
- package/lib/agent-cli-provider/errors.js.map +1 -0
- package/lib/agent-cli-provider/executable.d.ts +3 -0
- package/lib/agent-cli-provider/executable.d.ts.map +1 -0
- package/lib/agent-cli-provider/executable.js +24 -0
- package/lib/agent-cli-provider/executable.js.map +1 -0
- package/lib/agent-cli-provider/index.d.ts +8 -0
- package/lib/agent-cli-provider/index.d.ts.map +1 -0
- package/lib/agent-cli-provider/index.js +31 -0
- package/lib/agent-cli-provider/index.js.map +1 -0
- package/lib/agent-cli-provider/invoke-evidence.d.ts +4 -0
- package/lib/agent-cli-provider/invoke-evidence.d.ts.map +1 -0
- package/lib/agent-cli-provider/invoke-evidence.js +17 -0
- package/lib/agent-cli-provider/invoke-evidence.js.map +1 -0
- package/lib/agent-cli-provider/json.d.ts +16 -0
- package/lib/agent-cli-provider/json.d.ts.map +1 -0
- package/lib/agent-cli-provider/json.js +110 -0
- package/lib/agent-cli-provider/json.js.map +1 -0
- package/lib/agent-cli-provider/log-prefix.d.ts +2 -0
- package/lib/agent-cli-provider/log-prefix.d.ts.map +1 -0
- package/lib/agent-cli-provider/log-prefix.js +22 -0
- package/lib/agent-cli-provider/log-prefix.js.map +1 -0
- package/lib/agent-cli-provider/process-runner.d.ts +17 -0
- package/lib/agent-cli-provider/process-runner.d.ts.map +1 -0
- package/lib/agent-cli-provider/process-runner.js +89 -0
- package/lib/agent-cli-provider/process-runner.js.map +1 -0
- package/lib/agent-cli-provider/redaction.d.ts +9 -0
- package/lib/agent-cli-provider/redaction.d.ts.map +1 -0
- package/lib/agent-cli-provider/redaction.js +227 -0
- package/lib/agent-cli-provider/redaction.js.map +1 -0
- package/lib/agent-cli-provider/schema.d.ts +5 -0
- package/lib/agent-cli-provider/schema.d.ts.map +1 -0
- package/lib/agent-cli-provider/schema.js +136 -0
- package/lib/agent-cli-provider/schema.js.map +1 -0
- package/lib/agent-cli-provider/single-agent-runtime.d.ts +15 -0
- package/lib/agent-cli-provider/single-agent-runtime.d.ts.map +1 -0
- package/lib/agent-cli-provider/single-agent-runtime.js +228 -0
- package/lib/agent-cli-provider/single-agent-runtime.js.map +1 -0
- package/lib/agent-cli-provider/types.d.ts +194 -0
- package/lib/agent-cli-provider/types.d.ts.map +1 -0
- package/lib/agent-cli-provider/types.js +12 -0
- package/lib/agent-cli-provider/types.js.map +1 -0
- package/lib/completion.js +174 -0
- package/lib/detached-startup.js +220 -0
- package/lib/docker-config.js +220 -0
- package/lib/git-remote-utils.js +165 -0
- package/lib/id-detector.js +55 -0
- package/lib/provider-defaults.js +62 -0
- package/lib/provider-detection.js +59 -0
- package/lib/provider-names.js +57 -0
- package/lib/repo-settings.js +69 -0
- package/lib/settings/claude-auth.js +78 -0
- package/lib/settings.js +542 -0
- package/lib/start-cluster.js +321 -0
- package/lib/stream-json-parser.js +67 -0
- package/package.json +162 -0
- package/scripts/fix-node-pty-permissions.js +75 -0
- package/scripts/record-demo.sh +279 -0
- package/scripts/setup-merge-queue.sh +170 -0
- package/scripts/test-install.sh +40 -0
- package/scripts/validate-templates.js +107 -0
- package/src/agent/agent-config.js +266 -0
- package/src/agent/agent-context-builder.js +189 -0
- package/src/agent/agent-context-sections.js +338 -0
- package/src/agent/agent-context-sources.js +147 -0
- package/src/agent/agent-hook-executor.js +721 -0
- package/src/agent/agent-input-injector.js +141 -0
- package/src/agent/agent-lifecycle.js +982 -0
- package/src/agent/agent-quality-gate-schema.js +93 -0
- package/src/agent/agent-quality-gates-context.js +51 -0
- package/src/agent/agent-stuck-detector.js +256 -0
- package/src/agent/agent-task-executor.js +2028 -0
- package/src/agent/agent-trigger-evaluator.js +67 -0
- package/src/agent/context-metrics.js +160 -0
- package/src/agent/context-pack-builder.js +367 -0
- package/src/agent/context-replay-policy.js +51 -0
- package/src/agent/guidance-queue.js +77 -0
- package/src/agent/output-extraction.js +367 -0
- package/src/agent/output-reformatter.js +175 -0
- package/src/agent/pr-verification.js +653 -0
- package/src/agent/rate-limit-backoff.js +82 -0
- package/src/agent/schema-utils.js +146 -0
- package/src/agent/validation-platform.js +35 -0
- package/src/agent-cli-provider/adapters/claude-parser.ts +133 -0
- package/src/agent-cli-provider/adapters/claude-recovery.ts +203 -0
- package/src/agent-cli-provider/adapters/claude.ts +247 -0
- package/src/agent-cli-provider/adapters/codex-parser.ts +211 -0
- package/src/agent-cli-provider/adapters/codex.ts +217 -0
- package/src/agent-cli-provider/adapters/common.ts +124 -0
- package/src/agent-cli-provider/adapters/gemini.ts +243 -0
- package/src/agent-cli-provider/adapters/index.ts +126 -0
- package/src/agent-cli-provider/adapters/opencode.ts +286 -0
- package/src/agent-cli-provider/contract-actions.ts +150 -0
- package/src/agent-cli-provider/contract-env.ts +111 -0
- package/src/agent-cli-provider/contract-envelope.ts +110 -0
- package/src/agent-cli-provider/contract-errors.ts +66 -0
- package/src/agent-cli-provider/contract-fallback.ts +121 -0
- package/src/agent-cli-provider/contract-invoke.ts +104 -0
- package/src/agent-cli-provider/contract-options.ts +173 -0
- package/src/agent-cli-provider/contract-parse.ts +94 -0
- package/src/agent-cli-provider/contract-support.ts +167 -0
- package/src/agent-cli-provider/contract.ts +56 -0
- package/src/agent-cli-provider/env-safety.ts +82 -0
- package/src/agent-cli-provider/errors.ts +122 -0
- package/src/agent-cli-provider/executable.ts +24 -0
- package/src/agent-cli-provider/index.ts +83 -0
- package/src/agent-cli-provider/invoke-evidence.ts +18 -0
- package/src/agent-cli-provider/json.ts +114 -0
- package/src/agent-cli-provider/log-prefix.ts +20 -0
- package/src/agent-cli-provider/process-runner.ts +145 -0
- package/src/agent-cli-provider/redaction.ts +282 -0
- package/src/agent-cli-provider/schema.ts +115 -0
- package/src/agent-cli-provider/single-agent-runtime.ts +311 -0
- package/src/agent-cli-provider/types.ts +237 -0
- package/src/agent-wrapper.js +615 -0
- package/src/agents/git-pusher-template.js +705 -0
- package/src/attach/attach-client.js +438 -0
- package/src/attach/attach-server.js +543 -0
- package/src/attach/index.js +37 -0
- package/src/attach/protocol.js +220 -0
- package/src/attach/ring-buffer.js +121 -0
- package/src/attach/send-input.js +88 -0
- package/src/attach/socket-discovery.js +267 -0
- package/src/claude-task-runner.js +661 -0
- package/src/config-router.js +89 -0
- package/src/config-validator.js +2202 -0
- package/src/copy-worker.js +43 -0
- package/src/guidance-topics.js +10 -0
- package/src/input-helpers.js +65 -0
- package/src/isolation-manager.js +1734 -0
- package/src/issue-providers/README.md +305 -0
- package/src/issue-providers/azure-devops-provider.js +307 -0
- package/src/issue-providers/base-provider.js +232 -0
- package/src/issue-providers/github-provider.js +210 -0
- package/src/issue-providers/gitlab-provider.js +262 -0
- package/src/issue-providers/index.js +196 -0
- package/src/issue-providers/jira-provider.js +260 -0
- package/src/ledger.js +692 -0
- package/src/lib/gc.js +232 -0
- package/src/lib/safe-exec.js +88 -0
- package/src/logic-engine.js +201 -0
- package/src/message-buffer.js +81 -0
- package/src/message-bus-bridge.js +144 -0
- package/src/message-bus.js +256 -0
- package/src/name-generator.js +232 -0
- package/src/orchestrator.js +3924 -0
- package/src/preflight.js +712 -0
- package/src/process-metrics.js +608 -0
- package/src/providers/anthropic/index.js +3 -0
- package/src/providers/base-provider.js +355 -0
- package/src/providers/capabilities.js +60 -0
- package/src/providers/google/index.js +3 -0
- package/src/providers/index.js +293 -0
- package/src/providers/openai/index.js +3 -0
- package/src/providers/opencode/index.js +3 -0
- package/src/quality-gates.js +143 -0
- package/src/schemas/sub-cluster.js +208 -0
- package/src/state-snapshot.js +398 -0
- package/src/state-snapshotter.js +142 -0
- package/src/status-footer.js +1026 -0
- package/src/sub-cluster-wrapper.js +693 -0
- package/src/task-runner.js +30 -0
- package/src/template-resolver.js +425 -0
- package/src/template-validation/index.js +338 -0
- package/src/template-validation/simulate-consensus-gates.js +324 -0
- package/src/template-validation/simulate-random-topology.js +541 -0
- package/src/template-validation/simulate-two-stage-validation.js +270 -0
- package/src/worktree-claude-config.js +135 -0
- package/src/worktree-tooling-env.js +150 -0
- package/task-lib/attachable-watcher.js +381 -0
- package/task-lib/commands/clean.js +50 -0
- package/task-lib/commands/episodes.js +105 -0
- package/task-lib/commands/get-log-path.js +23 -0
- package/task-lib/commands/kill.js +32 -0
- package/task-lib/commands/list.js +105 -0
- package/task-lib/commands/logs.js +439 -0
- package/task-lib/commands/resume.js +42 -0
- package/task-lib/commands/run.js +57 -0
- package/task-lib/commands/schedule.js +105 -0
- package/task-lib/commands/scheduler-cmd.js +96 -0
- package/task-lib/commands/schedules.js +148 -0
- package/task-lib/commands/status.js +44 -0
- package/task-lib/commands/unschedule.js +16 -0
- package/task-lib/completion.js +9 -0
- package/task-lib/config.js +11 -0
- package/task-lib/name-generator.js +230 -0
- package/task-lib/package.json +3 -0
- package/task-lib/provider-helper-runtime.js +29 -0
- package/task-lib/runner.js +190 -0
- package/task-lib/scheduler.js +252 -0
- package/task-lib/store.js +529 -0
- package/task-lib/watcher.js +305 -0
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "Heavy Validation",
|
|
3
|
+
"description": "Stage 2: Security + Adversarial testing. Expensive (120-180s). Only runs after Stage 1 passes.",
|
|
4
|
+
"params": {
|
|
5
|
+
"validator_level": {
|
|
6
|
+
"type": "string",
|
|
7
|
+
"enum": ["level1", "level2", "level3"],
|
|
8
|
+
"default": "level3"
|
|
9
|
+
},
|
|
10
|
+
"max_tokens": {
|
|
11
|
+
"type": "number",
|
|
12
|
+
"default": 100000
|
|
13
|
+
},
|
|
14
|
+
"timeout": {
|
|
15
|
+
"type": "number",
|
|
16
|
+
"default": 0,
|
|
17
|
+
"description": "Task timeout in milliseconds (0 = no timeout)"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"agents": [
|
|
21
|
+
{
|
|
22
|
+
"id": "validator-security",
|
|
23
|
+
"role": "validator",
|
|
24
|
+
"modelLevel": "{{validator_level}}",
|
|
25
|
+
"timeout": "{{timeout}}",
|
|
26
|
+
"maxRetries": 3,
|
|
27
|
+
"outputFormat": "json",
|
|
28
|
+
"jsonSchema": {
|
|
29
|
+
"type": "object",
|
|
30
|
+
"properties": {
|
|
31
|
+
"approved": {
|
|
32
|
+
"type": "boolean"
|
|
33
|
+
},
|
|
34
|
+
"summary": {
|
|
35
|
+
"type": "string"
|
|
36
|
+
},
|
|
37
|
+
"errors": {
|
|
38
|
+
"type": "array",
|
|
39
|
+
"items": {
|
|
40
|
+
"type": "string"
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
"required": ["approved", "summary"]
|
|
45
|
+
},
|
|
46
|
+
"prompt": {
|
|
47
|
+
"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 ARE A VALIDATOR - READ-ONLY MODE\n\nYour ONLY job is to VALIDATE and OUTPUT JSON.\n- NEVER use Edit, Write, or any file modification tools\n- NEVER fix code - REJECT with errors array instead\n- NEVER create files, modify files, or make commits\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 (README, CONTRIBUTING, Makefile, package.json, etc.)\n2. Look for validation instructions, scripts, or commands the repo specifies\n3. If context files say to run a validation script (validation script, make check, etc.), 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 CRITICAL 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"
|
|
48
|
+
},
|
|
49
|
+
"contextStrategy": {
|
|
50
|
+
"sources": [
|
|
51
|
+
{
|
|
52
|
+
"topic": "ISSUE_OPENED",
|
|
53
|
+
"priority": "required",
|
|
54
|
+
"strategy": "latest",
|
|
55
|
+
"amount": 1
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"topic": "STATE_SNAPSHOT",
|
|
59
|
+
"priority": "required",
|
|
60
|
+
"strategy": "latest",
|
|
61
|
+
"amount": 1
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"topic": "PLAN_READY",
|
|
65
|
+
"priority": "required",
|
|
66
|
+
"strategy": "latest",
|
|
67
|
+
"amount": 1
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"topic": "IMPLEMENTATION_READY",
|
|
71
|
+
"priority": "required",
|
|
72
|
+
"strategy": "latest",
|
|
73
|
+
"amount": 1
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"topic": "QUICK_VALIDATION_PASSED",
|
|
77
|
+
"priority": "required",
|
|
78
|
+
"strategy": "latest",
|
|
79
|
+
"amount": 1
|
|
80
|
+
}
|
|
81
|
+
],
|
|
82
|
+
"format": "chronological",
|
|
83
|
+
"maxTokens": "{{max_tokens}}"
|
|
84
|
+
},
|
|
85
|
+
"triggers": [
|
|
86
|
+
{
|
|
87
|
+
"topic": "QUICK_VALIDATION_PASSED",
|
|
88
|
+
"action": "execute_task"
|
|
89
|
+
}
|
|
90
|
+
],
|
|
91
|
+
"hooks": {
|
|
92
|
+
"onComplete": {
|
|
93
|
+
"action": "publish_message",
|
|
94
|
+
"config": {
|
|
95
|
+
"topic": "HEAVY_VALIDATION_RESULT",
|
|
96
|
+
"content": {
|
|
97
|
+
"text": "{{result.summary}}",
|
|
98
|
+
"data": {
|
|
99
|
+
"approved": "{{result.approved}}",
|
|
100
|
+
"errors": "{{result.errors}}",
|
|
101
|
+
"validatorId": "validator-security"
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
"id": "validator-tester",
|
|
110
|
+
"role": "validator",
|
|
111
|
+
"modelLevel": "{{validator_level}}",
|
|
112
|
+
"timeout": "{{timeout}}",
|
|
113
|
+
"maxRetries": 3,
|
|
114
|
+
"outputFormat": "json",
|
|
115
|
+
"jsonSchema": {
|
|
116
|
+
"type": "object",
|
|
117
|
+
"properties": {
|
|
118
|
+
"approved": {
|
|
119
|
+
"type": "boolean"
|
|
120
|
+
},
|
|
121
|
+
"summary": {
|
|
122
|
+
"type": "string"
|
|
123
|
+
},
|
|
124
|
+
"errors": {
|
|
125
|
+
"type": "array",
|
|
126
|
+
"items": {
|
|
127
|
+
"type": "string"
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
"testResults": {
|
|
131
|
+
"type": "string"
|
|
132
|
+
},
|
|
133
|
+
"skippedTests": {
|
|
134
|
+
"type": "array",
|
|
135
|
+
"description": "Tests that couldn't run due to missing env vars or external service unavailability. Treated as WARNING, not failure.",
|
|
136
|
+
"items": {
|
|
137
|
+
"type": "object",
|
|
138
|
+
"properties": {
|
|
139
|
+
"test": {
|
|
140
|
+
"type": "string",
|
|
141
|
+
"description": "Test file or suite name"
|
|
142
|
+
},
|
|
143
|
+
"reason": {
|
|
144
|
+
"type": "string",
|
|
145
|
+
"description": "Why it was skipped (missing env var, unavailable service, etc.)"
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
"required": ["test", "reason"]
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
},
|
|
152
|
+
"required": ["approved", "summary"]
|
|
153
|
+
},
|
|
154
|
+
"prompt": {
|
|
155
|
+
"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 ARE A VALIDATOR - READ-ONLY MODE\n\nYour ONLY job is to VALIDATE and OUTPUT JSON.\n- NEVER use Edit, Write, or any file modification tools\n- NEVER fix code - REJECT with errors array instead\n- NEVER create files, modify files, or make commits\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: DISCOVER TEST COMMANDS FROM REPO CONTEXT\n\n1. Read context files (README, CONTRIBUTING, Makefile, package.json, pyproject.toml, Cargo.toml, etc.)\n2. Find the test runner command - DO NOT assume any specific tool\n3. Common patterns: `npm test`, `pytest`, `go test ./...`, `cargo test`, `make test`\n4. Use what the repo specifies, not hardcoded commands\n\n## 🔴 STEP 2: RUN TARGETED TESTS (NOT FULL SUITE)\n\n1. Identify changed files from IMPLEMENTATION_READY message\n2. Find tests RELATED to changed files:\n - Same directory (e.g., `src/foo.ts` → `src/foo.test.ts`)\n - Test files that import the changed files\n - Naming convention matches (e.g., `auth.ts` → `tests/auth.test.ts`)\n3. Run ONLY related tests using repo's \"related tests\" feature if available:\n - Jest: `--findRelatedTests <files>`\n - pytest: `pytest <test_files>`\n - go test: `go test ./path/to/package`\n4. For CRITICAL tasks (auth, payments, security): broader test scope is acceptable\n5. Record output in testResults field\n6. If ANY tests fail → REJECT immediately\n\n**DO NOT run the full test suite when targeted tests suffice.**\n\n## 🔴 STEP 3: RUN REPO-SPECIFIC VALIDATION\n\nIf context files specify validation commands (validation script, make check, etc.):\n1. RUN THEM\n2. Record output\n3. If they fail → REJECT\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- ❌ Hardcoding `npm test` or any specific test runner without checking repo context\n- ❌ Running full test suite + coverage when only 2 files changed\n\n## 🔴 HANDLING SKIPPED TESTS\n\nIf a test SKIPS due to missing prerequisites (env vars, external services, credentials):\n- Add to skippedTests array with test name and reason\n- Do NOT add to errors array\n- Do NOT reject for skipped tests alone\n- Core tests must still pass\n\nSkipped = WARNING, not FAILURE. Same as CANNOT_VALIDATE in requirements validation.\n\n## APPROVAL CRITERIA\n\nONLY approve if:\n1. You RAN tests related to changed files\n2. All RUNNABLE tests pass (skipped tests = warning only)\n3. Repo-specific validation commands pass\n4. Changed code has test coverage\n\n## Output\n- **approved**: true if runnable tests passed\n- **summary**: Assessment based on test execution\n- **errors**: Issues from running tests\n- **testResults**: Actual test output (REQUIRED)\n- **skippedTests**: Tests that couldn't run (warning only)\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"
|
|
156
|
+
},
|
|
157
|
+
"contextStrategy": {
|
|
158
|
+
"sources": [
|
|
159
|
+
{
|
|
160
|
+
"topic": "ISSUE_OPENED",
|
|
161
|
+
"priority": "required",
|
|
162
|
+
"strategy": "latest",
|
|
163
|
+
"amount": 1
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
"topic": "STATE_SNAPSHOT",
|
|
167
|
+
"priority": "required",
|
|
168
|
+
"strategy": "latest",
|
|
169
|
+
"amount": 1
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
"topic": "PLAN_READY",
|
|
173
|
+
"priority": "required",
|
|
174
|
+
"strategy": "latest",
|
|
175
|
+
"amount": 1
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
"topic": "IMPLEMENTATION_READY",
|
|
179
|
+
"priority": "required",
|
|
180
|
+
"strategy": "latest",
|
|
181
|
+
"amount": 1
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
"topic": "QUICK_VALIDATION_PASSED",
|
|
185
|
+
"priority": "required",
|
|
186
|
+
"strategy": "latest",
|
|
187
|
+
"amount": 1
|
|
188
|
+
}
|
|
189
|
+
],
|
|
190
|
+
"format": "chronological",
|
|
191
|
+
"maxTokens": "{{max_tokens}}"
|
|
192
|
+
},
|
|
193
|
+
"triggers": [
|
|
194
|
+
{
|
|
195
|
+
"topic": "QUICK_VALIDATION_PASSED",
|
|
196
|
+
"action": "execute_task"
|
|
197
|
+
}
|
|
198
|
+
],
|
|
199
|
+
"hooks": {
|
|
200
|
+
"onComplete": {
|
|
201
|
+
"action": "publish_message",
|
|
202
|
+
"config": {
|
|
203
|
+
"topic": "HEAVY_VALIDATION_RESULT",
|
|
204
|
+
"content": {
|
|
205
|
+
"text": "{{result.summary}}",
|
|
206
|
+
"data": {
|
|
207
|
+
"approved": "{{result.approved}}",
|
|
208
|
+
"errors": "{{result.errors}}",
|
|
209
|
+
"testResults": "{{result.testResults}}",
|
|
210
|
+
"skippedTests": "{{result.skippedTests}}",
|
|
211
|
+
"validatorId": "validator-tester"
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
"id": "consensus-coordinator",
|
|
220
|
+
"role": "coordinator",
|
|
221
|
+
"modelLevel": "level1",
|
|
222
|
+
"timeout": "{{timeout}}",
|
|
223
|
+
"outputFormat": "json",
|
|
224
|
+
"jsonSchema": {
|
|
225
|
+
"type": "object",
|
|
226
|
+
"properties": {
|
|
227
|
+
"allApproved": {
|
|
228
|
+
"type": "boolean"
|
|
229
|
+
},
|
|
230
|
+
"summary": {
|
|
231
|
+
"type": "string"
|
|
232
|
+
}
|
|
233
|
+
},
|
|
234
|
+
"required": ["allApproved", "summary"]
|
|
235
|
+
},
|
|
236
|
+
"prompt": {
|
|
237
|
+
"system": "Check if both validators approved. Output: {\"allApproved\": boolean, \"summary\": \"<50 chars>\"}"
|
|
238
|
+
},
|
|
239
|
+
"contextStrategy": {
|
|
240
|
+
"sources": [
|
|
241
|
+
{
|
|
242
|
+
"topic": "HEAVY_VALIDATION_RESULT",
|
|
243
|
+
"priority": "required",
|
|
244
|
+
"strategy": "latest",
|
|
245
|
+
"amount": 2
|
|
246
|
+
}
|
|
247
|
+
],
|
|
248
|
+
"format": "chronological",
|
|
249
|
+
"maxTokens": "{{max_tokens}}"
|
|
250
|
+
},
|
|
251
|
+
"triggers": [
|
|
252
|
+
{
|
|
253
|
+
"topic": "HEAVY_VALIDATION_RESULT",
|
|
254
|
+
"logic": {
|
|
255
|
+
"engine": "javascript",
|
|
256
|
+
"script": "const validators = ['validator-security', 'validator-tester']; const stageStart = ledger.findLast({ topic: 'QUICK_VALIDATION_PASSED' }); if (!stageStart) return false; const lastHeavyConsensus = ledger.findLast({ topic: 'VALIDATION_RESULT', since: stageStart.timestamp }); const since = Math.max(stageStart.timestamp, lastHeavyConsensus?.timestamp || 0); const responses = ledger.query({ topic: 'HEAVY_VALIDATION_RESULT', since }); const latestByValidator = new Map(); for (const response of responses) { if (validators.includes(response.sender)) { latestByValidator.set(response.sender, response); } } return validators.every((validatorId) => latestByValidator.has(validatorId));"
|
|
257
|
+
},
|
|
258
|
+
"action": "execute_task"
|
|
259
|
+
}
|
|
260
|
+
],
|
|
261
|
+
"hooks": {
|
|
262
|
+
"onComplete": {
|
|
263
|
+
"action": "publish_message",
|
|
264
|
+
"transform": {
|
|
265
|
+
"engine": "javascript",
|
|
266
|
+
"script": "const validationResults = ledger.query({ topic: 'HEAVY_VALIDATION_RESULT' }); return { topic: 'VALIDATION_RESULT', content: { text: result.allApproved ? 'All validations passed' : 'Stage 2 rejected', data: { approved: result.allApproved, stage: 'heavy', summary: result.summary, errors: validationResults.flatMap(r => r.content?.data?.errors || []), qualityGates: validationResults.flatMap(r => r.content?.data?.qualityGates || []) } } };"
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
]
|
|
272
|
+
}
|
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "Quick Validation",
|
|
3
|
+
"description": "Stage 1: Requirements + Code validation. Fast feedback (30-60s).",
|
|
4
|
+
"params": {
|
|
5
|
+
"validator_level": {
|
|
6
|
+
"type": "string",
|
|
7
|
+
"enum": ["level1", "level2", "level3"],
|
|
8
|
+
"default": "level3"
|
|
9
|
+
},
|
|
10
|
+
"max_tokens": {
|
|
11
|
+
"type": "number",
|
|
12
|
+
"default": 100000
|
|
13
|
+
},
|
|
14
|
+
"timeout": {
|
|
15
|
+
"type": "number",
|
|
16
|
+
"default": 0,
|
|
17
|
+
"description": "Task timeout in milliseconds (0 = no timeout)"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"agents": [
|
|
21
|
+
{
|
|
22
|
+
"id": "validator-requirements",
|
|
23
|
+
"role": "validator",
|
|
24
|
+
"modelLevel": "{{validator_level}}",
|
|
25
|
+
"timeout": "{{timeout}}",
|
|
26
|
+
"maxRetries": 3,
|
|
27
|
+
"outputFormat": "json",
|
|
28
|
+
"jsonSchema": {
|
|
29
|
+
"type": "object",
|
|
30
|
+
"properties": {
|
|
31
|
+
"approved": {
|
|
32
|
+
"type": "boolean"
|
|
33
|
+
},
|
|
34
|
+
"summary": {
|
|
35
|
+
"type": "string"
|
|
36
|
+
},
|
|
37
|
+
"errors": {
|
|
38
|
+
"type": "array",
|
|
39
|
+
"items": {
|
|
40
|
+
"type": "string"
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
"criteriaResults": {
|
|
44
|
+
"type": "array",
|
|
45
|
+
"description": "Status for each acceptance criterion. PASS/FAIL require evidence. CANNOT_VALIDATE requires reason.",
|
|
46
|
+
"items": {
|
|
47
|
+
"type": "object",
|
|
48
|
+
"properties": {
|
|
49
|
+
"id": {
|
|
50
|
+
"type": "string",
|
|
51
|
+
"description": "AC1, AC2, etc. from plan"
|
|
52
|
+
},
|
|
53
|
+
"status": {
|
|
54
|
+
"type": "string",
|
|
55
|
+
"enum": ["PASS", "FAIL", "SKIPPED", "CANNOT_VALIDATE"],
|
|
56
|
+
"description": "CANNOT_VALIDATE = verification impossible (missing tools, permissions, etc). Treated as PASS with warning."
|
|
57
|
+
},
|
|
58
|
+
"evidence": {
|
|
59
|
+
"type": "object",
|
|
60
|
+
"description": "REQUIRED for PASS/FAIL. Proof of verification - actual command output.",
|
|
61
|
+
"properties": {
|
|
62
|
+
"command": {
|
|
63
|
+
"type": "string"
|
|
64
|
+
},
|
|
65
|
+
"exitCode": {
|
|
66
|
+
"type": "integer"
|
|
67
|
+
},
|
|
68
|
+
"output": {
|
|
69
|
+
"type": "string"
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
"reason": {
|
|
74
|
+
"type": "string",
|
|
75
|
+
"description": "REQUIRED for CANNOT_VALIDATE. WHY verification is impossible (e.g., 'kubectl not installed', 'no SSH access')."
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
"required": ["id", "status"]
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
"required": ["approved", "summary"]
|
|
83
|
+
},
|
|
84
|
+
"prompt": {
|
|
85
|
+
"system": "# REQUIREMENTS VALIDATOR\n\n## 🚫 YOU ARE A VALIDATOR - READ-ONLY MODE\n\nYour ONLY job is to VALIDATE and OUTPUT JSON.\n- NEVER use Edit, Write, or any file modification tools\n- NEVER fix code - REJECT with errors array instead\n- NEVER create files, modify files, or make commits\n\nVerify implementation meets ALL requirements from issue. Hold a HIGH BAR.\n\n## WORKFLOW\n1. Read context files (README, CONTRIBUTING, Makefile, package.json, etc.) for repo-specific validation\n2. Parse acceptanceCriteria from PLAN_READY\n3. For EACH criterion: run verification, record evidence\n4. If repo has validation script (validation script, make check, etc.), 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."
|
|
86
|
+
},
|
|
87
|
+
"contextStrategy": {
|
|
88
|
+
"sources": [
|
|
89
|
+
{
|
|
90
|
+
"topic": "ISSUE_OPENED",
|
|
91
|
+
"priority": "required",
|
|
92
|
+
"strategy": "latest",
|
|
93
|
+
"amount": 1
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"topic": "STATE_SNAPSHOT",
|
|
97
|
+
"priority": "required",
|
|
98
|
+
"strategy": "latest",
|
|
99
|
+
"amount": 1
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
"topic": "PLAN_READY",
|
|
103
|
+
"priority": "required",
|
|
104
|
+
"strategy": "latest",
|
|
105
|
+
"amount": 1
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
"topic": "IMPLEMENTATION_READY",
|
|
109
|
+
"priority": "high",
|
|
110
|
+
"since": "last_agent_start",
|
|
111
|
+
"strategy": "latest",
|
|
112
|
+
"amount": 1
|
|
113
|
+
}
|
|
114
|
+
],
|
|
115
|
+
"format": "chronological",
|
|
116
|
+
"maxTokens": "{{max_tokens}}"
|
|
117
|
+
},
|
|
118
|
+
"triggers": [
|
|
119
|
+
{
|
|
120
|
+
"topic": "IMPLEMENTATION_READY",
|
|
121
|
+
"action": "execute_task"
|
|
122
|
+
}
|
|
123
|
+
],
|
|
124
|
+
"hooks": {
|
|
125
|
+
"onComplete": {
|
|
126
|
+
"action": "publish_message",
|
|
127
|
+
"config": {
|
|
128
|
+
"topic": "QUICK_VALIDATION_RESULT",
|
|
129
|
+
"content": {
|
|
130
|
+
"text": "{{result.summary}}",
|
|
131
|
+
"data": {
|
|
132
|
+
"approved": "{{result.approved}}",
|
|
133
|
+
"errors": "{{result.errors}}",
|
|
134
|
+
"criteriaResults": "{{result.criteriaResults}}",
|
|
135
|
+
"validatorId": "validator-requirements"
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
"id": "validator-code",
|
|
144
|
+
"role": "validator",
|
|
145
|
+
"modelLevel": "{{validator_level}}",
|
|
146
|
+
"timeout": "{{timeout}}",
|
|
147
|
+
"maxRetries": 3,
|
|
148
|
+
"outputFormat": "json",
|
|
149
|
+
"jsonSchema": {
|
|
150
|
+
"type": "object",
|
|
151
|
+
"properties": {
|
|
152
|
+
"approved": {
|
|
153
|
+
"type": "boolean"
|
|
154
|
+
},
|
|
155
|
+
"summary": {
|
|
156
|
+
"type": "string"
|
|
157
|
+
},
|
|
158
|
+
"errors": {
|
|
159
|
+
"type": "array",
|
|
160
|
+
"items": {
|
|
161
|
+
"type": "string"
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
},
|
|
165
|
+
"required": ["approved", "summary"]
|
|
166
|
+
},
|
|
167
|
+
"prompt": {
|
|
168
|
+
"system": "# CODE VALIDATOR\n\n## 🚫 YOU ARE A VALIDATOR - READ-ONLY MODE\n\nYour ONLY job is to VALIDATE and OUTPUT JSON.\n- NEVER use Edit, Write, or any file modification tools\n- NEVER fix code - REJECT with errors array instead\n- NEVER create files, modify files, or make commits\n\nSenior engineer code review. Catch REAL bugs, not style preferences.\n\n## WORKFLOW\n1. Read context files (README, CONTRIBUTING, Makefile, package.json, etc.) 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## 🔴 CLEAN DESIGN CHECK (CRITICAL)\nUnless the issue EXPLICITLY requests backwards compatibility, REJECT any of these:\n- Old function/class kept alongside new one (\"deprecated but still works\") → REJECT. Delete old, update ALL callers.\n- Re-exports or wrappers forwarding to new implementation → REJECT. Update imports at call sites.\n- `_unused` parameter renames to preserve old signatures → REJECT. Change the signature, update callers.\n- Fallback paths handling \"old format\" or \"legacy data\" → REJECT. Migrate the data, remove the fallback.\n- Comments like \"kept for backwards compatibility\" → REJECT. Remove the old code.\n- Feature flags toggling between old and new behavior → REJECT. Ship the new behavior. Delete the old.\n\nThe CLEAN solution: delete the old, update all callers, ship only the current implementation. A senior architect demolishes old scaffolding - they don't leave it standing \"just in case\".\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- Backwards compatibility shims or legacy wrappers (see CLEAN DESIGN CHECK)\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."
|
|
169
|
+
},
|
|
170
|
+
"contextStrategy": {
|
|
171
|
+
"sources": [
|
|
172
|
+
{
|
|
173
|
+
"topic": "ISSUE_OPENED",
|
|
174
|
+
"priority": "required",
|
|
175
|
+
"strategy": "latest",
|
|
176
|
+
"amount": 1
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
"topic": "STATE_SNAPSHOT",
|
|
180
|
+
"priority": "required",
|
|
181
|
+
"strategy": "latest",
|
|
182
|
+
"amount": 1
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
"topic": "PLAN_READY",
|
|
186
|
+
"priority": "required",
|
|
187
|
+
"strategy": "latest",
|
|
188
|
+
"amount": 1
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
"topic": "IMPLEMENTATION_READY",
|
|
192
|
+
"priority": "high",
|
|
193
|
+
"since": "last_agent_start",
|
|
194
|
+
"strategy": "latest",
|
|
195
|
+
"amount": 1
|
|
196
|
+
}
|
|
197
|
+
],
|
|
198
|
+
"format": "chronological",
|
|
199
|
+
"maxTokens": "{{max_tokens}}"
|
|
200
|
+
},
|
|
201
|
+
"triggers": [
|
|
202
|
+
{
|
|
203
|
+
"topic": "IMPLEMENTATION_READY",
|
|
204
|
+
"action": "execute_task"
|
|
205
|
+
}
|
|
206
|
+
],
|
|
207
|
+
"hooks": {
|
|
208
|
+
"onComplete": {
|
|
209
|
+
"action": "publish_message",
|
|
210
|
+
"config": {
|
|
211
|
+
"topic": "QUICK_VALIDATION_RESULT",
|
|
212
|
+
"content": {
|
|
213
|
+
"text": "{{result.summary}}",
|
|
214
|
+
"data": {
|
|
215
|
+
"approved": "{{result.approved}}",
|
|
216
|
+
"errors": "{{result.errors}}",
|
|
217
|
+
"validatorId": "validator-code"
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
"id": "consensus-coordinator",
|
|
226
|
+
"role": "coordinator",
|
|
227
|
+
"modelLevel": "level1",
|
|
228
|
+
"timeout": "{{timeout}}",
|
|
229
|
+
"outputFormat": "json",
|
|
230
|
+
"jsonSchema": {
|
|
231
|
+
"type": "object",
|
|
232
|
+
"properties": {
|
|
233
|
+
"allApproved": {
|
|
234
|
+
"type": "boolean"
|
|
235
|
+
},
|
|
236
|
+
"summary": {
|
|
237
|
+
"type": "string"
|
|
238
|
+
}
|
|
239
|
+
},
|
|
240
|
+
"required": ["allApproved", "summary"]
|
|
241
|
+
},
|
|
242
|
+
"prompt": {
|
|
243
|
+
"system": "Check if both validators approved. Output: {\"allApproved\": boolean, \"summary\": \"<50 chars>\"}"
|
|
244
|
+
},
|
|
245
|
+
"contextStrategy": {
|
|
246
|
+
"sources": [
|
|
247
|
+
{
|
|
248
|
+
"topic": "QUICK_VALIDATION_RESULT",
|
|
249
|
+
"priority": "required",
|
|
250
|
+
"strategy": "latest",
|
|
251
|
+
"amount": 2
|
|
252
|
+
}
|
|
253
|
+
],
|
|
254
|
+
"format": "chronological",
|
|
255
|
+
"maxTokens": "{{max_tokens}}"
|
|
256
|
+
},
|
|
257
|
+
"triggers": [
|
|
258
|
+
{
|
|
259
|
+
"topic": "QUICK_VALIDATION_RESULT",
|
|
260
|
+
"logic": {
|
|
261
|
+
"engine": "javascript",
|
|
262
|
+
"script": "const lastImpl = ledger.findLast({ topic: 'IMPLEMENTATION_READY' }); const since = lastImpl?.timestamp || 0; return helpers.allResponded(['validator-requirements', 'validator-code'], 'QUICK_VALIDATION_RESULT', since);"
|
|
263
|
+
},
|
|
264
|
+
"action": "execute_task"
|
|
265
|
+
}
|
|
266
|
+
],
|
|
267
|
+
"hooks": {
|
|
268
|
+
"onComplete": {
|
|
269
|
+
"action": "publish_message",
|
|
270
|
+
"config": {
|
|
271
|
+
"topic": "QUICK_VALIDATION_PASSED",
|
|
272
|
+
"content": {
|
|
273
|
+
"text": "Stage 1 passed",
|
|
274
|
+
"data": {}
|
|
275
|
+
}
|
|
276
|
+
},
|
|
277
|
+
"logic": {
|
|
278
|
+
"engine": "javascript",
|
|
279
|
+
"script": "if (!result.allApproved) { const validationResults = ledger.query({ topic: 'QUICK_VALIDATION_RESULT' }); return { topic: 'VALIDATION_RESULT', content: { text: 'Stage 1 rejected', data: { approved: false, stage: 'quick', errors: validationResults.flatMap(r => r.content?.data?.errors || []), qualityGates: validationResults.flatMap(r => r.content?.data?.qualityGates || []) } } }; }"
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
]
|
|
285
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
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
|
+
"priority": "required",
|
|
39
|
+
"strategy": "latest",
|
|
40
|
+
"amount": 1
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"topic": "STATE_SNAPSHOT",
|
|
44
|
+
"priority": "required",
|
|
45
|
+
"strategy": "latest",
|
|
46
|
+
"amount": 1
|
|
47
|
+
}
|
|
48
|
+
],
|
|
49
|
+
"format": "chronological",
|
|
50
|
+
"maxTokens": "{{max_tokens}}"
|
|
51
|
+
},
|
|
52
|
+
"triggers": [
|
|
53
|
+
{
|
|
54
|
+
"topic": "ISSUE_OPENED",
|
|
55
|
+
"action": "execute_task"
|
|
56
|
+
}
|
|
57
|
+
],
|
|
58
|
+
"hooks": {
|
|
59
|
+
"onComplete": {
|
|
60
|
+
"action": "publish_message",
|
|
61
|
+
"config": {
|
|
62
|
+
"topic": "CLUSTER_COMPLETE",
|
|
63
|
+
"content": {
|
|
64
|
+
"text": "Task completed."
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
]
|
|
71
|
+
}
|