opencode-swarm 7.132.1 → 7.133.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 (102) hide show
  1. package/.opencode/skills/swarm-pr-review/SKILL.md +15 -5
  2. package/README.md +4 -1
  3. package/dist/agents/agent-output-schema.d.ts +74 -0
  4. package/dist/agents/critic.d.ts +2 -1
  5. package/dist/agents/reviewer.d.ts +1 -1
  6. package/dist/background/completion-observer.d.ts +2 -0
  7. package/dist/background/pending-delegations.d.ts +39 -1
  8. package/dist/background/stage-b-gates.d.ts +2 -0
  9. package/dist/cli/{config-doctor-bp5spb79.js → config-doctor-8nbdwnn6.js} +2 -2
  10. package/dist/cli/{core-wg3re04e.js → core-egwpry19.js} +2 -2
  11. package/dist/cli/{curation-policy-7zp2m9gv.js → curation-policy-gae3xm5d.js} +2 -2
  12. package/dist/cli/{curator-28hcw9hx.js → curator-e88bm4mg.js} +17 -18
  13. package/dist/cli/{curator-llm-factory-rd0s95fw.js → curator-llm-factory-1a7esr69.js} +17 -18
  14. package/dist/cli/{evidence-summary-service-jfagmvrh.js → evidence-summary-service-nhsmsap8.js} +3 -3
  15. package/dist/cli/{guardrail-explain-742dhpec.js → guardrail-explain-zgja2b9m.js} +18 -19
  16. package/dist/cli/{guardrail-log-aa112fxv.js → guardrail-log-fjgyx76r.js} +3 -3
  17. package/dist/cli/{hive-promoter-8whgvcry.js → hive-promoter-2b04e0wh.js} +17 -18
  18. package/dist/cli/{index-9cf1yr67.js → index-0vd91yb8.js} +3 -3
  19. package/dist/cli/{index-w9cb5zwh.js → index-17zjp67y.js} +1 -1
  20. package/dist/cli/{index-djwemsjn.js → index-66zght9d.js} +1 -1
  21. package/dist/cli/{index-6ccynjv3.js → index-7ftthvqt.js} +2 -2
  22. package/dist/cli/{index-jgfcp9bh.js → index-bz08438z.js} +1 -1
  23. package/dist/cli/{index-mwkwyej1.js → index-cpest8sa.js} +5 -5
  24. package/dist/cli/{index-y5qp59rc.js → index-hfpw5m0e.js} +9 -3
  25. package/dist/cli/{index-3s9rfnqq.js → index-j5pnah1w.js} +4 -4
  26. package/dist/cli/{index-jj4earrh.js → index-kc1m6vpr.js} +2 -2
  27. package/dist/cli/{index-x3p6ktva.js → index-mhcge2ry.js} +34 -23
  28. package/dist/cli/{index-yvv1wt2h.js → index-mmvaf4t6.js} +1 -1
  29. package/dist/cli/{index-b21a4zw4.js → index-mwqfyjja.js} +37751 -33949
  30. package/dist/cli/{index-fgcmxjp7.js → index-sp7tm8t7.js} +1 -1
  31. package/dist/cli/{index-4hapy63e.js → index-sw82jvf2.js} +2 -2
  32. package/dist/cli/{index-630badhp.js → index-tj2mkfb3.js} +149 -6
  33. package/dist/cli/{index-rt5jgktq.js → index-wz36r0fk.js} +1 -1
  34. package/dist/cli/{index-bvp2v7k1.js → index-wzb4dv5s.js} +263 -16
  35. package/dist/cli/index.js +21 -20
  36. package/dist/cli/{knowledge-escalator-j0nceas7.js → knowledge-escalator-hzkw1ban.js} +3 -3
  37. package/dist/cli/{knowledge-events-gpqc62jr.js → knowledge-events-pbycdhqd.js} +1 -1
  38. package/dist/cli/{knowledge-store-ggxr3ww5.js → knowledge-store-45jawb2p.js} +1 -1
  39. package/dist/cli/{knowledge-validator-007smap6.js → knowledge-validator-ge576f8n.js} +4 -4
  40. package/dist/cli/pending-delegations-kxy8mdqg.js +75 -0
  41. package/dist/cli/{scan-cursor-wz4bff7a.js → scan-cursor-kvw872be.js} +2 -2
  42. package/dist/cli/{schema-023gwne7.js → schema-a2zm2m3r.js} +6 -2
  43. package/dist/cli/{scope-persistence-dm5bab50.js → scope-persistence-5qypzxxm.js} +1 -1
  44. package/dist/cli/{skill-generator-rtsg1m7x.js → skill-generator-ch79hvxh.js} +5 -5
  45. package/dist/commands/command-dispatch.d.ts +7 -0
  46. package/dist/commands/index.d.ts +7 -0
  47. package/dist/commands/registry.d.ts +16 -0
  48. package/dist/commands/review.d.ts +21 -0
  49. package/dist/config/agent-names.d.ts +3 -3
  50. package/dist/config/evidence-schema.d.ts +47 -47
  51. package/dist/config/index.d.ts +2 -2
  52. package/dist/config/schema.d.ts +58 -6
  53. package/dist/consensus/contracts.d.ts +3 -3
  54. package/dist/evaluation/contracts.d.ts +1 -1
  55. package/dist/evaluation/ephemeral-agent-dispatcher.d.ts +64 -0
  56. package/dist/evaluation/model-dispatcher.d.ts +11 -5
  57. package/dist/evaluation/public-api.d.ts +1 -1
  58. package/dist/hooks/auto-review.d.ts +30 -65
  59. package/dist/hooks/delegation-gate.d.ts +1 -1
  60. package/dist/hooks/guardrails/index.d.ts +32 -0
  61. package/dist/hooks/guardrails/messages-transform.d.ts +7 -0
  62. package/dist/hooks/guardrails/tool-before.d.ts +8 -0
  63. package/dist/hooks/guardrails.d.ts +1 -1
  64. package/dist/hooks/pr-workflow-response-gate.d.ts +44 -26
  65. package/dist/hooks/review-receipt-collector.d.ts +53 -10
  66. package/dist/hooks/review-receipt-scope.d.ts +74 -0
  67. package/dist/hooks/review-receipt.d.ts +104 -10
  68. package/dist/hooks/reviewer-scope-file-fingerprint.d.ts +21 -0
  69. package/dist/hooks/reviewer-scope-lifecycle.d.ts +19 -0
  70. package/dist/hooks/task-result-classifier.d.ts +6 -0
  71. package/dist/index.d.ts +2 -0
  72. package/dist/index.js +665 -612
  73. package/dist/memory/schema.d.ts +5 -5
  74. package/dist/review/contracts.d.ts +29 -0
  75. package/dist/review/diff-source.d.ts +134 -0
  76. package/dist/review/engine.d.ts +60 -0
  77. package/dist/review/evidence.d.ts +88 -0
  78. package/dist/review/finding-validator.d.ts +77 -0
  79. package/dist/review/phase-runner.d.ts +37 -0
  80. package/dist/review/runtime.d.ts +32 -0
  81. package/dist/scope/scope-binding.d.ts +9 -0
  82. package/dist/services/config-doctor.d.ts +12 -0
  83. package/dist/state.d.ts +179 -0
  84. package/dist/tools/dispatch-lanes.d.ts +2 -0
  85. package/dist/tools/lean-turbo-review.d.ts +4 -1
  86. package/dist/tools/lean-turbo-run-phase.d.ts +3 -1
  87. package/dist/tools/phase-complete/gates/final-review-gate.d.ts +18 -0
  88. package/dist/tools/phase-complete/gates/index.d.ts +1 -0
  89. package/dist/tools/phase-complete/gates/types.d.ts +10 -0
  90. package/dist/tools/phase-complete.d.ts +13 -1
  91. package/dist/tools/plugin-registration.d.ts +3 -1
  92. package/dist/tools/swarm-command.d.ts +4 -1
  93. package/dist/tools/tool-metadata.d.ts +22 -22
  94. package/dist/turbo/lean/integration.d.ts +18 -2
  95. package/dist/turbo/lean/reviewer.d.ts +19 -3
  96. package/dist/turbo/lean/runner.d.ts +1 -1
  97. package/package.json +1 -1
  98. package/dist/cli/index-y2pfmd0z.js +0 -259
  99. package/dist/cli/pending-delegations-37t4xecr.js +0 -34
  100. package/dist/cli/{curator-drift-y1wm4atk.js → curator-drift-ea0p8nh1.js} +2 -2
  101. package/dist/cli/{index-4ff0x4cg.js → index-74tptrss.js} +0 -0
  102. package/dist/cli/{index-03zyn94g.js → index-r260ybay.js} +4 -4
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  redactPath,
4
4
  redactShellCommand
5
- } from "./index-yvv1wt2h.js";
5
+ } from "./index-mmvaf4t6.js";
6
6
 
7
7
  // src/services/guardrail-log-service.ts
8
8
  import * as fs from "fs/promises";
@@ -12,14 +12,14 @@ import {
12
12
  detectPosixWrites,
13
13
  detectWindowsWrites,
14
14
  resolveWriteTargets
15
- } from "./index-b21a4zw4.js";
15
+ } from "./index-mwqfyjja.js";
16
16
  import {
17
17
  checkFileAuthority,
18
18
  classifyFile,
19
19
  isInDeclaredScope,
20
20
  redactPath,
21
21
  redactShellCommand
22
- } from "./index-yvv1wt2h.js";
22
+ } from "./index-mmvaf4t6.js";
23
23
 
24
24
  // src/services/guardrail-explain-service.ts
25
25
  import path from "path";
@@ -8,7 +8,7 @@ import {
8
8
  init_constants,
9
9
  init_schema,
10
10
  stripKnownSwarmPrefix
11
- } from "./index-bvp2v7k1.js";
11
+ } from "./index-wzb4dv5s.js";
12
12
  import {
13
13
  log
14
14
  } from "./index-zgwm4ryv.js";
@@ -28,7 +28,9 @@ var DEPRECATED_FIELDS = new Map([
28
28
  {
29
29
  message: "deprecated",
30
30
  replacement: "agents.skill_improver.model",
31
- isDefaultValue: (v) => v === null
31
+ isDefaultValue: (v) => v === null,
32
+ deprecatedIn: 2,
33
+ sinceVersion: 1
32
34
  }
33
35
  ],
34
36
  [
@@ -36,7 +38,9 @@ var DEPRECATED_FIELDS = new Map([
36
38
  {
37
39
  message: "deprecated",
38
40
  replacement: "agents.skill_improver.fallback_models",
39
- isDefaultValue: (v) => Array.isArray(v) && v.length === 0
41
+ isDefaultValue: (v) => Array.isArray(v) && v.length === 0,
42
+ deprecatedIn: 2,
43
+ sinceVersion: 1
40
44
  }
41
45
  ],
42
46
  [
@@ -44,7 +48,9 @@ var DEPRECATED_FIELDS = new Map([
44
48
  {
45
49
  message: "deprecated",
46
50
  replacement: "agents.spec_writer.model",
47
- isDefaultValue: (v) => v === null
51
+ isDefaultValue: (v) => v === null,
52
+ deprecatedIn: 2,
53
+ sinceVersion: 1
48
54
  }
49
55
  ],
50
56
  [
@@ -52,7 +58,9 @@ var DEPRECATED_FIELDS = new Map([
52
58
  {
53
59
  message: "deprecated",
54
60
  replacement: "agents.spec_writer.fallback_models",
55
- isDefaultValue: (v) => Array.isArray(v) && v.length === 0
61
+ isDefaultValue: (v) => Array.isArray(v) && v.length === 0,
62
+ deprecatedIn: 2,
63
+ sinceVersion: 1
56
64
  }
57
65
  ]
58
66
  ]);
@@ -283,6 +291,36 @@ function collectRawValueConstraintFindings(directory) {
283
291
  }
284
292
  return findings;
285
293
  }
294
+ function collectRawAutoReviewCompatibilityFindings(directory) {
295
+ const findings = [];
296
+ const { userConfigPath, projectConfigPath } = getConfigPaths(directory);
297
+ for (const configPath of [userConfigPath, projectConfigPath]) {
298
+ if (!fs.existsSync(configPath))
299
+ continue;
300
+ try {
301
+ const stats = fs.statSync(configPath);
302
+ if (stats.size > CONFIG_DOCTOR_MAX_CONFIG_FILE_BYTES)
303
+ continue;
304
+ const raw = JSON.parse(fs.readFileSync(configPath, "utf8"));
305
+ if (!isPlainObject(raw) || !isPlainObject(raw.auto_review))
306
+ continue;
307
+ const autoReview = raw.auto_review;
308
+ if (autoReview.structured_findings === false && isPlainObject(autoReview.final_review) && autoReview.final_review.mode === "gate") {
309
+ findings.push({
310
+ id: "invalid-auto-review-gate-compatibility",
311
+ title: "Invalid auto-review gate configuration",
312
+ description: 'auto_review.final_review.mode="gate" requires auto_review.structured_findings=true so gate evidence is machine-verifiable.',
313
+ severity: "error",
314
+ path: "auto_review.structured_findings",
315
+ currentValue: false,
316
+ autoFixable: false
317
+ });
318
+ break;
319
+ }
320
+ } catch {}
321
+ }
322
+ return findings;
323
+ }
286
324
  function emitWorktreeIsolationLayeringAdvisory(config, findings) {
287
325
  const parallelization = config.parallelization;
288
326
  const worktreePolicy = config.worktree?.policy ?? "auto";
@@ -497,6 +535,20 @@ function validateConfigKey(path2, value) {
497
535
  }
498
536
  break;
499
537
  }
538
+ case "config_format_version": {
539
+ if (typeof value !== "number" || !Number.isFinite(value) || !Number.isInteger(value) || value < 0) {
540
+ findings.push({
541
+ id: "type-mismatch",
542
+ title: `Config field "${path2}" has wrong type`,
543
+ description: `Expected non-negative integer, got ${typeof value === "number" ? Number.isInteger(value) ? value : `${value} (non-integer)` : typeof value}`,
544
+ severity: "error",
545
+ path: path2,
546
+ currentValue: value,
547
+ autoFixable: false
548
+ });
549
+ }
550
+ break;
551
+ }
500
552
  case "guardrails.enabled": {
501
553
  if (value === false) {
502
554
  findings.push({
@@ -1146,6 +1198,7 @@ function runConfigDoctor(config, directory) {
1146
1198
  findings.push(...collectRawGatesConfigFindings(directory));
1147
1199
  findings.push(...collectRawStrictSectionFindings(directory));
1148
1200
  findings.push(...collectRawValueConstraintFindings(directory));
1201
+ findings.push(...collectRawAutoReviewCompatibilityFindings(directory));
1149
1202
  emitWorktreeIsolationLayeringAdvisory(config, findings);
1150
1203
  const summary = {
1151
1204
  info: findings.filter((f) => f.severity === "info").length,
@@ -1160,12 +1213,27 @@ function runConfigDoctor(config, directory) {
1160
1213
  } else if (fs.existsSync(userConfigPath)) {
1161
1214
  configSource = userConfigPath;
1162
1215
  }
1216
+ const rawConfigVersion = config.config_format_version;
1217
+ const configVersion = typeof rawConfigVersion === "number" && Number.isFinite(rawConfigVersion) && Number.isInteger(rawConfigVersion) && rawConfigVersion >= 0 ? rawConfigVersion : 1;
1218
+ const availableMigrations = [];
1219
+ for (const [depPath, depInfo] of DEPRECATED_FIELDS) {
1220
+ if (configVersion < depInfo.deprecatedIn) {
1221
+ availableMigrations.push({
1222
+ field: depPath,
1223
+ replacement: depInfo.replacement,
1224
+ deprecatedIn: depInfo.deprecatedIn,
1225
+ sinceVersion: depInfo.sinceVersion,
1226
+ currentFormatVersion: configVersion
1227
+ });
1228
+ }
1229
+ }
1163
1230
  return {
1164
1231
  findings,
1165
1232
  summary,
1166
1233
  hasAutoFixableIssues,
1167
1234
  timestamp: Date.now(),
1168
- configSource
1235
+ configSource,
1236
+ ...availableMigrations.length > 0 ? { availableMigrations } : {}
1169
1237
  };
1170
1238
  }
1171
1239
  var DANGEROUS_PATH_SEGMENTS = new Set([
@@ -1265,6 +1333,81 @@ function applySafeAutoFixes(directory, result, options = {}) {
1265
1333
  break;
1266
1334
  }
1267
1335
  }
1336
+ if (applyLossy && result.availableMigrations && result.availableMigrations.length > 0) {
1337
+ for (const migration of result.availableMigrations) {
1338
+ if (!isPathSafe(migration.field) || !isPathSafe(migration.replacement)) {
1339
+ continue;
1340
+ }
1341
+ const legacyParts = migration.field.split(".");
1342
+ let legacyParent = config;
1343
+ let legacyNavigated = true;
1344
+ for (let i = 0;i < legacyParts.length - 1; i++) {
1345
+ const part = legacyParts[i];
1346
+ if (legacyParent === null || legacyParent === undefined || typeof legacyParent !== "object" || Array.isArray(legacyParent)) {
1347
+ legacyNavigated = false;
1348
+ break;
1349
+ }
1350
+ const obj = legacyParent;
1351
+ if (obj[part] === undefined || obj[part] === null) {
1352
+ legacyNavigated = false;
1353
+ break;
1354
+ }
1355
+ legacyParent = obj[part];
1356
+ }
1357
+ if (!legacyNavigated) {
1358
+ continue;
1359
+ }
1360
+ const legacyKey = legacyParts[legacyParts.length - 1];
1361
+ const legacyHolder = legacyParent;
1362
+ if (!(legacyKey in legacyHolder)) {
1363
+ continue;
1364
+ }
1365
+ const legacyValue = legacyHolder[legacyKey];
1366
+ const depInfo = DEPRECATED_FIELDS.get(migration.field);
1367
+ if (!depInfo || depInfo.isDefaultValue(legacyValue)) {
1368
+ continue;
1369
+ }
1370
+ const replParts = migration.replacement.split(".");
1371
+ let replParent = config;
1372
+ let replNavigated = true;
1373
+ for (let i = 0;i < replParts.length - 1; i++) {
1374
+ const part = replParts[i];
1375
+ if (replParent === null || replParent === undefined || typeof replParent !== "object" || Array.isArray(replParent)) {
1376
+ replNavigated = false;
1377
+ break;
1378
+ }
1379
+ const obj = replParent;
1380
+ if (obj[part] === undefined) {
1381
+ obj[part] = {};
1382
+ } else if (obj[part] === null || typeof obj[part] !== "object") {
1383
+ replNavigated = false;
1384
+ break;
1385
+ }
1386
+ replParent = obj[part];
1387
+ }
1388
+ if (!replNavigated) {
1389
+ continue;
1390
+ }
1391
+ const replKey = replParts[replParts.length - 1];
1392
+ replParent[replKey] = legacyValue;
1393
+ delete legacyHolder[legacyKey];
1394
+ appliedFixes.push({
1395
+ type: "update",
1396
+ path: migration.replacement,
1397
+ value: legacyValue,
1398
+ description: `Migrate deprecated field \`${migration.field}\` \u2192 \`${migration.replacement}\``,
1399
+ risk: "low",
1400
+ lossy: true
1401
+ });
1402
+ appliedFixes.push({
1403
+ type: "remove",
1404
+ path: migration.field,
1405
+ description: `Remove deprecated field \`${migration.field}\` (migrated to \`${migration.replacement}\`)`,
1406
+ risk: "low",
1407
+ lossy: true
1408
+ });
1409
+ }
1410
+ }
1268
1411
  if (appliedFixes.length > 0) {
1269
1412
  const configDir = path.dirname(configPath);
1270
1413
  if (!fs.existsSync(configDir)) {
@@ -4,7 +4,7 @@ import {
4
4
  } from "./index-rtry5xyf.js";
5
5
  import {
6
6
  readKnowledgeEvents
7
- } from "./index-jgfcp9bh.js";
7
+ } from "./index-bz08438z.js";
8
8
  import {
9
9
  isLinked,
10
10
  readLinkPointer,