opencode-swarm 7.126.1 → 7.126.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 (50) hide show
  1. package/.opencode/skills/engineering-conventions/SKILL.md +1 -1
  2. package/.opencode/skills/swarm-pr-feedback/SKILL.md +19 -5
  3. package/.opencode/skills/swarm-pr-review/SKILL.md +28 -7
  4. package/dist/background/pr-event-delivery.d.ts +1 -1
  5. package/dist/cli/{config-doctor-23jxdqwv.js → config-doctor-mfx27331.js} +2 -2
  6. package/dist/cli/{curation-policy-0t6hny6g.js → curation-policy-n944aq62.js} +2 -2
  7. package/dist/cli/{curator-g8rggzbk.js → curator-jm9ehfkg.js} +12 -12
  8. package/dist/cli/{curator-llm-factory-36psae60.js → curator-llm-factory-3cy0h9yw.js} +12 -12
  9. package/dist/cli/{guardrail-explain-6ffgrjx9.js → guardrail-explain-va0kj05m.js} +13 -13
  10. package/dist/cli/{guardrail-log-57sczn5h.js → guardrail-log-61gya05m.js} +3 -3
  11. package/dist/cli/{hive-promoter-c458rgp5.js → hive-promoter-h9c4kyv0.js} +12 -12
  12. package/dist/cli/{index-w0yztxgq.js → index-3xd9a2g7.js} +1 -1
  13. package/dist/cli/{index-y9t766sw.js → index-5n868tw8.js} +62 -46
  14. package/dist/cli/{index-x1w4cx3n.js → index-6t5sa6v0.js} +2 -2
  15. package/dist/cli/{index-k5xh81c9.js → index-7bxw3v5w.js} +3 -3
  16. package/dist/cli/{index-6j9p0c40.js → index-88dt7c9z.js} +2 -2
  17. package/dist/cli/{index-yf4kvhrn.js → index-b16153py.js} +14 -14
  18. package/dist/cli/{index-1p9z8cc4.js → index-bf76q8q7.js} +1 -1
  19. package/dist/cli/{index-vvwf9ark.js → index-c48dvb6j.js} +2 -2
  20. package/dist/cli/{index-nkhp7j16.js → index-f97dm6tz.js} +5 -5
  21. package/dist/cli/{index-abw10n3f.js → index-gf9cxvp0.js} +1 -1
  22. package/dist/cli/{index-kx3533dm.js → index-gwss5btk.js} +1 -1
  23. package/dist/cli/{index-echdpdhy.js → index-gxw20m1d.js} +1 -1
  24. package/dist/cli/{index-cnhp6c0k.js → index-nqp13m5a.js} +1 -1
  25. package/dist/cli/{index-nmyg9b7v.js → index-pb8ag9vg.js} +4 -4
  26. package/dist/cli/{index-3hkbegq2.js → index-pf3xae4s.js} +1 -1
  27. package/dist/cli/{index-c8sqc3nh.js → index-vcqwhe9d.js} +4 -0
  28. package/dist/cli/index.js +12 -12
  29. package/dist/cli/{knowledge-escalator-kd80m9vp.js → knowledge-escalator-nna0zec3.js} +3 -3
  30. package/dist/cli/{knowledge-events-j7jfwm1d.js → knowledge-events-7k82xk36.js} +1 -1
  31. package/dist/cli/{knowledge-store-1d4byc7y.js → knowledge-store-efvtng9t.js} +1 -1
  32. package/dist/cli/{knowledge-validator-63mkgt9x.js → knowledge-validator-jh93eagj.js} +4 -4
  33. package/dist/cli/{scan-cursor-qzn5jmbe.js → scan-cursor-cydz8d9q.js} +2 -2
  34. package/dist/cli/{schema-2j92wnns.js → schema-fa033pqw.js} +1 -1
  35. package/dist/cli/{skill-generator-sv6zvdvz.js → skill-generator-8v463kj7.js} +5 -5
  36. package/dist/config/bundled-skills.d.ts +3 -2
  37. package/dist/hooks/delegation-gate.d.ts +14 -2
  38. package/dist/hooks/init-orphan-recovery.d.ts +1 -1
  39. package/dist/hooks/pr-workflow-auto-wake.d.ts +31 -0
  40. package/dist/hooks/pr-workflow-gate.d.ts +19 -1
  41. package/dist/hooks/pr-workflow-response-gate.d.ts +4 -0
  42. package/dist/index.d.ts +14 -0
  43. package/dist/index.js +149 -146
  44. package/dist/tools/index.d.ts +1 -0
  45. package/dist/tools/manifest.d.ts +1 -0
  46. package/dist/tools/prepare-pr-workflow-checkout.d.ts +25 -0
  47. package/dist/tools/repo-graph/builder.d.ts +5 -4
  48. package/dist/tools/tool-metadata.d.ts +4 -0
  49. package/dist/utils/timeout.d.ts +8 -4
  50. package/package.json +1 -1
@@ -4,7 +4,7 @@ import {
4
4
  readDoctorArtifact,
5
5
  removeStraySwarmDir,
6
6
  runConfigDoctor
7
- } from "./index-w0yztxgq.js";
7
+ } from "./index-3xd9a2g7.js";
8
8
  import {
9
9
  EvaluationTaskV1Schema,
10
10
  GateAuditManifestV1Schema,
@@ -94,15 +94,15 @@ import {
94
94
  retireSkill,
95
95
  selectCandidateEntries,
96
96
  syncBundledProjectSkillsIfMissingAsync
97
- } from "./index-k5xh81c9.js";
97
+ } from "./index-7bxw3v5w.js";
98
98
  import {
99
99
  readRecentEscalations
100
- } from "./index-nkhp7j16.js";
100
+ } from "./index-f97dm6tz.js";
101
101
  import {
102
102
  alreadyCuratedThisGeneration,
103
103
  claimNextScanBatch,
104
104
  resolveCohortId
105
- } from "./index-3hkbegq2.js";
105
+ } from "./index-pf3xae4s.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-6j9p0c40.js";
138
+ } from "./index-88dt7c9z.js";
139
139
  import {
140
140
  authorizeCuration,
141
141
  buildConfigFingerprintInput
142
- } from "./index-kx3533dm.js";
142
+ } from "./index-gwss5btk.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-nmyg9b7v.js";
172
+ } from "./index-pb8ag9vg.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-cnhp6c0k.js";
182
+ } from "./index-nqp13m5a.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-abw10n3f.js";
204
+ } from "./index-gf9cxvp0.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-c8sqc3nh.js";
223
+ } from "./index-vcqwhe9d.js";
224
224
  import {
225
225
  KNOWLEDGE_SCHEMA_VERSION,
226
226
  OUTCOME_BLOCK_THRESHOLD,
@@ -940,8 +940,11 @@ async function bindPrWorkflowHead(directory, sessionID, prHeadSha) {
940
940
  const state = await requireAnyActiveState(directory, sessionID);
941
941
  const normalizedHead = normalizePrHeadSha(prHeadSha);
942
942
  assertCurrentCheckoutHead(directory, normalizedHead);
943
- if (state.mode === "PR_REVIEW")
944
- assertPrReviewCleanCheckout(directory);
943
+ if (!state.prHeadSha)
944
+ assertPrReviewCleanCheckout(directory, state.mode);
945
+ if (!state.prHeadSha && state.mode === "PR_FEEDBACK") {
946
+ assertPrFeedbackTrackingCheckout(directory, normalizedHead);
947
+ }
945
948
  if (state.prHeadSha && state.prHeadSha !== normalizedHead) {
946
949
  throw new Error(`BLOCKED: active ${state.mode} workflow is bound to PR head "${state.prHeadSha}"; received "${normalizedHead}"`);
947
950
  }
@@ -966,9 +969,19 @@ function assertCurrentCheckoutHead(directory, expectedHead) {
966
969
  }
967
970
  return normalizedExpected;
968
971
  }
969
- function assertPrReviewCleanCheckout(directory) {
972
+ function assertPrReviewCleanCheckout(directory, mode = "PR_REVIEW") {
970
973
  if (_test_exports.resolveIsWorkingTreeClean(directory) !== true) {
971
- throw new Error("BLOCKED: PR_REVIEW requires a clean index and working tree at the exact PR head");
974
+ throw new Error(`BLOCKED: ${mode} requires a clean index and working tree at the exact PR head`);
975
+ }
976
+ }
977
+ function assertPrFeedbackTrackingCheckout(directory, prHeadSha) {
978
+ const upstream = _test_exports.resolveCurrentUpstreamPushTarget(directory);
979
+ if (!upstream) {
980
+ throw new Error("BLOCKED: PR_FEEDBACK requires a current local branch bound to an exact remote name, remote branch ref, and remote-tracking ref before the first head bind; detached or non-tracking checkouts are not allowed");
981
+ }
982
+ const matchingRemoteRefs = _test_exports.resolveRemoteRefsContainingHead(directory, prHeadSha);
983
+ if (!matchingRemoteRefs?.includes(upstream.remoteTrackingRef)) {
984
+ throw new Error(`BLOCKED: PR_FEEDBACK upstream "${upstream.remoteTrackingRef}" must point to the exact intake PR head "${prHeadSha}" before the first head bind`);
972
985
  }
973
986
  }
974
987
  var _test_exports = {
@@ -991,6 +1004,7 @@ var _test_exports = {
991
1004
  resolveRemoteRefsContainingHead,
992
1005
  parseCriticVerdict,
993
1006
  isProcessAlive,
1007
+ rename: fsp.rename,
994
1008
  nowMs: () => Date.now()
995
1009
  };
996
1010
  async function requireAnyActiveState(directory, sessionID) {
@@ -1009,7 +1023,8 @@ var PR_WORKFLOW_SHARED_CONTROLLER_TOOLS = new Set([
1009
1023
  "complete_pr_workflow",
1010
1024
  "dispatch_lanes_async",
1011
1025
  "get_async_result",
1012
- "get_async_status"
1026
+ "get_async_status",
1027
+ "prepare_pr_workflow_checkout"
1013
1028
  ]);
1014
1029
  var PR_REVIEW_CONTROLLER_TOOLS = new Set([
1015
1030
  "parse_lane_candidates",
@@ -1297,12 +1312,12 @@ function workflowGateStateLockPath(directory, sessionID) {
1297
1312
  return validateSwarmPath(directory, workflowGateStateLockRelativePath(sessionID));
1298
1313
  }
1299
1314
  function workflowGateStateLockRelativePath(sessionID) {
1300
- return path.join(WORKFLOW_GATE_DIR, `${safeSessionFileStem(sessionID)}.lock`);
1315
+ return path.join(WORKFLOW_GATE_DIR, `${prWorkflowSessionFileStem(sessionID)}.lock`);
1301
1316
  }
1302
1317
  function workflowGateStateRelativePath(sessionID) {
1303
- return path.join(WORKFLOW_GATE_DIR, `${safeSessionFileStem(sessionID)}.json`);
1318
+ return path.join(WORKFLOW_GATE_DIR, `${prWorkflowSessionFileStem(sessionID)}.json`);
1304
1319
  }
1305
- function safeSessionFileStem(sessionID) {
1320
+ function prWorkflowSessionFileStem(sessionID) {
1306
1321
  const normalized = normalizeSessionID(sessionID);
1307
1322
  const slug = normalized.replace(/[^A-Za-z0-9_.-]/g, "_").slice(0, 80) || "session";
1308
1323
  const digest = createHash2("sha256").update(normalized).digest("hex").slice(0, 12);
@@ -1322,7 +1337,7 @@ async function writeAtomicJson(filePath, value) {
1322
1337
  await fsp.writeFile(tempPath, JSON.stringify(value, null, 2), "utf-8");
1323
1338
  for (let attempt = 0;attempt < WINDOWS_RENAME_MAX_RETRIES; attempt++) {
1324
1339
  try {
1325
- await fsp.rename(tempPath, filePath);
1340
+ await _test_exports.rename(tempPath, filePath);
1326
1341
  lastError = undefined;
1327
1342
  break;
1328
1343
  } catch (error2) {
@@ -10947,7 +10962,7 @@ async function runCuratorPhase(directory, phase, agentsDispatched, config, knowl
10947
10962
  }
10948
10963
  if (config.skill_generation_enabled === true && skillCandidates.length > 0) {
10949
10964
  try {
10950
- const skillModule = await import("./skill-generator-sv6zvdvz.js");
10965
+ const skillModule = await import("./skill-generator-8v463kj7.js");
10951
10966
  for (const cand of skillCandidates) {
10952
10967
  if (cand.confidence < (config.min_skill_confidence ?? DEFAULT_SKILL_MIN_CONFIDENCE)) {
10953
10968
  continue;
@@ -11284,7 +11299,7 @@ async function applyCuratorKnowledgeUpdates(directory, recommendations, knowledg
11284
11299
  } catch {}
11285
11300
  }
11286
11301
  if (contradictedEntries.length > 0 && knowledgeConfig.contradiction_threshold_action === "quarantine") {
11287
- const { maybeQuarantineOnContradiction } = await import("./knowledge-escalator-kd80m9vp.js");
11302
+ const { maybeQuarantineOnContradiction } = await import("./knowledge-escalator-nna0zec3.js");
11288
11303
  for (const { id } of contradictedEntries) {
11289
11304
  try {
11290
11305
  await maybeQuarantineOnContradiction(directory, id, knowledgeConfig.contradiction_quarantine_threshold, knowledgeConfig.contradiction_quarantine_window_days);
@@ -12083,7 +12098,7 @@ async function runCuratorPostMortem(directory, options = {}) {
12083
12098
  warnings.push("Failed to collect knowledge summary.");
12084
12099
  }
12085
12100
  try {
12086
- const { getScanStatus } = await import("./scan-cursor-qzn5jmbe.js");
12101
+ const { getScanStatus } = await import("./scan-cursor-cydz8d9q.js");
12087
12102
  const scanStatus = await getScanStatus(directory);
12088
12103
  if (scanStatus.remaining_estimate > 0) {
12089
12104
  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.`);
@@ -12255,9 +12270,9 @@ var _internals15 = {
12255
12270
  verifyPostMortemKnowledgeActions,
12256
12271
  repairPostMortemActions,
12257
12272
  loadDefaultKnowledgeConfig: async (directory) => {
12258
- const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-2j92wnns.js");
12273
+ const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-fa033pqw.js");
12259
12274
  try {
12260
- const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-vvwf9ark.js");
12275
+ const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-c48dvb6j.js");
12261
12276
  const loaded = loadPluginConfigWithMeta2(directory);
12262
12277
  return KnowledgeConfigSchema2.parse(loaded.config.knowledge ?? {});
12263
12278
  } catch {
@@ -12265,11 +12280,11 @@ var _internals15 = {
12265
12280
  }
12266
12281
  },
12267
12282
  applyCuratorKnowledgeUpdates: async (directory, recommendations, knowledgeConfig, generation) => {
12268
- const { applyCuratorKnowledgeUpdates: applyCuratorKnowledgeUpdates2 } = await import("./curator-g8rggzbk.js");
12283
+ const { applyCuratorKnowledgeUpdates: applyCuratorKnowledgeUpdates2 } = await import("./curator-jm9ehfkg.js");
12269
12284
  return applyCuratorKnowledgeUpdates2(directory, recommendations, knowledgeConfig, generation);
12270
12285
  },
12271
12286
  checkHivePromotions: async (entries, knowledgeConfig, directory) => {
12272
- const { checkHivePromotions } = await import("./hive-promoter-c458rgp5.js");
12287
+ const { checkHivePromotions } = await import("./hive-promoter-h9c4kyv0.js");
12273
12288
  return checkHivePromotions(entries, knowledgeConfig, directory);
12274
12289
  },
12275
12290
  applyProposalTriage: async (directory, triage) => {
@@ -12278,7 +12293,7 @@ var _internals15 = {
12278
12293
  activateProposal,
12279
12294
  listSkills: listSkills2,
12280
12295
  sanitizeSlug
12281
- } = await import("./skill-generator-sv6zvdvz.js");
12296
+ } = await import("./skill-generator-8v463kj7.js");
12282
12297
  const result = {
12283
12298
  approved: [],
12284
12299
  rejected: [],
@@ -14803,9 +14818,9 @@ function hashContent(content) {
14803
14818
  return createHash7("sha1").update(content).digest("hex");
14804
14819
  }
14805
14820
  async function loadConfigForPolicyCurator(directory) {
14806
- const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-2j92wnns.js");
14821
+ const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-fa033pqw.js");
14807
14822
  try {
14808
- const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-vvwf9ark.js");
14823
+ const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-c48dvb6j.js");
14809
14824
  const { config: loadedConfig } = loadPluginConfigWithMeta2(directory);
14810
14825
  return KnowledgeConfigSchema2.parse(loadedConfig.knowledge ?? {});
14811
14826
  } catch {
@@ -17966,7 +17981,7 @@ async function runFinalizeStage(ctx) {
17966
17981
  }
17967
17982
  }
17968
17983
  try {
17969
- const { CuratorConfigSchema: CCS } = await import("./schema-2j92wnns.js");
17984
+ const { CuratorConfigSchema: CCS } = await import("./schema-fa033pqw.js");
17970
17985
  const { config: pmLoadedConfig } = _internals24.loadPluginConfigWithMeta(ctx.directory);
17971
17986
  const curatorCfg = CCS.parse(pmLoadedConfig.curator ?? {});
17972
17987
  if (curatorCfg.enabled && curatorCfg.postmortem_enabled) {
@@ -20135,9 +20150,9 @@ var _internals28 = {
20135
20150
  readSwarmFileAsync,
20136
20151
  loadCuratorDeps: async () => {
20137
20152
  const [{ CuratorConfigSchema }, curator, { createCuratorLLMDelegate: createCuratorLLMDelegate2 }] = await Promise.all([
20138
- import("./schema-2j92wnns.js"),
20139
- import("./curator-g8rggzbk.js"),
20140
- import("./curator-llm-factory-36psae60.js")
20153
+ import("./schema-fa033pqw.js"),
20154
+ import("./curator-jm9ehfkg.js"),
20155
+ import("./curator-llm-factory-3cy0h9yw.js")
20141
20156
  ]);
20142
20157
  return { CuratorConfigSchema, curator, createCuratorLLMDelegate: createCuratorLLMDelegate2 };
20143
20158
  }
@@ -20636,7 +20651,7 @@ import { fileURLToPath } from "url";
20636
20651
  // package.json
20637
20652
  var package_default = {
20638
20653
  name: "opencode-swarm",
20639
- version: "7.126.1",
20654
+ version: "7.126.3",
20640
20655
  description: "Architect-centric agentic swarm plugin for OpenCode - hub-and-spoke orchestration with SME consultation, code generation, and QA review",
20641
20656
  main: "dist/index.js",
20642
20657
  types: "dist/index.d.ts",
@@ -21158,7 +21173,7 @@ async function computeCurationDiagnostics(directory, entries) {
21158
21173
  let scanCompleted = false;
21159
21174
  let scanRemaining = 0;
21160
21175
  try {
21161
- const { getScanStatus } = await import("./scan-cursor-qzn5jmbe.js");
21176
+ const { getScanStatus } = await import("./scan-cursor-cydz8d9q.js");
21162
21177
  const status = await getScanStatus(directory);
21163
21178
  scanGeneration = status.generation;
21164
21179
  scanCompleted = status.completed;
@@ -21168,17 +21183,17 @@ async function computeCurationDiagnostics(directory, entries) {
21168
21183
  try {
21169
21184
  const { isLinked: isLinked2 } = await import("./knowledge-link-4yd2z8ev.js");
21170
21185
  if (isLinked2(directory)) {
21171
- const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-2j92wnns.js");
21186
+ const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-fa033pqw.js");
21172
21187
  let config;
21173
21188
  try {
21174
- const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-vvwf9ark.js");
21189
+ const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-c48dvb6j.js");
21175
21190
  const loaded = loadPluginConfigWithMeta2(directory);
21176
21191
  config = KnowledgeConfigSchema2.parse(loaded.config.knowledge ?? {});
21177
21192
  } catch {
21178
21193
  config = KnowledgeConfigSchema2.parse({});
21179
21194
  }
21180
21195
  const { cohortConfigFingerprint: cohortConfigFingerprint2 } = await import("./config-fingerprint-v22xh5a2.js");
21181
- const { buildConfigFingerprintInput: buildConfigFingerprintInput2, readCohortConfigFingerprint } = await import("./curation-policy-0t6hny6g.js");
21196
+ const { buildConfigFingerprintInput: buildConfigFingerprintInput2, readCohortConfigFingerprint } = await import("./curation-policy-n944aq62.js");
21182
21197
  const currentFp = cohortConfigFingerprint2(buildConfigFingerprintInput2(config));
21183
21198
  const cohortFp = await readCohortConfigFingerprint(directory);
21184
21199
  configMatch = cohortFp === null ? null : currentFp === cohortFp;
@@ -22376,7 +22391,7 @@ async function handleDoctorCommand(directory, args) {
22376
22391
  const result = runConfigDoctor(config, directory);
22377
22392
  let output;
22378
22393
  if (enableAutoFix && result.hasAutoFixableIssues) {
22379
- const { runConfigDoctorWithFixes } = await import("./config-doctor-23jxdqwv.js");
22394
+ const { runConfigDoctorWithFixes } = await import("./config-doctor-mfx27331.js");
22380
22395
  const fixResult = await runConfigDoctorWithFixes(directory, config, true, {
22381
22396
  applyLossy: true
22382
22397
  });
@@ -41186,7 +41201,7 @@ function buildDetailedHelp(commandName, entry) {
41186
41201
  async function handleHelpCommand(ctx) {
41187
41202
  const targetCommand = ctx.args.join(" ");
41188
41203
  if (!targetCommand) {
41189
- const { buildHelpText } = await import("./index-yf4kvhrn.js");
41204
+ const { buildHelpText } = await import("./index-b16153py.js");
41190
41205
  return buildHelpText();
41191
41206
  }
41192
41207
  const tokens = targetCommand.split(/\s+/);
@@ -41195,7 +41210,7 @@ async function handleHelpCommand(ctx) {
41195
41210
  return _internals62.buildDetailedHelp(resolved.key, resolved.entry);
41196
41211
  }
41197
41212
  const similar = _internals62.findSimilarCommands(targetCommand);
41198
- const { buildHelpText: fullHelp } = await import("./index-yf4kvhrn.js");
41213
+ const { buildHelpText: fullHelp } = await import("./index-b16153py.js");
41199
41214
  if (similar.length > 0) {
41200
41215
  return `Command '/swarm ${targetCommand}' not found.
41201
41216
 
@@ -41334,7 +41349,7 @@ var COMMAND_REGISTRY = {
41334
41349
  },
41335
41350
  "guardrail explain": {
41336
41351
  handler: async (ctx) => {
41337
- const { handleGuardrailExplain } = await import("./guardrail-explain-6ffgrjx9.js");
41352
+ const { handleGuardrailExplain } = await import("./guardrail-explain-va0kj05m.js");
41338
41353
  return handleGuardrailExplain(ctx.directory, ctx.args);
41339
41354
  },
41340
41355
  description: "Dry-run: show what the guardrails would do to a command or write target (executes nothing)",
@@ -41344,7 +41359,7 @@ var COMMAND_REGISTRY = {
41344
41359
  },
41345
41360
  "guardrail-explain": {
41346
41361
  handler: async (ctx) => {
41347
- const { handleGuardrailExplain } = await import("./guardrail-explain-6ffgrjx9.js");
41362
+ const { handleGuardrailExplain } = await import("./guardrail-explain-va0kj05m.js");
41348
41363
  return handleGuardrailExplain(ctx.directory, ctx.args);
41349
41364
  },
41350
41365
  description: "Dry-run: show what the guardrails would do to a command or write target (executes nothing)",
@@ -41354,7 +41369,7 @@ var COMMAND_REGISTRY = {
41354
41369
  },
41355
41370
  "guardrail-log": {
41356
41371
  handler: async (ctx) => {
41357
- const { handleGuardrailLog } = await import("./guardrail-log-57sczn5h.js");
41372
+ const { handleGuardrailLog } = await import("./guardrail-log-61gya05m.js");
41358
41373
  return handleGuardrailLog(ctx.directory, ctx.args);
41359
41374
  },
41360
41375
  description: "Read the guardrail decision log (use --blocks-only for blocks)",
@@ -43138,7 +43153,7 @@ HARD CONSTRAINTS (apply regardless of skill load success):
43138
43153
  - Test execution, explorer lanes, reviewer dispatch, and critic challenge are all permitted within this mode
43139
43154
  - Quality is the only metric \u2014 there is no speed, efficiency, or time exception; time, tokens, and agent dispatches are irrelevant to correctness
43140
43155
  - FOLLOW THE SKILL EXACTLY: execute every phase of the loaded SKILL.md in order with no shortcuts, no phase-skipping, and no premature synthesis. If a required coverage phase cannot complete, apply the skill's coverage gate (retry or verified equivalent alternative). If the gap still cannot be closed, stop and surface the lane failure to the user as BLOCKED; do not produce a degraded review, partial verdict, or final synthesis.
43141
- - CHECK OUT THE PR BRANCH LOCALLY before launching explorer lanes: fetch the PR head ref if it is not present, verify the working tree is clean (git status --porcelain) and stash/abort if not, then check out the head branch. Explorers read the working-tree filesystem (Read/Glob/Grep), so without a checkout they read the base branch and produce invalid candidates. Always pass the base..head commit range in explorer delegations.
43156
+ - CHECK OUT THE EXACT PR HEAD LOCALLY before dispatching explorer lanes: resolve the authoritative full PR head SHA, verify the working tree is clean (git status --porcelain), and if tracked changes exist call \`prepare_pr_workflow_checkout\` with every explicit dirty tracked path before checkout. It returns an auditable stash OID and recovery command; it never stashes untracked files, which must be moved or removed manually. Do NOT run \`git stash\` through shell. Then use standalone commands: fetch the PR head, verify \`git cat-file -e <full_pr_head_sha>^{commit}\`, run \`git switch --detach <full_pr_head_sha>\`, confirm HEAD equals that SHA, and bind it through the PR-review controller. Do not use \`--track FETCH_HEAD\`. Explorers read the working-tree filesystem (Read/Glob/Grep), so without this checkout they read the base branch and produce invalid candidates. Always pass the base..head commit range in explorer delegations.
43142
43157
  - RUN ALL BASE LANES: the default PR_REVIEW path always launches exactly six repository-agnostic base check-type lanes from the skill. Use \`mode: "swarm-pr-review:base"\` and the exact six \`workflow_lane\` identifiers. The runtime rejects partial, duplicate, or mislabelled waves. Do not collapse, omit, or scale down the base lanes for a small, docs-only, or CI-only PR.
43143
43158
  - RETRY STRUCTURALLY: retry only failed base obligations in later \`swarm-pr-review:base\` async batches with the same exact \`pr_head_sha\`. Blocking \`dispatch_lanes\` and direct Task explorer/reviewer/critic dispatch are not provenance-equivalent and are rejected.
43144
43159
  - USE ASYNC DISPATCH WITHOUT IDLING: launch the base lanes with one \`dispatch_lanes_async\` call when available, record the \`batch_id\`, then keep doing non-dependent architect work while they run. Poll with \`collect_lane_results\` without \`wait\` (or \`wait: false\`) to process settled lanes and continue independent work between polls; use \`wait: true\` only as the final join when no independent work remains.
@@ -43157,7 +43172,7 @@ ACTION: Load skill ${bundledProjectSkillFileReference("swarm-pr-feedback")} imme
43157
43172
 
43158
43173
  HARD CONSTRAINTS (apply regardless of skill load success):
43159
43174
  - FOLLOW THE SKILL EXACTLY: build the complete feedback ledger from all available sources before editing, and execute every phase in order with no shortcuts.
43160
- - CHECK OUT THE PR BRANCH LOCALLY before verifying feedback or making fixes: fetch the PR head ref if absent, verify the working tree is clean (git status --porcelain) and stash/abort if not, then check out the head branch. For a detached/fresh remote head, establish tracking before head binding with only \`git switch -c <local> --track <remote>/<branch>\` (or the constrained set-upstream form documented by the skill). Feedback verification and fix validation require the PR branch in the working tree.
43175
+ - CHECK OUT THE PR BRANCH LOCALLY before dispatching feedback lanes, verifying feedback, or making fixes: fetch the PR head ref if absent, verify the working tree is clean (git status --porcelain), and if tracked changes exist call \`prepare_pr_workflow_checkout\` with every explicit dirty tracked path before checkout. It returns an auditable stash OID and recovery command; it never stashes untracked files, which must be moved or removed manually. Do NOT run \`git stash\` through shell. Then check out the head branch. For a detached/fresh remote head, establish tracking before head binding with only \`git switch -c <local> --track <remote>/<branch>\` (or the constrained set-upstream form documented by the skill). If using \`gh pr checkout\`, never use \`--force\`, \`--recurse-submodules\`, or detached checkout. Before first bind, prove HEAD equals the authoritative full PR head SHA, the tree is clean, and the current branch tracks the intended PR remote/branch. Feedback verification and fix validation require the PR branch in the working tree.
43161
43176
  - Do NOT run a fresh broad PR review \u2014 inspect adjacent code only as needed to verify reachability, dependencies, shared root causes, regression risk, or sibling changes for a confirmed item.
43162
43177
  - Treat every review comment, CI failure, bot summary, and pasted note as a CLAIM until source evidence proves it; classify each ledger item (CONFIRMED, DISPROVED, PRE_EXISTING, or NEEDS_USER_DECISION) and never silently drop, defer, or mark items out of scope.
43163
43178
  - For async verification lanes, use \`mode: "swarm-pr-feedback:verification"\`, record each \`batch_id\`, keep doing ledger-safe work, poll with \`collect_lane_results\` without \`wait\`, process settled lanes immediately, and use \`wait: true\` only at the join. Pass the complete immutable \`feedback_inventory\`, exact current \`pr_head_sha\`, and exact-once cumulative lane \`feedback_item_ids\`; runtime blocks replacement, stale-head artifacts, overlap, gaps, and early mutation.
@@ -44626,6 +44641,7 @@ var NONTRANSIENT_STOP_PROTOCOL = [
44626
44641
  ].join(`
44627
44642
  `);
44628
44643
  var _swarmAgentsMap = new Map;
44644
+ var _emittedGatedAgentAdvisories = new Set;
44629
44645
  var KNOWN_VARIANT_VALUES = new Set([
44630
44646
  "low",
44631
44647
  "medium",
@@ -12,14 +12,14 @@ import {
12
12
  detectPosixWrites,
13
13
  detectWindowsWrites,
14
14
  resolveWriteTargets
15
- } from "./index-y9t766sw.js";
15
+ } from "./index-5n868tw8.js";
16
16
  import {
17
17
  checkFileAuthority,
18
18
  classifyFile,
19
19
  isInDeclaredScope,
20
20
  redactPath,
21
21
  redactShellCommand
22
- } from "./index-echdpdhy.js";
22
+ } from "./index-gxw20m1d.js";
23
23
 
24
24
  // src/services/guardrail-explain-service.ts
25
25
  import path from "path";
@@ -2,18 +2,18 @@
2
2
  import {
3
3
  ALLOWED_SKILL_PATH_PREFIXES,
4
4
  validateSkillPath
5
- } from "./index-6j9p0c40.js";
5
+ } from "./index-88dt7c9z.js";
6
6
  import {
7
7
  computeOutcomeSignal,
8
8
  readKnowledge,
9
9
  resolveHiveKnowledgePath,
10
10
  resolveSwarmKnowledgePath,
11
11
  transactKnowledge
12
- } from "./index-nmyg9b7v.js";
12
+ } from "./index-pb8ag9vg.js";
13
13
  import {
14
14
  effectiveRetrievalOutcomes,
15
15
  readKnowledgeCounterRollups
16
- } from "./index-cnhp6c0k.js";
16
+ } from "./index-nqp13m5a.js";
17
17
  import {
18
18
  init_knowledge_types,
19
19
  isActiveStatus
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  authorizeCuration
4
- } from "./index-kx3533dm.js";
4
+ } from "./index-gwss5btk.js";
5
5
  import {
6
6
  findNearDuplicate,
7
7
  inferTags,
@@ -9,7 +9,7 @@ import {
9
9
  resolveSwarmKnowledgePath,
10
10
  resolveSwarmRejectedPath,
11
11
  transactKnowledge
12
- } from "./index-nmyg9b7v.js";
12
+ } from "./index-pb8ag9vg.js";
13
13
  import {
14
14
  resolveKnowledgeStoreDir
15
15
  } from "./index-q27bajqb.js";
@@ -1,10 +1,10 @@
1
1
  // @bun
2
2
  import {
3
3
  handleGuardrailExplain
4
- } from "./index-x1w4cx3n.js";
4
+ } from "./index-6t5sa6v0.js";
5
5
  import {
6
6
  handleGuardrailLog
7
- } from "./index-1p9z8cc4.js";
7
+ } from "./index-bf76q8q7.js";
8
8
  import {
9
9
  COMMAND_REGISTRY,
10
10
  SWARM_COMMAND_TOOL_ALLOWLIST,
@@ -83,28 +83,28 @@ import {
83
83
  handleWriteRetroCommand,
84
84
  normalizeSwarmCommandInput,
85
85
  resolveCommand
86
- } from "./index-y9t766sw.js";
87
- import"./index-echdpdhy.js";
88
- import"./index-w0yztxgq.js";
86
+ } from "./index-5n868tw8.js";
87
+ import"./index-gxw20m1d.js";
88
+ import"./index-3xd9a2g7.js";
89
89
  import"./index-kk1scggc.js";
90
90
  import"./index-4905hd2m.js";
91
91
  import"./index-134d35c1.js";
92
92
  import"./index-6n2jpz7x.js";
93
- import"./index-k5xh81c9.js";
94
- import"./index-nkhp7j16.js";
95
- import"./index-3hkbegq2.js";
93
+ import"./index-7bxw3v5w.js";
94
+ import"./index-f97dm6tz.js";
95
+ import"./index-pf3xae4s.js";
96
96
  import"./index-vxv732ex.js";
97
97
  import"./index-c8s9a3zh.js";
98
98
  import"./index-9ss2m4rs.js";
99
99
  import"./index-23zsx7dm.js";
100
- import"./index-6j9p0c40.js";
101
- import"./index-kx3533dm.js";
100
+ import"./index-88dt7c9z.js";
101
+ import"./index-gwss5btk.js";
102
102
  import"./index-rtry5xyf.js";
103
- import"./index-nmyg9b7v.js";
104
- import"./index-cnhp6c0k.js";
103
+ import"./index-pb8ag9vg.js";
104
+ import"./index-nqp13m5a.js";
105
105
  import"./index-ae75rja9.js";
106
106
  import"./index-q27bajqb.js";
107
- import"./index-abw10n3f.js";
107
+ import"./index-gf9cxvp0.js";
108
108
  import"./index-k5jrywpr.js";
109
109
  import"./index-n832052r.js";
110
110
  import {
@@ -113,7 +113,7 @@ import {
113
113
  init_constants,
114
114
  init_schema,
115
115
  stripKnownSwarmPrefix
116
- } from "./index-c8sqc3nh.js";
116
+ } from "./index-vcqwhe9d.js";
117
117
  import"./index-bk5tah7q.js";
118
118
  import"./index-8fwhhayc.js";
119
119
  import"./index-q1exe2b3.js";
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  redactPath,
4
4
  redactShellCommand
5
- } from "./index-echdpdhy.js";
5
+ } from "./index-gxw20m1d.js";
6
6
 
7
7
  // src/services/guardrail-log-service.ts
8
8
  import * as fs from "fs/promises";
@@ -6,7 +6,7 @@ import {
6
6
  loadPluginConfigWithMeta,
7
7
  loadPluginConfigWithMetaAsync,
8
8
  resolveWorktreeIsolationConfig
9
- } from "./index-abw10n3f.js";
9
+ } from "./index-gf9cxvp0.js";
10
10
  import {
11
11
  ApprovalEvidenceSchema,
12
12
  BaseEvidenceSchema,
@@ -58,7 +58,7 @@ import {
58
58
  WorktreeIsolationConfigSchema,
59
59
  isQAAgent,
60
60
  isSubagent
61
- } from "./index-c8sqc3nh.js";
61
+ } from "./index-vcqwhe9d.js";
62
62
  import"./index-bk5tah7q.js";
63
63
  import {
64
64
  MigrationStatusSchema,
@@ -6,13 +6,13 @@ import {
6
6
  resolveSwarmKnowledgePath,
7
7
  transactKnowledge,
8
8
  wordBigrams
9
- } from "./index-nmyg9b7v.js";
9
+ } from "./index-pb8ag9vg.js";
10
10
  import {
11
11
  countEntryContradictionsInWindow,
12
12
  countEntryViolationsInWindow,
13
13
  readKnowledgeEvents,
14
14
  recordKnowledgeEvent
15
- } from "./index-cnhp6c0k.js";
15
+ } from "./index-nqp13m5a.js";
16
16
  import {
17
17
  init_knowledge_types,
18
18
  isActiveStatus
@@ -190,11 +190,11 @@ async function maybeQuarantineOnContradiction(directory, entryId, threshold, win
190
190
  alreadyInactive: true
191
191
  };
192
192
  }
193
- const { quarantineEntry } = await import("./knowledge-validator-63mkgt9x.js");
193
+ const { quarantineEntry } = await import("./knowledge-validator-jh93eagj.js");
194
194
  let policyConfig;
195
195
  try {
196
- const { KnowledgeConfigSchema } = await import("./schema-2j92wnns.js");
197
- const { loadPluginConfigWithMeta } = await import("./index-vvwf9ark.js");
196
+ const { KnowledgeConfigSchema } = await import("./schema-fa033pqw.js");
197
+ const { loadPluginConfigWithMeta } = await import("./index-c48dvb6j.js");
198
198
  const { config: loadedConfig } = loadPluginConfigWithMeta(directory);
199
199
  policyConfig = KnowledgeConfigSchema.parse(loadedConfig.knowledge ?? {});
200
200
  } catch {
@@ -8,7 +8,7 @@ import {
8
8
  init_constants,
9
9
  init_schema,
10
10
  resolveExternalSkillsConfig
11
- } from "./index-c8sqc3nh.js";
11
+ } from "./index-vcqwhe9d.js";
12
12
  import {
13
13
  advisoryWarn,
14
14
  init_warning_buffer
@@ -4,7 +4,7 @@ import {
4
4
  } from "./index-rtry5xyf.js";
5
5
  import {
6
6
  readKnowledgeEvents
7
- } from "./index-cnhp6c0k.js";
7
+ } from "./index-nqp13m5a.js";
8
8
  import {
9
9
  isLinked,
10
10
  readLinkPointer,
@@ -3,7 +3,7 @@ import {
3
3
  init_constants,
4
4
  init_schema,
5
5
  stripKnownSwarmPrefix
6
- } from "./index-c8sqc3nh.js";
6
+ } from "./index-vcqwhe9d.js";
7
7
  import {
8
8
  init_logger,
9
9
  warn
@@ -608,7 +608,7 @@ async function applyKnowledgeVerdictFeedback(directory, options) {
608
608
  deltas.push({ id, delta });
609
609
  }
610
610
  if (deltas.length > 0) {
611
- const { bumpKnowledgeConfidenceBatch } = await import("./knowledge-store-1d4byc7y.js");
611
+ const { bumpKnowledgeConfidenceBatch } = await import("./knowledge-store-efvtng9t.js");
612
612
  await bumpKnowledgeConfidenceBatch(directory, deltas, options?.floorOptions);
613
613
  }
614
614
  return {
@@ -650,7 +650,7 @@ async function applyConfidenceFloorAction(directory, touched, options) {
650
650
  const recovered = touched.filter((e) => e.confidence > CONFIDENCE_FLOOR + FLOOR_EPSILON && e.confidence_floor_demoted);
651
651
  if (atFloor.length === 0 && recovered.length === 0)
652
652
  return;
653
- const { readKnowledgeCounterRollups, effectiveRetrievalOutcomes } = await import("./knowledge-events-j7jfwm1d.js");
653
+ const { readKnowledgeCounterRollups, effectiveRetrievalOutcomes } = await import("./knowledge-events-7k82xk36.js");
654
654
  const rollups = await readKnowledgeCounterRollups(directory);
655
655
  const flagIds = new Set;
656
656
  for (const e of atFloor) {
@@ -717,11 +717,11 @@ async function applyConfidenceFloorAction(directory, touched, options) {
717
717
  });
718
718
  }
719
719
  if (action === "quarantine" && toQuarantine.length > 0) {
720
- const { quarantineEntry } = await import("./knowledge-validator-63mkgt9x.js");
721
- const { KnowledgeConfigSchema } = await import("./schema-2j92wnns.js");
720
+ const { quarantineEntry } = await import("./knowledge-validator-jh93eagj.js");
721
+ const { KnowledgeConfigSchema } = await import("./schema-fa033pqw.js");
722
722
  let config;
723
723
  try {
724
- const { loadPluginConfigWithMeta } = await import("./index-vvwf9ark.js");
724
+ const { loadPluginConfigWithMeta } = await import("./index-c48dvb6j.js");
725
725
  const { config: loadedConfig } = loadPluginConfigWithMeta(directory);
726
726
  config = KnowledgeConfigSchema.parse(loadedConfig.knowledge ?? {});
727
727
  } catch {
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  readKnowledge,
4
4
  transactKnowledge
5
- } from "./index-nmyg9b7v.js";
5
+ } from "./index-pb8ag9vg.js";
6
6
  import {
7
7
  resolveKnowledgeStoreDir
8
8
  } from "./index-q27bajqb.js";
@@ -222,6 +222,10 @@ var init_tool_metadata = __esm(() => {
222
222
  description: "abort an unrecoverable PR_REVIEW/PR_FEEDBACK mechanical gate and clear its durable session state",
223
223
  agents: ["architect"]
224
224
  },
225
+ prepare_pr_workflow_checkout: {
226
+ description: "preserve explicit dirty tracked files before an unbound PR workflow checkout with an auditable recovery receipt",
227
+ agents: ["architect"]
228
+ },
225
229
  run_pr_feedback_stage_a: {
226
230
  description: "execute and persist mandatory PR-feedback Stage A checks on a content-bound revision",
227
231
  agents: ["architect"]