opencode-swarm 7.138.3 → 7.138.4

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 (56) hide show
  1. package/.opencode/skills/execute/SKILL.md +11 -2
  2. package/.opencode/skills/swarm-implement/SKILL.md +1 -1
  3. package/dist/cli/{config-doctor-2mwgdbsn.js → config-doctor-31yppse4.js} +2 -2
  4. package/dist/cli/{core-v6bte964.js → core-65c7rvqf.js} +1 -1
  5. package/dist/cli/{curation-policy-5dqexw5j.js → curation-policy-hs9pc1rp.js} +2 -2
  6. package/dist/cli/{curator-jjtp9hn2.js → curator-54n1y4j8.js} +16 -15
  7. package/dist/cli/{curator-llm-factory-wkjme59b.js → curator-llm-factory-wm27ra25.js} +16 -15
  8. package/dist/cli/{evidence-summary-service-6cttrkzw.js → evidence-summary-service-hrxcf29a.js} +1 -1
  9. package/dist/cli/{guardrail-explain-xppwfnxr.js → guardrail-explain-1729nse8.js} +17 -16
  10. package/dist/cli/{guardrail-log-swet7rch.js → guardrail-log-yjj5srkw.js} +4 -3
  11. package/dist/cli/{hive-promoter-xvq8jzbs.js → hive-promoter-es2x2b0e.js} +16 -15
  12. package/dist/cli/{index-1djv5684.js → index-1g6xpjk3.js} +4 -4
  13. package/dist/cli/{index-js7th5my.js → index-33q2gmgd.js} +1 -1
  14. package/dist/cli/{index-adde7nm2.js → index-50mwt8fx.js} +5 -5
  15. package/dist/cli/index-556ja8an.js +62 -0
  16. package/dist/cli/{index-93ky909v.js → index-57stye65.js} +1 -1
  17. package/dist/cli/{index-ab57h0yq.js → index-5q009kc4.js} +1 -1
  18. package/dist/cli/{index-99af5gvd.js → index-a18hk2fw.js} +211 -63
  19. package/dist/cli/{index-1v89yst3.js → index-a9xny52r.js} +2 -2
  20. package/dist/cli/{index-rjratees.js → index-c60whfgh.js} +1 -1
  21. package/dist/cli/{index-gda7cwqz.js → index-e1kgxchq.js} +30 -68
  22. package/dist/cli/{index-31vfewmn.js → index-gm3pjfhb.js} +271 -94
  23. package/dist/cli/{index-jhb8kjc5.js → index-jbge0dyh.js} +3 -3
  24. package/dist/cli/{index-xgmx9had.js → index-k27a4e5g.js} +18 -17
  25. package/dist/cli/{index-y6dvs5tt.js → index-m1pwkwfe.js} +1 -1
  26. package/dist/cli/{index-wqg74mwj.js → index-m40ea3zk.js} +1 -1
  27. package/dist/cli/{index-btx8j39p.js → index-m8txs2a9.js} +1 -1
  28. package/dist/cli/{index-y06a43sk.js → index-mycqmsz5.js} +4 -0
  29. package/dist/cli/index-smsy2p8n.js +1725 -0
  30. package/dist/cli/{index-tc61fybd.js → index-tjwz5tct.js} +2 -2
  31. package/dist/cli/{index-j0xx9wpj.js → index-y28n2wmq.js} +1 -1
  32. package/dist/cli/index.js +16 -15
  33. package/dist/cli/{knowledge-escalator-7n384ys1.js → knowledge-escalator-s6z1x65b.js} +3 -3
  34. package/dist/cli/{knowledge-events-yaj0yjd6.js → knowledge-events-nnyn6hst.js} +1 -1
  35. package/dist/cli/{knowledge-store-d99k0z2d.js → knowledge-store-x4yfc7v3.js} +1 -1
  36. package/dist/cli/{knowledge-validator-e5fqy9h4.js → knowledge-validator-1v047gsa.js} +4 -4
  37. package/dist/cli/{scan-cursor-9y9msabt.js → scan-cursor-jxajj6s7.js} +2 -2
  38. package/dist/cli/{schema-xg5f11md.js → schema-fj32eyae.js} +1 -1
  39. package/dist/cli/{scope-persistence-n1bryhzf.js → scope-persistence-w7zen2wz.js} +25 -2
  40. package/dist/cli/{skill-generator-arvwfdfh.js → skill-generator-rt0jqcsa.js} +5 -5
  41. package/dist/hooks/guardrails/destructive-command.d.ts +35 -0
  42. package/dist/hooks/guardrails/file-authority.d.ts +71 -26
  43. package/dist/hooks/guardrails/index.d.ts +2 -0
  44. package/dist/hooks/guardrails/tool-before.d.ts +5 -0
  45. package/dist/hooks/scope-guard.d.ts +3 -1
  46. package/dist/index.js +407 -395
  47. package/dist/scope/path-identity.d.ts +27 -0
  48. package/dist/scope/scope-binding.d.ts +90 -2
  49. package/dist/scope/scope-lease-renewal.d.ts +28 -0
  50. package/dist/scope/scope-persistence.d.ts +102 -19
  51. package/dist/scope/scope-resolution-diagnostic.d.ts +7 -0
  52. package/dist/tools/declare-scope.d.ts +3 -1
  53. package/dist/tools/save-plan.d.ts +2 -0
  54. package/dist/turbo/lean/lane-scope.d.ts +1 -1
  55. package/package.json +1 -1
  56. package/dist/cli/index-2y4jy0de.js +0 -642
@@ -16,13 +16,13 @@ import {
16
16
  } from "./index-rrxcfxrd.js";
17
17
  import {
18
18
  stableCanonicalStringify
19
- } from "./index-31vfewmn.js";
19
+ } from "./index-gm3pjfhb.js";
20
20
  import {
21
21
  detectStraySwarmDirs,
22
22
  readDoctorArtifact,
23
23
  removeStraySwarmDir,
24
24
  runConfigDoctor
25
- } from "./index-btx8j39p.js";
25
+ } from "./index-m8txs2a9.js";
26
26
  import {
27
27
  MAX_TRANSIENT_RETRIES,
28
28
  archiveEvidence,
@@ -59,7 +59,7 @@ import {
59
59
  savePlan,
60
60
  transientBackoff,
61
61
  validateProjectRoot
62
- } from "./index-y06a43sk.js";
62
+ } from "./index-mycqmsz5.js";
63
63
  import {
64
64
  EvaluationTaskV1Schema,
65
65
  GateAuditManifestV1Schema,
@@ -114,15 +114,15 @@ import {
114
114
  retireSkill,
115
115
  selectCandidateEntries,
116
116
  syncBundledProjectSkillsIfMissingAsync
117
- } from "./index-jhb8kjc5.js";
117
+ } from "./index-jbge0dyh.js";
118
118
  import {
119
119
  readRecentEscalations
120
- } from "./index-adde7nm2.js";
120
+ } from "./index-50mwt8fx.js";
121
121
  import {
122
122
  alreadyCuratedThisGeneration,
123
123
  claimNextScanBatch,
124
124
  resolveCohortId
125
- } from "./index-rjratees.js";
125
+ } from "./index-c60whfgh.js";
126
126
  import {
127
127
  CURATOR_INIT_PROMPT,
128
128
  CURATOR_PHASE_PROMPT,
@@ -175,11 +175,11 @@ import {
175
175
  validateActionableFields,
176
176
  validateLesson,
177
177
  validateSkillPath
178
- } from "./index-tc61fybd.js";
178
+ } from "./index-tjwz5tct.js";
179
179
  import {
180
180
  authorizeCuration,
181
181
  buildConfigFingerprintInput
182
- } from "./index-wqg74mwj.js";
182
+ } from "./index-m40ea3zk.js";
183
183
  import {
184
184
  cohortConfigFingerprint
185
185
  } from "./index-rtry5xyf.js";
@@ -212,7 +212,7 @@ import {
212
212
  transactFile,
213
213
  transactKnowledge,
214
214
  wordBigrams
215
- } from "./index-1djv5684.js";
215
+ } from "./index-1g6xpjk3.js";
216
216
  import {
217
217
  MAX_EVENT_LOG_ENTRIES,
218
218
  _internals,
@@ -222,7 +222,7 @@ import {
222
222
  recordHiveKnowledgeEvent,
223
223
  recordKnowledgeEvent,
224
224
  resolveKnowledgeEventsPath
225
- } from "./index-93ky909v.js";
225
+ } from "./index-57stye65.js";
226
226
  import {
227
227
  resolveHiveDataDir,
228
228
  resolveHiveEventsPath,
@@ -247,7 +247,7 @@ import {
247
247
  init_loader,
248
248
  loadPluginConfig,
249
249
  loadPluginConfigWithMeta
250
- } from "./index-y6dvs5tt.js";
250
+ } from "./index-m1pwkwfe.js";
251
251
  import {
252
252
  RetrospectiveEvidenceSchema
253
253
  } from "./index-gprxjmm7.js";
@@ -263,7 +263,7 @@ import {
263
263
  package_default,
264
264
  resolveAutoReviewConfig,
265
265
  stripKnownSwarmPrefix
266
- } from "./index-ab57h0yq.js";
266
+ } from "./index-5q009kc4.js";
267
267
  import {
268
268
  KNOWLEDGE_SCHEMA_VERSION,
269
269
  OUTCOME_BLOCK_THRESHOLD,
@@ -285,7 +285,7 @@ import {
285
285
  clearAllScopes,
286
286
  clearScopeBindingFromDisk,
287
287
  clearScopeBindings
288
- } from "./index-2y4jy0de.js";
288
+ } from "./index-smsy2p8n.js";
289
289
  import {
290
290
  appendLedgerEvent,
291
291
  computePlanHash,
@@ -5714,8 +5714,7 @@ function resetSwarmState() {
5714
5714
  for (const binding of clearScopeBindings()) {
5715
5715
  clearScopeBindingFromDisk({
5716
5716
  directory: binding.workspaceIdentity,
5717
- taskId: binding.taskId,
5718
- ownerSessionId: binding.ownerSessionId
5717
+ binding
5719
5718
  });
5720
5719
  }
5721
5720
  resetStandardWorktreeIsolationState();
@@ -5907,8 +5906,7 @@ function endAgentSession(sessionId) {
5907
5906
  for (const binding of removedBindings) {
5908
5907
  clearScopeBindingFromDisk({
5909
5908
  directory: binding.workspaceIdentity,
5910
- taskId: binding.taskId,
5911
- ownerSessionId: binding.ownerSessionId
5909
+ binding
5912
5910
  });
5913
5911
  }
5914
5912
  swarmState.agentSessions.delete(sessionId);
@@ -11396,6 +11394,14 @@ async function buildRetrievalRecency(provider, nowMs) {
11396
11394
  // src/hooks/guardrails/index.ts
11397
11395
  init_constants();
11398
11396
  init_schema();
11397
+ init_executor();
11398
+
11399
+ // src/scope/scope-lease-renewal.ts
11400
+ var MAX_HASH_BYTES = 4 * 1024 * 1024;
11401
+ var MAX_AGGREGATE_HASH_BYTES = 8 * 1024 * 1024;
11402
+ var CANDIDATE_TTL_MS = 10 * 60 * 1000;
11403
+
11404
+ // src/hooks/guardrails/index.ts
11399
11405
  init_logger();
11400
11406
 
11401
11407
  // src/utils/provider-error-classification.ts
@@ -11497,7 +11503,6 @@ import * as path17 from "path";
11497
11503
  var DC_MAX_UNWRAP_DEPTH = 5;
11498
11504
  var DC_SAFE_TARGETS = new Set([
11499
11505
  "node_modules",
11500
- ".git",
11501
11506
  "dist",
11502
11507
  "build",
11503
11508
  "coverage",
@@ -11662,6 +11667,30 @@ function dcSplitSegments(cmd) {
11662
11667
  segments.push(current.trim());
11663
11668
  return segments.filter((s) => s.length > 0);
11664
11669
  }
11670
+ function dcExtractRecursiveRmTargets(segment) {
11671
+ const tokens = segment.match(/"(?:[^"\\]|\\.)*"|'[^']*'|\S+/g) ?? [];
11672
+ if (tokens.length < 2 || tokens[0] !== "rm")
11673
+ return null;
11674
+ let destructive = false;
11675
+ let index = 1;
11676
+ for (;index < tokens.length; index++) {
11677
+ const token = tokens[index];
11678
+ if (token === "--") {
11679
+ index++;
11680
+ break;
11681
+ }
11682
+ if (!token.startsWith("-") || token === "-")
11683
+ break;
11684
+ if (token === "--recursive" || token === "--force")
11685
+ destructive = true;
11686
+ if (!token.startsWith("--") && /[rRfF]/.test(token.slice(1))) {
11687
+ destructive = true;
11688
+ }
11689
+ }
11690
+ if (!destructive)
11691
+ return null;
11692
+ return tokens.slice(index).map((target) => target.replace(/^(["'])|(["'])$/g, ""));
11693
+ }
11665
11694
  function dcHasUnresolvableVars(p) {
11666
11695
  return /(%[A-Za-z_][A-Za-z0-9_]*%|\$\{?[A-Za-z_]|\$env:)/i.test(p);
11667
11696
  }
@@ -11674,13 +11703,15 @@ function dcLstatAncestorWalk(targetPath, cwd) {
11674
11703
  const ancestors = [];
11675
11704
  let current = normalizedTarget;
11676
11705
  while (true) {
11706
+ const rel = path17.relative(normalizedCwd, current);
11707
+ if (rel === ".." || rel.startsWith(`..${path17.sep}`) || path17.isAbsolute(rel))
11708
+ break;
11677
11709
  ancestors.push(current);
11710
+ if (rel === "")
11711
+ break;
11678
11712
  const parent = path17.dirname(current);
11679
11713
  if (parent === current)
11680
11714
  break;
11681
- const rel = path17.relative(normalizedCwd, current);
11682
- if (rel === "" || rel.startsWith(".."))
11683
- break;
11684
11715
  current = parent;
11685
11716
  }
11686
11717
  for (const ancestor of ancestors) {
@@ -11690,7 +11721,7 @@ function dcLstatAncestorWalk(targetPath, cwd) {
11690
11721
  } catch (err) {
11691
11722
  const code = err.code;
11692
11723
  if (code === "ENOENT") {
11693
- break;
11724
+ continue;
11694
11725
  }
11695
11726
  return `lstat failed on "${ancestor}": ${String(err)} \u2014 refusing to allow destructive operation on unverifiable path`;
11696
11727
  }
@@ -11714,11 +11745,12 @@ function dcValidateTargets(targets, cwd) {
11714
11745
  if (/^\\\\/.test(t)) {
11715
11746
  return `BLOCKED: Destructive command targets UNC path "${t}" \u2014 UNC paths in destructive operations are not allowed.`;
11716
11747
  }
11717
- const lstatBlock = dcLstatAncestorWalk(t, cwd);
11748
+ const filesystemTarget = t.replace(/[\\/]+/g, path17.sep);
11749
+ const lstatBlock = dcLstatAncestorWalk(filesystemTarget, cwd);
11718
11750
  if (lstatBlock)
11719
11751
  return lstatBlock;
11720
- const basename3 = path17.basename(t);
11721
- if (t === basename3 && DC_SAFE_TARGETS.has(t)) {
11752
+ const basename3 = path17.basename(filesystemTarget);
11753
+ if (dcPathComponents(t).length === 1 && DC_SAFE_TARGETS.has(basename3)) {
11722
11754
  continue;
11723
11755
  }
11724
11756
  if (DC_FS_ROOTS.has(t) || DC_FS_ROOTS.has(t.replace(/\//g, "\\"))) {
@@ -11734,6 +11766,111 @@ function dcValidateTargets(targets, cwd) {
11734
11766
  }
11735
11767
  return null;
11736
11768
  }
11769
+ function dcIsUntrustedCodePoint(codePoint) {
11770
+ return codePoint <= 31 || codePoint >= 127 && codePoint <= 159 || codePoint >= 8234 && codePoint <= 8238 || codePoint >= 8294 && codePoint <= 8297;
11771
+ }
11772
+ function dcHasUntrustedText(value) {
11773
+ return Array.from(value).some((character) => dcIsUntrustedCodePoint(character.codePointAt(0) ?? 0));
11774
+ }
11775
+ function dcSafeDiagnosticValue(value) {
11776
+ return value.split("").map((character) => dcIsUntrustedCodePoint(character.codePointAt(0) ?? 0) ? "?" : character).join("").slice(0, 512);
11777
+ }
11778
+ function dcPathComponents(value) {
11779
+ return value.replace(/\\/g, "/").split("/").filter(Boolean);
11780
+ }
11781
+ function dcComponentEquals(left, right) {
11782
+ return process.platform === "win32" ? left.toLowerCase() === right.toLowerCase() : left === right;
11783
+ }
11784
+ function dcScopeContains(scopeEntry, target) {
11785
+ const normalize3 = (value) => {
11786
+ const normalized = path17.posix.normalize(value.replace(/\\/g, "/")).replace(/^\.\//, "").replace(/\/$/, "");
11787
+ return process.platform === "win32" ? normalized.toLowerCase() : normalized;
11788
+ };
11789
+ const scope = normalize3(scopeEntry);
11790
+ const candidate = normalize3(target);
11791
+ return candidate === scope || candidate.startsWith(`${scope}/`);
11792
+ }
11793
+ function dcEvaluateRecursiveDeleteTargets(input) {
11794
+ if (input.targets.length === 0) {
11795
+ return {
11796
+ allowed: false,
11797
+ code: "DESTRUCTIVE_TARGET_INVALID",
11798
+ reason: "BLOCKED: Recursive delete has no statically verifiable target."
11799
+ };
11800
+ }
11801
+ const commonBlock = dcValidateTargets(input.targets, input.cwd);
11802
+ if (commonBlock) {
11803
+ return {
11804
+ allowed: false,
11805
+ code: "DESTRUCTIVE_TARGET_INVALID",
11806
+ reason: commonBlock
11807
+ };
11808
+ }
11809
+ const normalizedTargets = [];
11810
+ let hasNested = false;
11811
+ for (const raw of input.targets) {
11812
+ const target = raw.trim().replace(/^['"]|['"]$/g, "");
11813
+ const safeTarget = dcSafeDiagnosticValue(target);
11814
+ if (!target || target === "." || dcHasUntrustedText(target) || dcPathComponents(target).includes("..")) {
11815
+ return {
11816
+ allowed: false,
11817
+ code: "DESTRUCTIVE_TARGET_INVALID",
11818
+ reason: `BLOCKED: Recursive delete target "${safeTarget}" is empty, the workspace root, contains traversal, or contains control characters.`
11819
+ };
11820
+ }
11821
+ const components = dcPathComponents(target);
11822
+ if (components.some((component) => dcComponentEquals(component, ".git") || dcComponentEquals(component, ".swarm"))) {
11823
+ return {
11824
+ allowed: false,
11825
+ code: "DESTRUCTIVE_TARGET_PROTECTED",
11826
+ reason: `BLOCKED: Recursive delete target "${safeTarget}" contains protected .git or .swarm state.`
11827
+ };
11828
+ }
11829
+ const filesystemTarget = target.replace(/[\\/]+/g, path17.sep);
11830
+ const resolved = path17.resolve(input.cwd, filesystemTarget);
11831
+ const relative3 = path17.relative(path17.resolve(input.cwd), resolved);
11832
+ if (relative3 === "" || relative3 === ".." || relative3.startsWith(`..${path17.sep}`) || path17.isAbsolute(relative3)) {
11833
+ return {
11834
+ allowed: false,
11835
+ code: "DESTRUCTIVE_TARGET_OUTSIDE_WORKSPACE",
11836
+ reason: `BLOCKED: Recursive delete target "${safeTarget}" is not strictly contained by the workspace.`
11837
+ };
11838
+ }
11839
+ const basename3 = path17.basename(resolved);
11840
+ if (!DC_SAFE_TARGETS.has(basename3)) {
11841
+ return {
11842
+ allowed: false,
11843
+ code: "DESTRUCTIVE_TARGET_NOT_SAFE_ARTIFACT",
11844
+ reason: `BLOCKED: Recursive delete target "${safeTarget}" is not an allowlisted build/cache artifact.`
11845
+ };
11846
+ }
11847
+ const normalizedRelative = relative3.replace(/\\/g, "/");
11848
+ const isBare = components.length === 1;
11849
+ if (!isBare) {
11850
+ hasNested = true;
11851
+ if (!input.verifiedScope?.bindingId || !input.verifiedScope.generationId) {
11852
+ return {
11853
+ allowed: false,
11854
+ code: "DESTRUCTIVE_TARGET_SCOPE_REQUIRED",
11855
+ reason: `BLOCKED: Nested safe artifact "${safeTarget}" requires a verified active coder scope binding.`
11856
+ };
11857
+ }
11858
+ if (!input.verifiedScope.files.some((entry) => dcScopeContains(entry, normalizedRelative))) {
11859
+ return {
11860
+ allowed: false,
11861
+ code: "DESTRUCTIVE_TARGET_OUT_OF_SCOPE",
11862
+ reason: `BLOCKED: Nested safe artifact "${safeTarget}" is outside the verified active coder scope.`
11863
+ };
11864
+ }
11865
+ }
11866
+ normalizedTargets.push(normalizedRelative);
11867
+ }
11868
+ return {
11869
+ allowed: true,
11870
+ kind: hasNested ? "scoped-nested-safe-artifact" : "bare-safe-artifact",
11871
+ targets: normalizedTargets
11872
+ };
11873
+ }
11737
11874
  function dcCheckJunctionCreation(segment, cwd) {
11738
11875
  const mklinkMatch = /^mklink(?:\.exe)?\s+\/[JjDd]\s+"?([^"\s]+)"?\s+"?([^"\s]+)"?/i.exec(segment);
11739
11876
  if (mklinkMatch) {
@@ -13148,7 +13285,6 @@ function classifySwarmCommandChatFallbackUse(resolved) {
13148
13285
  // src/hooks/guardrails/tool-before.ts
13149
13286
  init_constants();
13150
13287
  init_schema();
13151
- init_executor();
13152
13288
 
13153
13289
  // src/hooks/shell-write-detect.ts
13154
13290
  import * as path19 from "path";
@@ -18881,7 +19017,7 @@ function planMerges(active, threshold, maxComparisons, maxMerges) {
18881
19017
  };
18882
19018
  }
18883
19019
  async function sweepActiveNearDuplicates(directory, options = {}) {
18884
- const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-1v89yst3.js");
19020
+ const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-a9xny52r.js");
18885
19021
  const { config } = loadPluginConfigWithMeta2(directory);
18886
19022
  const sweepConfig = config.learning?.dedup_sweep;
18887
19023
  if (sweepConfig?.enabled === false)
@@ -20474,7 +20610,7 @@ async function runCuratorPhase(directory, phase, agentsDispatched, config, knowl
20474
20610
  }
20475
20611
  if (config.skill_generation_enabled === true && skillCandidates.length > 0) {
20476
20612
  try {
20477
- const skillModule = await import("./skill-generator-arvwfdfh.js");
20613
+ const skillModule = await import("./skill-generator-rt0jqcsa.js");
20478
20614
  for (const cand of skillCandidates) {
20479
20615
  if (cand.confidence < (config.min_skill_confidence ?? DEFAULT_SKILL_MIN_CONFIDENCE)) {
20480
20616
  continue;
@@ -20934,7 +21070,7 @@ async function applyCuratorKnowledgeUpdates(directory, recommendations, knowledg
20934
21070
  } catch {}
20935
21071
  }
20936
21072
  if (contradictedEntries.length > 0 && knowledgeConfig.contradiction_threshold_action === "quarantine") {
20937
- const { maybeQuarantineOnContradiction } = await import("./knowledge-escalator-7n384ys1.js");
21073
+ const { maybeQuarantineOnContradiction } = await import("./knowledge-escalator-s6z1x65b.js");
20938
21074
  for (const { id } of contradictedEntries) {
20939
21075
  try {
20940
21076
  await maybeQuarantineOnContradiction(directory, id, knowledgeConfig.contradiction_quarantine_threshold, knowledgeConfig.contradiction_quarantine_window_days);
@@ -21753,7 +21889,7 @@ async function runCuratorPostMortem(directory, options = {}) {
21753
21889
  warnings.push("Failed to collect knowledge summary.");
21754
21890
  }
21755
21891
  try {
21756
- const { getScanStatus } = await import("./scan-cursor-9y9msabt.js");
21892
+ const { getScanStatus } = await import("./scan-cursor-jxajj6s7.js");
21757
21893
  const scanStatus = await getScanStatus(directory);
21758
21894
  if (scanStatus.remaining_estimate > 0) {
21759
21895
  warnings.push(`Fair scan: reviewed ${knowledgeSummary.length} entries this sweep (generation ${scanStatus.generation}); ${scanStatus.remaining_estimate} more eligible entries will be visited in future curation sweeps.`);
@@ -21925,9 +22061,9 @@ var _internals24 = {
21925
22061
  verifyPostMortemKnowledgeActions,
21926
22062
  repairPostMortemActions,
21927
22063
  loadDefaultKnowledgeConfig: async (directory) => {
21928
- const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-xg5f11md.js");
22064
+ const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-fj32eyae.js");
21929
22065
  try {
21930
- const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-1v89yst3.js");
22066
+ const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-a9xny52r.js");
21931
22067
  const loaded = loadPluginConfigWithMeta2(directory);
21932
22068
  return KnowledgeConfigSchema2.parse(loaded.config.knowledge ?? {});
21933
22069
  } catch {
@@ -21935,11 +22071,11 @@ var _internals24 = {
21935
22071
  }
21936
22072
  },
21937
22073
  applyCuratorKnowledgeUpdates: async (directory, recommendations, knowledgeConfig, generation) => {
21938
- const { applyCuratorKnowledgeUpdates: applyCuratorKnowledgeUpdates2 } = await import("./curator-jjtp9hn2.js");
22074
+ const { applyCuratorKnowledgeUpdates: applyCuratorKnowledgeUpdates2 } = await import("./curator-54n1y4j8.js");
21939
22075
  return applyCuratorKnowledgeUpdates2(directory, recommendations, knowledgeConfig, generation);
21940
22076
  },
21941
22077
  checkHivePromotions: async (entries, knowledgeConfig, directory) => {
21942
- const { checkHivePromotions } = await import("./hive-promoter-xvq8jzbs.js");
22078
+ const { checkHivePromotions } = await import("./hive-promoter-es2x2b0e.js");
21943
22079
  return checkHivePromotions(entries, knowledgeConfig, directory);
21944
22080
  },
21945
22081
  applyProposalTriage: async (directory, triage) => {
@@ -21948,7 +22084,7 @@ var _internals24 = {
21948
22084
  activateProposal,
21949
22085
  listSkills: listSkills2,
21950
22086
  sanitizeSlug
21951
- } = await import("./skill-generator-arvwfdfh.js");
22087
+ } = await import("./skill-generator-rt0jqcsa.js");
21952
22088
  const result = {
21953
22089
  approved: [],
21954
22090
  rejected: [],
@@ -24575,9 +24711,9 @@ function hashContent(content) {
24575
24711
  return createHash9("sha1").update(content).digest("hex");
24576
24712
  }
24577
24713
  async function loadConfigForPolicyCurator(directory) {
24578
- const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-xg5f11md.js");
24714
+ const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-fj32eyae.js");
24579
24715
  try {
24580
- const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-1v89yst3.js");
24716
+ const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-a9xny52r.js");
24581
24717
  const { config: loadedConfig } = loadPluginConfigWithMeta2(directory);
24582
24718
  return KnowledgeConfigSchema2.parse(loadedConfig.knowledge ?? {});
24583
24719
  } catch {
@@ -27849,8 +27985,8 @@ function safeRemoveTemp(tempPath) {
27849
27985
  } catch {}
27850
27986
  }
27851
27987
  function buildVacuumIntoSql(destPath) {
27852
- const posix5 = destPath.replace(/\\/g, "/");
27853
- const escaped = posix5.replace(/'/g, "''");
27988
+ const posix6 = destPath.replace(/\\/g, "/");
27989
+ const escaped = posix6.replace(/'/g, "''");
27854
27990
  return `VACUUM INTO '${escaped}'`;
27855
27991
  }
27856
27992
  function rowString(row, col) {
@@ -28537,7 +28673,7 @@ async function runFinalizeStage(ctx) {
28537
28673
  }
28538
28674
  }
28539
28675
  try {
28540
- const { CuratorConfigSchema: CCS } = await import("./schema-xg5f11md.js");
28676
+ const { CuratorConfigSchema: CCS } = await import("./schema-fj32eyae.js");
28541
28677
  const { config: pmLoadedConfig } = _internals36.loadPluginConfigWithMeta(ctx.directory);
28542
28678
  const curatorCfg = CCS.parse(pmLoadedConfig.curator ?? {});
28543
28679
  if (curatorCfg.enabled && curatorCfg.postmortem_enabled) {
@@ -30808,9 +30944,9 @@ var _internals41 = {
30808
30944
  loadPluginConfigWithMeta,
30809
30945
  loadCuratorDeps: async () => {
30810
30946
  const [{ CuratorConfigSchema }, curator, { createCuratorLLMDelegate: createCuratorLLMDelegate2 }] = await Promise.all([
30811
- import("./schema-xg5f11md.js"),
30812
- import("./curator-jjtp9hn2.js"),
30813
- import("./curator-llm-factory-wkjme59b.js")
30947
+ import("./schema-fj32eyae.js"),
30948
+ import("./curator-54n1y4j8.js"),
30949
+ import("./curator-llm-factory-wm27ra25.js")
30814
30950
  ]);
30815
30951
  return { CuratorConfigSchema, curator, createCuratorLLMDelegate: createCuratorLLMDelegate2 };
30816
30952
  }
@@ -31715,7 +31851,7 @@ async function computeCurationDiagnostics(directory, entries) {
31715
31851
  let scanCompleted = false;
31716
31852
  let scanRemaining = 0;
31717
31853
  try {
31718
- const { getScanStatus } = await import("./scan-cursor-9y9msabt.js");
31854
+ const { getScanStatus } = await import("./scan-cursor-jxajj6s7.js");
31719
31855
  const status = await getScanStatus(directory);
31720
31856
  scanGeneration = status.generation;
31721
31857
  scanCompleted = status.completed;
@@ -31725,17 +31861,17 @@ async function computeCurationDiagnostics(directory, entries) {
31725
31861
  try {
31726
31862
  const { isLinked: isLinked2 } = await import("./knowledge-link-xc6yhxmz.js");
31727
31863
  if (isLinked2(directory)) {
31728
- const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-xg5f11md.js");
31864
+ const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-fj32eyae.js");
31729
31865
  let config;
31730
31866
  try {
31731
- const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-1v89yst3.js");
31867
+ const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-a9xny52r.js");
31732
31868
  const loaded = loadPluginConfigWithMeta2(directory);
31733
31869
  config = KnowledgeConfigSchema2.parse(loaded.config.knowledge ?? {});
31734
31870
  } catch {
31735
31871
  config = KnowledgeConfigSchema2.parse({});
31736
31872
  }
31737
31873
  const { cohortConfigFingerprint: cohortConfigFingerprint2 } = await import("./config-fingerprint-v22xh5a2.js");
31738
- const { buildConfigFingerprintInput: buildConfigFingerprintInput2, readCohortConfigFingerprint } = await import("./curation-policy-5dqexw5j.js");
31874
+ const { buildConfigFingerprintInput: buildConfigFingerprintInput2, readCohortConfigFingerprint } = await import("./curation-policy-hs9pc1rp.js");
31739
31875
  const currentFp = cohortConfigFingerprint2(buildConfigFingerprintInput2(config));
31740
31876
  const cohortFp = await readCohortConfigFingerprint(directory);
31741
31877
  configMatch = cohortFp === null ? null : currentFp === cohortFp;
@@ -32946,7 +33082,7 @@ async function handleDoctorCommand(directory, args) {
32946
33082
  const result = runConfigDoctor(config, directory);
32947
33083
  let output;
32948
33084
  if (enableAutoFix && result.hasAutoFixableIssues) {
32949
- const { runConfigDoctorWithFixes } = await import("./config-doctor-2mwgdbsn.js");
33085
+ const { runConfigDoctorWithFixes } = await import("./config-doctor-31yppse4.js");
32950
33086
  const fixResult = await runConfigDoctorWithFixes(directory, config, true, {
32951
33087
  applyLossy: true
32952
33088
  });
@@ -33783,7 +33919,7 @@ async function handleEvidenceCommand(directory, args) {
33783
33919
  return formatTaskEvidenceMarkdown(evidenceData);
33784
33920
  }
33785
33921
  async function handleEvidenceSummaryCommand(directory) {
33786
- const { buildEvidenceSummary } = await import("./evidence-summary-service-6cttrkzw.js");
33922
+ const { buildEvidenceSummary } = await import("./evidence-summary-service-hrxcf29a.js");
33787
33923
  const artifact = await buildEvidenceSummary(directory);
33788
33924
  if (!artifact) {
33789
33925
  return "No plan found. Run `/swarm plan` to check plan status.";
@@ -56089,7 +56225,7 @@ function buildDetailedHelp(commandName, entry) {
56089
56225
  async function handleHelpCommand(ctx) {
56090
56226
  const targetCommand = ctx.args.join(" ");
56091
56227
  if (!targetCommand) {
56092
- const { buildHelpText } = await import("./index-xgmx9had.js");
56228
+ const { buildHelpText } = await import("./index-k27a4e5g.js");
56093
56229
  return buildHelpText();
56094
56230
  }
56095
56231
  const tokens = targetCommand.split(/\s+/);
@@ -56098,7 +56234,7 @@ async function handleHelpCommand(ctx) {
56098
56234
  return _internals14.buildDetailedHelp(resolved.key, resolved.entry);
56099
56235
  }
56100
56236
  const similar = _internals14.findSimilarCommands(targetCommand);
56101
- const { buildHelpText: fullHelp } = await import("./index-xgmx9had.js");
56237
+ const { buildHelpText: fullHelp } = await import("./index-k27a4e5g.js");
56102
56238
  if (similar.length > 0) {
56103
56239
  return `Command '/swarm ${targetCommand}' not found.
56104
56240
 
@@ -56275,7 +56411,7 @@ var COMMAND_REGISTRY = {
56275
56411
  },
56276
56412
  "guardrail explain": {
56277
56413
  handler: async (ctx) => {
56278
- const { handleGuardrailExplain } = await import("./guardrail-explain-xppwfnxr.js");
56414
+ const { handleGuardrailExplain } = await import("./guardrail-explain-1729nse8.js");
56279
56415
  return handleGuardrailExplain(ctx.directory, ctx.args);
56280
56416
  },
56281
56417
  description: "Dry-run: show what the guardrails would do to a command or write target (executes nothing)",
@@ -56285,7 +56421,7 @@ var COMMAND_REGISTRY = {
56285
56421
  },
56286
56422
  "guardrail-explain": {
56287
56423
  handler: async (ctx) => {
56288
- const { handleGuardrailExplain } = await import("./guardrail-explain-xppwfnxr.js");
56424
+ const { handleGuardrailExplain } = await import("./guardrail-explain-1729nse8.js");
56289
56425
  return handleGuardrailExplain(ctx.directory, ctx.args);
56290
56426
  },
56291
56427
  description: "Dry-run: show what the guardrails would do to a command or write target (executes nothing)",
@@ -56295,7 +56431,7 @@ var COMMAND_REGISTRY = {
56295
56431
  },
56296
56432
  "guardrail-log": {
56297
56433
  handler: async (ctx) => {
56298
- const { handleGuardrailLog } = await import("./guardrail-log-swet7rch.js");
56434
+ const { handleGuardrailLog } = await import("./guardrail-log-yjj5srkw.js");
56299
56435
  return handleGuardrailLog(ctx.directory, ctx.args);
56300
56436
  },
56301
56437
  description: "Read the guardrail decision log (use --blocks-only for blocks)",
@@ -57430,12 +57566,16 @@ CODER'S TOOLS: write, edit, patch, apply_patch, swarm_apply_patch, create_file,
57430
57566
  If a tool modifies a file, it is a CODER tool. Delegate.
57431
57567
  <!-- BEHAVIORAL_GUIDANCE_START -->
57432
57568
  1a. SCOPE DISCIPLINE \u2014 call declare_scope BEFORE every coder delegation AND before any test_engineer delegation that will write new test files.
57433
- - Before you delegate a coding task, call declare_scope with { taskId, files } where \`files\` is the exact list of paths the coder is allowed to write. Bundle any generated/lockfile paths that the change will produce (e.g. package-lock.json, Cargo.lock, dist/*).
57434
- - Before you delegate to test_engineer with an instruction to CREATE or MODIFY test files, call declare_scope with { taskId, files } listing the exact test file path(s) (e.g. src/auth/login.test.ts, tests/unit/foo.spec.ts) the test_engineer is expected to write.
57435
- - If coder or test_engineer returns "WRITE BLOCKED" for a path outside the declared list: call declare_scope again with the missing path added. Do NOT instruct the coder to use bash, sed, echo, cat, tee, dd, or any interpreter eval (python -c, node -e, bun -e, ruby -e) to bypass the block. Alternate mechanisms cannot create write authority and violate scope discipline.
57569
+ - Before you delegate a coding task, call declare_scope with { taskId, files, replace_existing: true } where \`files\` is the exact list of paths the coder is allowed to write. Bundle any generated/lockfile paths that the change will produce (e.g. package-lock.json, Cargo.lock, dist/*). Replacement is safe for the first declaration and required for every retry/re-dispatch.
57570
+ - Before you delegate to test_engineer with an instruction to CREATE or MODIFY test files, call declare_scope with { taskId, files, replace_existing: true } listing the exact test file path(s) (e.g. src/auth/login.test.ts, tests/unit/foo.spec.ts) the test_engineer is expected to write.
57571
+ - If coder or test_engineer returns "WRITE BLOCKED" for a path outside the declared list: call declare_scope again with the missing path added and \`replace_existing: true\`. Do NOT instruct the coder to use bash, sed, echo, cat, tee, dd, or any interpreter eval (python -c, node -e, bun -e, ruby -e) to bypass the block. Alternate mechanisms cannot create write authority and violate scope discipline.
57436
57572
  - Never wrap a file write in eval, bash -c, sh -c, a subshell, or a heredoc-to-file redirect as a workaround. Shell and interpreter targets are scope-checked when they can be proven, and unverifiable write payloads fail closed.
57437
57573
  - Do NOT use mv, Move-Item, move, ren, Rename-Item, or cp-then-rm chains to relocate, rename, or delete files under \`.swarm/\` as a workaround for blocked destructive commands. Those are file-move shell bypasses and are banned. Use the tool's dedicated tools (\`.swarm/\` file management or evidence manager tools) instead.
57438
57574
  - If you cannot enumerate files up front (e.g. a broad refactor), declare the containing directories \u2014 declare_scope accepts directory entries and grants containment.
57575
+ - Author task scope durably: every coding task passed to save_plan SHOULD include a non-empty \`files_touched\` list of normalized project-relative paths. On plan revision, omitting \`files_touched\` preserves that task's prior scope; passing \`[]\` clears it intentionally.
57576
+ - Scope-source precedence is exact and fail-closed: the active \`declare_scope\` binding is authoritative, otherwise plan \`files_touched\`, otherwise complete \`FILE:\` directives. Every lower-precedence source that is present must be a subset of the authoritative source.
57577
+ - \`SCOPE_CONFLICT\` recovery: inspect the named source lists, correct stale plan scope with save_plan and/or correct the delegation's \`FILE:\` lines, then call \`declare_scope({ taskId, files: <the reconciled list>, replace_existing: true, working_directory: <active lane root> })\` before retrying. Do not widen scope merely to silence the conflict.
57578
+ - \`SCOPE_BINDING_EXPIRED\` or \`SCOPE_BINDING_AMBIGUOUS\` recovery: re-read the current task scope, then call \`declare_scope\` with the intended exact files and \`replace_existing: true\` before retrying. \`SCOPE_WORKSPACE_MISMATCH\` recovery: use the diagnostic's active lane/worktree root as \`working_directory\` and keep every declared path relative to that root. \`SCOPE_ROOT_ESCAPE\` recovery: retry the intended operation relative to the active root only when the diagnostic supplies a safe relative path; never authorize the outside absolute path.
57439
57579
  - Rationale: coder Task preflight binds scope to the exact workspace, plan generation, task, parent session, and Task call. Missing or malformed scope blocks delegation with SCOPE_NOT_DECLARED; conflicting lower-precedence FILE:/plan paths block with SCOPE_CONFLICT before the coder starts.
57440
57580
  <!-- BEHAVIORAL_GUIDANCE_END -->
57441
57581
  2. ONE agent per message. Send, STOP, wait for response.
@@ -57445,8 +57585,8 @@ If a tool modifies a file, it is a CODER tool. Delegate.
57445
57585
  > **WORKTREE ISOLATION IS BASELINE.** Standard parallel coders use isolated git worktrees by default; this is governed by the top-level \`worktree.policy\` setting (default \`auto\`) in \`PluginConfig\` \u2014 a sibling of \`parallelization:\`, not nested under it \u2014 and is active whenever the plan's \`parallelization_enabled=true\`. \`turbo.lean.worktree_isolation\` is a separate, Lean-Turbo-internal flag (default \`false\`); it is one possible SOURCE but NOT the recommended one. Do NOT recommend Lean Turbo (or Epic) SOLELY to obtain worktree isolation; recommend them only for what they add beyond baseline (Lean Turbo: lane planning, file locks, phase reviewer, integrated diff; Epic: co-change awareness + auto-decide). Lean Turbo users can also enable isolation via \`turbo.lean.worktree_isolation: true\`, but this is the secondary/legacy path \u2014 the recommended path is \`worktree.policy\`.
57446
57586
  Read-only advisory-lane exception (NON-BLOCKING; distinct from both exceptions above): the "Send, STOP, wait" rule governs MUTATION delegations (coder, and the test_engineer/reviewer Stage B completion gates). It does NOT govern read-only advisory exploration/review lanes. When you dispatch read-only advisory lanes \u2014 \`{{AGENT_PREFIX}}explorer\`, \`{{AGENT_PREFIX}}sme\`, \`{{AGENT_PREFIX}}researcher\`, the council members (\`council_generalist\`/\`council_skeptic\`/\`council_domain_expert\`), or an advisory \`{{AGENT_PREFIX}}critic\` lane \u2014 use the NON-BLOCKING path so you keep working while they run. Dispatch PROMPTLY: emit the \`dispatch_lanes_async\` call EARLY with compact lane prompts \u2014 do not accumulate long planning prose or build oversized inline prompts first, or the tool call can be truncated out of your message and the lanes never launch (a real failure mode on smaller models). The lane mechanism is a SINGLE \`dispatch_lanes_async\` call carrying all lane specs \u2014 NOT a per-agent Task/run-in-background pattern. Call \`dispatch_lanes_async\` with all lane specs in one call, record the returned \`batch_id\`, then IMMEDIATELY continue non-dependent architect work (refine the plan/obligation ledger, inspect metadata, prepare the synthesis/reviewer structure, run deterministic read-only tools). Poll incrementally with \`collect_lane_results\` without \`wait\` (or with \`wait: false\`) to harvest lanes as they settle; process completed lane output immediately while other lanes remain pending/running, then continue independent work between polls. Do NOT sit idle waiting on running lanes, and do NOT synthesize findings from still-running lanes. Join later by calling \`collect_lane_results\` with \`wait: true\` as the explicit barrier immediately before you synthesize. Use blocking \`dispatch_lanes\` only when \`dispatch_lanes_async\`/promptAsync is unavailable. A settled lane's inline \`output\` is delivered only once: if you poll the same lane again after already receiving its output, the repeat poll returns \`output_omitted_repeat: true\` with no \`output\` (not a sign the result was lost) \u2014 use the accompanying \`output_ref\` with \`retrieve_lane_output\` if you need the text again, and do not re-dispatch the lane. Keep each lane prompt compact: send large shared context (PR diff, ledger, scope) ONCE via the \`common_prompt\` field, or have lanes read it from a file by absolute path, instead of inlining the same blob into every lane prompt \u2014 inlining large context into many lanes is what produces malformed or truncated tool-call JSON and forces clumsy file workarounds. This non-blocking exception applies ONLY to read-only advisory lanes; it NEVER applies to coder delegations, to the test_engineer/reviewer Stage B completion gates, or to the critic PLAN-review gate, which all still follow "Send, STOP, wait" (or the Stage B parallel-dispatch exception above).
57447
57587
  3. ONE task per {{AGENT_PREFIX}}coder call. Never batch.
57448
- 3a. PRE-DELEGATION SCOPE CALL (required): BEFORE every {{AGENT_PREFIX}}coder delegation, you MUST call \`declare_scope\` with { taskId, files } listing the exact file(s) this task will modify (including generated/lockfile paths). No \`declare_scope\` call \u2192 no coder delegation. See Rule 1a.
57449
- 3b. PRE-DELEGATION SCOPE CALL (test_engineer): BEFORE any {{AGENT_PREFIX}}test_engineer delegation that will CREATE or MODIFY test files, you MUST call \`declare_scope\` with { taskId, files } listing the exact test file path(s) to write. Omitting this call leaves the write scope undeclared and will block the write. See Rule 1a.
57588
+ 3a. PRE-DELEGATION SCOPE CALL (required): BEFORE every {{AGENT_PREFIX}}coder delegation, you MUST call \`declare_scope\` with { taskId, files, replace_existing: true } listing the exact file(s) this task will modify (including generated/lockfile paths). No \`declare_scope\` call \u2192 no coder delegation. See Rule 1a.
57589
+ 3b. PRE-DELEGATION SCOPE CALL (test_engineer): BEFORE any {{AGENT_PREFIX}}test_engineer delegation that will CREATE or MODIFY test files, you MUST call \`declare_scope\` with { taskId, files, replace_existing: true } listing the exact test file path(s) to write. Omitting this call leaves the write scope undeclared and will block the write. See Rule 1a.
57450
57590
  <!-- BEHAVIORAL_GUIDANCE_START -->
57451
57591
  BATCHING DETECTION \u2014 you are batching if your coder delegation contains ANY of:
57452
57592
  - The word "and" connecting two actions ("update X AND add Y")
@@ -57845,7 +57985,7 @@ INPUT: Building a SwiftUI app with offline-first sync
57845
57985
  OUTPUT: Recommended patterns, frameworks, gotchas
57846
57986
  SKILLS: none
57847
57987
 
57848
- PRE-STEP (required): call \`declare_scope({ taskId, files })\` BEFORE writing any {{AGENT_PREFIX}}coder delegation. See Rule 1a.
57988
+ PRE-STEP (required): call \`declare_scope({ taskId, files, replace_existing: true })\` BEFORE writing any {{AGENT_PREFIX}}coder delegation. See Rule 1a.
57849
57989
 
57850
57990
  {{AGENT_PREFIX}}coder
57851
57991
  TASK: Add input validation to login
@@ -58258,7 +58398,15 @@ ACTION: Load skill ${bundledProjectSkillFileReference("plan")} immediately. Foll
58258
58398
  HARD CONSTRAINTS (apply regardless of skill load success):
58259
58399
  - Before drafting or saving a plan, offer the loaded skill's General Council advisory option when \`council.general.enabled\` is true and a search API key is configured. If the user accepts, use the council output as context before calling \`save_plan\` and before any critic pre-plan review.
58260
58400
  - Use the \`save_plan\` tool as the primary plan writer. Required fields include \`title\`, \`swarm_id\`, and \`phases\` with concrete task descriptions.
58261
- - Example call: save_plan({ title: "My Real Project", swarm_id: "mega", phases: [{ id: 1, name: "Setup", tasks: [{ id: "1.1", description: "Install dependencies and configure TypeScript", size: "small" }] }] })
58401
+ - Every coding task SHOULD include \`files_touched\` with the exact normalized project-relative files or directories it may modify; include generated outputs and lockfiles.
58402
+ - Example call:
58403
+ save_plan({
58404
+ title: "My Real Project",
58405
+ swarm_id: "mega",
58406
+ phases: [{ id: 1, name: "Setup", tasks: [{ id: "1.1", description: "Install dependencies and configure TypeScript", size: "small", files_touched: ["tsconfig.json", "package.json", "bun.lock"] }] }]
58407
+ })
58408
+
58409
+ - On a plan revision, omitting a task's \`files_touched\` preserves its prior scope; passing \`files_touched: []\` explicitly clears it. Never rely on the derived plan.md as the source of this field.
58262
58410
 
58263
58411
  - If \`save_plan\` is unavailable, delegate plan writing only after \`declare_scope\` covers \`.swarm/plan.md\`; the delegated output must be exact plan content.
58264
58412
  - A missing spec is a soft gate for external plan ingestion, but stale spec drift must be surfaced to the user before continuing.
@@ -58308,7 +58456,7 @@ ACTION: Load skill ${bundledProjectSkillFileReference("execute")} immediately. F
58308
58456
 
58309
58457
  HARD CONSTRAINTS (apply regardless of skill load success):
58310
58458
  - For each task, respect dependencies and delegate implementation to \`{{AGENT_PREFIX}}coder\`; do not self-fix ordinary gate failures.
58311
- - Before coder implementation or retry, call \`declare_scope({ taskId, files })\` with the exact files the coder may touch.
58459
+ - Before coder implementation or retry, call \`declare_scope({ taskId, files, replace_existing: true })\` with the exact files the coder may touch.
58312
58460
  - On any gate failure, return to \`{{AGENT_PREFIX}}coder\` with structured rejection: \`GATE FAILED: [gate name] | REASON: [details] | REQUIRED FIX: [specific action required]\`.
58313
58461
  - Required per-task gates include automated checks, reviewer gates, verification tests, regression sweep, test drift, TODO scan, and coverage guidance as detailed in the loaded skill.
58314
58462
  - Pre-commit constraint: do not commit or push unless reviewer, test_engineer, pre_check_batch, diff, regression-sweep, and test-drift have actually run or skipped according to the loaded protocol.
@@ -59872,4 +60020,4 @@ function createCuratorLLMDelegate(directory, mode = "init", sessionId) {
59872
60020
  };
59873
60021
  }
59874
60022
 
59875
- export { handleAcknowledgeSpecDriftCommand, handleAgentsCommand, handleAnalyzeCommand, DC_SAFE_TARGETS, dcNormalizeCommand, dcUnwrapWrappers, dcSplitSegments, dcValidateTargets, dcCheckJunctionCreation, dcExtractWindowsCmdTargets, dcExtractPowerShellTargets, normalizeSwarmCommandInput, canonicalCommandKey, formatCommandNotFound, executeSwarmCommand, SWARM_COMMAND_TOOL_COMMANDS, SWARM_COMMAND_TOOL_ALLOWLIST, HUMAN_ONLY_SWARM_COMMANDS, classifySwarmCommandToolUse, classifySwarmCommandChatFallbackUse, detectPosixWrites, detectWindowsWrites, resolveWriteTargets, handleArchiveCommand, handleAutoProceedCommand, handleBenchmarkCommand, handleBrainstormCommand, handleCheckpointCommand, handleCiSimulateCommand, handleClarifyCommand, createCuratorLLMDelegate, _internals23 as _internals, normalizeRecommendationEntryIdToken, parseKnowledgeRecommendations, parseKnowledgeRecommendationsWithDiagnostics, parseStructuredCuratorBlocks, readCuratorSummary, writeCuratorSummary, appendCuratorRecommendation, mergeCuratorPhaseSummary, filterPhaseEvents, checkPhaseCompliance, runCuratorInit, runCuratorPhase, applyCuratorKnowledgeUpdates, isHiveEligible, countDistinctProjects, checkHivePromotions, _internals26 as _internals1, createHivePromoterHook, promoteToHive, promoteFromSwarm, handleCloseCommand, handleCodebaseReviewCommand, handleConcurrencyCommand, handleConfigCommand, handleConsolidateCommand, handleCostsCommand, handleCouncilCommand, handleCurateCommand, handleDarkMatterCommand, handleDeepDiveCommand, handleDeepResearchCommand, getPluginConfigDir, getPluginCachePaths, getPluginLockFilePaths, handleDiagnoseCommand, handleDoctorCommand, handleEvidenceCommand, handleEvidenceSummaryCommand, handleExportCommand, handleFullAutoCommand, handleGateAuditCommand, handleGateStatsCommand, handleHandoffCommand, handleHistoryCommand, handleKnowledgeQuarantineCommand, handleKnowledgeRestoreCommand, handleKnowledgeMigrateCommand, handleKnowledgeListCommand, handleKnowledgeUnactionableCommand, handleKnowledgeRetryHardeningCommand, handleLearningCommand, handleLinkCommand, handleMemoryCommand, handleMemoryStatusCommand, handleMemoryValueLogCommand, handleMemoryMigrateCommand, handleMemoryImportCommand, handleMemoryExportCommand, handlePlanCommand, handlePreflightCommand, handlePromoteCommand, handleQaGatesCommand, handleResetCommand, handleResetSessionCommand, handleRetrieveCommand, handleReviewCommand, handleRollbackCommand, handleSddStatusCommand, handleSddValidateCommand, handleSddProjectCommand, handleSddCommand, handleSimulateCommand, handleSpecifyCommand, handleStatusCommand, handleSyncPlanCommand, handleTurboCommand, handleUnlinkCommand, handleWriteRetroCommand, handleHelpCommand, COMMAND_REGISTRY, VALID_COMMANDS, _internals14 as _internals2, resolveCommand };
60023
+ export { handleAcknowledgeSpecDriftCommand, handleAgentsCommand, handleAnalyzeCommand, dcNormalizeCommand, dcUnwrapWrappers, dcSplitSegments, dcExtractRecursiveRmTargets, dcEvaluateRecursiveDeleteTargets, dcCheckJunctionCreation, dcExtractWindowsCmdTargets, dcExtractPowerShellTargets, normalizeSwarmCommandInput, canonicalCommandKey, formatCommandNotFound, executeSwarmCommand, SWARM_COMMAND_TOOL_COMMANDS, SWARM_COMMAND_TOOL_ALLOWLIST, HUMAN_ONLY_SWARM_COMMANDS, classifySwarmCommandToolUse, classifySwarmCommandChatFallbackUse, detectPosixWrites, detectWindowsWrites, resolveWriteTargets, handleArchiveCommand, handleAutoProceedCommand, handleBenchmarkCommand, handleBrainstormCommand, handleCheckpointCommand, handleCiSimulateCommand, handleClarifyCommand, createCuratorLLMDelegate, _internals23 as _internals, normalizeRecommendationEntryIdToken, parseKnowledgeRecommendations, parseKnowledgeRecommendationsWithDiagnostics, parseStructuredCuratorBlocks, readCuratorSummary, writeCuratorSummary, appendCuratorRecommendation, mergeCuratorPhaseSummary, filterPhaseEvents, checkPhaseCompliance, runCuratorInit, runCuratorPhase, applyCuratorKnowledgeUpdates, isHiveEligible, countDistinctProjects, checkHivePromotions, _internals26 as _internals1, createHivePromoterHook, promoteToHive, promoteFromSwarm, handleCloseCommand, handleCodebaseReviewCommand, handleConcurrencyCommand, handleConfigCommand, handleConsolidateCommand, handleCostsCommand, handleCouncilCommand, handleCurateCommand, handleDarkMatterCommand, handleDeepDiveCommand, handleDeepResearchCommand, getPluginConfigDir, getPluginCachePaths, getPluginLockFilePaths, handleDiagnoseCommand, handleDoctorCommand, handleEvidenceCommand, handleEvidenceSummaryCommand, handleExportCommand, handleFullAutoCommand, handleGateAuditCommand, handleGateStatsCommand, handleHandoffCommand, handleHistoryCommand, handleKnowledgeQuarantineCommand, handleKnowledgeRestoreCommand, handleKnowledgeMigrateCommand, handleKnowledgeListCommand, handleKnowledgeUnactionableCommand, handleKnowledgeRetryHardeningCommand, handleLearningCommand, handleLinkCommand, handleMemoryCommand, handleMemoryStatusCommand, handleMemoryValueLogCommand, handleMemoryMigrateCommand, handleMemoryImportCommand, handleMemoryExportCommand, handlePlanCommand, handlePreflightCommand, handlePromoteCommand, handleQaGatesCommand, handleResetCommand, handleResetSessionCommand, handleRetrieveCommand, handleReviewCommand, handleRollbackCommand, handleSddStatusCommand, handleSddValidateCommand, handleSddProjectCommand, handleSddCommand, handleSimulateCommand, handleSpecifyCommand, handleStatusCommand, handleSyncPlanCommand, handleTurboCommand, handleUnlinkCommand, handleWriteRetroCommand, handleHelpCommand, COMMAND_REGISTRY, VALID_COMMANDS, _internals14 as _internals2, resolveCommand };
@@ -7,7 +7,7 @@ import {
7
7
  loadPluginConfigWithMeta,
8
8
  loadPluginConfigWithMetaAsync,
9
9
  resolveWorktreeIsolationConfig
10
- } from "./index-y6dvs5tt.js";
10
+ } from "./index-m1pwkwfe.js";
11
11
  import {
12
12
  ApprovalEvidenceSchema,
13
13
  BaseEvidenceSchema,
@@ -54,7 +54,7 @@ import {
54
54
  TurboConfigSchema,
55
55
  WorktreeIsolationConfigSchema,
56
56
  resolveAutoReviewConfig
57
- } from "./index-ab57h0yq.js";
57
+ } from "./index-5q009kc4.js";
58
58
  import"./index-bk5tah7q.js";
59
59
  import {
60
60
  MigrationStatusSchema,
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  readKnowledge,
4
4
  transactKnowledge
5
- } from "./index-1djv5684.js";
5
+ } from "./index-1g6xpjk3.js";
6
6
  import {
7
7
  resolveKnowledgeStoreDir
8
8
  } from "./index-en4fb04r.js";