opencode-swarm 7.88.1 → 7.88.3

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.
@@ -126,14 +126,31 @@ The tool will automatically write the retrospective to \`.swarm/evidence/retro-{
126
126
  - If `auto-proceed: off` AND `nudge: false`: after the user confirms the phase transition, suggest enabling auto-proceed. Use the swarm_command tool to record the user's answer: `swarm_command({ command: "auto-proceed", args: ["on"] })` for yes, `swarm_command({ command: "auto-proceed", args: ["off"] })` for no. Either call sets nudge to true and prevents re-nudging.
127
127
  - If `auto-proceed: off` AND `nudge: true`: Ask "Ready for Phase [N+1]?" and wait for user confirmation before proceeding.
128
128
 
129
+ 5.59. **Required agent dispatch for phase_complete**: Before calling `phase_complete`, the architect MUST have dispatched each of the active swarm's standard agents at least once during this phase. By default, `phase_complete` requires these agents:
130
+
131
+ | Agent | When required | Where dispatched during normal task execution |
132
+ |---|---|---|
133
+ | `coder` | Always | Task implementation (coder) |
134
+ | `reviewer` | Always | Task review (reviewer) |
135
+ | `test_engineer` | Always | Test verification (test_engineer) |
136
+ | `docs` | When `require_docs: true` in QA gate profile | Documentation updates |
137
+
138
+ If any required agent is missing, `phase_complete` returns `{ success: false, status: 'incomplete', message: 'Phase N incomplete: missing required agents: <list>', agentsMissing: [...] }` and the phase is not closed. Dispatch each agent during normal task execution (not only inside optional Phase/Final Councils in steps 5.65/5.7) so the closeout gate is satisfied.
139
+
140
+ The `docs` agent is only required when `require_docs: true` in the effective QA gate profile (visible via `get_qa_gate_profile`). For most small plans and feedback cycles, `docs` is NOT required and can be skipped. For multi-task implementation plans, `docs` is typically required.
141
+
142
+ The `coder` and `test_engineer` agents are required because every phase that modifies source code or tests must have at least one implementation and one test-verification delegation. For pure documentation or retrospective phases, these may be waived by the user explicitly.
143
+
144
+ This is a hard enforcement mechanism, not a suggestion. `phase_complete` will not return `status: success` if any required agent is missing from `agentsDispatched`.
145
+
129
146
  CATASTROPHIC VIOLATION CHECK — ask yourself at EVERY phase boundary (MODE: PHASE-WRAP):
130
- "Have I delegated to the active swarm's reviewer agent at least once this phase?"
131
- If the answer is NO: you have a catastrophic process violation.
147
+ "Have I delegated to each of the active swarm's required agents (coder, reviewer, test_engineer, plus docs if required) at least once this phase?"
148
+ If the answer is NO for any of them: you have a catastrophic process violation.
132
149
  STOP. Do not proceed to the next phase. Inform the user:
133
- "⛔ PROCESS VIOLATION: Phase [N] completed with zero reviewer-agent delegations in the active swarm.
134
- All code changes in this phase are unreviewed. Recommend retrospective review before proceeding."
135
- This is not optional. Zero active-swarm reviewer calls in a phase is always a violation.
136
- There is no project where code ships without review.
150
+ "⛔ PROCESS VIOLATION: Phase [N] completed with missing required-agent delegations in the active swarm: [list missing agents].
151
+ All code changes in this phase are unreviewed/untested/undocumented. Recommend retrospective review before proceeding."
152
+ This is not optional. Missing required-agent calls in a phase is always a violation.
153
+ There is no project where code ships without review, tests, and required documentation.
137
154
 
138
155
  ### Blockers
139
156
  Mark [BLOCKED] in plan.md, skip to next unblocked task, inform user.
@@ -134,8 +134,38 @@ tree:
134
134
  filesystem (`Read`/`Glob`/`Grep`), and fixes must land on the PR branch — without a
135
135
  checkout you would verify and patch the base branch's code instead. Record the
136
136
  `base_ref..head_ref` range for diff-scoped inspection.
137
- - If no PR reference was provided (a pasted-feedback session on the current branch),
138
- confirm the current branch is the intended PR branch before editing.
137
+ - If no PR reference was provided (a pasted-feedback session on the current branch),
138
+ confirm the current branch is the intended PR branch before editing.
139
+
140
+ When a verification lane result includes `output_ref`, treat `output` as a
141
+ preview and call `retrieve_lane_output` before using it to classify, resolve,
142
+ disprove, or group feedback items. If the result is `output_degraded`,
143
+ `transcript_incomplete`, or truncated without a usable ref, keep the affected
144
+ ledger items as `NEEDS_MORE_EVIDENCE` or re-dispatch a narrower read-only lane.
145
+
146
+ ## Pre-flight: Dirty Worktree Handling
147
+
148
+ Before staging any files for the PR commit, check the working tree state:
149
+
150
+ **The problem:** `git add -A` stages every uncommitted change in the working tree,
151
+ including pre-existing changes from other branches or prior work. This was hit twice
152
+ in one session during PR #1472 review, producing a 59-file commit instead of the
153
+ intended 2-file targeted fix.
154
+
155
+ **The check:** Run `git status --porcelain` first. If output is non-empty, identify
156
+ which files are PR-related vs pre-existing uncommitted changes.
157
+
158
+ **The rule:** Stage files explicitly by path when the working tree contains files
159
+ unrelated to the PR. For example:
160
+
161
+ ```bash
162
+ git add src/foo.ts tests/foo.test.ts
163
+ ```
164
+
165
+ Never use `git add -A` when the working tree has pre-existing changes from other
166
+ branches or prior work sessions.
167
+
168
+ *Reference: Caught during PR #1472 Round 1 closure.*
139
169
 
140
170
  ## Intake Surfaces
141
171
 
@@ -172,12 +202,6 @@ Missing, stale, cancelled, or failed lanes remain explicit ledger limitations.
172
202
  If `dispatch_lanes_async` is unavailable, use blocking verification and record
173
203
  that async advisory lanes were unavailable.
174
204
 
175
- When a verification lane result includes `output_ref`, treat `output` as a
176
- preview and call `retrieve_lane_output` before using it to classify, resolve,
177
- disprove, or group feedback items. If the result is `output_degraded`,
178
- `transcript_incomplete`, or truncated without a usable ref, keep the affected
179
- ledger items as `NEEDS_MORE_EVIDENCE` or re-dispatch a narrower read-only lane.
180
-
181
205
  ### CI matrix cascade check (do this before fixing)
182
206
 
183
207
  When the PR's `unit` job is a matrix across multiple OSes and downstream jobs
package/README.md CHANGED
@@ -1106,7 +1106,7 @@ Control how tool outputs are summarized for LLM context.
1106
1106
  | `/swarm pr-feedback [<pr-url\|owner/repo#N\|N>] [instructions...]` | Ingest and close known PR feedback (review comments, CI failures, conflicts) without a fresh review |
1107
1107
  | `/swarm pr subscribe <pr-url\|owner/repo#N\|N>` | Subscribe current session to PR monitoring (session-scoped); requires `pr_monitor.enabled: true` |
1108
1108
  | `/swarm pr unsubscribe <pr-url\|owner/repo#N\|N>` | Remove session's subscription to a PR |
1109
- | `/swarm pr status` | List active PR subscriptions for current session with relative timestamps |
1109
+ | `/swarm pr status` | List active PR subscriptions for current session with relative timestamps (the `bunx opencode-swarm run pr status` CLI has no session context, so it lists subscriptions across all sessions) |
1110
1110
  | `/swarm deep-dive <scope> [--profile <name>] [--max-explorers <n>]` | Read-only codebase audit with parallel explorers, dual reviewers, and critic challenge |
1111
1111
  | `/swarm design-docs <description> [--out <dir>] [--lang <name>] [--update]` | Generate or sync language-agnostic design docs (requires `design_docs.enabled`) |
1112
1112
  | `/swarm dark-matter` | Detect hidden file couplings from co-change history |
@@ -1,8 +1,8 @@
1
1
  // @bun
2
2
  import {
3
3
  handleGuardrailExplain
4
- } from "./index-tt5aehrb.js";
5
- import"./index-4td9ef53.js";
4
+ } from "./index-ds057q5k.js";
5
+ import"./index-g6f4tt38.js";
6
6
  import"./index-g00qm2gf.js";
7
7
  import"./index-yhsmmv2z.js";
8
8
  import"./index-32axfg6h.js";
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  handleGuardrailExplain
4
- } from "./index-tt5aehrb.js";
4
+ } from "./index-ds057q5k.js";
5
5
  import {
6
6
  handleGuardrailLog
7
7
  } from "./index-vjsr9bqt.js";
@@ -76,7 +76,7 @@ import {
76
76
  handleWriteRetroCommand,
77
77
  normalizeSwarmCommandInput,
78
78
  resolveCommand
79
- } from "./index-4td9ef53.js";
79
+ } from "./index-g6f4tt38.js";
80
80
  import"./index-g00qm2gf.js";
81
81
  import"./index-yhsmmv2z.js";
82
82
  import"./index-32axfg6h.js";
@@ -12,7 +12,7 @@ import {
12
12
  detectPosixWrites,
13
13
  detectWindowsWrites,
14
14
  resolveWriteTargets
15
- } from "./index-4td9ef53.js";
15
+ } from "./index-g6f4tt38.js";
16
16
  import {
17
17
  checkFileAuthority,
18
18
  classifyFile,
@@ -899,7 +899,7 @@ var init_executor = __esm(() => {
899
899
  // package.json
900
900
  var package_default = {
901
901
  name: "opencode-swarm",
902
- version: "7.88.1",
902
+ version: "7.88.3",
903
903
  description: "Architect-centric agentic swarm plugin for OpenCode - hub-and-spoke orchestration with SME consultation, code generation, and QA review",
904
904
  main: "dist/index.js",
905
905
  types: "dist/index.d.ts",
@@ -22294,31 +22294,35 @@ var _internals34 = {
22294
22294
  formatRelativeTime,
22295
22295
  listActive
22296
22296
  };
22297
- async function handlePrMonitorStatusCommand(directory, _args, sessionID) {
22297
+ async function handlePrMonitorStatusCommand(directory, _args, sessionID, source) {
22298
22298
  const allActive = await _internals34.listActive(directory);
22299
- const sessionSubs = allActive.filter((record) => record.sessionID === sessionID);
22300
- if (sessionSubs.length === 0) {
22301
- return "No active PR subscriptions for this session.";
22299
+ const allSessions = source === "cli";
22300
+ const subs = allSessions ? allActive : allActive.filter((record) => record.sessionID === sessionID);
22301
+ if (subs.length === 0) {
22302
+ return allSessions ? "No active PR subscriptions." : "No active PR subscriptions for this session.";
22302
22303
  }
22303
22304
  const lines = [];
22304
- lines.push(`PR Monitor Status \u2014 Session: ${sessionID}`);
22305
+ lines.push(allSessions ? "PR Monitor Status \u2014 all sessions" : `PR Monitor Status \u2014 Session: ${sessionID}`);
22305
22306
  lines.push("");
22306
22307
  const totalActive = allActive.length;
22307
- lines.push(`Active subscriptions (${sessionSubs.length}):`);
22308
- for (let i = 0;i < sessionSubs.length; i++) {
22309
- const sub = sessionSubs[i];
22308
+ lines.push(`Active subscriptions (${subs.length}):`);
22309
+ for (let i = 0;i < subs.length; i++) {
22310
+ const sub = subs[i];
22310
22311
  const index = i + 1;
22311
22312
  lines.push(` ${index}. ${sub.repoFullName}#${sub.prNumber}`);
22312
22313
  lines.push(` URL: ${sub.prUrl}`);
22314
+ if (allSessions) {
22315
+ lines.push(` Session: ${sub.sessionID}`);
22316
+ }
22313
22317
  lines.push(` Last checked: ${formatRelativeTime(sub.lastCheckedAt)}`);
22314
22318
  lines.push(` Watching: ${sub.isWatching ? "yes" : "no"}`);
22315
22319
  lines.push(` Errors: ${sub.errorCount}`);
22316
- if (i < sessionSubs.length - 1) {
22320
+ if (i < subs.length - 1) {
22317
22321
  lines.push("");
22318
22322
  }
22319
22323
  }
22320
22324
  lines.push("");
22321
- if (totalActive !== sessionSubs.length) {
22325
+ if (!allSessions && totalActive !== subs.length) {
22322
22326
  lines.push(`Total active across all sessions: ${totalActive}`);
22323
22327
  }
22324
22328
  return lines.join(`
@@ -22415,6 +22419,15 @@ async function handlePrSubscribeCommand(directory, args, sessionID) {
22415
22419
  "Expected: full GitHub URL, owner/repo#N shorthand,",
22416
22420
  "or a bare PR number (resolved against origin)."
22417
22421
  ].join(`
22422
+ `);
22423
+ }
22424
+ if (!sessionID || sessionID.trim() === "") {
22425
+ return [
22426
+ "Error: Cannot subscribe \u2014 no active session.",
22427
+ "",
22428
+ "PR subscriptions are session-scoped and require a live OpenCode session.",
22429
+ "Subscribe from inside OpenCode; the bunx CLI has no session context."
22430
+ ].join(`
22418
22431
  `);
22419
22432
  }
22420
22433
  const repoFullName = `${prInfo.owner}/${prInfo.repo}`;
@@ -29921,7 +29934,7 @@ function buildDetailedHelp(commandName, entry) {
29921
29934
  async function handleHelpCommand(ctx) {
29922
29935
  const targetCommand = ctx.args.join(" ");
29923
29936
  if (!targetCommand) {
29924
- const { buildHelpText } = await import("./index-sr7g2msm.js");
29937
+ const { buildHelpText } = await import("./index-0rt5aamg.js");
29925
29938
  return buildHelpText();
29926
29939
  }
29927
29940
  const tokens = targetCommand.split(/\s+/);
@@ -29930,7 +29943,7 @@ async function handleHelpCommand(ctx) {
29930
29943
  return _internals45.buildDetailedHelp(resolved.key, resolved.entry);
29931
29944
  }
29932
29945
  const similar = _internals45.findSimilarCommands(targetCommand);
29933
- const { buildHelpText: fullHelp } = await import("./index-sr7g2msm.js");
29946
+ const { buildHelpText: fullHelp } = await import("./index-0rt5aamg.js");
29934
29947
  if (similar.length > 0) {
29935
29948
  return `Command '/swarm ${targetCommand}' not found.
29936
29949
 
@@ -30063,7 +30076,7 @@ var COMMAND_REGISTRY = {
30063
30076
  },
30064
30077
  "guardrail explain": {
30065
30078
  handler: async (ctx) => {
30066
- const { handleGuardrailExplain } = await import("./guardrail-explain-995zavv8.js");
30079
+ const { handleGuardrailExplain } = await import("./guardrail-explain-eqypvw60.js");
30067
30080
  return handleGuardrailExplain(ctx.directory, ctx.args);
30068
30081
  },
30069
30082
  description: "Dry-run: show what the guardrails would do to a command or write target (executes nothing)",
@@ -30436,7 +30449,7 @@ Subcommands:
30436
30449
  deprecated: true
30437
30450
  },
30438
30451
  "pr status": {
30439
- handler: (ctx) => handlePrMonitorStatusCommand(ctx.directory, ctx.args, ctx.sessionID),
30452
+ handler: (ctx) => handlePrMonitorStatusCommand(ctx.directory, ctx.args, ctx.sessionID, ctx.source),
30440
30453
  description: "Show PR monitor subscription status for the current session",
30441
30454
  args: "",
30442
30455
  details: "Displays all active PR subscriptions for the current session. Shows PR URL, last checked time, watching status, and error count per subscription. Also shows total active subscriptions across all sessions.",
@@ -30445,7 +30458,7 @@ Subcommands:
30445
30458
  toolNoArgs: true
30446
30459
  },
30447
30460
  "pr-status": {
30448
- handler: (ctx) => handlePrMonitorStatusCommand(ctx.directory, ctx.args, ctx.sessionID),
30461
+ handler: (ctx) => handlePrMonitorStatusCommand(ctx.directory, ctx.args, ctx.sessionID, ctx.source),
30449
30462
  description: "Show PR monitor subscription status for the current session",
30450
30463
  aliasOf: "pr status",
30451
30464
  deprecated: true
package/dist/cli/index.js CHANGED
@@ -7,7 +7,7 @@ import {
7
7
  getPluginLockFilePaths,
8
8
  package_default,
9
9
  resolveCommand
10
- } from "./index-4td9ef53.js";
10
+ } from "./index-g6f4tt38.js";
11
11
  import"./index-g00qm2gf.js";
12
12
  import"./index-yhsmmv2z.js";
13
13
  import"./index-32axfg6h.js";
@@ -32,5 +32,5 @@ export declare const _internals: {
32
32
  * time, watching status, and error count. Appends a cross-session
33
33
  * total at the end.
34
34
  */
35
- export declare function handlePrMonitorStatusCommand(directory: string, _args: string[], sessionID: string): Promise<string>;
35
+ export declare function handlePrMonitorStatusCommand(directory: string, _args: string[], sessionID: string, source?: 'cli' | 'chat'): Promise<string>;
36
36
  export {};
package/dist/index.js CHANGED
@@ -69,7 +69,7 @@ var package_default;
69
69
  var init_package = __esm(() => {
70
70
  package_default = {
71
71
  name: "opencode-swarm",
72
- version: "7.88.1",
72
+ version: "7.88.3",
73
73
  description: "Architect-centric agentic swarm plugin for OpenCode - hub-and-spoke orchestration with SME consultation, code generation, and QA review",
74
74
  main: "dist/index.js",
75
75
  types: "dist/index.d.ts",
@@ -87852,31 +87852,35 @@ function formatRelativeTime(epochMs) {
87852
87852
  const diffDays = Math.floor(diffHours / 24);
87853
87853
  return `${diffDays} day${diffDays === 1 ? "" : "s"} ago`;
87854
87854
  }
87855
- async function handlePrMonitorStatusCommand(directory, _args, sessionID) {
87855
+ async function handlePrMonitorStatusCommand(directory, _args, sessionID, source) {
87856
87856
  const allActive = await _internals55.listActive(directory);
87857
- const sessionSubs = allActive.filter((record3) => record3.sessionID === sessionID);
87858
- if (sessionSubs.length === 0) {
87859
- return "No active PR subscriptions for this session.";
87857
+ const allSessions = source === "cli";
87858
+ const subs = allSessions ? allActive : allActive.filter((record3) => record3.sessionID === sessionID);
87859
+ if (subs.length === 0) {
87860
+ return allSessions ? "No active PR subscriptions." : "No active PR subscriptions for this session.";
87860
87861
  }
87861
87862
  const lines = [];
87862
- lines.push(`PR Monitor Status — Session: ${sessionID}`);
87863
+ lines.push(allSessions ? "PR Monitor Status — all sessions" : `PR Monitor Status — Session: ${sessionID}`);
87863
87864
  lines.push("");
87864
87865
  const totalActive = allActive.length;
87865
- lines.push(`Active subscriptions (${sessionSubs.length}):`);
87866
- for (let i2 = 0;i2 < sessionSubs.length; i2++) {
87867
- const sub = sessionSubs[i2];
87866
+ lines.push(`Active subscriptions (${subs.length}):`);
87867
+ for (let i2 = 0;i2 < subs.length; i2++) {
87868
+ const sub = subs[i2];
87868
87869
  const index = i2 + 1;
87869
87870
  lines.push(` ${index}. ${sub.repoFullName}#${sub.prNumber}`);
87870
87871
  lines.push(` URL: ${sub.prUrl}`);
87872
+ if (allSessions) {
87873
+ lines.push(` Session: ${sub.sessionID}`);
87874
+ }
87871
87875
  lines.push(` Last checked: ${formatRelativeTime(sub.lastCheckedAt)}`);
87872
87876
  lines.push(` Watching: ${sub.isWatching ? "yes" : "no"}`);
87873
87877
  lines.push(` Errors: ${sub.errorCount}`);
87874
- if (i2 < sessionSubs.length - 1) {
87878
+ if (i2 < subs.length - 1) {
87875
87879
  lines.push("");
87876
87880
  }
87877
87881
  }
87878
87882
  lines.push("");
87879
- if (totalActive !== sessionSubs.length) {
87883
+ if (!allSessions && totalActive !== subs.length) {
87880
87884
  lines.push(`Total active across all sessions: ${totalActive}`);
87881
87885
  }
87882
87886
  return lines.join(`
@@ -87985,6 +87989,15 @@ async function handlePrSubscribeCommand(directory, args2, sessionID) {
87985
87989
  "Expected: full GitHub URL, owner/repo#N shorthand,",
87986
87990
  "or a bare PR number (resolved against origin)."
87987
87991
  ].join(`
87992
+ `);
87993
+ }
87994
+ if (!sessionID || sessionID.trim() === "") {
87995
+ return [
87996
+ "Error: Cannot subscribe — no active session.",
87997
+ "",
87998
+ "PR subscriptions are session-scoped and require a live OpenCode session.",
87999
+ "Subscribe from inside OpenCode; the bunx CLI has no session context."
88000
+ ].join(`
87988
88001
  `);
87989
88002
  }
87990
88003
  const repoFullName = `${prInfo.owner}/${prInfo.repo}`;
@@ -99394,7 +99407,7 @@ Subcommands:
99394
99407
  deprecated: true
99395
99408
  },
99396
99409
  "pr status": {
99397
- handler: (ctx) => handlePrMonitorStatusCommand(ctx.directory, ctx.args, ctx.sessionID),
99410
+ handler: (ctx) => handlePrMonitorStatusCommand(ctx.directory, ctx.args, ctx.sessionID, ctx.source),
99398
99411
  description: "Show PR monitor subscription status for the current session",
99399
99412
  args: "",
99400
99413
  details: "Displays all active PR subscriptions for the current session. Shows PR URL, last checked time, watching status, and error count per subscription. Also shows total active subscriptions across all sessions.",
@@ -99403,7 +99416,7 @@ Subcommands:
99403
99416
  toolNoArgs: true
99404
99417
  },
99405
99418
  "pr-status": {
99406
- handler: (ctx) => handlePrMonitorStatusCommand(ctx.directory, ctx.args, ctx.sessionID),
99419
+ handler: (ctx) => handlePrMonitorStatusCommand(ctx.directory, ctx.args, ctx.sessionID, ctx.source),
99407
99420
  description: "Show PR monitor subscription status for the current session",
99408
99421
  aliasOf: "pr status",
99409
99422
  deprecated: true
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-swarm",
3
- "version": "7.88.1",
3
+ "version": "7.88.3",
4
4
  "description": "Architect-centric agentic swarm plugin for OpenCode - hub-and-spoke orchestration with SME consultation, code generation, and QA review",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",