opencode-swarm 7.122.0 → 7.123.0

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 (74) hide show
  1. package/.opencode/skills/issue-tracer/SKILL.md +341 -0
  2. package/.opencode/skills/issue-tracer/assets/pr-template.md +59 -0
  3. package/.opencode/skills/issue-tracer/references/critic-gate.md +245 -0
  4. package/.opencode/skills/issue-tracer/references/evidence-artifacts.md +267 -0
  5. package/.opencode/skills/issue-tracer/references/install.md +63 -0
  6. package/.opencode/skills/issue-tracer/references/localization-playbook.md +95 -0
  7. package/.opencode/skills/issue-tracer/references/method-provenance.md +13 -0
  8. package/.opencode/skills/issue-tracer/references/untrusted-content.md +22 -0
  9. package/.opencode/skills/issue-tracer/scripts/scan-deferred.sh +103 -0
  10. package/.opencode/skills/issue-tracer/scripts/trace-init.sh +119 -0
  11. package/dist/cli/{config-doctor-404c8mf8.js → config-doctor-3ksh1534.js} +2 -2
  12. package/dist/cli/{core-xnwasfpc.js → core-cwgb7ev8.js} +1 -1
  13. package/dist/cli/{curation-policy-cj1tpzr5.js → curation-policy-4j4qce5a.js} +5 -5
  14. package/dist/cli/{curator-llm-factory-8rg0f77t.js → curator-llm-factory-mfvd4sqx.js} +22 -20
  15. package/dist/cli/{curator-3rze3pd4.js → curator-tkyn9bzz.js} +22 -20
  16. package/dist/cli/{evidence-summary-service-k14ykm03.js → evidence-summary-service-96ndczbk.js} +7 -5
  17. package/dist/cli/{gate-evidence-tbpezk28.js → gate-evidence-xqks3kk2.js} +3 -3
  18. package/dist/cli/{guardrail-explain-hdsxa2c5.js → guardrail-explain-4vytbchb.js} +23 -21
  19. package/dist/cli/{guardrail-log-dhpp0kmn.js → guardrail-log-z291m4gw.js} +3 -3
  20. package/dist/cli/{hive-promoter-dh38qd9m.js → hive-promoter-y5wsztkc.js} +22 -20
  21. package/dist/cli/{index-zvae4m8g.js → index-17eybc3z.js} +1 -1
  22. package/dist/cli/{index-kyvg2cmp.js → index-19zn67q6.js} +1 -1
  23. package/dist/cli/{index-rbfq77sz.js → index-2j25br0p.js} +12 -10
  24. package/dist/cli/{index-9xpgytj9.js → index-3rr0ese8.js} +1 -1
  25. package/dist/cli/{index-68aggz0v.js → index-6sgqnvpw.js} +2 -2
  26. package/dist/cli/{index-qg11yf8q.js → index-6xnxz6z0.js} +1 -1
  27. package/dist/cli/{index-emkb0bbe.js → index-7cspygmb.js} +277 -673
  28. package/dist/cli/{index-jzpv74mq.js → index-7g91saha.js} +24 -22
  29. package/dist/cli/{index-3r1w7xky.js → index-cqsak7bf.js} +2 -2
  30. package/dist/cli/index-ctpgsj84.js +547 -0
  31. package/dist/cli/index-d6h5hq91.js +564 -0
  32. package/dist/cli/{index-vqcgmy4y.js → index-det5jwfk.js} +1 -1
  33. package/dist/cli/{index-3sx27bxt.js → index-dywekeen.js} +3 -3
  34. package/dist/cli/{index-wtn8wf7h.js → index-gw3m5fw0.js} +1 -1
  35. package/dist/cli/{index-rkd6qwjh.js → index-hns7xjm7.js} +2 -2
  36. package/dist/cli/{index-xdsj4qtd.js → index-j9kxwshw.js} +5 -5
  37. package/dist/cli/{index-ahxrne50.js → index-jyrhy4ww.js} +161 -58
  38. package/dist/cli/{index-j33zb3cx.js → index-m0bmh3w0.js} +4 -4
  39. package/dist/cli/index-m1abzg93.js +68 -0
  40. package/dist/cli/{index-ny13nr0x.js → index-n2712byd.js} +6 -6
  41. package/dist/cli/{index-gr7ssnj9.js → index-q00e4s1s.js} +5 -4
  42. package/dist/cli/{index-3jvqw5hy.js → index-q27bajqb.js} +1 -1
  43. package/dist/cli/{index-qt2yaghg.js → index-vcgfqd8f.js} +1 -63
  44. package/dist/cli/{index-tftv9xh9.js → index-wr8qgpz5.js} +1 -1
  45. package/dist/cli/index.js +22 -20
  46. package/dist/cli/{knowledge-escalator-sya06p12.js → knowledge-escalator-dyxsm78k.js} +6 -6
  47. package/dist/cli/{knowledge-events-xzps61a9.js → knowledge-events-36q6nvae.js} +4 -4
  48. package/dist/cli/{knowledge-link-sy85fw3w.js → knowledge-link-4yd2z8ev.js} +3 -3
  49. package/dist/cli/{knowledge-store-qg66a93n.js → knowledge-store-e07b4s54.js} +4 -4
  50. package/dist/cli/{knowledge-validator-gar6wv4f.js → knowledge-validator-sfyf7wn2.js} +7 -7
  51. package/dist/cli/pr-subscriptions-x653151h.js +1 -1
  52. package/dist/cli/{scan-cursor-nx5y5k7r.js → scan-cursor-hm0aqqae.js} +5 -5
  53. package/dist/cli/{schema-vwxpsk6j.js → schema-13bnng2n.js} +1 -1
  54. package/dist/cli/scope-persistence-d9erwnvb.js +36 -0
  55. package/dist/cli/{skill-generator-nt5qxafq.js → skill-generator-63r20a9k.js} +8 -8
  56. package/dist/config/bundled-skills.d.ts +1 -1
  57. package/dist/config/constants.d.ts +3 -2
  58. package/dist/hooks/delegation-gate.d.ts +19 -1
  59. package/dist/hooks/guardrails/nontransient-circuit.d.ts +47 -0
  60. package/dist/hooks/scope-guard.d.ts +9 -2
  61. package/dist/hooks/write-target-resolver.d.ts +30 -0
  62. package/dist/index.js +406 -370
  63. package/dist/sandbox/win32/restricted-environment-executor.d.ts +3 -2
  64. package/dist/scope/scope-binding.d.ts +89 -0
  65. package/dist/scope/scope-persistence.d.ts +53 -12
  66. package/dist/state.d.ts +25 -1
  67. package/dist/tools/declare-scope.d.ts +5 -1
  68. package/dist/tools/file-extractor-planner.d.ts +31 -0
  69. package/dist/tools/file-extractor.d.ts +2 -7
  70. package/package.json +2 -1
  71. package/dist/cli/index-51gg9947.js +0 -254
  72. package/dist/cli/scope-persistence-mfr36yc9.js +0 -20
  73. package/dist/cli/{index-h07wn84h.js → index-7mkpsw6g.js} +3 -3
  74. package/dist/cli/{pending-delegations-0z3znsec.js → pending-delegations-68cbaqv2.js} +1 -1
@@ -4,7 +4,7 @@ import {
4
4
  readDoctorArtifact,
5
5
  removeStraySwarmDir,
6
6
  runConfigDoctor
7
- } from "./index-vqcgmy4y.js";
7
+ } from "./index-det5jwfk.js";
8
8
  import {
9
9
  EvaluationTaskV1Schema,
10
10
  GateAuditManifestV1Schema,
@@ -13,18 +13,15 @@ import {
13
13
  IdentifierSchema,
14
14
  MAX_TRANSIENT_RETRIES,
15
15
  admitEvaluationTask,
16
- appendLedgerEvent,
17
16
  archiveEvidence,
18
17
  canonicalHash,
19
18
  canonicalJson,
20
19
  checkRequirementCoverage,
21
20
  closePlanTerminalState,
22
21
  computeManifestContentHash,
23
- computePlanHash,
24
22
  computeSpecHash,
25
23
  computeTaskInputContentHash,
26
24
  computeTaskSetContentHash,
27
- derivePlanId,
28
25
  derivePlanMarkdown,
29
26
  disableEpicMode,
30
27
  enableEpicMode,
@@ -34,7 +31,6 @@ import {
34
31
  getExecutor,
35
32
  getGitRepositoryStatus,
36
33
  initDurableStatusPath,
37
- initLedger,
38
34
  init_executor,
39
35
  isEpicModeActive,
40
36
  isGitRepo,
@@ -65,7 +61,7 @@ import {
65
61
  saveTaskSetSnapshot,
66
62
  transientBackoff,
67
63
  validateProjectRoot
68
- } from "./index-emkb0bbe.js";
64
+ } from "./index-7cspygmb.js";
69
65
  import {
70
66
  withTimeout
71
67
  } from "./index-4905hd2m.js";
@@ -95,15 +91,15 @@ import {
95
91
  retireSkill,
96
92
  selectCandidateEntries,
97
93
  syncBundledProjectSkillsIfMissingAsync
98
- } from "./index-gr7ssnj9.js";
94
+ } from "./index-q00e4s1s.js";
99
95
  import {
100
96
  readRecentEscalations
101
- } from "./index-xdsj4qtd.js";
97
+ } from "./index-j9kxwshw.js";
102
98
  import {
103
99
  alreadyCuratedThisGeneration,
104
100
  claimNextScanBatch,
105
101
  resolveCohortId
106
- } from "./index-rkd6qwjh.js";
102
+ } from "./index-hns7xjm7.js";
107
103
  import {
108
104
  CURATOR_INIT_PROMPT,
109
105
  CURATOR_PHASE_PROMPT,
@@ -136,11 +132,11 @@ import {
136
132
  validateActionability,
137
133
  validateActionableFields,
138
134
  validateLesson
139
- } from "./index-j33zb3cx.js";
135
+ } from "./index-m0bmh3w0.js";
140
136
  import {
141
137
  authorizeCuration,
142
138
  buildConfigFingerprintInput
143
- } from "./index-3r1w7xky.js";
139
+ } from "./index-cqsak7bf.js";
144
140
  import {
145
141
  cohortConfigFingerprint
146
142
  } from "./index-rtry5xyf.js";
@@ -170,7 +166,7 @@ import {
170
166
  transactFile,
171
167
  transactKnowledge,
172
168
  wordBigrams
173
- } from "./index-ny13nr0x.js";
169
+ } from "./index-n2712byd.js";
174
170
  import {
175
171
  MAX_EVENT_LOG_ENTRIES,
176
172
  _internals,
@@ -180,7 +176,7 @@ import {
180
176
  recordHiveKnowledgeEvent,
181
177
  recordKnowledgeEvent,
182
178
  resolveKnowledgeEventsPath
183
- } from "./index-3sx27bxt.js";
179
+ } from "./index-dywekeen.js";
184
180
  import {
185
181
  resolveHiveDataDir,
186
182
  resolveHiveEventsPath,
@@ -196,15 +192,14 @@ import {
196
192
  resolveLinkDir,
197
193
  sanitizeLinkId,
198
194
  writeLinkPointer
199
- } from "./index-3jvqw5hy.js";
195
+ } from "./index-q27bajqb.js";
200
196
  import {
201
197
  loadPluginConfig,
202
198
  loadPluginConfigWithMeta
203
- } from "./index-9xpgytj9.js";
199
+ } from "./index-3rr0ese8.js";
204
200
  import {
205
- PlanSchema,
206
201
  RetrospectiveEvidenceSchema
207
- } from "./index-qt2yaghg.js";
202
+ } from "./index-vcgfqd8f.js";
208
203
  import {
209
204
  AGENT_TOOL_MAP,
210
205
  ALL_SUBAGENT_NAMES,
@@ -215,7 +210,7 @@ import {
215
210
  TOOL_NAME_SET,
216
211
  getCanonicalAgentRole,
217
212
  stripKnownSwarmPrefix
218
- } from "./index-tftv9xh9.js";
213
+ } from "./index-wr8qgpz5.js";
219
214
  import {
220
215
  KNOWLEDGE_SCHEMA_VERSION,
221
216
  OUTCOME_BLOCK_THRESHOLD,
@@ -226,8 +221,20 @@ import {
226
221
  init_capability_probe
227
222
  } from "./index-8fwhhayc.js";
228
223
  import {
229
- clearAllScopes
230
- } from "./index-51gg9947.js";
224
+ MAX_PENDING_SCOPE_BINDINGS,
225
+ clearAllScopes,
226
+ clearScopeBindingFromDisk,
227
+ clearScopeBindings
228
+ } from "./index-d6h5hq91.js";
229
+ import {
230
+ appendLedgerEvent,
231
+ computePlanHash,
232
+ derivePlanId,
233
+ initLedger
234
+ } from "./index-ctpgsj84.js";
235
+ import {
236
+ PlanSchema
237
+ } from "./index-m1abzg93.js";
231
238
  import {
232
239
  advisoryWarn,
233
240
  getDeferredWarnings
@@ -246,7 +253,7 @@ import {
246
253
  } from "./index-zgwm4ryv.js";
247
254
  import {
248
255
  atomicWriteFile
249
- } from "./index-h07wn84h.js";
256
+ } from "./index-7mkpsw6g.js";
250
257
  import {
251
258
  tryAcquireLock,
252
259
  withEvidenceLock
@@ -9858,7 +9865,7 @@ async function runCuratorPhase(directory, phase, agentsDispatched, config, knowl
9858
9865
  }
9859
9866
  if (config.skill_generation_enabled === true && skillCandidates.length > 0) {
9860
9867
  try {
9861
- const skillModule = await import("./skill-generator-nt5qxafq.js");
9868
+ const skillModule = await import("./skill-generator-63r20a9k.js");
9862
9869
  for (const cand of skillCandidates) {
9863
9870
  if (cand.confidence < (config.min_skill_confidence ?? DEFAULT_SKILL_MIN_CONFIDENCE)) {
9864
9871
  continue;
@@ -10195,7 +10202,7 @@ async function applyCuratorKnowledgeUpdates(directory, recommendations, knowledg
10195
10202
  } catch {}
10196
10203
  }
10197
10204
  if (contradictedEntries.length > 0 && knowledgeConfig.contradiction_threshold_action === "quarantine") {
10198
- const { maybeQuarantineOnContradiction } = await import("./knowledge-escalator-sya06p12.js");
10205
+ const { maybeQuarantineOnContradiction } = await import("./knowledge-escalator-dyxsm78k.js");
10199
10206
  for (const { id } of contradictedEntries) {
10200
10207
  try {
10201
10208
  await maybeQuarantineOnContradiction(directory, id, knowledgeConfig.contradiction_quarantine_threshold, knowledgeConfig.contradiction_quarantine_window_days);
@@ -10993,7 +11000,7 @@ async function runCuratorPostMortem(directory, options = {}) {
10993
11000
  warnings.push("Failed to collect knowledge summary.");
10994
11001
  }
10995
11002
  try {
10996
- const { getScanStatus } = await import("./scan-cursor-nx5y5k7r.js");
11003
+ const { getScanStatus } = await import("./scan-cursor-hm0aqqae.js");
10997
11004
  const scanStatus = await getScanStatus(directory);
10998
11005
  if (scanStatus.remaining_estimate > 0) {
10999
11006
  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.`);
@@ -11165,9 +11172,9 @@ var _internals16 = {
11165
11172
  verifyPostMortemKnowledgeActions,
11166
11173
  repairPostMortemActions,
11167
11174
  loadDefaultKnowledgeConfig: async (directory) => {
11168
- const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-vwxpsk6j.js");
11175
+ const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-13bnng2n.js");
11169
11176
  try {
11170
- const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-rbfq77sz.js");
11177
+ const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-2j25br0p.js");
11171
11178
  const loaded = loadPluginConfigWithMeta2(directory);
11172
11179
  return KnowledgeConfigSchema2.parse(loaded.config.knowledge ?? {});
11173
11180
  } catch {
@@ -11175,11 +11182,11 @@ var _internals16 = {
11175
11182
  }
11176
11183
  },
11177
11184
  applyCuratorKnowledgeUpdates: async (directory, recommendations, knowledgeConfig, generation) => {
11178
- const { applyCuratorKnowledgeUpdates: applyCuratorKnowledgeUpdates2 } = await import("./curator-3rze3pd4.js");
11185
+ const { applyCuratorKnowledgeUpdates: applyCuratorKnowledgeUpdates2 } = await import("./curator-tkyn9bzz.js");
11179
11186
  return applyCuratorKnowledgeUpdates2(directory, recommendations, knowledgeConfig, generation);
11180
11187
  },
11181
11188
  checkHivePromotions: async (entries, knowledgeConfig, directory) => {
11182
- const { checkHivePromotions } = await import("./hive-promoter-dh38qd9m.js");
11189
+ const { checkHivePromotions } = await import("./hive-promoter-y5wsztkc.js");
11183
11190
  return checkHivePromotions(entries, knowledgeConfig, directory);
11184
11191
  },
11185
11192
  applyProposalTriage: async (directory, triage) => {
@@ -11188,7 +11195,7 @@ var _internals16 = {
11188
11195
  activateProposal,
11189
11196
  listSkills: listSkills2,
11190
11197
  sanitizeSlug
11191
- } = await import("./skill-generator-nt5qxafq.js");
11198
+ } = await import("./skill-generator-63r20a9k.js");
11192
11199
  const result = {
11193
11200
  approved: [],
11194
11201
  rejected: [],
@@ -13705,9 +13712,9 @@ function hashContent(content) {
13705
13712
  return createHash5("sha1").update(content).digest("hex");
13706
13713
  }
13707
13714
  async function loadConfigForPolicyCurator(directory) {
13708
- const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-vwxpsk6j.js");
13715
+ const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-13bnng2n.js");
13709
13716
  try {
13710
- const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-rbfq77sz.js");
13717
+ const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-2j25br0p.js");
13711
13718
  const { config: loadedConfig } = loadPluginConfigWithMeta2(directory);
13712
13719
  return KnowledgeConfigSchema2.parse(loadedConfig.knowledge ?? {});
13713
13720
  } catch {
@@ -16865,7 +16872,7 @@ async function runFinalizeStage(ctx) {
16865
16872
  }
16866
16873
  }
16867
16874
  try {
16868
- const { CuratorConfigSchema: CCS } = await import("./schema-vwxpsk6j.js");
16875
+ const { CuratorConfigSchema: CCS } = await import("./schema-13bnng2n.js");
16869
16876
  const { config: pmLoadedConfig } = _internals25.loadPluginConfigWithMeta(ctx.directory);
16870
16877
  const curatorCfg = CCS.parse(pmLoadedConfig.curator ?? {});
16871
16878
  if (curatorCfg.enabled && curatorCfg.postmortem_enabled) {
@@ -19016,9 +19023,9 @@ var _internals29 = {
19016
19023
  readSwarmFileAsync,
19017
19024
  loadCuratorDeps: async () => {
19018
19025
  const [{ CuratorConfigSchema }, curator, { createCuratorLLMDelegate: createCuratorLLMDelegate2 }] = await Promise.all([
19019
- import("./schema-vwxpsk6j.js"),
19020
- import("./curator-3rze3pd4.js"),
19021
- import("./curator-llm-factory-8rg0f77t.js")
19026
+ import("./schema-13bnng2n.js"),
19027
+ import("./curator-tkyn9bzz.js"),
19028
+ import("./curator-llm-factory-mfvd4sqx.js")
19022
19029
  ]);
19023
19030
  return { CuratorConfigSchema, curator, createCuratorLLMDelegate: createCuratorLLMDelegate2 };
19024
19031
  }
@@ -19516,7 +19523,7 @@ import { fileURLToPath } from "url";
19516
19523
  // package.json
19517
19524
  var package_default = {
19518
19525
  name: "opencode-swarm",
19519
- version: "7.122.0",
19526
+ version: "7.123.0",
19520
19527
  description: "Architect-centric agentic swarm plugin for OpenCode - hub-and-spoke orchestration with SME consultation, code generation, and QA review",
19521
19528
  main: "dist/index.js",
19522
19529
  types: "dist/index.d.ts",
@@ -19596,6 +19603,7 @@ var package_default = {
19596
19603
  ".opencode/skills/fork-pr-operations",
19597
19604
  ".opencode/skills/parallel-work-check",
19598
19605
  ".opencode/skills/ci-fix-monitor",
19606
+ ".opencode/skills/issue-tracer",
19599
19607
  "tests/fixtures/memory-recall",
19600
19608
  "README.md",
19601
19609
  "LICENSE"
@@ -19965,7 +19973,7 @@ async function computeCurationDiagnostics(directory, entries) {
19965
19973
  let scanCompleted = false;
19966
19974
  let scanRemaining = 0;
19967
19975
  try {
19968
- const { getScanStatus } = await import("./scan-cursor-nx5y5k7r.js");
19976
+ const { getScanStatus } = await import("./scan-cursor-hm0aqqae.js");
19969
19977
  const status = await getScanStatus(directory);
19970
19978
  scanGeneration = status.generation;
19971
19979
  scanCompleted = status.completed;
@@ -19973,19 +19981,19 @@ async function computeCurationDiagnostics(directory, entries) {
19973
19981
  } catch {}
19974
19982
  let configMatch = null;
19975
19983
  try {
19976
- const { isLinked: isLinked2 } = await import("./knowledge-link-sy85fw3w.js");
19984
+ const { isLinked: isLinked2 } = await import("./knowledge-link-4yd2z8ev.js");
19977
19985
  if (isLinked2(directory)) {
19978
- const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-vwxpsk6j.js");
19986
+ const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-13bnng2n.js");
19979
19987
  let config;
19980
19988
  try {
19981
- const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-rbfq77sz.js");
19989
+ const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-2j25br0p.js");
19982
19990
  const loaded = loadPluginConfigWithMeta2(directory);
19983
19991
  config = KnowledgeConfigSchema2.parse(loaded.config.knowledge ?? {});
19984
19992
  } catch {
19985
19993
  config = KnowledgeConfigSchema2.parse({});
19986
19994
  }
19987
19995
  const { cohortConfigFingerprint: cohortConfigFingerprint2 } = await import("./config-fingerprint-v22xh5a2.js");
19988
- const { buildConfigFingerprintInput: buildConfigFingerprintInput2, readCohortConfigFingerprint } = await import("./curation-policy-cj1tpzr5.js");
19996
+ const { buildConfigFingerprintInput: buildConfigFingerprintInput2, readCohortConfigFingerprint } = await import("./curation-policy-4j4qce5a.js");
19989
19997
  const currentFp = cohortConfigFingerprint2(buildConfigFingerprintInput2(config));
19990
19998
  const cohortFp = await readCohortConfigFingerprint(directory);
19991
19999
  configMatch = cohortFp === null ? null : currentFp === cohortFp;
@@ -21163,7 +21171,7 @@ async function handleDoctorCommand(directory, args) {
21163
21171
  const result = runConfigDoctor(config, directory);
21164
21172
  let output;
21165
21173
  if (enableAutoFix && result.hasAutoFixableIssues) {
21166
- const { runConfigDoctorWithFixes } = await import("./config-doctor-404c8mf8.js");
21174
+ const { runConfigDoctorWithFixes } = await import("./config-doctor-3ksh1534.js");
21167
21175
  const fixResult = await runConfigDoctorWithFixes(directory, config, true);
21168
21176
  output = formatDoctorMarkdown(fixResult.result);
21169
21177
  } else {
@@ -21976,7 +21984,7 @@ async function handleEvidenceCommand(directory, args) {
21976
21984
  return formatTaskEvidenceMarkdown(evidenceData);
21977
21985
  }
21978
21986
  async function handleEvidenceSummaryCommand(directory) {
21979
- const { buildEvidenceSummary } = await import("./evidence-summary-service-k14ykm03.js");
21987
+ const { buildEvidenceSummary } = await import("./evidence-summary-service-96ndczbk.js");
21980
21988
  const artifact = await buildEvidenceSummary(directory);
21981
21989
  if (!artifact) {
21982
21990
  return "No plan found. Run `/swarm plan` to check plan status.";
@@ -39356,7 +39364,7 @@ function buildDetailedHelp(commandName, entry) {
39356
39364
  async function handleHelpCommand(ctx) {
39357
39365
  const targetCommand = ctx.args.join(" ");
39358
39366
  if (!targetCommand) {
39359
- const { buildHelpText } = await import("./index-jzpv74mq.js");
39367
+ const { buildHelpText } = await import("./index-7g91saha.js");
39360
39368
  return buildHelpText();
39361
39369
  }
39362
39370
  const tokens = targetCommand.split(/\s+/);
@@ -39365,7 +39373,7 @@ async function handleHelpCommand(ctx) {
39365
39373
  return _internals63.buildDetailedHelp(resolved.key, resolved.entry);
39366
39374
  }
39367
39375
  const similar = _internals63.findSimilarCommands(targetCommand);
39368
- const { buildHelpText: fullHelp } = await import("./index-jzpv74mq.js");
39376
+ const { buildHelpText: fullHelp } = await import("./index-7g91saha.js");
39369
39377
  if (similar.length > 0) {
39370
39378
  return `Command '/swarm ${targetCommand}' not found.
39371
39379
 
@@ -39498,7 +39506,7 @@ var COMMAND_REGISTRY = {
39498
39506
  },
39499
39507
  "guardrail explain": {
39500
39508
  handler: async (ctx) => {
39501
- const { handleGuardrailExplain } = await import("./guardrail-explain-hdsxa2c5.js");
39509
+ const { handleGuardrailExplain } = await import("./guardrail-explain-4vytbchb.js");
39502
39510
  return handleGuardrailExplain(ctx.directory, ctx.args);
39503
39511
  },
39504
39512
  description: "Dry-run: show what the guardrails would do to a command or write target (executes nothing)",
@@ -39508,7 +39516,7 @@ var COMMAND_REGISTRY = {
39508
39516
  },
39509
39517
  "guardrail-explain": {
39510
39518
  handler: async (ctx) => {
39511
- const { handleGuardrailExplain } = await import("./guardrail-explain-hdsxa2c5.js");
39519
+ const { handleGuardrailExplain } = await import("./guardrail-explain-4vytbchb.js");
39512
39520
  return handleGuardrailExplain(ctx.directory, ctx.args);
39513
39521
  },
39514
39522
  description: "Dry-run: show what the guardrails would do to a command or write target (executes nothing)",
@@ -39518,7 +39526,7 @@ var COMMAND_REGISTRY = {
39518
39526
  },
39519
39527
  "guardrail-log": {
39520
39528
  handler: async (ctx) => {
39521
- const { handleGuardrailLog } = await import("./guardrail-log-dhpp0kmn.js");
39529
+ const { handleGuardrailLog } = await import("./guardrail-log-z291m4gw.js");
39522
39530
  return handleGuardrailLog(ctx.directory, ctx.args);
39523
39531
  },
39524
39532
  description: "Read the guardrail decision log (use --blocks-only for blocks)",
@@ -40523,11 +40531,11 @@ If a tool modifies a file, it is a CODER tool. Delegate.
40523
40531
  1a. SCOPE DISCIPLINE \u2014 call declare_scope BEFORE every coder delegation AND before any test_engineer delegation that will write new test files.
40524
40532
  - 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/*).
40525
40533
  - 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.
40526
- - 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. Those routes bypass the authority check and violate scope discipline.
40527
- - Never wrap a file write in eval, bash -c, sh -c, a subshell, or a heredoc-to-file redirect. Those are bash workarounds and are banned even when scope appears to permit them \u2014 the write-authority guard is tool-scoped; bash is unguarded and must not be used as a write path.
40534
+ - 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.
40535
+ - 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.
40528
40536
  - 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.
40529
40537
  - 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.
40530
- - Rationale: declare_scope persists the allowed set to disk (.swarm/scopes/scope-\${taskId}.json) so it survives cross-process delegation. Without a call, the coder or test_engineer process reads an empty scope and every Edit/Write is denied.
40538
+ - 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.
40531
40539
  <!-- BEHAVIORAL_GUIDANCE_END -->
40532
40540
  2. ONE agent per message. Send, STOP, wait for response.
40533
40541
  Exception: Stage B reviewer/test_engineer gate agents for the SAME completed coder task may be dispatched together before waiting when both gates are required. This exception NEVER applies to coder delegations. Preserve ONE task per coder call.
@@ -40541,7 +40549,7 @@ If a tool modifies a file, it is a CODER tool. Delegate.
40541
40549
  <!-- BEHAVIORAL_GUIDANCE_START -->
40542
40550
  BATCHING DETECTION \u2014 you are batching if your coder delegation contains ANY of:
40543
40551
  - The word "and" connecting two actions ("update X AND add Y")
40544
- - Multiple FILE paths ("FILE: src/a.ts, src/b.ts, src/c.ts")
40552
+ - Multiple objectives hidden behind a comma-separated FILE value (use one complete relative path per FILE: line)
40545
40553
  - Multiple TASK objectives ("TASK: Refactor the processor and update the config")
40546
40554
  - Phrases like "also", "while you're at it", "additionally", "as well"
40547
40555
 
@@ -41308,7 +41316,7 @@ Purpose: Ingest issue evidence, trace impact, and transition to the full fix wor
41308
41316
  ACTION: Load skill ${bundledProjectSkillFileReference("issue-ingest")} immediately. Follow the protocol defined there.
41309
41317
 
41310
41318
  HARD CONSTRAINTS:
41311
- - Preserve issue evidence, flag missing repro details, and route non-mega swarms through the active swarm's agents.
41319
+ - Preserve issue evidence, flag missing repro details, and route every delegation through the current session's active-swarm role mapping; no swarm ID receives special behavior.
41312
41320
 
41313
41321
  RECOVERY: At mode entry, read .swarm/issue-reference.json to recover the source issue URL, number, and flags (plan/trace/noRepro) if the mode signal has been lost or context was compacted.
41314
41322
 
@@ -42381,7 +42389,7 @@ DO NOT:
42381
42389
  - Use the semantic diff as a substitute for your own reasoning about correctness
42382
42390
 
42383
42391
  ## EXPLORER FINDINGS \u2014 VALIDATE BEFORE REPORTING
42384
- Explorer agent outputs (from @mega_explorer) may contain observations labeled as REVIEW NEEDED, RISKS, VERDICT, BREAKING, COMPATIBLE, or similar judgment language. Treat these as CANDIDATE OBSERVATIONS, not established facts.
42392
+ Explorer agent outputs may contain observations labeled as REVIEW NEEDED, RISKS, VERDICT, BREAKING, COMPATIBLE, or similar judgment language. Treat these as CANDIDATE OBSERVATIONS, not established facts, regardless of the active swarm's user-defined ID.
42385
42393
  - BEFORE including any issue-like finding from explorer input in your final report: READ the relevant code yourself and verify the issue independently
42386
42394
  - Do NOT adopt the explorer's VERDICT, BREAKING, or COMPATIBLE labels as your own \u2014 you must reach your own conclusion
42387
42395
  - Explorer's RISKS section names potential concerns \u2014 you determine if they are actual issues through your own review
@@ -42727,6 +42735,17 @@ SME is read-only. Cache persistence is Architect's responsibility \u2014 save th
42727
42735
 
42728
42736
  // src/agents/index.ts
42729
42737
  var warnedAgents = new Set;
42738
+ var NONTRANSIENT_STOP_PROTOCOL = [
42739
+ "",
42740
+ "## NON-TRANSIENT TOOL FAILURE PROTOCOL \u2014 MANDATORY",
42741
+ "Apply this protocol when a tool reports ParserError, ParseError, MissingEndCurlyBrace, CommandNotFoundException, a command-not-found/not-recognized error, or [sandbox] BLOCKED.",
42742
+ "It also applies when guardrails report NON-TRANSIENT STOP or NON-TRANSIENT CIRCUIT BREAKER \u2014 including the third same-category permanent failure:",
42743
+ "1. STOP. Do not retry the same operation with a different command, shell, tool, quoting style, or wrapper.",
42744
+ "2. Treat the failure as structural, not transient. Do not spend retry budget on it.",
42745
+ "3. Report BLOCKED with the exact error category and the command/tool that failed.",
42746
+ "4. Wait for corrected input, environment, scope, or a verified new invocation before continuing."
42747
+ ].join(`
42748
+ `);
42730
42749
  var _swarmAgentsMap = new Map;
42731
42750
  var KNOWN_VARIANT_VALUES = new Set([
42732
42751
  "low",
@@ -43080,6 +43099,13 @@ var loggedFirstCalls = new Set;
43080
43099
  // src/hooks/guardrails/messages-transform.ts
43081
43100
  var TRANSIENT_STATUS_CODES = new Set([408, 429, 500, 502, 503, 504, 529]);
43082
43101
 
43102
+ // src/hooks/guardrails/nontransient-circuit.ts
43103
+ var IMMEDIATE_HARD_STOP_CATEGORIES = new Set([
43104
+ "shell_parse_error",
43105
+ "command_not_found",
43106
+ "sandbox_wrapper_failure"
43107
+ ]);
43108
+
43083
43109
  // src/commands/command-dispatch.ts
43084
43110
  function normalizeSwarmCommandInput(command, argumentText) {
43085
43111
  if (command !== "swarm" && !command.startsWith("swarm-")) {
@@ -44762,6 +44788,9 @@ function resolveWriteTargets(command, writes, cwd) {
44762
44788
  };
44763
44789
  });
44764
44790
  }
44791
+
44792
+ // src/tools/file-extractor-planner.ts
44793
+ var cachedPlans = new WeakMap;
44765
44794
  // src/hooks/guardrails/index.ts
44766
44795
  var SPEC_DRIFT_BLOCKED_TOOLS = new Set([
44767
44796
  "save_plan",
@@ -44782,7 +44811,46 @@ var EvidenceTaskIdPlanSchema = exports_external.object({
44782
44811
  }).passthrough()).optional()
44783
44812
  }).passthrough()).optional()
44784
44813
  }).passthrough();
44785
- var pendingCoderScopeByTaskId = new Map;
44814
+
44815
+ class BoundedPendingScopeMap extends Map {
44816
+ expiresAtByKey = new Map;
44817
+ sweepExpired(now = Date.now()) {
44818
+ for (const [key, expiresAt] of this.expiresAtByKey) {
44819
+ if (expiresAt <= now)
44820
+ this.delete(key);
44821
+ }
44822
+ }
44823
+ set(key, value) {
44824
+ this.sweepExpired();
44825
+ this.delete(key);
44826
+ super.set(key, value);
44827
+ this.expiresAtByKey.set(key, Date.now() + 5 * 60000);
44828
+ while (this.size > MAX_PENDING_SCOPE_BINDINGS) {
44829
+ const oldest = this.keys().next().value;
44830
+ if (!oldest)
44831
+ break;
44832
+ this.delete(oldest);
44833
+ }
44834
+ return this;
44835
+ }
44836
+ get(key) {
44837
+ this.sweepExpired();
44838
+ return super.get(key);
44839
+ }
44840
+ has(key) {
44841
+ this.sweepExpired();
44842
+ return super.has(key);
44843
+ }
44844
+ delete(key) {
44845
+ this.expiresAtByKey.delete(key);
44846
+ return super.delete(key);
44847
+ }
44848
+ clear() {
44849
+ this.expiresAtByKey.clear();
44850
+ super.clear();
44851
+ }
44852
+ }
44853
+ var pendingCoderScopeByTaskId = new BoundedPendingScopeMap;
44786
44854
  function clearPendingCoderScope() {
44787
44855
  pendingCoderScopeByTaskId.clear();
44788
44856
  }
@@ -44893,6 +44961,16 @@ var STATE_ORDER2 = [
44893
44961
  "tests_run",
44894
44962
  "complete"
44895
44963
  ];
44964
+ function createNonTransientCircuitState(agentName, invocationId) {
44965
+ return {
44966
+ ownerAgent: stripKnownSwarmPrefix(agentName),
44967
+ ownerInvocationId: invocationId,
44968
+ category: null,
44969
+ sameCategoryCount: 0,
44970
+ hardStop: false,
44971
+ lastSignal: null
44972
+ };
44973
+ }
44896
44974
  var _toolAggregates = new Map;
44897
44975
  var defaultRunContext = new AgentRunContext("default", _toolAggregates);
44898
44976
  var _runContexts = new Map;
@@ -44944,6 +45022,13 @@ function resetSwarmState() {
44944
45022
  swarmState.fullAutoEnabledInConfig = false;
44945
45023
  swarmState.environmentProfiles.clear();
44946
45024
  clearPendingCoderScope();
45025
+ for (const binding of clearScopeBindings()) {
45026
+ clearScopeBindingFromDisk({
45027
+ directory: binding.workspaceIdentity,
45028
+ taskId: binding.taskId,
45029
+ ownerSessionId: binding.ownerSessionId
45030
+ });
45031
+ }
44947
45032
  resetStandardWorktreeIsolationState();
44948
45033
  resetRealtimeLearningNudgeState();
44949
45034
  _councilDisagreementWarned.clear();
@@ -45003,6 +45088,8 @@ function startAgentSession(sessionId, agentName, staleDurationMs = STALE_SESSION
45003
45088
  activeInvocationId: 0,
45004
45089
  lastInvocationIdByAgent: {},
45005
45090
  windows: {},
45091
+ nonTransientCircuit: createNonTransientCircuitState(agentName, 0),
45092
+ pendingToolExecutions: new Map,
45006
45093
  lastCompactionHint: 0,
45007
45094
  architectWriteCount: 0,
45008
45095
  lastCoderDelegationTaskId: null,
@@ -45083,6 +45170,14 @@ function startAgentSession(sessionId, agentName, staleDurationMs = STALE_SESSION
45083
45170
  }
45084
45171
  }
45085
45172
  function endAgentSession(sessionId) {
45173
+ const removedBindings = clearScopeBindings((binding) => binding.ownerSessionId === sessionId || binding.parentOwnerSessionId === sessionId);
45174
+ for (const binding of removedBindings) {
45175
+ clearScopeBindingFromDisk({
45176
+ directory: binding.workspaceIdentity,
45177
+ taskId: binding.taskId,
45178
+ ownerSessionId: binding.ownerSessionId
45179
+ });
45180
+ }
45086
45181
  swarmState.agentSessions.delete(sessionId);
45087
45182
  clearRealtimeLearningNudgeSession(sessionId);
45088
45183
  }
@@ -45099,6 +45194,7 @@ function ensureAgentSession(sessionId, agentName, directory) {
45099
45194
  telemetry.agentActivated(sessionId, agentName, oldName);
45100
45195
  session.delegationActive = false;
45101
45196
  session.lastAgentEventTime = now;
45197
+ session.nonTransientCircuit = createNonTransientCircuitState(agentName, 0);
45102
45198
  if (!session.windows) {
45103
45199
  session.activeInvocationId = 0;
45104
45200
  session.lastInvocationIdByAgent = {};
@@ -45110,6 +45206,12 @@ function ensureAgentSession(sessionId, agentName, directory) {
45110
45206
  session.lastInvocationIdByAgent = {};
45111
45207
  session.windows = {};
45112
45208
  }
45209
+ if (session.nonTransientCircuit === undefined) {
45210
+ session.nonTransientCircuit = createNonTransientCircuitState(session.agentName, session.activeInvocationId ?? 0);
45211
+ }
45212
+ if (session.pendingToolExecutions === undefined) {
45213
+ session.pendingToolExecutions = new Map;
45214
+ }
45113
45215
  if (session.lastCompactionHint === undefined) {
45114
45216
  session.lastCompactionHint = 0;
45115
45217
  }
@@ -45262,13 +45364,14 @@ function beginInvocation(sessionId, agentName) {
45262
45364
  throw new Error(`Cannot begin invocation: session ${sessionId} does not exist`);
45263
45365
  }
45264
45366
  const stripped = stripKnownSwarmPrefix(agentName);
45265
- if (stripped === ORCHESTRATOR_NAME) {
45266
- return null;
45267
- }
45268
45367
  const lastId = session.lastInvocationIdByAgent[stripped] || 0;
45269
45368
  const newId = lastId + 1;
45270
45369
  session.lastInvocationIdByAgent[stripped] = newId;
45271
45370
  session.activeInvocationId = newId;
45371
+ session.nonTransientCircuit = createNonTransientCircuitState(stripped, newId);
45372
+ if (stripped === ORCHESTRATOR_NAME) {
45373
+ return null;
45374
+ }
45272
45375
  const now = Date.now();
45273
45376
  const window = {
45274
45377
  id: newId,
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  authorizeCuration
4
- } from "./index-3r1w7xky.js";
4
+ } from "./index-cqsak7bf.js";
5
5
  import {
6
6
  findNearDuplicate,
7
7
  inferTags,
@@ -9,17 +9,17 @@ import {
9
9
  resolveSwarmKnowledgePath,
10
10
  resolveSwarmRejectedPath,
11
11
  transactKnowledge
12
- } from "./index-ny13nr0x.js";
12
+ } from "./index-n2712byd.js";
13
13
  import {
14
14
  resolveKnowledgeStoreDir
15
- } from "./index-3jvqw5hy.js";
15
+ } from "./index-q27bajqb.js";
16
16
  import {
17
17
  init_logger,
18
18
  warn
19
19
  } from "./index-zgwm4ryv.js";
20
20
  import {
21
21
  atomicWriteFile
22
- } from "./index-h07wn84h.js";
22
+ } from "./index-7mkpsw6g.js";
23
23
  import {
24
24
  require_proper_lockfile
25
25
  } from "./index-7g4c7s5r.js";
@@ -0,0 +1,68 @@
1
+ // @bun
2
+ import {
3
+ exports_external
4
+ } from "./index-293f68mj.js";
5
+
6
+ // src/config/plan-schema.ts
7
+ var ExecutionProfileSchema = exports_external.object({
8
+ parallelization_enabled: exports_external.boolean().default(false),
9
+ max_concurrent_tasks: exports_external.number().int().min(1).max(64).default(10),
10
+ council_parallel: exports_external.boolean().default(true),
11
+ locked: exports_external.boolean().default(false),
12
+ auto_proceed: exports_external.boolean().default(false)
13
+ });
14
+ var TaskStatusSchema = exports_external.enum([
15
+ "pending",
16
+ "in_progress",
17
+ "completed",
18
+ "blocked",
19
+ "closed"
20
+ ]);
21
+ var TaskSizeSchema = exports_external.enum(["small", "medium", "large"]);
22
+ var PhaseStatusSchema = exports_external.enum([
23
+ "pending",
24
+ "in_progress",
25
+ "complete",
26
+ "completed",
27
+ "blocked",
28
+ "closed"
29
+ ]);
30
+ var MigrationStatusSchema = exports_external.enum([
31
+ "native",
32
+ "migrated",
33
+ "migration_failed"
34
+ ]);
35
+ var TaskSchema = exports_external.object({
36
+ id: exports_external.string(),
37
+ phase: exports_external.number().int().min(1),
38
+ status: TaskStatusSchema.default("pending"),
39
+ size: TaskSizeSchema.default("small"),
40
+ description: exports_external.string().min(1),
41
+ depends: exports_external.array(exports_external.string()).default([]),
42
+ acceptance: exports_external.string().optional(),
43
+ files_touched: exports_external.array(exports_external.string()).default([]),
44
+ evidence_path: exports_external.string().optional(),
45
+ blocked_reason: exports_external.string().optional(),
46
+ fr_refs: exports_external.array(exports_external.string()).optional()
47
+ });
48
+ var PhaseSchema = exports_external.object({
49
+ id: exports_external.number().int().min(1),
50
+ name: exports_external.string().min(1),
51
+ status: PhaseStatusSchema.default("pending"),
52
+ tasks: exports_external.array(TaskSchema).default([]),
53
+ type: exports_external.enum(["code", "non-code"]).optional(),
54
+ required_agents: exports_external.array(exports_external.string()).optional()
55
+ });
56
+ var PlanSchema = exports_external.object({
57
+ schema_version: exports_external.literal("1.0.0"),
58
+ title: exports_external.string().min(1),
59
+ swarm: exports_external.string().min(1),
60
+ current_phase: exports_external.number().int().min(1).optional(),
61
+ phases: exports_external.array(PhaseSchema).min(1),
62
+ migration_status: MigrationStatusSchema.optional(),
63
+ specMtime: exports_external.string().optional(),
64
+ specHash: exports_external.string().optional(),
65
+ execution_profile: ExecutionProfileSchema.optional()
66
+ });
67
+
68
+ export { ExecutionProfileSchema, TaskStatusSchema, TaskSizeSchema, PhaseStatusSchema, MigrationStatusSchema, TaskSchema, PhaseSchema, PlanSchema };