opencode-swarm 7.153.1 → 7.153.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 (48) hide show
  1. package/dist/cli/{config-doctor-ze21qs6b.js → config-doctor-tv0ar88m.js} +2 -2
  2. package/dist/cli/{core-qdmhh1kx.js → core-kmsm50zn.js} +1 -1
  3. package/dist/cli/{curator-llm-factory-s8atmc2n.js → curator-llm-factory-dxkhdhwg.js} +17 -17
  4. package/dist/cli/{curator-hxb3wsxr.js → curator-wxe863k9.js} +17 -17
  5. package/dist/cli/{evidence-summary-service-wzzym9r7.js → evidence-summary-service-9akrdg9t.js} +6 -6
  6. package/dist/cli/{gate-evidence-f71dn9vv.js → gate-evidence-bdzqbg2y.js} +2 -2
  7. package/dist/cli/{guardrail-explain-5kzeem4m.js → guardrail-explain-kx9rem51.js} +18 -18
  8. package/dist/cli/{guardrail-log-38jnajpa.js → guardrail-log-zxzyx1de.js} +3 -3
  9. package/dist/cli/{guardrail-reset-wzvtmpn2.js → guardrail-reset-1mc3st34.js} +17 -17
  10. package/dist/cli/{hive-promoter-55qcqgfx.js → hive-promoter-gncwtq0z.js} +17 -17
  11. package/dist/cli/{index-9v8d3c0k.js → index-02rbfrab.js} +1 -1
  12. package/dist/cli/{index-af0cqe6n.js → index-0azn976d.js} +3 -3
  13. package/dist/cli/{index-6vgb5fyb.js → index-21pt4jwf.js} +1 -1
  14. package/dist/cli/{index-tdzbm974.js → index-3bh4h6ve.js} +104 -4
  15. package/dist/cli/{index-ajkxx2k6.js → index-3fpqpyp6.js} +2 -2
  16. package/dist/cli/{index-v689bmr2.js → index-56ejcj07.js} +1 -1
  17. package/dist/cli/{index-8v9sj4aq.js → index-5ad8xcv3.js} +1 -1
  18. package/dist/cli/{index-1akn19mp.js → index-5zp4c36c.js} +1 -1
  19. package/dist/cli/{index-0tzv5zg2.js → index-84m4per1.js} +2 -2
  20. package/dist/cli/{index-n823qsae.js → index-a58nmnmz.js} +7 -1
  21. package/dist/cli/{index-k10qtq71.js → index-bw55r5bz.js} +4 -4
  22. package/dist/cli/{index-mb7b1gye.js → index-ebshrg4x.js} +1 -1
  23. package/dist/cli/{index-1dtshrzg.js → index-h06112sh.js} +2 -2
  24. package/dist/cli/{index-gn26q90p.js → index-h3zhb18p.js} +1 -1
  25. package/dist/cli/{index-0tyc8kdg.js → index-hhv2pvab.js} +1 -1
  26. package/dist/cli/{index-6ybjrqf7.js → index-j4f8sz67.js} +139 -52
  27. package/dist/cli/{index-23rneydq.js → index-kenz5bja.js} +19 -19
  28. package/dist/cli/{index-xkjrg9k4.js → index-kvk65qzz.js} +3 -3
  29. package/dist/cli/{index-4g0g3dqz.js → index-s6b8jgtn.js} +1 -1
  30. package/dist/cli/{index-n5pxkera.js → index-vhbds89e.js} +3 -3
  31. package/dist/cli/{index-smqsp8hs.js → index-yvepnbyd.js} +5 -5
  32. package/dist/cli/index.js +17 -17
  33. package/dist/cli/{knowledge-escalator-w05ztgvk.js → knowledge-escalator-gp3mpbqe.js} +6 -6
  34. package/dist/cli/{knowledge-events-pwm9jc0m.js → knowledge-events-nvkhtqvn.js} +4 -4
  35. package/dist/cli/{knowledge-store-4xv65tj2.js → knowledge-store-2ngh8xvv.js} +1 -1
  36. package/dist/cli/{knowledge-validator-0ttfsca7.js → knowledge-validator-4bphyrec.js} +2 -2
  37. package/dist/cli/{scan-cursor-b6n15w8d.js → scan-cursor-c16xtygz.js} +2 -2
  38. package/dist/cli/{schema-jkbfwqr2.js → schema-83tbte2g.js} +1 -1
  39. package/dist/cli/{scope-persistence-5xt2m5ep.js → scope-persistence-gdbw8xh8.js} +4 -4
  40. package/dist/cli/{skill-generator-3keadpf7.js → skill-generator-gr13xeha.js} +7 -7
  41. package/dist/cli/{worktree-isolation-1ymaxn4h.js → worktree-isolation-jjkfg2pg.js} +17 -17
  42. package/dist/commands/registry.d.ts +1 -1
  43. package/dist/commands/reset-session.d.ts +8 -2
  44. package/dist/hooks/knowledge-application-gate.d.ts +10 -1
  45. package/dist/hooks/knowledge-receipt-ledger.d.ts +1 -1
  46. package/dist/index.js +72 -72
  47. package/dist/state.d.ts +6 -4
  48. package/package.json +7 -1
@@ -6,7 +6,7 @@ import {
6
6
  PluginConfigSchema,
7
7
  init_schema,
8
8
  resolveExternalSkillsConfig
9
- } from "./index-n823qsae.js";
9
+ } from "./index-a58nmnmz.js";
10
10
  import {
11
11
  GIT_BINARY_ENV_VAR,
12
12
  init_git_executable
@@ -14,14 +14,14 @@ import {
14
14
  detectWindowsWrites,
15
15
  getSharedClassifierGuardrailBlock,
16
16
  resolveWriteTargets
17
- } from "./index-6ybjrqf7.js";
17
+ } from "./index-j4f8sz67.js";
18
18
  import {
19
19
  checkFileAuthority,
20
20
  classifyFile,
21
21
  isInDeclaredScope,
22
22
  redactPath,
23
23
  redactShellCommand
24
- } from "./index-gn26q90p.js";
24
+ } from "./index-h3zhb18p.js";
25
25
 
26
26
  // src/services/guardrail-explain-service.ts
27
27
  import path from "path";
@@ -21,7 +21,7 @@ var package_default;
21
21
  var init_package = __esm(() => {
22
22
  package_default = {
23
23
  name: "opencode-swarm",
24
- version: "7.153.1",
24
+ version: "7.153.2",
25
25
  description: "Architect-centric agentic swarm plugin for OpenCode - hub-and-spoke orchestration with SME consultation, code generation, and QA review",
26
26
  main: "dist/index.js",
27
27
  types: "dist/index.d.ts",
@@ -133,7 +133,13 @@ var init_package = __esm(() => {
133
133
  "check:core-events": "bun run scripts/check-core-events-usage.ts",
134
134
  "check:shell-audit": "bun run scripts/check-shell-audit-usage.ts",
135
135
  "check:trajectory-store": "bun run scripts/check-trajectory-store-usage.ts",
136
+ "check:mock-cleanup": "bun run scripts/check-mock-cleanup.ts",
137
+ "check:invariants": "bun run scripts/check-invariants.ts",
138
+ "check:cross-contamination": "bun run scripts/check-cross-contamination.ts",
139
+ "check:test-clock": "bun run scripts/check-test-clock.ts",
136
140
  "check:test-file-cap": "bun run scripts/check-test-file-cap.ts",
141
+ "check:test-tmpdir": "bun run scripts/check-test-tmpdir.ts",
142
+ "check:bash-portability": "bun run scripts/check-bash-portability.ts",
137
143
  "check:pending-fragment": "bun run scripts/check-pending-fragment.ts",
138
144
  "check:gate-portability": "bun run scripts/check-gate-portability.ts",
139
145
  "check:bare-spawn": "bun run scripts/check-bare-executable-spawn.ts",
@@ -713,7 +713,7 @@ async function applyConfidenceFloorAction(directory, touched, options) {
713
713
  const {
714
714
  readAuthoritativeKnowledgeCounterRollups,
715
715
  effectiveRetrievalOutcomes
716
- } = await import("./knowledge-events-pwm9jc0m.js");
716
+ } = await import("./knowledge-events-nvkhtqvn.js");
717
717
  const rollups = await readAuthoritativeKnowledgeCounterRollups(directory);
718
718
  const flagIds = new Set;
719
719
  for (const e of atFloor) {
@@ -780,11 +780,11 @@ async function applyConfidenceFloorAction(directory, touched, options) {
780
780
  });
781
781
  }
782
782
  if (action === "quarantine" && toQuarantine.length > 0) {
783
- const { quarantineEntry } = await import("./knowledge-validator-0ttfsca7.js");
784
- const { KnowledgeConfigSchema } = await import("./schema-jkbfwqr2.js");
783
+ const { quarantineEntry } = await import("./knowledge-validator-4bphyrec.js");
784
+ const { KnowledgeConfigSchema } = await import("./schema-83tbte2g.js");
785
785
  let config;
786
786
  try {
787
- const { loadPluginConfigWithMeta } = await import("./index-xkjrg9k4.js");
787
+ const { loadPluginConfigWithMeta } = await import("./index-kvk65qzz.js");
788
788
  const { config: loadedConfig } = loadPluginConfigWithMeta(directory);
789
789
  config = KnowledgeConfigSchema.parse(loadedConfig.knowledge ?? {});
790
790
  } catch {
@@ -4,7 +4,7 @@ import {
4
4
  PlanSchema,
5
5
  TaskStatusSchema,
6
6
  init_loader
7
- } from "./index-1akn19mp.js";
7
+ } from "./index-5zp4c36c.js";
8
8
  import {
9
9
  assertProjectRoot,
10
10
  withEvidenceLock
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  computePlanStructureHash,
4
4
  derivePlanId
5
- } from "./index-mb7b1gye.js";
5
+ } from "./index-ebshrg4x.js";
6
6
  import {
7
7
  appendCoreEventSync
8
8
  } from "./index-pk1gbqmq.js";
@@ -11,7 +11,7 @@ import {
11
11
  } from "./index-556ja8an.js";
12
12
  import {
13
13
  PlanSchema
14
- } from "./index-1akn19mp.js";
14
+ } from "./index-5zp4c36c.js";
15
15
  import {
16
16
  atomicWriteSwarmFile,
17
17
  atomicWriteSwarmFileSync
@@ -11,7 +11,7 @@ import {
11
11
  import {
12
12
  init_schema,
13
13
  stripKnownSwarmPrefix
14
- } from "./index-n823qsae.js";
14
+ } from "./index-a58nmnmz.js";
15
15
  import {
16
16
  init_constants
17
17
  } from "./index-myt57pht.js";
@@ -6,7 +6,7 @@ import {
6
6
  PluginConfigSchema,
7
7
  init_schema,
8
8
  stripKnownSwarmPrefix
9
- } from "./index-n823qsae.js";
9
+ } from "./index-a58nmnmz.js";
10
10
  import {
11
11
  ALL_AGENT_NAMES,
12
12
  init_constants
@@ -6,13 +6,13 @@ import {
6
6
  protectedRoots,
7
7
  redactDecisionLineForArchive,
8
8
  stableCanonicalStringify
9
- } from "./index-gn26q90p.js";
9
+ } from "./index-h3zhb18p.js";
10
10
  import {
11
11
  detectStraySwarmDirs,
12
12
  readDoctorArtifact,
13
13
  removeStraySwarmDir,
14
14
  runConfigDoctor
15
- } from "./index-0tyc8kdg.js";
15
+ } from "./index-hhv2pvab.js";
16
16
  import {
17
17
  MAX_TRANSIENT_RETRIES,
18
18
  archiveEvidence,
@@ -59,7 +59,7 @@ import {
59
59
  validateProjectRoot,
60
60
  validateSymlinkBoundary,
61
61
  validateTargetWithinRoot
62
- } from "./index-af0cqe6n.js";
62
+ } from "./index-0azn976d.js";
63
63
  import {
64
64
  loadDatabaseCtor
65
65
  } from "./index-134d35c1.js";
@@ -112,7 +112,7 @@ import {
112
112
  alreadyCuratedThisGeneration,
113
113
  claimNextScanBatch,
114
114
  resolveCohortId
115
- } from "./index-8v9sj4aq.js";
115
+ } from "./index-5ad8xcv3.js";
116
116
  import {
117
117
  CURATOR_INIT_PROMPT,
118
118
  CURATOR_PHASE_PROMPT,
@@ -182,10 +182,10 @@ import {
182
182
  retireSkill,
183
183
  selectCandidateEntries,
184
184
  syncBundledProjectSkillsIfMissingAsync
185
- } from "./index-n5pxkera.js";
185
+ } from "./index-vhbds89e.js";
186
186
  import {
187
187
  readRecentEscalations
188
- } from "./index-smqsp8hs.js";
188
+ } from "./index-yvepnbyd.js";
189
189
  import {
190
190
  appendUnactionable,
191
191
  quarantineEntry,
@@ -196,7 +196,7 @@ import {
196
196
  validateActionableFields,
197
197
  validateLesson,
198
198
  validateSkillPath
199
- } from "./index-v689bmr2.js";
199
+ } from "./index-56ejcj07.js";
200
200
  import {
201
201
  authorizeCuration,
202
202
  buildConfigFingerprintInput
@@ -243,12 +243,12 @@ import {
243
243
  transitionTaskWorkflowEvidence,
244
244
  withTaskEvidenceTransaction,
245
245
  writeWorkflowWalFile
246
- } from "./index-9v8d3c0k.js";
246
+ } from "./index-02rbfrab.js";
247
247
  import {
248
248
  makeWorktreeBranchName,
249
249
  provisionWorktree,
250
250
  removeWorktree
251
- } from "./index-4g0g3dqz.js";
251
+ } from "./index-s6b8jgtn.js";
252
252
  import {
253
253
  DEFAULT_STALE_DELEGATION_TIMEOUT_MS,
254
254
  DELEGATION_COMPACTION_HIGH_WATER_BYTES,
@@ -270,7 +270,7 @@ import {
270
270
  clearAllScopes,
271
271
  clearScopeBindingFromDisk,
272
272
  clearScopeBindings
273
- } from "./index-1dtshrzg.js";
273
+ } from "./index-h06112sh.js";
274
274
  import {
275
275
  appendLedgerEvent,
276
276
  computePlanHash,
@@ -285,7 +285,7 @@ import {
285
285
  readPlanEpochIdentity,
286
286
  replayFromLedgerWithStatus,
287
287
  takeSnapshotEvent
288
- } from "./index-mb7b1gye.js";
288
+ } from "./index-ebshrg4x.js";
289
289
  import {
290
290
  CORE_EVENT_LOCKED,
291
291
  appendCoreEventSync,
@@ -345,12 +345,14 @@ import {
345
345
  transactFile,
346
346
  transactKnowledge,
347
347
  wordBigrams
348
- } from "./index-k10qtq71.js";
348
+ } from "./index-bw55r5bz.js";
349
349
  import {
350
350
  MAX_EVENT_LOG_ENTRIES,
351
351
  _internals as _internals2,
352
+ commitGateReleaseBatch,
352
353
  effectiveRetrievalOutcomes,
353
354
  queryHistoricalOutcomes,
355
+ queryLiveMemberships,
354
356
  readAuthoritativeKnowledgeCounterRollups,
355
357
  readKnowledgeCounterRollups,
356
358
  readKnowledgeEvents,
@@ -359,10 +361,10 @@ import {
359
361
  recordKnowledgeEvent,
360
362
  recordPhaseCloseIntent,
361
363
  resolveKnowledgeEventsPath
362
- } from "./index-tdzbm974.js";
364
+ } from "./index-3bh4h6ve.js";
363
365
  import {
364
366
  resolveWorktreeIsolationConfig
365
- } from "./index-ajkxx2k6.js";
367
+ } from "./index-3fpqpyp6.js";
366
368
  import {
367
369
  RetrospectiveEvidenceSchema
368
370
  } from "./index-gprxjmm7.js";
@@ -384,7 +386,7 @@ import {
384
386
  init_loader,
385
387
  loadPluginConfig,
386
388
  loadPluginConfigWithMeta
387
- } from "./index-1akn19mp.js";
389
+ } from "./index-5zp4c36c.js";
388
390
  import {
389
391
  DEFAULT_PR_REVIEW_RESILIENCE_CONFIG,
390
392
  DEFAULT_SKILL_OPT_CONFIG,
@@ -399,7 +401,7 @@ import {
399
401
  package_default,
400
402
  resolveAutoReviewConfig,
401
403
  stripKnownSwarmPrefix
402
- } from "./index-n823qsae.js";
404
+ } from "./index-a58nmnmz.js";
403
405
  import {
404
406
  AGENT_TOOL_MAP,
405
407
  ALL_AGENT_NAMES,
@@ -6824,7 +6826,7 @@ async function cleanupRecoveredWorktree(directory, descriptor) {
6824
6826
  awaitingMergeByCallID,
6825
6827
  cleanupStandardWorktreeForCallId,
6826
6828
  standardWorktreeByCallID
6827
- } = await import("./worktree-isolation-1ymaxn4h.js");
6829
+ } = await import("./worktree-isolation-jjkfg2pg.js");
6828
6830
  standardWorktreeByCallID.delete(descriptor.callID);
6829
6831
  if (hasResidue)
6830
6832
  awaitingMergeByCallID.set(descriptor.callID, {
@@ -6930,7 +6932,7 @@ async function recoverCoderSettlement(directory, taskId) {
6930
6932
  awaitingMergeByCallID,
6931
6933
  finishStandardWorktreeDispatch,
6932
6934
  standardWorktreeByCallID
6933
- } = await import("./worktree-isolation-1ymaxn4h.js");
6935
+ } = await import("./worktree-isolation-jjkfg2pg.js");
6934
6936
  const descriptor = wal.worktree;
6935
6937
  const reconstructedDispatch = {
6936
6938
  callID: descriptor.callID,
@@ -20064,7 +20066,7 @@ function planMerges(active, threshold, maxComparisons, maxMerges) {
20064
20066
  };
20065
20067
  }
20066
20068
  async function sweepActiveNearDuplicates(directory, options = {}) {
20067
- const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-xkjrg9k4.js");
20069
+ const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-kvk65qzz.js");
20068
20070
  const { config } = loadPluginConfigWithMeta2(directory);
20069
20071
  const sweepConfig = config.learning?.dedup_sweep;
20070
20072
  if (sweepConfig?.enabled === false)
@@ -21194,7 +21196,7 @@ async function runCuratorPhase(directory, phase, agentsDispatched, config, knowl
21194
21196
  }
21195
21197
  if (config.skill_generation_enabled === true && skillCandidates.length > 0) {
21196
21198
  try {
21197
- const skillModule = await import("./skill-generator-3keadpf7.js");
21199
+ const skillModule = await import("./skill-generator-gr13xeha.js");
21198
21200
  for (const cand of skillCandidates) {
21199
21201
  if (cand.confidence < (config.min_skill_confidence ?? DEFAULT_SKILL_MIN_CONFIDENCE)) {
21200
21202
  continue;
@@ -21666,7 +21668,7 @@ async function applyCuratorKnowledgeUpdates(directory, recommendations, knowledg
21666
21668
  } catch {}
21667
21669
  }
21668
21670
  if (contradictedEntries.length > 0 && knowledgeConfig.contradiction_threshold_action === "quarantine") {
21669
- const { maybeQuarantineOnContradiction } = await import("./knowledge-escalator-w05ztgvk.js");
21671
+ const { maybeQuarantineOnContradiction } = await import("./knowledge-escalator-gp3mpbqe.js");
21670
21672
  for (const { id } of contradictedEntries) {
21671
21673
  try {
21672
21674
  await maybeQuarantineOnContradiction(directory, id, knowledgeConfig.contradiction_quarantine_threshold, knowledgeConfig.contradiction_quarantine_window_days);
@@ -22485,7 +22487,7 @@ async function runCuratorPostMortem(directory, options = {}) {
22485
22487
  warnings.push("Failed to collect knowledge summary.");
22486
22488
  }
22487
22489
  try {
22488
- const { getScanStatus } = await import("./scan-cursor-b6n15w8d.js");
22490
+ const { getScanStatus } = await import("./scan-cursor-c16xtygz.js");
22489
22491
  const scanStatus = await getScanStatus(directory);
22490
22492
  if (scanStatus.remaining_estimate > 0) {
22491
22493
  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.`);
@@ -22657,9 +22659,9 @@ var _internals27 = {
22657
22659
  verifyPostMortemKnowledgeActions,
22658
22660
  repairPostMortemActions,
22659
22661
  loadDefaultKnowledgeConfig: async (directory) => {
22660
- const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-jkbfwqr2.js");
22662
+ const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-83tbte2g.js");
22661
22663
  try {
22662
- const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-xkjrg9k4.js");
22664
+ const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-kvk65qzz.js");
22663
22665
  const loaded = loadPluginConfigWithMeta2(directory);
22664
22666
  return KnowledgeConfigSchema2.parse(loaded.config.knowledge ?? {});
22665
22667
  } catch {
@@ -22667,11 +22669,11 @@ var _internals27 = {
22667
22669
  }
22668
22670
  },
22669
22671
  applyCuratorKnowledgeUpdates: async (directory, recommendations, knowledgeConfig, generation) => {
22670
- const { applyCuratorKnowledgeUpdates: applyCuratorKnowledgeUpdates2 } = await import("./curator-hxb3wsxr.js");
22672
+ const { applyCuratorKnowledgeUpdates: applyCuratorKnowledgeUpdates2 } = await import("./curator-wxe863k9.js");
22671
22673
  return applyCuratorKnowledgeUpdates2(directory, recommendations, knowledgeConfig, generation);
22672
22674
  },
22673
22675
  checkHivePromotions: async (entries, knowledgeConfig, directory) => {
22674
- const { checkHivePromotions } = await import("./hive-promoter-55qcqgfx.js");
22676
+ const { checkHivePromotions } = await import("./hive-promoter-gncwtq0z.js");
22675
22677
  return checkHivePromotions(entries, knowledgeConfig, directory);
22676
22678
  },
22677
22679
  applyProposalTriage: async (directory, triage) => {
@@ -22680,7 +22682,7 @@ var _internals27 = {
22680
22682
  activateProposal,
22681
22683
  listSkills: listSkills2,
22682
22684
  sanitizeSlug
22683
- } = await import("./skill-generator-3keadpf7.js");
22685
+ } = await import("./skill-generator-gr13xeha.js");
22684
22686
  const result = {
22685
22687
  approved: [],
22686
22688
  rejected: [],
@@ -24010,9 +24012,9 @@ function hashContent(content) {
24010
24012
  return createHash12("sha1").update(content).digest("hex");
24011
24013
  }
24012
24014
  async function loadConfigForPolicyCurator(directory) {
24013
- const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-jkbfwqr2.js");
24015
+ const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-83tbte2g.js");
24014
24016
  try {
24015
- const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-xkjrg9k4.js");
24017
+ const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-kvk65qzz.js");
24016
24018
  const { config: loadedConfig } = loadPluginConfigWithMeta2(directory);
24017
24019
  return KnowledgeConfigSchema2.parse(loadedConfig.knowledge ?? {});
24018
24020
  } catch {
@@ -36056,7 +36058,7 @@ async function runFinalizeStage(ctx) {
36056
36058
  }
36057
36059
  }
36058
36060
  try {
36059
- const { CuratorConfigSchema: CCS } = await import("./schema-jkbfwqr2.js");
36061
+ const { CuratorConfigSchema: CCS } = await import("./schema-83tbte2g.js");
36060
36062
  const { config: pmLoadedConfig } = _internals42.loadPluginConfigWithMeta(ctx.directory);
36061
36063
  const curatorCfg = CCS.parse(pmLoadedConfig.curator ?? {});
36062
36064
  if (curatorCfg.enabled && curatorCfg.postmortem_enabled) {
@@ -38269,9 +38271,9 @@ var _internals46 = {
38269
38271
  loadPluginConfigWithMeta,
38270
38272
  loadCuratorDeps: async () => {
38271
38273
  const [{ CuratorConfigSchema }, curator, { createCuratorLLMDelegate: createCuratorLLMDelegate2 }] = await Promise.all([
38272
- import("./schema-jkbfwqr2.js"),
38273
- import("./curator-hxb3wsxr.js"),
38274
- import("./curator-llm-factory-s8atmc2n.js")
38274
+ import("./schema-83tbte2g.js"),
38275
+ import("./curator-wxe863k9.js"),
38276
+ import("./curator-llm-factory-dxkhdhwg.js")
38275
38277
  ]);
38276
38278
  return { CuratorConfigSchema, curator, createCuratorLLMDelegate: createCuratorLLMDelegate2 };
38277
38279
  }
@@ -39280,7 +39282,7 @@ async function computeCurationDiagnostics(directory, entries) {
39280
39282
  let scanCompleted = false;
39281
39283
  let scanRemaining = 0;
39282
39284
  try {
39283
- const { getScanStatus } = await import("./scan-cursor-b6n15w8d.js");
39285
+ const { getScanStatus } = await import("./scan-cursor-c16xtygz.js");
39284
39286
  const status = await getScanStatus(directory);
39285
39287
  scanGeneration = status.generation;
39286
39288
  scanCompleted = status.completed;
@@ -39290,10 +39292,10 @@ async function computeCurationDiagnostics(directory, entries) {
39290
39292
  try {
39291
39293
  const { isLinked: isLinked2 } = await import("./knowledge-link-ge0rddxw.js");
39292
39294
  if (isLinked2(directory)) {
39293
- const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-jkbfwqr2.js");
39295
+ const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-83tbte2g.js");
39294
39296
  let config;
39295
39297
  try {
39296
- const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-xkjrg9k4.js");
39298
+ const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-kvk65qzz.js");
39297
39299
  const loaded = loadPluginConfigWithMeta2(directory);
39298
39300
  config = KnowledgeConfigSchema2.parse(loaded.config.knowledge ?? {});
39299
39301
  } catch {
@@ -40613,7 +40615,7 @@ async function handleDoctorCommand(directory, args) {
40613
40615
  const result = runConfigDoctor(config, directory);
40614
40616
  let output;
40615
40617
  if (enableAutoFix && result.hasAutoFixableIssues) {
40616
- const { runConfigDoctorWithFixes } = await import("./config-doctor-ze21qs6b.js");
40618
+ const { runConfigDoctorWithFixes } = await import("./config-doctor-tv0ar88m.js");
40617
40619
  const fixResult = await runConfigDoctorWithFixes(directory, config, true, {
40618
40620
  applyLossy: true
40619
40621
  });
@@ -41553,7 +41555,7 @@ async function handleEvidenceCommand(directory, args) {
41553
41555
  return formatTaskEvidenceMarkdown(evidenceData);
41554
41556
  }
41555
41557
  async function handleEvidenceSummaryCommand(directory) {
41556
- const { buildEvidenceSummary } = await import("./evidence-summary-service-wzzym9r7.js");
41558
+ const { buildEvidenceSummary } = await import("./evidence-summary-service-9akrdg9t.js");
41557
41559
  const artifact = await buildEvidenceSummary(directory);
41558
41560
  if (!artifact) {
41559
41561
  return "No plan found. Run `/swarm plan` to check plan status.";
@@ -67388,14 +67390,87 @@ function clearTrajectoryStep(sessionId) {
67388
67390
  var _internals84 = {
67389
67391
  cleanupOrphanedBranches,
67390
67392
  backupSwarmStateBeforeReset,
67391
- recoverStaleCoderSettlements
67393
+ recoverStaleCoderSettlements,
67394
+ queryLiveMemberships,
67395
+ commitGateReleaseBatch,
67396
+ releaseKnowledgeGateObligations
67392
67397
  };
67393
67398
  function errorMessage(err) {
67394
67399
  if (err instanceof Error)
67395
67400
  return err.message;
67396
67401
  return String(err);
67397
67402
  }
67398
- async function handleResetSessionCommand(directory, _args) {
67403
+ async function releaseKnowledgeGateObligations(directory, sessionID) {
67404
+ const results = [];
67405
+ let live;
67406
+ try {
67407
+ live = await _internals84.queryLiveMemberships(directory, {
67408
+ session_id: sessionID,
67409
+ include_terminal: true
67410
+ });
67411
+ } catch (err) {
67412
+ return [
67413
+ `\u26A0\uFE0F Knowledge gate state not cleared: receipt authority unavailable (${errorMessage(err)})`
67414
+ ];
67415
+ }
67416
+ if (!live.ok) {
67417
+ return [
67418
+ `\u26A0\uFE0F Knowledge gate state not cleared: receipt authority unavailable (${live.code})`
67419
+ ];
67420
+ }
67421
+ const pending = live.memberships.filter((membership) => membership.exposure_kind === "architect_directive" && !membership.application_marker && membership.gate_release?.membership_event_id !== membership.membership_event_id);
67422
+ if (pending.length === 0) {
67423
+ return ["\u23ED\uFE0F No pending knowledge gate obligations for this session"];
67424
+ }
67425
+ const byTrace = new Map;
67426
+ for (const membership of pending) {
67427
+ const group = byTrace.get(membership.trace_id) ?? [];
67428
+ group.push(membership);
67429
+ byTrace.set(membership.trace_id, group);
67430
+ }
67431
+ let committedCount = 0;
67432
+ const releasedPairs = [];
67433
+ for (const [traceId, group] of byTrace) {
67434
+ const committed = await _internals84.commitGateReleaseBatch(directory, {
67435
+ trace_id: traceId,
67436
+ session_id: sessionID,
67437
+ items: group.map((membership) => ({
67438
+ entry_id: membership.entry_id,
67439
+ source: "application_gate_session_reset_release",
67440
+ reason: "/swarm reset-session operator escape (#2398)"
67441
+ }))
67442
+ });
67443
+ if (!committed.ok) {
67444
+ results.push(`\u26A0\uFE0F Failed to release knowledge gate obligations on trace ${sanitizeDiagnosticText(traceId, 64)}: ${committed.code}`);
67445
+ continue;
67446
+ }
67447
+ committedCount += committed.committed.length;
67448
+ for (const item of committed.committed) {
67449
+ releasedPairs.push(`${traceId}/${item.entry_id}`);
67450
+ }
67451
+ if (committed.rejected.length > 0) {
67452
+ results.push(`\u26A0\uFE0F Partially released trace ${sanitizeDiagnosticText(traceId, 64)}: ${committed.rejected.map((item) => item.reason).join("; ")}`);
67453
+ }
67454
+ }
67455
+ if (committedCount === 0) {
67456
+ return results;
67457
+ }
67458
+ if (committedCount < pending.length) {
67459
+ results.push(`\u26A0\uFE0F Released ${committedCount} of ${pending.length} pending knowledge gate obligation(s) \u2014 ${pending.length - committedCount} not released; see warnings above`);
67460
+ } else {
67461
+ results.push(`\u2705 Released ${committedCount} pending knowledge gate obligation(s) for this session`);
67462
+ }
67463
+ try {
67464
+ appendCoreEventSync(directory, {
67465
+ timestamp: new Date().toISOString(),
67466
+ event: "knowledge_application_gate_session_reset_clear",
67467
+ sessionID,
67468
+ released_pairs: releasedPairs
67469
+ });
67470
+ } catch {}
67471
+ return results;
67472
+ }
67473
+ async function handleResetSessionCommand(directory, _args, sessionID) {
67399
67474
  const results = [];
67400
67475
  try {
67401
67476
  const backup = _internals84.backupSwarmStateBeforeReset(directory, "reset-session", ["session"]);
@@ -67458,6 +67533,18 @@ async function handleResetSessionCommand(directory, _args) {
67458
67533
  const activeAgentCount = swarmState.activeAgent.size;
67459
67534
  swarmState.activeAgent.clear();
67460
67535
  results.push(`\u2705 Cleared ${activeAgentCount} active-agent mapping(s)`);
67536
+ if (sessionID) {
67537
+ try {
67538
+ results.push(...await _internals84.releaseKnowledgeGateObligations(directory, sessionID));
67539
+ } catch (err) {
67540
+ results.push(`\u26A0\uFE0F Knowledge gate state not cleared: ${errorMessage(err)}`);
67541
+ }
67542
+ } else {
67543
+ results.push("\u26A0\uFE0F Knowledge gate obligations not released: no session context on this invocation");
67544
+ }
67545
+ swarmState.gateDenialCounts.clear();
67546
+ swarmState.currentCriticalShownIds.clear();
67547
+ results.push("\u2705 Cleared in-memory knowledge gate denial state");
67461
67548
  let preserveWorktrees = false;
67462
67549
  try {
67463
67550
  const { results: settlementResults, truncated } = await _internals84.recoverStaleCoderSettlements(directory, {
@@ -76033,7 +76120,7 @@ function buildDetailedHelp(commandName, entry) {
76033
76120
  async function handleHelpCommand(ctx) {
76034
76121
  const targetCommand = ctx.args.join(" ");
76035
76122
  if (!targetCommand) {
76036
- const { buildHelpText } = await import("./index-23rneydq.js");
76123
+ const { buildHelpText } = await import("./index-kenz5bja.js");
76037
76124
  return buildHelpText();
76038
76125
  }
76039
76126
  const tokens = targetCommand.split(/\s+/);
@@ -76042,7 +76129,7 @@ async function handleHelpCommand(ctx) {
76042
76129
  return _internals101.buildDetailedHelp(resolved.key, resolved.entry);
76043
76130
  }
76044
76131
  const similar = _internals101.findSimilarCommands(targetCommand);
76045
- const { buildHelpText: fullHelp } = await import("./index-23rneydq.js");
76132
+ const { buildHelpText: fullHelp } = await import("./index-kenz5bja.js");
76046
76133
  if (similar.length > 0) {
76047
76134
  return `Command '/swarm ${targetCommand}' not found.
76048
76135
 
@@ -76229,7 +76316,7 @@ var COMMAND_REGISTRY = {
76229
76316
  },
76230
76317
  "guardrail explain": {
76231
76318
  handler: async (ctx) => {
76232
- const { handleGuardrailExplain } = await import("./guardrail-explain-5kzeem4m.js");
76319
+ const { handleGuardrailExplain } = await import("./guardrail-explain-kx9rem51.js");
76233
76320
  return handleGuardrailExplain(ctx.directory, ctx.args);
76234
76321
  },
76235
76322
  description: "Dry-run: show what the guardrails would do to a command or write target (executes nothing)",
@@ -76239,7 +76326,7 @@ var COMMAND_REGISTRY = {
76239
76326
  },
76240
76327
  "guardrail reset": {
76241
76328
  handler: async (ctx) => {
76242
- const { handleGuardrailReset } = await import("./guardrail-reset-wzvtmpn2.js");
76329
+ const { handleGuardrailReset } = await import("./guardrail-reset-1mc3st34.js");
76243
76330
  return handleGuardrailReset(ctx.args, ctx.sessionID);
76244
76331
  },
76245
76332
  description: "Reset one exact active invocation/action circuit after repair",
@@ -76248,7 +76335,7 @@ var COMMAND_REGISTRY = {
76248
76335
  },
76249
76336
  "guardrail-explain": {
76250
76337
  handler: async (ctx) => {
76251
- const { handleGuardrailExplain } = await import("./guardrail-explain-5kzeem4m.js");
76338
+ const { handleGuardrailExplain } = await import("./guardrail-explain-kx9rem51.js");
76252
76339
  return handleGuardrailExplain(ctx.directory, ctx.args);
76253
76340
  },
76254
76341
  description: "Dry-run: show what the guardrails would do to a command or write target (executes nothing)",
@@ -76258,7 +76345,7 @@ var COMMAND_REGISTRY = {
76258
76345
  },
76259
76346
  "guardrail-reset": {
76260
76347
  handler: async (ctx) => {
76261
- const { handleGuardrailReset } = await import("./guardrail-reset-wzvtmpn2.js");
76348
+ const { handleGuardrailReset } = await import("./guardrail-reset-1mc3st34.js");
76262
76349
  return handleGuardrailReset(ctx.args, ctx.sessionID);
76263
76350
  },
76264
76351
  description: "Reset one exact active invocation/action circuit after repair",
@@ -76268,7 +76355,7 @@ var COMMAND_REGISTRY = {
76268
76355
  },
76269
76356
  "guardrail-log": {
76270
76357
  handler: async (ctx) => {
76271
- const { handleGuardrailLog } = await import("./guardrail-log-38jnajpa.js");
76358
+ const { handleGuardrailLog } = await import("./guardrail-log-zxzyx1de.js");
76272
76359
  return handleGuardrailLog(ctx.directory, ctx.args);
76273
76360
  },
76274
76361
  description: "Read the guardrail decision log (use --blocks-only for blocks)",
@@ -76503,7 +76590,7 @@ var COMMAND_REGISTRY = {
76503
76590
  deprecated: true
76504
76591
  },
76505
76592
  clear: {
76506
- handler: (ctx) => handleResetSessionCommand(ctx.directory, ctx.args),
76593
+ handler: (ctx) => handleResetSessionCommand(ctx.directory, ctx.args, ctx.sessionID),
76507
76594
  description: "Clear session state while preserving plan, evidence, and knowledge",
76508
76595
  category: "utility",
76509
76596
  aliasOf: "reset-session",
@@ -76918,9 +77005,9 @@ Subcommands:
76918
77005
  toolPolicy: "restricted"
76919
77006
  },
76920
77007
  "reset-session": {
76921
- handler: (ctx) => handleResetSessionCommand(ctx.directory, ctx.args),
77008
+ handler: (ctx) => handleResetSessionCommand(ctx.directory, ctx.args, ctx.sessionID),
76922
77009
  description: "Clear session state while preserving plan, evidence, and knowledge",
76923
- details: "Deletes only .swarm/session/state.json and any other session files. Clears in-memory agent sessions, delegation chains, and active-agent mappings. Preserves plan, evidence, and knowledge for cross-session continuity. Also recovers stale coder settlements, releasing in-flight ownership held by this process, so dispatches cannot stay wedged on CODER_DISPATCH_IN_PROGRESS (issue #2268). Before deleting, auto-backs up the session files it removes to .swarm/reset-backups/<timestamp>/ (newest 5 kept).",
77010
+ details: "Deletes only .swarm/session/state.json and other session files. Clears in-memory agent sessions, delegation chains, and active-agent mappings. Preserves plan, evidence, and knowledge. Also releases this session's pending knowledge-gate obligations (#2398) and recovers stale coder settlements so dispatches cannot wedge on CODER_DISPATCH_IN_PROGRESS (#2268). Auto-backs up removed files to .swarm/reset-backups/ (newest 5 kept).",
76924
77011
  args: "",
76925
77012
  category: "utility",
76926
77013
  toolPolicy: "restricted"
@@ -83084,7 +83171,7 @@ async function precreateStandardWorktreeSession(args) {
83084
83171
  const laneProfile = computeLaneRuntimeProfile(worktreeConfig.runtime_isolation, laneIndex, handle.worktreePath);
83085
83172
  if (laneProfile) {
83086
83173
  try {
83087
- const { writeLaneProfileToDiskReal } = await import("./core-qdmhh1kx.js");
83174
+ const { writeLaneProfileToDiskReal } = await import("./core-kmsm50zn.js");
83088
83175
  await writeLaneProfileToDiskReal(handle.worktreePath, laneProfile.laneIndex, laneProfile.envOverrides);
83089
83176
  } catch {}
83090
83177
  }
@@ -84009,7 +84096,7 @@ async function finishStandardWorktreeDispatch(directory, dispatch, config, callI
84009
84096
  }
84010
84097
  clearWorktreeMergeStatus(statusKey);
84011
84098
  try {
84012
- const { removeLaneProfileFromDiskReal } = await import("./core-qdmhh1kx.js");
84099
+ const { removeLaneProfileFromDiskReal } = await import("./core-kmsm50zn.js");
84013
84100
  await removeLaneProfileFromDiskReal(dispatch.handle.worktreePath, dispatch.laneIndex);
84014
84101
  } catch {}
84015
84102
  const state = serializationStateBySessionID.get(dispatch.parentSessionID);