pi-spine 1.0.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 (156) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +563 -0
  3. package/bin/get-version.mjs +35 -0
  4. package/bin/spine-batch.mjs +425 -0
  5. package/bin/spine-cli/batch.mjs +47 -0
  6. package/bin/spine-cli/gate.mjs +10 -0
  7. package/bin/spine-cli/integrate.mjs +10 -0
  8. package/bin/spine-cli/plan.mjs +12 -0
  9. package/bin/spine-cli/shared.mjs +73 -0
  10. package/bin/spine-cli/status.mjs +18 -0
  11. package/bin/spine-cli/verify.mjs +199 -0
  12. package/bin/spine-config.mjs +212 -0
  13. package/bin/spine-dashboard.mjs +178 -0
  14. package/bin/spine-deps.mjs +69 -0
  15. package/bin/spine-doctor.mjs +468 -0
  16. package/bin/spine-gate.mjs +137 -0
  17. package/bin/spine-init.mjs +398 -0
  18. package/bin/spine-integrate.mjs +77 -0
  19. package/bin/spine-journal.mjs +198 -0
  20. package/bin/spine-migrate-from-taskplane.mjs +136 -0
  21. package/bin/spine-plan.mjs +83 -0
  22. package/bin/spine-preflight.mjs +700 -0
  23. package/bin/spine-report-progress.d.mts +28 -0
  24. package/bin/spine-report-progress.mjs +126 -0
  25. package/bin/spine-review-step.d.mts +24 -0
  26. package/bin/spine-review-step.mjs +124 -0
  27. package/bin/spine-rules.mjs +35 -0
  28. package/bin/spine-settings.mjs +186 -0
  29. package/bin/spine-state.mjs +110 -0
  30. package/bin/spine-status.mjs +79 -0
  31. package/bin/spine-tasks.mjs +293 -0
  32. package/bin/spine-worker-runner.mjs +314 -0
  33. package/bin/spine.mjs +404 -0
  34. package/extensions/spine/settings-slash.ts +20 -0
  35. package/extensions/spine/slash-commands.ts +806 -0
  36. package/extensions/spine/worker-tools.ts +279 -0
  37. package/extensions/spine-orchestrator.ts +12 -0
  38. package/package.json +72 -0
  39. package/skills/.gitkeep +0 -0
  40. package/skills/create-spine-tasks/SKILL.md +375 -0
  41. package/skills/create-spine-tasks/references/context-template.md +25 -0
  42. package/skills/create-spine-tasks/references/contract-template.md +98 -0
  43. package/skills/create-spine-tasks/references/explore-template.md +63 -0
  44. package/skills/create-spine-tasks/references/prompt-template.md +276 -0
  45. package/src/batch/abort.mjs +272 -0
  46. package/src/batch/agent-session-worker.mjs +297 -0
  47. package/src/batch/batch-state-io.mjs +53 -0
  48. package/src/batch/contract-verify.mjs +310 -0
  49. package/src/batch/detached-start.mjs +778 -0
  50. package/src/batch/diagnosis.mjs +378 -0
  51. package/src/batch/engine-lanes/merge.mjs +632 -0
  52. package/src/batch/engine-lanes/queue.mjs +208 -0
  53. package/src/batch/engine-lanes/review.mjs +970 -0
  54. package/src/batch/engine-lanes.mjs +388 -0
  55. package/src/batch/engine-scope.mjs +251 -0
  56. package/src/batch/engine.mjs +445 -0
  57. package/src/batch/evidence-command.mjs +157 -0
  58. package/src/batch/evidence.mjs +203 -0
  59. package/src/batch/gate.mjs +359 -0
  60. package/src/batch/git-commit-env.mjs +46 -0
  61. package/src/batch/git-exec.mjs +26 -0
  62. package/src/batch/heartbeat.mjs +430 -0
  63. package/src/batch/integrate.mjs +414 -0
  64. package/src/batch/journal-rebuild.mjs +388 -0
  65. package/src/batch/journal.mjs +373 -0
  66. package/src/batch/lane-commit.mjs +153 -0
  67. package/src/batch/lifecycle.mjs +364 -0
  68. package/src/batch/metrics.mjs +265 -0
  69. package/src/batch/orphan-detect.mjs +210 -0
  70. package/src/batch/post-merge-limbo.mjs +80 -0
  71. package/src/batch/postmortem.mjs +296 -0
  72. package/src/batch/readers/spine-state.mjs +95 -0
  73. package/src/batch/readers/taskplane-state.mjs +136 -0
  74. package/src/batch/reconcile.mjs +729 -0
  75. package/src/batch/resume-common.mjs +104 -0
  76. package/src/batch/resume-engine.mjs +66 -0
  77. package/src/batch/resume-multi-lanes.mjs +479 -0
  78. package/src/batch/resume-multi-validate.mjs +187 -0
  79. package/src/batch/resume-multi.mjs +254 -0
  80. package/src/batch/resume.mjs +475 -0
  81. package/src/batch/retry.mjs +257 -0
  82. package/src/batch/review-scope.mjs +136 -0
  83. package/src/batch/review.mjs +1045 -0
  84. package/src/batch/salvage.mjs +332 -0
  85. package/src/batch/state.mjs +680 -0
  86. package/src/batch/task-stall-budget.mjs +88 -0
  87. package/src/batch/worker-host.mjs +683 -0
  88. package/src/batch/worker-output.mjs +253 -0
  89. package/src/batch/worker-prompt.mjs +84 -0
  90. package/src/batch/worktree.mjs +290 -0
  91. package/src/cli/deps.mjs +141 -0
  92. package/src/cli/handoff.mjs +364 -0
  93. package/src/cli/rules.mjs +429 -0
  94. package/src/cli/settings-set.mjs +171 -0
  95. package/src/cli/settings-show.mjs +140 -0
  96. package/src/cli/settings-slash.mjs +107 -0
  97. package/src/config/contract.mjs +56 -0
  98. package/src/config/cursor-rules/discover.mjs +416 -0
  99. package/src/config/cursor-rules/index.mjs +39 -0
  100. package/src/config/cursor-rules/match-globs.mjs +132 -0
  101. package/src/config/cursor-rules/parse-frontmatter.mjs +222 -0
  102. package/src/config/cursor-rules/priority.mjs +26 -0
  103. package/src/config/cursor-rules/profile.mjs +403 -0
  104. package/src/config/cursor-rules/select.mjs +259 -0
  105. package/src/config/defaults.mjs +36 -0
  106. package/src/config/env-overrides.mjs +207 -0
  107. package/src/config/merge-defaults.mjs +47 -0
  108. package/src/config/pi-spine-root.mjs +93 -0
  109. package/src/config/reviewer-context.mjs +243 -0
  110. package/src/config/settings-fields.mjs +265 -0
  111. package/src/config/worker-backend.mjs +116 -0
  112. package/src/config/worker-context.mjs +402 -0
  113. package/src/config/worker-launch-script.mjs +130 -0
  114. package/src/config/worktree-setup-hook.mjs +122 -0
  115. package/src/dashboard/public/dashboard.css +77 -0
  116. package/src/dashboard/public/dashboard.js +349 -0
  117. package/src/dashboard/public/index.html +80 -0
  118. package/src/dashboard/server.mjs +155 -0
  119. package/src/dashboard/snapshot.mjs +414 -0
  120. package/src/dashboard/sse.mjs +15 -0
  121. package/src/dashboard/view.mjs +292 -0
  122. package/src/doctor/agent-model-inherit.mjs +101 -0
  123. package/src/doctor/batch-size-guidance.mjs +72 -0
  124. package/src/doctor/coexistence.mjs +312 -0
  125. package/src/doctor/rules-manifest.mjs +133 -0
  126. package/src/doctor/stale-path.mjs +156 -0
  127. package/src/doctor/stall-config.mjs +108 -0
  128. package/src/doctor/suggest-max-parallel.mjs +53 -0
  129. package/src/doctor/task-packet-size.mjs +110 -0
  130. package/src/doctor/worktree-health.mjs +71 -0
  131. package/src/migrate/taskplane-config.mjs +116 -0
  132. package/src/planner/cycles.mjs +63 -0
  133. package/src/planner/format-plan.mjs +132 -0
  134. package/src/planner/graph.mjs +99 -0
  135. package/src/planner/index.mjs +125 -0
  136. package/src/planner/lanes.mjs +111 -0
  137. package/src/planner/pending.mjs +39 -0
  138. package/src/planner/scope.mjs +142 -0
  139. package/src/process/liveness.mjs +21 -0
  140. package/src/tasks/packet/discover.mjs +40 -0
  141. package/src/tasks/packet/index.mjs +81 -0
  142. package/src/tasks/packet/merge-deps.mjs +79 -0
  143. package/src/tasks/packet/parse-prompt.mjs +445 -0
  144. package/src/tasks/packet/parse-status.mjs +118 -0
  145. package/src/tasks/packet/validate-contract.mjs +115 -0
  146. package/src/tasks/packet/validate-prompt.mjs +99 -0
  147. package/src/worker-tools/report-progress.d.mts +18 -0
  148. package/src/worker-tools/report-progress.mjs +59 -0
  149. package/src/worker-tools/request-gate.d.mts +17 -0
  150. package/src/worker-tools/request-gate.mjs +54 -0
  151. package/templates/agents/reviewer.md +123 -0
  152. package/templates/agents/supervisor.md +59 -0
  153. package/templates/agents/worker.md +122 -0
  154. package/templates/rules-profile.json +27 -0
  155. package/templates/spine-config.json +64 -0
  156. package/templates/tasks/CONTEXT.md +30 -0
@@ -0,0 +1,414 @@
1
+ /**
2
+ * Orch → base integration (FR-INT-01–05, TP-016).
3
+ */
4
+
5
+ import { execFileSync } from "node:child_process";
6
+ import { gitExec } from "./git-exec.mjs";
7
+ import { loadSpineConfig } from "../../bin/spine-config.mjs";
8
+ import {
9
+ resolveRulesManifestIntegrateDrift,
10
+ tryAutoResolveRulesManifestMergeConflict,
11
+ } from "./engine-lanes.mjs";
12
+ import { checkIntegrateGate } from "./gate.mjs";
13
+ import { appendJournalEvent } from "./journal.mjs";
14
+ import { countCommitsAhead } from "./lane-commit.mjs";
15
+ import { inspectGitState, loadBatchStateFile, parseBatchState } from "./reconcile.mjs";
16
+
17
+ /**
18
+ * @param {string} projectRoot
19
+ * @param {string[]} args
20
+ */
21
+ function git(projectRoot, args) {
22
+ return gitExec(projectRoot, args, { projectRoot });
23
+ }
24
+
25
+ /**
26
+ * Validates orch branch state before `spine batch complete` (FR-BATCH-16).
27
+ *
28
+ * @param {string} projectRoot
29
+ * @param {object} ctx
30
+ * @param {string} ctx.baseBranch
31
+ * @param {string|null} ctx.orchBranch
32
+ * @param {boolean} ctx.mergeResultsEmpty
33
+ * @param {boolean} ctx.orchMergedToBase
34
+ */
35
+ export function assertOrchIntegratable(projectRoot, ctx) {
36
+ const { baseBranch, orchBranch, mergeResultsEmpty, orchMergedToBase } = ctx;
37
+
38
+ if (orchMergedToBase) {
39
+ return { ok: true, reason: "orch_merged_to_base" };
40
+ }
41
+
42
+ if (mergeResultsEmpty) {
43
+ return { ok: true, reason: "no_merge_claimed" };
44
+ }
45
+
46
+ if (!orchBranch) {
47
+ return {
48
+ ok: false,
49
+ failureClass: "EmptyMerge",
50
+ error: "Batch mergeResults claim success but no orch branch is recorded",
51
+ suggestedCommand: "spine status --diagnose",
52
+ };
53
+ }
54
+
55
+ let commitsAhead = 0;
56
+ try {
57
+ commitsAhead = countCommitsAhead(projectRoot, baseBranch, orchBranch);
58
+ } catch (err) {
59
+ const message = err instanceof Error ? err.message : String(err);
60
+ return {
61
+ ok: false,
62
+ failureClass: "EmptyMerge",
63
+ error: `Cannot compare ${orchBranch} to ${baseBranch}: ${message}`,
64
+ suggestedCommand: "spine status --diagnose",
65
+ };
66
+ }
67
+
68
+ if (commitsAhead === 0) {
69
+ return {
70
+ ok: false,
71
+ failureClass: "EmptyMerge",
72
+ error:
73
+ `Orch branch ${orchBranch} has no commits ahead of ${baseBranch} but mergeResults claim success. ` +
74
+ `Re-run the batch or land lane work on the orch branch before completing.`,
75
+ suggestedCommand: "spine status --diagnose",
76
+ };
77
+ }
78
+
79
+ return {
80
+ ok: false,
81
+ failureClass: "NeedsIntegrate",
82
+ error:
83
+ `Orch branch ${orchBranch} is ${commitsAhead} commit(s) ahead of ${baseBranch} — run integrate before completing the batch record.`,
84
+ suggestedCommand: "spine integrate",
85
+ commitsAhead,
86
+ };
87
+ }
88
+
89
+ /**
90
+ * @param {object} ctx
91
+ * @param {string} ctx.projectRoot
92
+ * @param {boolean} [ctx.dryRun]
93
+ * @param {string|null} [ctx.batchId]
94
+ * @param {string|null} [ctx.batchStatePath]
95
+ */
96
+ export function integrateOrchToBase(ctx) {
97
+ const { projectRoot, dryRun = false } = ctx;
98
+ const loaded = loadBatchStateFile(projectRoot, ctx.batchStatePath ?? null);
99
+
100
+ if (!loaded.path || !loaded.raw) {
101
+ return {
102
+ ok: false,
103
+ exitCode: 1,
104
+ headline: "No active batch to integrate",
105
+ suggestedCommand: "spine preflight",
106
+ diagnosis: null,
107
+ batchId: null,
108
+ };
109
+ }
110
+
111
+ if (loaded.parseError) {
112
+ return {
113
+ ok: false,
114
+ exitCode: 1,
115
+ error: loaded.parseError,
116
+ headline: `Cannot parse batch state: ${loaded.parseError}`,
117
+ suggestedCommand: "spine status --diagnose",
118
+ diagnosis: "failed",
119
+ batchId: null,
120
+ };
121
+ }
122
+
123
+ const batch = parseBatchState(loaded.raw, loaded.path ?? "");
124
+ if (!batch) {
125
+ return {
126
+ ok: false,
127
+ exitCode: 1,
128
+ headline: "Batch state is unreadable",
129
+ suggestedCommand: "spine status --diagnose",
130
+ batchId: null,
131
+ };
132
+ }
133
+
134
+ const batchId = batch.batchId;
135
+ if (ctx.batchId && batchId && ctx.batchId !== batchId) {
136
+ return {
137
+ ok: false,
138
+ exitCode: 1,
139
+ error: `Active batch is ${batchId}, not ${ctx.batchId}`,
140
+ headline: `Batch ID mismatch — active batch is ${batchId}`,
141
+ suggestedCommand: "spine status --diagnose",
142
+ batchId,
143
+ };
144
+ }
145
+
146
+ const baseBranch = batch.baseBranch;
147
+ const orchBranch = batch.orchBranch;
148
+ if (!orchBranch) {
149
+ return {
150
+ ok: false,
151
+ exitCode: 1,
152
+ error: "Batch state has no orch branch",
153
+ headline: "Cannot integrate — orch branch missing from batch state",
154
+ suggestedCommand: "spine status --diagnose",
155
+ batchId,
156
+ };
157
+ }
158
+
159
+ const gitState = inspectGitState({
160
+ projectRoot,
161
+ batchId,
162
+ baseBranch,
163
+ orchBranch,
164
+ });
165
+
166
+ if (gitState.orchMergedToBase) {
167
+ return {
168
+ ok: true,
169
+ exitCode: 0,
170
+ batchId,
171
+ baseBranch,
172
+ orchBranch,
173
+ headline: `Orch branch already merged into ${baseBranch}`,
174
+ suggestedCommand: "spine batch complete",
175
+ alreadyMerged: true,
176
+ };
177
+ }
178
+
179
+ const mergeResultsEmpty = batch.mergeResults.length === 0;
180
+ const integratable = assertOrchIntegratable(projectRoot, {
181
+ baseBranch,
182
+ orchBranch,
183
+ mergeResultsEmpty,
184
+ orchMergedToBase: false,
185
+ });
186
+
187
+ let commitsAhead = integratable.commitsAhead ?? null;
188
+ if (commitsAhead == null) {
189
+ try {
190
+ commitsAhead = countCommitsAhead(projectRoot, baseBranch, orchBranch);
191
+ } catch (err) {
192
+ const message = err instanceof Error ? err.message : String(err);
193
+ return {
194
+ ok: false,
195
+ exitCode: 1,
196
+ error: message,
197
+ failureClass: "EmptyMerge",
198
+ headline: `Cannot integrate — ${message}`,
199
+ suggestedCommand: "spine status --diagnose",
200
+ batchId,
201
+ };
202
+ }
203
+ }
204
+
205
+ if (commitsAhead === 0) {
206
+ return {
207
+ ok: false,
208
+ exitCode: 1,
209
+ failureClass: "EmptyMerge",
210
+ error: `Orch branch ${orchBranch} has no commits ahead of ${baseBranch}`,
211
+ headline: `Nothing to integrate — ${orchBranch} is not ahead of ${baseBranch}`,
212
+ suggestedCommand: "spine status --diagnose",
213
+ batchId,
214
+ };
215
+ }
216
+
217
+ if (!integratable.ok && integratable.failureClass !== "NeedsIntegrate") {
218
+ return {
219
+ ok: false,
220
+ exitCode: 1,
221
+ error: integratable.error,
222
+ failureClass: integratable.failureClass,
223
+ headline: integratable.error ?? "Integrate refused",
224
+ suggestedCommand: integratable.suggestedCommand ?? "spine status --diagnose",
225
+ batchId,
226
+ diagnosis: null,
227
+ };
228
+ }
229
+
230
+ const configResult = loadSpineConfig(projectRoot);
231
+ const config = configResult.config ?? null;
232
+ const gateCheck = checkIntegrateGate({
233
+ projectRoot,
234
+ batchId,
235
+ config,
236
+ forceIntegrate: Boolean(ctx.forceIntegrate),
237
+ dryRun,
238
+ });
239
+
240
+ if (!gateCheck.ok && !dryRun) {
241
+ appendJournalEvent(projectRoot, batchId, "integrate.failed", {
242
+ baseBranch,
243
+ orchBranch,
244
+ gateBlocked: true,
245
+ gateStatus: gateCheck.gate?.status ?? "missing",
246
+ error: gateCheck.error ?? gateCheck.headline,
247
+ });
248
+
249
+ return {
250
+ ok: false,
251
+ exitCode: gateCheck.exitCode ?? 2,
252
+ failureClass: gateCheck.failureClass ?? "GateBlocked",
253
+ error: gateCheck.error,
254
+ headline: gateCheck.headline ?? "Integrate blocked by gate",
255
+ suggestedCommand: gateCheck.suggestedCommand ?? "spine gate approve",
256
+ alternatives: gateCheck.alternatives ?? ["/spine-gate approve"],
257
+ batchId,
258
+ gate: gateCheck.gate ?? null,
259
+ diagnosis: "needs_integrate",
260
+ };
261
+ }
262
+
263
+ if (dryRun) {
264
+ const gatePending = gateCheck.required && !gateCheck.ok;
265
+ return {
266
+ ok: true,
267
+ exitCode: 0,
268
+ dryRun: true,
269
+ batchId,
270
+ baseBranch,
271
+ orchBranch,
272
+ commitsAhead,
273
+ gateRequired: gateCheck.required ?? false,
274
+ gatePending,
275
+ headline: gatePending
276
+ ? `Would merge ${orchBranch} → ${baseBranch} after gate approval (${commitsAhead ?? "?"} commit(s))`
277
+ : `Would merge ${orchBranch} → ${baseBranch} (${commitsAhead ?? "?"} commit(s))`,
278
+ suggestedCommand: gatePending ? "spine gate approve" : "spine integrate",
279
+ mergePlan: `git checkout ${baseBranch} && git merge --no-ff ${orchBranch}`,
280
+ };
281
+ }
282
+
283
+ appendJournalEvent(projectRoot, batchId, "integrate.started", {
284
+ baseBranch,
285
+ orchBranch,
286
+ commitsAhead,
287
+ gateRequired: gateCheck.required ?? false,
288
+ gateForced: gateCheck.forced ?? false,
289
+ });
290
+
291
+ const previous = git(projectRoot, ["rev-parse", "--abbrev-ref", "HEAD"]);
292
+ try {
293
+ const drift = resolveRulesManifestIntegrateDrift({ projectRoot, baseBranch, orchBranch });
294
+ if (!drift.ok) {
295
+ return {
296
+ ok: false,
297
+ exitCode: 1,
298
+ error: drift.error,
299
+ failureClass: drift.failureClass ?? "DirtyWorktree",
300
+ headline: drift.error ?? "Integrate refused — dirty rules-manifest",
301
+ suggestedCommand: "spine status --diagnose",
302
+ batchId,
303
+ };
304
+ }
305
+
306
+ git(projectRoot, ["checkout", baseBranch]);
307
+ let mergeInProgress = false;
308
+ try {
309
+ git(projectRoot, [
310
+ "merge",
311
+ "--no-ff",
312
+ orchBranch,
313
+ "-m",
314
+ `integrate ${orchBranch} into ${baseBranch}`,
315
+ ]);
316
+ } catch {
317
+ mergeInProgress = true;
318
+ const autoResolved = tryAutoResolveRulesManifestMergeConflict(projectRoot);
319
+ if (!autoResolved.ok) {
320
+ try {
321
+ execFileSync("git", ["merge", "--abort"], {
322
+ cwd: projectRoot,
323
+ stdio: ["ignore", "pipe", "pipe"],
324
+ });
325
+ } catch {
326
+ // best-effort abort
327
+ }
328
+ const message = autoResolved.error ?? "merge conflict";
329
+ appendJournalEvent(projectRoot, batchId, "integrate.failed", {
330
+ baseBranch,
331
+ orchBranch,
332
+ error: message.slice(0, 500),
333
+ conflict: true,
334
+ });
335
+ try {
336
+ git(projectRoot, ["checkout", previous || baseBranch]);
337
+ } catch {
338
+ // leave operator on base for manual recovery
339
+ }
340
+ return {
341
+ ok: false,
342
+ exitCode: 1,
343
+ error: message,
344
+ failureClass: autoResolved.failureClass ?? "MergeConflict",
345
+ headline: `Merge conflict integrating ${orchBranch} into ${baseBranch} — resolve manually`,
346
+ suggestedCommand: "spine status --diagnose",
347
+ batchId,
348
+ alternatives: ["/spine-gate"],
349
+ };
350
+ }
351
+ git(projectRoot, ["commit", "--no-edit"]);
352
+ }
353
+ const mergeCommit = git(projectRoot, ["rev-parse", "HEAD"]);
354
+
355
+ appendJournalEvent(projectRoot, batchId, "integrate.completed", {
356
+ baseBranch,
357
+ orchBranch,
358
+ mergeCommit,
359
+ commitsAhead,
360
+ });
361
+
362
+ return {
363
+ ok: true,
364
+ exitCode: 0,
365
+ batchId,
366
+ baseBranch,
367
+ orchBranch,
368
+ mergeCommit,
369
+ commitsAhead,
370
+ gateRequired: gateCheck.required ?? false,
371
+ headline: `Integrated ${orchBranch} into ${baseBranch}`,
372
+ suggestedCommand: "spine batch complete",
373
+ alternatives: ["spine status --diagnose"],
374
+ };
375
+ } catch (err) {
376
+ const message = err instanceof Error ? err.message : String(err);
377
+ const conflict = /conflict|CONFLICT/i.test(message);
378
+
379
+ appendJournalEvent(projectRoot, batchId, "integrate.failed", {
380
+ baseBranch,
381
+ orchBranch,
382
+ error: message.slice(0, 500),
383
+ conflict,
384
+ });
385
+
386
+ try {
387
+ execFileSync("git", ["merge", "--abort"], {
388
+ cwd: projectRoot,
389
+ stdio: ["ignore", "pipe", "pipe"],
390
+ });
391
+ } catch {
392
+ // best-effort abort
393
+ }
394
+
395
+ try {
396
+ git(projectRoot, ["checkout", previous || baseBranch]);
397
+ } catch {
398
+ // leave operator on base for manual recovery
399
+ }
400
+
401
+ return {
402
+ ok: false,
403
+ exitCode: 1,
404
+ error: message,
405
+ failureClass: conflict ? "MergeConflict" : "IntegrateFailed",
406
+ headline: conflict
407
+ ? `Merge conflict integrating ${orchBranch} into ${baseBranch} — resolve manually`
408
+ : `Integrate failed: ${message}`,
409
+ suggestedCommand: "spine status --diagnose",
410
+ batchId,
411
+ alternatives: ["/spine-gate"],
412
+ };
413
+ }
414
+ }