@telora/daemon 0.15.3 → 0.15.5
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/build-info.json +2 -2
- package/dist/directive-executor.d.ts +18 -3
- package/dist/directive-executor.d.ts.map +1 -1
- package/dist/directive-executor.js +45 -4
- package/dist/directive-executor.js.map +1 -1
- package/dist/focus-completion.js +12 -12
- package/dist/focus-completion.js.map +1 -1
- package/dist/focus-executor.d.ts.map +1 -1
- package/dist/focus-executor.js +30 -13
- package/dist/focus-executor.js.map +1 -1
- package/dist/focus-phase.d.ts +22 -0
- package/dist/focus-phase.d.ts.map +1 -0
- package/dist/focus-phase.js +54 -0
- package/dist/focus-phase.js.map +1 -0
- package/dist/focus-team-state.d.ts +6 -0
- package/dist/focus-team-state.d.ts.map +1 -1
- package/dist/focus-team-state.js +13 -0
- package/dist/focus-team-state.js.map +1 -1
- package/dist/index.js +0 -0
- package/dist/listener.d.ts.map +1 -1
- package/dist/listener.js +0 -5
- package/dist/listener.js.map +1 -1
- package/dist/queries/focuses.d.ts +5 -0
- package/dist/queries/focuses.d.ts.map +1 -1
- package/dist/queries/focuses.js +15 -0
- package/dist/queries/focuses.js.map +1 -1
- package/dist/review-defect-detector.d.ts +16 -95
- package/dist/review-defect-detector.d.ts.map +1 -1
- package/dist/review-defect-detector.js +19 -211
- package/dist/review-defect-detector.js.map +1 -1
- package/dist/state-cascade.d.ts +45 -41
- package/dist/state-cascade.d.ts.map +1 -1
- package/dist/state-cascade.js +123 -215
- package/dist/state-cascade.js.map +1 -1
- package/package.json +2 -2
- package/dist/listener-review.d.ts +0 -37
- package/dist/listener-review.d.ts.map +0 -1
- package/dist/listener-review.js +0 -217
- package/dist/listener-review.js.map +0 -1
- package/dist/queries/strategies.d.ts +0 -97
- package/dist/queries/strategies.d.ts.map +0 -1
- package/dist/queries/strategies.js +0 -136
- package/dist/queries/strategies.js.map +0 -1
- package/dist/review-spawner.d.ts +0 -32
- package/dist/review-spawner.d.ts.map +0 -1
- package/dist/review-spawner.js +0 -170
- package/dist/review-spawner.js.map +0 -1
- package/dist/strategy-completion-event.d.ts +0 -63
- package/dist/strategy-completion-event.d.ts.map +0 -1
- package/dist/strategy-completion-event.js +0 -138
- package/dist/strategy-completion-event.js.map +0 -1
- package/dist/strategy-completion.d.ts +0 -85
- package/dist/strategy-completion.d.ts.map +0 -1
- package/dist/strategy-completion.js +0 -459
- package/dist/strategy-completion.js.map +0 -1
- package/dist/strategy-engine.d.ts +0 -47
- package/dist/strategy-engine.d.ts.map +0 -1
- package/dist/strategy-engine.js +0 -421
- package/dist/strategy-engine.js.map +0 -1
- package/dist/strategy-executor.d.ts +0 -55
- package/dist/strategy-executor.d.ts.map +0 -1
- package/dist/strategy-executor.js +0 -519
- package/dist/strategy-executor.js.map +0 -1
- package/dist/strategy-lifecycle.d.ts +0 -61
- package/dist/strategy-lifecycle.d.ts.map +0 -1
- package/dist/strategy-lifecycle.js +0 -544
- package/dist/strategy-lifecycle.js.map +0 -1
- package/dist/strategy-merge.d.ts +0 -77
- package/dist/strategy-merge.d.ts.map +0 -1
- package/dist/strategy-merge.js +0 -378
- package/dist/strategy-merge.js.map +0 -1
- package/dist/strategy-prompt-builder.d.ts +0 -24
- package/dist/strategy-prompt-builder.d.ts.map +0 -1
- package/dist/strategy-prompt-builder.js +0 -87
- package/dist/strategy-prompt-builder.js.map +0 -1
- package/dist/strategy-provisioning.d.ts +0 -16
- package/dist/strategy-provisioning.d.ts.map +0 -1
- package/dist/strategy-provisioning.js +0 -119
- package/dist/strategy-provisioning.js.map +0 -1
- package/dist/strategy-spawn-helpers.d.ts +0 -67
- package/dist/strategy-spawn-helpers.d.ts.map +0 -1
- package/dist/strategy-spawn-helpers.js +0 -160
- package/dist/strategy-spawn-helpers.js.map +0 -1
- package/dist/strategy-team-lifecycle.d.ts +0 -50
- package/dist/strategy-team-lifecycle.d.ts.map +0 -1
- package/dist/strategy-team-lifecycle.js +0 -256
- package/dist/strategy-team-lifecycle.js.map +0 -1
- package/dist/strategy-team-state.d.ts +0 -24
- package/dist/strategy-team-state.d.ts.map +0 -1
- package/dist/strategy-team-state.js +0 -43
- package/dist/strategy-team-state.js.map +0 -1
- package/dist/strategy-teardown.d.ts +0 -24
- package/dist/strategy-teardown.d.ts.map +0 -1
- package/dist/strategy-teardown.js +0 -158
- package/dist/strategy-teardown.js.map +0 -1
- package/dist/strategy-worktree-state.d.ts +0 -47
- package/dist/strategy-worktree-state.d.ts.map +0 -1
- package/dist/strategy-worktree-state.js +0 -104
- package/dist/strategy-worktree-state.js.map +0 -1
- package/dist/team-prompt-variants.d.ts +0 -17
- package/dist/team-prompt-variants.d.ts.map +0 -1
- package/dist/team-prompt-variants.js +0 -79
- package/dist/team-prompt-variants.js.map +0 -1
- package/dist/types/strategy.d.ts +0 -180
- package/dist/types/strategy.d.ts.map +0 -1
- package/dist/types/strategy.js +0 -5
- package/dist/types/strategy.js.map +0 -1
- package/dist/worktree-merge.d.ts +0 -23
- package/dist/worktree-merge.d.ts.map +0 -1
- package/dist/worktree-merge.js +0 -57
- package/dist/worktree-merge.js.map +0 -1
- package/dist/worktree-strategy.d.ts +0 -69
- package/dist/worktree-strategy.d.ts.map +0 -1
- package/dist/worktree-strategy.js +0 -214
- package/dist/worktree-strategy.js.map +0 -1
package/dist/strategy-merge.js
DELETED
|
@@ -1,378 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Strategy branch merge logic.
|
|
3
|
-
*
|
|
4
|
-
* Handles merging a strategy's work branch into the integration branch,
|
|
5
|
-
* including workflow resolution and per-delivery git state reporting.
|
|
6
|
-
*/
|
|
7
|
-
import { runGitSync } from './git-types.js';
|
|
8
|
-
import { fetchEffectiveWorkflow, reportGitState, getMergeConflictDeliveries } from './supabase.js';
|
|
9
|
-
import { mergeToIntegration } from './git.js';
|
|
10
|
-
import { mergeBackFromIntegration } from './git-merge.js';
|
|
11
|
-
import { mergeDeliveryBranch } from './delivery-lifecycle.js';
|
|
12
|
-
import { createEscalation } from './queries/issues.js';
|
|
13
|
-
import { updateDeliveryMergeCommitSha } from './queries/deliveries.js';
|
|
14
|
-
import { withRetry, sendMessage, ESCALATION_REASONS } from '@telora/daemon-core';
|
|
15
|
-
import { spawnResolutionAgent } from './spawner.js';
|
|
16
|
-
import { getStrategyWorktree } from './strategy-worktree-state.js';
|
|
17
|
-
// Track deliveries with pending merge conflict escalations to avoid duplicates
|
|
18
|
-
const pendingMergeConflictDeliveries = new Set();
|
|
19
|
-
/**
|
|
20
|
-
* Report merge_conflict git state for a delivery.
|
|
21
|
-
*
|
|
22
|
-
* Makes the merge failure visible in the frontend delivery detail view.
|
|
23
|
-
*/
|
|
24
|
-
export async function reportMergeConflictState(deliveryId, branchName) {
|
|
25
|
-
try {
|
|
26
|
-
await reportGitState(deliveryId, 'merge_conflict', branchName);
|
|
27
|
-
}
|
|
28
|
-
catch (err) {
|
|
29
|
-
console.warn(`[strategy-merge] reportGitState merge_conflict failed for ${deliveryId}:`, err.message);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Create an escalation for a merge conflict and report the git state.
|
|
34
|
-
*
|
|
35
|
-
* Idempotent: skips escalation creation if one is already pending for
|
|
36
|
-
* the same delivery (tracked in-memory via pendingMergeConflictDeliveries).
|
|
37
|
-
* Always reports merge_conflict git state regardless.
|
|
38
|
-
*
|
|
39
|
-
* Called by all strategy-level merge callers when mergeToIntegration fails.
|
|
40
|
-
*/
|
|
41
|
-
export async function escalateMergeConflict(params) {
|
|
42
|
-
const { organizationId, sessionId, deliveryId, deliveryName, branchName, integrationBranch, mergeError } = params;
|
|
43
|
-
// Always report merge_conflict git state
|
|
44
|
-
await reportMergeConflictState(deliveryId, branchName);
|
|
45
|
-
// Skip duplicate escalation
|
|
46
|
-
if (pendingMergeConflictDeliveries.has(deliveryId)) {
|
|
47
|
-
console.log(`[strategy-merge] Merge conflict escalation already pending for delivery ${deliveryId}, skipping duplicate`);
|
|
48
|
-
return;
|
|
49
|
-
}
|
|
50
|
-
pendingMergeConflictDeliveries.add(deliveryId);
|
|
51
|
-
try {
|
|
52
|
-
await withRetry(() => createEscalation({
|
|
53
|
-
organizationId,
|
|
54
|
-
sessionId,
|
|
55
|
-
issueId: null,
|
|
56
|
-
reasonType: ESCALATION_REASONS.ERROR_ENCOUNTERED,
|
|
57
|
-
description: `Merge conflict merging strategy branch into integration.\n\n` +
|
|
58
|
-
`**Delivery:** ${deliveryName}\n` +
|
|
59
|
-
`**Source branch:** ${branchName}\n` +
|
|
60
|
-
`**Target branch:** ${integrationBranch}\n` +
|
|
61
|
-
`**Error:** ${mergeError}\n\n` +
|
|
62
|
-
`The branch has been preserved. Resolve the conflict and mark the escalation as resolved to trigger a retry.`,
|
|
63
|
-
whatWasTried: `Attempted automatic merge of ${branchName} into ${integrationBranch}.`,
|
|
64
|
-
helpNeeded: `Resolve the merge conflicts between ${branchName} and ${integrationBranch}, then mark this escalation as resolved.`,
|
|
65
|
-
}), { maxAttempts: 3, label: `escalation-strategy-merge-conflict-${deliveryId}` });
|
|
66
|
-
console.log(`[strategy-merge] Created merge conflict escalation for delivery "${deliveryName}"`);
|
|
67
|
-
}
|
|
68
|
-
catch (err) {
|
|
69
|
-
console.error(`[strategy-merge] Failed to create merge conflict escalation for "${deliveryName}": ${err.message}`);
|
|
70
|
-
// Remove from pending set so a retry can create it later
|
|
71
|
-
pendingMergeConflictDeliveries.delete(deliveryId);
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* Clear the pending merge conflict flag for a delivery (e.g., after successful retry).
|
|
76
|
-
*/
|
|
77
|
-
export function clearMergeConflictFlag(deliveryId) {
|
|
78
|
-
pendingMergeConflictDeliveries.delete(deliveryId);
|
|
79
|
-
}
|
|
80
|
-
/**
|
|
81
|
-
* Check for deliveries stuck in merge_conflict state and retry the merge.
|
|
82
|
-
*
|
|
83
|
-
* Called once per poll cycle. Queries the API for deliveries with
|
|
84
|
-
* merge_conflict git state, groups them by branch (to avoid duplicate
|
|
85
|
-
* merges), and retries mergeToIntegration for each unique branch.
|
|
86
|
-
*
|
|
87
|
-
* On success: reports merged_to_integration for all deliveries on that
|
|
88
|
-
* branch and clears their pending merge conflict flags.
|
|
89
|
-
* On failure: logs quietly (the existing escalation remains active).
|
|
90
|
-
*/
|
|
91
|
-
export async function checkResolvedMergeConflicts(config) {
|
|
92
|
-
let conflictDeliveries;
|
|
93
|
-
try {
|
|
94
|
-
conflictDeliveries = await getMergeConflictDeliveries(config.organizationId, config.productId);
|
|
95
|
-
}
|
|
96
|
-
catch (err) {
|
|
97
|
-
console.warn(`[strategy-merge] Failed to fetch merge conflict deliveries:`, err.message);
|
|
98
|
-
return;
|
|
99
|
-
}
|
|
100
|
-
if (conflictDeliveries.length === 0)
|
|
101
|
-
return;
|
|
102
|
-
// Group deliveries by branch so we only merge once per branch
|
|
103
|
-
const byBranch = new Map();
|
|
104
|
-
for (const d of conflictDeliveries) {
|
|
105
|
-
if (!d.git_branch_name)
|
|
106
|
-
continue;
|
|
107
|
-
const group = byBranch.get(d.git_branch_name) ?? [];
|
|
108
|
-
group.push(d);
|
|
109
|
-
byBranch.set(d.git_branch_name, group);
|
|
110
|
-
}
|
|
111
|
-
for (const [branchName, deliveries] of byBranch) {
|
|
112
|
-
const representative = deliveries[0];
|
|
113
|
-
console.log(`[strategy-merge] Retrying merge for branch ${branchName} ` +
|
|
114
|
-
`(${deliveries.length} delivery/ies in merge_conflict state)`);
|
|
115
|
-
const mergeResult = await mergeToIntegration({
|
|
116
|
-
config,
|
|
117
|
-
branchName,
|
|
118
|
-
deliveryName: representative.delivery_name,
|
|
119
|
-
deliveryId: representative.delivery_id,
|
|
120
|
-
});
|
|
121
|
-
if (mergeResult.success) {
|
|
122
|
-
console.log(`[strategy-merge] Merge retry succeeded for branch ${branchName}`);
|
|
123
|
-
// Update all deliveries in this branch group
|
|
124
|
-
for (const d of deliveries) {
|
|
125
|
-
clearMergeConflictFlag(d.delivery_id);
|
|
126
|
-
reportGitState(d.delivery_id, 'merged_to_integration').catch((err) => console.warn(`[strategy-merge] reportGitState merged_to_integration failed for ${d.delivery_id}:`, err.message));
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
else {
|
|
130
|
-
console.log(`[strategy-merge] Merge retry still failing for branch ${branchName}: ${mergeResult.error ?? 'unknown'}`);
|
|
131
|
-
// Attempt fallback resolution agent if a worktree exists for this strategy
|
|
132
|
-
if (representative.strategy_id) {
|
|
133
|
-
const worktreeInfo = getStrategyWorktree(representative.strategy_id);
|
|
134
|
-
if (worktreeInfo) {
|
|
135
|
-
console.log(`[strategy-merge] Spawning fallback resolution agent for branch ${branchName}`);
|
|
136
|
-
// Merge integration back into the strategy worktree to surface conflicts
|
|
137
|
-
const mergeBackResult = await mergeBackFromIntegration({
|
|
138
|
-
worktreePath: worktreeInfo.worktreePath,
|
|
139
|
-
integrationBranch: config.integrationBranch,
|
|
140
|
-
});
|
|
141
|
-
if (mergeBackResult.status === 'conflict') {
|
|
142
|
-
const fallbackResult = await spawnResolutionAgent({
|
|
143
|
-
config,
|
|
144
|
-
worktreePath: worktreeInfo.worktreePath,
|
|
145
|
-
branchName,
|
|
146
|
-
integrationBranch: config.integrationBranch,
|
|
147
|
-
conflictFiles: mergeBackResult.conflictFiles ?? [],
|
|
148
|
-
strategyDescription: worktreeInfo.strategyName || branchName,
|
|
149
|
-
});
|
|
150
|
-
if (fallbackResult.success) {
|
|
151
|
-
// Retry merge after resolution
|
|
152
|
-
const retryResult = await mergeToIntegration({
|
|
153
|
-
config,
|
|
154
|
-
branchName,
|
|
155
|
-
deliveryName: representative.delivery_name,
|
|
156
|
-
deliveryId: representative.delivery_id,
|
|
157
|
-
});
|
|
158
|
-
if (retryResult.success) {
|
|
159
|
-
console.log(`[strategy-merge] Merge succeeded after fallback resolution for branch ${branchName}`);
|
|
160
|
-
for (const d of deliveries) {
|
|
161
|
-
clearMergeConflictFlag(d.delivery_id);
|
|
162
|
-
reportGitState(d.delivery_id, 'merged_to_integration').catch((err) => console.warn(`[strategy-merge] reportGitState failed for ${d.delivery_id}:`, err.message));
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
// ── Team lead conflict resolution ────────────────────────────────
|
|
173
|
-
/** Default timeout for team lead to resolve merge conflicts (5 minutes). */
|
|
174
|
-
const MERGE_CONFLICT_RESOLUTION_TIMEOUT_MS = 5 * 60 * 1000;
|
|
175
|
-
/** Poll interval when waiting for conflict resolution (5 seconds). */
|
|
176
|
-
const RESOLUTION_POLL_INTERVAL_MS = 5000;
|
|
177
|
-
/**
|
|
178
|
-
* Request the team lead to resolve merge conflicts in the worktree.
|
|
179
|
-
*
|
|
180
|
-
* Sends a user message via stdin with conflict details and instructions,
|
|
181
|
-
* then polls git state to detect when conflicts are resolved (no more
|
|
182
|
-
* unmerged files and a merge commit exists).
|
|
183
|
-
*
|
|
184
|
-
* Returns when resolution is detected or timeout expires.
|
|
185
|
-
*/
|
|
186
|
-
export async function requestTeamLeadResolution(teamState, conflictFiles, branchName, integrationBranch, timeoutMs = MERGE_CONFLICT_RESOLUTION_TIMEOUT_MS) {
|
|
187
|
-
const { leadStdin, worktreePath, strategyName } = teamState;
|
|
188
|
-
if (!leadStdin || !worktreePath) {
|
|
189
|
-
return { resolved: false, reason: 'No active team lead stdin or worktree' };
|
|
190
|
-
}
|
|
191
|
-
// Set concurrency guard
|
|
192
|
-
teamState.resolvingMergeConflict = true;
|
|
193
|
-
try {
|
|
194
|
-
// Send conflict resolution instructions to the team lead
|
|
195
|
-
const message = `MERGE CONFLICT RESOLUTION NEEDED\n\n` +
|
|
196
|
-
`The integration branch has changes that conflict with your strategy branch.\n\n` +
|
|
197
|
-
`**Conflicted files:**\n${conflictFiles.map(f => `- ${f}`).join('\n')}\n\n` +
|
|
198
|
-
`**Source:** origin/${integrationBranch}\n` +
|
|
199
|
-
`**Target:** ${branchName}\n\n` +
|
|
200
|
-
`**Instructions:**\n` +
|
|
201
|
-
`1. Open each conflicted file and resolve the conflict markers (<<<<<<< / ======= / >>>>>>>)\n` +
|
|
202
|
-
`2. Stage each resolved file with: git add <file>\n` +
|
|
203
|
-
`3. Commit the merge resolution: git commit --no-edit\n` +
|
|
204
|
-
`4. Run: npm run build && npm test\n` +
|
|
205
|
-
`5. If build+test fails, fix the issues, commit, and re-run\n\n` +
|
|
206
|
-
`Do NOT run git merge --abort. Your goal is to produce a clean merge commit that passes build and tests.`;
|
|
207
|
-
sendMessage(leadStdin, message);
|
|
208
|
-
console.log(`[strategy-merge] Sent merge conflict resolution request to team lead for "${strategyName}"`);
|
|
209
|
-
// Poll git state to detect resolution
|
|
210
|
-
const deadline = Date.now() + timeoutMs;
|
|
211
|
-
const preResolutionHead = runGitSync(['rev-parse', 'HEAD'], worktreePath).output;
|
|
212
|
-
while (Date.now() < deadline) {
|
|
213
|
-
await new Promise(resolve => setTimeout(resolve, RESOLUTION_POLL_INTERVAL_MS));
|
|
214
|
-
// Check if unmerged files remain
|
|
215
|
-
const unmergedResult = runGitSync(['diff', '--name-only', '--diff-filter=U'], worktreePath);
|
|
216
|
-
const unmergedFiles = unmergedResult.success
|
|
217
|
-
? unmergedResult.output.split('\n').filter(Boolean)
|
|
218
|
-
: [];
|
|
219
|
-
if (unmergedFiles.length === 0) {
|
|
220
|
-
// No unmerged files -- check if HEAD advanced (merge commit created)
|
|
221
|
-
const currentHead = runGitSync(['rev-parse', 'HEAD'], worktreePath).output;
|
|
222
|
-
if (currentHead !== preResolutionHead) {
|
|
223
|
-
console.log(`[strategy-merge] Team lead resolved merge conflicts for "${strategyName}"`);
|
|
224
|
-
return { resolved: true };
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
// Timeout expired
|
|
229
|
-
console.warn(`[strategy-merge] Team lead did not resolve merge conflicts within ${timeoutMs / 1000}s for "${strategyName}"`);
|
|
230
|
-
return { resolved: false, reason: `Resolution timeout (${timeoutMs / 1000}s)` };
|
|
231
|
-
}
|
|
232
|
-
finally {
|
|
233
|
-
teamState.resolvingMergeConflict = false;
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
/**
|
|
237
|
-
* Merge the strategy branch to integration.
|
|
238
|
-
*
|
|
239
|
-
* Uses the first delivery ID as the representative for merge operations
|
|
240
|
-
* (all deliveries share the same branch in the strategy model).
|
|
241
|
-
*
|
|
242
|
-
* `workedDeliveryIds` is the set of deliveries the team actually built in
|
|
243
|
-
* this merge cycle. Git state and the merge commit SHA are recorded only
|
|
244
|
-
* for these deliveries — never for queued/planning deliveries that happen
|
|
245
|
-
* to share the same strategy branch but were never touched.
|
|
246
|
-
*/
|
|
247
|
-
export async function mergeStrategyBranch(config, teamState, sessionId, branchName, workedDeliveryIds) {
|
|
248
|
-
// Empty-set guard: planning teams may exit before any deliveries are
|
|
249
|
-
// worked (human cleared the agent role mid-planning, planning failed,
|
|
250
|
-
// etc.). With workedDeliveryIds required, this also covers the old
|
|
251
|
-
// "no deliveries to merge" case.
|
|
252
|
-
if (workedDeliveryIds.length === 0) {
|
|
253
|
-
return { mergeSucceeded: false, exitReason: 'No worked deliveries to merge.' };
|
|
254
|
-
}
|
|
255
|
-
// Use first worked delivery as the representative for merge operations
|
|
256
|
-
const representativeDeliveryId = workedDeliveryIds[0];
|
|
257
|
-
// Fetch workflow for merge operations (used only for conflict rollback stage lookup)
|
|
258
|
-
let workflow;
|
|
259
|
-
try {
|
|
260
|
-
workflow = await fetchEffectiveWorkflow(representativeDeliveryId);
|
|
261
|
-
}
|
|
262
|
-
catch (err) {
|
|
263
|
-
console.warn(`[strategy-executor] Failed to fetch workflow for merge, using fallback:`, err.message);
|
|
264
|
-
workflow = { id: 'fallback', stages: [] };
|
|
265
|
-
}
|
|
266
|
-
// ── Merge-back: sync integration into strategy branch before merging out ──
|
|
267
|
-
// Merge integration HEAD into the strategy branch to surface conflicts early
|
|
268
|
-
const worktreePath = teamState.worktreePath;
|
|
269
|
-
if (worktreePath) {
|
|
270
|
-
const mergeBackResult = await mergeBackFromIntegration({
|
|
271
|
-
worktreePath,
|
|
272
|
-
integrationBranch: config.integrationBranch,
|
|
273
|
-
});
|
|
274
|
-
if (mergeBackResult.status === 'conflict') {
|
|
275
|
-
const conflictFiles = mergeBackResult.conflictFiles ?? [];
|
|
276
|
-
console.log(`[strategy-merge] Merge-back produced conflicts for "${teamState.strategyName}": ` +
|
|
277
|
-
`${conflictFiles.join(', ') || 'unknown files'}`);
|
|
278
|
-
// If team lead is alive, delegate resolution to them
|
|
279
|
-
if (teamState.leadStdin && teamState.phase === 'executing') {
|
|
280
|
-
const resolution = await requestTeamLeadResolution(teamState, conflictFiles, branchName, config.integrationBranch);
|
|
281
|
-
if (resolution.resolved) {
|
|
282
|
-
// Agent committed the merge resolution, proceed to integration merge
|
|
283
|
-
console.log(`[strategy-merge] Conflict resolved by team lead for "${teamState.strategyName}", proceeding`);
|
|
284
|
-
}
|
|
285
|
-
else {
|
|
286
|
-
// Team lead could not resolve -- escalate
|
|
287
|
-
await escalateMergeConflict({
|
|
288
|
-
organizationId: teamState.organizationId,
|
|
289
|
-
sessionId,
|
|
290
|
-
deliveryId: representativeDeliveryId,
|
|
291
|
-
deliveryName: teamState.strategyName,
|
|
292
|
-
branchName,
|
|
293
|
-
integrationBranch: config.integrationBranch,
|
|
294
|
-
mergeError: `Merge-back conflict unresolved: ${resolution.reason ?? 'unknown'}`,
|
|
295
|
-
});
|
|
296
|
-
return { mergeSucceeded: false, exitReason: 'merge_back_conflict_unresolved' };
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
|
-
else {
|
|
300
|
-
// No active team lead -- spawn a short-lived resolution agent
|
|
301
|
-
console.log(`[strategy-merge] No active team lead for "${teamState.strategyName}", spawning fallback resolution agent`);
|
|
302
|
-
// Report resolving_conflict state for all unmerged deliveries
|
|
303
|
-
for (const deliveryId of teamState.knownDeliveryIds) {
|
|
304
|
-
if (!teamState.mergedDeliveryIds.has(deliveryId)) {
|
|
305
|
-
reportGitState(deliveryId, 'resolving_conflict').catch(err => console.warn(`[strategy-merge] reportGitState resolving_conflict failed for ${deliveryId}:`, err.message));
|
|
306
|
-
}
|
|
307
|
-
}
|
|
308
|
-
const fallbackResult = await spawnResolutionAgent({
|
|
309
|
-
config,
|
|
310
|
-
worktreePath,
|
|
311
|
-
branchName,
|
|
312
|
-
integrationBranch: config.integrationBranch,
|
|
313
|
-
conflictFiles,
|
|
314
|
-
strategyDescription: teamState.strategyName,
|
|
315
|
-
});
|
|
316
|
-
if (fallbackResult.success) {
|
|
317
|
-
console.log(`[strategy-merge] Fallback resolution agent resolved conflicts for "${teamState.strategyName}", proceeding`);
|
|
318
|
-
}
|
|
319
|
-
else {
|
|
320
|
-
await escalateMergeConflict({
|
|
321
|
-
organizationId: teamState.organizationId,
|
|
322
|
-
sessionId,
|
|
323
|
-
deliveryId: representativeDeliveryId,
|
|
324
|
-
deliveryName: teamState.strategyName,
|
|
325
|
-
branchName,
|
|
326
|
-
integrationBranch: config.integrationBranch,
|
|
327
|
-
mergeError: `Fallback resolution agent failed: ${fallbackResult.error ?? 'unknown'}`,
|
|
328
|
-
});
|
|
329
|
-
return { mergeSucceeded: false, exitReason: 'merge_back_conflict_unresolved' };
|
|
330
|
-
}
|
|
331
|
-
}
|
|
332
|
-
}
|
|
333
|
-
if (mergeBackResult.status === 'error') {
|
|
334
|
-
console.error(`[strategy-merge] Merge-back error for "${teamState.strategyName}": ${mergeBackResult.message}`);
|
|
335
|
-
return { mergeSucceeded: false, exitReason: mergeBackResult.message };
|
|
336
|
-
}
|
|
337
|
-
// status === 'clean' -- proceed to merge to integration
|
|
338
|
-
console.log(`[strategy-merge] Merge-back clean for "${teamState.strategyName}", proceeding to integration merge`);
|
|
339
|
-
}
|
|
340
|
-
const mergeOutcome = await mergeDeliveryBranch({
|
|
341
|
-
config,
|
|
342
|
-
branchName,
|
|
343
|
-
deliveryId: representativeDeliveryId,
|
|
344
|
-
deliveryName: teamState.strategyName,
|
|
345
|
-
organizationId: teamState.organizationId,
|
|
346
|
-
sessionId,
|
|
347
|
-
workflow,
|
|
348
|
-
strategyId: teamState.strategyId,
|
|
349
|
-
});
|
|
350
|
-
// Report git state and merge commit SHA only for deliveries that were
|
|
351
|
-
// actually worked on, never for queued/planning deliveries on the same branch.
|
|
352
|
-
const deliveryIdsForGitState = new Set(workedDeliveryIds);
|
|
353
|
-
if (mergeOutcome.mergeSucceeded) {
|
|
354
|
-
for (const deliveryId of deliveryIdsForGitState) {
|
|
355
|
-
if (!teamState.mergedDeliveryIds.has(deliveryId)) {
|
|
356
|
-
reportGitState(deliveryId, 'merged_to_integration').catch(err => console.warn(`[strategy-executor] reportGitState merged_to_integration failed for ${deliveryId}:`, err.message));
|
|
357
|
-
// Propagate the merge commit SHA to all deliveries so the git state
|
|
358
|
-
// detector can track their containment in main/remote independently.
|
|
359
|
-
if (mergeOutcome.commitSha) {
|
|
360
|
-
updateDeliveryMergeCommitSha(deliveryId, mergeOutcome.commitSha).catch(err => console.warn(`[strategy-merge] updateDeliveryMergeCommitSha failed for ${deliveryId}:`, err.message));
|
|
361
|
-
}
|
|
362
|
-
}
|
|
363
|
-
}
|
|
364
|
-
}
|
|
365
|
-
else {
|
|
366
|
-
// Report merge_conflict state for worked deliveries only
|
|
367
|
-
for (const deliveryId of deliveryIdsForGitState) {
|
|
368
|
-
if (!teamState.mergedDeliveryIds.has(deliveryId)) {
|
|
369
|
-
reportMergeConflictState(deliveryId, branchName).catch(err => console.warn(`[strategy-merge] reportMergeConflictState failed for ${deliveryId}:`, err.message));
|
|
370
|
-
}
|
|
371
|
-
}
|
|
372
|
-
}
|
|
373
|
-
return {
|
|
374
|
-
mergeSucceeded: mergeOutcome.mergeSucceeded,
|
|
375
|
-
exitReason: mergeOutcome.exitReason,
|
|
376
|
-
};
|
|
377
|
-
}
|
|
378
|
-
//# sourceMappingURL=strategy-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B,4BAA4B,CAAC,UAAU,EAAE,YAAY,CAAC,SAAS,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAC3E,OAAO,CAAC,IAAI,CAAC,4DAA4D,UAAU,GAAG,EAAG,GAAa,CAAC,OAAO,CAAC,CAChH,CAAC;gBACJ,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;SAAM,CAAC;QACN,yDAAyD;QACzD,KAAK,MAAM,UAAU,IAAI,sBAAsB,EAAE,CAAC;YAChD,IAAI,CAAC,SAAS,CAAC,iBAAiB,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC;gBACjD,wBAAwB,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAC3D,OAAO,CAAC,IAAI,CAAC,wDAAwD,UAAU,GAAG,EAAG,GAAa,CAAC,OAAO,CAAC,CAC5G,CAAC;YACJ,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO;QACL,cAAc,EAAE,YAAY,CAAC,cAAc;QAC3C,UAAU,EAAE,YAAY,CAAC,UAAU;KACpC,CAAC;AACJ,CAAC"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Strategy team prompt builder.
|
|
3
|
-
*
|
|
4
|
-
* The core prompt building logic lives in team-prompt-base.ts (section builders
|
|
5
|
-
* + buildStrategyTeamPrompt). This file re-exports the main entry points for
|
|
6
|
-
* backward compatibility and houses buildWakeMessage (wake-only, not part of
|
|
7
|
-
* the role framework).
|
|
8
|
-
*
|
|
9
|
-
* Planning prompts have been extracted to planning-prompt-builder.ts
|
|
10
|
-
* and are re-exported here for backward compatibility.
|
|
11
|
-
*/
|
|
12
|
-
import type { StrategyDeliveryInfo, StrategyIssueInfo } from './types.js';
|
|
13
|
-
export type { DeploymentProfileSnapshotContext, StrategyTeamPromptContext } from './team-prompt-base.js';
|
|
14
|
-
export { buildStrategyTeamPrompt } from './team-prompt-base.js';
|
|
15
|
-
/**
|
|
16
|
-
* Build a wake message for an idle team when new work is available.
|
|
17
|
-
*
|
|
18
|
-
* The team already has role context and execution instructions from the
|
|
19
|
-
* initial prompt. This message is a lean update with just the new work.
|
|
20
|
-
*/
|
|
21
|
-
export declare function buildWakeMessage(deliveries: StrategyDeliveryInfo[], issues: StrategyIssueInfo[], knownDeliveryIds: Set<string>): string;
|
|
22
|
-
export type { PlanningPass1Context, PlanningPass2Context } from './planning-prompt-builder.js';
|
|
23
|
-
export { buildPlanningPass1Prompt, buildPlanningPass2Prompt, buildPlanningCombinedPrompt } from './planning-prompt-builder.js';
|
|
24
|
-
//# sourceMappingURL=strategy-prompt-builder.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"strategy-prompt-builder.d.ts","sourceRoot":"","sources":["../src/strategy-prompt-builder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EACV,oBAAoB,EACpB,iBAAiB,EAClB,MAAM,YAAY,CAAC;AAIpB,YAAY,EAAE,gCAAgC,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AACzG,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAEhE;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAC9B,UAAU,EAAE,oBAAoB,EAAE,EAClC,MAAM,EAAE,iBAAiB,EAAE,EAC3B,gBAAgB,EAAE,GAAG,CAAC,MAAM,CAAC,GAC5B,MAAM,CA2ER;AAMD,YAAY,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAC/F,OAAO,EAAE,wBAAwB,EAAE,wBAAwB,EAAE,2BAA2B,EAAE,MAAM,8BAA8B,CAAC"}
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Strategy team prompt builder.
|
|
3
|
-
*
|
|
4
|
-
* The core prompt building logic lives in team-prompt-base.ts (section builders
|
|
5
|
-
* + buildStrategyTeamPrompt). This file re-exports the main entry points for
|
|
6
|
-
* backward compatibility and houses buildWakeMessage (wake-only, not part of
|
|
7
|
-
* the role framework).
|
|
8
|
-
*
|
|
9
|
-
* Planning prompts have been extracted to planning-prompt-builder.ts
|
|
10
|
-
* and are re-exported here for backward compatibility.
|
|
11
|
-
*/
|
|
12
|
-
import { isStatusAgentActionable } from './stage-classifier.js';
|
|
13
|
-
export { buildStrategyTeamPrompt } from './team-prompt-base.js';
|
|
14
|
-
/**
|
|
15
|
-
* Build a wake message for an idle team when new work is available.
|
|
16
|
-
*
|
|
17
|
-
* The team already has role context and execution instructions from the
|
|
18
|
-
* initial prompt. This message is a lean update with just the new work.
|
|
19
|
-
*/
|
|
20
|
-
export function buildWakeMessage(deliveries, issues, knownDeliveryIds) {
|
|
21
|
-
const parts = [];
|
|
22
|
-
parts.push('## New Work Available');
|
|
23
|
-
parts.push('');
|
|
24
|
-
const actionableDeliveries = deliveries.filter(d => isStatusAgentActionable(d.executionStatus ?? ''));
|
|
25
|
-
if (actionableDeliveries.length === 0) {
|
|
26
|
-
parts.push('No actionable deliveries at this time.');
|
|
27
|
-
parts.push('');
|
|
28
|
-
return parts.join('\n');
|
|
29
|
-
}
|
|
30
|
-
for (const delivery of actionableDeliveries) {
|
|
31
|
-
const isNew = !knownDeliveryIds.has(delivery.id);
|
|
32
|
-
const tag = isNew ? ' (NEW)' : '';
|
|
33
|
-
parts.push(`### ${delivery.name} [${delivery.executionStatus}]${tag}`);
|
|
34
|
-
parts.push(`**Delivery ID:** ${delivery.id}`);
|
|
35
|
-
if (delivery.stageDescription) {
|
|
36
|
-
parts.push(`**Stage directive:** ${delivery.stageDescription}`);
|
|
37
|
-
}
|
|
38
|
-
if (delivery.description) {
|
|
39
|
-
parts.push(`**Description:** ${delivery.description}`);
|
|
40
|
-
}
|
|
41
|
-
// Compact issue listing
|
|
42
|
-
const deliveryIssues = issues.filter(i => i.deliveryId === delivery.id);
|
|
43
|
-
const actionableIssues = deliveryIssues.filter(i => i.issueType !== 'Context Group');
|
|
44
|
-
if (actionableIssues.length > 0) {
|
|
45
|
-
const statusCounts = new Map();
|
|
46
|
-
for (const issue of actionableIssues) {
|
|
47
|
-
statusCounts.set(issue.status, (statusCounts.get(issue.status) ?? 0) + 1);
|
|
48
|
-
}
|
|
49
|
-
const countParts = [];
|
|
50
|
-
for (const s of ['To Do', 'In Progress', 'Done', 'Blocked', 'In Review']) {
|
|
51
|
-
const count = statusCounts.get(s);
|
|
52
|
-
if (count !== undefined) {
|
|
53
|
-
countParts.push(`${count} ${s}`);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
parts.push(`**Issues (${countParts.join(', ')}):**`);
|
|
57
|
-
}
|
|
58
|
-
const wakeContextGroups = deliveryIssues.filter(i => i.issueType === 'Context Group');
|
|
59
|
-
for (const issue of deliveryIssues) {
|
|
60
|
-
if (issue.issueType === 'Context Group') {
|
|
61
|
-
const children = deliveryIssues.filter(i => i.parentIssueId === issue.id);
|
|
62
|
-
const depsSuffix = issue.dependsOn && issue.dependsOn.length > 0
|
|
63
|
-
? ` [depends on: ${issue.dependsOn.map(depId => {
|
|
64
|
-
const depCg = wakeContextGroups.find(cg => cg.id === depId);
|
|
65
|
-
return depCg ? `"${depCg.title}"` : depId;
|
|
66
|
-
}).join(', ')}]`
|
|
67
|
-
: '';
|
|
68
|
-
if (children.length > 0) {
|
|
69
|
-
const childSummaries = children.map(c => `${c.key} (${c.status})`).join(', ');
|
|
70
|
-
parts.push(` Context Group: "${issue.title}"${depsSuffix} -- children: ${childSummaries}`);
|
|
71
|
-
}
|
|
72
|
-
else {
|
|
73
|
-
parts.push(` Context Group: "${issue.title}"${depsSuffix}`);
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
else if (!issue.parentIssueId) {
|
|
77
|
-
parts.push(` - ${issue.key}: ${issue.title} (${issue.status})`);
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
parts.push('');
|
|
81
|
-
}
|
|
82
|
-
parts.push('Do NOT poll for new deliveries. The daemon will send them to you directly.');
|
|
83
|
-
parts.push('');
|
|
84
|
-
return parts.join('\n');
|
|
85
|
-
}
|
|
86
|
-
export { buildPlanningPass1Prompt, buildPlanningPass2Prompt, buildPlanningCombinedPrompt } from './planning-prompt-builder.js';
|
|
87
|
-
//# sourceMappingURL=strategy-prompt-builder.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"strategy-prompt-builder.js","sourceRoot":"","sources":["../src/strategy-prompt-builder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAMH,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAIhE,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAEhE;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB,CAC9B,UAAkC,EAClC,MAA2B,EAC3B,gBAA6B;IAE7B,MAAM,KAAK,GAAa,EAAE,CAAC;IAE3B,KAAK,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAC;IACpC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAEf,MAAM,oBAAoB,GAAG,UAAU,CAAC,MAAM,CAC5C,CAAC,CAAC,EAAE,CAAC,uBAAuB,CAAC,CAAC,CAAC,eAAe,IAAI,EAAE,CAAC,CACtD,CAAC;IAEF,IAAI,oBAAoB,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACtC,KAAK,CAAC,IAAI,CAAC,wCAAwC,CAAC,CAAC;QACrD,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACf,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;IAED,KAAK,MAAM,QAAQ,IAAI,oBAAoB,EAAE,CAAC;QAC5C,MAAM,KAAK,GAAG,CAAC,gBAAgB,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;QACjD,MAAM,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,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CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;oBAC9E,KAAK,CAAC,IAAI,CAAC,qBAAqB,KAAK,CAAC,KAAK,IAAI,UAAU,iBAAiB,cAAc,EAAE,CAAC,CAAC;gBAC9F,CAAC;qBAAM,CAAC;oBACN,KAAK,CAAC,IAAI,CAAC,qBAAqB,KAAK,CAAC,KAAK,IAAI,UAAU,EAAE,CAAC,CAAC;gBAC/D,CAAC;YACH,CAAC;iBAAM,IAAI,CAAC,KAAK,CAAC,aAAa,EAAE,CAAC;gBAChC,KAAK,CAAC,IAAI,CAAC,OAAO,KAAK,CAAC,GAAG,KAAK,KAAK,CAAC,KAAK,KAAK,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC;YACnE,CAAC;QACH,CAAC;QAED,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACjB,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,4EAA4E,CAAC,CAAC;IACzF,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAEf,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC;AAOD,OAAO,EAAE,wBAAwB,EAAE,wBAAwB,EAAE,2BAA2B,EAAE,MAAM,8BAA8B,CAAC"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Persistent worktree provisioning for active strategies.
|
|
3
|
-
*
|
|
4
|
-
* Creates worktrees for active strategies that don't have one yet,
|
|
5
|
-
* adopts existing worktrees on disk, and rebases onto integration.
|
|
6
|
-
*/
|
|
7
|
-
import type { DaemonConfig, AgentRole } from './types.js';
|
|
8
|
-
/**
|
|
9
|
-
* Ensure persistent worktrees exist for all active strategies.
|
|
10
|
-
*
|
|
11
|
-
* Called each poll cycle BEFORE processReadyStrategies(). Creates
|
|
12
|
-
* worktrees for active strategies that don't have one yet.
|
|
13
|
-
* Syncs integration with main once per cycle (not per strategy).
|
|
14
|
-
*/
|
|
15
|
-
export declare function ensureStrategyWorktrees(config: DaemonConfig, roles: Map<string, AgentRole>): Promise<void>;
|
|
16
|
-
//# sourceMappingURL=strategy-provisioning.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"strategy-provisioning.d.ts","sourceRoot":"","sources":["../src/strategy-provisioning.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAW1D;;;;;;GAMG;AACH,wBAAsB,uBAAuB,CAC3C,MAAM,EAAE,YAAY,EACpB,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,GAC5B,OAAO,CAAC,IAAI,CAAC,CAsGf"}
|