opencode-swarm 7.199.0 → 7.199.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 (86) hide show
  1. package/.opencode/skills/swarm-pr-feedback/SKILL.md +9 -9
  2. package/binaries/win32-arm64/swarm-sandbox-runner.exe +0 -0
  3. package/binaries/win32-x64/swarm-sandbox-runner.exe +0 -0
  4. package/dist/agents/architect.d.ts +1 -1
  5. package/dist/background/workspace-snapshot.d.ts +51 -0
  6. package/dist/cli/{auto-checkpoint-1wf9n5yj.js → auto-checkpoint-0ajspw7n.js} +6 -6
  7. package/dist/cli/{checkpoint-gw6f4ghv.js → checkpoint-1dsrg3ft.js} +10 -10
  8. package/dist/cli/{coder-settlement-qy77s1x6.js → coder-settlement-189074m3.js} +6 -6
  9. package/dist/cli/{config-doctor-2tcp28sc.js → config-doctor-20pd12nw.js} +9 -9
  10. package/dist/cli/{core-pz87qafz.js → core-5bqceeft.js} +2 -2
  11. package/dist/cli/{curator-fvnptcnw.js → curator-b3zn9w9q.js} +29 -29
  12. package/dist/cli/{curator-drift-c1x7jdxj.js → curator-drift-ka477rrz.js} +6 -6
  13. package/dist/cli/{curator-llm-factory-cg1p6ysr.js → curator-llm-factory-nbprwszt.js} +29 -29
  14. package/dist/cli/{doctor-knowledge-receipt-phase-id-xwyb5sf8.js → doctor-knowledge-receipt-phase-id-nrk52ak6.js} +5 -5
  15. package/dist/cli/{evidence-summary-service-47cptvea.js → evidence-summary-service-qrr8zjhj.js} +11 -11
  16. package/dist/cli/{gate-evidence-77bzfckz.js → gate-evidence-cbs5xh1n.js} +3 -3
  17. package/dist/cli/{guardrail-explain-0ap0a51w.js → guardrail-explain-6xd6r3f5.js} +30 -30
  18. package/dist/cli/{guardrail-log-xw37f7ws.js → guardrail-log-qn1sqjs9.js} +6 -5
  19. package/dist/cli/{guardrail-reset-3fq8xdjf.js → guardrail-reset-ha3w0nby.js} +29 -29
  20. package/dist/cli/{hive-promoter-bmdgnmnf.js → hive-promoter-2dnv2xrg.js} +29 -29
  21. package/dist/cli/{index-vbm2ykr9.js → index-46sgm9rd.js} +1 -1
  22. package/dist/cli/{index-gds6c8qt.js → index-4py6w3hy.js} +4 -4
  23. package/dist/cli/{index-3x07b03s.js → index-5mbpybdm.js} +2 -2
  24. package/dist/cli/{index-ckcdheqx.js → index-5v0wkcd9.js} +2 -2
  25. package/dist/cli/{index-e5ecn73v.js → index-67ad9qbe.js} +1 -1
  26. package/dist/cli/{index-pqrepne6.js → index-7d3ft7by.js} +1 -1
  27. package/dist/cli/{index-mefad009.js → index-9qc7d3q2.js} +15 -11
  28. package/dist/cli/{index-ye9bze9s.js → index-bz5h9ttt.js} +5 -5
  29. package/dist/cli/{index-bjzxbxpw.js → index-c2eqtpk1.js} +2 -2
  30. package/dist/cli/{index-2f9tsejp.js → index-cpdcscwt.js} +2 -2
  31. package/dist/cli/{index-26h8fb7t.js → index-djtqb6b7.js} +2 -2
  32. package/dist/cli/{index-jccs3fgn.js → index-dyp5807d.js} +13 -1
  33. package/dist/cli/{index-1fwm8vqr.js → index-eyt9ryhd.js} +4 -4
  34. package/dist/cli/{index-a5xzwxdq.js → index-gfdz460m.js} +1 -1
  35. package/dist/cli/{index-awt5dpam.js → index-h349p91m.js} +32 -1
  36. package/dist/cli/{index-42dtc5nd.js → index-hfsyvkn0.js} +4 -4
  37. package/dist/cli/{index-3gwh8c9d.js → index-hj76n215.js} +1 -1
  38. package/dist/cli/{index-9ztsfved.js → index-hz2609qt.js} +117 -2
  39. package/dist/cli/{index-b5k6etf9.js → index-jrdepg4w.js} +2 -2
  40. package/dist/cli/{index-vh87e91s.js → index-km9tjdgw.js} +3 -3
  41. package/dist/cli/{index-kxaxf3en.js → index-kwh4b9cm.js} +246 -19
  42. package/dist/cli/{index-tnrq0pg8.js → index-mb3y5cgy.js} +6 -6
  43. package/dist/cli/{index-71g0ps66.js → index-mbygjbj8.js} +4 -4
  44. package/dist/cli/{index-kjhsssaq.js → index-qksw8p51.js} +29 -29
  45. package/dist/cli/{index-y9ckbta5.js → index-r9s68beh.js} +1 -1
  46. package/dist/cli/{index-79b9re6h.js → index-skg220qc.js} +441 -120
  47. package/dist/cli/{index-mzsj4kkv.js → index-t6gsqe10.js} +2 -2
  48. package/dist/cli/{index-qdwccqv5.js → index-vd6s2mxq.js} +1 -1
  49. package/dist/cli/{index-r52wrpb7.js → index-ve0ncsnc.js} +1 -1
  50. package/dist/cli/{index-jjsjjefm.js → index-wz8zc7w3.js} +6 -6
  51. package/dist/cli/{index-zd15v0gr.js → index-xapmt05a.js} +3 -3
  52. package/dist/cli/{index-hqrkr9ag.js → index-xfzkq1k4.js} +5 -5
  53. package/dist/cli/{index-zg5gnn3m.js → index-y4kjbf12.js} +1 -1
  54. package/dist/cli/{index-4hnxtssf.js → index-zvjrymp9.js} +31 -31
  55. package/dist/cli/index.js +30 -30
  56. package/dist/cli/{knowledge-escalator-w7b32ak4.js → knowledge-escalator-k1mssp9r.js} +8 -8
  57. package/dist/cli/{knowledge-events-y0kb9wbe.js → knowledge-events-f7c0z8rb.js} +6 -6
  58. package/dist/cli/{knowledge-store-knrqgmyk.js → knowledge-store-50vj5db0.js} +1 -1
  59. package/dist/cli/{knowledge-validator-zg7d9z8p.js → knowledge-validator-afxk6dvk.js} +2 -2
  60. package/dist/cli/{mcp-3k1t9q6h.js → mcp-j0grf8gt.js} +1 -1
  61. package/dist/cli/{model-preflight-k92fnbq8.js → model-preflight-ks9j40t5.js} +29 -29
  62. package/dist/cli/{pending-delegations-ape3hrm0.js → pending-delegations-e42yvvj0.js} +2 -2
  63. package/dist/cli/{pr-subscriptions-cn13b19x.js → pr-subscriptions-e92eg4ts.js} +1 -1
  64. package/dist/cli/{pr-workflow-gate-74j5mcxh.js → pr-workflow-gate-zqwde6r6.js} +29 -29
  65. package/dist/cli/{runner-qe3fkzx5.js → runner-7sd43gan.js} +1 -1
  66. package/dist/cli/{scan-cursor-4xxfc42h.js → scan-cursor-yehnf9jt.js} +2 -2
  67. package/dist/cli/{schema-qv9bvhyz.js → schema-jw861rj0.js} +2 -2
  68. package/dist/cli/{scope-persistence-fmva1cv0.js → scope-persistence-p778xbbq.js} +7 -7
  69. package/dist/cli/{server-s5ac6ydk.js → server-nkhvbbc5.js} +102 -40
  70. package/dist/cli/{skill-generator-19ckpm74.js → skill-generator-dd1w9p3t.js} +9 -9
  71. package/dist/cli/{snapshot-coordination-init-7c0s65jw.js → snapshot-coordination-init-11qb0jbs.js} +29 -29
  72. package/dist/cli/{speckit-checkoff-9b2zj8hd.js → speckit-checkoff-d92ej93g.js} +4 -4
  73. package/dist/cli/{workspace-snapshot-vhvrkbbb.js → workspace-snapshot-4zfj5wnd.js} +13 -1
  74. package/dist/cli/{worktree-collision-ownership-3r669yvh.js → worktree-collision-ownership-81wpkagz.js} +2 -2
  75. package/dist/cli/{worktree-isolation-5dydsr8c.js → worktree-isolation-zw3ydg49.js} +29 -29
  76. package/dist/config/skill-contract-digest.d.ts +8 -0
  77. package/dist/hooks/guardrails/file-authority.d.ts +17 -0
  78. package/dist/hooks/pr-workflow-gate.d.ts +32 -23
  79. package/dist/host/v2/events.d.ts +19 -1
  80. package/dist/host/v2/hooks.d.ts +25 -0
  81. package/dist/index.js +131 -128
  82. package/dist/tools/index.d.ts +1 -0
  83. package/dist/tools/manifest.d.ts +1 -0
  84. package/dist/tools/prepare-pr-feedback-commit-message.d.ts +30 -0
  85. package/dist/tools/tool-metadata.d.ts +4 -4
  86. package/package.json +1 -1
@@ -8,14 +8,14 @@ import {
8
8
  protectedRoots,
9
9
  redactDecisionLineForArchive,
10
10
  stableCanonicalStringify
11
- } from "./index-kxaxf3en.js";
11
+ } from "./index-kwh4b9cm.js";
12
12
  import {
13
13
  detectStraySwarmDirs,
14
14
  readDoctorArtifact,
15
15
  removeStraySwarmDir,
16
16
  resolvePlanParallelizationFlag,
17
17
  runConfigDoctor
18
- } from "./index-42dtc5nd.js";
18
+ } from "./index-hfsyvkn0.js";
19
19
  import {
20
20
  archiveEvidence,
21
21
  checkRequirementCoverage,
@@ -27,7 +27,7 @@ import {
27
27
  sanitizeTaskId,
28
28
  saveEvidence,
29
29
  validateProjectRoot
30
- } from "./index-zg5gnn3m.js";
30
+ } from "./index-y4kjbf12.js";
31
31
  import {
32
32
  JAVA_SYMBOL_GRAMMAR,
33
33
  LANGUAGE_REGISTRY,
@@ -56,7 +56,7 @@ import {
56
56
  runEvaluation,
57
57
  runExternalTool,
58
58
  withDisposableWorktree
59
- } from "./index-jccs3fgn.js";
59
+ } from "./index-dyp5807d.js";
60
60
  import {
61
61
  EvaluationTaskV1Schema,
62
62
  GateAuditManifestV1Schema,
@@ -89,7 +89,7 @@ import {
89
89
  alreadyCuratedThisGeneration,
90
90
  claimNextScanBatch,
91
91
  resolveCohortId
92
- } from "./index-y9ckbta5.js";
92
+ } from "./index-r9s68beh.js";
93
93
  import {
94
94
  CURATOR_CONSOLIDATION_PROMPT,
95
95
  CURATOR_INIT_PROMPT,
@@ -108,13 +108,13 @@ import {
108
108
  getGroupCommitWriter,
109
109
  importLegacyJsonl,
110
110
  readPriorDriftReports
111
- } from "./index-r52wrpb7.js";
111
+ } from "./index-ve0ncsnc.js";
112
112
  import {
113
113
  assertNoUnsettledCoderDispatch,
114
114
  listCoderSettlementWalStates,
115
115
  recoverCoderSettlement,
116
116
  recoverStaleCoderSettlements
117
- } from "./index-ye9bze9s.js";
117
+ } from "./index-bz5h9ttt.js";
118
118
  import {
119
119
  BUNDLED_PROJECT_SKILL_ROOT,
120
120
  DEFAULT_SKILL_MIN_CONFIDENCE,
@@ -137,12 +137,13 @@ import {
137
137
  skillContractDigest,
138
138
  splitSkillFrontmatter,
139
139
  syncBundledProjectSkillsIfMissingAsync
140
- } from "./index-mefad009.js";
140
+ } from "./index-9qc7d3q2.js";
141
141
  import {
142
142
  buildEscalationBriefing,
143
143
  readRecentEscalations
144
- } from "./index-jjsjjefm.js";
144
+ } from "./index-wz8zc7w3.js";
145
145
  import {
146
+ fastForwardToRefAsync,
146
147
  parsePorcelainV2Snapshot,
147
148
  resolveCommitCountSince,
148
149
  resolveCommitCountSinceAsync,
@@ -154,13 +155,16 @@ import {
154
155
  resolveCurrentUpstreamRemoteRef,
155
156
  resolveExactRemoteBranchHead,
156
157
  resolveExactRemoteBranchHeadAsync,
158
+ resolveIsAncestorAsync,
157
159
  resolveIsExactSingleChildCommit,
158
160
  resolveIsExactSingleChildCommitAsync,
159
161
  resolveIsWorkingTreeClean,
160
162
  resolveIsWorkingTreeCleanAsync,
163
+ resolveLocalRefHeadAsync,
161
164
  resolvePrFeedbackTrackingCandidatesAsync,
162
165
  resolvePrReviewDiffStats,
163
166
  resolvePrReviewDiffStatsAsync,
167
+ resolvePrWorkflowChangedPathSetAsync,
164
168
  resolvePrWorkflowRevisionDigest,
165
169
  resolvePrWorkflowRevisionDigestDetailed,
166
170
  resolvePrWorkflowRevisionDigestDetailedAsync,
@@ -168,8 +172,10 @@ import {
168
172
  resolveRemoteRefsContainingHeadAsync,
169
173
  resolveRemoteUrlIdentity,
170
174
  resolveRemoteUrlIdentityAsync,
175
+ resolveRepoTopLevelAsync,
176
+ resolveWorkingTreeDirtyPathsAsync,
171
177
  switchPrFeedbackTrackingCandidateAsync
172
- } from "./index-9ztsfved.js";
178
+ } from "./index-hz2609qt.js";
173
179
  import {
174
180
  buildCorrelationId,
175
181
  buildIssueUrl,
@@ -225,7 +231,7 @@ import {
225
231
  swarmOverwriteCandidates,
226
232
  trackedDirtyCandidates,
227
233
  transientBackoff
228
- } from "./index-gds6c8qt.js";
234
+ } from "./index-4py6w3hy.js";
229
235
  import {
230
236
  EPIC_MODE_CONFIG_DISABLED_MESSAGE,
231
237
  PlanRecoverySupersededError,
@@ -257,7 +263,7 @@ import {
257
263
  updateEpicRecord,
258
264
  updateTaskStatus,
259
265
  withPlanLifecycleLock
260
- } from "./index-tnrq0pg8.js";
266
+ } from "./index-mb3y5cgy.js";
261
267
  import {
262
268
  containsControlChars,
263
269
  containsPathTraversal,
@@ -274,7 +280,7 @@ import {
274
280
  resolveSpeckitProjection,
275
281
  validateSpeckit,
276
282
  writeProjectedSpecSync
277
- } from "./index-zd15v0gr.js";
283
+ } from "./index-xapmt05a.js";
278
284
  import {
279
285
  clearWorktreeMergeStatus,
280
286
  getAllWorktreeMergeFailures,
@@ -306,7 +312,7 @@ import {
306
312
  transitionTaskWorkflowEvidenceWithStatus,
307
313
  withTaskEvidenceTransaction,
308
314
  writeWorkflowWalFile
309
- } from "./index-vbm2ykr9.js";
315
+ } from "./index-46sgm9rd.js";
310
316
  import {
311
317
  isPathUnderSwarmWorktreeBase,
312
318
  listLiveLaneOwners,
@@ -315,7 +321,7 @@ import {
315
321
  recordLiveLaneOwner,
316
322
  removeWorktree,
317
323
  resolveWorktreeBaseDir
318
- } from "./index-2f9tsejp.js";
324
+ } from "./index-cpdcscwt.js";
319
325
  import {
320
326
  GitBinaryMissingError,
321
327
  GitSpawnCwdError,
@@ -358,7 +364,7 @@ import {
358
364
  scanBackgroundCoderReservationsForAdmission,
359
365
  scanDelegationsForRecovery,
360
366
  sweepStaleDelegations
361
- } from "./index-3gwh8c9d.js";
367
+ } from "./index-hj76n215.js";
362
368
  import {
363
369
  MAX_EVENT_LOG_ENTRIES,
364
370
  _internals,
@@ -370,7 +376,7 @@ import {
370
376
  recordHiveKnowledgeEvent,
371
377
  recordKnowledgeEvent,
372
378
  resolveKnowledgeEventsPath
373
- } from "./index-mzsj4kkv.js";
379
+ } from "./index-t6gsqe10.js";
374
380
  import {
375
381
  commitDisplayedMembership,
376
382
  commitEmptyRetrieval,
@@ -383,7 +389,7 @@ import {
383
389
  queryLiveMemberships,
384
390
  reconcilePhaseClose,
385
391
  recordPhaseCloseIntent
386
- } from "./index-bjzxbxpw.js";
392
+ } from "./index-c2eqtpk1.js";
387
393
  import {
388
394
  sanitizeContextText
389
395
  } from "./index-m9zzj4ee.js";
@@ -414,7 +420,7 @@ import {
414
420
  validateActionableFields,
415
421
  validateLesson,
416
422
  validateSkillPath
417
- } from "./index-e5ecn73v.js";
423
+ } from "./index-67ad9qbe.js";
418
424
  import {
419
425
  MAX_CURATION_PROPOSALS,
420
426
  authorizeCuration,
@@ -425,7 +431,7 @@ import {
425
431
  } from "./index-rtry5xyf.js";
426
432
  import {
427
433
  resolveWorktreeIsolationConfig
428
- } from "./index-vh87e91s.js";
434
+ } from "./index-km9tjdgw.js";
429
435
  import {
430
436
  RetrospectiveEvidenceSchema
431
437
  } from "./index-g22dps7x.js";
@@ -437,7 +443,7 @@ import {
437
443
  clearScopeBindings,
438
444
  readAuthoritativeScopeBindingSet,
439
445
  readDeclaredScopeFilesFromBindings
440
- } from "./index-b5k6etf9.js";
446
+ } from "./index-jrdepg4w.js";
441
447
  import {
442
448
  approvedSnapshotCoversPlan,
443
449
  clearPlanLedgerForReset,
@@ -454,17 +460,18 @@ import {
454
460
  replayFromLedgerWithStatus,
455
461
  resolvePlanningProfile,
456
462
  takeSnapshotEvent
457
- } from "./index-26h8fb7t.js";
463
+ } from "./index-djtqb6b7.js";
458
464
  import {
459
465
  CORE_EVENT_LOCKED,
460
466
  appendCoreEventSync,
461
467
  appendCoreEventsSync,
462
468
  finalizeCoreEventsForClose,
469
+ getCoderRetryEscalationActions,
463
470
  getCoreEventCoverage,
464
471
  hasSpecDriftAuditEvent,
465
472
  hasTaskRepairAuditEvent,
466
473
  readCoreEvents
467
- } from "./index-awt5dpam.js";
474
+ } from "./index-h349p91m.js";
468
475
  import {
469
476
  DEFAULT_QA_GATES,
470
477
  computeProfileHash,
@@ -543,7 +550,7 @@ import {
543
550
  transactFile,
544
551
  transactKnowledge,
545
552
  wordBigrams
546
- } from "./index-1fwm8vqr.js";
553
+ } from "./index-eyt9ryhd.js";
547
554
  import {
548
555
  readTailJsonl,
549
556
  readTailJsonlDetailed,
@@ -628,7 +635,7 @@ import {
628
635
  loadPluginConfig,
629
636
  loadPluginConfigWithMeta,
630
637
  resolveEpicConfig
631
- } from "./index-qdwccqv5.js";
638
+ } from "./index-vd6s2mxq.js";
632
639
  import {
633
640
  GIT_BINARY_ENV_VAR,
634
641
  addDeferredWarning,
@@ -661,7 +668,7 @@ import {
661
668
  resolveContextWindow,
662
669
  resolveGeneratedAgentRole,
663
670
  stripKnownSwarmPrefix
664
- } from "./index-3x07b03s.js";
671
+ } from "./index-5mbpybdm.js";
665
672
  import {
666
673
  AGENT_TOOL_MAP,
667
674
  ALL_AGENT_NAMES,
@@ -687,7 +694,7 @@ import {
687
694
  init_agent_names,
688
695
  init_constants,
689
696
  init_tool_metadata
690
- } from "./index-hqrkr9ag.js";
697
+ } from "./index-xfzkq1k4.js";
691
698
  import {
692
699
  KNOWLEDGE_SCHEMA_VERSION,
693
700
  OUTCOME_BLOCK_THRESHOLD,
@@ -835,6 +842,7 @@ init_loader();
835
842
  // src/hooks/pr-workflow-gate.ts
836
843
  init_zod();
837
844
  import { createHash as createHash25, randomUUID as randomUUID6 } from "crypto";
845
+ import { realpathSync as realpathSync5 } from "fs";
838
846
  import * as fsp5 from "fs/promises";
839
847
  import * as path34 from "path";
840
848
 
@@ -3463,7 +3471,7 @@ async function importLegacyPrWorkflowGateStateIfNeeded(directory, sessionID, all
3463
3471
  return null;
3464
3472
  throw error2;
3465
3473
  }
3466
- const legacy = allowSalvagedImport ? (await (await import("./pr-workflow-gate-74j5mcxh.js")).readPrWorkflowGateStateForRecovery(directory, sessionID))?.state ?? null : await readPrWorkflowGateStateFileFromDisk(filePath, sessionID);
3474
+ const legacy = allowSalvagedImport ? (await (await import("./pr-workflow-gate-zqwde6r6.js")).readPrWorkflowGateStateForRecovery(directory, sessionID))?.state ?? null : await readPrWorkflowGateStateFileFromDisk(filePath, sessionID);
3467
3475
  if (!legacy)
3468
3476
  return null;
3469
3477
  const namespace = workflowGateStateCoordinationNamespace(sessionID);
@@ -3597,7 +3605,7 @@ async function deleteStateWhileLocked(directory, sessionID, options = {}) {
3597
3605
  let recoveryState = null;
3598
3606
  if (!currentAuthoritative) {
3599
3607
  if (options.allowSalvagedRead) {
3600
- const { readPrWorkflowGateStateForRecovery } = await import("./pr-workflow-gate-74j5mcxh.js");
3608
+ const { readPrWorkflowGateStateForRecovery } = await import("./pr-workflow-gate-zqwde6r6.js");
3601
3609
  recoveryState = (await readPrWorkflowGateStateForRecovery(directory, normalizedSessionID))?.state ?? null;
3602
3610
  }
3603
3611
  if (!recoveryState) {
@@ -11476,7 +11484,7 @@ function isLaneOwnedByCurrentSession(branchName, expectedSessionId) {
11476
11484
  return extracted === expectedSessionId;
11477
11485
  }
11478
11486
  async function inspectStandardWorktreeCollisionOwnership(identity) {
11479
- const collisionOwnership = await import("./worktree-collision-ownership-3r669yvh.js");
11487
+ const collisionOwnership = await import("./worktree-collision-ownership-81wpkagz.js");
11480
11488
  return collisionOwnership.inspectStandardWorktreeCollisionOwnership(identity);
11481
11489
  }
11482
11490
  async function runRecoveryGit(directory, args, timeoutMs = 15000) {
@@ -11904,7 +11912,7 @@ async function precreateStandardWorktreeSession(args) {
11904
11912
  const laneProfile = computeLaneRuntimeProfile(worktreeConfig.runtime_isolation, laneIndex, handle.worktreePath);
11905
11913
  if (laneProfile) {
11906
11914
  try {
11907
- const { writeLaneProfileToDiskReal } = await import("./core-pz87qafz.js");
11915
+ const { writeLaneProfileToDiskReal } = await import("./core-5bqceeft.js");
11908
11916
  await writeLaneProfileToDiskReal(handle.worktreePath, laneProfile.laneIndex, laneProfile.envOverrides);
11909
11917
  } catch {}
11910
11918
  }
@@ -12898,7 +12906,7 @@ async function finishStandardWorktreeDispatch(directory, dispatch, config, callI
12898
12906
  }
12899
12907
  clearWorktreeMergeStatus(statusKey);
12900
12908
  try {
12901
- const { removeLaneProfileFromDiskReal } = await import("./core-pz87qafz.js");
12909
+ const { removeLaneProfileFromDiskReal } = await import("./core-5bqceeft.js");
12902
12910
  await removeLaneProfileFromDiskReal(dispatch.handle.worktreePath, dispatch.laneIndex);
12903
12911
  } catch {}
12904
12912
  const state = serializationStateBySessionID.get(dispatch.parentSessionID);
@@ -20936,9 +20944,23 @@ async function repairTaskWorkflowUnderPlanLock(options) {
20936
20944
  transitionId: existingWal.transitionId
20937
20945
  };
20938
20946
  }
20939
- if (existingWal === null && options.currentPlanStatus !== "completed" && options.currentPlanStatus !== "blocked" && options.currentPlanStatus !== "closed") {
20947
+ if (existingWal === null && options.currentPlanStatus !== "completed" && options.currentPlanStatus !== "blocked" && options.currentPlanStatus !== "closed" && options.currentPlanStatus !== "in_progress") {
20940
20948
  throw new Error(`TASK_REPAIR_NOT_BACKWARD: cannot create a repair from plan status ${options.currentPlanStatus}`);
20941
20949
  }
20950
+ if (existingWal === null && options.currentPlanStatus === "in_progress") {
20951
+ let wedgeEscalated = false;
20952
+ try {
20953
+ wedgeEscalated = getCoderRetryEscalationActions(options.directory, options.taskId, snapshot.retryEpoch).has("user_escalation") && snapshot.retryCount >= 3;
20954
+ } catch (error2) {
20955
+ if (error2 instanceof Error && error2.message === "CORE_EVENT_AUTHORITY_INDEX_UNREADABLE") {
20956
+ throw new Error("TASK_REPAIR_ESCALATION_INDEX_UNREADABLE: cannot verify the retry-escalation wedge evidence for an in_progress repair " + "(the core-event authority index is unreadable). The unreadable index is not content-restored: a later authority write rebuilds it from subsequent events only, so escalation evidence already folded out of the retained events window stays lost, and producers may refuse while the index is unreadable. " + "Recovery without discarding the events trail: re-dispatching the task re-runs the retry ladder from scratch and re-records the rungs; /swarm reset is the destructive full reset (it clears the plan, the events trail, and run state \u2014 session state is reset-session's charter and survives). Admission refuses to guess.");
20957
+ }
20958
+ throw error2;
20959
+ }
20960
+ if (!wedgeEscalated) {
20961
+ throw new Error(`TASK_REPAIR_NOT_BACKWARD: cannot create a repair from plan status ${options.currentPlanStatus} \u2014 an in_progress task is repairable only once the coder retry ladder has recorded a durable user_escalation for its current retry epoch with retryCount at the threshold; no such record is visible for this task.`);
20962
+ }
20963
+ }
20942
20964
  const wal = existingWal ?? {
20943
20965
  version: 1,
20944
20966
  state: "PREPARED",
@@ -29586,7 +29608,7 @@ function clearCriticalShownIds(sessionID) {
29586
29608
  async function rehydratePrSubscriptions(sessionID, directory) {
29587
29609
  const map = new Map;
29588
29610
  try {
29589
- const { listActive: listActive2 } = await import("./pr-subscriptions-cn13b19x.js");
29611
+ const { listActive: listActive2 } = await import("./pr-subscriptions-e92eg4ts.js");
29590
29612
  const records = await listActive2(directory);
29591
29613
  for (const record of records) {
29592
29614
  if (record.sessionID !== sessionID)
@@ -29814,6 +29836,9 @@ var PrFeedbackStageARecordSchema = exports_external.object({
29814
29836
  source: exports_external.string().min(1),
29815
29837
  validatorContract: exports_external.object({ path: exports_external.string().min(1), id: exports_external.string().min(1) }).strict().optional()
29816
29838
  }).strict()).max(256).optional(),
29839
+ baseRef: exports_external.string().min(1).max(256).optional(),
29840
+ baseSha: exports_external.string().regex(/^(?:[0-9a-f]{40}|[0-9a-f]{64})$/).optional(),
29841
+ baseVerification: exports_external.enum(["caller-asserted", "none"]).optional(),
29817
29842
  validatedAt: exports_external.string().min(1)
29818
29843
  }).strict();
29819
29844
  var PrFeedbackGateBatchRecordSchema = exports_external.object({
@@ -31456,45 +31481,87 @@ async function bindPrWorkflowHeadWhileLocked(directory, normalizedSessionID, prH
31456
31481
  throw error2;
31457
31482
  }
31458
31483
  }
31459
- async function rebindPrFeedbackHead(directory, sessionID, prHeadSha) {
31460
- const state = await requireBoundState2(directory, sessionID, "PR_FEEDBACK");
31461
- const normalizedHead = normalizePrHeadSha(prHeadSha);
31462
- if (state.prFeedbackReadyToPublish) {
31463
- throw new Error("BLOCKED: PR_FEEDBACK rebind is refused while publication is armed; complete the workflow (or push the bound commit) before rebinding.");
31484
+ async function maybeFastForwardRebindHead(directory, normalizedHead) {
31485
+ const tracking = await _test_exports2.resolveCurrentUpstreamPushTargetAsync(directory).catch(() => null);
31486
+ if (!tracking?.remoteTrackingRef)
31487
+ return;
31488
+ const trackingHead = await _test_exports2.resolveLocalRefHeadAsync(directory, tracking.remoteTrackingRef);
31489
+ if (!trackingHead || trackingHead !== normalizedHead.toLowerCase())
31490
+ return;
31491
+ const currentHead = (await _test_exports2.resolveCurrentGitHeadAsync(directory))?.trim().toLowerCase();
31492
+ if (!currentHead)
31493
+ return;
31494
+ if (currentHead === normalizedHead.toLowerCase())
31495
+ return;
31496
+ const ancestry = await _test_exports2.resolveIsAncestorAsync(directory, currentHead, normalizedHead);
31497
+ if (ancestry === null) {
31498
+ throw new Error(`BLOCKED: PR_FEEDBACK rebind fast-forward could not verify whether "${normalizedHead}" is a descendant of the current HEAD "${currentHead}" (the ancestry probe timed out or its output was truncated); nothing moved \u2014 retry the rebind`);
31464
31499
  }
31465
- const rebindRead = readDelegationsDetailed(directory);
31466
- if (rebindRead.status === "uncertain") {
31467
- throw new Error(`BLOCKED: PR_FEEDBACK rebind refused while the delegation store is unreadable after ${rebindRead.attempts} attempts (${rebindRead.reason}); in-flight lanes are UNKNOWN. Restore the store before rebinding.`);
31500
+ if (!ancestry) {
31501
+ throw new Error(`BLOCKED: PR_FEEDBACK rebind fast-forward refused: the bound tracking ref ${tracking.remoteTrackingRef} points at "${normalizedHead}", which is not a descendant of the current HEAD "${currentHead}"; resolve the divergence manually (push the repair, then rebind) \u2014 the gate never merges or rebases`);
31468
31502
  }
31469
- const openLanes = rebindRead.records.filter((record) => record.parentSessionId === state.sessionID && record.mode?.startsWith("swarm-pr-") && (record.status === "pending" || record.status === "running"));
31470
- if (openLanes.length > 0) {
31471
- throw new Error(`BLOCKED: PR_FEEDBACK rebind refused while ${openLanes.length} PR workflow lane(s) are still in flight; collect their results first.`);
31503
+ if (await _test_exports2.resolveIsWorkingTreeCleanAsync(directory) !== true) {
31504
+ throw new Error("BLOCKED: PR_FEEDBACK rebind fast-forward requires a clean index and working tree; clean the tree first, then rebind");
31472
31505
  }
31473
- if (normalizedHead === state.prHeadSha) {
31474
- throw new Error(`BLOCKED: PR_FEEDBACK rebind to the current intake head "${normalizedHead}" is a no-op; a rebind must move to a genuinely new verified PR head after merge/rebase repair.`);
31506
+ const moved = await _test_exports2.fastForwardToRefAsync(directory, tracking.remoteTrackingRef);
31507
+ if (!moved) {
31508
+ throw new Error(`BLOCKED: PR_FEEDBACK rebind fast-forward to ${tracking.remoteTrackingRef} failed or timed out; if git left an index.lock or a partially updated tree, remove the lock / restore the tree manually before retrying \u2014 otherwise a plain retry of the rebind completes it`);
31475
31509
  }
31476
- await assertCurrentCheckoutHead(directory, normalizedHead, state.mode);
31477
- await assertPrFeedbackTrackingCheckout(directory, normalizedHead);
31478
- const nextState = {
31479
- ...state,
31480
- prHeadSha: normalizedHead,
31481
- prFeedbackStageA: undefined,
31482
- prFeedbackVerifications: undefined,
31483
- prFeedbackGateBatches: undefined,
31484
- prFeedbackRebindCount: (state.prFeedbackRebindCount ?? 0) + 1,
31485
- updatedAt: isoNow()
31486
- };
31487
- try {
31488
- appendCoreEventSync(directory, {
31489
- type: "pr_feedback_rebound",
31490
- timestamp: isoNow(),
31491
- sessionID: state.sessionID,
31492
- previousPrHeadSha: state.prHeadSha,
31510
+ }
31511
+ async function rebindPrFeedbackHead(directory, sessionID, prHeadSha) {
31512
+ return withPrWorkflowCheckoutMutationLock(directory, async () => {
31513
+ const state = await requireBoundState2(directory, sessionID, "PR_FEEDBACK");
31514
+ const normalizedHead = normalizePrHeadSha(prHeadSha).toLowerCase();
31515
+ if (state.prFeedbackReadyToPublish) {
31516
+ throw new Error("BLOCKED: PR_FEEDBACK rebind is refused while publication is armed; complete the workflow (or push the bound commit) before rebinding.");
31517
+ }
31518
+ const rebindRead = readDelegationsDetailed(directory);
31519
+ if (rebindRead.status === "uncertain") {
31520
+ throw new Error(`BLOCKED: PR_FEEDBACK rebind refused while the delegation store is unreadable after ${rebindRead.attempts} attempts (${rebindRead.reason}); in-flight lanes are UNKNOWN. Restore the store before rebinding.`);
31521
+ }
31522
+ const openLanes = rebindRead.records.filter((record) => record.parentSessionId === state.sessionID && record.mode?.startsWith("swarm-pr-") && (record.status === "pending" || record.status === "running"));
31523
+ if (openLanes.length > 0) {
31524
+ throw new Error(`BLOCKED: PR_FEEDBACK rebind refused while ${openLanes.length} PR workflow lane(s) are still in flight; collect their results first.`);
31525
+ }
31526
+ if (normalizedHead === state.prHeadSha) {
31527
+ throw new Error(`BLOCKED: PR_FEEDBACK rebind to the current intake head "${normalizedHead}" is a no-op; a rebind must move to a genuinely new verified PR head after merge/rebase repair.`);
31528
+ }
31529
+ try {
31530
+ await maybeFastForwardRebindHead(directory, normalizedHead);
31531
+ await assertCurrentCheckoutHead(directory, normalizedHead, state.mode);
31532
+ await assertPrFeedbackTrackingCheckout(directory, normalizedHead);
31533
+ } catch (error2) {
31534
+ const currentHead = (await _test_exports2.resolveCurrentGitHeadAsync(directory).catch(() => null))?.trim().toLowerCase();
31535
+ if (currentHead !== undefined && currentHead !== null && currentHead !== (state.prHeadSha ?? "").toLowerCase() && error2 instanceof Error) {
31536
+ throw new Error(`BLOCKED: ${error2.message} NOTE: the checkout HEAD is "${currentHead}" while the bound intake head is still "${state.prHeadSha}" \u2014 the fast-forward already moved HEAD; a plain retry of the same rebind completes it`, { cause: error2 });
31537
+ }
31538
+ throw error2;
31539
+ }
31540
+ const nextState = {
31541
+ ...state,
31493
31542
  prHeadSha: normalizedHead,
31494
- rebindCount: nextState.prFeedbackRebindCount
31495
- });
31496
- } catch {}
31497
- return withSessionStateMutation(directory, state.sessionID, async () => writeStateWhileLocked(directory, nextState));
31543
+ prFeedbackStageA: undefined,
31544
+ prFeedbackVerifications: undefined,
31545
+ prFeedbackGateBatches: undefined,
31546
+ prFeedbackRebindCount: (state.prFeedbackRebindCount ?? 0) + 1,
31547
+ updatedAt: isoNow()
31548
+ };
31549
+ try {
31550
+ appendCoreEventSync(directory, {
31551
+ type: "pr_feedback_rebound",
31552
+ timestamp: isoNow(),
31553
+ sessionID: state.sessionID,
31554
+ previousPrHeadSha: state.prHeadSha,
31555
+ prHeadSha: normalizedHead,
31556
+ rebindCount: nextState.prFeedbackRebindCount
31557
+ });
31558
+ } catch {}
31559
+ try {
31560
+ return await withSessionStateMutation(directory, state.sessionID, async () => writeStateWhileLocked(directory, nextState));
31561
+ } catch (error2) {
31562
+ throw new Error(`BLOCKED: PR_FEEDBACK rebind moved the checkout toward "${normalizedHead}" but could not persist the rebind state (${error2 instanceof Error ? error2.message : String(error2)}); HEAD is already at the new head \u2014 retry the same rebind to complete it`, { cause: error2 });
31563
+ }
31564
+ });
31498
31565
  }
31499
31566
  async function bindPrReviewBase(directory, sessionID, options) {
31500
31567
  let state = await bindPrWorkflowHead(directory, sessionID, options.prHeadSha);
@@ -31538,7 +31605,12 @@ async function assertCurrentCheckoutHead(directory, expectedHead, mode = "PR_REV
31538
31605
  }
31539
31606
  async function assertPrReviewCleanCheckout(directory, mode = "PR_REVIEW") {
31540
31607
  if (await _test_exports2.resolveIsWorkingTreeCleanAsync(directory) !== true) {
31541
- throw new Error(`BLOCKED: ${mode} requires a clean index and working tree at the exact PR head`);
31608
+ const dirtyPaths = await _test_exports2.resolveWorkingTreeDirtyPathsAsync(directory);
31609
+ const sanitizePath = (value) => value.replace(/[\p{Cc}]/gu, (ch) => `\\u${ch.charCodeAt(0).toString(16).padStart(4, "0")}`);
31610
+ const shown = dirtyPaths ? dirtyPaths.slice(0, PR_WORKFLOW_DIRTY_PATH_DISCLOSURE_LIMIT).map(sanitizePath) : [];
31611
+ const total = dirtyPaths ? dirtyPaths.length : 0;
31612
+ const detail = shown.length > 0 ? ` Dirty paths (first ${shown.length} of ${total}): ${shown.join(", ")}.` : "";
31613
+ throw new Error(`BLOCKED: ${mode} requires a clean index and working tree at the exact PR head.${detail}`);
31542
31614
  }
31543
31615
  }
31544
31616
  async function assertPrFeedbackTrackingCheckout(directory, prHeadSha) {
@@ -33048,6 +33120,11 @@ async function recordPrFeedbackStageA(directory, sessionID, revisionDigest, chec
33048
33120
  feedbackItemIds: reproductionFeedbackItemIds,
33049
33121
  applicableCategories: normalizedCategories,
33050
33122
  applicableObligations,
33123
+ ...options.baseIdentity !== undefined ? {
33124
+ baseRef: options.baseIdentity.baseRef,
33125
+ baseSha: options.baseIdentity.baseSha
33126
+ } : {},
33127
+ baseVerification: options.baseIdentity?.baseVerification,
33051
33128
  validatedAt: isoNow()
33052
33129
  },
33053
33130
  prFeedbackGateBatches: retainsGateBatches ? [...state.prFeedbackGateBatches ?? []] : [],
@@ -35332,11 +35409,19 @@ async function enforcePrWorkflowToolBefore(directory, sessionID, toolName, args,
35332
35409
  const isDetachedFeedbackCheckout = Boolean(detachedFeedbackSwitchMatch?.[1] && isSafeGitRefToken(detachedFeedbackSwitchMatch[1])) || /^gh\s+pr\s+checkout\b.*\s--detach(?:\s|$)/i.test(command);
35333
35410
  const containsGitCommitShell = isShellCommandRequiringVerification && /\bgit\b(?:(?![;&|]).){0,200}\bcommit\b/i.test(command);
35334
35411
  const isStandaloneGitCommitShell = containsGitCommitShell && isSafeStandaloneGitCommit(command);
35412
+ const isStandaloneGitAddShell = isShellCommandRequiringVerification && isSafeStandaloneGitAdd(command);
35335
35413
  const isPublicationShell = isShellCommandRequiringVerification && (/\bgit\b(?:(?![;&|]).){0,200}\bpush\b/i.test(command) || /\bgh\s+(?:api|pr|issue|run)\b/i.test(command));
35336
- const isPublicationTool = !isInternalWorkflowTool && isRemoteMutationTool;
35414
+ const isTrustedObserveTool = trustedCapability === "observe" && isTrustedWorkflowTool;
35415
+ const isPublicationTool = !isInternalWorkflowTool && !isTrustedObserveTool && isRemoteMutationTool;
35337
35416
  const isCoderTask = isDirectAgentTask && requestedRoles.length > 0 && requestedRoles.every((role) => role === "coder");
35338
35417
  const blockedShellDiagnosis = isShellTool && command && !isReadOnlyShell && shellPermissionEnvelope ? ` ${describeBlockedPrReviewShellCommand(command, shellPermissionEnvelope)}` : "";
35339
35418
  if (state.mode === "PR_REVIEW") {
35419
+ if (normalizedTool === "test_runner" && state.prHeadSha) {
35420
+ throw new Error("BLOCKED: PR_REVIEW test_runner would execute inside the bound checkout at the exact PR head and its outputs (snapshot files, fixtures) would dirty the tree; run validation through dispatch_lanes_async lanes or PR_FEEDBACK Stage A");
35421
+ }
35422
+ if (normalizedTool === "swarm_command" && isPrWorkflowRecoverySwarmCommandArgs(args)) {
35423
+ return;
35424
+ }
35340
35425
  let hasAuthorizedDirectReentry = false;
35341
35426
  if (isDirectAgentTask && requestedAgentFields.length === 1 && requestedAgentFields[0] === "subagent_type" && requestedRoles.length === 1 && (requestedRoles[0] === "reviewer" || requestedRoles[0] === "test_engineer") && callID) {
35342
35427
  hasAuthorizedDirectReentry = await hasActivePrReviewReentryAuthorization(directory, sessionID, {
@@ -35355,6 +35440,9 @@ async function enforcePrWorkflowToolBefore(directory, sessionID, toolName, args,
35355
35440
  if (isDirectAgentTask && !isCoderTask) {
35356
35441
  throw new Error("BLOCKED: PR_FEEDBACK reviewer, test, critic, explorer, and unknown agent lanes require structured dispatch_lanes_async provenance");
35357
35442
  }
35443
+ if (normalizedTool === "swarm_command" && isPrWorkflowRecoverySwarmCommandArgs(args)) {
35444
+ return;
35445
+ }
35358
35446
  if (!isInternalWorkflowTool && !isDirectAgentTask && !isDirectWrite && !isShellTool && !isNamedReadOnlyTool) {
35359
35447
  throw new Error("BLOCKED: PR_FEEDBACK rejects unclassified plugin/MCP tools; use positively classified observation tools, built-in structured write tools after verification, or the workflow controller" + describePrWorkflowControllerToolNames(state.mode));
35360
35448
  }
@@ -35406,9 +35494,43 @@ async function enforcePrWorkflowToolBefore(directory, sessionID, toolName, args,
35406
35494
  if (!state.prHeadSha && isCanonicalReviewCheckout)
35407
35495
  return;
35408
35496
  if (isStandaloneGitCommitShell) {
35497
+ const messageFile = extractStandaloneGitCommitMessageFile(command);
35498
+ if (messageFile !== null) {
35499
+ const cwdBase = resolveStandaloneGitCommandCwd(command, directory);
35500
+ const resolvedFile = path34.resolve(cwdBase, messageFile);
35501
+ const containmentRoot = await _test_exports2.resolveRepoTopLevelAsync(directory);
35502
+ if (isPathInsideRepository(resolvedFile, directory) || containmentRoot !== null && isPathInsideRepository(resolvedFile, containmentRoot)) {
35503
+ throw new Error(`BLOCKED: PR_FEEDBACK commit -F message file "${messageFile}" resolves inside the repository; an in-repo message file would dirty the clean-tree arming check. The message file must live outside the repository; author it with the prepare_pr_feedback_commit_message tool and pass the returned path`);
35504
+ }
35505
+ }
35409
35506
  await assertPrFeedbackReadyToPublish(directory, sessionID);
35410
35507
  return;
35411
35508
  }
35509
+ if (isStandaloneGitAddShell) {
35510
+ const stagedPaths2 = extractStandaloneGitAddPaths(command);
35511
+ const changedPaths = state.prHeadSha ? await _test_exports2.resolvePrWorkflowChangedPathSetAsync(directory, state.prHeadSha) : null;
35512
+ const foldToken = (token) => token.replace(/\\/g, "/").replace(/^\.\//, "");
35513
+ const tokenAdmitted = (token) => {
35514
+ if (changedPaths === null)
35515
+ return false;
35516
+ const folded = foldToken(token);
35517
+ if (changedPaths.has(folded))
35518
+ return true;
35519
+ let foldedMatches = 0;
35520
+ for (const member of changedPaths) {
35521
+ if (member.toLowerCase() === folded.toLowerCase()) {
35522
+ foldedMatches += 1;
35523
+ if (foldedMatches > 1)
35524
+ return false;
35525
+ }
35526
+ }
35527
+ return foldedMatches === 1;
35528
+ };
35529
+ if (changedPaths !== null && stagedPaths2.length > 0 && stagedPaths2.every(tokenAdmitted)) {
35530
+ await assertPrFeedbackReadyToPublish(directory, sessionID);
35531
+ return;
35532
+ }
35533
+ }
35412
35534
  if (isPublicationShell || isPublicationTool) {
35413
35535
  throw new Error("BLOCKED: PR_FEEDBACK publication is not armed; finish every ordered gate, create the one approved commit, and call complete_pr_workflow before publishing");
35414
35536
  }
@@ -35422,6 +35544,8 @@ async function enforcePrWorkflowToolBefore(directory, sessionID, toolName, args,
35422
35544
  return;
35423
35545
  if (normalizedTool === "abort_pr_workflow")
35424
35546
  return;
35547
+ if (normalizedTool === "rebind_pr_feedback_head" || isTrustedObserveTool)
35548
+ return;
35425
35549
  await assertPrFeedbackVerificationSettled(directory, sessionID);
35426
35550
  }
35427
35551
  async function readPrReviewReentryBindingContext(directory, sessionID) {
@@ -35872,6 +35996,12 @@ var _test_exports2 = {
35872
35996
  resolveCommitCountSinceAsync,
35873
35997
  resolveIsWorkingTreeClean,
35874
35998
  resolveIsWorkingTreeCleanAsync,
35999
+ resolveLocalRefHeadAsync,
36000
+ resolveIsAncestorAsync,
36001
+ fastForwardToRefAsync,
36002
+ resolveRepoTopLevelAsync,
36003
+ resolvePrWorkflowChangedPathSetAsync,
36004
+ resolveWorkingTreeDirtyPathsAsync,
35875
36005
  resolveIsExactSingleChildCommit,
35876
36006
  resolveIsExactSingleChildCommitAsync,
35877
36007
  resolvePrReviewDiffStats,
@@ -36061,9 +36191,12 @@ var PR_REVIEW_CONTROLLER_TOOLS = new Set([
36061
36191
  "write_pr_review_artifact",
36062
36192
  "write_pr_review_trigger_eval"
36063
36193
  ]);
36194
+ var PR_WORKFLOW_DIRTY_PATH_DISCLOSURE_LIMIT = 5;
36064
36195
  var PR_FEEDBACK_CONTROLLER_TOOLS = new Set([
36065
36196
  "invalidate_pr_feedback_publication",
36197
+ "prepare_pr_feedback_commit_message",
36066
36198
  "prepare_pr_feedback_scope",
36199
+ "rebind_pr_feedback_head",
36067
36200
  "run_pr_feedback_stage_a"
36068
36201
  ]);
36069
36202
  function isPrWorkflowControllerTool(mode, toolName) {
@@ -36442,6 +36575,194 @@ function describeShellSyntaxViolation(command) {
36442
36575
  return "Reason: compound-syntax (;, &&, |, <, >, backtick, or $()/@()). Run ONE command per call; a single leading `cd <dir> &&` and a trailing `2>&1` are tolerated for reads only.";
36443
36576
  }
36444
36577
  }
36578
+ function isPrWorkflowRecoverySwarmCommandArgs(args) {
36579
+ const raw = typeof args?.command === "string" ? args.command : typeof args?.subcommand === "string" ? args.subcommand : "";
36580
+ const parts = raw.trim().toLowerCase().split(/\s+/).filter(Boolean);
36581
+ if (parts.length === 0)
36582
+ return false;
36583
+ if (parts[0] === "diagnose")
36584
+ return true;
36585
+ return parts[0] === "guardrail" && parts[1] === "reset";
36586
+ }
36587
+ function isSafeStandaloneGitAdd(command) {
36588
+ if (hasUnsafeShellControlSyntax(command))
36589
+ return false;
36590
+ const match = /^git\s+add\s+--\s+(.+)$/i.exec(command.trim());
36591
+ if (!match)
36592
+ return false;
36593
+ const paths = extractStandaloneGitAddPaths(command);
36594
+ return paths.length > 0 && paths.every((token) => isSanctionedAddPath(token));
36595
+ }
36596
+ function isSanctionedAddPath(token) {
36597
+ if (token.length === 0)
36598
+ return false;
36599
+ if (/["'`\\]/.test(token))
36600
+ return false;
36601
+ if (/[*?[\]]/.test(token))
36602
+ return false;
36603
+ if (token.includes(":"))
36604
+ return false;
36605
+ if (token.startsWith("-"))
36606
+ return false;
36607
+ return true;
36608
+ }
36609
+ function extractStandaloneGitAddPaths(command) {
36610
+ const tokens = tokenizeStandaloneGitCommand(command);
36611
+ if (tokens.length < 3)
36612
+ return [];
36613
+ if (tokens[0].quoted || tokens[0].text.toLowerCase() !== "git")
36614
+ return [];
36615
+ if (tokens[1].quoted || tokens[1].text.toLowerCase() !== "add")
36616
+ return [];
36617
+ const separator = tokens[2];
36618
+ if (!separator || separator.text !== "--")
36619
+ return [];
36620
+ return tokens.slice(3).map((token) => token.text).filter(Boolean);
36621
+ }
36622
+ function tokenizeStandaloneGitCommand(command) {
36623
+ const tokens = [];
36624
+ let current = "";
36625
+ let started = false;
36626
+ let beganQuoted = false;
36627
+ let inQuotes = false;
36628
+ const flush = () => {
36629
+ if (started) {
36630
+ tokens.push({ text: current, quoted: beganQuoted });
36631
+ }
36632
+ current = "";
36633
+ started = false;
36634
+ beganQuoted = false;
36635
+ };
36636
+ for (const ch of command) {
36637
+ if (ch === '"') {
36638
+ if (!started) {
36639
+ started = true;
36640
+ beganQuoted = true;
36641
+ }
36642
+ inQuotes = !inQuotes;
36643
+ continue;
36644
+ }
36645
+ if (!inQuotes && (ch === " " || ch === "\t" || ch === `
36646
+ `)) {
36647
+ flush();
36648
+ continue;
36649
+ }
36650
+ started = true;
36651
+ current += ch;
36652
+ }
36653
+ flush();
36654
+ return tokens;
36655
+ }
36656
+ function standaloneGitCommitSubcommandIndex(tokens) {
36657
+ for (let i = 0;i < tokens.length; i += 1) {
36658
+ if (!tokens[i].quoted && tokens[i].text === "commit")
36659
+ return i;
36660
+ }
36661
+ return -1;
36662
+ }
36663
+ function extractStandaloneGitCommitMessageFile(command) {
36664
+ const tokens = tokenizeStandaloneGitCommand(command);
36665
+ const subcommand = standaloneGitCommitSubcommandIndex(tokens);
36666
+ if (subcommand < 0)
36667
+ return null;
36668
+ let lastMessageFile = null;
36669
+ for (let i = subcommand + 1;i < tokens.length; i += 1) {
36670
+ const token = tokens[i];
36671
+ const text = token.text.replace(/^\^+/, "");
36672
+ if (text === "--")
36673
+ break;
36674
+ if (text === "-F" || text === "--file") {
36675
+ const value = tokens[i + 1];
36676
+ lastMessageFile = value === undefined ? null : value.text;
36677
+ continue;
36678
+ }
36679
+ if (GIT_COMMIT_VALUE_TAKING_OPTIONS.has(text)) {
36680
+ i += 1;
36681
+ continue;
36682
+ }
36683
+ if (text.startsWith("--")) {
36684
+ const eq = text.indexOf("=");
36685
+ if (eq < 0) {
36686
+ if (/^--fil$/i.test(text)) {
36687
+ const value = tokens[i + 1];
36688
+ lastMessageFile = value === undefined ? null : value.text;
36689
+ i += 1;
36690
+ }
36691
+ continue;
36692
+ }
36693
+ const name = text.slice(2, eq).toLowerCase();
36694
+ if (name === "file" || name === "fil") {
36695
+ lastMessageFile = text.slice(eq + 1);
36696
+ }
36697
+ continue;
36698
+ }
36699
+ if (text.startsWith("-") && text.length > 1) {
36700
+ let consumedNext = false;
36701
+ for (let p = 1;p < text.length; p += 1) {
36702
+ const c = text[p];
36703
+ if (c === "F") {
36704
+ const rest = text.slice(p + 1);
36705
+ if (rest.length > 0) {
36706
+ lastMessageFile = rest;
36707
+ } else {
36708
+ lastMessageFile = tokens[i + 1]?.text ?? null;
36709
+ consumedNext = true;
36710
+ }
36711
+ break;
36712
+ }
36713
+ if ("cCmt".includes(c)) {
36714
+ if (p + 1 >= text.length)
36715
+ consumedNext = true;
36716
+ break;
36717
+ }
36718
+ }
36719
+ if (consumedNext)
36720
+ i += 1;
36721
+ }
36722
+ }
36723
+ return lastMessageFile;
36724
+ }
36725
+ var GIT_COMMIT_VALUE_TAKING_OPTIONS = new Set([
36726
+ "-m",
36727
+ "--message",
36728
+ "-c",
36729
+ "--reedit-message",
36730
+ "-C",
36731
+ "--reuse-message",
36732
+ "-t",
36733
+ "--template",
36734
+ "--fixup",
36735
+ "--squash",
36736
+ "--author",
36737
+ "--date",
36738
+ "--cleanup",
36739
+ "--trailer",
36740
+ "--pathspec-from-file"
36741
+ ]);
36742
+ function resolveStandaloneGitCommandCwd(command, directory) {
36743
+ const tokens = tokenizeStandaloneGitCommand(command);
36744
+ const subcommand = standaloneGitCommitSubcommandIndex(tokens);
36745
+ const limit = subcommand >= 0 ? subcommand : tokens.length;
36746
+ for (let i = 0;i < limit; i += 1) {
36747
+ if (!tokens[i].quoted && tokens[i].text === "-C" && tokens[i + 1]) {
36748
+ return path34.resolve(directory, tokens[i + 1].text);
36749
+ }
36750
+ }
36751
+ return directory;
36752
+ }
36753
+ function isPathInsideRepository(target, repoRoot) {
36754
+ const lexicalInside = (value, root) => {
36755
+ const rel = path34.relative(root, value);
36756
+ return rel === "" || !rel.startsWith("..") && !path34.isAbsolute(rel);
36757
+ };
36758
+ if (lexicalInside(target, repoRoot))
36759
+ return true;
36760
+ try {
36761
+ return lexicalInside(realpathSync5(target), realpathSync5(repoRoot));
36762
+ } catch {
36763
+ return false;
36764
+ }
36765
+ }
36445
36766
  function isSafeStandaloneGitCommit(command) {
36446
36767
  if (hasUnsafeShellControlSyntax(command))
36447
36768
  return false;
@@ -42660,8 +42981,8 @@ init_schema();
42660
42981
  init_logger();
42661
42982
 
42662
42983
  // src/tools/repo-graph/safe-realpath.ts
42663
- import { realpathSync as realpathSync6 } from "fs";
42664
- function safeRealpathSync(targetPath, fallback, realpathResolver = realpathSync6) {
42984
+ import { realpathSync as realpathSync7 } from "fs";
42985
+ function safeRealpathSync(targetPath, fallback, realpathResolver = realpathSync7) {
42665
42986
  try {
42666
42987
  return realpathResolver(targetPath);
42667
42988
  } catch (error2) {
@@ -46658,9 +46979,9 @@ function hashContent(content) {
46658
46979
  return createHash29("sha1").update(content).digest("hex");
46659
46980
  }
46660
46981
  async function loadConfigForPolicyCurator(directory) {
46661
- const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-qv9bvhyz.js");
46982
+ const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-jw861rj0.js");
46662
46983
  try {
46663
- const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-71g0ps66.js");
46984
+ const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-mbygjbj8.js");
46664
46985
  const { config: loadedConfig } = loadPluginConfigWithMeta2(directory);
46665
46986
  return KnowledgeConfigSchema2.parse(loadedConfig.knowledge ?? {});
46666
46987
  } catch {
@@ -49718,7 +50039,7 @@ async function resolveCuratorLLMDelegate(directory, mode, sessionId) {
49718
50039
  const seam = _internals50.createCuratorLLMDelegate;
49719
50040
  if (seam)
49720
50041
  return seam(directory, mode, sessionId);
49721
- const { createCuratorLLMDelegate } = await import("./curator-llm-factory-cg1p6ysr.js");
50042
+ const { createCuratorLLMDelegate } = await import("./curator-llm-factory-nbprwszt.js");
49722
50043
  return createCuratorLLMDelegate(directory, mode, sessionId);
49723
50044
  }
49724
50045
  async function reconcileCloseTerminalStateForPlan(directory, targetPlan, options) {
@@ -50113,7 +50434,7 @@ async function runFinalizeStage(ctx) {
50113
50434
  }
50114
50435
  }
50115
50436
  try {
50116
- const { CuratorConfigSchema: CCS } = await import("./schema-qv9bvhyz.js");
50437
+ const { CuratorConfigSchema: CCS } = await import("./schema-jw861rj0.js");
50117
50438
  const { config: pmLoadedConfig } = _internals50.loadPluginConfigWithMeta(ctx.directory);
50118
50439
  const curatorCfg = CCS.parse(pmLoadedConfig.curator ?? {});
50119
50440
  if (curatorCfg.enabled && curatorCfg.postmortem_enabled) {
@@ -54146,7 +54467,7 @@ function serializeAgentSession(s) {
54146
54467
  }
54147
54468
  async function writeSnapshot(directory, state) {
54148
54469
  try {
54149
- const { ensureSnapshotCoordinationReady } = await import("./snapshot-coordination-init-7c0s65jw.js");
54470
+ const { ensureSnapshotCoordinationReady } = await import("./snapshot-coordination-init-11qb0jbs.js");
54150
54471
  await ensureSnapshotCoordinationReady(directory);
54151
54472
  const snapshot = {
54152
54473
  version: 3,
@@ -57286,7 +57607,7 @@ function planMerges(active, threshold, maxComparisons, maxMerges) {
57286
57607
  };
57287
57608
  }
57288
57609
  async function sweepActiveNearDuplicates(directory, options = {}) {
57289
- const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-71g0ps66.js");
57610
+ const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-mbygjbj8.js");
57290
57611
  const { config } = loadPluginConfigWithMeta2(directory);
57291
57612
  const sweepConfig = config.learning?.dedup_sweep;
57292
57613
  if (sweepConfig?.enabled === false)
@@ -58410,7 +58731,7 @@ async function runCuratorPhase(directory, phase, agentsDispatched, config, knowl
58410
58731
  }
58411
58732
  if (config.skill_generation_enabled === true && skillCandidates.length > 0) {
58412
58733
  try {
58413
- const skillModule = await import("./skill-generator-19ckpm74.js");
58734
+ const skillModule = await import("./skill-generator-dd1w9p3t.js");
58414
58735
  for (const cand of skillCandidates) {
58415
58736
  if (cand.confidence < (config.min_skill_confidence ?? DEFAULT_SKILL_MIN_CONFIDENCE)) {
58416
58737
  continue;
@@ -58882,7 +59203,7 @@ async function applyCuratorKnowledgeUpdates(directory, recommendations, knowledg
58882
59203
  } catch {}
58883
59204
  }
58884
59205
  if (contradictedEntries.length > 0 && knowledgeConfig.contradiction_threshold_action === "quarantine") {
58885
- const { maybeQuarantineOnContradiction } = await import("./knowledge-escalator-w7b32ak4.js");
59206
+ const { maybeQuarantineOnContradiction } = await import("./knowledge-escalator-k1mssp9r.js");
58886
59207
  for (const { id } of contradictedEntries) {
58887
59208
  try {
58888
59209
  await maybeQuarantineOnContradiction(directory, id, knowledgeConfig.contradiction_quarantine_threshold, knowledgeConfig.contradiction_quarantine_window_days);
@@ -59714,7 +60035,7 @@ async function runCuratorPostMortem(directory, options = {}) {
59714
60035
  warnings.push("Failed to collect knowledge summary.");
59715
60036
  }
59716
60037
  try {
59717
- const { getScanStatus } = await import("./scan-cursor-4xxfc42h.js");
60038
+ const { getScanStatus } = await import("./scan-cursor-yehnf9jt.js");
59718
60039
  const scanStatus = await getScanStatus(directory);
59719
60040
  if (scanStatus.remaining_estimate > 0) {
59720
60041
  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.`);
@@ -59886,9 +60207,9 @@ var _internals72 = {
59886
60207
  verifyPostMortemKnowledgeActions,
59887
60208
  repairPostMortemActions,
59888
60209
  loadDefaultKnowledgeConfig: async (directory) => {
59889
- const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-qv9bvhyz.js");
60210
+ const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-jw861rj0.js");
59890
60211
  try {
59891
- const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-71g0ps66.js");
60212
+ const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-mbygjbj8.js");
59892
60213
  const loaded = loadPluginConfigWithMeta2(directory);
59893
60214
  return KnowledgeConfigSchema2.parse(loaded.config.knowledge ?? {});
59894
60215
  } catch {
@@ -59896,11 +60217,11 @@ var _internals72 = {
59896
60217
  }
59897
60218
  },
59898
60219
  applyCuratorKnowledgeUpdates: async (directory, recommendations, knowledgeConfig, generation) => {
59899
- const { applyCuratorKnowledgeUpdates: applyCuratorKnowledgeUpdates2 } = await import("./curator-fvnptcnw.js");
60220
+ const { applyCuratorKnowledgeUpdates: applyCuratorKnowledgeUpdates2 } = await import("./curator-b3zn9w9q.js");
59900
60221
  return applyCuratorKnowledgeUpdates2(directory, recommendations, knowledgeConfig, generation);
59901
60222
  },
59902
60223
  checkHivePromotions: async (entries2, knowledgeConfig, directory) => {
59903
- const { checkHivePromotions } = await import("./hive-promoter-bmdgnmnf.js");
60224
+ const { checkHivePromotions } = await import("./hive-promoter-2dnv2xrg.js");
59904
60225
  return checkHivePromotions(entries2, knowledgeConfig, directory);
59905
60226
  },
59906
60227
  applyProposalTriage: async (directory, triage) => {
@@ -59909,7 +60230,7 @@ var _internals72 = {
59909
60230
  activateProposal,
59910
60231
  listSkills: listSkills2,
59911
60232
  sanitizeSlug
59912
- } = await import("./skill-generator-19ckpm74.js");
60233
+ } = await import("./skill-generator-dd1w9p3t.js");
59913
60234
  const result = {
59914
60235
  approved: [],
59915
60236
  rejected: [],
@@ -59951,7 +60272,7 @@ var _internals72 = {
59951
60272
  return result;
59952
60273
  },
59953
60274
  readPriorDriftReports: async (directory) => {
59954
- const { readPriorDriftReports: readPriorDriftReports2 } = await import("./curator-drift-c1x7jdxj.js");
60275
+ const { readPriorDriftReports: readPriorDriftReports2 } = await import("./curator-drift-ka477rrz.js");
59955
60276
  return readPriorDriftReports2(directory);
59956
60277
  },
59957
60278
  readSwarmKnowledge: (directory) => readKnowledge(resolveSwarmKnowledgePath(directory))
@@ -70221,9 +70542,9 @@ var _internals80 = {
70221
70542
  loadPluginConfigWithMeta,
70222
70543
  loadCuratorDeps: async () => {
70223
70544
  const [{ CuratorConfigSchema }, curator, { createCuratorLLMDelegate }] = await Promise.all([
70224
- import("./schema-qv9bvhyz.js"),
70225
- import("./curator-fvnptcnw.js"),
70226
- import("./curator-llm-factory-cg1p6ysr.js")
70545
+ import("./schema-jw861rj0.js"),
70546
+ import("./curator-b3zn9w9q.js"),
70547
+ import("./curator-llm-factory-nbprwszt.js")
70227
70548
  ]);
70228
70549
  return { CuratorConfigSchema, curator, createCuratorLLMDelegate };
70229
70550
  }
@@ -72673,7 +72994,7 @@ async function computeCurationDiagnostics(directory, entries2) {
72673
72994
  let scanCompleted = false;
72674
72995
  let scanRemaining = 0;
72675
72996
  try {
72676
- const { getScanStatus } = await import("./scan-cursor-4xxfc42h.js");
72997
+ const { getScanStatus } = await import("./scan-cursor-yehnf9jt.js");
72677
72998
  const status = await getScanStatus(directory);
72678
72999
  scanGeneration = status.generation;
72679
73000
  scanCompleted = status.completed;
@@ -72683,10 +73004,10 @@ async function computeCurationDiagnostics(directory, entries2) {
72683
73004
  try {
72684
73005
  const { isLinked: isLinked2 } = await import("./knowledge-link-1f91bzcc.js");
72685
73006
  if (isLinked2(directory)) {
72686
- const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-qv9bvhyz.js");
73007
+ const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-jw861rj0.js");
72687
73008
  let config;
72688
73009
  try {
72689
- const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-71g0ps66.js");
73010
+ const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-mbygjbj8.js");
72690
73011
  const loaded = loadPluginConfigWithMeta2(directory);
72691
73012
  config = KnowledgeConfigSchema2.parse(loaded.config.knowledge ?? {});
72692
73013
  } catch {
@@ -74142,7 +74463,7 @@ async function handleDoctorCommand(directory, args) {
74142
74463
  const result = runConfigDoctor(config, directory, planParallelizationEnabled);
74143
74464
  let output;
74144
74465
  if (enableAutoFix && result.hasAutoFixableIssues) {
74145
- const { runConfigDoctorWithFixes } = await import("./config-doctor-2tcp28sc.js");
74466
+ const { runConfigDoctorWithFixes } = await import("./config-doctor-20pd12nw.js");
74146
74467
  const fixResult = await runConfigDoctorWithFixes(directory, config, true, {
74147
74468
  applyLossy: true
74148
74469
  });
@@ -74180,7 +74501,7 @@ async function handleDoctorCommand(directory, args) {
74180
74501
  `;
74181
74502
  }
74182
74503
  try {
74183
- const { runModelPreflight } = await import("./model-preflight-k92fnbq8.js");
74504
+ const { runModelPreflight } = await import("./model-preflight-ks9j40t5.js");
74184
74505
  const preflight = await runModelPreflight(config, swarmState.opencodeClient, { generatedAgentNames: swarmState.generatedAgentNames });
74185
74506
  const missingSelection = preflight.resolutions.filter((resolution) => resolution.status === "missing-selection");
74186
74507
  const unresolved = preflight.catalogAvailable ? preflight.resolutions.filter((resolution) => resolution.status === "unresolved") : [];
@@ -74214,7 +74535,7 @@ async function handleDoctorCommand(directory, args) {
74214
74535
  }
74215
74536
  } catch {}
74216
74537
  try {
74217
- const { renderKnowledgeReceiptPhaseIdSection } = await import("./doctor-knowledge-receipt-phase-id-xwyb5sf8.js");
74538
+ const { renderKnowledgeReceiptPhaseIdSection } = await import("./doctor-knowledge-receipt-phase-id-nrk52ak6.js");
74218
74539
  output += await renderKnowledgeReceiptPhaseIdSection(directory, enableAutoFix);
74219
74540
  } catch {}
74220
74541
  const strayDirs = detectStraySwarmDirs(directory);
@@ -76231,7 +76552,7 @@ async function handleEvidenceCommand(directory, args) {
76231
76552
  return formatTaskEvidenceMarkdown(evidenceData);
76232
76553
  }
76233
76554
  async function handleEvidenceSummaryCommand(directory) {
76234
- const { buildEvidenceSummary } = await import("./evidence-summary-service-47cptvea.js");
76555
+ const { buildEvidenceSummary } = await import("./evidence-summary-service-qrr8zjhj.js");
76235
76556
  const artifact = await buildEvidenceSummary(directory);
76236
76557
  if (!artifact) {
76237
76558
  return "No plan found. Run `/swarm plan` to check plan status.";
@@ -77526,7 +77847,7 @@ import { spawnSync as spawnSync5 } from "child_process";
77526
77847
  import * as fs55 from "fs";
77527
77848
  import {
77528
77849
  readFileSync as readFileSync44,
77529
- realpathSync as realpathSync10,
77850
+ realpathSync as realpathSync11,
77530
77851
  statSync as statSync34,
77531
77852
  unlinkSync as unlinkSync17,
77532
77853
  writeFileSync as writeFileSync16
@@ -77803,8 +78124,8 @@ function isMissingExecutableFailure(message) {
77803
78124
  }
77804
78125
  function resolveContainedRegularFile(workingDir, filePath) {
77805
78126
  try {
77806
- const realWorkingDir = realpathSync10(path100.resolve(workingDir));
77807
- const realFilePath = realpathSync10(path100.resolve(realWorkingDir, filePath));
78127
+ const realWorkingDir = realpathSync11(path100.resolve(workingDir));
78128
+ const realFilePath = realpathSync11(path100.resolve(realWorkingDir, filePath));
77808
78129
  const relativePath2 = path100.relative(realWorkingDir, realFilePath);
77809
78130
  if (relativePath2 === "" || relativePath2 === ".." || relativePath2.startsWith(`..${path100.sep}`) || path100.isAbsolute(relativePath2)) {
77810
78131
  return;
@@ -90938,7 +91259,7 @@ ${USAGE14}`;
90938
91259
 
90939
91260
  // src/commands/memory.ts
90940
91261
  init_loader();
90941
- import { existsSync as existsSync66, readFileSync as readFileSync60, realpathSync as realpathSync15, statSync as statSync42 } from "fs";
91262
+ import { existsSync as existsSync66, readFileSync as readFileSync60, realpathSync as realpathSync16, statSync as statSync42 } from "fs";
90942
91263
  import * as path132 from "path";
90943
91264
  import { fileURLToPath as fileURLToPath4 } from "url";
90944
91265
  // src/memory/evaluation.ts
@@ -94439,7 +94760,7 @@ import {
94439
94760
  fstatSync as fstatSync8,
94440
94761
  openSync as openSync21,
94441
94762
  readSync as readSync14,
94442
- realpathSync as realpathSync14,
94763
+ realpathSync as realpathSync15,
94443
94764
  statSync as statSync41
94444
94765
  } from "fs";
94445
94766
  var import_proper_lockfile12 = __toESM(require_proper_lockfile(), 1);
@@ -99975,7 +100296,7 @@ function parseEvaluateArgs(directory, args) {
99975
100296
  }
99976
100297
  let realFixtures;
99977
100298
  try {
99978
- realFixtures = realpathSync15(resolvedFixtures);
100299
+ realFixtures = realpathSync16(resolvedFixtures);
99979
100300
  } catch {
99980
100301
  return {
99981
100302
  error: "--fixtures <directory> must be an existing directory inside the project or the bundled fixtures directory (path could not be resolved)"
@@ -99986,7 +100307,7 @@ function parseEvaluateArgs(directory, args) {
99986
100307
  path132.join(PACKAGE_ROOT, "tests", "fixtures", "memory-recall")
99987
100308
  ].map((root) => {
99988
100309
  try {
99989
- return realpathSync15(root);
100310
+ return realpathSync16(root);
99990
100311
  } catch {
99991
100312
  return null;
99992
100313
  }
@@ -100037,7 +100358,7 @@ function parseEvaluateArgs(directory, args) {
100037
100358
  };
100038
100359
  }
100039
100360
  try {
100040
- manifestPath = realpathSync15(resolvedManifest);
100361
+ manifestPath = realpathSync16(resolvedManifest);
100041
100362
  if (statSync42(manifestPath).size > MAX_HELDOUT_MANIFEST_BYTES) {
100042
100363
  return {
100043
100364
  error: `--manifest <file> exceeds the ${MAX_HELDOUT_MANIFEST_BYTES}-byte limit`
@@ -100045,7 +100366,7 @@ function parseEvaluateArgs(directory, args) {
100045
100366
  }
100046
100367
  const realRoots = [projectRoot, bundledRoot].map((root) => {
100047
100368
  try {
100048
- return realpathSync15(root);
100369
+ return realpathSync16(root);
100049
100370
  } catch {
100050
100371
  return null;
100051
100372
  }
@@ -100658,7 +100979,7 @@ function createCuratorLLMDelegate(directory, mode = "init", sessionId) {
100658
100979
  }
100659
100980
  const sdkOpts = signal ? { signal } : {};
100660
100981
  try {
100661
- const { getSwarmAgents: getSwarmAgents2, resolveFallbackModel: resolveFallbackModel2 } = await import("./index-kjhsssaq.js");
100982
+ const { getSwarmAgents: getSwarmAgents2, resolveFallbackModel: resolveFallbackModel2 } = await import("./index-qksw8p51.js");
100662
100983
  const createResult = await client.session.create({
100663
100984
  ...sessionId ? {
100664
100985
  body: {
@@ -102756,7 +103077,7 @@ async function cancelPrFeedbackLoopUnlocked(directory, sessionID, reason) {
102756
103077
  clearedEvents: []
102757
103078
  };
102758
103079
  try {
102759
- const { cancelPrFeedbackPublication: cancelPrFeedbackPublication2 } = await import("./pr-workflow-gate-74j5mcxh.js");
103080
+ const { cancelPrFeedbackPublication: cancelPrFeedbackPublication2 } = await import("./pr-workflow-gate-zqwde6r6.js");
102760
103081
  await cancelPrFeedbackPublication2(directory, sessionID, reason);
102761
103082
  } catch (err) {
102762
103083
  warn(`[pr-feedback-loop] cancelPrFeedbackPublication failed (fail-open): ${err instanceof Error ? err.message : String(err)}`);
@@ -112712,7 +113033,7 @@ async function handleResetSessionCommand(directory, args, sessionID) {
112712
113033
  "",
112713
113034
  "Session state cleared. Plan, evidence, and knowledge preserved.",
112714
113035
  "",
112715
- "In-memory circuit breakers and revision limits have been cleared. Durable per-task retry gates (the coder retry circuit breaker, bound to commit settlement in the events audit log and .swarm/evidence/) intentionally survive this reset. If a task is blocked with TASK_RETRY_CRITIC_REQUIRED waiting for a critic_sounding_board APPROVED verdict that was already obtained, have the architect record it with the approve_retry_sounding_board tool. A task left at rework_required also survives this reset; when the Stage B verdict did not require a code change, the architect can exit it with the recover_rework_task tool (issue #2755)."
113036
+ "In-memory circuit breakers and revision limits have been cleared. Durable per-task retry gates (the coder retry circuit breaker, bound to commit settlement in the events audit log and .swarm/evidence/) intentionally survive this reset. If a task is blocked with TASK_RETRY_CRITIC_REQUIRED waiting for a critic_sounding_board APPROVED verdict that was already obtained, have the architect record it with the approve_retry_sounding_board tool. A task left at rework_required also survives this reset; when the Stage B verdict did not require a code change, the architect can exit it with the recover_rework_task tool (issue #2755). A task wedged at TASK_RETRY_USER_ESCALATION_REQUIRED is exited with the audited update_task_status force repair (issue #3389; see docs/troubleshooting/recovery-runbook.md), which reopens the task " + "and clears the retry circuit \u2014 the task's plan status must " + "already be in_progress; a task still pending in the plan takes one ordinary in_progress status update first."
112716
113037
  ].join(`
112717
113038
  `);
112718
113039
  }
@@ -116189,7 +116510,7 @@ async function deterministicSeed(input) {
116189
116510
  }
116190
116511
 
116191
116512
  // src/services/skill-optimizer/smoke.ts
116192
- import { existsSync as existsSync77, lstatSync as lstatSync16, readFileSync as readFileSync71, realpathSync as realpathSync23 } from "fs";
116513
+ import { existsSync as existsSync77, lstatSync as lstatSync16, readFileSync as readFileSync71, realpathSync as realpathSync24 } from "fs";
116193
116514
  import * as path155 from "path";
116194
116515
 
116195
116516
  // src/hooks/spawn-helper.ts
@@ -116282,7 +116603,7 @@ var _internals143 = {
116282
116603
  const rel = path155.relative(path155.resolve(root), path155.resolve(target));
116283
116604
  return rel.startsWith("..") || path155.isAbsolute(rel);
116284
116605
  },
116285
- realpath: (p) => realpathSync23(p),
116606
+ realpath: (p) => realpathSync24(p),
116286
116607
  evaluateSkillChange,
116287
116608
  isRejectedSkillContent,
116288
116609
  spawnAsync
@@ -116648,7 +116969,7 @@ async function runValidationWithTransientRetry(input, candidateContent, baseline
116648
116969
  if (!input.dispatcher) {
116649
116970
  throw new Error("no evaluation dispatcher available (cannot run validation)");
116650
116971
  }
116651
- const { createModelEvaluationExecutor: createModelEvaluationExecutor2 } = await import("./runner-qe3fkzx5.js");
116972
+ const { createModelEvaluationExecutor: createModelEvaluationExecutor2 } = await import("./runner-7sd43gan.js");
116652
116973
  const executor = createModelEvaluationExecutor2(input.dispatcher, input.sessionId);
116653
116974
  const result = await withProtectedSetIntegrity([evalInputRoot, ...protectedRoots(input.directory)], () => _internals144.evaluateCandidateV1({
116654
116975
  projectRoot: input.directory,
@@ -119241,7 +119562,7 @@ function buildDetailedHelp(commandName, entry) {
119241
119562
  async function handleHelpCommand(ctx) {
119242
119563
  const targetCommand = ctx.args.join(" ");
119243
119564
  if (!targetCommand) {
119244
- const { buildHelpText } = await import("./index-4hnxtssf.js");
119565
+ const { buildHelpText } = await import("./index-zvjrymp9.js");
119245
119566
  return buildHelpText();
119246
119567
  }
119247
119568
  const tokens = targetCommand.split(/\s+/);
@@ -119255,7 +119576,7 @@ async function handleHelpCommand(ctx) {
119255
119576
  > Note: \`/swarm ${resolved.key}\` is a deprecated alias for \`/swarm ${aliasTarget}\`.` : detailed;
119256
119577
  }
119257
119578
  const similar = _internals39.findSimilarCommands(targetCommand);
119258
- const { buildHelpText: fullHelp } = await import("./index-4hnxtssf.js");
119579
+ const { buildHelpText: fullHelp } = await import("./index-zvjrymp9.js");
119259
119580
  if (similar.length > 0) {
119260
119581
  return `Command '/swarm ${targetCommand}' not found.
119261
119582
 
@@ -119583,7 +119904,7 @@ var COMMAND_REGISTRY = {
119583
119904
  },
119584
119905
  "guardrail explain": {
119585
119906
  handler: async (ctx) => {
119586
- const { handleGuardrailExplain } = await import("./guardrail-explain-0ap0a51w.js");
119907
+ const { handleGuardrailExplain } = await import("./guardrail-explain-6xd6r3f5.js");
119587
119908
  return handleGuardrailExplain(ctx.directory, ctx.args);
119588
119909
  },
119589
119910
  description: "Dry-run: show what the guardrails would do to a command or write target (executes nothing)",
@@ -119593,7 +119914,7 @@ var COMMAND_REGISTRY = {
119593
119914
  },
119594
119915
  "guardrail reset": {
119595
119916
  handler: async (ctx) => {
119596
- const { handleGuardrailReset } = await import("./guardrail-reset-3fq8xdjf.js");
119917
+ const { handleGuardrailReset } = await import("./guardrail-reset-ha3w0nby.js");
119597
119918
  return handleGuardrailReset(ctx.args, ctx.sessionID);
119598
119919
  },
119599
119920
  description: "Reset one exact active invocation/action circuit after repair",
@@ -119614,7 +119935,7 @@ var COMMAND_REGISTRY = {
119614
119935
  },
119615
119936
  "guardrail-log": {
119616
119937
  handler: async (ctx) => {
119617
- const { handleGuardrailLog } = await import("./guardrail-log-xw37f7ws.js");
119938
+ const { handleGuardrailLog } = await import("./guardrail-log-qn1sqjs9.js");
119618
119939
  return handleGuardrailLog(ctx.directory, ctx.args);
119619
119940
  },
119620
119941
  description: "Read the guardrail decision log (use --blocks-only for blocks)",
@@ -120816,7 +121137,7 @@ function resolveRegistryEntry(key) {
120816
121137
  init_constants();
120817
121138
  init_warning_buffer();
120818
121139
  var ARCHITECT_MEMORY_OUTCOME_GUIDANCE = `After using recalled memory or a graph answer, call \`swarm_memory_outcome\` to record whether it was \`useful\`, a \`dead_end\`, or \`corrected\`, with the relevant file/symbol anchors. If you correct a memory-backed claim, record \`corrected\` and include the corrected explanation in \`correction\`.`;
120819
- var ARCHITECT_PROMPT_BUDGET_CHARS = 163000;
121140
+ var ARCHITECT_PROMPT_BUDGET_CHARS = 164000;
120820
121141
  var ARCHITECT_TOOL_DESCRIPTION_PROMPT_CAP_CHARS = 240;
120821
121142
  function estimateModelTokens(text) {
120822
121143
  return Math.ceil(text.length / 4);
@@ -121787,8 +122108,8 @@ HARD CONSTRAINTS (apply regardless of skill load success):
121787
122108
  - RUN THE MECHANICAL GATES: after fixes, call \`run_pr_feedback_stage_a\` with distinct repository-valid array-form build, typecheck, lint, exact \`["git", "diff", "--check"]\`, and reproduction commands; the reproduction declares exact selected test/package/path \`targets\`. Arbitrary/no-op, mutating, publishing, fix/update, wrapper/eval, selector-free, or duplicate commands fail closed, and content plus HEAD/index/refs/upstream/Git-config state must remain unchanged around every command. Then dispatch exactly one fresh lane at a time, in order, with \`max_concurrent: 1\`: \`swarm-pr-feedback:stage-b-reviewer\`, \`:stage-b-test\`, \`:closeout-reviewer\`, and \`:closeout-critic\`. Every lane owns the complete immutable \`feedback_item_ids\` and uses the matching \`workflow_lane\`. Free-form verdicts, direct Task calls, parallel or out-of-order lanes, stale digests, missing or duplicate item rows, and speed/time rationalizations do not satisfy the gate.
121788
122109
  - RESTART AFTER EDITS: any content change after Stage A invalidates Stage A and all later verdicts. Restart the entire mechanical gate sequence; do not reuse a prior reviewer or critic conversation.
121789
122110
  - DO NOT PUBLISH EARLY: commits, pushes, PR comments/updates, review-thread mutations, and other remote writes remain blocked until every ordered feedback gate settles positively on the same revision digest.
121790
- - After every local gate passes, EITHER path terminates: (a) content changes \u2014 create the reviewed commit with one standalone \`git commit\`, then call \`complete_pr_workflow\` once. It requires a clean index/worktree and a non-merge direct child whose sole parent is the immutable intake head before binding that post-commit HEAD and arming publication. Push only with \`git push <bound-remote> <bound-commit>:refs/heads/<bound-branch>\`; the literal bound commit and exact bound branch are required, and force flags, wrappers, aliases, fetch-based local-ref forgery, extra refspecs, \`git -C\`, and other remote writes fail closed. Perform read-only remote checks, then call \`complete_pr_workflow\` a second time with the same immutable verification \`pr_head_sha\`; the second call clears only after both the actual remote ref and its local tracking ref resolve to the exact bound commit. Only then perform any explicitly authorized PR comment/body/thread writes. (b) verified no-change \u2014 when EVERY ledger item is verified DISPROVED, PRE_EXISTING, NEEDS_MORE_EVIDENCE, or NEEDS_USER_DECISION in the settled verification lanes, call \`complete_pr_workflow\` with the intake head while HEAD equals it and the tree is clean; it returns \`verified-no-change\` and clears the gate terminally with no commit and no push (an empty commit is still forbidden).
121791
- - BASE-SYNC REBIND: when base drift or merge conflicts force a merge/rebase, do NOT abort ad-hoc \u2014 finish the repair, fetch and check out the new authoritative PR head, then call \`rebind_pr_feedback_head\` with the new full SHA. It moves the immutable intake head, keeps the inventory, and invalidates Stage A plus every gate receipt; re-run the entire mechanical ladder on the new ancestry. It refuses a no-op rebind, an armed gate, and in-flight lanes.
122111
+ - After every local gate passes, EITHER path terminates: (a) content changes \u2014 stage exact changed-set paths with \`git add -- <paths>\`, commit with one standalone \`git commit\` (a trailer-bearing message goes via \`prepare_pr_feedback_commit_message\` + \`git commit -F <path>\`), then call \`complete_pr_workflow\` once. It requires a clean index/worktree and a non-merge direct child whose sole parent is the immutable intake head before binding that post-commit HEAD and arming publication. Push only with \`git push <bound-remote> <bound-commit>:refs/heads/<bound-branch>\`; the literal bound commit and exact bound branch are required, and force flags, wrappers, aliases, fetch-based local-ref forgery, extra refspecs, \`git -C\`, and other remote writes fail closed. Perform read-only remote checks, then call \`complete_pr_workflow\` a second time with the same immutable verification \`pr_head_sha\`; the second call clears only after both the actual remote ref and its local tracking ref resolve to the exact bound commit. Only then perform any explicitly authorized PR comment/body/thread writes. (b) verified no-change \u2014 when EVERY ledger item is verified DISPROVED, PRE_EXISTING, NEEDS_MORE_EVIDENCE, or NEEDS_USER_DECISION in the settled verification lanes, call \`complete_pr_workflow\` with the intake head while HEAD equals it and the tree is clean; it returns \`verified-no-change\` and clears the gate terminally with no commit and no push (an empty commit is still forbidden).
122112
+ - BASE-SYNC REBIND: when base drift or merge conflicts force a merge/rebase, do NOT abort ad-hoc \u2014 finish the repair, fetch the advanced remote head, then call \`rebind_pr_feedback_head\` with the new full SHA; it fast-forwards the branch when the bound tracking ref already points at that head over a clean ancestor checkout. It moves the immutable intake head, keeps the inventory, and invalidates Stage A plus every gate receipt; re-run the entire mechanical ladder on the new ancestry. It refuses a no-op rebind, an armed gate, a diverged ref, and in-flight lanes.
121792
122113
  - Patch only confirmed items plus the tests/docs they require; report closure status for every ledger item including disproved ones.
121793
122114
  - ABORT/CANCEL IF UNRECOVERABLE: before arming, if checkout/bind or recovery fails, call \`abort_pr_workflow\` with \`mode: "PR_FEEDBACK"\`, \`kind: "recovery"\`, and a one-line \`reason\`. Plain aborts refuse while armed. To cancel armed publication, call \`abort_pr_workflow\` with \`kind: "cancel-publication"\`, \`cancel_publication: true\`, and a non-empty \`reason\`; it records \`cancelled_without_publication\` with observed head; never grants push authority. Do not substitute a plain abort. To change content, call \`invalidate_pr_feedback_publication\` and rerun the ladder. A published generation is never cleared by abort; use \`complete_pr_workflow\` for remote verification. Do NOT abort/cancel while recovery remains.
121794
122115
  - Do NOT resolve or mark GitHub review threads resolved unless the user explicitly instructs it.