@telora/daemon 0.21.198 → 0.22.4

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 (39) hide show
  1. package/build-info.json +7 -3
  2. package/dist/completion/merge-phase.d.ts.map +1 -1
  3. package/dist/completion/merge-phase.js +2 -1
  4. package/dist/completion/merge-phase.js.map +1 -1
  5. package/dist/completion/team-lifecycle.d.ts.map +1 -1
  6. package/dist/completion/team-lifecycle.js +48 -28
  7. package/dist/completion/team-lifecycle.js.map +1 -1
  8. package/dist/focus/focus-lifecycle.js +1 -1
  9. package/dist/focus/focus-lifecycle.js.map +1 -1
  10. package/dist/merge/focus-merge.d.ts +55 -62
  11. package/dist/merge/focus-merge.d.ts.map +1 -1
  12. package/dist/merge/focus-merge.js +181 -242
  13. package/dist/merge/focus-merge.js.map +1 -1
  14. package/dist/merge/merge-conflict-escalation.d.ts +60 -0
  15. package/dist/merge/merge-conflict-escalation.d.ts.map +1 -0
  16. package/dist/merge/merge-conflict-escalation.js +131 -0
  17. package/dist/merge/merge-conflict-escalation.js.map +1 -0
  18. package/dist/queries/linear-linked.d.ts +53 -0
  19. package/dist/queries/linear-linked.d.ts.map +1 -0
  20. package/dist/queries/linear-linked.js +120 -0
  21. package/dist/queries/linear-linked.js.map +1 -0
  22. package/dist/queries/schemas.d.ts.map +1 -1
  23. package/dist/queries/schemas.js +1 -0
  24. package/dist/queries/schemas.js.map +1 -1
  25. package/dist/resolvers/assembly-engine.d.ts.map +1 -1
  26. package/dist/resolvers/assembly-engine.js +1 -0
  27. package/dist/resolvers/assembly-engine.js.map +1 -1
  28. package/dist/resolvers/index.d.ts.map +1 -1
  29. package/dist/resolvers/index.js +2 -0
  30. package/dist/resolvers/index.js.map +1 -1
  31. package/dist/resolvers/linear-linked-issues.d.ts +40 -0
  32. package/dist/resolvers/linear-linked-issues.d.ts.map +1 -0
  33. package/dist/resolvers/linear-linked-issues.js +164 -0
  34. package/dist/resolvers/linear-linked-issues.js.map +1 -0
  35. package/dist/templates/claude-md.d.ts +1 -1
  36. package/dist/templates/claude-md.d.ts.map +1 -1
  37. package/dist/templates/claude-md.js +20 -0
  38. package/dist/templates/claude-md.js.map +1 -1
  39. package/package.json +2 -2
@@ -1,14 +1,12 @@
1
1
  // PINNED-BY-BEGIN (generated by gen:pinned-by -- do not hand-edit; checked by lint:pinned-by)
2
2
  // Pinned by: packages/daemon/src/integration/agent-owned-scoping-integration.test.ts,
3
3
  // packages/daemon/src/merge/dirty-worktree-merge-refusal.test.ts,
4
- // packages/daemon/src/merge/focus-merge-empty-deliveries.test.ts,
5
- // packages/daemon/src/merge/merge-conflict-escalation-dedup.test.ts,
6
- // packages/daemon/src/merge/merge-failure-classification.test.ts
4
+ // packages/daemon/src/merge/focus-merge-empty-deliveries.test.ts
7
5
  // PINNED-BY-END
8
6
  import { runGitSync } from '../git/index.js';
9
7
  import { fetchEffectiveWorkflow } from '../queries/workflows.js';
10
- import { mergeToIntegration } from '../git/exec.js';
11
8
  import { mergeBackFromIntegration } from '../git/index.js';
9
+ import { mergeToIntegration } from '../git/exec.js';
12
10
  import { mergeDeliveryBranch } from '../delivery/delivery-lifecycle.js';
13
11
  import { createEscalation, hasOpenWorktreeDirtyEscalation, resolveOpenWorktreeDirtyEscalations, MERGE_CONFLICT_ESCALATION_KIND, MERGE_REFUSED_DIRTY_ESCALATION_KIND } from '../queries/escalations.js';
14
12
  import { updateDeliveryMergeCommitSha, reportGitState, getMergeConflictDeliveries } from '../queries/deliveries.js';
@@ -22,6 +20,7 @@ import { spawnResolutionAgent } from '../spawn/lifecycle.js';
22
20
  import { getFocusWorktree } from '../focus/focus-worktree-state.js';
23
21
  import { worktreeHasUncommittedChanges } from '../worktree/index.js';
24
22
  import { classifyMergeFailure } from './merge-failure-classify.js';
23
+ import { escalateMergeConflict, reportMergeConflictState } from './merge-conflict-escalation.js';
25
24
  import { createLogger } from '../shell/log.js';
26
25
  const log = createLogger({ module: 'focus-merge' });
27
26
  /**
@@ -29,11 +28,17 @@ const log = createLogger({ module: 'focus-merge' });
29
28
  *
30
29
  * A merge of a dirty worktree would either silently drop the uncommitted work
31
30
  * or merge an unintended tree -- never acceptable. This guard runs before any
32
- * merge attempt: if the worktree is dirty it files an escalation (deduped
33
- * durably at focus grain across the sibling classes -- see
34
- * hasOpenWorktreeDirtyEscalation) and returns refused=true so the caller aborts
35
- * the merge. A read-only audit worktree that an agent dirtied is the canonical
36
- * case, but the guard is generic -- any dirty worktree refuses.
31
+ * merge attempt: if the worktree is dirty it aborts the merge (returns
32
+ * refused=true so the caller stops).
33
+ *
34
+ * What it does about the dirty tree depends on `policy`:
35
+ * - `escalate` (default): the dirty tree is a FAULT -- file an escalation
36
+ * (deduped durably at focus grain across the sibling classes -- see
37
+ * hasOpenWorktreeDirtyEscalation). Correct on a caller after which no further
38
+ * WIP-capture will run.
39
+ * - `defer`: the dirty tree is a live agent still writing mid-flight -- refuse
40
+ * but file NOTHING (returns refused=true, deferred=true). A later tick retries
41
+ * once the agent commits or the exit pipeline's wip-preserve captures the work.
37
42
  *
38
43
  * Returns refused=false (proceed) when the worktree is clean or no path is
39
44
  * known.
@@ -42,9 +47,19 @@ export async function refuseMergeIfWorktreeDirty(params, deps = {}) {
42
47
  const hasUncommitted = deps.worktreeHasUncommittedChanges ?? worktreeHasUncommittedChanges;
43
48
  const createEsc = deps.createEscalation ?? createEscalation;
44
49
  const hasOpenEsc = deps.hasOpenWorktreeDirtyEscalation ?? hasOpenWorktreeDirtyEscalation;
45
- const { worktreePath, organizationId, sessionId, deliveryId, deliveryName, focusId, branchName, integrationBranch } = params;
50
+ const { worktreePath, organizationId, sessionId, deliveryId, deliveryName, focusId, branchName, integrationBranch, policy = 'escalate', readOnly = false } = params;
46
51
  if (!worktreePath || !hasUncommitted(worktreePath)) {
47
- return { refused: false };
52
+ return { refused: false, deferred: false };
53
+ }
54
+ // Mid-flight defer: the worktree is dirty because a live agent is still
55
+ // writing, not because something is wrong. Skip the merge quietly and let a
56
+ // later tick retry once the agent commits. File nothing -- an escalation here
57
+ // would sit in the operator inbox describing a condition the exit pipeline's
58
+ // wip-preserve phase (or the agent's own next commit) clears on its own.
59
+ if (policy === 'defer') {
60
+ log.debug(`[focus-merge] Deferring merge of "${deliveryName}" (${branchName} -> ${integrationBranch}): ` +
61
+ `worktree ${worktreePath} has uncommitted changes while the team is still executing.`);
62
+ return { refused: true, deferred: true };
48
63
  }
49
64
  log.warn(`[focus-merge] REFUSING merge of "${deliveryName}" (${branchName} -> ${integrationBranch}): ` +
50
65
  `worktree ${worktreePath} has uncommitted changes.`);
@@ -63,8 +78,27 @@ export async function refuseMergeIfWorktreeDirty(params, deps = {}) {
63
78
  log.warn(`[focus-merge] Open worktree-dirty escalation lookup failed for "${deliveryName}", proceeding to file: ${err.message}`);
64
79
  }
65
80
  if (alreadyOpen) {
66
- return { refused: true };
67
- }
81
+ return { refused: true, deferred: false };
82
+ }
83
+ // Posture-accurate body: the diagnosis of a dirty worktree is opposite between
84
+ // a read-only audit focus and a read-write focus, so a single fixed template
85
+ // cannot describe both. On a read-only audit a dirty tree IS the violation --
86
+ // the agent wrote where it must not. On a read-write focus it is ordinary
87
+ // uncommitted work that reached the merge point without being committed; there
88
+ // is no read-only violation, so the body must not send the operator hunting
89
+ // for one.
90
+ const dirtyCauseSentence = readOnly
91
+ ? `The merge was NOT performed (a dirty-worktree merge would drop or ` +
92
+ `mis-merge uncommitted work). This is a read-only audit focus, so a dirty ` +
93
+ `worktree means the agent modified files it should not have.`
94
+ : `The merge was NOT performed (a dirty-worktree merge would drop or ` +
95
+ `mis-merge uncommitted work). The focus branch reached the merge point ` +
96
+ `with uncommitted changes that were neither committed nor captured.`;
97
+ const dirtyRemedySentence = readOnly
98
+ ? `Inspect ${worktreePath}; the agent should not have modified files on a ` +
99
+ `read-only audit focus -- discard the changes, then the merge can be retried.`
100
+ : `Inspect ${worktreePath}; commit or discard the uncommitted changes, then ` +
101
+ `the merge can be retried.`;
68
102
  try {
69
103
  await withRetry(() => createEsc({
70
104
  organizationId,
@@ -79,237 +113,16 @@ export async function refuseMergeIfWorktreeDirty(params, deps = {}) {
79
113
  `**Source branch:** ${branchName}\n` +
80
114
  `**Target branch:** ${integrationBranch}\n` +
81
115
  `**Worktree:** ${worktreePath}\n\n` +
82
- `The merge was NOT performed (a dirty-worktree merge would drop or ` +
83
- `mis-merge uncommitted work). For a read-only audit focus this means ` +
84
- `the agent modified files it should not have.`,
116
+ dirtyCauseSentence,
85
117
  whatWasTried: `Daemon was about to merge ${branchName} into ${integrationBranch} but \`git status --porcelain\` reported uncommitted changes in ${worktreePath}.`,
86
- helpNeeded: `Inspect ${worktreePath}; commit or discard the uncommitted changes (for a read-only audit, discard them), then the merge can be retried.`,
118
+ helpNeeded: dirtyRemedySentence,
87
119
  }), { maxAttempts: 3, label: `escalation-dirty-worktree-merge-${deliveryId}` });
88
120
  log.info(`Filed dirty-worktree merge-refusal escalation for "${deliveryName}"`);
89
121
  }
90
122
  catch (err) {
91
123
  log.error(`[focus-merge] Failed to file dirty-worktree merge-refusal escalation for "${deliveryName}": ${err.message}`);
92
124
  }
93
- return { refused: true };
94
- }
95
- /**
96
- * Report merge_conflict git state for a delivery.
97
- *
98
- * Makes the merge failure visible in the frontend delivery detail view.
99
- */
100
- export async function reportMergeConflictState(deliveryId, branchName) {
101
- try {
102
- await reportGitState(deliveryId, 'merge_conflict', branchName);
103
- }
104
- catch (err) {
105
- log.warn(`[focus-merge] reportGitState merge_conflict failed for ${deliveryId}:`, err.message);
106
- }
107
- }
108
- /**
109
- * Create an escalation for a merge conflict and report the git state.
110
- *
111
- * Durable, focus-grain dedup: skips escalation creation if any sibling
112
- * worktree-dirty escalation (advance_blocked / merge_conflict /
113
- * merge_refused_dirty) is already open for the FOCUS. Because the lookup
114
- * queries the DB rather than an in-memory Set, the suppression survives a
115
- * daemon restart and collapses across the sibling paths. Always reports
116
- * merge_conflict git state regardless (git-state surfacing is not deduped --
117
- * only the human-facing escalation row is).
118
- *
119
- * Called by all focus-level merge callers when mergeToIntegration fails.
120
- */
121
- export async function escalateMergeConflict(params, deps = {}) {
122
- const createEsc = deps.createEscalation ?? createEscalation;
123
- const hasOpenEsc = deps.hasOpenWorktreeDirtyEscalation ?? hasOpenWorktreeDirtyEscalation;
124
- const reportState = deps.reportGitState ?? reportGitState;
125
- const { organizationId, sessionId, deliveryId, deliveryName, focusId, branchName, integrationBranch, mergeError } = params;
126
- // A filing states only what the machine established. Discriminate on the git
127
- // error the caller already holds BEFORE asserting a merge_conflict verdict.
128
- const classification = classifyMergeFailure(mergeError);
129
- // Missing / unconfigured integration ref: a CONFIGURATION gap, not a merge
130
- // conflict and not an operator escalation (config gaps are state, not
131
- // escalations). Surface it as state -- log it naming the missing ref -- and
132
- // file nothing. Reporting merge_conflict git state here would assert a verdict
133
- // the machine never established; prescribing conflict resolution would offer a
134
- // remedy whose retry re-fails identically.
135
- if (classification.isConfigGap) {
136
- log.warn(`[focus-merge] Merge of "${deliveryName}" (${branchName} -> ${integrationBranch}) failed on a ` +
137
- `missing/unconfigured integration ref -- a configuration gap, NOT a merge conflict. ` +
138
- `No git state stamped and no operator escalation filed. Error: ${mergeError}`);
139
- return;
140
- }
141
- // Any non-conflict failure we could not attribute to a content conflict: do
142
- // NOT stamp a merge_conflict git state and do NOT file a merge_conflict
143
- // escalation whose remedy the machine cannot verify. Report it honestly as a
144
- // log line naming the real error; the branch is preserved for the next tick.
145
- if (!classification.isContentConflict) {
146
- log.warn(`[focus-merge] Merge of "${deliveryName}" (${branchName} -> ${integrationBranch}) failed for a ` +
147
- `non-conflict reason (${classification.class}); not stamping a merge_conflict verdict. Error: ${mergeError}`);
148
- return;
149
- }
150
- // Genuine content conflict -- the sole case that warrants the merge_conflict
151
- // git state + conflict-resolution escalation below.
152
- // Report merge_conflict git state (git-state surfacing is not deduped).
153
- try {
154
- await reportState(deliveryId, 'merge_conflict', branchName);
155
- }
156
- catch (err) {
157
- log.warn(`[focus-merge] reportGitState merge_conflict failed for ${deliveryId}:`, err.message);
158
- }
159
- // Durable, focus-grain dedup across the sibling classes. Fail open: if the
160
- // lookup errors we proceed to file rather than swallow a genuine first
161
- // escalation.
162
- let alreadyOpen = false;
163
- try {
164
- alreadyOpen = await hasOpenEsc(focusId);
165
- }
166
- catch (err) {
167
- log.warn(`[focus-merge] Open worktree-dirty escalation lookup failed for "${deliveryName}", proceeding to file: ${err.message}`);
168
- }
169
- if (alreadyOpen) {
170
- log.info(`Worktree-dirty escalation already open for focus ${focusId}, skipping duplicate merge-conflict row`);
171
- return;
172
- }
173
- try {
174
- await withRetry(() => createEsc({
175
- organizationId,
176
- sessionId,
177
- issueId: null,
178
- reasonType: ESCALATION_REASONS.ERROR_ENCOUNTERED,
179
- disposition: ESCALATION_DISPOSITIONS.NEEDS_OPERATOR,
180
- escalationKind: MERGE_CONFLICT_ESCALATION_KIND,
181
- anchor: { deliveryId, focusId, branch: branchName },
182
- description: `Merge conflict merging focus branch into integration.\n\n` +
183
- `**Delivery:** ${deliveryName}\n` +
184
- `**Source branch:** ${branchName}\n` +
185
- `**Target branch:** ${integrationBranch}\n` +
186
- `**Error:** ${mergeError}\n\n` +
187
- `The branch has been preserved. Resolve the conflict and mark the escalation as resolved to trigger a retry.`,
188
- whatWasTried: `Attempted automatic merge of ${branchName} into ${integrationBranch}.`,
189
- helpNeeded: `Resolve the merge conflicts between ${branchName} and ${integrationBranch}, then mark this escalation as resolved.`,
190
- }), { maxAttempts: 3, label: `escalation-focus-merge-conflict-${deliveryId}` });
191
- log.info(`Created merge conflict escalation for delivery "${deliveryName}"`);
192
- }
193
- catch (err) {
194
- log.error(`[focus-merge] Failed to create merge conflict escalation for "${deliveryName}": ${err.message}`);
195
- }
196
- }
197
- /**
198
- * Best-effort: close any open merge_conflict escalation for the focuses behind a
199
- * branch group once the merge has actually gone through. A clean worktree does
200
- * NOT clear a content conflict -- only a successful merge does -- so the
201
- * merge-success path (not the advance-block clean path) owns merge_conflict
202
- * auto-resolution. Fire-and-forget with a logged catch so it never blocks the
203
- * merge bookkeeping.
204
- */
205
- function resolveMergeConflictEscalations(deliveries) {
206
- const focusIds = new Set(deliveries.map((d) => d.focus_id).filter((id) => !!id));
207
- for (const focusId of focusIds) {
208
- resolveOpenWorktreeDirtyEscalations(focusId, [MERGE_CONFLICT_ESCALATION_KIND])
209
- .then((n) => {
210
- if (n > 0) {
211
- log.info(`[focus-merge] Merge resolved for focus ${focusId}; auto-resolved ${n} merge-conflict escalation(s).`);
212
- }
213
- })
214
- .catch((err) => log.warn(`[focus-merge] Auto-resolve of merge-conflict escalation failed for focus ${focusId}: ${err.message}`));
215
- }
216
- }
217
- /**
218
- * Check for deliveries stuck in merge_conflict state and retry the merge.
219
- *
220
- * Called once per poll cycle. Queries the API for deliveries with
221
- * merge_conflict git state, groups them by branch (to avoid duplicate
222
- * merges), and retries mergeToIntegration for each unique branch.
223
- *
224
- * On success: reports merged_to_integration for all deliveries on that
225
- * branch and auto-resolves their open merge_conflict escalations.
226
- * On failure: logs quietly (the existing escalation remains active).
227
- */
228
- export async function checkResolvedMergeConflicts(config) {
229
- let conflictDeliveries;
230
- try {
231
- conflictDeliveries = await getMergeConflictDeliveries(config.organizationId, config.productId);
232
- }
233
- catch (err) {
234
- log.warn(`[focus-merge] Failed to fetch merge conflict deliveries:`, err.message);
235
- return;
236
- }
237
- if (conflictDeliveries.length === 0)
238
- return;
239
- // Group deliveries by branch so we only merge once per branch
240
- const byBranch = new Map();
241
- for (const d of conflictDeliveries) {
242
- if (!d.git_branch_name)
243
- continue;
244
- const group = byBranch.get(d.git_branch_name) ?? [];
245
- group.push(d);
246
- byBranch.set(d.git_branch_name, group);
247
- }
248
- for (const [branchName, deliveries] of byBranch) {
249
- const representative = deliveries[0];
250
- log.info(`[focus-merge] Retrying merge for branch ${branchName} ` +
251
- `(${deliveries.length} delivery/ies in merge_conflict state)`);
252
- const mergeResult = await mergeToIntegration({
253
- config,
254
- branchName,
255
- deliveryName: representative.delivery_name,
256
- deliveryId: representative.delivery_id,
257
- });
258
- if (mergeResult.success) {
259
- log.info(`[focus-merge] Merge retry succeeded for branch ${branchName}`);
260
- // Update all deliveries in this branch group. Dedup is durable now (an
261
- // open escalation suppresses re-filing); now that the merge succeeded we
262
- // also auto-resolve the open merge_conflict escalation(s) for the focus so
263
- // a resolved-in-fact conflict stops sitting in the human inbox.
264
- for (const d of deliveries) {
265
- reportGitState(d.delivery_id, 'merged_to_integration').catch((err) => log.warn(`[focus-merge] reportGitState merged_to_integration failed for ${d.delivery_id}:`, err.message));
266
- }
267
- resolveMergeConflictEscalations(deliveries);
268
- }
269
- else {
270
- log.info(`[focus-merge] Merge retry still failing for branch ${branchName}: ${mergeResult.error ?? 'unknown'}`);
271
- // Attempt fallback resolution agent if a worktree exists for this focus
272
- if (representative.focus_id) {
273
- const worktreeInfo = getFocusWorktree(representative.focus_id);
274
- if (worktreeInfo) {
275
- log.info(`[focus-merge] Spawning fallback resolution agent for branch ${branchName}`);
276
- // Merge integration back into the focus worktree to surface conflicts
277
- const mergeBackResult = await mergeBackFromIntegration({
278
- worktreePath: worktreeInfo.worktreePath,
279
- integrationBranch: config.integrationBranch,
280
- });
281
- if (mergeBackResult.status === 'conflict') {
282
- const fallbackResult = await spawnResolutionAgent({
283
- config,
284
- worktreePath: worktreeInfo.worktreePath,
285
- branchName,
286
- integrationBranch: config.integrationBranch,
287
- conflictFiles: mergeBackResult.conflictFiles ?? [],
288
- focusDescription: worktreeInfo.focusName || branchName,
289
- model: representative.pipeline_config?.model ?? null,
290
- focusId: representative.focus_id,
291
- });
292
- if (fallbackResult.success) {
293
- // Retry merge after resolution
294
- const retryResult = await mergeToIntegration({
295
- config,
296
- branchName,
297
- deliveryName: representative.delivery_name,
298
- deliveryId: representative.delivery_id,
299
- });
300
- if (retryResult.success) {
301
- log.info(`Merge succeeded after fallback resolution for branch ${branchName}`);
302
- for (const d of deliveries) {
303
- reportGitState(d.delivery_id, 'merged_to_integration').catch((err) => log.warn(`reportGitState failed for ${d.delivery_id}:`, err.message));
304
- }
305
- resolveMergeConflictEscalations(deliveries);
306
- }
307
- }
308
- }
309
- }
310
- }
311
- }
312
- }
125
+ return { refused: true, deferred: false };
313
126
  }
314
127
  // ── Team lead conflict resolution ────────────────────────────────
315
128
  /** Default timeout for team lead to resolve merge conflicts (5 minutes). */
@@ -390,7 +203,7 @@ export async function requestTeamLeadResolution(teamState, conflictFiles, branch
390
203
  * proceeds — the planning-phase / read-only safety nets live in
391
204
  * `shouldAttemptMerge`, not here.
392
205
  */
393
- export async function mergeFocusBranch(config, teamState, sessionId, branchName, workedDeliveryIds) {
206
+ export async function mergeFocusBranch(config, teamState, sessionId, branchName, workedDeliveryIds, dirtyWorktreePolicy = 'escalate') {
394
207
  log.info(`Merging focus branch ${branchName} for "${teamState.focusName}"`, {
395
208
  focusId: teamState.focusId,
396
209
  sessionId,
@@ -406,9 +219,11 @@ export async function mergeFocusBranch(config, teamState, sessionId, branchName,
406
219
  }
407
220
  // ── Refuse: never merge a dirty worktree ──────────────────────────────
408
221
  // A merge of a worktree with uncommitted changes would drop or mis-merge
409
- // that work. Refuse (and escalate) before doing anything else. For a
410
- // read-only audit focus this is the merge-side backstop that keeps an
411
- // unintended dirty tree out of integration.
222
+ // that work. Abort before doing anything else. On the escalate policy (any
223
+ // caller after which no further WIP-capture will run) this is the merge-side
224
+ // backstop that keeps an unintended dirty tree out of integration and files
225
+ // an escalation. On the defer policy (the mid-flight merge of a still-executing
226
+ // team) a dirty tree is a live agent writing, not a fault -- defer silently.
412
227
  const dirtyGuard = await refuseMergeIfWorktreeDirty({
413
228
  worktreePath: teamState.worktreePath,
414
229
  organizationId: teamState.organizationId,
@@ -418,9 +233,16 @@ export async function mergeFocusBranch(config, teamState, sessionId, branchName,
418
233
  focusId: teamState.focusId,
419
234
  branchName,
420
235
  integrationBranch: config.integrationBranch,
236
+ policy: dirtyWorktreePolicy,
237
+ readOnly: teamState.readOnly,
421
238
  });
422
239
  if (dirtyGuard.refused) {
423
- return { mergeSucceeded: false, exitReason: 'merge_refused_dirty_worktree' };
240
+ return {
241
+ mergeSucceeded: false,
242
+ exitReason: dirtyGuard.deferred
243
+ ? 'merge_deferred_dirty_worktree'
244
+ : 'merge_refused_dirty_worktree',
245
+ };
424
246
  }
425
247
  // Fetch workflow for merge operations (used only for conflict rollback stage lookup)
426
248
  let workflow;
@@ -554,4 +376,121 @@ export async function mergeFocusBranch(config, teamState, sessionId, branchName,
554
376
  exitReason: mergeOutcome.exitReason,
555
377
  };
556
378
  }
379
+ /**
380
+ * Best-effort: close any open merge_conflict escalation for the focuses behind a
381
+ * branch group once the merge has actually gone through. A clean worktree does
382
+ * NOT clear a content conflict -- only a successful merge does -- so the
383
+ * merge-success path (not the advance-block clean path) owns merge_conflict
384
+ * auto-resolution. Fire-and-forget with a logged catch so it never blocks the
385
+ * merge bookkeeping.
386
+ */
387
+ function resolveMergeConflictEscalations(deliveries) {
388
+ const focusIds = new Set(deliveries.map((d) => d.focus_id).filter((id) => !!id));
389
+ for (const focusId of focusIds) {
390
+ resolveOpenWorktreeDirtyEscalations(focusId, [MERGE_CONFLICT_ESCALATION_KIND])
391
+ .then((n) => {
392
+ if (n > 0) {
393
+ log.info(`[focus-merge] Merge resolved for focus ${focusId}; auto-resolved ${n} merge-conflict escalation(s).`);
394
+ }
395
+ })
396
+ .catch((err) => log.warn(`[focus-merge] Auto-resolve of merge-conflict escalation failed for focus ${focusId}: ${err.message}`));
397
+ }
398
+ }
399
+ /**
400
+ * Check for deliveries stuck in merge_conflict state and retry the merge.
401
+ *
402
+ * Called once per poll cycle. Queries the API for deliveries with
403
+ * merge_conflict git state, groups them by branch (to avoid duplicate
404
+ * merges), and retries mergeToIntegration for each unique branch.
405
+ *
406
+ * On success: reports merged_to_integration for all deliveries on that
407
+ * branch and auto-resolves their open merge_conflict escalations.
408
+ * On failure: logs quietly (the existing escalation remains active).
409
+ */
410
+ export async function checkResolvedMergeConflicts(config) {
411
+ let conflictDeliveries;
412
+ try {
413
+ conflictDeliveries = await getMergeConflictDeliveries(config.organizationId, config.productId);
414
+ }
415
+ catch (err) {
416
+ log.warn(`[focus-merge] Failed to fetch merge conflict deliveries:`, err.message);
417
+ return;
418
+ }
419
+ if (conflictDeliveries.length === 0)
420
+ return;
421
+ // Group deliveries by branch so we only merge once per branch
422
+ const byBranch = new Map();
423
+ for (const d of conflictDeliveries) {
424
+ if (!d.git_branch_name)
425
+ continue;
426
+ const group = byBranch.get(d.git_branch_name) ?? [];
427
+ group.push(d);
428
+ byBranch.set(d.git_branch_name, group);
429
+ }
430
+ for (const [branchName, deliveries] of byBranch) {
431
+ const representative = deliveries[0];
432
+ log.info(`[focus-merge] Retrying merge for branch ${branchName} ` +
433
+ `(${deliveries.length} delivery/ies in merge_conflict state)`);
434
+ const mergeResult = await mergeToIntegration({
435
+ config,
436
+ branchName,
437
+ deliveryName: representative.delivery_name,
438
+ deliveryId: representative.delivery_id,
439
+ });
440
+ if (mergeResult.success) {
441
+ log.info(`[focus-merge] Merge retry succeeded for branch ${branchName}`);
442
+ // Update all deliveries in this branch group. Dedup is durable now (an
443
+ // open escalation suppresses re-filing); now that the merge succeeded we
444
+ // also auto-resolve the open merge_conflict escalation(s) for the focus so
445
+ // a resolved-in-fact conflict stops sitting in the human inbox.
446
+ for (const d of deliveries) {
447
+ reportGitState(d.delivery_id, 'merged_to_integration').catch((err) => log.warn(`[focus-merge] reportGitState merged_to_integration failed for ${d.delivery_id}:`, err.message));
448
+ }
449
+ resolveMergeConflictEscalations(deliveries);
450
+ }
451
+ else {
452
+ log.info(`[focus-merge] Merge retry still failing for branch ${branchName}: ${mergeResult.error ?? 'unknown'}`);
453
+ // Attempt fallback resolution agent if a worktree exists for this focus
454
+ if (representative.focus_id) {
455
+ const worktreeInfo = getFocusWorktree(representative.focus_id);
456
+ if (worktreeInfo) {
457
+ log.info(`[focus-merge] Spawning fallback resolution agent for branch ${branchName}`);
458
+ // Merge integration back into the focus worktree to surface conflicts
459
+ const mergeBackResult = await mergeBackFromIntegration({
460
+ worktreePath: worktreeInfo.worktreePath,
461
+ integrationBranch: config.integrationBranch,
462
+ });
463
+ if (mergeBackResult.status === 'conflict') {
464
+ const fallbackResult = await spawnResolutionAgent({
465
+ config,
466
+ worktreePath: worktreeInfo.worktreePath,
467
+ branchName,
468
+ integrationBranch: config.integrationBranch,
469
+ conflictFiles: mergeBackResult.conflictFiles ?? [],
470
+ focusDescription: worktreeInfo.focusName || branchName,
471
+ model: representative.pipeline_config?.model ?? null,
472
+ focusId: representative.focus_id,
473
+ });
474
+ if (fallbackResult.success) {
475
+ // Retry merge after resolution
476
+ const retryResult = await mergeToIntegration({
477
+ config,
478
+ branchName,
479
+ deliveryName: representative.delivery_name,
480
+ deliveryId: representative.delivery_id,
481
+ });
482
+ if (retryResult.success) {
483
+ log.info(`Merge succeeded after fallback resolution for branch ${branchName}`);
484
+ for (const d of deliveries) {
485
+ reportGitState(d.delivery_id, 'merged_to_integration').catch((err) => log.warn(`reportGitState failed for ${d.delivery_id}:`, err.message));
486
+ }
487
+ resolveMergeConflictEscalations(deliveries);
488
+ }
489
+ }
490
+ }
491
+ }
492
+ }
493
+ }
494
+ }
495
+ }
557
496
  //# sourceMappingURL=focus-merge.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"focus-merge.js","sourceRoot":"","sources":["../../src/merge/focus-merge.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,sFAAsF;AACtF,oEAAoE;AACpE,oEAAoE;AACpE,uEAAuE;AACvE,mEAAmE;AACnE,gBAAgB;AAehB,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,EAAE,gBAAgB,EAA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xB,GAAG,CAAC,IAAI,CAAC,wDAAwD,UAAU,EAAE,CAAC,CAAC;gCAC/E,KAAK,MAAM,CAAC,IAAI,UAAU,EAAE,CAAC;oCAC3B,cAAc,CAAC,CAAC,CAAC,WAAW,EAAE,uBAAuB,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE,CACnE,GAAG,CAAC,IAAI,CAAC,6BAA6B,CAAC,CAAC,WAAW,GAAG,EAAG,GAAa,CAAC,OAAO,CAAC,CAChF,CAAC;gCACJ,CAAC;gCACD,+BAA+B,CAAC,UAAU,CAAC,CAAC;4BAC9C,CAAC;wBACH,CAAC;oBACH,CAAC;gBACH,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;AACH,CAAC"}
@@ -0,0 +1,60 @@
1
+ /**
2
+ * Merge-conflict escalation, reporting and retry.
3
+ *
4
+ * Sliced out of focus-merge.ts so both modules stay under the
5
+ * daemon-file-size gate. This is a LEAF of the merge cluster: it imports
6
+ * nothing from focus-merge.ts, so focus-merge.ts can import the escalation
7
+ * helpers back without closing a cycle.
8
+ *
9
+ * Scope is deliberately the FILING side only: classifying a merge failure
10
+ * before asserting a verdict, and filing (with focus-grain dedup) the operator
11
+ * escalation. The retry path that clears the state stays in focus-merge.ts,
12
+ * because it invokes the git merge entry points and MERGE_OWNERSHIP_POLICY
13
+ * concentrates every route into a merge in that one sanctioned module.
14
+ */
15
+ import { createEscalation, hasOpenWorktreeDirtyEscalation } from '../queries/escalations.js';
16
+ import { reportGitState } from '../queries/deliveries.js';
17
+ /**
18
+ * Parameters for merge conflict escalation/reporting.
19
+ */
20
+ export interface MergeConflictParams {
21
+ organizationId: string;
22
+ sessionId: string;
23
+ deliveryId: string;
24
+ deliveryName: string;
25
+ focusId: string;
26
+ branchName: string;
27
+ integrationBranch: string;
28
+ mergeError: string;
29
+ }
30
+ /**
31
+ * Report merge_conflict git state for a delivery.
32
+ *
33
+ * Makes the merge failure visible in the frontend delivery detail view.
34
+ */
35
+ export declare function reportMergeConflictState(deliveryId: string, branchName: string): Promise<void>;
36
+ /**
37
+ * Injectable collaborators for the merge-conflict escalation. Defaults to the
38
+ * real implementations; tests override them to drive the suppression path
39
+ * without a live Supabase.
40
+ */
41
+ export interface MergeConflictEscalationDeps {
42
+ createEscalation?: typeof createEscalation;
43
+ hasOpenWorktreeDirtyEscalation?: typeof hasOpenWorktreeDirtyEscalation;
44
+ reportGitState?: typeof reportGitState;
45
+ }
46
+ /**
47
+ * Create an escalation for a merge conflict and report the git state.
48
+ *
49
+ * Durable, focus-grain dedup: skips escalation creation if any sibling
50
+ * worktree-dirty escalation (advance_blocked / merge_conflict /
51
+ * merge_refused_dirty) is already open for the FOCUS. Because the lookup
52
+ * queries the DB rather than an in-memory Set, the suppression survives a
53
+ * daemon restart and collapses across the sibling paths. Always reports
54
+ * merge_conflict git state regardless (git-state surfacing is not deduped --
55
+ * only the human-facing escalation row is).
56
+ *
57
+ * Called by all focus-level merge callers when mergeToIntegration fails.
58
+ */
59
+ export declare function escalateMergeConflict(params: MergeConflictParams, deps?: MergeConflictEscalationDeps): Promise<void>;
60
+ //# sourceMappingURL=merge-conflict-escalation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"merge-conflict-escalation.d.ts","sourceRoot":"","sources":["../../src/merge/merge-conflict-escalation.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EACL,gBAAgB,EAChB,8BAA8B,EAE/B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAW1D;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;;;GAIG;AACH,wBAAsB,wBAAwB,CAC5C,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,IAAI,CAAC,CASf;AAED;;;;GAIG;AACH,MAAM,WAAW,2BAA2B;IAC1C,gBAAgB,CAAC,EAAE,OAAO,gBAAgB,CAAC;IAC3C,8BAA8B,CAAC,EAAE,OAAO,8BAA8B,CAAC;IACvE,cAAc,CAAC,EAAE,OAAO,cAAc,CAAC;CACxC;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,qBAAqB,CACzC,MAAM,EAAE,mBAAmB,EAC3B,IAAI,GAAE,2BAAgC,GACrC,OAAO,CAAC,IAAI,CAAC,CA6Ff"}