opencode-swarm 7.187.3 → 7.188.1

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 (92) hide show
  1. package/binaries/win32-arm64/swarm-sandbox-runner.exe +0 -0
  2. package/binaries/win32-x64/swarm-sandbox-runner.exe +0 -0
  3. package/dist/background/delegation-lifecycle.d.ts +4 -0
  4. package/dist/cli/{auto-checkpoint-521fehr3.js → auto-checkpoint-w2mjh5m3.js} +7 -7
  5. package/dist/cli/{checkpoint-czx5eken.js → checkpoint-eac282hg.js} +12 -12
  6. package/dist/cli/{coder-settlement-skfkfgt7.js → coder-settlement-40qspmep.js} +8 -8
  7. package/dist/cli/{config-doctor-t88fd5ra.js → config-doctor-p21xsvfn.js} +11 -11
  8. package/dist/cli/{core-fap9x47g.js → core-z7qs8s32.js} +1 -1
  9. package/dist/cli/{curation-policy-e1ce7ha8.js → curation-policy-v64ctcbd.js} +5 -5
  10. package/dist/cli/{curator-b7zzsv98.js → curator-csg36d2a.js} +35 -35
  11. package/dist/cli/{curator-drift-ea11apaw.js → curator-drift-z6c2ctqr.js} +5 -5
  12. package/dist/cli/{curator-llm-factory-758hynyn.js → curator-llm-factory-dtyyh77f.js} +35 -35
  13. package/dist/cli/{doctor-knowledge-receipt-phase-id-5768wb0n.js → doctor-knowledge-receipt-phase-id-gps8dpqr.js} +6 -6
  14. package/dist/cli/{evidence-summary-service-z2yj87tn.js → evidence-summary-service-txbkchx6.js} +15 -15
  15. package/dist/cli/{gate-evidence-m90ynftc.js → gate-evidence-bwyxrk3z.js} +5 -5
  16. package/dist/cli/{guardrail-explain-y2g82gqv.js → guardrail-explain-gxzdr8w4.js} +36 -36
  17. package/dist/cli/{guardrail-log-c50qd8sf.js → guardrail-log-ra5qbb4b.js} +6 -6
  18. package/dist/cli/{guardrail-reset-h7g9a90e.js → guardrail-reset-b0s11ban.js} +35 -35
  19. package/dist/cli/{hive-promoter-wpcn3wyz.js → hive-promoter-avvddtgc.js} +35 -35
  20. package/dist/cli/{index-bkcd3nwh.js → index-0v2svrev.js} +1 -1
  21. package/dist/cli/{index-by488z8m.js → index-41v699sv.js} +3 -3
  22. package/dist/cli/{index-sec8fwf1.js → index-4htcpbs4.js} +67 -48
  23. package/dist/cli/{index-h03j41jw.js → index-4m6k2r0v.js} +4 -4
  24. package/dist/cli/{index-naxtsh2e.js → index-4rjw95qw.js} +4 -4
  25. package/dist/cli/{index-4tmk29gc.js → index-5m06enb0.js} +1 -1
  26. package/dist/cli/{index-by7x4ty3.js → index-61pxv4sk.js} +35 -35
  27. package/dist/cli/{index-xpj149rz.js → index-7sbyvk99.js} +1 -1
  28. package/dist/cli/{index-japwz660.js → index-8pbtv6ea.js} +1 -1
  29. package/dist/cli/{index-w3xapqjq.js → index-9007eaeh.js} +3 -3
  30. package/dist/cli/{index-5ktekhxk.js → index-936d3ny7.js} +1 -1
  31. package/dist/cli/{index-02nzb100.js → index-9bjf0bhd.js} +2 -2
  32. package/dist/cli/{index-mh3nsv7v.js → index-a1tpp2fs.js} +2 -2
  33. package/dist/cli/{index-5x8zhfsq.js → index-aqe9x8ga.js} +3 -3
  34. package/dist/cli/{index-hrxr48p5.js → index-b9pz70d0.js} +2 -2
  35. package/dist/cli/{index-468s960k.js → index-c66ywect.js} +1 -1
  36. package/dist/cli/{index-a5pjm9zc.js → index-cb72p9w2.js} +2 -2
  37. package/dist/cli/{index-m3dcecc5.js → index-cdakr0yh.js} +37 -37
  38. package/dist/cli/{index-npkxp81s.js → index-cs6g43qy.js} +14 -9
  39. package/dist/cli/{index-7fekgghd.js → index-dxhd7dsr.js} +7 -7
  40. package/dist/cli/{index-ksvm96bz.js → index-edaj9qxn.js} +1 -1
  41. package/dist/cli/{index-zbv9t6p2.js → index-fdx38afm.js} +6 -6
  42. package/dist/cli/{index-45d3vpry.js → index-gy57hcy2.js} +1 -1
  43. package/dist/cli/{index-fk7s8btv.js → index-jd3hvnqn.js} +2 -2
  44. package/dist/cli/{index-ez4kkgcd.js → index-jn08bcaa.js} +3 -3
  45. package/dist/cli/{index-7ba0hdg4.js → index-mb1reyw3.js} +1 -1
  46. package/dist/cli/{index-h7p78r0w.js → index-mdbqm6w1.js} +4 -4
  47. package/dist/cli/{index-mdxrk3az.js → index-pswvtgdx.js} +3 -3
  48. package/dist/cli/{index-6551m2st.js → index-qgvmq92m.js} +2 -2
  49. package/dist/cli/{index-nsvm2j4x.js → index-rwabrcsg.js} +1 -1
  50. package/dist/cli/{index-w9p41945.js → index-swagbt0g.js} +1 -1
  51. package/dist/cli/{index-10h0jx4e.js → index-w4q0sw5g.js} +4 -4
  52. package/dist/cli/{index-6rdajskg.js → index-wkxhhyej.js} +138 -102
  53. package/dist/cli/{index-e3vbyy10.js → index-x73e0zkb.js} +1 -1
  54. package/dist/cli/{index-7t15ybzn.js → index-xrsfbr31.js} +3 -3
  55. package/dist/cli/{index-yk9vs9pw.js → index-z4zznftq.js} +2 -2
  56. package/dist/cli/{index-wvkbp1qr.js → index-zhnywrhs.js} +6 -6
  57. package/dist/cli/{index-zzgv4jy6.js → index-ztq5ag7q.js} +4 -4
  58. package/dist/cli/{index-v8ytrkrg.js → index-zvrfvtp3.js} +77 -11
  59. package/dist/cli/{index-q0am9gm3.js → index-zwgh0gty.js} +1 -1
  60. package/dist/cli/index.js +36 -36
  61. package/dist/cli/{knowledge-escalator-wzsxp6yg.js → knowledge-escalator-02z57h57.js} +12 -12
  62. package/dist/cli/{knowledge-events-dcchq50n.js → knowledge-events-yqfwghad.js} +10 -10
  63. package/dist/cli/{knowledge-link-zh9rzesj.js → knowledge-link-9gx2djyd.js} +4 -4
  64. package/dist/cli/{knowledge-store-p27r8wa9.js → knowledge-store-85rcyme4.js} +5 -5
  65. package/dist/cli/{knowledge-validator-rmtymth5.js → knowledge-validator-0fax9dq4.js} +7 -7
  66. package/dist/cli/{mcp-jr1rr2zd.js → mcp-rt2qxyc1.js} +1 -1
  67. package/dist/cli/{model-preflight-xzy5x4rt.js → model-preflight-yf57x1x7.js} +35 -35
  68. package/dist/cli/{pending-delegations-4k740a2c.js → pending-delegations-3emmnz2y.js} +7 -7
  69. package/dist/cli/{pr-subscriptions-515xdgjj.js → pr-subscriptions-mpwtbpdd.js} +7 -7
  70. package/dist/cli/{pr-workflow-gate-srpa0mds.js → pr-workflow-gate-0qzc2dbr.js} +35 -35
  71. package/dist/cli/{runner-tk1cmgzt.js → runner-x8sbydkw.js} +5 -5
  72. package/dist/cli/{scan-cursor-w89sck5y.js → scan-cursor-w0m9zjrr.js} +6 -6
  73. package/dist/cli/{schema-1mwgvrv7.js → schema-0w9q2h6j.js} +1 -1
  74. package/dist/cli/{scope-persistence-qen27qx7.js → scope-persistence-3mc615t3.js} +11 -11
  75. package/dist/cli/{server-rhz44ye9.js → server-h36cgr2m.js} +35 -35
  76. package/dist/cli/{skill-generator-05mxym3d.js → skill-generator-qaskynvt.js} +14 -14
  77. package/dist/cli/{snapshot-coordination-init-jjegs3v5.js → snapshot-coordination-init-j226zrvz.js} +35 -35
  78. package/dist/cli/{speckit-checkoff-3m04ks95.js → speckit-checkoff-6xa1f1qr.js} +3 -3
  79. package/dist/cli/{telemetry-vwxbsnye.js → telemetry-d0j31j5d.js} +1 -1
  80. package/dist/cli/{worktree-collision-ownership-0d73y8h0.js → worktree-collision-ownership-frtjkhms.js} +7 -7
  81. package/dist/cli/{worktree-isolation-d0vn38wb.js → worktree-isolation-c07qk28m.js} +35 -35
  82. package/dist/commands/close/align-stage.d.ts +26 -0
  83. package/dist/commands/close/context.d.ts +8 -0
  84. package/dist/commands/close/internals.d.ts +1 -1
  85. package/dist/commands/destructive-purge.d.ts +55 -27
  86. package/dist/commands/registry.d.ts +1 -1
  87. package/dist/hooks/knowledge-validator.d.ts +18 -1
  88. package/dist/index.js +20 -19
  89. package/dist/observability/catalog.d.ts +3 -3
  90. package/dist/telemetry.d.ts +15 -1
  91. package/dist/tools/repo-map.d.ts +4 -0
  92. package/package.json +1 -1
@@ -8,74 +8,74 @@ import {
8
8
  markSnapshotCoordinationClosing,
9
9
  retrySnapshotCoordinationInitialization,
10
10
  startSnapshotCoordinationInitialization
11
- } from "./index-6rdajskg.js";
12
- import"./index-ez4kkgcd.js";
13
- import"./index-6551m2st.js";
14
- import"./index-7t15ybzn.js";
11
+ } from "./index-wkxhhyej.js";
12
+ import"./index-jn08bcaa.js";
13
+ import"./index-qgvmq92m.js";
14
+ import"./index-xrsfbr31.js";
15
15
  import"./index-vx8a8w3b.js";
16
- import"./index-e3vbyy10.js";
17
- import"./index-fk7s8btv.js";
16
+ import"./index-x73e0zkb.js";
17
+ import"./index-jd3hvnqn.js";
18
18
  import"./index-txdagbh7.js";
19
- import"./index-yk9vs9pw.js";
19
+ import"./index-z4zznftq.js";
20
20
  import"./index-rdec0y3z.js";
21
- import"./index-45d3vpry.js";
22
- import"./index-zzgv4jy6.js";
23
- import"./index-5x8zhfsq.js";
24
- import"./index-wvkbp1qr.js";
21
+ import"./index-gy57hcy2.js";
22
+ import"./index-ztq5ag7q.js";
23
+ import"./index-aqe9x8ga.js";
24
+ import"./index-zhnywrhs.js";
25
25
  import"./index-mf19yqss.js";
26
- import"./index-by488z8m.js";
26
+ import"./index-41v699sv.js";
27
27
  import"./index-cjapb4hy.js";
28
28
  import"./index-a8gvszr2.js";
29
29
  import"./index-pt7h91zc.js";
30
30
  import"./index-q7sjgr1y.js";
31
- import"./index-v8ytrkrg.js";
32
- import"./index-7fekgghd.js";
31
+ import"./index-zvrfvtp3.js";
32
+ import"./index-dxhd7dsr.js";
33
33
  import"./index-6b295cas.js";
34
34
  import"./index-9nyqt3kb.js";
35
- import"./index-w9p41945.js";
35
+ import"./index-swagbt0g.js";
36
36
  import"./index-zsrtt42s.js";
37
- import"./index-468s960k.js";
38
- import"./index-w3xapqjq.js";
39
- import"./index-ksvm96bz.js";
37
+ import"./index-c66ywect.js";
38
+ import"./index-9007eaeh.js";
39
+ import"./index-edaj9qxn.js";
40
40
  import"./index-g4fs6z4e.js";
41
- import"./index-10h0jx4e.js";
42
- import"./index-h7p78r0w.js";
43
- import"./index-h03j41jw.js";
41
+ import"./index-w4q0sw5g.js";
42
+ import"./index-mdbqm6w1.js";
43
+ import"./index-4m6k2r0v.js";
44
44
  import"./index-m9zzj4ee.js";
45
45
  import"./index-bejxkee0.js";
46
46
  import"./index-2s7dvzff.js";
47
- import"./index-npkxp81s.js";
48
- import"./index-nsvm2j4x.js";
47
+ import"./index-cs6g43qy.js";
48
+ import"./index-rwabrcsg.js";
49
49
  import"./index-rtry5xyf.js";
50
- import"./index-a5pjm9zc.js";
50
+ import"./index-cb72p9w2.js";
51
51
  import"./index-kbkk7vnh.js";
52
52
  import"./index-0725jpp7.js";
53
- import"./index-02nzb100.js";
54
- import"./index-naxtsh2e.js";
55
- import"./index-hrxr48p5.js";
53
+ import"./index-9bjf0bhd.js";
54
+ import"./index-4rjw95qw.js";
55
+ import"./index-b9pz70d0.js";
56
56
  import"./index-m1qy7f1e.js";
57
57
  import"./index-cc1vzq4m.js";
58
58
  import"./index-9hag235h.js";
59
59
  import"./index-ry16d01s.js";
60
60
  import"./index-rdm3px0g.js";
61
61
  import"./index-7pmbnjvj.js";
62
- import"./index-7ba0hdg4.js";
63
- import"./index-zbv9t6p2.js";
62
+ import"./index-mb1reyw3.js";
63
+ import"./index-fdx38afm.js";
64
64
  import"./index-vzm6zre7.js";
65
65
  import"./index-ae75rja9.js";
66
- import"./index-q0am9gm3.js";
67
- import"./index-xpj149rz.js";
68
- import"./index-bkcd3nwh.js";
66
+ import"./index-zwgh0gty.js";
67
+ import"./index-7sbyvk99.js";
68
+ import"./index-0v2svrev.js";
69
69
  import"./index-t7hmqgjy.js";
70
- import"./index-sec8fwf1.js";
70
+ import"./index-4htcpbs4.js";
71
71
  import"./index-fzpt2djt.js";
72
72
  import"./index-ejhxgyvm.js";
73
73
  import"./index-7g4c7s5r.js";
74
74
  import"./index-r6e8syr3.js";
75
75
  import"./index-gx2vp8gx.js";
76
- import"./index-5ktekhxk.js";
76
+ import"./index-936d3ny7.js";
77
77
  import"./index-zxdawwc7.js";
78
- import"./index-4tmk29gc.js";
78
+ import"./index-5m06enb0.js";
79
79
  import"./index-bstjg81q.js";
80
80
  import"./index-bk5tah7q.js";
81
81
  import"./index-gknz3bv1.js";
@@ -7,13 +7,13 @@ import {
7
7
  parseSpeckitTasksContent,
8
8
  propagateSpeckitCheckoff,
9
9
  writeSpeckitCheckoffLedger
10
- } from "./index-468s960k.js";
10
+ } from "./index-c66ywect.js";
11
11
  import"./index-ejhxgyvm.js";
12
12
  import"./index-7g4c7s5r.js";
13
13
  import"./index-r6e8syr3.js";
14
- import"./index-5ktekhxk.js";
14
+ import"./index-936d3ny7.js";
15
15
  import"./index-zxdawwc7.js";
16
- import"./index-4tmk29gc.js";
16
+ import"./index-5m06enb0.js";
17
17
  import"./index-bstjg81q.js";
18
18
  import"./index-bk5tah7q.js";
19
19
  import"./index-gknz3bv1.js";
@@ -14,7 +14,7 @@ import {
14
14
  startHeartbeatTracking,
15
15
  stopHeartbeatTracking,
16
16
  telemetry
17
- } from "./index-sec8fwf1.js";
17
+ } from "./index-4htcpbs4.js";
18
18
  import"./index-fzpt2djt.js";
19
19
  import"./index-gknz3bv1.js";
20
20
  import"./index-zpsr8rpc.js";
@@ -13,7 +13,7 @@ import {
13
13
  import {
14
14
  scanDelegationFallbacksForRecovery,
15
15
  scanDelegationsForRecovery
16
- } from "./index-10h0jx4e.js";
16
+ } from "./index-w4q0sw5g.js";
17
17
  import"./index-bejxkee0.js";
18
18
  import"./index-2s7dvzff.js";
19
19
  import"./index-m1qy7f1e.js";
@@ -22,15 +22,15 @@ import"./index-9hag235h.js";
22
22
  import"./index-ry16d01s.js";
23
23
  import"./index-rdm3px0g.js";
24
24
  import"./index-7pmbnjvj.js";
25
- import"./index-7ba0hdg4.js";
26
- import"./index-zbv9t6p2.js";
25
+ import"./index-mb1reyw3.js";
26
+ import"./index-fdx38afm.js";
27
27
  import"./index-vzm6zre7.js";
28
28
  import"./index-ae75rja9.js";
29
- import"./index-q0am9gm3.js";
30
- import"./index-xpj149rz.js";
31
- import"./index-bkcd3nwh.js";
29
+ import"./index-zwgh0gty.js";
30
+ import"./index-7sbyvk99.js";
31
+ import"./index-0v2svrev.js";
32
32
  import"./index-t7hmqgjy.js";
33
- import"./index-sec8fwf1.js";
33
+ import"./index-4htcpbs4.js";
34
34
  import {
35
35
  canonicalRootKeyFresh
36
36
  } from "./index-fzpt2djt.js";
@@ -21,76 +21,76 @@ import {
21
21
  sanitizeWorktreeTaskId,
22
22
  standardWorktreeByCallID,
23
23
  standardWorktreeSerializationSessions
24
- } from "./index-6rdajskg.js";
25
- import"./index-ez4kkgcd.js";
26
- import"./index-6551m2st.js";
27
- import"./index-7t15ybzn.js";
24
+ } from "./index-wkxhhyej.js";
25
+ import"./index-jn08bcaa.js";
26
+ import"./index-qgvmq92m.js";
27
+ import"./index-xrsfbr31.js";
28
28
  import"./index-vx8a8w3b.js";
29
- import"./index-e3vbyy10.js";
30
- import"./index-fk7s8btv.js";
29
+ import"./index-x73e0zkb.js";
30
+ import"./index-jd3hvnqn.js";
31
31
  import"./index-txdagbh7.js";
32
- import"./index-yk9vs9pw.js";
32
+ import"./index-z4zznftq.js";
33
33
  import"./index-rdec0y3z.js";
34
- import"./index-45d3vpry.js";
35
- import"./index-zzgv4jy6.js";
36
- import"./index-5x8zhfsq.js";
37
- import"./index-wvkbp1qr.js";
34
+ import"./index-gy57hcy2.js";
35
+ import"./index-ztq5ag7q.js";
36
+ import"./index-aqe9x8ga.js";
37
+ import"./index-zhnywrhs.js";
38
38
  import"./index-mf19yqss.js";
39
- import"./index-by488z8m.js";
39
+ import"./index-41v699sv.js";
40
40
  import"./index-cjapb4hy.js";
41
41
  import"./index-a8gvszr2.js";
42
42
  import"./index-pt7h91zc.js";
43
43
  import"./index-q7sjgr1y.js";
44
- import"./index-v8ytrkrg.js";
45
- import"./index-7fekgghd.js";
44
+ import"./index-zvrfvtp3.js";
45
+ import"./index-dxhd7dsr.js";
46
46
  import"./index-6b295cas.js";
47
47
  import"./index-9nyqt3kb.js";
48
- import"./index-w9p41945.js";
48
+ import"./index-swagbt0g.js";
49
49
  import"./index-zsrtt42s.js";
50
- import"./index-468s960k.js";
51
- import"./index-w3xapqjq.js";
52
- import"./index-ksvm96bz.js";
50
+ import"./index-c66ywect.js";
51
+ import"./index-9007eaeh.js";
52
+ import"./index-edaj9qxn.js";
53
53
  import"./index-g4fs6z4e.js";
54
- import"./index-10h0jx4e.js";
55
- import"./index-h7p78r0w.js";
56
- import"./index-h03j41jw.js";
54
+ import"./index-w4q0sw5g.js";
55
+ import"./index-mdbqm6w1.js";
56
+ import"./index-4m6k2r0v.js";
57
57
  import"./index-m9zzj4ee.js";
58
58
  import"./index-bejxkee0.js";
59
59
  import"./index-2s7dvzff.js";
60
- import"./index-npkxp81s.js";
61
- import"./index-nsvm2j4x.js";
60
+ import"./index-cs6g43qy.js";
61
+ import"./index-rwabrcsg.js";
62
62
  import"./index-rtry5xyf.js";
63
63
  import {
64
64
  resolveWorktreeIsolationConfig
65
- } from "./index-a5pjm9zc.js";
65
+ } from "./index-cb72p9w2.js";
66
66
  import"./index-kbkk7vnh.js";
67
67
  import"./index-0725jpp7.js";
68
- import"./index-02nzb100.js";
69
- import"./index-naxtsh2e.js";
70
- import"./index-hrxr48p5.js";
68
+ import"./index-9bjf0bhd.js";
69
+ import"./index-4rjw95qw.js";
70
+ import"./index-b9pz70d0.js";
71
71
  import"./index-m1qy7f1e.js";
72
72
  import"./index-cc1vzq4m.js";
73
73
  import"./index-9hag235h.js";
74
74
  import"./index-ry16d01s.js";
75
75
  import"./index-rdm3px0g.js";
76
76
  import"./index-7pmbnjvj.js";
77
- import"./index-7ba0hdg4.js";
78
- import"./index-zbv9t6p2.js";
77
+ import"./index-mb1reyw3.js";
78
+ import"./index-fdx38afm.js";
79
79
  import"./index-vzm6zre7.js";
80
80
  import"./index-ae75rja9.js";
81
- import"./index-q0am9gm3.js";
82
- import"./index-xpj149rz.js";
83
- import"./index-bkcd3nwh.js";
81
+ import"./index-zwgh0gty.js";
82
+ import"./index-7sbyvk99.js";
83
+ import"./index-0v2svrev.js";
84
84
  import"./index-t7hmqgjy.js";
85
- import"./index-sec8fwf1.js";
85
+ import"./index-4htcpbs4.js";
86
86
  import"./index-fzpt2djt.js";
87
87
  import"./index-ejhxgyvm.js";
88
88
  import"./index-7g4c7s5r.js";
89
89
  import"./index-r6e8syr3.js";
90
90
  import"./index-gx2vp8gx.js";
91
- import"./index-5ktekhxk.js";
91
+ import"./index-936d3ny7.js";
92
92
  import"./index-zxdawwc7.js";
93
- import"./index-4tmk29gc.js";
93
+ import"./index-5m06enb0.js";
94
94
  import"./index-bstjg81q.js";
95
95
  import"./index-bk5tah7q.js";
96
96
  import"./index-gknz3bv1.js";
@@ -1,4 +1,30 @@
1
1
  import type { CloseStageContext, GitAlignResult } from './context.js';
2
+ /** Options for the guarded `resetToMainAfterMerge` seam (issue #2953). */
3
+ export type GuardedResetToMainOptions = {
4
+ pruneBranches?: boolean;
5
+ /**
6
+ * The tracked-dirty set the close gate measured (and the operator
7
+ * confirmed, or the empty clean-tree set). REQUIRED — the guard
8
+ * re-verifies exactly this scope before the destructive reset.
9
+ */
10
+ expectedDirtyPaths: readonly string[];
11
+ };
12
+ export type GuardedResetToMainResult = import('../../git/branch.js').ResetToMainAfterMergeResult & {
13
+ /** True when the #2953 re-check refused and NO reset ran. */
14
+ recheckRefused?: true;
15
+ };
16
+ /**
17
+ * Issue #2953 guard: re-verify the tracked-dirty tree with the SAME argv and
18
+ * parser the close gate used, immediately before delegating to the real
19
+ * aggressive reset. Installed as the `_internals.resetToMainAfterMerge` seam
20
+ * value at facade wiring time (see wiring.ts) so the re-measurement happens
21
+ * at the tightest point reachable without editing src/git/branch.ts; a
22
+ * residual fetch/checkout window INSIDE the real reset remains and is
23
+ * disclosed in the release notes. On refusal the real reset is never called
24
+ * and the result carries the full bounded refusal text in `message` — the
25
+ * caller must treat `recheckRefused` as terminal (no cautious fallback).
26
+ */
27
+ export declare function guardResetWithRecheck(real: typeof import('../../git/branch.js').resetToMainAfterMerge, cwd: string, options?: GuardedResetToMainOptions): Promise<GuardedResetToMainResult>;
2
28
  /**
3
29
  * STAGE 4: ALIGN
4
30
  *
@@ -109,6 +109,14 @@ export interface CloseStageContext {
109
109
  archiveDir: string;
110
110
  archiveSuffix: string;
111
111
  args: string[];
112
+ /**
113
+ * Issue #2953: the tracked-dirty set the close gate measured at the top of
114
+ * this invocation — exactly the scope the operator's confirm token
115
+ * certified (or the empty set on the clean-tree fast path). The align
116
+ * stage's guard re-verifies it immediately before the destructive reset
117
+ * and aborts fail-closed if tracked files changed in the window.
118
+ */
119
+ purgeGateDirtyPaths?: string[];
112
120
  }
113
121
  export interface GitAlignResult {
114
122
  gitAlignResult: string;
@@ -27,7 +27,7 @@ export declare const _internals: {
27
27
  detectFullAuto: typeof import("./orchestrator.js").detectFullAuto;
28
28
  guaranteeAllPlansComplete: typeof import("./finalize-stage.js").guaranteeAllPlansComplete;
29
29
  getGitRepositoryStatus: typeof import("../../git/branch.js").getGitRepositoryStatus;
30
- resetToMainAfterMerge: typeof import("../../git/branch.js").resetToMainAfterMerge;
30
+ resetToMainAfterMerge: (cwd: string, options?: import("./align-stage.js").GuardedResetToMainOptions) => Promise<import("./align-stage.js").GuardedResetToMainResult>;
31
31
  resetToRemoteBranch: typeof import("../../git/branch.js").resetToRemoteBranch;
32
32
  copyDirRecursive: typeof import("./fs-helpers.js").copyDirRecursive;
33
33
  loadPluginConfigWithMeta: typeof import("../../config/index.js").loadPluginConfigWithMeta;
@@ -1,30 +1,3 @@
1
- /**
2
- * Issue #2527 / #2508: the shared two-step destructive-purge confirmation
3
- * primitive (preview + confirm_token → exact-token execution).
4
- *
5
- * Contract (frozen by check C8 and the destructive-purge-2527 unit suite):
6
- * - `previewDestructivePurge` is a side-effect-free preview (counts, exact
7
- * option label, the confirmation the operator must echo);
8
- * - `issueConfirmToken` records a single-slot pending purge keyed by a
9
- * digest over the candidate SET (sorted absolute paths + kind) and
10
- * returns the confirm token (15-minute TTL);
11
- * - `executeDestructivePurge` re-derives the CURRENT scope digest and
12
- * passes only on exact token match AND digest match AND fresh TTL — so
13
- * replay after the candidate set changes (a lane added, removed, or the
14
- * scope re-derived differently) is rejected by construction, and the
15
- * token is single-use (the pending record is consumed on execution; a
16
- * second execution is rejected with "no pending purge").
17
- * - TTL expiry: an expired pending record is treated as absent on read
18
- * (silent); every new issuance overwrites the single slot — the
19
- * overwritten token can never execute (it is rejected with "confirm
20
- * token mismatch"; a single-slot store cannot distinguish generations,
21
- * but rejection is guaranteed either way).
22
- * - Scope-of-execution: the executor deletes ONLY the recorded candidate
23
- * paths. The primitive confirms operator intent; CALLERS own scoping —
24
- * `/swarm reset-session` (and #2508's `/swarm close` when it adopts
25
- * this) must only construct candidate sets from ownership-gated,
26
- * base-scoped directories.
27
- */
28
1
  import { randomBytes } from 'node:crypto';
29
2
  import * as fs from 'node:fs';
30
3
  import { atomicWriteSwarmFileSync } from '../utils/atomic-write';
@@ -54,6 +27,61 @@ export declare const _internals: {
54
27
  now: () => number;
55
28
  randomBytes: typeof randomBytes;
56
29
  scopeDigest: typeof scopeDigest;
30
+ runGitStatus: typeof runGitStatusSync;
31
+ };
32
+ /**
33
+ * Shared argv for every tracked-dirty measurement (issue #2953): the close
34
+ * gate and the pre-destruction re-check run the identical status command and
35
+ * feed the same parser, so the two measurements parse identically. (The two
36
+ * reads still go through separate spawn wrappers; equivalence is by
37
+ * convention + review, not a single shared call site.)
38
+ */
39
+ export declare const GIT_STATUS_ARGS: readonly ["status", "--porcelain"];
40
+ /** Default bounded status read (invariant 3: array form, cwd, timeout, ignore
41
+ * stdin, bounded stdout, windowsHide). Exposed via `_internals` for tests. */
42
+ declare function runGitStatusSync(args: readonly string[], cwd: string): string | null;
43
+ /**
44
+ * Parse `git status --porcelain` (newline) output into repo-relative
45
+ * tracked-dirty paths: untracked (`??`) entries are skipped (they survive the
46
+ * align reset), surrounding quotes are stripped, and rename/copy records are
47
+ * split into BOTH sides. R/C may appear in EITHER status column (`R old ->
48
+ * new` staged, ` R old -> new` worktree renames via `git add -N`) — both
49
+ * columns are tested, never just the first (the codebase porcelain-parser
50
+ * rule from the #2976 rollback-gate review). Sibling module
51
+ * `src/commands/rollback-gate.ts` exports a same-named parser for
52
+ * NUL-terminated `--porcelain -z` output (J1/#2946); the two are deliberately
53
+ * not consolidated in this PR.
54
+ */
55
+ export declare function parseTrackedDirtyPaths(statusOutput: string): string[];
56
+ /**
57
+ * Shared tracked-dirty read (issue #2953): GIT_STATUS_ARGS + the shared
58
+ * parser around the default runner (test seam: `_internals.runGitStatus`).
59
+ * The close gate composes the same argv + parser directly through its own
60
+ * long-standing `_closeGateInternals.runGit` seam rather than calling this
61
+ * helper, so its existing #2508 fail-closed tests keep their injection point.
62
+ */
63
+ export declare function readTrackedDirtyPaths(directory: string): {
64
+ ok: true;
65
+ dirtyPaths: string[];
66
+ } | {
67
+ ok: false;
68
+ };
69
+ /**
70
+ * Issue #2953 TOCTOU re-check: re-measure the tracked-dirty set immediately
71
+ * before a destructive reset and compare it to the set the operator actually
72
+ * confirmed (or the empty clean-tree set). Fail-closed in both directions
73
+ * that matter: ANY newly-dirty tracked path refuses, and an unreadable
74
+ * status refuses (a measurement that cannot be taken must never read as
75
+ * "unchanged"). A file that got cleaner passes — strictly less destruction
76
+ * than confirmed.
77
+ */
78
+ export declare function recheckBeforeDestructive(directory: string, expectedDirtyPaths: readonly string[]): {
79
+ ok: true;
80
+ dirtyPaths: string[];
81
+ } | {
82
+ ok: false;
83
+ reason: string;
84
+ newDirtyPaths: string[];
57
85
  };
58
86
  declare function scopeDigest(kind: string, candidates: PurgeCandidate[]): string;
59
87
  /**
@@ -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. 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. 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";
@@ -121,6 +121,23 @@ export interface EntryHealthResult {
121
121
  concern?: string;
122
122
  }
123
123
  export declare function auditEntryHealth(entry: KnowledgeEntryBase): EntryHealthResult;
124
+ /**
125
+ * #2950: what `quarantineEntry` actually did inside the lock. Callers that
126
+ * need to report truthfully (the knowledge_archive tool) switch on this
127
+ * instead of assuming the mutation happened; value-discarding callers are
128
+ * unaffected.
129
+ */
130
+ export type QuarantineEntryOutcome = {
131
+ status: 'quarantined';
132
+ } | {
133
+ status: 'denied';
134
+ basis: string;
135
+ detail: string;
136
+ } | {
137
+ status: 'not_found';
138
+ } | {
139
+ status: 'invalid_input';
140
+ };
124
141
  export declare function quarantineEntry(directory: string, entryId: string, reason: string, reportedBy: 'architect' | 'user' | 'auto',
125
142
  /** #1848: cohort-safe curation context. When provided, the quarantine is
126
143
  * authorized through the shared curation policy BEFORE mutating; an
@@ -130,7 +147,7 @@ export declare function quarantineEntry(directory: string, entryId: string, reas
130
147
  curationContext?: {
131
148
  input: CurationAuthorizationInput;
132
149
  context: CurationContext;
133
- }): Promise<void>;
150
+ }): Promise<QuarantineEntryOutcome>;
134
151
  export declare function restoreEntry(directory: string, entryId: string,
135
152
  /** #1848 §2: cohort-safe curation context (optional). When provided, the
136
153
  * restore is authorized through the shared policy before mutating. */