opencode-swarm 7.188.7 → 7.188.9

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 (81) hide show
  1. package/binaries/win32-arm64/swarm-sandbox-runner.exe +0 -0
  2. package/binaries/win32-x64/swarm-sandbox-runner.exe +0 -0
  3. package/dist/cli/{auto-checkpoint-1z9d2jrk.js → auto-checkpoint-8hn7sczv.js} +4 -4
  4. package/dist/cli/{checkpoint-f8165pv4.js → checkpoint-zagm80g6.js} +8 -8
  5. package/dist/cli/{coder-settlement-gaby6spt.js → coder-settlement-ea9wk0fa.js} +3 -3
  6. package/dist/cli/{config-doctor-4wgw6nak.js → config-doctor-482f83pc.js} +7 -7
  7. package/dist/cli/{core-y89texpp.js → core-jev9px23.js} +1 -1
  8. package/dist/cli/{curator-drift-rpwrx355.js → curator-drift-tzr8cq9d.js} +5 -5
  9. package/dist/cli/{curator-llm-factory-1qbcj7vs.js → curator-llm-factory-vwxengt1.js} +26 -26
  10. package/dist/cli/{curator-tkz65fvw.js → curator-sw5w1yxn.js} +26 -26
  11. package/dist/cli/{dispatch-qvcztbpf.js → dispatch-h8m1jntz.js} +47 -220
  12. package/dist/cli/{doctor-knowledge-receipt-phase-id-11q7en6t.js → doctor-knowledge-receipt-phase-id-78hqh9ds.js} +4 -4
  13. package/dist/cli/{evidence-summary-service-hn7vdm45.js → evidence-summary-service-dpx7844s.js} +9 -9
  14. package/dist/cli/{gate-evidence-sxh3r64f.js → gate-evidence-v5fbpnfe.js} +2 -2
  15. package/dist/cli/{guardrail-explain-e0wbeyk1.js → guardrail-explain-020gkz5c.js} +27 -27
  16. package/dist/cli/{guardrail-log-gzrj46h0.js → guardrail-log-z14b98cn.js} +3 -3
  17. package/dist/cli/{guardrail-reset-7z62s1j5.js → guardrail-reset-cg6kfk8r.js} +26 -26
  18. package/dist/cli/{hive-promoter-88d95wk8.js → hive-promoter-bse7dh34.js} +26 -26
  19. package/dist/cli/{index-7eajwwfg.js → index-0dp2ak7d.js} +1 -1
  20. package/dist/cli/{index-snwj9ptc.js → index-0e49htcs.js} +1 -1
  21. package/dist/cli/{index-61kszszd.js → index-0whh6em0.js} +2 -2
  22. package/dist/cli/{index-7k9hdn0b.js → index-2mmbzyqb.js} +1 -1
  23. package/dist/cli/{index-y3sk68m5.js → index-4xc838p0.js} +1 -1
  24. package/dist/cli/{index-5102w44y.js → index-64e9z08z.js} +2 -2
  25. package/dist/cli/{index-0j5ggeem.js → index-6nx6qf7v.js} +1 -1
  26. package/dist/cli/{index-2wctq2hn.js → index-7jtxt3qp.js} +1 -1
  27. package/dist/cli/{index-m9g7s9ee.js → index-804rs273.js} +1 -1
  28. package/dist/cli/{index-c016phsk.js → index-akkskstq.js} +4 -4
  29. package/dist/cli/{index-yj1cwps4.js → index-b2g020d7.js} +1 -1
  30. package/dist/cli/{index-xj3k6x1h.js → index-b913b1yc.js} +1 -1
  31. package/dist/cli/{index-c937rpbm.js → index-byfk6w9a.js} +3 -3
  32. package/dist/cli/{index-ytms8x1h.js → index-bzeegaem.js} +2 -2
  33. package/dist/cli/{index-vx8a8w3b.js → index-c0tjwb5k.js} +496 -201
  34. package/dist/cli/{index-kap459mr.js → index-cxybg712.js} +2 -2
  35. package/dist/cli/{index-03ad14qc.js → index-d1z2yrwq.js} +2 -2
  36. package/dist/cli/{index-ffmw6af9.js → index-ddgmj923.js} +26 -26
  37. package/dist/cli/{index-g39cmzpj.js → index-dhkgby53.js} +2 -2
  38. package/dist/cli/{index-eh0sg1pz.js → index-g0we5tpv.js} +3 -3
  39. package/dist/cli/{index-ghjg1rxe.js → index-gd602ztc.js} +1 -1
  40. package/dist/cli/{index-9tes309n.js → index-hjyakvcq.js} +1 -1
  41. package/dist/cli/{index-rw0c6qtt.js → index-kjb143pz.js} +3 -3
  42. package/dist/cli/{index-a4s5yrdd.js → index-ng5n8tp0.js} +3 -3
  43. package/dist/cli/{index-2vtrjm19.js → index-peyrzden.js} +28 -28
  44. package/dist/cli/{index-7zyktm9f.js → index-ps6fyxfc.js} +5 -5
  45. package/dist/cli/{index-xsdphmet.js → index-q6y176gs.js} +6 -6
  46. package/dist/cli/{index-pnfd3s7s.js → index-qdp9ny78.js} +1 -1
  47. package/dist/cli/{index-emh69vk9.js → index-sndyex1t.js} +304 -166
  48. package/dist/cli/{index-8sqyx5rh.js → index-t6tew3pf.js} +1 -1
  49. package/dist/cli/{index-y8z9x87e.js → index-v71w06rr.js} +1 -1
  50. package/dist/cli/index.js +27 -27
  51. package/dist/cli/{knowledge-escalator-ejfb2e7c.js → knowledge-escalator-wah5yybk.js} +7 -7
  52. package/dist/cli/{knowledge-events-3fzfehwy.js → knowledge-events-akz8013r.js} +5 -5
  53. package/dist/cli/{knowledge-store-swxk4tr6.js → knowledge-store-hy12373e.js} +1 -1
  54. package/dist/cli/{knowledge-validator-0a1at9gm.js → knowledge-validator-yrqkdt1w.js} +2 -2
  55. package/dist/cli/{mcp-0ah7s1j0.js → mcp-0srnsd05.js} +1 -1
  56. package/dist/cli/{model-preflight-nfvapzyj.js → model-preflight-m3v8hn9k.js} +26 -26
  57. package/dist/cli/{pending-delegations-hynywgkj.js → pending-delegations-40txwk2h.js} +2 -2
  58. package/dist/cli/{pr-subscriptions-k86p5qcn.js → pr-subscriptions-w6n5s9c7.js} +1 -1
  59. package/dist/cli/{pr-workflow-gate-3ett6hjh.js → pr-workflow-gate-mx9t1p5j.js} +26 -26
  60. package/dist/cli/{scan-cursor-9961dhv1.js → scan-cursor-phbwfaya.js} +2 -2
  61. package/dist/cli/{schema-s5zbnzmv.js → schema-t1xwd728.js} +1 -1
  62. package/dist/cli/{scope-persistence-2w562h83.js → scope-persistence-m6qrwt3d.js} +5 -5
  63. package/dist/cli/{server-vrk0k61v.js → server-7pt2zhnc.js} +26 -26
  64. package/dist/cli/{skill-generator-bfcjzp20.js → skill-generator-pnv8efrw.js} +8 -8
  65. package/dist/cli/{snapshot-coordination-init-8ykpp5m6.js → snapshot-coordination-init-514wtctt.js} +26 -26
  66. package/dist/cli/{speckit-checkoff-3x52vw64.js → speckit-checkoff-beh1nw7v.js} +3 -3
  67. package/dist/cli/{worktree-collision-ownership-kjw1pqfc.js → worktree-collision-ownership-f5wca0gg.js} +2 -2
  68. package/dist/cli/{worktree-isolation-xdgm4ekx.js → worktree-isolation-bd6c5x8h.js} +26 -26
  69. package/dist/commands/recover.d.ts +1 -1
  70. package/dist/commands/registry.d.ts +1 -1
  71. package/dist/hooks/knowledge-receipt-ledger.d.ts +23 -0
  72. package/dist/hooks/knowledge-receipt-validator.d.ts +10 -0
  73. package/dist/index.js +213 -213
  74. package/dist/lang/backends/java.d.ts +39 -0
  75. package/dist/lang/default-backend.d.ts +15 -0
  76. package/dist/state.d.ts +48 -0
  77. package/dist/tools/test-runner.d.ts +31 -1
  78. package/dist/utils/windows-batch.d.ts +53 -0
  79. package/dist/workflow/session-view.d.ts +47 -0
  80. package/dist/workflow/stage-a-repair.d.ts +1 -0
  81. package/package.json +1 -1
@@ -8,14 +8,14 @@ import {
8
8
  protectedRoots,
9
9
  redactDecisionLineForArchive,
10
10
  stableCanonicalStringify
11
- } from "./index-7k9hdn0b.js";
11
+ } from "./index-2mmbzyqb.js";
12
12
  import {
13
13
  detectStraySwarmDirs,
14
14
  readDoctorArtifact,
15
15
  removeStraySwarmDir,
16
16
  resolvePlanParallelizationFlag,
17
17
  runConfigDoctor
18
- } from "./index-g39cmzpj.js";
18
+ } from "./index-dhkgby53.js";
19
19
  import {
20
20
  archiveEvidence,
21
21
  checkRequirementCoverage,
@@ -27,19 +27,26 @@ import {
27
27
  sanitizeTaskId,
28
28
  saveEvidence,
29
29
  validateProjectRoot
30
- } from "./index-y8z9x87e.js";
30
+ } from "./index-v71w06rr.js";
31
31
  import {
32
32
  JAVA_SYMBOL_GRAMMAR,
33
33
  LANGUAGE_REGISTRY,
34
+ WINDOWS_BATCH_WRAPPER_EXTENSIONS,
34
35
  _internals as _internals3,
35
36
  _internals1 as _internals4,
37
+ buildGradleTestCommand,
38
+ buildMavenTestCommand,
36
39
  buildNativeTargetCommand,
40
+ buildWindowsBatchCommand,
37
41
  getProfileForFile,
38
42
  isCommandAvailable,
43
+ isWindowsCommandInterpreterLaunch,
39
44
  maskCommentsAndLiterals,
40
45
  parseJavaImports,
41
- resolveLocalNodeTool
42
- } from "./index-vx8a8w3b.js";
46
+ resolveContainedWindowsBatchCommand,
47
+ resolveLocalNodeTool,
48
+ resolveMavenWrapperCommand
49
+ } from "./index-c0tjwb5k.js";
43
50
  import {
44
51
  captureWorkingTreeFingerprint,
45
52
  createModelEvaluationExecutor,
@@ -81,7 +88,7 @@ import {
81
88
  alreadyCuratedThisGeneration,
82
89
  claimNextScanBatch,
83
90
  resolveCohortId
84
- } from "./index-snwj9ptc.js";
91
+ } from "./index-0e49htcs.js";
85
92
  import {
86
93
  CURATOR_CONSOLIDATION_PROMPT,
87
94
  CURATOR_INIT_PROMPT,
@@ -100,13 +107,13 @@ import {
100
107
  getGroupCommitWriter,
101
108
  importLegacyJsonl,
102
109
  readPriorDriftReports
103
- } from "./index-pnfd3s7s.js";
110
+ } from "./index-qdp9ny78.js";
104
111
  import {
105
112
  assertNoUnsettledCoderDispatch,
106
113
  listCoderSettlementWalStates,
107
114
  recoverCoderSettlement,
108
115
  recoverStaleCoderSettlements
109
- } from "./index-rw0c6qtt.js";
116
+ } from "./index-kjb143pz.js";
110
117
  import {
111
118
  BUNDLED_PROJECT_SKILL_ROOT,
112
119
  DEFAULT_SKILL_MIN_CONFIDENCE,
@@ -127,11 +134,11 @@ import {
127
134
  retireSkill,
128
135
  selectCandidateEntries,
129
136
  syncBundledProjectSkillsIfMissingAsync
130
- } from "./index-c937rpbm.js";
137
+ } from "./index-byfk6w9a.js";
131
138
  import {
132
139
  buildEscalationBriefing,
133
140
  readRecentEscalations
134
- } from "./index-xsdphmet.js";
141
+ } from "./index-q6y176gs.js";
135
142
  import {
136
143
  parsePorcelainV2Snapshot,
137
144
  resolveCommitCountSince,
@@ -211,7 +218,7 @@ import {
211
218
  resolveWorkingDirectory,
212
219
  swarmOverwriteCandidates,
213
220
  trackedDirtyCandidates
214
- } from "./index-a4s5yrdd.js";
221
+ } from "./index-ng5n8tp0.js";
215
222
  import {
216
223
  MAX_TRANSIENT_RETRIES,
217
224
  PlanRecoverySupersededError,
@@ -238,7 +245,7 @@ import {
238
245
  transientBackoff,
239
246
  updateTaskStatus,
240
247
  withPlanLifecycleLock
241
- } from "./index-7zyktm9f.js";
248
+ } from "./index-ps6fyxfc.js";
242
249
  import {
243
250
  containsControlChars,
244
251
  containsPathTraversal,
@@ -254,7 +261,7 @@ import {
254
261
  resolveSpeckitProjection,
255
262
  validateSpeckit,
256
263
  writeProjectedSpecSync
257
- } from "./index-2wctq2hn.js";
264
+ } from "./index-7jtxt3qp.js";
258
265
  import {
259
266
  clearWorktreeMergeStatus,
260
267
  getAllWorktreeMergeFailures,
@@ -285,7 +292,7 @@ import {
285
292
  transitionTaskWorkflowEvidenceWithStatus,
286
293
  withTaskEvidenceTransaction,
287
294
  writeWorkflowWalFile
288
- } from "./index-8sqyx5rh.js";
295
+ } from "./index-t6tew3pf.js";
289
296
  import {
290
297
  isPathUnderSwarmWorktreeBase,
291
298
  listLiveLaneOwners,
@@ -294,7 +301,7 @@ import {
294
301
  recordLiveLaneOwner,
295
302
  removeWorktree,
296
303
  resolveWorktreeBaseDir
297
- } from "./index-xj3k6x1h.js";
304
+ } from "./index-b913b1yc.js";
298
305
  import {
299
306
  DEFAULT_STALE_DELEGATION_TIMEOUT_MS,
300
307
  DELEGATION_COMPACTION_HIGH_WATER_BYTES,
@@ -328,7 +335,7 @@ import {
328
335
  scanBackgroundCoderReservationsForAdmission,
329
336
  scanDelegationsForRecovery,
330
337
  sweepStaleDelegations
331
- } from "./index-7eajwwfg.js";
338
+ } from "./index-0dp2ak7d.js";
332
339
  import {
333
340
  MAX_EVENT_LOG_ENTRIES,
334
341
  _internals,
@@ -340,7 +347,7 @@ import {
340
347
  recordHiveKnowledgeEvent,
341
348
  recordKnowledgeEvent,
342
349
  resolveKnowledgeEventsPath
343
- } from "./index-kap459mr.js";
350
+ } from "./index-cxybg712.js";
344
351
  import {
345
352
  commitDisplayedMembership,
346
353
  commitEmptyRetrieval,
@@ -353,7 +360,7 @@ import {
353
360
  queryLiveMemberships,
354
361
  reconcilePhaseClose,
355
362
  recordPhaseCloseIntent
356
- } from "./index-61kszszd.js";
363
+ } from "./index-0whh6em0.js";
357
364
  import {
358
365
  sanitizeContextText
359
366
  } from "./index-m9zzj4ee.js";
@@ -384,7 +391,7 @@ import {
384
391
  validateActionableFields,
385
392
  validateLesson,
386
393
  validateSkillPath
387
- } from "./index-m9g7s9ee.js";
394
+ } from "./index-804rs273.js";
388
395
  import {
389
396
  MAX_CURATION_PROPOSALS,
390
397
  authorizeCuration,
@@ -395,7 +402,7 @@ import {
395
402
  } from "./index-rtry5xyf.js";
396
403
  import {
397
404
  resolveWorktreeIsolationConfig
398
- } from "./index-5102w44y.js";
405
+ } from "./index-64e9z08z.js";
399
406
  import {
400
407
  RetrospectiveEvidenceSchema
401
408
  } from "./index-kbkk7vnh.js";
@@ -407,7 +414,7 @@ import {
407
414
  clearScopeBindings,
408
415
  readAuthoritativeScopeBindingSet,
409
416
  readDeclaredScopeFilesFromBindings
410
- } from "./index-y3sk68m5.js";
417
+ } from "./index-4xc838p0.js";
411
418
  import {
412
419
  clearPlanLedgerForReset,
413
420
  computePlanStructureHash,
@@ -423,7 +430,7 @@ import {
423
430
  replayFromLedgerWithStatus,
424
431
  resolvePlanningProfile,
425
432
  takeSnapshotEvent
426
- } from "./index-ytms8x1h.js";
433
+ } from "./index-bzeegaem.js";
427
434
  import {
428
435
  CORE_EVENT_LOCKED,
429
436
  appendCoreEventSync,
@@ -512,7 +519,7 @@ import {
512
519
  transactFile,
513
520
  transactKnowledge,
514
521
  wordBigrams
515
- } from "./index-c016phsk.js";
522
+ } from "./index-akkskstq.js";
516
523
  import {
517
524
  readTailJsonl,
518
525
  readTailJsonlDetailed,
@@ -593,7 +600,7 @@ import {
593
600
  loadGateOverrides,
594
601
  loadPluginConfig,
595
602
  loadPluginConfigWithMeta
596
- } from "./index-9tes309n.js";
603
+ } from "./index-hjyakvcq.js";
597
604
  import {
598
605
  addDeferredWarning,
599
606
  advisoryWarn,
@@ -625,7 +632,7 @@ import {
625
632
  resolveContextWindow,
626
633
  resolveGeneratedAgentRole,
627
634
  stripKnownSwarmPrefix
628
- } from "./index-ghjg1rxe.js";
635
+ } from "./index-gd602ztc.js";
629
636
  import {
630
637
  AGENT_TOOL_MAP,
631
638
  ALL_AGENT_NAMES,
@@ -3414,7 +3421,7 @@ async function importLegacyPrWorkflowGateStateIfNeeded(directory, sessionID, all
3414
3421
  return null;
3415
3422
  throw error2;
3416
3423
  }
3417
- const legacy = allowSalvagedImport ? (await (await import("./pr-workflow-gate-3ett6hjh.js")).readPrWorkflowGateStateForRecovery(directory, sessionID))?.state ?? null : await readPrWorkflowGateStateFileFromDisk(filePath, sessionID);
3424
+ const legacy = allowSalvagedImport ? (await (await import("./pr-workflow-gate-mx9t1p5j.js")).readPrWorkflowGateStateForRecovery(directory, sessionID))?.state ?? null : await readPrWorkflowGateStateFileFromDisk(filePath, sessionID);
3418
3425
  if (!legacy)
3419
3426
  return null;
3420
3427
  const namespace = workflowGateStateCoordinationNamespace(sessionID);
@@ -3501,7 +3508,7 @@ async function deleteStateWhileLocked(directory, sessionID, options = {}) {
3501
3508
  let recoveryState = null;
3502
3509
  if (!currentAuthoritative) {
3503
3510
  if (options.allowSalvagedRead) {
3504
- const { readPrWorkflowGateStateForRecovery } = await import("./pr-workflow-gate-3ett6hjh.js");
3511
+ const { readPrWorkflowGateStateForRecovery } = await import("./pr-workflow-gate-mx9t1p5j.js");
3505
3512
  recoveryState = (await readPrWorkflowGateStateForRecovery(directory, normalizedSessionID))?.state ?? null;
3506
3513
  }
3507
3514
  if (!recoveryState) {
@@ -15074,7 +15081,7 @@ function isLaneOwnedByCurrentSession(branchName, expectedSessionId) {
15074
15081
  return extracted === expectedSessionId;
15075
15082
  }
15076
15083
  async function inspectStandardWorktreeCollisionOwnership(identity) {
15077
- const collisionOwnership = await import("./worktree-collision-ownership-kjw1pqfc.js");
15084
+ const collisionOwnership = await import("./worktree-collision-ownership-f5wca0gg.js");
15078
15085
  return collisionOwnership.inspectStandardWorktreeCollisionOwnership(identity);
15079
15086
  }
15080
15087
  async function runRecoveryGit(directory, args, timeoutMs = 15000) {
@@ -15500,7 +15507,7 @@ async function precreateStandardWorktreeSession(args) {
15500
15507
  const laneProfile = computeLaneRuntimeProfile(worktreeConfig.runtime_isolation, laneIndex, handle.worktreePath);
15501
15508
  if (laneProfile) {
15502
15509
  try {
15503
- const { writeLaneProfileToDiskReal } = await import("./core-y89texpp.js");
15510
+ const { writeLaneProfileToDiskReal } = await import("./core-jev9px23.js");
15504
15511
  await writeLaneProfileToDiskReal(handle.worktreePath, laneProfile.laneIndex, laneProfile.envOverrides);
15505
15512
  } catch {}
15506
15513
  }
@@ -16479,7 +16486,7 @@ async function finishStandardWorktreeDispatch(directory, dispatch, config, callI
16479
16486
  }
16480
16487
  clearWorktreeMergeStatus(statusKey);
16481
16488
  try {
16482
- const { removeLaneProfileFromDiskReal } = await import("./core-y89texpp.js");
16489
+ const { removeLaneProfileFromDiskReal } = await import("./core-jev9px23.js");
16483
16490
  await removeLaneProfileFromDiskReal(dispatch.handle.worktreePath, dispatch.laneIndex);
16484
16491
  } catch {}
16485
16492
  const state = serializationStateBySessionID.get(dispatch.parentSessionID);
@@ -22923,6 +22930,8 @@ var swarmState = {
22923
22930
  finalPromptPressureBySession: new Map,
22924
22931
  finalAccountingWarningBandsBySession: new Map,
22925
22932
  liveContextWindows: new Map,
22933
+ dispatchParentByChildSession: new Map,
22934
+ pendingDispatchAuthorizations: [],
22926
22935
  agentSessions: defaultRunContext.agentSessions,
22927
22936
  pendingRehydrations: new Set,
22928
22937
  fullAutoEnabledInConfig: false,
@@ -22956,6 +22965,8 @@ function resetSwarmState() {
22956
22965
  swarmState.knowledgeAckDedup.clear();
22957
22966
  swarmState.gateDenialCounts.clear();
22958
22967
  swarmState.generatedAgentNames = [];
22968
+ swarmState.dispatchParentByChildSession.clear();
22969
+ swarmState.pendingDispatchAuthorizations = [];
22959
22970
  clearHydrationOwnershipState();
22960
22971
  swarmState.fullAutoEnabledInConfig = false;
22961
22972
  swarmState.environmentProfiles.clear();
@@ -22995,6 +23006,55 @@ function resetSwarmStatePreservingSingletons() {
22995
23006
  }
22996
23007
  var STALE_SESSION_TTL_MS = 7200000;
22997
23008
  var REVIEWER_SCOPE_GENERATION_TTL_MS = STALE_SESSION_TTL_MS;
23009
+ var MAX_TRACKED_DISPATCH_PARENTS = 200;
23010
+ var PENDING_DISPATCH_AUTHORIZATION_TTL_MS = 600000;
23011
+ function pruneExpiredPendingDispatchAuthorizations(now) {
23012
+ const pendings = swarmState.pendingDispatchAuthorizations;
23013
+ if (pendings.length === 0)
23014
+ return;
23015
+ const alive = pendings.filter((pending) => now - pending.recordedAt <= PENDING_DISPATCH_AUTHORIZATION_TTL_MS);
23016
+ if (alive.length !== pendings.length) {
23017
+ swarmState.pendingDispatchAuthorizations = alive;
23018
+ }
23019
+ }
23020
+ function setDispatchParentEntry(childSessionId, parentSessionId) {
23021
+ if (!childSessionId || !parentSessionId)
23022
+ return;
23023
+ swarmState.dispatchParentByChildSession.delete(childSessionId);
23024
+ swarmState.dispatchParentByChildSession.set(childSessionId, parentSessionId);
23025
+ if (swarmState.dispatchParentByChildSession.size > MAX_TRACKED_DISPATCH_PARENTS) {
23026
+ const oldestKey = swarmState.dispatchParentByChildSession.keys().next().value;
23027
+ if (oldestKey !== undefined) {
23028
+ swarmState.dispatchParentByChildSession.delete(oldestKey);
23029
+ }
23030
+ }
23031
+ }
23032
+ function adoptPendingDispatchAuthorization(newSessionId, agentName) {
23033
+ if (swarmState.dispatchParentByChildSession.has(newSessionId))
23034
+ return;
23035
+ const normalizedRole = stripKnownSwarmPrefix(agentName).toLowerCase();
23036
+ if (!normalizedRole)
23037
+ return;
23038
+ const now = Date.now();
23039
+ pruneExpiredPendingDispatchAuthorizations(now);
23040
+ const pendings = swarmState.pendingDispatchAuthorizations;
23041
+ const matchIndex = pendings.findIndex((pending) => pending.agentName === normalizedRole);
23042
+ if (matchIndex < 0)
23043
+ return;
23044
+ const [adopted] = pendings.splice(matchIndex, 1);
23045
+ if (!adopted)
23046
+ return;
23047
+ setDispatchParentEntry(newSessionId, adopted.parentSessionId);
23048
+ }
23049
+ function clearDispatchLineageForSession(sessionId) {
23050
+ swarmState.dispatchParentByChildSession.delete(sessionId);
23051
+ for (const [child, parent] of swarmState.dispatchParentByChildSession) {
23052
+ if (parent === sessionId) {
23053
+ swarmState.dispatchParentByChildSession.delete(child);
23054
+ }
23055
+ }
23056
+ swarmState.pendingDispatchAuthorizations = swarmState.pendingDispatchAuthorizations.filter((pending) => pending.parentSessionId !== sessionId);
23057
+ }
22998
23058
  function ensureReviewerScopeGenerationState(session) {
22999
23059
  session.reviewerScopeGenerations ??= new Map;
23000
23060
  session.reviewerScopeGenerationCounter ??= 0;
@@ -23105,6 +23165,7 @@ function sweepStaleSessions(staleDurationMs = STALE_SESSION_TTL_MS, now = Date.n
23105
23165
  releaseSnapshotSessionOwnership(id);
23106
23166
  swarmState.agentSessions.delete(id);
23107
23167
  swarmState.delegationChains.delete(id);
23168
+ clearDispatchLineageForSession(id);
23108
23169
  swarmState.activeAgent.delete(id);
23109
23170
  }
23110
23171
  return staleIds;
@@ -23275,6 +23336,7 @@ function endAgentSession(sessionId, directory) {
23275
23336
  swarmState.agentSessions.delete(sessionId);
23276
23337
  swarmState.activeAgent.delete(sessionId);
23277
23338
  swarmState.delegationChains.delete(sessionId);
23339
+ clearDispatchLineageForSession(sessionId);
23278
23340
  clearRealtimeLearningNudgeSession(sessionId);
23279
23341
  resetSessionQueue(sessionId);
23280
23342
  resetPrmPatternSupport(sessionId);
@@ -23503,6 +23565,9 @@ function ensureAgentSession(sessionId, agentName, directory) {
23503
23565
  if (!session) {
23504
23566
  throw new Error(`Failed to create guardrail session for ${sessionId}`);
23505
23567
  }
23568
+ if (agentName && agentName !== "unknown") {
23569
+ adoptPendingDispatchAuthorization(sessionId, agentName);
23570
+ }
23506
23571
  return session;
23507
23572
  }
23508
23573
  function recordSessionWorkspaceRoot(sessionId, laneRoot) {
@@ -24059,7 +24124,7 @@ function clearCriticalShownIds(sessionID) {
24059
24124
  async function rehydratePrSubscriptions(sessionID, directory) {
24060
24125
  const map = new Map;
24061
24126
  try {
24062
- const { listActive: listActive2 } = await import("./pr-subscriptions-k86p5qcn.js");
24127
+ const { listActive: listActive2 } = await import("./pr-subscriptions-w6n5s9c7.js");
24063
24128
  const records = await listActive2(directory);
24064
24129
  for (const record of records) {
24065
24130
  if (record.sessionID !== sessionID)
@@ -40606,9 +40671,9 @@ function hashContent(content) {
40606
40671
  return createHash27("sha1").update(content).digest("hex");
40607
40672
  }
40608
40673
  async function loadConfigForPolicyCurator(directory) {
40609
- const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-s5zbnzmv.js");
40674
+ const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-t1xwd728.js");
40610
40675
  try {
40611
- const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-eh0sg1pz.js");
40676
+ const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-g0we5tpv.js");
40612
40677
  const { config: loadedConfig } = loadPluginConfigWithMeta2(directory);
40613
40678
  return KnowledgeConfigSchema2.parse(loadedConfig.knowledge ?? {});
40614
40679
  } catch {
@@ -43666,7 +43731,7 @@ async function resolveCuratorLLMDelegate(directory, mode, sessionId) {
43666
43731
  const seam = _internals38.createCuratorLLMDelegate;
43667
43732
  if (seam)
43668
43733
  return seam(directory, mode, sessionId);
43669
- const { createCuratorLLMDelegate } = await import("./curator-llm-factory-1qbcj7vs.js");
43734
+ const { createCuratorLLMDelegate } = await import("./curator-llm-factory-vwxengt1.js");
43670
43735
  return createCuratorLLMDelegate(directory, mode, sessionId);
43671
43736
  }
43672
43737
  async function reconcileCloseTerminalStateForPlan(directory, targetPlan, options) {
@@ -44061,7 +44126,7 @@ async function runFinalizeStage(ctx) {
44061
44126
  }
44062
44127
  }
44063
44128
  try {
44064
- const { CuratorConfigSchema: CCS } = await import("./schema-s5zbnzmv.js");
44129
+ const { CuratorConfigSchema: CCS } = await import("./schema-t1xwd728.js");
44065
44130
  const { config: pmLoadedConfig } = _internals38.loadPluginConfigWithMeta(ctx.directory);
44066
44131
  const curatorCfg = CCS.parse(pmLoadedConfig.curator ?? {});
44067
44132
  if (curatorCfg.enabled && curatorCfg.postmortem_enabled) {
@@ -46298,7 +46363,7 @@ function serializeAgentSession(s) {
46298
46363
  }
46299
46364
  async function writeSnapshot(directory, state) {
46300
46365
  try {
46301
- const { ensureSnapshotCoordinationReady } = await import("./snapshot-coordination-init-8ykpp5m6.js");
46366
+ const { ensureSnapshotCoordinationReady } = await import("./snapshot-coordination-init-514wtctt.js");
46302
46367
  await ensureSnapshotCoordinationReady(directory);
46303
46368
  const snapshot = {
46304
46369
  version: 3,
@@ -49308,7 +49373,7 @@ function planMerges(active, threshold, maxComparisons, maxMerges) {
49308
49373
  };
49309
49374
  }
49310
49375
  async function sweepActiveNearDuplicates(directory, options = {}) {
49311
- const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-eh0sg1pz.js");
49376
+ const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-g0we5tpv.js");
49312
49377
  const { config } = loadPluginConfigWithMeta2(directory);
49313
49378
  const sweepConfig = config.learning?.dedup_sweep;
49314
49379
  if (sweepConfig?.enabled === false)
@@ -50432,7 +50497,7 @@ async function runCuratorPhase(directory, phase, agentsDispatched, config, knowl
50432
50497
  }
50433
50498
  if (config.skill_generation_enabled === true && skillCandidates.length > 0) {
50434
50499
  try {
50435
- const skillModule = await import("./skill-generator-bfcjzp20.js");
50500
+ const skillModule = await import("./skill-generator-pnv8efrw.js");
50436
50501
  for (const cand of skillCandidates) {
50437
50502
  if (cand.confidence < (config.min_skill_confidence ?? DEFAULT_SKILL_MIN_CONFIDENCE)) {
50438
50503
  continue;
@@ -50904,7 +50969,7 @@ async function applyCuratorKnowledgeUpdates(directory, recommendations, knowledg
50904
50969
  } catch {}
50905
50970
  }
50906
50971
  if (contradictedEntries.length > 0 && knowledgeConfig.contradiction_threshold_action === "quarantine") {
50907
- const { maybeQuarantineOnContradiction } = await import("./knowledge-escalator-ejfb2e7c.js");
50972
+ const { maybeQuarantineOnContradiction } = await import("./knowledge-escalator-wah5yybk.js");
50908
50973
  for (const { id } of contradictedEntries) {
50909
50974
  try {
50910
50975
  await maybeQuarantineOnContradiction(directory, id, knowledgeConfig.contradiction_quarantine_threshold, knowledgeConfig.contradiction_quarantine_window_days);
@@ -51736,7 +51801,7 @@ async function runCuratorPostMortem(directory, options = {}) {
51736
51801
  warnings.push("Failed to collect knowledge summary.");
51737
51802
  }
51738
51803
  try {
51739
- const { getScanStatus } = await import("./scan-cursor-9961dhv1.js");
51804
+ const { getScanStatus } = await import("./scan-cursor-phbwfaya.js");
51740
51805
  const scanStatus = await getScanStatus(directory);
51741
51806
  if (scanStatus.remaining_estimate > 0) {
51742
51807
  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.`);
@@ -51908,9 +51973,9 @@ var _internals56 = {
51908
51973
  verifyPostMortemKnowledgeActions,
51909
51974
  repairPostMortemActions,
51910
51975
  loadDefaultKnowledgeConfig: async (directory) => {
51911
- const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-s5zbnzmv.js");
51976
+ const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-t1xwd728.js");
51912
51977
  try {
51913
- const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-eh0sg1pz.js");
51978
+ const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-g0we5tpv.js");
51914
51979
  const loaded = loadPluginConfigWithMeta2(directory);
51915
51980
  return KnowledgeConfigSchema2.parse(loaded.config.knowledge ?? {});
51916
51981
  } catch {
@@ -51918,11 +51983,11 @@ var _internals56 = {
51918
51983
  }
51919
51984
  },
51920
51985
  applyCuratorKnowledgeUpdates: async (directory, recommendations, knowledgeConfig, generation) => {
51921
- const { applyCuratorKnowledgeUpdates: applyCuratorKnowledgeUpdates2 } = await import("./curator-tkz65fvw.js");
51986
+ const { applyCuratorKnowledgeUpdates: applyCuratorKnowledgeUpdates2 } = await import("./curator-sw5w1yxn.js");
51922
51987
  return applyCuratorKnowledgeUpdates2(directory, recommendations, knowledgeConfig, generation);
51923
51988
  },
51924
51989
  checkHivePromotions: async (entries2, knowledgeConfig, directory) => {
51925
- const { checkHivePromotions } = await import("./hive-promoter-88d95wk8.js");
51990
+ const { checkHivePromotions } = await import("./hive-promoter-bse7dh34.js");
51926
51991
  return checkHivePromotions(entries2, knowledgeConfig, directory);
51927
51992
  },
51928
51993
  applyProposalTriage: async (directory, triage) => {
@@ -51931,7 +51996,7 @@ var _internals56 = {
51931
51996
  activateProposal,
51932
51997
  listSkills: listSkills2,
51933
51998
  sanitizeSlug
51934
- } = await import("./skill-generator-bfcjzp20.js");
51999
+ } = await import("./skill-generator-pnv8efrw.js");
51935
52000
  const result = {
51936
52001
  approved: [],
51937
52002
  rejected: [],
@@ -51973,7 +52038,7 @@ var _internals56 = {
51973
52038
  return result;
51974
52039
  },
51975
52040
  readPriorDriftReports: async (directory) => {
51976
- const { readPriorDriftReports: readPriorDriftReports2 } = await import("./curator-drift-rpwrx355.js");
52041
+ const { readPriorDriftReports: readPriorDriftReports2 } = await import("./curator-drift-tzr8cq9d.js");
51977
52042
  return readPriorDriftReports2(directory);
51978
52043
  },
51979
52044
  readSwarmKnowledge: (directory) => readKnowledge(resolveSwarmKnowledgePath(directory))
@@ -61776,9 +61841,9 @@ var _internals66 = {
61776
61841
  loadPluginConfigWithMeta,
61777
61842
  loadCuratorDeps: async () => {
61778
61843
  const [{ CuratorConfigSchema }, curator, { createCuratorLLMDelegate }] = await Promise.all([
61779
- import("./schema-s5zbnzmv.js"),
61780
- import("./curator-tkz65fvw.js"),
61781
- import("./curator-llm-factory-1qbcj7vs.js")
61844
+ import("./schema-t1xwd728.js"),
61845
+ import("./curator-sw5w1yxn.js"),
61846
+ import("./curator-llm-factory-vwxengt1.js")
61782
61847
  ]);
61783
61848
  return { CuratorConfigSchema, curator, createCuratorLLMDelegate };
61784
61849
  }
@@ -63464,6 +63529,33 @@ import { readdir as readdir5 } from "fs/promises";
63464
63529
  init_path_identity();
63465
63530
  init_logger();
63466
63531
 
63532
+ // src/workflow/session-view.ts
63533
+ function applySessionWorkflowView(session, taskId, workflow) {
63534
+ session.taskWorkflowStates.set(taskId, workflow.state);
63535
+ session.stageBCompletion?.delete(taskId);
63536
+ session.taskCouncilApproved?.delete(taskId);
63537
+ session.taskCouncilWorkflowGeneration?.delete(taskId);
63538
+ updateTaskWorkflowCache(session, taskId, workflow);
63539
+ }
63540
+ var STAGE_A_RECOVERED_STATES = [
63541
+ "pre_check_passed",
63542
+ "reviewer_run",
63543
+ "tests_run"
63544
+ ];
63545
+ function isStageARecoveredState(state) {
63546
+ return STAGE_A_RECOVERED_STATES.includes(state);
63547
+ }
63548
+ function shouldRefreshStageARecoveryView(view, recoveredState) {
63549
+ if (view === undefined)
63550
+ return true;
63551
+ if (view === "rework_required" || view === "blocked")
63552
+ return true;
63553
+ if (view === "tests_run" || view === "closed" || view === "complete") {
63554
+ return false;
63555
+ }
63556
+ return compareTaskWorkflowStateRank(recoveredState, view) > 0;
63557
+ }
63558
+
63467
63559
  // src/workflow/task-recovery-status.ts
63468
63560
  init_path_identity();
63469
63561
  function identitySuffix(status) {
@@ -63765,6 +63857,7 @@ async function scanWedgedStageA(directory, options) {
63765
63857
  }
63766
63858
  async function repairWedgedStageA(directory, options) {
63767
63859
  const requested = options?.taskIds;
63860
+ const refreshSession = options?.sessionId ? getAgentSession(options.sessionId) : undefined;
63768
63861
  const { selected, truncated } = await enumerateStageACandidates(directory, requested);
63769
63862
  const { states: walStates } = await listCoderSettlementWalStates(directory);
63770
63863
  const results = [];
@@ -63772,6 +63865,12 @@ async function repairWedgedStageA(directory, options) {
63772
63865
  try {
63773
63866
  const scan = await scanStageATask(directory, taskId, walStates);
63774
63867
  if (scan.kind === "not_wedged") {
63868
+ if (refreshSession && isStageARecoveredState(scan.state)) {
63869
+ const snapshot = getTaskWorkflowSnapshot(await readTaskEvidence(directory, taskId));
63870
+ if (snapshot.authoritative && isStageARecoveredState(snapshot.state) && shouldRefreshStageARecoveryView(refreshSession.taskWorkflowStates.get(taskId), snapshot.state)) {
63871
+ applySessionWorkflowView(refreshSession, taskId, snapshot);
63872
+ }
63873
+ }
63775
63874
  results.push({
63776
63875
  taskId,
63777
63876
  outcome: "skipped_not_wedged",
@@ -63788,12 +63887,18 @@ async function repairWedgedStageA(directory, options) {
63788
63887
  continue;
63789
63888
  }
63790
63889
  const transitionId = `stage-a-repair:${taskId}:${scan.generation}`;
63791
- const { duplicated } = await transitionTaskWorkflowEvidenceWithStatus(directory, taskId, {
63890
+ const { evidence: updatedEvidence, duplicated } = await transitionTaskWorkflowEvidenceWithStatus(directory, taskId, {
63792
63891
  type: "stage_a_passed",
63793
63892
  ...scan.mode === "settlement_wedge" ? { settlementRecovery: true } : {},
63794
63893
  expectedGeneration: scan.generation,
63795
63894
  transitionId
63796
63895
  });
63896
+ if (refreshSession) {
63897
+ const snapshot = getTaskWorkflowSnapshot(updatedEvidence);
63898
+ if (isStageARecoveredState(snapshot.state) && shouldRefreshStageARecoveryView(refreshSession.taskWorkflowStates.get(taskId), snapshot.state)) {
63899
+ applySessionWorkflowView(refreshSession, taskId, snapshot);
63900
+ }
63901
+ }
63797
63902
  if (!duplicated) {
63798
63903
  await appendStageARepairEvent(directory, {
63799
63904
  action: "repaired",
@@ -64176,7 +64281,7 @@ async function computeCurationDiagnostics(directory, entries2) {
64176
64281
  let scanCompleted = false;
64177
64282
  let scanRemaining = 0;
64178
64283
  try {
64179
- const { getScanStatus } = await import("./scan-cursor-9961dhv1.js");
64284
+ const { getScanStatus } = await import("./scan-cursor-phbwfaya.js");
64180
64285
  const status = await getScanStatus(directory);
64181
64286
  scanGeneration = status.generation;
64182
64287
  scanCompleted = status.completed;
@@ -64186,10 +64291,10 @@ async function computeCurationDiagnostics(directory, entries2) {
64186
64291
  try {
64187
64292
  const { isLinked: isLinked2 } = await import("./knowledge-link-h4pdcnya.js");
64188
64293
  if (isLinked2(directory)) {
64189
- const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-s5zbnzmv.js");
64294
+ const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-t1xwd728.js");
64190
64295
  let config;
64191
64296
  try {
64192
- const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-eh0sg1pz.js");
64297
+ const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-g0we5tpv.js");
64193
64298
  const loaded = loadPluginConfigWithMeta2(directory);
64194
64299
  config = KnowledgeConfigSchema2.parse(loaded.config.knowledge ?? {});
64195
64300
  } catch {
@@ -65645,7 +65750,7 @@ async function handleDoctorCommand(directory, args) {
65645
65750
  const result = runConfigDoctor(config, directory, planParallelizationEnabled);
65646
65751
  let output;
65647
65752
  if (enableAutoFix && result.hasAutoFixableIssues) {
65648
- const { runConfigDoctorWithFixes } = await import("./config-doctor-4wgw6nak.js");
65753
+ const { runConfigDoctorWithFixes } = await import("./config-doctor-482f83pc.js");
65649
65754
  const fixResult = await runConfigDoctorWithFixes(directory, config, true, {
65650
65755
  applyLossy: true
65651
65756
  });
@@ -65683,7 +65788,7 @@ async function handleDoctorCommand(directory, args) {
65683
65788
  `;
65684
65789
  }
65685
65790
  try {
65686
- const { runModelPreflight } = await import("./model-preflight-nfvapzyj.js");
65791
+ const { runModelPreflight } = await import("./model-preflight-m3v8hn9k.js");
65687
65792
  const preflight = await runModelPreflight(config, swarmState.opencodeClient, { generatedAgentNames: swarmState.generatedAgentNames });
65688
65793
  const missingSelection = preflight.resolutions.filter((resolution) => resolution.status === "missing-selection");
65689
65794
  const unresolved = preflight.catalogAvailable ? preflight.resolutions.filter((resolution) => resolution.status === "unresolved") : [];
@@ -65717,7 +65822,7 @@ async function handleDoctorCommand(directory, args) {
65717
65822
  }
65718
65823
  } catch {}
65719
65824
  try {
65720
- const { renderKnowledgeReceiptPhaseIdSection } = await import("./doctor-knowledge-receipt-phase-id-11q7en6t.js");
65825
+ const { renderKnowledgeReceiptPhaseIdSection } = await import("./doctor-knowledge-receipt-phase-id-78hqh9ds.js");
65721
65826
  output += await renderKnowledgeReceiptPhaseIdSection(directory, enableAutoFix);
65722
65827
  } catch {}
65723
65828
  const strayDirs = detectStraySwarmDirs(directory);
@@ -66614,7 +66719,7 @@ async function handleEvidenceCommand(directory, args) {
66614
66719
  return formatTaskEvidenceMarkdown(evidenceData);
66615
66720
  }
66616
66721
  async function handleEvidenceSummaryCommand(directory) {
66617
- const { buildEvidenceSummary } = await import("./evidence-summary-service-hn7vdm45.js");
66722
+ const { buildEvidenceSummary } = await import("./evidence-summary-service-dpx7844s.js");
66618
66723
  const artifact = await buildEvidenceSummary(directory);
66619
66724
  if (!artifact) {
66620
66725
  return "No plan found. Run `/swarm plan` to check plan status.";
@@ -91061,7 +91166,7 @@ function createCuratorLLMDelegate(directory, mode = "init", sessionId) {
91061
91166
  }
91062
91167
  const sdkOpts = signal ? { signal } : {};
91063
91168
  try {
91064
- const { getSwarmAgents: getSwarmAgents2, resolveFallbackModel: resolveFallbackModel2 } = await import("./index-ffmw6af9.js");
91169
+ const { getSwarmAgents: getSwarmAgents2, resolveFallbackModel: resolveFallbackModel2 } = await import("./index-ddgmj923.js");
91065
91170
  const createResult = await client.session.create({
91066
91171
  ...sessionId ? {
91067
91172
  body: {
@@ -93398,7 +93503,7 @@ async function cancelPrFeedbackLoopUnlocked(directory, sessionID, reason) {
93398
93503
  clearedEvents: []
93399
93504
  };
93400
93505
  try {
93401
- const { cancelPrFeedbackPublication: cancelPrFeedbackPublication2 } = await import("./pr-workflow-gate-3ett6hjh.js");
93506
+ const { cancelPrFeedbackPublication: cancelPrFeedbackPublication2 } = await import("./pr-workflow-gate-mx9t1p5j.js");
93402
93507
  await cancelPrFeedbackPublication2(directory, sessionID, reason);
93403
93508
  } catch (err) {
93404
93509
  warn(`[pr-feedback-loop] cancelPrFeedbackPublication failed (fail-open): ${err instanceof Error ? err.message : String(err)}`);
@@ -94699,8 +94804,12 @@ var BIN_DIRECTORY = ".bin";
94699
94804
  var MAX_PACKAGE_MANIFEST_BYTES = 256 * 1024;
94700
94805
  var MAX_PATH_SHIM_BYTES = 64 * 1024;
94701
94806
  var UNSAFE_SHELL_WRAPPER_EXTENSIONS = new Set([".bat", ".cmd", ".ps1"]);
94702
- var WINDOWS_BATCH_WRAPPER_EXTENSIONS = [".cmd", ".bat"];
94703
- var WINDOWS_CMD_UNSAFE_TOKEN = /["%!^&|<>\r\n]/;
94807
+ var lintWindowsBatchDeps = {
94808
+ platform: () => _internals106.platform(),
94809
+ comSpec: () => _internals106.comSpec(),
94810
+ realpathSync: (candidate2) => _internals106.realpathSync(candidate2),
94811
+ statSync: (candidate2) => _internals106.statSync(candidate2)
94812
+ };
94704
94813
  var LINTER_PACKAGES = {
94705
94814
  biome: "@biomejs/biome",
94706
94815
  eslint: "eslint"
@@ -95126,62 +95235,17 @@ function resolveAdditionalExecutable(name) {
95126
95235
  }
95127
95236
  return resolveExecutableFromPath([`${name}.exe`], _internals106.pathEnv(), platform);
95128
95237
  }
95129
- function resolveWindowsCommandInterpreter() {
95130
- const candidate2 = _internals106.comSpec();
95131
- if (!candidate2 || !path128.isAbsolute(candidate2) || path128.basename(candidate2).toLowerCase() !== "cmd.exe" || !isRegularFile(candidate2)) {
95132
- return null;
95133
- }
95134
- try {
95135
- const canonical = _internals106.realpathSync(candidate2);
95136
- return path128.basename(canonical).toLowerCase() === "cmd.exe" ? canonical : null;
95137
- } catch {
95138
- return null;
95139
- }
95140
- }
95141
- function buildWindowsBatchCommand(wrapperPath, args) {
95142
- const interpreter = resolveWindowsCommandInterpreter();
95143
- if (!interpreter)
95144
- return null;
95145
- let canonicalWrapper;
95146
- try {
95147
- canonicalWrapper = _internals106.realpathSync(wrapperPath);
95148
- } catch {
95149
- return null;
95150
- }
95151
- if (!isRegularFile(canonicalWrapper) || !WINDOWS_BATCH_WRAPPER_EXTENSIONS.includes(path128.extname(canonicalWrapper).toLowerCase())) {
95152
- return null;
95153
- }
95154
- const tokens = [canonicalWrapper, ...args];
95155
- if (tokens.some((token) => WINDOWS_CMD_UNSAFE_TOKEN.test(token)))
95156
- return null;
95157
- const command = `call ${tokens.map((token) => `"${token}"`).join(" ")}`;
95158
- return [interpreter, "/d", "/s", "/v:off", "/c", command];
95238
+ function buildWindowsBatchCommand2(wrapperPath, args) {
95239
+ return buildWindowsBatchCommand(wrapperPath, args, lintWindowsBatchDeps);
95159
95240
  }
95160
95241
  function resolveWindowsBatchCommandFromPath(name, args) {
95161
95242
  if (_internals106.platform() !== "win32")
95162
95243
  return null;
95163
95244
  const wrapper = resolveExecutableFromPath(WINDOWS_BATCH_WRAPPER_EXTENSIONS.map((extension) => `${name}${extension}`), _internals106.pathEnv(), "win32");
95164
- return wrapper ? buildWindowsBatchCommand(wrapper, args) : null;
95245
+ return wrapper ? buildWindowsBatchCommand2(wrapper, args) : null;
95165
95246
  }
95166
- function resolveContainedWindowsBatchCommand(cwd, fileName, args) {
95167
- if (_internals106.platform() !== "win32")
95168
- return null;
95169
- const candidate2 = path128.join(cwd, fileName);
95170
- if (!isRegularFile(candidate2))
95171
- return null;
95172
- let canonicalCwd;
95173
- let canonicalCandidate;
95174
- try {
95175
- canonicalCwd = _internals106.realpathSync(cwd);
95176
- canonicalCandidate = _internals106.realpathSync(candidate2);
95177
- } catch {
95178
- return null;
95179
- }
95180
- const relative22 = path128.relative(canonicalCwd, canonicalCandidate);
95181
- if (relative22 === "" || relative22.startsWith("..") || path128.isAbsolute(relative22)) {
95182
- return null;
95183
- }
95184
- return buildWindowsBatchCommand(canonicalCandidate, args);
95247
+ function resolveContainedWindowsBatchCommand2(cwd, fileName, args) {
95248
+ return resolveContainedWindowsBatchCommand(cwd, fileName, args, lintWindowsBatchDeps);
95185
95249
  }
95186
95250
  function buildAdditionalCommand(name, args) {
95187
95251
  const executable = resolveAdditionalExecutable(name);
@@ -95210,7 +95274,7 @@ function resolveCheckstyleCommand(cwd) {
95210
95274
  const hasGradleSignal = hasCheckstyleGradleSignal(cwd);
95211
95275
  if (hasGradleSignal) {
95212
95276
  if (_internals106.platform() === "win32") {
95213
- const gradlew = resolveContainedWindowsBatchCommand(cwd, "gradlew.bat", [
95277
+ const gradlew = resolveContainedWindowsBatchCommand2(cwd, "gradlew.bat", [
95214
95278
  "checkstyleMain"
95215
95279
  ]);
95216
95280
  if (gradlew)
@@ -98004,6 +98068,7 @@ var MAX_SAFE_SOURCE_FILES = 1;
98004
98068
  var MAX_RAW_FILE_ENTRIES = 512;
98005
98069
  var MAX_FILE_PATH_LENGTH2 = 4096;
98006
98070
  var MAX_GRAPH_FILE_BYTES = 4 * 1024 * 1024;
98071
+ var MAX_MAVEN_MODULE_PROBE_ENTRIES = 100;
98007
98072
  var DEFAULT_LOAD_IMPACT_MAP = loadImpactMap;
98008
98073
  async function estimateFanOut(sourceFiles, cwd) {
98009
98074
  try {
@@ -98386,7 +98451,7 @@ var DISPATCH_FRAMEWORK_MAP = {
98386
98451
  };
98387
98452
  async function detectTestFrameworkViaDispatch(cwd) {
98388
98453
  try {
98389
- const { pickBackend } = await import("./dispatch-qvcztbpf.js");
98454
+ const { pickBackend } = await import("./dispatch-h8m1jntz.js");
98390
98455
  const backend = await pickBackend(cwd);
98391
98456
  if (!backend?.selectTestFramework)
98392
98457
  return "none";
@@ -98402,7 +98467,7 @@ async function buildTestCommandViaDispatch(framework, scope, files, coverage, ba
98402
98467
  if (framework === "none")
98403
98468
  return null;
98404
98469
  try {
98405
- const { pickBackend } = await import("./dispatch-qvcztbpf.js");
98470
+ const { pickBackend } = await import("./dispatch-h8m1jntz.js");
98406
98471
  const backend = await pickBackend(baseDir);
98407
98472
  if (backend?.buildTestCommand) {
98408
98473
  const cmd = backend.buildTestCommand(framework, files, baseDir, {
@@ -98424,7 +98489,7 @@ async function parseTestOutputViaDispatch(framework, output, baseDir) {
98424
98489
  if (framework === "none")
98425
98490
  return null;
98426
98491
  try {
98427
- const { pickBackend } = await import("./dispatch-qvcztbpf.js");
98492
+ const { pickBackend } = await import("./dispatch-h8m1jntz.js");
98428
98493
  const backend = await pickBackend(baseDir);
98429
98494
  if (!backend?.parseTestOutput)
98430
98495
  return null;
@@ -98444,7 +98509,82 @@ async function parseTestOutputViaDispatch(framework, output, baseDir) {
98444
98509
  return null;
98445
98510
  }
98446
98511
  }
98447
- async function detectTestFramework(cwd) {
98512
+ function relativeEscapesRoot(relative24) {
98513
+ return relative24 === ".." || relative24.startsWith(`..${path132.sep}`) || path132.isAbsolute(relative24);
98514
+ }
98515
+ function resolveMavenModuleDir(root, files) {
98516
+ const resolvedRoot = path132.resolve(root);
98517
+ let rootReal;
98518
+ const isContainedModuleDir = (dir) => {
98519
+ if (rootReal === undefined) {
98520
+ try {
98521
+ rootReal = _internals110.realpathSync(resolvedRoot);
98522
+ } catch {
98523
+ rootReal = null;
98524
+ }
98525
+ }
98526
+ if (rootReal === null)
98527
+ return false;
98528
+ let dirReal;
98529
+ try {
98530
+ dirReal = _internals110.realpathSync(dir);
98531
+ } catch {
98532
+ return false;
98533
+ }
98534
+ return !relativeEscapesRoot(path132.relative(rootReal, dirReal));
98535
+ };
98536
+ if (files && files.length > 0) {
98537
+ for (const file of files) {
98538
+ const resolvedFile = path132.resolve(resolvedRoot, file);
98539
+ const relativeToRoot = path132.relative(resolvedRoot, resolvedFile);
98540
+ if (relativeEscapesRoot(relativeToRoot)) {
98541
+ continue;
98542
+ }
98543
+ let current = path132.dirname(resolvedFile);
98544
+ while (true) {
98545
+ if (_internals110.existsSync(path132.join(current, "pom.xml")) && isContainedModuleDir(current)) {
98546
+ return current;
98547
+ }
98548
+ if (current === resolvedRoot)
98549
+ break;
98550
+ const parent = path132.dirname(current);
98551
+ if (parent === current)
98552
+ break;
98553
+ if (relativeEscapesRoot(path132.relative(resolvedRoot, parent))) {
98554
+ break;
98555
+ }
98556
+ current = parent;
98557
+ }
98558
+ }
98559
+ return null;
98560
+ }
98561
+ let entries2;
98562
+ try {
98563
+ entries2 = _internals110.readdirSync(resolvedRoot);
98564
+ } catch {
98565
+ return null;
98566
+ }
98567
+ entries2.sort((a, b) => a.localeCompare(b));
98568
+ let inspected = 0;
98569
+ for (const entry of entries2) {
98570
+ if (entry.startsWith(".") || entry === "node_modules")
98571
+ continue;
98572
+ if (inspected >= MAX_MAVEN_MODULE_PROBE_ENTRIES)
98573
+ break;
98574
+ inspected++;
98575
+ const candidate2 = path132.join(resolvedRoot, entry);
98576
+ if (_internals110.existsSync(path132.join(candidate2, "pom.xml")) && isContainedModuleDir(candidate2)) {
98577
+ return candidate2;
98578
+ }
98579
+ }
98580
+ return null;
98581
+ }
98582
+ function resolveNestedMavenModuleDir(root, files) {
98583
+ if (_internals110.existsSync(path132.join(root, "pom.xml")))
98584
+ return null;
98585
+ return resolveMavenModuleDir(root, files);
98586
+ }
98587
+ async function detectTestFramework(cwd, files) {
98448
98588
  const baseDir = cwd;
98449
98589
  try {
98450
98590
  const packageJsonPath = path132.join(baseDir, "package.json");
@@ -98536,6 +98676,10 @@ async function detectTestFramework(cwd) {
98536
98676
  return "rspec";
98537
98677
  if (detectMinitest(baseDir))
98538
98678
  return "minitest";
98679
+ const mavenModuleDir = resolveNestedMavenModuleDir(baseDir, files);
98680
+ if (mavenModuleDir && (_internals110.isCommandAvailable("mvn") || resolveMavenWrapperCommand(mavenModuleDir, ["test"]) !== null)) {
98681
+ return "maven";
98682
+ }
98539
98683
  return "none";
98540
98684
  }
98541
98685
  function detectPhpTest(cwd) {
@@ -98927,30 +99071,10 @@ function buildTestCommand(framework, scope, files, coverage, baseDir, bail, targ
98927
99071
  return args;
98928
99072
  }
98929
99073
  case "maven": {
98930
- const args = ["mvn", "test"];
98931
- if (targets && targets.length > 0) {
98932
- args.push(`-Dtest=${targets.join(",")}`);
98933
- }
98934
- return args;
99074
+ return buildMavenTestCommand(baseDir, targets);
98935
99075
  }
98936
99076
  case "gradle": {
98937
- const isWindows = process.platform === "win32";
98938
- const hasGradlewBat = fs68.existsSync(path132.join(baseDir, "gradlew.bat"));
98939
- const hasGradlew = fs68.existsSync(path132.join(baseDir, "gradlew"));
98940
- const args = [];
98941
- if (hasGradlewBat && isWindows)
98942
- args.push("gradlew.bat");
98943
- else if (hasGradlew)
98944
- args.push("./gradlew");
98945
- else
98946
- args.push("gradle");
98947
- args.push("test");
98948
- if (targets && targets.length > 0) {
98949
- for (const target of targets) {
98950
- args.push("--tests", target);
98951
- }
98952
- }
98953
- return args;
99077
+ return buildGradleTestCommand(baseDir, targets);
98954
99078
  }
98955
99079
  case "dotnet-test": {
98956
99080
  const args = ["dotnet", "test"];
@@ -99539,7 +99663,8 @@ async function runTests(framework, scope, files, coverage, timeout_ms, cwd, bail
99539
99663
  stderr: "pipe",
99540
99664
  cwd: executionCwd,
99541
99665
  timeout: timeout_ms,
99542
- killProcessTree: true
99666
+ killProcessTree: true,
99667
+ ...isWindowsCommandInterpreterLaunch(command) ? { windowsVerbatimArguments: true } : {}
99543
99668
  });
99544
99669
  const stdoutPromise = readBoundedStream2(proc.stdout, MAX_OUTPUT_BYTES5);
99545
99670
  const stderrPromise = readBoundedStream2(proc.stderr, MAX_OUTPUT_BYTES5);
@@ -99595,8 +99720,9 @@ async function runTests(framework, scope, files, coverage, timeout_ms, cwd, bail
99595
99720
  totals.total = parsedTestCases.length;
99596
99721
  }
99597
99722
  const isTimeout = timedOutByDeadline;
99723
+ const spawnFailure = proc.spawnError;
99598
99724
  const nativeTargetObserved = resolvedNativeTarget ? didExecuteNativeTarget(resolvedNativeTarget, output) : true;
99599
- const testPassed = exitCode === 0 && !isTimeout && totals.failed === 0 && nativeTargetObserved;
99725
+ const testPassed = exitCode === 0 && !isTimeout && !spawnFailure && totals.failed === 0 && nativeTargetObserved;
99600
99726
  if (testPassed) {
99601
99727
  const result = {
99602
99728
  success: true,
@@ -99625,9 +99751,9 @@ async function runTests(framework, scope, files, coverage, timeout_ms, cwd, bail
99625
99751
  duration_ms,
99626
99752
  totals,
99627
99753
  rawOutput: output,
99628
- error: isTimeout ? `Tests timed out after ${timeout_ms}ms` : !nativeTargetObserved ? `Native target "${resolvedNativeTarget?.name}" did not execute` : `Tests failed with ${totals.failed} failures`,
99629
- message: isTimeout ? `${framework} tests timed out after ${timeout_ms}ms` : !nativeTargetObserved ? `${framework} did not report the exact requested native target; refusing a false-green 0/0 result` : `${framework} tests failed (${totals.failed}/${totals.total} failed)`,
99630
- outcome: isTimeout ? "error" : "regression",
99754
+ error: spawnFailure ? `Test command failed to launch: ${spawnFailure.message}` : isTimeout ? `Tests timed out after ${timeout_ms}ms` : !nativeTargetObserved ? `Native target "${resolvedNativeTarget?.name}" did not execute` : `Tests failed with ${totals.failed} failures`,
99755
+ message: spawnFailure ? `${framework} test process could not be started: ${spawnFailure.message} \u2014 a launch failure (for example a missing executable or unusable working directory), not a test regression. Check the command, PATH, and cwd instead of the tests.` : isTimeout ? `${framework} tests timed out after ${timeout_ms}ms` : !nativeTargetObserved ? `${framework} did not report the exact requested native target; refusing a false-green 0/0 result` : `${framework} tests failed (${totals.failed}/${totals.total} failed)`,
99756
+ outcome: spawnFailure || isTimeout ? "error" : "regression",
99631
99757
  testCases: parsedTestCases
99632
99758
  };
99633
99759
  if (coveragePercent !== undefined) {
@@ -99835,7 +99961,7 @@ var test_runner = createSwarmTool({
99835
99961
  path: exports_external.string()
99836
99962
  }).optional().describe('For scope "target": exact framework-native test name plus a workspace-relative package/build directory. Absolute paths, traversal, coverage, bail, and broad fallback are rejected.'),
99837
99963
  files: exports_external.array(exports_external.string().min(1).max(MAX_FILE_PATH_LENGTH2)).max(MAX_RAW_FILE_ENTRIES).optional().describe('Specific files to test. For "convention", pass source files or direct test files. For "graph" and "impact", pass source files only.'),
99838
- targets: exports_external.array(exports_external.string()).optional().describe("Framework-native test names or patterns to filter which tests run. Supported by cargo, go-test, maven, gradle, dotnet-test, ctest, and swift-test. Each entry is passed as-is to the framework's native filter flag."),
99964
+ targets: exports_external.array(exports_external.string()).optional().describe("Framework-native test names or patterns to filter which tests run. Supported by cargo, go-test, maven, gradle, dotnet-test, ctest, and swift-test. Each entry is passed as-is to the framework's native filter flag. Targets only filter a files-driven selection \u2014 provide a non-empty files array for the convention, graph, and impact scopes; targets alone cannot drive discovery."),
99839
99965
  coverage: exports_external.boolean().optional().describe("Enable coverage reporting if supported"),
99840
99966
  bail: exports_external.boolean().optional().describe("Stop running tests after the first failure. Default false. Note: coverage may be incomplete when bail=true with coverage=true."),
99841
99967
  timeout_ms: exports_external.number().int().min(1).default(DEFAULT_TIMEOUT_MS3).describe("Timeout in milliseconds (default 60000, max 300000)"),
@@ -99942,13 +100068,13 @@ var test_runner = createSwarmTool({
99942
100068
  return JSON.stringify(errorResult, null, 2);
99943
100069
  }
99944
100070
  }
99945
- if ((scope === "convention" || scope === "graph" || scope === "impact") && (!args.files || args.files.length === 0) && (!args.targets || args.targets.length === 0)) {
100071
+ if ((scope === "convention" || scope === "graph" || scope === "impact") && (!args.files || args.files.length === 0)) {
99946
100072
  const errorResult = {
99947
100073
  success: false,
99948
100074
  framework: "none",
99949
100075
  scope,
99950
- error: 'scope "convention", "graph", and "impact" require explicit files or targets array - omitting both causes unsafe full-project discovery',
99951
- message: 'When using scope "convention", "graph", or "impact", you must provide a non-empty "files" array (or "targets" for framework-native test names). Example: { scope: "convention", files: ["tests/test_calc.py"] }',
100076
+ error: 'scope "convention", "graph", and "impact" require a non-empty files array - targets only filter which tests run and cannot substitute for files (omitting files causes unsafe full-project discovery)',
100077
+ message: 'When using scope "convention", "graph", or "impact", provide at least one source or direct-test file in "files"; "targets" only filter which tests run within that selection and cannot drive discovery on their own. Example: { scope: "convention", files: ["tests/test_calc.py"] }',
99952
100078
  outcome: "error",
99953
100079
  resolution: makeResolution(scope, scope, [], [], "skip", workingDir)
99954
100080
  };
@@ -99965,10 +100091,10 @@ var test_runner = createSwarmTool({
99965
100091
  } else if (useDispatch) {
99966
100092
  framework = await detectTestFrameworkViaDispatch(workingDir);
99967
100093
  if (framework === "none") {
99968
- framework = await detectTestFramework(workingDir);
100094
+ framework = await detectTestFramework(workingDir, _files);
99969
100095
  }
99970
100096
  } else {
99971
- framework = await detectTestFramework(workingDir);
100097
+ framework = await detectTestFramework(workingDir, _files);
99972
100098
  }
99973
100099
  if (framework === "none") {
99974
100100
  const result2 = {
@@ -99990,6 +100116,12 @@ var test_runner = createSwarmTool({
99990
100116
  };
99991
100117
  return JSON.stringify(result2, null, 2);
99992
100118
  }
100119
+ if (scope !== "target" && framework === "maven") {
100120
+ const mavenModuleDir = resolveNestedMavenModuleDir(workingDir, _files);
100121
+ if (mavenModuleDir) {
100122
+ nativeExecutionDirectory = mavenModuleDir;
100123
+ }
100124
+ }
99993
100125
  let testFiles = [];
99994
100126
  let graphFallbackReason;
99995
100127
  let effectiveScope = scope;
@@ -99997,14 +100129,14 @@ var test_runner = createSwarmTool({
99997
100129
  let selectionCacheStatus;
99998
100130
  let selectionSourceFiles = [];
99999
100131
  if (scope === "target") {} else if (scope === "all") {} else if (scope === "convention") {
100000
- const directTestFiles = args.files.filter((file) => isConventionTestFilePath(file));
100001
- const sourceFiles = args.files.filter((file) => {
100132
+ const directTestFiles = _files.filter((file) => isConventionTestFilePath(file));
100133
+ const sourceFiles = _files.filter((file) => {
100002
100134
  if (directTestFiles.includes(file))
100003
100135
  return false;
100004
100136
  const ext = path132.extname(file).toLowerCase();
100005
100137
  return SOURCE_EXTENSIONS.has(ext);
100006
100138
  });
100007
- const invalidFiles = args.files.filter((file) => !directTestFiles.includes(file) && !sourceFiles.includes(file));
100139
+ const invalidFiles = _files.filter((file) => !directTestFiles.includes(file) && !sourceFiles.includes(file));
100008
100140
  if (directTestFiles.length === 0 && sourceFiles.length === 0) {
100009
100141
  const errorResult = {
100010
100142
  success: false,
@@ -100027,7 +100159,7 @@ var test_runner = createSwarmTool({
100027
100159
  };
100028
100160
  return JSON.stringify(errorResult, null, 2);
100029
100161
  }
100030
- selectionSourceFiles = normalizeSelectionFiles(args.files, workingDir);
100162
+ selectionSourceFiles = normalizeSelectionFiles(_files, workingDir);
100031
100163
  if (sourceFiles.length > MAX_SAFE_SOURCE_FILES) {
100032
100164
  const errorResult = {
100033
100165
  success: false,
@@ -100045,7 +100177,7 @@ var test_runner = createSwarmTool({
100045
100177
  ...getTestFilesFromConvention(sourceFiles, workingDir)
100046
100178
  ].filter((file, index, items) => items.indexOf(file) === index);
100047
100179
  } else if (scope === "graph") {
100048
- const sourceFiles = normalizeSelectionFiles(args.files.filter((f) => {
100180
+ const sourceFiles = normalizeSelectionFiles(_files.filter((f) => {
100049
100181
  if (isConventionTestFilePath(f)) {
100050
100182
  return false;
100051
100183
  }
@@ -100088,7 +100220,7 @@ var test_runner = createSwarmTool({
100088
100220
  testFiles = getTestFilesFromConvention(sourceFiles, workingDir).slice(0, MAX_SAFE_TEST_FILES2 + 1);
100089
100221
  }
100090
100222
  } else if (scope === "impact") {
100091
- const sourceFiles = normalizeSelectionFiles(args.files.filter((f) => {
100223
+ const sourceFiles = normalizeSelectionFiles(_files.filter((f) => {
100092
100224
  if (isConventionTestFilePath(f)) {
100093
100225
  return false;
100094
100226
  }
@@ -100258,6 +100390,7 @@ var _internals110 = {
100258
100390
  existsSync: fs68.existsSync,
100259
100391
  readdirSync: fs68.readdirSync,
100260
100392
  readFileSync: fs68.readFileSync,
100393
+ realpathSync: fs68.realpathSync,
100261
100394
  resolveLocalNodeTool,
100262
100395
  bunSpawn,
100263
100396
  buildNativeTargetCommand,
@@ -101384,7 +101517,7 @@ function renderStageARepairOutcome(outcome) {
101384
101517
  return `\u274C Task ${outcome.taskId}: unknown repair outcome`;
101385
101518
  }
101386
101519
  }
101387
- async function handleRecoverCommand(directory, args) {
101520
+ async function handleRecoverCommand(directory, args, sessionID) {
101388
101521
  const force = args.includes("--force");
101389
101522
  if (args.includes("--coordination")) {
101390
101523
  try {
@@ -101441,7 +101574,8 @@ async function handleRecoverCommand(directory, args) {
101441
101574
  }
101442
101575
  try {
101443
101576
  const { results: repairResults, truncated: repairTruncated } = await repairWedgedStageA(directory, {
101444
- ...taskId ? { taskIds: [taskId] } : {}
101577
+ ...taskId ? { taskIds: [taskId] } : {},
101578
+ ...sessionID ? { sessionId: sessionID } : {}
101445
101579
  });
101446
101580
  const repaired = repairResults.filter((r) => r.outcome === "repaired");
101447
101581
  if (repairResults.length > 0) {
@@ -102879,7 +103013,9 @@ async function releaseKnowledgeGateObligations(directory, sessionID) {
102879
103013
  releasedPairs.push(`${traceId}/${item.entry_id}`);
102880
103014
  }
102881
103015
  if (committed.rejected.length > 0) {
102882
- results.push(`\u26A0\uFE0F Partially released trace ${sanitizeDiagnosticText(traceId, 64)}: ${committed.rejected.map((item) => item.reason).join("; ")}`);
103016
+ const reasons = committed.rejected.map((item) => item.reason).join("; ");
103017
+ const hasWrongSession = committed.rejected.some((item) => item.reason === "wrong_session");
103018
+ results.push(`\u26A0\uFE0F Partially released trace ${sanitizeDiagnosticText(traceId, 64)}: ${reasons}` + (hasWrongSession ? ` \u2014 a re-dispatched child session is an authorized filer for its dispatch's stamps, or surface fresh knowledge via knowledge_recall for a new trace` : ""));
102883
103019
  }
102884
103020
  }
102885
103021
  if (committedCount === 0) {
@@ -102992,6 +103128,8 @@ async function handleResetSessionCommand(directory, args, sessionID) {
102992
103128
  clearTrajectoryStep(sessionId);
102993
103129
  }
102994
103130
  swarmState.agentSessions.clear();
103131
+ swarmState.dispatchParentByChildSession.clear();
103132
+ swarmState.pendingDispatchAuthorizations = [];
102995
103133
  clearSnapshotSessionOwnerships();
102996
103134
  results.push(`\u2705 Cleared ${sessionCount} in-memory agent session(s)`);
102997
103135
  try {
@@ -109768,7 +109906,7 @@ function buildDetailedHelp(commandName, entry) {
109768
109906
  async function handleHelpCommand(ctx) {
109769
109907
  const targetCommand = ctx.args.join(" ");
109770
109908
  if (!targetCommand) {
109771
- const { buildHelpText } = await import("./index-2vtrjm19.js");
109909
+ const { buildHelpText } = await import("./index-peyrzden.js");
109772
109910
  return buildHelpText();
109773
109911
  }
109774
109912
  const tokens = targetCommand.split(/\s+/);
@@ -109782,7 +109920,7 @@ async function handleHelpCommand(ctx) {
109782
109920
  > Note: \`/swarm ${resolved.key}\` is a deprecated alias for \`/swarm ${aliasTarget}\`.` : detailed;
109783
109921
  }
109784
109922
  const similar = _internals27.findSimilarCommands(targetCommand);
109785
- const { buildHelpText: fullHelp } = await import("./index-2vtrjm19.js");
109923
+ const { buildHelpText: fullHelp } = await import("./index-peyrzden.js");
109786
109924
  if (similar.length > 0) {
109787
109925
  return `Command '/swarm ${targetCommand}' not found.
109788
109926
 
@@ -110110,7 +110248,7 @@ var COMMAND_REGISTRY = {
110110
110248
  },
110111
110249
  "guardrail explain": {
110112
110250
  handler: async (ctx) => {
110113
- const { handleGuardrailExplain } = await import("./guardrail-explain-e0wbeyk1.js");
110251
+ const { handleGuardrailExplain } = await import("./guardrail-explain-020gkz5c.js");
110114
110252
  return handleGuardrailExplain(ctx.directory, ctx.args);
110115
110253
  },
110116
110254
  description: "Dry-run: show what the guardrails would do to a command or write target (executes nothing)",
@@ -110120,7 +110258,7 @@ var COMMAND_REGISTRY = {
110120
110258
  },
110121
110259
  "guardrail reset": {
110122
110260
  handler: async (ctx) => {
110123
- const { handleGuardrailReset } = await import("./guardrail-reset-7z62s1j5.js");
110261
+ const { handleGuardrailReset } = await import("./guardrail-reset-cg6kfk8r.js");
110124
110262
  return handleGuardrailReset(ctx.args, ctx.sessionID);
110125
110263
  },
110126
110264
  description: "Reset one exact active invocation/action circuit after repair",
@@ -110141,7 +110279,7 @@ var COMMAND_REGISTRY = {
110141
110279
  },
110142
110280
  "guardrail-log": {
110143
110281
  handler: async (ctx) => {
110144
- const { handleGuardrailLog } = await import("./guardrail-log-gzrj46h0.js");
110282
+ const { handleGuardrailLog } = await import("./guardrail-log-z14b98cn.js");
110145
110283
  return handleGuardrailLog(ctx.directory, ctx.args);
110146
110284
  },
110147
110285
  description: "Read the guardrail decision log (use --blocks-only for blocks)",
@@ -110916,9 +111054,9 @@ Subcommands:
110916
111054
  toolPolicy: "restricted"
110917
111055
  },
110918
111056
  recover: {
110919
- handler: (ctx) => handleRecoverCommand(ctx.directory, ctx.args),
111057
+ handler: (ctx) => handleRecoverCommand(ctx.directory, ctx.args, ctx.sessionID),
110920
111058
  description: "Recover wedged coder settlements [task_id] [--force]",
110921
- details: "Settles stale coder-settlement WALs in .swarm/coder-settlements/ \u2014 the CODER_DISPATCH_IN_PROGRESS wedge where a dispatch's completion never fired (issue #2268). Safe mode recovers settlements whose owner process is gone. --force also releases ownership keys held by this process: use only when no dispatch is genuinely running (a late completion then reports CODER_SETTLEMENT_IDEMPOTENCY_CONFLICT, safe to ignore). Never interrupts another live OpenCode process. Also repairs tasks wedged at coder_delegated with unattributed green pre_check evidence \u2014 the post-reset TASK_WORKFLOW_STAGE_A_REQUIRED wedge \u2014 and the settlement-wedge class (issue #2828): a task whose workflow drifted to idle or blocked while a COMMITTED accepted coder settlement and green post-settlement pre-check evidence still justify Stage A gets the missing stage_a_passed written directly, with a settlementRecovery marker and a stage_a_repair audit event in .swarm/events.jsonl; the architect-side audited escape hatch for the same receipts is the recover_stage_a_task tool. Note that --force affects only in-process settlement-WAL ownership and does not override Stage A wedge-classification refusals. Pass [task_id] to scope both phases to one task. Diagnose and repair emit per-category status explanations (missing/stale/ambiguous/corrupt/live_wedge/settlement_wedge) with shell-correct invocation guidance per host \u2014 see docs/troubleshooting/recovery-runbook.md (#2665). Human-only.",
111059
+ details: "Settles stale coder-settlement WALs in .swarm/coder-settlements/ \u2014 the CODER_DISPATCH_IN_PROGRESS wedge where a dispatch's completion never fired (issue #2268). Safe mode recovers settlements whose owner process is gone. --force also releases ownership keys held by this process: use only when no dispatch is genuinely running (a late completion then reports CODER_SETTLEMENT_IDEMPOTENCY_CONFLICT, safe to ignore). Never interrupts another live OpenCode process. Also repairs tasks wedged at coder_delegated with unattributed green pre_check evidence \u2014 the post-reset TASK_WORKFLOW_STAGE_A_REQUIRED wedge \u2014 and the settlement-wedge class (issue #2828): a task whose workflow drifted to idle or blocked while a COMMITTED accepted coder settlement and green post-settlement pre-check evidence still justify Stage A gets the missing stage_a_passed written directly, with a settlementRecovery marker and a stage_a_repair audit event in .swarm/events.jsonl; the architect-side audited escape hatch for the same receipts is the recover_stage_a_task tool. Both recovery surfaces also refresh the invoking session's in-memory task workflow view, so a blocked-start wedge does not survive the recovery in the session that ran it (#3043). Note that --force affects only in-process settlement-WAL ownership and does not override Stage A wedge-classification refusals. Pass [task_id] to scope both phases to one task. Diagnose and repair emit per-category status explanations (missing/stale/ambiguous/corrupt/live_wedge/settlement_wedge) with shell-correct invocation guidance per host \u2014 see docs/troubleshooting/recovery-runbook.md (#2665). Human-only.",
110922
111060
  args: "[task_id] [--force]",
110923
111061
  category: "utility",
110924
111062
  toolPolicy: "human-only"
@@ -114700,7 +114838,7 @@ EXECUTION BOUNDARY:
114700
114838
  - scope: "all" is PROHIBITED for test_engineer \u2014 full-suite output can destabilize opencode's SSE streaming, and the architect handles regression sweeps separately via scope: "graph"
114701
114839
  - If you need to verify tests beyond your assigned file, report the concern in your VERDICT and the architect will handle it
114702
114840
  - If you wrote tests/foo.test.ts for src/foo.ts, you MUST run only tests/foo.test.ts
114703
- - The test_runner convention scope recognises direct test files in supported locations/naming conventions: Python (test_*.py, *_test.py), Ruby (*_spec.rb), Java/Kotlin (*Test.*), C# (*Tests.cs), and PowerShell (*.Tests.ps1). For Go and CTest, use scope "target" with an exact framework-native name; never broaden to a package/build sweep. For target-based frameworks (cargo, maven, gradle, dotnet-test, swift-test), you may also pass framework-native test names or patterns in the \`targets\` array parameter alongside \`files\`.
114841
+ - The test_runner convention scope recognises direct test files in supported locations/naming conventions: Python (test_*.py, *_test.py), Ruby (*_spec.rb), Java/Kotlin (*Test.*), C# (*Tests.cs), and PowerShell (*.Tests.ps1). For Go and CTest, use scope "target" with an exact framework-native name; never broaden to a package/build sweep. For target-based frameworks (cargo, maven, gradle, dotnet-test, swift-test), you may also pass framework-native test names or patterns in the \`targets\` array parameter alongside \`files\` (\`targets\` alone cannot drive discovery: the convention, graph, and impact scopes require a non-empty \`files\` array).
114704
114842
 
114705
114843
  TOOL USAGE:
114706
114844
  - Use \`test_runner\` tool for test execution