opencode-swarm 7.184.0 → 7.184.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.
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-yvpewr52.js} +15 -12
  11. package/dist/cli/{config-doctor-y0bpap07.js → config-doctor-qgwpvrbz.js} +2 -2
  12. package/dist/cli/{core-7f955h2f.js → core-9qt388hq.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-wf0sm2te.js} +9 -9
  15. package/dist/cli/{curator-m7enwwz2.js → curator-ffz5pxgc.js} +40 -39
  16. package/dist/cli/curator-llm-factory-drs36v1q.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-8dfzjnxe.js} +21 -20
  19. package/dist/cli/{gate-evidence-nktrs0w2.js → gate-evidence-aa5q30f4.js} +14 -7
  20. package/dist/cli/guardrail-explain-9g5y2gjm.js +76 -0
  21. package/dist/cli/{guardrail-log-dppv6tgn.js → guardrail-log-0g51p94w.js} +8 -8
  22. package/dist/cli/{guardrail-reset-btzq4ses.js → guardrail-reset-dcbmt2wr.js} +40 -39
  23. package/dist/cli/{hive-promoter-yp1baj9z.js → hive-promoter-2g8nga0y.js} +40 -39
  24. package/dist/cli/{index-r30xs0wp.js → index-046psajf.js} +1 -1
  25. package/dist/cli/{index-ysr6n4ca.js → index-0874kghs.js} +1 -1
  26. package/dist/cli/{index-6h81yvyc.js → index-131ay7x1.js} +3 -3
  27. package/dist/cli/{index-4gr9pj67.js → index-2c91cxdv.js} +4 -4
  28. package/dist/cli/{index-pq6vr26z.js → index-32vszgv0.js} +3 -3
  29. package/dist/cli/{index-0bpr8vag.js → index-3n5zsp31.js} +2 -2
  30. package/dist/cli/{index-152b9c6m.js → index-3skvygca.js} +5 -5
  31. package/dist/cli/{index-w81jmdkt.js → index-456awy1p.js} +2 -2
  32. package/dist/cli/{index-74x26wyj.js → index-475bkab8.js} +2 -2
  33. package/dist/cli/{index-t1swv35d.js → index-49ptc9xx.js} +1 -1
  34. package/dist/cli/{index-nm8ma9xb.js → index-57swfxyp.js} +8 -8
  35. package/dist/cli/{index-me39468k.js → index-5ppx86w1.js} +38 -18
  36. package/dist/cli/{index-njf5pbkm.js → index-6b427dy8.js} +6 -6
  37. package/dist/cli/{index-edrgc139.js → index-6cvdk98y.js} +2 -2
  38. package/dist/cli/{index-4t0wd9sv.js → index-6g664sy8.js} +1 -1
  39. package/dist/cli/{index-t26gj2fh.js → index-76abqm8d.js} +2 -2
  40. package/dist/cli/{index-nvm6mxep.js → index-7hvy33gc.js} +271 -80
  41. package/dist/cli/{index-6b4vkz6q.js → index-7p4ym4q3.js} +1 -1
  42. package/dist/cli/{index-rwfmx7vn.js → index-aghd9kcx.js} +2 -2
  43. package/dist/cli/{index-e90m050y.js → index-ar2gsn6b.js} +8 -8
  44. package/dist/cli/{index-fs9y88h1.js → index-dbshccrr.js} +3 -3
  45. package/dist/cli/{index-ad3yskxy.js → index-depfky1j.js} +158 -27
  46. package/dist/cli/{index-v3hpsxvd.js → index-earq3mda.js} +1 -1
  47. package/dist/cli/{index-b5mkznms.js → index-ejb7ejhd.js} +1 -1
  48. package/dist/cli/{index-3rb5gs4w.js → index-f0nj3d8z.js} +1 -1
  49. package/dist/cli/{index-5wk0etp8.js → index-gsgy1psq.js} +4 -4
  50. package/dist/cli/{index-qyx53xrz.js → index-jc8pcf0r.js} +7 -7
  51. package/dist/cli/{index-3fhg7pqf.js → index-jkxef52n.js} +2 -2
  52. package/dist/cli/{index-mn5zzmqx.js → index-jvk95e6y.js} +2 -2
  53. package/dist/cli/{index-5cve9g2b.js → index-k53a69vb.js} +6 -6
  54. package/dist/cli/{index-1xnse449.js → index-mc72pk74.js} +1 -1
  55. package/dist/cli/{index-bf1726rj.js → index-mz4zz59c.js} +42 -41
  56. package/dist/cli/{index-j40czc9v.js → index-n107956q.js} +5 -5
  57. package/dist/cli/{index-z3b157ew.js → index-qczxr0wh.js} +12 -10
  58. package/dist/cli/{index-9yvjwfay.js → index-s7bseqza.js} +3156 -1887
  59. package/dist/cli/{index-01wt209s.js → index-t7hmqgjy.js} +90 -141
  60. package/dist/cli/{index-08x7gsnf.js → index-w9hxzcz4.js} +2 -2
  61. package/dist/cli/{index-51xtrf7g.js → index-wfdx7yw2.js} +39 -15
  62. package/dist/cli/{index-079xzcxb.js → index-wsb0wbw6.js} +40 -39
  63. package/dist/cli/{index-nmh0s6dg.js → index-wy3zpwjy.js} +1 -1
  64. package/dist/cli/{index-fbhtb6f5.js → index-x1gyqgze.js} +7 -7
  65. package/dist/cli/index-xf69xty9.js +105 -0
  66. package/dist/cli/{index-z8smhv7k.js → index-ya32wfkp.js} +4 -2
  67. package/dist/cli/{index-46z4c89b.js → index-yk0r42nr.js} +4 -4
  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-pt21q3eh.js} +14 -13
  71. package/dist/cli/{knowledge-events-31nga9yt.js → knowledge-events-hp96b55k.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-rnw1e7zp.js} +7 -6
  74. package/dist/cli/{knowledge-validator-vndnwdj6.js → knowledge-validator-xy7r6eyx.js} +9 -8
  75. package/dist/cli/{mcp-taace90a.js → mcp-3nd85kww.js} +15 -1
  76. package/dist/cli/mcp.d.ts +1 -0
  77. package/dist/cli/{model-preflight-bv8nvjjx.js → model-preflight-xe0chjad.js} +40 -39
  78. package/dist/cli/{pending-delegations-kwdk8j9d.js → pending-delegations-2pdngdzq.js} +13 -12
  79. package/dist/cli/{pr-subscriptions-w2fwdpkk.js → pr-subscriptions-hxxwszyr.js} +13 -12
  80. package/dist/cli/{pr-workflow-gate-sqjc6jmd.js → pr-workflow-gate-m37ynr6h.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-be9hbq1v.js} +8 -7
  83. package/dist/cli/{schema-cyet68tw.js → schema-j17hv98z.js} +1 -1
  84. package/dist/cli/{scope-persistence-rg8v0r8q.js → scope-persistence-rmt56rma.js} +16 -15
  85. package/dist/cli/{server-765s4stz.js → server-wzrb59mh.js} +40 -39
  86. package/dist/cli/{skill-generator-qg5m18k7.js → skill-generator-vsfya55z.js} +16 -15
  87. package/dist/cli/{snapshot-coordination-init-zzs4bkmj.js → snapshot-coordination-init-pc8ykvh8.js} +40 -39
  88. package/dist/cli/{speckit-checkoff-2bsm6p0c.js → speckit-checkoff-j407j8ew.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-je4fb407.js} +14 -13
  92. package/dist/cli/{worktree-isolation-0b0jy6dt.js → worktree-isolation-27rt584e.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
@@ -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.1",
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",
@@ -1,17 +1,17 @@
1
1
  // @bun
2
2
  import {
3
3
  validateSwarmPath
4
- } from "./index-nmh0s6dg.js";
4
+ } from "./index-wy3zpwjy.js";
5
5
  import {
6
6
  bunSpawn
7
7
  } from "./index-2s7dvzff.js";
8
8
  import {
9
9
  canonicalRootKey,
10
10
  sameProjectRoot
11
- } from "./index-1xnse449.js";
11
+ } from "./index-mc72pk74.js";
12
12
  import {
13
13
  atomicWriteSwarmFile
14
- } from "./index-5cve9g2b.js";
14
+ } from "./index-k53a69vb.js";
15
15
  import {
16
16
  init_git_executable,
17
17
  resolveGitExecutable
@@ -1,16 +1,16 @@
1
1
  // @bun
2
2
  import {
3
3
  validateSwarmPath
4
- } from "./index-nmh0s6dg.js";
4
+ } from "./index-wy3zpwjy.js";
5
5
  import {
6
6
  bunSpawn
7
7
  } from "./index-2s7dvzff.js";
8
8
  import {
9
9
  canonicalRootKeyFresh
10
- } from "./index-1xnse449.js";
10
+ } from "./index-mc72pk74.js";
11
11
  import {
12
12
  atomicWriteSwarmFileSync
13
- } from "./index-5cve9g2b.js";
13
+ } from "./index-k53a69vb.js";
14
14
  import {
15
15
  advisoryWarn,
16
16
  init_git_executable,
@@ -242,7 +242,7 @@ var _internals2 = {
242
242
  symlinkSync: fs2.symlinkSync
243
243
  },
244
244
  writeScopeToDisk: async (directory, taskId, files) => {
245
- const { writeScopeToDisk: realWrite } = await import("./scope-persistence-rg8v0r8q.js");
245
+ const { writeScopeToDisk: realWrite } = await import("./scope-persistence-rmt56rma.js");
246
246
  return realWrite(directory, taskId, files);
247
247
  },
248
248
  writeLaneProfileToDisk: async (_worktreePath, _laneIndex, _envOverrides) => {
@@ -1,14 +1,14 @@
1
1
  // @bun
2
2
  import {
3
3
  observeStoreHealth
4
- } from "./index-1d6ssjcj.js";
4
+ } from "./index-zzvxj02e.js";
5
5
  import {
6
6
  telemetry
7
- } from "./index-fbhtb6f5.js";
7
+ } from "./index-x1gyqgze.js";
8
8
  import {
9
9
  init_schema,
10
10
  stripKnownSwarmPrefix
11
- } from "./index-ysr6n4ca.js";
11
+ } from "./index-0874kghs.js";
12
12
  import {
13
13
  init_constants
14
14
  } from "./index-wzec3c4g.js";
@@ -1,10 +1,10 @@
1
1
  // @bun
2
2
  import {
3
3
  validateSwarmPath
4
- } from "./index-nmh0s6dg.js";
4
+ } from "./index-wy3zpwjy.js";
5
5
  import {
6
6
  atomicWriteSwarmFileSync
7
- } from "./index-5cve9g2b.js";
7
+ } from "./index-k53a69vb.js";
8
8
 
9
9
  // src/hooks/delegation-gate/worktree-provisioning-owner.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-qczxr0wh.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-jc8pcf0r.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-xy7r6eyx.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-j17hv98z.js");
231
+ const { loadPluginConfigWithMeta } = await import("./index-dbshccrr.js");
232
232
  const { config: loadedConfig } = loadPluginConfigWithMeta(directory);
233
233
  policyConfig = KnowledgeConfigSchema.parse(loadedConfig.knowledge ?? {});
234
234
  } catch {
@@ -2,13 +2,13 @@
2
2
  import {
3
3
  derivePlanId,
4
4
  derivePlanIdentityHash
5
- } from "./index-3rb5gs4w.js";
5
+ } from "./index-f0nj3d8z.js";
6
6
  import {
7
7
  DURABILITY_CLASSES,
8
8
  getProjectDb,
9
9
  projectDbExists,
10
10
  withImmediateTransaction
11
- } from "./index-08x7gsnf.js";
11
+ } from "./index-w9hxzcz4.js";
12
12
  import {
13
13
  init_logger,
14
14
  warn
@@ -1,10 +1,10 @@
1
1
  // @bun
2
2
  import {
3
3
  atomicWriteFile
4
- } from "./index-01wt209s.js";
4
+ } from "./index-xf69xty9.js";
5
5
  import {
6
6
  canonicalRootKeyFresh
7
- } from "./index-1xnse449.js";
7
+ } from "./index-mc72pk74.js";
8
8
  import {
9
9
  init_logger,
10
10
  warn
@@ -13,7 +13,7 @@ import {
13
13
  PluginConfigSchema,
14
14
  init_schema,
15
15
  resolveExternalSkillsConfig
16
- } from "./index-ysr6n4ca.js";
16
+ } from "./index-0874kghs.js";
17
17
  import {
18
18
  DangerousMergeKeyError,
19
19
  MAX_MERGE_DEPTH,
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  validateSwarmPath
4
- } from "./index-nmh0s6dg.js";
4
+ } from "./index-wy3zpwjy.js";
5
5
  import {
6
6
  bunWrite
7
7
  } from "./index-2s7dvzff.js";
@@ -18,25 +18,25 @@ import {
18
18
  releaseCoordinationLease,
19
19
  transitionCoordinationState,
20
20
  withCoordinationTransaction
21
- } from "./index-3rb5gs4w.js";
21
+ } from "./index-f0nj3d8z.js";
22
22
  import {
23
23
  getProjectDb,
24
24
  projectDbExists
25
- } from "./index-08x7gsnf.js";
25
+ } from "./index-w9hxzcz4.js";
26
26
  import {
27
27
  observeDelegationLedgerPressure
28
- } from "./index-1d6ssjcj.js";
28
+ } from "./index-zzvxj02e.js";
29
29
  import {
30
30
  EvidenceLockTimeoutError,
31
31
  withEvidenceLock
32
- } from "./index-01wt209s.js";
32
+ } from "./index-xf69xty9.js";
33
33
  import {
34
34
  telemetry
35
- } from "./index-fbhtb6f5.js";
35
+ } from "./index-x1gyqgze.js";
36
36
  import {
37
37
  canonicalRootKeyFresh,
38
38
  sameProjectRoot
39
- } from "./index-1xnse449.js";
39
+ } from "./index-mc72pk74.js";
40
40
  import {
41
41
  exports_external,
42
42
  init_zod
@@ -4669,7 +4669,7 @@ async function reconcileLegacyCoderSettlements(directory, maxRecords, onReconcil
4669
4669
  const candidates = readDelegations(directory).filter((record) => record.normalizedAgent === "coder" && Boolean(record.legacyCoderSettlementTransfer) && Boolean(record.terminalResult)).slice(0, maxRecords);
4670
4670
  if (candidates.length === 0)
4671
4671
  return 0;
4672
- const { transferCoderSettlementToBackground } = await import("./coder-settlement-vrc5zxvv.js");
4672
+ const { transferCoderSettlementToBackground } = await import("./coder-settlement-yvpewr52.js");
4673
4673
  let transferred = 0;
4674
4674
  for (const record of candidates) {
4675
4675
  try {
@@ -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-depfky1j.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-27rt584e.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-27rt584e.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 };
@@ -1,10 +1,10 @@
1
1
  // @bun
2
2
  import {
3
3
  computePlanStructureHash
4
- } from "./index-51xtrf7g.js";
4
+ } from "./index-wfdx7yw2.js";
5
5
  import {
6
6
  appendCoreEventSync
7
- } from "./index-mn5zzmqx.js";
7
+ } from "./index-jvk95e6y.js";
8
8
  import {
9
9
  deleteCoordinationState,
10
10
  derivePlanId,
@@ -13,24 +13,24 @@ import {
13
13
  transitionCoordinationState,
14
14
  transitionCoordinationStateWithinTransaction,
15
15
  withCoordinationTransaction
16
- } from "./index-3rb5gs4w.js";
16
+ } from "./index-f0nj3d8z.js";
17
17
  import {
18
18
  getProjectDb
19
- } from "./index-08x7gsnf.js";
19
+ } from "./index-w9hxzcz4.js";
20
20
  import {
21
21
  canonicalExistingFilesystemPath,
22
22
  legacyCanonicalExistingFilesystemPath
23
23
  } from "./index-ry16d01s.js";
24
24
  import {
25
25
  assertProjectRoot
26
- } from "./index-01wt209s.js";
26
+ } from "./index-t7hmqgjy.js";
27
27
  import {
28
28
  require_proper_lockfile
29
29
  } from "./index-7g4c7s5r.js";
30
30
  import {
31
31
  atomicWriteSwarmFile,
32
32
  atomicWriteSwarmFileSync
33
- } from "./index-5cve9g2b.js";
33
+ } from "./index-k53a69vb.js";
34
34
  import {
35
35
  PlanSchema
36
36
  } from "./index-gx2vp8gx.js";
@@ -2,10 +2,10 @@
2
2
  import {
3
3
  init_loader,
4
4
  loadPluginConfigWithMeta
5
- } from "./index-t1swv35d.js";
5
+ } from "./index-49ptc9xx.js";
6
6
  import {
7
7
  init_schema
8
- } from "./index-ysr6n4ca.js";
8
+ } from "./index-0874kghs.js";
9
9
  import {
10
10
  DEFAULT_WORKTREE_ISOLATION_CONFIG,
11
11
  init_constants
@@ -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,
@@ -5,11 +5,11 @@ import {
5
5
  import {
6
6
  atomicWriteFileAnyRoot,
7
7
  atomicWriteSwarmFileSync
8
- } from "./index-5cve9g2b.js";
8
+ } from "./index-k53a69vb.js";
9
9
  import {
10
10
  init_loader,
11
11
  loadPluginConfig
12
- } from "./index-t1swv35d.js";
12
+ } from "./index-49ptc9xx.js";
13
13
  import {
14
14
  init_logger,
15
15
  log,