opencode-swarm 7.164.5 → 7.164.7

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 (101) hide show
  1. package/.opencode/skills/swarm-pr-review/SKILL.md +12 -12
  2. package/README.md +1 -1
  3. package/dist/background/pending-delegations.d.ts +12 -2
  4. package/dist/background/pr-review-contract.d.ts +9 -0
  5. package/dist/background/pr-subscriptions.d.ts +1 -8
  6. package/dist/cli/{coder-settlement-x9wbqx46.js → coder-settlement-p8wwmtnn.js} +14 -14
  7. package/dist/cli/{config-doctor-axd9d6hs.js → config-doctor-wxf488mw.js} +5 -3
  8. package/dist/cli/{core-f1a1fk13.js → core-671ybpbt.js} +2 -2
  9. package/dist/cli/{curation-policy-2cy7wejw.js → curation-policy-de7emfqc.js} +7 -6
  10. package/dist/cli/{curator-drift-3s3q4wsy.js → curator-drift-nvxv8xkk.js} +7 -5
  11. package/dist/cli/{curator-b104f7a7.js → curator-eaz5rj6k.js} +39 -37
  12. package/dist/cli/curator-llm-factory-swzyfnh6.js +68 -0
  13. package/dist/cli/{dispatch-q4v8x2pk.js → dispatch-dqybvj8v.js} +10 -6
  14. package/dist/cli/{evidence-summary-service-5xsjs3x3.js → evidence-summary-service-deqsc8hj.js} +19 -16
  15. package/dist/cli/{gate-evidence-ypja4156.js → gate-evidence-mafg71qb.js} +14 -8
  16. package/dist/cli/guardrail-explain-ygq7cx9w.js +69 -0
  17. package/dist/cli/{guardrail-log-6t4e2j5f.js → guardrail-log-k3w9dq6x.js} +9 -8
  18. package/dist/cli/{guardrail-reset-es0bg976.js → guardrail-reset-ae2step4.js} +39 -37
  19. package/dist/cli/hive-promoter-a4cs5sbr.js +83 -0
  20. package/dist/cli/{index-hnjkpk57.js → index-0zjwnbze.js} +1 -1
  21. package/dist/cli/{index-er8ba9be.js → index-1ekzd5wf.js} +56 -15
  22. package/dist/cli/{index-fxxja498.js → index-2czt53wz.js} +1 -1
  23. package/dist/cli/{index-wbnyc50b.js → index-388sxv1b.js} +17 -8
  24. package/dist/cli/{index-1q2dwv69.js → index-3kgg2n6z.js} +12 -6
  25. package/dist/cli/{index-50s9q4c1.js → index-3sv8t7ca.js} +2 -2
  26. package/dist/cli/{index-4jmtdtm9.js → index-46yrz972.js} +3 -3
  27. package/dist/cli/{index-s09b63xg.js → index-4vx89ymn.js} +5 -5
  28. package/dist/cli/{index-aaqbhn9h.js → index-581bcqp9.js} +2 -2
  29. package/dist/cli/{index-0trtcm9n.js → index-63enf73z.js} +20 -15
  30. package/dist/cli/index-7qefgq4j.js +71 -0
  31. package/dist/cli/{index-yrsag0vs.js → index-8ck1jkhd.js} +3 -2
  32. package/dist/cli/{index-y42pra05.js → index-8ntf8jnj.js} +19 -18
  33. package/dist/cli/{index-m1nrd3yd.js → index-8psybzzf.js} +1 -1
  34. package/dist/cli/{index-rz87mx1c.js → index-8tqqmsav.js} +1 -1
  35. package/dist/cli/{index-25z5qwkk.js → index-93znbdam.js} +9 -5
  36. package/dist/cli/{index-maxz22c1.js → index-9qkytpwa.js} +185 -376
  37. package/dist/cli/{index-164m995b.js → index-9ydhzegh.js} +28 -17
  38. package/dist/cli/{index-3gb7bw7h.js → index-bvjwmmdc.js} +1332 -1217
  39. package/dist/cli/{index-ywtcznk2.js → index-c4j9sjcs.js} +4 -4
  40. package/dist/cli/index-cw912re7.js +200 -0
  41. package/dist/cli/{index-8h9nng7f.js → index-fq1wfsmw.js} +100 -97
  42. package/dist/cli/{index-7rat6nyh.js → index-gm65h7bh.js} +9 -6
  43. package/dist/cli/{index-rc6hec4j.js → index-h3k3rgyr.js} +4 -4
  44. package/dist/cli/{index-ea7sehgy.js → index-jkwfajh1.js} +4 -4
  45. package/dist/cli/{index-1dz8hv7p.js → index-kvq1e82k.js} +3 -3
  46. package/dist/cli/{index-4emx8hhh.js → index-mr3h3sm5.js} +2 -2
  47. package/dist/cli/{index-q0gtgwyr.js → index-rey1tzcw.js} +7 -7
  48. package/dist/cli/index-ry16d01s.js +107 -0
  49. package/dist/cli/{index-aper29nf.js → index-ry4mwbc2.js} +1 -1
  50. package/dist/cli/{index-xj4kbtdw.js → index-sxxh4ams.js} +2 -2
  51. package/dist/cli/{index-tfa2p4y4.js → index-t1qzjhnj.js} +13 -13
  52. package/dist/cli/{index-xm7dc14y.js → index-v1fj9exz.js} +12 -5
  53. package/dist/cli/{index-3f7hqtgg.js → index-w3gtqey0.js} +4 -1
  54. package/dist/cli/{index-4krjn1gn.js → index-wgqeqy68.js} +2 -2
  55. package/dist/cli/{index-3rrc5x4v.js → index-x2t2tbm2.js} +2 -2
  56. package/dist/cli/{index-0zbze3n6.js → index-x3qzt684.js} +71 -47
  57. package/dist/cli/{index-j9a4fsxg.js → index-xc3q62ev.js} +2 -2
  58. package/dist/cli/{index-553veay1.js → index-xy59dnvq.js} +1 -1
  59. package/dist/cli/{index-fwebva1m.js → index-y75xd50f.js} +36 -27
  60. package/dist/cli/{index-25jze7sf.js → index-yzn1fm9a.js} +1 -1
  61. package/dist/cli/{index-1f4nandk.js → index-zg34ngdf.js} +21 -11
  62. package/dist/cli/{index-ssb67ff6.js → index-zg8tvjb0.js} +41 -39
  63. package/dist/cli/index.js +39 -37
  64. package/dist/cli/{knowledge-escalator-evjd8g7y.js → knowledge-escalator-t532h2ym.js} +15 -14
  65. package/dist/cli/{knowledge-events-q46z1wy6.js → knowledge-events-hdtc0cxe.js} +13 -12
  66. package/dist/cli/{knowledge-link-ffmzf72f.js → knowledge-link-hhnmc4g1.js} +6 -5
  67. package/dist/cli/{knowledge-store-z82f5x9k.js → knowledge-store-45jadhmb.js} +7 -6
  68. package/dist/cli/{knowledge-validator-19gbnxx2.js → knowledge-validator-5e6qbq6h.js} +9 -8
  69. package/dist/cli/{model-preflight-pmnbfzjv.js → model-preflight-bq035tfh.js} +1 -1
  70. package/dist/cli/{pending-delegations-t4cqk5ha.js → pending-delegations-z0crvst3.js} +7 -7
  71. package/dist/cli/{pr-subscriptions-3enjtq0k.js → pr-subscriptions-73fs8y3n.js} +7 -6
  72. package/dist/cli/{pr-workflow-gate-3ecgfsge.js → pr-workflow-gate-rpdts7wy.js} +41 -37
  73. package/dist/cli/{runner-wqy2hbxn.js → runner-5qqh83e2.js} +6 -6
  74. package/dist/cli/{scan-cursor-8wcy0dvf.js → scan-cursor-t75qznf3.js} +8 -7
  75. package/dist/cli/{schema-hsw9r2tm.js → schema-8dfjsrk6.js} +2 -2
  76. package/dist/cli/{scope-persistence-mbwt4grd.js → scope-persistence-zfmz4sws.js} +12 -10
  77. package/dist/cli/{skill-generator-kg32a5jy.js → skill-generator-psdb10jw.js} +17 -16
  78. package/dist/cli/{telemetry-j14cj552.js → telemetry-85gxedng.js} +1 -1
  79. package/dist/cli/{workspace-snapshot-yq0tc49d.js → workspace-snapshot-eh18vgkn.js} +2 -1
  80. package/dist/cli/{worktree-collision-ownership-0rfw6kp3.js → worktree-collision-ownership-xrqssqzd.js} +12 -15
  81. package/dist/cli/{worktree-isolation-qcwt09ve.js → worktree-isolation-s9m3bgah.js} +39 -37
  82. package/dist/db/canonical-project.d.ts +10 -3
  83. package/dist/db/project-db.d.ts +4 -0
  84. package/dist/evidence/task-gate-repair.d.ts +1 -1
  85. package/dist/gate-evidence.d.ts +19 -1
  86. package/dist/hooks/delegation-gate.d.ts +3 -1
  87. package/dist/hooks/pr-workflow-gate.d.ts +10 -2
  88. package/dist/index.js +593 -590
  89. package/dist/plan/ledger.d.ts +2 -0
  90. package/dist/pr-review/authorization.d.ts +13 -3
  91. package/dist/tools/authorize-pr-review-reentry.d.ts +5 -4
  92. package/dist/tools/dispatch-lanes.d.ts +1 -0
  93. package/dist/tools/pr-workflow-status.d.ts +2 -0
  94. package/dist/tools/pre-check-batch.d.ts +1 -1
  95. package/dist/utils/canonical-root.d.ts +21 -1
  96. package/dist/utils/filesystem-identity.d.ts +59 -0
  97. package/package.json +2 -1
  98. package/dist/cli/curator-llm-factory-cv7ft0mb.js +0 -66
  99. package/dist/cli/guardrail-explain-cvha7b9p.js +0 -67
  100. package/dist/cli/hive-promoter-yzv5g7jy.js +0 -81
  101. package/dist/cli/index-ddszzne4.js +0 -42
@@ -1,12 +1,15 @@
1
1
  // @bun
2
+ import {
3
+ canonicalRootKeyFresh
4
+ } from "./index-7qefgq4j.js";
2
5
  import {
3
6
  atomicWriteSwarmFile
4
- } from "./index-tfa2p4y4.js";
7
+ } from "./index-t1qzjhnj.js";
5
8
  import {
6
9
  pseudonymousRef,
7
10
  resolveLineageSalt,
8
11
  telemetry
9
- } from "./index-1dz8hv7p.js";
12
+ } from "./index-kvq1e82k.js";
10
13
 
11
14
  // src/health/learning-health.ts
12
15
  import { promises as fs } from "fs";
@@ -178,15 +181,16 @@ var lastPersistAtByDirectory = new Map;
178
181
  var recentPersistDirectories = [];
179
182
  var MAX_TRACKED_DIRECTORIES = 16;
180
183
  function rememberPersistDirectory(directory) {
181
- if (recentPersistDirectories.includes(directory)) {
182
- const idx = recentPersistDirectories.indexOf(directory);
184
+ const key = canonicalRootKeyFresh(directory);
185
+ const idx = recentPersistDirectories.findIndex((entry) => entry.key === key);
186
+ if (idx >= 0) {
183
187
  recentPersistDirectories.splice(idx, 1);
184
188
  }
185
- recentPersistDirectories.push(directory);
189
+ recentPersistDirectories.push({ key, directory });
186
190
  while (recentPersistDirectories.length > MAX_TRACKED_DIRECTORIES) {
187
191
  const evicted = recentPersistDirectories.shift();
188
192
  if (evicted !== undefined)
189
- lastPersistAtByDirectory.delete(evicted);
193
+ lastPersistAtByDirectory.delete(evicted.key);
190
194
  }
191
195
  }
192
196
  var _internals = {
@@ -205,11 +209,12 @@ var _internals = {
205
209
  };
206
210
  var projectRefCache = new Map;
207
211
  function projectRef(directory) {
208
- const cached = projectRefCache.get(directory);
212
+ const key = canonicalRootKeyFresh(directory);
213
+ const cached = projectRefCache.get(key);
209
214
  if (cached !== undefined)
210
215
  return cached;
211
- const ref = pseudonymousRef(directory, resolveLineageSalt());
212
- if (!projectRefCache.has(directory)) {
216
+ const ref = pseudonymousRef(key, resolveLineageSalt());
217
+ if (!projectRefCache.has(key)) {
213
218
  while (projectRefCache.size >= MAX_TRACKED_DIRECTORIES) {
214
219
  const oldest = projectRefCache.keys().next().value;
215
220
  if (oldest === undefined)
@@ -217,9 +222,12 @@ function projectRef(directory) {
217
222
  projectRefCache.delete(oldest);
218
223
  }
219
224
  }
220
- projectRefCache.set(directory, ref);
225
+ projectRefCache.set(key, ref);
221
226
  return ref;
222
227
  }
228
+ function legacyProjectRef(directory) {
229
+ return pseudonymousRef(directory, resolveLineageSalt());
230
+ }
223
231
  function getScopeMap(alarm) {
224
232
  let map = alarmScopes.get(alarm);
225
233
  if (!map) {
@@ -361,13 +369,14 @@ function applyAlarmState(alarm, scopeClass, scopeKey, desired, severity, detail,
361
369
  }
362
370
  }
363
371
  function schedulePersist(directory, now, force) {
364
- const target = directory ?? recentPersistDirectories.at(-1);
372
+ const target = directory ?? recentPersistDirectories.at(-1)?.directory;
365
373
  if (!target)
366
374
  return;
367
- const last = lastPersistAtByDirectory.get(target) ?? 0;
375
+ const targetKey = canonicalRootKeyFresh(target);
376
+ const last = lastPersistAtByDirectory.get(targetKey) ?? 0;
368
377
  if (!force && now - last < PERSIST_DEBOUNCE_MS)
369
378
  return;
370
- lastPersistAtByDirectory.set(target, now);
379
+ lastPersistAtByDirectory.set(targetKey, now);
371
380
  persistLearningHealth(target).catch(() => {
372
381
  return;
373
382
  });
@@ -462,13 +471,14 @@ function isAdoptableScopeKey(key) {
462
471
  if (typeof key !== "string" || key.length === 0 || key.length > 200) {
463
472
  return false;
464
473
  }
465
- return /^[0-9a-zA-Z:_.-/]+$/.test(key);
474
+ return /^[-0-9a-zA-Z:_.\u002f]+$/.test(key);
466
475
  }
467
476
  function isFiniteCounter(value) {
468
477
  return typeof value === "number" && Number.isFinite(value) && value >= 0;
469
478
  }
470
479
  function livenessMap(directory) {
471
- let map = livenessGaps.get(directory);
480
+ const key = canonicalRootKeyFresh(directory);
481
+ let map = livenessGaps.get(key);
472
482
  if (!map) {
473
483
  if (livenessGaps.size >= MAX_TRACKED_DIRECTORIES) {
474
484
  let victim;
@@ -483,7 +493,7 @@ function livenessMap(directory) {
483
493
  livenessGaps.delete(victim);
484
494
  }
485
495
  map = new Map;
486
- livenessGaps.set(directory, map);
496
+ livenessGaps.set(key, map);
487
497
  }
488
498
  return map;
489
499
  }
@@ -742,12 +752,13 @@ async function readLearningHealth(directory) {
742
752
  const now = _internals.now();
743
753
  evaluateLiveness(directory, now);
744
754
  const scopeOwner = projectRef(directory);
755
+ const legacyScopeOwner = legacyProjectRef(directory);
745
756
  const active = [];
746
757
  for (const [alarm, scopes] of alarmScopes) {
747
758
  for (const [key, scope] of scopes) {
748
759
  if (scope.status !== "active")
749
760
  continue;
750
- const owned = key.startsWith(`${scopeOwner}/`) || key.startsWith("u/") || key.startsWith("store/");
761
+ const owned = key.startsWith(`${scopeOwner}/`) || key.startsWith(`${legacyScopeOwner}/`) || key.startsWith("u/") || key.startsWith("store/");
751
762
  if (!owned)
752
763
  continue;
753
764
  active.push({