opencode-swarm 7.196.0 → 7.197.0

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 (126) hide show
  1. package/.opencode/skills/brainstorm/SKILL.md +2 -1
  2. package/.opencode/skills/ci-failure-batching/SKILL.md +2 -1
  3. package/.opencode/skills/ci-fix-monitor/SKILL.md +2 -1
  4. package/.opencode/skills/clarify/SKILL.md +2 -1
  5. package/.opencode/skills/clarify-spec/SKILL.md +2 -1
  6. package/.opencode/skills/codebase-review-swarm/SKILL.md +1 -1
  7. package/.opencode/skills/commit-pr/SKILL.md +3 -2
  8. package/.opencode/skills/consult/SKILL.md +2 -1
  9. package/.opencode/skills/council/SKILL.md +2 -1
  10. package/.opencode/skills/critic-gate/SKILL.md +2 -1
  11. package/.opencode/skills/deep-dive/SKILL.md +2 -1
  12. package/.opencode/skills/deep-research/SKILL.md +2 -1
  13. package/.opencode/skills/design-docs/SKILL.md +2 -1
  14. package/.opencode/skills/discover/SKILL.md +2 -1
  15. package/.opencode/skills/durable-session-state/SKILL.md +2 -1
  16. package/.opencode/skills/engineering-conventions/SKILL.md +2 -1
  17. package/.opencode/skills/execute/SKILL.md +2 -1
  18. package/.opencode/skills/fork-pr-operations/SKILL.md +2 -1
  19. package/.opencode/skills/gate-attribution/SKILL.md +2 -1
  20. package/.opencode/skills/issue-ingest/SKILL.md +2 -1
  21. package/.opencode/skills/issue-tracer/SKILL.md +1 -1
  22. package/.opencode/skills/loop/SKILL.md +2 -1
  23. package/.opencode/skills/merge-queue-readiness/SKILL.md +2 -1
  24. package/.opencode/skills/orchestrating-subagents/SKILL.md +2 -1
  25. package/.opencode/skills/parallel-work-check/SKILL.md +17 -16
  26. package/.opencode/skills/phase-wrap/SKILL.md +2 -1
  27. package/.opencode/skills/pre-phase-briefing/SKILL.md +2 -1
  28. package/.opencode/skills/running-tests/SKILL.md +2 -1
  29. package/.opencode/skills/skill-edit-validation/SKILL.md +2 -1
  30. package/.opencode/skills/specify/SKILL.md +2 -1
  31. package/.opencode/skills/swarm/SKILL.md +2 -1
  32. package/.opencode/skills/swarm-ci-monitor/SKILL.md +3 -2
  33. package/.opencode/skills/swarm-implement/SKILL.md +2 -1
  34. package/.opencode/skills/swarm-plan/SKILL.md +2 -1
  35. package/.opencode/skills/swarm-pr-feedback/SKILL.md +9 -162
  36. package/.opencode/skills/swarm-pr-feedback/references/gate-evidence-scope.md +20 -0
  37. package/.opencode/skills/swarm-pr-feedback/references/intake-surfaces.md +107 -0
  38. package/.opencode/skills/swarm-pr-feedback/references/preflight-checkout.md +67 -0
  39. package/.opencode/skills/swarm-pr-review/SKILL.md +12 -344
  40. package/.opencode/skills/swarm-pr-review/references/council-mode.md +38 -0
  41. package/.opencode/skills/swarm-pr-review/references/explorer-output-format.md +54 -0
  42. package/.opencode/skills/swarm-pr-review/references/findings-persistence-detail.md +15 -0
  43. package/.opencode/skills/swarm-pr-review/references/parser-candidate-extraction.md +75 -0
  44. package/.opencode/skills/swarm-pr-review/references/phase0a-intake.md +61 -0
  45. package/.opencode/skills/swarm-pr-review/references/scope-detection.md +103 -0
  46. package/.opencode/skills/swarm-pr-review/references/writeback-phases.md +68 -0
  47. package/.opencode/skills/swarm-pr-subscribe/SKILL.md +3 -2
  48. package/.opencode/skills/swarm-resume/SKILL.md +2 -1
  49. package/.opencode/skills/test-file-split/SKILL.md +2 -1
  50. package/.opencode/skills/worktree-retry-cleanup/SKILL.md +2 -1
  51. package/.opencode/skills/writing-tests/SKILL.md +7 -437
  52. package/.opencode/skills/writing-tests/references/cross-platform-patterns.md +237 -0
  53. package/.opencode/skills/writing-tests/references/mock-tiers.md +207 -0
  54. package/binaries/win32-arm64/swarm-sandbox-runner.exe +0 -0
  55. package/binaries/win32-x64/swarm-sandbox-runner.exe +0 -0
  56. package/dist/cli/{auto-checkpoint-f00tk7sc.js → auto-checkpoint-s05sxmg6.js} +4 -4
  57. package/dist/cli/{checkpoint-acztxqga.js → checkpoint-kzyy9b7y.js} +8 -8
  58. package/dist/cli/{coder-settlement-0ka4n1xf.js → coder-settlement-d1qqfgdm.js} +3 -3
  59. package/dist/cli/{config-doctor-qv7wc6fa.js → config-doctor-yrven0ya.js} +7 -7
  60. package/dist/cli/{core-dmn3arr1.js → core-qpmksfae.js} +1 -1
  61. package/dist/cli/{curator-drift-sxzs48ew.js → curator-drift-2h6nf0mw.js} +5 -5
  62. package/dist/cli/{curator-llm-factory-cvrt4bf9.js → curator-llm-factory-kt3jhgs9.js} +25 -25
  63. package/dist/cli/{curator-891pc8b7.js → curator-mqnqst1g.js} +25 -25
  64. package/dist/cli/{doctor-knowledge-receipt-phase-id-mvbj576e.js → doctor-knowledge-receipt-phase-id-d8arz38j.js} +4 -4
  65. package/dist/cli/{evidence-summary-service-x9nxvmn5.js → evidence-summary-service-gjs4zssz.js} +9 -9
  66. package/dist/cli/{gate-evidence-dxd20wrc.js → gate-evidence-9n5r17hq.js} +2 -2
  67. package/dist/cli/{guardrail-explain-fga9bnvt.js → guardrail-explain-g4wcr664.js} +26 -26
  68. package/dist/cli/{guardrail-log-y84b9m8n.js → guardrail-log-0hy23f7d.js} +3 -3
  69. package/dist/cli/{guardrail-reset-xpcsxyt0.js → guardrail-reset-9z5rmp3f.js} +25 -25
  70. package/dist/cli/{hive-promoter-w1vchgfr.js → hive-promoter-w8f840ah.js} +25 -25
  71. package/dist/cli/{index-7gqmqhzj.js → index-1cks27mv.js} +6 -6
  72. package/dist/cli/{index-tjc68trf.js → index-1gnrtz76.js} +5 -5
  73. package/dist/cli/{index-nqxbqb50.js → index-20m9q2z9.js} +1 -1
  74. package/dist/cli/{index-41p9zzpe.js → index-29xr45xr.js} +153 -52
  75. package/dist/cli/{index-psqfkgav.js → index-3qqnz0jg.js} +3 -3
  76. package/dist/cli/{index-3drq02r1.js → index-401a12w5.js} +1 -1
  77. package/dist/cli/{index-3hpjqa6y.js → index-5p0jhn2s.js} +1 -1
  78. package/dist/cli/{index-hjma52c8.js → index-67w61x1b.js} +3 -3
  79. package/dist/cli/{index-w3mav870.js → index-8ahnfc03.js} +2 -2
  80. package/dist/cli/{index-t5med3ga.js → index-8zwmfh9d.js} +1 -1
  81. package/dist/cli/{index-vsa05smc.js → index-9px1knpj.js} +1 -1
  82. package/dist/cli/{index-174j0g38.js → index-9sqcmzc2.js} +2 -2
  83. package/dist/cli/{index-nrqyc8pr.js → index-agvmmvdt.js} +25 -25
  84. package/dist/cli/{index-wscg5ryb.js → index-avbvxmw2.js} +1 -1
  85. package/dist/cli/{index-ppnpkww2.js → index-bpnpvhja.js} +1 -1
  86. package/dist/cli/{index-knxq5byr.js → index-dgvf1jey.js} +1 -1
  87. package/dist/cli/{index-mt5t492g.js → index-eabxecjf.js} +2 -2
  88. package/dist/cli/{index-tzasccpd.js → index-fzx1wfxn.js} +1 -1
  89. package/dist/cli/{index-4cazf4kb.js → index-g1r94prs.js} +27 -27
  90. package/dist/cli/{index-8bsnnnj2.js → index-g749xs7c.js} +2 -2
  91. package/dist/cli/{index-bjaef5zn.js → index-jvpvghyh.js} +326 -222
  92. package/dist/cli/{index-2grr37ry.js → index-jvzfw0n5.js} +1 -1
  93. package/dist/cli/{index-391ydd25.js → index-mbdkr2sh.js} +1 -1
  94. package/dist/cli/{index-te61qv0q.js → index-ng6me2hh.js} +2 -2
  95. package/dist/cli/{index-7zkgdefv.js → index-njfkqr77.js} +3 -3
  96. package/dist/cli/{index-ryjp0wmq.js → index-t3tzk566.js} +1 -1
  97. package/dist/cli/{index-svbh91pz.js → index-v8jhmn8x.js} +1 -1
  98. package/dist/cli/{index-jnjvghgp.js → index-xb3h5tvj.js} +4 -4
  99. package/dist/cli/{index-31b55cq9.js → index-xf6tdsyr.js} +3 -3
  100. package/dist/cli/{index-sgt1d7ez.js → index-ysbmrmzk.js} +1 -1
  101. package/dist/cli/index.js +26 -26
  102. package/dist/cli/{knowledge-escalator-2dy96d0j.js → knowledge-escalator-42cvn0ec.js} +7 -7
  103. package/dist/cli/{knowledge-events-70kb745b.js → knowledge-events-v0xavjkd.js} +5 -5
  104. package/dist/cli/{knowledge-store-hvq03g0j.js → knowledge-store-s01cread.js} +1 -1
  105. package/dist/cli/{knowledge-validator-eaatcnkr.js → knowledge-validator-kvtcqpke.js} +2 -2
  106. package/dist/cli/{mcp-bj3awdfy.js → mcp-ff73w9z7.js} +1 -1
  107. package/dist/cli/{model-preflight-skhq4xtr.js → model-preflight-0k8bd388.js} +25 -25
  108. package/dist/cli/{pending-delegations-yamzv468.js → pending-delegations-bmj7djk1.js} +2 -2
  109. package/dist/cli/{pr-subscriptions-hkzd0nr4.js → pr-subscriptions-9dbrw7ky.js} +1 -1
  110. package/dist/cli/{pr-workflow-gate-2gmznmj4.js → pr-workflow-gate-wg003fkd.js} +25 -25
  111. package/dist/cli/{scan-cursor-arezehhk.js → scan-cursor-d93q0q3s.js} +2 -2
  112. package/dist/cli/{schema-emx6r32d.js → schema-0ny9ef6s.js} +1 -1
  113. package/dist/cli/{scope-persistence-tvr8w7ea.js → scope-persistence-ekcfq34x.js} +5 -5
  114. package/dist/cli/{server-ez03wdw9.js → server-rpx7pkg1.js} +25 -25
  115. package/dist/cli/{skill-generator-w0jy1mpc.js → skill-generator-h1w7s5dh.js} +8 -8
  116. package/dist/cli/{snapshot-coordination-init-2x56ds8a.js → snapshot-coordination-init-f6ecsn9c.js} +25 -25
  117. package/dist/cli/{speckit-checkoff-c2e5wezr.js → speckit-checkoff-kf0zkpdw.js} +3 -3
  118. package/dist/cli/{worktree-collision-ownership-1bgcea0v.js → worktree-collision-ownership-p7zmj4ag.js} +2 -2
  119. package/dist/cli/{worktree-isolation-9xp4dz41.js → worktree-isolation-nz90xvw5.js} +25 -25
  120. package/dist/config/skill-contract-digest.d.ts +6 -0
  121. package/dist/hooks/skill-scoring.d.ts +1 -1
  122. package/dist/hooks/skill-usage-log.d.ts +2 -0
  123. package/dist/index.js +23 -21
  124. package/dist/services/skill-evaluator.d.ts +2 -0
  125. package/dist/services/skill-generator.d.ts +13 -0
  126. package/package.json +1 -1
@@ -8,14 +8,14 @@ import {
8
8
  protectedRoots,
9
9
  redactDecisionLineForArchive,
10
10
  stableCanonicalStringify
11
- } from "./index-t5med3ga.js";
11
+ } from "./index-8zwmfh9d.js";
12
12
  import {
13
13
  detectStraySwarmDirs,
14
14
  readDoctorArtifact,
15
15
  removeStraySwarmDir,
16
16
  resolvePlanParallelizationFlag,
17
17
  runConfigDoctor
18
- } from "./index-hjma52c8.js";
18
+ } from "./index-67w61x1b.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-2grr37ry.js";
30
+ } from "./index-jvzfw0n5.js";
31
31
  import {
32
32
  JAVA_SYMBOL_GRAMMAR,
33
33
  LANGUAGE_REGISTRY,
@@ -89,7 +89,7 @@ import {
89
89
  alreadyCuratedThisGeneration,
90
90
  claimNextScanBatch,
91
91
  resolveCohortId
92
- } from "./index-knxq5byr.js";
92
+ } from "./index-dgvf1jey.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-sgt1d7ez.js";
111
+ } from "./index-ysbmrmzk.js";
112
112
  import {
113
113
  assertNoUnsettledCoderDispatch,
114
114
  listCoderSettlementWalStates,
115
115
  recoverCoderSettlement,
116
116
  recoverStaleCoderSettlements
117
- } from "./index-7zkgdefv.js";
117
+ } from "./index-njfkqr77.js";
118
118
  import {
119
119
  BUNDLED_PROJECT_SKILL_ROOT,
120
120
  DEFAULT_SKILL_MIN_CONFIDENCE,
@@ -134,12 +134,14 @@ import {
134
134
  retireOrMarkStale,
135
135
  retireSkill,
136
136
  selectCandidateEntries,
137
+ skillContractDigest,
138
+ splitSkillFrontmatter,
137
139
  syncBundledProjectSkillsIfMissingAsync
138
- } from "./index-41p9zzpe.js";
140
+ } from "./index-29xr45xr.js";
139
141
  import {
140
142
  buildEscalationBriefing,
141
143
  readRecentEscalations
142
- } from "./index-7gqmqhzj.js";
144
+ } from "./index-1cks27mv.js";
143
145
  import {
144
146
  parsePorcelainV2Snapshot,
145
147
  resolveCommitCountSince,
@@ -223,7 +225,7 @@ import {
223
225
  swarmOverwriteCandidates,
224
226
  trackedDirtyCandidates,
225
227
  transientBackoff
226
- } from "./index-31b55cq9.js";
228
+ } from "./index-xf6tdsyr.js";
227
229
  import {
228
230
  EPIC_MODE_CONFIG_DISABLED_MESSAGE,
229
231
  PlanRecoverySupersededError,
@@ -255,7 +257,7 @@ import {
255
257
  updateEpicRecord,
256
258
  updateTaskStatus,
257
259
  withPlanLifecycleLock
258
- } from "./index-tjc68trf.js";
260
+ } from "./index-1gnrtz76.js";
259
261
  import {
260
262
  containsControlChars,
261
263
  containsPathTraversal,
@@ -271,7 +273,7 @@ import {
271
273
  resolveSpeckitProjection,
272
274
  validateSpeckit,
273
275
  writeProjectedSpecSync
274
- } from "./index-ryjp0wmq.js";
276
+ } from "./index-t3tzk566.js";
275
277
  import {
276
278
  clearWorktreeMergeStatus,
277
279
  getAllWorktreeMergeFailures,
@@ -303,7 +305,7 @@ import {
303
305
  transitionTaskWorkflowEvidenceWithStatus,
304
306
  withTaskEvidenceTransaction,
305
307
  writeWorkflowWalFile
306
- } from "./index-3drq02r1.js";
308
+ } from "./index-401a12w5.js";
307
309
  import {
308
310
  isPathUnderSwarmWorktreeBase,
309
311
  listLiveLaneOwners,
@@ -312,7 +314,7 @@ import {
312
314
  recordLiveLaneOwner,
313
315
  removeWorktree,
314
316
  resolveWorktreeBaseDir
315
- } from "./index-391ydd25.js";
317
+ } from "./index-mbdkr2sh.js";
316
318
  import {
317
319
  GitBinaryMissingError,
318
320
  GitSpawnCwdError,
@@ -354,7 +356,7 @@ import {
354
356
  scanBackgroundCoderReservationsForAdmission,
355
357
  scanDelegationsForRecovery,
356
358
  sweepStaleDelegations
357
- } from "./index-vsa05smc.js";
359
+ } from "./index-9px1knpj.js";
358
360
  import {
359
361
  MAX_EVENT_LOG_ENTRIES,
360
362
  _internals,
@@ -366,7 +368,7 @@ import {
366
368
  recordHiveKnowledgeEvent,
367
369
  recordKnowledgeEvent,
368
370
  resolveKnowledgeEventsPath
369
- } from "./index-mt5t492g.js";
371
+ } from "./index-eabxecjf.js";
370
372
  import {
371
373
  commitDisplayedMembership,
372
374
  commitEmptyRetrieval,
@@ -379,7 +381,7 @@ import {
379
381
  queryLiveMemberships,
380
382
  reconcilePhaseClose,
381
383
  recordPhaseCloseIntent
382
- } from "./index-te61qv0q.js";
384
+ } from "./index-ng6me2hh.js";
383
385
  import {
384
386
  sanitizeContextText
385
387
  } from "./index-m9zzj4ee.js";
@@ -410,7 +412,7 @@ import {
410
412
  validateActionableFields,
411
413
  validateLesson,
412
414
  validateSkillPath
413
- } from "./index-wscg5ryb.js";
415
+ } from "./index-avbvxmw2.js";
414
416
  import {
415
417
  MAX_CURATION_PROPOSALS,
416
418
  authorizeCuration,
@@ -421,7 +423,7 @@ import {
421
423
  } from "./index-rtry5xyf.js";
422
424
  import {
423
425
  resolveWorktreeIsolationConfig
424
- } from "./index-8bsnnnj2.js";
426
+ } from "./index-g749xs7c.js";
425
427
  import {
426
428
  RetrospectiveEvidenceSchema
427
429
  } from "./index-g22dps7x.js";
@@ -433,7 +435,7 @@ import {
433
435
  clearScopeBindings,
434
436
  readAuthoritativeScopeBindingSet,
435
437
  readDeclaredScopeFilesFromBindings
436
- } from "./index-tzasccpd.js";
438
+ } from "./index-fzx1wfxn.js";
437
439
  import {
438
440
  approvedSnapshotCoversPlan,
439
441
  clearPlanLedgerForReset,
@@ -450,7 +452,7 @@ import {
450
452
  replayFromLedgerWithStatus,
451
453
  resolvePlanningProfile,
452
454
  takeSnapshotEvent
453
- } from "./index-174j0g38.js";
455
+ } from "./index-9sqcmzc2.js";
454
456
  import {
455
457
  CORE_EVENT_LOCKED,
456
458
  appendCoreEventSync,
@@ -539,7 +541,7 @@ import {
539
541
  transactFile,
540
542
  transactKnowledge,
541
543
  wordBigrams
542
- } from "./index-jnjvghgp.js";
544
+ } from "./index-xb3h5tvj.js";
543
545
  import {
544
546
  readTailJsonl,
545
547
  readTailJsonlDetailed,
@@ -624,7 +626,7 @@ import {
624
626
  loadPluginConfig,
625
627
  loadPluginConfigWithMeta,
626
628
  resolveEpicConfig
627
- } from "./index-ppnpkww2.js";
629
+ } from "./index-bpnpvhja.js";
628
630
  import {
629
631
  GIT_BINARY_ENV_VAR,
630
632
  addDeferredWarning,
@@ -657,7 +659,7 @@ import {
657
659
  resolveContextWindow,
658
660
  resolveGeneratedAgentRole,
659
661
  stripKnownSwarmPrefix
660
- } from "./index-nqxbqb50.js";
662
+ } from "./index-20m9q2z9.js";
661
663
  import {
662
664
  AGENT_TOOL_MAP,
663
665
  ALL_AGENT_NAMES,
@@ -830,7 +832,7 @@ init_loader();
830
832
 
831
833
  // src/hooks/pr-workflow-gate.ts
832
834
  init_zod();
833
- import { createHash as createHash26, randomUUID as randomUUID6 } from "crypto";
835
+ import { createHash as createHash25, randomUUID as randomUUID6 } from "crypto";
834
836
  import * as fsp5 from "fs/promises";
835
837
  import * as path34 from "path";
836
838
 
@@ -3457,7 +3459,7 @@ async function importLegacyPrWorkflowGateStateIfNeeded(directory, sessionID, all
3457
3459
  return null;
3458
3460
  throw error2;
3459
3461
  }
3460
- const legacy = allowSalvagedImport ? (await (await import("./pr-workflow-gate-2gmznmj4.js")).readPrWorkflowGateStateForRecovery(directory, sessionID))?.state ?? null : await readPrWorkflowGateStateFileFromDisk(filePath, sessionID);
3462
+ const legacy = allowSalvagedImport ? (await (await import("./pr-workflow-gate-wg003fkd.js")).readPrWorkflowGateStateForRecovery(directory, sessionID))?.state ?? null : await readPrWorkflowGateStateFileFromDisk(filePath, sessionID);
3461
3463
  if (!legacy)
3462
3464
  return null;
3463
3465
  const namespace = workflowGateStateCoordinationNamespace(sessionID);
@@ -3544,7 +3546,7 @@ async function deleteStateWhileLocked(directory, sessionID, options = {}) {
3544
3546
  let recoveryState = null;
3545
3547
  if (!currentAuthoritative) {
3546
3548
  if (options.allowSalvagedRead) {
3547
- const { readPrWorkflowGateStateForRecovery } = await import("./pr-workflow-gate-2gmznmj4.js");
3549
+ const { readPrWorkflowGateStateForRecovery } = await import("./pr-workflow-gate-wg003fkd.js");
3548
3550
  recoveryState = (await readPrWorkflowGateStateForRecovery(directory, normalizedSessionID))?.state ?? null;
3549
3551
  }
3550
3552
  if (!recoveryState) {
@@ -7019,30 +7021,6 @@ import * as fs4 from "fs";
7019
7021
  import * as os2 from "os";
7020
7022
  import * as path9 from "path";
7021
7023
  import { fileURLToPath } from "url";
7022
-
7023
- // src/config/skill-contract-digest.ts
7024
- import { createHash as createHash11 } from "crypto";
7025
- function splitSkillFrontmatter(content) {
7026
- if (!content.startsWith(`---
7027
- `))
7028
- return { frontmatter: "", body: content };
7029
- const end = content.indexOf(`
7030
- ---
7031
- `, 4);
7032
- if (end === -1)
7033
- return { frontmatter: "", body: content };
7034
- return {
7035
- frontmatter: content.slice(0, end + 5),
7036
- body: content.slice(end + 5)
7037
- };
7038
- }
7039
- function skillContractDigest(body) {
7040
- const normalized = body.replace(/\r\n/g, `
7041
- `);
7042
- return createHash11("sha256").update(normalized, "utf8").digest("hex").slice(0, 12);
7043
- }
7044
-
7045
- // src/services/pr-workflow-skill-contract.ts
7046
7024
  init_warning_buffer();
7047
7025
  var PR_WORKFLOW_MODE_SKILL = {
7048
7026
  PR_REVIEW: "swarm-pr-review",
@@ -7155,7 +7133,7 @@ init_schema();
7155
7133
 
7156
7134
  // src/council/council-review-identity.ts
7157
7135
  init_schema();
7158
- import { createHash as createHash12 } from "crypto";
7136
+ import { createHash as createHash11 } from "crypto";
7159
7137
  var COUNCIL_REVIEW_IDENTITY_VERSION = 2;
7160
7138
  function computeCouncilReviewHash(plan) {
7161
7139
  const normalized = {
@@ -7182,7 +7160,7 @@ function computeCouncilReviewHash(plan) {
7182
7160
  }))
7183
7161
  }))
7184
7162
  };
7185
- return createHash12("sha256").update(JSON.stringify(normalized), "utf8").digest("hex");
7163
+ return createHash11("sha256").update(JSON.stringify(normalized), "utf8").digest("hex");
7186
7164
  }
7187
7165
  function computeCouncilPolicyDigest(level, config) {
7188
7166
  const base = {
@@ -7210,7 +7188,7 @@ function computeCouncilPolicyDigest(level, config) {
7210
7188
  minimumMembers: config?.minimumMembers ?? 3
7211
7189
  };
7212
7190
  }
7213
- return createHash12("sha256").update(JSON.stringify(normalized), "utf8").digest("hex");
7191
+ return createHash11("sha256").update(JSON.stringify(normalized), "utf8").digest("hex");
7214
7192
  }
7215
7193
  function resolveFinalCompletionPolicy(config) {
7216
7194
  const policy = config?.finalCompletionPolicy;
@@ -7235,7 +7213,7 @@ function computeCouncilReviewIdentity(input) {
7235
7213
  };
7236
7214
  return {
7237
7215
  ...identity,
7238
- identityDigest: createHash12("sha256").update(JSON.stringify(identity), "utf8").digest("hex")
7216
+ identityDigest: createHash11("sha256").update(JSON.stringify(identity), "utf8").digest("hex")
7239
7217
  };
7240
7218
  }
7241
7219
 
@@ -7529,7 +7507,7 @@ import * as fs21 from "fs";
7529
7507
  import * as path31 from "path";
7530
7508
 
7531
7509
  // src/background/stage-b-dispatch-binding-store.ts
7532
- import { createHash as createHash13 } from "crypto";
7510
+ import { createHash as createHash12 } from "crypto";
7533
7511
  var STAGE_B_BINDINGS_DIR = "stage-b-dispatch-bindings";
7534
7512
  var STAGE_B_BINDING_MAX_BYTES = 64 * 1024;
7535
7513
  var STAGE_B_BINDING_TTL_MS = 24 * 60 * 60 * 1000;
@@ -7559,7 +7537,7 @@ var WINDOWS_RESERVED = new Set([
7559
7537
  "LPT9"
7560
7538
  ]);
7561
7539
  function stageBSessionDirName(sessionID) {
7562
- return createHash13("sha256").update(sessionID).digest("hex").slice(0, 24);
7540
+ return createHash12("sha256").update(sessionID).digest("hex").slice(0, 24);
7563
7541
  }
7564
7542
 
7565
7543
  // src/hooks/delegation-gate.ts
@@ -9153,7 +9131,7 @@ import * as path18 from "path";
9153
9131
  // src/hooks/delegation-gate/worktree-isolation.ts
9154
9132
  init_constants();
9155
9133
  init_schema();
9156
- import { createHash as createHash17 } from "crypto";
9134
+ import { createHash as createHash16 } from "crypto";
9157
9135
  import * as fs10 from "fs/promises";
9158
9136
  import * as path16 from "path";
9159
9137
 
@@ -9161,7 +9139,7 @@ import * as path16 from "path";
9161
9139
  init_logger();
9162
9140
 
9163
9141
  // src/epic/plan-key.ts
9164
- import { createHash as createHash14 } from "crypto";
9142
+ import { createHash as createHash13 } from "crypto";
9165
9143
  var SWARM_PLAN_TRAILER_KEY = "Swarm-Plan";
9166
9144
  var SWARM_TASK_SUBJECT_RE = /^swarm\(task ([^)]+)\):/;
9167
9145
  var TRAILER_LINE_RE = /^Swarm-Plan:[ \t]*(\S+)[ \t]*$/;
@@ -9175,7 +9153,7 @@ function scrubTaskIdForGitSubject(taskId) {
9175
9153
  return taskId.replace(/[^a-zA-Z0-9._-]/g, "_");
9176
9154
  }
9177
9155
  function computePlanKey(planIdentityHash, planEpoch) {
9178
- return createHash14("sha256").update(`${planIdentityHash}|${planEpoch ?? ""}`, "utf8").digest("hex").slice(0, 16);
9156
+ return createHash13("sha256").update(`${planIdentityHash}|${planEpoch ?? ""}`, "utf8").digest("hex").slice(0, 16);
9179
9157
  }
9180
9158
  function formatSwarmPlanTrailer(planKey) {
9181
9159
  return `${SWARM_PLAN_TRAILER_KEY}: ${planKey}`;
@@ -9450,7 +9428,7 @@ var _internals19 = {
9450
9428
  init_git_executable();
9451
9429
  init_logger();
9452
9430
  // src/hooks/reviewer-scope-file-fingerprint.ts
9453
- import { createHash as createHash15 } from "crypto";
9431
+ import { createHash as createHash14 } from "crypto";
9454
9432
  import * as fs7 from "fs";
9455
9433
  import * as path14 from "path";
9456
9434
  var RETRYABLE_CAPTURE_FAILURE_CODES = new Set([
@@ -9736,7 +9714,7 @@ function captureReviewerScopeFileFingerprint(directory, file, options = {}) {
9736
9714
  retryable: true
9737
9715
  };
9738
9716
  }
9739
- const hash = createHash15("sha256");
9717
+ const hash = createHash14("sha256");
9740
9718
  const chunk = Buffer.alloc(REVIEWER_SCOPE_CAPTURE_CHUNK_BYTES);
9741
9719
  let totalBytes = 0;
9742
9720
  for (;; ) {
@@ -10092,7 +10070,7 @@ var _internals22 = {
10092
10070
  };
10093
10071
 
10094
10072
  // src/hooks/delegation-gate/worktree-recovery-authority.ts
10095
- import { createHash as createHash16, randomBytes } from "crypto";
10073
+ import { createHash as createHash15, randomBytes } from "crypto";
10096
10074
  import * as fs9 from "fs";
10097
10075
  import * as path15 from "path";
10098
10076
  var STORE_RELATIVE_PATH = path15.join(".swarm", "worktree-merge-recovery-v2.json");
@@ -10111,7 +10089,7 @@ function nowMs(input) {
10111
10089
  return input ?? Date.now();
10112
10090
  }
10113
10091
  function sha2562(input) {
10114
- return createHash16("sha256").update(input).digest("hex");
10092
+ return createHash15("sha256").update(input).digest("hex");
10115
10093
  }
10116
10094
  function storePath2(directory) {
10117
10095
  return path15.join(directory, STORE_RELATIVE_PATH);
@@ -11342,7 +11320,7 @@ function isLaneOwnedByCurrentSession(branchName, expectedSessionId) {
11342
11320
  return extracted === expectedSessionId;
11343
11321
  }
11344
11322
  async function inspectStandardWorktreeCollisionOwnership(identity) {
11345
- const collisionOwnership = await import("./worktree-collision-ownership-1bgcea0v.js");
11323
+ const collisionOwnership = await import("./worktree-collision-ownership-p7zmj4ag.js");
11346
11324
  return collisionOwnership.inspectStandardWorktreeCollisionOwnership(identity);
11347
11325
  }
11348
11326
  async function runRecoveryGit(directory, args, timeoutMs = 15000) {
@@ -11770,7 +11748,7 @@ async function precreateStandardWorktreeSession(args) {
11770
11748
  const laneProfile = computeLaneRuntimeProfile(worktreeConfig.runtime_isolation, laneIndex, handle.worktreePath);
11771
11749
  if (laneProfile) {
11772
11750
  try {
11773
- const { writeLaneProfileToDiskReal } = await import("./core-dmn3arr1.js");
11751
+ const { writeLaneProfileToDiskReal } = await import("./core-qpmksfae.js");
11774
11752
  await writeLaneProfileToDiskReal(handle.worktreePath, laneProfile.laneIndex, laneProfile.envOverrides);
11775
11753
  } catch {}
11776
11754
  }
@@ -11935,7 +11913,7 @@ async function preserveBackgroundWorktreeOwnershipForCallId(callID) {
11935
11913
  }
11936
11914
  const session = Buffer.from(dispatch.handle.sessionId, "utf8").toString("base64url");
11937
11915
  const lane = Buffer.from(dispatch.handle.id, "utf8").toString("base64url");
11938
- const callDigest = createHash17("sha256").update(callID).digest("hex").slice(0, 12);
11916
+ const callDigest = createHash16("sha256").update(callID).digest("hex").slice(0, 12);
11939
11917
  const tag = `swarm-preserved-owner/${session}/${lane}/${callDigest}`;
11940
11918
  let tagProc;
11941
11919
  try {
@@ -12764,7 +12742,7 @@ async function finishStandardWorktreeDispatch(directory, dispatch, config, callI
12764
12742
  }
12765
12743
  clearWorktreeMergeStatus(statusKey);
12766
12744
  try {
12767
- const { removeLaneProfileFromDiskReal } = await import("./core-dmn3arr1.js");
12745
+ const { removeLaneProfileFromDiskReal } = await import("./core-qpmksfae.js");
12768
12746
  await removeLaneProfileFromDiskReal(dispatch.handle.worktreePath, dispatch.laneIndex);
12769
12747
  } catch {}
12770
12748
  const state = serializationStateBySessionID.get(dispatch.parentSessionID);
@@ -13347,7 +13325,7 @@ function summarizeEpicLearning(stats, hotExcess, limit = 10) {
13347
13325
 
13348
13326
  // src/epic/learning-store.ts
13349
13327
  init_zod();
13350
- import { createHash as createHash18 } from "crypto";
13328
+ import { createHash as createHash17 } from "crypto";
13351
13329
  import * as fs11 from "fs";
13352
13330
  import * as path17 from "path";
13353
13331
  init_logger();
@@ -13449,7 +13427,7 @@ function readBounded(filePath) {
13449
13427
  return fs11.readFileSync(filePath, "utf-8");
13450
13428
  }
13451
13429
  function sha2563(text) {
13452
- return createHash18("sha256").update(text).digest("hex");
13430
+ return createHash17("sha256").update(text).digest("hex");
13453
13431
  }
13454
13432
  function directoryProbe(directory) {
13455
13433
  return (entry) => {
@@ -14600,7 +14578,7 @@ init_schema();
14600
14578
  init_config();
14601
14579
 
14602
14580
  // src/security/command-classifier.ts
14603
- import { createHash as createHash19 } from "crypto";
14581
+ import { createHash as createHash18 } from "crypto";
14604
14582
 
14605
14583
  // src/hooks/guardrails/destructive-command.ts
14606
14584
  import * as fsSync2 from "fs";
@@ -15411,7 +15389,7 @@ var SAFE = [
15411
15389
  ];
15412
15390
  var BLOCK_RULES_BY_ID = new Map([...CATASTROPHIC, ...DESTRUCTIVE].map((rule) => [rule.id, rule]));
15413
15391
  function digest(value) {
15414
- return createHash19("sha256").update(value).digest("hex");
15392
+ return createHash18("sha256").update(value).digest("hex");
15415
15393
  }
15416
15394
  function hasAmbiguousSyntax(value) {
15417
15395
  let single = false;
@@ -18149,6 +18127,10 @@ function parseGeneratedFromKnowledge(content) {
18149
18127
  if (!frontmatterMatch)
18150
18128
  return [];
18151
18129
  const body = frontmatterMatch[1];
18130
+ const jsonMatch = body.match(/^\s+generated_from_knowledge:\s*'?\[([^\]]*)\]'?\s*$/m);
18131
+ if (jsonMatch) {
18132
+ return jsonMatch[1].split(",").map((entry) => entry.trim().replace(/^["']|["']$/g, "")).filter(Boolean);
18133
+ }
18152
18134
  const ids = [];
18153
18135
  const sectionRegex = /generated_from_knowledge\s*:\s*\n((?:\s+-\s+\S+[^\n]*\n?)+)/;
18154
18136
  const sectionMatch = body.match(sectionRegex);
@@ -18479,6 +18461,61 @@ function collectAudienceYamlList(lines, start, end) {
18479
18461
  nextIndex: i - 1
18480
18462
  };
18481
18463
  }
18464
+ function collectMetadataChildren(lines, start, end) {
18465
+ const children = new Map;
18466
+ const duplicateKeys = new Set;
18467
+ let i = start;
18468
+ let current = null;
18469
+ for (;i < end; i++) {
18470
+ const line = lines[i] ?? "";
18471
+ if (line.trim() === "")
18472
+ continue;
18473
+ if (!/^\s/.test(line))
18474
+ break;
18475
+ const childMatch = line.match(/^\s+([A-Za-z_][A-Za-z0-9_-]*)\s*:\s*(.*)$/);
18476
+ if (childMatch) {
18477
+ const key = childMatch[1].toLowerCase();
18478
+ if (children.has(key)) {
18479
+ duplicateKeys.add(key);
18480
+ current = null;
18481
+ continue;
18482
+ }
18483
+ const child = {
18484
+ inline: stripQuotes(childMatch[2].trim()).replace(/''/g, "'"),
18485
+ listItems: []
18486
+ };
18487
+ children.set(key, child);
18488
+ current = { child };
18489
+ continue;
18490
+ }
18491
+ const itemMatch = line.match(/^\s+-\s+(.+?)\s*$/);
18492
+ if (itemMatch && current) {
18493
+ current.child.listItems.push(itemMatch[1]);
18494
+ }
18495
+ }
18496
+ return { children, duplicateKeys, nextIndex: i - 1 };
18497
+ }
18498
+ function resolveAudiencePair(metadataAudience, topLevelAudience) {
18499
+ if (metadataAudience.status === "absent")
18500
+ return topLevelAudience;
18501
+ if (metadataAudience.status !== "valid")
18502
+ return { status: "invalid", values: [] };
18503
+ if (topLevelAudience.status === "absent")
18504
+ return metadataAudience;
18505
+ if (topLevelAudience.status !== "valid")
18506
+ return { status: "invalid", values: [] };
18507
+ const sortKey = (values) => [...values].sort().join("\x00");
18508
+ return sortKey(metadataAudience.values) === sortKey(topLevelAudience.values) ? metadataAudience : { status: "invalid", values: [] };
18509
+ }
18510
+ function parseMetadataAudienceChild(child) {
18511
+ if (child.inline) {
18512
+ return parseInlineAudienceList(child.inline);
18513
+ }
18514
+ if (child.listItems.length === 0) {
18515
+ return { status: "invalid", values: [] };
18516
+ }
18517
+ return parseAudienceValues(child.listItems);
18518
+ }
18482
18519
  function isSkillAudienceMatch(metadata, context) {
18483
18520
  const audience = metadata.audience;
18484
18521
  if (!audience || audience.status === "absent")
@@ -18513,6 +18550,8 @@ function parseSkillFrontmatter(content, skillPath) {
18513
18550
  let skillType;
18514
18551
  let triggers = [];
18515
18552
  let audience = { status: "absent", values: [] };
18553
+ let metadataChildren = null;
18554
+ let duplicateMetadataBlocks = 0;
18516
18555
  for (let i = 1;i < end; i++) {
18517
18556
  const line = lines[i] ?? "";
18518
18557
  const match = line.match(/^([A-Za-z_][A-Za-z0-9_-]*)\s*:\s*(.*)$/);
@@ -18520,6 +18559,18 @@ function parseSkillFrontmatter(content, skillPath) {
18520
18559
  continue;
18521
18560
  const key = match[1].toLowerCase();
18522
18561
  const rawValue = match[2].trim();
18562
+ if (key === "metadata") {
18563
+ duplicateMetadataBlocks += 1;
18564
+ if (duplicateMetadataBlocks === 1) {
18565
+ const collected = collectMetadataChildren(lines, i + 1, end);
18566
+ metadataChildren = collected.children;
18567
+ if (collected.duplicateKeys.has("audience")) {
18568
+ audience = { status: "invalid", values: [] };
18569
+ }
18570
+ i = collected.nextIndex;
18571
+ }
18572
+ continue;
18573
+ }
18523
18574
  if (key === "name") {
18524
18575
  const parsed = stripQuotes(rawValue);
18525
18576
  if (parsed)
@@ -18552,7 +18603,7 @@ function parseSkillFrontmatter(content, skillPath) {
18552
18603
  audience = collected.audience;
18553
18604
  i = collected.nextIndex;
18554
18605
  } else {
18555
- audience = parseInlineAudienceList(rawValue);
18606
+ audience = parseInlineAudienceList(stripQuotes(rawValue));
18556
18607
  }
18557
18608
  continue;
18558
18609
  }
@@ -18572,6 +18623,24 @@ function parseSkillFrontmatter(content, skillPath) {
18572
18623
  description = stripQuotes(rawValue);
18573
18624
  }
18574
18625
  }
18626
+ if (duplicateMetadataBlocks > 1) {
18627
+ audience = { status: "invalid", values: [] };
18628
+ } else if (metadataChildren) {
18629
+ const audienceChild = metadataChildren.get("audience");
18630
+ if (audienceChild && audience.status !== "invalid") {
18631
+ audience = resolveAudiencePair(parseMetadataAudienceChild(audienceChild), audience);
18632
+ }
18633
+ const skillTypeChild = metadataChildren.get("skill_type");
18634
+ if (skillTypeChild) {
18635
+ const value = skillTypeChild.inline;
18636
+ if (value === "directive" || value === "workflow")
18637
+ skillType = value;
18638
+ }
18639
+ const triggersChild = metadataChildren.get("triggers");
18640
+ if (triggersChild) {
18641
+ triggers = triggersChild.inline ? normalizeTriggerList(parseInlineStringList(triggersChild.inline)) : normalizeTriggerList(triggersChild.listItems);
18642
+ }
18643
+ }
18575
18644
  const meta = {
18576
18645
  path: normalizedPath,
18577
18646
  frontmatterStatus: "valid",
@@ -21232,7 +21301,7 @@ init_schema();
21232
21301
 
21233
21302
  // src/failures/action-identity.ts
21234
21303
  init_schema();
21235
- import { createHash as createHash21 } from "crypto";
21304
+ import { createHash as createHash20 } from "crypto";
21236
21305
  var MAX_STRING_INPUT = 512;
21237
21306
  var MAX_PUBLIC_FIELD_LENGTH = 128;
21238
21307
  var MAX_COLLECTION_ITEMS = 64;
@@ -21286,7 +21355,7 @@ function normalizeToolName2(tool) {
21286
21355
  return tool.trim().toLowerCase() || "unknown-tool";
21287
21356
  }
21288
21357
  function hashString(value) {
21289
- return createHash21("sha256").update(value).digest("hex");
21358
+ return createHash20("sha256").update(value).digest("hex");
21290
21359
  }
21291
21360
  function readRecord(value) {
21292
21361
  return typeof value === "object" && value !== null && !Array.isArray(value) ? value : undefined;
@@ -21531,7 +21600,7 @@ function createActionIdentity(input) {
21531
21600
  }
21532
21601
 
21533
21602
  // src/failures/invocation-failure.ts
21534
- import { createHash as createHash22 } from "crypto";
21603
+ import { createHash as createHash21 } from "crypto";
21535
21604
  var MAX_DISPLAY_BYTES = 512;
21536
21605
  var MAX_STRUCTURED_STRING = 128;
21537
21606
  function hasOwn(source, key) {
@@ -21555,7 +21624,7 @@ function boundedUtf8(value, maxBytes = MAX_DISPLAY_BYTES) {
21555
21624
  return buffer.subarray(0, maxBytes).toString("utf8").replace(/\uFFFD+$/g, "");
21556
21625
  }
21557
21626
  function hashValue(value) {
21558
- return createHash22("sha256").update(value).digest("hex");
21627
+ return createHash21("sha256").update(value).digest("hex");
21559
21628
  }
21560
21629
  function redactUrl(match) {
21561
21630
  try {
@@ -21895,7 +21964,7 @@ function getFullAutoRecoveryBlockers(input) {
21895
21964
  }
21896
21965
 
21897
21966
  // src/review/diff-source.ts
21898
- import { createHash as createHash23 } from "crypto";
21967
+ import { createHash as createHash22 } from "crypto";
21899
21968
  import * as fs19 from "fs";
21900
21969
  import * as path28 from "path";
21901
21970
  init_git_executable();
@@ -22307,7 +22376,7 @@ function uniqueSkipCodes(skipReasons) {
22307
22376
  return [...new Set(skipReasons.map((item) => item.code))].sort();
22308
22377
  }
22309
22378
  function hashManifestPayload(payload) {
22310
- return createHash23("sha256").update(JSON.stringify(payload), "utf8").digest("hex");
22379
+ return createHash22("sha256").update(JSON.stringify(payload), "utf8").digest("hex");
22311
22380
  }
22312
22381
  function parseObjectFormat(stdout) {
22313
22382
  const objectFormat = stdout.trim();
@@ -22395,7 +22464,7 @@ function hashWorkingTreeIdentity(root, rawPath, budget) {
22395
22464
  if (fileBytes > budget.remainingBytes) {
22396
22465
  return deadlineExceeded(`working-tree content identity exceeded the ${WORKTREE_IDENTITY_TOTAL_BYTES}-byte aggregate cap`);
22397
22466
  }
22398
- const hash = createHash23("sha256");
22467
+ const hash = createHash22("sha256");
22399
22468
  const buffer = Buffer.alloc(64 * 1024);
22400
22469
  let offset = 0;
22401
22470
  while (offset < fileBytes) {
@@ -22975,8 +23044,8 @@ async function collectReviewDiff(options) {
22975
23044
  canonicalText,
22976
23045
  fileListFallback: fileListFallback ?? null
22977
23046
  });
22978
- const scopeHash = createHash23("sha256").update(hashPayload, "utf8").digest("hex");
22979
- const reviewContentHash = createHash23("sha256").update(JSON.stringify({
23047
+ const scopeHash = createHash22("sha256").update(hashPayload, "utf8").digest("hex");
23048
+ const reviewContentHash = createHash22("sha256").update(JSON.stringify({
22980
23049
  selector,
22981
23050
  canonicalText,
22982
23051
  fileListFallback: fileListFallback ?? null
@@ -23180,7 +23249,7 @@ ${text}`;
23180
23249
  }
23181
23250
 
23182
23251
  // src/db/observability-event-store.ts
23183
- import { createHash as createHash24 } from "crypto";
23252
+ import { createHash as createHash23 } from "crypto";
23184
23253
  import { existsSync as existsSync11, readFileSync as readFileSync14, statSync as statSync10 } from "fs";
23185
23254
  import { join as join23 } from "path";
23186
23255
  var MAX_OBSERVABILITY_EVENT_ROWS = 50000;
@@ -23192,7 +23261,7 @@ var LINE_HASH_NAMESPACE = "obs-line-v1";
23192
23261
  var LINE_HASH_QUERY_CHUNK = 500;
23193
23262
  var LIVE_LINE_HASH_BACKFILL_MARKER = "__live_line_hash_backfill__";
23194
23263
  function lineHashOf(content) {
23195
- return createHash24("sha256").update(`${LINE_HASH_NAMESPACE}\x00${content}`).digest("hex");
23264
+ return createHash23("sha256").update(`${LINE_HASH_NAMESPACE}\x00${content}`).digest("hex");
23196
23265
  }
23197
23266
  function normalizeSegmentForLineHash(segment) {
23198
23267
  return segment.endsWith("\r") ? segment.slice(0, -1) : segment;
@@ -23249,7 +23318,7 @@ function runRetentionIfOverCap(db) {
23249
23318
  db.run("DELETE FROM observability_event WHERE rowid IN (SELECT rowid FROM observability_event ORDER BY rowid ASC LIMIT ?)", [excess]);
23250
23319
  }
23251
23320
  function syntheticImportEventId(line) {
23252
- return createHash24("sha256").update(`${IMPORT_ID_NAMESPACE}\x00${line}`).digest("hex");
23321
+ return createHash23("sha256").update(`${IMPORT_ID_NAMESPACE}\x00${line}`).digest("hex");
23253
23322
  }
23254
23323
  function unparseableImportRow(line, reason) {
23255
23324
  return {
@@ -23639,7 +23708,7 @@ function readOtlpExporterHealth(directory) {
23639
23708
 
23640
23709
  // src/services/task-cohort.ts
23641
23710
  init_logger();
23642
- import { createHash as createHash25 } from "crypto";
23711
+ import { createHash as createHash24 } from "crypto";
23643
23712
  import * as fs20 from "fs";
23644
23713
  import * as path29 from "path";
23645
23714
  var MANIFEST_DIGEST_LIMIT_BYTES = 64 * 1024;
@@ -23661,7 +23730,7 @@ function captureFileManifest(source, filePath, capturedAt) {
23661
23730
  try {
23662
23731
  const buffer = Buffer.alloc(MANIFEST_DIGEST_LIMIT_BYTES);
23663
23732
  const bytesRead = fs20.readSync(fd, buffer, 0, buffer.length, 0);
23664
- const digest2 = createHash25("sha256").update(buffer.subarray(0, bytesRead)).digest("hex");
23733
+ const digest2 = createHash24("sha256").update(buffer.subarray(0, bytesRead)).digest("hex");
23665
23734
  return {
23666
23735
  source,
23667
23736
  status: "captured",
@@ -23687,7 +23756,7 @@ function captureHostStatusManifest(capturedAt, strata) {
23687
23756
  if (runtime === "") {
23688
23757
  return { source: "host_status", status: "unavailable", capturedAt };
23689
23758
  }
23690
- const digest2 = createHash25("sha256").update(runtime).digest("hex");
23759
+ const digest2 = createHash24("sha256").update(runtime).digest("hex");
23691
23760
  return {
23692
23761
  source: "host_status",
23693
23762
  status: "captured",
@@ -23697,7 +23766,7 @@ function captureHostStatusManifest(capturedAt, strata) {
23697
23766
  }
23698
23767
  function manifestFileName(capturedAt, manifests) {
23699
23768
  const combined = manifests.map((m) => `${m.source}:${m.status}:${m.digest ?? "-"}`).join("|");
23700
- const suffix = createHash25("sha256").update(combined).digest("hex").slice(0, 12);
23769
+ const suffix = createHash24("sha256").update(combined).digest("hex").slice(0, 12);
23701
23770
  const epoch = Date.parse(capturedAt);
23702
23771
  const stamp = Number.isFinite(epoch) ? epoch : 0;
23703
23772
  return `${stamp}-${suffix}.json`;
@@ -29106,7 +29175,7 @@ function clearCriticalShownIds(sessionID) {
29106
29175
  async function rehydratePrSubscriptions(sessionID, directory) {
29107
29176
  const map = new Map;
29108
29177
  try {
29109
- const { listActive: listActive2 } = await import("./pr-subscriptions-hkzd0nr4.js");
29178
+ const { listActive: listActive2 } = await import("./pr-subscriptions-9dbrw7ky.js");
29110
29179
  const records = await listActive2(directory);
29111
29180
  for (const record of records) {
29112
29181
  if (record.sessionID !== sessionID)
@@ -32492,7 +32561,7 @@ async function recordPrFeedbackStageA(directory, sessionID, revisionDigest, chec
32492
32561
  throw new Error(`BLOCKED: PR_FEEDBACK Stage A obligation ${obligation.id} requires exact validator contract provenance`);
32493
32562
  }
32494
32563
  }
32495
- const commandDigest = createHash26("sha256").update(`${check.obligationId ?? check.category}\x00${check.workingDirectory ?? "."}\x00${check.command.join("\x00")}`).digest("hex");
32564
+ const commandDigest = createHash25("sha256").update(`${check.obligationId ?? check.category}\x00${check.workingDirectory ?? "."}\x00${check.command.join("\x00")}`).digest("hex");
32496
32565
  if (commandDigests.has(commandDigest)) {
32497
32566
  throw new Error("BLOCKED: PR_FEEDBACK Stage A cannot reuse one command as multiple check receipts");
32498
32567
  }
@@ -33361,7 +33430,7 @@ function parseExactBoundPushIntent(command, armed) {
33361
33430
  return {
33362
33431
  ok: true,
33363
33432
  intent,
33364
- digest: createHash26("sha256").update(JSON.stringify(intent), "utf8").digest("hex")
33433
+ digest: createHash25("sha256").update(JSON.stringify(intent), "utf8").digest("hex")
33365
33434
  };
33366
33435
  }
33367
33436
  async function admitPrFeedbackPushAttempt(directory, sessionID, callID, intent, intentDigest) {
@@ -34152,7 +34221,7 @@ async function findOwnedPrReviewRunReservations(directory, sessionID, workflowIn
34152
34221
  return owned.sort();
34153
34222
  }
34154
34223
  function hashPrReviewFindingIds(ids) {
34155
- return createHash26("sha256").update([...new Set(ids)].sort().join("\x00"), "utf8").digest("hex");
34224
+ return createHash25("sha256").update([...new Set(ids)].sort().join("\x00"), "utf8").digest("hex");
34156
34225
  }
34157
34226
  async function readPrReviewRunReservation(directory, runId) {
34158
34227
  try {
@@ -34267,7 +34336,7 @@ async function readPrReviewFeedbackHandoffArtifact(directory, relativePath) {
34267
34336
  }
34268
34337
  return {
34269
34338
  artifact: parsed.data,
34270
- digest: createHash26("sha256").update(raw, "utf8").digest("hex")
34339
+ digest: createHash25("sha256").update(raw, "utf8").digest("hex")
34271
34340
  };
34272
34341
  }
34273
34342
  var PrReviewFindingProjectionSchema = exports_external.object({
@@ -34345,7 +34414,7 @@ async function readAuthoritativeFindingPolicy(directory, state) {
34345
34414
  const receipt = routeReceipt;
34346
34415
  const expectedPath = `pr-review/${runId}/findings.jsonl`;
34347
34416
  const raw = await readBoundedSwarmRegularFile2(directory, state.prReviewFindingsPath, PR_REVIEW_FINDINGS_MAX_BYTES, "PR_REVIEW final findings artifact");
34348
- const findingsDigest = createHash26("sha256").update(raw, "utf8").digest("hex");
34417
+ const findingsDigest = createHash25("sha256").update(raw, "utf8").digest("hex");
34349
34418
  if (receipt.version !== FINDING_POLICY_VERSION) {
34350
34419
  throw new Error(`BLOCKED: PR_REVIEW finding-policy route receipt version ${String(receipt.version)} does not match the current finding-policy version ${FINDING_POLICY_VERSION}; the sidecar was written by a different plugin version and cannot be trusted at this one`);
34351
34420
  }
@@ -34395,7 +34464,7 @@ function assertMatchingPrReviewFeedbackConsent(record, input) {
34395
34464
  }
34396
34465
  }
34397
34466
  function workflowIdentity(state) {
34398
- return state.workflowInstanceId ?? `legacy-${createHash26("sha256").update(`${state.sessionID}\x00${state.mode}\x00${state.activatedAt}`).digest("hex").slice(0, 32)}`;
34467
+ return state.workflowInstanceId ?? `legacy-${createHash25("sha256").update(`${state.sessionID}\x00${state.mode}\x00${state.activatedAt}`).digest("hex").slice(0, 32)}`;
34399
34468
  }
34400
34469
  function sameHandoffIds(left, right) {
34401
34470
  const normalizedLeft = [...new Set(left)].sort();
@@ -37944,7 +38013,7 @@ ${USAGE2}`;
37944
38013
  }
37945
38014
 
37946
38015
  // src/services/spec-drift-recovery.ts
37947
- import { createHash as createHash27 } from "crypto";
38016
+ import { createHash as createHash26 } from "crypto";
37948
38017
  import { mkdir as mkdir6, readFile as readFile10, unlink as unlink2 } from "fs/promises";
37949
38018
  import { dirname as dirname17 } from "path";
37950
38019
  var SPEC_DRIFT_RECOVERY_AGENT = "spec-drift-recovery";
@@ -37974,7 +38043,7 @@ function now() {
37974
38043
  return new Date().toISOString();
37975
38044
  }
37976
38045
  function sha2564(text) {
37977
- return createHash27("sha256").update(text, "utf-8").digest("hex");
38046
+ return createHash26("sha256").update(text, "utf-8").digest("hex");
37978
38047
  }
37979
38048
  function parseMarker(raw) {
37980
38049
  try {
@@ -38493,7 +38562,7 @@ ${USAGE3}`;
38493
38562
 
38494
38563
  // src/security/write-authority.ts
38495
38564
  import { AsyncLocalStorage } from "async_hooks";
38496
- import { createHash as createHash28, randomUUID as randomUUID7 } from "crypto";
38565
+ import { createHash as createHash27, randomUUID as randomUUID7 } from "crypto";
38497
38566
  import { existsSync as existsSync15, readFileSync as readFileSync17 } from "fs";
38498
38567
  import * as path35 from "path";
38499
38568
  var DEFAULT_TTL_MS = 30 * 60 * 1000;
@@ -38600,7 +38669,7 @@ function leastPrivilege(left, right) {
38600
38669
  return ORIGIN_RANK[left.origin] <= ORIGIN_RANK[right.origin] ? left : right;
38601
38670
  }
38602
38671
  function computeWriteApprovalHash(input) {
38603
- return createHash28("sha256").update(stableSerialize(input)).digest("hex");
38672
+ return createHash27("sha256").update(stableSerialize(input)).digest("hex");
38604
38673
  }
38605
38674
  function getCurrentWriteAuthority() {
38606
38675
  const extent = authorityStore.getStore();
@@ -43222,7 +43291,7 @@ import { promises as fs31 } from "fs";
43222
43291
  import path47 from "path";
43223
43292
 
43224
43293
  // src/services/swarm-residue.ts
43225
- import { createHash as createHash29 } from "crypto";
43294
+ import { createHash as createHash28 } from "crypto";
43226
43295
  import * as fs30 from "fs";
43227
43296
  import * as path45 from "path";
43228
43297
  var RESIDUE_STALE_AGE_MS = 30 * 60000;
@@ -43276,7 +43345,7 @@ var _internals52 = {
43276
43345
  return targets;
43277
43346
  },
43278
43347
  sha256File: (absPath) => {
43279
- const hash = createHash29("sha256");
43348
+ const hash = createHash28("sha256");
43280
43349
  const fd = fs30.openSync(absPath, "r");
43281
43350
  try {
43282
43351
  const chunk = Buffer.alloc(1024 * 1024);
@@ -45826,7 +45895,7 @@ var _internals56 = {
45826
45895
  import { existsSync as existsSync22 } from "fs";
45827
45896
 
45828
45897
  // src/hooks/knowledge-curator.ts
45829
- import { createHash as createHash30 } from "crypto";
45898
+ import { createHash as createHash29 } from "crypto";
45830
45899
  import { realpath as realpath3 } from "fs/promises";
45831
45900
  import * as path53 from "path";
45832
45901
 
@@ -46105,12 +46174,12 @@ function recordSeenRetroSection(key, value, timestamp) {
46105
46174
  capSeenRetroSections();
46106
46175
  }
46107
46176
  function hashContent(content) {
46108
- return createHash30("sha1").update(content).digest("hex");
46177
+ return createHash29("sha1").update(content).digest("hex");
46109
46178
  }
46110
46179
  async function loadConfigForPolicyCurator(directory) {
46111
- const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-emx6r32d.js");
46180
+ const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-0ny9ef6s.js");
46112
46181
  try {
46113
- const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-psqfkgav.js");
46182
+ const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-3qqnz0jg.js");
46114
46183
  const { config: loadedConfig } = loadPluginConfigWithMeta2(directory);
46115
46184
  return KnowledgeConfigSchema2.parse(loadedConfig.knowledge ?? {});
46116
46185
  } catch {
@@ -48948,9 +49017,9 @@ var _internals59 = {
48948
49017
  init_logger();
48949
49018
 
48950
49019
  // src/workflow/close-terminal.ts
48951
- import { createHash as createHash31 } from "crypto";
49020
+ import { createHash as createHash30 } from "crypto";
48952
49021
  function createCloseTransitionId(planEpoch, taskId, target) {
48953
- const digest2 = createHash31("sha256").update(JSON.stringify([planEpoch, taskId, target]), "utf8").digest("hex");
49022
+ const digest2 = createHash30("sha256").update(JSON.stringify([planEpoch, taskId, target]), "utf8").digest("hex");
48954
49023
  return `close-terminal:${digest2}`;
48955
49024
  }
48956
49025
  function findTask(plan, taskId) {
@@ -49168,7 +49237,7 @@ async function resolveCuratorLLMDelegate(directory, mode, sessionId) {
49168
49237
  const seam = _internals50.createCuratorLLMDelegate;
49169
49238
  if (seam)
49170
49239
  return seam(directory, mode, sessionId);
49171
- const { createCuratorLLMDelegate } = await import("./curator-llm-factory-cvrt4bf9.js");
49240
+ const { createCuratorLLMDelegate } = await import("./curator-llm-factory-kt3jhgs9.js");
49172
49241
  return createCuratorLLMDelegate(directory, mode, sessionId);
49173
49242
  }
49174
49243
  async function reconcileCloseTerminalStateForPlan(directory, targetPlan, options) {
@@ -49563,7 +49632,7 @@ async function runFinalizeStage(ctx) {
49563
49632
  }
49564
49633
  }
49565
49634
  try {
49566
- const { CuratorConfigSchema: CCS } = await import("./schema-emx6r32d.js");
49635
+ const { CuratorConfigSchema: CCS } = await import("./schema-0ny9ef6s.js");
49567
49636
  const { config: pmLoadedConfig } = _internals50.loadPluginConfigWithMeta(ctx.directory);
49568
49637
  const curatorCfg = CCS.parse(pmLoadedConfig.curator ?? {});
49569
49638
  if (curatorCfg.enabled && curatorCfg.postmortem_enabled) {
@@ -52295,7 +52364,7 @@ function buildApprovedReceipt(opts) {
52295
52364
  }
52296
52365
 
52297
52366
  // src/services/skill-optimizer/store.ts
52298
- import { createHash as createHash33, randomUUID as randomUUID10 } from "crypto";
52367
+ import { createHash as createHash32, randomUUID as randomUUID10 } from "crypto";
52299
52368
  import {
52300
52369
  closeSync as closeSync13,
52301
52370
  existsSync as existsSync27,
@@ -52320,10 +52389,10 @@ function canonicalJson2(value) {
52320
52389
  return `{${entries.map(([k, v]) => `${JSON.stringify(k)}:${canonicalJson2(v)}`).join(",")}}`;
52321
52390
  }
52322
52391
  function computeStateHash(value) {
52323
- return createHash33("sha256").update(canonicalJson2(value), "utf8").digest("hex");
52392
+ return createHash32("sha256").update(canonicalJson2(value), "utf8").digest("hex");
52324
52393
  }
52325
52394
  function computeContentHash2(content) {
52326
- return createHash33("sha256").update(content, "utf8").digest("hex");
52395
+ return createHash32("sha256").update(content, "utf8").digest("hex");
52327
52396
  }
52328
52397
  function computeEventHash(event) {
52329
52398
  return computeStateHash({
@@ -53361,7 +53430,7 @@ async function countStaleSummaries(projectRoot, retentionDays, now2) {
53361
53430
  }
53362
53431
 
53363
53432
  // src/session/snapshot-coordination-init.ts
53364
- import { createHash as createHash34, randomUUID as randomUUID11 } from "crypto";
53433
+ import { createHash as createHash33, randomUUID as randomUUID11 } from "crypto";
53365
53434
  import { existsSync as existsSync29, readFileSync as readFileSync24, renameSync as renameSync10 } from "fs";
53366
53435
  init_warning_buffer();
53367
53436
 
@@ -53596,7 +53665,7 @@ function serializeAgentSession(s) {
53596
53665
  }
53597
53666
  async function writeSnapshot(directory, state) {
53598
53667
  try {
53599
- const { ensureSnapshotCoordinationReady } = await import("./snapshot-coordination-init-2x56ds8a.js");
53668
+ const { ensureSnapshotCoordinationReady } = await import("./snapshot-coordination-init-f6ecsn9c.js");
53600
53669
  await ensureSnapshotCoordinationReady(directory);
53601
53670
  const snapshot = {
53602
53671
  version: 3,
@@ -54190,7 +54259,7 @@ async function initializeSnapshotCoordination(directory, scope) {
54190
54259
  if (!isCurrent())
54191
54260
  return "superseded";
54192
54261
  const serialized = JSON.stringify(candidate);
54193
- const outcome = _snapshotCoordinationInternals.importSnapshotRowsOnce(directory, candidate, createHash34("sha256").update(serialized).digest("hex"), source);
54262
+ const outcome = _snapshotCoordinationInternals.importSnapshotRowsOnce(directory, candidate, createHash33("sha256").update(serialized).digest("hex"), source);
54194
54263
  snapshot = readSnapshotRows(directory);
54195
54264
  if (outcome === "imported" && source === "session/state.json") {
54196
54265
  legacyArchiveAttempted = true;
@@ -55895,16 +55964,16 @@ function parsePromotedExternalFrontmatter(content) {
55895
55964
  if (!match)
55896
55965
  return {};
55897
55966
  const fm = match[1];
55898
- const originMatch = /^skill_origin:\s*(\S+)/m.exec(fm);
55899
- const promotedAtMatch = /^promoted_at:\s*(\S+)/m.exec(fm);
55900
- const origin = originMatch?.[1];
55901
- const promotedAt = promotedAtMatch?.[1];
55967
+ const originMatch = /^\s+skill_origin:\s*(\S+)/m.exec(fm);
55968
+ const promotedAtMatch = /^\s+promoted_at:\s*(\S+)/m.exec(fm);
55969
+ const origin = stripFmQuotes(originMatch?.[1] ?? /^skill_origin:\s*(\S+)/m.exec(fm)?.[1]);
55970
+ const promotedAt = stripFmQuotes(promotedAtMatch?.[1] ?? /^promoted_at:\s*(\S+)/m.exec(fm)?.[1]);
55902
55971
  let sourceKnowledgeIds;
55903
- const inlineMatch = /^source_knowledge_ids:\s*\[([^\]]*)\]/m.exec(fm);
55972
+ const inlineMatch = /^\s*source_knowledge_ids:\s*'?\[([^\]]*)\]'?/m.exec(fm);
55904
55973
  if (inlineMatch) {
55905
55974
  sourceKnowledgeIds = inlineMatch[1].split(",").map((s) => s.trim().replace(/^["']|["']$/g, "")).filter(Boolean);
55906
55975
  } else {
55907
- const blockMatch = /^source_knowledge_ids:\s*$/m.exec(fm);
55976
+ const blockMatch = /^\s*source_knowledge_ids:\s*$/m.exec(fm);
55908
55977
  if (blockMatch && blockMatch.index !== undefined) {
55909
55978
  const afterKey = fm.slice(blockMatch.index + blockMatch[0].length);
55910
55979
  const blockItems = [];
@@ -55924,6 +55993,15 @@ function parsePromotedExternalFrontmatter(content) {
55924
55993
  }
55925
55994
  return { origin, sourceKnowledgeIds, promotedAt };
55926
55995
  }
55996
+ function stripFmQuotes(value) {
55997
+ if (value === undefined)
55998
+ return;
55999
+ const trimmed = value.trim();
56000
+ if (trimmed.startsWith('"') && trimmed.endsWith('"') || trimmed.startsWith("'") && trimmed.endsWith("'")) {
56001
+ return trimmed.slice(1, -1);
56002
+ }
56003
+ return trimmed;
56004
+ }
55927
56005
  function readPromotedExternalFrontmatter(skillPath) {
55928
56006
  if (!existsSync32(skillPath))
55929
56007
  return {};
@@ -55977,14 +56055,17 @@ function buildPromotedExternalInputFromSkill(directory, skillSlug, usage, ageDay
55977
56055
  }
55978
56056
 
55979
56057
  // src/services/skill-reviser.ts
55980
- init_logger();
55981
56058
  import { readFile as readFile16, rename as rename6, writeFile as writeFile7 } from "fs/promises";
56059
+ init_logger();
55982
56060
  var REVISION_VIOLATION_THRESHOLD = 0.15;
55983
56061
  var MAX_REVISION_CALLS_PER_PHASE = 3;
55984
56062
  var DEFAULT_MAX_CALLS = 10;
55985
56063
  async function getSkillVersion(skillPath) {
55986
56064
  try {
55987
56065
  const content = await readFile16(skillPath, "utf-8");
56066
+ const nested = content.match(/^\s+version:\s*"(\d+)"\s*$/m);
56067
+ if (nested)
56068
+ return parseInt(nested[1], 10);
55988
56069
  const match = content.match(/^version:\s*(\d+)\s*$/m);
55989
56070
  return match ? parseInt(match[1], 10) : 1;
55990
56071
  } catch {
@@ -56009,15 +56090,30 @@ function buildDeterministicRevision(currentContent, currentVersion, violationCon
56009
56090
  ].join(`
56010
56091
  `);
56011
56092
  let result = currentContent;
56012
- if (/^version:\s*\d+\s*$/m.test(result)) {
56013
- result = result.replace(/^version:\s*\d+\s*$/m, `version: ${nextVersion}`);
56014
- } else if (/^confidence:\s*.+$/m.test(result)) {
56015
- result = result.replace(/^(confidence:\s*.+)$/m, `$1
56093
+ const split = splitSkillFrontmatter(result);
56094
+ let fm = split.frontmatter;
56095
+ const nestedVersion = /^(\s+)version:\s*"?(\d+)"?\s*[ \t]*$/m.exec(fm);
56096
+ if (nestedVersion?.[1]) {
56097
+ fm = fm.replace(/^(\s+)version:\s*"?(\d+)"?\s*[ \t]*$/m, `${nestedVersion[1]}version: "${nextVersion}"`);
56098
+ } else if (/^version:\s*"?(\d+)"?\s*[ \t]*$/m.test(fm)) {
56099
+ fm = fm.replace(/^version:\s*"?(\d+)"?\s*[ \t]*$/m, `version: ${nextVersion}`);
56100
+ } else if (/^(\s+)confidence:\s*/m.test(fm)) {
56101
+ const indent = /^(\s+)confidence:/m.exec(fm)?.[1] ?? "";
56102
+ fm = fm.replace(/^(\s+)(confidence:[^\n]*)$/m, `$1$2
56103
+ ${indent}version: "${nextVersion}"`);
56104
+ } else if (/^confidence:[^\n]*$/m.test(fm) && !/^metadata:[ \t]*$/m.test(fm)) {
56105
+ fm = fm.replace(/^(confidence:[^\n]*)$/m, `$1
56016
56106
  version: ${nextVersion}`);
56017
- } else {
56018
- result = result.replace(/^(---\s*\n)/, `$1version: ${nextVersion}
56107
+ } else if (/^metadata:[ \t]*$/m.test(fm)) {
56108
+ fm = fm.replace(/^(metadata:[ \t]*\n)/m, `$1 version: "${nextVersion}"
56019
56109
  `);
56110
+ } else {
56111
+ fm = fm.replace(/\n(---[ \t]*(?:\r?\n|$))/, `
56112
+ metadata:
56113
+ version: "${nextVersion}"
56114
+ $1`);
56020
56115
  }
56116
+ result = fm + split.body;
56021
56117
  const revisionNotesPattern = /## Revision Notes\n[\s\S]*?(?=\n## Source Knowledge IDs|$)/;
56022
56118
  if (revisionNotesPattern.test(result)) {
56023
56119
  result = result.replace(revisionNotesPattern, "");
@@ -56051,9 +56147,9 @@ function buildLLMPrompt(currentContent, currentVersion, violationContexts) {
56051
56147
  const userPrompt = [
56052
56148
  "Instructions:",
56053
56149
  "- Revise ONLY the sections that were violated",
56054
- "- Preserve the exact frontmatter format (--- fenced YAML)",
56150
+ "- Preserve the exact frontmatter format (--- fenced YAML), including the indented `metadata:` block",
56055
56151
  "- Preserve all sections: Trigger, Required Procedure, Forbidden Shortcuts, Delegation Template, Reviewer Checks, Source Knowledge IDs",
56056
- `- Update the version field in frontmatter to ${currentVersion + 1}`,
56152
+ `- Update the version field in frontmatter to ${currentVersion + 1} (metadata.version when the metadata block is present)`,
56057
56153
  "- Make the violated rules clearer, more specific, or add missing edge cases",
56058
56154
  "- Do NOT remove any source knowledge IDs",
56059
56155
  "- Do NOT change the name or description in frontmatter",
@@ -56185,8 +56281,16 @@ async function reviseSkill(params) {
56185
56281
  }
56186
56282
  const expectedVersion = params.currentVersion + 1;
56187
56283
  let finalOutput = llmOutput.trim();
56188
- if (/^version:\s*\d+\s*$/m.test(finalOutput)) {
56189
- finalOutput = finalOutput.replace(/^version:\s*\d+\s*$/m, `version: ${expectedVersion}`);
56284
+ {
56285
+ const llmSplit = splitSkillFrontmatter(finalOutput);
56286
+ let llmFm = llmSplit.frontmatter;
56287
+ const nested = /^(\s+)version:\s*"?\d+"?\s*[ \t]*$/m.exec(llmFm);
56288
+ if (nested?.[1]) {
56289
+ llmFm = llmFm.replace(/^(\s+)version:\s*"?\d+"?\s*[ \t]*$/m, `${nested[1]}version: "${expectedVersion}"`);
56290
+ } else if (/^version:\s*\d+\s*$/m.test(llmFm)) {
56291
+ llmFm = llmFm.replace(/^version:\s*\d+\s*$/m, `version: ${expectedVersion}`);
56292
+ }
56293
+ finalOutput = llmFm + llmSplit.body;
56190
56294
  }
56191
56295
  const validation = await validateRevisionCandidate(params, `${finalOutput}
56192
56296
  `, "skill_reviser:llm");
@@ -56617,7 +56721,7 @@ function planMerges(active, threshold, maxComparisons, maxMerges) {
56617
56721
  };
56618
56722
  }
56619
56723
  async function sweepActiveNearDuplicates(directory, options = {}) {
56620
- const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-psqfkgav.js");
56724
+ const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-3qqnz0jg.js");
56621
56725
  const { config } = loadPluginConfigWithMeta2(directory);
56622
56726
  const sweepConfig = config.learning?.dedup_sweep;
56623
56727
  if (sweepConfig?.enabled === false)
@@ -57741,7 +57845,7 @@ async function runCuratorPhase(directory, phase, agentsDispatched, config, knowl
57741
57845
  }
57742
57846
  if (config.skill_generation_enabled === true && skillCandidates.length > 0) {
57743
57847
  try {
57744
- const skillModule = await import("./skill-generator-w0jy1mpc.js");
57848
+ const skillModule = await import("./skill-generator-h1w7s5dh.js");
57745
57849
  for (const cand of skillCandidates) {
57746
57850
  if (cand.confidence < (config.min_skill_confidence ?? DEFAULT_SKILL_MIN_CONFIDENCE)) {
57747
57851
  continue;
@@ -58213,7 +58317,7 @@ async function applyCuratorKnowledgeUpdates(directory, recommendations, knowledg
58213
58317
  } catch {}
58214
58318
  }
58215
58319
  if (contradictedEntries.length > 0 && knowledgeConfig.contradiction_threshold_action === "quarantine") {
58216
- const { maybeQuarantineOnContradiction } = await import("./knowledge-escalator-2dy96d0j.js");
58320
+ const { maybeQuarantineOnContradiction } = await import("./knowledge-escalator-42cvn0ec.js");
58217
58321
  for (const { id } of contradictedEntries) {
58218
58322
  try {
58219
58323
  await maybeQuarantineOnContradiction(directory, id, knowledgeConfig.contradiction_quarantine_threshold, knowledgeConfig.contradiction_quarantine_window_days);
@@ -59045,7 +59149,7 @@ async function runCuratorPostMortem(directory, options = {}) {
59045
59149
  warnings.push("Failed to collect knowledge summary.");
59046
59150
  }
59047
59151
  try {
59048
- const { getScanStatus } = await import("./scan-cursor-arezehhk.js");
59152
+ const { getScanStatus } = await import("./scan-cursor-d93q0q3s.js");
59049
59153
  const scanStatus = await getScanStatus(directory);
59050
59154
  if (scanStatus.remaining_estimate > 0) {
59051
59155
  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.`);
@@ -59217,9 +59321,9 @@ var _internals72 = {
59217
59321
  verifyPostMortemKnowledgeActions,
59218
59322
  repairPostMortemActions,
59219
59323
  loadDefaultKnowledgeConfig: async (directory) => {
59220
- const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-emx6r32d.js");
59324
+ const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-0ny9ef6s.js");
59221
59325
  try {
59222
- const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-psqfkgav.js");
59326
+ const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-3qqnz0jg.js");
59223
59327
  const loaded = loadPluginConfigWithMeta2(directory);
59224
59328
  return KnowledgeConfigSchema2.parse(loaded.config.knowledge ?? {});
59225
59329
  } catch {
@@ -59227,11 +59331,11 @@ var _internals72 = {
59227
59331
  }
59228
59332
  },
59229
59333
  applyCuratorKnowledgeUpdates: async (directory, recommendations, knowledgeConfig, generation) => {
59230
- const { applyCuratorKnowledgeUpdates: applyCuratorKnowledgeUpdates2 } = await import("./curator-891pc8b7.js");
59334
+ const { applyCuratorKnowledgeUpdates: applyCuratorKnowledgeUpdates2 } = await import("./curator-mqnqst1g.js");
59231
59335
  return applyCuratorKnowledgeUpdates2(directory, recommendations, knowledgeConfig, generation);
59232
59336
  },
59233
59337
  checkHivePromotions: async (entries2, knowledgeConfig, directory) => {
59234
- const { checkHivePromotions } = await import("./hive-promoter-w1vchgfr.js");
59338
+ const { checkHivePromotions } = await import("./hive-promoter-w8f840ah.js");
59235
59339
  return checkHivePromotions(entries2, knowledgeConfig, directory);
59236
59340
  },
59237
59341
  applyProposalTriage: async (directory, triage) => {
@@ -59240,7 +59344,7 @@ var _internals72 = {
59240
59344
  activateProposal,
59241
59345
  listSkills: listSkills2,
59242
59346
  sanitizeSlug
59243
- } = await import("./skill-generator-w0jy1mpc.js");
59347
+ } = await import("./skill-generator-h1w7s5dh.js");
59244
59348
  const result = {
59245
59349
  approved: [],
59246
59350
  rejected: [],
@@ -59282,7 +59386,7 @@ var _internals72 = {
59282
59386
  return result;
59283
59387
  },
59284
59388
  readPriorDriftReports: async (directory) => {
59285
- const { readPriorDriftReports: readPriorDriftReports2 } = await import("./curator-drift-sxzs48ew.js");
59389
+ const { readPriorDriftReports: readPriorDriftReports2 } = await import("./curator-drift-2h6nf0mw.js");
59286
59390
  return readPriorDriftReports2(directory);
59287
59391
  },
59288
59392
  readSwarmKnowledge: (directory) => readKnowledge(resolveSwarmKnowledgePath(directory))
@@ -59291,7 +59395,7 @@ var _internals72 = {
59291
59395
  // src/hooks/hive-promoter.ts
59292
59396
  init_constants();
59293
59397
  init_schema();
59294
- import { createHash as createHash35 } from "crypto";
59398
+ import { createHash as createHash34 } from "crypto";
59295
59399
  import path75 from "path";
59296
59400
 
59297
59401
  // src/hooks/cohort-cache.ts
@@ -59733,7 +59837,7 @@ function buildLineage(args) {
59733
59837
  return lineage;
59734
59838
  }
59735
59839
  function lessonRevision(lesson) {
59736
- return createHash35("sha256").update(lesson).digest("hex").slice(0, 12);
59840
+ return createHash34("sha256").update(lesson).digest("hex").slice(0, 12);
59737
59841
  }
59738
59842
  async function checkHivePromotions(swarmEntries, config, directory, sessionID) {
59739
59843
  const empty = {
@@ -60377,7 +60481,7 @@ async function promoteFromSwarm(directory, lessonId, options, config) {
60377
60481
  init_logger();
60378
60482
 
60379
60483
  // src/memory/gateway.ts
60380
- import { createHash as createHash39, randomUUID as randomUUID16 } from "crypto";
60484
+ import { createHash as createHash38, randomUUID as randomUUID16 } from "crypto";
60381
60485
  import { existsSync as existsSync39, mkdirSync as mkdirSync25, readFileSync as readFileSync32 } from "fs";
60382
60486
  import * as path84 from "path";
60383
60487
  init_logger();
@@ -60627,7 +60731,7 @@ var MAX_RELATIONS_PER_MEMORY = 32;
60627
60731
  var RELATED_RECALL_FANOUT = 2;
60628
60732
  // src/memory/schema.ts
60629
60733
  init_zod();
60630
- import { createHash as createHash36 } from "crypto";
60734
+ import { createHash as createHash35 } from "crypto";
60631
60735
 
60632
60736
  // src/memory/pii.ts
60633
60737
  import { createRequire } from "module";
@@ -61112,7 +61216,7 @@ function stableScopeKey(scope) {
61112
61216
  }
61113
61217
  function computeMemoryContentHash(recordLike) {
61114
61218
  const normalized = normalizeMemoryText(recordLike.text).toLowerCase();
61115
- return createHash36("sha256").update(`${stableScopeKey(recordLike.scope)}
61219
+ return createHash35("sha256").update(`${stableScopeKey(recordLike.scope)}
61116
61220
  ${recordLike.kind}
61117
61221
  ${normalized}`).digest("hex");
61118
61222
  }
@@ -61120,14 +61224,14 @@ function createMemoryId(recordLike) {
61120
61224
  return `mem_${computeMemoryContentHash(recordLike).slice(0, 16)}`;
61121
61225
  }
61122
61226
  function createProposalId(input) {
61123
- const hash = createHash36("sha256").update(`${input.createdAt}
61227
+ const hash = createHash35("sha256").update(`${input.createdAt}
61124
61228
  ${input.proposer}
61125
61229
  ${normalizeMemoryText(input.text)}`).digest("hex");
61126
61230
  return `prop_${hash.slice(0, 16)}`;
61127
61231
  }
61128
61232
  function createBundleId(query, generatedAt) {
61129
61233
  const compactTimestamp = generatedAt.replace(/[-:.TZ]/g, "").slice(0, 14);
61130
- const hash = createHash36("sha256").update(`${generatedAt}
61234
+ const hash = createHash35("sha256").update(`${generatedAt}
61131
61235
  ${query}`).digest("hex").slice(0, 8);
61132
61236
  return `bundle_${compactTimestamp}_${hash}`;
61133
61237
  }
@@ -61989,7 +62093,7 @@ function proposalSort(a, b) {
61989
62093
  }
61990
62094
 
61991
62095
  // src/memory/outcome-events.ts
61992
- import { createHash as createHash37, randomUUID as randomUUID13 } from "crypto";
62096
+ import { createHash as createHash36, randomUUID as randomUUID13 } from "crypto";
61993
62097
  function newOutcomeGeneration() {
61994
62098
  return randomUUID13();
61995
62099
  }
@@ -62122,7 +62226,7 @@ function dedupeAnchors(anchors) {
62122
62226
  return [...byKey.values()].sort((a, b) => compareText(a.file, b.file) || compareText(a.symbol ?? "", b.symbol ?? ""));
62123
62227
  }
62124
62228
  function hash(value) {
62125
- return createHash37("sha256").update(value).digest("hex").slice(0, 32);
62229
+ return createHash36("sha256").update(value).digest("hex").slice(0, 32);
62126
62230
  }
62127
62231
  function compareText(a, b) {
62128
62232
  return a < b ? -1 : a > b ? 1 : 0;
@@ -63088,7 +63192,7 @@ function toRecallBundle(input) {
63088
63192
  import { mkdirSync as mkdirSync23 } from "fs";
63089
63193
 
63090
63194
  // src/memory/sqlite-provider.ts
63091
- import { createHash as createHash38, randomUUID as randomUUID15 } from "crypto";
63195
+ import { createHash as createHash37, randomUUID as randomUUID15 } from "crypto";
63092
63196
  import {
63093
63197
  existsSync as existsSync37,
63094
63198
  mkdirSync as mkdirSync22,
@@ -63758,7 +63862,7 @@ function toJsonl(values) {
63758
63862
  var EVENT_CHAIN_GENESIS = "GENESIS";
63759
63863
  var MEMORY_EVENTS_CHAIN_HEAD_KEY = "memory_events_chain_head";
63760
63864
  function memoryEventRowHash(row) {
63761
- return createHash38("sha256").update(stableCanonicalStringify({
63865
+ return createHash37("sha256").update(stableCanonicalStringify({
63762
63866
  id: row.id,
63763
63867
  operation: row.operation,
63764
63868
  target_id: row.target_id,
@@ -67248,7 +67352,7 @@ function sourceFromEvidence(evidenceRefs, context) {
67248
67352
  return { type: "manual", ref: first };
67249
67353
  }
67250
67354
  function createStableId(value) {
67251
- return createHash39("sha256").update(value.toLowerCase()).digest("hex").slice(0, 16);
67355
+ return createHash38("sha256").update(value.toLowerCase()).digest("hex").slice(0, 16);
67252
67356
  }
67253
67357
  var gitRemoteUrlCache = new Map;
67254
67358
  var MAX_GIT_REMOTE_CACHE_ENTRIES = 128;
@@ -69552,9 +69656,9 @@ var _internals80 = {
69552
69656
  loadPluginConfigWithMeta,
69553
69657
  loadCuratorDeps: async () => {
69554
69658
  const [{ CuratorConfigSchema }, curator, { createCuratorLLMDelegate }] = await Promise.all([
69555
- import("./schema-emx6r32d.js"),
69556
- import("./curator-891pc8b7.js"),
69557
- import("./curator-llm-factory-cvrt4bf9.js")
69659
+ import("./schema-0ny9ef6s.js"),
69660
+ import("./curator-mqnqst1g.js"),
69661
+ import("./curator-llm-factory-kt3jhgs9.js")
69558
69662
  ]);
69559
69663
  return { CuratorConfigSchema, curator, createCuratorLLMDelegate };
69560
69664
  }
@@ -69821,11 +69925,11 @@ async function handleDashboardCommand(directory, _args) {
69821
69925
  }
69822
69926
 
69823
69927
  // src/commands/dataset.ts
69824
- import { createHash as createHash43 } from "crypto";
69928
+ import { createHash as createHash42 } from "crypto";
69825
69929
 
69826
69930
  // src/training/consent.ts
69827
69931
  init_zod();
69828
- import { createHash as createHash40, randomUUID as randomUUID17 } from "crypto";
69932
+ import { createHash as createHash39, randomUUID as randomUUID17 } from "crypto";
69829
69933
  import * as fs46 from "fs";
69830
69934
  import * as path90 from "path";
69831
69935
 
@@ -69896,7 +70000,7 @@ function rootDigestOf(directory) {
69896
70000
  try {
69897
70001
  canonical = fs46.realpathSync.native(directory);
69898
70002
  } catch {}
69899
- return createHash40("sha256").update(`training-project-binding-v1\x00${canonical}`).digest("hex").slice(0, 16);
70003
+ return createHash39("sha256").update(`training-project-binding-v1\x00${canonical}`).digest("hex").slice(0, 16);
69900
70004
  }
69901
70005
  function computeProjectBinding(directory) {
69902
70006
  return {
@@ -70005,13 +70109,13 @@ function readTrainingConsentState(directory) {
70005
70109
 
70006
70110
  // src/training/exporter.ts
70007
70111
  init_zod();
70008
- import { createHash as createHash42, randomBytes as randomBytes2 } from "crypto";
70112
+ import { createHash as createHash41, randomBytes as randomBytes2 } from "crypto";
70009
70113
  import * as fs49 from "fs";
70010
70114
  import * as path92 from "path";
70011
70115
 
70012
70116
  // src/training/vault.ts
70013
70117
  init_zod();
70014
- import { createHash as createHash41, randomUUID as randomUUID18 } from "crypto";
70118
+ import { createHash as createHash40, randomUUID as randomUUID18 } from "crypto";
70015
70119
  import * as fs48 from "fs";
70016
70120
  import * as path91 from "path";
70017
70121
 
@@ -70096,7 +70200,7 @@ var TrainingWithdrawalTombstoneSchema = exports_external.object({
70096
70200
  revoked_export_ids: exports_external.array(exports_external.string())
70097
70201
  }).strict();
70098
70202
  function sha2565(input) {
70099
- return createHash41("sha256").update(input, "utf8").digest("hex");
70203
+ return createHash40("sha256").update(input, "utf8").digest("hex");
70100
70204
  }
70101
70205
  function readHealth(directory) {
70102
70206
  try {
@@ -70332,7 +70436,7 @@ var TrainingExportFiltersSchema = exports_external.object({
70332
70436
  validationRatio: exports_external.number().min(0).max(0.5).optional()
70333
70437
  }).strict();
70334
70438
  function sha2566(input) {
70335
- return createHash42("sha256").update(input, "utf8").digest("hex");
70439
+ return createHash41("sha256").update(input, "utf8").digest("hex");
70336
70440
  }
70337
70441
  function canonicalJson3(value) {
70338
70442
  if (value === null || typeof value !== "object") {
@@ -70473,7 +70577,7 @@ function consumeTrainingPendingOp(directory) {
70473
70577
  } catch {}
70474
70578
  }
70475
70579
  function issueTrainingConfirmToken(directory, scope) {
70476
- const token = createHash42("sha256").update(`${scope.digest}:${randomBytes2(16).toString("hex")}`).digest("hex").slice(0, 24);
70580
+ const token = createHash41("sha256").update(`${scope.digest}:${randomBytes2(16).toString("hex")}`).digest("hex").slice(0, 24);
70477
70581
  writePending(directory, {
70478
70582
  schema_version: 1,
70479
70583
  kind: scope.kind,
@@ -70617,7 +70721,7 @@ async function handleDatasetConsentCommand(directory, args) {
70617
70721
  maxRecords: quotaNumber(flagValue(args, "max-records")) ?? TRAINING_QUOTA_CEILINGS.maxRecords,
70618
70722
  retentionDays: quotaNumber(flagValue(args, "retention-days")) ?? TRAINING_QUOTA_CEILINGS.retentionDays
70619
70723
  };
70620
- const digest2 = createHash43("sha256").update(`dataset-consent-v1\x00${JSON.stringify(quotas)}`).digest("hex");
70724
+ const digest2 = createHash42("sha256").update(`dataset-consent-v1\x00${JSON.stringify(quotas)}`).digest("hex");
70621
70725
  if (confirm !== undefined) {
70622
70726
  const check = checkTrainingConfirmToken(directory, "consent", confirm);
70623
70727
  if (!check.ok) {
@@ -70658,7 +70762,7 @@ async function handleDatasetWithdrawCommand(directory, args) {
70658
70762
  const status = getTrainingVaultStatus(directory);
70659
70763
  const revocations = readTrainingExportRevocations(directory);
70660
70764
  const exportIds = revocations.length;
70661
- const digest2 = createHash43("sha256").update(`dataset-withdraw-v1\x00${status.recordCount}\x00${status.vaultBytes}\x00${status.tombstoneCount}`).digest("hex");
70765
+ const digest2 = createHash42("sha256").update(`dataset-withdraw-v1\x00${status.recordCount}\x00${status.vaultBytes}\x00${status.tombstoneCount}`).digest("hex");
70662
70766
  const confirm = flagValue(args, "confirm");
70663
70767
  if (confirm !== undefined) {
70664
70768
  const check = checkTrainingConfirmToken(directory, "withdraw", confirm);
@@ -72004,7 +72108,7 @@ async function computeCurationDiagnostics(directory, entries2) {
72004
72108
  let scanCompleted = false;
72005
72109
  let scanRemaining = 0;
72006
72110
  try {
72007
- const { getScanStatus } = await import("./scan-cursor-arezehhk.js");
72111
+ const { getScanStatus } = await import("./scan-cursor-d93q0q3s.js");
72008
72112
  const status = await getScanStatus(directory);
72009
72113
  scanGeneration = status.generation;
72010
72114
  scanCompleted = status.completed;
@@ -72014,10 +72118,10 @@ async function computeCurationDiagnostics(directory, entries2) {
72014
72118
  try {
72015
72119
  const { isLinked: isLinked2 } = await import("./knowledge-link-8bn2b7vr.js");
72016
72120
  if (isLinked2(directory)) {
72017
- const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-emx6r32d.js");
72121
+ const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-0ny9ef6s.js");
72018
72122
  let config;
72019
72123
  try {
72020
- const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-psqfkgav.js");
72124
+ const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-3qqnz0jg.js");
72021
72125
  const loaded = loadPluginConfigWithMeta2(directory);
72022
72126
  config = KnowledgeConfigSchema2.parse(loaded.config.knowledge ?? {});
72023
72127
  } catch {
@@ -73473,7 +73577,7 @@ async function handleDoctorCommand(directory, args) {
73473
73577
  const result = runConfigDoctor(config, directory, planParallelizationEnabled);
73474
73578
  let output;
73475
73579
  if (enableAutoFix && result.hasAutoFixableIssues) {
73476
- const { runConfigDoctorWithFixes } = await import("./config-doctor-qv7wc6fa.js");
73580
+ const { runConfigDoctorWithFixes } = await import("./config-doctor-yrven0ya.js");
73477
73581
  const fixResult = await runConfigDoctorWithFixes(directory, config, true, {
73478
73582
  applyLossy: true
73479
73583
  });
@@ -73511,7 +73615,7 @@ async function handleDoctorCommand(directory, args) {
73511
73615
  `;
73512
73616
  }
73513
73617
  try {
73514
- const { runModelPreflight } = await import("./model-preflight-skhq4xtr.js");
73618
+ const { runModelPreflight } = await import("./model-preflight-0k8bd388.js");
73515
73619
  const preflight = await runModelPreflight(config, swarmState.opencodeClient, { generatedAgentNames: swarmState.generatedAgentNames });
73516
73620
  const missingSelection = preflight.resolutions.filter((resolution) => resolution.status === "missing-selection");
73517
73621
  const unresolved = preflight.catalogAvailable ? preflight.resolutions.filter((resolution) => resolution.status === "unresolved") : [];
@@ -73545,7 +73649,7 @@ async function handleDoctorCommand(directory, args) {
73545
73649
  }
73546
73650
  } catch {}
73547
73651
  try {
73548
- const { renderKnowledgeReceiptPhaseIdSection } = await import("./doctor-knowledge-receipt-phase-id-mvbj576e.js");
73652
+ const { renderKnowledgeReceiptPhaseIdSection } = await import("./doctor-knowledge-receipt-phase-id-d8arz38j.js");
73549
73653
  output += await renderKnowledgeReceiptPhaseIdSection(directory, enableAutoFix);
73550
73654
  } catch {}
73551
73655
  const strayDirs = detectStraySwarmDirs(directory);
@@ -75562,7 +75666,7 @@ async function handleEvidenceCommand(directory, args) {
75562
75666
  return formatTaskEvidenceMarkdown(evidenceData);
75563
75667
  }
75564
75668
  async function handleEvidenceSummaryCommand(directory) {
75565
- const { buildEvidenceSummary } = await import("./evidence-summary-service-x9nxvmn5.js");
75669
+ const { buildEvidenceSummary } = await import("./evidence-summary-service-gjs4zssz.js");
75566
75670
  const artifact = await buildEvidenceSummary(directory);
75567
75671
  if (!artifact) {
75568
75672
  return "No plan found. Run `/swarm plan` to check plan status.";
@@ -83282,7 +83386,7 @@ import * as path109 from "path";
83282
83386
  init_zod();
83283
83387
 
83284
83388
  // src/harness/hash.ts
83285
- import { createHash as createHash46 } from "crypto";
83389
+ import { createHash as createHash45 } from "crypto";
83286
83390
  function canonicalize(value, ancestors2) {
83287
83391
  if (value === null || typeof value === "string" || typeof value === "boolean") {
83288
83392
  return value;
@@ -83330,7 +83434,7 @@ function canonicalJson4(value) {
83330
83434
  return serialized;
83331
83435
  }
83332
83436
  function sha2567(value) {
83333
- return createHash46("sha256").update(value).digest("hex");
83437
+ return createHash45("sha256").update(value).digest("hex");
83334
83438
  }
83335
83439
  function canonicalHash2(value) {
83336
83440
  return sha2567(canonicalJson4(value));
@@ -87447,7 +87551,7 @@ async function handleHistoryCommand(directory, _args) {
87447
87551
  }
87448
87552
  // src/knowledge/hive-quarantine.ts
87449
87553
  init_package();
87450
- import { createHash as createHash47, createHmac, randomBytes as randomBytes3, randomUUID as randomUUID20 } from "crypto";
87554
+ import { createHash as createHash46, createHmac, randomBytes as randomBytes3, randomUUID as randomUUID20 } from "crypto";
87451
87555
  import {
87452
87556
  chmod,
87453
87557
  copyFile as copyFile2,
@@ -87480,7 +87584,7 @@ function serializeCanonical(value) {
87480
87584
  return `{${entries2.map(([k, v]) => `${JSON.stringify(k)}:${serializeCanonical(v)}`).join(",")}}`;
87481
87585
  }
87482
87586
  function sha256Hex(content) {
87483
- return createHash47("sha256").update(content, "utf-8").digest("hex");
87587
+ return createHash46("sha256").update(content, "utf-8").digest("hex");
87484
87588
  }
87485
87589
  var QUARANTINE_SECRET_FILE = "hive-quarantine.key";
87486
87590
  async function readQuarantineSecret() {
@@ -90270,13 +90374,13 @@ import { existsSync as existsSync66, readFileSync as readFileSync60, realpathSyn
90270
90374
  import * as path132 from "path";
90271
90375
  import { fileURLToPath as fileURLToPath4 } from "url";
90272
90376
  // src/memory/evaluation.ts
90273
- import { createHash as createHash49 } from "crypto";
90377
+ import { createHash as createHash48 } from "crypto";
90274
90378
  import * as fs65 from "fs/promises";
90275
90379
  import * as os13 from "os";
90276
90380
  import * as path121 from "path";
90277
90381
 
90278
90382
  // src/memory/heldout-evaluation-corpus.ts
90279
- import { createHash as createHash48 } from "crypto";
90383
+ import { createHash as createHash47 } from "crypto";
90280
90384
  import * as fs64 from "fs/promises";
90281
90385
  import * as path120 from "path";
90282
90386
  var MAX_CORPUS_CASES = 256;
@@ -90349,7 +90453,7 @@ function isValidEdge(value) {
90349
90453
  return typeof edge.from === "string" && Boolean(edge.from.trim()) && typeof edge.to === "string" && Boolean(edge.to.trim());
90350
90454
  }
90351
90455
  function computeCanonicalSourceHash(source) {
90352
- return createHash48("sha256").update(source.toString("utf8").replace(/\r\n?|\n/g, `
90456
+ return createHash47("sha256").update(source.toString("utf8").replace(/\r\n?|\n/g, `
90353
90457
  `)).digest("hex");
90354
90458
  }
90355
90459
  async function loadHeldoutRecallEvaluationScenarios(corpusDirectory) {
@@ -90762,8 +90866,8 @@ function normalizeResourceUsage(usage) {
90762
90866
  };
90763
90867
  }
90764
90868
  function createRecallEvaluationManifest(args) {
90765
- const corpusHash = createHash49("sha256").update(stableStringify2(args.fixtures)).digest("hex");
90766
- const configHash = createHash49("sha256").update(stableStringify2({
90869
+ const corpusHash = createHash48("sha256").update(stableStringify2(args.fixtures)).digest("hex");
90870
+ const configHash = createHash48("sha256").update(stableStringify2({
90767
90871
  providers: args.providers,
90768
90872
  profiles: args.profiles ?? ["legacy"],
90769
90873
  resourceCaps: args.resourceCaps,
@@ -90794,19 +90898,19 @@ function createRecallEvaluationManifest(args) {
90794
90898
  source_id: args.heldoutCorpusId ? `heldout:${args.heldoutCorpusId}` : `fixtures:${corpusHash}`,
90795
90899
  model_id: profile === "lexical" ? "none" : args.dependencies?.embeddingProvider?.modelVersion ?? "configured-embedding",
90796
90900
  provider_id: `profiles:${profile};providers:${args.providers.join(",")}`,
90797
- config_hash: createHash49("sha256").update(stableStringify2({ profile, resourceCaps: args.resourceCaps })).digest("hex")
90901
+ config_hash: createHash48("sha256").update(stableStringify2({ profile, resourceCaps: args.resourceCaps })).digest("hex")
90798
90902
  }
90799
90903
  ]))
90800
90904
  };
90801
90905
  }
90802
90906
  function createRunIdentity(args) {
90803
90907
  const profile = args.profile ?? "legacy";
90804
- const sourceId = args.fixture.scenario ? `source:${args.fixture.scenario.id}:${args.fixture.sourceHash}` : `fixture:${args.fixture.name}:${createHash49("sha256").update(args.fixture.query).digest("hex")}`;
90908
+ const sourceId = args.fixture.scenario ? `source:${args.fixture.scenario.id}:${args.fixture.sourceHash}` : `fixture:${args.fixture.name}:${createHash48("sha256").update(args.fixture.query).digest("hex")}`;
90805
90909
  return {
90806
90910
  source_id: sourceId,
90807
90911
  model_id: profile === "lexical" ? "none" : args.dependencies?.embeddingProvider?.modelVersion ?? "configured-embedding",
90808
90912
  provider_id: args.provider,
90809
- config_hash: createHash49("sha256").update(stableStringify2({
90913
+ config_hash: createHash48("sha256").update(stableStringify2({
90810
90914
  profile,
90811
90915
  resourceCaps: args.resourceCaps,
90812
90916
  model: args.dependencies?.embeddingProvider?.modelVersion ?? "configured",
@@ -91118,7 +91222,7 @@ function parseJsonObject(candidate2) {
91118
91222
  init_schema();
91119
91223
  init_logger();
91120
91224
  // src/memory/instruction-pairing.ts
91121
- import { createHash as createHash51 } from "crypto";
91225
+ import { createHash as createHash50 } from "crypto";
91122
91226
  import {
91123
91227
  existsSync as existsSync63,
91124
91228
  mkdirSync as mkdirSync37,
@@ -91131,7 +91235,7 @@ import { tmpdir as tmpdir7 } from "os";
91131
91235
  import path125 from "path";
91132
91236
 
91133
91237
  // src/hooks/knowledge-injector.ts
91134
- import { createHash as createHash50 } from "crypto";
91238
+ import { createHash as createHash49 } from "crypto";
91135
91239
 
91136
91240
  // src/agents/reviewer-directive-compliance.ts
91137
91241
  var DIRECTIVES_TO_VERIFY_TAG = "<directives_to_verify>";
@@ -92138,7 +92242,7 @@ function stableInstructionJson(value) {
92138
92242
  return JSON.stringify(value);
92139
92243
  }
92140
92244
  function sha256Short(value) {
92141
- return createHash50("sha256").update(value).digest("hex").slice(0, 16);
92245
+ return createHash49("sha256").update(value).digest("hex").slice(0, 16);
92142
92246
  }
92143
92247
  async function readInstructionInputs(directory) {
92144
92248
  let briefing = null;
@@ -92663,9 +92767,9 @@ function createKnowledgeInjectorHook(directory, config, modelLimitOverrides = {}
92663
92767
  ctx.targetAgent ?? "",
92664
92768
  ctx.taskId ?? "",
92665
92769
  (ctx.filePaths ?? []).slice(0, 8).join(","),
92666
- ctx.lastUserMessage ? createHash50("sha1").update(ctx.lastUserMessage).digest("hex").slice(0, 16) : ""
92770
+ ctx.lastUserMessage ? createHash49("sha1").update(ctx.lastUserMessage).digest("hex").slice(0, 16) : ""
92667
92771
  ].join("|");
92668
- return createHash50("sha1").update(parts).digest("hex").slice(0, 16);
92772
+ return createHash49("sha1").update(parts).digest("hex").slice(0, 16);
92669
92773
  }
92670
92774
  let lastSeenCacheKey = null;
92671
92775
  let cachedInjectionText = null;
@@ -93197,7 +93301,7 @@ async function materializeTaskStore(projectDir, task2) {
93197
93301
  for (const record of task2.records) {
93198
93302
  const lesson = `__PAIRING_LABEL_${record.label}__ ${record.lesson}`.slice(0, 280);
93199
93303
  const entry = {
93200
- id: createHash51("sha1").update(`${task2.id}:${record.label}`).digest("hex"),
93304
+ id: createHash50("sha1").update(`${task2.id}:${record.label}`).digest("hex"),
93201
93305
  tier: "swarm",
93202
93306
  lesson,
93203
93307
  category: "process",
@@ -93355,8 +93459,8 @@ async function runInstructionSelectionPairing(options) {
93355
93459
  pairs.push(await runTaskPairing(task2, injectCharBudget));
93356
93460
  }
93357
93461
  const cacheInvalidation = await verifyCacheInvalidation();
93358
- const taskSetId = createHash51("sha256").update(stableJson2(tasks)).digest("hex");
93359
- const instructionSetDigest = createHash51("sha256").update(stableJson2({
93462
+ const taskSetId = createHash50("sha256").update(stableJson2(tasks)).digest("hex");
93463
+ const instructionSetDigest = createHash50("sha256").update(stableJson2({
93360
93464
  task_set: taskSetId,
93361
93465
  inject_char_budget: injectCharBudget,
93362
93466
  cache_invalidation_verified: cacheInvalidation.verified
@@ -98560,12 +98664,12 @@ var workspaceCache = new Map;
98560
98664
 
98561
98665
  // src/tools/repo-graph/freshness.ts
98562
98666
  init_package();
98563
- import { createHash as createHash52 } from "crypto";
98667
+ import { createHash as createHash51 } from "crypto";
98564
98668
  import * as fsPromises3 from "fs/promises";
98565
98669
  import * as path130 from "path";
98566
98670
  var REPO_GRAPH_FINGERPRINT_FILENAME = "repo-graph.fingerprint.json";
98567
98671
  var FINGERPRINT_SCHEMA_VERSION = 1;
98568
- var EXTRACTOR_STAMP = createHash52("sha256").update(`${package_default.version}\x00${GRAPH_SCHEMA_VERSION}`).digest("hex");
98672
+ var EXTRACTOR_STAMP = createHash51("sha256").update(`${package_default.version}\x00${GRAPH_SCHEMA_VERSION}`).digest("hex");
98569
98673
  var MAX_FINGERPRINT_BYTES = 24 * 1024 * 1024;
98570
98674
  var MAX_FINGERPRINT_ENTRIES = 100256;
98571
98675
  var MAX_RELATIVE_PATH_LENGTH = 4096;
@@ -98588,7 +98692,7 @@ function normalizedExcludes(options) {
98588
98692
  return [...new Set((options?.excludeDirs ?? []).filter(Boolean))].sort((a, b) => a.localeCompare(b));
98589
98693
  }
98590
98694
  function exclusionStamp(options) {
98591
- return createHash52("sha256").update(JSON.stringify({
98695
+ return createHash51("sha256").update(JSON.stringify({
98592
98696
  excludeDirs: normalizedExcludes(options),
98593
98697
  followSymlinks: options?.followSymlinks ?? false
98594
98698
  })).digest("hex");
@@ -100028,7 +100132,7 @@ function createCuratorLLMDelegate(directory, mode = "init", sessionId) {
100028
100132
  }
100029
100133
  const sdkOpts = signal ? { signal } : {};
100030
100134
  try {
100031
- const { getSwarmAgents: getSwarmAgents2, resolveFallbackModel: resolveFallbackModel2 } = await import("./index-nrqyc8pr.js");
100135
+ const { getSwarmAgents: getSwarmAgents2, resolveFallbackModel: resolveFallbackModel2 } = await import("./index-agvmmvdt.js");
100032
100136
  const createResult = await client.session.create({
100033
100137
  ...sessionId ? {
100034
100138
  body: {
@@ -100319,7 +100423,7 @@ function handlePrFeedbackCommand(directory, args) {
100319
100423
  // src/background/pr-feedback-loop.ts
100320
100424
  init_zod();
100321
100425
  init_loader();
100322
- import { createHash as createHash53, randomUUID as randomUUID23 } from "crypto";
100426
+ import { createHash as createHash52, randomUUID as randomUUID23 } from "crypto";
100323
100427
  import * as fsSync10 from "fs";
100324
100428
  import * as fs68 from "fs/promises";
100325
100429
  import * as path136 from "path";
@@ -102126,7 +102230,7 @@ async function cancelPrFeedbackLoopUnlocked(directory, sessionID, reason) {
102126
102230
  clearedEvents: []
102127
102231
  };
102128
102232
  try {
102129
- const { cancelPrFeedbackPublication: cancelPrFeedbackPublication2 } = await import("./pr-workflow-gate-2gmznmj4.js");
102233
+ const { cancelPrFeedbackPublication: cancelPrFeedbackPublication2 } = await import("./pr-workflow-gate-wg003fkd.js");
102130
102234
  await cancelPrFeedbackPublication2(directory, sessionID, reason);
102131
102235
  } catch (err) {
102132
102236
  warn(`[pr-feedback-loop] cancelPrFeedbackPublication failed (fail-open): ${err instanceof Error ? err.message : String(err)}`);
@@ -105464,7 +105568,7 @@ import * as fs73 from "fs";
105464
105568
  import * as path141 from "path";
105465
105569
 
105466
105570
  // src/test-impact/analyzer.ts
105467
- import { createHash as createHash54 } from "crypto";
105571
+ import { createHash as createHash53 } from "crypto";
105468
105572
  import fs71 from "fs";
105469
105573
  import path139 from "path";
105470
105574
  var MAX_IMPACT_TEST_FILES = 4096;
@@ -105569,7 +105673,7 @@ function sharedTrailingSegments(a, b) {
105569
105673
  return shared;
105570
105674
  }
105571
105675
  function digestContent(content) {
105572
- return createHash54("sha256").update(content).digest("hex");
105676
+ return createHash53("sha256").update(content).digest("hex");
105573
105677
  }
105574
105678
  function scanTestFilesSync(cwd) {
105575
105679
  const result = {
@@ -111439,7 +111543,7 @@ function resolveWorktreeEnumerationBases(directory) {
111439
111543
 
111440
111544
  // src/hooks/gate-denial-tracker.ts
111441
111545
  init_schema();
111442
- import { createHash as createHash55 } from "crypto";
111546
+ import { createHash as createHash54 } from "crypto";
111443
111547
 
111444
111548
  // src/dispatch/spawn-circuit.ts
111445
111549
  var SPAWN_CIRCUIT_TTL_MS = 30 * 60000;
@@ -111511,7 +111615,7 @@ function boundedPathAlias(value) {
111511
111615
  if (normalizedPaths.length <= MAX_ACTION_PATH_PREFIX_ITEMS) {
111512
111616
  return { value: normalizedPaths };
111513
111617
  }
111514
- const tailHasher = createHash55("sha256");
111618
+ const tailHasher = createHash54("sha256");
111515
111619
  tailHasher.update(`tail-count:${normalizedPaths.length - MAX_ACTION_PATH_PREFIX_ITEMS};`);
111516
111620
  for (let index = MAX_ACTION_PATH_PREFIX_ITEMS;index < normalizedPaths.length; index += 1) {
111517
111621
  const pathValue = normalizedPaths[index];
@@ -112132,7 +112236,7 @@ import * as path149 from "path";
112132
112236
  init_schema();
112133
112237
 
112134
112238
  // src/review/finding-validator.ts
112135
- import { createHash as createHash56 } from "crypto";
112239
+ import { createHash as createHash55 } from "crypto";
112136
112240
  init_schema();
112137
112241
  var MAX_VALIDATOR_FALLBACK_MODELS = FALLBACK_MODELS_MAX;
112138
112242
  function canonicalFindingPayload(finding) {
@@ -112158,7 +112262,7 @@ function canonicalizeValidationCandidates(findings) {
112158
112262
  line_start: finding.line_start,
112159
112263
  line_end: finding.line_end
112160
112264
  };
112161
- const findingId = createHash56("sha256").update(canonicalFindingPayload(normalized), "utf8").digest("hex");
112265
+ const findingId = createHash55("sha256").update(canonicalFindingPayload(normalized), "utf8").digest("hex");
112162
112266
  const existing = candidates.get(findingId);
112163
112267
  if (existing) {
112164
112268
  existing.duplicate_count += "duplicate_count" in finding && finding.duplicate_count > 1 ? finding.duplicate_count : 1;
@@ -112824,11 +112928,11 @@ var _internals134 = {
112824
112928
  };
112825
112929
 
112826
112930
  // src/review/evidence.ts
112827
- import { createHash as createHash57 } from "crypto";
112931
+ import { createHash as createHash56 } from "crypto";
112828
112932
  import * as fs81 from "fs";
112829
112933
  import * as path148 from "path";
112830
112934
  function computeAutoReviewManifestHash(manifest) {
112831
- return createHash57("sha256").update(JSON.stringify({
112935
+ return createHash56("sha256").update(JSON.stringify({
112832
112936
  schema_version: manifest.schema_version,
112833
112937
  content_hash: manifest.content_hash,
112834
112938
  plan_requirements_hash: manifest.plan_requirements_hash,
@@ -112919,7 +113023,7 @@ async function computePlanRequirementsHash(directory) {
112919
113023
  return plan ? computeReviewPlanRequirementsHash(plan) : "plan:none";
112920
113024
  }
112921
113025
  function computeAutoReviewPolicyDigest(config) {
112922
- return createHash57("sha256").update(JSON.stringify({
113026
+ return createHash56("sha256").update(JSON.stringify({
112923
113027
  mode: config.final_review.mode,
112924
113028
  min_confidence: config.min_confidence,
112925
113029
  structured_findings: config.structured_findings,
@@ -112965,7 +113069,7 @@ async function loadReviewRequirementsPlan(directory) {
112965
113069
  return replayed.plan;
112966
113070
  }
112967
113071
  function computeReviewPlanRequirementsHash(plan) {
112968
- return createHash57("sha256").update(JSON.stringify({
113072
+ return createHash56("sha256").update(JSON.stringify({
112969
113073
  schema_version: plan.schema_version,
112970
113074
  title: plan.title,
112971
113075
  swarm: plan.swarm,
@@ -115277,7 +115381,7 @@ import { existsSync as existsSync78, mkdirSync as mkdirSync43, readFileSync as r
115277
115381
  import * as path156 from "path";
115278
115382
 
115279
115383
  // src/security/protected-input-integrity.ts
115280
- import { createHash as createHash58 } from "crypto";
115384
+ import { createHash as createHash57 } from "crypto";
115281
115385
  import { lstat as lstat6, readdir as readdir9, readFile as readFile32, realpath as realpath11 } from "fs/promises";
115282
115386
  import * as path154 from "path";
115283
115387
  var LIMITS = {
@@ -115300,11 +115404,11 @@ async function snapshotProtectedTree(root) {
115300
115404
  const afterRead = await lstat6(canonicalRoot);
115301
115405
  if (`${afterRead.dev}:${afterRead.ino}:${afterRead.size}:${afterRead.mtimeMs}` !== `${rootStat.dev}:${rootStat.ino}:${rootStat.size}:${rootStat.mtimeMs}`)
115302
115406
  throw new Error("PROTECTED_INPUT_REPLACED_DURING_READ:root");
115303
- entries2.push(`f\x00.\x00${rootStat.size}\x00${rootStat.mode}\x00${createHash58("sha256").update(content).digest("hex")}`);
115407
+ entries2.push(`f\x00.\x00${rootStat.size}\x00${rootStat.mode}\x00${createHash57("sha256").update(content).digest("hex")}`);
115304
115408
  return Object.freeze({
115305
115409
  v: 1,
115306
115410
  root: canonicalRoot,
115307
- digest: createHash58("sha256").update(entries2[0]).digest("hex"),
115411
+ digest: createHash57("sha256").update(entries2[0]).digest("hex"),
115308
115412
  entries: Object.freeze(entries2)
115309
115413
  });
115310
115414
  }
@@ -115335,7 +115439,7 @@ async function snapshotProtectedTree(root) {
115335
115439
  byteCount += stat14.size;
115336
115440
  if (fileCount > LIMITS.files || byteCount > LIMITS.bytes || Date.now() - started > LIMITS.elapsedMs)
115337
115441
  throw new Error("PROTECTED_INPUT_INTEGRITY_BUDGET_EXCEEDED");
115338
- const contentHash = createHash58("sha256").update(await readFile32(absolute)).digest("hex");
115442
+ const contentHash = createHash57("sha256").update(await readFile32(absolute)).digest("hex");
115339
115443
  const afterRead = await lstat6(absolute);
115340
115444
  if (`${afterRead.dev}:${afterRead.ino}:${afterRead.size}:${afterRead.mtimeMs}` !== identityBefore)
115341
115445
  throw new Error(`PROTECTED_INPUT_REPLACED_DURING_READ:${relative37}`);
@@ -115346,7 +115450,7 @@ async function snapshotProtectedTree(root) {
115346
115450
  return Object.freeze({
115347
115451
  v: 1,
115348
115452
  root: canonicalRoot,
115349
- digest: createHash58("sha256").update(entries2.join(`
115453
+ digest: createHash57("sha256").update(entries2.join(`
115350
115454
  `)).digest("hex"),
115351
115455
  entries: Object.freeze(entries2)
115352
115456
  });
@@ -116710,7 +116814,7 @@ async function countConsensusReportFiles(directory) {
116710
116814
  }
116711
116815
 
116712
116816
  // src/turbo/lean/state.ts
116713
- import { createHash as createHash59 } from "crypto";
116817
+ import { createHash as createHash58 } from "crypto";
116714
116818
  import * as fs86 from "fs";
116715
116819
  import * as path160 from "path";
116716
116820
  init_logger();
@@ -116803,7 +116907,7 @@ function readLegacyPersisted(directory) {
116803
116907
  const raw = fs86.readFileSync(filePath, "utf-8");
116804
116908
  return {
116805
116909
  persisted: parsePersistedJson(raw),
116806
- sourceDigest: createHash59("sha256").update(raw).digest("hex")
116910
+ sourceDigest: createHash58("sha256").update(raw).digest("hex")
116807
116911
  };
116808
116912
  }
116809
116913
  function seedProjectionBestEffort(directory, persisted) {
@@ -118592,7 +118696,7 @@ function buildDetailedHelp(commandName, entry) {
118592
118696
  async function handleHelpCommand(ctx) {
118593
118697
  const targetCommand = ctx.args.join(" ");
118594
118698
  if (!targetCommand) {
118595
- const { buildHelpText } = await import("./index-4cazf4kb.js");
118699
+ const { buildHelpText } = await import("./index-g1r94prs.js");
118596
118700
  return buildHelpText();
118597
118701
  }
118598
118702
  const tokens = targetCommand.split(/\s+/);
@@ -118606,7 +118710,7 @@ async function handleHelpCommand(ctx) {
118606
118710
  > Note: \`/swarm ${resolved.key}\` is a deprecated alias for \`/swarm ${aliasTarget}\`.` : detailed;
118607
118711
  }
118608
118712
  const similar = _internals39.findSimilarCommands(targetCommand);
118609
- const { buildHelpText: fullHelp } = await import("./index-4cazf4kb.js");
118713
+ const { buildHelpText: fullHelp } = await import("./index-g1r94prs.js");
118610
118714
  if (similar.length > 0) {
118611
118715
  return `Command '/swarm ${targetCommand}' not found.
118612
118716
 
@@ -118934,7 +119038,7 @@ var COMMAND_REGISTRY = {
118934
119038
  },
118935
119039
  "guardrail explain": {
118936
119040
  handler: async (ctx) => {
118937
- const { handleGuardrailExplain } = await import("./guardrail-explain-fga9bnvt.js");
119041
+ const { handleGuardrailExplain } = await import("./guardrail-explain-g4wcr664.js");
118938
119042
  return handleGuardrailExplain(ctx.directory, ctx.args);
118939
119043
  },
118940
119044
  description: "Dry-run: show what the guardrails would do to a command or write target (executes nothing)",
@@ -118944,7 +119048,7 @@ var COMMAND_REGISTRY = {
118944
119048
  },
118945
119049
  "guardrail reset": {
118946
119050
  handler: async (ctx) => {
118947
- const { handleGuardrailReset } = await import("./guardrail-reset-xpcsxyt0.js");
119051
+ const { handleGuardrailReset } = await import("./guardrail-reset-9z5rmp3f.js");
118948
119052
  return handleGuardrailReset(ctx.args, ctx.sessionID);
118949
119053
  },
118950
119054
  description: "Reset one exact active invocation/action circuit after repair",
@@ -118965,7 +119069,7 @@ var COMMAND_REGISTRY = {
118965
119069
  },
118966
119070
  "guardrail-log": {
118967
119071
  handler: async (ctx) => {
118968
- const { handleGuardrailLog } = await import("./guardrail-log-y84b9m8n.js");
119072
+ const { handleGuardrailLog } = await import("./guardrail-log-0hy23f7d.js");
118969
119073
  return handleGuardrailLog(ctx.directory, ctx.args);
118970
119074
  },
118971
119075
  description: "Read the guardrail decision log (use --blocks-only for blocks)",