steroids-cli 0.10.39 → 0.10.41

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/dist/commands/loop-phases-coder-decision.d.ts +27 -0
  2. package/dist/commands/loop-phases-coder-decision.d.ts.map +1 -0
  3. package/dist/commands/loop-phases-coder-decision.js +246 -0
  4. package/dist/commands/loop-phases-coder-decision.js.map +1 -0
  5. package/dist/commands/loop-phases-coder.d.ts +7 -0
  6. package/dist/commands/loop-phases-coder.d.ts.map +1 -0
  7. package/dist/commands/loop-phases-coder.js +343 -0
  8. package/dist/commands/loop-phases-coder.js.map +1 -0
  9. package/dist/commands/loop-phases-helpers.d.ts +79 -0
  10. package/dist/commands/loop-phases-helpers.d.ts.map +1 -0
  11. package/dist/commands/loop-phases-helpers.js +284 -0
  12. package/dist/commands/loop-phases-helpers.js.map +1 -0
  13. package/dist/commands/loop-phases-reviewer-resolution.d.ts +22 -0
  14. package/dist/commands/loop-phases-reviewer-resolution.d.ts.map +1 -0
  15. package/dist/commands/loop-phases-reviewer-resolution.js +188 -0
  16. package/dist/commands/loop-phases-reviewer-resolution.js.map +1 -0
  17. package/dist/commands/loop-phases-reviewer.d.ts +7 -0
  18. package/dist/commands/loop-phases-reviewer.d.ts.map +1 -0
  19. package/dist/commands/loop-phases-reviewer.js +331 -0
  20. package/dist/commands/loop-phases-reviewer.js.map +1 -0
  21. package/dist/commands/loop-phases.d.ts +13 -19
  22. package/dist/commands/loop-phases.d.ts.map +1 -1
  23. package/dist/commands/loop-phases.js +13 -1283
  24. package/dist/commands/loop-phases.js.map +1 -1
  25. package/dist/orchestrator/coder.d.ts.map +1 -1
  26. package/dist/orchestrator/coder.js +6 -0
  27. package/dist/orchestrator/coder.js.map +1 -1
  28. package/dist/orchestrator/coordinator.d.ts.map +1 -1
  29. package/dist/orchestrator/coordinator.js +2 -1
  30. package/dist/orchestrator/coordinator.js.map +1 -1
  31. package/dist/orchestrator/post-coder.d.ts.map +1 -1
  32. package/dist/orchestrator/post-coder.js +2 -0
  33. package/dist/orchestrator/post-coder.js.map +1 -1
  34. package/dist/orchestrator/post-reviewer.d.ts.map +1 -1
  35. package/dist/orchestrator/post-reviewer.js +9 -4
  36. package/dist/orchestrator/post-reviewer.js.map +1 -1
  37. package/dist/parallel/clone.d.ts.map +1 -1
  38. package/dist/parallel/clone.js +16 -2
  39. package/dist/parallel/clone.js.map +1 -1
  40. package/dist/prompts/coder.d.ts +2 -0
  41. package/dist/prompts/coder.d.ts.map +1 -1
  42. package/dist/prompts/coder.js +28 -11
  43. package/dist/prompts/coder.js.map +1 -1
  44. package/dist/prompts/prompt-helpers.d.ts +4 -2
  45. package/dist/prompts/prompt-helpers.d.ts.map +1 -1
  46. package/dist/prompts/prompt-helpers.js +27 -6
  47. package/dist/prompts/prompt-helpers.js.map +1 -1
  48. package/dist/prompts/reviewer.d.ts.map +1 -1
  49. package/dist/prompts/reviewer.js +9 -4
  50. package/dist/prompts/reviewer.js.map +1 -1
  51. package/dist/runners/heartbeat.d.ts.map +1 -1
  52. package/dist/runners/heartbeat.js +11 -5
  53. package/dist/runners/heartbeat.js.map +1 -1
  54. package/dist/runners/orchestrator-loop.d.ts.map +1 -1
  55. package/dist/runners/orchestrator-loop.js +19 -14
  56. package/dist/runners/orchestrator-loop.js.map +1 -1
  57. package/dist/runners/wakeup.d.ts.map +1 -1
  58. package/dist/runners/wakeup.js +7 -11
  59. package/dist/runners/wakeup.js.map +1 -1
  60. package/dist/workspace/git-lifecycle.d.ts.map +1 -1
  61. package/dist/workspace/git-lifecycle.js +33 -1
  62. package/dist/workspace/git-lifecycle.js.map +1 -1
  63. package/dist/workspace/pool.d.ts +2 -1
  64. package/dist/workspace/pool.d.ts.map +1 -1
  65. package/dist/workspace/pool.js +13 -5
  66. package/dist/workspace/pool.js.map +1 -1
  67. package/package.json +1 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loop-phases-reviewer.d.ts","sourceRoot":"","sources":["../../src/commands/loop-phases-reviewer.ts"],"names":[],"mappings":"AACA,OAAO,EACL,OAAO,EAWR,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAe9D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAIxE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAS7D,OAAO,EACL,iBAAiB,EAIjB,sBAAsB,EAOvB,MAAM,0BAA0B,CAAC;AAyDlC,wBAAsB,gBAAgB,CACpC,EAAE,EAAE,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC,IAAI,CAAC,EACzC,IAAI,EAAE,UAAU,CAAC,OAAO,OAAO,CAAC,EAChC,WAAW,EAAE,MAAM,EACnB,QAAQ,UAAQ,EAChB,iBAAiB,CAAC,EAAE,iBAAiB,EACrC,UAAU,GAAE,MAAe,EAC3B,UAAU,CAAC,EAAE,iBAAiB,EAC9B,eAAe,CAAC,EAAE,eAAe,GAChC,OAAO,CAAC,sBAAsB,GAAG,IAAI,CAAC,CA6VxC"}
@@ -0,0 +1,331 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.runReviewerPhase = runReviewerPhase;
4
+ const queries_js_1 = require("../database/queries.js");
5
+ const reviewer_js_1 = require("../orchestrator/reviewer.js");
6
+ const push_js_1 = require("../git/push.js");
7
+ const status_js_1 = require("../git/status.js");
8
+ const submission_resolution_js_1 = require("../git/submission-resolution.js");
9
+ const loop_phases_reviewer_resolution_js_1 = require("./loop-phases-reviewer-resolution.js");
10
+ const loader_js_1 = require("../config/loader.js");
11
+ const registry_js_1 = require("../providers/registry.js");
12
+ const git_lifecycle_js_1 = require("../workspace/git-lifecycle.js");
13
+ const pool_js_1 = require("../workspace/pool.js");
14
+ const merge_pipeline_js_1 = require("../workspace/merge-pipeline.js");
15
+ const loop_phases_helpers_js_1 = require("./loop-phases-helpers.js");
16
+ /**
17
+ * Create follow-up tasks based on reviewer decision.
18
+ * This is extracted to keep runReviewerPhase under 500 lines.
19
+ */
20
+ async function createFollowUpTasksIfNeeded(db, task, projectPath, followUpTasks, submissionCommitSha, jsonMode) {
21
+ if (!task || !followUpTasks || followUpTasks.length === 0) {
22
+ return;
23
+ }
24
+ const followUpConfig = (0, loader_js_1.loadConfig)(projectPath);
25
+ const depth = (0, queries_js_1.getFollowUpDepth)(db, task.id);
26
+ const maxDepth = followUpConfig.followUpTasks?.maxDepth ?? 2;
27
+ if (depth < maxDepth) {
28
+ for (const followUp of followUpTasks) {
29
+ try {
30
+ const nextDepth = depth + 1;
31
+ // Policy: Auto-implement depth 1 if configured.
32
+ // Depth 2+ always requires human promotion (approval).
33
+ let requiresPromotion = true;
34
+ if (nextDepth === 1 && followUpConfig.followUpTasks?.autoImplementDepth1) {
35
+ requiresPromotion = false;
36
+ }
37
+ const followUpId = (0, queries_js_1.createFollowUpTask)(db, {
38
+ title: followUp.title,
39
+ description: followUp.description,
40
+ sectionId: task.section_id,
41
+ referenceTaskId: task.id,
42
+ referenceCommit: submissionCommitSha,
43
+ requiresPromotion,
44
+ depth: nextDepth,
45
+ });
46
+ if (!jsonMode) {
47
+ const statusLabel = requiresPromotion ? '(deferred)' : '(active)';
48
+ console.log(`\n+ Created follow-up task ${statusLabel}: ${followUp.title} (${followUpId.substring(0, 8)})`);
49
+ }
50
+ }
51
+ catch (error) {
52
+ console.warn(`Failed to create follow-up task "${followUp.title}":`, error);
53
+ }
54
+ }
55
+ }
56
+ else if (!jsonMode) {
57
+ console.log(`\n! Follow-up depth limit reached (${depth}), skipping new follow-ups.`);
58
+ }
59
+ }
60
+ async function runReviewerPhase(db, task, projectPath, jsonMode = false, coordinatorResult, branchName = 'main', leaseFence, poolSlotContext) {
61
+ if (!task)
62
+ return;
63
+ if (!(0, loop_phases_helpers_js_1.refreshParallelWorkstreamLease)(projectPath, leaseFence)) {
64
+ if (!jsonMode) {
65
+ console.log('\n↺ Lease ownership lost before reviewer phase; skipping task in this runner.');
66
+ }
67
+ return;
68
+ }
69
+ // ── Pool slot: set effective path for reviewer ──
70
+ const effectiveProjectPath = poolSlotContext ? poolSlotContext.slot.slot_path : projectPath;
71
+ if (poolSlotContext) {
72
+ (0, pool_js_1.updateSlotStatus)(poolSlotContext.globalDb, poolSlotContext.slot.id, 'review_active');
73
+ }
74
+ const submissionResolution = (0, submission_resolution_js_1.resolveSubmissionCommitWithRecovery)(effectiveProjectPath, (0, queries_js_1.getSubmissionCommitShas)(db, task.id));
75
+ if (submissionResolution.status !== 'resolved') {
76
+ const attemptsText = submissionResolution.attempts.join(' | ') || 'none';
77
+ (0, queries_js_1.updateTaskStatus)(db, task.id, 'in_progress', 'orchestrator', `[commit_recovery] Missing reachable submission hash (${submissionResolution.reason}; attempts: ${attemptsText}). ` +
78
+ `Treating task as resubmission. Coder must output exact line: SUBMISSION_COMMIT: <sha> for the commit that implements the task.`);
79
+ if (!jsonMode) {
80
+ console.log('\n⟳ Reviewer hash missing; returning task to coder for hash resubmission');
81
+ }
82
+ return;
83
+ }
84
+ const submissionCommitSha = submissionResolution.sha;
85
+ const phaseConfig = (0, loader_js_1.loadConfig)(projectPath);
86
+ const multiReviewEnabled = (0, reviewer_js_1.isMultiReviewEnabled)(phaseConfig);
87
+ let effectiveMultiReviewEnabled = multiReviewEnabled;
88
+ let reviewerResult;
89
+ let reviewerResults = [];
90
+ // STEP 1: Invoke reviewer(s)
91
+ if (multiReviewEnabled) {
92
+ const reviewerConfigs = (0, reviewer_js_1.getReviewerConfigs)(phaseConfig);
93
+ if (!jsonMode) {
94
+ console.log(`\n>>> Invoking ${reviewerConfigs.length} REVIEWERS in parallel...\n`);
95
+ if (coordinatorResult) {
96
+ console.log(`Coordinator guidance included (decision: ${coordinatorResult.decision})`);
97
+ }
98
+ }
99
+ const reviewerInvocation = await (0, loop_phases_helpers_js_1.invokeWithLeaseHeartbeat)(projectPath, leaseFence, () => (0, reviewer_js_1.invokeReviewers)(task, effectiveProjectPath, reviewerConfigs, coordinatorResult?.guidance, coordinatorResult?.decision, leaseFence?.runnerId));
100
+ if (reviewerInvocation.superseded || !reviewerInvocation.result) {
101
+ if (!jsonMode) {
102
+ console.log('\n↺ Lease ownership changed during reviewer invocation; skipping post-processing in this runner.');
103
+ }
104
+ return;
105
+ }
106
+ reviewerResults = reviewerInvocation.result;
107
+ const failedReviewerIndex = reviewerResults.findIndex((res) => !res.success || res.timedOut);
108
+ if (failedReviewerIndex !== -1) {
109
+ const failedReviewer = reviewerResults[failedReviewerIndex];
110
+ const failedConfig = reviewerConfigs[failedReviewerIndex];
111
+ const providerName = failedReviewer.provider ??
112
+ failedConfig?.provider ??
113
+ phaseConfig.ai?.reviewer?.provider ??
114
+ 'unknown';
115
+ const modelName = failedReviewer.model ??
116
+ failedConfig?.model ??
117
+ phaseConfig.ai?.reviewer?.model ??
118
+ 'unknown';
119
+ const output = (failedReviewer.stderr || failedReviewer.stdout || '').trim();
120
+ const failed = await (0, loop_phases_helpers_js_1.handleProviderInvocationFailure)(db, task.id, {
121
+ role: 'reviewer',
122
+ provider: providerName,
123
+ model: modelName,
124
+ exitCode: failedReviewer.exitCode ?? 1,
125
+ output,
126
+ }, jsonMode);
127
+ if (failed.shouldStopTask) {
128
+ return;
129
+ }
130
+ return;
131
+ }
132
+ (0, queries_js_1.clearTaskFailureCount)(db, task.id);
133
+ reviewerResult = reviewerResults[0];
134
+ effectiveMultiReviewEnabled = reviewerResults.length > 1;
135
+ }
136
+ else {
137
+ if (!jsonMode) {
138
+ console.log('\n>>> Invoking REVIEWER...\n');
139
+ if (coordinatorResult) {
140
+ console.log(`Coordinator guidance included (decision: ${coordinatorResult.decision})`);
141
+ }
142
+ }
143
+ const reviewerInvocation = await (0, loop_phases_helpers_js_1.invokeWithLeaseHeartbeat)(projectPath, leaseFence, () => (0, reviewer_js_1.invokeReviewer)(task, effectiveProjectPath, coordinatorResult?.guidance, coordinatorResult?.decision, undefined, leaseFence?.runnerId));
144
+ if (reviewerInvocation.superseded || !reviewerInvocation.result) {
145
+ if (!jsonMode) {
146
+ console.log('\n↺ Lease ownership changed during reviewer invocation; skipping post-processing in this runner.');
147
+ }
148
+ return;
149
+ }
150
+ reviewerResult = reviewerInvocation.result;
151
+ if (!reviewerResult.success || reviewerResult.timedOut) {
152
+ const providerName = reviewerResult.provider ??
153
+ phaseConfig.ai?.reviewer?.provider ??
154
+ 'unknown';
155
+ const modelName = reviewerResult.model ??
156
+ phaseConfig.ai?.reviewer?.model ??
157
+ 'unknown';
158
+ // Check for credit/rate_limit exhaustion before provider failure handling
159
+ const registry = await (0, registry_js_1.getProviderRegistry)();
160
+ const prov = registry.tryGet(providerName);
161
+ if (prov) {
162
+ const classified = prov.classifyResult(reviewerResult);
163
+ if (classified?.type === 'credit_exhaustion') {
164
+ return { action: 'pause_credit_exhaustion', provider: providerName, model: modelName, role: 'reviewer', message: classified.message };
165
+ }
166
+ if (classified?.type === 'rate_limit') {
167
+ return { action: 'rate_limit', provider: providerName, model: modelName, role: 'reviewer', message: classified.message, retryAfterMs: classified.retryAfterMs };
168
+ }
169
+ }
170
+ // Non-credit/rate-limit reviewer failure: fall through to orchestrator
171
+ }
172
+ else {
173
+ (0, queries_js_1.clearTaskFailureCount)(db, task.id);
174
+ }
175
+ }
176
+ // STEP 2: Gather git context
177
+ const commit_sha = (0, status_js_1.getCurrentCommitSha)(effectiveProjectPath) || '';
178
+ const files_changed = (0, status_js_1.getModifiedFiles)(effectiveProjectPath);
179
+ const diffStats = (0, status_js_1.getDiffStats)(effectiveProjectPath);
180
+ const gitContext = {
181
+ commit_sha,
182
+ files_changed,
183
+ additions: diffStats.additions,
184
+ deletions: diffStats.deletions,
185
+ };
186
+ // STEP 3: Resolve decision and merge notes if needed
187
+ let decision = await (0, loop_phases_reviewer_resolution_js_1.resolveReviewerDecision)({ id: task.id, title: task.title, rejection_count: task.rejection_count }, projectPath, reviewerResult, reviewerResults, effectiveMultiReviewEnabled, gitContext);
188
+ // STEP 4: Fallback for unclear decisions (catches ALL unclear, not just orchestrator parse failures)
189
+ if (decision.decision === 'unclear') {
190
+ const consecutiveParseFallbackRetries = (0, loop_phases_helpers_js_1.countConsecutiveUnclearEntries)(db, task.id) + 1;
191
+ if (consecutiveParseFallbackRetries >= loop_phases_helpers_js_1.MAX_ORCHESTRATOR_PARSE_RETRIES) {
192
+ decision = {
193
+ ...decision,
194
+ decision: 'dispute',
195
+ reasoning: `Orchestrator parse failed ${consecutiveParseFallbackRetries} times; escalating to dispute`,
196
+ notes: 'Escalated to disputed to prevent endless unclear-review retries',
197
+ next_status: 'disputed',
198
+ confidence: 'low',
199
+ push_to_remote: false,
200
+ };
201
+ }
202
+ else {
203
+ decision = {
204
+ ...decision,
205
+ reasoning: `${decision.reasoning} (parse_retry ${consecutiveParseFallbackRetries}/${loop_phases_helpers_js_1.MAX_ORCHESTRATOR_PARSE_RETRIES})`,
206
+ };
207
+ }
208
+ }
209
+ // STEP 5: Log orchestrator decision for audit trail (non-transition row).
210
+ // Concrete status transitions are recorded by approve/reject/update calls below.
211
+ (0, queries_js_1.addAuditEntry)(db, task.id, task.status, task.status, 'orchestrator', {
212
+ actorType: 'orchestrator',
213
+ notes: `[${decision.decision}] ${decision.reasoning} (confidence: ${decision.confidence})`,
214
+ category: 'decision',
215
+ });
216
+ if (!(0, loop_phases_helpers_js_1.refreshParallelWorkstreamLease)(projectPath, leaseFence)) {
217
+ if (!jsonMode) {
218
+ console.log('\n↺ Lease ownership changed before applying reviewer decision; skipping in this runner.');
219
+ }
220
+ return;
221
+ }
222
+ // STEP 5.5: Create follow-up tasks if any (ONLY on approval)
223
+ await createFollowUpTasksIfNeeded(db, task, projectPath, decision.follow_up_tasks, submissionCommitSha, jsonMode);
224
+ // STEP 6: Execute the decision
225
+ const commitSha = submissionCommitSha;
226
+ switch (decision.decision) {
227
+ case 'approve':
228
+ if (poolSlotContext) {
229
+ // ── Pool slot: post-review gate + merge pipeline ──
230
+ (0, git_lifecycle_js_1.postReviewGate)(effectiveProjectPath);
231
+ // Refresh slot from DB before merge
232
+ const freshSlot = (0, pool_js_1.getSlot)(poolSlotContext.globalDb, poolSlotContext.slot.id);
233
+ if (!freshSlot) {
234
+ if (!jsonMode)
235
+ console.log('\n✗ Pool slot disappeared during review');
236
+ return;
237
+ }
238
+ const mergeResult = (0, git_lifecycle_js_1.mergeToBase)(poolSlotContext.globalDb, freshSlot, task.id);
239
+ if (!mergeResult.ok) {
240
+ const failureResult = (0, merge_pipeline_js_1.handleMergeFailure)(db, poolSlotContext, task.id, mergeResult);
241
+ if (!jsonMode) {
242
+ if (failureResult.taskBlocked) {
243
+ console.log(`\n✗ Task BLOCKED (${failureResult.blockStatus}): ${failureResult.reason}`);
244
+ }
245
+ else {
246
+ console.log(`\n⟳ Merge failed, returning to pending: ${failureResult.reason}`);
247
+ }
248
+ }
249
+ return;
250
+ }
251
+ // Merge succeeded — approve the task
252
+ (0, queries_js_1.approveTask)(db, task.id, 'orchestrator', decision.notes, mergeResult.mergedSha || commitSha);
253
+ (0, pool_js_1.releaseSlot)(poolSlotContext.globalDb, poolSlotContext.slot.id);
254
+ if (!jsonMode) {
255
+ console.log(`\n✓ Task APPROVED and merged (sha: ${mergeResult.mergedSha})`);
256
+ }
257
+ }
258
+ else {
259
+ // Legacy path: direct push
260
+ (0, queries_js_1.approveTask)(db, task.id, 'orchestrator', decision.notes, commitSha);
261
+ if (!jsonMode) {
262
+ console.log(`\n✓ Task APPROVED (confidence: ${decision.confidence})`);
263
+ console.log('Pushing to git...');
264
+ }
265
+ if (!(0, loop_phases_helpers_js_1.refreshParallelWorkstreamLease)(projectPath, leaseFence)) {
266
+ if (!jsonMode) {
267
+ console.log('\n↺ Lease ownership lost before review push; skipping push in this runner.');
268
+ }
269
+ return;
270
+ }
271
+ const pushResult = (0, push_js_1.pushToRemote)(effectiveProjectPath, 'origin', branchName);
272
+ if (!jsonMode && pushResult.success) {
273
+ console.log(`Pushed successfully (${pushResult.commitHash})`);
274
+ }
275
+ else if (!jsonMode) {
276
+ console.warn('Push failed. Will stack and retry on next completion.');
277
+ }
278
+ }
279
+ break;
280
+ case 'reject': {
281
+ // Deterministically extract [OUT_OF_SCOPE] items from raw reviewer stdout.
282
+ // The post-reviewer LLM may rephrase or drop structured tags, so we preserve
283
+ // them here before they are lost. Only append if not already present.
284
+ const allReviewerStdout = effectiveMultiReviewEnabled
285
+ ? (reviewerResults ?? []).map(r => r?.stdout ?? '').join('\n')
286
+ : (reviewerResult?.stdout ?? '');
287
+ const outOfScopeItems = (0, loop_phases_helpers_js_1.extractOutOfScopeItems)(allReviewerStdout);
288
+ if (outOfScopeItems.length > 0 && !(decision.notes ?? '').toLowerCase().includes('[out_of_scope]')) {
289
+ decision = {
290
+ ...decision,
291
+ notes: `${decision.notes ?? ''}\n\n## Out-of-Scope Items (from reviewer)\n${outOfScopeItems.join('\n')}`
292
+ };
293
+ }
294
+ (0, queries_js_1.rejectTask)(db, task.id, 'orchestrator', decision.notes, commitSha);
295
+ if (!jsonMode) {
296
+ console.log(`\n✗ Task REJECTED (${task.rejection_count + 1}/15, confidence: ${decision.confidence})`);
297
+ console.log('Returning to coder for fixes.');
298
+ }
299
+ break;
300
+ }
301
+ case 'dispute':
302
+ (0, queries_js_1.updateTaskStatus)(db, task.id, 'disputed', 'orchestrator', decision.notes, commitSha);
303
+ if (!jsonMode) {
304
+ console.log(`\n! Task DISPUTED (confidence: ${decision.confidence})`);
305
+ console.log('Pushing current work and moving to next task.');
306
+ }
307
+ if (!(0, loop_phases_helpers_js_1.refreshParallelWorkstreamLease)(projectPath, leaseFence)) {
308
+ if (!jsonMode) {
309
+ console.log('\n↺ Lease ownership lost before dispute push; skipping push in this runner.');
310
+ }
311
+ return;
312
+ }
313
+ const disputePush = (0, push_js_1.pushToRemote)(effectiveProjectPath, 'origin', branchName);
314
+ if (!jsonMode && disputePush.success) {
315
+ console.log(`Pushed disputed work (${disputePush.commitHash})`);
316
+ }
317
+ break;
318
+ case 'skip':
319
+ (0, queries_js_1.updateTaskStatus)(db, task.id, 'skipped', 'orchestrator', decision.notes, commitSha);
320
+ if (!jsonMode) {
321
+ console.log(`\n⏭ Task SKIPPED (confidence: ${decision.confidence})`);
322
+ }
323
+ break;
324
+ case 'unclear':
325
+ if (!jsonMode) {
326
+ console.log(`\n? Review unclear (${decision.reasoning}), will retry`);
327
+ }
328
+ break;
329
+ }
330
+ }
331
+ //# sourceMappingURL=loop-phases-reviewer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loop-phases-reviewer.js","sourceRoot":"","sources":["../../src/commands/loop-phases-reviewer.ts"],"names":[],"mappings":";;AA+GA,4CAsWC;AApdD,uDAYgC;AAEhC,6DAMqC;AACrC,4CAA8C;AAC9C,gDAI0B;AAC1B,8EAAsF;AAEtF,6FAA+E;AAC/E,mDAAiD;AACjD,0DAA+D;AAE/D,oEAKuC;AACvC,kDAA8E;AAC9E,sEAAoE;AACpE,qEAYkC;AAElC;;;GAGG;AACH,KAAK,UAAU,2BAA2B,CACxC,EAAyC,EACzC,IAAgC,EAChC,WAAmB,EACnB,aAAwE,EACxE,mBAA2B,EAC3B,QAAiB;IAEjB,IAAI,CAAC,IAAI,IAAI,CAAC,aAAa,IAAI,aAAa,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC1D,OAAO;IACT,CAAC;IAED,MAAM,cAAc,GAAG,IAAA,sBAAU,EAAC,WAAW,CAAC,CAAC;IAC/C,MAAM,KAAK,GAAG,IAAA,6BAAgB,EAAC,EAAE,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC;IAC5C,MAAM,QAAQ,GAAG,cAAc,CAAC,aAAa,EAAE,QAAQ,IAAI,CAAC,CAAC;IAE7D,IAAI,KAAK,GAAG,QAAQ,EAAE,CAAC;QACrB,KAAK,MAAM,QAAQ,IAAI,aAAa,EAAE,CAAC;YACrC,IAAI,CAAC;gBACH,MAAM,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;gBAE5B,gDAAgD;gBAChD,u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CAAC,6EAA6E,CAAC,CAAC;gBAC7F,CAAC;gBACD,OAAO;YACT,CAAC;YACD,MAAM,WAAW,GAAG,IAAA,sBAAY,EAAC,oBAAoB,EAAE,QAAQ,EAAE,UAAU,CAAC,CAAC;YAC7E,IAAI,CAAC,QAAQ,IAAI,WAAW,CAAC,OAAO,EAAE,CAAC;gBACrC,OAAO,CAAC,GAAG,CAAC,yBAAyB,WAAW,CAAC,UAAU,GAAG,CAAC,CAAC;YAClE,CAAC;YACD,MAAM;QAER,KAAK,MAAM;YACT,IAAA,6BAAgB,EAAC,EAAE,EAAE,IAAI,CAAC,EAAE,EAAE,SAAS,EAAE,cAAc,EAAE,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;YACpF,IAAI,CAAC,QAAQ,EAAE,CAAC;gBACd,OAAO,CAAC,GAAG,CAAC,iCAAiC,QAAQ,CAAC,UAAU,GAAG,CAAC,CAAC;YACvE,CAAC;YACD,MAAM;QAER,KAAK,SAAS;YACZ,IAAI,CAAC,QAAQ,EAAE,CAAC;gBACd,OAAO,CAAC,GAAG,CAAC,uBAAuB,QAAQ,CAAC,SAAS,eAAe,CAAC,CAAC;YACxE,CAAC;YACD,MAAM;IACV,CAAC;AACH,CAAC"}
@@ -1,20 +1,14 @@
1
- import { getTask } from '../database/queries.js';
2
- import type { openDatabase } from '../database/connection.js';
3
- import { type CoordinatorResult } from '../orchestrator/coordinator.js';
4
- import type { PoolSlotContext } from '../workspace/types.js';
5
- export { type CoordinatorResult };
6
- interface LeaseFenceContext {
7
- parallelSessionId?: string;
8
- runnerId?: string;
9
- }
10
- export interface CreditExhaustionResult {
11
- action: 'pause_credit_exhaustion' | 'rate_limit';
12
- provider: string;
13
- model: string;
14
- role: 'coder' | 'reviewer';
15
- message: string;
16
- retryAfterMs?: number;
17
- }
18
- export declare function runCoderPhase(db: ReturnType<typeof openDatabase>['db'], task: ReturnType<typeof getTask>, projectPath: string, action: 'start' | 'resume', jsonMode?: boolean, coordinatorCache?: Map<string, CoordinatorResult>, coordinatorThresholds?: number[], leaseFence?: LeaseFenceContext, branchName?: string, poolSlotContext?: PoolSlotContext): Promise<CreditExhaustionResult | void>;
19
- export declare function runReviewerPhase(db: ReturnType<typeof openDatabase>['db'], task: ReturnType<typeof getTask>, projectPath: string, jsonMode?: boolean, coordinatorResult?: CoordinatorResult, branchName?: string, leaseFence?: LeaseFenceContext, poolSlotContext?: PoolSlotContext): Promise<CreditExhaustionResult | void>;
1
+ /**
2
+ * Public API re-exports implementation split across focused modules.
3
+ *
4
+ * loop-phases-helpers.ts — shared types, constants, and utility functions
5
+ * loop-phases-coder.ts — runCoderPhase implementation
6
+ * loop-phases-coder-decision.ts — coordinator invocation + decision execution helpers
7
+ * loop-phases-reviewer.ts — runReviewerPhase implementation
8
+ * loop-phases-reviewer-resolution.ts — reviewer decision resolution helper
9
+ */
10
+ export { runCoderPhase } from './loop-phases-coder.js';
11
+ export { runReviewerPhase } from './loop-phases-reviewer.js';
12
+ export type { CreditExhaustionResult, LeaseFenceContext } from './loop-phases-helpers.js';
13
+ export type { CoordinatorResult } from '../orchestrator/coordinator.js';
20
14
  //# sourceMappingURL=loop-phases.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"loop-phases.d.ts","sourceRoot":"","sources":["../../src/commands/loop-phases.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,OAAO,EAeR,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAU9D,OAAO,EAA8C,KAAK,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAyBpH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAU7D,OAAO,EAAE,KAAK,iBAAiB,EAAE,CAAC;AAElC,UAAU,iBAAiB;IACzB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AA4ED,MAAM,WAAW,sBAAsB;IACrC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