opencode-swarm 7.184.0 → 7.184.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (112) hide show
  1. package/binaries/win32-arm64/swarm-sandbox-runner.exe +0 -0
  2. package/binaries/win32-x64/swarm-sandbox-runner.exe +0 -0
  3. package/dist/background/delegation-health.d.ts +1 -1
  4. package/dist/background/index.d.ts +1 -0
  5. package/dist/background/pr-event-delivery.d.ts +29 -14
  6. package/dist/background/pr-event-subscribers.d.ts +6 -5
  7. package/dist/background/pr-feedback-event-queue.d.ts +19 -2
  8. package/dist/background/pr-feedback-loop-runtime.d.ts +75 -0
  9. package/dist/background/pr-feedback-loop.d.ts +47 -12
  10. package/dist/cli/{coder-settlement-vrc5zxvv.js → coder-settlement-vqh4b7fb.js} +15 -12
  11. package/dist/cli/{config-doctor-y0bpap07.js → config-doctor-8fp6s15v.js} +2 -2
  12. package/dist/cli/{core-7f955h2f.js → core-75bsfgse.js} +4 -4
  13. package/dist/cli/{curation-policy-fa2h82c4.js → curation-policy-49f8jx48.js} +7 -6
  14. package/dist/cli/{curator-drift-48x02n2m.js → curator-drift-pmcpywr0.js} +9 -9
  15. package/dist/cli/{curator-m7enwwz2.js → curator-gwqs85sp.js} +40 -39
  16. package/dist/cli/curator-llm-factory-g6hb1vvw.js +75 -0
  17. package/dist/cli/{dispatch-p5zjg5e6.js → dispatch-cv89p2y1.js} +1 -1
  18. package/dist/cli/{evidence-summary-service-k8a5vkfk.js → evidence-summary-service-rm0tp8d1.js} +21 -20
  19. package/dist/cli/{gate-evidence-nktrs0w2.js → gate-evidence-ra0trg97.js} +14 -7
  20. package/dist/cli/guardrail-explain-kghhhjky.js +76 -0
  21. package/dist/cli/{guardrail-log-dppv6tgn.js → guardrail-log-r72971jr.js} +8 -8
  22. package/dist/cli/{guardrail-reset-btzq4ses.js → guardrail-reset-1kq1m70y.js} +40 -39
  23. package/dist/cli/{hive-promoter-yp1baj9z.js → hive-promoter-82ygdw79.js} +40 -39
  24. package/dist/cli/{index-6h81yvyc.js → index-131ay7x1.js} +3 -3
  25. package/dist/cli/{index-rwfmx7vn.js → index-1v13c6r0.js} +2 -2
  26. package/dist/cli/{index-ad3yskxy.js → index-279xp2be.js} +158 -27
  27. package/dist/cli/{index-9yvjwfay.js → index-2wn8ww1e.js} +3156 -1887
  28. package/dist/cli/{index-0bpr8vag.js → index-3n5zsp31.js} +2 -2
  29. package/dist/cli/{index-w81jmdkt.js → index-456awy1p.js} +2 -2
  30. package/dist/cli/{index-74x26wyj.js → index-475bkab8.js} +2 -2
  31. package/dist/cli/{index-nvm6mxep.js → index-5r5s0dbb.js} +271 -80
  32. package/dist/cli/{index-r30xs0wp.js → index-6ayk7a3q.js} +1 -1
  33. package/dist/cli/{index-4t0wd9sv.js → index-6g664sy8.js} +1 -1
  34. package/dist/cli/{index-me39468k.js → index-8chh1c96.js} +38 -18
  35. package/dist/cli/{index-079xzcxb.js → index-ahe4mn8t.js} +40 -39
  36. package/dist/cli/{index-3fhg7pqf.js → index-amhr3swp.js} +2 -2
  37. package/dist/cli/{index-e90m050y.js → index-ar2gsn6b.js} +8 -8
  38. package/dist/cli/{index-51xtrf7g.js → index-b0qyb790.js} +39 -15
  39. package/dist/cli/{index-edrgc139.js → index-bga7w4rt.js} +2 -2
  40. package/dist/cli/{index-t1swv35d.js → index-dm2ydm2b.js} +1 -1
  41. package/dist/cli/{index-v3hpsxvd.js → index-earq3mda.js} +1 -1
  42. package/dist/cli/{index-3rb5gs4w.js → index-f0nj3d8z.js} +1 -1
  43. package/dist/cli/{index-152b9c6m.js → index-hkqd9jz6.js} +5 -5
  44. package/dist/cli/{index-ysr6n4ca.js → index-j2xcdbfd.js} +1 -1
  45. package/dist/cli/{index-t26gj2fh.js → index-jct9kb50.js} +2 -2
  46. package/dist/cli/{index-mn5zzmqx.js → index-jvk95e6y.js} +2 -2
  47. package/dist/cli/{index-b5mkznms.js → index-k1cxfede.js} +1 -1
  48. package/dist/cli/{index-5cve9g2b.js → index-k53a69vb.js} +6 -6
  49. package/dist/cli/{index-1xnse449.js → index-mc72pk74.js} +1 -1
  50. package/dist/cli/{index-nm8ma9xb.js → index-peg6sftq.js} +8 -8
  51. package/dist/cli/{index-fs9y88h1.js → index-q5115jpe.js} +3 -3
  52. package/dist/cli/{index-4gr9pj67.js → index-rp6sfpwp.js} +4 -4
  53. package/dist/cli/{index-pq6vr26z.js → index-rpsmx4ke.js} +3 -3
  54. package/dist/cli/{index-z3b157ew.js → index-rr1m7cc6.js} +12 -10
  55. package/dist/cli/{index-bf1726rj.js → index-stcacf0k.js} +42 -41
  56. package/dist/cli/{index-01wt209s.js → index-t7hmqgjy.js} +90 -141
  57. package/dist/cli/{index-5wk0etp8.js → index-w6agyrzs.js} +4 -4
  58. package/dist/cli/{index-08x7gsnf.js → index-w9hxzcz4.js} +2 -2
  59. package/dist/cli/{index-nmh0s6dg.js → index-wy3zpwjy.js} +1 -1
  60. package/dist/cli/{index-fbhtb6f5.js → index-x1gyqgze.js} +7 -7
  61. package/dist/cli/{index-6b4vkz6q.js → index-x9wpvhpk.js} +1 -1
  62. package/dist/cli/index-xf69xty9.js +105 -0
  63. package/dist/cli/{index-46z4c89b.js → index-xka1cq9k.js} +4 -4
  64. package/dist/cli/{index-z8smhv7k.js → index-ya32wfkp.js} +4 -2
  65. package/dist/cli/{index-njf5pbkm.js → index-zmgs43tw.js} +6 -6
  66. package/dist/cli/{index-qyx53xrz.js → index-zq40mkha.js} +7 -7
  67. package/dist/cli/{index-j40czc9v.js → index-zvbn85q0.js} +5 -5
  68. package/dist/cli/{index-1d6ssjcj.js → index-zzvxj02e.js} +3 -3
  69. package/dist/cli/index.js +41 -40
  70. package/dist/cli/{knowledge-escalator-4296y1h2.js → knowledge-escalator-x0159cv7.js} +14 -13
  71. package/dist/cli/{knowledge-events-31nga9yt.js → knowledge-events-4879bjbz.js} +12 -11
  72. package/dist/cli/{knowledge-link-ydpvzam8.js → knowledge-link-ap2274vm.js} +6 -5
  73. package/dist/cli/{knowledge-store-0qz3zmq3.js → knowledge-store-zvstn7dy.js} +7 -6
  74. package/dist/cli/{knowledge-validator-vndnwdj6.js → knowledge-validator-k0q00zsj.js} +9 -8
  75. package/dist/cli/{mcp-taace90a.js → mcp-tmr9kgrr.js} +15 -1
  76. package/dist/cli/mcp.d.ts +1 -0
  77. package/dist/cli/{model-preflight-bv8nvjjx.js → model-preflight-17y17gys.js} +40 -39
  78. package/dist/cli/{pending-delegations-kwdk8j9d.js → pending-delegations-jzr2w62w.js} +13 -12
  79. package/dist/cli/{pr-subscriptions-w2fwdpkk.js → pr-subscriptions-t867sq1q.js} +13 -12
  80. package/dist/cli/{pr-workflow-gate-sqjc6jmd.js → pr-workflow-gate-npgdhk7j.js} +40 -39
  81. package/dist/cli/{runner-r6gxq7m1.js → runner-yz3ysehf.js} +7 -6
  82. package/dist/cli/{scan-cursor-f74b9b4k.js → scan-cursor-5zy5h556.js} +8 -7
  83. package/dist/cli/{schema-cyet68tw.js → schema-80nb4z6k.js} +1 -1
  84. package/dist/cli/{scope-persistence-rg8v0r8q.js → scope-persistence-t2888gjf.js} +16 -15
  85. package/dist/cli/{server-765s4stz.js → server-41f41q15.js} +40 -39
  86. package/dist/cli/{skill-generator-qg5m18k7.js → skill-generator-6kj1xzk8.js} +16 -15
  87. package/dist/cli/{snapshot-coordination-init-zzs4bkmj.js → snapshot-coordination-init-pbdzjv20.js} +40 -39
  88. package/dist/cli/{speckit-checkoff-2bsm6p0c.js → speckit-checkoff-4ppx68ks.js} +4 -4
  89. package/dist/cli/{telemetry-rzvcp2n9.js → telemetry-39zmx4fp.js} +2 -2
  90. package/dist/cli/{workspace-snapshot-t22m6gbd.js → workspace-snapshot-0q1n1xq5.js} +4 -4
  91. package/dist/cli/{worktree-collision-ownership-qf2shp2n.js → worktree-collision-ownership-hn1mgtta.js} +14 -13
  92. package/dist/cli/{worktree-isolation-0b0jy6dt.js → worktree-isolation-w4nq6yzp.js} +40 -39
  93. package/dist/db/qa-gate-session-override.d.ts +12 -12
  94. package/dist/gate-evidence.d.ts +43 -1
  95. package/dist/hooks/guardrails/index.d.ts +13 -7
  96. package/dist/index.js +507 -503
  97. package/dist/plan/ledger.d.ts +20 -4
  98. package/dist/plan/manager.d.ts +20 -2
  99. package/dist/session/hydration-ownership.d.ts +39 -12
  100. package/dist/session/snapshot-coordination-init.d.ts +11 -4
  101. package/dist/session/snapshot-reader.d.ts +9 -4
  102. package/dist/session/snapshot-writer.d.ts +2 -3
  103. package/dist/state.d.ts +35 -5
  104. package/dist/tools/phase-complete.d.ts +1 -0
  105. package/dist/tools/update-task-status.d.ts +1 -1
  106. package/dist/utils/project-boundary.d.ts +32 -1
  107. package/dist/workflow/coder-settlement.d.ts +8 -0
  108. package/dist/workflow/task-terminal.d.ts +2 -1
  109. package/dist/workflow/workflow-wal-schema.d.ts +2 -0
  110. package/package.json +1 -1
  111. package/dist/cli/curator-llm-factory-g6at4hn6.js +0 -74
  112. package/dist/cli/guardrail-explain-1ccchxdr.js +0 -75
@@ -12,7 +12,7 @@ import {
12
12
  PluginConfigSchema,
13
13
  init_schema,
14
14
  stripKnownSwarmPrefix
15
- } from "./index-ysr6n4ca.js";
15
+ } from "./index-j2xcdbfd.js";
16
16
  import {
17
17
  ALL_AGENT_NAMES,
18
18
  TOOL_NAME_SET,
@@ -9,7 +9,7 @@ import {
9
9
  readEvaluationRun,
10
10
  saveEvaluationRun,
11
11
  saveTaskSetSnapshot
12
- } from "./index-z8smhv7k.js";
12
+ } from "./index-ya32wfkp.js";
13
13
  import {
14
14
  canonicalHash,
15
15
  computeCandidateInputContentHash,
@@ -2,10 +2,10 @@
2
2
  import {
3
3
  captureWorkspaceSnapshotAsync,
4
4
  changedFilesSinceSnapshotAsync
5
- } from "./index-6h81yvyc.js";
5
+ } from "./index-131ay7x1.js";
6
6
  import {
7
7
  removeWorktreeProvisioningOwner
8
- } from "./index-0bpr8vag.js";
8
+ } from "./index-3n5zsp31.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-ad3yskxy.js";
17
+ } from "./index-279xp2be.js";
18
18
  import {
19
19
  validateSwarmPath
20
- } from "./index-nmh0s6dg.js";
20
+ } from "./index-wy3zpwjy.js";
21
21
  import {
22
22
  appendCoreEventSync
23
- } from "./index-mn5zzmqx.js";
23
+ } from "./index-jvk95e6y.js";
24
24
  import {
25
25
  canonicalRootKeyFresh
26
- } from "./index-1xnse449.js";
26
+ } from "./index-mc72pk74.js";
27
27
  import {
28
28
  tryAcquireLock
29
29
  } from "./index-ejhxgyvm.js";
@@ -150,6 +150,9 @@ function baselineAttributionDoomed(baseline) {
150
150
  return true;
151
151
  return Array.isArray(baseline.changedFiles) && baseline.changedFiles.length > 0;
152
152
  }
153
+ function hasUnattributedEmptyScopeMutation(declaredFiles, rawObservedFiles) {
154
+ return Array.isArray(declaredFiles) && declaredFiles.length === 0 && Array.isArray(rawObservedFiles) && rawObservedFiles.length > 0;
155
+ }
153
156
  function doomedReason(baseline) {
154
157
  if (baseline.gitHead === null)
155
158
  return "launch workspace has no git baseline (not a git repository, or git unavailable at dispatch)";
@@ -170,6 +173,9 @@ async function scopedObservedFiles(directory, context) {
170
173
  const observed = await changedFilesSinceSnapshotAsync(directory, baseline);
171
174
  if (!observed || !context.declaredFiles)
172
175
  return null;
176
+ if (hasUnattributedEmptyScopeMutation(context.declaredFiles, observed)) {
177
+ return observed;
178
+ }
173
179
  return observed.filter((filePath) => isPathWithinDeclaredScope(filePath, context.declaredFiles ?? [], directory));
174
180
  }
175
181
  function settlementTransitionEvent(wal) {
@@ -185,6 +191,10 @@ function settlementTransitionEvent(wal) {
185
191
  } : {
186
192
  type: "dispatch_no_mutation",
187
193
  agentType: "coder",
194
+ context: {
195
+ declaredFiles: wal.context.declaredFiles,
196
+ settlementTransitionId: wal.transitionId
197
+ },
188
198
  expectedGeneration: wal.expectedGeneration,
189
199
  transitionId: wal.transitionId
190
200
  };
@@ -204,7 +214,7 @@ async function commitPrepared(directory, wal, options) {
204
214
  }
205
215
  const transitionEvent = settlementTransitionEvent(lockedWal);
206
216
  const snapshot = getTaskWorkflowSnapshot(transaction.read());
207
- const evidenceAlreadySettled = lockedWal.accepted === true ? snapshot.authoritative && snapshot.state === (lockedWal.settlementFailed === true ? "rework_required" : "coder_delegated") && snapshot.generation === lockedWal.expectedGeneration + 1 && snapshot.lastOutcome === (lockedWal.settlementFailed === true ? "accepted_mutation_failed" : "accepted_mutation") && snapshot.lastTransitionId === lockedWal.transitionId : snapshot.generation === lockedWal.expectedGeneration && snapshot.lastOutcome === "dispatch_no_mutation" && snapshot.lastTransitionId === lockedWal.transitionId;
217
+ const evidenceAlreadySettled = lockedWal.accepted === true ? snapshot.authoritative && snapshot.state === (lockedWal.settlementFailed === true ? "rework_required" : "coder_delegated") && snapshot.generation === lockedWal.expectedGeneration + 1 && snapshot.lastOutcome === (lockedWal.settlementFailed === true ? "accepted_mutation_failed" : "accepted_mutation") && snapshot.lastTransitionId === lockedWal.transitionId : snapshot.authoritative && snapshot.generation === lockedWal.expectedGeneration && (lockedWal.context.declaredFiles?.length === 0 ? snapshot.noMutationSettlement?.transitionId === lockedWal.transitionId : snapshot.lastOutcome === "dispatch_no_mutation" && snapshot.lastTransitionId === lockedWal.transitionId);
208
218
  if (evidenceAlreadySettled) {
209
219
  const evidence2 = transaction.read();
210
220
  if (lockedWal.accepted === true) {
@@ -228,7 +238,7 @@ async function commitPrepared(directory, wal, options) {
228
238
  alreadyApplied: true
229
239
  };
230
240
  }
231
- if (lockedWal.state !== "PREPARED") {
241
+ if (lockedWal.state !== "PREPARED" && !(lockedWal.state === "COMMITTED" && lockedWal.accepted !== true && snapshot.state === "idle")) {
232
242
  throw new Error("CODER_SETTLEMENT_NOT_PREPARED");
233
243
  }
234
244
  const evidence = await transaction.transition(transitionEvent);
@@ -321,8 +331,11 @@ async function settleCoderDispatch(options) {
321
331
  if (wal.transitionId !== options.transitionId) {
322
332
  throw new Error("CODER_SETTLEMENT_WAL_REPLACED");
323
333
  }
334
+ const unattributedEmptyScopeMutation = hasUnattributedEmptyScopeMutation(wal.context.declaredFiles, options.observedFiles);
335
+ const accepted = options.accepted || unattributedEmptyScopeMutation;
336
+ const settlementFailed = options.settlementFailed === true || unattributedEmptyScopeMutation;
324
337
  if (wal.state === "COMMITTED") {
325
- if (wal.accepted !== options.accepted || wal.testEngineerExempt !== options.testEngineerExempt || wal.settlementFailed !== (options.settlementFailed === true)) {
338
+ if (wal.accepted !== accepted || wal.testEngineerExempt !== options.testEngineerExempt || wal.settlementFailed !== settlementFailed) {
326
339
  throw new Error("CODER_SETTLEMENT_IDEMPOTENCY_CONFLICT");
327
340
  }
328
341
  return commitPrepared(options.directory, wal, {
@@ -332,15 +345,15 @@ async function settleCoderDispatch(options) {
332
345
  if (wal.state === "ABORTED") {
333
346
  throw new Error("CODER_SETTLEMENT_IDEMPOTENCY_CONFLICT");
334
347
  }
335
- if (wal.state === "PREPARED" && (wal.accepted !== options.accepted || wal.testEngineerExempt !== options.testEngineerExempt || wal.settlementFailed !== (options.settlementFailed === true))) {
348
+ if (wal.state === "PREPARED" && (wal.accepted !== accepted || wal.testEngineerExempt !== options.testEngineerExempt || wal.settlementFailed !== settlementFailed)) {
336
349
  throw new Error("CODER_SETTLEMENT_IDEMPOTENCY_CONFLICT");
337
350
  }
338
351
  const prepared = {
339
352
  ...wal,
340
353
  state: "PREPARED",
341
- accepted: options.accepted,
354
+ accepted,
342
355
  testEngineerExempt: options.testEngineerExempt,
343
- settlementFailed: options.settlementFailed === true
356
+ settlementFailed
344
357
  };
345
358
  if (wal.state !== "PREPARED")
346
359
  await writeWal(filePath, prepared);
@@ -499,7 +512,7 @@ async function cleanupRecoveredWorktree(directory, descriptor, options) {
499
512
  awaitingMergeByCallID,
500
513
  cleanupStandardWorktreeForCallId,
501
514
  standardWorktreeByCallID
502
- } = await import("./worktree-isolation-0b0jy6dt.js");
515
+ } = await import("./worktree-isolation-w4nq6yzp.js");
503
516
  standardWorktreeByCallID.delete(descriptor.callID);
504
517
  if (hasResidue)
505
518
  awaitingMergeByCallID.set(descriptor.callID, {
@@ -595,6 +608,9 @@ async function recoverCoderSettlement(directory, taskId) {
595
608
  if (observed2 === null) {
596
609
  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.`);
597
610
  }
611
+ const unattributedEmptyScopeMutation2 = hasUnattributedEmptyScopeMutation(wal.context.declaredFiles, observed2);
612
+ const accepted = observed2.length > 0 || unattributedEmptyScopeMutation2;
613
+ const settlementFailed = wal.settlementFailed === true || unattributedEmptyScopeMutation2;
598
614
  if (wal.mergeProvenance) {
599
615
  const landed = await reconcileLandedMerge(directory, wal.mergeProvenance);
600
616
  if (landed.landed) {
@@ -603,7 +619,8 @@ async function recoverCoderSettlement(directory, taskId) {
603
619
  ...wal,
604
620
  state: "PREPARED",
605
621
  observedFiles: observed2,
606
- accepted: observed2.length > 0,
622
+ accepted,
623
+ settlementFailed,
607
624
  testEngineerExempt: isMarkdownOnlyTaskChange(wal.context.declaredFiles, observed2)
608
625
  };
609
626
  await writeWal(filePath, wal);
@@ -631,7 +648,7 @@ async function recoverCoderSettlement(directory, taskId) {
631
648
  awaitingMergeByCallID,
632
649
  finishStandardWorktreeDispatch,
633
650
  standardWorktreeByCallID
634
- } = await import("./worktree-isolation-0b0jy6dt.js");
651
+ } = await import("./worktree-isolation-w4nq6yzp.js");
635
652
  const descriptor = wal.worktree;
636
653
  const reconstructedDispatch = {
637
654
  callID: descriptor.callID,
@@ -676,7 +693,8 @@ async function recoverCoderSettlement(directory, taskId) {
676
693
  wal = {
677
694
  ...wal,
678
695
  state: "PREPARED",
679
- accepted: observed2.length > 0,
696
+ accepted,
697
+ settlementFailed,
680
698
  testEngineerExempt: isMarkdownOnlyTaskChange(wal.context.declaredFiles, observed2)
681
699
  };
682
700
  await writeWal(filePath, wal);
@@ -705,6 +723,7 @@ async function recoverCoderSettlement(directory, taskId) {
705
723
  return recovered;
706
724
  }
707
725
  const rawObserved = await changedFilesSinceSnapshotAsync(directory, wal.context.baseline);
726
+ const unattributedEmptyScopeMutation = hasUnattributedEmptyScopeMutation(wal.context.declaredFiles, rawObserved);
708
727
  let observed;
709
728
  if (rawObserved === null) {
710
729
  if (baselineAttributionDoomed(wal.context.baseline)) {
@@ -717,7 +736,7 @@ async function recoverCoderSettlement(directory, taskId) {
717
736
  } else if (wal.context.declaredFiles === null) {
718
737
  observed = [];
719
738
  } else {
720
- observed = rawObserved.filter((filePath2) => isPathWithinDeclaredScope(filePath2, wal.context.declaredFiles ?? [], directory));
739
+ observed = unattributedEmptyScopeMutation ? rawObserved : rawObserved.filter((filePath2) => isPathWithinDeclaredScope(filePath2, wal.context.declaredFiles ?? [], directory));
721
740
  }
722
741
  if (observed === null) {
723
742
  throw new Error(`CODER_SETTLEMENT_RECOVERY_UNCERTAIN: transition ${wal.transitionId} for task ${taskId} workspace changes could not be attributed 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.`);
@@ -726,6 +745,7 @@ async function recoverCoderSettlement(directory, taskId) {
726
745
  ...wal,
727
746
  state: "PREPARED",
728
747
  accepted: observed.length > 0,
748
+ settlementFailed: wal.settlementFailed === true || unattributedEmptyScopeMutation,
729
749
  testEngineerExempt: isMarkdownOnlyTaskChange(wal.context.declaredFiles, observed)
730
750
  };
731
751
  await writeWal(filePath, wal);
@@ -912,4 +932,4 @@ var _internals = {
912
932
  recoverCoderSettlement
913
933
  };
914
934
 
915
- export { beginCoderSettlement, settleCoderDispatch, abortCoderSettlement, transferCoderSettlementToBackground, abortCoderSettlementIfDoomed, recordCoderMergeProvenance, completeCoderSettlementCleanup, recoverCoderSettlement, releaseCoderDispatchOwnership, assertNoUnsettledCoderDispatch, listCoderSettlementWalStates, recoverStaleCoderSettlements, _internals };
935
+ export { hasUnattributedEmptyScopeMutation, beginCoderSettlement, settleCoderDispatch, abortCoderSettlement, transferCoderSettlementToBackground, abortCoderSettlementIfDoomed, recordCoderMergeProvenance, completeCoderSettlementCleanup, recoverCoderSettlement, releaseCoderDispatchOwnership, assertNoUnsettledCoderDispatch, listCoderSettlementWalStates, recoverStaleCoderSettlements, _internals };
@@ -23,68 +23,69 @@ import {
23
23
  resolveFallbackModel,
24
24
  resolvePrimaryAgentNames,
25
25
  stripSwarmPrefix
26
- } from "./index-9yvjwfay.js";
27
- import"./index-pq6vr26z.js";
26
+ } from "./index-2wn8ww1e.js";
27
+ import"./index-rpsmx4ke.js";
28
28
  import"./index-hamqvzqn.js";
29
- import"./index-4t0wd9sv.js";
30
- import"./index-46z4c89b.js";
31
- import"./index-r30xs0wp.js";
32
- import"./index-nvm6mxep.js";
33
- import"./index-z8smhv7k.js";
29
+ import"./index-6g664sy8.js";
30
+ import"./index-xka1cq9k.js";
31
+ import"./index-6ayk7a3q.js";
32
+ import"./index-5r5s0dbb.js";
33
+ import"./index-ya32wfkp.js";
34
34
  import"./index-txdagbh7.js";
35
- import"./index-6b4vkz6q.js";
35
+ import"./index-x9wpvhpk.js";
36
36
  import"./index-6b295cas.js";
37
- import"./index-j40czc9v.js";
38
- import"./index-152b9c6m.js";
39
- import"./index-3fhg7pqf.js";
37
+ import"./index-zvbn85q0.js";
38
+ import"./index-hkqd9jz6.js";
39
+ import"./index-amhr3swp.js";
40
40
  import {
41
41
  createExplorerAgent
42
42
  } from "./index-rdec0y3z.js";
43
- import"./index-e90m050y.js";
43
+ import"./index-ar2gsn6b.js";
44
44
  import"./index-cjapb4hy.js";
45
45
  import"./index-zsrtt42s.js";
46
- import"./index-me39468k.js";
47
- import"./index-6h81yvyc.js";
48
- import"./index-0bpr8vag.js";
46
+ import"./index-8chh1c96.js";
47
+ import"./index-131ay7x1.js";
48
+ import"./index-3n5zsp31.js";
49
49
  import"./index-pt7h91zc.js";
50
50
  import"./index-q7sjgr1y.js";
51
- import"./index-t26gj2fh.js";
52
- import"./index-ad3yskxy.js";
53
- import"./index-4gr9pj67.js";
54
- import"./index-nm8ma9xb.js";
55
- import"./index-z3b157ew.js";
56
- import"./index-nmh0s6dg.js";
51
+ import"./index-jct9kb50.js";
52
+ import"./index-279xp2be.js";
53
+ import"./index-rp6sfpwp.js";
54
+ import"./index-peg6sftq.js";
55
+ import"./index-rr1m7cc6.js";
56
+ import"./index-wy3zpwjy.js";
57
57
  import"./index-2s7dvzff.js";
58
- import"./index-5wk0etp8.js";
59
- import"./index-v3hpsxvd.js";
58
+ import"./index-w6agyrzs.js";
59
+ import"./index-earq3mda.js";
60
60
  import"./index-rtry5xyf.js";
61
- import"./index-edrgc139.js";
61
+ import"./index-bga7w4rt.js";
62
62
  import"./index-frcemc0b.js";
63
63
  import"./index-0725jpp7.js";
64
- import"./index-njf5pbkm.js";
65
- import"./index-51xtrf7g.js";
66
- import"./index-mn5zzmqx.js";
67
- import"./index-w81jmdkt.js";
68
- import"./index-3rb5gs4w.js";
69
- import"./index-08x7gsnf.js";
64
+ import"./index-zmgs43tw.js";
65
+ import"./index-b0qyb790.js";
66
+ import"./index-jvk95e6y.js";
67
+ import"./index-456awy1p.js";
68
+ import"./index-f0nj3d8z.js";
69
+ import"./index-w9hxzcz4.js";
70
70
  import"./index-rdm3px0g.js";
71
71
  import"./index-ry16d01s.js";
72
- import"./index-1d6ssjcj.js";
73
- import"./index-qyx53xrz.js";
72
+ import"./index-zzvxj02e.js";
73
+ import"./index-zq40mkha.js";
74
74
  import"./index-vzm6zre7.js";
75
75
  import"./index-ae75rja9.js";
76
- import"./index-74x26wyj.js";
77
- import"./index-01wt209s.js";
78
- import"./index-fbhtb6f5.js";
79
- import"./index-1xnse449.js";
76
+ import"./index-475bkab8.js";
77
+ import"./index-xf69xty9.js";
78
+ import"./index-t7hmqgjy.js";
79
+ import"./index-x1gyqgze.js";
80
+ import"./index-mc72pk74.js";
80
81
  import"./index-c1ggtmpm.js";
81
82
  import"./index-ejhxgyvm.js";
82
83
  import"./index-7g4c7s5r.js";
83
- import"./index-5cve9g2b.js";
84
+ import"./index-k53a69vb.js";
84
85
  import"./index-gx2vp8gx.js";
85
- import"./index-t1swv35d.js";
86
+ import"./index-dm2ydm2b.js";
86
87
  import"./index-zxdawwc7.js";
87
- import"./index-ysr6n4ca.js";
88
+ import"./index-j2xcdbfd.js";
88
89
  import"./index-wzec3c4g.js";
89
90
  import"./index-bk5tah7q.js";
90
91
  import"./index-gknz3bv1.js";
@@ -2,10 +2,10 @@
2
2
  import {
3
3
  readKnowledge,
4
4
  transactKnowledge
5
- } from "./index-qyx53xrz.js";
5
+ } from "./index-zq40mkha.js";
6
6
  import {
7
7
  resolveKnowledgeStoreDir
8
- } from "./index-74x26wyj.js";
8
+ } from "./index-475bkab8.js";
9
9
  import {
10
10
  init_git_executable,
11
11
  resolveGitExecutableAsync
@@ -1,35 +1,35 @@
1
1
  // @bun
2
2
  import {
3
3
  validateSwarmPath
4
- } from "./index-nmh0s6dg.js";
4
+ } from "./index-wy3zpwjy.js";
5
5
  import {
6
6
  deleteCoordinationState,
7
7
  importCoordinationOnce,
8
8
  listCoordinationStates,
9
9
  transitionCoordinationState,
10
10
  withCoordinationTransaction
11
- } from "./index-3rb5gs4w.js";
11
+ } from "./index-f0nj3d8z.js";
12
12
  import {
13
13
  getProjectDb,
14
14
  projectDbExists
15
- } from "./index-08x7gsnf.js";
15
+ } from "./index-w9hxzcz4.js";
16
16
  import {
17
17
  observeStoreHealth
18
- } from "./index-1d6ssjcj.js";
18
+ } from "./index-zzvxj02e.js";
19
19
  import {
20
20
  withEvidenceLock
21
- } from "./index-01wt209s.js";
21
+ } from "./index-xf69xty9.js";
22
22
  import {
23
23
  telemetry
24
- } from "./index-fbhtb6f5.js";
24
+ } from "./index-x1gyqgze.js";
25
25
  import {
26
26
  canonicalRootKey,
27
27
  canonicalRootKeyFresh,
28
28
  sameProjectRoot
29
- } from "./index-1xnse449.js";
29
+ } from "./index-mc72pk74.js";
30
30
  import {
31
31
  atomicWriteSwarmFileSync
32
- } from "./index-5cve9g2b.js";
32
+ } from "./index-k53a69vb.js";
33
33
  import {
34
34
  exports_external,
35
35
  init_zod
@@ -2,20 +2,22 @@
2
2
  import {
3
3
  derivePlanId,
4
4
  derivePlanIdentityHash
5
- } from "./index-3rb5gs4w.js";
5
+ } from "./index-f0nj3d8z.js";
6
6
  import {
7
7
  getProjectDb,
8
8
  projectDbExists,
9
9
  withImmediateTransaction,
10
10
  withProjectDbReadOnly
11
- } from "./index-08x7gsnf.js";
11
+ } from "./index-w9hxzcz4.js";
12
12
  import {
13
- assertProjectRoot,
14
13
  withEvidenceLock
15
- } from "./index-01wt209s.js";
14
+ } from "./index-xf69xty9.js";
15
+ import {
16
+ assertProjectRoot
17
+ } from "./index-t7hmqgjy.js";
16
18
  import {
17
19
  emit
18
- } from "./index-fbhtb6f5.js";
20
+ } from "./index-x1gyqgze.js";
19
21
  import {
20
22
  ExecutionProfileSchema,
21
23
  PlanSchema,
@@ -25,11 +27,11 @@ import {
25
27
  import {
26
28
  init_loader,
27
29
  loadPluginConfig
28
- } from "./index-t1swv35d.js";
30
+ } from "./index-dm2ydm2b.js";
29
31
  import {
30
32
  init_package,
31
33
  package_default
32
- } from "./index-ysr6n4ca.js";
34
+ } from "./index-j2xcdbfd.js";
33
35
  import {
34
36
  criticalWarn,
35
37
  init_logger,
@@ -1235,7 +1237,7 @@ async function readLedgerEvents(directory) {
1235
1237
  const events = result.truncated ? result.lenientEvents ?? result.events : result.events;
1236
1238
  return [...events].sort((a, b) => a.seq - b.seq);
1237
1239
  }
1238
- async function initLedger(directory, planId, initialPlanHash, initialPlan) {
1240
+ async function initLedger(directory, planId, initialPlanHash, initialPlan, options) {
1239
1241
  assertProjectRoot(directory);
1240
1242
  const ledgerPath = getLedgerPath(directory);
1241
1243
  const planJsonPath = getPlanJsonPath(directory);
@@ -1275,10 +1277,12 @@ async function initLedger(directory, planId, initialPlanHash, initialPlan) {
1275
1277
  const tempPath = `${ledgerPath}.tmp.${Date.now()}.${Math.floor(Math.random() * 1e9)}`;
1276
1278
  const line = `${JSON.stringify(event)}
1277
1279
  `;
1280
+ options?.preCommitCheck?.();
1278
1281
  writeFileFsyncedThenRename(tempPath, ledgerPath, line);
1279
1282
  const initialized = readFileLedgerExact(directory);
1280
1283
  if (hasSqliteLedger(directory)) {
1281
1284
  const priorMode = getPlanLedgerState(directory)?.authorityMode ?? "file_shadow";
1285
+ options?.preCommitCheck?.();
1282
1286
  try {
1283
1287
  replaceSqliteLedger(directory, {
1284
1288
  canonicalEvents: initialized.lines,
@@ -1424,6 +1428,7 @@ async function appendLedgerEvent(directory, eventInput, options) {
1424
1428
  const state = getPlanLedgerState(directory);
1425
1429
  const authorityMode = state?.authorityMode ?? "file_shadow";
1426
1430
  if (authorityMode === "sqlite") {
1431
+ options?.preCommitCheck?.();
1427
1432
  try {
1428
1433
  const existing = sqliteEventsAsLedger(directory);
1429
1434
  appendSqliteLedger(directory, {
@@ -1448,6 +1453,7 @@ async function appendLedgerEvent(directory, eventInput, options) {
1448
1453
  throw new Error("Ledger not initialized. Call initLedger() first.");
1449
1454
  }
1450
1455
  const existingContent = fs.readFileSync(ledgerPath);
1456
+ options?.preCommitCheck?.();
1451
1457
  writeFileFsyncedThenRename(tempPath, ledgerPath, Buffer.concat([
1452
1458
  existingContent,
1453
1459
  Buffer.from(canonicalEvent),
@@ -1479,7 +1485,8 @@ async function appendLedgerEventWithRetry(directory, eventInput, options) {
1479
1485
  try {
1480
1486
  return await appendLedgerEvent(directory, eventInput, {
1481
1487
  expectedHash: currentExpected,
1482
- planHashAfter: options.planHashAfter
1488
+ planHashAfter: options.planHashAfter,
1489
+ preCommitCheck: options.preCommitCheck
1483
1490
  });
1484
1491
  } catch (error) {
1485
1492
  if (!(error instanceof LedgerStaleWriterError) || attempt >= maxRetries) {
@@ -1534,6 +1541,7 @@ async function takeSnapshotEvent(directory, plan, options) {
1534
1541
  snapshotPayload.approval = options.approvalMetadata;
1535
1542
  }
1536
1543
  const planId = derivePlanId(plan);
1544
+ options?.preCommitCheck?.();
1537
1545
  return appendLedgerEvent(directory, {
1538
1546
  event_type: "snapshot",
1539
1547
  source: options?.source ?? "takeSnapshotEvent",
@@ -1542,7 +1550,8 @@ async function takeSnapshotEvent(directory, plan, options) {
1542
1550
  }, {
1543
1551
  planHashAfter: options?.planHashAfter,
1544
1552
  expectedSeq: options?.expectedSeq,
1545
- expectedLedgerHash: options?.expectedLedgerHash
1553
+ expectedLedgerHash: options?.expectedLedgerHash,
1554
+ preCommitCheck: options?.preCommitCheck
1546
1555
  });
1547
1556
  }
1548
1557
  async function replaceTruncatedLedgerWithRecoveryRoot(directory, plan, expected) {
@@ -1649,12 +1658,13 @@ async function clearPlanLedgerForReset(directory) {
1649
1658
  }
1650
1659
  });
1651
1660
  }
1652
- async function replacePlanLedgerWithRoot(directory, plan, source) {
1661
+ async function replacePlanLedgerWithRoot(directory, plan, source, options) {
1653
1662
  assertProjectRoot(directory);
1654
1663
  const validated = PlanSchema.parse(plan);
1655
1664
  await withEvidenceLock(directory, LEDGER_LOCK_PATH, "plan-ledger", "replace-plan-ledger-root", async () => {
1656
1665
  const ledgerPath = getLedgerPath(directory);
1657
1666
  if (fs.existsSync(ledgerPath)) {
1667
+ options?.preCommitCheck?.();
1658
1668
  archiveLegacyLedger(directory, fs.readFileSync(ledgerPath));
1659
1669
  }
1660
1670
  const planHash = computePlanLedgerHash(validated);
@@ -1676,7 +1686,9 @@ async function replacePlanLedgerWithRoot(directory, plan, source) {
1676
1686
  const line = new TextEncoder().encode(serializeLedgerEvent(root));
1677
1687
  const priorMode = getPlanLedgerState(directory)?.authorityMode ?? "file_shadow";
1678
1688
  if (priorMode === "file_shadow") {
1689
+ options?.preCommitCheck?.();
1679
1690
  writePortableLedger(directory, [line]);
1691
+ options?.preCommitCheck?.();
1680
1692
  try {
1681
1693
  replaceSqliteLedger(directory, {
1682
1694
  canonicalEvents: [line],
@@ -1690,6 +1702,7 @@ async function replacePlanLedgerWithRoot(directory, plan, source) {
1690
1702
  }
1691
1703
  return;
1692
1704
  }
1705
+ options?.preCommitCheck?.();
1693
1706
  replaceSqliteLedger(directory, {
1694
1707
  canonicalEvents: [line],
1695
1708
  state: stateForEvents(directory, [root], priorMode),
@@ -1697,6 +1710,7 @@ async function replacePlanLedgerWithRoot(directory, plan, source) {
1697
1710
  mode: priorMode,
1698
1711
  version: package_default.version
1699
1712
  });
1713
+ options?.preCommitCheck?.();
1700
1714
  try {
1701
1715
  writePortableLedger(directory, [line]);
1702
1716
  } catch (error) {
@@ -1739,12 +1753,16 @@ async function peekPlanFromLedger(directory, _options) {
1739
1753
  };
1740
1754
  }
1741
1755
  async function replayFromLedgerWithStatus(directory, _options) {
1742
- const { events, truncated, badSuffix } = await readLedgerEventsWithIntegrity(directory);
1756
+ const integrity = await readLedgerEventsWithIntegrity(directory);
1757
+ _options?.preCommitCheck?.();
1758
+ const { events, truncated, badSuffix } = integrity;
1743
1759
  if (events.length === 0) {
1744
1760
  return { plan: null, truncated, badSuffix };
1745
1761
  }
1746
1762
  if (truncated && badSuffix !== null) {
1747
- await quarantineLedgerSuffix(directory, badSuffix);
1763
+ await quarantineLedgerSuffix(directory, badSuffix, {
1764
+ preCommitCheck: _options?.preCommitCheck
1765
+ });
1748
1766
  }
1749
1767
  const plan = reconstructPlanFromEvents(directory, events);
1750
1768
  return { plan, truncated, badSuffix };
@@ -1916,7 +1934,7 @@ async function readLedgerEventsWithIntegrity(directory, options) {
1916
1934
  throw error;
1917
1935
  }
1918
1936
  }
1919
- async function quarantineLedgerSuffix(directory, badSuffix) {
1937
+ async function quarantineLedgerSuffix(directory, badSuffix, options) {
1920
1938
  let salvagedCount = 0;
1921
1939
  for (const line of badSuffix.split(`
1922
1940
  `)) {
@@ -1927,6 +1945,7 @@ async function quarantineLedgerSuffix(directory, badSuffix) {
1927
1945
  salvagedCount++;
1928
1946
  } catch {}
1929
1947
  }
1948
+ let quarantinePath;
1930
1949
  try {
1931
1950
  assertProjectRoot(directory);
1932
1951
  const hash = crypto.createHash("sha256").update(badSuffix, "utf8").digest("hex").slice(0, 12);
@@ -1940,7 +1959,12 @@ async function quarantineLedgerSuffix(directory, badSuffix) {
1940
1959
  }
1941
1960
  }
1942
1961
  } catch {}
1943
- const quarantinePath = path2.join(swarmDir, `plan-ledger.quarantine.${Date.now()}.${hash}`);
1962
+ quarantinePath = path2.join(swarmDir, `plan-ledger.quarantine.${Date.now()}.${hash}`);
1963
+ } catch {
1964
+ return { path: null, salvagedCount };
1965
+ }
1966
+ options?.preCommitCheck?.();
1967
+ try {
1944
1968
  fs.writeFileSync(quarantinePath, badSuffix, "utf8");
1945
1969
  log(`[ledger] Corrupted suffix quarantined to ${path2.relative(directory, quarantinePath)} (salvageable events: ${salvagedCount})`);
1946
1970
  return { path: quarantinePath, salvagedCount };
@@ -2,10 +2,10 @@
2
2
  import {
3
3
  init_loader,
4
4
  loadPluginConfigWithMeta
5
- } from "./index-t1swv35d.js";
5
+ } from "./index-dm2ydm2b.js";
6
6
  import {
7
7
  init_schema
8
- } from "./index-ysr6n4ca.js";
8
+ } from "./index-j2xcdbfd.js";
9
9
  import {
10
10
  DEFAULT_WORKTREE_ISOLATION_CONFIG,
11
11
  init_constants
@@ -13,7 +13,7 @@ import {
13
13
  PluginConfigSchema,
14
14
  init_schema,
15
15
  resolveExternalSkillsConfig
16
- } from "./index-ysr6n4ca.js";
16
+ } from "./index-j2xcdbfd.js";
17
17
  import {
18
18
  DangerousMergeKeyError,
19
19
  MAX_MERGE_DEPTH,
@@ -11,7 +11,7 @@ import {
11
11
  readLinkPointer,
12
12
  resolveKnowledgeStoreDir,
13
13
  resolveLinkDir
14
- } from "./index-74x26wyj.js";
14
+ } from "./index-475bkab8.js";
15
15
 
16
16
  // src/knowledge/curation-policy.ts
17
17
  import { readFile as readFile2 } from "fs/promises";
@@ -4,7 +4,7 @@ import {
4
4
  getProjectDb,
5
5
  projectDbExists,
6
6
  withImmediateTransaction
7
- } from "./index-08x7gsnf.js";
7
+ } from "./index-w9hxzcz4.js";
8
8
 
9
9
  // src/db/coordination-store.ts
10
10
  import { createHash } from "crypto";
@@ -3,7 +3,7 @@ import {
3
3
  queryHistoricalOutcomes,
4
4
  readKnowledgeEvents,
5
5
  recordKnowledgeEvent
6
- } from "./index-z3b157ew.js";
6
+ } from "./index-rr1m7cc6.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-qyx53xrz.js";
14
+ } from "./index-zq40mkha.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-vndnwdj6.js");
227
+ const { quarantineEntry } = await import("./knowledge-validator-k0q00zsj.js");
228
228
  let policyConfig;
229
229
  try {
230
- const { KnowledgeConfigSchema } = await import("./schema-cyet68tw.js");
231
- const { loadPluginConfigWithMeta } = await import("./index-fs9y88h1.js");
230
+ const { KnowledgeConfigSchema } = await import("./schema-80nb4z6k.js");
231
+ const { loadPluginConfigWithMeta } = await import("./index-q5115jpe.js");
232
232
  const { config: loadedConfig } = loadPluginConfigWithMeta(directory);
233
233
  policyConfig = KnowledgeConfigSchema.parse(loadedConfig.knowledge ?? {});
234
234
  } catch {
@@ -21,7 +21,7 @@ var package_default;
21
21
  var init_package = __esm(() => {
22
22
  package_default = {
23
23
  name: "opencode-swarm",
24
- version: "7.184.0",
24
+ version: "7.184.2",
25
25
  description: "Architect-centric agentic swarm plugin for OpenCode - hub-and-spoke orchestration with SME consultation, code generation, and QA review",
26
26
  main: "dist/index.js",
27
27
  types: "dist/index.d.ts",