opencode-swarm 7.125.2 → 7.125.4

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 (53) hide show
  1. package/dist/cli/{config-doctor-8df6hk58.js → config-doctor-rm1m07gz.js} +2 -2
  2. package/dist/cli/{core-d38hc85b.js → core-v1kp7anb.js} +2 -2
  3. package/dist/cli/{curation-policy-7pvghg6f.js → curation-policy-7pgdjt5w.js} +2 -2
  4. package/dist/cli/{curator-drift-h9a2sjvf.js → curator-drift-24bdacdc.js} +2 -2
  5. package/dist/cli/{curator-llm-factory-bntt6v8j.js → curator-llm-factory-0hncnz9t.js} +16 -16
  6. package/dist/cli/{curator-dw2zb74h.js → curator-n6whbm4r.js} +16 -16
  7. package/dist/cli/{evidence-summary-service-v4h2w487.js → evidence-summary-service-thx1c3me.js} +3 -3
  8. package/dist/cli/{guardrail-explain-vmr4db9n.js → guardrail-explain-8gknrsbb.js} +17 -17
  9. package/dist/cli/{guardrail-log-8prd6cnc.js → guardrail-log-6a2zxvtx.js} +3 -3
  10. package/dist/cli/{hive-promoter-xymt9vf2.js → hive-promoter-mpjq0fw9.js} +16 -16
  11. package/dist/cli/{index-ptmhxsaf.js → index-01n43w2p.js} +4 -4
  12. package/dist/cli/{index-qcrah1jk.js → index-414r47r7.js} +3 -3
  13. package/dist/cli/{index-pgya7cnn.js → index-45mvd5q7.js} +4 -4
  14. package/dist/cli/index-4rhhvd1a.js +62 -0
  15. package/dist/cli/{index-1s7jzcsy.js → index-4ycq2mrp.js} +1 -1
  16. package/dist/cli/{index-8ed9rz7y.js → index-7xg876np.js} +64 -49
  17. package/dist/cli/{index-39p1yyag.js → index-8tjbq2ej.js} +1 -1
  18. package/dist/cli/{index-s9mj4rb9.js → index-9ss2m4rs.js} +1 -1
  19. package/dist/cli/{index-j8ptbcxz.js → index-ambnwnmt.js} +15 -6
  20. package/dist/cli/{index-zbsxek49.js → index-emzes7sj.js} +3 -3
  21. package/dist/cli/{index-tdpct4cz.js → index-fm4zfxnr.js} +1 -1
  22. package/dist/cli/{index-v2rdhwx8.js → index-g4ef4v3m.js} +1 -1
  23. package/dist/cli/{index-yrk6hfp1.js → index-hr2kzcem.js} +18 -18
  24. package/dist/cli/{index-em4h33my.js → index-jkwyjr8x.js} +2 -2
  25. package/dist/cli/{index-fs02c7tz.js → index-kk1scggc.js} +1 -1
  26. package/dist/cli/{index-92xyawa7.js → index-pk099nqv.js} +87 -6
  27. package/dist/cli/{index-7ne6q2a0.js → index-rp5msv7n.js} +1 -1
  28. package/dist/cli/{index-7mtvvt8p.js → index-sa3dgpmc.js} +2 -2
  29. package/dist/cli/{index-v3f7jvm8.js → index-vdfewvn5.js} +5 -5
  30. package/dist/cli/{index-sxdh19nk.js → index-xezv6tdw.js} +1 -1
  31. package/dist/cli/index.js +16 -16
  32. package/dist/cli/{knowledge-escalator-47hfstmk.js → knowledge-escalator-gr8qd7kz.js} +3 -3
  33. package/dist/cli/{knowledge-events-j5dpp72w.js → knowledge-events-q83g3f8z.js} +1 -1
  34. package/dist/cli/{knowledge-store-58gt7m85.js → knowledge-store-qq3w5yt8.js} +1 -1
  35. package/dist/cli/{knowledge-validator-jjxw5mwc.js → knowledge-validator-7jhq8yam.js} +4 -4
  36. package/dist/cli/{scan-cursor-h8we8dfv.js → scan-cursor-fa5sy36q.js} +2 -2
  37. package/dist/cli/{schema-xpqbhcyp.js → schema-bw68my66.js} +3 -1
  38. package/dist/cli/{skill-generator-k8d0vff0.js → skill-generator-ffc1agyw.js} +6 -6
  39. package/dist/config/loader.d.ts +14 -0
  40. package/dist/config/schema.d.ts +6 -0
  41. package/dist/hooks/delegation-gate.d.ts +35 -0
  42. package/dist/hooks/shell-write-detect.d.ts +1 -1
  43. package/dist/index.js +34 -28
  44. package/dist/services/config-doctor.d.ts +14 -2
  45. package/dist/services/warning-buffer.d.ts +24 -5
  46. package/dist/session/snapshot-writer.d.ts +9 -0
  47. package/dist/state.d.ts +15 -0
  48. package/dist/turbo/lean/reviewer.d.ts +2 -1
  49. package/dist/turbo/lean/runner.d.ts +2 -1
  50. package/dist/utils/model-dispatch-fallback.d.ts +71 -0
  51. package/dist/utils/provider-error-classification.d.ts +52 -0
  52. package/package.json +1 -1
  53. package/dist/cli/index-gacm5s2n.js +0 -34
@@ -1,13 +1,14 @@
1
1
  // @bun
2
2
  import {
3
3
  ALL_AGENT_NAMES,
4
+ FALLBACK_MODELS_MAX,
4
5
  GATE_CONFIG_KNOWN_SECTION_KEYS,
5
6
  GateConfigSchema,
6
7
  PluginConfigSchema,
7
8
  init_constants,
8
9
  init_schema,
9
10
  stripKnownSwarmPrefix
10
- } from "./index-qcrah1jk.js";
11
+ } from "./index-414r47r7.js";
11
12
  import {
12
13
  log
13
14
  } from "./index-zgwm4ryv.js";
@@ -205,6 +206,83 @@ function collectRawStrictSectionFindings(directory) {
205
206
  }
206
207
  return findings;
207
208
  }
209
+ function getRawValueAtPath(raw, issuePath) {
210
+ let node = raw;
211
+ for (const seg of issuePath) {
212
+ if (node === null || typeof node !== "object")
213
+ return;
214
+ node = node[seg];
215
+ }
216
+ return node;
217
+ }
218
+ function collectRawValueConstraintFindings(directory) {
219
+ const findings = [];
220
+ const { userConfigPath, projectConfigPath } = getConfigPaths(directory);
221
+ const applyTargetPath = fs.existsSync(projectConfigPath) ? projectConfigPath : userConfigPath;
222
+ const seen = new Set;
223
+ const filesInApplyOrder = applyTargetPath === projectConfigPath ? [projectConfigPath, userConfigPath] : [userConfigPath, projectConfigPath];
224
+ for (const configPath of filesInApplyOrder) {
225
+ if (!fs.existsSync(configPath))
226
+ continue;
227
+ try {
228
+ const stats = fs.statSync(configPath);
229
+ if (stats.size > CONFIG_DOCTOR_MAX_CONFIG_FILE_BYTES)
230
+ continue;
231
+ const raw = JSON.parse(fs.readFileSync(configPath, "utf-8"));
232
+ if (!isPlainObject(raw))
233
+ continue;
234
+ const parsed = PluginConfigSchema.safeParse(raw);
235
+ if (parsed.success)
236
+ continue;
237
+ for (const issue of parsed.error.issues) {
238
+ if (issue.code === "unrecognized_keys")
239
+ continue;
240
+ if (issue.path[0] === "gates")
241
+ continue;
242
+ const dotted = issue.path.map(String).join(".");
243
+ const dedupeKey = `${dotted}|${issue.code}`;
244
+ if (seen.has(dedupeKey))
245
+ continue;
246
+ seen.add(dedupeKey);
247
+ const current = getRawValueAtPath(raw, issue.path);
248
+ if (issue.code === "too_big" && dotted.endsWith("fallback_models") && Array.isArray(current) && current.length > FALLBACK_MODELS_MAX) {
249
+ const trimmed = current.slice(0, FALLBACK_MODELS_MAX);
250
+ const dropped = current.slice(FALLBACK_MODELS_MAX).map(String);
251
+ const inApplyTarget = configPath === applyTargetPath;
252
+ const drop = `${dropped.length} entr${dropped.length === 1 ? "y" : "ies"}`;
253
+ findings.push({
254
+ id: "fallback-models-too-many",
255
+ title: "Too many fallback models",
256
+ description: `"${dotted}" in ${configPath} lists ${current.length} models; the maximum is ${FALLBACK_MODELS_MAX}. ` + `A config that fails validation is discarded in favor of safe defaults. ` + (inApplyTarget ? `Run /swarm config doctor --fix to trim to the first ${FALLBACK_MODELS_MAX} (drops ${drop}: ${dropped.join(", ")}), or edit the file yourself.` : `Remove ${drop} from that file (would drop: ${dropped.join(", ")}).`),
257
+ severity: "error",
258
+ path: dotted,
259
+ currentValue: current,
260
+ autoFixable: inApplyTarget,
261
+ proposedFix: {
262
+ type: "update",
263
+ path: dotted,
264
+ value: trimmed,
265
+ description: `Trim "${dotted}" to the first ${FALLBACK_MODELS_MAX} models`,
266
+ risk: "low",
267
+ lossy: true
268
+ }
269
+ });
270
+ continue;
271
+ }
272
+ findings.push({
273
+ id: "invalid-config-value",
274
+ title: "Invalid config value",
275
+ description: `"${dotted || "(root)"}" in ${configPath} is invalid: ${issue.message}. ` + `A config that fails validation is discarded in favor of safe defaults until this is fixed.`,
276
+ severity: "error",
277
+ path: dotted,
278
+ currentValue: current,
279
+ autoFixable: false
280
+ });
281
+ }
282
+ } catch {}
283
+ }
284
+ return findings;
285
+ }
208
286
  function emitWorktreeIsolationLayeringAdvisory(config, findings) {
209
287
  const parallelization = config.parallelization;
210
288
  const worktreePolicy = config.worktree?.policy ?? "auto";
@@ -1059,6 +1137,7 @@ function runConfigDoctor(config, directory) {
1059
1137
  walkConfigAndValidate(config, "", findings);
1060
1138
  findings.push(...collectRawGatesConfigFindings(directory));
1061
1139
  findings.push(...collectRawStrictSectionFindings(directory));
1140
+ findings.push(...collectRawValueConstraintFindings(directory));
1062
1141
  emitWorktreeIsolationLayeringAdvisory(config, findings);
1063
1142
  const summary = {
1064
1143
  info: findings.filter((f) => f.severity === "info").length,
@@ -1098,7 +1177,8 @@ function isPathSafe(fixPath) {
1098
1177
  }
1099
1178
  return true;
1100
1179
  }
1101
- function applySafeAutoFixes(directory, result) {
1180
+ function applySafeAutoFixes(directory, result, options = {}) {
1181
+ const applyLossy = options.applyLossy === true;
1102
1182
  const appliedFixes = [];
1103
1183
  let updatedConfigPath = null;
1104
1184
  const { userConfigPath, projectConfigPath } = getConfigPaths(directory);
@@ -1119,7 +1199,7 @@ function applySafeAutoFixes(directory, result) {
1119
1199
  } catch {
1120
1200
  return { appliedFixes, updatedConfigPath: null };
1121
1201
  }
1122
- const safeFixes = result.findings.filter((f) => f.autoFixable && f.proposedFix?.risk === "low");
1202
+ const safeFixes = result.findings.filter((f) => f.autoFixable && f.proposedFix?.risk === "low" && (applyLossy || !f.proposedFix?.lossy));
1123
1203
  for (const finding of safeFixes) {
1124
1204
  const fix = finding.proposedFix;
1125
1205
  if (!fix)
@@ -1244,7 +1324,8 @@ function writeDoctorArtifact(directory, result) {
1244
1324
  type: f.proposedFix.type,
1245
1325
  path: f.proposedFix.path,
1246
1326
  description: f.proposedFix.description,
1247
- risk: f.proposedFix.risk
1327
+ risk: f.proposedFix.risk,
1328
+ lossy: f.proposedFix.lossy === true
1248
1329
  } : null
1249
1330
  }))
1250
1331
  };
@@ -1260,7 +1341,7 @@ function shouldRunOnStartup(automationConfig) {
1260
1341
  }
1261
1342
  return automationConfig.capabilities?.config_doctor_on_startup === true;
1262
1343
  }
1263
- async function runConfigDoctorWithFixes(directory, config, autoFix = false) {
1344
+ async function runConfigDoctorWithFixes(directory, config, autoFix = false, options = {}) {
1264
1345
  const result = runConfigDoctor(config, directory);
1265
1346
  const artifactPath = writeDoctorArtifact(directory, result);
1266
1347
  if (!autoFix) {
@@ -1277,7 +1358,7 @@ async function runConfigDoctorWithFixes(directory, config, autoFix = false) {
1277
1358
  if (backup) {
1278
1359
  backupPath = writeBackupArtifact(directory, backup);
1279
1360
  }
1280
- const { appliedFixes, updatedConfigPath } = applySafeAutoFixes(directory, result);
1361
+ const { appliedFixes, updatedConfigPath } = applySafeAutoFixes(directory, result, options);
1281
1362
  if (appliedFixes.length > 0) {
1282
1363
  const freshConfig = readConfigFromFile(directory);
1283
1364
  if (freshConfig) {
@@ -4,7 +4,7 @@ import {
4
4
  } from "./index-rtry5xyf.js";
5
5
  import {
6
6
  readKnowledgeEvents
7
- } from "./index-tdpct4cz.js";
7
+ } from "./index-fm4zfxnr.js";
8
8
  import {
9
9
  isLinked,
10
10
  readLinkPointer,
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  authorizeCuration
4
- } from "./index-7ne6q2a0.js";
4
+ } from "./index-rp5msv7n.js";
5
5
  import {
6
6
  findNearDuplicate,
7
7
  inferTags,
@@ -9,7 +9,7 @@ import {
9
9
  resolveSwarmKnowledgePath,
10
10
  resolveSwarmRejectedPath,
11
11
  transactKnowledge
12
- } from "./index-pgya7cnn.js";
12
+ } from "./index-45mvd5q7.js";
13
13
  import {
14
14
  resolveKnowledgeStoreDir
15
15
  } from "./index-q27bajqb.js";
@@ -6,13 +6,13 @@ import {
6
6
  resolveSwarmKnowledgePath,
7
7
  transactKnowledge,
8
8
  wordBigrams
9
- } from "./index-pgya7cnn.js";
9
+ } from "./index-45mvd5q7.js";
10
10
  import {
11
11
  countEntryContradictionsInWindow,
12
12
  countEntryViolationsInWindow,
13
13
  readKnowledgeEvents,
14
14
  recordKnowledgeEvent
15
- } from "./index-tdpct4cz.js";
15
+ } from "./index-fm4zfxnr.js";
16
16
  import {
17
17
  init_knowledge_types,
18
18
  isActiveStatus
@@ -190,11 +190,11 @@ async function maybeQuarantineOnContradiction(directory, entryId, threshold, win
190
190
  alreadyInactive: true
191
191
  };
192
192
  }
193
- const { quarantineEntry } = await import("./knowledge-validator-jjxw5mwc.js");
193
+ const { quarantineEntry } = await import("./knowledge-validator-7jhq8yam.js");
194
194
  let policyConfig;
195
195
  try {
196
- const { KnowledgeConfigSchema } = await import("./schema-xpqbhcyp.js");
197
- const { loadPluginConfigWithMeta } = await import("./index-zbsxek49.js");
196
+ const { KnowledgeConfigSchema } = await import("./schema-bw68my66.js");
197
+ const { loadPluginConfigWithMeta } = await import("./index-emzes7sj.js");
198
198
  const { config: loadedConfig } = loadPluginConfigWithMeta(directory);
199
199
  policyConfig = KnowledgeConfigSchema.parse(loadedConfig.knowledge ?? {});
200
200
  } catch {
@@ -3,7 +3,7 @@ import {
3
3
  init_constants,
4
4
  init_schema,
5
5
  stripKnownSwarmPrefix
6
- } from "./index-qcrah1jk.js";
6
+ } from "./index-414r47r7.js";
7
7
  import {
8
8
  init_logger,
9
9
  warn
package/dist/cli/index.js CHANGED
@@ -7,42 +7,42 @@ import {
7
7
  getPluginLockFilePaths,
8
8
  package_default,
9
9
  resolveCommand
10
- } from "./index-8ed9rz7y.js";
11
- import"./index-sxdh19nk.js";
12
- import"./index-92xyawa7.js";
13
- import"./index-fs02c7tz.js";
10
+ } from "./index-7xg876np.js";
11
+ import"./index-xezv6tdw.js";
12
+ import"./index-pk099nqv.js";
13
+ import"./index-kk1scggc.js";
14
14
  import"./index-4905hd2m.js";
15
15
  import"./index-134d35c1.js";
16
16
  import"./index-6n2jpz7x.js";
17
- import"./index-ptmhxsaf.js";
18
- import"./index-v3f7jvm8.js";
19
- import"./index-39p1yyag.js";
17
+ import"./index-01n43w2p.js";
18
+ import"./index-vdfewvn5.js";
19
+ import"./index-8tjbq2ej.js";
20
20
  import"./index-vxv732ex.js";
21
21
  import"./index-c8s9a3zh.js";
22
- import"./index-s9mj4rb9.js";
22
+ import"./index-9ss2m4rs.js";
23
23
  import"./index-23zsx7dm.js";
24
- import"./index-7mtvvt8p.js";
25
- import"./index-7ne6q2a0.js";
24
+ import"./index-sa3dgpmc.js";
25
+ import"./index-rp5msv7n.js";
26
26
  import"./index-rtry5xyf.js";
27
- import"./index-pgya7cnn.js";
28
- import"./index-tdpct4cz.js";
27
+ import"./index-45mvd5q7.js";
28
+ import"./index-fm4zfxnr.js";
29
29
  import"./index-ae75rja9.js";
30
30
  import"./index-q27bajqb.js";
31
- import"./index-j8ptbcxz.js";
31
+ import"./index-ambnwnmt.js";
32
32
  import"./index-k5jrywpr.js";
33
33
  import"./index-n832052r.js";
34
34
  import {
35
35
  DEFAULT_AGENT_CONFIGS,
36
36
  init_constants
37
- } from "./index-qcrah1jk.js";
37
+ } from "./index-414r47r7.js";
38
38
  import"./index-bk5tah7q.js";
39
39
  import"./index-8fwhhayc.js";
40
40
  import"./index-q1exe2b3.js";
41
41
  import"./index-gnvg72y1.js";
42
42
  import"./index-2tn5h2zp.js";
43
43
  import"./index-1kz6da87.js";
44
- import"./index-v2rdhwx8.js";
45
- import"./index-gacm5s2n.js";
44
+ import"./index-g4ef4v3m.js";
45
+ import"./index-4rhhvd1a.js";
46
46
  import"./index-0cz1ws47.js";
47
47
  import"./index-2445sx3d.js";
48
48
  import"./index-z6xqpmqg.js";
@@ -8,9 +8,9 @@ import {
8
8
  maybeEscalateOnViolation,
9
9
  maybeQuarantineOnContradiction,
10
10
  readRecentEscalations
11
- } from "./index-v3f7jvm8.js";
12
- import"./index-pgya7cnn.js";
13
- import"./index-tdpct4cz.js";
11
+ } from "./index-vdfewvn5.js";
12
+ import"./index-45mvd5q7.js";
13
+ import"./index-fm4zfxnr.js";
14
14
  import"./index-ae75rja9.js";
15
15
  import"./index-q27bajqb.js";
16
16
  import"./index-bk5tah7q.js";
@@ -26,7 +26,7 @@ import {
26
26
  resolveKnowledgeCounterBaselinePath,
27
27
  resolveKnowledgeEventsPath,
28
28
  resolveLegacyApplicationLogPath
29
- } from "./index-tdpct4cz.js";
29
+ } from "./index-fm4zfxnr.js";
30
30
  import"./index-ae75rja9.js";
31
31
  import"./index-q27bajqb.js";
32
32
  import"./index-zgwm4ryv.js";
@@ -40,7 +40,7 @@ import {
40
40
  transactKnowledge,
41
41
  transactKnowledgeWithCas,
42
42
  wordBigrams
43
- } from "./index-pgya7cnn.js";
43
+ } from "./index-45mvd5q7.js";
44
44
  import {
45
45
  resolveHiveDataDir
46
46
  } from "./index-ae75rja9.js";
@@ -23,11 +23,11 @@ import {
23
23
  validateLesson,
24
24
  validateSkillCandidatePath,
25
25
  validateSkillPath
26
- } from "./index-7mtvvt8p.js";
27
- import"./index-7ne6q2a0.js";
26
+ } from "./index-sa3dgpmc.js";
27
+ import"./index-rp5msv7n.js";
28
28
  import"./index-rtry5xyf.js";
29
- import"./index-pgya7cnn.js";
30
- import"./index-tdpct4cz.js";
29
+ import"./index-45mvd5q7.js";
30
+ import"./index-fm4zfxnr.js";
31
31
  import"./index-ae75rja9.js";
32
32
  import"./index-q27bajqb.js";
33
33
  import"./index-bk5tah7q.js";
@@ -4,8 +4,8 @@ import {
4
4
  alreadyCuratedThisGeneration,
5
5
  claimNextScanBatch,
6
6
  getScanStatus
7
- } from "./index-39p1yyag.js";
8
- import"./index-pgya7cnn.js";
7
+ } from "./index-8tjbq2ej.js";
8
+ import"./index-45mvd5q7.js";
9
9
  import"./index-ae75rja9.js";
10
10
  import"./index-q27bajqb.js";
11
11
  import"./index-bk5tah7q.js";
@@ -34,6 +34,7 @@ import {
34
34
  ExternalSkillCandidateSchema,
35
35
  ExternalSkillCandidateSourceTypeSchema,
36
36
  ExternalSkillsConfigSchema,
37
+ FALLBACK_MODELS_MAX,
37
38
  GATE_CONFIG_KNOWN_SECTION_KEYS,
38
39
  GateConfigSchema,
39
40
  GateFeatureSchema,
@@ -88,7 +89,7 @@ import {
88
89
  resolveGeneratedAgentRole,
89
90
  resolveGuardrailsConfig,
90
91
  stripKnownSwarmPrefix
91
- } from "./index-qcrah1jk.js";
92
+ } from "./index-414r47r7.js";
92
93
  import"./index-bk5tah7q.js";
93
94
  import"./index-zjygnfay.js";
94
95
  import"./index-bpmtbmy9.js";
@@ -149,6 +150,7 @@ export {
149
150
  GateFeatureSchema,
150
151
  GateConfigSchema,
151
152
  GATE_CONFIG_KNOWN_SECTION_KEYS,
153
+ FALLBACK_MODELS_MAX,
152
154
  ExternalSkillsConfigSchema,
153
155
  ExternalSkillCandidateSourceTypeSchema,
154
156
  ExternalSkillCandidateSchema,
@@ -33,16 +33,16 @@ import {
33
33
  sanitizeSlug,
34
34
  selectCandidateEntries,
35
35
  writeEvalStub
36
- } from "./index-ptmhxsaf.js";
37
- import"./index-7mtvvt8p.js";
38
- import"./index-7ne6q2a0.js";
36
+ } from "./index-01n43w2p.js";
37
+ import"./index-sa3dgpmc.js";
38
+ import"./index-rp5msv7n.js";
39
39
  import"./index-rtry5xyf.js";
40
- import"./index-pgya7cnn.js";
41
- import"./index-tdpct4cz.js";
40
+ import"./index-45mvd5q7.js";
41
+ import"./index-fm4zfxnr.js";
42
42
  import"./index-ae75rja9.js";
43
43
  import"./index-q27bajqb.js";
44
44
  import"./index-bk5tah7q.js";
45
- import"./index-gacm5s2n.js";
45
+ import"./index-4rhhvd1a.js";
46
46
  import"./index-zgwm4ryv.js";
47
47
  import"./index-7mkpsw6g.js";
48
48
  import"./index-fsrp8wp3.js";
@@ -1,6 +1,20 @@
1
+ import type { z } from 'zod';
1
2
  import { type PluginConfig } from './schema';
2
3
  export declare const MAX_CONFIG_FILE_BYTES = 102400;
3
4
  export { deepMerge, MAX_MERGE_DEPTH } from '../utils/merge';
5
+ /**
6
+ * Flatten a ZodError into a compact, single-line, human-readable summary that
7
+ * names each failing config path and why it failed, e.g.
8
+ * "agents.architect.fallback_models: Too big: expected array to have <=3 items"
9
+ *
10
+ * Surfaced to operators via `advisoryWarn` → `/swarm diagnose` so a config
11
+ * validation failure tells the user exactly what to fix, instead of the bare
12
+ * `"... validation failed:"` line they used to see (issue #1886). Replaces
13
+ * `error.format()` (a nested object that `advisoryWarn` dropped from the
14
+ * operator-visible buffer). It emits issue paths and messages only — never a
15
+ * raw dump of the user's config values.
16
+ */
17
+ export declare function formatZodIssues(error: z.ZodError): string;
4
18
  export declare function loadPluginConfig(directory: string): PluginConfig;
5
19
  /**
6
20
  * Internal variant of loadPluginConfig that also returns loader metadata.
@@ -83,6 +83,12 @@ export declare const AgentThinkingConfigSchema: z.ZodObject<{
83
83
  budget_tokens: z.ZodOptional<z.ZodNumber>;
84
84
  }, z.core.$strip>;
85
85
  export type AgentThinkingConfig = z.infer<typeof AgentThinkingConfigSchema>;
86
+ /**
87
+ * Maximum number of `fallback_models` an agent override may declare. Shared so
88
+ * the config doctor's opt-in trim (src/services/config-doctor.ts) can never
89
+ * drift from the schema constraint enforced here (issue #1886 follow-up).
90
+ */
91
+ export declare const FALLBACK_MODELS_MAX = 3;
86
92
  export declare const AgentOverrideConfigSchema: z.ZodObject<{
87
93
  model: z.ZodOptional<z.ZodString>;
88
94
  variant: z.ZodOptional<z.ZodString>;
@@ -189,8 +189,42 @@ export declare function extractSpecRequirementBodyById(specText: string, id: str
189
189
  * fold is symmetric (both sides go through this one function), so it can only
190
190
  * REDUCE false-blocks — it never opens a bypass, since covered/uncovered still
191
191
  * differ by whole words, not punctuation.
192
+ *
193
+ * Issue #1896: encoding tolerance. Canonicalizes Unicode via NFC first (so a
194
+ * decomposed accent vs its composed form compare equal — same text, different
195
+ * byte encoding), and folds the section sign `§` (U+00A7) — and the common
196
+ * Latin-1 mojibake `§` a non-UTF-8 web save produces — to the spaced word token
197
+ * " section " so `§4.2`, `§ 4.2`, `§ 4.2`, and `section 4.2` all compare equal.
198
+ * Both additions are symmetric and information-preserving, so they can only
199
+ * reduce false-blocks. A literal `??` (U+003F run, from a save that DESTROYED the
200
+ * `§`) is NOT recoverable here — the coverage-miss diagnostic surfaces it instead.
192
201
  */
193
202
  export declare function normalizeAcceptanceText(s: string): string;
203
+ /**
204
+ * Issue #1896: bounded, diagnostic description of WHY an ACCEPTANCE text failed
205
+ * to cover a requirement body. The coverage check is a SUBSTRING match
206
+ * (`acceptance.includes(body)`), so "first divergence" is defined against the
207
+ * best-aligning window: the longest prefix of the normalized expected body that
208
+ * still appears as a substring of the normalized acceptance. `divergenceOffset`
209
+ * is the length of that matched prefix; the snippets show the expected text at
210
+ * the break and the acceptance text where the match ran out. All scans and
211
+ * snippets are capped so this stays O(1)-bounded on large spec bodies. When the
212
+ * raw (pre-normalization) text carries mojibake markers (a `??` run, U+FFFD, or a
213
+ * Latin-1 `Â`-prefixed byte), a corruption hint is attached — this is the signal
214
+ * that unblocks the destroyed-`§`-as-`??` case the diagnostic exists for.
215
+ */
216
+ export interface CoverageMissDiagnostic {
217
+ expectedSnippet: string;
218
+ foundSnippet: string;
219
+ divergenceOffset: number;
220
+ corruptionHint?: string;
221
+ }
222
+ export declare function describeCoverageMiss(params: {
223
+ rawExpectedBody: string;
224
+ rawAcceptanceText: string;
225
+ normalizedExpected: string;
226
+ normalizedAcceptance: string;
227
+ }): CoverageMissDiagnostic;
194
228
  /**
195
229
  * FR-001/FR-002/FR-005/SC-001/SC-002/SC-006 (issue #1687): mechanical coverage
196
230
  * check that the ACCEPTANCE text CONTAINS the verbatim requirement body for each
@@ -213,6 +247,7 @@ export declare function checkAcceptanceCoversFrRefs(params: {
213
247
  }): {
214
248
  covered: boolean;
215
249
  missingId?: string;
250
+ diagnostic?: CoverageMissDiagnostic;
216
251
  };
217
252
  interface MessageInfo {
218
253
  role: string;
@@ -70,7 +70,7 @@ export declare function detectInteractiveSession(command: string, shell: 'posix'
70
70
  * - Redirection operators: >, >>, >|, <<, <<- (here-docs)
71
71
  * - Write-effect builtins: cp, mv, install, ln, truncate, dd (of=)
72
72
  * - In-place editors: sed -i, perl -i, awk -i
73
- * - Interpreter eval: python -c/-m, node -e, bun -e, ruby -e, perl -e, php -r
73
+ * - Interpreter eval: python -c, node -e, bun -e, ruby -e, perl -e, php -r
74
74
  * - Network downloaders: curl -o, wget -O, scp
75
75
  * - Archive extraction: tar -x, unzip, gunzip
76
76
  * - Git destructive: git checkout --, git restore, git reset --hard, git clean -fd