opencode-swarm 7.140.3 → 7.140.5

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 (148) hide show
  1. package/.opencode/skills/brainstorm/SKILL.md +1 -1
  2. package/.opencode/skills/ci-failure-batching/SKILL.md +11 -1
  3. package/.opencode/skills/ci-fix-monitor/SKILL.md +6 -4
  4. package/.opencode/skills/discover/SKILL.md +1 -1
  5. package/.opencode/skills/durable-session-state/SKILL.md +82 -0
  6. package/.opencode/skills/engineering-conventions/SKILL.md +1 -1
  7. package/.opencode/skills/issue-ingest/SKILL.md +13 -7
  8. package/.opencode/skills/issue-tracer/SKILL.md +1 -1
  9. package/.opencode/skills/orchestrating-subagents/SKILL.md +113 -0
  10. package/.opencode/skills/parallel-work-check/SKILL.md +1 -1
  11. package/.opencode/skills/plan/SKILL.md +40 -12
  12. package/.opencode/skills/swarm-ci-monitor/SKILL.md +5 -3
  13. package/.opencode/skills/swarm-pr-feedback/SKILL.md +30 -4
  14. package/.opencode/skills/writing-tests/SKILL.md +1 -1
  15. package/dist/agents/architect.d.ts +2 -1
  16. package/dist/agents/reviewer-directive-compliance.d.ts +19 -5
  17. package/dist/background/pending-delegations.d.ts +5 -0
  18. package/dist/cli/{config-doctor-fnmfd35x.js → config-doctor-5vzpq4qa.js} +3 -3
  19. package/dist/cli/{core-p5cyej3r.js → core-xjzdc56e.js} +2 -2
  20. package/dist/cli/{curation-policy-d52h4g8t.js → curation-policy-avvb56x2.js} +6 -8
  21. package/dist/cli/{curator-3zpdqt9r.js → curator-5nytvg7p.js} +38 -38
  22. package/dist/cli/curator-llm-factory-rds75zhj.js +61 -0
  23. package/dist/cli/{evidence-summary-service-nfdc1ht9.js → evidence-summary-service-zq4gyx6g.js} +15 -12
  24. package/dist/cli/gate-evidence-smn2wqft.js +51 -0
  25. package/dist/cli/guardrail-explain-an7jvam1.js +62 -0
  26. package/dist/cli/{guardrail-log-82da8y5a.js → guardrail-log-0hnd2k9v.js} +4 -4
  27. package/dist/cli/{hive-promoter-af5yaxvt.js → hive-promoter-qe8pqg79.js} +38 -38
  28. package/dist/cli/{index-qksjaxpd.js → index-01ggt2mj.js} +49 -18
  29. package/dist/cli/{index-j1xmren9.js → index-0r2m0vbq.js} +12 -10
  30. package/dist/cli/{index-pg7n141e.js → index-0rx9t9w8.js} +1 -1
  31. package/dist/cli/{index-brh827g0.js → index-2bg901qt.js} +73 -32
  32. package/dist/cli/{index-8n4c3vec.js → index-386ts4tm.js} +4 -4
  33. package/dist/cli/{index-898f16j9.js → index-8rp1y4ab.js} +2 -2
  34. package/dist/cli/{index-hfvxhk4z.js → index-912qz4y0.js} +88 -88
  35. package/dist/cli/index-affh1gtg.js +2554 -0
  36. package/dist/cli/{index-1m1ksyqt.js → index-c432knmy.js} +1 -1
  37. package/dist/cli/{index-jvk119ck.js → index-e0mpz2j3.js} +54 -19
  38. package/dist/cli/{index-ry0hgg3m.js → index-epvhf50h.js} +37 -3
  39. package/dist/cli/{index-95bj4kaw.js → index-ex7r16gc.js} +2 -2
  40. package/dist/cli/{index-7d5jseea.js → index-jm4cpp4n.js} +5 -2
  41. package/dist/cli/{index-n408rw7n.js → index-jqsfsqbx.js} +27 -2
  42. package/dist/cli/{index-7kdd75se.js → index-kb5q9v34.js} +11 -9
  43. package/dist/cli/{index-jfjnn408.js → index-m9xrdjn0.js} +1 -1
  44. package/dist/cli/{index-pj9h75cc.js → index-mm2egvdt.js} +40 -40
  45. package/dist/cli/{index-8bnzzv3b.js → index-nwrwy8eb.js} +70 -34
  46. package/dist/cli/index-nyjtzmsj.js +43 -0
  47. package/dist/cli/{index-h2waehqq.js → index-p8kk34am.js} +3 -3
  48. package/dist/cli/{index-wf35ka4z.js → index-ptn13xjn.js} +3 -3
  49. package/dist/cli/{index-1kyex7z2.js → index-qwm6vdyv.js} +32 -1
  50. package/dist/cli/{index-p9dsb0tw.js → index-qy1nq52t.js} +2 -19
  51. package/dist/cli/{index-b9rd29ge.js → index-s1v0wza5.js} +6 -2
  52. package/dist/cli/{index-yyyk63kk.js → index-t5pytnca.js} +2 -2
  53. package/dist/cli/index-tjqzr3jc.js +623 -0
  54. package/dist/cli/{index-rs1f1bh0.js → index-vh05t3w5.js} +1 -1
  55. package/dist/cli/{index-adyxbmt5.js → index-wkt9fj06.js} +4 -4
  56. package/dist/cli/{index-kbfsp07d.js → index-wrb0gykj.js} +217 -15
  57. package/dist/cli/{index-xz8f1n1a.js → index-z7h37d63.js} +2 -2
  58. package/dist/cli/{index-q1q8b85k.js → index-z90nvqj3.js} +49315 -47331
  59. package/dist/cli/{index-b8zgtz81.js → index-zsrtt42s.js} +34 -1
  60. package/dist/cli/{index-gtbmabws.js → index-ztgn70jz.js} +2 -2
  61. package/dist/cli/index.js +37 -37
  62. package/dist/cli/{knowledge-escalator-7q59skqg.js → knowledge-escalator-4pfrc902.js} +20 -8
  63. package/dist/cli/{knowledge-events-3nwfdpq7.js → knowledge-events-3zkfnksk.js} +19 -6
  64. package/dist/cli/{knowledge-link-q46k9adx.js → knowledge-link-m9p80f4r.js} +5 -5
  65. package/dist/cli/{knowledge-store-0d83rhh3.js → knowledge-store-dpqgvvjt.js} +6 -6
  66. package/dist/cli/{knowledge-validator-6mfx91a2.js → knowledge-validator-2c7w87dk.js} +8 -9
  67. package/dist/cli/{pending-delegations-qzrx38y9.js → pending-delegations-cxx9tezp.js} +4 -4
  68. package/dist/cli/{pr-subscriptions-5s59h4dd.js → pr-subscriptions-2sfnb599.js} +4 -4
  69. package/dist/cli/{runner-y78d7ryb.js → runner-mky3vvht.js} +6 -6
  70. package/dist/cli/{scan-cursor-rc8q12ss.js → scan-cursor-1z60gwrw.js} +7 -7
  71. package/dist/cli/{schema-n9eaxp3a.js → schema-vpnkwvez.js} +2 -2
  72. package/dist/cli/{scope-persistence-dr1msqxw.js → scope-persistence-p9dmprry.js} +10 -5
  73. package/dist/cli/{skill-generator-q7c6vadg.js → skill-generator-yx7ka1cj.js} +19 -10
  74. package/dist/cli/{telemetry-sc57xtb0.js → telemetry-0x6kszvk.js} +1 -1
  75. package/dist/cli/{worktree-collision-ownership-7a8e6gr9.js → worktree-collision-ownership-wm5pse49.js} +8 -8
  76. package/dist/cli/worktree-isolation-bwc6ra8e.js +102 -0
  77. package/dist/cli/worktree-provisioning-owner-sjh7te1h.js +22 -0
  78. package/dist/commands/acknowledge-spec-drift.d.ts +4 -5
  79. package/dist/commands/ci-simulate.d.ts +7 -3
  80. package/dist/commands/close.d.ts +8 -0
  81. package/dist/commands/registry.d.ts +2 -2
  82. package/dist/commands/sdd.d.ts +15 -0
  83. package/dist/config/bundled-skills.d.ts +1 -1
  84. package/dist/config/evidence-schema.d.ts +3 -3
  85. package/dist/config/index.d.ts +2 -2
  86. package/dist/config/plan-schema.d.ts +8 -0
  87. package/dist/config/schema.d.ts +4 -2
  88. package/dist/council/council-evidence-writer.d.ts +1 -1
  89. package/dist/gate-evidence.d.ts +117 -4
  90. package/dist/git/branch.d.ts +1 -1
  91. package/dist/hooks/delegate-ack-collector.d.ts +5 -0
  92. package/dist/hooks/delegation-gate.d.ts +21 -0
  93. package/dist/hooks/hive-promoter.d.ts +4 -4
  94. package/dist/hooks/issue-trace-reducer.d.ts +7 -1
  95. package/dist/hooks/issue-trace-state.d.ts +18 -0
  96. package/dist/hooks/issue-trace.d.ts +3 -1
  97. package/dist/hooks/knowledge-application-gate.d.ts +8 -3
  98. package/dist/hooks/knowledge-application.d.ts +8 -5
  99. package/dist/hooks/knowledge-escalator.d.ts +9 -5
  100. package/dist/hooks/knowledge-events.d.ts +21 -8
  101. package/dist/hooks/knowledge-injector.d.ts +9 -0
  102. package/dist/hooks/knowledge-receipt-ledger-storage.d.ts +49 -0
  103. package/dist/hooks/knowledge-receipt-ledger.d.ts +305 -0
  104. package/dist/hooks/knowledge-receipt-observability.d.ts +28 -0
  105. package/dist/hooks/knowledge-receipt-validator.d.ts +13 -50
  106. package/dist/hooks/knowledge-store.d.ts +6 -1
  107. package/dist/hooks/knowledge-types.d.ts +12 -0
  108. package/dist/hooks/phase-complete-directive-gate.d.ts +3 -1
  109. package/dist/hooks/phase-directives.d.ts +4 -4
  110. package/dist/hooks/pr-workflow-gate.d.ts +34 -1
  111. package/dist/hooks/promotion-evidence-store.d.ts +14 -8
  112. package/dist/hooks/reviewer-verdict-parser.d.ts +34 -10
  113. package/dist/index.js +823 -779
  114. package/dist/knowledge/curation-policy.d.ts +0 -2
  115. package/dist/observability/catalog.d.ts +5 -3
  116. package/dist/observability/legacy.d.ts +4 -3
  117. package/dist/plan/ledger.d.ts +55 -0
  118. package/dist/plan/manager.d.ts +9 -0
  119. package/dist/plan/planning-profile.d.ts +27 -0
  120. package/dist/services/spec-drift-recovery.d.ts +84 -0
  121. package/dist/session/snapshot-writer.d.ts +3 -1
  122. package/dist/state.d.ts +19 -17
  123. package/dist/summaries/schema.d.ts +2 -2
  124. package/dist/telemetry.d.ts +1 -1
  125. package/dist/tools/convene-council.d.ts +6 -6
  126. package/dist/tools/index.d.ts +3 -0
  127. package/dist/tools/manifest.d.ts +3 -0
  128. package/dist/tools/phase-complete.d.ts +9 -0
  129. package/dist/tools/rebind-pr-feedback-head.d.ts +17 -0
  130. package/dist/tools/record-implementation-review.d.ts +19 -0
  131. package/dist/tools/record-recurrence-sweep.d.ts +17 -0
  132. package/dist/tools/run-pr-feedback-stage-a.d.ts +8 -0
  133. package/dist/tools/save-plan.d.ts +8 -0
  134. package/dist/tools/submit-phase-council-verdicts.d.ts +6 -6
  135. package/dist/tools/tool-metadata.d.ts +40 -28
  136. package/dist/tools/update-task-status.d.ts +13 -0
  137. package/dist/tools/write-final-council-evidence.d.ts +6 -6
  138. package/dist/types/events.d.ts +29 -1
  139. package/dist/workflow/coder-settlement.d.ts +62 -0
  140. package/dist/workflow/task-repair.d.ts +30 -0
  141. package/dist/workflow/task-terminal.d.ts +52 -0
  142. package/package.json +3 -1
  143. package/dist/cli/curator-llm-factory-2h0xb62t.js +0 -61
  144. package/dist/cli/gate-evidence-46qeyfc1.js +0 -32
  145. package/dist/cli/guardrail-explain-yktan15c.js +0 -62
  146. package/dist/cli/index-d181x9zr.js +0 -71
  147. package/dist/cli/index-n0pja0qs.js +0 -239
  148. package/dist/cli/index-n8jncheh.js +0 -666
@@ -9,7 +9,7 @@ import {
9
9
  readEvaluationRun,
10
10
  saveEvaluationRun,
11
11
  saveTaskSetSnapshot
12
- } from "./index-yyyk63kk.js";
12
+ } from "./index-t5pytnca.js";
13
13
  import {
14
14
  canonicalHash,
15
15
  computeCandidateInputContentHash,
@@ -1,4 +1,9 @@
1
1
  // @bun
2
+ import {
3
+ queryHistoricalOutcomes,
4
+ readKnowledgeEvents,
5
+ recordKnowledgeEvent
6
+ } from "./index-affh1gtg.js";
2
7
  import {
3
8
  jaccardBigram,
4
9
  readKnowledge,
@@ -6,13 +11,7 @@ import {
6
11
  resolveSwarmKnowledgePath,
7
12
  transactKnowledge,
8
13
  wordBigrams
9
- } from "./index-qksjaxpd.js";
10
- import {
11
- countEntryContradictionsInWindow,
12
- countEntryViolationsInWindow,
13
- readKnowledgeEvents,
14
- recordKnowledgeEvent
15
- } from "./index-n8jncheh.js";
14
+ } from "./index-01ggt2mj.js";
16
15
  import {
17
16
  init_knowledge_types,
18
17
  isActiveStatus
@@ -30,9 +29,41 @@ var ESCALATION_THRESHOLD = 2;
30
29
  function isFullyEscalated(e) {
31
30
  return e.directive_priority === "critical" && e.enforcement_mode === "enforce";
32
31
  }
32
+ function terminalHistory(membership) {
33
+ const compatible = membership;
34
+ return [
35
+ ...compatible.terminal_history ?? [],
36
+ ...compatible.historical_terminals ?? [],
37
+ ...membership.terminal ? [membership.terminal] : []
38
+ ];
39
+ }
40
+ function countTerminalOutcomesInWindow(memberships, entryIds, outcome, windowDays, now) {
41
+ const cutoff = now.getTime() - windowDays * 24 * 60 * 60 * 1000;
42
+ const upper = now.getTime();
43
+ const seenEvents = new Set;
44
+ let count = 0;
45
+ for (const membership of memberships) {
46
+ if (!entryIds.has(membership.entry_id))
47
+ continue;
48
+ for (const terminal of terminalHistory(membership)) {
49
+ if (terminal.outcome !== outcome || seenEvents.has(terminal.event_id)) {
50
+ continue;
51
+ }
52
+ const timestamp = Date.parse(terminal.committed_at);
53
+ if (!Number.isNaN(timestamp) && timestamp >= cutoff && timestamp <= upper) {
54
+ seenEvents.add(terminal.event_id);
55
+ count += 1;
56
+ }
57
+ }
58
+ }
59
+ return count;
60
+ }
33
61
  async function maybeEscalateOnViolation(directory, entryId, now = new Date) {
34
62
  try {
35
- let count = await countEntryViolationsInWindow(directory, entryId, ESCALATION_WINDOW_DAYS, now);
63
+ const history = await _internals.queryHistoricalOutcomes(directory);
64
+ if (!history.ok)
65
+ return { escalated: false, entryId };
66
+ let count = countTerminalOutcomesInWindow(history.memberships, new Set([entryId]), "violated", ESCALATION_WINDOW_DAYS, now);
36
67
  if (count < ESCALATION_THRESHOLD) {
37
68
  try {
38
69
  const allEntries = [];
@@ -43,18 +74,16 @@ async function maybeEscalateOnViolation(directory, entryId, now = new Date) {
43
74
  }
44
75
  const target = allEntries.find((e) => e.id === entryId);
45
76
  if (target) {
46
- const seen = new Set([entryId]);
77
+ const equivalentIds = new Set([entryId]);
47
78
  const targetBigrams = wordBigrams(target.lesson);
48
79
  for (const e of allEntries) {
49
- if (seen.has(e.id))
80
+ if (equivalentIds.has(e.id))
50
81
  continue;
51
- seen.add(e.id);
52
82
  if (jaccardBigram(targetBigrams, wordBigrams(e.lesson)) >= NEAR_DUPLICATE_THRESHOLD) {
53
- count += await countEntryViolationsInWindow(directory, e.id, ESCALATION_WINDOW_DAYS, now);
54
- if (count >= ESCALATION_THRESHOLD)
55
- break;
83
+ equivalentIds.add(e.id);
56
84
  }
57
85
  }
86
+ count = countTerminalOutcomesInWindow(history.memberships, equivalentIds, "violated", ESCALATION_WINDOW_DAYS, now);
58
87
  }
59
88
  } catch {}
60
89
  }
@@ -173,7 +202,12 @@ async function escalateViolatedEntries(directory, entryIds, now = new Date) {
173
202
  }
174
203
  async function maybeQuarantineOnContradiction(directory, entryId, threshold, windowDays, now = new Date) {
175
204
  try {
176
- const count = await countEntryContradictionsInWindow(directory, entryId, windowDays, now);
205
+ const history = await _internals.queryHistoricalOutcomes(directory, [
206
+ entryId
207
+ ]);
208
+ if (!history.ok)
209
+ return { quarantined: false, entryId };
210
+ const count = countTerminalOutcomesInWindow(history.memberships, new Set([entryId]), "contradicted", windowDays, now);
177
211
  if (count < threshold) {
178
212
  return { quarantined: false, entryId, contradictionsInWindow: count };
179
213
  }
@@ -190,11 +224,11 @@ async function maybeQuarantineOnContradiction(directory, entryId, threshold, win
190
224
  alreadyInactive: true
191
225
  };
192
226
  }
193
- const { quarantineEntry } = await import("./knowledge-validator-6mfx91a2.js");
227
+ const { quarantineEntry } = await import("./knowledge-validator-2c7w87dk.js");
194
228
  let policyConfig;
195
229
  try {
196
- const { KnowledgeConfigSchema } = await import("./schema-n9eaxp3a.js");
197
- const { loadPluginConfigWithMeta } = await import("./index-j1xmren9.js");
230
+ const { KnowledgeConfigSchema } = await import("./schema-vpnkwvez.js");
231
+ const { loadPluginConfigWithMeta } = await import("./index-0r2m0vbq.js");
198
232
  const { config: loadedConfig } = loadPluginConfigWithMeta(directory);
199
233
  policyConfig = KnowledgeConfigSchema.parse(loadedConfig.knowledge ?? {});
200
234
  } catch {
@@ -215,5 +249,6 @@ async function maybeQuarantineOnContradiction(directory, entryId, threshold, win
215
249
  return { quarantined: false, entryId };
216
250
  }
217
251
  }
252
+ var _internals = { queryHistoricalOutcomes };
218
253
 
219
- export { ESCALATION_WINDOW_DAYS, ESCALATION_THRESHOLD, maybeEscalateOnViolation, ESCALATION_DISPLAY_WINDOW_DAYS, readRecentEscalations, buildEscalationBriefing, escalateViolatedEntries, maybeQuarantineOnContradiction };
254
+ export { ESCALATION_WINDOW_DAYS, ESCALATION_THRESHOLD, maybeEscalateOnViolation, ESCALATION_DISPLAY_WINDOW_DAYS, readRecentEscalations, buildEscalationBriefing, escalateViolatedEntries, maybeQuarantineOnContradiction, _internals };
@@ -532,7 +532,7 @@ var CATALOG_SOURCE = [
532
532
  category: "plan",
533
533
  severity: "notice",
534
534
  privacyClass: "operational",
535
- producer: "src/plan/manager.ts:341",
535
+ producer: "src/plan/manager.ts:344",
536
536
  consumers: NO_CONSUMERS,
537
537
  futureOwnerIssue: ISSUE_SINK,
538
538
  retentionOwnerIssue: ISSUE_PLAN_EVIDENCE_RETENTION,
@@ -545,7 +545,7 @@ var CATALOG_SOURCE = [
545
545
  category: "plan",
546
546
  severity: "warning",
547
547
  privacyClass: "sensitive",
548
- producer: "src/plan/manager.ts:1780",
548
+ producer: "src/plan/manager.ts:1842",
549
549
  consumers: NO_CONSUMERS,
550
550
  futureOwnerIssue: ISSUE_SINK,
551
551
  retentionOwnerIssue: ISSUE_PLAN_EVIDENCE_RETENTION,
@@ -558,7 +558,7 @@ var CATALOG_SOURCE = [
558
558
  category: "plan",
559
559
  severity: "error",
560
560
  privacyClass: "sensitive",
561
- producer: "src/plan/ledger.ts:707",
561
+ producer: "src/plan/ledger.ts:762",
562
562
  consumers: NO_CONSUMERS,
563
563
  futureOwnerIssue: ISSUE_SINK,
564
564
  retentionOwnerIssue: ISSUE_PLAN_EVIDENCE_RETENTION,
@@ -592,6 +592,20 @@ var CATALOG_SOURCE = [
592
592
  futureOwnerIssue: ISSUE_SINK,
593
593
  retentionOwnerIssue: ISSUE_SINK
594
594
  }
595
+ ],
596
+ [
597
+ "knowledge_receipt_transition",
598
+ {
599
+ category: "knowledge",
600
+ severity: "info",
601
+ privacyClass: "pseudonymous",
602
+ producer: "src/hooks/knowledge-receipt-observability.ts:160",
603
+ consumers: NO_CONSUMERS,
604
+ futureOwnerIssue: ISSUE_SINK,
605
+ retentionOwnerIssue: ISSUE_LIFECYCLE_RETENTION,
606
+ requiredWorkflowIds: NO_WORKFLOW_IDS,
607
+ allowsLinks: false
608
+ }
595
609
  ]
596
610
  ];
597
611
  var catalog = {};
@@ -950,6 +964,18 @@ var KNOWN_TELEMETRY_KEYS = Object.freeze({
950
964
  "conflictType",
951
965
  "resolutionPath",
952
966
  "summary"
967
+ ]),
968
+ knowledge_receipt_transition: Object.freeze([
969
+ "transition",
970
+ "reasonCode",
971
+ "schemaVersion",
972
+ "knowledgeTraceId",
973
+ "knowledgeEntryId",
974
+ "sessionId",
975
+ "taskId",
976
+ "phase",
977
+ "receiptOutcome",
978
+ "receiptSource"
953
979
  ])
954
980
  });
955
981
  var EMPTY_EXTRA = Object.freeze({});
@@ -1038,6 +1064,14 @@ function extractWorkflowIds(data) {
1038
1064
  const batchId = nonEmptyString(record.batchId);
1039
1065
  if (batchId !== undefined)
1040
1066
  ids.batchId = batchId;
1067
+ const knowledgeTraceId = nonEmptyString(record.knowledgeTraceId);
1068
+ if (knowledgeTraceId !== undefined) {
1069
+ ids.knowledgeTraceId = knowledgeTraceId;
1070
+ }
1071
+ const knowledgeEntryId = nonEmptyString(record.knowledgeEntryId);
1072
+ if (knowledgeEntryId !== undefined) {
1073
+ ids.knowledgeEntryId = knowledgeEntryId;
1074
+ }
1041
1075
  const phase = record.phase;
1042
1076
  if (typeof phase === "number" && Number.isFinite(phase)) {
1043
1077
  ids.phaseId = String(phase);
@@ -12,14 +12,14 @@ import {
12
12
  detectPosixWrites,
13
13
  detectWindowsWrites,
14
14
  resolveWriteTargets
15
- } from "./index-q1q8b85k.js";
15
+ } from "./index-z90nvqj3.js";
16
16
  import {
17
17
  checkFileAuthority,
18
18
  classifyFile,
19
19
  isInDeclaredScope,
20
20
  redactPath,
21
21
  redactShellCommand
22
- } from "./index-wf35ka4z.js";
22
+ } from "./index-ptn13xjn.js";
23
23
 
24
24
  // src/services/guardrail-explain-service.ts
25
25
  import path from "path";
@@ -3,7 +3,7 @@ import {
3
3
  ALL_AGENT_NAMES,
4
4
  SUMMARIZER_EXEMPT_TOOL_NAMES,
5
5
  init_constants
6
- } from "./index-n408rw7n.js";
6
+ } from "./index-jqsfsqbx.js";
7
7
  import {
8
8
  OUTCOME_BLOCK_THRESHOLD,
9
9
  init_knowledge_types
@@ -21,7 +21,7 @@ var package_default;
21
21
  var init_package = __esm(() => {
22
22
  package_default = {
23
23
  name: "opencode-swarm",
24
- version: "7.140.3",
24
+ version: "7.140.5",
25
25
  description: "Architect-centric agentic swarm plugin for OpenCode - hub-and-spoke orchestration with SME consultation, code generation, and QA review",
26
26
  main: "dist/index.js",
27
27
  types: "dist/index.d.ts",
@@ -102,6 +102,8 @@ var init_package = __esm(() => {
102
102
  ".opencode/skills/parallel-work-check",
103
103
  ".opencode/skills/ci-fix-monitor",
104
104
  ".opencode/skills/issue-tracer",
105
+ ".opencode/skills/orchestrating-subagents",
106
+ ".opencode/skills/durable-session-state",
105
107
  "tests/fixtures/memory-recall",
106
108
  "README.md",
107
109
  "LICENSE"
@@ -853,6 +855,7 @@ var init_schema = __esm(() => {
853
855
  evergreen_utility: exports_external.number().min(0).max(1).default(0.8),
854
856
  low_utility_threshold: exports_external.number().min(0).max(1).default(0.3),
855
857
  min_retrievals_for_utility: exports_external.number().min(1).max(100).default(3),
858
+ receipt_close_grace_days: exports_external.number().int().min(0).max(3650).default(7),
856
859
  schema_version: exports_external.number().int().min(1).default(1),
857
860
  directive_min_confidence: exports_external.number().min(0).max(1).default(0.75),
858
861
  same_project_weight: exports_external.number().min(0).max(5).default(1),
@@ -246,6 +246,10 @@ var init_tool_metadata = __esm(() => {
246
246
  description: "prepare an auditable PR workflow checkout or restore its exact original branch/HEAD and preserved stash after terminal cleanup",
247
247
  agents: ["architect"]
248
248
  },
249
+ record_implementation_review: {
250
+ description: "record fresh-context reviewer + critic APPROVE verdicts for the implementation diff so the /swarm issue --trace workflow can satisfy its review gate before commit-pr handoff",
251
+ agents: ["architect"]
252
+ },
249
253
  record_issue_publication: {
250
254
  description: "record a publication receipt so the /swarm issue --trace workflow reaches its terminal published state after the PR is created/updated",
251
255
  agents: ["architect"]
@@ -254,6 +258,14 @@ var init_tool_metadata = __esm(() => {
254
258
  description: "record the reproduction outcome for the current traced issue so the /swarm issue --trace workflow can satisfy its reproduction gate and transition to PLAN",
255
259
  agents: ["architect"]
256
260
  },
261
+ record_recurrence_sweep: {
262
+ description: "record the recurrence sweep (defect class, predicates, hit dispositions, guardrail proof) so the /swarm issue --trace workflow can satisfy its recurrence gate before commit-pr handoff",
263
+ agents: ["architect"]
264
+ },
265
+ rebind_pr_feedback_head: {
266
+ description: "rebind a PR_FEEDBACK workflow to a new verified remote PR head after merge/rebase/conflict repair, invalidating ancestry-bound receipts so the mechanical ladder re-runs",
267
+ agents: ["architect"]
268
+ },
257
269
  run_pr_feedback_stage_a: {
258
270
  description: "execute and persist mandatory PR-feedback Stage A checks on a content-bound revision",
259
271
  agents: ["architect"]
@@ -910,7 +922,7 @@ function isQAAgent(name) {
910
922
  function isSubagent(name) {
911
923
  return ALL_SUBAGENT_NAMES.includes(name);
912
924
  }
913
- var OPENCODE_NATIVE_AGENTS, CLAUDE_CODE_NATIVE_COMMANDS, EXTERNAL_SKILL_TOOL_NAMES, EXTERNAL_SKILL_AGENT_TOOL_MAP, COUNCIL_TOOL_NAMES, COUNCIL_AGENT_TOOL_MAP, GENERAL_COUNCIL_TOOL_NAMES, GENERAL_COUNCIL_AGENT_TOOL_MAP, TURBO_TOOL_NAMES, TURBO_AGENT_TOOL_MAP, SKILL_TOOL_NAMES, SKILL_AGENT_TOOL_MAP, SUMMARIZER_EXEMPT_TOOL_NAMES, DEFAULT_MODELS, DEFAULT_AGENT_CONFIGS, SWARM_WORKTREE_DIR_NAME = ".swarm-worktrees", DEFAULT_WORKTREE_ISOLATION_CONFIG;
925
+ var OPENCODE_NATIVE_AGENTS, CLAUDE_CODE_NATIVE_COMMANDS, EXTERNAL_SKILL_TOOL_NAMES, EXTERNAL_SKILL_AGENT_TOOL_MAP, COUNCIL_TOOL_NAMES, COUNCIL_AGENT_TOOL_MAP, GENERAL_COUNCIL_TOOL_NAMES, GENERAL_COUNCIL_AGENT_TOOL_MAP, TURBO_TOOL_NAMES, TURBO_AGENT_TOOL_MAP, SKILL_TOOL_NAMES, SKILL_AGENT_TOOL_MAP, WRITE_TOOL_NAMES, SUMMARIZER_EXEMPT_TOOL_NAMES, DEFAULT_MODELS, DEFAULT_AGENT_CONFIGS, SWARM_WORKTREE_DIR_NAME = ".swarm-worktrees", DEFAULT_WORKTREE_ISOLATION_CONFIG;
914
926
  var init_constants = __esm(() => {
915
927
  init_agent_names();
916
928
  init_tool_metadata();
@@ -1084,6 +1096,19 @@ var init_constants = __esm(() => {
1084
1096
  SKILL_AGENT_TOOL_MAP = {
1085
1097
  architect: [...SKILL_TOOL_NAMES]
1086
1098
  };
1099
+ WRITE_TOOL_NAMES = [
1100
+ "write",
1101
+ "edit",
1102
+ "patch",
1103
+ "apply_patch",
1104
+ "swarm_apply_patch",
1105
+ "create_file",
1106
+ "insert",
1107
+ "replace",
1108
+ "append",
1109
+ "prepend",
1110
+ "extract_code_blocks"
1111
+ ];
1087
1112
  SUMMARIZER_EXEMPT_TOOL_NAMES = [
1088
1113
  "retrieve_summary",
1089
1114
  "retrieve_lane_output",
@@ -1224,4 +1249,4 @@ var init_constants = __esm(() => {
1224
1249
  };
1225
1250
  });
1226
1251
 
1227
- export { QA_AGENTS, PIPELINE_AGENTS, ORCHESTRATOR_NAME, ALL_SUBAGENT_NAMES, ALL_AGENT_NAMES, init_agent_names, TOOL_NAMES, TOOL_NAME_SET, AGENT_TOOL_MAP, init_tool_metadata, SUMMARIZER_EXEMPT_TOOL_NAMES, DEFAULT_MODELS, DEFAULT_AGENT_CONFIGS, isQAAgent, isSubagent, SWARM_WORKTREE_DIR_NAME, DEFAULT_WORKTREE_ISOLATION_CONFIG, init_constants };
1252
+ export { QA_AGENTS, PIPELINE_AGENTS, ORCHESTRATOR_NAME, ALL_SUBAGENT_NAMES, ALL_AGENT_NAMES, init_agent_names, TOOL_NAMES, TOOL_NAME_SET, AGENT_TOOL_MAP, init_tool_metadata, WRITE_TOOL_NAMES, SUMMARIZER_EXEMPT_TOOL_NAMES, DEFAULT_MODELS, DEFAULT_AGENT_CONFIGS, isQAAgent, isSubagent, SWARM_WORKTREE_DIR_NAME, DEFAULT_WORKTREE_ISOLATION_CONFIG, init_constants };
@@ -1,19 +1,19 @@
1
1
  // @bun
2
+ import {
3
+ effectiveRetrievalOutcomes,
4
+ readAuthoritativeKnowledgeCounterRollups
5
+ } from "./index-affh1gtg.js";
2
6
  import {
3
7
  ALLOWED_SKILL_PATH_PREFIXES,
4
8
  validateSkillPath
5
- } from "./index-8n4c3vec.js";
9
+ } from "./index-386ts4tm.js";
6
10
  import {
7
11
  computeOutcomeSignal,
8
12
  readKnowledge,
9
13
  resolveHiveKnowledgePath,
10
14
  resolveSwarmKnowledgePath,
11
15
  transactKnowledge
12
- } from "./index-qksjaxpd.js";
13
- import {
14
- effectiveRetrievalOutcomes,
15
- readKnowledgeCounterRollups
16
- } from "./index-n8jncheh.js";
16
+ } from "./index-01ggt2mj.js";
17
17
  import {
18
18
  advisoryWarn,
19
19
  init_warning_buffer
@@ -81,7 +81,9 @@ var BUNDLED_PROJECT_SKILLS = [
81
81
  "fork-pr-operations",
82
82
  "parallel-work-check",
83
83
  "ci-fix-monitor",
84
- "issue-tracer"
84
+ "issue-tracer",
85
+ "orchestrating-subagents",
86
+ "durable-session-state"
85
87
  ];
86
88
  var BUNDLED_PROJECT_SKILL_ROOT = ".swarm/bundled-skills";
87
89
  function bundledProjectSkillFileReference(slug) {
@@ -824,7 +826,7 @@ async function selectCandidateEntries(directory, opts) {
824
826
  const hivePath = resolveHiveKnowledgePath();
825
827
  const hive = existsSync2(hivePath) ? await readKnowledge(hivePath) : [];
826
828
  const all = [...swarm, ...hive];
827
- const counterRollups = await readKnowledgeCounterRollups(directory);
829
+ const counterRollups = await readAuthoritativeKnowledgeCounterRollups(directory);
828
830
  const selected = [];
829
831
  for (const e of all) {
830
832
  if (e.status === "archived")
@@ -1058,7 +1060,7 @@ async function generateSkills(req) {
1058
1060
  const swarm = await readKnowledge(resolveSwarmKnowledgePath(req.directory));
1059
1061
  const hivePath = resolveHiveKnowledgePath();
1060
1062
  const hive = existsSync2(hivePath) ? await readKnowledge(hivePath) : [];
1061
- const rollups = await readKnowledgeCounterRollups(req.directory);
1063
+ const rollups = await readAuthoritativeKnowledgeCounterRollups(req.directory);
1062
1064
  pool = [...swarm, ...hive].filter((e) => idSet.has(e.id) && isActiveStatus(e.status)).sort((a, b) => (idOrder.get(a.id) ?? 0) - (idOrder.get(b.id) ?? 0)).map((e) => ({
1063
1065
  ...e,
1064
1066
  retrieval_outcomes: effectiveRetrievalOutcomes(e.retrieval_outcomes, rollups.get(e.id))
@@ -4,7 +4,7 @@ import {
4
4
  } from "./index-k46me75h.js";
5
5
  import {
6
6
  withEvidenceLock
7
- } from "./index-hfvxhk4z.js";
7
+ } from "./index-912qz4y0.js";
8
8
  import {
9
9
  log
10
10
  } from "./index-zgwm4ryv.js";
@@ -1,16 +1,16 @@
1
1
  // @bun
2
2
  import {
3
3
  handleGuardrailExplain
4
- } from "./index-95bj4kaw.js";
4
+ } from "./index-ex7r16gc.js";
5
5
  import {
6
6
  handleGuardrailLog
7
- } from "./index-pg7n141e.js";
7
+ } from "./index-0rx9t9w8.js";
8
8
  import {
9
9
  COMMAND_REGISTRY,
10
10
  SWARM_COMMAND_TOOL_ALLOWLIST,
11
11
  SWARM_COMMAND_TOOL_COMMANDS,
12
12
  VALID_COMMANDS,
13
- _internals2 as _internals,
13
+ _internals3 as _internals,
14
14
  canonicalCommandKey,
15
15
  classifySwarmCommandChatFallbackUse,
16
16
  classifySwarmCommandToolUse,
@@ -84,66 +84,66 @@ import {
84
84
  handleWriteRetroCommand,
85
85
  normalizeSwarmCommandInput,
86
86
  resolveCommand
87
- } from "./index-q1q8b85k.js";
88
- import"./index-41hkt36g.js";
89
- import"./index-1m1ksyqt.js";
90
- import"./index-wf35ka4z.js";
91
- import"./index-xz8f1n1a.js";
92
- import"./index-brh827g0.js";
93
- import"./index-yyyk63kk.js";
94
- import"./index-y8552snf.js";
87
+ } from "./index-z90nvqj3.js";
95
88
  import"./index-4905hd2m.js";
96
- import"./index-134d35c1.js";
97
- import"./index-7kdd75se.js";
98
- import"./index-jvk119ck.js";
99
- import"./index-gtbmabws.js";
100
- import"./index-v2xrer41.js";
89
+ import"./index-41hkt36g.js";
90
+ import"./index-c432knmy.js";
91
+ import"./index-ptn13xjn.js";
101
92
  import"./index-c8s9a3zh.js";
93
+ import"./index-z7h37d63.js";
94
+ import"./index-2bg901qt.js";
95
+ import"./index-134d35c1.js";
96
+ import"./index-t5pytnca.js";
97
+ import"./index-y8552snf.js";
102
98
  import"./index-9ss2m4rs.js";
103
- import"./index-jfjnn408.js";
104
- import"./index-adyxbmt5.js";
105
- import"./index-556ja8an.js";
106
- import"./index-kbfsp07d.js";
107
- import"./index-1kyex7z2.js";
108
- import"./index-b8zgtz81.js";
109
- import"./index-898f16j9.js";
110
- import"./index-b9rd29ge.js";
111
- import"./index-k46me75h.js";
112
- import"./index-ee3x66a5.js";
113
99
  import"./index-74hpm6sh.js";
114
- import"./index-n0pja0qs.js";
100
+ import"./index-kb5q9v34.js";
101
+ import"./index-e0mpz2j3.js";
102
+ import"./index-ztgn70jz.js";
103
+ import"./index-v2xrer41.js";
104
+ import"./index-m9xrdjn0.js";
105
+ import"./index-wkt9fj06.js";
106
+ import"./index-556ja8an.js";
107
+ import"./index-wrb0gykj.js";
108
+ import"./index-zsrtt42s.js";
109
+ import"./index-8rp1y4ab.js";
110
+ import"./index-qwm6vdyv.js";
111
+ import"./index-tjqzr3jc.js";
112
+ import"./index-s1v0wza5.js";
115
113
  import"./index-8fwhhayc.js";
116
114
  import"./index-q1exe2b3.js";
117
- import"./index-8n4c3vec.js";
118
- import"./index-p9dsb0tw.js";
115
+ import"./index-affh1gtg.js";
116
+ import"./index-k46me75h.js";
117
+ import"./index-ee3x66a5.js";
118
+ import"./index-386ts4tm.js";
119
+ import"./index-qy1nq52t.js";
119
120
  import"./index-rtry5xyf.js";
120
- import"./index-qksjaxpd.js";
121
- import"./index-n8jncheh.js";
121
+ import"./index-01ggt2mj.js";
122
122
  import"./index-ae75rja9.js";
123
- import"./index-rs1f1bh0.js";
124
- import"./index-h2waehqq.js";
125
- import"./index-ed5ykebp.js";
126
- import"./index-hfvxhk4z.js";
123
+ import"./index-vh05t3w5.js";
124
+ import"./index-p8kk34am.js";
125
+ import"./index-912qz4y0.js";
127
126
  import"./index-7g4c7s5r.js";
127
+ import"./index-ed5ykebp.js";
128
128
  import"./index-4nt52yr9.js";
129
- import"./index-8bnzzv3b.js";
129
+ import"./index-nyjtzmsj.js";
130
130
  import"./index-gprxjmm7.js";
131
131
  import"./index-n832052r.js";
132
- import"./index-d181x9zr.js";
132
+ import"./index-nwrwy8eb.js";
133
133
  import"./index-4rhhvd1a.js";
134
134
  import"./index-zgwm4ryv.js";
135
135
  import {
136
136
  init_schema,
137
137
  stripKnownSwarmPrefix
138
- } from "./index-7d5jseea.js";
138
+ } from "./index-jm4cpp4n.js";
139
139
  import {
140
140
  AGENT_TOOL_MAP,
141
141
  ORCHESTRATOR_NAME,
142
142
  init_constants
143
- } from "./index-n408rw7n.js";
143
+ } from "./index-jqsfsqbx.js";
144
144
  import"./index-zjygnfay.js";
145
145
  import"./index-bk5tah7q.js";
146
- import"./index-ry0hgg3m.js";
146
+ import"./index-epvhf50h.js";
147
147
  import"./index-bpmtbmy9.js";
148
148
  import"./index-a76rekgs.js";
149
149
 
@@ -10,16 +10,16 @@ import {
10
10
  PluginConfigSchema,
11
11
  init_schema,
12
12
  resolveExternalSkillsConfig
13
- } from "./index-7d5jseea.js";
14
- import {
15
- DEFAULT_WORKTREE_ISOLATION_CONFIG,
16
- init_constants
17
- } from "./index-n408rw7n.js";
13
+ } from "./index-jm4cpp4n.js";
18
14
  import {
19
15
  MAX_MERGE_DEPTH,
20
16
  deepMerge,
21
17
  init_merge
22
18
  } from "./index-zjygnfay.js";
19
+ import {
20
+ exports_external,
21
+ init_zod
22
+ } from "./index-bpmtbmy9.js";
23
23
  import {
24
24
  __esm,
25
25
  __export
@@ -688,33 +688,69 @@ var init_loader = __esm(() => {
688
688
  init_merge();
689
689
  });
690
690
 
691
- // src/config/index.ts
692
- init_constants();
693
- init_loader();
694
- init_loader();
695
- init_schema();
696
-
697
- // src/config/worktree-isolation-config.ts
698
- init_constants();
699
- function resolveWorktreeIsolationConfig(config) {
700
- if (config.worktree) {
701
- return { ...DEFAULT_WORKTREE_ISOLATION_CONFIG, ...config.worktree };
702
- }
703
- const lean = config.turbo?.strategy === "lean" ? config.turbo.lean : undefined;
704
- if (lean?.worktree_isolation) {
705
- return {
706
- ...DEFAULT_WORKTREE_ISOLATION_CONFIG,
707
- policy: "auto",
708
- merge_strategy: lean.merge_strategy ?? "merge",
709
- worktree_dir: lean.worktree_dir,
710
- deps_strategy: lean.deps_strategy ?? "skip",
711
- runtime_isolation: lean.runtime_isolation ?? DEFAULT_WORKTREE_ISOLATION_CONFIG.runtime_isolation
712
- };
713
- }
714
- return DEFAULT_WORKTREE_ISOLATION_CONFIG;
715
- }
716
-
717
- // src/config/index.ts
718
- var _internals = { loadPluginConfigWithMeta };
691
+ // src/config/plan-schema.ts
692
+ init_zod();
693
+ var ExecutionProfileSchema = exports_external.object({
694
+ parallelization_enabled: exports_external.boolean().default(false),
695
+ max_concurrent_tasks: exports_external.number().int().min(1).max(64).default(10),
696
+ council_parallel: exports_external.boolean().default(true),
697
+ locked: exports_external.boolean().default(false),
698
+ auto_proceed: exports_external.boolean().default(false),
699
+ commit_after_each_completed_task: exports_external.boolean().default(false),
700
+ planning_profile: exports_external.enum(["balanced", "strict"]).optional()
701
+ });
702
+ var TaskStatusSchema = exports_external.enum([
703
+ "pending",
704
+ "in_progress",
705
+ "completed",
706
+ "blocked",
707
+ "closed"
708
+ ]);
709
+ var TaskSizeSchema = exports_external.enum(["small", "medium", "large"]);
710
+ var PhaseStatusSchema = exports_external.enum([
711
+ "pending",
712
+ "in_progress",
713
+ "complete",
714
+ "completed",
715
+ "blocked",
716
+ "closed"
717
+ ]);
718
+ var MigrationStatusSchema = exports_external.enum([
719
+ "native",
720
+ "migrated",
721
+ "migration_failed"
722
+ ]);
723
+ var TaskSchema = exports_external.object({
724
+ id: exports_external.string(),
725
+ phase: exports_external.number().int().min(1),
726
+ status: TaskStatusSchema.default("pending"),
727
+ size: TaskSizeSchema.default("small"),
728
+ description: exports_external.string().min(1),
729
+ depends: exports_external.array(exports_external.string()).default([]),
730
+ acceptance: exports_external.string().optional(),
731
+ files_touched: exports_external.array(exports_external.string()).default([]),
732
+ evidence_path: exports_external.string().optional(),
733
+ blocked_reason: exports_external.string().optional(),
734
+ fr_refs: exports_external.array(exports_external.string()).optional()
735
+ });
736
+ var PhaseSchema = exports_external.object({
737
+ id: exports_external.number().int().min(1),
738
+ name: exports_external.string().min(1),
739
+ status: PhaseStatusSchema.default("pending"),
740
+ tasks: exports_external.array(TaskSchema).default([]),
741
+ type: exports_external.enum(["code", "non-code"]).optional(),
742
+ required_agents: exports_external.array(exports_external.string()).optional()
743
+ });
744
+ var PlanSchema = exports_external.object({
745
+ schema_version: exports_external.literal("1.0.0"),
746
+ title: exports_external.string().min(1),
747
+ swarm: exports_external.string().min(1),
748
+ current_phase: exports_external.number().int().min(1).optional(),
749
+ phases: exports_external.array(PhaseSchema).min(1),
750
+ migration_status: MigrationStatusSchema.optional(),
751
+ specMtime: exports_external.string().optional(),
752
+ specHash: exports_external.string().optional(),
753
+ execution_profile: ExecutionProfileSchema.optional()
754
+ });
719
755
 
720
- export { loadPluginConfig, loadPluginConfigWithMeta, getSafeDefaultConfigLoadResult, loadPluginConfigWithMetaAsync, loadAgentPrompt, exports_loader, init_loader, resolveWorktreeIsolationConfig, _internals };
756
+ export { ExecutionProfileSchema, TaskStatusSchema, TaskSizeSchema, PhaseStatusSchema, MigrationStatusSchema, TaskSchema, PhaseSchema, PlanSchema, loadPluginConfig, loadPluginConfigWithMeta, getSafeDefaultConfigLoadResult, loadPluginConfigWithMetaAsync, loadAgentPrompt, exports_loader, init_loader };