opencode-swarm 7.154.2 → 7.154.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/dist/cli/{coder-settlement-xqs49g07.js → coder-settlement-7c9h07f5.js} +7 -7
  2. package/dist/cli/{config-doctor-69eebk90.js → config-doctor-8zjz6dej.js} +2 -2
  3. package/dist/cli/{core-dyp14hcb.js → core-dn8bn81g.js} +1 -1
  4. package/dist/cli/{curation-policy-jm9jsxtt.js → curation-policy-2jkbybw7.js} +4 -4
  5. package/dist/cli/{curator-drift-h57z6tm3.js → curator-drift-g6w4ga1q.js} +1 -1
  6. package/dist/cli/{curator-llm-factory-5tq9c4v5.js → curator-llm-factory-mxdjw6kz.js} +28 -28
  7. package/dist/cli/{curator-he8n9z9n.js → curator-v12rhct2.js} +28 -28
  8. package/dist/cli/{evidence-summary-service-05s5y8d6.js → evidence-summary-service-zzvvcaa9.js} +10 -10
  9. package/dist/cli/{gate-evidence-3ptr9af3.js → gate-evidence-16jkjre9.js} +5 -5
  10. package/dist/cli/{guardrail-explain-tebk344k.js → guardrail-explain-11fx66cx.js} +29 -29
  11. package/dist/cli/{guardrail-log-x3gz3x17.js → guardrail-log-ahvfn58c.js} +3 -3
  12. package/dist/cli/{guardrail-reset-716pdyf5.js → guardrail-reset-zp5xe0n5.js} +28 -28
  13. package/dist/cli/{hive-promoter-nvwpj2t9.js → hive-promoter-k6y06jj8.js} +28 -28
  14. package/dist/cli/{index-kemxyzc0.js → index-0f4b9ywa.js} +1 -1
  15. package/dist/cli/{index-6rcx6vr6.js → index-2rgm3hgq.js} +4 -4
  16. package/dist/cli/{index-pj2nycpg.js → index-4dt91x6e.js} +1 -1
  17. package/dist/cli/{index-6qwp46k0.js → index-4n557t8w.js} +3 -3
  18. package/dist/cli/{index-xt6jx41g.js → index-6vcrkz80.js} +4 -4
  19. package/dist/cli/{index-vhhdj49x.js → index-7fyv62b2.js} +8 -9
  20. package/dist/cli/{index-2w6vy9a9.js → index-7qky94rr.js} +1 -1
  21. package/dist/cli/{index-6rns7b2m.js → index-94e20w95.js} +2 -2
  22. package/dist/cli/{index-v2ryvr8k.js → index-9nw6z98k.js} +30 -30
  23. package/dist/cli/{index-f6qmar4k.js → index-a6xjn2zt.js} +5 -5
  24. package/dist/cli/{index-j6q3k628.js → index-bhjkxasn.js} +1 -1
  25. package/dist/cli/{index-7tw116n6.js → index-ckp0z9d4.js} +2 -2
  26. package/dist/cli/{index-mnxtkt8s.js → index-d7r6y724.js} +3 -3
  27. package/dist/cli/{index-4cgee5vh.js → index-dtn0pne5.js} +20 -1
  28. package/dist/cli/{index-r0dactw2.js → index-ed13peqr.js} +1 -1
  29. package/dist/cli/{index-fv9ddfta.js → index-env8fk17.js} +1 -1
  30. package/dist/cli/{index-8v69hfpt.js → index-g1bh7980.js} +3 -3
  31. package/dist/cli/{index-ynvw5kxc.js → index-gbkdj7ay.js} +2 -2
  32. package/dist/cli/{index-nh4axsxc.js → index-kck2gtxk.js} +2 -2
  33. package/dist/cli/{index-bxvkn0ye.js → index-m0fy8jra.js} +93 -65
  34. package/dist/cli/{index-n0gqre56.js → index-n7nnz0jp.js} +6 -6
  35. package/dist/cli/{index-dm9tc6qb.js → index-q0prhdds.js} +1 -1
  36. package/dist/cli/{index-399e8aze.js → index-qdnmnq65.js} +1 -1
  37. package/dist/cli/{index-xq2v52tt.js → index-qxj63890.js} +1 -1
  38. package/dist/cli/{index-p7ey2w90.js → index-s23q9v6t.js} +6 -6
  39. package/dist/cli/{index-dsqat5pg.js → index-s5p8ryar.js} +1 -1
  40. package/dist/cli/{index-v9585wjc.js → index-v6xkgxts.js} +2 -2
  41. package/dist/cli/{index-4xqa0sgz.js → index-vntggpez.js} +2 -2
  42. package/dist/cli/{index-07n87ctw.js → index-wkagbmpt.js} +1 -1
  43. package/dist/cli/{index-57t97rtr.js → index-y3kw1zpm.js} +2 -1
  44. package/dist/cli/{index-9avdncr2.js → index-ymgsmjba.js} +5 -5
  45. package/dist/cli/{index-14bz2t7b.js → index-zak50rve.js} +1 -1
  46. package/dist/cli/index.js +28 -28
  47. package/dist/cli/{knowledge-escalator-s0tye368.js → knowledge-escalator-yew2fbxb.js} +10 -10
  48. package/dist/cli/{knowledge-events-eyy9yf6b.js → knowledge-events-zfg423hp.js} +8 -8
  49. package/dist/cli/{knowledge-link-rb11f06y.js → knowledge-link-ydv6shg2.js} +3 -3
  50. package/dist/cli/{knowledge-store-zjq5mz2d.js → knowledge-store-zcv9stzz.js} +4 -4
  51. package/dist/cli/{knowledge-validator-yw5qqqpd.js → knowledge-validator-q68wx2bf.js} +6 -6
  52. package/dist/cli/{pending-delegations-rdzjq3nw.js → pending-delegations-yet1rza6.js} +2 -2
  53. package/dist/cli/{pr-subscriptions-2f5fne6z.js → pr-subscriptions-mp7fyh1r.js} +3 -3
  54. package/dist/cli/{runner-yaqrj388.js → runner-s89ja08q.js} +4 -4
  55. package/dist/cli/{scan-cursor-8f0s883y.js → scan-cursor-38bzfhwf.js} +5 -5
  56. package/dist/cli/{schema-2xw94dh3.js → schema-9hqyt4t6.js} +1 -1
  57. package/dist/cli/{scope-persistence-tap2q94x.js → scope-persistence-dd9s9q2b.js} +5 -5
  58. package/dist/cli/{skill-generator-2xbfryqb.js → skill-generator-b28ezazm.js} +12 -12
  59. package/dist/cli/{worktree-collision-ownership-5gwey8ms.js → worktree-collision-ownership-zw65t2p9.js} +4 -4
  60. package/dist/cli/{worktree-isolation-xsy14t5a.js → worktree-isolation-0ag393t0.js} +28 -28
  61. package/dist/hooks/final-context-accounting.d.ts +60 -0
  62. package/dist/hooks/index.d.ts +1 -0
  63. package/dist/hooks/knowledge-injector.d.ts +1 -1
  64. package/dist/hooks/system-enhancer.d.ts +13 -0
  65. package/dist/hooks/utils.d.ts +11 -0
  66. package/dist/index.js +65 -60
  67. package/dist/services/compaction-service.d.ts +9 -3
  68. package/dist/services/context-budget-service.d.ts +7 -3
  69. package/dist/services/injection-budget.d.ts +103 -26
  70. package/dist/state.d.ts +69 -0
  71. package/dist/summaries/summarizer.d.ts +34 -3
  72. package/package.json +2 -1
@@ -6,7 +6,7 @@ import {
6
6
  resolveExecutableFromPath,
7
7
  runEvaluation,
8
8
  runExternalTool
9
- } from "./index-399e8aze.js";
9
+ } from "./index-qdnmnq65.js";
10
10
  import {
11
11
  finalizeShellAuditForClose,
12
12
  isPolicyProtectedPath,
@@ -14,13 +14,13 @@ import {
14
14
  protectedRoots,
15
15
  redactDecisionLineForArchive,
16
16
  stableCanonicalStringify
17
- } from "./index-xq2v52tt.js";
17
+ } from "./index-qxj63890.js";
18
18
  import {
19
19
  detectStraySwarmDirs,
20
20
  readDoctorArtifact,
21
21
  removeStraySwarmDir,
22
22
  runConfigDoctor
23
- } from "./index-07n87ctw.js";
23
+ } from "./index-wkagbmpt.js";
24
24
  import {
25
25
  MAX_TRANSIENT_RETRIES,
26
26
  archiveEvidence,
@@ -67,7 +67,7 @@ import {
67
67
  validateProjectRoot,
68
68
  validateSymlinkBoundary,
69
69
  validateTargetWithinRoot
70
- } from "./index-vhhdj49x.js";
70
+ } from "./index-7fyv62b2.js";
71
71
  import {
72
72
  EvaluationTaskV1Schema,
73
73
  GateAuditManifestV1Schema,
@@ -84,7 +84,7 @@ import {
84
84
  saveGateAuditResult,
85
85
  savePromotionDecision,
86
86
  saveTaskSetSnapshot
87
- } from "./index-fv9ddfta.js";
87
+ } from "./index-env8fk17.js";
88
88
  import {
89
89
  loadDatabaseCtor
90
90
  } from "./index-134d35c1.js";
@@ -110,12 +110,12 @@ import {
110
110
  } from "./index-y8552snf.js";
111
111
  import {
112
112
  readRecentEscalations
113
- } from "./index-f6qmar4k.js";
113
+ } from "./index-a6xjn2zt.js";
114
114
  import {
115
115
  alreadyCuratedThisGeneration,
116
116
  claimNextScanBatch,
117
117
  resolveCohortId
118
- } from "./index-v9585wjc.js";
118
+ } from "./index-v6xkgxts.js";
119
119
  import {
120
120
  CURATOR_INIT_PROMPT,
121
121
  CURATOR_PHASE_PROMPT,
@@ -139,7 +139,7 @@ import {
139
139
  listActive,
140
140
  subscribe,
141
141
  unsubscribe
142
- } from "./index-6rns7b2m.js";
142
+ } from "./index-94e20w95.js";
143
143
  import {
144
144
  clearWorktreeMergeStatus,
145
145
  getAllWorktreeMergeFailures,
@@ -151,12 +151,12 @@ import {
151
151
  listCoderSettlementWalStates,
152
152
  recoverCoderSettlement,
153
153
  recoverStaleCoderSettlements
154
- } from "./index-9avdncr2.js";
154
+ } from "./index-ymgsmjba.js";
155
155
  import {
156
156
  WORKTREE_LIFECYCLE_LOCK_FILE,
157
157
  recordWorktreeProvisioningOwner,
158
158
  removeWorktreeProvisioningOwner
159
- } from "./index-4xqa0sgz.js";
159
+ } from "./index-vntggpez.js";
160
160
  import {
161
161
  BUNDLED_PROJECT_SKILL_ROOT,
162
162
  DEFAULT_SKILL_MIN_CONFIDENCE,
@@ -177,7 +177,7 @@ import {
177
177
  retireSkill,
178
178
  selectCandidateEntries,
179
179
  syncBundledProjectSkillsIfMissingAsync
180
- } from "./index-6rcx6vr6.js";
180
+ } from "./index-2rgm3hgq.js";
181
181
  import {
182
182
  appendUnactionable,
183
183
  quarantineEntry,
@@ -188,11 +188,11 @@ import {
188
188
  validateActionableFields,
189
189
  validateLesson,
190
190
  validateSkillPath
191
- } from "./index-xt6jx41g.js";
191
+ } from "./index-6vcrkz80.js";
192
192
  import {
193
193
  authorizeCuration,
194
194
  buildConfigFingerprintInput
195
- } from "./index-14bz2t7b.js";
195
+ } from "./index-zak50rve.js";
196
196
  import {
197
197
  cohortConfigFingerprint
198
198
  } from "./index-rtry5xyf.js";
@@ -223,12 +223,12 @@ import {
223
223
  transitionTaskWorkflowEvidence,
224
224
  withTaskEvidenceTransaction,
225
225
  writeWorkflowWalFile
226
- } from "./index-8v69hfpt.js";
226
+ } from "./index-g1bh7980.js";
227
227
  import {
228
228
  makeWorktreeBranchName,
229
229
  provisionWorktree,
230
230
  removeWorktree
231
- } from "./index-2w6vy9a9.js";
231
+ } from "./index-7qky94rr.js";
232
232
  import {
233
233
  DEFAULT_STALE_DELEGATION_TIMEOUT_MS,
234
234
  DELEGATION_COMPACTION_HIGH_WATER_BYTES,
@@ -243,7 +243,7 @@ import {
243
243
  scanBackgroundCoderReservationsForAdmission,
244
244
  scanDelegationsForRecovery,
245
245
  sweepStaleDelegations
246
- } from "./index-nh4axsxc.js";
246
+ } from "./index-kck2gtxk.js";
247
247
  import {
248
248
  compositeSessionKey,
249
249
  sessionKeySuffix
@@ -279,7 +279,7 @@ import {
279
279
  clearAllScopes,
280
280
  clearScopeBindingFromDisk,
281
281
  clearScopeBindings
282
- } from "./index-6qwp46k0.js";
282
+ } from "./index-4n557t8w.js";
283
283
  import {
284
284
  appendLedgerEvent,
285
285
  computePlanHash,
@@ -294,7 +294,7 @@ import {
294
294
  readPlanEpochIdentity,
295
295
  replayFromLedgerWithStatus,
296
296
  takeSnapshotEvent
297
- } from "./index-dsqat5pg.js";
297
+ } from "./index-s5p8ryar.js";
298
298
  import {
299
299
  CORE_EVENT_LOCKED,
300
300
  appendCoreEventSync,
@@ -353,7 +353,7 @@ import {
353
353
  transactFile,
354
354
  transactKnowledge,
355
355
  wordBigrams
356
- } from "./index-n0gqre56.js";
356
+ } from "./index-n7nnz0jp.js";
357
357
  import {
358
358
  MAX_EVENT_LOG_ENTRIES,
359
359
  _internals as _internals2,
@@ -369,18 +369,19 @@ import {
369
369
  recordKnowledgeEvent,
370
370
  recordPhaseCloseIntent,
371
371
  resolveKnowledgeEventsPath
372
- } from "./index-p7ey2w90.js";
372
+ } from "./index-s23q9v6t.js";
373
373
  import {
374
374
  resolveWorktreeIsolationConfig
375
- } from "./index-ynvw5kxc.js";
375
+ } from "./index-gbkdj7ay.js";
376
376
  import {
377
377
  RetrospectiveEvidenceSchema
378
378
  } from "./index-gprxjmm7.js";
379
379
  import {
380
+ estimateTokens,
380
381
  readSwarmFileAsync,
381
382
  safeHook,
382
383
  validateSwarmPath
383
- } from "./index-4cgee5vh.js";
384
+ } from "./index-dtn0pne5.js";
384
385
  import {
385
386
  bunSpawn,
386
387
  bunSpawnSync,
@@ -394,7 +395,7 @@ import {
394
395
  init_loader,
395
396
  loadPluginConfig,
396
397
  loadPluginConfigWithMeta
397
- } from "./index-dm9tc6qb.js";
398
+ } from "./index-q0prhdds.js";
398
399
  import {
399
400
  DEFAULT_PR_REVIEW_RESILIENCE_CONFIG,
400
401
  DEFAULT_SKILL_OPT_CONFIG,
@@ -409,7 +410,7 @@ import {
409
410
  package_default,
410
411
  resolveAutoReviewConfig,
411
412
  stripKnownSwarmPrefix
412
- } from "./index-57t97rtr.js";
413
+ } from "./index-y3kw1zpm.js";
413
414
  import {
414
415
  AGENT_TOOL_MAP,
415
416
  ALL_AGENT_NAMES,
@@ -449,10 +450,10 @@ import {
449
450
  resolveLinkDir,
450
451
  sanitizeLinkId,
451
452
  writeLinkPointer
452
- } from "./index-r0dactw2.js";
453
+ } from "./index-ed13peqr.js";
453
454
  import {
454
455
  atomicWriteFile
455
- } from "./index-j6q3k628.js";
456
+ } from "./index-bhjkxasn.js";
456
457
  import {
457
458
  KNOWLEDGE_SCHEMA_VERSION,
458
459
  OUTCOME_BLOCK_THRESHOLD,
@@ -464,7 +465,7 @@ import {
464
465
  atomicWriteSwarmFileSync,
465
466
  matchTempGrammar,
466
467
  parseTargetBasename
467
- } from "./index-kemxyzc0.js";
468
+ } from "./index-0f4b9ywa.js";
468
469
  import {
469
470
  assertProjectRoot,
470
471
  hasExplicitProjectBoundary,
@@ -19486,7 +19487,7 @@ function planMerges(active, threshold, maxComparisons, maxMerges) {
19486
19487
  };
19487
19488
  }
19488
19489
  async function sweepActiveNearDuplicates(directory, options = {}) {
19489
- const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-mnxtkt8s.js");
19490
+ const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-d7r6y724.js");
19490
19491
  const { config } = loadPluginConfigWithMeta2(directory);
19491
19492
  const sweepConfig = config.learning?.dedup_sweep;
19492
19493
  if (sweepConfig?.enabled === false)
@@ -20616,7 +20617,7 @@ async function runCuratorPhase(directory, phase, agentsDispatched, config, knowl
20616
20617
  }
20617
20618
  if (config.skill_generation_enabled === true && skillCandidates.length > 0) {
20618
20619
  try {
20619
- const skillModule = await import("./skill-generator-2xbfryqb.js");
20620
+ const skillModule = await import("./skill-generator-b28ezazm.js");
20620
20621
  for (const cand of skillCandidates) {
20621
20622
  if (cand.confidence < (config.min_skill_confidence ?? DEFAULT_SKILL_MIN_CONFIDENCE)) {
20622
20623
  continue;
@@ -21088,7 +21089,7 @@ async function applyCuratorKnowledgeUpdates(directory, recommendations, knowledg
21088
21089
  } catch {}
21089
21090
  }
21090
21091
  if (contradictedEntries.length > 0 && knowledgeConfig.contradiction_threshold_action === "quarantine") {
21091
- const { maybeQuarantineOnContradiction } = await import("./knowledge-escalator-s0tye368.js");
21092
+ const { maybeQuarantineOnContradiction } = await import("./knowledge-escalator-yew2fbxb.js");
21092
21093
  for (const { id } of contradictedEntries) {
21093
21094
  try {
21094
21095
  await maybeQuarantineOnContradiction(directory, id, knowledgeConfig.contradiction_quarantine_threshold, knowledgeConfig.contradiction_quarantine_window_days);
@@ -21907,7 +21908,7 @@ async function runCuratorPostMortem(directory, options = {}) {
21907
21908
  warnings.push("Failed to collect knowledge summary.");
21908
21909
  }
21909
21910
  try {
21910
- const { getScanStatus } = await import("./scan-cursor-8f0s883y.js");
21911
+ const { getScanStatus } = await import("./scan-cursor-38bzfhwf.js");
21911
21912
  const scanStatus = await getScanStatus(directory);
21912
21913
  if (scanStatus.remaining_estimate > 0) {
21913
21914
  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.`);
@@ -22079,9 +22080,9 @@ var _internals26 = {
22079
22080
  verifyPostMortemKnowledgeActions,
22080
22081
  repairPostMortemActions,
22081
22082
  loadDefaultKnowledgeConfig: async (directory) => {
22082
- const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-2xw94dh3.js");
22083
+ const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-9hqyt4t6.js");
22083
22084
  try {
22084
- const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-mnxtkt8s.js");
22085
+ const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-d7r6y724.js");
22085
22086
  const loaded = loadPluginConfigWithMeta2(directory);
22086
22087
  return KnowledgeConfigSchema2.parse(loaded.config.knowledge ?? {});
22087
22088
  } catch {
@@ -22089,11 +22090,11 @@ var _internals26 = {
22089
22090
  }
22090
22091
  },
22091
22092
  applyCuratorKnowledgeUpdates: async (directory, recommendations, knowledgeConfig, generation) => {
22092
- const { applyCuratorKnowledgeUpdates: applyCuratorKnowledgeUpdates2 } = await import("./curator-he8n9z9n.js");
22093
+ const { applyCuratorKnowledgeUpdates: applyCuratorKnowledgeUpdates2 } = await import("./curator-v12rhct2.js");
22093
22094
  return applyCuratorKnowledgeUpdates2(directory, recommendations, knowledgeConfig, generation);
22094
22095
  },
22095
22096
  checkHivePromotions: async (entries, knowledgeConfig, directory) => {
22096
- const { checkHivePromotions } = await import("./hive-promoter-nvwpj2t9.js");
22097
+ const { checkHivePromotions } = await import("./hive-promoter-k6y06jj8.js");
22097
22098
  return checkHivePromotions(entries, knowledgeConfig, directory);
22098
22099
  },
22099
22100
  applyProposalTriage: async (directory, triage) => {
@@ -22102,7 +22103,7 @@ var _internals26 = {
22102
22103
  activateProposal,
22103
22104
  listSkills: listSkills2,
22104
22105
  sanitizeSlug
22105
- } = await import("./skill-generator-2xbfryqb.js");
22106
+ } = await import("./skill-generator-b28ezazm.js");
22106
22107
  const result = {
22107
22108
  approved: [],
22108
22109
  rejected: [],
@@ -22144,7 +22145,7 @@ var _internals26 = {
22144
22145
  return result;
22145
22146
  },
22146
22147
  readPriorDriftReports: async (directory) => {
22147
- const { readPriorDriftReports } = await import("./curator-drift-h57z6tm3.js");
22148
+ const { readPriorDriftReports } = await import("./curator-drift-g6w4ga1q.js");
22148
22149
  return readPriorDriftReports(directory);
22149
22150
  },
22150
22151
  readSwarmKnowledge: (directory) => readKnowledge(resolveSwarmKnowledgePath(directory))
@@ -23432,9 +23433,9 @@ function hashContent(content) {
23432
23433
  return createHash12("sha1").update(content).digest("hex");
23433
23434
  }
23434
23435
  async function loadConfigForPolicyCurator(directory) {
23435
- const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-2xw94dh3.js");
23436
+ const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-9hqyt4t6.js");
23436
23437
  try {
23437
- const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-mnxtkt8s.js");
23438
+ const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-d7r6y724.js");
23438
23439
  const { config: loadedConfig } = loadPluginConfigWithMeta2(directory);
23439
23440
  return KnowledgeConfigSchema2.parse(loadedConfig.knowledge ?? {});
23440
23441
  } catch {
@@ -32296,7 +32297,7 @@ function buildSkillImproverApprovalRequest(input) {
32296
32297
  };
32297
32298
  }
32298
32299
  function estimateTokenCount(content) {
32299
- return Math.max(1, Math.ceil(content.length / 4));
32300
+ return Math.max(1, estimateTokens(content));
32300
32301
  }
32301
32302
  function toApprovalPath(directory, targetPath) {
32302
32303
  const relative7 = path42.relative(directory, targetPath).replace(/\\/g, "/");
@@ -35478,7 +35479,7 @@ async function runFinalizeStage(ctx) {
35478
35479
  }
35479
35480
  }
35480
35481
  try {
35481
- const { CuratorConfigSchema: CCS } = await import("./schema-2xw94dh3.js");
35482
+ const { CuratorConfigSchema: CCS } = await import("./schema-9hqyt4t6.js");
35482
35483
  const { config: pmLoadedConfig } = _internals41.loadPluginConfigWithMeta(ctx.directory);
35483
35484
  const curatorCfg = CCS.parse(pmLoadedConfig.curator ?? {});
35484
35485
  if (curatorCfg.enabled && curatorCfg.postmortem_enabled) {
@@ -37691,9 +37692,9 @@ var _internals45 = {
37691
37692
  loadPluginConfigWithMeta,
37692
37693
  loadCuratorDeps: async () => {
37693
37694
  const [{ CuratorConfigSchema }, curator, { createCuratorLLMDelegate: createCuratorLLMDelegate2 }] = await Promise.all([
37694
- import("./schema-2xw94dh3.js"),
37695
- import("./curator-he8n9z9n.js"),
37696
- import("./curator-llm-factory-5tq9c4v5.js")
37695
+ import("./schema-9hqyt4t6.js"),
37696
+ import("./curator-v12rhct2.js"),
37697
+ import("./curator-llm-factory-mxdjw6kz.js")
37697
37698
  ]);
37698
37699
  return { CuratorConfigSchema, curator, createCuratorLLMDelegate: createCuratorLLMDelegate2 };
37699
37700
  }
@@ -38702,7 +38703,7 @@ async function computeCurationDiagnostics(directory, entries) {
38702
38703
  let scanCompleted = false;
38703
38704
  let scanRemaining = 0;
38704
38705
  try {
38705
- const { getScanStatus } = await import("./scan-cursor-8f0s883y.js");
38706
+ const { getScanStatus } = await import("./scan-cursor-38bzfhwf.js");
38706
38707
  const status = await getScanStatus(directory);
38707
38708
  scanGeneration = status.generation;
38708
38709
  scanCompleted = status.completed;
@@ -38710,19 +38711,19 @@ async function computeCurationDiagnostics(directory, entries) {
38710
38711
  } catch {}
38711
38712
  let configMatch = null;
38712
38713
  try {
38713
- const { isLinked: isLinked2 } = await import("./knowledge-link-rb11f06y.js");
38714
+ const { isLinked: isLinked2 } = await import("./knowledge-link-ydv6shg2.js");
38714
38715
  if (isLinked2(directory)) {
38715
- const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-2xw94dh3.js");
38716
+ const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-9hqyt4t6.js");
38716
38717
  let config;
38717
38718
  try {
38718
- const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-mnxtkt8s.js");
38719
+ const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-d7r6y724.js");
38719
38720
  const loaded = loadPluginConfigWithMeta2(directory);
38720
38721
  config = KnowledgeConfigSchema2.parse(loaded.config.knowledge ?? {});
38721
38722
  } catch {
38722
38723
  config = KnowledgeConfigSchema2.parse({});
38723
38724
  }
38724
38725
  const { cohortConfigFingerprint: cohortConfigFingerprint2 } = await import("./config-fingerprint-v22xh5a2.js");
38725
- const { buildConfigFingerprintInput: buildConfigFingerprintInput2, readCohortConfigFingerprint } = await import("./curation-policy-jm9jsxtt.js");
38726
+ const { buildConfigFingerprintInput: buildConfigFingerprintInput2, readCohortConfigFingerprint } = await import("./curation-policy-2jkbybw7.js");
38726
38727
  const currentFp = cohortConfigFingerprint2(buildConfigFingerprintInput2(config));
38727
38728
  const cohortFp = await readCohortConfigFingerprint(directory);
38728
38729
  configMatch = cohortFp === null ? null : currentFp === cohortFp;
@@ -40035,7 +40036,7 @@ async function handleDoctorCommand(directory, args) {
40035
40036
  const result = runConfigDoctor(config, directory);
40036
40037
  let output;
40037
40038
  if (enableAutoFix && result.hasAutoFixableIssues) {
40038
- const { runConfigDoctorWithFixes } = await import("./config-doctor-69eebk90.js");
40039
+ const { runConfigDoctorWithFixes } = await import("./config-doctor-8zjz6dej.js");
40039
40040
  const fixResult = await runConfigDoctorWithFixes(directory, config, true, {
40040
40041
  applyLossy: true
40041
40042
  });
@@ -40975,7 +40976,7 @@ async function handleEvidenceCommand(directory, args) {
40975
40976
  return formatTaskEvidenceMarkdown(evidenceData);
40976
40977
  }
40977
40978
  async function handleEvidenceSummaryCommand(directory) {
40978
- const { buildEvidenceSummary } = await import("./evidence-summary-service-05s5y8d6.js");
40979
+ const { buildEvidenceSummary } = await import("./evidence-summary-service-zzvvcaa9.js");
40979
40980
  const artifact = await buildEvidenceSummary(directory);
40980
40981
  if (!artifact) {
40981
40982
  return "No plan found. Run `/swarm plan` to check plan status.";
@@ -52309,6 +52310,15 @@ function parseJsonObject(candidate) {
52309
52310
 
52310
52311
  // src/memory/injector.ts
52311
52312
  init_schema();
52313
+
52314
+ // src/services/injection-budget.ts
52315
+ var turnLedgers = new Map;
52316
+ function clearAllTurnLedgers() {
52317
+ turnLedgers.clear();
52318
+ }
52319
+
52320
+ // src/memory/injector.ts
52321
+ init_logger();
52312
52322
  // src/memory/reflection-service.ts
52313
52323
  import {
52314
52324
  closeSync as closeSync11,
@@ -73531,7 +73541,7 @@ async function runValidationWithTransientRetry(input, candidateContent, baseline
73531
73541
  if (!input.dispatcher) {
73532
73542
  throw new Error("no evaluation dispatcher available (cannot run validation)");
73533
73543
  }
73534
- const { createModelEvaluationExecutor: createModelEvaluationExecutor2 } = await import("./runner-yaqrj388.js");
73544
+ const { createModelEvaluationExecutor: createModelEvaluationExecutor2 } = await import("./runner-s89ja08q.js");
73535
73545
  const executor = createModelEvaluationExecutor2(input.dispatcher, input.sessionId);
73536
73546
  const result = await withProtectedSetIntegrity([evalInputRoot, ...protectedRoots(input.directory)], () => _internals97.evaluateCandidateV1({
73537
73547
  projectRoot: input.directory,
@@ -74892,9 +74902,13 @@ function formatStatusMarkdown(status) {
74892
74902
  const budgetTokens = status.contextBudgetTokens;
74893
74903
  if (budgetTokens !== undefined && budgetTokens !== null && budgetTokens > 0) {
74894
74904
  const est = Math.round(status.contextBudgetPct / 100 * budgetTokens);
74895
- lines.push("", `**Context**: ${pct}% used (est. ${est.toLocaleString()} / ${budgetTokens.toLocaleString()} tokens)`);
74905
+ lines.push("", `**Swarm injection footprint**: ${pct}% of model window (intermediate measurement; est. ${est.toLocaleString()} / ${budgetTokens.toLocaleString()} tokens)`);
74896
74906
  } else {
74897
- lines.push("", `**Context**: ${pct}% used`);
74907
+ lines.push("", `**Swarm injection footprint**: ${pct}% of model window (intermediate measurement)`);
74908
+ }
74909
+ const finalPressure = getDisplayFinalPromptPressure();
74910
+ if (finalPressure && finalPressure.pct > 0) {
74911
+ lines.push(`**Prompt pressure (final)**: ${finalPressure.pct.toFixed(1)}% estimated (est. ${finalPressure.usedTokens.toLocaleString()} / ${finalPressure.limitTokens.toLocaleString()} tokens; ${finalPressure.estimatorSource}${finalPressure.providerReported ? "; provider-reported" : ""})`);
74898
74912
  }
74899
74913
  if (status.compactionCount > 0) {
74900
74914
  lines.push(`**Compaction events**: ${status.compactionCount} triggered`);
@@ -75572,7 +75586,7 @@ function buildDetailedHelp(commandName, entry) {
75572
75586
  async function handleHelpCommand(ctx) {
75573
75587
  const targetCommand = ctx.args.join(" ");
75574
75588
  if (!targetCommand) {
75575
- const { buildHelpText } = await import("./index-v2ryvr8k.js");
75589
+ const { buildHelpText } = await import("./index-9nw6z98k.js");
75576
75590
  return buildHelpText();
75577
75591
  }
75578
75592
  const tokens = targetCommand.split(/\s+/);
@@ -75581,7 +75595,7 @@ async function handleHelpCommand(ctx) {
75581
75595
  return _internals100.buildDetailedHelp(resolved.key, resolved.entry);
75582
75596
  }
75583
75597
  const similar = _internals100.findSimilarCommands(targetCommand);
75584
- const { buildHelpText: fullHelp } = await import("./index-v2ryvr8k.js");
75598
+ const { buildHelpText: fullHelp } = await import("./index-9nw6z98k.js");
75585
75599
  if (similar.length > 0) {
75586
75600
  return `Command '/swarm ${targetCommand}' not found.
75587
75601
 
@@ -75768,7 +75782,7 @@ var COMMAND_REGISTRY = {
75768
75782
  },
75769
75783
  "guardrail explain": {
75770
75784
  handler: async (ctx) => {
75771
- const { handleGuardrailExplain } = await import("./guardrail-explain-tebk344k.js");
75785
+ const { handleGuardrailExplain } = await import("./guardrail-explain-11fx66cx.js");
75772
75786
  return handleGuardrailExplain(ctx.directory, ctx.args);
75773
75787
  },
75774
75788
  description: "Dry-run: show what the guardrails would do to a command or write target (executes nothing)",
@@ -75778,7 +75792,7 @@ var COMMAND_REGISTRY = {
75778
75792
  },
75779
75793
  "guardrail reset": {
75780
75794
  handler: async (ctx) => {
75781
- const { handleGuardrailReset } = await import("./guardrail-reset-716pdyf5.js");
75795
+ const { handleGuardrailReset } = await import("./guardrail-reset-zp5xe0n5.js");
75782
75796
  return handleGuardrailReset(ctx.args, ctx.sessionID);
75783
75797
  },
75784
75798
  description: "Reset one exact active invocation/action circuit after repair",
@@ -75787,7 +75801,7 @@ var COMMAND_REGISTRY = {
75787
75801
  },
75788
75802
  "guardrail-explain": {
75789
75803
  handler: async (ctx) => {
75790
- const { handleGuardrailExplain } = await import("./guardrail-explain-tebk344k.js");
75804
+ const { handleGuardrailExplain } = await import("./guardrail-explain-11fx66cx.js");
75791
75805
  return handleGuardrailExplain(ctx.directory, ctx.args);
75792
75806
  },
75793
75807
  description: "Dry-run: show what the guardrails would do to a command or write target (executes nothing)",
@@ -75797,7 +75811,7 @@ var COMMAND_REGISTRY = {
75797
75811
  },
75798
75812
  "guardrail-reset": {
75799
75813
  handler: async (ctx) => {
75800
- const { handleGuardrailReset } = await import("./guardrail-reset-716pdyf5.js");
75814
+ const { handleGuardrailReset } = await import("./guardrail-reset-zp5xe0n5.js");
75801
75815
  return handleGuardrailReset(ctx.args, ctx.sessionID);
75802
75816
  },
75803
75817
  description: "Reset one exact active invocation/action circuit after repair",
@@ -75807,7 +75821,7 @@ var COMMAND_REGISTRY = {
75807
75821
  },
75808
75822
  "guardrail-log": {
75809
75823
  handler: async (ctx) => {
75810
- const { handleGuardrailLog } = await import("./guardrail-log-x3gz3x17.js");
75824
+ const { handleGuardrailLog } = await import("./guardrail-log-ahvfn58c.js");
75811
75825
  return handleGuardrailLog(ctx.directory, ctx.args);
75812
75826
  },
75813
75827
  description: "Read the guardrail decision log (use --blocks-only for blocks)",
@@ -80778,6 +80792,8 @@ var swarmState = {
80778
80792
  gateDenialCounts: new Map,
80779
80793
  generatedAgentNames: [],
80780
80794
  lastBudgetBySession: new Map,
80795
+ finalPromptPressureBySession: new Map,
80796
+ finalAccountingWarningBandsBySession: new Map,
80781
80797
  liveContextWindows: new Map,
80782
80798
  agentSessions: defaultRunContext.agentSessions,
80783
80799
  pendingRehydrations: new Set,
@@ -80791,6 +80807,9 @@ function resetSwarmState() {
80791
80807
  swarmState.delegationChains.clear();
80792
80808
  swarmState.pendingEvents = 0;
80793
80809
  swarmState.lastBudgetBySession.clear();
80810
+ swarmState.finalPromptPressureBySession.clear();
80811
+ clearAllTurnLedgers();
80812
+ swarmState.finalAccountingWarningBandsBySession.clear();
80794
80813
  swarmState.liveContextWindows.clear();
80795
80814
  swarmState.agentSessions.clear();
80796
80815
  _lastIdleSweepAtMs = 0;
@@ -81765,10 +81784,19 @@ function getDisplayBudget() {
81765
81784
  }
81766
81785
  return best;
81767
81786
  }
81787
+ function getDisplayFinalPromptPressure() {
81788
+ let best = null;
81789
+ for (const entry of swarmState.finalPromptPressureBySession.values()) {
81790
+ if (entry.pct > 0 && (best === null || entry.pct > best.pct)) {
81791
+ best = entry;
81792
+ }
81793
+ }
81794
+ return best;
81795
+ }
81768
81796
  async function rehydratePrSubscriptions(sessionID, directory) {
81769
81797
  const map = new Map;
81770
81798
  try {
81771
- const { listActive: listActive2 } = await import("./pr-subscriptions-2f5fne6z.js");
81799
+ const { listActive: listActive2 } = await import("./pr-subscriptions-mp7fyh1r.js");
81772
81800
  const records = await listActive2(directory);
81773
81801
  for (const record of records) {
81774
81802
  if (record.sessionID !== sessionID)
@@ -82214,7 +82242,7 @@ function isLaneOwnedByCurrentSession(branchName, expectedSessionId) {
82214
82242
  return extracted === expectedSessionId;
82215
82243
  }
82216
82244
  async function inspectStandardWorktreeCollisionOwnership(identity) {
82217
- const collisionOwnership = await import("./worktree-collision-ownership-5gwey8ms.js");
82245
+ const collisionOwnership = await import("./worktree-collision-ownership-zw65t2p9.js");
82218
82246
  return collisionOwnership.inspectStandardWorktreeCollisionOwnership(identity);
82219
82247
  }
82220
82248
  async function runRecoveryGit(directory, args, timeoutMs = 15000) {
@@ -82623,7 +82651,7 @@ async function precreateStandardWorktreeSession(args) {
82623
82651
  const laneProfile = computeLaneRuntimeProfile(worktreeConfig.runtime_isolation, laneIndex, handle.worktreePath);
82624
82652
  if (laneProfile) {
82625
82653
  try {
82626
- const { writeLaneProfileToDiskReal } = await import("./core-dyp14hcb.js");
82654
+ const { writeLaneProfileToDiskReal } = await import("./core-dn8bn81g.js");
82627
82655
  await writeLaneProfileToDiskReal(handle.worktreePath, laneProfile.laneIndex, laneProfile.envOverrides);
82628
82656
  } catch {}
82629
82657
  }
@@ -83548,7 +83576,7 @@ async function finishStandardWorktreeDispatch(directory, dispatch, config, callI
83548
83576
  }
83549
83577
  clearWorktreeMergeStatus(statusKey);
83550
83578
  try {
83551
- const { removeLaneProfileFromDiskReal } = await import("./core-dyp14hcb.js");
83579
+ const { removeLaneProfileFromDiskReal } = await import("./core-dn8bn81g.js");
83552
83580
  await removeLaneProfileFromDiskReal(dispatch.handle.worktreePath, dispatch.laneIndex);
83553
83581
  } catch {}
83554
83582
  const state = serializationStateBySessionID.get(dispatch.parentSessionID);
@@ -6,10 +6,10 @@ import {
6
6
  } from "./index-ae75rja9.js";
7
7
  import {
8
8
  resolveKnowledgeStoreDir
9
- } from "./index-r0dactw2.js";
9
+ } from "./index-ed13peqr.js";
10
10
  import {
11
11
  atomicWriteFile
12
- } from "./index-j6q3k628.js";
12
+ } from "./index-bhjkxasn.js";
13
13
  import {
14
14
  init_knowledge_types,
15
15
  isActiveStatus
@@ -713,7 +713,7 @@ async function applyConfidenceFloorAction(directory, touched, options) {
713
713
  const {
714
714
  readAuthoritativeKnowledgeCounterRollups,
715
715
  effectiveRetrievalOutcomes
716
- } = await import("./knowledge-events-eyy9yf6b.js");
716
+ } = await import("./knowledge-events-zfg423hp.js");
717
717
  const rollups = await readAuthoritativeKnowledgeCounterRollups(directory);
718
718
  const flagIds = new Set;
719
719
  for (const e of atFloor) {
@@ -780,11 +780,11 @@ async function applyConfidenceFloorAction(directory, touched, options) {
780
780
  });
781
781
  }
782
782
  if (action === "quarantine" && toQuarantine.length > 0) {
783
- const { quarantineEntry } = await import("./knowledge-validator-yw5qqqpd.js");
784
- const { KnowledgeConfigSchema } = await import("./schema-2xw94dh3.js");
783
+ const { quarantineEntry } = await import("./knowledge-validator-q68wx2bf.js");
784
+ const { KnowledgeConfigSchema } = await import("./schema-9hqyt4t6.js");
785
785
  let config;
786
786
  try {
787
- const { loadPluginConfigWithMeta } = await import("./index-mnxtkt8s.js");
787
+ const { loadPluginConfigWithMeta } = await import("./index-d7r6y724.js");
788
788
  const { config: loadedConfig } = loadPluginConfigWithMeta(directory);
789
789
  config = KnowledgeConfigSchema.parse(loadedConfig.knowledge ?? {});
790
790
  } catch {
@@ -6,7 +6,7 @@ import {
6
6
  PluginConfigSchema,
7
7
  init_schema,
8
8
  resolveExternalSkillsConfig
9
- } from "./index-57t97rtr.js";
9
+ } from "./index-y3kw1zpm.js";
10
10
  import {
11
11
  MAX_MERGE_DEPTH,
12
12
  deepMerge,
@@ -9,7 +9,7 @@ import {
9
9
  readEvaluationRun,
10
10
  saveEvaluationRun,
11
11
  saveTaskSetSnapshot
12
- } from "./index-fv9ddfta.js";
12
+ } from "./index-env8fk17.js";
13
13
  import {
14
14
  canonicalHash,
15
15
  computeCandidateInputContentHash,
@@ -11,7 +11,7 @@ import {
11
11
  import {
12
12
  init_schema,
13
13
  stripKnownSwarmPrefix
14
- } from "./index-57t97rtr.js";
14
+ } from "./index-y3kw1zpm.js";
15
15
  import {
16
16
  init_constants
17
17
  } from "./index-myt57pht.js";
@@ -1,23 +1,23 @@
1
1
  // @bun
2
2
  import {
3
3
  validateSwarmPath
4
- } from "./index-4cgee5vh.js";
4
+ } from "./index-dtn0pne5.js";
5
5
  import {
6
6
  loadPluginConfigWithMeta
7
- } from "./index-dm9tc6qb.js";
7
+ } from "./index-q0prhdds.js";
8
8
  import {
9
9
  KnowledgeConfigSchema,
10
10
  init_schema
11
- } from "./index-57t97rtr.js";
11
+ } from "./index-y3kw1zpm.js";
12
12
  import {
13
13
  resolveHiveEventsPath
14
14
  } from "./index-ae75rja9.js";
15
15
  import {
16
16
  resolveKnowledgeStoreDir
17
- } from "./index-r0dactw2.js";
17
+ } from "./index-ed13peqr.js";
18
18
  import {
19
19
  atomicWriteFile
20
- } from "./index-j6q3k628.js";
20
+ } from "./index-bhjkxasn.js";
21
21
  import {
22
22
  assertProjectRoot
23
23
  } from "./index-xagq35tf.js";
@@ -2793,7 +2793,7 @@ async function applyKnowledgeVerdictFeedback(directory, options) {
2793
2793
  }
2794
2794
  let bumps = 0;
2795
2795
  if (deltas.length > 0) {
2796
- const { bumpKnowledgeConfidenceBatch } = await import("./knowledge-store-zjq5mz2d.js");
2796
+ const { bumpKnowledgeConfidenceBatch } = await import("./knowledge-store-zcv9stzz.js");
2797
2797
  bumps = await bumpKnowledgeConfidenceBatch(directory, deltas, options?.floorOptions);
2798
2798
  }
2799
2799
  return {
@@ -4,7 +4,7 @@ import {
4
4
  PlanSchema,
5
5
  TaskStatusSchema,
6
6
  init_loader
7
- } from "./index-dm9tc6qb.js";
7
+ } from "./index-q0prhdds.js";
8
8
  import {
9
9
  assertProjectRoot,
10
10
  withEvidenceLock