opencode-swarm 7.188.12 → 7.190.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 (177) hide show
  1. package/README.md +42 -6
  2. package/binaries/win32-arm64/swarm-sandbox-runner.exe +0 -0
  3. package/binaries/win32-x64/swarm-sandbox-runner.exe +0 -0
  4. package/dist/agents/architect.d.ts +1 -1
  5. package/dist/background/completion-observer.d.ts +6 -0
  6. package/dist/cli/{auto-checkpoint-4g963859.js → auto-checkpoint-qvk04fya.js} +9 -9
  7. package/dist/cli/{checkpoint-y9nbjper.js → checkpoint-9q2r5c3j.js} +18 -20
  8. package/dist/cli/{coder-settlement-q8ea2jkw.js → coder-settlement-xcparbf3.js} +13 -13
  9. package/dist/cli/{config-doctor-4v5m6v30.js → config-doctor-by0ak49m.js} +23 -20
  10. package/dist/cli/{core-879105xb.js → core-b1b3kxzy.js} +4 -4
  11. package/dist/cli/{curation-policy-65ckmmd5.js → curation-policy-6p6fcfjb.js} +6 -6
  12. package/dist/cli/{curator-t7g3hamd.js → curator-d7b88mzr.js} +44 -44
  13. package/dist/cli/{curator-drift-satfdnp2.js → curator-drift-6v604220.js} +9 -9
  14. package/dist/cli/curator-llm-factory-yvbktznk.js +82 -0
  15. package/dist/cli/{doctor-knowledge-receipt-phase-id-y3ft2v24.js → doctor-knowledge-receipt-phase-id-kwrvnps9.js} +9 -9
  16. package/dist/cli/{evidence-summary-service-56rqzmrf.js → evidence-summary-service-mzr2q4bn.js} +21 -22
  17. package/dist/cli/{gate-evidence-zzmgph9z.js → gate-evidence-78jes9kq.js} +8 -8
  18. package/dist/cli/guardrail-explain-8kt2mxmw.js +83 -0
  19. package/dist/cli/{guardrail-log-sxv7q0xw.js → guardrail-log-2sthykag.js} +8 -8
  20. package/dist/cli/{guardrail-reset-37cr442b.js → guardrail-reset-2n746rzv.js} +44 -44
  21. package/dist/cli/{hive-promoter-hyeta8d6.js → hive-promoter-s7a5gwhz.js} +44 -44
  22. package/dist/cli/{index-e638qt2d.js → index-0qc7a88d.js} +3 -3
  23. package/dist/cli/{index-kap0d52p.js → index-1s95jrgc.js} +3 -3
  24. package/dist/cli/{index-9tvjwv01.js → index-2fpv2wmc.js} +1 -1
  25. package/dist/cli/{index-jgr1rsr1.js → index-2kpqqcch.js} +4 -4
  26. package/dist/cli/{index-msvf6p5y.js → index-3t9t9q2q.js} +44 -44
  27. package/dist/cli/{index-8q8783g0.js → index-3zwhxk98.js} +1 -1
  28. package/dist/cli/{index-0b172h6r.js → index-49e65y51.js} +5 -5
  29. package/dist/cli/{index-5pafc9x6.js → index-69tgdm9t.js} +18 -8
  30. package/dist/cli/{index-d3rjvm9e.js → index-7vnr5cmp.js} +2 -2
  31. package/dist/cli/{index-twb3f4tk.js → index-8bx6vhzk.js} +1 -1
  32. package/dist/cli/{index-84pwb6cz.js → index-9gcqmgbc.js} +5 -5
  33. package/dist/cli/{index-9sps637v.js → index-9xxqdzp4.js} +4 -4
  34. package/dist/cli/{index-j0qep2zr.js → index-a5ca62vt.js} +1 -1
  35. package/dist/cli/{index-xy2403g9.js → index-ajzgeb2s.js} +2 -2
  36. package/dist/cli/{index-8xabhfwr.js → index-b2j231jy.js} +2 -2
  37. package/dist/cli/{index-19yt5p2t.js → index-dmq7p8s9.js} +6 -6
  38. package/dist/cli/{index-95pzyv9a.js → index-ej1hdw16.js} +5 -5
  39. package/dist/cli/{index-1krdj1sc.js → index-ejk34dnw.js} +127 -13
  40. package/dist/cli/{index-tbyvvq50.js → index-fb5s32c2.js} +862 -1221
  41. package/dist/cli/{index-ntda6tje.js → index-feaxsjrt.js} +10 -2
  42. package/dist/cli/{index-94fgbb34.js → index-ffgcdf49.js} +22147 -15396
  43. package/dist/cli/{index-fhtcx5ag.js → index-h0xhec3d.js} +4 -4
  44. package/dist/cli/{index-kaqdzhj3.js → index-kfevm0n5.js} +2 -2
  45. package/dist/cli/{index-z7gakzb5.js → index-kp8k95v9.js} +4 -4
  46. package/dist/cli/{index-x1eh2636.js → index-mcv0v2dp.js} +1 -1
  47. package/dist/cli/{index-9czp2dcg.js → index-mjfpaxw3.js} +7 -7
  48. package/dist/cli/{index-tmn4pf7q.js → index-mp1s7b0n.js} +7 -7
  49. package/dist/cli/{index-f0jn2nvs.js → index-mseerehd.js} +26 -10
  50. package/dist/cli/{index-f6exny9m.js → index-n8q43eff.js} +2 -2
  51. package/dist/cli/{index-7hr5m7yp.js → index-nkgzkt7c.js} +1 -1
  52. package/dist/cli/{index-8jy605yf.js → index-npe10823.js} +7 -7
  53. package/dist/cli/{index-yc0y5fjt.js → index-p69k8v0e.js} +1 -1
  54. package/dist/cli/{index-p2tqzwh6.js → index-qs9myayh.js} +5 -10
  55. package/dist/cli/{index-hh7pa3yk.js → index-r9yvpr2m.js} +2 -2
  56. package/dist/cli/{index-qha2p47y.js → index-rgkzcw2a.js} +5 -5
  57. package/dist/cli/{index-zfbxfm2m.js → index-s8b67e6h.js} +33 -12
  58. package/dist/cli/{index-m3hhaf61.js → index-s92a5ta3.js} +4 -4
  59. package/dist/cli/{index-dd6p8xb5.js → index-sm01zpqe.js} +46 -46
  60. package/dist/cli/{index-q9kefh33.js → index-sxj143a4.js} +1 -1
  61. package/dist/cli/{index-2h13hjbf.js → index-t0gj8s46.js} +77 -16
  62. package/dist/cli/{index-3dqazqk4.js → index-t73adn9b.js} +2 -2
  63. package/dist/cli/{index-5cksakjf.js → index-tkhenmms.js} +101 -13
  64. package/dist/cli/{index-zsrtt42s.js → index-v3bmwmqw.js} +25 -1
  65. package/dist/cli/{index-w9tfb0am.js → index-vhn4e6rm.js} +7 -7
  66. package/dist/cli/{index-yjjyapbf.js → index-xyvrfram.js} +2 -2
  67. package/dist/cli/{index-k8sarme1.js → index-y9v41185.js} +1 -1
  68. package/dist/cli/{index-1xa8wq76.js → index-z3ahy9c2.js} +2 -2
  69. package/dist/cli/{index-wrdktgpy.js → index-zk6ttjkt.js} +2 -2
  70. package/dist/cli/{index-7z2pxxye.js → index-zyg1m9d0.js} +4 -4
  71. package/dist/cli/index.js +45 -45
  72. package/dist/cli/{knowledge-escalator-dzd35eb3.js → knowledge-escalator-n1ezv1zp.js} +15 -15
  73. package/dist/cli/{knowledge-events-wkr5ne5f.js → knowledge-events-nyqk3mr7.js} +13 -13
  74. package/dist/cli/{knowledge-link-h4pdcnya.js → knowledge-link-6hw3z6wn.js} +5 -5
  75. package/dist/cli/{knowledge-store-sme6sqrb.js → knowledge-store-mnxqcyet.js} +6 -6
  76. package/dist/cli/{knowledge-validator-jgzeawa8.js → knowledge-validator-z30113mp.js} +8 -8
  77. package/dist/cli/{mcp-egrbh8na.js → mcp-mnbqw2s5.js} +1 -1
  78. package/dist/cli/{model-preflight-h7azh4m4.js → model-preflight-ex482fsy.js} +44 -44
  79. package/dist/cli/{pending-delegations-pg284vsk.js → pending-delegations-j18afz5z.js} +12 -12
  80. package/dist/cli/{pr-subscriptions-hzc4fg25.js → pr-subscriptions-yngda8mz.js} +12 -12
  81. package/dist/cli/{pr-workflow-gate-j3r3g3q7.js → pr-workflow-gate-0vt614f0.js} +44 -44
  82. package/dist/cli/{runner-4hfmp1ag.js → runner-ssnsje35.js} +6 -6
  83. package/dist/cli/{scan-cursor-zg0a56c1.js → scan-cursor-8pwfg5g9.js} +7 -7
  84. package/dist/cli/{schema-p246rqkt.js → schema-e58ytmqt.js} +14 -2
  85. package/dist/cli/{scope-persistence-7qtsmx5c.js → scope-persistence-9qfx6ext.js} +16 -16
  86. package/dist/cli/{server-twhpwhgq.js → server-wxcfwsdx.js} +45 -45
  87. package/dist/cli/{skill-generator-7vfbmyrw.js → skill-generator-tbd4tq9r.js} +17 -17
  88. package/dist/cli/{snapshot-coordination-init-050hf69t.js → snapshot-coordination-init-sckyzb94.js} +44 -44
  89. package/dist/cli/{speckit-checkoff-d3v522cb.js → speckit-checkoff-k5jm0abh.js} +5 -5
  90. package/dist/cli/{telemetry-kvhe94gs.js → telemetry-9szfdfqv.js} +1 -1
  91. package/dist/cli/{workspace-snapshot-30kdf018.js → workspace-snapshot-9f12p1s1.js} +3 -3
  92. package/dist/cli/{worktree-collision-ownership-yy1tp8t9.js → worktree-collision-ownership-3wwfc72t.js} +14 -14
  93. package/dist/cli/{worktree-isolation-e56skbfw.js → worktree-isolation-zfk7zk6a.js} +46 -44
  94. package/dist/commands/coupling.d.ts +21 -4
  95. package/dist/commands/epic-learning.d.ts +28 -0
  96. package/dist/commands/epic.d.ts +81 -36
  97. package/dist/commands/registry.d.ts +8 -8
  98. package/dist/commands/turbo.d.ts +16 -1
  99. package/dist/config/constants.d.ts +11 -1
  100. package/dist/config/loader.d.ts +2 -0
  101. package/dist/config/schema.d.ts +291 -77
  102. package/dist/db/coordination-store.d.ts +6 -0
  103. package/dist/epic/close.d.ts +209 -0
  104. package/dist/{turbo/epic → epic}/cochange-conflict.d.ts +5 -4
  105. package/dist/{turbo/epic → epic}/cochange-source.d.ts +10 -1
  106. package/dist/epic/components.d.ts +238 -0
  107. package/dist/epic/config-gate.d.ts +25 -0
  108. package/dist/epic/config.d.ts +101 -0
  109. package/dist/{turbo/epic → epic}/coupling-report.d.ts +3 -1
  110. package/dist/epic/declared-scopes.d.ts +37 -0
  111. package/dist/epic/epic-branch.d.ts +157 -0
  112. package/dist/epic/gate-policy.d.ts +114 -0
  113. package/dist/epic/git-once.d.ts +26 -0
  114. package/dist/epic/learning-store.d.ts +176 -0
  115. package/dist/epic/learning.d.ts +198 -0
  116. package/dist/epic/legacy-migration.d.ts +26 -0
  117. package/dist/epic/lifecycle.d.ts +437 -0
  118. package/dist/epic/markers.d.ts +123 -0
  119. package/dist/epic/merge-epoch.d.ts +90 -0
  120. package/dist/epic/next-wave-format.d.ts +101 -0
  121. package/dist/epic/next-wave.d.ts +102 -0
  122. package/dist/epic/phase-readiness.d.ts +221 -0
  123. package/dist/epic/plan-key.d.ts +104 -0
  124. package/dist/epic/plan-shaping-seam.d.ts +112 -0
  125. package/dist/epic/planning-signals.d.ts +38 -0
  126. package/dist/epic/report.d.ts +152 -0
  127. package/dist/epic/residue-commit.d.ts +151 -0
  128. package/dist/epic/scorecard.d.ts +130 -0
  129. package/dist/epic/shaping-sizing.d.ts +108 -0
  130. package/dist/epic/shaping-suggestions.d.ts +172 -0
  131. package/dist/epic/shaping.d.ts +112 -0
  132. package/dist/epic/sizing.d.ts +60 -0
  133. package/dist/epic/start.d.ts +187 -0
  134. package/dist/epic/task-landing.d.ts +83 -0
  135. package/dist/epic/wave-close.d.ts +112 -0
  136. package/dist/epic/wave-select.d.ts +95 -0
  137. package/dist/evaluation/contracts.d.ts +1 -1
  138. package/dist/evaluation/public-api.d.ts +1 -1
  139. package/dist/full-auto/policy.d.ts +12 -1
  140. package/dist/hooks/delegation-gate/worktree-isolation.d.ts +16 -0
  141. package/dist/hooks/delegation-gate.d.ts +11 -0
  142. package/dist/hooks/guardrails/index.d.ts +7 -0
  143. package/dist/hooks/promotion-evidence-store.d.ts +2 -2
  144. package/dist/index.js +814 -807
  145. package/dist/plan/manager.d.ts +6 -8
  146. package/dist/plan/parallel-verdict.d.ts +13 -2
  147. package/dist/retention/caps.d.ts +1 -1
  148. package/dist/review/contracts.d.ts +8 -1
  149. package/dist/services/config-doctor.d.ts +38 -0
  150. package/dist/session/snapshot-reader.d.ts +2 -0
  151. package/dist/session/snapshot-writer.d.ts +13 -2
  152. package/dist/state.d.ts +13 -18
  153. package/dist/tools/epic-next-wave.d.ts +20 -0
  154. package/dist/tools/epic-phase-review.d.ts +43 -0
  155. package/dist/tools/index.d.ts +2 -3
  156. package/dist/tools/manifest.d.ts +2 -3
  157. package/dist/tools/phase-complete.d.ts +5 -1
  158. package/dist/tools/save-plan.d.ts +7 -0
  159. package/dist/tools/tool-metadata.d.ts +4 -8
  160. package/dist/worktree/merge.d.ts +14 -1
  161. package/opencode-swarm.schema.json +273 -28
  162. package/package.json +1 -1
  163. package/dist/cli/curator-llm-factory-fx1qnpsh.js +0 -82
  164. package/dist/cli/guardrail-explain-g03manbh.js +0 -83
  165. package/dist/tools/epic-plan-waves.d.ts +0 -79
  166. package/dist/tools/epic-record-divergence.d.ts +0 -73
  167. package/dist/tools/epic-run-phase.d.ts +0 -179
  168. package/dist/turbo/epic/activation.d.ts +0 -193
  169. package/dist/turbo/epic/calibration-engine.d.ts +0 -88
  170. package/dist/turbo/epic/calibration.d.ts +0 -80
  171. package/dist/turbo/epic/divergence-recorder.d.ts +0 -123
  172. package/dist/turbo/epic/index.d.ts +0 -24
  173. package/dist/turbo/epic/promotion-evidence.d.ts +0 -42
  174. package/dist/turbo/epic/state.d.ts +0 -69
  175. package/dist/turbo/epic/task-commit.d.ts +0 -110
  176. package/dist/turbo/epic/upstream-commits.d.ts +0 -82
  177. package/dist/turbo/epic/wave-planner.d.ts +0 -83
@@ -7,14 +7,14 @@ import {
7
7
  parseSpeckitTasksContent,
8
8
  propagateSpeckitCheckoff,
9
9
  writeSpeckitCheckoffLedger
10
- } from "./index-yjjyapbf.js";
10
+ } from "./index-xyvrfram.js";
11
11
  import"./index-ejhxgyvm.js";
12
12
  import"./index-7g4c7s5r.js";
13
- import"./index-p2tqzwh6.js";
14
- import"./index-1krdj1sc.js";
13
+ import"./index-qs9myayh.js";
14
+ import"./index-ejk34dnw.js";
15
15
  import"./index-zxdawwc7.js";
16
- import"./index-2h13hjbf.js";
17
- import"./index-zfbxfm2m.js";
16
+ import"./index-t0gj8s46.js";
17
+ import"./index-s8b67e6h.js";
18
18
  import"./index-bk5tah7q.js";
19
19
  import"./index-gknz3bv1.js";
20
20
  import"./index-zpsr8rpc.js";
@@ -14,7 +14,7 @@ import {
14
14
  startHeartbeatTracking,
15
15
  stopHeartbeatTracking,
16
16
  telemetry
17
- } from "./index-d3rjvm9e.js";
17
+ } from "./index-7vnr5cmp.js";
18
18
  import"./index-fzpt2djt.js";
19
19
  import"./index-gknz3bv1.js";
20
20
  import"./index-zpsr8rpc.js";
@@ -46,11 +46,11 @@ import {
46
46
  shouldSkipSnapshot,
47
47
  switchPrFeedbackTrackingCandidateAsync,
48
48
  workspaceSnapshotMatches
49
- } from "./index-kaqdzhj3.js";
50
- import"./index-7hr5m7yp.js";
49
+ } from "./index-kfevm0n5.js";
50
+ import"./index-nkgzkt7c.js";
51
51
  import"./index-2s7dvzff.js";
52
52
  import"./index-fzpt2djt.js";
53
- import"./index-p2tqzwh6.js";
53
+ import"./index-qs9myayh.js";
54
54
  import"./index-zxdawwc7.js";
55
55
  import"./index-zpsr8rpc.js";
56
56
  import"./index-zgwm4ryv.js";
@@ -6,37 +6,37 @@ import {
6
6
  WORKTREE_PROVISIONING_OWNER_LEASE_MS,
7
7
  removeWorktreeProvisioningOwner,
8
8
  scanWorktreeProvisioningOwnersForRecovery
9
- } from "./index-f6exny9m.js";
9
+ } from "./index-n8q43eff.js";
10
10
  import {
11
11
  scanWorktreeMergeFailuresForRecovery
12
- } from "./index-zsrtt42s.js";
12
+ } from "./index-v3bmwmqw.js";
13
13
  import {
14
14
  scanDelegationFallbacksForRecovery,
15
15
  scanDelegationsForRecovery
16
- } from "./index-8jy605yf.js";
17
- import"./index-7hr5m7yp.js";
16
+ } from "./index-npe10823.js";
17
+ import"./index-nkgzkt7c.js";
18
18
  import"./index-2s7dvzff.js";
19
- import"./index-x1eh2636.js";
20
- import"./index-ntda6tje.js";
21
- import"./index-9tvjwv01.js";
19
+ import"./index-mcv0v2dp.js";
20
+ import"./index-feaxsjrt.js";
21
+ import"./index-2fpv2wmc.js";
22
22
  import"./index-ry16d01s.js";
23
23
  import"./index-rdm3px0g.js";
24
24
  import"./index-7pmbnjvj.js";
25
- import"./index-1xa8wq76.js";
26
- import"./index-tmn4pf7q.js";
25
+ import"./index-z3ahy9c2.js";
26
+ import"./index-mp1s7b0n.js";
27
27
  import"./index-vzm6zre7.js";
28
28
  import"./index-ae75rja9.js";
29
- import"./index-8q8783g0.js";
30
- import"./index-hh7pa3yk.js";
31
- import"./index-twb3f4tk.js";
29
+ import"./index-3zwhxk98.js";
30
+ import"./index-r9yvpr2m.js";
31
+ import"./index-8bx6vhzk.js";
32
32
  import"./index-t7hmqgjy.js";
33
- import"./index-d3rjvm9e.js";
33
+ import"./index-7vnr5cmp.js";
34
34
  import {
35
35
  canonicalRootKeyFresh
36
36
  } from "./index-fzpt2djt.js";
37
37
  import"./index-ejhxgyvm.js";
38
38
  import"./index-7g4c7s5r.js";
39
- import"./index-p2tqzwh6.js";
39
+ import"./index-qs9myayh.js";
40
40
  import"./index-zxdawwc7.js";
41
41
  import"./index-bk5tah7q.js";
42
42
  import"./index-gknz3bv1.js";
@@ -18,80 +18,81 @@ import {
18
18
  preserveDirtyWorktreeForCallId,
19
19
  readLaneEnvFileFromDisk,
20
20
  resetStandardWorktreeIsolationState,
21
+ runSerializedWithMergeBacks,
21
22
  sanitizeWorktreeTaskId,
22
23
  standardWorktreeByCallID,
23
24
  standardWorktreeSerializationSessions
24
- } from "./index-94fgbb34.js";
25
- import"./index-9sps637v.js";
26
- import"./index-5cksakjf.js";
27
- import"./index-84pwb6cz.js";
25
+ } from "./index-ffgcdf49.js";
26
+ import"./index-9xxqdzp4.js";
27
+ import"./index-tkhenmms.js";
28
+ import"./index-9gcqmgbc.js";
28
29
  import"./index-j2vv0h13.js";
29
- import"./index-k8sarme1.js";
30
- import"./index-8xabhfwr.js";
30
+ import"./index-y9v41185.js";
31
+ import"./index-b2j231jy.js";
31
32
  import"./index-txdagbh7.js";
32
- import"./index-xy2403g9.js";
33
+ import"./index-ajzgeb2s.js";
33
34
  import"./index-rdec0y3z.js";
34
- import"./index-e638qt2d.js";
35
- import"./index-w9tfb0am.js";
36
- import"./index-m3hhaf61.js";
37
- import"./index-19yt5p2t.js";
38
- import"./index-kaqdzhj3.js";
39
- import"./index-9czp2dcg.js";
35
+ import"./index-0qc7a88d.js";
36
+ import"./index-vhn4e6rm.js";
37
+ import"./index-s92a5ta3.js";
38
+ import"./index-dmq7p8s9.js";
39
+ import"./index-kfevm0n5.js";
40
+ import"./index-mjfpaxw3.js";
40
41
  import"./index-cjapb4hy.js";
41
- import"./index-f6exny9m.js";
42
+ import"./index-n8q43eff.js";
42
43
  import"./index-pt7h91zc.js";
43
44
  import"./index-q7sjgr1y.js";
44
- import"./index-f0jn2nvs.js";
45
- import"./index-tbyvvq50.js";
45
+ import"./index-mseerehd.js";
46
+ import"./index-fb5s32c2.js";
46
47
  import"./index-6b295cas.js";
47
48
  import"./index-9nyqt3kb.js";
48
- import"./index-yc0y5fjt.js";
49
- import"./index-zsrtt42s.js";
50
- import"./index-yjjyapbf.js";
51
- import"./index-5pafc9x6.js";
52
- import"./index-7z2pxxye.js";
49
+ import"./index-p69k8v0e.js";
50
+ import"./index-v3bmwmqw.js";
51
+ import"./index-xyvrfram.js";
52
+ import"./index-69tgdm9t.js";
53
+ import"./index-zyg1m9d0.js";
53
54
  import"./index-g4fs6z4e.js";
54
- import"./index-8jy605yf.js";
55
- import"./index-fhtcx5ag.js";
56
- import"./index-0b172h6r.js";
55
+ import"./index-npe10823.js";
56
+ import"./index-h0xhec3d.js";
57
+ import"./index-49e65y51.js";
57
58
  import"./index-m9zzj4ee.js";
58
- import"./index-7hr5m7yp.js";
59
+ import"./index-nkgzkt7c.js";
59
60
  import"./index-2s7dvzff.js";
60
- import"./index-jgr1rsr1.js";
61
- import"./index-q9kefh33.js";
61
+ import"./index-2kpqqcch.js";
62
+ import"./index-sxj143a4.js";
62
63
  import"./index-rtry5xyf.js";
63
64
  import {
64
65
  resolveWorktreeIsolationConfig
65
- } from "./index-kap0d52p.js";
66
+ } from "./index-1s95jrgc.js";
66
67
  import"./index-pkhbd2t5.js";
67
68
  import"./index-0725jpp7.js";
68
- import"./index-qha2p47y.js";
69
- import"./index-95pzyv9a.js";
70
- import"./index-wrdktgpy.js";
71
- import"./index-x1eh2636.js";
72
- import"./index-ntda6tje.js";
73
- import"./index-9tvjwv01.js";
69
+ import"./index-rgkzcw2a.js";
70
+ import"./index-ej1hdw16.js";
71
+ import"./index-zk6ttjkt.js";
72
+ import"./index-mcv0v2dp.js";
73
+ import"./index-feaxsjrt.js";
74
+ import"./index-2fpv2wmc.js";
74
75
  import"./index-ry16d01s.js";
75
76
  import"./index-rdm3px0g.js";
76
77
  import"./index-7pmbnjvj.js";
77
- import"./index-1xa8wq76.js";
78
- import"./index-tmn4pf7q.js";
78
+ import"./index-z3ahy9c2.js";
79
+ import"./index-mp1s7b0n.js";
79
80
  import"./index-vzm6zre7.js";
80
81
  import"./index-ae75rja9.js";
81
- import"./index-8q8783g0.js";
82
- import"./index-hh7pa3yk.js";
83
- import"./index-twb3f4tk.js";
82
+ import"./index-3zwhxk98.js";
83
+ import"./index-r9yvpr2m.js";
84
+ import"./index-8bx6vhzk.js";
84
85
  import"./index-t7hmqgjy.js";
85
- import"./index-d3rjvm9e.js";
86
+ import"./index-7vnr5cmp.js";
86
87
  import"./index-fzpt2djt.js";
87
88
  import"./index-ejhxgyvm.js";
88
89
  import"./index-7g4c7s5r.js";
89
- import"./index-p2tqzwh6.js";
90
+ import"./index-qs9myayh.js";
90
91
  import"./index-gx2vp8gx.js";
91
- import"./index-1krdj1sc.js";
92
+ import"./index-ejk34dnw.js";
92
93
  import"./index-zxdawwc7.js";
93
- import"./index-2h13hjbf.js";
94
- import"./index-zfbxfm2m.js";
94
+ import"./index-t0gj8s46.js";
95
+ import"./index-s8b67e6h.js";
95
96
  import"./index-bk5tah7q.js";
96
97
  import"./index-gknz3bv1.js";
97
98
  import"./index-zpsr8rpc.js";
@@ -103,6 +104,7 @@ export {
103
104
  standardWorktreeSerializationSessions,
104
105
  standardWorktreeByCallID,
105
106
  sanitizeWorktreeTaskId,
107
+ runSerializedWithMergeBacks,
106
108
  resolveWorktreeIsolationConfig,
107
109
  resetStandardWorktreeIsolationState,
108
110
  readLaneEnvFileFromDisk,
@@ -7,9 +7,13 @@
7
7
  * a structured JSON report under `.swarm/epic/coupling-report.json` for
8
8
  * programmatic consumption.
9
9
  *
10
- * This command always runs independent of `turbo.epic.cochange.enabled`. The
11
- * config flag gates runtime planner integration (M3); `/swarm coupling` is a
12
- * diagnostic and what-if tool, so users can see the report before opting in.
10
+ * The report itself always runs (it is a diagnostic), but the co-change
11
+ * signal honors the `epic.cochange.enabled` master gate (default
12
+ * false): when it is not `true`, no git history is scanned, `p` reflects
13
+ * declared-path conflicts only, and the report states that the co-change
14
+ * signal is disabled by config (`cochangeSignal: 'disabled-by-config'` in
15
+ * JSON output). Declared task scopes resolve from the authoritative v2
16
+ * scope-binding store (what `declare_scope` writes), then `files_touched`.
13
17
  *
14
18
  * Flags:
15
19
  * --phase <n> Scope to one phase (default: whole plan).
@@ -17,9 +21,18 @@
17
21
  * --min-co-changes <n> Co-change-count floor override (default: 5).
18
22
  * --format <fmt> 'markdown' (default) or 'json'.
19
23
  * --persist Also write JSON to .swarm/epic/coupling-report.json.
24
+ * --suggest Also shape the whole plan (Epic v2 C7): the same
25
+ * ranked advisory `save_plan` returns as
26
+ * `epic_shaping` (`src/epic/shaping.ts`), with
27
+ * the start's inputs (live declared scopes, learned
28
+ * signals of the project prior, co-change when
29
+ * enabled, the epic's wave width). Read-only.
20
30
  */
31
+ import { loadPluginConfigWithMeta } from '../config/index.js';
32
+ import { getCoChangeData, getCoChangePairs } from '../epic/cochange-source.js';
33
+ import { loadEpicLearningView } from '../epic/learning-store.js';
34
+ import { isGitRepo } from '../git/branch.js';
21
35
  import { loadPlanJsonOnly } from '../plan/manager.js';
22
- import { getCoChangePairs } from '../turbo/epic/cochange-source.js';
23
36
  /**
24
37
  * Entry point invoked from the command registry. Returns the report
25
38
  * formatted per the `--format` flag, plus a one-line "wrote to ..." trailer
@@ -33,4 +46,8 @@ export declare function handleCouplingCommand(directory: string, args: string[])
33
46
  export declare const _internals: {
34
47
  loadPlanJsonOnly: typeof loadPlanJsonOnly;
35
48
  getCoChangePairs: typeof getCoChangePairs;
49
+ getCoChangeData: typeof getCoChangeData;
50
+ loadPluginConfigWithMeta: typeof loadPluginConfigWithMeta;
51
+ loadEpicLearningView: typeof loadEpicLearningView;
52
+ isGitRepo: typeof isGitRepo;
36
53
  };
@@ -0,0 +1,28 @@
1
+ /**
2
+ * `/swarm epic learning` and `/swarm epic prior [show|reset]` (Epic v2 C6)
3
+ * — read-only views of what epics learned, and the one destructive action
4
+ * (`prior reset`, two-step through the shared destructive-confirm
5
+ * primitive: preview + token, then `--confirm=<token>`). See
6
+ * `src/epic/learning.ts` (the model) and
7
+ * `src/epic/learning-store.ts` (prior + posterior). Both work
8
+ * regardless of the Epic config gate, like `status` and `close`.
9
+ */
10
+ import { type EpicLearningSettings } from '../epic/learning.js';
11
+ import { loadEpicLearningView, readEpicPrior, resetEpicPrior } from '../epic/learning-store.js';
12
+ import { getOpenEpic } from '../epic/lifecycle.js';
13
+ import { consumeConfirmToken, issueConfirmToken } from './destructive-purge.js';
14
+ /** DI seam (AGENTS.md invariant 7). Restore in `afterEach`. */
15
+ export declare const _internals: {
16
+ getOpenEpic: typeof getOpenEpic;
17
+ issueConfirmToken: typeof issueConfirmToken;
18
+ consumeConfirmToken: typeof consumeConfirmToken;
19
+ loadEpicLearningView: typeof loadEpicLearningView;
20
+ readEpicPrior: typeof readEpicPrior;
21
+ resetEpicPrior: typeof resetEpicPrior;
22
+ now: () => number;
23
+ };
24
+ export declare const EPIC_PRIOR_USAGE = "Usage: /swarm epic prior [show] | /swarm epic prior reset [--confirm=<token>]";
25
+ /** `/swarm epic learning` — what the Epic planner learned and uses now. */
26
+ export declare function renderEpicLearning(directory: string, settings: EpicLearningSettings): string;
27
+ /** `/swarm epic prior [show|reset [--confirm=<token>]]`. */
28
+ export declare function renderEpicPrior(directory: string, args: string[], settings: EpicLearningSettings): string;
@@ -1,32 +1,60 @@
1
1
  /**
2
- * `/swarm epic` — Epic Mode activation toggle and diagnostics (Capability C).
2
+ * `/swarm epic` — plan-scoped Epic lifecycle and diagnostics (Epic v2 C1a).
3
3
  *
4
4
  * Subcommands:
5
- * /swarm epic on — enable Epic Mode for this session
6
- * /swarm epic off — disable Epic Mode for this session
7
- * /swarm epic — toggle (on if off, off if on)
8
- * /swarm epic status — show current state + last decision rationale
9
- * /swarm epic decide — run the activation decision once and print the
10
- * verdict without dispatching execution
11
- * (read-only what-if; does NOT write to
12
- * `.swarm/evidence/epic-promotions.jsonl`)
5
+ * /swarm epic start [--force] — open an epic for the current plan (see
6
+ * `src/epic/start.ts` for the refusals)
7
+ * /swarm epic close [--abandon] [--land squash|merge|none]
8
+ * — close the open epic, land its epic branch onto
9
+ * the original branch (default squash: staged,
10
+ * uncommitted), and write its close report
11
+ * /swarm epic — same as `status` (the bare form never mutates
12
+ * the epic)
13
+ * /swarm epic status [--repair-refs]
14
+ * — lifecycle state, orphan detection, sentinel/row
15
+ * repair, recorded worktree merge failures, and
16
+ * the one-time retirement of Epic v1 session state
17
+ * (including the epic's waves, phases, the
18
+ * phase's task components recorded with the
19
+ * latest wave, and divergence recorded by
20
+ * `epic_next_wave`);
21
+ * `--repair-refs` re-adopts task commits a rebase
22
+ * or amend made unreachable (Epic v2 C3)
23
+ * /swarm epic report [<key>|last] [--format json]
24
+ * — the epic scorecard (Epic v2 C8): live for the
25
+ * open epic, else from a past epic's close report
26
+ * in `.swarm/epic-prior/reports/` (`last` = the
27
+ * newest; `<key>` = a report or epic key)
28
+ * /swarm epic learning — what the Epic planner learned (hot files,
29
+ * learned co-writes) and uses now (Epic v2 C6)
30
+ * /swarm epic prior [show|reset [--confirm=<token>]]
31
+ * — the project prior `.swarm/epic-prior/
32
+ * learning.json`; `reset` previews without
33
+ * `--confirm`
34
+ * /swarm epic clear-merge-failure <taskId> [--confirm]
35
+ * — clear a recorded worktree merge failure that
36
+ * blocks an epic wave (read-only without --confirm)
13
37
  *
14
- * Toggling only mutates session state (and the durable
15
- * `.swarm/epic-state.json`); it does not start or stop any execution. The
16
- * `epic_decide_phase` + `epic_plan_waves` tools (plus per-wave Task dispatch
17
- * by the architect) are the architect-facing entries that gate execution.
38
+ * The Epic v1 `on` / `off` per-session toggles were removed: an epic is
39
+ * bound to one plan and every Epic behaviour is driven by the sentinel-first
40
+ * project probe (`isEpicOpenForProject`). `decide` / `last` were removed in
41
+ * Epic v2 C2 with the activation gate: `epic_next_wave` plans every wave and
42
+ * `status` shows what it recorded. `calibration` was renamed `learning` in
43
+ * Epic v2 C6 (the v1 self-calibration was replaced). `close`, `status`,
44
+ * `report`, `learning`, and `prior` work regardless of the config gate.
18
45
  */
19
46
  import { loadPluginConfigWithMeta } from '../config/index.js';
20
- import { isGitRepo } from '../git/branch.js';
47
+ import { closeEpic } from '../epic/close.js';
48
+ import { checkEpicBranch } from '../epic/epic-branch.js';
49
+ import { retireLegacyEpicSessionState } from '../epic/legacy-migration.js';
50
+ import { type EpicLandMode, getOpenEpic, inspectEpic, repairEpicSentinel, updateEpicRecord } from '../epic/lifecycle.js';
51
+ import { planEpicTaskRefRepair, readEpicRefs, syncEpicRefs, writeEpicRef } from '../epic/markers.js';
52
+ import { clearMergeFailureCommand, describeMergeFailuresForStatus } from '../epic/merge-epoch.js';
53
+ import { completedBeforeEpic } from '../epic/next-wave.js';
54
+ import { resolvePlanMarkerScope } from '../epic/plan-key.js';
55
+ import { selectEpicReport } from '../epic/report.js';
56
+ import { startEpic } from '../epic/start.js';
21
57
  import { loadPlanJsonOnly } from '../plan/manager.js';
22
- import { ensureAgentSession } from '../state.js';
23
- import { decideEpicActivation } from '../turbo/epic/activation.js';
24
- import { isCalibrationStateUnreadable, loadCalibrationState } from '../turbo/epic/calibration.js';
25
- import { getCoChangeData } from '../turbo/epic/cochange-source.js';
26
- import { readDivergenceHistory } from '../turbo/epic/divergence-recorder.js';
27
- import { readPromotionEvidence } from '../turbo/epic/promotion-evidence.js';
28
- import { disableEpicMode, enableEpicMode, isEpicModeActive, isStateUnreadable, loadEpicSessionState } from '../turbo/epic/state.js';
29
- import { readTaskScopes } from '../turbo/lean/conflicts.js';
30
58
  /**
31
59
  * Test-only DI seam. Production code calls `_internals.fn(...)` so tests can
32
60
  * replace these without `mock.module` (AGENTS.md invariant 7).
@@ -34,19 +62,36 @@ import { readTaskScopes } from '../turbo/lean/conflicts.js';
34
62
  export declare const _internals: {
35
63
  loadPluginConfigWithMeta: typeof loadPluginConfigWithMeta;
36
64
  loadPlanJsonOnly: typeof loadPlanJsonOnly;
37
- getCoChangeData: typeof getCoChangeData;
38
- decideEpicActivation: typeof decideEpicActivation;
39
- ensureAgentSession: typeof ensureAgentSession;
40
- isEpicModeActive: typeof isEpicModeActive;
41
- isStateUnreadable: typeof isStateUnreadable;
42
- loadEpicSessionState: typeof loadEpicSessionState;
43
- enableEpicMode: typeof enableEpicMode;
44
- disableEpicMode: typeof disableEpicMode;
45
- readTaskScopes: typeof readTaskScopes;
46
- readPromotionEvidence: typeof readPromotionEvidence;
47
- loadCalibrationState: typeof loadCalibrationState;
48
- isCalibrationStateUnreadable: typeof isCalibrationStateUnreadable;
49
- readDivergenceHistory: typeof readDivergenceHistory;
50
- isGitRepo: typeof isGitRepo;
65
+ resolvePlanMarkerScope: typeof resolvePlanMarkerScope;
66
+ describeMergeFailuresForStatus: typeof describeMergeFailuresForStatus;
67
+ clearMergeFailureCommand: typeof clearMergeFailureCommand;
68
+ startEpic: typeof startEpic;
69
+ closeEpic: typeof closeEpic;
70
+ inspectEpic: typeof inspectEpic;
71
+ repairEpicSentinel: typeof repairEpicSentinel;
72
+ retireLegacyEpicSessionState: typeof retireLegacyEpicSessionState;
73
+ checkEpicBranch: typeof checkEpicBranch;
74
+ getOpenEpic: typeof getOpenEpic;
75
+ updateEpicRecord: typeof updateEpicRecord;
76
+ planEpicTaskRefRepair: typeof planEpicTaskRefRepair;
77
+ syncEpicRefs: typeof syncEpicRefs;
78
+ readEpicRefs: typeof readEpicRefs;
79
+ writeEpicRef: typeof writeEpicRef;
80
+ completedBeforeEpic: typeof completedBeforeEpic;
81
+ selectEpicReport: typeof selectEpicReport;
51
82
  };
52
83
  export declare function handleEpicCommand(directory: string, args: string[], sessionID: string): Promise<string>;
84
+ /** Parse `report` options: one optional selector, `--format json|markdown`. */
85
+ export declare function parseReportOptions(args: string[]): {
86
+ selector: string | null;
87
+ format: 'markdown' | 'json';
88
+ } | {
89
+ error: string;
90
+ };
91
+ /** Parse `close` options: `--abandon`, `--land <mode>` / `--land=<mode>`. */
92
+ export declare function parseCloseOptions(args: string[]): {
93
+ abandon: boolean;
94
+ land?: EpicLandMode;
95
+ } | {
96
+ error: string;
97
+ };
@@ -707,16 +707,16 @@ export declare const COMMAND_REGISTRY: {
707
707
  readonly coupling: {
708
708
  readonly handler: (ctx: CommandContext) => Promise<string>;
709
709
  readonly description: "Measure plan coupling (p) and rank modules driving conflicts (Epic mode preview)";
710
- readonly details: "Computes the coupling coefficient p = (conflicting task pairs) / (total task pairs) over the current plan, using Epic mode's combined path + co-change conflict signal. Surfaces per-module contention and a ranked decoupling roadmap. Read-only: runs independent of `turbo.epic.cochange.enabled` so it can be used as a what-if diagnostic before opting into the runtime signal.";
711
- readonly args: "--phase <n>, --threshold <-1..1>, --min-co-changes <n>, --format markdown|json, --persist";
710
+ readonly details: "Computes the coupling coefficient p = (conflicting task pairs) / (total task pairs) over the current plan, using Epic mode's combined path + co-change conflict signal. Surfaces per-module contention and a ranked decoupling roadmap. Declared scopes come from live `declare_scope` bindings (falling back to plan `files_touched`). Read-only and usable without Epic Mode on, but the co-change signal is included only when `epic.cochange.enabled` is true — otherwise p reflects path conflicts only and the report says the signal is disabled by config. `--suggest` adds Epic plan shaping for the whole plan (the advisory save_plan returns as `epic_shaping` when Epic is on): the plan's epic sizing and up to 5 suggestions — scope advice (declare-scope, narrow-scope) first, then by their effective-speedup gain: extract-prerequisite, isolate-hot-file, split-task, merge-tasks, each with a concrete save_plan patch. Read-only; bounded by a work budget (skipped-budget beyond it).";
711
+ readonly args: "--phase <n>, --threshold <-1..1>, --min-co-changes <n>, --format markdown|json, --persist, --suggest";
712
712
  readonly category: "diagnostics";
713
713
  readonly toolPolicy: "none";
714
714
  };
715
715
  readonly epic: {
716
716
  readonly handler: (ctx: CommandContext) => Promise<string>;
717
- readonly description: "Toggle Epic Mode (autonomous coupling-aware parallel activation) and inspect its decisions";
718
- readonly details: "Epic Mode is an additive overlay that composes Lean Turbo. When on, the architect follows the transparent decide-then-dispatch wave flow: declare_scope (per pending task) → epic_decide_phase → epic_plan_waves → for each wave in order, dispatch one Task per taskId in the wave, ALL in one assistant message (each concurrent coder appears as a visible subagent the user can click into) → epic_record_divergence. epic_decide_phase computes the plan-wide coupling coefficient p and gates parallel promotion on p + a hot-module check + a greenfield rule. epic_plan_waves partitions promoted phases into ordered concurrent groups (waves) that respect dependency order and scope disjointness. Subcommands: on, off, status, decide (read-only what-if), last (most recent decision from durable evidence log), calibration (Capability D state: learned threshold + hot modules + recent divergent tasks). Bare /swarm epic shows status. Decision rationale persists to .swarm/evidence/epic-promotions.jsonl after every epic_decide_phase invocation.";
719
- readonly args: "on | off | status | decide | last | calibration";
717
+ readonly description: "Open, inspect, and close a plan-scoped epic (coupling-aware parallel execution of the current plan)";
718
+ readonly details: "An epic is bound to ONE plan: `start` opens it for the current plan, `close` ends it. Requires `epic.mode.enabled: true` in config (top-level `epic` block; no `turbo` block needed — the legacy `turbo.epic` path is still accepted and migrated). `start [--force]` refuses, in order: epic-disabled-by-config, host-unsupported (the host gives the plugin no OpenCode SDK client — OpenCode 2 does not yet — so worktree-isolated coders and the phase review cannot run), no-plan / plan-ledger-unreadable, epic-already-open (idempotent for the same plan) / epic-open-for-other-plan, turbo-active (config turbo_mode, a session with Turbo on, or a running Lean run — Epic enables neither Lean nor Turbo and never waives per-task QA), dirty-baseline (git: uncommitted changes outside .swarm/), detached-head / epic-branch-exists (epic-branch policy), in-flight-coders (any coder dispatch, background delegation, unsettled settlement, or preserved/recovery lane), not-epic-sized (too few pending tasks, insufficient scope coverage, or insufficient effective speedup — run it in Balanced, or reshape it with the plan-shaping suggestions shown; `--force` overrides and is recorded). Non-git projects run an epic serially (one task per wave). Git epics default to `epic.commit_policy: \"epic-branch\"`: start checks out `swarm/epic/<epicKey>` and every Epic commit goes there (epic_next_wave blocks with epic-branch-mismatch, and no landing or residue is committed, while HEAD is elsewhere); `current-branch` keeps commits on the starting branch. In a git epic every coder runs in an isolated worktree (refused EPIC_ISOLATION_DEGRADED when isolation is unavailable) and lands as a `swarm(task <id>): …` merge commit; main-tree files a non-coder writer (test_engineer, docs) wrote for a task are committed as residue of that task; update_task_status writes nothing to git; wave close records the commit of each task as `refs/swarm/epics/<epicKey>/tasks/<id>` (deleted at close unless `epic.retain_refs`; never pushed by default). While open, the architect calls epic_next_wave and does what its status says: it issues one wave at a time (tasks with non-conflicting declared scopes — exclusive tasks alone, at most one task per densely coupled component; phases strictly in order), the architect dispatches one Task per taskId in ONE message and runs per-task QA (pre_check_batch → reviewer + test_engineer → update_task_status(completed)), and the next epic_next_wave closes the wave (recording outcomes and declared-vs-actual divergence) and issues the next; when a phase is done it returns phase-ready-for-review → epic_phase_review → phase_complete. `close [--abandon] [--land squash|merge|none]` refuses while tasks are pending (or the epic is orphaned / unreadable) unless `--abandon`, refuses a dirty tree before landing, writes a close report (epic-report-v2, embedding the epic scorecard) to .swarm/epic/reports/ and .swarm/epic-prior/reports/ (newest 50 kept), and lands the epic branch onto the original branch: squash (default — staged, uncommitted changes for you to review and commit), merge (a --no-ff merge commit), or none (switch back only). The epic branch is kept (remove it with `git branch -D` once committed). A landing conflict is rolled back (the attempted squash or merge is undone) and the epic stays closing — rerun close to resume. `--abandon` never lands; it switches back to the original branch when the tree is clean. `status [--repair-refs]` (also bare /swarm epic) shows the epic, its waves, phases, the task components recorded with the latest wave and recorded divergence, orphan detection (plan renamed or replaced), sentinel/row repair, recorded worktree merge failures, and retires legacy Epic v1 session state once; `--repair-refs` re-adopts task commits a rebase or amend made unreachable from HEAD. `report [<key>|last] [--format json]` shows the epic scorecard: live for the open epic (bare `report`), else from the close report of a past epic in .swarm/epic-prior/reports/ (`last` = newest; `<key>` = a report or epic key) — tasks completed in the epic, waves (count, width), time over closed waves (wave span, task issue→resolve time, and their ratio, a concurrency factor that is NOT a speedup: it includes queueing behind serialized QA), conflicts (merge-back failures, undeclared writes), rework (extra generations, reopens), first-pass gate rates (upper bounds: the failure history is bounded), forced/sizing at start and learned hot files. Epics learn from their outcomes: undeclared writes teach learned co-writes (a task declaring D that also wrote f makes later tasks declaring D conflict with tasks on f — planner analysis only, never write authorization) and incidents (undeclared writes, merge conflicts, Stage B failures, rework, reopens) in excess of clean exposures make a file hot (a task declaring it runs alone) — undeclared writes its strongest learned co-writer explains are discounted (expansion already separates them), so one declarer writing a file is not heat; an empty history learns nothing (neutral start). Each wave close updates the posterior of the epic; close merges it into the project prior .swarm/epic-prior/learning.json (decayed per epic and by age; kept across /swarm close; `epic.learning.*`). `learning` shows what the planner learned and uses now; `prior [show]` shows the project prior; `prior reset` previews and prints a single-use confirm token (15 minutes); `prior reset --confirm=<token>` clears it. Also: clear-merge-failure <taskId> [--confirm]. The former `on` / `off` toggles, the `decide` / `last` subcommands and `calibration` (renamed `learning`) were removed.";
719
+ readonly args: "start [--force] | close [--abandon] [--land squash|merge|none] | status [--repair-refs] | report [<key>|last] [--format json] | learning | prior [show|reset [--confirm=<token>]] | clear-merge-failure <taskId> [--confirm]";
720
720
  readonly category: "diagnostics";
721
721
  readonly toolPolicy: "none";
722
722
  };
@@ -730,7 +730,7 @@ export declare const COMMAND_REGISTRY: {
730
730
  readonly finalize: {
731
731
  readonly handler: (ctx: CommandContext) => Promise<string>;
732
732
  readonly description: "Use /swarm finalize to finalize the swarm project and archive evidence";
733
- readonly details: "Idempotent 4-stage terminal finalization: (1) finalize writes retrospectives for in-progress phases, (2) archive creates timestamped bundle of swarm artifacts and evidence, (3) clean removes active-state files for a clean slate, (4) align performs aggressive git reset --hard to the default remote branch, discarding uncommitted changes and gitignored build artifacts (user-created untracked files are preserved); falls back to a cautious reset that preserves uncommitted changes when the aggressive path cannot proceed. Alignment re-verifies the tracked tree immediately before its destructive reset and aborts fail-closed (leaving alignment undone) when tracked files changed after the close gate was verified or the status cannot be re-read (#2953). WARNING: alignment discards local changes and gitignored files. Resets agent sessions, delegation chains, and active-agent mappings. Reads .swarm/close-lessons.md for explicit lessons and runs curation. Cleanup: knowledge.jsonl is preserved; plan.json, plan.md, events.jsonl, handoff.*, run-memory.jsonl, and summaries/ are removed. Use --skill-review to run the quota-bounded skill_improver in proposal mode. Use --dry-run to preview what finalize would archive, clean, and align without taking the lock or changing anything.";
733
+ readonly details: "Idempotent 4-stage terminal finalization: (1) finalize writes retrospectives for in-progress phases, (2) archive creates timestamped bundle of swarm artifacts and evidence, (3) clean removes active-state files for a clean slate, (4) align performs aggressive git reset --hard to the default remote branch, discarding uncommitted changes and gitignored build artifacts (user-created untracked files are preserved); falls back to a cautious reset that preserves uncommitted changes when the aggressive path cannot proceed. Alignment re-verifies the tracked tree immediately before its destructive reset and aborts fail-closed (leaving alignment undone) when tracked files changed after the close gate was verified or the status cannot be re-read (#2953). WARNING: alignment discards local changes and gitignored files. Resets agent sessions, delegation chains, and active-agent mappings. Reads .swarm/close-lessons.md for explicit lessons and runs curation. Cleanup: knowledge.jsonl is preserved; plan.json, plan.md, events.jsonl, handoff.*, run-memory.jsonl, and summaries/ are removed. An open epic (Epic Mode) is first closed as abandoned-by-swarm-close (it never lands; its close report is archived); .swarm/epic/ is cleaned, while .swarm/epic-prior/ (learning prior and past epic reports) is preserved. Use --skill-review to run the quota-bounded skill_improver in proposal mode. Use --dry-run to preview what finalize would archive, clean, and align without taking the lock or changing anything.";
734
734
  readonly args: "--prune-branches, --skill-review, --dry-run";
735
735
  readonly category: "core";
736
736
  readonly toolPolicy: "none";
@@ -1116,8 +1116,8 @@ export declare const COMMAND_REGISTRY: {
1116
1116
  };
1117
1117
  readonly turbo: {
1118
1118
  readonly handler: (ctx: CommandContext) => Promise<string>;
1119
- readonly description: "Toggle Turbo Mode strategy for the active session [on|off|lean|standard|epic|status]";
1120
- readonly args: "on, off, lean, standard, epic, status";
1119
+ readonly description: "Toggle Turbo Mode strategy for the active session [on|off|lean|standard|status]";
1120
+ readonly args: "on, off, lean, standard, status";
1121
1121
  readonly details: string;
1122
1122
  readonly category: "utility";
1123
1123
  readonly toolPolicy: "none";
@@ -1,4 +1,5 @@
1
1
  import { loadPluginConfigWithMeta } from '../config';
2
+ import { isEpicOpenForProject } from '../epic/lifecycle';
2
3
  /**
3
4
  * Test-only dependency-injection seam. Production code calls
4
5
  * `_internals.loadPluginConfigWithMeta(...)` so tests can replace the function
@@ -8,13 +9,27 @@ import { loadPluginConfigWithMeta } from '../config';
8
9
  */
9
10
  export declare const _internals: {
10
11
  loadPluginConfigWithMeta: typeof loadPluginConfigWithMeta;
12
+ isEpicOpenForProject: typeof isEpicOpenForProject;
11
13
  };
14
+ /**
15
+ * Reply to `/swarm turbo epic [on|off]` and bare `/swarm turbo epic`. Epic
16
+ * Mode is no longer a Turbo strategy: it is started with `/swarm epic start`
17
+ * and never enables Lean or Turbo. The redirect changes no state.
18
+ */
19
+ export declare const TURBO_EPIC_REDIRECT_MESSAGE = "Epic is no longer combined with Turbo; use `/swarm epic start` (it enables neither Lean nor Turbo, and per-task QA is never waived). Turbo state is unchanged.";
20
+ /**
21
+ * Reply to any Turbo-enabling invocation while an Epic is open for the
22
+ * project: Turbo/Lean would waive per-task QA (Stage B) that Epic never
23
+ * waives, so enabling is refused until the Epic is closed. Disabling Turbo
24
+ * stays available.
25
+ */
26
+ export declare const TURBO_EPIC_OPEN_REFUSAL = "Turbo Mode NOT enabled \u2014 epic-open: close the epic first (/swarm epic close). Turbo state is unchanged.";
12
27
  /**
13
28
  * Handles the /swarm turbo command.
14
29
  * Supports standard turbo toggle, lean turbo mode, and status reporting.
15
30
  *
16
31
  * @param directory - Project directory (used to persist Lean Turbo run state)
17
- * @param args - Arguments: (none) | "on" | "off" | "status" | "lean" ["on"|"off"] | "standard" ["on"|"off"] | "epic" ["on"|"off"]. Unknown arguments are rejected without changing state.
32
+ * @param args - Arguments: (none) | "on" | "off" | "status" | "lean" ["on"|"off"] | "standard" ["on"|"off"]. "epic" ["on"|"off"] is refused with a redirect to `/swarm epic start`; every Turbo-enabling argument is refused while an Epic is open for the project. Unknown arguments are rejected without changing state.
18
33
  * @param sessionID - Session ID for accessing active session state
19
34
  * @returns Feedback message about Turbo Mode state
20
35
  */
@@ -28,6 +28,16 @@ export declare const GENERAL_COUNCIL_TOOL_NAMES: readonly ["convene_general_coun
28
28
  export declare const GENERAL_COUNCIL_AGENT_TOOL_MAP: Partial<Record<AgentName, ToolName[]>>;
29
29
  export declare const TURBO_TOOL_NAMES: readonly ["lean_turbo_plan_lanes", "lean_turbo_acquire_locks", "lean_turbo_runner_status", "lean_turbo_review", "lean_turbo_critic", "lean_turbo_run_phase", "lean_turbo_status"];
30
30
  export declare const TURBO_AGENT_TOOL_MAP: Partial<Record<AgentName, ToolName[]>>;
31
+ /**
32
+ * Every Epic Mode tool. They stay registered in the plugin (TOOL_METADATA +
33
+ * TOOL_MANIFEST + barrel) but carry `agents: []`, so no agent sees them
34
+ * unless `epic.mode.enabled === true`, in which case they are merged
35
+ * into the architect's tool set at every opt-in merge site
36
+ * (`getAgentConfigs`, the architect prompt tool lists, the full-auto
37
+ * capability derivation).
38
+ */
39
+ export declare const EPIC_TOOL_NAMES: readonly ["epic_next_wave", "epic_phase_review"];
40
+ export declare const EPIC_AGENT_TOOL_MAP: Partial<Record<AgentName, ToolName[]>>;
31
41
  export declare const SKILL_TOOL_NAMES: readonly ["skill_generate", "skill_list", "skill_apply", "skill_inspect", "skill_regenerate", "skill_retire", "skill_improve"];
32
42
  export declare const SKILL_AGENT_TOOL_MAP: Partial<Record<AgentName, ToolName[]>>;
33
43
  export declare const PR_REVIEW_CHILD_TOOL_NAMES: readonly ["submit_pr_review_result"];
@@ -162,4 +172,4 @@ export declare const DEFAULT_LEAN_TURBO_CONFIG: LeanTurboConfig;
162
172
  export declare const SWARM_WORKTREE_DIR_NAME = ".swarm-worktrees";
163
173
  export declare const DEFAULT_WORKTREE_ISOLATION_CONFIG: WorktreeIsolationConfig;
164
174
  export declare const LEAN_TURBO_BANNER = "## \uD83D\uDEE4\uFE0F LEAN TURBO ACTIVE\n\nLane-based parallel execution is enabled for this phase.\n\nBehavioral changes:\n- Tasks are partitioned into parallel lanes based on file-scope conflicts. Tasks in the same lane run sequentially; tasks in different lanes run concurrently (up to max_parallel_coders).\n- **Lane dispatch overrides the one-agent-per-message rule**: for lean lane dispatch only, you may send multiple Task tool calls concurrently (one per lane).\n- **Lane tasks skip per-task Stage B** (reviewer + test_engineer). Quality is enforced at phase-end via phase reviewer and critic gates instead.\n- **Degraded tasks** (global files, protected paths, high-risk patterns) and **serialized tasks** (lock-conflicted) run through standard serial workflow with full Stage B gates.\n- **Phase reviewer and critic are REQUIRED** before phase_complete when lean turbo is active \u2014 they serve as the holistic quality gate for all lane work.\n- **Full-Auto composition**: if Full-Auto is also active, lane dispatch is subject to Full-Auto delegation policy and phase approval.\n- Use the lean_turbo_run_phase tool to execute a phase with parallel lanes\n\nDo NOT skip phase reviewer/critic when configured. Degraded and serialized tasks MUST still go through full Stage B.\n";
165
- export declare const EPIC_MODE_BANNER = "## \uD83E\uDDED EPIC MODE ACTIVE\n\n**\u26D4 THE USER ALWAYS COMES FIRST \u2014 this overrides everything below.** The user can message you at ANY time, including mid-phase while coders are running or retrying. The instant a user message arrives \u2014 a question, a slash command, a comment, anything \u2014 STOP advancing the flow. Do not dispatch, do not retry, do not call another tool. Read what they said and respond to them directly, in plain conversation, first. Never keep executing the protocol and leave a user message unanswered \u2014 ignoring the user is the single worst failure mode in this mode. After you've answered, pick up where you left off. If you're mid-wave when they interrupt, tell them the state (\"3.1 and 3.2 are still running; I'll continue once I've answered you\") rather than going silent.\n\n**Activation \u2260 start.** Until the user asks for execution (\"start phase N\", \"run task X\", \"continue\"): do nothing. On `/swarm turbo epic`, `/swarm epic *` and any slash status/config command: call the named tool ONCE, surface its output VERBATIM, then stop. Don't infer intent \u2014 if unsure, ASK. This restraint applies ONLY before activation.\n\n**Talk to the user as you work** \u2014 like you naturally would. Once they ask you to run a phase, keep them in the loop with a sentence before each step about what you're doing and why (\"Declaring scopes for 3.1\u20133.3 so the planner can find parallelism\u2026\", \"Discrimination and calibration are independent, so I'll run 3.1 and 3.2 in parallel\u2026\"). This is normal conversation, not a form to fill in \u2014 the steps below tell you the key facts to share, but say them in your own voice. Don't go silent and tool-only through a phase.\n\nUse `epic_plan_waves` (NOT `lean_turbo_plan_lanes` or the deprecated `epic_run_phase`) for the wave plan. Do NOT call `lean_turbo_run_phase` directly.\n\n### Six-step flow (only when the user asks to run a phase)\n\n> Supersedes Rule 1a/3a: declare ALL pending scopes UP FRONT (step 1), BEFORE step 2. Just-in-time declaration breaks the wave planner.\n\n**1. `declare_scope` for every pending task** \u2014 one call per single `taskId` string (NOT ranges/arrays/globs). Tight, disjoint scopes; avoid shared files (`__init__.py`, barrels, registries) \u2014 they force serial waves. Declared scope is a CONTRACT; if a task needs more files mid-run, re-declare BEFORE dispatching.\n\n**2. `epic_decide_phase(directory, phase=N, sessionID)`** \u2014 returns:\n- `decided`+`promote` \u2192 step 3\n- `demoted` \u2192 step 6 (per-task serial)\n- `scopes-missing` \u2192 `declare_scope` each `missingScopes[]`, retry step 2\n- `no-phase` | `phase-empty` | `phase-already-complete` | `epic-state-unreadable` \u2192 fix per response `message`, retry. `phase-already-complete` means call step 2 with `phase=N+1` (NOT step 4 directly).\n- other \u2192 fix per `message`, retry\n\n**3. Surface the verdict to the user immediately, before any further action:**\n> Epic Mode: <PROMOTE|DEMOTE> (p=<value>) \u2014 <one-sentence rationale or top blocking reason>\n> Dependencies: <task_id> \u2190 <deps>; \u2026 (omit if none)\n\nThe verdict is the user's only visibility into what Epic is doing \u2014 silence here makes the mode invisible. If you're going to spend time on this phase, tell the user why up front. Phrase it naturally; the format above is a guide, not a script.\n\n**4. `epic_plan_waves(directory, phase=N)`** \u2014 returns `{ waves: [{ waveId, taskIds, files }], serializedTasks, degradedTasks, degradationSummary }`. Failure reasons mirror step 2; additionally: `git-failed` (retry), `planner-error` (check `errors[0]`).\n\n**4b. Surface the wave plan to the user, before dispatching any `Task`:**\n> Wave plan (<N> waves): Wave 1 \u2192 [<ids>] (parallel); Wave 2 \u2192 [<ids>]; \u2026 \u2014 serialized [<ids>], degraded [<ids>]\n\nWalk them through which tasks run in which wave and what's parallel \u2014 naturally, in your own words. If `waves.length` exceeds the distinct-dependency-layer count, also flag the over-split and its likely cause (typical: a shared file like a barrel/registry in multiple scopes forces serial waves), e.g. \"Wave N split into K single-task waves because every scope claims `<shared-file>` \u2014 re-declare those tasks without it to restore parallelism, then re-plan.\"\n\n`serializedTasks` causes (NOT `declare_scope`-fixable): cycle, `no-scope`, `invalid-scope`, cap-exhaustion. Fix dep graph or scope contents, re-plan.\n\n`degradedTasks[].reason` keys:\n- `global file conflict` / `protected path` \u2192 balanced mode, dispatch per-task after waves\n- `cross-batch upstream not committed (greenfield-smart Rule 3): <ids>` \u2192 commit named upstreams, re-plan\n- `unresolved in-batch dependency: <ids>` \u2192 fix upstream degrade/serialize, re-plan\n- `planning leftover (no identifiable blocker)` \u2192 surface as planner bug\n\n**5. Dispatch each wave: `wave.taskIds.length` SEPARATE `Task` calls in ONE assistant message.** Per wave in order:\n- One `Task(subagent_type=\"coder\", description=\"Phase N task <id>\", prompt=\"<scope + acceptance>\")` per `taskId`\n- ALL in same turn \u2192 concurrent\n- Wait for all in wave to reach `update_task_status(completed)` + `epic_record_divergence` before next wave\n\n\u26A0\uFE0F **Three defects:**\n1. **Bundling**: multiple ids in one Task call \u2192 kills 1:1 coder visibility\n2. **Splitting across messages**: serial execution, no parallelism\n3. **Skipping single-task waves**: still emit ONE Task, wait for completion+divergence\n\nThis is the only sanctioned dispatch path. Don't use `lean_turbo_run_phase`; don't bundle through other tools \u2014 visibility requires `Task`.\n\n`serializedTasks` + `degradedTasks` (after wave loop): ONE Task per assistant message each, never batched, wait for completion+divergence between.\n\n**6. After each `update_task_status(completed)`, call `epic_record_divergence(directory, taskId, sessionID)`** (feeds calibration). If `summary.isClean: false`:\n> Divergence: task `<id>` wrote <undeclaredCount> undeclared file(s) (ratio <ratio>)\n\n### Phase-complete + audit\n\nPhase reviewer + critic still required at `phase_complete` (Epic Mode doesn't change Stage B).\n\nAudit (no architect needed): `/swarm epic status | last | decide | calibration`.\n";
175
+ export declare const EPIC_MODE_BANNER = "## \uD83E\uDDED EPIC MODE ACTIVE \u2014 an epic is open for this plan\n\n**\u26D4 THE USER ALWAYS COMES FIRST \u2014 this overrides everything below.** The user can message you at ANY time, including mid-wave while coders are running or retrying. The instant a user message arrives \u2014 a question, a slash command, a comment, anything \u2014 STOP advancing the flow: no dispatch, no retry, no further tool call. Answer them directly, in plain conversation, first \u2014 ignoring the user is the worst failure mode here. Then resume; if mid-wave, tell them the state (\"3.1 and 3.2 are still running; I'll continue once I've answered you\") rather than going silent.\n\n**An open epic \u2260 start.** The user opened it with `/swarm epic start`; until they ask for execution (\"start phase N\", \"run task X\", \"continue\"): do nothing. On `/swarm epic *` and any slash status/config command: call the named tool ONCE, surface its output VERBATIM, then stop. Don't infer intent \u2014 if unsure, ASK. Only the user opens or closes an epic. Epic enables neither Turbo nor Lean.\n\n**Talk to the user as you work.** Once they ask you to run the plan, say a sentence before each step about what you're doing and why \u2014 never go silent and tool-only.\n\n### How to run it: call `epic_next_wave` and do exactly what its `status` says\n\nIt plans every wave, closes finished waves, and keeps phases in order. Never plan waves yourself; never call `lean_turbo_run_phase` / `lean_turbo_plan_lanes`.\n- `dispatch` \u2192 follow its `instructions`: one `Task` per `taskId`, ALL in ONE message; per task Stage A (`pre_check_batch`) \u2192 Stage B (`reviewer` + `test_engineer`) \u2192 `update_task_status(completed)`; then call `epic_next_wave` again.\n- `declare-scopes` \u2192 `declare_scope` once per listed `taskId` (start from `suggestedFiles`), then call again.\n- `in-progress` \u2192 finish the listed tasks, then call again.\n- `blocked` \u2192 relay `message` to the user and apply its remedy.\n- `phase-ready-for-review` \u2192 `epic_phase_review(phase)` ONCE (phase reviewer, then critic). Both APPROVED \u2192 your normal PHASE-WRAP (phase-wrap skill: docs agent, `write_retro`, \u2026) \u2192 `phase_complete` \u2192 `epic_next_wave`; otherwise add each fix as a NEW pending task of that phase (`save_plan`) and call `epic_next_wave` (it runs them as a fix wave), then re-run it. Never re-dispatch a coder outside a wave.\n- `epic-complete` \u2192 tell the user to close the epic with `/swarm epic close`.\n- `refused` \u2192 relay `message`; run tasks per-task serially.\n\nPer-task QA (Stage A + Stage B) is NEVER waived in Epic. Audit (no architect needed): `/swarm epic status | learning`.\n";
@@ -3,6 +3,8 @@ import { type GateConfigOverrides, type PluginConfig } from './schema';
3
3
  export declare const MAX_CONFIG_FILE_BYTES = 102400;
4
4
  export declare const _internals: {
5
5
  resetUnknownTopLevelKeyWarning(): void;
6
+ resetRetiredEpicKeyWarning(): void;
7
+ resetLegacyEpicConfigWarning(): void;
6
8
  resetGatesAdvisoryDedup(): void;
7
9
  };
8
10
  export { deepMerge, MAX_MERGE_DEPTH } from '../utils/merge';