opencode-swarm 7.168.1 → 7.170.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.
- package/.opencode/skills/swarm-pr-feedback/SKILL.md +11 -11
- package/README.md +1 -0
- package/binaries/win32-arm64/swarm-sandbox-runner.exe +0 -0
- package/binaries/win32-x64/swarm-sandbox-runner.exe +0 -0
- package/dist/ci/evaluate.d.ts +100 -0
- package/dist/ci/index.d.ts +13 -0
- package/dist/ci/quality-checks.d.ts +58 -0
- package/dist/ci/report.d.ts +21 -0
- package/dist/ci/runtime.d.ts +81 -0
- package/dist/cli/{capability-probe-faqefhah.js → capability-probe-pdwwz8gs.js} +1 -1
- package/dist/cli/{coder-settlement-54a3d97g.js → coder-settlement-65zx1bet.js} +12 -12
- package/dist/cli/{config-doctor-vzp6b3ng.js → config-doctor-c30rss1c.js} +2 -2
- package/dist/cli/{core-yynse50x.js → core-8wkbr1tr.js} +5 -2
- package/dist/cli/{curation-policy-mgwv8h2k.js → curation-policy-k74qz9ms.js} +5 -5
- package/dist/cli/{curator-drift-k0zrnm09.js → curator-drift-3ssjr0nx.js} +5 -5
- package/dist/cli/curator-llm-factory-jkjqasfs.js +72 -0
- package/dist/cli/{curator-agdhhzqt.js → curator-pckzk1q4.js} +40 -39
- package/dist/cli/{dispatch-8ks9dyk5.js → dispatch-hwwj3qrb.js} +2 -2
- package/dist/cli/{evidence-summary-service-6mmcekr7.js → evidence-summary-service-4ydcapke.js} +17 -17
- package/dist/cli/{gate-evidence-xqvkqhrk.js → gate-evidence-xwqfky3m.js} +7 -7
- package/dist/cli/guardrail-explain-fe2veh2s.js +73 -0
- package/dist/cli/{guardrail-log-5wa5c77w.js → guardrail-log-z38j69bx.js} +8 -8
- package/dist/cli/{guardrail-reset-dh78tbcf.js → guardrail-reset-mmnzt4mz.js} +40 -39
- package/dist/cli/hive-promoter-68hrw1y1.js +87 -0
- package/dist/cli/{index-gmpmgtzn.js → index-06rbdzqn.js} +5 -5
- package/dist/cli/index-0hgmsyfp.js +92 -0
- package/dist/cli/{index-f1fps3w9.js → index-0xprxg95.js} +7 -7
- package/dist/cli/{index-p612v1mv.js → index-2s7dvzff.js} +200 -51
- package/dist/cli/{index-qthc56c4.js → index-31sqcdsd.js} +4 -4
- package/dist/cli/{index-y85aptep.js → index-3axdtaf0.js} +7 -7
- package/dist/cli/{index-9b2105n0.js → index-3eh2n3dx.js} +2 -2
- package/dist/cli/{index-w1dfkp1q.js → index-3p3y55xg.js} +15 -15
- package/dist/cli/{index-apy1qfj0.js → index-4wc5gfgm.js} +26 -4
- package/dist/cli/{index-d5qf7hvh.js → index-5400m33a.js} +1 -1
- package/dist/cli/{index-qkwtth00.js → index-59fcfpkh.js} +197 -35
- package/dist/cli/{index-j0bxxz9d.js → index-5bbem0ey.js} +8 -8
- package/dist/cli/{index-qwsh0h2g.js → index-5qt9yf5w.js} +4 -4
- package/dist/cli/{index-q1r1cfww.js → index-76qm2c2y.js} +37 -26
- package/dist/cli/{index-qhey6vc3.js → index-7h01bkm6.js} +2 -2
- package/dist/cli/{index-6df6wbvj.js → index-8w1mrvbd.js} +8 -8
- package/dist/cli/{index-8ybjqg51.js → index-9ttqbhvw.js} +1 -1
- package/dist/cli/{index-xhb4gryr.js → index-9xk97bcf.js} +4 -4
- package/dist/cli/{index-kear8gb7.js → index-b3pmzbh1.js} +2 -2
- package/dist/cli/{index-h439y187.js → index-bernkwgf.js} +1 -1
- package/dist/cli/{index-m35hybf0.js → index-bm5xrfnx.js} +1 -1
- package/dist/cli/{index-pyf517sz.js → index-br3mvbsa.js} +2 -2
- package/dist/cli/{index-4r5pmtvk.js → index-bx1wgn3a.js} +4 -4
- package/dist/cli/{index-nwwk3dej.js → index-cgpwjctj.js} +1 -1
- package/dist/cli/{index-wst6n478.js → index-dvbf6fpn.js} +1 -1
- package/dist/cli/{index-a8xbvsse.js → index-fgp96k3r.js} +2 -2
- package/dist/cli/{index-5zqakgp4.js → index-fhh02gwx.js} +3 -3
- package/dist/cli/{index-dfyv3xkd.js → index-gfbggp8k.js} +9 -9
- package/dist/cli/{index-kkmezerc.js → index-j144fgk8.js} +4831 -2776
- package/dist/cli/{index-xkf3672y.js → index-mjn6aqqk.js} +2 -2
- package/dist/cli/{index-3jmb4ppa.js → index-n0d5hrs4.js} +2 -2
- package/dist/cli/{index-v3xc4sde.js → index-nbdmdyke.js} +2 -1
- package/dist/cli/{index-z6qreakh.js → index-nprdr0sm.js} +6 -4
- package/dist/cli/{index-bvqqwx84.js → index-nyn01yrz.js} +2 -2
- package/dist/cli/{index-q8091q8b.js → index-p6fj7qz7.js} +3 -3
- package/dist/cli/{index-gh9ybrrs.js → index-pw00xcj0.js} +7 -7
- package/dist/cli/{index-bw9x8d8n.js → index-r1z8nrb6.js} +5 -5
- package/dist/cli/{index-2xbww1x0.js → index-ssx8087p.js} +7 -7
- package/dist/cli/{index-4kv1ew3q.js → index-t73888m0.js} +1 -1
- package/dist/cli/{index-91ww9hyr.js → index-td6xrw55.js} +1 -1
- package/dist/cli/{index-gp9yzr1v.js → index-xnpjwc4h.js} +1 -1
- package/dist/cli/{index-yt9n9zt3.js → index-xztkjj3c.js} +48 -41
- package/dist/cli/{index-5g6rhkn7.js → index-ye43mdfm.js} +36 -1
- package/dist/cli/{index-w3x1dmrf.js → index-z5vas8c3.js} +40 -39
- package/dist/cli/{index-chebm5h5.js → index-zw3hkzch.js} +3 -3
- package/dist/cli/index.js +45 -39
- package/dist/cli/{knowledge-escalator-135dz4eh.js → knowledge-escalator-pz2faktx.js} +13 -13
- package/dist/cli/{knowledge-events-27gwv47q.js → knowledge-events-s6s8qedx.js} +11 -11
- package/dist/cli/{knowledge-link-dr3xnwyd.js → knowledge-link-rkxfrmhm.js} +4 -4
- package/dist/cli/{knowledge-store-80m44bfw.js → knowledge-store-dgv3xw3h.js} +5 -5
- package/dist/cli/{knowledge-validator-crsfb2cc.js → knowledge-validator-22qppdyv.js} +7 -7
- package/dist/cli/{pending-delegations-gwgjzzkz.js → pending-delegations-4r21nf9d.js} +12 -12
- package/dist/cli/{pr-subscriptions-g633nhz4.js → pr-subscriptions-d52xy3zd.js} +12 -12
- package/dist/cli/{pr-workflow-gate-4dc5nt2e.js → pr-workflow-gate-0de81kzw.js} +40 -39
- package/dist/cli/{runner-k0ycgv8x.js → runner-1dwrgyyr.js} +6 -6
- package/dist/cli/{scan-cursor-avxjsm4w.js → scan-cursor-ahbbejab.js} +6 -6
- package/dist/cli/{schema-3ja77k4y.js → schema-17h2hcw9.js} +5 -1
- package/dist/cli/{scope-persistence-f540tc50.js → scope-persistence-gcn3zm5e.js} +14 -14
- package/dist/cli/{skill-generator-kcqqpg1g.js → skill-generator-hkqr5qs7.js} +15 -15
- package/dist/cli/{snapshot-coordination-init-e4s8bn4p.js → snapshot-coordination-init-ms36zxv6.js} +40 -39
- package/dist/cli/{telemetry-2wzapf11.js → telemetry-fdtaemnv.js} +1 -1
- package/dist/cli/{workspace-snapshot-rkgxhj9b.js → workspace-snapshot-hkz2wt1c.js} +4 -4
- package/dist/cli/{worktree-collision-ownership-rk9gz638.js → worktree-collision-ownership-7v7gg511.js} +18 -104
- package/dist/cli/{worktree-isolation-1bdzfgky.js → worktree-isolation-nanamt25.js} +40 -39
- package/dist/commands/ci.d.ts +40 -0
- package/dist/commands/destructive-purge.d.ts +85 -0
- package/dist/commands/index.d.ts +1 -0
- package/dist/commands/registry.d.ts +10 -2
- package/dist/commands/reset-session.d.ts +5 -1
- package/dist/config/constants.d.ts +4 -1
- package/dist/config/lane-context.d.ts +19 -0
- package/dist/config/schema.d.ts +77 -0
- package/dist/evaluation/index.d.ts +1 -0
- package/dist/evaluation/retrieval-quality.d.ts +116 -0
- package/dist/failures/invocation-failure.d.ts +23 -4
- package/dist/hooks/gate-denial-tracker.d.ts +18 -14
- package/dist/hooks/init-orphan-recovery.d.ts +7 -0
- package/dist/hooks/pr-workflow-gate.d.ts +8 -2
- package/dist/index.js +616 -608
- package/dist/memory/embeddings/reranker.d.ts +13 -2
- package/dist/memory/evaluation.d.ts +99 -0
- package/dist/memory/heldout-evaluation-corpus.d.ts +51 -0
- package/dist/memory/index.d.ts +5 -2
- package/dist/memory/sqlite-provider.d.ts +35 -1
- package/dist/memory/types.d.ts +14 -0
- package/dist/observability/otel-mapping.d.ts +5 -5
- package/dist/observability/otlp-exporter.d.ts +80 -0
- package/dist/parallel/lane-owners.d.ts +76 -0
- package/dist/sandbox/macos/sandbox-exec-executor.d.ts +48 -11
- package/dist/tools/repo-graph/query.d.ts +6 -1
- package/dist/tools/repo-graph/types.d.ts +13 -4
- package/dist/utils/bun-compat.d.ts +20 -0
- package/dist/utils/gitignore-warning.d.ts +5 -2
- package/dist/worktree/base-migration.d.ts +55 -0
- package/dist/worktree/core.d.ts +15 -6
- package/dist/worktree/ownership.d.ts +66 -0
- package/opencode-swarm.schema.json +97 -0
- package/package.json +4 -2
- package/tests/fixtures/memory-recall-heldout/manifest.json +311 -0
- package/tests/fixtures/memory-recall-heldout/sources/bash.sh +1 -0
- package/tests/fixtures/memory-recall-heldout/sources/c.c +1 -0
- package/tests/fixtures/memory-recall-heldout/sources/cpp.cpp +1 -0
- package/tests/fixtures/memory-recall-heldout/sources/csharp.cs +1 -0
- package/tests/fixtures/memory-recall-heldout/sources/css.css +3 -0
- package/tests/fixtures/memory-recall-heldout/sources/dart.dart +1 -0
- package/tests/fixtures/memory-recall-heldout/sources/go.go +3 -0
- package/tests/fixtures/memory-recall-heldout/sources/ini.ini +2 -0
- package/tests/fixtures/memory-recall-heldout/sources/java.java +1 -0
- package/tests/fixtures/memory-recall-heldout/sources/javascript.js +3 -0
- package/tests/fixtures/memory-recall-heldout/sources/kotlin.kt +1 -0
- package/tests/fixtures/memory-recall-heldout/sources/php.php +1 -0
- package/tests/fixtures/memory-recall-heldout/sources/powershell.ps1 +1 -0
- package/tests/fixtures/memory-recall-heldout/sources/python.py +2 -0
- package/tests/fixtures/memory-recall-heldout/sources/regex.regex +1 -0
- package/tests/fixtures/memory-recall-heldout/sources/ruby.rb +3 -0
- package/tests/fixtures/memory-recall-heldout/sources/rust.rs +1 -0
- package/tests/fixtures/memory-recall-heldout/sources/swift.swift +1 -0
- package/tests/fixtures/memory-recall-heldout/sources/tsx.tsx +3 -0
- package/tests/fixtures/memory-recall-heldout/sources/typescript.ts +3 -0
- package/dist/cli/curator-llm-factory-ygxd6hfx.js +0 -71
- package/dist/cli/guardrail-explain-vjtjhgzs.js +0 -72
- package/dist/cli/hive-promoter-3czsx7c6.js +0 -86
package/dist/cli/{snapshot-coordination-init-e4s8bn4p.js → snapshot-coordination-init-ms36zxv6.js}
RENAMED
|
@@ -8,68 +8,69 @@ import {
|
|
|
8
8
|
markSnapshotCoordinationClosing,
|
|
9
9
|
retrySnapshotCoordinationInitialization,
|
|
10
10
|
startSnapshotCoordinationInitialization
|
|
11
|
-
} from "./index-
|
|
12
|
-
import"./index-
|
|
13
|
-
import"./index-
|
|
14
|
-
import"./index-
|
|
15
|
-
import"./index-
|
|
16
|
-
import"./index-
|
|
17
|
-
import"./index-
|
|
18
|
-
import"./index-
|
|
11
|
+
} from "./index-j144fgk8.js";
|
|
12
|
+
import"./index-5400m33a.js";
|
|
13
|
+
import"./index-7h01bkm6.js";
|
|
14
|
+
import"./index-zw3hkzch.js";
|
|
15
|
+
import"./index-cgpwjctj.js";
|
|
16
|
+
import"./index-ye43mdfm.js";
|
|
17
|
+
import"./index-3p3y55xg.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-
|
|
23
|
-
import"./index-
|
|
24
|
-
import"./index-
|
|
22
|
+
import"./index-9xk97bcf.js";
|
|
23
|
+
import"./index-r1z8nrb6.js";
|
|
24
|
+
import"./index-3eh2n3dx.js";
|
|
25
25
|
import"./index-fyfbpz4f.js";
|
|
26
|
-
import"./index-
|
|
26
|
+
import"./index-gfbggp8k.js";
|
|
27
|
+
import"./index-0hgmsyfp.js";
|
|
27
28
|
import"./index-zsrtt42s.js";
|
|
28
|
-
import"./index-
|
|
29
|
-
import"./index-
|
|
30
|
-
import"./index-
|
|
29
|
+
import"./index-5bbem0ey.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-
|
|
34
|
-
import"./index-
|
|
35
|
-
import"./index-
|
|
36
|
-
import"./index-
|
|
37
|
-
import"./index-
|
|
38
|
-
import"./index-
|
|
39
|
-
import"./index-
|
|
40
|
-
import"./index-
|
|
34
|
+
import"./index-06rbdzqn.js";
|
|
35
|
+
import"./index-59fcfpkh.js";
|
|
36
|
+
import"./index-0xprxg95.js";
|
|
37
|
+
import"./index-8w1mrvbd.js";
|
|
38
|
+
import"./index-b3pmzbh1.js";
|
|
39
|
+
import"./index-2s7dvzff.js";
|
|
40
|
+
import"./index-31sqcdsd.js";
|
|
41
|
+
import"./index-bm5xrfnx.js";
|
|
41
42
|
import"./index-rtry5xyf.js";
|
|
42
|
-
import"./index-
|
|
43
|
+
import"./index-mjn6aqqk.js";
|
|
43
44
|
import"./index-3qf1vxtb.js";
|
|
44
45
|
import"./index-n832052r.js";
|
|
45
|
-
import"./index-
|
|
46
|
-
import"./index-
|
|
47
|
-
import"./index-
|
|
48
|
-
import"./index-
|
|
49
|
-
import"./index-
|
|
50
|
-
import"./index-
|
|
46
|
+
import"./index-3axdtaf0.js";
|
|
47
|
+
import"./index-pw00xcj0.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-
|
|
54
|
-
import"./index-
|
|
54
|
+
import"./index-5qt9yf5w.js";
|
|
55
|
+
import"./index-ssx8087p.js";
|
|
55
56
|
import"./index-vzm6zre7.js";
|
|
56
57
|
import"./index-ae75rja9.js";
|
|
57
|
-
import"./index-
|
|
58
|
-
import"./index-
|
|
58
|
+
import"./index-9ttqbhvw.js";
|
|
59
|
+
import"./index-bx1wgn3a.js";
|
|
59
60
|
import"./index-7g4c7s5r.js";
|
|
60
|
-
import"./index-
|
|
61
|
-
import"./index-
|
|
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-
|
|
65
|
+
import"./index-td6xrw55.js";
|
|
65
66
|
import"./index-0mhftbpp.js";
|
|
66
67
|
import"./index-a1w58b47.js";
|
|
67
|
-
import"./index-
|
|
68
|
+
import"./index-4wc5gfgm.js";
|
|
68
69
|
import"./index-sxt7fgcw.js";
|
|
69
70
|
import"./index-bk5tah7q.js";
|
|
70
71
|
import"./index-bpmtbmy9.js";
|
|
71
72
|
import"./index-zpsr8rpc.js";
|
|
72
|
-
import"./index-
|
|
73
|
+
import"./index-76qm2c2y.js";
|
|
73
74
|
import"./index-yzjaj53h.js";
|
|
74
75
|
import"./index-zgwm4ryv.js";
|
|
75
76
|
import"./index-a76rekgs.js";
|
|
@@ -45,10 +45,10 @@ import {
|
|
|
45
45
|
shouldSkipSnapshot,
|
|
46
46
|
switchPrFeedbackTrackingCandidateAsync,
|
|
47
47
|
workspaceSnapshotMatches
|
|
48
|
-
} from "./index-
|
|
49
|
-
import"./index-
|
|
50
|
-
import"./index-
|
|
51
|
-
import"./index-
|
|
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-
|
|
12
|
+
} from "./index-nyn01yrz.js";
|
|
10
13
|
import {
|
|
11
14
|
scanDelegationFallbacksForRecovery,
|
|
12
15
|
scanDelegationsForRecovery
|
|
13
|
-
} from "./index-
|
|
14
|
-
import"./index-
|
|
15
|
-
import
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
import"./index-
|
|
19
|
-
import"./index-h439y187.js";
|
|
20
|
-
import"./index-wst6n478.js";
|
|
16
|
+
} from "./index-0xprxg95.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-
|
|
24
|
-
import"./index-
|
|
24
|
+
import"./index-5qt9yf5w.js";
|
|
25
|
+
import"./index-ssx8087p.js";
|
|
25
26
|
import"./index-vzm6zre7.js";
|
|
26
27
|
import"./index-ae75rja9.js";
|
|
27
|
-
import"./index-
|
|
28
|
-
import"./index-
|
|
28
|
+
import"./index-9ttqbhvw.js";
|
|
29
|
+
import"./index-bx1wgn3a.js";
|
|
29
30
|
import"./index-7g4c7s5r.js";
|
|
30
|
-
import"./index-
|
|
31
|
-
import"./index-
|
|
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:
|
|
48
|
+
statSync: fs.statSync,
|
|
135
49
|
removeWorktreeProvisioningOwner
|
|
136
50
|
};
|
|
137
51
|
function descriptorCoordinateMatch(descriptor, identity) {
|
|
@@ -21,70 +21,71 @@ import {
|
|
|
21
21
|
sanitizeWorktreeTaskId,
|
|
22
22
|
standardWorktreeByCallID,
|
|
23
23
|
standardWorktreeSerializationSessions
|
|
24
|
-
} from "./index-
|
|
25
|
-
import"./index-
|
|
26
|
-
import"./index-
|
|
27
|
-
import"./index-
|
|
28
|
-
import"./index-
|
|
29
|
-
import"./index-
|
|
30
|
-
import"./index-
|
|
31
|
-
import"./index-
|
|
24
|
+
} from "./index-j144fgk8.js";
|
|
25
|
+
import"./index-5400m33a.js";
|
|
26
|
+
import"./index-7h01bkm6.js";
|
|
27
|
+
import"./index-zw3hkzch.js";
|
|
28
|
+
import"./index-cgpwjctj.js";
|
|
29
|
+
import"./index-ye43mdfm.js";
|
|
30
|
+
import"./index-3p3y55xg.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-
|
|
36
|
-
import"./index-
|
|
37
|
-
import"./index-
|
|
35
|
+
import"./index-9xk97bcf.js";
|
|
36
|
+
import"./index-r1z8nrb6.js";
|
|
37
|
+
import"./index-3eh2n3dx.js";
|
|
38
38
|
import"./index-fyfbpz4f.js";
|
|
39
|
-
import"./index-
|
|
39
|
+
import"./index-gfbggp8k.js";
|
|
40
|
+
import"./index-0hgmsyfp.js";
|
|
40
41
|
import"./index-zsrtt42s.js";
|
|
41
|
-
import"./index-
|
|
42
|
-
import"./index-
|
|
43
|
-
import"./index-
|
|
42
|
+
import"./index-5bbem0ey.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-
|
|
47
|
-
import"./index-
|
|
48
|
-
import"./index-
|
|
49
|
-
import"./index-
|
|
50
|
-
import"./index-
|
|
51
|
-
import"./index-
|
|
52
|
-
import"./index-
|
|
53
|
-
import"./index-
|
|
47
|
+
import"./index-06rbdzqn.js";
|
|
48
|
+
import"./index-59fcfpkh.js";
|
|
49
|
+
import"./index-0xprxg95.js";
|
|
50
|
+
import"./index-8w1mrvbd.js";
|
|
51
|
+
import"./index-b3pmzbh1.js";
|
|
52
|
+
import"./index-2s7dvzff.js";
|
|
53
|
+
import"./index-31sqcdsd.js";
|
|
54
|
+
import"./index-bm5xrfnx.js";
|
|
54
55
|
import"./index-rtry5xyf.js";
|
|
55
56
|
import {
|
|
56
57
|
resolveWorktreeIsolationConfig
|
|
57
|
-
} from "./index-
|
|
58
|
+
} from "./index-mjn6aqqk.js";
|
|
58
59
|
import"./index-3qf1vxtb.js";
|
|
59
60
|
import"./index-n832052r.js";
|
|
60
|
-
import"./index-
|
|
61
|
-
import"./index-
|
|
62
|
-
import"./index-
|
|
63
|
-
import"./index-
|
|
64
|
-
import"./index-
|
|
65
|
-
import"./index-
|
|
61
|
+
import"./index-3axdtaf0.js";
|
|
62
|
+
import"./index-pw00xcj0.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-
|
|
69
|
-
import"./index-
|
|
69
|
+
import"./index-5qt9yf5w.js";
|
|
70
|
+
import"./index-ssx8087p.js";
|
|
70
71
|
import"./index-vzm6zre7.js";
|
|
71
72
|
import"./index-ae75rja9.js";
|
|
72
|
-
import"./index-
|
|
73
|
-
import"./index-
|
|
73
|
+
import"./index-9ttqbhvw.js";
|
|
74
|
+
import"./index-bx1wgn3a.js";
|
|
74
75
|
import"./index-7g4c7s5r.js";
|
|
75
|
-
import"./index-
|
|
76
|
-
import"./index-
|
|
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-
|
|
80
|
+
import"./index-td6xrw55.js";
|
|
80
81
|
import"./index-0mhftbpp.js";
|
|
81
82
|
import"./index-a1w58b47.js";
|
|
82
|
-
import"./index-
|
|
83
|
+
import"./index-4wc5gfgm.js";
|
|
83
84
|
import"./index-sxt7fgcw.js";
|
|
84
85
|
import"./index-bk5tah7q.js";
|
|
85
86
|
import"./index-bpmtbmy9.js";
|
|
86
87
|
import"./index-zpsr8rpc.js";
|
|
87
|
-
import"./index-
|
|
88
|
+
import"./index-76qm2c2y.js";
|
|
88
89
|
import"./index-yzjaj53h.js";
|
|
89
90
|
import"./index-zgwm4ryv.js";
|
|
90
91
|
import"./index-a76rekgs.js";
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `swarm ci` command handler (issue #2497).
|
|
3
|
+
*
|
|
4
|
+
* Advisory headless CI: evaluates a checked-out repo's authoritative gates
|
|
5
|
+
* read-only (see src/ci/evaluate.ts), renders Markdown + [SWARM_CI_JSON],
|
|
6
|
+
* and maps the run outcome to a machine exit status:
|
|
7
|
+
* 0 = every evaluated gate passed (and at least one was evaluated)
|
|
8
|
+
* 1 = gate violation / no-data / corrupt evidence / nothing to evaluate
|
|
9
|
+
* 2 = cancelled (SIGINT/SIGTERM)
|
|
10
|
+
* 3 = deadline or internal error
|
|
11
|
+
*
|
|
12
|
+
* The command must run without a TTY and without the OpenCode host
|
|
13
|
+
* (scrubbed CI environments), so it carries NO toolPolicy (neither
|
|
14
|
+
* human-only nor agent-gated). It uses `ctx.directory` — never
|
|
15
|
+
* process.cwd() — per AGENTS.md invariant 4, spawns no subprocess, and
|
|
16
|
+
* consumes no stdin.
|
|
17
|
+
*/
|
|
18
|
+
import { runAdvisoryCiRuntime } from '../ci/index.js';
|
|
19
|
+
import type { CommandContext, CommandFailure } from './registry.js';
|
|
20
|
+
export declare const DEFAULT_CI_DEADLINE_MS = 300000;
|
|
21
|
+
export interface CiSignalCancellation {
|
|
22
|
+
/** The handler invoked on SIGINT/SIGTERM; exported for unit testing the
|
|
23
|
+
* wiring without relying on platform signal delivery. */
|
|
24
|
+
handler: () => void;
|
|
25
|
+
install: () => void;
|
|
26
|
+
dispose: () => void;
|
|
27
|
+
}
|
|
28
|
+
/** Wire SIGINT/SIGTERM to the run's AbortController. Kept as a seam so the
|
|
29
|
+
* cancellation contract is unit-testable on platforms where self-signalling
|
|
30
|
+
* a native process is unreliable (Windows Git Bash; see frozen check C5's
|
|
31
|
+
* notes). */
|
|
32
|
+
export declare function createSignalCancellation(controller: AbortController, onCancelled?: () => void): CiSignalCancellation;
|
|
33
|
+
export declare function handleCiCommand(ctx: CommandContext): Promise<string | CommandFailure>;
|
|
34
|
+
/** Test seam: dependency injection over the runtime entry so handler-level
|
|
35
|
+
* diagnostic-branch tests can drive cancelled/deadline outcomes without
|
|
36
|
+
* timing or signal-delivery dependence (repo convention: DI over mock.module;
|
|
37
|
+
* restore in afterEach). */
|
|
38
|
+
export declare const _internals: {
|
|
39
|
+
runAdvisoryCiRuntime: typeof runAdvisoryCiRuntime;
|
|
40
|
+
};
|
|
@@ -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;
|
package/dist/commands/index.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ export { handleAutoProceedCommand } from './auto-proceed';
|
|
|
12
12
|
export { handleBenchmarkCommand } from './benchmark';
|
|
13
13
|
export { handleBrainstormCommand } from './brainstorm';
|
|
14
14
|
export { handleCheckpointCommand } from './checkpoint';
|
|
15
|
+
export { createSignalCancellation, DEFAULT_CI_DEADLINE_MS, handleCiCommand, } from './ci';
|
|
15
16
|
export { handleCiSimulateCommand } from './ci-simulate';
|
|
16
17
|
export { handleClarifyCommand } from './clarify';
|
|
17
18
|
export { handleCloseCommand } from './close';
|
|
@@ -788,6 +788,14 @@ export declare const COMMAND_REGISTRY: {
|
|
|
788
788
|
readonly category: "agent";
|
|
789
789
|
readonly toolPolicy: "none";
|
|
790
790
|
};
|
|
791
|
+
readonly ci: {
|
|
792
|
+
readonly handler: (ctx: CommandContext) => Promise<string | CommandFailure>;
|
|
793
|
+
readonly description: "Advisory headless CI: evaluate the repo gate/evidence state read-only with machine exit codes [--timeout-ms <n>] [--json]";
|
|
794
|
+
readonly args: "--timeout-ms <n>, --json";
|
|
795
|
+
readonly details: "Host-decoupled, read-only evaluation of the checked-out repo (#2497): per-task required gates (tri-state evidence), plan-critic approval, and evidence-quality thresholds, composed from the authoritative readers. Exits 0 only when every evaluated gate passes; 1 on any violation, no-data, corrupt evidence, or a missing plan; 2 on cancellation (SIGINT/SIGTERM); 3 on deadline/internal error. Emits a Markdown report plus a [SWARM_CI_JSON] machine block. Never writes to .swarm and cannot satisfy or bypass any gate; runs with no TTY and no OpenCode host.";
|
|
796
|
+
readonly category: "diagnostics";
|
|
797
|
+
readonly toolPolicy: "none";
|
|
798
|
+
};
|
|
791
799
|
readonly 'ci-monitor': {
|
|
792
800
|
readonly handler: (ctx: CommandContext) => CommandResult;
|
|
793
801
|
readonly description: "Drive an already-reviewed, approved PR to green and merged (monitor CI, fix, merge) [pr]";
|
|
@@ -960,7 +968,7 @@ export declare const COMMAND_REGISTRY: {
|
|
|
960
968
|
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
961
969
|
readonly description: "Clear session state while preserving plan, evidence, and knowledge";
|
|
962
970
|
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: "";
|
|
971
|
+
readonly args: "--confirm=<token> (purge dirty/live lanes)";
|
|
964
972
|
readonly category: "utility";
|
|
965
973
|
readonly toolPolicy: "restricted";
|
|
966
974
|
};
|
|
@@ -1151,7 +1159,7 @@ export declare const COMMAND_REGISTRY: {
|
|
|
1151
1159
|
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
1152
1160
|
readonly description: "Run golden Swarm memory recall evaluation fixtures";
|
|
1153
1161
|
readonly subcommandOf: "memory";
|
|
1154
|
-
readonly args: "--json, --fixtures <directory>";
|
|
1162
|
+
readonly args: "--json, --fixtures <directory>, --profiles <list>, --manifest <file>";
|
|
1155
1163
|
readonly category: "diagnostics";
|
|
1156
1164
|
readonly toolPolicy: "agent";
|
|
1157
1165
|
};
|
|
@@ -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,
|
|
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
|
-
*
|
|
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
|