steroids-cli 0.10.40 → 0.10.42
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/commands/loop-phases-coder-decision.d.ts +27 -0
- package/dist/commands/loop-phases-coder-decision.d.ts.map +1 -0
- package/dist/commands/loop-phases-coder-decision.js +246 -0
- package/dist/commands/loop-phases-coder-decision.js.map +1 -0
- package/dist/commands/loop-phases-coder.d.ts +7 -0
- package/dist/commands/loop-phases-coder.d.ts.map +1 -0
- package/dist/commands/loop-phases-coder.js +343 -0
- package/dist/commands/loop-phases-coder.js.map +1 -0
- package/dist/commands/loop-phases-helpers.d.ts +79 -0
- package/dist/commands/loop-phases-helpers.d.ts.map +1 -0
- package/dist/commands/loop-phases-helpers.js +284 -0
- package/dist/commands/loop-phases-helpers.js.map +1 -0
- package/dist/commands/loop-phases-reviewer-resolution.d.ts +22 -0
- package/dist/commands/loop-phases-reviewer-resolution.d.ts.map +1 -0
- package/dist/commands/loop-phases-reviewer-resolution.js +188 -0
- package/dist/commands/loop-phases-reviewer-resolution.js.map +1 -0
- package/dist/commands/loop-phases-reviewer.d.ts +7 -0
- package/dist/commands/loop-phases-reviewer.d.ts.map +1 -0
- package/dist/commands/loop-phases-reviewer.js +331 -0
- package/dist/commands/loop-phases-reviewer.js.map +1 -0
- package/dist/commands/loop-phases.d.ts +13 -19
- package/dist/commands/loop-phases.d.ts.map +1 -1
- package/dist/commands/loop-phases.js +13 -1283
- package/dist/commands/loop-phases.js.map +1 -1
- package/dist/commands/web.d.ts.map +1 -1
- package/dist/commands/web.js +11 -0
- package/dist/commands/web.js.map +1 -1
- package/dist/orchestrator/coder.d.ts.map +1 -1
- package/dist/orchestrator/coder.js +6 -0
- package/dist/orchestrator/coder.js.map +1 -1
- package/dist/orchestrator/coordinator.d.ts.map +1 -1
- package/dist/orchestrator/coordinator.js +2 -1
- package/dist/orchestrator/coordinator.js.map +1 -1
- package/dist/orchestrator/post-coder.d.ts.map +1 -1
- package/dist/orchestrator/post-coder.js +2 -0
- package/dist/orchestrator/post-coder.js.map +1 -1
- package/dist/orchestrator/post-reviewer.d.ts.map +1 -1
- package/dist/orchestrator/post-reviewer.js +9 -4
- package/dist/orchestrator/post-reviewer.js.map +1 -1
- package/dist/parallel/clone.d.ts.map +1 -1
- package/dist/parallel/clone.js +16 -2
- package/dist/parallel/clone.js.map +1 -1
- package/dist/prompts/coder.d.ts +2 -0
- package/dist/prompts/coder.d.ts.map +1 -1
- package/dist/prompts/coder.js +28 -11
- package/dist/prompts/coder.js.map +1 -1
- package/dist/prompts/prompt-helpers.d.ts +4 -2
- package/dist/prompts/prompt-helpers.d.ts.map +1 -1
- package/dist/prompts/prompt-helpers.js +27 -6
- package/dist/prompts/prompt-helpers.js.map +1 -1
- package/dist/prompts/reviewer.d.ts.map +1 -1
- package/dist/prompts/reviewer.js +9 -4
- package/dist/prompts/reviewer.js.map +1 -1
- package/dist/runners/orchestrator-loop.d.ts.map +1 -1
- package/dist/runners/orchestrator-loop.js +19 -14
- package/dist/runners/orchestrator-loop.js.map +1 -1
- package/dist/workspace/git-lifecycle.d.ts.map +1 -1
- package/dist/workspace/git-lifecycle.js +33 -1
- package/dist/workspace/git-lifecycle.js.map +1 -1
- package/dist/workspace/pool.d.ts +2 -1
- package/dist/workspace/pool.d.ts.map +1 -1
- package/dist/workspace/pool.js +13 -5
- package/dist/workspace/pool.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Coder phase decision helpers
|
|
3
|
+
* Extracted from loop-phases-coder.ts to keep that file under 500 lines.
|
|
4
|
+
*/
|
|
5
|
+
import { getTask } from '../database/queries.js';
|
|
6
|
+
import type { openDatabase } from '../database/connection.js';
|
|
7
|
+
import { type CoordinatorResult } from '../orchestrator/coordinator.js';
|
|
8
|
+
import { LeaseFenceContext } from './loop-phases-helpers.js';
|
|
9
|
+
export declare function invokeCoordinatorIfNeeded(db: ReturnType<typeof openDatabase>['db'], task: ReturnType<typeof getTask>, projectPath: string, effectiveProjectPath: string, coordinatorCache?: Map<string, CoordinatorResult>, coordinatorThresholds?: number[], jsonMode?: boolean): Promise<string | undefined>;
|
|
10
|
+
export interface CoderExecutionContext {
|
|
11
|
+
coderStdout: string;
|
|
12
|
+
has_uncommitted: boolean;
|
|
13
|
+
requiresExplicitSubmissionCommit: boolean;
|
|
14
|
+
effectiveProjectPath: string;
|
|
15
|
+
projectPath: string;
|
|
16
|
+
branchName: string;
|
|
17
|
+
leaseFence?: LeaseFenceContext;
|
|
18
|
+
jsonMode: boolean;
|
|
19
|
+
}
|
|
20
|
+
export interface CoderDecision {
|
|
21
|
+
action: 'submit' | 'stage_commit_submit' | 'retry' | 'error';
|
|
22
|
+
reasoning: string;
|
|
23
|
+
confidence?: string;
|
|
24
|
+
commit_message?: string;
|
|
25
|
+
}
|
|
26
|
+
export declare function executeCoderDecision(db: ReturnType<typeof openDatabase>['db'], task: ReturnType<typeof getTask>, decision: CoderDecision, ctx: CoderExecutionContext): Promise<void>;
|
|
27
|
+
//# sourceMappingURL=loop-phases-coder-decision.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loop-phases-coder-decision.d.ts","sourceRoot":"","sources":["../../src/commands/loop-phases-coder-decision.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EACL,OAAO,EAOR,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAGL,KAAK,iBAAiB,EACvB,MAAM,gCAAgC,CAAC;AAOxC,OAAO,EACL,iBAAiB,EAIlB,MAAM,0BAA0B,CAAC;AAIlC,wBAAsB,yBAAyB,CAC7C,EAAE,EAAE,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC,IAAI,CAAC,EACzC,IAAI,EAAE,UAAU,CAAC,OAAO,OAAO,CAAC,EAChC,WAAW,EAAE,MAAM,EACnB,oBAAoB,EAAE,MAAM,EAC5B,gBAAgB,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,iBAAiB,CAAC,EACjD,qBAAqB,CAAC,EAAE,MAAM,EAAE,EAChC,QAAQ,UAAQ,GACf,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CA0G7B;AAID,MAAM,WAAW,qBAAqB;IACpC,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,OAAO,CAAC;IACzB,gCAAgC,EAAE,OAAO,CAAC;IAC1C,oBAAoB,EAAE,MAAM,CAAC;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,iBAAiB,CAAC;IAC/B,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,QAAQ,GAAG,qBAAqB,GAAG,OAAO,GAAG,OAAO,CAAC;IAC7D,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,wBAAsB,oBAAoB,CACxC,EAAE,EAAE,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC,IAAI,CAAC,EACzC,IAAI,EAAE,UAAU,CAAC,OAAO,OAAO,CAAC,EAChC,QAAQ,EAAE,aAAa,EACvB,GAAG,EAAE,qBAAqB,GACzB,OAAO,CAAC,IAAI,CAAC,CAyMf"}
|
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Coder phase decision helpers
|
|
4
|
+
* Extracted from loop-phases-coder.ts to keep that file under 500 lines.
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.invokeCoordinatorIfNeeded = invokeCoordinatorIfNeeded;
|
|
8
|
+
exports.executeCoderDecision = executeCoderDecision;
|
|
9
|
+
const node_child_process_1 = require("node:child_process");
|
|
10
|
+
const queries_js_1 = require("../database/queries.js");
|
|
11
|
+
const coordinator_js_1 = require("../orchestrator/coordinator.js");
|
|
12
|
+
const status_js_1 = require("../git/status.js");
|
|
13
|
+
const push_js_1 = require("../git/push.js");
|
|
14
|
+
const loop_phases_helpers_js_1 = require("./loop-phases-helpers.js");
|
|
15
|
+
// ─── Coordinator invocation ───────────────────────────────────────────────────
|
|
16
|
+
async function invokeCoordinatorIfNeeded(db, task, projectPath, effectiveProjectPath, coordinatorCache, coordinatorThresholds, jsonMode = false) {
|
|
17
|
+
let coordinatorGuidance;
|
|
18
|
+
const thresholds = coordinatorThresholds || [2, 5, 9];
|
|
19
|
+
const persistedMustImplement = (0, queries_js_1.getLatestMustImplementGuidance)(db, task.id);
|
|
20
|
+
const activeMustImplement = persistedMustImplement &&
|
|
21
|
+
task.status === 'in_progress' &&
|
|
22
|
+
task.rejection_count >= persistedMustImplement.rejection_count_watermark
|
|
23
|
+
? persistedMustImplement
|
|
24
|
+
: null;
|
|
25
|
+
// Run coordinator at rejection thresholds (same as before)
|
|
26
|
+
const shouldInvokeCoordinator = thresholds.includes(task.rejection_count);
|
|
27
|
+
const cachedResult = coordinatorCache?.get(task.id);
|
|
28
|
+
if (activeMustImplement) {
|
|
29
|
+
coordinatorGuidance = activeMustImplement.guidance;
|
|
30
|
+
coordinatorCache?.set(task.id, {
|
|
31
|
+
success: true,
|
|
32
|
+
decision: 'guide_coder',
|
|
33
|
+
guidance: activeMustImplement.guidance,
|
|
34
|
+
});
|
|
35
|
+
if (!jsonMode) {
|
|
36
|
+
console.log(`\nActive MUST_IMPLEMENT override detected (rc=${activeMustImplement.rejection_count_watermark})`);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
if (shouldInvokeCoordinator) {
|
|
40
|
+
if (activeMustImplement &&
|
|
41
|
+
task.rejection_count === activeMustImplement.rejection_count_watermark) {
|
|
42
|
+
if (!jsonMode) {
|
|
43
|
+
console.log('\nSkipping coordinator reinvocation in same rejection cycle due to active MUST_IMPLEMENT override');
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
if (!jsonMode) {
|
|
48
|
+
console.log(`\n>>> Task has ${task.rejection_count} rejections (threshold hit) - invoking COORDINATOR...\n`);
|
|
49
|
+
}
|
|
50
|
+
try {
|
|
51
|
+
const rejectionHistory = (0, queries_js_1.getTaskRejections)(db, task.id);
|
|
52
|
+
const coordExtra = {};
|
|
53
|
+
if (task.section_id) {
|
|
54
|
+
const allSectionTasks = (0, queries_js_1.listTasks)(db, { sectionId: task.section_id });
|
|
55
|
+
coordExtra.sectionTasks = allSectionTasks.map(t => ({
|
|
56
|
+
id: t.id, title: t.title, status: t.status,
|
|
57
|
+
}));
|
|
58
|
+
}
|
|
59
|
+
coordExtra.submissionNotes = (0, queries_js_1.getLatestSubmissionNotes)(db, task.id);
|
|
60
|
+
const modified = (0, status_js_1.getModifiedFiles)(effectiveProjectPath);
|
|
61
|
+
if (modified.length > 0) {
|
|
62
|
+
coordExtra.gitDiffSummary = modified.join('\n');
|
|
63
|
+
}
|
|
64
|
+
if (cachedResult) {
|
|
65
|
+
coordExtra.previousGuidance = cachedResult.guidance;
|
|
66
|
+
}
|
|
67
|
+
if (activeMustImplement) {
|
|
68
|
+
coordExtra.lockedMustImplementGuidance = activeMustImplement.guidance;
|
|
69
|
+
coordExtra.lockedMustImplementWatermark = activeMustImplement.rejection_count_watermark;
|
|
70
|
+
}
|
|
71
|
+
const coordResult = await (0, coordinator_js_1.invokeCoordinator)(task, rejectionHistory, projectPath, coordExtra);
|
|
72
|
+
if (coordResult) {
|
|
73
|
+
const mustKeepOverride = activeMustImplement &&
|
|
74
|
+
task.rejection_count > activeMustImplement.rejection_count_watermark;
|
|
75
|
+
const normalizedGuidance = mustKeepOverride && !coordResult.guidance.includes('MUST_IMPLEMENT:')
|
|
76
|
+
? `${activeMustImplement.guidance}\n\nAdditional coordinator guidance:\n${coordResult.guidance}`
|
|
77
|
+
: coordResult.guidance;
|
|
78
|
+
coordinatorGuidance = normalizedGuidance;
|
|
79
|
+
coordinatorCache?.set(task.id, {
|
|
80
|
+
...coordResult,
|
|
81
|
+
guidance: normalizedGuidance,
|
|
82
|
+
});
|
|
83
|
+
(0, queries_js_1.addAuditEntry)(db, task.id, task.status, task.status, 'coordinator', {
|
|
84
|
+
actorType: 'orchestrator',
|
|
85
|
+
notes: `[${coordResult.decision}] ${normalizedGuidance}`,
|
|
86
|
+
});
|
|
87
|
+
if (!jsonMode) {
|
|
88
|
+
console.log(`\nCoordinator decision: ${coordResult.decision}`);
|
|
89
|
+
console.log('Coordinator guidance stored for both coder and reviewer.');
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
catch (error) {
|
|
94
|
+
if (!jsonMode) {
|
|
95
|
+
console.warn('Coordinator invocation failed, continuing without guidance:', error);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
else if (cachedResult && !activeMustImplement) {
|
|
101
|
+
coordinatorGuidance = cachedResult.guidance;
|
|
102
|
+
if (!jsonMode && task.rejection_count >= 2) {
|
|
103
|
+
console.log(`\nReusing cached coordinator guidance (decision: ${cachedResult.decision})`);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
return coordinatorGuidance;
|
|
107
|
+
}
|
|
108
|
+
async function executeCoderDecision(db, task, decision, ctx) {
|
|
109
|
+
const { coderStdout, has_uncommitted, requiresExplicitSubmissionCommit, effectiveProjectPath, projectPath, branchName, leaseFence, jsonMode, } = ctx;
|
|
110
|
+
switch (decision.action) {
|
|
111
|
+
case 'submit':
|
|
112
|
+
{
|
|
113
|
+
const submissionCommitSha = (0, loop_phases_helpers_js_1.resolveCoderSubmittedCommitSha)(effectiveProjectPath, coderStdout, {
|
|
114
|
+
requireExplicitToken: requiresExplicitSubmissionCommit,
|
|
115
|
+
});
|
|
116
|
+
if (!submissionCommitSha && requiresExplicitSubmissionCommit) {
|
|
117
|
+
(0, queries_js_1.addAuditEntry)(db, task.id, task.status, task.status, 'orchestrator', {
|
|
118
|
+
actorType: 'orchestrator',
|
|
119
|
+
notes: '[retry] Awaiting explicit SUBMISSION_COMMIT token for commit recovery',
|
|
120
|
+
});
|
|
121
|
+
if (!jsonMode) {
|
|
122
|
+
console.log('\n⟳ Waiting for explicit SUBMISSION_COMMIT token from coder');
|
|
123
|
+
}
|
|
124
|
+
break;
|
|
125
|
+
}
|
|
126
|
+
if (!submissionCommitSha || !(0, status_js_1.isCommitReachable)(effectiveProjectPath, submissionCommitSha)) {
|
|
127
|
+
(0, queries_js_1.updateTaskStatus)(db, task.id, 'failed', 'orchestrator', 'Task failed: cannot submit to review without a valid commit hash');
|
|
128
|
+
if (!jsonMode) {
|
|
129
|
+
console.log('\n✗ Task failed (submission commit missing or not in workspace)');
|
|
130
|
+
}
|
|
131
|
+
break;
|
|
132
|
+
}
|
|
133
|
+
if (leaseFence?.parallelSessionId) {
|
|
134
|
+
const pushResult = (0, push_js_1.pushToRemote)(projectPath, 'origin', branchName);
|
|
135
|
+
if (!pushResult.success) {
|
|
136
|
+
(0, queries_js_1.updateTaskStatus)(db, task.id, 'failed', 'orchestrator', `Task failed: cannot publish submission commit ${submissionCommitSha} to ${branchName} before review`);
|
|
137
|
+
if (!jsonMode) {
|
|
138
|
+
console.log('\n✗ Task failed (unable to push submission commit to branch for review)');
|
|
139
|
+
}
|
|
140
|
+
break;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
(0, queries_js_1.updateTaskStatus)(db, task.id, 'review', 'orchestrator', decision.reasoning, submissionCommitSha);
|
|
144
|
+
}
|
|
145
|
+
if (!jsonMode) {
|
|
146
|
+
console.log(`\n✓ Coder complete, submitted to review (confidence: ${decision.confidence})`);
|
|
147
|
+
}
|
|
148
|
+
break;
|
|
149
|
+
case 'stage_commit_submit':
|
|
150
|
+
if (!has_uncommitted) {
|
|
151
|
+
const submissionCommitSha = (0, loop_phases_helpers_js_1.resolveCoderSubmittedCommitSha)(effectiveProjectPath, coderStdout, {
|
|
152
|
+
requireExplicitToken: requiresExplicitSubmissionCommit,
|
|
153
|
+
});
|
|
154
|
+
if (!submissionCommitSha && requiresExplicitSubmissionCommit) {
|
|
155
|
+
(0, queries_js_1.addAuditEntry)(db, task.id, task.status, task.status, 'orchestrator', {
|
|
156
|
+
actorType: 'orchestrator',
|
|
157
|
+
notes: '[retry] Awaiting explicit SUBMISSION_COMMIT token for commit recovery',
|
|
158
|
+
});
|
|
159
|
+
if (!jsonMode) {
|
|
160
|
+
console.log('\n⟳ Waiting for explicit SUBMISSION_COMMIT token from coder');
|
|
161
|
+
}
|
|
162
|
+
break;
|
|
163
|
+
}
|
|
164
|
+
if (!submissionCommitSha || !(0, status_js_1.isCommitReachable)(effectiveProjectPath, submissionCommitSha)) {
|
|
165
|
+
(0, queries_js_1.updateTaskStatus)(db, task.id, 'failed', 'orchestrator', 'Task failed: cannot submit to review without a valid commit hash');
|
|
166
|
+
if (!jsonMode) {
|
|
167
|
+
console.log('\n✗ Task failed (submission commit missing or not in workspace)');
|
|
168
|
+
}
|
|
169
|
+
break;
|
|
170
|
+
}
|
|
171
|
+
if (leaseFence?.parallelSessionId) {
|
|
172
|
+
const pushResult = (0, push_js_1.pushToRemote)(projectPath, 'origin', branchName);
|
|
173
|
+
if (!pushResult.success) {
|
|
174
|
+
(0, queries_js_1.updateTaskStatus)(db, task.id, 'failed', 'orchestrator', `Task failed: cannot publish submission commit ${submissionCommitSha} to ${branchName} before review`);
|
|
175
|
+
if (!jsonMode) {
|
|
176
|
+
console.log('\n✗ Task failed (unable to push submission commit to branch for review)');
|
|
177
|
+
}
|
|
178
|
+
break;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
(0, queries_js_1.updateTaskStatus)(db, task.id, 'review', 'orchestrator', 'Auto-commit skipped: no uncommitted changes', submissionCommitSha);
|
|
182
|
+
if (!jsonMode) {
|
|
183
|
+
console.log('\n✓ Auto-commit skipped (no uncommitted files) and submitted to review');
|
|
184
|
+
}
|
|
185
|
+
break;
|
|
186
|
+
}
|
|
187
|
+
if (!(0, loop_phases_helpers_js_1.refreshParallelWorkstreamLease)(projectPath, leaseFence)) {
|
|
188
|
+
if (!jsonMode) {
|
|
189
|
+
console.log('\n↺ Lease ownership lost before auto-commit; skipping task in this runner.');
|
|
190
|
+
}
|
|
191
|
+
return;
|
|
192
|
+
}
|
|
193
|
+
// Stage all changes
|
|
194
|
+
try {
|
|
195
|
+
(0, node_child_process_1.execSync)('git add -A', { cwd: effectiveProjectPath, stdio: 'pipe' });
|
|
196
|
+
const message = decision.commit_message || 'feat: implement task specification';
|
|
197
|
+
(0, node_child_process_1.execSync)(`git commit -m "${message.replace(/"/g, '\\"')}"`, {
|
|
198
|
+
cwd: effectiveProjectPath,
|
|
199
|
+
stdio: 'pipe'
|
|
200
|
+
});
|
|
201
|
+
const submissionCommitSha = (0, status_js_1.getCurrentCommitSha)(effectiveProjectPath) || undefined;
|
|
202
|
+
if (!submissionCommitSha || !(0, status_js_1.isCommitReachable)(effectiveProjectPath, submissionCommitSha)) {
|
|
203
|
+
(0, queries_js_1.updateTaskStatus)(db, task.id, 'failed', 'orchestrator', 'Task failed: auto-committed but commit hash is not in current workspace');
|
|
204
|
+
if (!jsonMode) {
|
|
205
|
+
console.log('\n✗ Task failed (auto-commit hash not in workspace)');
|
|
206
|
+
}
|
|
207
|
+
break;
|
|
208
|
+
}
|
|
209
|
+
if (leaseFence?.parallelSessionId) {
|
|
210
|
+
const pushResult = (0, push_js_1.pushToRemote)(projectPath, 'origin', branchName);
|
|
211
|
+
if (!pushResult.success) {
|
|
212
|
+
(0, queries_js_1.updateTaskStatus)(db, task.id, 'failed', 'orchestrator', `Task failed: cannot publish submission commit ${submissionCommitSha} to ${branchName} before review`);
|
|
213
|
+
if (!jsonMode) {
|
|
214
|
+
console.log('\n✗ Task failed (unable to push submission commit to branch for review)');
|
|
215
|
+
}
|
|
216
|
+
break;
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
(0, queries_js_1.updateTaskStatus)(db, task.id, 'review', 'orchestrator', `Auto-committed and submitted (${decision.reasoning})`, submissionCommitSha);
|
|
220
|
+
if (!jsonMode) {
|
|
221
|
+
console.log(`\n✓ Auto-committed and submitted to review (confidence: ${decision.confidence})`);
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
catch (error) {
|
|
225
|
+
const failureReason = (0, loop_phases_helpers_js_1.summarizeErrorMessage)(error);
|
|
226
|
+
(0, queries_js_1.updateTaskStatus)(db, task.id, 'failed', 'orchestrator', `Task failed: auto-commit step failed before review (${failureReason})`);
|
|
227
|
+
if (!jsonMode) {
|
|
228
|
+
console.log('\n✗ Task failed (auto-commit step failed before review)');
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
break;
|
|
232
|
+
case 'retry':
|
|
233
|
+
if (!jsonMode) {
|
|
234
|
+
console.log(`\n⟳ Retrying coder (${decision.reasoning}, confidence: ${decision.confidence})`);
|
|
235
|
+
}
|
|
236
|
+
break;
|
|
237
|
+
case 'error':
|
|
238
|
+
(0, queries_js_1.updateTaskStatus)(db, task.id, 'failed', 'orchestrator', `Task failed: ${decision.reasoning}`);
|
|
239
|
+
if (!jsonMode) {
|
|
240
|
+
console.log(`\n✗ Task failed (${decision.reasoning})`);
|
|
241
|
+
console.log('Human intervention required.');
|
|
242
|
+
}
|
|
243
|
+
break;
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
//# sourceMappingURL=loop-phases-coder-decision.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loop-phases-coder-decision.js","sourceRoot":"","sources":["../../src/commands/loop-phases-coder-decision.ts"],"names":[],"mappings":";AAAA;;;GAGG;;AAiCH,8DAkHC;AAsBD,oDA8MC;AArXD,2DAA8C;AAC9C,uDAQgC;AAEhC,mEAIwC;AACxC,gDAI0B;AAC1B,4CAA8C;AAC9C,qEAKkC;AAElC,iFAAiF;AAE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AAE,cAAc,EACrD,gBAAgB,QAAQ,CAAC,SAAS,EAAE,CAAC,CAAC;YACxC,IAAI,CAAC,QAAQ,EAAE,CAAC;gBACd,OAAO,CAAC,GAAG,CAAC,oBAAoB,QAAQ,CAAC,SAAS,GAAG,CAAC,CAAC;gBACvD,OAAO,CAAC,GAAG,CAAC,8BAA8B,CAAC,CAAC;YAC9C,CAAC;YACD,MAAM;IACV,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
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
|
+
import { LeaseFenceContext, CreditExhaustionResult } from './loop-phases-helpers.js';
|
|
6
|
+
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>;
|
|
7
|
+
//# sourceMappingURL=loop-phases-coder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loop-phases-coder.d.ts","sourceRoot":"","sources":["../../src/commands/loop-phases-coder.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EAKR,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAE9D,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAaxE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAG7D,OAAO,EACL,iBAAiB,EAGjB,sBAAsB,EAcvB,MAAM,0BAA0B,CAAC;AAMlC,wBAAsB,aAAa,CACjC,EAAE,EAAE,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC,IAAI,CAAC,EACzC,IAAI,EAAE,UAAU,CAAC,OAAO,OAAO,CAAC,EAChC,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,OAAO,GAAG,QAAQ,EAC1B,QAAQ,UAAQ,EAChB,gBAAgB,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,iBAAiB,CAAC,EACjD,qBAAqB,CAAC,EAAE,MAAM,EAAE,EAChC,UAAU,CAAC,EAAE,iBAAiB,EAC9B,UAAU,SAAS,EACnB,eAAe,CAAC,EAAE,eAAe,GAChC,OAAO,CAAC,sBAAsB,GAAG,IAAI,CAAC,CAgYxC"}
|
|
@@ -0,0 +1,343 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.runCoderPhase = runCoderPhase;
|
|
4
|
+
const queries_js_1 = require("../database/queries.js");
|
|
5
|
+
const coder_js_1 = require("../orchestrator/coder.js");
|
|
6
|
+
const status_js_1 = require("../git/status.js");
|
|
7
|
+
const invoke_js_1 = require("../orchestrator/invoke.js");
|
|
8
|
+
const fallback_handler_js_1 = require("../orchestrator/fallback-handler.js");
|
|
9
|
+
const loader_js_1 = require("../config/loader.js");
|
|
10
|
+
const registry_js_1 = require("../providers/registry.js");
|
|
11
|
+
const git_lifecycle_js_1 = require("../workspace/git-lifecycle.js");
|
|
12
|
+
const pool_js_1 = require("../workspace/pool.js");
|
|
13
|
+
const loop_phases_helpers_js_1 = require("./loop-phases-helpers.js");
|
|
14
|
+
const loop_phases_coder_decision_js_1 = require("./loop-phases-coder-decision.js");
|
|
15
|
+
async function runCoderPhase(db, task, projectPath, action, jsonMode = false, coordinatorCache, coordinatorThresholds, leaseFence, branchName = 'main', poolSlotContext) {
|
|
16
|
+
if (!task)
|
|
17
|
+
return;
|
|
18
|
+
if (!(0, loop_phases_helpers_js_1.refreshParallelWorkstreamLease)(projectPath, leaseFence)) {
|
|
19
|
+
if (!jsonMode) {
|
|
20
|
+
console.log('\n↺ Lease ownership lost before coder phase; skipping task in this runner.');
|
|
21
|
+
}
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
// ── Pool slot: prepare workspace for task ──
|
|
25
|
+
let poolStartingSha;
|
|
26
|
+
let effectiveProjectPath = projectPath;
|
|
27
|
+
if (poolSlotContext) {
|
|
28
|
+
const prepResult = (0, git_lifecycle_js_1.prepareForTask)(poolSlotContext.globalDb, poolSlotContext.slot, task.id, projectPath);
|
|
29
|
+
if (!prepResult.ok) {
|
|
30
|
+
if (!jsonMode) {
|
|
31
|
+
console.log(`\n✗ Workspace preparation failed: ${prepResult.reason}`);
|
|
32
|
+
}
|
|
33
|
+
if (prepResult.blocked) {
|
|
34
|
+
const { setTaskBlocked } = await import('../database/queries.js');
|
|
35
|
+
setTaskBlocked(db, task.id, 'blocked_error', prepResult.reason);
|
|
36
|
+
}
|
|
37
|
+
(0, pool_js_1.releaseSlot)(poolSlotContext.globalDb, poolSlotContext.slot.id);
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
poolStartingSha = prepResult.startingSha;
|
|
41
|
+
effectiveProjectPath = poolSlotContext.slot.slot_path;
|
|
42
|
+
if (!jsonMode) {
|
|
43
|
+
console.log(`\n✓ Workspace prepared (branch: ${prepResult.taskBranch}, base: ${prepResult.baseBranch})`);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
// Get coordinator guidance if needed
|
|
47
|
+
const coordinatorGuidance = await (0, loop_phases_coder_decision_js_1.invokeCoordinatorIfNeeded)(db, task, projectPath, effectiveProjectPath, coordinatorCache, coordinatorThresholds, jsonMode);
|
|
48
|
+
// STEP 1: Invoke coder (no status commands in prompt anymore)
|
|
49
|
+
if (!jsonMode) {
|
|
50
|
+
console.log('\n>>> Invoking CODER...\n');
|
|
51
|
+
}
|
|
52
|
+
const initialSha = poolStartingSha || (0, status_js_1.getCurrentCommitSha)(effectiveProjectPath) || '';
|
|
53
|
+
const coderConfig = (0, loader_js_1.loadConfig)(projectPath).ai?.coder;
|
|
54
|
+
const coderInvocation = await (0, loop_phases_helpers_js_1.invokeWithLeaseHeartbeat)(projectPath, leaseFence, () => (0, coder_js_1.invokeCoder)(task, effectiveProjectPath, action, coordinatorGuidance, leaseFence?.runnerId));
|
|
55
|
+
if (coderInvocation.superseded || !coderInvocation.result) {
|
|
56
|
+
if (!jsonMode) {
|
|
57
|
+
console.log('\n↺ Lease ownership changed during coder invocation; skipping post-processing in this runner.');
|
|
58
|
+
}
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
const coderResult = coderInvocation.result;
|
|
62
|
+
if (coderResult.timedOut || !coderResult.success) {
|
|
63
|
+
const providerName = coderConfig?.provider ?? (0, loader_js_1.loadConfig)(projectPath).ai?.coder?.provider ?? 'unknown';
|
|
64
|
+
const modelName = coderConfig?.model ?? (0, loader_js_1.loadConfig)(projectPath).ai?.coder?.model ?? 'unknown';
|
|
65
|
+
// Check for credit/rate_limit exhaustion before counting as a provider failure
|
|
66
|
+
const registry = await (0, registry_js_1.getProviderRegistry)();
|
|
67
|
+
const prov = registry.tryGet(providerName);
|
|
68
|
+
if (prov) {
|
|
69
|
+
const classified = prov.classifyResult(coderResult);
|
|
70
|
+
if (classified?.type === 'credit_exhaustion') {
|
|
71
|
+
return { action: 'pause_credit_exhaustion', provider: providerName, model: modelName, role: 'coder', message: classified.message };
|
|
72
|
+
}
|
|
73
|
+
if (classified?.type === 'rate_limit') {
|
|
74
|
+
return { action: 'rate_limit', provider: providerName, model: modelName, role: 'coder', message: classified.message, retryAfterMs: classified.retryAfterMs };
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
const output = (coderResult.stderr || coderResult.stdout || '').trim();
|
|
78
|
+
const failed = await (0, loop_phases_helpers_js_1.handleProviderInvocationFailure)(db, task.id, {
|
|
79
|
+
role: 'coder',
|
|
80
|
+
provider: providerName,
|
|
81
|
+
model: modelName,
|
|
82
|
+
exitCode: coderResult.exitCode ?? 1,
|
|
83
|
+
output,
|
|
84
|
+
}, jsonMode);
|
|
85
|
+
if (failed.shouldStopTask) {
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
(0, queries_js_1.clearTaskFailureCount)(db, task.id);
|
|
91
|
+
// ── Pool slot: post-coder verification gate ──
|
|
92
|
+
if (poolSlotContext && poolStartingSha) {
|
|
93
|
+
const gateResult = (0, git_lifecycle_js_1.postCoderGate)(effectiveProjectPath, poolStartingSha, task.title);
|
|
94
|
+
if (!gateResult.ok) {
|
|
95
|
+
if (!jsonMode) {
|
|
96
|
+
console.log(`\n⟳ Post-coder gate: ${gateResult.reason}. Returning to coder.`);
|
|
97
|
+
}
|
|
98
|
+
(0, queries_js_1.addAuditEntry)(db, task.id, task.status, task.status, 'orchestrator', {
|
|
99
|
+
actorType: 'orchestrator',
|
|
100
|
+
notes: `[retry] Post-coder gate: ${gateResult.reason}`,
|
|
101
|
+
});
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
if (gateResult.autoCommitted && !jsonMode) {
|
|
105
|
+
console.log('\n✓ Post-coder gate: auto-committed uncommitted work');
|
|
106
|
+
}
|
|
107
|
+
(0, pool_js_1.updateSlotStatus)(poolSlotContext.globalDb, poolSlotContext.slot.id, 'awaiting_review');
|
|
108
|
+
}
|
|
109
|
+
// STEP 2: Gather git state
|
|
110
|
+
const commits = (0, status_js_1.getRecentCommits)(effectiveProjectPath, 5, initialSha);
|
|
111
|
+
const files_changed = (0, status_js_1.getChangedFiles)(effectiveProjectPath);
|
|
112
|
+
const has_uncommitted = (0, status_js_1.hasUncommittedChanges)(effectiveProjectPath);
|
|
113
|
+
const diff_summary = (0, status_js_1.getDiffSummary)(effectiveProjectPath);
|
|
114
|
+
const hasRelevantChanges = has_uncommitted || commits.length > 0 || files_changed.length > 0;
|
|
115
|
+
const gitState = {
|
|
116
|
+
commits,
|
|
117
|
+
files_changed,
|
|
118
|
+
has_uncommitted_changes: has_uncommitted,
|
|
119
|
+
diff_summary,
|
|
120
|
+
};
|
|
121
|
+
// STEP 3: Build orchestrator context
|
|
122
|
+
// Get rejection notes if any
|
|
123
|
+
const lastRejectionNotes = task.rejection_count > 0
|
|
124
|
+
? (0, queries_js_1.getTaskRejections)(db, task.id).slice(-1)[0]?.notes ?? undefined
|
|
125
|
+
: undefined;
|
|
126
|
+
const requiresExplicitSubmissionCommit = (lastRejectionNotes ?? '').includes('[commit_recovery]');
|
|
127
|
+
const rejectionItemCount = (0, loop_phases_helpers_js_1.countLatestOpenRejectionItems)(lastRejectionNotes);
|
|
128
|
+
const context = {
|
|
129
|
+
task: {
|
|
130
|
+
id: task.id,
|
|
131
|
+
title: task.title,
|
|
132
|
+
description: task.title, // Use title as description for now
|
|
133
|
+
rejection_notes: lastRejectionNotes,
|
|
134
|
+
rejection_count: task.rejection_count,
|
|
135
|
+
rejection_item_count: rejectionItemCount,
|
|
136
|
+
},
|
|
137
|
+
coder_output: {
|
|
138
|
+
stdout: coderResult.stdout,
|
|
139
|
+
stderr: coderResult.stderr,
|
|
140
|
+
exit_code: coderResult.exitCode,
|
|
141
|
+
timed_out: coderResult.timedOut,
|
|
142
|
+
duration_ms: coderResult.duration,
|
|
143
|
+
},
|
|
144
|
+
git_state: gitState,
|
|
145
|
+
};
|
|
146
|
+
// STEP 4: Invoke orchestrator
|
|
147
|
+
let orchestratorOutput;
|
|
148
|
+
try {
|
|
149
|
+
orchestratorOutput = await (0, invoke_js_1.invokeCoderOrchestrator)(context, projectPath);
|
|
150
|
+
}
|
|
151
|
+
catch (error) {
|
|
152
|
+
console.error('Orchestrator invocation failed:', error);
|
|
153
|
+
const orchestratorFailure = await (0, loop_phases_helpers_js_1.classifyOrchestratorFailure)(error, projectPath);
|
|
154
|
+
if (orchestratorFailure && !orchestratorFailure.retryable) {
|
|
155
|
+
orchestratorOutput = `STATUS: ERROR\nREASON: FALLBACK: Non-retryable orchestrator failure (${orchestratorFailure.type})\nCONFIDENCE: LOW`;
|
|
156
|
+
}
|
|
157
|
+
else {
|
|
158
|
+
// Check if coder seems finished even if orchestrator failed
|
|
159
|
+
const isTaskComplete = (0, loop_phases_helpers_js_1.hasCoderCompletionSignal)(coderResult.stdout);
|
|
160
|
+
// Only count as having work if there are actual relevant uncommitted changes,
|
|
161
|
+
// changed files, or recent commits
|
|
162
|
+
const hasWork = hasRelevantChanges;
|
|
163
|
+
if (isTaskComplete && hasWork) {
|
|
164
|
+
orchestratorOutput = `STATUS: REVIEW\nREASON: FALLBACK: Orchestrator failed but coder signaled completion\nCONFIDENCE: LOW`;
|
|
165
|
+
}
|
|
166
|
+
else {
|
|
167
|
+
// Fallback to safe default: retry
|
|
168
|
+
orchestratorOutput = `STATUS: RETRY\nREASON: FALLBACK: Orchestrator failed, defaulting to retry\nCONFIDENCE: LOW`;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
// STEP 5: Parse orchestrator output with fallback
|
|
173
|
+
const handler = new fallback_handler_js_1.OrchestrationFallbackHandler();
|
|
174
|
+
let decision = handler.parseCoderOutput(orchestratorOutput);
|
|
175
|
+
// Fill git-state fields from actual git state (parser returns placeholders)
|
|
176
|
+
decision.commits = commits.map(c => c.sha);
|
|
177
|
+
decision.files_changed = files_changed.length;
|
|
178
|
+
decision.has_commits = commits.length > 0;
|
|
179
|
+
// Derive stage_commit_submit from submit + uncommitted + completion signal
|
|
180
|
+
if (decision.action === 'submit' && has_uncommitted && commits.length === 0) {
|
|
181
|
+
const isTaskComplete = (0, loop_phases_helpers_js_1.hasCoderCompletionSignal)(coderResult.stdout);
|
|
182
|
+
if (isTaskComplete) {
|
|
183
|
+
decision.action = 'stage_commit_submit';
|
|
184
|
+
}
|
|
185
|
+
// If not complete, leave as 'submit' — the existing submit handler
|
|
186
|
+
// will fail safely when it can't find a valid commit hash
|
|
187
|
+
}
|
|
188
|
+
// When orchestrator parse falls back to retry, check coder output + git state
|
|
189
|
+
// for completion signals before giving up (same logic as the catch block above)
|
|
190
|
+
if (decision.action === 'retry' && decision.reasoning.includes('FALLBACK: Orchestrator failed')) {
|
|
191
|
+
const isTaskComplete = (0, loop_phases_helpers_js_1.hasCoderCompletionSignal)(coderResult.stdout);
|
|
192
|
+
const hasWork = hasRelevantChanges;
|
|
193
|
+
if (isTaskComplete && hasWork) {
|
|
194
|
+
if (!jsonMode) {
|
|
195
|
+
console.log('[Orchestrator] Parse failed but coder signaled completion with work present - submitting');
|
|
196
|
+
}
|
|
197
|
+
decision = {
|
|
198
|
+
action: has_uncommitted ? 'stage_commit_submit' : 'submit',
|
|
199
|
+
reasoning: 'FALLBACK: Orchestrator failed but coder signaled completion with commits/changes',
|
|
200
|
+
commits: commits.map(c => c.sha),
|
|
201
|
+
commit_message: has_uncommitted ? 'feat: implement task specification' : undefined,
|
|
202
|
+
next_status: 'review',
|
|
203
|
+
files_changed: files_changed.length,
|
|
204
|
+
confidence: 'low',
|
|
205
|
+
exit_clean: true,
|
|
206
|
+
has_commits: commits.length > 0,
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
else {
|
|
210
|
+
// No completion signal - apply the parse retry counter
|
|
211
|
+
const consecutiveParseFallbackRetries = (0, loop_phases_helpers_js_1.countConsecutiveOrchestratorFallbackEntries)(db, task.id, loop_phases_helpers_js_1.CODER_PARSE_FALLBACK_MARKER) + 1;
|
|
212
|
+
if (consecutiveParseFallbackRetries >= loop_phases_helpers_js_1.MAX_ORCHESTRATOR_PARSE_RETRIES) {
|
|
213
|
+
decision = {
|
|
214
|
+
...decision,
|
|
215
|
+
action: 'error',
|
|
216
|
+
reasoning: `Orchestrator parse failed ${consecutiveParseFallbackRetries} times; escalating to failed to stop retry loop`,
|
|
217
|
+
next_status: 'failed',
|
|
218
|
+
confidence: 'low',
|
|
219
|
+
exit_clean: false,
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
else {
|
|
223
|
+
decision = {
|
|
224
|
+
...decision,
|
|
225
|
+
reasoning: `${decision.reasoning} (parse_retry ${consecutiveParseFallbackRetries}/${loop_phases_helpers_js_1.MAX_ORCHESTRATOR_PARSE_RETRIES})`,
|
|
226
|
+
};
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
// Contract-violation handling (detected via REASON prefix from text signals).
|
|
231
|
+
const legacyChecklistViolation = /^CHECKLIST_REQUIRED:/i.test(decision.reasoning || '');
|
|
232
|
+
const legacyRejectionResponseViolation = /^REJECTION_RESPONSE_REQUIRED:/i.test(decision.reasoning || '');
|
|
233
|
+
const contractViolation = legacyChecklistViolation ? 'checklist_required'
|
|
234
|
+
: legacyRejectionResponseViolation ? 'rejection_response_required'
|
|
235
|
+
: null;
|
|
236
|
+
if (contractViolation) {
|
|
237
|
+
const marker = contractViolation === 'checklist_required'
|
|
238
|
+
? loop_phases_helpers_js_1.CONTRACT_CHECKLIST_MARKER
|
|
239
|
+
: loop_phases_helpers_js_1.CONTRACT_REJECTION_RESPONSE_MARKER;
|
|
240
|
+
const reasonText = (decision.reasoning || '')
|
|
241
|
+
.replace(/^CHECKLIST_REQUIRED:\s*/i, '')
|
|
242
|
+
.replace(/^REJECTION_RESPONSE_REQUIRED:\s*/i, '')
|
|
243
|
+
.trim();
|
|
244
|
+
const cleanReason = reasonText || 'Required output contract not satisfied';
|
|
245
|
+
const consecutiveContractViolations = (0, loop_phases_helpers_js_1.countConsecutiveTaggedOrchestratorEntries)(db, task.id, marker, '[contract:') + 1;
|
|
246
|
+
if (consecutiveContractViolations >= loop_phases_helpers_js_1.MAX_CONTRACT_VIOLATION_RETRIES) {
|
|
247
|
+
decision = {
|
|
248
|
+
...decision,
|
|
249
|
+
action: 'error',
|
|
250
|
+
next_status: 'failed',
|
|
251
|
+
reasoning: `${marker} ${cleanReason} (retry_limit ${consecutiveContractViolations}/${loop_phases_helpers_js_1.MAX_CONTRACT_VIOLATION_RETRIES})`,
|
|
252
|
+
confidence: 'low',
|
|
253
|
+
exit_clean: false,
|
|
254
|
+
};
|
|
255
|
+
}
|
|
256
|
+
else {
|
|
257
|
+
decision = {
|
|
258
|
+
...decision,
|
|
259
|
+
action: 'retry',
|
|
260
|
+
next_status: 'in_progress',
|
|
261
|
+
reasoning: `${marker} ${cleanReason} (retry ${consecutiveContractViolations}/${loop_phases_helpers_js_1.MAX_CONTRACT_VIOLATION_RETRIES})`,
|
|
262
|
+
confidence: 'medium',
|
|
263
|
+
};
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
// Enforce orchestrator authority over weak/unsupported WONT_FIX claims.
|
|
267
|
+
// WONT_FIX overrides are now encoded in the REASON prefix as semicolon-separated items.
|
|
268
|
+
const legacyWontFixOverrideMatch = (decision.reasoning || '').match(/WONT_FIX_OVERRIDE:\s*([\s\S]+)/i);
|
|
269
|
+
const overrideItems = legacyWontFixOverrideMatch?.[1]
|
|
270
|
+
? legacyWontFixOverrideMatch[1]
|
|
271
|
+
.split(';')
|
|
272
|
+
.map(line => line.trim())
|
|
273
|
+
.filter(Boolean)
|
|
274
|
+
: [];
|
|
275
|
+
if (overrideItems.length > 0) {
|
|
276
|
+
const mandatoryLines = overrideItems.map((item, idx) => `${idx + 1}. ${item}`);
|
|
277
|
+
const mandatoryGuidance = `MUST_IMPLEMENT:
|
|
278
|
+
${mandatoryLines.join('\n')}
|
|
279
|
+
|
|
280
|
+
This is a mandatory orchestrator override. Implement these changes before resubmitting.
|
|
281
|
+
Only use WONT_FIX if you provide exceptional technical evidence and the orchestrator explicitly accepts it.`;
|
|
282
|
+
const persistedNote = mandatoryGuidance;
|
|
283
|
+
(0, queries_js_1.addAuditEntry)(db, task.id, task.status, task.status, 'coordinator', {
|
|
284
|
+
actorType: 'orchestrator',
|
|
285
|
+
notes: persistedNote,
|
|
286
|
+
category: 'must_implement',
|
|
287
|
+
metadata: { rejection_count: task.rejection_count }
|
|
288
|
+
});
|
|
289
|
+
coordinatorCache?.set(task.id, {
|
|
290
|
+
success: true,
|
|
291
|
+
decision: 'guide_coder',
|
|
292
|
+
guidance: mandatoryGuidance,
|
|
293
|
+
});
|
|
294
|
+
decision = {
|
|
295
|
+
...decision,
|
|
296
|
+
action: 'retry',
|
|
297
|
+
next_status: 'in_progress',
|
|
298
|
+
reasoning: `WONT_FIX override applied (MUST_IMPLEMENT)`,
|
|
299
|
+
confidence: 'medium',
|
|
300
|
+
};
|
|
301
|
+
}
|
|
302
|
+
// Universal retry cap: prevent infinite loops for ANY consecutive [retry] entries.
|
|
303
|
+
// This catches the bug where SignalParser returns 'unclear' → 'retry' without escalation.
|
|
304
|
+
if (decision.action === 'retry') {
|
|
305
|
+
const consecutiveRetries = (0, loop_phases_helpers_js_1.countConsecutiveRetryEntries)(db, task.id) + 1;
|
|
306
|
+
if (consecutiveRetries >= loop_phases_helpers_js_1.MAX_CONSECUTIVE_CODER_RETRIES) {
|
|
307
|
+
decision = {
|
|
308
|
+
...decision,
|
|
309
|
+
action: 'error',
|
|
310
|
+
reasoning: `Coder retry limit reached (${consecutiveRetries} consecutive retries); escalating to failed`,
|
|
311
|
+
next_status: 'failed',
|
|
312
|
+
confidence: 'low',
|
|
313
|
+
exit_clean: false,
|
|
314
|
+
};
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
// STEP 6: Log orchestrator decision for audit trail.
|
|
318
|
+
// Use a non-transition audit row here; actual status transitions are recorded
|
|
319
|
+
// only after execution succeeds (e.g. updateTaskStatus/approveTask/rejectTask).
|
|
320
|
+
(0, queries_js_1.addAuditEntry)(db, task.id, task.status, task.status, 'orchestrator', {
|
|
321
|
+
actorType: 'orchestrator',
|
|
322
|
+
notes: `[${decision.action}] ${decision.reasoning} (confidence: ${decision.confidence})`,
|
|
323
|
+
category: 'decision',
|
|
324
|
+
});
|
|
325
|
+
if (!(0, loop_phases_helpers_js_1.refreshParallelWorkstreamLease)(projectPath, leaseFence)) {
|
|
326
|
+
if (!jsonMode) {
|
|
327
|
+
console.log('\n↺ Lease ownership changed before applying coder decision; skipping in this runner.');
|
|
328
|
+
}
|
|
329
|
+
return;
|
|
330
|
+
}
|
|
331
|
+
// STEP 7: Execute the decision
|
|
332
|
+
await (0, loop_phases_coder_decision_js_1.executeCoderDecision)(db, task, decision, {
|
|
333
|
+
coderStdout: coderResult.stdout,
|
|
334
|
+
has_uncommitted,
|
|
335
|
+
requiresExplicitSubmissionCommit,
|
|
336
|
+
effectiveProjectPath,
|
|
337
|
+
projectPath,
|
|
338
|
+
branchName,
|
|
339
|
+
leaseFence,
|
|
340
|
+
jsonMode,
|
|
341
|
+
});
|
|
342
|
+
}
|
|
343
|
+
//# sourceMappingURL=loop-phases-coder.js.map
|