opencode-swarm 7.87.2 → 7.88.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 (28) hide show
  1. package/.opencode/skills/swarm-pr-review/SKILL.md +304 -9
  2. package/README.md +1 -0
  3. package/dist/background/candidate-parser.d.ts +189 -0
  4. package/dist/background/candidate-sidecar-store.d.ts +56 -0
  5. package/dist/cli/{config-doctor-6h64pn8n.js → config-doctor-jzbgpbdh.js} +2 -2
  6. package/dist/cli/{guardrail-explain-9fngqx80.js → guardrail-explain-sw5bjxtk.js} +6 -6
  7. package/dist/cli/{guardrail-log-eegabqcp.js → guardrail-log-c7egm5km.js} +3 -3
  8. package/dist/cli/{index-q9h0wb04.js → index-0asbrmdx.js} +4 -0
  9. package/dist/cli/{index-s8bj492g.js → index-32axfg6h.js} +23 -7
  10. package/dist/cli/{index-1cb4wxnm.js → index-819xp49y.js} +1 -1
  11. package/dist/cli/{index-gjdq4na6.js → index-dkytd370.js} +7 -7
  12. package/dist/cli/{index-f41fa3f0.js → index-fwb5f2gr.js} +2 -2
  13. package/dist/cli/{index-5hvbw5xh.js → index-g00qm2gf.js} +1 -1
  14. package/dist/cli/{index-6qkwgdsg.js → index-jch711dq.js} +246 -169
  15. package/dist/cli/{index-5vpe6vq9.js → index-vjsr9bqt.js} +1 -1
  16. package/dist/cli/index.js +5 -5
  17. package/dist/cli/{schema-84146tvk.js → schema-vb6jkxgg.js} +1 -1
  18. package/dist/cli/{skill-generator-3pvpk4y2.js → skill-generator-kz4q8e49.js} +3 -1
  19. package/dist/hooks/knowledge-reader.d.ts +2 -0
  20. package/dist/hooks/knowledge-types.d.ts +3 -0
  21. package/dist/index.js +1640 -797
  22. package/dist/services/skill-generator.d.ts +10 -0
  23. package/dist/services/skill-improver.d.ts +25 -1
  24. package/dist/tools/index.d.ts +1 -0
  25. package/dist/tools/manifest.d.ts +1 -0
  26. package/dist/tools/parse-lane-candidates.d.ts +2 -0
  27. package/dist/tools/tool-metadata.d.ts +4 -0
  28. package/package.json +1 -1
@@ -1,9 +1,9 @@
1
1
  // @bun
2
2
  import {
3
3
  handleGuardrailLog
4
- } from "./index-5vpe6vq9.js";
5
- import"./index-5hvbw5xh.js";
6
- import"./index-q9h0wb04.js";
4
+ } from "./index-vjsr9bqt.js";
5
+ import"./index-g00qm2gf.js";
6
+ import"./index-0asbrmdx.js";
7
7
  import"./index-5e4e2hvv.js";
8
8
  import"./index-p0arc26j.js";
9
9
  import"./index-zgwm4ryv.js";
@@ -187,6 +187,10 @@ var TOOL_METADATA = {
187
187
  "test_engineer"
188
188
  ]
189
189
  },
190
+ parse_lane_candidates: {
191
+ description: "Parse [CANDIDATE] rows from a dispatch_lanes or collect_lane_results artifact (by output_ref), produce structured records with provenance, optionally persist to a per-batch sidecar JSONL. Pure-parser variant exists as internal module.",
192
+ agents: ["architect"]
193
+ },
190
194
  test_runner: {
191
195
  description: "auto-detect and run tests",
192
196
  agents: ["architect", "reviewer", "test_engineer"]
@@ -152,7 +152,13 @@ async function readCounterBaseline(directory) {
152
152
  const filePath = resolveKnowledgeCounterBaselinePath(directory);
153
153
  if (!existsSync(filePath))
154
154
  return new Map;
155
- const raw = JSON.parse(await readFile(filePath, "utf-8"));
155
+ let raw;
156
+ try {
157
+ raw = JSON.parse(await readFile(filePath, "utf-8"));
158
+ } catch (err) {
159
+ warn(`[knowledge-events] corrupted counter baseline at ${filePath}; ignoring folded baseline and replaying live events only: ${err instanceof Error ? err.message : String(err)}`);
160
+ return new Map;
161
+ }
156
162
  const map = new Map;
157
163
  for (const [id, rollup] of Object.entries(raw)) {
158
164
  map.set(id, normalizeRollupTimestamps(cloneRollup(rollup)));
@@ -309,9 +315,12 @@ function effectiveRetrievalOutcomes(stored, rollup) {
309
315
  };
310
316
  if (!rollup)
311
317
  return base;
318
+ const { n_a_count: _na, ...rollupWithoutNa } = rollup;
312
319
  return {
313
320
  ...base,
314
- ...rollup
321
+ ...rollupWithoutNa,
322
+ succeeded_after_shown_count: (base.succeeded_after_shown_count ?? 0) + (rollup.succeeded_after_shown_count ?? 0),
323
+ failed_after_shown_count: (base.failed_after_shown_count ?? 0) + (rollup.failed_after_shown_count ?? 0)
315
324
  };
316
325
  }
317
326
 
@@ -1359,6 +1368,7 @@ function activeRepoRelativePath(slug) {
1359
1368
  var DEFAULT_SKILL_MIN_CONFIDENCE = 0.7;
1360
1369
  var DEFAULT_SKILL_MIN_CONFIRMATIONS = 2;
1361
1370
  var STRONG_SKILL_OUTCOME_COUNT = 3;
1371
+ var HIGH_PRIORITY_SKILL_MIN_CONFIDENCE = 0.6;
1362
1372
  async function selectCandidateEntries(directory, opts) {
1363
1373
  const swarm = await readKnowledge(resolveSwarmKnowledgePath(directory));
1364
1374
  const hivePath = resolveHiveKnowledgePath();
@@ -1391,10 +1401,12 @@ function isSkillMaturityEligible(entry, opts, outcomes = entry.retrieval_outcome
1391
1401
  const strongOutcomes = hasStrongSkillOutcomeRecord(outcomes);
1392
1402
  if (outcomeSignal > 0 && strongOutcomes)
1393
1403
  return true;
1394
- if (entry.confidence < opts.minConfidence && !strongOutcomes)
1395
- return false;
1396
1404
  const distinctPhases = new Set((entry.confirmed_by ?? []).map((c) => c.phase_number).filter((p) => typeof p === "number")).size;
1397
- return distinctPhases >= opts.minConfirmations || strongOutcomes;
1405
+ const highPriorityPath = isHighPriorityDirective(entry) && distinctPhases >= 1 && entry.confidence >= HIGH_PRIORITY_SKILL_MIN_CONFIDENCE;
1406
+ if (entry.confidence < opts.minConfidence && !strongOutcomes && !highPriorityPath) {
1407
+ return false;
1408
+ }
1409
+ return distinctPhases >= opts.minConfirmations || strongOutcomes || highPriorityPath;
1398
1410
  }
1399
1411
  var MIN_CLUSTER_SIZE = 2;
1400
1412
  var JACCARD_THRESHOLD = 0.5;
@@ -1591,7 +1603,11 @@ async function generateSkills(req) {
1591
1603
  const swarm = await readKnowledge(resolveSwarmKnowledgePath(req.directory));
1592
1604
  const hivePath = resolveHiveKnowledgePath();
1593
1605
  const hive = existsSync3(hivePath) ? await readKnowledge(hivePath) : [];
1594
- pool = [...swarm, ...hive].filter((e) => idSet.has(e.id) && e.status !== "archived");
1606
+ const rollups = await readKnowledgeCounterRollups(req.directory);
1607
+ pool = [...swarm, ...hive].filter((e) => idSet.has(e.id) && e.status !== "archived").map((e) => ({
1608
+ ...e,
1609
+ retrieval_outcomes: effectiveRetrievalOutcomes(e.retrieval_outcomes, rollups.get(e.id))
1610
+ }));
1595
1611
  } else {
1596
1612
  pool = candidates;
1597
1613
  }
@@ -2311,4 +2327,4 @@ var _internals = {
2311
2327
  unlinkSync
2312
2328
  };
2313
2329
 
2314
- export { resolveKnowledgeEventsPath, readKnowledgeEvents, readKnowledgeCounterRollups, effectiveRetrievalOutcomes, validateLesson, validateActionableFields, validateActionability, resolveUnactionablePath, appendUnactionable, quarantineEntry, restoreEntry, sanitizeSlug, isValidSlug2 as isValidSlug, proposalPath, activePath, activeRepoRelativePath, DEFAULT_SKILL_MIN_CONFIDENCE, DEFAULT_SKILL_MIN_CONFIRMATIONS, STRONG_SKILL_OUTCOME_COUNT, selectCandidateEntries, isSkillMaturityEligible, clusterEntries, renderSkillMarkdown, generateSkills, parseDraftFrontmatter, activateProposal, listSkills, autoApplyProposals, inspectSkill, retireSkill, regenerateSkill, _internals };
2330
+ export { resolveKnowledgeEventsPath, readKnowledgeEvents, readKnowledgeCounterRollups, effectiveRetrievalOutcomes, validateLesson, validateActionableFields, validateActionability, resolveUnactionablePath, appendUnactionable, quarantineEntry, restoreEntry, sanitizeSlug, isValidSlug2 as isValidSlug, proposalPath, activePath, activeRepoRelativePath, DEFAULT_SKILL_MIN_CONFIDENCE, DEFAULT_SKILL_MIN_CONFIRMATIONS, STRONG_SKILL_OUTCOME_COUNT, HIGH_PRIORITY_SKILL_MIN_CONFIDENCE, selectCandidateEntries, isSkillMaturityEligible, clusterEntries, renderSkillMarkdown, generateSkills, parseDraftFrontmatter, activateProposal, listSkills, autoApplyProposals, inspectSkill, retireSkill, regenerateSkill, _internals };
@@ -3,7 +3,7 @@ import {
3
3
  ALL_AGENT_NAMES,
4
4
  PluginConfigSchema,
5
5
  stripKnownSwarmPrefix
6
- } from "./index-q9h0wb04.js";
6
+ } from "./index-0asbrmdx.js";
7
7
  import {
8
8
  log
9
9
  } from "./index-zgwm4ryv.js";
@@ -1,10 +1,10 @@
1
1
  // @bun
2
2
  import {
3
3
  handleGuardrailExplain
4
- } from "./index-f41fa3f0.js";
4
+ } from "./index-fwb5f2gr.js";
5
5
  import {
6
6
  handleGuardrailLog
7
- } from "./index-5vpe6vq9.js";
7
+ } from "./index-vjsr9bqt.js";
8
8
  import {
9
9
  COMMAND_REGISTRY,
10
10
  SWARM_COMMAND_TOOL_ALLOWLIST,
@@ -76,17 +76,17 @@ import {
76
76
  handleWriteRetroCommand,
77
77
  normalizeSwarmCommandInput,
78
78
  resolveCommand
79
- } from "./index-6qkwgdsg.js";
80
- import"./index-5hvbw5xh.js";
79
+ } from "./index-jch711dq.js";
80
+ import"./index-g00qm2gf.js";
81
81
  import"./index-yhsmmv2z.js";
82
- import"./index-s8bj492g.js";
82
+ import"./index-32axfg6h.js";
83
83
  import"./index-e8pk68cc.js";
84
- import"./index-1cb4wxnm.js";
84
+ import"./index-819xp49y.js";
85
85
  import {
86
86
  AGENT_TOOL_MAP,
87
87
  ORCHESTRATOR_NAME,
88
88
  stripKnownSwarmPrefix
89
- } from "./index-q9h0wb04.js";
89
+ } from "./index-0asbrmdx.js";
90
90
  import"./index-8y7qetpg.js";
91
91
  import"./index-adz3nk9b.js";
92
92
  import"./index-v4fcn4tr.js";
@@ -12,14 +12,14 @@ import {
12
12
  detectPosixWrites,
13
13
  detectWindowsWrites,
14
14
  resolveWriteTargets
15
- } from "./index-6qkwgdsg.js";
15
+ } from "./index-jch711dq.js";
16
16
  import {
17
17
  checkFileAuthority,
18
18
  classifyFile,
19
19
  isInDeclaredScope,
20
20
  redactPath,
21
21
  redactShellCommand
22
- } from "./index-5hvbw5xh.js";
22
+ } from "./index-g00qm2gf.js";
23
23
 
24
24
  // src/services/guardrail-explain-service.ts
25
25
  import path from "path";
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  stripKnownSwarmPrefix
4
- } from "./index-q9h0wb04.js";
4
+ } from "./index-0asbrmdx.js";
5
5
  import {
6
6
  init_logger,
7
7
  warn