opencode-swarm 7.125.0 → 7.125.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/.opencode/skills/swarm-pr-feedback/SKILL.md +11 -127
  2. package/.opencode/skills/swarm-pr-feedback/references/bot-claim-verification.md +71 -0
  3. package/.opencode/skills/swarm-pr-feedback/references/operational-gotchas.md +49 -0
  4. package/.opencode/skills/swarm-pr-review/SKILL.md +6 -346
  5. package/.opencode/skills/swarm-pr-review/references/parser-dry-run.md +235 -0
  6. package/.opencode/skills/swarm-pr-review/references/prompt-templates.md +103 -0
  7. package/.opencode/skills/writing-tests/SKILL.md +4 -123
  8. package/.opencode/skills/writing-tests/references/mock-and-seam-inventory.md +43 -0
  9. package/dist/cli/{config-doctor-be9sxqx8.js → config-doctor-8df6hk58.js} +2 -2
  10. package/dist/cli/{curation-policy-52kt6d7t.js → curation-policy-7pvghg6f.js} +2 -2
  11. package/dist/cli/{curator-hbst8nbc.js → curator-dw2zb74h.js} +13 -13
  12. package/dist/cli/{curator-llm-factory-frde1955.js → curator-llm-factory-bntt6v8j.js} +13 -13
  13. package/dist/cli/{evidence-summary-service-9hq7n9k9.js → evidence-summary-service-v4h2w487.js} +1 -1
  14. package/dist/cli/{guardrail-explain-112kqmbc.js → guardrail-explain-vmr4db9n.js} +14 -14
  15. package/dist/cli/{guardrail-log-c8zcab91.js → guardrail-log-8prd6cnc.js} +3 -3
  16. package/dist/cli/{hive-promoter-448xs2tp.js → hive-promoter-xymt9vf2.js} +13 -13
  17. package/dist/cli/{index-jh6s75f6.js → index-1s7jzcsy.js} +1 -1
  18. package/dist/cli/{index-09vd53pz.js → index-39p1yyag.js} +1 -1
  19. package/dist/cli/{index-dx2c2wjt.js → index-7mtvvt8p.js} +2 -2
  20. package/dist/cli/{index-67hqr2zv.js → index-7ne6q2a0.js} +1 -1
  21. package/dist/cli/{index-amspa811.js → index-8ed9rz7y.js} +122 -45
  22. package/dist/cli/{index-0y6tmm9v.js → index-92xyawa7.js} +1 -1
  23. package/dist/cli/{index-7j3sm7h8.js → index-em4h33my.js} +2 -2
  24. package/dist/cli/{index-4rzzzjtg.js → index-fs02c7tz.js} +277 -16
  25. package/dist/cli/{index-kt0awv1n.js → index-j8ptbcxz.js} +1 -1
  26. package/dist/cli/{index-yt1v62pv.js → index-pgya7cnn.js} +4 -4
  27. package/dist/cli/{index-vtwqjr4z.js → index-ptmhxsaf.js} +3 -3
  28. package/dist/cli/{index-xattnmyb.js → index-qcrah1jk.js} +6 -2
  29. package/dist/cli/{index-6vfvc36k.js → index-sxdh19nk.js} +1 -1
  30. package/dist/cli/{index-n6chz2g8.js → index-tdpct4cz.js} +1 -1
  31. package/dist/cli/{index-99ed0h32.js → index-v3f7jvm8.js} +5 -5
  32. package/dist/cli/{index-9hbwa5x1.js → index-yrk6hfp1.js} +15 -15
  33. package/dist/cli/{index-958hf0yr.js → index-zbsxek49.js} +2 -2
  34. package/dist/cli/index.js +13 -13
  35. package/dist/cli/{knowledge-escalator-htafbhxg.js → knowledge-escalator-47hfstmk.js} +3 -3
  36. package/dist/cli/{knowledge-events-havw8c4t.js → knowledge-events-j5dpp72w.js} +1 -1
  37. package/dist/cli/{knowledge-store-hqngpt2v.js → knowledge-store-58gt7m85.js} +1 -1
  38. package/dist/cli/{knowledge-validator-g7mpnazh.js → knowledge-validator-jjxw5mwc.js} +4 -4
  39. package/dist/cli/{scan-cursor-sx7cvh8v.js → scan-cursor-h8we8dfv.js} +2 -2
  40. package/dist/cli/{schema-2418eqy3.js → schema-xpqbhcyp.js} +1 -1
  41. package/dist/cli/{skill-generator-zggy797r.js → skill-generator-k8d0vff0.js} +5 -5
  42. package/dist/commands/close.d.ts +4 -2
  43. package/dist/config/schema.d.ts +8 -0
  44. package/dist/evidence/documents-retention.d.ts +116 -0
  45. package/dist/evidence/manager.d.ts +17 -0
  46. package/dist/hooks/knowledge-application-gate.d.ts +8 -2
  47. package/dist/hooks/knowledge-application.d.ts +2 -0
  48. package/dist/index.js +376 -368
  49. package/dist/state.d.ts +33 -2
  50. package/package.json +1 -1
@@ -4,7 +4,7 @@ import {
4
4
  readDoctorArtifact,
5
5
  removeStraySwarmDir,
6
6
  runConfigDoctor
7
- } from "./index-0y6tmm9v.js";
7
+ } from "./index-92xyawa7.js";
8
8
  import {
9
9
  EvaluationTaskV1Schema,
10
10
  GateAuditManifestV1Schema,
@@ -61,7 +61,7 @@ import {
61
61
  saveTaskSetSnapshot,
62
62
  transientBackoff,
63
63
  validateProjectRoot
64
- } from "./index-4rzzzjtg.js";
64
+ } from "./index-fs02c7tz.js";
65
65
  import {
66
66
  withTimeout
67
67
  } from "./index-4905hd2m.js";
@@ -94,15 +94,15 @@ import {
94
94
  retireSkill,
95
95
  selectCandidateEntries,
96
96
  syncBundledProjectSkillsIfMissingAsync
97
- } from "./index-vtwqjr4z.js";
97
+ } from "./index-ptmhxsaf.js";
98
98
  import {
99
99
  readRecentEscalations
100
- } from "./index-99ed0h32.js";
100
+ } from "./index-v3f7jvm8.js";
101
101
  import {
102
102
  alreadyCuratedThisGeneration,
103
103
  claimNextScanBatch,
104
104
  resolveCohortId
105
- } from "./index-09vd53pz.js";
105
+ } from "./index-39p1yyag.js";
106
106
  import {
107
107
  CURATOR_INIT_PROMPT,
108
108
  CURATOR_PHASE_PROMPT,
@@ -135,11 +135,11 @@ import {
135
135
  validateActionability,
136
136
  validateActionableFields,
137
137
  validateLesson
138
- } from "./index-dx2c2wjt.js";
138
+ } from "./index-7mtvvt8p.js";
139
139
  import {
140
140
  authorizeCuration,
141
141
  buildConfigFingerprintInput
142
- } from "./index-67hqr2zv.js";
142
+ } from "./index-7ne6q2a0.js";
143
143
  import {
144
144
  cohortConfigFingerprint
145
145
  } from "./index-rtry5xyf.js";
@@ -169,7 +169,7 @@ import {
169
169
  transactFile,
170
170
  transactKnowledge,
171
171
  wordBigrams
172
- } from "./index-yt1v62pv.js";
172
+ } from "./index-pgya7cnn.js";
173
173
  import {
174
174
  MAX_EVENT_LOG_ENTRIES,
175
175
  _internals,
@@ -179,7 +179,7 @@ import {
179
179
  recordHiveKnowledgeEvent,
180
180
  recordKnowledgeEvent,
181
181
  resolveKnowledgeEventsPath
182
- } from "./index-n6chz2g8.js";
182
+ } from "./index-tdpct4cz.js";
183
183
  import {
184
184
  resolveHiveDataDir,
185
185
  resolveHiveEventsPath,
@@ -201,7 +201,7 @@ import {
201
201
  init_loader,
202
202
  loadPluginConfig,
203
203
  loadPluginConfigWithMeta
204
- } from "./index-kt0awv1n.js";
204
+ } from "./index-j8ptbcxz.js";
205
205
  import {
206
206
  RetrospectiveEvidenceSchema
207
207
  } from "./index-k5jrywpr.js";
@@ -220,7 +220,7 @@ import {
220
220
  init_schema,
221
221
  init_tool_metadata,
222
222
  stripKnownSwarmPrefix
223
- } from "./index-xattnmyb.js";
223
+ } from "./index-qcrah1jk.js";
224
224
  import {
225
225
  KNOWLEDGE_SCHEMA_VERSION,
226
226
  OUTCOME_BLOCK_THRESHOLD,
@@ -6023,15 +6023,59 @@ var _internals8 = {
6023
6023
  function artifactLabel(artifact) {
6024
6024
  return `${artifact.namespace}/${artifact.id}`;
6025
6025
  }
6026
+ function formatBytes(bytes) {
6027
+ if (bytes < 1024)
6028
+ return `${bytes} B`;
6029
+ if (bytes < 1024 * 1024)
6030
+ return `${(bytes / 1024).toFixed(1)} KiB`;
6031
+ return `${(bytes / (1024 * 1024)).toFixed(2)} MiB`;
6032
+ }
6033
+ function formatDocumentsCacheSection(cache, maxBytes, maxRecords) {
6034
+ const capsConfigured = typeof maxBytes === "number" && maxBytes > 0 || typeof maxRecords === "number" && maxRecords > 0;
6035
+ if (!capsConfigured)
6036
+ return "";
6037
+ const lines = [
6038
+ "",
6039
+ "### Documents cache (`.swarm/evidence-cache/documents.jsonl`)"
6040
+ ];
6041
+ if (cache.aborted) {
6042
+ lines.push(`**Aborted**: file exceeds the 100 MiB read cap; left untouched. Set a tighter cap or prune manually.`);
6043
+ return lines.join(`
6044
+ `);
6045
+ }
6046
+ const capParts = [];
6047
+ if (typeof maxBytes === "number" && maxBytes > 0) {
6048
+ capParts.push(`max ${formatBytes(maxBytes)}`);
6049
+ }
6050
+ if (typeof maxRecords === "number" && maxRecords > 0) {
6051
+ capParts.push(`max ${maxRecords} records`);
6052
+ }
6053
+ lines.push(`**Retention caps**: ${capParts.join(", ")}`);
6054
+ lines.push(`**Inventory**: ${cache.inventory} record(s), ${formatBytes(cache.bytesBefore)}`);
6055
+ if (cache.dryRun) {
6056
+ lines.push(`**Would prune**: ${cache.selected} record(s) \u2192 ${formatBytes(cache.bytesAfter)}`);
6057
+ } else {
6058
+ lines.push(`**Pruned**: ${cache.archived} record(s) \u2192 ${formatBytes(cache.bytesAfter)}`);
6059
+ }
6060
+ if (cache.corrupt > 0) {
6061
+ lines.push(`**Corrupt rows dropped**: ${cache.corrupt} (unparseable lines removed from the cache; reported, not relocated)`);
6062
+ }
6063
+ return lines.join(`
6064
+ `);
6065
+ }
6026
6066
  async function handleArchiveCommand(directory, args) {
6027
6067
  const config = loadPluginConfig(directory);
6028
6068
  const maxAgeDays = config?.evidence?.max_age_days ?? 90;
6029
6069
  const maxBundles = config?.evidence?.max_bundles ?? 1000;
6070
+ const cacheMaxBytes = config?.evidence?.cache_max_bytes;
6071
+ const cacheMaxRecords = config?.evidence?.cache_max_records;
6030
6072
  const dryRun = args.includes("--dry-run");
6031
6073
  const report = await archiveEvidence(directory, maxAgeDays, maxBundles, {
6032
6074
  report: true,
6033
6075
  dryRun,
6034
- now: _internals8.now()
6076
+ now: _internals8.now(),
6077
+ cacheMaxBytes,
6078
+ cacheMaxRecords
6035
6079
  });
6036
6080
  const evaluationSelected = report.evaluation.selected.map(artifactLabel);
6037
6081
  const evaluationArchived = report.evaluation.archived.map(artifactLabel);
@@ -6040,13 +6084,16 @@ async function handleArchiveCommand(directory, args) {
6040
6084
  const corruptCount = report.evaluation.corrupt.length;
6041
6085
  const inventoryCount = report.inventoryEvidence.length + report.evaluation.inventory.length;
6042
6086
  if (dryRun) {
6087
+ const cacheSection2 = formatDocumentsCacheSection(report.documentsCache, cacheMaxBytes, cacheMaxRecords);
6043
6088
  if (selectedCount === 0) {
6044
- if (corruptCount > 0) {
6045
- return `No valid evidence bundles to archive. Preserved ${corruptCount} corrupt evaluation artifact(s) for data-quality review.`;
6089
+ const baseMsg = corruptCount > 0 ? `No valid evidence bundles to archive. Preserved ${corruptCount} corrupt evaluation artifact(s) for data-quality review.` : inventoryCount === 0 ? "No evidence bundles to archive." : `No evidence bundles older than ${maxAgeDays} days found, and bundle count (${inventoryCount}) is within max_bundles limit (${maxBundles}).`;
6090
+ if (cacheSection2) {
6091
+ return `${baseMsg}
6092
+
6093
+ ## Archive Preview (dry run)
6094
+ ${cacheSection2}`;
6046
6095
  }
6047
- if (inventoryCount === 0)
6048
- return "No evidence bundles to archive.";
6049
- return `No evidence bundles older than ${maxAgeDays} days found, and bundle count (${inventoryCount}) is within max_bundles limit (${maxBundles}).`;
6096
+ return baseMsg;
6050
6097
  }
6051
6098
  const lines2 = [
6052
6099
  "## Archive Preview (dry run)",
@@ -6072,11 +6119,24 @@ async function handleArchiveCommand(directory, args) {
6072
6119
  if (report.evaluation.protected.length > 0 || corruptCount > 0) {
6073
6120
  lines2.push("", `**Evaluation artifacts preserved**: ${report.evaluation.protected.length} lineage-protected, ${corruptCount} corrupt/data-quality`);
6074
6121
  }
6122
+ if (cacheSection2)
6123
+ lines2.push(cacheSection2);
6075
6124
  return lines2.join(`
6076
6125
  `);
6077
6126
  }
6078
6127
  if (archivedCount === 0) {
6079
6128
  const failedCount2 = report.failedEvidence.length + report.evaluation.failed.length;
6129
+ const cacheSection2 = formatDocumentsCacheSection(report.documentsCache, cacheMaxBytes, cacheMaxRecords);
6130
+ if (cacheSection2 && report.documentsCache.archived > 0) {
6131
+ const lines2 = [
6132
+ "## Documents Cache Pruned",
6133
+ "",
6134
+ "No evidence bundles were archived.",
6135
+ cacheSection2
6136
+ ];
6137
+ return lines2.join(`
6138
+ `);
6139
+ }
6080
6140
  if (failedCount2 > 0) {
6081
6141
  return `No evidence bundles were archived; ${failedCount2} selected deletion(s) failed and remain on disk.`;
6082
6142
  }
@@ -6100,6 +6160,9 @@ async function handleArchiveCommand(directory, args) {
6100
6160
  if (failedCount > 0) {
6101
6161
  lines.push("", `**Failed deletions preserved**: ${failedCount}`);
6102
6162
  }
6163
+ const cacheSection = formatDocumentsCacheSection(report.documentsCache, cacheMaxBytes, cacheMaxRecords);
6164
+ if (cacheSection)
6165
+ lines.push(cacheSection);
6103
6166
  return lines.join(`
6104
6167
  `);
6105
6168
  }
@@ -10752,7 +10815,7 @@ async function runCuratorPhase(directory, phase, agentsDispatched, config, knowl
10752
10815
  }
10753
10816
  if (config.skill_generation_enabled === true && skillCandidates.length > 0) {
10754
10817
  try {
10755
- const skillModule = await import("./skill-generator-zggy797r.js");
10818
+ const skillModule = await import("./skill-generator-k8d0vff0.js");
10756
10819
  for (const cand of skillCandidates) {
10757
10820
  if (cand.confidence < (config.min_skill_confidence ?? DEFAULT_SKILL_MIN_CONFIDENCE)) {
10758
10821
  continue;
@@ -11089,7 +11152,7 @@ async function applyCuratorKnowledgeUpdates(directory, recommendations, knowledg
11089
11152
  } catch {}
11090
11153
  }
11091
11154
  if (contradictedEntries.length > 0 && knowledgeConfig.contradiction_threshold_action === "quarantine") {
11092
- const { maybeQuarantineOnContradiction } = await import("./knowledge-escalator-htafbhxg.js");
11155
+ const { maybeQuarantineOnContradiction } = await import("./knowledge-escalator-47hfstmk.js");
11093
11156
  for (const { id } of contradictedEntries) {
11094
11157
  try {
11095
11158
  await maybeQuarantineOnContradiction(directory, id, knowledgeConfig.contradiction_quarantine_threshold, knowledgeConfig.contradiction_quarantine_window_days);
@@ -11888,7 +11951,7 @@ async function runCuratorPostMortem(directory, options = {}) {
11888
11951
  warnings.push("Failed to collect knowledge summary.");
11889
11952
  }
11890
11953
  try {
11891
- const { getScanStatus } = await import("./scan-cursor-sx7cvh8v.js");
11954
+ const { getScanStatus } = await import("./scan-cursor-h8we8dfv.js");
11892
11955
  const scanStatus = await getScanStatus(directory);
11893
11956
  if (scanStatus.remaining_estimate > 0) {
11894
11957
  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.`);
@@ -12060,9 +12123,9 @@ var _internals15 = {
12060
12123
  verifyPostMortemKnowledgeActions,
12061
12124
  repairPostMortemActions,
12062
12125
  loadDefaultKnowledgeConfig: async (directory) => {
12063
- const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-2418eqy3.js");
12126
+ const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-xpqbhcyp.js");
12064
12127
  try {
12065
- const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-958hf0yr.js");
12128
+ const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-zbsxek49.js");
12066
12129
  const loaded = loadPluginConfigWithMeta2(directory);
12067
12130
  return KnowledgeConfigSchema2.parse(loaded.config.knowledge ?? {});
12068
12131
  } catch {
@@ -12070,11 +12133,11 @@ var _internals15 = {
12070
12133
  }
12071
12134
  },
12072
12135
  applyCuratorKnowledgeUpdates: async (directory, recommendations, knowledgeConfig, generation) => {
12073
- const { applyCuratorKnowledgeUpdates: applyCuratorKnowledgeUpdates2 } = await import("./curator-hbst8nbc.js");
12136
+ const { applyCuratorKnowledgeUpdates: applyCuratorKnowledgeUpdates2 } = await import("./curator-dw2zb74h.js");
12074
12137
  return applyCuratorKnowledgeUpdates2(directory, recommendations, knowledgeConfig, generation);
12075
12138
  },
12076
12139
  checkHivePromotions: async (entries, knowledgeConfig, directory) => {
12077
- const { checkHivePromotions } = await import("./hive-promoter-448xs2tp.js");
12140
+ const { checkHivePromotions } = await import("./hive-promoter-xymt9vf2.js");
12078
12141
  return checkHivePromotions(entries, knowledgeConfig, directory);
12079
12142
  },
12080
12143
  applyProposalTriage: async (directory, triage) => {
@@ -12083,7 +12146,7 @@ var _internals15 = {
12083
12146
  activateProposal,
12084
12147
  listSkills: listSkills2,
12085
12148
  sanitizeSlug
12086
- } = await import("./skill-generator-zggy797r.js");
12149
+ } = await import("./skill-generator-k8d0vff0.js");
12087
12150
  const result = {
12088
12151
  approved: [],
12089
12152
  rejected: [],
@@ -14608,9 +14671,9 @@ function hashContent(content) {
14608
14671
  return createHash7("sha1").update(content).digest("hex");
14609
14672
  }
14610
14673
  async function loadConfigForPolicyCurator(directory) {
14611
- const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-2418eqy3.js");
14674
+ const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-xpqbhcyp.js");
14612
14675
  try {
14613
- const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-958hf0yr.js");
14676
+ const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-zbsxek49.js");
14614
14677
  const { config: loadedConfig } = loadPluginConfigWithMeta2(directory);
14615
14678
  return KnowledgeConfigSchema2.parse(loadedConfig.knowledge ?? {});
14616
14679
  } catch {
@@ -17771,7 +17834,7 @@ async function runFinalizeStage(ctx) {
17771
17834
  }
17772
17835
  }
17773
17836
  try {
17774
- const { CuratorConfigSchema: CCS } = await import("./schema-2418eqy3.js");
17837
+ const { CuratorConfigSchema: CCS } = await import("./schema-xpqbhcyp.js");
17775
17838
  const { config: pmLoadedConfig } = _internals24.loadPluginConfigWithMeta(ctx.directory);
17776
17839
  const curatorCfg = CCS.parse(pmLoadedConfig.curator ?? {});
17777
17840
  if (curatorCfg.enabled && curatorCfg.postmortem_enabled) {
@@ -17968,6 +18031,8 @@ async function runArchiveStage(ctx) {
17968
18031
  async function runArchiveEvidenceRetention(ctx) {
17969
18032
  let maxAgeDays = 30;
17970
18033
  let maxBundles = 10;
18034
+ let cacheMaxBytes;
18035
+ let cacheMaxRecords;
17971
18036
  try {
17972
18037
  const { config: evidenceLoadedConfig } = _internals24.loadPluginConfigWithMeta(ctx.directory);
17973
18038
  const evidenceCfg = evidenceLoadedConfig.evidence ?? {};
@@ -17977,9 +18042,19 @@ async function runArchiveEvidenceRetention(ctx) {
17977
18042
  if (typeof evidenceCfg.max_bundles === "number") {
17978
18043
  maxBundles = evidenceCfg.max_bundles;
17979
18044
  }
18045
+ if (typeof evidenceCfg.cache_max_bytes === "number") {
18046
+ cacheMaxBytes = evidenceCfg.cache_max_bytes;
18047
+ }
18048
+ if (typeof evidenceCfg.cache_max_records === "number") {
18049
+ cacheMaxRecords = evidenceCfg.cache_max_records;
18050
+ }
17980
18051
  } catch {}
17981
18052
  try {
17982
- await _internals24.archiveEvidence(ctx.directory, maxAgeDays, maxBundles);
18053
+ await _internals24.archiveEvidence(ctx.directory, maxAgeDays, maxBundles, {
18054
+ report: true,
18055
+ cacheMaxBytes,
18056
+ cacheMaxRecords
18057
+ });
17983
18058
  } catch (error2) {
17984
18059
  const msg = error2 instanceof Error ? error2.message : String(error2);
17985
18060
  ctx.warnings.push(`Evidence retention archive failed: ${msg}`);
@@ -19928,9 +20003,9 @@ var _internals28 = {
19928
20003
  readSwarmFileAsync,
19929
20004
  loadCuratorDeps: async () => {
19930
20005
  const [{ CuratorConfigSchema }, curator, { createCuratorLLMDelegate: createCuratorLLMDelegate2 }] = await Promise.all([
19931
- import("./schema-2418eqy3.js"),
19932
- import("./curator-hbst8nbc.js"),
19933
- import("./curator-llm-factory-frde1955.js")
20006
+ import("./schema-xpqbhcyp.js"),
20007
+ import("./curator-dw2zb74h.js"),
20008
+ import("./curator-llm-factory-bntt6v8j.js")
19934
20009
  ]);
19935
20010
  return { CuratorConfigSchema, curator, createCuratorLLMDelegate: createCuratorLLMDelegate2 };
19936
20011
  }
@@ -20429,7 +20504,7 @@ import { fileURLToPath } from "url";
20429
20504
  // package.json
20430
20505
  var package_default = {
20431
20506
  name: "opencode-swarm",
20432
- version: "7.125.0",
20507
+ version: "7.125.2",
20433
20508
  description: "Architect-centric agentic swarm plugin for OpenCode - hub-and-spoke orchestration with SME consultation, code generation, and QA review",
20434
20509
  main: "dist/index.js",
20435
20510
  types: "dist/index.d.ts",
@@ -20950,7 +21025,7 @@ async function computeCurationDiagnostics(directory, entries) {
20950
21025
  let scanCompleted = false;
20951
21026
  let scanRemaining = 0;
20952
21027
  try {
20953
- const { getScanStatus } = await import("./scan-cursor-sx7cvh8v.js");
21028
+ const { getScanStatus } = await import("./scan-cursor-h8we8dfv.js");
20954
21029
  const status = await getScanStatus(directory);
20955
21030
  scanGeneration = status.generation;
20956
21031
  scanCompleted = status.completed;
@@ -20960,17 +21035,17 @@ async function computeCurationDiagnostics(directory, entries) {
20960
21035
  try {
20961
21036
  const { isLinked: isLinked2 } = await import("./knowledge-link-4yd2z8ev.js");
20962
21037
  if (isLinked2(directory)) {
20963
- const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-2418eqy3.js");
21038
+ const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-xpqbhcyp.js");
20964
21039
  let config;
20965
21040
  try {
20966
- const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-958hf0yr.js");
21041
+ const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-zbsxek49.js");
20967
21042
  const loaded = loadPluginConfigWithMeta2(directory);
20968
21043
  config = KnowledgeConfigSchema2.parse(loaded.config.knowledge ?? {});
20969
21044
  } catch {
20970
21045
  config = KnowledgeConfigSchema2.parse({});
20971
21046
  }
20972
21047
  const { cohortConfigFingerprint: cohortConfigFingerprint2 } = await import("./config-fingerprint-v22xh5a2.js");
20973
- const { buildConfigFingerprintInput: buildConfigFingerprintInput2, readCohortConfigFingerprint } = await import("./curation-policy-52kt6d7t.js");
21048
+ const { buildConfigFingerprintInput: buildConfigFingerprintInput2, readCohortConfigFingerprint } = await import("./curation-policy-7pvghg6f.js");
20974
21049
  const currentFp = cohortConfigFingerprint2(buildConfigFingerprintInput2(config));
20975
21050
  const cohortFp = await readCohortConfigFingerprint(directory);
20976
21051
  configMatch = cohortFp === null ? null : currentFp === cohortFp;
@@ -22158,7 +22233,7 @@ async function handleDoctorCommand(directory, args) {
22158
22233
  const result = runConfigDoctor(config, directory);
22159
22234
  let output;
22160
22235
  if (enableAutoFix && result.hasAutoFixableIssues) {
22161
- const { runConfigDoctorWithFixes } = await import("./config-doctor-be9sxqx8.js");
22236
+ const { runConfigDoctorWithFixes } = await import("./config-doctor-8df6hk58.js");
22162
22237
  const fixResult = await runConfigDoctorWithFixes(directory, config, true);
22163
22238
  output = formatDoctorMarkdown(fixResult.result);
22164
22239
  } else {
@@ -22971,7 +23046,7 @@ async function handleEvidenceCommand(directory, args) {
22971
23046
  return formatTaskEvidenceMarkdown(evidenceData);
22972
23047
  }
22973
23048
  async function handleEvidenceSummaryCommand(directory) {
22974
- const { buildEvidenceSummary } = await import("./evidence-summary-service-9hq7n9k9.js");
23049
+ const { buildEvidenceSummary } = await import("./evidence-summary-service-v4h2w487.js");
22975
23050
  const artifact = await buildEvidenceSummary(directory);
22976
23051
  if (!artifact) {
22977
23052
  return "No plan found. Run `/swarm plan` to check plan status.";
@@ -40933,7 +41008,7 @@ function buildDetailedHelp(commandName, entry) {
40933
41008
  async function handleHelpCommand(ctx) {
40934
41009
  const targetCommand = ctx.args.join(" ");
40935
41010
  if (!targetCommand) {
40936
- const { buildHelpText } = await import("./index-9hbwa5x1.js");
41011
+ const { buildHelpText } = await import("./index-yrk6hfp1.js");
40937
41012
  return buildHelpText();
40938
41013
  }
40939
41014
  const tokens = targetCommand.split(/\s+/);
@@ -40942,7 +41017,7 @@ async function handleHelpCommand(ctx) {
40942
41017
  return _internals62.buildDetailedHelp(resolved.key, resolved.entry);
40943
41018
  }
40944
41019
  const similar = _internals62.findSimilarCommands(targetCommand);
40945
- const { buildHelpText: fullHelp } = await import("./index-9hbwa5x1.js");
41020
+ const { buildHelpText: fullHelp } = await import("./index-yrk6hfp1.js");
40946
41021
  if (similar.length > 0) {
40947
41022
  return `Command '/swarm ${targetCommand}' not found.
40948
41023
 
@@ -41081,7 +41156,7 @@ var COMMAND_REGISTRY = {
41081
41156
  },
41082
41157
  "guardrail explain": {
41083
41158
  handler: async (ctx) => {
41084
- const { handleGuardrailExplain } = await import("./guardrail-explain-112kqmbc.js");
41159
+ const { handleGuardrailExplain } = await import("./guardrail-explain-vmr4db9n.js");
41085
41160
  return handleGuardrailExplain(ctx.directory, ctx.args);
41086
41161
  },
41087
41162
  description: "Dry-run: show what the guardrails would do to a command or write target (executes nothing)",
@@ -41091,7 +41166,7 @@ var COMMAND_REGISTRY = {
41091
41166
  },
41092
41167
  "guardrail-explain": {
41093
41168
  handler: async (ctx) => {
41094
- const { handleGuardrailExplain } = await import("./guardrail-explain-112kqmbc.js");
41169
+ const { handleGuardrailExplain } = await import("./guardrail-explain-vmr4db9n.js");
41095
41170
  return handleGuardrailExplain(ctx.directory, ctx.args);
41096
41171
  },
41097
41172
  description: "Dry-run: show what the guardrails would do to a command or write target (executes nothing)",
@@ -41101,7 +41176,7 @@ var COMMAND_REGISTRY = {
41101
41176
  },
41102
41177
  "guardrail-log": {
41103
41178
  handler: async (ctx) => {
41104
- const { handleGuardrailLog } = await import("./guardrail-log-c8zcab91.js");
41179
+ const { handleGuardrailLog } = await import("./guardrail-log-8prd6cnc.js");
41105
41180
  return handleGuardrailLog(ctx.directory, ctx.args);
41106
41181
  },
41107
41182
  description: "Read the guardrail decision log (use --blocks-only for blocks)",
@@ -42458,7 +42533,7 @@ For every applicable directive in the block:
42458
42533
  - If a directive references a generated skill via \`skill: file:...\`, you MUST add that path to the SKILLS: field of any matching subagent delegation.
42459
42534
  - If a directive does NOT apply to the current action, record \`KNOWLEDGE_IGNORED: <id> reason=<short reason>\` once in your reply.
42460
42535
  - If runtime evidence shows a directive was violated (reviewer rejection, failing test, scope breach), record \`KNOWLEDGE_VIOLATED: <id> reason=<reason>\` and re-plan.
42461
- - NEVER silently ignore a \`priority: critical\` directive. The knowledge_application gate may run in 'enforce' mode; in that mode an omitted ack on a critical directive blocks the action.
42536
+ - NEVER silently ignore a \`priority: critical\` directive. The knowledge_application gate may run in 'enforce' mode; in that mode an omitted ack on a critical directive blocks the action for a bounded number of retries and time window (\`max_gate_denials\`, \`gate_staleness_ms\`), after which it auto-clears and logs the bypass \u2014 do not attempt out-of-band workarounds (editing .swarm/ state files, restarting sessions) to escape it; retry the ack with a correctly-terminated marker instead.
42462
42537
 
42463
42538
  Chat-text markers (KNOWLEDGE_APPLIED/IGNORED/VIOLATED) are the sole mechanism that satisfies the knowledge-application enforcement gate. The \`knowledge_receipt\` tool records knowledge-usage receipts for audit but does NOT satisfy the gate.
42464
42539
 
@@ -46611,6 +46686,7 @@ var swarmState = {
46611
46686
  specWriterAgentNames: [],
46612
46687
  currentCriticalShownIds: new Map,
46613
46688
  knowledgeAckDedup: new Set,
46689
+ gateDenialCounts: new Map,
46614
46690
  generatedAgentNames: [],
46615
46691
  lastBudgetPct: 0,
46616
46692
  agentSessions: defaultRunContext.agentSessions,
@@ -46639,6 +46715,7 @@ function resetSwarmState() {
46639
46715
  swarmState.specWriterAgentNames = [];
46640
46716
  swarmState.currentCriticalShownIds.clear();
46641
46717
  swarmState.knowledgeAckDedup.clear();
46718
+ swarmState.gateDenialCounts.clear();
46642
46719
  swarmState.generatedAgentNames = [];
46643
46720
  _rehydrationCache = null;
46644
46721
  swarmState.fullAutoEnabledInConfig = false;
@@ -7,7 +7,7 @@ import {
7
7
  init_constants,
8
8
  init_schema,
9
9
  stripKnownSwarmPrefix
10
- } from "./index-xattnmyb.js";
10
+ } from "./index-qcrah1jk.js";
11
11
  import {
12
12
  log
13
13
  } from "./index-zgwm4ryv.js";
@@ -12,14 +12,14 @@ import {
12
12
  detectPosixWrites,
13
13
  detectWindowsWrites,
14
14
  resolveWriteTargets
15
- } from "./index-amspa811.js";
15
+ } from "./index-8ed9rz7y.js";
16
16
  import {
17
17
  checkFileAuthority,
18
18
  classifyFile,
19
19
  isInDeclaredScope,
20
20
  redactPath,
21
21
  redactShellCommand
22
- } from "./index-6vfvc36k.js";
22
+ } from "./index-sxdh19nk.js";
23
23
 
24
24
  // src/services/guardrail-explain-service.ts
25
25
  import path from "path";