pi-spine 2.2.0 → 2.3.0

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 (47) hide show
  1. package/bin/spine-cli/verify.mjs +2 -19
  2. package/package.json +1 -1
  3. package/src/batch/attached-runner-promote.mjs +370 -0
  4. package/src/batch/attached-runner-reconcile.mjs +291 -0
  5. package/src/batch/attached-runner.mjs +24 -645
  6. package/src/batch/batch-guards.mjs +69 -0
  7. package/src/batch/contract-exec.mjs +483 -0
  8. package/src/batch/contract-parse.mjs +243 -0
  9. package/src/batch/contract-verify.mjs +32 -707
  10. package/src/batch/detached-diagnostics.mjs +255 -0
  11. package/src/batch/detached-run.mjs +326 -0
  12. package/src/batch/detached-start.mjs +18 -894
  13. package/src/batch/detached-wait.mjs +346 -0
  14. package/src/batch/engine.mjs +8 -67
  15. package/src/batch/integrate-git.mjs +21 -0
  16. package/src/batch/integrate.mjs +5 -15
  17. package/src/batch/journal-rebuild-structural.mjs +352 -0
  18. package/src/batch/journal-rebuild.mjs +16 -348
  19. package/src/batch/lane-dirty-check-commit.mjs +361 -0
  20. package/src/batch/lane-dirty-check-git.mjs +298 -0
  21. package/src/batch/lane-dirty-check.mjs +31 -297
  22. package/src/batch/reconcile-batch.mjs +483 -0
  23. package/src/batch/reconcile-classify.mjs +433 -0
  24. package/src/batch/reconcile-diagnosis.mjs +459 -0
  25. package/src/batch/reconcile-light-cache.mjs +61 -0
  26. package/src/batch/reconcile-orphan.mjs +198 -0
  27. package/src/batch/reconcile.mjs +19 -1693
  28. package/src/batch/resume-multi-lanes.mjs +6 -148
  29. package/src/batch/resume-multi-queue.mjs +159 -0
  30. package/src/batch/resume-single-validate.mjs +25 -0
  31. package/src/batch/resume.mjs +3 -20
  32. package/src/batch/review-artifacts.mjs +419 -0
  33. package/src/batch/review-step-run.mjs +383 -0
  34. package/src/batch/review-step.mjs +451 -0
  35. package/src/batch/review.mjs +32 -1199
  36. package/src/batch/salvage-batch-list.mjs +291 -0
  37. package/src/batch/salvage-batch.mjs +10 -284
  38. package/src/batch/sequence-plan.mjs +234 -0
  39. package/src/batch/sequence-run.mjs +418 -0
  40. package/src/batch/sequence-wait.mjs +167 -0
  41. package/src/batch/sequence.mjs +22 -783
  42. package/src/batch/state-guards.mjs +284 -0
  43. package/src/batch/state-io.mjs +135 -0
  44. package/src/batch/state.mjs +27 -396
  45. package/src/batch/worker-heartbeat.mjs +375 -0
  46. package/src/batch/worker-host.mjs +50 -541
  47. package/src/batch/worker-spawn.mjs +315 -0
@@ -0,0 +1,483 @@
1
+ // @ts-nocheck
2
+ /** Main reconcileBatch orchestration (SP-606 / #192). */
3
+
4
+ import fs from "node:fs";
5
+ import path from "node:path";
6
+ import { buildStalePathDoctorCheck } from "../doctor/stale-path.mjs";
7
+ import { PACKAGE_ROOT } from "../config/spine-init-constants.mjs";
8
+ import { loadGateRecord } from "./gate-evidence-read.mjs";
9
+ import { deriveMacroPhase, macroPhaseLabel } from "./macro-phase.mjs";
10
+ import {
11
+ buildDiagnosisOutput,
12
+ inferMergeGitignoredFailure,
13
+ } from "./diagnosis.mjs";
14
+ import {
15
+ classifyTasks,
16
+ inspectGitState,
17
+ inspectHumanBaseSync,
18
+ resolveTasksRoot,
19
+ syncPersistedClassifications,
20
+ } from "./reconcile-classify.mjs";
21
+ import { findLatestReviewHonorSignal } from "./review.mjs";
22
+ import { summarizeMergeFailures } from "./diagnosis-merge-failure.mjs";
23
+ import { inferWorkerDoneMissingFailure } from "./diagnosis-worker-done-missing.mjs";
24
+ import { inferEngineOrphanCause } from "./diagnosis-parent-exit.mjs";
25
+ import { findStubMarkedSucceededTask } from "./diagnosis-stub.mjs";
26
+ import { detectOrphanRunning, journalEventsSinceResume } from "./orphan-detect.mjs";
27
+ import { computePendingTasks } from "./resume-multi.mjs";
28
+ import { computeStatusProgress } from "./status-json.mjs";
29
+ import {
30
+ detectBatchStateDrift,
31
+ rebuildBatchStateFromJournal,
32
+ reconcileBatchStateDrift,
33
+ } from "./journal-rebuild.mjs";
34
+ import {
35
+ extractJournalDiagnosisHints,
36
+ findPlanReviewNestedSpawnBlockedFailure,
37
+ journalPath,
38
+ readJournalEvents,
39
+ } from "./journal.mjs";
40
+ import { findLatestSalvageInspection } from "./salvage.mjs";
41
+ import { isProcessAlive } from "../process/liveness.mjs";
42
+ import {
43
+ loadBatchStateFile,
44
+ parseBatchState,
45
+ readBaseBranchHeadAtStart,
46
+ } from "./batch-state-io.mjs";
47
+ import { readBatchEnginePid } from "./state.mjs";
48
+ import {
49
+ deriveDiagnosis,
50
+ enrichLaunchFailureFromWorkerOutput,
51
+ enrichWorkerDoneMissingContext,
52
+ extractGitignoredPathsFromJournal,
53
+ hasGhostRunningCluster,
54
+ laneTaskBranchForDiagnosis,
55
+ } from "./reconcile-diagnosis.mjs";
56
+ import {
57
+ HUMAN_SYNC_OVERRIDE_DIAGNOSES,
58
+ _lightReconcileCache,
59
+ clearLightReconcileCache,
60
+ lightReconcileCacheMatches,
61
+ updateLightReconcileCache,
62
+ } from "./reconcile-light-cache.mjs";
63
+
64
+ /**
65
+ * @param {object} ctx
66
+ * @param {string} ctx.projectRoot
67
+ * @param {object|null} [ctx.batchState]
68
+ * @param {string|null} [ctx.batchStatePath]
69
+ * @param {boolean} [ctx.verbose]
70
+ * @param {boolean} [ctx.light] Skip git branch scans when batch phase unchanged since last full reconcile.
71
+ * @param {boolean} [ctx._lightRetry] Internal — full reconcile after light diagnosis transition.
72
+ */
73
+ export function reconcileBatch(ctx, _lightRetry = false) {
74
+ const { projectRoot } = ctx;
75
+ const loaded = ctx.batchState
76
+ ? {
77
+ path: ctx.batchStatePath ?? null,
78
+ raw: ctx.batchState,
79
+ parseError: null,
80
+ }
81
+ : loadBatchStateFile(projectRoot, ctx.batchStatePath ?? null);
82
+
83
+ if (!loaded.path && !loaded.raw) {
84
+ clearLightReconcileCache();
85
+ return {
86
+ diagnosis: null,
87
+ headline: "No active batch — ready to plan or start",
88
+ suggestedCommand: "spine preflight",
89
+ alternatives: ["spine plan all"],
90
+ batchId: null,
91
+ batchStatePath: null,
92
+ phase: null,
93
+ macroPhase: "idle",
94
+ macroPhaseLabel: macroPhaseLabel("idle"),
95
+ signals: { idle: true, macroPhase: "idle" },
96
+ };
97
+ }
98
+
99
+ if (loaded.parseError) {
100
+ return {
101
+ diagnosis: "failed",
102
+ headline: `Cannot parse batch state: ${loaded.parseError}`,
103
+ suggestedCommand: "spine status --diagnose",
104
+ alternatives: ["spine doctor"],
105
+ batchId: null,
106
+ batchStatePath: loaded.path,
107
+ phase: null,
108
+ macroPhase: "failed",
109
+ macroPhaseLabel: macroPhaseLabel("failed"),
110
+ signals: { parseError: loaded.parseError, macroPhase: "failed" },
111
+ };
112
+ }
113
+
114
+ const batch = parseBatchState(loaded.raw ?? ctx.batchState, loaded.path ?? ctx.batchStatePath ?? "");
115
+ if (!batch) {
116
+ return {
117
+ diagnosis: "failed",
118
+ headline: "Batch state is unreadable",
119
+ suggestedCommand: "spine status --diagnose",
120
+ batchId: null,
121
+ batchStatePath: loaded.path,
122
+ phase: null,
123
+ macroPhase: "failed",
124
+ macroPhaseLabel: macroPhaseLabel("failed"),
125
+ signals: { unreadable: true, macroPhase: "failed" },
126
+ };
127
+ }
128
+
129
+ const tasksRoot = resolveTasksRoot(projectRoot);
130
+ let classifiedTasks = classifyTasks(batch, tasksRoot, projectRoot);
131
+ const useLightGit =
132
+ ctx.light === true &&
133
+ !_lightRetry &&
134
+ lightReconcileCacheMatches(projectRoot, batch.batchId, batch.phase);
135
+ const git = useLightGit
136
+ ? /** @type {ReturnType<typeof inspectGitState>} */ (_lightReconcileCache.git)
137
+ : inspectGitState({
138
+ projectRoot,
139
+ batchId: batch.batchId,
140
+ baseBranch: batch.baseBranch,
141
+ orchBranch: batch.orchBranch,
142
+ });
143
+
144
+ const hasRunningTasks = classifiedTasks.some((task) => task.classification === "running");
145
+ const hasPendingTasks = classifiedTasks.some((task) => task.classification === "pending");
146
+ const pendingWithFailedSegment = batch.segments.some(
147
+ (segment) => segment.classification === "terminal-failure",
148
+ );
149
+ const driftTask = batch.tasks.find((task) => {
150
+ if (task.classification !== "pending") return false;
151
+ return batch.segments.some(
152
+ (segment) => segment.taskId === task.taskId && segment.classification === "terminal-failure",
153
+ );
154
+ });
155
+ const hasSegmentDrift = pendingWithFailedSegment || Boolean(driftTask);
156
+ const hasFailedTasks =
157
+ classifiedTasks.some((task) => task.classification === "terminal-failure") ||
158
+ hasSegmentDrift ||
159
+ batch.failedTasks > 0;
160
+ const allTasksTerminalSuccess =
161
+ classifiedTasks.length > 0 &&
162
+ classifiedTasks.every((task) => task.classification === "terminal-success");
163
+ const failedTask = classifiedTasks.find((task) => task.classification === "terminal-failure");
164
+
165
+ const signals = {
166
+ phase: batch.phase,
167
+ endedAt: batch.endedAt,
168
+ failedTasks: hasFailedTasks ? Math.max(batch.failedTasks, 1) : batch.failedTasks,
169
+ allTasksTerminalSuccess,
170
+ hasRunningTasks,
171
+ hasPendingTasks,
172
+ hasFailedTasks,
173
+ hasSegmentDrift,
174
+ failedTaskId: failedTask?.taskId ?? driftTask?.taskId ?? null,
175
+ mergeResultsEmpty: batch.mergeResults.length === 0,
176
+ git,
177
+ tasks: classifiedTasks,
178
+ tasksRoot,
179
+ segments: batch.segments,
180
+ lanes: batch.lanes,
181
+ raw: batch.raw,
182
+ };
183
+
184
+ const journalFile = journalPath(projectRoot, batch.batchId);
185
+ /** @type {object[]} */
186
+ let journalEvents = [];
187
+ if (fs.existsSync(journalFile)) {
188
+ journalEvents = readJournalEvents(projectRoot, batch.batchId);
189
+ signals.journalHints = extractJournalDiagnosisHints(journalEvents);
190
+ signals.journalEvents = journalEvents;
191
+ }
192
+
193
+ const engineSessionJournalEvents = journalEventsSinceResume(journalEvents, batch.raw);
194
+
195
+ if (journalEvents.length > 0 && batch.raw) {
196
+ let rebuilt = rebuildBatchStateFromJournal(batch.raw, journalEvents);
197
+ let drift = detectBatchStateDrift(batch.raw, rebuilt, journalEvents, classifiedTasks);
198
+ const healed = reconcileBatchStateDrift({
199
+ projectRoot,
200
+ state: batch.raw,
201
+ classifiedTasks,
202
+ journalEvents,
203
+ drift,
204
+ });
205
+ if (healed.reconciled) {
206
+ journalEvents = readJournalEvents(projectRoot, batch.batchId);
207
+ const refreshed = parseBatchState(batch.raw, loaded.path ?? ctx.batchStatePath ?? "");
208
+ if (refreshed) {
209
+ batch.tasks = refreshed.tasks;
210
+ batch.segments = refreshed.segments;
211
+ batch.succeededTasks = refreshed.succeededTasks;
212
+ batch.failedTasks = refreshed.failedTasks;
213
+ batch.lanes = refreshed.lanes;
214
+ }
215
+ classifiedTasks = classifyTasks(batch, tasksRoot, projectRoot);
216
+ rebuilt = rebuildBatchStateFromJournal(batch.raw, journalEvents);
217
+ drift = detectBatchStateDrift(batch.raw, rebuilt, journalEvents, classifiedTasks);
218
+ }
219
+ signals.stateDrift = drift;
220
+ signals.rebuiltFromJournal = rebuilt;
221
+ if (healed.reconciled) {
222
+ signals.journalEvents = journalEvents;
223
+ signals.tasks = classifiedTasks;
224
+ signals.hasRunningTasks = classifiedTasks.some((task) => task.classification === "running");
225
+ signals.hasPendingTasks = classifiedTasks.some((task) => task.classification === "pending");
226
+ signals.allTasksTerminalSuccess =
227
+ classifiedTasks.length > 0 &&
228
+ classifiedTasks.every((task) => task.classification === "terminal-success");
229
+ const healedFailedTask = classifiedTasks.find(
230
+ (task) => task.classification === "terminal-failure",
231
+ );
232
+ signals.failedTaskId = healedFailedTask?.taskId ?? signals.failedTaskId;
233
+ }
234
+ }
235
+
236
+ if (batch.raw) {
237
+ syncPersistedClassifications({ projectRoot, state: batch.raw });
238
+ }
239
+
240
+ signals.orphanRunning = detectOrphanRunning({
241
+ phase: batch.phase,
242
+ hasRunningTasks: signals.hasRunningTasks,
243
+ tasks: classifiedTasks,
244
+ lanes: batch.lanes,
245
+ raw: batch.raw,
246
+ journalEvents: engineSessionJournalEvents,
247
+ });
248
+
249
+ const pendingTaskCount = computePendingTasks(batch.raw ?? {}).length;
250
+ signals.pendingTaskCount = pendingTaskCount;
251
+
252
+ const derived = deriveDiagnosis(signals);
253
+ let { diagnosis, failedTaskId, exitReason } = derived;
254
+ const launchFailureKind = derived.launchFailureKind;
255
+ const stubSucceededTaskId = findStubMarkedSucceededTask(tasksRoot, classifiedTasks);
256
+ if (
257
+ stubSucceededTaskId &&
258
+ (diagnosis === "completed" ||
259
+ diagnosis === "needs_integrate" ||
260
+ diagnosis === "limbo_stale" ||
261
+ diagnosis === "completed_manual")
262
+ ) {
263
+ diagnosis = "needs_retry";
264
+ failedTaskId = stubSucceededTaskId;
265
+ exitReason = "stub";
266
+ }
267
+
268
+ const humanBaseSync = inspectHumanBaseSync({
269
+ projectRoot,
270
+ baseBranch: batch.baseBranch,
271
+ baseBranchHeadAtStart: readBaseBranchHeadAtStart(batch.raw),
272
+ orchBranch: batch.orchBranch,
273
+ git,
274
+ journalEvents,
275
+ });
276
+ if (humanBaseSync && HUMAN_SYNC_OVERRIDE_DIAGNOSES.has(diagnosis)) {
277
+ diagnosis = humanBaseSync.diagnosis;
278
+ }
279
+
280
+ const doneMissingHint =
281
+ diagnosis === "worker_done_missing"
282
+ ? inferWorkerDoneMissingFailure({
283
+ journalEvents,
284
+ failedTaskId,
285
+ })
286
+ : null;
287
+ const doneMissingContext =
288
+ diagnosis === "worker_done_missing"
289
+ ? enrichWorkerDoneMissingContext(
290
+ projectRoot,
291
+ batch.batchId,
292
+ failedTaskId,
293
+ classifiedTasks,
294
+ doneMissingHint,
295
+ )
296
+ : null;
297
+ const resolvedLaunchFailureKind =
298
+ diagnosis === "worker_orphaned"
299
+ ? enrichLaunchFailureFromWorkerOutput(
300
+ projectRoot,
301
+ batch.batchId,
302
+ failedTaskId,
303
+ classifiedTasks,
304
+ launchFailureKind,
305
+ )
306
+ : launchFailureKind;
307
+ const ghostRunningCluster =
308
+ diagnosis === "worker_orphaned" && hasGhostRunningCluster(classifiedTasks, failedTaskId);
309
+ const salvagePayload = findLatestSalvageInspection(journalEvents, failedTaskId);
310
+ const salvageChangedFileCount = Number(salvagePayload?.changedFileCount ?? 0) || 0;
311
+ const salvageRetryCommand =
312
+ typeof salvagePayload?.retryCommand === "string"
313
+ ? salvagePayload.retryCommand
314
+ : signals.orphanRunning?.taskId
315
+ ? `spine batch retry ${signals.orphanRunning.taskId}`
316
+ : null;
317
+
318
+ const gateRecord = batch.batchId ? loadGateRecord(projectRoot, batch.batchId) : null;
319
+ const integrateGateOpen = signals.postMergeLimbo === true && Boolean(gateRecord);
320
+
321
+ const macroPhase = deriveMacroPhase({
322
+ diagnosis,
323
+ batchPhase: batch.phase,
324
+ gateRecord,
325
+ postMergeLimbo: signals.postMergeLimbo === true,
326
+ journalEvents,
327
+ mergeResults: batch.mergeResults,
328
+ hasActiveWorkerTasks: hasRunningTasks || hasPendingTasks,
329
+ allTasksTerminalSuccess: signals.allTasksTerminalSuccess,
330
+ mergeResultsEmpty: signals.mergeResultsEmpty,
331
+ });
332
+ const resolvedMacroPhaseLabel = macroPhaseLabel(macroPhase);
333
+ if (ctx.verbose) {
334
+ signals.macroPhase = macroPhase;
335
+ signals.reconcileMode = useLightGit ? "light" : "full";
336
+ }
337
+
338
+ const stalePathCheck = buildStalePathDoctorCheck({
339
+ packageRoot: PACKAGE_ROOT,
340
+ runningSpinePath: path.join(PACKAGE_ROOT, "bin", "spine.mjs"),
341
+ });
342
+ const stalePathSpine = stalePathCheck.warning === true;
343
+ const planReviewNestedSpawnBlocked =
344
+ diagnosis === "worker_orphaned" &&
345
+ findPlanReviewNestedSpawnBlockedFailure(journalEvents, failedTaskId);
346
+
347
+ const mergeGitignoredFailure = inferMergeGitignoredFailure({
348
+ exitReason,
349
+ failureClass: batch.raw?.mergeResults?.find((entry) => entry?.failureClass)?.failureClass ?? null,
350
+ lastError: batch.raw?.lastError ?? null,
351
+ journalEvents,
352
+ });
353
+ const mergeFailureSummary = summarizeMergeFailures(
354
+ batch.mergeResults,
355
+ batch.raw?.lastError ?? null,
356
+ );
357
+ signals.mergeFailed = mergeFailureSummary.mergeFailed;
358
+ signals.failedMerges = mergeFailureSummary.failedMerges;
359
+ signals.failedWaveIndex = mergeFailureSummary.failedWaveIndex;
360
+ signals.failedLane = mergeFailureSummary.failedLane;
361
+ signals.lastError = mergeFailureSummary.lastError;
362
+ const gitignoredPaths = extractGitignoredPathsFromJournal(journalEvents, failedTaskId);
363
+ const taskBranch =
364
+ failedTaskId != null
365
+ ? laneTaskBranchForDiagnosis(batch.raw, batch.batchId, failedTaskId)
366
+ : null;
367
+ const driftTaskStatus =
368
+ failedTaskId != null
369
+ ? String(
370
+ (batch.raw?.tasks ?? []).find((entry) => entry?.taskId === failedTaskId)?.status ?? "",
371
+ )
372
+ : null;
373
+
374
+ const activeReviewTaskId =
375
+ failedTaskId ??
376
+ classifiedTasks.find((task) => task.classification === "running")?.taskId ??
377
+ null;
378
+ const reviewHonorSignal = findLatestReviewHonorSignal(journalEvents, activeReviewTaskId);
379
+ if (ctx.verbose) {
380
+ signals.reviewHonor = reviewHonorSignal;
381
+ }
382
+
383
+ const enginePid = readBatchEnginePid(batch.raw);
384
+ const staleEnginePid =
385
+ enginePid != null && !isProcessAlive(enginePid);
386
+ const engineOrphanCause =
387
+ diagnosis === "engine_orphaned"
388
+ ? inferEngineOrphanCause({ journalEvents, staleEnginePid })
389
+ : null;
390
+
391
+ const output = buildDiagnosisOutput(diagnosis, {
392
+ batchId: batch.batchId,
393
+ phase: batch.phase,
394
+ failedTasks: signals.failedTasks,
395
+ failedTaskId,
396
+ driftTaskStatus,
397
+ exitReason,
398
+ launchFailureKind: resolvedLaunchFailureKind,
399
+ gitMerged: git.orchMergedToBase,
400
+ pendingTaskCount,
401
+ salvageChangedFileCount,
402
+ salvageRetryCommand,
403
+ ghostRunningCluster,
404
+ postMergeLimbo: signals.postMergeLimbo === true,
405
+ integrateGateOpen,
406
+ stalePathSpine,
407
+ planReviewNestedSpawnBlocked,
408
+ mergeGitignoredFailure,
409
+ mergeFailed: mergeFailureSummary.mergeFailed,
410
+ failedWaveIndex: mergeFailureSummary.failedWaveIndex,
411
+ failedLane: mergeFailureSummary.failedLane,
412
+ lastError: mergeFailureSummary.lastError,
413
+ succeededTasks: batch.succeededTasks,
414
+ totalTasks: batch.totalTasks,
415
+ taskBranch,
416
+ gitignoredPaths,
417
+ hasRunningTasks,
418
+ hasPendingTasks,
419
+ allTasksTerminalSuccess: signals.allTasksTerminalSuccess,
420
+ tasksRoot,
421
+ macroPhase,
422
+ reviewHonorSignal,
423
+ ...(doneMissingContext ?? {}),
424
+ engineOrphanCause,
425
+ staleEnginePid,
426
+ humanBaseSync,
427
+ overlapPaths: humanBaseSync?.overlapPaths ?? [],
428
+ });
429
+
430
+ if (humanBaseSync && (diagnosis === "human_base_diverged" || diagnosis === "integrate_isolated_ok")) {
431
+ output.headline = humanBaseSync.headline;
432
+ }
433
+
434
+ if (diagnosis === "git_unavailable") {
435
+ output.headline = `Batch ${batch.batchId} — git inspection failed: ${git.gitInspectionError}`;
436
+ output.suggestedCommand = "spine doctor";
437
+ output.alternatives = ["spine status --diagnose"];
438
+ }
439
+
440
+ const progress = computeStatusProgress({
441
+ batchRaw: batch.raw,
442
+ succeededTasks: batch.succeededTasks,
443
+ totalTasks: batch.totalTasks,
444
+ pendingTasks: pendingTaskCount,
445
+ });
446
+
447
+ if (
448
+ ctx.light === true &&
449
+ useLightGit &&
450
+ !_lightRetry &&
451
+ _lightReconcileCache.diagnosis != null &&
452
+ _lightReconcileCache.diagnosis !== diagnosis
453
+ ) {
454
+ return reconcileBatch({ ...ctx, light: false }, true);
455
+ }
456
+
457
+ if (!useLightGit) {
458
+ updateLightReconcileCache(projectRoot, batch.batchId, batch.phase, git, diagnosis);
459
+ } else {
460
+ _lightReconcileCache.diagnosis = diagnosis;
461
+ }
462
+
463
+ return {
464
+ ...output,
465
+ batchId: batch.batchId,
466
+ batchStatePath: loaded.path ?? ctx.batchStatePath ?? null,
467
+ phase: batch.phase,
468
+ macroPhase,
469
+ macroPhaseLabel: resolvedMacroPhaseLabel,
470
+ failedTasks: signals.failedTasks,
471
+ succeededTasks: batch.succeededTasks,
472
+ totalTasks: batch.totalTasks,
473
+ pendingTasks: progress?.pendingTasks,
474
+ currentWaveIndex: progress?.currentWaveIndex,
475
+ waveCount: progress?.waveCount,
476
+ mergeFailed: mergeFailureSummary.mergeFailed,
477
+ failedMerges: mergeFailureSummary.failedMerges,
478
+ failedWaveIndex: mergeFailureSummary.failedWaveIndex,
479
+ failedLane: mergeFailureSummary.failedLane,
480
+ lastError: mergeFailureSummary.lastError,
481
+ signals: ctx.verbose ? signals : undefined,
482
+ };
483
+ }