opencode-swarm 7.200.8 → 7.200.10
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/ci-fix-monitor/SKILL.md +49 -0
- package/.opencode/skills/swarm-pr-review/references/lane-output-recoverability.md +11 -2
- package/binaries/win32-arm64/swarm-sandbox-runner.exe +0 -0
- package/binaries/win32-x64/swarm-sandbox-runner.exe +0 -0
- package/dist/background/completion-observer.d.ts +2 -1
- package/dist/background/pending-delegations.d.ts +9 -1
- package/dist/background/pr-review-contract.d.ts +8 -0
- package/dist/cli/{attest-task-dxrfae0t.js → attest-task-yx2t832n.js} +78 -76
- package/dist/cli/{auto-checkpoint-6sacb90s.js → auto-checkpoint-15mvj9zm.js} +12 -12
- package/dist/cli/{capability-probe-dwqn2609.js → capability-probe-qjndmx6z.js} +1 -1
- package/dist/cli/{checkpoint-nwp1j6zv.js → checkpoint-65whgvwa.js} +23 -23
- package/dist/cli/{coder-settlement-gw7yz6j8.js → coder-settlement-sdg1he8p.js} +14 -13
- package/dist/cli/{config-doctor-9azv1kqx.js → config-doctor-4af2p2y4.js} +19 -19
- package/dist/cli/{core-0qgp0a8j.js → core-8swqc6kw.js} +6 -3
- package/dist/cli/{curation-policy-gy868ec3.js → curation-policy-1a23ftnv.js} +6 -6
- package/dist/cli/{curator-ekthxye6.js → curator-6ze04fz3.js} +53 -52
- package/dist/cli/{curator-drift-45snz8a6.js → curator-drift-ktf137da.js} +10 -10
- package/dist/cli/curator-llm-factory-7vq4rgg7.js +83 -0
- package/dist/cli/{doctor-knowledge-receipt-phase-id-fggff61y.js → doctor-knowledge-receipt-phase-id-0smwq3ar.js} +10 -10
- package/dist/cli/{evidence-summary-service-zc2fc8h1.js → evidence-summary-service-3bhq2gef.js} +26 -25
- package/dist/cli/{gate-evidence-r57ahtp0.js → gate-evidence-gcv0xgfc.js} +10 -9
- package/dist/cli/guardrail-explain-9t3mvm92.js +84 -0
- package/dist/cli/{guardrail-log-hskq7q1w.js → guardrail-log-ehgpan5n.js} +8 -8
- package/dist/cli/{guardrail-reset-ywcnk88z.js → guardrail-reset-q7m265wy.js} +53 -52
- package/dist/cli/{hive-promoter-k66hgffk.js → hive-promoter-857ranjf.js} +53 -52
- package/dist/cli/{index-4krkevgc.js → index-001tkp0j.js} +1 -1
- package/dist/cli/{index-k5h4mmwd.js → index-06sj5bjh.js} +5 -5
- package/dist/cli/{index-sg2sd66b.js → index-2dey2mtg.js} +6 -6
- package/dist/cli/{index-6w1x38yd.js → index-3h5ztpn5.js} +2 -2
- package/dist/cli/{index-kzyw3315.js → index-43zgg04r.js} +5 -5
- package/dist/cli/{index-wfd267ma.js → index-4dvqvn4k.js} +12905 -12414
- package/dist/cli/{index-q7z2yws5.js → index-60m7qnds.js} +8 -8
- package/dist/cli/{index-m6632p7f.js → index-66b4f2qd.js} +18 -13
- package/dist/cli/{index-c2k7q723.js → index-6cppzd9c.js} +1 -1
- package/dist/cli/{index-zjjxe0q5.js → index-6e7jxxys.js} +15 -15
- package/dist/cli/{index-jrpfzv5r.js → index-6ehx0pj4.js} +15 -15
- package/dist/cli/{index-yyrnkc3a.js → index-6m551cng.js} +2 -2
- package/dist/cli/{index-wgwg2b4d.js → index-8c6zshfj.js} +1 -1
- package/dist/cli/{index-8srvdpw6.js → index-8xtdxy91.js} +2 -2
- package/dist/cli/{index-mn75z39t.js → index-9qy3tzt5.js} +1 -1
- package/dist/cli/{index-057y0sbg.js → index-bt3pxs7r.js} +6 -6
- package/dist/cli/{index-0tvkfdwp.js → index-c34tgnwm.js} +7 -7
- package/dist/cli/{index-y7c4hqcj.js → index-ck7jpn0y.js} +1 -1
- package/dist/cli/{index-p2dst45x.js → index-ckq78kq1.js} +1 -1
- package/dist/cli/{index-8mrentmw.js → index-dp6hy23p.js} +58 -53
- package/dist/cli/{index-4fkxdnc7.js → index-erp7fk72.js} +1 -1
- package/dist/cli/{index-16n2s0zf.js → index-ev46f132.js} +8 -8
- package/dist/cli/{index-h7t7hvq3.js → index-fbn2mv67.js} +6 -6
- package/dist/cli/{index-vpxdf79m.js → index-ffm3d4cn.js} +17 -17
- package/dist/cli/{index-kekvdqj6.js → index-gsnj3a0h.js} +4 -4
- package/dist/cli/{index-zvvavx1h.js → index-h9qhy8r6.js} +6 -6
- package/dist/cli/{index-tecp3a77.js → index-kd1n3ne2.js} +9 -9
- package/dist/cli/{index-2wryy5a7.js → index-kxxy7zq4.js} +18 -20
- package/dist/cli/{index-ez0smmcc.js → index-mamw83wm.js} +53 -52
- package/dist/cli/{index-4a3ey5g6.js → index-mx34b7bm.js} +58 -57
- package/dist/cli/{index-wkbdfy1g.js → index-nv8tx9v4.js} +4 -4
- package/dist/cli/{index-q8vfw61p.js → index-pjrx4jkq.js} +1 -1
- package/dist/cli/{index-mhd6kdzr.js → index-qyj4383m.js} +1 -1
- package/dist/cli/{index-x8cac18k.js → index-r3wyt8za.js} +611 -1376
- package/dist/cli/{index-2x015vjy.js → index-rck7v4r4.js} +1 -1
- package/dist/cli/{index-vtpt8yns.js → index-rjsqf4hv.js} +2 -2
- package/dist/cli/{index-z72545mf.js → index-rnm6c33a.js} +5 -5
- package/dist/cli/{index-bk8r4m9j.js → index-rpvp88js.js} +2 -2
- package/dist/cli/{index-v839c9mv.js → index-tggyracy.js} +1 -1
- package/dist/cli/{index-5z4c9acx.js → index-tm6nwe43.js} +29 -29
- package/dist/cli/{index-c5wk61ak.js → index-vajbtn3v.js} +11 -11
- package/dist/cli/{index-4y90ecpz.js → index-vm3j8fvn.js} +201 -33
- package/dist/cli/{index-z1e9b5qk.js → index-vqknke9n.js} +121 -40
- package/dist/cli/{index-4ph7ad0b.js → index-vx1j2t5p.js} +2 -2
- package/dist/cli/{index-7h22y3ew.js → index-w0afnznk.js} +2 -2
- package/dist/cli/{index-76xnddca.js → index-ww5ne0g6.js} +7 -7
- package/dist/cli/index-xkavxqf2.js +1330 -0
- package/dist/cli/{index-tfaf8zy8.js → index-ywwazz81.js} +8 -8
- package/dist/cli/{index-21nbxx1t.js → index-zmp1k0mb.js} +2 -2
- package/dist/cli/index.js +57 -56
- package/dist/cli/{knowledge-escalator-9tz25k7f.js → knowledge-escalator-6p7m6gkc.js} +18 -18
- package/dist/cli/{knowledge-events-dcmpbb23.js → knowledge-events-w3ep12sq.js} +15 -15
- package/dist/cli/{knowledge-link-13t3nfrz.js → knowledge-link-r7e2t5c1.js} +5 -5
- package/dist/cli/{knowledge-store-dxwsme9q.js → knowledge-store-g4cpw0hz.js} +7 -7
- package/dist/cli/{knowledge-validator-7q1w62s7.js → knowledge-validator-zhy6mgxv.js} +9 -9
- package/dist/cli/{mcp-k38cfqtg.js → mcp-j1dy60mx.js} +1 -1
- package/dist/cli/{model-preflight-1tkjtc9z.js → model-preflight-962y2z1d.js} +56 -55
- package/dist/cli/{pending-delegations-q1fksmee.js → pending-delegations-erjwa1y6.js} +14 -14
- package/dist/cli/{pr-subscriptions-pf6mwhwr.js → pr-subscriptions-7fcawjg9.js} +13 -13
- package/dist/cli/{pr-workflow-gate-thazeaa1.js → pr-workflow-gate-j8ee9c6g.js} +53 -52
- package/dist/cli/{runner-q1g9atrv.js → runner-s4422dq4.js} +6 -6
- package/dist/cli/{scan-cursor-8k8rkrcj.js → scan-cursor-msz8j44s.js} +8 -8
- package/dist/cli/{schema-ff9v839b.js → schema-kep9t01t.js} +2 -2
- package/dist/cli/{scope-persistence-mzyqtkwv.js → scope-persistence-tx71g0ac.js} +18 -18
- package/dist/cli/{server-ss4jqd5y.js → server-6enk6sfw.js} +70 -69
- package/dist/cli/{skill-generator-fgk15dd5.js → skill-generator-p9fkx1g3.js} +20 -20
- package/dist/cli/{snapshot-coordination-init-e9gvsaj7.js → snapshot-coordination-init-kgftbdmq.js} +53 -52
- package/dist/cli/{speckit-checkoff-ec4g0hhc.js → speckit-checkoff-jfdwsy5n.js} +5 -5
- package/dist/cli/{telemetry-cr8q16wk.js → telemetry-j7zr1dht.js} +1 -1
- package/dist/cli/workflow-wal-file-xvvwcxr1.js +32 -0
- package/dist/cli/{workspace-snapshot-7hws89e9.js → workspace-snapshot-ksdspd74.js} +3 -3
- package/dist/cli/{worktree-collision-ownership-egc9b97v.js → worktree-collision-ownership-hac3t2xv.js} +15 -15
- package/dist/cli/{worktree-isolation-9evd232c.js → worktree-isolation-tjvxcsr9.js} +53 -52
- package/dist/hooks/delegation-gate/worktree-isolation.d.ts +3 -0
- package/dist/hooks/shell-write-detect.d.ts +10 -0
- package/dist/index.js +686 -684
- package/dist/memory/redaction.d.ts +13 -3
- package/dist/pr-review/legacy-transcript-adapter.d.ts +15 -4
- package/dist/sandbox/macos/sandbox-exec-executor.d.ts +24 -0
- package/dist/workflow/coder-settlement.d.ts +5 -0
- package/dist/worktree/core.d.ts +3 -0
- package/dist/worktree/merge.d.ts +15 -1
- package/dist/worktree/ownership.d.ts +3 -0
- package/dist/worktree/settlement-artifact-lifecycle.d.ts +32 -0
- package/dist/worktree/settlement-source-recovery.d.ts +12 -0
- package/package.json +1 -1
- package/dist/cli/curator-llm-factory-ds4y7k0b.js +0 -82
- package/dist/cli/guardrail-explain-bc8garre.js +0 -83
|
@@ -1,26 +1,35 @@
|
|
|
1
1
|
// @bun
|
|
2
|
+
import {
|
|
3
|
+
ensureTaskGateRequirementsReceiptForSettledTransition,
|
|
4
|
+
getTaskWorkflowSnapshot,
|
|
5
|
+
withTaskEvidenceTransaction
|
|
6
|
+
} from "./index-xkavxqf2.js";
|
|
2
7
|
import {
|
|
3
8
|
captureWorkspaceSnapshotAsync,
|
|
4
9
|
changedFilesSinceSnapshotAsync
|
|
5
|
-
} from "./index-
|
|
10
|
+
} from "./index-rpvp88js.js";
|
|
6
11
|
import {
|
|
7
12
|
removeWorktreeProvisioningOwner
|
|
8
|
-
} from "./index-
|
|
13
|
+
} from "./index-w0afnznk.js";
|
|
14
|
+
import {
|
|
15
|
+
appendCoreEventSync
|
|
16
|
+
} from "./index-rjsqf4hv.js";
|
|
9
17
|
import {
|
|
10
18
|
SOURCE_WORKTREE_GONE_STAGE,
|
|
11
|
-
|
|
12
|
-
|
|
19
|
+
preserveSettlementSource,
|
|
20
|
+
probeSettlementSource,
|
|
13
21
|
readWorkflowWalFile,
|
|
14
22
|
reconcileLandedMerge,
|
|
15
|
-
|
|
23
|
+
releaseSettlementSource,
|
|
24
|
+
validateSettlementLane,
|
|
16
25
|
writeWorkflowWalFile
|
|
17
|
-
} from "./index-
|
|
26
|
+
} from "./index-r3wyt8za.js";
|
|
18
27
|
import {
|
|
19
|
-
|
|
20
|
-
} from "./index-
|
|
28
|
+
withSettlementArtifactLifecycle
|
|
29
|
+
} from "./index-vm3j8fvn.js";
|
|
21
30
|
import {
|
|
22
|
-
|
|
23
|
-
} from "./index-
|
|
31
|
+
validateSwarmPath
|
|
32
|
+
} from "./index-001tkp0j.js";
|
|
24
33
|
import {
|
|
25
34
|
init_path_identity,
|
|
26
35
|
isPathWithinDeclaredScope
|
|
@@ -288,31 +297,44 @@ async function beginCoderSettlement(options) {
|
|
|
288
297
|
return;
|
|
289
298
|
}
|
|
290
299
|
}
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
300
|
+
const publish = async () => {
|
|
301
|
+
if (options.worktree) {
|
|
302
|
+
if (canonicalRootKeyFresh(options.context.baseline.directory) !== canonicalRootKeyFresh(options.worktree.worktreePath) || options.context.baseline.gitHead === null) {
|
|
303
|
+
throw new Error("CODER_SETTLEMENT_DISPATCH_ARTIFACT_CHANGED");
|
|
304
|
+
}
|
|
305
|
+
await _internals.validateSettlementLane(options.worktree.worktreePath, options.worktree.branchName, options.context.baseline.gitHead);
|
|
306
|
+
}
|
|
307
|
+
await transaction.transition({
|
|
308
|
+
type: "dispatch_attempted",
|
|
309
|
+
agentType: "coder",
|
|
310
|
+
expectedGeneration: options.expectedGeneration,
|
|
311
|
+
transitionId: options.transitionId
|
|
312
|
+
});
|
|
313
|
+
await writeWal(filePath, {
|
|
314
|
+
version: 1,
|
|
315
|
+
state: "DISPATCHED",
|
|
316
|
+
taskId: options.taskId,
|
|
317
|
+
transitionId: options.transitionId,
|
|
318
|
+
actor: options.actor,
|
|
319
|
+
processId: process.pid,
|
|
320
|
+
runtimeId,
|
|
321
|
+
expectedGeneration: options.expectedGeneration,
|
|
322
|
+
context: options.context,
|
|
323
|
+
...options.worktree ? { worktree: options.worktree } : {},
|
|
324
|
+
recordedAt: new Date().toISOString()
|
|
325
|
+
});
|
|
326
|
+
ownsActiveDispatch = true;
|
|
327
|
+
await appendSettlementEvent(options.directory, "dispatched", {
|
|
328
|
+
taskId: options.taskId,
|
|
329
|
+
transitionId: options.transitionId,
|
|
330
|
+
actor: options.actor
|
|
331
|
+
});
|
|
332
|
+
};
|
|
333
|
+
if (options.worktree) {
|
|
334
|
+
await _internals.withSettlementArtifactLifecycle(options.directory, publish);
|
|
335
|
+
} else {
|
|
336
|
+
await publish();
|
|
337
|
+
}
|
|
316
338
|
}));
|
|
317
339
|
if (ownsActiveDispatch) {
|
|
318
340
|
const key = dispatchKey(options.directory, options.taskId, options.transitionId);
|
|
@@ -512,7 +534,7 @@ async function cleanupRecoveredWorktree(directory, descriptor, options) {
|
|
|
512
534
|
awaitingMergeByCallID,
|
|
513
535
|
cleanupStandardWorktreeForCallId,
|
|
514
536
|
standardWorktreeByCallID
|
|
515
|
-
} = await import("./worktree-isolation-
|
|
537
|
+
} = await import("./worktree-isolation-tjvxcsr9.js");
|
|
516
538
|
standardWorktreeByCallID.delete(descriptor.callID);
|
|
517
539
|
if (hasResidue)
|
|
518
540
|
awaitingMergeByCallID.set(descriptor.callID, {
|
|
@@ -540,6 +562,41 @@ async function cleanupRecoveredWorktree(directory, descriptor, options) {
|
|
|
540
562
|
throw new Error("CODER_SETTLEMENT_OWNER_CLEANUP_FAILED");
|
|
541
563
|
}
|
|
542
564
|
}
|
|
565
|
+
var HISTORICAL_ORPHAN_ADVISORY_COOLDOWN_MS = 600000;
|
|
566
|
+
var MAX_HISTORICAL_ORPHAN_ADVISORIES = 256;
|
|
567
|
+
var historicalOrphanAdvisoryAt = new Map;
|
|
568
|
+
function shouldEmitHistoricalOrphanAdvisory(key) {
|
|
569
|
+
const now = Date.now();
|
|
570
|
+
const last = historicalOrphanAdvisoryAt.get(key);
|
|
571
|
+
if (last !== undefined && now - last >= 0 && now - last < HISTORICAL_ORPHAN_ADVISORY_COOLDOWN_MS)
|
|
572
|
+
return false;
|
|
573
|
+
historicalOrphanAdvisoryAt.delete(key);
|
|
574
|
+
historicalOrphanAdvisoryAt.set(key, now);
|
|
575
|
+
while (historicalOrphanAdvisoryAt.size > MAX_HISTORICAL_ORPHAN_ADVISORIES) {
|
|
576
|
+
const oldest = historicalOrphanAdvisoryAt.keys().next().value;
|
|
577
|
+
if (oldest === undefined)
|
|
578
|
+
break;
|
|
579
|
+
historicalOrphanAdvisoryAt.delete(oldest);
|
|
580
|
+
}
|
|
581
|
+
return true;
|
|
582
|
+
}
|
|
583
|
+
async function preserveHistoricalSelfHealedSource(directory, wal) {
|
|
584
|
+
if (wal.state !== "ABORTED" || !wal.abortReason?.startsWith("CODER_SETTLEMENT_SELF_HEALED_MISSING_WORKTREE") || !wal.mergeProvenance || await probeSettlementSource(directory, wal.mergeProvenance.sourceHead) !== "present")
|
|
585
|
+
return "none";
|
|
586
|
+
const source = wal.mergeProvenance.sourceHead;
|
|
587
|
+
const backup = await preserveSettlementSource(directory, source);
|
|
588
|
+
const landed = await reconcileLandedMerge(directory, wal.mergeProvenance);
|
|
589
|
+
if (landed.landed && landed.method !== "worktree-match") {
|
|
590
|
+
await releaseSettlementSource(directory, source);
|
|
591
|
+
return "none";
|
|
592
|
+
}
|
|
593
|
+
if (shouldEmitHistoricalOrphanAdvisory(`${canonicalRootKeyFresh(directory)}\x00${wal.taskId}\x00${source}`)) {
|
|
594
|
+
const message = `RECOVERABLE_ORPHAN_COMMIT: historical aborted task ${wal.taskId} source ${source} is retained at ${backup}; apply it explicitly after reviewing the current task generation. The settlement remains ABORTED. This report is advisory: task status, dispatch and close are not blocked by it.`;
|
|
595
|
+
criticalWarn(message);
|
|
596
|
+
advisoryWarn(message);
|
|
597
|
+
}
|
|
598
|
+
return "orphan";
|
|
599
|
+
}
|
|
543
600
|
async function completeCoderSettlementCleanup(directory, taskId, transitionId) {
|
|
544
601
|
await withSettlementLock(directory, taskId, "coder-cleanup", async () => {
|
|
545
602
|
const filePath = walPath(directory, taskId);
|
|
@@ -552,6 +609,8 @@ async function completeCoderSettlementCleanup(directory, taskId, transitionId) {
|
|
|
552
609
|
if (wal.state !== "COMMITTED" && wal.state !== "ABORTED") {
|
|
553
610
|
throw new Error("CODER_SETTLEMENT_NOT_COMMITTED");
|
|
554
611
|
}
|
|
612
|
+
if (await preserveHistoricalSelfHealedSource(directory, wal) === "orphan")
|
|
613
|
+
return;
|
|
555
614
|
if (!wal.worktree || wal.cleanupComplete === true)
|
|
556
615
|
return;
|
|
557
616
|
await cleanupRecoveredWorktree(directory, wal.worktree);
|
|
@@ -563,6 +622,14 @@ async function selfHealMissingLaneWorktree(directory, filePath, taskId, transiti
|
|
|
563
622
|
return false;
|
|
564
623
|
if (_internals.branchExists(directory, descriptor.branchName))
|
|
565
624
|
return false;
|
|
625
|
+
const currentWal = await readWal(filePath, taskId);
|
|
626
|
+
if (currentWal?.mergeProvenance) {
|
|
627
|
+
const source = currentWal.mergeProvenance.sourceHead;
|
|
628
|
+
if (await probeSettlementSource(directory, source) === "present") {
|
|
629
|
+
const backup = await preserveSettlementSource(directory, source);
|
|
630
|
+
throw new Error(`RECOVERABLE_ORPHAN_COMMIT: task ${taskId} source ${source} is retained at ${backup}; settlement remains pending.`);
|
|
631
|
+
}
|
|
632
|
+
}
|
|
566
633
|
const reason = `CODER_SETTLEMENT_SELF_HEALED_MISSING_WORKTREE: ${detail}`;
|
|
567
634
|
const aborted = await abortDispatchedWalUnderLock(directory, taskId, transitionId, reason);
|
|
568
635
|
if (aborted.outcome === "not-dispatched")
|
|
@@ -588,8 +655,10 @@ async function recoverCoderSettlement(directory, taskId) {
|
|
|
588
655
|
if (existingWal === null)
|
|
589
656
|
return null;
|
|
590
657
|
let wal = existingWal;
|
|
591
|
-
if (wal.state === "ABORTED")
|
|
658
|
+
if (wal.state === "ABORTED") {
|
|
659
|
+
await preserveHistoricalSelfHealedSource(directory, wal);
|
|
592
660
|
return null;
|
|
661
|
+
}
|
|
593
662
|
if (wal.state === "COMMITTED") {
|
|
594
663
|
if (wal.worktree && wal.cleanupComplete !== true) {
|
|
595
664
|
await cleanupRecoveredWorktree(directory, wal.worktree);
|
|
@@ -604,6 +673,9 @@ async function recoverCoderSettlement(directory, taskId) {
|
|
|
604
673
|
if (wal.state === "DISPATCHED") {
|
|
605
674
|
if (wal.worktree) {
|
|
606
675
|
const worktree = wal.worktree;
|
|
676
|
+
const sourceState = wal.mergeProvenance ? await probeSettlementSource(directory, wal.mergeProvenance.sourceHead) : undefined;
|
|
677
|
+
if (sourceState === "absent" && await selfHealMissingLaneWorktree(directory, filePath, taskId, wal.transitionId, worktree, "the recorded source object, lane branch and checkout are absent"))
|
|
678
|
+
return null;
|
|
607
679
|
const observed2 = wal.observedFiles ?? await scopedObservedFiles(worktree.worktreePath, wal.context);
|
|
608
680
|
if (observed2 === null) {
|
|
609
681
|
throw new Error(`CODER_SETTLEMENT_RECOVERY_UNCERTAIN: transition ${wal.transitionId} for isolated task ${taskId} could not attribute worktree changes to the declared scope (${filePath}, state ${wal.state}). Run /swarm recover ${taskId} (or /swarm reset-session), then retry; do not remove the WAL by hand.`);
|
|
@@ -611,10 +683,15 @@ async function recoverCoderSettlement(directory, taskId) {
|
|
|
611
683
|
const unattributedEmptyScopeMutation2 = hasUnattributedEmptyScopeMutation(wal.context.declaredFiles, observed2);
|
|
612
684
|
const accepted = observed2.length > 0 || unattributedEmptyScopeMutation2;
|
|
613
685
|
const settlementFailed = wal.settlementFailed === true || unattributedEmptyScopeMutation2;
|
|
614
|
-
if (wal.mergeProvenance) {
|
|
686
|
+
if (wal.mergeProvenance && sourceState !== "absent") {
|
|
615
687
|
const landed = await reconcileLandedMerge(directory, wal.mergeProvenance);
|
|
616
688
|
if (landed.landed) {
|
|
617
689
|
const landedUnstaged = landed.method === "worktree-match";
|
|
690
|
+
if (landedUnstaged) {
|
|
691
|
+
await preserveSettlementSource(directory, wal.mergeProvenance.sourceHead);
|
|
692
|
+
} else {
|
|
693
|
+
await releaseSettlementSource(directory, wal.mergeProvenance.sourceHead);
|
|
694
|
+
}
|
|
618
695
|
wal = {
|
|
619
696
|
...wal,
|
|
620
697
|
state: "PREPARED",
|
|
@@ -640,6 +717,7 @@ async function recoverCoderSettlement(directory, taskId) {
|
|
|
640
717
|
});
|
|
641
718
|
return committed2;
|
|
642
719
|
}
|
|
720
|
+
await preserveSettlementSource(directory, wal.mergeProvenance.sourceHead);
|
|
643
721
|
if (landed.error) {
|
|
644
722
|
throw new Error(`CODER_SETTLEMENT_RECOVERY_UNCERTAIN: transition ${wal.transitionId} for task ${taskId} could not reconcile the landed merge (${filePath}, state ${wal.state}): ${landed.error}. Run /swarm recover ${taskId} (or /swarm reset-session), then retry; do not remove the WAL by hand.`);
|
|
645
723
|
}
|
|
@@ -648,7 +726,7 @@ async function recoverCoderSettlement(directory, taskId) {
|
|
|
648
726
|
awaitingMergeByCallID,
|
|
649
727
|
finishStandardWorktreeDispatch,
|
|
650
728
|
standardWorktreeByCallID
|
|
651
|
-
} = await import("./worktree-isolation-
|
|
729
|
+
} = await import("./worktree-isolation-tjvxcsr9.js");
|
|
652
730
|
const descriptor = wal.worktree;
|
|
653
731
|
const reconstructedDispatch = {
|
|
654
732
|
callID: descriptor.callID,
|
|
@@ -927,9 +1005,12 @@ async function recoverStaleCoderSettlements(directory, options) {
|
|
|
927
1005
|
}
|
|
928
1006
|
var _internals = {
|
|
929
1007
|
liveDispatches,
|
|
1008
|
+
withSettlementArtifactLifecycle,
|
|
1009
|
+
validateSettlementLane,
|
|
930
1010
|
removeWorktreeProvisioningOwner,
|
|
931
1011
|
branchExists: probeBranchExists,
|
|
932
|
-
recoverCoderSettlement
|
|
1012
|
+
recoverCoderSettlement,
|
|
1013
|
+
historicalOrphanAdvisoryAt
|
|
933
1014
|
};
|
|
934
1015
|
|
|
935
1016
|
export { hasUnattributedEmptyScopeMutation, beginCoderSettlement, settleCoderDispatch, abortCoderSettlement, transferCoderSettlementToBackground, abortCoderSettlementIfDoomed, recordCoderMergeProvenance, completeCoderSettlementCleanup, recoverCoderSettlement, releaseCoderDispatchOwnership, assertNoUnsettledCoderDispatch, listCoderSettlementWalStates, recoverStaleCoderSettlements, _internals };
|
|
@@ -9,10 +9,10 @@ import {
|
|
|
9
9
|
} from "./index-txdagbh7.js";
|
|
10
10
|
import {
|
|
11
11
|
atomicWriteFile
|
|
12
|
-
} from "./index-
|
|
12
|
+
} from "./index-6m551cng.js";
|
|
13
13
|
import {
|
|
14
14
|
withEvidenceLock
|
|
15
|
-
} from "./index-
|
|
15
|
+
} from "./index-pjrx4jkq.js";
|
|
16
16
|
import {
|
|
17
17
|
assertProjectRoot
|
|
18
18
|
} from "./index-t7hmqgjy.js";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
validateSwarmPath
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-001tkp0j.js";
|
|
5
5
|
import {
|
|
6
6
|
atomicWriteSwarmFileSync
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-9qy3tzt5.js";
|
|
8
8
|
|
|
9
9
|
// src/hooks/delegation-gate/worktree-provisioning-owner.ts
|
|
10
10
|
import { createHash } from "crypto";
|
|
@@ -1,10 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import {
|
|
3
|
-
GIT_BINARY_ENV_VAR,
|
|
4
|
-
advisoryWarn,
|
|
5
|
-
init_git_executable,
|
|
6
|
-
init_warning_buffer
|
|
7
|
-
} from "./index-sp2cxpaq.js";
|
|
8
2
|
import {
|
|
9
3
|
CONSERVATIVE_PRESET_BASE,
|
|
10
4
|
ExternalSkillsConfigSchema,
|
|
@@ -16,7 +10,13 @@ import {
|
|
|
16
10
|
init_schema,
|
|
17
11
|
resolveExternalSkillsConfig,
|
|
18
12
|
retiredEpicKeyReplacement
|
|
19
|
-
} from "./index-
|
|
13
|
+
} from "./index-06sj5bjh.js";
|
|
14
|
+
import {
|
|
15
|
+
GIT_BINARY_ENV_VAR,
|
|
16
|
+
advisoryWarn,
|
|
17
|
+
init_git_executable,
|
|
18
|
+
init_warning_buffer
|
|
19
|
+
} from "./index-sp2cxpaq.js";
|
|
20
20
|
import {
|
|
21
21
|
DangerousMergeKeyError,
|
|
22
22
|
MAX_MERGE_DEPTH,
|