opencode-swarm 7.172.4 → 7.173.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.
- package/binaries/win32-arm64/swarm-sandbox-runner.exe +0 -0
- package/binaries/win32-x64/swarm-sandbox-runner.exe +0 -0
- package/dist/background/pending-delegations.d.ts +2 -0
- package/dist/cli/{coder-settlement-mjqefsjv.js → coder-settlement-kxxmd9jt.js} +10 -10
- package/dist/cli/{config-doctor-3nxrxzqg.js → config-doctor-nzcya5zr.js} +2 -2
- package/dist/cli/{core-bebtf39m.js → core-s9a9kmcc.js} +3 -3
- package/dist/cli/{curation-policy-yep7t261.js → curation-policy-tx4kb30e.js} +4 -4
- package/dist/cli/{curator-drift-z8p6kwqg.js → curator-drift-047n8fjw.js} +4 -4
- package/dist/cli/{curator-tbzt37gq.js → curator-jkp8558s.js} +35 -35
- package/dist/cli/curator-llm-factory-dza1qtwr.js +72 -0
- package/dist/cli/{evidence-summary-service-b8wvay0a.js → evidence-summary-service-ek50h5b3.js} +14 -14
- package/dist/cli/{gate-evidence-7kqzd4b6.js → gate-evidence-8dk50ten.js} +5 -5
- package/dist/cli/guardrail-explain-s29vngen.js +73 -0
- package/dist/cli/{guardrail-log-cpb01m4a.js → guardrail-log-hq5xpm7g.js} +6 -6
- package/dist/cli/{guardrail-reset-226tvhv4.js → guardrail-reset-gttz1y0h.js} +35 -35
- package/dist/cli/{hive-promoter-nz5dk7cz.js → hive-promoter-44p7ng87.js} +35 -35
- package/dist/cli/{index-j7zrvqnf.js → index-0dfhahxm.js} +2 -2
- package/dist/cli/{index-5tjd3cne.js → index-18b9snn6.js} +5 -5
- package/dist/cli/{index-zfzbn9a7.js → index-1xfxzjq9.js} +2 -2
- package/dist/cli/{index-yxegcfy5.js → index-43dmpa9w.js} +1 -1
- package/dist/cli/{index-gqkfha6x.js → index-53c0ajk4.js} +1 -1
- package/dist/cli/{index-68bp6sak.js → index-62pcs7jg.js} +2 -2
- package/dist/cli/{index-zpksgw8w.js → index-6z404f7y.js} +4 -4
- package/dist/cli/{index-rxakec16.js → index-7gkdxs00.js} +6 -6
- package/dist/cli/{index-d21qcjr6.js → index-90qbc4rp.js} +1 -1
- package/dist/cli/{index-8p30wyx0.js → index-bsnpv4xd.js} +1 -1
- package/dist/cli/{index-bwnf1e4d.js → index-c5nrcde1.js} +37 -37
- package/dist/cli/{index-her1kqcr.js → index-cm0339fe.js} +4 -4
- package/dist/cli/{index-jg2s11sg.js → index-dktpzjy9.js} +1 -1
- package/dist/cli/{index-bbhgnn4j.js → index-dx9pz5n6.js} +7 -7
- package/dist/cli/{index-2n16srdc.js → index-evf5r7bk.js} +1 -1
- package/dist/cli/{index-y6bqbe76.js → index-fnx0jzf7.js} +1 -1
- package/dist/cli/{index-y1qc2cpp.js → index-gwtb07gc.js} +3 -3
- package/dist/cli/{index-3rkjybes.js → index-gwz9p53s.js} +2 -2
- package/dist/cli/{index-9h6zhnk0.js → index-hhws1xkc.js} +1 -1
- package/dist/cli/{index-szezqd2a.js → index-j0vvq8se.js} +7 -7
- package/dist/cli/{index-01mjyjdt.js → index-kdyvk541.js} +1 -1
- package/dist/cli/{index-efbdfkw9.js → index-m51cmzxt.js} +1 -1
- package/dist/cli/{index-16rwxf4m.js → index-m53v442a.js} +35 -35
- package/dist/cli/{index-d9g9stnf.js → index-mjqjbq94.js} +10 -10
- package/dist/cli/{index-kerhh5q4.js → index-mt8pbzda.js} +1 -1
- package/dist/cli/{index-a1187fx5.js → index-ndvgkxpf.js} +2 -2
- package/dist/cli/{index-1c119trs.js → index-p36b6t7w.js} +47 -23
- package/dist/cli/{index-1c1n8aax.js → index-pjw95rxm.js} +120 -6
- package/dist/cli/{index-2negdnww.js → index-psb9rxt8.js} +5 -5
- package/dist/cli/{index-5qfqwbvg.js → index-pynk60z5.js} +7 -7
- package/dist/cli/{index-2qv69ydg.js → index-r8g2meas.js} +3 -3
- package/dist/cli/{index-1t4v24tw.js → index-r93ptj7j.js} +1 -1
- package/dist/cli/{index-kt8yn94y.js → index-samx6zgc.js} +1 -1
- package/dist/cli/{index-36143n94.js → index-vwnd2szd.js} +7 -6
- package/dist/cli/{index-fn7ny88p.js → index-wf3s2t1t.js} +1975 -1828
- package/dist/cli/{index-j8z3t7dv.js → index-wr4m11x4.js} +1 -1
- package/dist/cli/{index-pkgshf8r.js → index-yeehyat1.js} +2 -2
- package/dist/cli/{index-ksjpc8s8.js → index-yzwb6ja4.js} +1 -1
- package/dist/cli/{index-qzptb0gf.js → index-z35ynvj4.js} +1 -1
- package/dist/cli/{index-b395nw9b.js → index-za1kvsa0.js} +2 -2
- package/dist/cli/index.js +36 -36
- package/dist/cli/{knowledge-escalator-qjvkjkhw.js → knowledge-escalator-ttp4x29h.js} +11 -11
- package/dist/cli/{knowledge-events-ctn3yfqx.js → knowledge-events-dx9mjgqb.js} +9 -9
- package/dist/cli/{knowledge-link-3qypq7bm.js → knowledge-link-f7bhq7cx.js} +3 -3
- package/dist/cli/{knowledge-store-7js414b2.js → knowledge-store-6sq9rxma.js} +4 -4
- package/dist/cli/{knowledge-validator-f5xhqqxr.js → knowledge-validator-h49dkw2z.js} +6 -6
- package/dist/cli/{mcp-wzvpxtqf.js → mcp-kd7w2572.js} +1 -1
- package/dist/cli/{pending-delegations-avmzmj7x.js → pending-delegations-n4qyymj2.js} +10 -10
- package/dist/cli/{pr-subscriptions-k33rz8ea.js → pr-subscriptions-n8vkm5mv.js} +10 -10
- package/dist/cli/{pr-workflow-gate-x91jrfaz.js → pr-workflow-gate-j67jhtzt.js} +35 -35
- package/dist/cli/{runner-2qypr9b5.js → runner-58k70bnr.js} +4 -4
- package/dist/cli/{scan-cursor-kmp98vk2.js → scan-cursor-sz8ncpw2.js} +5 -5
- package/dist/cli/{schema-n50qbvmt.js → schema-70c0yw8p.js} +1 -1
- package/dist/cli/{scope-persistence-nrj3q5sk.js → scope-persistence-0dzyv0vt.js} +13 -13
- package/dist/cli/{server-zs1r7z1g.js → server-njmemwbm.js} +35 -35
- package/dist/cli/{skill-generator-7f0jayyp.js → skill-generator-kf5yqmvk.js} +13 -13
- package/dist/cli/{snapshot-coordination-init-6tz602wz.js → snapshot-coordination-init-ezf5xqy2.js} +35 -35
- package/dist/cli/{workspace-snapshot-e63mg204.js → workspace-snapshot-62be4368.js} +3 -3
- package/dist/cli/{worktree-collision-ownership-hqk8gc0f.js → worktree-collision-ownership-fe176vyv.js} +11 -11
- package/dist/cli/{worktree-isolation-8yh97cgh.js → worktree-isolation-c0b1h3f1.js} +35 -35
- package/dist/commands/close/orchestrator.d.ts +34 -0
- package/dist/commands/destructive-purge.d.ts +15 -0
- package/dist/hooks/delegation-gate/worktree-isolation.d.ts +18 -3
- package/dist/hooks/guardrails/index.d.ts +2 -0
- package/dist/hooks/guardrails/stage-a-route.d.ts +45 -0
- package/dist/hooks/guardrails/tool-before.d.ts +10 -0
- package/dist/index.js +251 -246
- package/dist/turbo/lean/merge-back.d.ts +1 -1
- package/dist/workflow/coder-settlement.d.ts +2 -0
- package/dist/worktree/merge.d.ts +36 -9
- package/dist/worktree/types.d.ts +8 -1
- package/package.json +1 -1
- package/dist/cli/curator-llm-factory-pchm0j1e.js +0 -72
- package/dist/cli/guardrail-explain-dmyf8vc9.js +0 -73
|
@@ -22,66 +22,66 @@ import {
|
|
|
22
22
|
resolveFallbackModel,
|
|
23
23
|
resolvePrimaryAgentNames,
|
|
24
24
|
stripSwarmPrefix
|
|
25
|
-
} from "./index-
|
|
25
|
+
} from "./index-wf3s2t1t.js";
|
|
26
26
|
import"./index-hnvmj9wx.js";
|
|
27
|
-
import"./index-
|
|
28
|
-
import"./index-
|
|
29
|
-
import"./index-
|
|
30
|
-
import"./index-
|
|
31
|
-
import"./index-
|
|
32
|
-
import"./index-
|
|
27
|
+
import"./index-hhws1xkc.js";
|
|
28
|
+
import"./index-62pcs7jg.js";
|
|
29
|
+
import"./index-wr4m11x4.js";
|
|
30
|
+
import"./index-r93ptj7j.js";
|
|
31
|
+
import"./index-mjqjbq94.js";
|
|
32
|
+
import"./index-z35ynvj4.js";
|
|
33
33
|
import"./index-txdagbh7.js";
|
|
34
34
|
import"./index-z2deqhpp.js";
|
|
35
35
|
import"./index-fpbcxykc.js";
|
|
36
|
-
import"./index-
|
|
37
|
-
import"./index-
|
|
38
|
-
import"./index-
|
|
36
|
+
import"./index-6z404f7y.js";
|
|
37
|
+
import"./index-psb9rxt8.js";
|
|
38
|
+
import"./index-1xfxzjq9.js";
|
|
39
39
|
import {
|
|
40
40
|
createExplorerAgent
|
|
41
41
|
} from "./index-fyfbpz4f.js";
|
|
42
|
-
import"./index-
|
|
42
|
+
import"./index-7gkdxs00.js";
|
|
43
43
|
import"./index-0hgmsyfp.js";
|
|
44
44
|
import"./index-zsrtt42s.js";
|
|
45
|
-
import"./index-
|
|
46
|
-
import"./index-
|
|
47
|
-
import"./index-
|
|
45
|
+
import"./index-p36b6t7w.js";
|
|
46
|
+
import"./index-ndvgkxpf.js";
|
|
47
|
+
import"./index-0dfhahxm.js";
|
|
48
48
|
import"./index-pt7h91zc.js";
|
|
49
49
|
import"./index-q7sjgr1y.js";
|
|
50
|
-
import"./index-
|
|
51
|
-
import"./index-
|
|
52
|
-
import"./index-
|
|
53
|
-
import"./index-
|
|
54
|
-
import"./index-
|
|
50
|
+
import"./index-pjw95rxm.js";
|
|
51
|
+
import"./index-gwtb07gc.js";
|
|
52
|
+
import"./index-vwnd2szd.js";
|
|
53
|
+
import"./index-pynk60z5.js";
|
|
54
|
+
import"./index-evf5r7bk.js";
|
|
55
55
|
import"./index-2s7dvzff.js";
|
|
56
|
-
import"./index-
|
|
57
|
-
import"./index-
|
|
56
|
+
import"./index-cm0339fe.js";
|
|
57
|
+
import"./index-m51cmzxt.js";
|
|
58
58
|
import"./index-rtry5xyf.js";
|
|
59
|
-
import"./index-
|
|
59
|
+
import"./index-gwz9p53s.js";
|
|
60
60
|
import"./index-frcemc0b.js";
|
|
61
61
|
import"./index-wrt875kh.js";
|
|
62
|
-
import"./index-
|
|
63
|
-
import"./index-
|
|
64
|
-
import"./index-
|
|
65
|
-
import"./index-
|
|
66
|
-
import"./index-
|
|
67
|
-
import"./index-
|
|
62
|
+
import"./index-dx9pz5n6.js";
|
|
63
|
+
import"./index-18b9snn6.js";
|
|
64
|
+
import"./index-mt8pbzda.js";
|
|
65
|
+
import"./index-za1kvsa0.js";
|
|
66
|
+
import"./index-fnx0jzf7.js";
|
|
67
|
+
import"./index-dktpzjy9.js";
|
|
68
68
|
import"./index-rdm3px0g.js";
|
|
69
69
|
import"./index-ry16d01s.js";
|
|
70
|
-
import"./index-
|
|
71
|
-
import"./index-
|
|
70
|
+
import"./index-43dmpa9w.js";
|
|
71
|
+
import"./index-j0vvq8se.js";
|
|
72
72
|
import"./index-vzm6zre7.js";
|
|
73
73
|
import"./index-ae75rja9.js";
|
|
74
|
-
import"./index-
|
|
75
|
-
import"./index-
|
|
74
|
+
import"./index-yzwb6ja4.js";
|
|
75
|
+
import"./index-kdyvk541.js";
|
|
76
76
|
import"./index-7g4c7s5r.js";
|
|
77
77
|
import"./index-jmn35na4.js";
|
|
78
|
-
import"./index-
|
|
78
|
+
import"./index-bsnpv4xd.js";
|
|
79
79
|
import"./index-1xnse449.js";
|
|
80
80
|
import"./index-c1ggtmpm.js";
|
|
81
|
-
import"./index-
|
|
81
|
+
import"./index-53c0ajk4.js";
|
|
82
82
|
import"./index-0mhftbpp.js";
|
|
83
83
|
import"./index-a1w58b47.js";
|
|
84
|
-
import"./index-
|
|
84
|
+
import"./index-90qbc4rp.js";
|
|
85
85
|
import"./index-5frh43fj.js";
|
|
86
86
|
import"./index-bk5tah7q.js";
|
|
87
87
|
import"./index-gknz3bv1.js";
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
EvaluationRunV1Schema,
|
|
4
4
|
GateAuditResultV1Schema,
|
|
5
5
|
getProtectedEvaluationRunIds
|
|
6
|
-
} from "./index-
|
|
6
|
+
} from "./index-z35ynvj4.js";
|
|
7
7
|
import {
|
|
8
8
|
readEffectiveSpecSync
|
|
9
9
|
} from "./index-z2deqhpp.js";
|
|
@@ -23,13 +23,13 @@ import {
|
|
|
23
23
|
readTaskEvidence,
|
|
24
24
|
readTaskEvidenceRaw,
|
|
25
25
|
sanitizeTaskId
|
|
26
|
-
} from "./index-
|
|
26
|
+
} from "./index-pjw95rxm.js";
|
|
27
27
|
import {
|
|
28
28
|
estimateCharsForTokens,
|
|
29
29
|
estimateTokens,
|
|
30
30
|
readSwarmFileAsync,
|
|
31
31
|
validateSwarmPath
|
|
32
|
-
} from "./index-
|
|
32
|
+
} from "./index-evf5r7bk.js";
|
|
33
33
|
import {
|
|
34
34
|
bunHash,
|
|
35
35
|
bunWrite,
|
|
@@ -58,10 +58,10 @@ import {
|
|
|
58
58
|
replayFromLedgerWithStatus,
|
|
59
59
|
takeSnapshotEvent,
|
|
60
60
|
takeSnapshotWithRetry
|
|
61
|
-
} from "./index-
|
|
61
|
+
} from "./index-18b9snn6.js";
|
|
62
62
|
import {
|
|
63
63
|
appendCoreEventSync
|
|
64
|
-
} from "./index-
|
|
64
|
+
} from "./index-mt8pbzda.js";
|
|
65
65
|
import {
|
|
66
66
|
derivePlanId,
|
|
67
67
|
derivePlanIdentityHash,
|
|
@@ -69,18 +69,18 @@ import {
|
|
|
69
69
|
importCoordinationOnce,
|
|
70
70
|
listCoordinationStates,
|
|
71
71
|
transitionCoordinationState
|
|
72
|
-
} from "./index-
|
|
72
|
+
} from "./index-fnx0jzf7.js";
|
|
73
73
|
import {
|
|
74
74
|
DURABILITY_CLASSES,
|
|
75
75
|
getProjectDb,
|
|
76
76
|
projectDbExists,
|
|
77
77
|
withDurabilityClass
|
|
78
|
-
} from "./index-
|
|
78
|
+
} from "./index-dktpzjy9.js";
|
|
79
79
|
import {
|
|
80
80
|
assertProjectRoot,
|
|
81
81
|
tryAcquireLock,
|
|
82
82
|
withEvidenceLock
|
|
83
|
-
} from "./index-
|
|
83
|
+
} from "./index-kdyvk541.js";
|
|
84
84
|
import {
|
|
85
85
|
emit
|
|
86
86
|
} from "./index-jmn35na4.js";
|
|
@@ -88,13 +88,13 @@ import {
|
|
|
88
88
|
atomicWriteSwarmFileSync,
|
|
89
89
|
invalidateCachedArtifact,
|
|
90
90
|
readCachedParsedFile
|
|
91
|
-
} from "./index-
|
|
91
|
+
} from "./index-bsnpv4xd.js";
|
|
92
92
|
import {
|
|
93
93
|
canonicalRootKeyFresh
|
|
94
94
|
} from "./index-1xnse449.js";
|
|
95
95
|
import {
|
|
96
96
|
PlanSchema
|
|
97
|
-
} from "./index-
|
|
97
|
+
} from "./index-53c0ajk4.js";
|
|
98
98
|
import {
|
|
99
99
|
GIT_BINARY_ENV_VAR,
|
|
100
100
|
describeGitResolution,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
validateSwarmPath
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-evf5r7bk.js";
|
|
5
5
|
import {
|
|
6
6
|
bunSpawn
|
|
7
7
|
} from "./index-2s7dvzff.js";
|
|
8
8
|
import {
|
|
9
9
|
atomicWriteSwarmFile
|
|
10
|
-
} from "./index-
|
|
10
|
+
} from "./index-bsnpv4xd.js";
|
|
11
11
|
import {
|
|
12
12
|
canonicalRootKey,
|
|
13
13
|
sameProjectRoot
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
import {
|
|
3
3
|
captureWorkspaceSnapshotAsync,
|
|
4
4
|
changedFilesSinceSnapshotAsync
|
|
5
|
-
} from "./index-
|
|
5
|
+
} from "./index-ndvgkxpf.js";
|
|
6
6
|
import {
|
|
7
7
|
removeWorktreeProvisioningOwner
|
|
8
|
-
} from "./index-
|
|
8
|
+
} from "./index-0dfhahxm.js";
|
|
9
9
|
import {
|
|
10
10
|
SOURCE_WORKTREE_GONE_STAGE,
|
|
11
11
|
ensureTaskGateRequirementsReceiptForSettledTransition,
|
|
@@ -14,16 +14,16 @@ import {
|
|
|
14
14
|
reconcileLandedMerge,
|
|
15
15
|
withTaskEvidenceTransaction,
|
|
16
16
|
writeWorkflowWalFile
|
|
17
|
-
} from "./index-
|
|
17
|
+
} from "./index-pjw95rxm.js";
|
|
18
18
|
import {
|
|
19
19
|
validateSwarmPath
|
|
20
|
-
} from "./index-
|
|
20
|
+
} from "./index-evf5r7bk.js";
|
|
21
21
|
import {
|
|
22
22
|
appendCoreEventSync
|
|
23
|
-
} from "./index-
|
|
23
|
+
} from "./index-mt8pbzda.js";
|
|
24
24
|
import {
|
|
25
25
|
tryAcquireLock
|
|
26
|
-
} from "./index-
|
|
26
|
+
} from "./index-kdyvk541.js";
|
|
27
27
|
import {
|
|
28
28
|
canonicalRootKeyFresh
|
|
29
29
|
} from "./index-1xnse449.js";
|
|
@@ -191,7 +191,12 @@ function settlementTransitionEvent(wal) {
|
|
|
191
191
|
transitionId: wal.transitionId
|
|
192
192
|
};
|
|
193
193
|
}
|
|
194
|
-
|
|
194
|
+
function withLandedUnstaged(worktree, landedUnstaged) {
|
|
195
|
+
if (worktree === undefined || landedUnstaged === undefined)
|
|
196
|
+
return worktree;
|
|
197
|
+
return { ...worktree, landedUnstaged };
|
|
198
|
+
}
|
|
199
|
+
async function commitPrepared(directory, wal, options) {
|
|
195
200
|
return withTaskEvidenceTransaction(directory, wal.taskId, wal.actor, async (transaction) => {
|
|
196
201
|
let lockedWal = await readWal(walPath(directory, wal.taskId), wal.taskId);
|
|
197
202
|
if (lockedWal === null)
|
|
@@ -211,7 +216,8 @@ async function commitPrepared(directory, wal) {
|
|
|
211
216
|
lockedWal = {
|
|
212
217
|
...lockedWal,
|
|
213
218
|
state: "COMMITTED",
|
|
214
|
-
cleanupComplete: lockedWal.worktree === undefined
|
|
219
|
+
cleanupComplete: lockedWal.worktree === undefined,
|
|
220
|
+
worktree: withLandedUnstaged(lockedWal.worktree, options?.landedUnstaged)
|
|
215
221
|
};
|
|
216
222
|
await writeWal(walPath(directory, wal.taskId), lockedWal);
|
|
217
223
|
await appendSettlementEvent(directory, "settled", lockedWal, {
|
|
@@ -231,7 +237,8 @@ async function commitPrepared(directory, wal) {
|
|
|
231
237
|
lockedWal = {
|
|
232
238
|
...lockedWal,
|
|
233
239
|
state: "COMMITTED",
|
|
234
|
-
cleanupComplete: lockedWal.worktree === undefined
|
|
240
|
+
cleanupComplete: lockedWal.worktree === undefined,
|
|
241
|
+
worktree: withLandedUnstaged(lockedWal.worktree, options?.landedUnstaged)
|
|
235
242
|
};
|
|
236
243
|
await writeWal(walPath(directory, wal.taskId), lockedWal);
|
|
237
244
|
await appendSettlementEvent(directory, "settled", lockedWal);
|
|
@@ -320,7 +327,9 @@ async function settleCoderDispatch(options) {
|
|
|
320
327
|
if (wal.accepted !== options.accepted || wal.testEngineerExempt !== options.testEngineerExempt || wal.settlementFailed !== (options.settlementFailed === true)) {
|
|
321
328
|
throw new Error("CODER_SETTLEMENT_IDEMPOTENCY_CONFLICT");
|
|
322
329
|
}
|
|
323
|
-
return commitPrepared(options.directory, wal
|
|
330
|
+
return commitPrepared(options.directory, wal, {
|
|
331
|
+
landedUnstaged: options.landedUnstaged
|
|
332
|
+
});
|
|
324
333
|
}
|
|
325
334
|
if (wal.state === "ABORTED") {
|
|
326
335
|
throw new Error("CODER_SETTLEMENT_IDEMPOTENCY_CONFLICT");
|
|
@@ -339,7 +348,9 @@ async function settleCoderDispatch(options) {
|
|
|
339
348
|
await writeWal(filePath, prepared);
|
|
340
349
|
liveDispatches.delete(dispatchKey(options.directory, options.taskId, options.transitionId));
|
|
341
350
|
try {
|
|
342
|
-
return await commitPrepared(options.directory, prepared
|
|
351
|
+
return await commitPrepared(options.directory, prepared, {
|
|
352
|
+
landedUnstaged: options.landedUnstaged
|
|
353
|
+
});
|
|
343
354
|
} finally {
|
|
344
355
|
const finalWal = await readWal(filePath, options.taskId);
|
|
345
356
|
if (finalWal !== null && finalWal.state === "COMMITTED") {
|
|
@@ -482,14 +493,15 @@ function probeBranchExists(directory, branchName) {
|
|
|
482
493
|
return false;
|
|
483
494
|
throw new Error(`CODER_SETTLEMENT_CLEANUP_UNCERTAIN: git show-ref exited with status ${String(result.status)}`);
|
|
484
495
|
}
|
|
485
|
-
async function cleanupRecoveredWorktree(directory, descriptor) {
|
|
496
|
+
async function cleanupRecoveredWorktree(directory, descriptor, options) {
|
|
497
|
+
const retainBranch = options?.retainBranch ?? descriptor.landedUnstaged === true;
|
|
486
498
|
const branchExists = () => _internals.branchExists(directory, descriptor.branchName);
|
|
487
499
|
const hasResidue = existsSync(descriptor.worktreePath) || branchExists();
|
|
488
500
|
const {
|
|
489
501
|
awaitingMergeByCallID,
|
|
490
502
|
cleanupStandardWorktreeForCallId,
|
|
491
503
|
standardWorktreeByCallID
|
|
492
|
-
} = await import("./worktree-isolation-
|
|
504
|
+
} = await import("./worktree-isolation-c0b1h3f1.js");
|
|
493
505
|
standardWorktreeByCallID.delete(descriptor.callID);
|
|
494
506
|
if (hasResidue)
|
|
495
507
|
awaitingMergeByCallID.set(descriptor.callID, {
|
|
@@ -503,9 +515,9 @@ async function cleanupRecoveredWorktree(directory, descriptor) {
|
|
|
503
515
|
queuedAt: Date.now()
|
|
504
516
|
});
|
|
505
517
|
if (hasResidue) {
|
|
506
|
-
await cleanupStandardWorktreeForCallId(descriptor.callID, "success", directory, descriptor.worktreeDir ?? undefined);
|
|
518
|
+
await cleanupStandardWorktreeForCallId(descriptor.callID, "success", directory, descriptor.worktreeDir ?? undefined, retainBranch ? { retainBranch: true } : undefined);
|
|
507
519
|
}
|
|
508
|
-
if (existsSync(descriptor.worktreePath) || branchExists()) {
|
|
520
|
+
if (existsSync(descriptor.worktreePath) || branchExists() && !retainBranch) {
|
|
509
521
|
throw new Error("CODER_SETTLEMENT_WORKTREE_CLEANUP_UNVERIFIED");
|
|
510
522
|
}
|
|
511
523
|
const provisioningOwner = descriptor.provisioningOwner ?? (descriptor.reservationId !== undefined && descriptor.generation !== undefined ? {
|
|
@@ -588,6 +600,7 @@ async function recoverCoderSettlement(directory, taskId) {
|
|
|
588
600
|
if (wal.mergeProvenance) {
|
|
589
601
|
const landed = await reconcileLandedMerge(directory, wal.mergeProvenance);
|
|
590
602
|
if (landed.landed) {
|
|
603
|
+
const landedUnstaged = landed.method === "worktree-match";
|
|
591
604
|
wal = {
|
|
592
605
|
...wal,
|
|
593
606
|
state: "PREPARED",
|
|
@@ -596,11 +609,18 @@ async function recoverCoderSettlement(directory, taskId) {
|
|
|
596
609
|
testEngineerExempt: isMarkdownOnlyTaskChange(wal.context.declaredFiles, observed2)
|
|
597
610
|
};
|
|
598
611
|
await writeWal(filePath, wal);
|
|
599
|
-
const committed2 = await commitPrepared(directory, wal
|
|
600
|
-
|
|
612
|
+
const committed2 = await commitPrepared(directory, wal, {
|
|
613
|
+
landedUnstaged
|
|
614
|
+
});
|
|
615
|
+
await cleanupRecoveredWorktree(directory, worktree, {
|
|
616
|
+
retainBranch: landedUnstaged
|
|
617
|
+
});
|
|
618
|
+
const reconciledWal = await readWal(filePath, taskId);
|
|
619
|
+
if (reconciledWal === null) {
|
|
620
|
+
throw new Error("CODER_SETTLEMENT_WAL_MISSING");
|
|
621
|
+
}
|
|
601
622
|
await writeWal(filePath, {
|
|
602
|
-
...
|
|
603
|
-
state: "COMMITTED",
|
|
623
|
+
...reconciledWal,
|
|
604
624
|
cleanupComplete: true
|
|
605
625
|
});
|
|
606
626
|
return committed2;
|
|
@@ -613,7 +633,7 @@ async function recoverCoderSettlement(directory, taskId) {
|
|
|
613
633
|
awaitingMergeByCallID,
|
|
614
634
|
finishStandardWorktreeDispatch,
|
|
615
635
|
standardWorktreeByCallID
|
|
616
|
-
} = await import("./worktree-isolation-
|
|
636
|
+
} = await import("./worktree-isolation-c0b1h3f1.js");
|
|
617
637
|
const descriptor = wal.worktree;
|
|
618
638
|
const reconstructedDispatch = {
|
|
619
639
|
callID: descriptor.callID,
|
|
@@ -654,7 +674,7 @@ async function recoverCoderSettlement(directory, taskId) {
|
|
|
654
674
|
};
|
|
655
675
|
await writeWal(filePath, wal);
|
|
656
676
|
},
|
|
657
|
-
onMerged: async () => {
|
|
677
|
+
onMerged: async (mergedResult) => {
|
|
658
678
|
wal = {
|
|
659
679
|
...wal,
|
|
660
680
|
state: "PREPARED",
|
|
@@ -662,7 +682,9 @@ async function recoverCoderSettlement(directory, taskId) {
|
|
|
662
682
|
testEngineerExempt: isMarkdownOnlyTaskChange(wal.context.declaredFiles, observed2)
|
|
663
683
|
};
|
|
664
684
|
await writeWal(filePath, wal);
|
|
665
|
-
recovered = await commitPrepared(directory, wal
|
|
685
|
+
recovered = await commitPrepared(directory, wal, {
|
|
686
|
+
landedUnstaged: mergedResult.strategy === "squash-unstaged"
|
|
687
|
+
});
|
|
666
688
|
}
|
|
667
689
|
});
|
|
668
690
|
if (mergeResult.outcome !== "merged" || recovered === null) {
|
|
@@ -671,7 +693,9 @@ async function recoverCoderSettlement(directory, taskId) {
|
|
|
671
693
|
}
|
|
672
694
|
throw new Error(`CODER_SETTLEMENT_MERGE_RECOVERY_REQUIRED: transition ${wal.transitionId} for task ${taskId} worktree merge-back did not reach merged (${filePath}, state ${wal.state}, outcome ${mergeResult.outcome}${mergeResult.outcome === "failed" && mergeResult.message ? `: ${mergeResult.message}` : ""}). Run /swarm recover ${taskId} (or /swarm reset-session), then retry; do not remove the WAL by hand.`);
|
|
673
695
|
}
|
|
674
|
-
await cleanupRecoveredWorktree(directory, descriptor
|
|
696
|
+
await cleanupRecoveredWorktree(directory, descriptor, {
|
|
697
|
+
retainBranch: mergeResult.strategy === "squash-unstaged"
|
|
698
|
+
});
|
|
675
699
|
const committedWal = await readWal(filePath, taskId);
|
|
676
700
|
if (committedWal === null) {
|
|
677
701
|
throw new Error("CODER_SETTLEMENT_WAL_MISSING");
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
import {
|
|
3
3
|
autoCommitDirty,
|
|
4
4
|
cleanUntrackedFiles
|
|
5
|
-
} from "./index-
|
|
5
|
+
} from "./index-gwtb07gc.js";
|
|
6
6
|
import {
|
|
7
7
|
validateSwarmPath
|
|
8
|
-
} from "./index-
|
|
8
|
+
} from "./index-evf5r7bk.js";
|
|
9
9
|
import {
|
|
10
10
|
bunSpawn,
|
|
11
11
|
classifySpawnFailure
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
atomicWriteFile,
|
|
16
16
|
taskEvidencePath,
|
|
17
17
|
withTaskEvidenceLock
|
|
18
|
-
} from "./index-
|
|
18
|
+
} from "./index-kdyvk541.js";
|
|
19
19
|
import {
|
|
20
20
|
telemetry
|
|
21
21
|
} from "./index-jmn35na4.js";
|
|
@@ -476,6 +476,62 @@ function parseConflictFiles(output) {
|
|
|
476
476
|
return files;
|
|
477
477
|
}
|
|
478
478
|
var GIT_OBJECT_ID_PATTERN = /^[0-9a-f]{40}$|^[0-9a-f]{64}$/;
|
|
479
|
+
async function matchesSourceHeadWorkingTree(primaryDir, sourceHead) {
|
|
480
|
+
const mergeBase = await runGit(["merge-base", "HEAD", sourceHead], primaryDir);
|
|
481
|
+
if (mergeBase.exitCode !== 0) {
|
|
482
|
+
return {
|
|
483
|
+
landed: false,
|
|
484
|
+
error: mergeBase.stderr.trim() || `git merge-base exited ${mergeBase.exitCode}`
|
|
485
|
+
};
|
|
486
|
+
}
|
|
487
|
+
const incoming = await runGit([
|
|
488
|
+
"diff",
|
|
489
|
+
"--name-status",
|
|
490
|
+
"--no-renames",
|
|
491
|
+
mergeBase.stdout.trim(),
|
|
492
|
+
sourceHead,
|
|
493
|
+
"--"
|
|
494
|
+
], primaryDir);
|
|
495
|
+
if (incoming.exitCode !== 0) {
|
|
496
|
+
return {
|
|
497
|
+
landed: false,
|
|
498
|
+
error: incoming.stderr.trim() || incoming.stdout.trim() || `git diff exited ${incoming.exitCode}`
|
|
499
|
+
};
|
|
500
|
+
}
|
|
501
|
+
for (const line of incoming.stdout.split(`
|
|
502
|
+
`)) {
|
|
503
|
+
if (!line)
|
|
504
|
+
continue;
|
|
505
|
+
const tabIndex = line.indexOf("\t");
|
|
506
|
+
if (tabIndex < 0)
|
|
507
|
+
continue;
|
|
508
|
+
const status = line.slice(0, tabIndex);
|
|
509
|
+
const filePath = line.slice(tabIndex + 1);
|
|
510
|
+
if (filePath.startsWith('"'))
|
|
511
|
+
return { landed: false };
|
|
512
|
+
if (status === "A") {
|
|
513
|
+
const worktreePath = path3.join(primaryDir, filePath);
|
|
514
|
+
if (!fs3.existsSync(worktreePath))
|
|
515
|
+
return { landed: false };
|
|
516
|
+
const expected = await runGit(["rev-parse", `${sourceHead}:${filePath}`], primaryDir);
|
|
517
|
+
const actual = await runGit(["hash-object", "--", filePath], primaryDir);
|
|
518
|
+
if (expected.exitCode !== 0 || actual.exitCode !== 0) {
|
|
519
|
+
return {
|
|
520
|
+
landed: false,
|
|
521
|
+
error: expected.stderr.trim() || actual.stderr.trim() || `git content probe exited ${expected.exitCode}/${actual.exitCode}`
|
|
522
|
+
};
|
|
523
|
+
}
|
|
524
|
+
if (actual.stdout.trim() !== expected.stdout.trim()) {
|
|
525
|
+
return { landed: false };
|
|
526
|
+
}
|
|
527
|
+
continue;
|
|
528
|
+
}
|
|
529
|
+
const diff = await runGit(["diff", "--quiet", sourceHead, "--", filePath], primaryDir);
|
|
530
|
+
if (diff.exitCode !== 0)
|
|
531
|
+
return { landed: false };
|
|
532
|
+
}
|
|
533
|
+
return { landed: true, method: "worktree-match" };
|
|
534
|
+
}
|
|
479
535
|
function abortArgsForStrategy(strategy) {
|
|
480
536
|
return strategy === "rebase" ? ["rebase", "--abort"] : strategy === "cherry-pick" ? ["cherry-pick", "--abort"] : ["merge", "--abort"];
|
|
481
537
|
}
|
|
@@ -764,6 +820,58 @@ async function mergeLaneBranch(primaryDir, branchName, strategy) {
|
|
|
764
820
|
case "merge":
|
|
765
821
|
result = await runGit(["merge", "--no-edit", branchName], primaryDir);
|
|
766
822
|
break;
|
|
823
|
+
case "squash-unstaged": {
|
|
824
|
+
const mergeBaseResult = await runGit(["merge-base", "HEAD", branchName], primaryDir);
|
|
825
|
+
const mergeBase = mergeBaseResult.stdout.trim();
|
|
826
|
+
if (mergeBaseResult.exitCode !== 0 || !GIT_OBJECT_ID_PATTERN.test(mergeBase)) {
|
|
827
|
+
return {
|
|
828
|
+
error: `Unable to determine merge base for squash-unstaged landing of ${branchName}`
|
|
829
|
+
};
|
|
830
|
+
}
|
|
831
|
+
const incomingResult = await runGit([
|
|
832
|
+
"diff",
|
|
833
|
+
"--name-status",
|
|
834
|
+
"-z",
|
|
835
|
+
"--find-renames",
|
|
836
|
+
`${mergeBase}..${branchName}`
|
|
837
|
+
], primaryDir);
|
|
838
|
+
if (incomingResult.exitCode !== 0) {
|
|
839
|
+
return {
|
|
840
|
+
error: `Unable to enumerate incoming paths for squash-unstaged landing of ${branchName}`
|
|
841
|
+
};
|
|
842
|
+
}
|
|
843
|
+
const parsedIncoming = parseIncomingPaths(incomingResult.stdout, currentPathCasePolicy());
|
|
844
|
+
if ("error" in parsedIncoming || parsedIncoming.paths.size === 0) {
|
|
845
|
+
return {
|
|
846
|
+
error: `No parsable incoming paths for squash-unstaged landing of ${branchName}`
|
|
847
|
+
};
|
|
848
|
+
}
|
|
849
|
+
const incomingPaths = [...parsedIncoming.paths.values()];
|
|
850
|
+
const squashResult = await runGit(["merge", "--squash", "--no-commit", branchName], primaryDir);
|
|
851
|
+
if (squashResult.exitCode !== 0) {
|
|
852
|
+
const combined = `${squashResult.stderr}
|
|
853
|
+
${squashResult.stdout}`;
|
|
854
|
+
const restore = await runGit(["checkout", "-q", "HEAD", "--", ...incomingPaths], primaryDir);
|
|
855
|
+
if (/CONFLICT/i.test(combined)) {
|
|
856
|
+
return {
|
|
857
|
+
conflict: true,
|
|
858
|
+
files: parseConflictFiles(combined),
|
|
859
|
+
message: squashResult.stderr.trim() || squashResult.stdout.trim() || "squash merge reported a conflict"
|
|
860
|
+
};
|
|
861
|
+
}
|
|
862
|
+
if (restore.exitCode !== 0) {
|
|
863
|
+
advisoryWarn(`[worktree] mergeLaneBranch: squash merge failed and targeted restore also failed for ${branchName}: ${restore.stderr.trim() || restore.stdout.trim()}`);
|
|
864
|
+
}
|
|
865
|
+
return {
|
|
866
|
+
error: squashResult.stderr.trim() || squashResult.stdout.trim() || "squash merge failed"
|
|
867
|
+
};
|
|
868
|
+
}
|
|
869
|
+
const resetResult = await runGit(["reset", "-q", "HEAD", "--", ...incomingPaths], primaryDir);
|
|
870
|
+
if (resetResult.exitCode !== 0) {
|
|
871
|
+
advisoryWarn(`[worktree] mergeLaneBranch: targeted unstage failed for ${branchName} (${resetResult.stderr.trim() || resetResult.stdout.trim()}); lane changes remain staged`);
|
|
872
|
+
}
|
|
873
|
+
return { merged: true, strategy };
|
|
874
|
+
}
|
|
767
875
|
case "rebase":
|
|
768
876
|
result = await runGit(["rebase", branchName], primaryDir);
|
|
769
877
|
break;
|
|
@@ -911,6 +1019,9 @@ async function reconcileLandedMerge(primaryDir, provenance) {
|
|
|
911
1019
|
return { landed: true, method: "ancestry" };
|
|
912
1020
|
}
|
|
913
1021
|
if (ancestry.exitCode === 1) {
|
|
1022
|
+
if (provenance.strategy === "merge") {
|
|
1023
|
+
return matchesSourceHeadWorkingTree(primaryDir, provenance.sourceHead);
|
|
1024
|
+
}
|
|
914
1025
|
return { landed: false };
|
|
915
1026
|
}
|
|
916
1027
|
return {
|
|
@@ -1024,7 +1135,7 @@ async function attemptMergeBackFromDirty(worktreePath, branchName, primaryDir, s
|
|
|
1024
1135
|
if (reconciliation.landed) {
|
|
1025
1136
|
return {
|
|
1026
1137
|
merged: true,
|
|
1027
|
-
strategy,
|
|
1138
|
+
strategy: reconciliation.method === "worktree-match" ? "squash-unstaged" : strategy,
|
|
1028
1139
|
autoCommitted: false,
|
|
1029
1140
|
cleaned: false,
|
|
1030
1141
|
reconciled: true,
|
|
@@ -1140,6 +1251,8 @@ async function attemptMergeBackFromDirty(worktreePath, branchName, primaryDir, s
|
|
|
1140
1251
|
cleaned,
|
|
1141
1252
|
message: `Primary checkout has overlapping dirty paths with incoming lane changes: ${finalOverlapSnapshot.snapshot.overlapPaths.join(", ")}`,
|
|
1142
1253
|
conflictFiles: finalOverlapSnapshot.snapshot.overlapPaths,
|
|
1254
|
+
code: "SETTLEMENT_OVERLAP_BLOCKED",
|
|
1255
|
+
recoveryHint: `ACTION: commit or stash your local changes to the overlapping paths (or run /swarm recover for the preserved lane), then re-dispatch the lane. Overlapping paths: ${finalOverlapSnapshot.snapshot.overlapPaths.join(", ")}`,
|
|
1143
1256
|
...provenance ? { provenance } : {}
|
|
1144
1257
|
};
|
|
1145
1258
|
}
|
|
@@ -1151,11 +1264,12 @@ async function attemptMergeBackFromDirty(worktreePath, branchName, primaryDir, s
|
|
|
1151
1264
|
...provenance ? { provenance } : {}
|
|
1152
1265
|
};
|
|
1153
1266
|
}
|
|
1154
|
-
const
|
|
1267
|
+
const landingStrategy = strategy === "merge" && !options.commitLanding ? "squash-unstaged" : strategy;
|
|
1268
|
+
const mergeResult = await mergeLaneBranch(primaryDir, branchName, landingStrategy);
|
|
1155
1269
|
if ("merged" in mergeResult && mergeResult.merged) {
|
|
1156
1270
|
return {
|
|
1157
1271
|
merged: true,
|
|
1158
|
-
strategy,
|
|
1272
|
+
strategy: landingStrategy,
|
|
1159
1273
|
autoCommitted,
|
|
1160
1274
|
cleaned,
|
|
1161
1275
|
...provenance ? { reconciled: false, provenance } : {}
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
queryHistoricalOutcomes,
|
|
4
4
|
readKnowledgeEvents,
|
|
5
5
|
recordKnowledgeEvent
|
|
6
|
-
} from "./index-
|
|
6
|
+
} from "./index-pynk60z5.js";
|
|
7
7
|
import {
|
|
8
8
|
jaccardBigram,
|
|
9
9
|
readKnowledge,
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
resolveSwarmKnowledgePath,
|
|
12
12
|
transactKnowledge,
|
|
13
13
|
wordBigrams
|
|
14
|
-
} from "./index-
|
|
14
|
+
} from "./index-j0vvq8se.js";
|
|
15
15
|
import {
|
|
16
16
|
init_knowledge_types,
|
|
17
17
|
isActiveStatus
|
|
@@ -224,11 +224,11 @@ async function maybeQuarantineOnContradiction(directory, entryId, threshold, win
|
|
|
224
224
|
alreadyInactive: true
|
|
225
225
|
};
|
|
226
226
|
}
|
|
227
|
-
const { quarantineEntry } = await import("./knowledge-validator-
|
|
227
|
+
const { quarantineEntry } = await import("./knowledge-validator-h49dkw2z.js");
|
|
228
228
|
let policyConfig;
|
|
229
229
|
try {
|
|
230
|
-
const { KnowledgeConfigSchema } = await import("./schema-
|
|
231
|
-
const { loadPluginConfigWithMeta } = await import("./index-
|
|
230
|
+
const { KnowledgeConfigSchema } = await import("./schema-70c0yw8p.js");
|
|
231
|
+
const { loadPluginConfigWithMeta } = await import("./index-r8g2meas.js");
|
|
232
232
|
const { config: loadedConfig } = loadPluginConfigWithMeta(directory);
|
|
233
233
|
policyConfig = KnowledgeConfigSchema.parse(loadedConfig.knowledge ?? {});
|
|
234
234
|
} catch {
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
validateSwarmPath
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-evf5r7bk.js";
|
|
5
5
|
import {
|
|
6
6
|
observeReceiptTransition
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-43dmpa9w.js";
|
|
8
8
|
import {
|
|
9
9
|
resolveHiveEventsPath
|
|
10
10
|
} from "./index-ae75rja9.js";
|
|
11
11
|
import {
|
|
12
12
|
resolveKnowledgeStoreDir
|
|
13
|
-
} from "./index-
|
|
13
|
+
} from "./index-yzwb6ja4.js";
|
|
14
14
|
import {
|
|
15
15
|
assertProjectRoot,
|
|
16
16
|
atomicWriteFile
|
|
17
|
-
} from "./index-
|
|
17
|
+
} from "./index-kdyvk541.js";
|
|
18
18
|
import {
|
|
19
19
|
require_proper_lockfile
|
|
20
20
|
} from "./index-7g4c7s5r.js";
|
|
@@ -26,11 +26,11 @@ import {
|
|
|
26
26
|
} from "./index-1xnse449.js";
|
|
27
27
|
import {
|
|
28
28
|
loadPluginConfigWithMeta
|
|
29
|
-
} from "./index-
|
|
29
|
+
} from "./index-53c0ajk4.js";
|
|
30
30
|
import {
|
|
31
31
|
KnowledgeConfigSchema,
|
|
32
32
|
init_schema
|
|
33
|
-
} from "./index-
|
|
33
|
+
} from "./index-90qbc4rp.js";
|
|
34
34
|
import {
|
|
35
35
|
init_logger,
|
|
36
36
|
warn
|
|
@@ -2813,7 +2813,7 @@ async function applyKnowledgeVerdictFeedback(directory, options) {
|
|
|
2813
2813
|
}
|
|
2814
2814
|
let bumps = 0;
|
|
2815
2815
|
if (deltas.length > 0) {
|
|
2816
|
-
const { bumpKnowledgeConfidenceBatch } = await import("./knowledge-store-
|
|
2816
|
+
const { bumpKnowledgeConfidenceBatch } = await import("./knowledge-store-6sq9rxma.js");
|
|
2817
2817
|
bumps = await bumpKnowledgeConfidenceBatch(directory, deltas, options?.floorOptions);
|
|
2818
2818
|
}
|
|
2819
2819
|
return {
|