opencode-swarm 7.168.1 → 7.169.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 (133) hide show
  1. package/.opencode/skills/swarm-pr-feedback/SKILL.md +11 -11
  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/cli/{coder-settlement-54a3d97g.js → coder-settlement-fd6ba876.js} +12 -12
  5. package/dist/cli/{config-doctor-vzp6b3ng.js → config-doctor-zeppqwwx.js} +2 -2
  6. package/dist/cli/{core-yynse50x.js → core-fj1afc31.js} +5 -2
  7. package/dist/cli/{curation-policy-mgwv8h2k.js → curation-policy-k74qz9ms.js} +5 -5
  8. package/dist/cli/{curator-drift-k0zrnm09.js → curator-drift-3ssjr0nx.js} +5 -5
  9. package/dist/cli/{curator-agdhhzqt.js → curator-emftndv0.js} +39 -38
  10. package/dist/cli/curator-llm-factory-4t773tmz.js +72 -0
  11. package/dist/cli/{dispatch-8ks9dyk5.js → dispatch-hwwj3qrb.js} +2 -2
  12. package/dist/cli/{evidence-summary-service-6mmcekr7.js → evidence-summary-service-51b69jc3.js} +16 -16
  13. package/dist/cli/{gate-evidence-xqvkqhrk.js → gate-evidence-53s161wb.js} +7 -7
  14. package/dist/cli/guardrail-explain-mhx8gt8q.js +73 -0
  15. package/dist/cli/{guardrail-log-5wa5c77w.js → guardrail-log-xg6hrdsq.js} +8 -8
  16. package/dist/cli/{guardrail-reset-dh78tbcf.js → guardrail-reset-fgv5kt5x.js} +39 -38
  17. package/dist/cli/{hive-promoter-3czsx7c6.js → hive-promoter-41zygtgx.js} +39 -38
  18. package/dist/cli/index-0hgmsyfp.js +92 -0
  19. package/dist/cli/{index-6df6wbvj.js → index-0vgs5r39.js} +8 -8
  20. package/dist/cli/{index-3jmb4ppa.js → index-1cbjemgh.js} +2 -2
  21. package/dist/cli/{index-p612v1mv.js → index-2s7dvzff.js} +200 -51
  22. package/dist/cli/{index-qthc56c4.js → index-2znfa537.js} +4 -4
  23. package/dist/cli/{index-91ww9hyr.js → index-3bfzpzsb.js} +1 -1
  24. package/dist/cli/{index-kkmezerc.js → index-3zcds757.js} +3101 -1918
  25. package/dist/cli/{index-d5qf7hvh.js → index-5400m33a.js} +1 -1
  26. package/dist/cli/{index-bw9x8d8n.js → index-55fkkjec.js} +5 -5
  27. package/dist/cli/{index-qwsh0h2g.js → index-5qt9yf5w.js} +4 -4
  28. package/dist/cli/{index-chebm5h5.js → index-5reh1bjz.js} +3 -3
  29. package/dist/cli/{index-2xbww1x0.js → index-76ng6vmq.js} +7 -7
  30. package/dist/cli/{index-qhey6vc3.js → index-7h01bkm6.js} +2 -2
  31. package/dist/cli/{index-gh9ybrrs.js → index-83m0y4cj.js} +6 -6
  32. package/dist/cli/{index-yt9n9zt3.js → index-8x9keek6.js} +41 -40
  33. package/dist/cli/{index-8ybjqg51.js → index-9ttqbhvw.js} +1 -1
  34. package/dist/cli/{index-kear8gb7.js → index-b3pmzbh1.js} +2 -2
  35. package/dist/cli/{index-h439y187.js → index-bernkwgf.js} +1 -1
  36. package/dist/cli/{index-m35hybf0.js → index-bm5xrfnx.js} +1 -1
  37. package/dist/cli/{index-pyf517sz.js → index-br3mvbsa.js} +2 -2
  38. package/dist/cli/{index-4r5pmtvk.js → index-bx1wgn3a.js} +4 -4
  39. package/dist/cli/{index-xhb4gryr.js → index-c7kr7tnk.js} +4 -4
  40. package/dist/cli/{index-nwwk3dej.js → index-cgpwjctj.js} +1 -1
  41. package/dist/cli/{index-q8091q8b.js → index-dd48vt27.js} +3 -3
  42. package/dist/cli/{index-wst6n478.js → index-dvbf6fpn.js} +1 -1
  43. package/dist/cli/{index-w3x1dmrf.js → index-e4dxf5cr.js} +39 -38
  44. package/dist/cli/{index-5g6rhkn7.js → index-egkc2bpv.js} +36 -1
  45. package/dist/cli/{index-4kv1ew3q.js → index-exf0j569.js} +1 -1
  46. package/dist/cli/{index-a8xbvsse.js → index-fgp96k3r.js} +2 -2
  47. package/dist/cli/{index-5zqakgp4.js → index-fhh02gwx.js} +3 -3
  48. package/dist/cli/{index-dfyv3xkd.js → index-gfbggp8k.js} +9 -9
  49. package/dist/cli/{index-f1fps3w9.js → index-ksybszed.js} +7 -7
  50. package/dist/cli/{index-v3xc4sde.js → index-nbdmdyke.js} +2 -1
  51. package/dist/cli/{index-z6qreakh.js → index-nprdr0sm.js} +6 -4
  52. package/dist/cli/{index-9b2105n0.js → index-nwv3e3kc.js} +2 -2
  53. package/dist/cli/{index-bvqqwx84.js → index-nyn01yrz.js} +2 -2
  54. package/dist/cli/{index-y85aptep.js → index-p6xsgk4r.js} +7 -7
  55. package/dist/cli/{index-xkf3672y.js → index-s96dpjsk.js} +2 -2
  56. package/dist/cli/{index-j0bxxz9d.js → index-sb1s03y9.js} +8 -8
  57. package/dist/cli/{index-gmpmgtzn.js → index-sxcfszbe.js} +5 -5
  58. package/dist/cli/{index-qkwtth00.js → index-wwr67xc0.js} +197 -35
  59. package/dist/cli/{index-gp9yzr1v.js → index-xnpjwc4h.js} +1 -1
  60. package/dist/cli/{index-apy1qfj0.js → index-yj24ny5k.js} +26 -4
  61. package/dist/cli/{index-w1dfkp1q.js → index-zapc8vj4.js} +14 -14
  62. package/dist/cli/index.js +39 -38
  63. package/dist/cli/{knowledge-escalator-135dz4eh.js → knowledge-escalator-07s44av0.js} +13 -13
  64. package/dist/cli/{knowledge-events-27gwv47q.js → knowledge-events-j2n1569p.js} +11 -11
  65. package/dist/cli/{knowledge-link-dr3xnwyd.js → knowledge-link-rkxfrmhm.js} +4 -4
  66. package/dist/cli/{knowledge-store-80m44bfw.js → knowledge-store-85metj89.js} +5 -5
  67. package/dist/cli/{knowledge-validator-crsfb2cc.js → knowledge-validator-63k1xzcc.js} +7 -7
  68. package/dist/cli/{pending-delegations-gwgjzzkz.js → pending-delegations-dckmjymn.js} +12 -12
  69. package/dist/cli/{pr-subscriptions-g633nhz4.js → pr-subscriptions-pyh73me6.js} +12 -12
  70. package/dist/cli/{pr-workflow-gate-4dc5nt2e.js → pr-workflow-gate-k1r4rjw4.js} +39 -38
  71. package/dist/cli/{runner-k0ycgv8x.js → runner-1dwrgyyr.js} +6 -6
  72. package/dist/cli/{scan-cursor-avxjsm4w.js → scan-cursor-k6egg4n0.js} +6 -6
  73. package/dist/cli/{schema-3ja77k4y.js → schema-vdrtpggt.js} +5 -1
  74. package/dist/cli/{scope-persistence-f540tc50.js → scope-persistence-h1mmww19.js} +14 -14
  75. package/dist/cli/{skill-generator-kcqqpg1g.js → skill-generator-pmn6gmvk.js} +15 -15
  76. package/dist/cli/{snapshot-coordination-init-e4s8bn4p.js → snapshot-coordination-init-rspykgd0.js} +39 -38
  77. package/dist/cli/{telemetry-2wzapf11.js → telemetry-fdtaemnv.js} +1 -1
  78. package/dist/cli/{workspace-snapshot-rkgxhj9b.js → workspace-snapshot-hkz2wt1c.js} +4 -4
  79. package/dist/cli/{worktree-collision-ownership-rk9gz638.js → worktree-collision-ownership-x84dzzzc.js} +18 -104
  80. package/dist/cli/{worktree-isolation-1bdzfgky.js → worktree-isolation-nw9pakkx.js} +39 -38
  81. package/dist/commands/destructive-purge.d.ts +85 -0
  82. package/dist/commands/registry.d.ts +2 -2
  83. package/dist/commands/reset-session.d.ts +5 -1
  84. package/dist/config/constants.d.ts +4 -1
  85. package/dist/config/lane-context.d.ts +19 -0
  86. package/dist/config/schema.d.ts +77 -0
  87. package/dist/evaluation/index.d.ts +1 -0
  88. package/dist/evaluation/retrieval-quality.d.ts +116 -0
  89. package/dist/failures/invocation-failure.d.ts +23 -4
  90. package/dist/hooks/init-orphan-recovery.d.ts +7 -0
  91. package/dist/hooks/pr-workflow-gate.d.ts +8 -2
  92. package/dist/index.js +596 -590
  93. package/dist/memory/embeddings/reranker.d.ts +13 -2
  94. package/dist/memory/evaluation.d.ts +99 -0
  95. package/dist/memory/heldout-evaluation-corpus.d.ts +51 -0
  96. package/dist/memory/index.d.ts +5 -2
  97. package/dist/memory/sqlite-provider.d.ts +35 -1
  98. package/dist/memory/types.d.ts +14 -0
  99. package/dist/observability/otel-mapping.d.ts +5 -5
  100. package/dist/observability/otlp-exporter.d.ts +80 -0
  101. package/dist/parallel/lane-owners.d.ts +76 -0
  102. package/dist/tools/repo-graph/query.d.ts +6 -1
  103. package/dist/tools/repo-graph/types.d.ts +13 -4
  104. package/dist/utils/bun-compat.d.ts +20 -0
  105. package/dist/utils/gitignore-warning.d.ts +5 -2
  106. package/dist/worktree/base-migration.d.ts +55 -0
  107. package/dist/worktree/core.d.ts +15 -6
  108. package/dist/worktree/ownership.d.ts +66 -0
  109. package/opencode-swarm.schema.json +97 -0
  110. package/package.json +4 -2
  111. package/tests/fixtures/memory-recall-heldout/manifest.json +311 -0
  112. package/tests/fixtures/memory-recall-heldout/sources/bash.sh +1 -0
  113. package/tests/fixtures/memory-recall-heldout/sources/c.c +1 -0
  114. package/tests/fixtures/memory-recall-heldout/sources/cpp.cpp +1 -0
  115. package/tests/fixtures/memory-recall-heldout/sources/csharp.cs +1 -0
  116. package/tests/fixtures/memory-recall-heldout/sources/css.css +3 -0
  117. package/tests/fixtures/memory-recall-heldout/sources/dart.dart +1 -0
  118. package/tests/fixtures/memory-recall-heldout/sources/go.go +3 -0
  119. package/tests/fixtures/memory-recall-heldout/sources/ini.ini +2 -0
  120. package/tests/fixtures/memory-recall-heldout/sources/java.java +1 -0
  121. package/tests/fixtures/memory-recall-heldout/sources/javascript.js +3 -0
  122. package/tests/fixtures/memory-recall-heldout/sources/kotlin.kt +1 -0
  123. package/tests/fixtures/memory-recall-heldout/sources/php.php +1 -0
  124. package/tests/fixtures/memory-recall-heldout/sources/powershell.ps1 +1 -0
  125. package/tests/fixtures/memory-recall-heldout/sources/python.py +2 -0
  126. package/tests/fixtures/memory-recall-heldout/sources/regex.regex +1 -0
  127. package/tests/fixtures/memory-recall-heldout/sources/ruby.rb +3 -0
  128. package/tests/fixtures/memory-recall-heldout/sources/rust.rs +1 -0
  129. package/tests/fixtures/memory-recall-heldout/sources/swift.swift +1 -0
  130. package/tests/fixtures/memory-recall-heldout/sources/tsx.tsx +3 -0
  131. package/tests/fixtures/memory-recall-heldout/sources/typescript.ts +3 -0
  132. package/dist/cli/curator-llm-factory-ygxd6hfx.js +0 -71
  133. package/dist/cli/guardrail-explain-vjtjhgzs.js +0 -72
@@ -8,63 +8,64 @@ import {
8
8
  markSnapshotCoordinationClosing,
9
9
  retrySnapshotCoordinationInitialization,
10
10
  startSnapshotCoordinationInitialization
11
- } from "./index-kkmezerc.js";
12
- import"./index-d5qf7hvh.js";
13
- import"./index-qhey6vc3.js";
14
- import"./index-chebm5h5.js";
15
- import"./index-nwwk3dej.js";
16
- import"./index-5g6rhkn7.js";
17
- import"./index-w1dfkp1q.js";
18
- import"./index-gp9yzr1v.js";
11
+ } from "./index-3zcds757.js";
12
+ import"./index-5400m33a.js";
13
+ import"./index-7h01bkm6.js";
14
+ import"./index-5reh1bjz.js";
15
+ import"./index-cgpwjctj.js";
16
+ import"./index-egkc2bpv.js";
17
+ import"./index-zapc8vj4.js";
18
+ import"./index-xnpjwc4h.js";
19
19
  import"./index-txdagbh7.js";
20
20
  import"./index-9br68j86.js";
21
21
  import"./index-cw912re7.js";
22
- import"./index-xhb4gryr.js";
23
- import"./index-bw9x8d8n.js";
24
- import"./index-9b2105n0.js";
22
+ import"./index-c7kr7tnk.js";
23
+ import"./index-55fkkjec.js";
24
+ import"./index-nwv3e3kc.js";
25
25
  import"./index-fyfbpz4f.js";
26
- import"./index-dfyv3xkd.js";
26
+ import"./index-gfbggp8k.js";
27
+ import"./index-0hgmsyfp.js";
27
28
  import"./index-zsrtt42s.js";
28
- import"./index-j0bxxz9d.js";
29
- import"./index-5zqakgp4.js";
30
- import"./index-bvqqwx84.js";
29
+ import"./index-sb1s03y9.js";
30
+ import"./index-fhh02gwx.js";
31
+ import"./index-nyn01yrz.js";
31
32
  import"./index-b43rt5ph.js";
32
33
  import"./index-q7sjgr1y.js";
33
- import"./index-gmpmgtzn.js";
34
- import"./index-qkwtth00.js";
35
- import"./index-f1fps3w9.js";
36
- import"./index-6df6wbvj.js";
37
- import"./index-kear8gb7.js";
38
- import"./index-p612v1mv.js";
39
- import"./index-qthc56c4.js";
40
- import"./index-m35hybf0.js";
34
+ import"./index-sxcfszbe.js";
35
+ import"./index-wwr67xc0.js";
36
+ import"./index-ksybszed.js";
37
+ import"./index-0vgs5r39.js";
38
+ import"./index-b3pmzbh1.js";
39
+ import"./index-2s7dvzff.js";
40
+ import"./index-2znfa537.js";
41
+ import"./index-bm5xrfnx.js";
41
42
  import"./index-rtry5xyf.js";
42
- import"./index-xkf3672y.js";
43
+ import"./index-s96dpjsk.js";
43
44
  import"./index-3qf1vxtb.js";
44
45
  import"./index-n832052r.js";
45
- import"./index-y85aptep.js";
46
- import"./index-gh9ybrrs.js";
47
- import"./index-a8xbvsse.js";
48
- import"./index-pyf517sz.js";
49
- import"./index-h439y187.js";
50
- import"./index-wst6n478.js";
46
+ import"./index-p6xsgk4r.js";
47
+ import"./index-83m0y4cj.js";
48
+ import"./index-fgp96k3r.js";
49
+ import"./index-br3mvbsa.js";
50
+ import"./index-bernkwgf.js";
51
+ import"./index-dvbf6fpn.js";
51
52
  import"./index-rdm3px0g.js";
52
53
  import"./index-ry16d01s.js";
53
- import"./index-qwsh0h2g.js";
54
- import"./index-2xbww1x0.js";
54
+ import"./index-5qt9yf5w.js";
55
+ import"./index-76ng6vmq.js";
55
56
  import"./index-vzm6zre7.js";
56
57
  import"./index-ae75rja9.js";
57
- import"./index-8ybjqg51.js";
58
- import"./index-4r5pmtvk.js";
58
+ import"./index-9ttqbhvw.js";
59
+ import"./index-bx1wgn3a.js";
59
60
  import"./index-7g4c7s5r.js";
60
- import"./index-v3xc4sde.js";
61
- import"./index-z6qreakh.js";
61
+ import"./index-nprdr0sm.js";
62
+ import"./index-nbdmdyke.js";
62
63
  import"./index-1xnse449.js";
63
64
  import"./index-ee6ydtfe.js";
64
- import"./index-91ww9hyr.js";
65
+ import"./index-3bfzpzsb.js";
65
66
  import"./index-0mhftbpp.js";
66
67
  import"./index-a1w58b47.js";
67
- import"./index-apy1qfj0.js";
68
+ import"./index-yj24ny5k.js";
68
69
  import"./index-sxt7fgcw.js";
69
70
  import"./index-bk5tah7q.js";
70
71
  import"./index-bpmtbmy9.js";
@@ -14,7 +14,7 @@ import {
14
14
  startHeartbeatTracking,
15
15
  stopHeartbeatTracking,
16
16
  telemetry
17
- } from "./index-z6qreakh.js";
17
+ } from "./index-nprdr0sm.js";
18
18
  import"./index-1xnse449.js";
19
19
  import"./index-ee6ydtfe.js";
20
20
  import"./index-bpmtbmy9.js";
@@ -45,10 +45,10 @@ import {
45
45
  shouldSkipSnapshot,
46
46
  switchPrFeedbackTrackingCandidateAsync,
47
47
  workspaceSnapshotMatches
48
- } from "./index-5zqakgp4.js";
49
- import"./index-kear8gb7.js";
50
- import"./index-p612v1mv.js";
51
- import"./index-v3xc4sde.js";
48
+ } from "./index-fhh02gwx.js";
49
+ import"./index-b3pmzbh1.js";
50
+ import"./index-2s7dvzff.js";
51
+ import"./index-nbdmdyke.js";
52
52
  import"./index-1xnse449.js";
53
53
  import"./index-ee6ydtfe.js";
54
54
  import"./index-0mhftbpp.js";
@@ -1,4 +1,7 @@
1
1
  // @bun
2
+ import {
3
+ scanBackgroundWorktreeOwnershipTagsForRecovery
4
+ } from "./index-0hgmsyfp.js";
2
5
  import {
3
6
  scanWorktreeMergeFailuresForRecovery
4
7
  } from "./index-zsrtt42s.js";
@@ -6,37 +9,32 @@ import {
6
9
  WORKTREE_PROVISIONING_OWNER_LEASE_MS,
7
10
  removeWorktreeProvisioningOwner,
8
11
  scanWorktreeProvisioningOwnersForRecovery
9
- } from "./index-bvqqwx84.js";
12
+ } from "./index-nyn01yrz.js";
10
13
  import {
11
14
  scanDelegationFallbacksForRecovery,
12
15
  scanDelegationsForRecovery
13
- } from "./index-f1fps3w9.js";
14
- import"./index-kear8gb7.js";
15
- import {
16
- bunSpawn
17
- } from "./index-p612v1mv.js";
18
- import"./index-pyf517sz.js";
19
- import"./index-h439y187.js";
20
- import"./index-wst6n478.js";
16
+ } from "./index-ksybszed.js";
17
+ import"./index-b3pmzbh1.js";
18
+ import"./index-2s7dvzff.js";
19
+ import"./index-br3mvbsa.js";
20
+ import"./index-bernkwgf.js";
21
+ import"./index-dvbf6fpn.js";
21
22
  import"./index-rdm3px0g.js";
22
23
  import"./index-ry16d01s.js";
23
- import"./index-qwsh0h2g.js";
24
- import"./index-2xbww1x0.js";
24
+ import"./index-5qt9yf5w.js";
25
+ import"./index-76ng6vmq.js";
25
26
  import"./index-vzm6zre7.js";
26
27
  import"./index-ae75rja9.js";
27
- import"./index-8ybjqg51.js";
28
- import"./index-4r5pmtvk.js";
28
+ import"./index-9ttqbhvw.js";
29
+ import"./index-bx1wgn3a.js";
29
30
  import"./index-7g4c7s5r.js";
30
- import"./index-v3xc4sde.js";
31
- import"./index-z6qreakh.js";
31
+ import"./index-nprdr0sm.js";
32
+ import"./index-nbdmdyke.js";
32
33
  import {
33
34
  canonicalRootKeyFresh
34
35
  } from "./index-1xnse449.js";
35
36
  import"./index-ee6ydtfe.js";
36
- import {
37
- init_git_executable,
38
- resolveGitExecutable
39
- } from "./index-0mhftbpp.js";
37
+ import"./index-0mhftbpp.js";
40
38
  import"./index-a1w58b47.js";
41
39
  import"./index-bk5tah7q.js";
42
40
  import"./index-bpmtbmy9.js";
@@ -45,93 +43,9 @@ import"./index-zgwm4ryv.js";
45
43
  import"./index-a76rekgs.js";
46
44
 
47
45
  // src/hooks/delegation-gate/worktree-collision-ownership.ts
48
- import * as fs2 from "fs";
49
-
50
- // src/hooks/delegation-gate/worktree-ownership-tag.ts
51
46
  import * as fs from "fs";
52
- import * as path from "path";
53
- init_git_executable();
54
- var OWNERSHIP_TAG_SCAN_TIMEOUT_MS = 2000;
55
- var MAX_OWNERSHIP_TAGS = 512;
56
- function decodeTagPart(value) {
57
- if (!value || !/^[A-Za-z0-9_-]+$/.test(value))
58
- return null;
59
- const decoded = Buffer.from(value, "base64url").toString("utf8");
60
- return decoded && Buffer.from(decoded, "utf8").toString("base64url") === value ? decoded : null;
61
- }
62
- async function scanBackgroundWorktreeOwnershipTagsForRecovery(directory) {
63
- try {
64
- fs.statSync(path.join(directory, ".git"));
65
- } catch (error) {
66
- if (error.code === "ENOENT") {
67
- return { status: "ok", owners: [] };
68
- }
69
- return {
70
- status: "uncertain",
71
- reason: `Git metadata could not be inspected: ${error instanceof Error ? error.message : String(error)}`
72
- };
73
- }
74
- let proc;
75
- try {
76
- proc = bunSpawn([
77
- resolveGitExecutable(),
78
- "-C",
79
- directory,
80
- "for-each-ref",
81
- `--count=${MAX_OWNERSHIP_TAGS + 1}`,
82
- "--format=%(refname:strip=2)%00%(objectname)",
83
- "refs/tags/swarm-preserved-owner/"
84
- ], {
85
- stdin: "ignore",
86
- stdout: "pipe",
87
- stderr: "ignore",
88
- timeout: OWNERSHIP_TAG_SCAN_TIMEOUT_MS
89
- });
90
- const exitCode = await proc.exited;
91
- if (exitCode !== 0) {
92
- return {
93
- status: "uncertain",
94
- reason: `ownership tag scan exited ${exitCode}`
95
- };
96
- }
97
- const lines = (await proc.stdout.text()).split(/\r?\n/).map((line) => line.trim()).filter(Boolean);
98
- if (lines.length > MAX_OWNERSHIP_TAGS) {
99
- return {
100
- status: "uncertain",
101
- reason: `ownership tag scan exceeded the ${MAX_OWNERSHIP_TAGS}-tag safety bound`
102
- };
103
- }
104
- const owners = [];
105
- for (const line of lines) {
106
- const [tag, ref, ...extra] = line.split("\x00");
107
- const segments = tag?.split("/") ?? [];
108
- const sessionId = decodeTagPart(segments[1] ?? "");
109
- const laneId = decodeTagPart(segments[2] ?? "");
110
- const callDigest = segments[3];
111
- if (extra.length > 0 || segments.length !== 4 || segments[0] !== "swarm-preserved-owner" || !sessionId || !laneId || !callDigest || !/^[0-9a-f]{12}$/.test(callDigest) || !ref || !/^[0-9a-f]{40,64}$/i.test(ref)) {
112
- return {
113
- status: "uncertain",
114
- reason: `malformed background ownership tag entry "${tag ?? ""}"`
115
- };
116
- }
117
- owners.push({ sessionId, laneId, callDigest, ref });
118
- }
119
- return { status: "ok", owners };
120
- } catch (error) {
121
- return {
122
- status: "uncertain",
123
- reason: `ownership tag scan failed: ${error instanceof Error ? error.message : String(error)}`
124
- };
125
- } finally {
126
- try {
127
- proc?.kill();
128
- } catch {}
129
- }
130
- }
131
-
132
- // src/hooks/delegation-gate/worktree-collision-ownership.ts
133
47
  var _internals = {
134
- statSync: fs2.statSync,
48
+ statSync: fs.statSync,
135
49
  removeWorktreeProvisioningOwner
136
50
  };
137
51
  function descriptorCoordinateMatch(descriptor, identity) {
@@ -21,65 +21,66 @@ import {
21
21
  sanitizeWorktreeTaskId,
22
22
  standardWorktreeByCallID,
23
23
  standardWorktreeSerializationSessions
24
- } from "./index-kkmezerc.js";
25
- import"./index-d5qf7hvh.js";
26
- import"./index-qhey6vc3.js";
27
- import"./index-chebm5h5.js";
28
- import"./index-nwwk3dej.js";
29
- import"./index-5g6rhkn7.js";
30
- import"./index-w1dfkp1q.js";
31
- import"./index-gp9yzr1v.js";
24
+ } from "./index-3zcds757.js";
25
+ import"./index-5400m33a.js";
26
+ import"./index-7h01bkm6.js";
27
+ import"./index-5reh1bjz.js";
28
+ import"./index-cgpwjctj.js";
29
+ import"./index-egkc2bpv.js";
30
+ import"./index-zapc8vj4.js";
31
+ import"./index-xnpjwc4h.js";
32
32
  import"./index-txdagbh7.js";
33
33
  import"./index-9br68j86.js";
34
34
  import"./index-cw912re7.js";
35
- import"./index-xhb4gryr.js";
36
- import"./index-bw9x8d8n.js";
37
- import"./index-9b2105n0.js";
35
+ import"./index-c7kr7tnk.js";
36
+ import"./index-55fkkjec.js";
37
+ import"./index-nwv3e3kc.js";
38
38
  import"./index-fyfbpz4f.js";
39
- import"./index-dfyv3xkd.js";
39
+ import"./index-gfbggp8k.js";
40
+ import"./index-0hgmsyfp.js";
40
41
  import"./index-zsrtt42s.js";
41
- import"./index-j0bxxz9d.js";
42
- import"./index-5zqakgp4.js";
43
- import"./index-bvqqwx84.js";
42
+ import"./index-sb1s03y9.js";
43
+ import"./index-fhh02gwx.js";
44
+ import"./index-nyn01yrz.js";
44
45
  import"./index-b43rt5ph.js";
45
46
  import"./index-q7sjgr1y.js";
46
- import"./index-gmpmgtzn.js";
47
- import"./index-qkwtth00.js";
48
- import"./index-f1fps3w9.js";
49
- import"./index-6df6wbvj.js";
50
- import"./index-kear8gb7.js";
51
- import"./index-p612v1mv.js";
52
- import"./index-qthc56c4.js";
53
- import"./index-m35hybf0.js";
47
+ import"./index-sxcfszbe.js";
48
+ import"./index-wwr67xc0.js";
49
+ import"./index-ksybszed.js";
50
+ import"./index-0vgs5r39.js";
51
+ import"./index-b3pmzbh1.js";
52
+ import"./index-2s7dvzff.js";
53
+ import"./index-2znfa537.js";
54
+ import"./index-bm5xrfnx.js";
54
55
  import"./index-rtry5xyf.js";
55
56
  import {
56
57
  resolveWorktreeIsolationConfig
57
- } from "./index-xkf3672y.js";
58
+ } from "./index-s96dpjsk.js";
58
59
  import"./index-3qf1vxtb.js";
59
60
  import"./index-n832052r.js";
60
- import"./index-y85aptep.js";
61
- import"./index-gh9ybrrs.js";
62
- import"./index-a8xbvsse.js";
63
- import"./index-pyf517sz.js";
64
- import"./index-h439y187.js";
65
- import"./index-wst6n478.js";
61
+ import"./index-p6xsgk4r.js";
62
+ import"./index-83m0y4cj.js";
63
+ import"./index-fgp96k3r.js";
64
+ import"./index-br3mvbsa.js";
65
+ import"./index-bernkwgf.js";
66
+ import"./index-dvbf6fpn.js";
66
67
  import"./index-rdm3px0g.js";
67
68
  import"./index-ry16d01s.js";
68
- import"./index-qwsh0h2g.js";
69
- import"./index-2xbww1x0.js";
69
+ import"./index-5qt9yf5w.js";
70
+ import"./index-76ng6vmq.js";
70
71
  import"./index-vzm6zre7.js";
71
72
  import"./index-ae75rja9.js";
72
- import"./index-8ybjqg51.js";
73
- import"./index-4r5pmtvk.js";
73
+ import"./index-9ttqbhvw.js";
74
+ import"./index-bx1wgn3a.js";
74
75
  import"./index-7g4c7s5r.js";
75
- import"./index-v3xc4sde.js";
76
- import"./index-z6qreakh.js";
76
+ import"./index-nprdr0sm.js";
77
+ import"./index-nbdmdyke.js";
77
78
  import"./index-1xnse449.js";
78
79
  import"./index-ee6ydtfe.js";
79
- import"./index-91ww9hyr.js";
80
+ import"./index-3bfzpzsb.js";
80
81
  import"./index-0mhftbpp.js";
81
82
  import"./index-a1w58b47.js";
82
- import"./index-apy1qfj0.js";
83
+ import"./index-yj24ny5k.js";
83
84
  import"./index-sxt7fgcw.js";
84
85
  import"./index-bk5tah7q.js";
85
86
  import"./index-bpmtbmy9.js";
@@ -0,0 +1,85 @@
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
+ import { randomBytes } from 'node:crypto';
29
+ import * as fs from 'node:fs';
30
+ import { atomicWriteSwarmFileSync } from '../utils/atomic-write';
31
+ export interface PurgeCandidate {
32
+ path: string;
33
+ reason: string;
34
+ }
35
+ export interface PurgePlan {
36
+ previewLines: string[];
37
+ counts: {
38
+ total: number;
39
+ };
40
+ optionLabel: string;
41
+ confirmToken: string;
42
+ candidates: PurgeCandidate[];
43
+ }
44
+ export interface PurgeExecution {
45
+ ok: boolean;
46
+ reason?: string;
47
+ purged?: string[];
48
+ }
49
+ export declare const _internals: {
50
+ readFileSync: (p: string, enc: BufferEncoding) => string;
51
+ rmSync: typeof fs.rmSync;
52
+ existsSync: typeof fs.existsSync;
53
+ atomicWriteSwarmFileSync: typeof atomicWriteSwarmFileSync;
54
+ now: () => number;
55
+ randomBytes: typeof randomBytes;
56
+ };
57
+ /**
58
+ * Side-effect-free preview: what would be purged, the counts, the exact
59
+ * option label the operator must echo, and the confirm token to use.
60
+ * (The token returned here is informational; `issueConfirmToken` is what
61
+ * arms it — keeping preview strictly read-only lets callers preview freely.)
62
+ */
63
+ export declare function previewDestructivePurge(scopeTarget: string, projectRoot: string, extra?: {
64
+ kind?: string;
65
+ candidates?: PurgeCandidate[];
66
+ }): PurgePlan;
67
+ /**
68
+ * Arm a pending purge for the scope and return the confirm token. The
69
+ * single-slot record is overwritten by every new issuance (the previous
70
+ * token stops working — "no pending purge for this scope").
71
+ */
72
+ export declare function issueConfirmToken(scopeTarget: string, projectRoot: string, extra?: {
73
+ kind?: string;
74
+ candidates?: PurgeCandidate[];
75
+ }): string;
76
+ /**
77
+ * Execute the pending purge under the exact token. Re-derives the CURRENT
78
+ * scope digest: token match AND digest match AND fresh TTL required; the
79
+ * record is consumed on success (single use). Deletes ONLY the recorded
80
+ * candidate paths.
81
+ */
82
+ export declare function executeDestructivePurge(scopeTarget: string, projectRoot: string, token: string, extra?: {
83
+ kind?: string;
84
+ candidates?: PurgeCandidate[];
85
+ }): PurgeExecution;
@@ -960,7 +960,7 @@ export declare const COMMAND_REGISTRY: {
960
960
  readonly handler: (ctx: CommandContext) => Promise<string>;
961
961
  readonly description: "Clear session state while preserving plan, evidence, and knowledge";
962
962
  readonly details: "Deletes only .swarm/session/state.json and other session files. Clears in-memory agent sessions, delegation chains, and active-agent mappings. Preserves plan, evidence, and knowledge. Also releases this session's pending knowledge-gate obligations (#2398) and recovers stale coder settlements so dispatches cannot wedge on CODER_DISPATCH_IN_PROGRESS (#2268). Auto-backs up removed files to .swarm/reset-backups/ (newest 5 kept).";
963
- readonly args: "";
963
+ readonly args: "--confirm=<token> (purge dirty/live lanes)";
964
964
  readonly category: "utility";
965
965
  readonly toolPolicy: "restricted";
966
966
  };
@@ -1151,7 +1151,7 @@ export declare const COMMAND_REGISTRY: {
1151
1151
  readonly handler: (ctx: CommandContext) => Promise<string>;
1152
1152
  readonly description: "Run golden Swarm memory recall evaluation fixtures";
1153
1153
  readonly subcommandOf: "memory";
1154
- readonly args: "--json, --fixtures <directory>";
1154
+ readonly args: "--json, --fixtures <directory>, --profiles <list>, --manifest <file>";
1155
1155
  readonly category: "diagnostics";
1156
1156
  readonly toolPolicy: "agent";
1157
1157
  };
@@ -1,8 +1,10 @@
1
1
  import { commitGateReleaseBatch, queryLiveMemberships } from '../hooks/knowledge-receipt-ledger';
2
+ import { listLiveLaneOwners } from '../parallel/lane-owners';
2
3
  import { beginSnapshotCoordinationReset } from '../session/snapshot-coordination-init.js';
3
4
  import { clearSnapshotRows } from '../session/snapshot-store.js';
4
5
  import { recoverStaleCoderSettlements } from '../workflow/coder-settlement.js';
5
6
  import { type OrphanCleanupResult } from '../worktree/merge';
7
+ import { removeOwnedWorktreeDir } from '../worktree/ownership';
6
8
  import { type ResetBackupResult } from './reset-backup';
7
9
  /**
8
10
  * _internals DI seam for testing reset-session without spawning real git processes.
@@ -12,6 +14,8 @@ import { type ResetBackupResult } from './reset-backup';
12
14
  */
13
15
  export declare const _internals: {
14
16
  cleanupOrphanedBranches: (directory: string, activeSessionIds: string[]) => Promise<OrphanCleanupResult>;
17
+ removeOwnedWorktreeDir: typeof removeOwnedWorktreeDir;
18
+ listLiveLaneOwners: typeof listLiveLaneOwners;
15
19
  backupSwarmStateBeforeReset: (directory: string, kind: 'reset' | 'reset-session', relEntries: string[]) => ResetBackupResult;
16
20
  recoverStaleCoderSettlements: typeof recoverStaleCoderSettlements;
17
21
  queryLiveMemberships: typeof queryLiveMemberships;
@@ -28,4 +32,4 @@ export declare const _internals: {
28
32
  * session's pending knowledge-application gate obligations (issue #2398) so
29
33
  * the reset is a real escape from an enforce-mode lockout.
30
34
  */
31
- export declare function handleResetSessionCommand(directory: string, _args: string[], sessionID?: string): Promise<string>;
35
+ export declare function handleResetSessionCommand(directory: string, args: string[], sessionID?: string): Promise<string>;
@@ -141,7 +141,10 @@ export declare const AUTO_PROCEED_BANNER = "## \u23ED\uFE0F AUTO-PROCEED STATUS\
141
141
  export declare const DEFAULT_LEAN_TURBO_CONFIG: LeanTurboConfig;
142
142
  /**
143
143
  * Directory name of the DD-6 default swarm-managed worktree base, created as a
144
- * SIBLING of the project root (`<project-parent>/.swarm-worktrees`).
144
+ * child of the project root (`<project>/.swarm-worktrees`) — moved inside the
145
+ * project by issue #2527 (the pre-#2527 parent-level default was shared by
146
+ * every sibling checkout and enabled cross-project reclamation destruction);
147
+ * a start-time migration moves owned legacy-base lanes into the project.
145
148
  *
146
149
  * Single source of truth shared by `resolveWorktreeBaseDir` in
147
150
  * `src/worktree/core.ts` (which BUILDS lane paths) and
@@ -55,6 +55,25 @@ export interface LaneContext {
55
55
  */
56
56
  parentProjectPath: string;
57
57
  }
58
+ /**
59
+ * Issue #2527: repo-ownership answer for destructive reclamation.
60
+ *
61
+ * `owned === true` (and `uncertain === false`) is the ONLY answer that
62
+ * permits deleting a worktree directory from a reclamation path: the
63
+ * candidate's `.git` pointer must resolve, through git's own `commondir`
64
+ * metadata, back to a main working tree that IS the expected project root.
65
+ * Anything else — foreign repo (the common shared-base case: `git worktree
66
+ * remove` says "is not a working tree"), unreadable/malformed pointer, or a
67
+ * main-working-tree candidate we were not asked about — is NOT deletable.
68
+ * Comparison is case-insensitive on Windows, matching
69
+ * `isPathUnderSwarmWorktreeBase` in `src/worktree/core.ts`.
70
+ */
71
+ export interface WorktreeRepoOwnership {
72
+ owned: boolean;
73
+ mainWorktree?: string;
74
+ uncertain: boolean;
75
+ }
76
+ export declare function resolveWorktreeRepoOwnership(worktreePath: string, expectedProjectRoot: string): WorktreeRepoOwnership;
58
77
  /**
59
78
  * Test-only dependency-injection seam (AGENTS.md invariant 7 — prefer
60
79
  * `_internals` over `mock.module`, which leaks across files in Bun's shared
@@ -882,6 +882,62 @@ export declare const ConsensusConfigSchema: z.ZodObject<{
882
882
  report_retention: z.ZodDefault<z.ZodNumber>;
883
883
  }, z.core.$strip>;
884
884
  export type ConsensusConfig = z.infer<typeof ConsensusConfigSchema>;
885
+ /**
886
+ * Opt-in remote OTLP/OpenInference observability export (issue #2485).
887
+ *
888
+ * Disabled by default: local operation — plugin init, the SQLite sink, the
889
+ * legacy telemetry stream, /swarm report — is fully independent of the
890
+ * exporter and of any collector/network. When enabled, the exporter
891
+ * registers as a telemetry listener (the same O(1) shape as the SQLite
892
+ * observability sink), persists privacy-filtered records in a bounded
893
+ * spool under `.swarm/otlp-export/`, and ships them as OTLP/HTTP JSON to
894
+ * `endpoint` with bounded retry/backoff and a cooldown circuit. Endpoint
895
+ * policy: `https:` required for remote collectors; plain `http:` is
896
+ * accepted only for loopback test collectors.
897
+ */
898
+ export declare const OtlpExportConfigSchema: z.ZodObject<{
899
+ enabled: z.ZodDefault<z.ZodBoolean>;
900
+ endpoint: z.ZodDefault<z.ZodString>;
901
+ convention: z.ZodDefault<z.ZodEnum<{
902
+ genai: "genai";
903
+ openinference: "openinference";
904
+ }>>;
905
+ headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
906
+ batchSize: z.ZodDefault<z.ZodNumber>;
907
+ flushIntervalMs: z.ZodDefault<z.ZodNumber>;
908
+ requestTimeoutMs: z.ZodDefault<z.ZodNumber>;
909
+ spoolMaxBytes: z.ZodDefault<z.ZodNumber>;
910
+ spoolMaxAgeMs: z.ZodDefault<z.ZodNumber>;
911
+ maxRetries: z.ZodDefault<z.ZodNumber>;
912
+ backoffBaseMs: z.ZodDefault<z.ZodNumber>;
913
+ backoffMaxMs: z.ZodDefault<z.ZodNumber>;
914
+ circuitThreshold: z.ZodDefault<z.ZodNumber>;
915
+ circuitCooldownMs: z.ZodDefault<z.ZodNumber>;
916
+ }, z.core.$strip>;
917
+ export type OtlpExportConfig = z.infer<typeof OtlpExportConfigSchema>;
918
+ /** Observability block. Only the opt-in remote export today. */
919
+ export declare const ObservabilityConfigSchema: z.ZodObject<{
920
+ export: z.ZodOptional<z.ZodObject<{
921
+ enabled: z.ZodDefault<z.ZodBoolean>;
922
+ endpoint: z.ZodDefault<z.ZodString>;
923
+ convention: z.ZodDefault<z.ZodEnum<{
924
+ genai: "genai";
925
+ openinference: "openinference";
926
+ }>>;
927
+ headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
928
+ batchSize: z.ZodDefault<z.ZodNumber>;
929
+ flushIntervalMs: z.ZodDefault<z.ZodNumber>;
930
+ requestTimeoutMs: z.ZodDefault<z.ZodNumber>;
931
+ spoolMaxBytes: z.ZodDefault<z.ZodNumber>;
932
+ spoolMaxAgeMs: z.ZodDefault<z.ZodNumber>;
933
+ maxRetries: z.ZodDefault<z.ZodNumber>;
934
+ backoffBaseMs: z.ZodDefault<z.ZodNumber>;
935
+ backoffMaxMs: z.ZodDefault<z.ZodNumber>;
936
+ circuitThreshold: z.ZodDefault<z.ZodNumber>;
937
+ circuitCooldownMs: z.ZodDefault<z.ZodNumber>;
938
+ }, z.core.$strip>>;
939
+ }, z.core.$strip>;
940
+ export type ObservabilityConfig = z.infer<typeof ObservabilityConfigSchema>;
885
941
  export declare const MemoryConfigSchema: z.ZodObject<{
886
942
  enabled: z.ZodDefault<z.ZodBoolean>;
887
943
  provider: z.ZodDefault<z.ZodEnum<{
@@ -2563,6 +2619,27 @@ export declare const PluginConfigSchema: z.ZodObject<{
2563
2619
  latencyBudgetMs: z.ZodDefault<z.ZodNumber>;
2564
2620
  }, z.core.$strip>>;
2565
2621
  }, z.core.$strip>>;
2622
+ observability: z.ZodOptional<z.ZodObject<{
2623
+ export: z.ZodOptional<z.ZodObject<{
2624
+ enabled: z.ZodDefault<z.ZodBoolean>;
2625
+ endpoint: z.ZodDefault<z.ZodString>;
2626
+ convention: z.ZodDefault<z.ZodEnum<{
2627
+ genai: "genai";
2628
+ openinference: "openinference";
2629
+ }>>;
2630
+ headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2631
+ batchSize: z.ZodDefault<z.ZodNumber>;
2632
+ flushIntervalMs: z.ZodDefault<z.ZodNumber>;
2633
+ requestTimeoutMs: z.ZodDefault<z.ZodNumber>;
2634
+ spoolMaxBytes: z.ZodDefault<z.ZodNumber>;
2635
+ spoolMaxAgeMs: z.ZodDefault<z.ZodNumber>;
2636
+ maxRetries: z.ZodDefault<z.ZodNumber>;
2637
+ backoffBaseMs: z.ZodDefault<z.ZodNumber>;
2638
+ backoffMaxMs: z.ZodDefault<z.ZodNumber>;
2639
+ circuitThreshold: z.ZodDefault<z.ZodNumber>;
2640
+ circuitCooldownMs: z.ZodDefault<z.ZodNumber>;
2641
+ }, z.core.$strip>>;
2642
+ }, z.core.$strip>>;
2566
2643
  learning: z.ZodOptional<z.ZodObject<{
2567
2644
  realtime_admission: z.ZodPrefault<z.ZodObject<{
2568
2645
  enabled: z.ZodDefault<z.ZodBoolean>;
@@ -12,6 +12,7 @@ export { createEvaluationModelDispatcher, resolveEvaluationAgentName, } from './
12
12
  export * from './pr-review-recovery.js';
13
13
  export * from './public-api.js';
14
14
  export * from './retention.js';
15
+ export { type AggregateExactMeasurement, type ExactMeasurement, evaluateHeldoutGraphRetrievalQuality, type HeldoutGraphQualityCase, type HeldoutGraphQualityReport, type RetrievalQualityOptions, type RetrievalQualityResourceCaps, type RetrievalQualityStatus, type RetrievalRouteMeasurement, } from './retrieval-quality.js';
15
16
  export type { EvaluationExecutor, EvaluationExecutorResult, RunEvaluationOptions, } from './runner.js';
16
17
  export { createModelEvaluationExecutor, runEvaluation, } from './runner.js';
17
18
  export * from './statistics.js';