steroids-api 0.2.7
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/dist/API/src/index.d.ts +10 -0
- package/dist/API/src/index.d.ts.map +1 -0
- package/dist/API/src/index.js +130 -0
- package/dist/API/src/index.js.map +1 -0
- package/dist/API/src/routes/activity.d.ts +7 -0
- package/dist/API/src/routes/activity.d.ts.map +1 -0
- package/dist/API/src/routes/activity.js +252 -0
- package/dist/API/src/routes/activity.js.map +1 -0
- package/dist/API/src/routes/config.d.ts +7 -0
- package/dist/API/src/routes/config.d.ts.map +1 -0
- package/dist/API/src/routes/config.js +521 -0
- package/dist/API/src/routes/config.js.map +1 -0
- package/dist/API/src/routes/health.d.ts +7 -0
- package/dist/API/src/routes/health.d.ts.map +1 -0
- package/dist/API/src/routes/health.js +172 -0
- package/dist/API/src/routes/health.js.map +1 -0
- package/dist/API/src/routes/incidents.d.ts +7 -0
- package/dist/API/src/routes/incidents.d.ts.map +1 -0
- package/dist/API/src/routes/incidents.js +117 -0
- package/dist/API/src/routes/incidents.js.map +1 -0
- package/dist/API/src/routes/projects.d.ts +7 -0
- package/dist/API/src/routes/projects.d.ts.map +1 -0
- package/dist/API/src/routes/projects.js +398 -0
- package/dist/API/src/routes/projects.js.map +1 -0
- package/dist/API/src/routes/runners.d.ts +7 -0
- package/dist/API/src/routes/runners.d.ts.map +1 -0
- package/dist/API/src/routes/runners.js +242 -0
- package/dist/API/src/routes/runners.js.map +1 -0
- package/dist/API/src/routes/tasks.d.ts +7 -0
- package/dist/API/src/routes/tasks.d.ts.map +1 -0
- package/dist/API/src/routes/tasks.js +1007 -0
- package/dist/API/src/routes/tasks.js.map +1 -0
- package/dist/API/src/utils/validation.d.ts +22 -0
- package/dist/API/src/utils/validation.d.ts.map +1 -0
- package/dist/API/src/utils/validation.js +50 -0
- package/dist/API/src/utils/validation.js.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +184 -0
- package/dist/index.js.map +1 -0
- package/dist/routes/activity.d.ts +7 -0
- package/dist/routes/activity.d.ts.map +1 -0
- package/dist/routes/activity.js +252 -0
- package/dist/routes/activity.js.map +1 -0
- package/dist/routes/config.d.ts +7 -0
- package/dist/routes/config.d.ts.map +1 -0
- package/dist/routes/config.js +647 -0
- package/dist/routes/config.js.map +1 -0
- package/dist/routes/credit-alerts.d.ts +2 -0
- package/dist/routes/credit-alerts.d.ts.map +1 -0
- package/dist/routes/credit-alerts.js +97 -0
- package/dist/routes/credit-alerts.js.map +1 -0
- package/dist/routes/health.d.ts +7 -0
- package/dist/routes/health.d.ts.map +1 -0
- package/dist/routes/health.js +200 -0
- package/dist/routes/health.js.map +1 -0
- package/dist/routes/incidents.d.ts +7 -0
- package/dist/routes/incidents.d.ts.map +1 -0
- package/dist/routes/incidents.js +117 -0
- package/dist/routes/incidents.js.map +1 -0
- package/dist/routes/projects.d.ts +7 -0
- package/dist/routes/projects.d.ts.map +1 -0
- package/dist/routes/projects.js +643 -0
- package/dist/routes/projects.js.map +1 -0
- package/dist/routes/runners.d.ts +7 -0
- package/dist/routes/runners.d.ts.map +1 -0
- package/dist/routes/runners.js +299 -0
- package/dist/routes/runners.js.map +1 -0
- package/dist/routes/skills.d.ts +3 -0
- package/dist/routes/skills.d.ts.map +1 -0
- package/dist/routes/skills.js +109 -0
- package/dist/routes/skills.js.map +1 -0
- package/dist/routes/storage.d.ts +7 -0
- package/dist/routes/storage.d.ts.map +1 -0
- package/dist/routes/storage.js +93 -0
- package/dist/routes/storage.js.map +1 -0
- package/dist/routes/tasks.d.ts +7 -0
- package/dist/routes/tasks.d.ts.map +1 -0
- package/dist/routes/tasks.js +1145 -0
- package/dist/routes/tasks.js.map +1 -0
- package/dist/src/cleanup/invocation-logs.d.ts +30 -0
- package/dist/src/cleanup/invocation-logs.d.ts.map +1 -0
- package/dist/src/cleanup/invocation-logs.js +66 -0
- package/dist/src/cleanup/invocation-logs.js.map +1 -0
- package/dist/src/commands/loop-phases.d.ts +11 -0
- package/dist/src/commands/loop-phases.d.ts.map +1 -0
- package/dist/src/commands/loop-phases.js +304 -0
- package/dist/src/commands/loop-phases.js.map +1 -0
- package/dist/src/config/loader.d.ts +160 -0
- package/dist/src/config/loader.d.ts.map +1 -0
- package/dist/src/config/loader.js +276 -0
- package/dist/src/config/loader.js.map +1 -0
- package/dist/src/database/connection.d.ts +35 -0
- package/dist/src/database/connection.d.ts.map +1 -0
- package/dist/src/database/connection.js +197 -0
- package/dist/src/database/connection.js.map +1 -0
- package/dist/src/database/queries.d.ts +220 -0
- package/dist/src/database/queries.d.ts.map +1 -0
- package/dist/src/database/queries.js +589 -0
- package/dist/src/database/queries.js.map +1 -0
- package/dist/src/database/schema.d.ts +8 -0
- package/dist/src/database/schema.d.ts.map +1 -0
- package/dist/src/database/schema.js +184 -0
- package/dist/src/database/schema.js.map +1 -0
- package/dist/src/git/push.d.ts +26 -0
- package/dist/src/git/push.d.ts.map +1 -0
- package/dist/src/git/push.js +91 -0
- package/dist/src/git/push.js.map +1 -0
- package/dist/src/git/status.d.ts +83 -0
- package/dist/src/git/status.d.ts.map +1 -0
- package/dist/src/git/status.js +315 -0
- package/dist/src/git/status.js.map +1 -0
- package/dist/src/health/stuck-task-detector.d.ts +131 -0
- package/dist/src/health/stuck-task-detector.d.ts.map +1 -0
- package/dist/src/health/stuck-task-detector.js +233 -0
- package/dist/src/health/stuck-task-detector.js.map +1 -0
- package/dist/src/health/stuck-task-recovery.d.ts +45 -0
- package/dist/src/health/stuck-task-recovery.d.ts.map +1 -0
- package/dist/src/health/stuck-task-recovery.js +309 -0
- package/dist/src/health/stuck-task-recovery.js.map +1 -0
- package/dist/src/index.d.ts +10 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +130 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/locking/queries.d.ts +116 -0
- package/dist/src/locking/queries.d.ts.map +1 -0
- package/dist/src/locking/queries.js +232 -0
- package/dist/src/locking/queries.js.map +1 -0
- package/dist/src/locking/section-lock.d.ts +74 -0
- package/dist/src/locking/section-lock.d.ts.map +1 -0
- package/dist/src/locking/section-lock.js +196 -0
- package/dist/src/locking/section-lock.js.map +1 -0
- package/dist/src/locking/task-lock.d.ts +92 -0
- package/dist/src/locking/task-lock.d.ts.map +1 -0
- package/dist/src/locking/task-lock.js +233 -0
- package/dist/src/locking/task-lock.js.map +1 -0
- package/dist/src/migrations/index.d.ts +7 -0
- package/dist/src/migrations/index.d.ts.map +1 -0
- package/dist/src/migrations/index.js +9 -0
- package/dist/src/migrations/index.js.map +1 -0
- package/dist/src/migrations/manifest.d.ts +92 -0
- package/dist/src/migrations/manifest.d.ts.map +1 -0
- package/dist/src/migrations/manifest.js +255 -0
- package/dist/src/migrations/manifest.js.map +1 -0
- package/dist/src/migrations/runner.d.ts +84 -0
- package/dist/src/migrations/runner.d.ts.map +1 -0
- package/dist/src/migrations/runner.js +338 -0
- package/dist/src/migrations/runner.js.map +1 -0
- package/dist/src/orchestrator/coder.d.ts +32 -0
- package/dist/src/orchestrator/coder.d.ts.map +1 -0
- package/dist/src/orchestrator/coder.js +170 -0
- package/dist/src/orchestrator/coder.js.map +1 -0
- package/dist/src/orchestrator/coordinator.d.ts +28 -0
- package/dist/src/orchestrator/coordinator.d.ts.map +1 -0
- package/dist/src/orchestrator/coordinator.js +252 -0
- package/dist/src/orchestrator/coordinator.js.map +1 -0
- package/dist/src/orchestrator/fallback-handler.d.ts +24 -0
- package/dist/src/orchestrator/fallback-handler.d.ts.map +1 -0
- package/dist/src/orchestrator/fallback-handler.js +280 -0
- package/dist/src/orchestrator/fallback-handler.js.map +1 -0
- package/dist/src/orchestrator/invoke.d.ts +14 -0
- package/dist/src/orchestrator/invoke.d.ts.map +1 -0
- package/dist/src/orchestrator/invoke.js +76 -0
- package/dist/src/orchestrator/invoke.js.map +1 -0
- package/dist/src/orchestrator/post-coder.d.ts +10 -0
- package/dist/src/orchestrator/post-coder.d.ts.map +1 -0
- package/dist/src/orchestrator/post-coder.js +198 -0
- package/dist/src/orchestrator/post-coder.js.map +1 -0
- package/dist/src/orchestrator/post-reviewer.d.ts +10 -0
- package/dist/src/orchestrator/post-reviewer.d.ts.map +1 -0
- package/dist/src/orchestrator/post-reviewer.js +199 -0
- package/dist/src/orchestrator/post-reviewer.js.map +1 -0
- package/dist/src/orchestrator/reviewer.d.ts +35 -0
- package/dist/src/orchestrator/reviewer.d.ts.map +1 -0
- package/dist/src/orchestrator/reviewer.js +237 -0
- package/dist/src/orchestrator/reviewer.js.map +1 -0
- package/dist/src/orchestrator/schemas.d.ts +10 -0
- package/dist/src/orchestrator/schemas.d.ts.map +1 -0
- package/dist/src/orchestrator/schemas.js +81 -0
- package/dist/src/orchestrator/schemas.js.map +1 -0
- package/dist/src/orchestrator/task-selector.d.ts +102 -0
- package/dist/src/orchestrator/task-selector.d.ts.map +1 -0
- package/dist/src/orchestrator/task-selector.js +326 -0
- package/dist/src/orchestrator/task-selector.js.map +1 -0
- package/dist/src/orchestrator/types.d.ts +74 -0
- package/dist/src/orchestrator/types.d.ts.map +1 -0
- package/dist/src/orchestrator/types.js +5 -0
- package/dist/src/orchestrator/types.js.map +1 -0
- package/dist/src/prompts/coder.d.ts +36 -0
- package/dist/src/prompts/coder.d.ts.map +1 -0
- package/dist/src/prompts/coder.js +303 -0
- package/dist/src/prompts/coder.js.map +1 -0
- package/dist/src/prompts/prompt-helpers.d.ts +51 -0
- package/dist/src/prompts/prompt-helpers.d.ts.map +1 -0
- package/dist/src/prompts/prompt-helpers.js +299 -0
- package/dist/src/prompts/prompt-helpers.js.map +1 -0
- package/dist/src/prompts/reviewer.d.ts +40 -0
- package/dist/src/prompts/reviewer.d.ts.map +1 -0
- package/dist/src/prompts/reviewer.js +416 -0
- package/dist/src/prompts/reviewer.js.map +1 -0
- package/dist/src/providers/claude.d.ts +53 -0
- package/dist/src/providers/claude.d.ts.map +1 -0
- package/dist/src/providers/claude.js +227 -0
- package/dist/src/providers/claude.js.map +1 -0
- package/dist/src/providers/codex.d.ts +53 -0
- package/dist/src/providers/codex.d.ts.map +1 -0
- package/dist/src/providers/codex.js +253 -0
- package/dist/src/providers/codex.js.map +1 -0
- package/dist/src/providers/gemini.d.ts +58 -0
- package/dist/src/providers/gemini.d.ts.map +1 -0
- package/dist/src/providers/gemini.js +240 -0
- package/dist/src/providers/gemini.js.map +1 -0
- package/dist/src/providers/interface.d.ts +185 -0
- package/dist/src/providers/interface.d.ts.map +1 -0
- package/dist/src/providers/interface.js +92 -0
- package/dist/src/providers/interface.js.map +1 -0
- package/dist/src/providers/invocation-logger.d.ts +97 -0
- package/dist/src/providers/invocation-logger.d.ts.map +1 -0
- package/dist/src/providers/invocation-logger.js +378 -0
- package/dist/src/providers/invocation-logger.js.map +1 -0
- package/dist/src/providers/openai.d.ts +53 -0
- package/dist/src/providers/openai.d.ts.map +1 -0
- package/dist/src/providers/openai.js +230 -0
- package/dist/src/providers/openai.js.map +1 -0
- package/dist/src/providers/registry.d.ts +100 -0
- package/dist/src/providers/registry.d.ts.map +1 -0
- package/dist/src/providers/registry.js +170 -0
- package/dist/src/providers/registry.js.map +1 -0
- package/dist/src/routes/activity.d.ts +7 -0
- package/dist/src/routes/activity.d.ts.map +1 -0
- package/dist/src/routes/activity.js +252 -0
- package/dist/src/routes/activity.js.map +1 -0
- package/dist/src/routes/config.d.ts +7 -0
- package/dist/src/routes/config.d.ts.map +1 -0
- package/dist/src/routes/config.js +521 -0
- package/dist/src/routes/config.js.map +1 -0
- package/dist/src/routes/health.d.ts +7 -0
- package/dist/src/routes/health.d.ts.map +1 -0
- package/dist/src/routes/health.js +172 -0
- package/dist/src/routes/health.js.map +1 -0
- package/dist/src/routes/incidents.d.ts +7 -0
- package/dist/src/routes/incidents.d.ts.map +1 -0
- package/dist/src/routes/incidents.js +117 -0
- package/dist/src/routes/incidents.js.map +1 -0
- package/dist/src/routes/projects.d.ts +7 -0
- package/dist/src/routes/projects.d.ts.map +1 -0
- package/dist/src/routes/projects.js +398 -0
- package/dist/src/routes/projects.js.map +1 -0
- package/dist/src/routes/runners.d.ts +7 -0
- package/dist/src/routes/runners.d.ts.map +1 -0
- package/dist/src/routes/runners.js +242 -0
- package/dist/src/routes/runners.js.map +1 -0
- package/dist/src/routes/tasks.d.ts +7 -0
- package/dist/src/routes/tasks.d.ts.map +1 -0
- package/dist/src/routes/tasks.js +1007 -0
- package/dist/src/routes/tasks.js.map +1 -0
- package/dist/src/runners/activity-log.d.ts +65 -0
- package/dist/src/runners/activity-log.d.ts.map +1 -0
- package/dist/src/runners/activity-log.js +140 -0
- package/dist/src/runners/activity-log.js.map +1 -0
- package/dist/src/runners/cron.d.ts +30 -0
- package/dist/src/runners/cron.d.ts.map +1 -0
- package/dist/src/runners/cron.js +333 -0
- package/dist/src/runners/cron.js.map +1 -0
- package/dist/src/runners/daemon.d.ts +71 -0
- package/dist/src/runners/daemon.d.ts.map +1 -0
- package/dist/src/runners/daemon.js +233 -0
- package/dist/src/runners/daemon.js.map +1 -0
- package/dist/src/runners/global-db.d.ts +31 -0
- package/dist/src/runners/global-db.d.ts.map +1 -0
- package/dist/src/runners/global-db.js +220 -0
- package/dist/src/runners/global-db.js.map +1 -0
- package/dist/src/runners/hang-detector.d.ts +38 -0
- package/dist/src/runners/hang-detector.d.ts.map +1 -0
- package/dist/src/runners/hang-detector.js +130 -0
- package/dist/src/runners/hang-detector.js.map +1 -0
- package/dist/src/runners/heartbeat.d.ts +39 -0
- package/dist/src/runners/heartbeat.d.ts.map +1 -0
- package/dist/src/runners/heartbeat.js +71 -0
- package/dist/src/runners/heartbeat.js.map +1 -0
- package/dist/src/runners/lock.d.ts +47 -0
- package/dist/src/runners/lock.d.ts.map +1 -0
- package/dist/src/runners/lock.js +140 -0
- package/dist/src/runners/lock.js.map +1 -0
- package/dist/src/runners/orchestrator-loop.d.ts +20 -0
- package/dist/src/runners/orchestrator-loop.d.ts.map +1 -0
- package/dist/src/runners/orchestrator-loop.js +208 -0
- package/dist/src/runners/orchestrator-loop.js.map +1 -0
- package/dist/src/runners/projects.d.ts +96 -0
- package/dist/src/runners/projects.d.ts.map +1 -0
- package/dist/src/runners/projects.js +243 -0
- package/dist/src/runners/projects.js.map +1 -0
- package/dist/src/runners/wakeup.d.ts +37 -0
- package/dist/src/runners/wakeup.d.ts.map +1 -0
- package/dist/src/runners/wakeup.js +355 -0
- package/dist/src/runners/wakeup.js.map +1 -0
- package/dist/src/utils/validation.d.ts +22 -0
- package/dist/src/utils/validation.d.ts.map +1 -0
- package/dist/src/utils/validation.js +50 -0
- package/dist/src/utils/validation.js.map +1 -0
- package/dist/utils/sqlite.d.ts +17 -0
- package/dist/utils/sqlite.d.ts.map +1 -0
- package/dist/utils/sqlite.js +27 -0
- package/dist/utils/sqlite.js.map +1 -0
- package/dist/utils/storage-cache.d.ts +33 -0
- package/dist/utils/storage-cache.d.ts.map +1 -0
- package/dist/utils/storage-cache.js +81 -0
- package/dist/utils/storage-cache.js.map +1 -0
- package/dist/utils/validation.d.ts +22 -0
- package/dist/utils/validation.d.ts.map +1 -0
- package/dist/utils/validation.js +51 -0
- package/dist/utils/validation.js.map +1 -0
- package/package.json +39 -0
- package/src/index.ts +199 -0
- package/src/routes/activity.ts +302 -0
- package/src/routes/config.ts +723 -0
- package/src/routes/credit-alerts.ts +73 -0
- package/src/routes/health.ts +219 -0
- package/src/routes/incidents.ts +131 -0
- package/src/routes/projects.ts +854 -0
- package/src/routes/runners.ts +357 -0
- package/src/routes/skills.ts +127 -0
- package/src/routes/storage.ts +108 -0
- package/src/routes/tasks.ts +1372 -0
- package/src/utils/sqlite.ts +36 -0
- package/src/utils/storage-cache.ts +107 -0
- package/src/utils/validation.ts +61 -0
- package/tsconfig.json +20 -0
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Post-Reviewer Orchestrator
|
|
3
|
+
* Analyzes reviewer output and decides task outcome
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Generate post-reviewer orchestrator prompt
|
|
7
|
+
*/
|
|
8
|
+
export function buildPostReviewerPrompt(context) {
|
|
9
|
+
const { task, reviewer_output: { stdout, stderr, exit_code, timed_out, duration_ms }, git_context: { commit_sha, files_changed, additions, deletions } } = context;
|
|
10
|
+
const duration_seconds = (duration_ms / 1000).toFixed(1);
|
|
11
|
+
const stdout_tail = stdout.slice(-2000);
|
|
12
|
+
const stderr_tail = stderr.slice(-2000);
|
|
13
|
+
let stderrSection = '';
|
|
14
|
+
if (stderr) {
|
|
15
|
+
stderrSection = `
|
|
16
|
+
**Errors:**
|
|
17
|
+
\`\`\`
|
|
18
|
+
${stderr_tail}
|
|
19
|
+
\`\`\`
|
|
20
|
+
`;
|
|
21
|
+
}
|
|
22
|
+
return `# POST-REVIEWER ORCHESTRATOR
|
|
23
|
+
|
|
24
|
+
You are a state machine that analyzes reviewer output and determines the next action.
|
|
25
|
+
|
|
26
|
+
**CRITICAL: You MUST respond ONLY with valid JSON. No markdown, no other text.**
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## Task Context
|
|
31
|
+
|
|
32
|
+
**Task ID:** ${task.id}
|
|
33
|
+
**Task Title:** ${task.title}
|
|
34
|
+
**Rejection Count:** ${task.rejection_count}/15
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## Reviewer Execution
|
|
39
|
+
|
|
40
|
+
**Exit Code:** ${exit_code}
|
|
41
|
+
**Timed Out:** ${timed_out}
|
|
42
|
+
**Duration:** ${duration_seconds}s
|
|
43
|
+
|
|
44
|
+
**Output (last 2000 chars):**
|
|
45
|
+
\`\`\`
|
|
46
|
+
${stdout_tail}
|
|
47
|
+
\`\`\`
|
|
48
|
+
${stderrSection}
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## Git Diff
|
|
52
|
+
|
|
53
|
+
**Commit:** ${commit_sha}
|
|
54
|
+
**Files Changed:** ${files_changed.length}
|
|
55
|
+
**Lines:** +${additions} -${deletions}
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
## Decision Rules
|
|
60
|
+
|
|
61
|
+
### 1. Clear Approval
|
|
62
|
+
- Output contains "APPROVE" / "LGTM" / "looks good" → \`approve\`
|
|
63
|
+
- Exit 0 + positive language + no rejection phrases → \`approve\`
|
|
64
|
+
|
|
65
|
+
### 2. Clear Rejection
|
|
66
|
+
- Output contains "REJECT" / "needs work" / "issues found" → \`reject\`
|
|
67
|
+
- Output lists specific problems/feedback → \`reject\`
|
|
68
|
+
|
|
69
|
+
### 3. Dispute
|
|
70
|
+
- Output contains "DISPUTE" / "fundamental disagreement" → \`dispute\`
|
|
71
|
+
- Rejection count >= 10 AND same issue repeated → \`dispute\`
|
|
72
|
+
- Output mentions "out of scope" / "architectural disagreement" → \`dispute\`
|
|
73
|
+
|
|
74
|
+
### 4. Skip
|
|
75
|
+
- Output contains "SKIP" / "external setup required" → \`skip\`
|
|
76
|
+
- Output says "nothing to review" / "no code changes needed" → \`skip\`
|
|
77
|
+
|
|
78
|
+
### 5. Unclear
|
|
79
|
+
- Exit 0 but no clear decision words → \`unclear\`
|
|
80
|
+
- Timeout → \`unclear\`
|
|
81
|
+
- Stderr has errors → \`unclear\`
|
|
82
|
+
|
|
83
|
+
### 6. Rejection Threshold
|
|
84
|
+
- Rejection count = 15 → automatically \`dispute\` (prevent infinite loops)
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
## Output Format (JSON ONLY)
|
|
89
|
+
|
|
90
|
+
\`\`\`json
|
|
91
|
+
{
|
|
92
|
+
"decision": "approve" | "reject" | "dispute" | "skip" | "unclear",
|
|
93
|
+
"reasoning": "One sentence why (max 100 chars)",
|
|
94
|
+
"notes": "Feedback for coder (required if reject)",
|
|
95
|
+
"next_status": "completed" | "in_progress" | "disputed" | "skipped" | "review",
|
|
96
|
+
"metadata": {
|
|
97
|
+
"rejection_count": 0,
|
|
98
|
+
"confidence": "high" | "medium" | "low",
|
|
99
|
+
"push_to_remote": false,
|
|
100
|
+
"repeated_issue": false
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
\`\`\`
|
|
104
|
+
|
|
105
|
+
### Field Rules
|
|
106
|
+
|
|
107
|
+
**decision:**
|
|
108
|
+
- \`approve\` → Work meets requirements, task complete
|
|
109
|
+
- \`reject\` → Issues found, send back to coder
|
|
110
|
+
- \`dispute\` → Fundamental disagreement or hit limit, needs human
|
|
111
|
+
- \`skip\` → Task requires external work, no code needed
|
|
112
|
+
- \`unclear\` → Couldn't determine decision, retry review
|
|
113
|
+
|
|
114
|
+
**next_status:**
|
|
115
|
+
- \`completed\` for approve
|
|
116
|
+
- \`in_progress\` for reject
|
|
117
|
+
- \`disputed\` for dispute
|
|
118
|
+
- \`skipped\` for skip
|
|
119
|
+
- \`review\` for unclear
|
|
120
|
+
|
|
121
|
+
**notes:** Required if reject (specific feedback for coder)
|
|
122
|
+
|
|
123
|
+
**metadata.push_to_remote:**
|
|
124
|
+
- \`true\` for approve, dispute, skip
|
|
125
|
+
- \`false\` for reject, unclear
|
|
126
|
+
|
|
127
|
+
---
|
|
128
|
+
|
|
129
|
+
## Examples
|
|
130
|
+
|
|
131
|
+
### Example 1: Approval
|
|
132
|
+
\`\`\`json
|
|
133
|
+
{
|
|
134
|
+
"decision": "approve",
|
|
135
|
+
"reasoning": "Explicit approval signal",
|
|
136
|
+
"notes": "Implementation meets all requirements",
|
|
137
|
+
"next_status": "completed",
|
|
138
|
+
"metadata": {
|
|
139
|
+
"rejection_count": 0,
|
|
140
|
+
"confidence": "high",
|
|
141
|
+
"push_to_remote": true,
|
|
142
|
+
"repeated_issue": false
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
\`\`\`
|
|
146
|
+
|
|
147
|
+
### Example 2: Rejection
|
|
148
|
+
\`\`\`json
|
|
149
|
+
{
|
|
150
|
+
"decision": "reject",
|
|
151
|
+
"reasoning": "Specific issues identified",
|
|
152
|
+
"notes": "1. Add error handling in parseConfig(). 2. Missing test for edge case. 3. Fix type error on line 42.",
|
|
153
|
+
"next_status": "in_progress",
|
|
154
|
+
"metadata": {
|
|
155
|
+
"rejection_count": 1,
|
|
156
|
+
"confidence": "high",
|
|
157
|
+
"push_to_remote": false,
|
|
158
|
+
"repeated_issue": false
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
\`\`\`
|
|
162
|
+
|
|
163
|
+
### Example 3: Dispute (Repeated)
|
|
164
|
+
\`\`\`json
|
|
165
|
+
{
|
|
166
|
+
"decision": "dispute",
|
|
167
|
+
"reasoning": "Same issue repeated 4 times, hitting limit",
|
|
168
|
+
"notes": "Reviewer demanding global test coverage outside task scope. Human decision needed.",
|
|
169
|
+
"next_status": "disputed",
|
|
170
|
+
"metadata": {
|
|
171
|
+
"rejection_count": 11,
|
|
172
|
+
"confidence": "high",
|
|
173
|
+
"push_to_remote": true,
|
|
174
|
+
"repeated_issue": true
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
\`\`\`
|
|
178
|
+
|
|
179
|
+
### Example 4: Unclear
|
|
180
|
+
\`\`\`json
|
|
181
|
+
{
|
|
182
|
+
"decision": "unclear",
|
|
183
|
+
"reasoning": "No decision statement in output",
|
|
184
|
+
"notes": "Reviewer did not complete analysis",
|
|
185
|
+
"next_status": "review",
|
|
186
|
+
"metadata": {
|
|
187
|
+
"rejection_count": 2,
|
|
188
|
+
"confidence": "low",
|
|
189
|
+
"push_to_remote": false,
|
|
190
|
+
"repeated_issue": false
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
\`\`\`
|
|
194
|
+
|
|
195
|
+
---
|
|
196
|
+
|
|
197
|
+
Analyze the context above and respond with JSON:`;
|
|
198
|
+
}
|
|
199
|
+
//# sourceMappingURL=post-reviewer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"post-reviewer.js","sourceRoot":"","sources":["../../../../src/orchestrator/post-reviewer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH;;GAEG;AACH,MAAM,UAAU,uBAAuB,CAAC,OAAwB;IAC9D,MAAM,EACJ,IAAI,EACJ,eAAe,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,EACtE,WAAW,EAAE,EAAE,UAAU,EAAE,aAAa,EAAE,SAAS,EAAE,SAAS,EAAE,EACjE,GAAG,OAAO,CAAC;IAEZ,MAAM,gBAAgB,GAAG,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IACzD,MAAM,WAAW,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC;IACxC,MAAM,WAAW,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC;IAExC,IAAI,aAAa,GAAG,EAAE,CAAC;IACvB,IAAI,MAAM,EAAE,CAAC;QACX,aAAa,GAAG;;;EAGlB,WAAW;;CAEZ,CAAC;IACA,CAAC;IAED,OAAO;;;;;;;;;;eAUM,IAAI,CAAC,EAAE;kBACJ,IAAI,CAAC,KAAK;uBACL,IAAI,CAAC,eAAe;;;;;;iBAM1B,SAAS;iBACT,SAAS;gBACV,gBAAgB;;;;EAI9B,WAAW;;EAEX,aAAa;;;;;cAKD,UAAU;qBACH,aAAa,CAAC,MAAM;cAC3B,SAAS,KAAK,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iDA8IY,CAAC;AAClD,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reviewer invocation
|
|
3
|
+
* Uses AI provider system for flexible LLM support
|
|
4
|
+
*/
|
|
5
|
+
import type { Task } from '../database/queries.js';
|
|
6
|
+
export interface ReviewerResult {
|
|
7
|
+
success: boolean;
|
|
8
|
+
exitCode: number;
|
|
9
|
+
stdout: string;
|
|
10
|
+
stderr: string;
|
|
11
|
+
duration: number;
|
|
12
|
+
timedOut: boolean;
|
|
13
|
+
decision?: 'approve' | 'reject' | 'dispute';
|
|
14
|
+
notes?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface BatchReviewerResult {
|
|
17
|
+
success: boolean;
|
|
18
|
+
exitCode: number;
|
|
19
|
+
stdout: string;
|
|
20
|
+
stderr: string;
|
|
21
|
+
duration: number;
|
|
22
|
+
timedOut: boolean;
|
|
23
|
+
taskCount: number;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Invoke reviewer for a task
|
|
27
|
+
* @param coordinatorGuidance Optional guidance from coordinator after repeated rejections
|
|
28
|
+
* @param coordinatorDecision Optional decision type from coordinator
|
|
29
|
+
*/
|
|
30
|
+
export declare function invokeReviewer(task: Task, projectPath: string, coordinatorGuidance?: string, coordinatorDecision?: string): Promise<ReviewerResult>;
|
|
31
|
+
/**
|
|
32
|
+
* Invoke reviewer for a batch of tasks
|
|
33
|
+
*/
|
|
34
|
+
export declare function invokeReviewerBatch(tasks: Task[], sectionName: string, projectPath: string): Promise<BatchReviewerResult>;
|
|
35
|
+
//# sourceMappingURL=reviewer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reviewer.d.ts","sourceRoot":"","sources":["../../../../src/orchestrator/reviewer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAqBnD,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,SAAS,GAAG,QAAQ,GAAG,SAAS,CAAC;IAC5C,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AAiHD;;;;GAIG;AACH,wBAAsB,cAAc,CAClC,IAAI,EAAE,IAAI,EACV,WAAW,EAAE,MAAM,EACnB,mBAAmB,CAAC,EAAE,MAAM,EAC5B,mBAAmB,CAAC,EAAE,MAAM,GAC3B,OAAO,CAAC,cAAc,CAAC,CAsGzB;AAED;;GAEG;AACH,wBAAsB,mBAAmB,CACvC,KAAK,EAAE,IAAI,EAAE,EACb,WAAW,EAAE,MAAM,EACnB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,mBAAmB,CAAC,CA8C9B"}
|
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reviewer invocation
|
|
3
|
+
* Uses AI provider system for flexible LLM support
|
|
4
|
+
*/
|
|
5
|
+
import { writeFileSync, readFileSync, unlinkSync, existsSync } from 'node:fs';
|
|
6
|
+
import { tmpdir } from 'node:os';
|
|
7
|
+
import { join } from 'node:path';
|
|
8
|
+
import { listTasks, getTaskRejections, getLatestSubmissionNotes } from '../database/queries.js';
|
|
9
|
+
import { openDatabase } from '../database/connection.js';
|
|
10
|
+
import { generateReviewerPrompt, generateBatchReviewerPrompt, } from '../prompts/reviewer.js';
|
|
11
|
+
import { getGitDiff, getModifiedFiles, findTaskCommit, getCommitDiff, getCommitFiles, } from '../git/status.js';
|
|
12
|
+
import { loadConfig } from '../config/loader.js';
|
|
13
|
+
import { getProviderRegistry } from '../providers/registry.js';
|
|
14
|
+
import { logInvocation } from '../providers/invocation-logger.js';
|
|
15
|
+
/**
|
|
16
|
+
* Write prompt to temp file
|
|
17
|
+
*/
|
|
18
|
+
function writePromptToTempFile(prompt) {
|
|
19
|
+
const tempPath = join(tmpdir(), `steroids-reviewer-${Date.now()}.txt`);
|
|
20
|
+
writeFileSync(tempPath, prompt, 'utf-8');
|
|
21
|
+
return tempPath;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Parse reviewer output for decision
|
|
25
|
+
*/
|
|
26
|
+
function parseReviewerDecision(output) {
|
|
27
|
+
const upperOutput = output.toUpperCase();
|
|
28
|
+
// Look for explicit decision markers
|
|
29
|
+
if (upperOutput.includes('DECISION: APPROVE') || upperOutput.includes('**APPROVE**') || /\bAPPROVE\b/.test(upperOutput)) {
|
|
30
|
+
// Extract notes if present
|
|
31
|
+
const notesMatch = output.match(/(?:notes?|feedback|comments?):\s*["']?([^"'\n]+)/i);
|
|
32
|
+
return { decision: 'approve', notes: notesMatch?.[1]?.trim() };
|
|
33
|
+
}
|
|
34
|
+
if (upperOutput.includes('DECISION: REJECT') || upperOutput.includes('**REJECT**') || /\bREJECT\b/.test(upperOutput)) {
|
|
35
|
+
// Extract rejection notes
|
|
36
|
+
const notesMatch = output.match(/(?:notes?|reason|feedback|issues?):\s*["']?([^"'\n]+)/i);
|
|
37
|
+
return { decision: 'reject', notes: notesMatch?.[1]?.trim() || 'See reviewer output for details' };
|
|
38
|
+
}
|
|
39
|
+
if (upperOutput.includes('DECISION: DISPUTE') || upperOutput.includes('**DISPUTE**') || /\bDISPUTE\b/.test(upperOutput)) {
|
|
40
|
+
const notesMatch = output.match(/(?:reason|notes?):\s*["']?([^"'\n]+)/i);
|
|
41
|
+
return { decision: 'dispute', notes: notesMatch?.[1]?.trim() };
|
|
42
|
+
}
|
|
43
|
+
return {};
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Invoke AI provider with prompt
|
|
47
|
+
* Uses configuration to determine which provider to use
|
|
48
|
+
*/
|
|
49
|
+
async function invokeProvider(promptFile, timeoutMs = 600_000, // 10 minutes default for reviewer
|
|
50
|
+
taskId, projectPath) {
|
|
51
|
+
// Load configuration to get reviewer provider settings
|
|
52
|
+
// Project config overrides global config
|
|
53
|
+
const config = loadConfig(projectPath);
|
|
54
|
+
const reviewerConfig = config.ai?.reviewer;
|
|
55
|
+
const providerName = reviewerConfig?.provider;
|
|
56
|
+
const modelName = reviewerConfig?.model;
|
|
57
|
+
if (!providerName || !modelName) {
|
|
58
|
+
throw new Error('Reviewer AI provider not configured. Run "steroids config ai reviewer" to configure.');
|
|
59
|
+
}
|
|
60
|
+
// Get the provider from registry
|
|
61
|
+
const registry = getProviderRegistry();
|
|
62
|
+
const provider = registry.get(providerName);
|
|
63
|
+
// Check if provider is available
|
|
64
|
+
if (!(await provider.isAvailable())) {
|
|
65
|
+
throw new Error(`Provider '${providerName}' is not available. ` +
|
|
66
|
+
`Ensure the CLI is installed and in PATH.`);
|
|
67
|
+
}
|
|
68
|
+
// Read prompt content
|
|
69
|
+
const promptContent = readFileSync(promptFile, 'utf-8');
|
|
70
|
+
const result = await logInvocation(promptContent, (ctx) => provider.invoke(promptContent, {
|
|
71
|
+
model: modelName,
|
|
72
|
+
timeout: timeoutMs,
|
|
73
|
+
cwd: process.cwd(),
|
|
74
|
+
promptFile,
|
|
75
|
+
role: 'reviewer',
|
|
76
|
+
streamOutput: true,
|
|
77
|
+
onActivity: ctx?.onActivity,
|
|
78
|
+
}), {
|
|
79
|
+
role: 'reviewer',
|
|
80
|
+
provider: providerName,
|
|
81
|
+
model: modelName,
|
|
82
|
+
taskId,
|
|
83
|
+
projectPath,
|
|
84
|
+
});
|
|
85
|
+
// Parse the decision from output
|
|
86
|
+
const { decision, notes } = parseReviewerDecision(result.stdout);
|
|
87
|
+
return {
|
|
88
|
+
success: result.success,
|
|
89
|
+
exitCode: result.exitCode,
|
|
90
|
+
stdout: result.stdout,
|
|
91
|
+
stderr: result.stderr,
|
|
92
|
+
duration: result.duration,
|
|
93
|
+
timedOut: result.timedOut,
|
|
94
|
+
decision,
|
|
95
|
+
notes,
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Invoke reviewer for a task
|
|
100
|
+
* @param coordinatorGuidance Optional guidance from coordinator after repeated rejections
|
|
101
|
+
* @param coordinatorDecision Optional decision type from coordinator
|
|
102
|
+
*/
|
|
103
|
+
export async function invokeReviewer(task, projectPath, coordinatorGuidance, coordinatorDecision) {
|
|
104
|
+
// Load config to show provider/model being used
|
|
105
|
+
const config = loadConfig(projectPath);
|
|
106
|
+
const reviewerConfig = config.ai?.reviewer;
|
|
107
|
+
console.log(`\n${'='.repeat(60)}`);
|
|
108
|
+
console.log(`REVIEWER: ${task.title}`);
|
|
109
|
+
console.log(`Task ID: ${task.id}`);
|
|
110
|
+
console.log(`Rejection count: ${task.rejection_count}/15`);
|
|
111
|
+
console.log(`Provider: ${reviewerConfig?.provider ?? 'not configured'}`);
|
|
112
|
+
console.log(`Model: ${reviewerConfig?.model ?? 'not configured'}`);
|
|
113
|
+
console.log(`${'='.repeat(60)}\n`);
|
|
114
|
+
// Try to find the specific commit for this task
|
|
115
|
+
let gitDiff;
|
|
116
|
+
let modifiedFiles;
|
|
117
|
+
const commitHash = findTaskCommit(projectPath, task.title);
|
|
118
|
+
if (commitHash) {
|
|
119
|
+
console.log(`Found task commit: ${commitHash}`);
|
|
120
|
+
gitDiff = getCommitDiff(projectPath, commitHash);
|
|
121
|
+
modifiedFiles = getCommitFiles(projectPath, commitHash);
|
|
122
|
+
}
|
|
123
|
+
else {
|
|
124
|
+
// Fallback to HEAD~1 if no matching commit found
|
|
125
|
+
console.log('No matching commit found, using HEAD~1 diff');
|
|
126
|
+
gitDiff = getGitDiff(projectPath, 'HEAD~1');
|
|
127
|
+
modifiedFiles = getModifiedFiles(projectPath);
|
|
128
|
+
}
|
|
129
|
+
// Fetch other tasks in the same section for context
|
|
130
|
+
let sectionTasks = [];
|
|
131
|
+
let rejectionHistory = [];
|
|
132
|
+
let submissionNotes = null;
|
|
133
|
+
try {
|
|
134
|
+
const { db, close } = openDatabase(projectPath);
|
|
135
|
+
// Get section tasks
|
|
136
|
+
if (task.section_id) {
|
|
137
|
+
const allSectionTasks = listTasks(db, { sectionId: task.section_id });
|
|
138
|
+
sectionTasks = allSectionTasks.map(t => ({
|
|
139
|
+
id: t.id,
|
|
140
|
+
title: t.title,
|
|
141
|
+
status: t.status,
|
|
142
|
+
}));
|
|
143
|
+
}
|
|
144
|
+
// Get rejection history - ALWAYS fetch this so reviewer can see past attempts
|
|
145
|
+
rejectionHistory = getTaskRejections(db, task.id);
|
|
146
|
+
if (rejectionHistory.length > 0) {
|
|
147
|
+
console.log(`Found ${rejectionHistory.length} previous rejection(s) for this task`);
|
|
148
|
+
}
|
|
149
|
+
// Get coder's submission notes (if any)
|
|
150
|
+
submissionNotes = getLatestSubmissionNotes(db, task.id);
|
|
151
|
+
if (submissionNotes) {
|
|
152
|
+
console.log(`Coder included notes with submission`);
|
|
153
|
+
}
|
|
154
|
+
close();
|
|
155
|
+
}
|
|
156
|
+
catch (error) {
|
|
157
|
+
console.warn('Could not fetch task context:', error);
|
|
158
|
+
}
|
|
159
|
+
// Reuse config loaded earlier, get reviewer model
|
|
160
|
+
const reviewerModel = reviewerConfig?.model || 'unknown';
|
|
161
|
+
const context = {
|
|
162
|
+
task,
|
|
163
|
+
projectPath,
|
|
164
|
+
reviewerModel,
|
|
165
|
+
gitDiff,
|
|
166
|
+
modifiedFiles,
|
|
167
|
+
sectionTasks,
|
|
168
|
+
rejectionHistory,
|
|
169
|
+
submissionNotes,
|
|
170
|
+
config,
|
|
171
|
+
coordinatorGuidance,
|
|
172
|
+
coordinatorDecision,
|
|
173
|
+
};
|
|
174
|
+
const prompt = generateReviewerPrompt(context);
|
|
175
|
+
// Write prompt to temp file
|
|
176
|
+
const promptFile = writePromptToTempFile(prompt);
|
|
177
|
+
try {
|
|
178
|
+
const result = await invokeProvider(promptFile, 600_000, task.id, projectPath);
|
|
179
|
+
console.log(`\n${'='.repeat(60)}`);
|
|
180
|
+
console.log(`REVIEWER COMPLETED`);
|
|
181
|
+
console.log(`Exit code: ${result.exitCode}`);
|
|
182
|
+
console.log(`Duration: ${(result.duration / 1000).toFixed(1)}s`);
|
|
183
|
+
console.log(`${'='.repeat(60)}\n`);
|
|
184
|
+
return result;
|
|
185
|
+
}
|
|
186
|
+
finally {
|
|
187
|
+
// Clean up temp file
|
|
188
|
+
if (existsSync(promptFile)) {
|
|
189
|
+
unlinkSync(promptFile);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Invoke reviewer for a batch of tasks
|
|
195
|
+
*/
|
|
196
|
+
export async function invokeReviewerBatch(tasks, sectionName, projectPath) {
|
|
197
|
+
// Load config for quality settings and to show provider/model being used
|
|
198
|
+
const config = loadConfig(projectPath);
|
|
199
|
+
const reviewerConfig = config.ai?.reviewer;
|
|
200
|
+
console.log(`\n${'='.repeat(60)}`);
|
|
201
|
+
console.log(`BATCH REVIEWER: Section "${sectionName}"`);
|
|
202
|
+
console.log(`Tasks: ${tasks.length}`);
|
|
203
|
+
tasks.forEach((t, i) => console.log(` ${i + 1}. ${t.title} (${t.id})`));
|
|
204
|
+
console.log(`Provider: ${reviewerConfig?.provider ?? 'not configured'}`);
|
|
205
|
+
console.log(`Model: ${reviewerConfig?.model ?? 'not configured'}`);
|
|
206
|
+
console.log(`${'='.repeat(60)}\n`);
|
|
207
|
+
// Get combined git diff for all tasks (compare against base before batch started)
|
|
208
|
+
// We look for the earliest task's commit and diff from there
|
|
209
|
+
const gitDiff = getGitDiff(projectPath, 'HEAD~' + tasks.length);
|
|
210
|
+
const modifiedFiles = getModifiedFiles(projectPath);
|
|
211
|
+
const context = {
|
|
212
|
+
tasks,
|
|
213
|
+
projectPath,
|
|
214
|
+
sectionName,
|
|
215
|
+
gitDiff,
|
|
216
|
+
modifiedFiles,
|
|
217
|
+
config,
|
|
218
|
+
};
|
|
219
|
+
const prompt = generateBatchReviewerPrompt(context);
|
|
220
|
+
const promptFile = writePromptToTempFile(prompt);
|
|
221
|
+
try {
|
|
222
|
+
// Longer timeout for batch: base 20 minutes + 3 minutes per task
|
|
223
|
+
const timeoutMs = 20 * 60 * 1000 + tasks.length * 3 * 60 * 1000;
|
|
224
|
+
const result = await invokeProvider(promptFile, timeoutMs, undefined, projectPath);
|
|
225
|
+
console.log(`\n${'='.repeat(60)}`);
|
|
226
|
+
console.log(`BATCH REVIEWER COMPLETED`);
|
|
227
|
+
console.log(`Duration: ${(result.duration / 1000).toFixed(1)}s`);
|
|
228
|
+
console.log(`${'='.repeat(60)}\n`);
|
|
229
|
+
return { ...result, taskCount: tasks.length };
|
|
230
|
+
}
|
|
231
|
+
finally {
|
|
232
|
+
if (existsSync(promptFile)) {
|
|
233
|
+
unlinkSync(promptFile);
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
//# sourceMappingURL=reviewer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reviewer.js","sourceRoot":"","sources":["../../../../src/orchestrator/reviewer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC9E,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAChG,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EACL,sBAAsB,EACtB,2BAA2B,GAG5B,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EACL,UAAU,EACV,gBAAgB,EAChB,cAAc,EACd,aAAa,EACb,cAAc,GACf,MAAM,kBAAkB,CAAC;AAC1B,OAAO,E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G,CAAC,0BAA0B,CAAC,CAAC;QACxC,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,MAAM,CAAC,QAAQ,GAAG,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;QACjE,OAAO,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC;QAEnC,OAAO,EAAE,GAAG,MAAM,EAAE,SAAS,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC;IAChD,CAAC;YAAS,CAAC;QACT,IAAI,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;YAC3B,UAAU,CAAC,UAAU,CAAC,CAAC;QACzB,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* JSON schema validation for orchestrator outputs
|
|
3
|
+
*/
|
|
4
|
+
export declare const validateCoderResult: import("ajv").ValidateFunction<{
|
|
5
|
+
[x: string]: {};
|
|
6
|
+
}>;
|
|
7
|
+
export declare const validateReviewerResult: import("ajv").ValidateFunction<{
|
|
8
|
+
[x: string]: {};
|
|
9
|
+
}>;
|
|
10
|
+
//# sourceMappingURL=schemas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../../src/orchestrator/schemas.ts"],"names":[],"mappings":"AAAA;;GAEG;AAgFH,eAAO,MAAM,mBAAmB;;EAA2B,CAAC;AAC5D,eAAO,MAAM,sBAAsB;;EAA8B,CAAC"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* JSON schema validation for orchestrator outputs
|
|
3
|
+
*/
|
|
4
|
+
import Ajv from 'ajv';
|
|
5
|
+
const coderSchema = {
|
|
6
|
+
type: 'object',
|
|
7
|
+
required: ['action', 'reasoning', 'next_status', 'metadata'],
|
|
8
|
+
properties: {
|
|
9
|
+
action: {
|
|
10
|
+
type: 'string',
|
|
11
|
+
enum: ['submit', 'retry', 'stage_commit_submit', 'error']
|
|
12
|
+
},
|
|
13
|
+
reasoning: { type: 'string', minLength: 10, maxLength: 200 },
|
|
14
|
+
commits: {
|
|
15
|
+
oneOf: [
|
|
16
|
+
{ type: 'array', items: { type: 'string' } },
|
|
17
|
+
{ type: 'null' }
|
|
18
|
+
]
|
|
19
|
+
},
|
|
20
|
+
commit_message: {
|
|
21
|
+
oneOf: [
|
|
22
|
+
{ type: 'string', maxLength: 200 },
|
|
23
|
+
{ type: 'null' }
|
|
24
|
+
]
|
|
25
|
+
},
|
|
26
|
+
next_status: {
|
|
27
|
+
type: 'string',
|
|
28
|
+
enum: ['review', 'in_progress', 'failed']
|
|
29
|
+
},
|
|
30
|
+
metadata: {
|
|
31
|
+
type: 'object',
|
|
32
|
+
required: ['files_changed', 'confidence', 'exit_clean', 'has_commits'],
|
|
33
|
+
properties: {
|
|
34
|
+
files_changed: { type: 'number', minimum: 0 },
|
|
35
|
+
confidence: { type: 'string', enum: ['high', 'medium', 'low'] },
|
|
36
|
+
exit_clean: { type: 'boolean' },
|
|
37
|
+
has_commits: { type: 'boolean' }
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
const reviewerSchema = {
|
|
43
|
+
type: 'object',
|
|
44
|
+
required: ['decision', 'reasoning', 'next_status', 'metadata'],
|
|
45
|
+
properties: {
|
|
46
|
+
decision: {
|
|
47
|
+
type: 'string',
|
|
48
|
+
enum: ['approve', 'reject', 'dispute', 'skip', 'unclear']
|
|
49
|
+
},
|
|
50
|
+
reasoning: { type: 'string', minLength: 10, maxLength: 200 },
|
|
51
|
+
notes: {
|
|
52
|
+
oneOf: [
|
|
53
|
+
{ type: 'string', maxLength: 1000 },
|
|
54
|
+
{ type: 'null' }
|
|
55
|
+
]
|
|
56
|
+
},
|
|
57
|
+
next_status: {
|
|
58
|
+
type: 'string',
|
|
59
|
+
enum: ['completed', 'in_progress', 'disputed', 'skipped', 'review']
|
|
60
|
+
},
|
|
61
|
+
metadata: {
|
|
62
|
+
type: 'object',
|
|
63
|
+
required: ['rejection_count', 'confidence', 'push_to_remote'],
|
|
64
|
+
properties: {
|
|
65
|
+
rejection_count: { type: 'number', minimum: 0 },
|
|
66
|
+
confidence: { type: 'string', enum: ['high', 'medium', 'low'] },
|
|
67
|
+
push_to_remote: { type: 'boolean' },
|
|
68
|
+
repeated_issue: {
|
|
69
|
+
oneOf: [
|
|
70
|
+
{ type: 'boolean' },
|
|
71
|
+
{ type: 'null' }
|
|
72
|
+
]
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
const ajv = new Ajv();
|
|
79
|
+
export const validateCoderResult = ajv.compile(coderSchema);
|
|
80
|
+
export const validateReviewerResult = ajv.compile(reviewerSchema);
|
|
81
|
+
//# sourceMappingURL=schemas.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schemas.js","sourceRoot":"","sources":["../../../../src/orchestrator/schemas.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,GAAG,MAAM,KAAK,CAAC;AAEtB,MAAM,WAAW,GAAG;IAClB,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,CAAC,QAAQ,EAAE,WAAW,EAAE,aAAa,EAAE,UAAU,CAAC;IAC5D,UAAU,EAAE;QACV,MAAM,EAAE;YACN,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,CAAC,QAAQ,EAAE,OAAO,EAAE,qBAAqB,EAAE,OAAO,CAAC;SAC1D;QACD,SAAS,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,EAAE,SAAS,EAAE,GAAG,EAAE;QAC5D,OAAO,EAAE;YACP,KAAK,EAAE;gBACL,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;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