opencode-swarm 7.136.2 → 7.136.3

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 (84) hide show
  1. package/.opencode/skills/brainstorm/SKILL.md +1 -1
  2. package/.opencode/skills/clarify/SKILL.md +3 -3
  3. package/.opencode/skills/clarify-spec/SKILL.md +2 -2
  4. package/.opencode/skills/consult/SKILL.md +1 -1
  5. package/.opencode/skills/council/SKILL.md +1 -1
  6. package/.opencode/skills/critic-gate/SKILL.md +8 -3
  7. package/.opencode/skills/discover/SKILL.md +1 -1
  8. package/.opencode/skills/execute/SKILL.md +1 -1
  9. package/.opencode/skills/gate-attribution/SKILL.md +1 -1
  10. package/.opencode/skills/issue-ingest/SKILL.md +3 -3
  11. package/.opencode/skills/phase-wrap/SKILL.md +1 -1
  12. package/.opencode/skills/plan/SKILL.md +3 -3
  13. package/.opencode/skills/pre-phase-briefing/SKILL.md +1 -1
  14. package/.opencode/skills/resume/SKILL.md +1 -1
  15. package/.opencode/skills/specify/SKILL.md +1 -1
  16. package/dist/cli/{config-doctor-b67nb84b.js → config-doctor-g71mz50j.js} +2 -2
  17. package/dist/cli/{core-4z1s2ak1.js → core-jpjk2qvt.js} +1 -1
  18. package/dist/cli/{curation-policy-kvzhfaj1.js → curation-policy-zhyttjpa.js} +6 -6
  19. package/dist/cli/{curator-nrmj8bds.js → curator-36dxw38r.js} +25 -25
  20. package/dist/cli/{curator-llm-factory-x7kvry9x.js → curator-llm-factory-k2a7cv41.js} +25 -25
  21. package/dist/cli/{evidence-summary-service-cf8sz2bq.js → evidence-summary-service-nse06dqr.js} +7 -7
  22. package/dist/cli/{gate-evidence-aenyz6vt.js → gate-evidence-kdygjr56.js} +4 -4
  23. package/dist/cli/{guardrail-explain-5kd44rcj.js → guardrail-explain-1k337z5d.js} +26 -26
  24. package/dist/cli/{guardrail-log-aksrzqdx.js → guardrail-log-xbc9bvdt.js} +3 -3
  25. package/dist/cli/{hive-promoter-cy21rhnd.js → hive-promoter-daxrn62p.js} +25 -25
  26. package/dist/cli/{index-y0xaq4f3.js → index-0vq9gnqd.js} +8 -2
  27. package/dist/cli/{index-rw3f73aq.js → index-176zwqcq.js} +2 -2
  28. package/dist/cli/{index-kwwxevne.js → index-45y0y3xh.js} +5 -5
  29. package/dist/cli/{index-7ayaq27q.js → index-68tjkaqk.js} +1 -1
  30. package/dist/cli/{index-s0rbdp61.js → index-79pgzj9a.js} +4 -4
  31. package/dist/cli/{index-45t7w06b.js → index-7t3vjw5e.js} +1 -1
  32. package/dist/cli/{index-ey29aap6.js → index-b3jfcptk.js} +1 -1
  33. package/dist/cli/{index-sr2cynyw.js → index-brtg922w.js} +108 -51
  34. package/dist/cli/{index-7a2hm51h.js → index-cze4bq1x.js} +41 -0
  35. package/dist/cli/{index-mrtms113.js → index-d2sf9an1.js} +2 -2
  36. package/dist/cli/{index-wxyxf0bd.js → index-d61h3f3h.js} +2 -2
  37. package/dist/cli/{index-ckybsn6p.js → index-g2kpqpvh.js} +27 -27
  38. package/dist/cli/{index-37v2wxqe.js → index-g5rtcb1n.js} +1 -1
  39. package/dist/cli/{index-ad6j0m7k.js → index-gj5jerzz.js} +3 -3
  40. package/dist/cli/{index-c9ddxv4k.js → index-hh34tyv7.js} +1 -1
  41. package/dist/cli/{index-21115szq.js → index-kp5h245k.js} +5 -5
  42. package/dist/cli/{index-tcn457d5.js → index-kym0cctr.js} +1 -1
  43. package/dist/cli/{index-84nz7bhe.js → index-mgbpbs1f.js} +3 -3
  44. package/dist/cli/{index-m5fw4mer.js → index-n89fdxwg.js} +1 -1
  45. package/dist/cli/{index-z1tm47nj.js → index-ne28wyyc.js} +2 -2
  46. package/dist/cli/{index-wjm896ey.js → index-nfm9f10v.js} +1 -1
  47. package/dist/cli/{index-azghvnja.js → index-pff46kfv.js} +2 -2
  48. package/dist/cli/{index-wnz282j3.js → index-rtgqy0yg.js} +2 -2
  49. package/dist/cli/{index-09b9zncg.js → index-tncy55bp.js} +1 -1
  50. package/dist/cli/{index-vg3yx648.js → index-w6j1n5az.js} +1 -1
  51. package/dist/cli/{index-0755132s.js → index-wbdxmf1a.js} +6 -6
  52. package/dist/cli/{index-1kn24ja0.js → index-zcrvn579.js} +2 -2
  53. package/dist/cli/{index-s0vahtdm.js → index-zwh5dewz.js} +1 -1
  54. package/dist/cli/{index-dzyjb33e.js → index-zzhyws9g.js} +1 -1
  55. package/dist/cli/index.js +25 -25
  56. package/dist/cli/{knowledge-escalator-ta3xjrdj.js → knowledge-escalator-h7fspgph.js} +7 -7
  57. package/dist/cli/{knowledge-events-dk6banmz.js → knowledge-events-vkf7an5n.js} +5 -5
  58. package/dist/cli/{knowledge-link-mm1w967j.js → knowledge-link-zr40rnwr.js} +4 -4
  59. package/dist/cli/{knowledge-store-h3jz10bv.js → knowledge-store-s4976v9c.js} +5 -5
  60. package/dist/cli/{knowledge-validator-jsz1dxkr.js → knowledge-validator-64ppqy4y.js} +8 -8
  61. package/dist/cli/{pending-delegations-qajsxct0.js → pending-delegations-0h5b18p7.js} +3 -3
  62. package/dist/cli/{pr-subscriptions-qhr41epq.js → pr-subscriptions-jn0h047q.js} +3 -3
  63. package/dist/cli/{runner-2v413r74.js → runner-deeswadt.js} +5 -5
  64. package/dist/cli/{scan-cursor-48gwzh9c.js → scan-cursor-xbkae12h.js} +6 -6
  65. package/dist/cli/{schema-f937b9cs.js → schema-7jm70cab.js} +1 -1
  66. package/dist/cli/{scope-persistence-h2fpgxww.js → scope-persistence-5xc9ntdh.js} +4 -4
  67. package/dist/cli/{skill-generator-4p10ktw1.js → skill-generator-8gtq1ajr.js} +9 -9
  68. package/dist/cli/{telemetry-859khp82.js → telemetry-6678gya0.js} +1 -1
  69. package/dist/cli/{worktree-collision-ownership-13btcj9g.js → worktree-collision-ownership-wt7cc850.js} +3 -3
  70. package/dist/config/schema.d.ts +10 -0
  71. package/dist/hooks/delegation-gate.d.ts +12 -1
  72. package/dist/hooks/gate-denial-tracker.d.ts +175 -0
  73. package/dist/hooks/guardrails/execution-episode.d.ts +41 -0
  74. package/dist/hooks/guardrails/execution-stall.d.ts +285 -0
  75. package/dist/hooks/guardrails/internals-guard.d.ts +117 -0
  76. package/dist/hooks/guardrails/messages-transform.d.ts +85 -0
  77. package/dist/hooks/trajectory-logger.d.ts +76 -0
  78. package/dist/index.js +476 -462
  79. package/dist/memory/schema.d.ts +3 -3
  80. package/dist/prm/index.d.ts +2 -0
  81. package/dist/state.d.ts +32 -0
  82. package/dist/telemetry.d.ts +66 -1
  83. package/dist/types/events.d.ts +14 -1
  84. package/package.json +2 -1
@@ -12,16 +12,16 @@ import {
12
12
  resolveExecutableFromPath,
13
13
  runEvaluation,
14
14
  runExternalTool
15
- } from "./index-wjm896ey.js";
15
+ } from "./index-nfm9f10v.js";
16
16
  import {
17
17
  stableCanonicalStringify
18
- } from "./index-m5fw4mer.js";
18
+ } from "./index-n89fdxwg.js";
19
19
  import {
20
20
  detectStraySwarmDirs,
21
21
  readDoctorArtifact,
22
22
  removeStraySwarmDir,
23
23
  runConfigDoctor
24
- } from "./index-7ayaq27q.js";
24
+ } from "./index-68tjkaqk.js";
25
25
  import {
26
26
  MAX_TRANSIENT_RETRIES,
27
27
  archiveEvidence,
@@ -58,7 +58,7 @@ import {
58
58
  savePlan,
59
59
  transientBackoff,
60
60
  validateProjectRoot
61
- } from "./index-kwwxevne.js";
61
+ } from "./index-45y0y3xh.js";
62
62
  import {
63
63
  EvaluationTaskV1Schema,
64
64
  GateAuditManifestV1Schema,
@@ -75,7 +75,7 @@ import {
75
75
  saveGateAuditResult,
76
76
  savePromotionDecision,
77
77
  saveTaskSetSnapshot
78
- } from "./index-z1tm47nj.js";
78
+ } from "./index-ne28wyyc.js";
79
79
  import {
80
80
  canonicalHash,
81
81
  canonicalJson,
@@ -113,15 +113,15 @@ import {
113
113
  retireSkill,
114
114
  selectCandidateEntries,
115
115
  syncBundledProjectSkillsIfMissingAsync
116
- } from "./index-ad6j0m7k.js";
116
+ } from "./index-gj5jerzz.js";
117
117
  import {
118
118
  readRecentEscalations
119
- } from "./index-21115szq.js";
119
+ } from "./index-kp5h245k.js";
120
120
  import {
121
121
  alreadyCuratedThisGeneration,
122
122
  claimNextScanBatch,
123
123
  resolveCohortId
124
- } from "./index-1kn24ja0.js";
124
+ } from "./index-zcrvn579.js";
125
125
  import {
126
126
  CURATOR_INIT_PROMPT,
127
127
  CURATOR_PHASE_PROMPT,
@@ -174,11 +174,11 @@ import {
174
174
  validateActionableFields,
175
175
  validateLesson,
176
176
  validateSkillPath
177
- } from "./index-s0rbdp61.js";
177
+ } from "./index-79pgzj9a.js";
178
178
  import {
179
179
  authorizeCuration,
180
180
  buildConfigFingerprintInput
181
- } from "./index-rw3f73aq.js";
181
+ } from "./index-176zwqcq.js";
182
182
  import {
183
183
  cohortConfigFingerprint
184
184
  } from "./index-rtry5xyf.js";
@@ -211,7 +211,7 @@ import {
211
211
  transactFile,
212
212
  transactKnowledge,
213
213
  wordBigrams
214
- } from "./index-0755132s.js";
214
+ } from "./index-wbdxmf1a.js";
215
215
  import {
216
216
  MAX_EVENT_LOG_ENTRIES,
217
217
  _internals,
@@ -221,7 +221,7 @@ import {
221
221
  recordHiveKnowledgeEvent,
222
222
  recordKnowledgeEvent,
223
223
  resolveKnowledgeEventsPath
224
- } from "./index-84nz7bhe.js";
224
+ } from "./index-mgbpbs1f.js";
225
225
  import {
226
226
  resolveHiveDataDir,
227
227
  resolveHiveEventsPath,
@@ -237,16 +237,16 @@ import {
237
237
  resolveLinkDir,
238
238
  sanitizeLinkId,
239
239
  writeLinkPointer
240
- } from "./index-dzyjb33e.js";
240
+ } from "./index-zzhyws9g.js";
241
241
  import {
242
242
  atomicWriteFile
243
- } from "./index-ey29aap6.js";
243
+ } from "./index-b3jfcptk.js";
244
244
  import {
245
245
  exports_loader,
246
246
  init_loader,
247
247
  loadPluginConfig,
248
248
  loadPluginConfigWithMeta
249
- } from "./index-s0vahtdm.js";
249
+ } from "./index-zwh5dewz.js";
250
250
  import {
251
251
  RetrospectiveEvidenceSchema
252
252
  } from "./index-k5jrywpr.js";
@@ -262,7 +262,7 @@ import {
262
262
  package_default,
263
263
  resolveAutoReviewConfig,
264
264
  stripKnownSwarmPrefix
265
- } from "./index-y0xaq4f3.js";
265
+ } from "./index-0vq9gnqd.js";
266
266
  import {
267
267
  KNOWLEDGE_SCHEMA_VERSION,
268
268
  OUTCOME_BLOCK_THRESHOLD,
@@ -278,13 +278,13 @@ import {
278
278
  listActive,
279
279
  subscribe,
280
280
  unsubscribe
281
- } from "./index-tcn457d5.js";
281
+ } from "./index-kym0cctr.js";
282
282
  import {
283
283
  MAX_PENDING_SCOPE_BINDINGS,
284
284
  clearAllScopes,
285
285
  clearScopeBindingFromDisk,
286
286
  clearScopeBindings
287
- } from "./index-vg3yx648.js";
287
+ } from "./index-w6j1n5az.js";
288
288
  import {
289
289
  appendLedgerEvent,
290
290
  computePlanHash,
@@ -292,7 +292,7 @@ import {
292
292
  derivePlanId,
293
293
  initLedger,
294
294
  takeSnapshotEvent
295
- } from "./index-wxyxf0bd.js";
295
+ } from "./index-d61h3f3h.js";
296
296
  import {
297
297
  PlanSchema
298
298
  } from "./index-1kz6da87.js";
@@ -319,7 +319,7 @@ import {
319
319
  import {
320
320
  findByBatchId,
321
321
  readDelegations
322
- } from "./index-45t7w06b.js";
322
+ } from "./index-7t3vjw5e.js";
323
323
  import {
324
324
  readSwarmFileAsync,
325
325
  safeHook,
@@ -328,7 +328,7 @@ import {
328
328
  import {
329
329
  tryAcquireLock,
330
330
  withEvidenceLock
331
- } from "./index-09b9zncg.js";
331
+ } from "./index-tncy55bp.js";
332
332
  import {
333
333
  require_proper_lockfile
334
334
  } from "./index-7g4c7s5r.js";
@@ -340,7 +340,7 @@ import {
340
340
  emit,
341
341
  getLastHeartbeat,
342
342
  telemetry
343
- } from "./index-7a2hm51h.js";
343
+ } from "./index-cze4bq1x.js";
344
344
  import {
345
345
  bunSpawn,
346
346
  bunWrite,
@@ -5452,7 +5452,9 @@ function startAgentSession(sessionId, agentName, staleDurationMs = STALE_SESSION
5452
5452
  prmLastPatternDetected: null,
5453
5453
  prmTrajectoryStep: 0,
5454
5454
  prmHardStopPending: false,
5455
+ prmHardStopInjectPending: false,
5455
5456
  prmInjectedAdvisoryKeys: new Set,
5457
+ executionEpisodeArmed: false,
5456
5458
  prSubscriptions: new Map
5457
5459
  };
5458
5460
  swarmState.agentSessions.set(sessionId, sessionState);
@@ -5684,9 +5686,15 @@ function ensureAgentSession(sessionId, agentName, directory) {
5684
5686
  if (session.prmHardStopPending === undefined) {
5685
5687
  session.prmHardStopPending = false;
5686
5688
  }
5689
+ if (session.prmHardStopInjectPending === undefined) {
5690
+ session.prmHardStopInjectPending = false;
5691
+ }
5687
5692
  if (!session.prmInjectedAdvisoryKeys) {
5688
5693
  session.prmInjectedAdvisoryKeys = new Set;
5689
5694
  }
5695
+ if (session.executionEpisodeArmed === undefined) {
5696
+ session.executionEpisodeArmed = false;
5697
+ }
5690
5698
  if (!session.prSubscriptions) {
5691
5699
  session.prSubscriptions = new Map;
5692
5700
  }
@@ -6098,7 +6106,7 @@ function hasActiveEpicMode(sessionID) {
6098
6106
  async function rehydratePrSubscriptions(sessionID, directory) {
6099
6107
  const map = new Map;
6100
6108
  try {
6101
- const { listActive: listActive2 } = await import("./pr-subscriptions-qhr41epq.js");
6109
+ const { listActive: listActive2 } = await import("./pr-subscriptions-jn0h047q.js");
6102
6110
  const records = await listActive2(directory);
6103
6111
  for (const record of records) {
6104
6112
  if (record.sessionID !== sessionID)
@@ -11356,6 +11364,25 @@ function dcExtractPowerShellTargets(segment) {
11356
11364
  return targets;
11357
11365
  }
11358
11366
 
11367
+ // src/hooks/guardrails/execution-stall.ts
11368
+ init_constants();
11369
+ init_schema();
11370
+ var MUTATING_DELEGATION_ROLES = new Set([
11371
+ "coder",
11372
+ "reviewer",
11373
+ "test_engineer",
11374
+ "security_reviewer"
11375
+ ]);
11376
+ var EXECUTION_STALL_DENIED_TOOLS = new Set([
11377
+ "read",
11378
+ "glob",
11379
+ "grep",
11380
+ "bash",
11381
+ "shell"
11382
+ ]);
11383
+ var stallStates = new Map;
11384
+ var pendingDispatchRoles = new Map;
11385
+
11359
11386
  // src/hooks/guardrails/messages-transform.ts
11360
11387
  init_constants();
11361
11388
  init_schema();
@@ -14064,6 +14091,16 @@ function containsControlChars(str) {
14064
14091
 
14065
14092
  // src/tools/file-extractor-planner.ts
14066
14093
  var cachedPlans = new WeakMap;
14094
+
14095
+ // src/hooks/guardrails/internals-guard.ts
14096
+ var GUARDED_TOOLS = new Set([
14097
+ "read",
14098
+ "glob",
14099
+ "grep",
14100
+ "bash",
14101
+ "shell"
14102
+ ]);
14103
+ var selfDevelopmentWorkspaces = new Map;
14067
14104
  // src/hooks/guardrails/index.ts
14068
14105
  var SPEC_DRIFT_BLOCKED_TOOLS = new Set([
14069
14106
  "save_plan",
@@ -14074,6 +14111,7 @@ var SPEC_DRIFT_BLOCKED_TOOLS = new Set([
14074
14111
  ]);
14075
14112
  var toolCallsSinceLastWrite = new Map;
14076
14113
  var noOpWarningIssued = new Set;
14114
+ var noOpStrongWarningIssued = new Set;
14077
14115
  // src/hooks/delegation-gate.ts
14078
14116
  var EvidenceTaskIdPlanSchema = exports_external.object({
14079
14117
  phases: exports_external.array(exports_external.object({
@@ -18075,7 +18113,7 @@ function planMerges(active, threshold, maxComparisons, maxMerges) {
18075
18113
  };
18076
18114
  }
18077
18115
  async function sweepActiveNearDuplicates(directory, options = {}) {
18078
- const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-wnz282j3.js");
18116
+ const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-rtgqy0yg.js");
18079
18117
  const { config } = loadPluginConfigWithMeta2(directory);
18080
18118
  const sweepConfig = config.learning?.dedup_sweep;
18081
18119
  if (sweepConfig?.enabled === false)
@@ -19668,7 +19706,7 @@ async function runCuratorPhase(directory, phase, agentsDispatched, config, knowl
19668
19706
  }
19669
19707
  if (config.skill_generation_enabled === true && skillCandidates.length > 0) {
19670
19708
  try {
19671
- const skillModule = await import("./skill-generator-4p10ktw1.js");
19709
+ const skillModule = await import("./skill-generator-8gtq1ajr.js");
19672
19710
  for (const cand of skillCandidates) {
19673
19711
  if (cand.confidence < (config.min_skill_confidence ?? DEFAULT_SKILL_MIN_CONFIDENCE)) {
19674
19712
  continue;
@@ -20128,7 +20166,7 @@ async function applyCuratorKnowledgeUpdates(directory, recommendations, knowledg
20128
20166
  } catch {}
20129
20167
  }
20130
20168
  if (contradictedEntries.length > 0 && knowledgeConfig.contradiction_threshold_action === "quarantine") {
20131
- const { maybeQuarantineOnContradiction } = await import("./knowledge-escalator-ta3xjrdj.js");
20169
+ const { maybeQuarantineOnContradiction } = await import("./knowledge-escalator-h7fspgph.js");
20132
20170
  for (const { id } of contradictedEntries) {
20133
20171
  try {
20134
20172
  await maybeQuarantineOnContradiction(directory, id, knowledgeConfig.contradiction_quarantine_threshold, knowledgeConfig.contradiction_quarantine_window_days);
@@ -20947,7 +20985,7 @@ async function runCuratorPostMortem(directory, options = {}) {
20947
20985
  warnings.push("Failed to collect knowledge summary.");
20948
20986
  }
20949
20987
  try {
20950
- const { getScanStatus } = await import("./scan-cursor-48gwzh9c.js");
20988
+ const { getScanStatus } = await import("./scan-cursor-xbkae12h.js");
20951
20989
  const scanStatus = await getScanStatus(directory);
20952
20990
  if (scanStatus.remaining_estimate > 0) {
20953
20991
  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.`);
@@ -21119,9 +21157,9 @@ var _internals23 = {
21119
21157
  verifyPostMortemKnowledgeActions,
21120
21158
  repairPostMortemActions,
21121
21159
  loadDefaultKnowledgeConfig: async (directory) => {
21122
- const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-f937b9cs.js");
21160
+ const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-7jm70cab.js");
21123
21161
  try {
21124
- const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-wnz282j3.js");
21162
+ const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-rtgqy0yg.js");
21125
21163
  const loaded = loadPluginConfigWithMeta2(directory);
21126
21164
  return KnowledgeConfigSchema2.parse(loaded.config.knowledge ?? {});
21127
21165
  } catch {
@@ -21129,11 +21167,11 @@ var _internals23 = {
21129
21167
  }
21130
21168
  },
21131
21169
  applyCuratorKnowledgeUpdates: async (directory, recommendations, knowledgeConfig, generation) => {
21132
- const { applyCuratorKnowledgeUpdates: applyCuratorKnowledgeUpdates2 } = await import("./curator-nrmj8bds.js");
21170
+ const { applyCuratorKnowledgeUpdates: applyCuratorKnowledgeUpdates2 } = await import("./curator-36dxw38r.js");
21133
21171
  return applyCuratorKnowledgeUpdates2(directory, recommendations, knowledgeConfig, generation);
21134
21172
  },
21135
21173
  checkHivePromotions: async (entries, knowledgeConfig, directory) => {
21136
- const { checkHivePromotions } = await import("./hive-promoter-cy21rhnd.js");
21174
+ const { checkHivePromotions } = await import("./hive-promoter-daxrn62p.js");
21137
21175
  return checkHivePromotions(entries, knowledgeConfig, directory);
21138
21176
  },
21139
21177
  applyProposalTriage: async (directory, triage) => {
@@ -21142,7 +21180,7 @@ var _internals23 = {
21142
21180
  activateProposal,
21143
21181
  listSkills: listSkills2,
21144
21182
  sanitizeSlug
21145
- } = await import("./skill-generator-4p10ktw1.js");
21183
+ } = await import("./skill-generator-8gtq1ajr.js");
21146
21184
  const result = {
21147
21185
  approved: [],
21148
21186
  rejected: [],
@@ -23769,9 +23807,9 @@ function hashContent(content) {
23769
23807
  return createHash9("sha1").update(content).digest("hex");
23770
23808
  }
23771
23809
  async function loadConfigForPolicyCurator(directory) {
23772
- const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-f937b9cs.js");
23810
+ const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-7jm70cab.js");
23773
23811
  try {
23774
- const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-wnz282j3.js");
23812
+ const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-rtgqy0yg.js");
23775
23813
  const { config: loadedConfig } = loadPluginConfigWithMeta2(directory);
23776
23814
  return KnowledgeConfigSchema2.parse(loadedConfig.knowledge ?? {});
23777
23815
  } catch {
@@ -27116,7 +27154,7 @@ async function runFinalizeStage(ctx) {
27116
27154
  }
27117
27155
  }
27118
27156
  try {
27119
- const { CuratorConfigSchema: CCS } = await import("./schema-f937b9cs.js");
27157
+ const { CuratorConfigSchema: CCS } = await import("./schema-7jm70cab.js");
27120
27158
  const { config: pmLoadedConfig } = _internals33.loadPluginConfigWithMeta(ctx.directory);
27121
27159
  const curatorCfg = CCS.parse(pmLoadedConfig.curator ?? {});
27122
27160
  if (curatorCfg.enabled && curatorCfg.postmortem_enabled) {
@@ -29346,9 +29384,9 @@ var _internals38 = {
29346
29384
  loadPluginConfigWithMeta,
29347
29385
  loadCuratorDeps: async () => {
29348
29386
  const [{ CuratorConfigSchema }, curator, { createCuratorLLMDelegate: createCuratorLLMDelegate2 }] = await Promise.all([
29349
- import("./schema-f937b9cs.js"),
29350
- import("./curator-nrmj8bds.js"),
29351
- import("./curator-llm-factory-x7kvry9x.js")
29387
+ import("./schema-7jm70cab.js"),
29388
+ import("./curator-36dxw38r.js"),
29389
+ import("./curator-llm-factory-k2a7cv41.js")
29352
29390
  ]);
29353
29391
  return { CuratorConfigSchema, curator, createCuratorLLMDelegate: createCuratorLLMDelegate2 };
29354
29392
  }
@@ -30250,7 +30288,7 @@ async function computeCurationDiagnostics(directory, entries) {
30250
30288
  let scanCompleted = false;
30251
30289
  let scanRemaining = 0;
30252
30290
  try {
30253
- const { getScanStatus } = await import("./scan-cursor-48gwzh9c.js");
30291
+ const { getScanStatus } = await import("./scan-cursor-xbkae12h.js");
30254
30292
  const status = await getScanStatus(directory);
30255
30293
  scanGeneration = status.generation;
30256
30294
  scanCompleted = status.completed;
@@ -30258,19 +30296,19 @@ async function computeCurationDiagnostics(directory, entries) {
30258
30296
  } catch {}
30259
30297
  let configMatch = null;
30260
30298
  try {
30261
- const { isLinked: isLinked2 } = await import("./knowledge-link-mm1w967j.js");
30299
+ const { isLinked: isLinked2 } = await import("./knowledge-link-zr40rnwr.js");
30262
30300
  if (isLinked2(directory)) {
30263
- const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-f937b9cs.js");
30301
+ const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-7jm70cab.js");
30264
30302
  let config;
30265
30303
  try {
30266
- const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-wnz282j3.js");
30304
+ const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-rtgqy0yg.js");
30267
30305
  const loaded = loadPluginConfigWithMeta2(directory);
30268
30306
  config = KnowledgeConfigSchema2.parse(loaded.config.knowledge ?? {});
30269
30307
  } catch {
30270
30308
  config = KnowledgeConfigSchema2.parse({});
30271
30309
  }
30272
30310
  const { cohortConfigFingerprint: cohortConfigFingerprint2 } = await import("./config-fingerprint-v22xh5a2.js");
30273
- const { buildConfigFingerprintInput: buildConfigFingerprintInput2, readCohortConfigFingerprint } = await import("./curation-policy-kvzhfaj1.js");
30311
+ const { buildConfigFingerprintInput: buildConfigFingerprintInput2, readCohortConfigFingerprint } = await import("./curation-policy-zhyttjpa.js");
30274
30312
  const currentFp = cohortConfigFingerprint2(buildConfigFingerprintInput2(config));
30275
30313
  const cohortFp = await readCohortConfigFingerprint(directory);
30276
30314
  configMatch = cohortFp === null ? null : currentFp === cohortFp;
@@ -31481,7 +31519,7 @@ async function handleDoctorCommand(directory, args) {
31481
31519
  const result = runConfigDoctor(config, directory);
31482
31520
  let output;
31483
31521
  if (enableAutoFix && result.hasAutoFixableIssues) {
31484
- const { runConfigDoctorWithFixes } = await import("./config-doctor-b67nb84b.js");
31522
+ const { runConfigDoctorWithFixes } = await import("./config-doctor-g71mz50j.js");
31485
31523
  const fixResult = await runConfigDoctorWithFixes(directory, config, true, {
31486
31524
  applyLossy: true
31487
31525
  });
@@ -32318,7 +32356,7 @@ async function handleEvidenceCommand(directory, args) {
32318
32356
  return formatTaskEvidenceMarkdown(evidenceData);
32319
32357
  }
32320
32358
  async function handleEvidenceSummaryCommand(directory) {
32321
- const { buildEvidenceSummary } = await import("./evidence-summary-service-cf8sz2bq.js");
32359
+ const { buildEvidenceSummary } = await import("./evidence-summary-service-nse06dqr.js");
32322
32360
  const artifact = await buildEvidenceSummary(directory);
32323
32361
  if (!artifact) {
32324
32362
  return "No plan found. Run `/swarm plan` to check plan status.";
@@ -47423,6 +47461,19 @@ init_constants();
47423
47461
  import * as fs40 from "fs";
47424
47462
  import * as path85 from "path";
47425
47463
 
47464
+ // src/hooks/gate-denial-tracker.ts
47465
+ init_schema();
47466
+ var GATE_DENIAL_TTL_MS = 30 * 60000;
47467
+ var UNCLASSIFIED_GATE_DENIAL_CODE = "UNCLASSIFIED";
47468
+ var denialStreaks = new Map;
47469
+ var NOT_COUNTED = Object.freeze({
47470
+ code: UNCLASSIFIED_GATE_DENIAL_CODE,
47471
+ count: 0,
47472
+ warned: false,
47473
+ stopped: false,
47474
+ decorated: false
47475
+ });
47476
+
47426
47477
  // src/hooks/trajectory-logger.ts
47427
47478
  var callStartTimes = new Map;
47428
47479
  var SENSITIVE_FIELDS = new Set([
@@ -47443,6 +47494,8 @@ var SENSITIVE_FIELDS = new Set([
47443
47494
  "session_id",
47444
47495
  "cookie"
47445
47496
  ]);
47497
+ var DENIED_CALL_TTL_MS = 5 * 60000;
47498
+ var deniedCallMarkers = new Map;
47446
47499
  function clearTrajectoryStep(sessionId) {
47447
47500
  clearTrajectoryStepCounters(sessionId);
47448
47501
  }
@@ -47913,6 +47966,7 @@ function resetPrmSessionState(session, sessionId) {
47913
47966
  session.prmEscalationLevel = 0;
47914
47967
  session.prmLastPatternDetected = null;
47915
47968
  session.prmHardStopPending = false;
47969
+ session.prmHardStopInjectPending = false;
47916
47970
  session.prmTrajectoryStep = 0;
47917
47971
  session.prmInjectedAdvisoryKeys = new Set;
47918
47972
  session.replayArtifactPath = null;
@@ -52575,7 +52629,7 @@ async function runValidationWithTransientRetry(input, candidateContent, baseline
52575
52629
  if (!input.dispatcher) {
52576
52630
  throw new Error("no evaluation dispatcher available (cannot run validation)");
52577
52631
  }
52578
- const { createModelEvaluationExecutor } = await import("./runner-2v413r74.js");
52632
+ const { createModelEvaluationExecutor } = await import("./runner-deeswadt.js");
52579
52633
  const executor = createModelEvaluationExecutor(input.dispatcher, input.sessionId);
52580
52634
  const result = await _internals80.evaluateCandidateV1({
52581
52635
  projectRoot: input.directory,
@@ -54400,7 +54454,7 @@ function buildDetailedHelp(commandName, entry) {
54400
54454
  async function handleHelpCommand(ctx) {
54401
54455
  const targetCommand = ctx.args.join(" ");
54402
54456
  if (!targetCommand) {
54403
- const { buildHelpText } = await import("./index-ckybsn6p.js");
54457
+ const { buildHelpText } = await import("./index-g2kpqpvh.js");
54404
54458
  return buildHelpText();
54405
54459
  }
54406
54460
  const tokens = targetCommand.split(/\s+/);
@@ -54409,7 +54463,7 @@ async function handleHelpCommand(ctx) {
54409
54463
  return _internals13.buildDetailedHelp(resolved.key, resolved.entry);
54410
54464
  }
54411
54465
  const similar = _internals13.findSimilarCommands(targetCommand);
54412
- const { buildHelpText: fullHelp } = await import("./index-ckybsn6p.js");
54466
+ const { buildHelpText: fullHelp } = await import("./index-g2kpqpvh.js");
54413
54467
  if (similar.length > 0) {
54414
54468
  return `Command '/swarm ${targetCommand}' not found.
54415
54469
 
@@ -54586,7 +54640,7 @@ var COMMAND_REGISTRY = {
54586
54640
  },
54587
54641
  "guardrail explain": {
54588
54642
  handler: async (ctx) => {
54589
- const { handleGuardrailExplain } = await import("./guardrail-explain-5kd44rcj.js");
54643
+ const { handleGuardrailExplain } = await import("./guardrail-explain-1k337z5d.js");
54590
54644
  return handleGuardrailExplain(ctx.directory, ctx.args);
54591
54645
  },
54592
54646
  description: "Dry-run: show what the guardrails would do to a command or write target (executes nothing)",
@@ -54596,7 +54650,7 @@ var COMMAND_REGISTRY = {
54596
54650
  },
54597
54651
  "guardrail-explain": {
54598
54652
  handler: async (ctx) => {
54599
- const { handleGuardrailExplain } = await import("./guardrail-explain-5kd44rcj.js");
54653
+ const { handleGuardrailExplain } = await import("./guardrail-explain-1k337z5d.js");
54600
54654
  return handleGuardrailExplain(ctx.directory, ctx.args);
54601
54655
  },
54602
54656
  description: "Dry-run: show what the guardrails would do to a command or write target (executes nothing)",
@@ -54606,7 +54660,7 @@ var COMMAND_REGISTRY = {
54606
54660
  },
54607
54661
  "guardrail-log": {
54608
54662
  handler: async (ctx) => {
54609
- const { handleGuardrailLog } = await import("./guardrail-log-aksrzqdx.js");
54663
+ const { handleGuardrailLog } = await import("./guardrail-log-xbc9bvdt.js");
54610
54664
  return handleGuardrailLog(ctx.directory, ctx.args);
54611
54665
  },
54612
54666
  description: "Read the guardrail decision log (use --blocks-only for blocks)",
@@ -56115,6 +56169,8 @@ Continue handling small touch-ups (typos, cross-references) via the spec_writer
56115
56169
  Commands above are documented with args and behavioral details. Run commands via /swarm <command> [args].
56116
56170
  Outside OpenCode, invoke any plugin command via: \`bunx opencode-swarm run <command> [args]\` (e.g. \`bunx opencode-swarm run knowledge migrate\`). Do not use \`bun -e\` or look for \`src/commands/\` \u2014 those paths are internal to the plugin source and do not exist in user project directories. EXCEPTION \u2014 human-only commands (including but not limited to \`acknowledge-spec-drift\`, \`reset\`, \`reset-session\`, \`rollback\`, \`checkpoint\`, and any command that releases a runtime safety gate or destroys plan state): you MUST present these to the user and ask them to run the command themselves. Never invoke a human-only command via Bash, swarm_command, or chat fallback. The runtime guardrail will block such attempts; if a Bash call returns \`BLOCKED\` with a "human-only" message, do not retry under a different shell form \u2014 present the situation to the user instead.
56117
56171
 
56172
+ GATE/GUARDRAIL ERRORS ARE NEVER A SPELUNKING INVITATION: when a tool call is denied with a gate or guardrail code \u2014 \`ACCEPTANCE_*\`, \`SCOPE_*\`, \`PLAN_CRITIC_*\`, \`BLOCKED\`, \`CIRCUIT BREAKER\`, \`PRM HARD STOP\`, \`FULL_AUTO_*\`, \`SWARM_INTERNALS_OFF_LIMITS\` \u2014 the fix is ALWAYS to correct the dispatch or state the error names (re-declare scope, rewrite ACCEPTANCE text, resolve the named conflict) or to surface the blocker to the user in plain language. It is NEVER to go read the installed plugin package (\`node_modules/opencode-swarm\`, \`~/.cache/opencode/\u2026\`, its \`dist/\`) or to hunt for plugin \`src/\` paths \u2014 those paths are internal to the plugin's own development repo and do not exist in installed deployments; reading them wastes turns and produces no remediation. If you retry the same dispatch against the same error code twice without success, STOP retrying \u2014 present the blocker to the user verbatim, including the exact error code and message, rather than attempting a third self-recovery.
56173
+
56118
56174
  SMEs advise only. Reviewer and critic review only. None of them write code.
56119
56175
 
56120
56176
  Available Tools: {{AVAILABLE_TOOLS}}
@@ -57848,6 +57904,7 @@ SKILL_COMPLIANCE: <verdict> \u2014 <details>
57848
57904
  - Only flag real issues, not theoretical
57849
57905
  - Don't reject for style if functionally correct
57850
57906
  - No code modifications
57907
+ - GATE/GUARDRAIL ERRORS: if any tool call you make is denied with a gate or guardrail code (\`ACCEPTANCE_*\`, \`SCOPE_*\`, \`PLAN_CRITIC_*\`, \`BLOCKED\`, \`CIRCUIT BREAKER\`, \`PRM HARD STOP\`, \`FULL_AUTO_*\`, \`SWARM_INTERNALS_OFF_LIMITS\`), the fix is to correct whatever the error names or to surface the blocker to the architect \u2014 never to go read the installed plugin package (\`node_modules/opencode-swarm\`, \`~/.cache/opencode/\u2026\`, its \`dist/\`) or hunt for plugin \`src/\` paths, which do not exist in installed deployments. After two failed retries against the same error code, stop retrying and report the blocker verbatim instead of attempting a third time.
57851
57908
 
57852
57909
  ## SEVERITY CALIBRATION
57853
57910
  Use these definitions precisely \u2014 do not inflate severity:
@@ -245,6 +245,39 @@ var telemetry = {
245
245
  loopDetected(sessionId, agentName, loopType) {
246
246
  _internals.emit("loop_detected", { sessionId, agentName, loopType });
247
247
  },
248
+ noOpStrongWarning(sessionId, agentName, count, threshold) {
249
+ _internals.emit("no_op_strong_warning", {
250
+ sessionId,
251
+ agentName,
252
+ count,
253
+ threshold
254
+ });
255
+ },
256
+ gateDenialLoop(sessionId, tool, code, count) {
257
+ _internals.emit("gate_denial_loop", { sessionId, tool, code, count });
258
+ },
259
+ executionStallWarning(sessionId, count, threshold) {
260
+ _internals.emit("execution_stall_warning", {
261
+ sessionId,
262
+ count,
263
+ threshold
264
+ });
265
+ },
266
+ executionStallDenied(sessionId, tool, count, threshold) {
267
+ _internals.emit("execution_stall_denied", {
268
+ sessionId,
269
+ tool,
270
+ count,
271
+ threshold
272
+ });
273
+ },
274
+ swarmInternalsReadDenied(sessionId, tool, target) {
275
+ _internals.emit("swarm_internals_read_denied", {
276
+ sessionId,
277
+ tool,
278
+ target
279
+ });
280
+ },
248
281
  scopeViolation(sessionId, agentName, file, reason) {
249
282
  _internals.emit("scope_violation", { sessionId, agentName, file, reason });
250
283
  },
@@ -305,6 +338,14 @@ var telemetry = {
305
338
  level,
306
339
  occurrenceCount
307
340
  });
341
+ },
342
+ prmHardStopDelivered(sessionId, pattern, level, occurrenceCount) {
343
+ _internals.emit("prm_hard_stop_delivered", {
344
+ sessionId,
345
+ pattern,
346
+ level,
347
+ occurrenceCount
348
+ });
308
349
  }
309
350
  };
310
351
  var _internals = {
@@ -3,14 +3,14 @@ import {
3
3
  atomicWriteFile,
4
4
  taskEvidencePath,
5
5
  withTaskEvidenceLock
6
- } from "./index-ey29aap6.js";
6
+ } from "./index-b3jfcptk.js";
7
7
  import {
8
8
  exports_external,
9
9
  init_zod
10
10
  } from "./index-bpmtbmy9.js";
11
11
  import {
12
12
  telemetry
13
- } from "./index-7a2hm51h.js";
13
+ } from "./index-cze4bq1x.js";
14
14
 
15
15
  // src/gate-evidence.ts
16
16
  init_zod();
@@ -6,10 +6,10 @@ import {
6
6
  } from "./index-1kz6da87.js";
7
7
  import {
8
8
  withEvidenceLock
9
- } from "./index-09b9zncg.js";
9
+ } from "./index-tncy55bp.js";
10
10
  import {
11
11
  emit
12
- } from "./index-7a2hm51h.js";
12
+ } from "./index-cze4bq1x.js";
13
13
  import {
14
14
  criticalWarn,
15
15
  init_logger,