opencode-swarm 7.126.6 → 7.127.1

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 (27) hide show
  1. package/.opencode/skills/issue-tracer/SKILL.md +7 -6
  2. package/.opencode/skills/issue-tracer/references/install.md +5 -3
  3. package/.opencode/skills/swarm-pr-feedback/SKILL.md +87 -13
  4. package/.opencode/skills/swarm-pr-review/SKILL.md +313 -109
  5. package/.opencode/skills/swarm-pr-review/references/parser-dry-run.md +5 -3
  6. package/.opencode/skills/swarm-pr-review/references/prompt-templates.md +5 -5
  7. package/dist/background/candidate-parser.d.ts +1 -0
  8. package/dist/background/pending-delegations.d.ts +7 -0
  9. package/dist/background/workspace-snapshot.d.ts +20 -0
  10. package/dist/cli/{curator-llm-factory-ffseqhr4.js → curator-llm-factory-4t2h2p60.js} +3 -3
  11. package/dist/cli/{curator-zmff7bha.js → curator-qqd1fvvg.js} +3 -3
  12. package/dist/cli/{guardrail-explain-n4eyw2ak.js → guardrail-explain-4yg67c3t.js} +4 -4
  13. package/dist/cli/{hive-promoter-s60fcnq0.js → hive-promoter-14jh86kj.js} +3 -3
  14. package/dist/cli/{index-mg54y5gc.js → index-40zn444p.js} +38 -1
  15. package/dist/cli/{index-w3q49fy4.js → index-8cnpsbk5.js} +1 -1
  16. package/dist/cli/{index-8exjgmrz.js → index-bn3w6ym4.js} +49 -24
  17. package/dist/cli/{index-0cz1ws47.js → index-ecxwhwz7.js} +2 -0
  18. package/dist/cli/{index-p3cksay8.js → index-pbw1ncre.js} +4 -4
  19. package/dist/cli/index.js +3 -3
  20. package/dist/cli/{pending-delegations-7j8xqg5f.js → pending-delegations-a1bbpp8b.js} +1 -1
  21. package/dist/cli/{workspace-snapshot-c9pxxt9a.js → workspace-snapshot-aa0ggevw.js} +3 -1
  22. package/dist/commands/registry.d.ts +1 -1
  23. package/dist/hooks/pr-workflow-gate.d.ts +45 -1
  24. package/dist/hooks/pr-workflow-response-gate.d.ts +7 -5
  25. package/dist/index.js +22 -17
  26. package/dist/tools/dispatch-lanes.d.ts +5 -0
  27. package/package.json +1 -1
@@ -4,7 +4,7 @@ audience: swarm-plugin
4
4
  description: Evidence-first investigation and full resolution of issues and bugs. Use when asked to investigate, trace, root-cause, reproduce, plan, fix, resolve, close, or prepare a PR for an issue, bug report, defect, regression, failing test, crash, or confusing runtime behavior. Drives intake, reproduction, reasoning-guided localization, no-gap fix planning, independent critic and implementation review, recurrence-class eradication, and invariant-aware PR-ready closure under a mandatory full-resolution contract that forbids partial fixes, deferred work, and unwired code.
5
5
  license: MIT
6
6
  metadata:
7
- version: 2.0.0
7
+ version: 2.1.0
8
8
  source: .opencode/skills/issue-tracer/SKILL.md
9
9
  ---
10
10
 
@@ -48,11 +48,11 @@ This skill is agent-neutral. Wherever the protocol says "your file-edit tool", "
48
48
  |---|---|---|---|---|
49
49
  | OpenCode | `edit`, `write` | `todowrite` | `webfetch` | `task` / lane dispatch |
50
50
  | Claude Code | `Edit`, `Write`, `MultiEdit` | `TodoWrite` | `WebFetch`, `WebSearch` | `Agent` / `Task` |
51
- | OpenAI Codex | `apply_patch` | `update_plan` | `web` | not available in-session |
52
- | ZCode | `apply_patch` | `update_plan` | `web` | not available in-session |
53
- | GitHub coding agent | `edit` (native commit) | built-in task list | `web` | not available in-session |
51
+ | OpenAI Codex | `apply_patch` | `update_plan` | `web` | native subagent dispatch (fresh context) |
52
+ | ZCode | `apply_patch` | `update_plan` | `web` | native subagent dispatch (fresh context) |
53
+ | GitHub coding agent | `edit` (native commit) | built-in task list | `web` | native subagent dispatch (fresh context) |
54
54
 
55
- Fill each cell from your own current tool docs (see `references/install.md` for per-agent details and the rationale behind each row). "Not available in-session" means the agent cannot spawn an independent subagent; use the fallback self-review/self-critic passes (Phase 4.5 / 4.6) and disclose the limitation. Any agent without a plan/tasklist tool keeps the phase checklist inline in its working notes.
55
+ Fill each cell from your own current tool docs (see `references/install.md` for per-agent details and the rationale behind each row). Every listed agent currently exposes fresh-context subagent dispatch — treat the subagent column as capability-first: detect availability from the session's actual tool list, never from the agent's name. A restricted session on any harness may genuinely lack a subagent mechanism; only then do the fallback self-review/self-critic passes (Phase 4.5 / 4.6) apply, with the limitation disclosed. Any agent without a plan/tasklist tool keeps the phase checklist inline in its working notes.
56
56
 
57
57
  ## Source Policy
58
58
 
@@ -155,6 +155,7 @@ Read the relevant reference before starting that phase:
155
155
  3. If the worktree has unrelated user changes, do not overwrite them. Continue read-only until you can isolate your changes or ask the user.
156
156
  4. Run `.opencode/skills/issue-tracer/scripts/trace-init.sh <issue-slug>` (from the repo root) to create the trace directory and its exclusion, and initialize `state.md` (or the compact inline trail).
157
157
  5. Build a phase checklist with your plan/tasklist tool (or inline). Mark only one step in progress at a time, and mark steps complete only after gate verification.
158
+ 6. Scale investigation and review depth to change size and risk, mirroring the S/M/L depth-tier model of the sibling swarm PR skills: trivial low-risk fixes take the lighter paths already marked in this protocol (Phase 2 item 7's single pass, Phase 3 item 1's reduced candidate bar), while risk triggers — auth/identity/secrets, untrusted input, subprocess/filesystem execution, concurrency/state, dependencies/build/release, schema/migrations, payments or PII, generated artifacts — always take the deeper passes regardless of diff size. Depth scaling never waives a phase gate.
158
159
 
159
160
  ### Phase 0 Gate
160
161
 
@@ -180,7 +181,7 @@ Proceed only when one is true: the issue is reproduced with exact failing output
180
181
  Goal: isolate the root cause to the narrowest truthful granularity: file, symbol, line range, invariant, and triggering input. Use `references/localization-playbook.md`.
181
182
 
182
183
  1. Build candidate locations from issue evidence: stack traces and error text, failing test names, UI route/API endpoint/CLI command names, labels and linked PRs, recent commits touching related areas.
183
- 2. Search and read in parallel where possible: search for symbols, routes, commands, strings, errors, config keys; confirm against tracked files; use `git log`/`git blame` where useful.
184
+ 2. Search and read in parallel where possible: search for symbols, routes, commands, strings, errors, config keys; confirm against tracked files; use `git log`/`git blame` where useful. When the candidate surface is broad or ambiguous, fan out to independent fresh-context explorer subagents with disjoint scopes — 1–2 for a trivial surface, 3–5 for a typical one, more only for genuinely multi-module scopes. Explorers return candidate locations with file:line evidence, never verdicts; their candidates enter the same ranking and bug-specific-explanation bar as your own.
184
185
  3. Use reasoning-guided hierarchical localization — file → element (function/class/handler/config) → line/condition.
185
186
  4. Maintain `03-localization-log.md`: every hypothesis, files read and why, commands run and results, evidence for and against, ruled-out paths.
186
187
  5. Follow call chains in both directions — from input/event to failure, and from failure back to origin — through config, serialization, async boundaries, state transitions, and feature flags.
@@ -14,11 +14,11 @@ The canonical version is the `metadata.version` field in the canonical `SKILL.md
14
14
  | ZCode | `.agents/skills/issue-tracer/SKILL.md` | adapter shim → canonical |
15
15
  | GitHub coding agent | repo-root `AGENTS.md` pointer | canonical |
16
16
 
17
- The adapter shims are one-line pointers to `../../../.opencode/skills/issue-tracer/SKILL.md`; they carry no protocol of their own, so a project checkout always executes a single canonical body.
17
+ The adapter shims point to `../../../.opencode/skills/issue-tracer/SKILL.md` as the canonical workflow and add only short per-agent execution notes (tool bindings, fallback labels, publish routing); the protocol itself lives in the single canonical body, so a project checkout always executes one protocol.
18
18
 
19
19
  ### Agent Adapter table — how each row was filled
20
20
 
21
- The canonical SKILL.md's Agent Adapter table maps each capability to a concrete tool per agent. Those rows were filled from each agent's current tool surface: OpenCode (`edit`/`write`, `todowrite`, `webfetch`, `task`), Claude Code (`Edit`/`Write`/`MultiEdit`, `TodoWrite`, `WebFetch`/`WebSearch`, `Agent`/`Task`), OpenAI Codex (`apply_patch`, `update_plan`, `web`), and the GitHub coding agent (`edit`, built-in task list, `web`). **ZCode** is mapped to the Codex-native tool surface (`apply_patch`/`update_plan`/`web`) because it is a Codex-family CLI that shares the project-level `.agents/skills/` discovery tree with Codex; if your ZCode build exposes different tool names, treat the table as capability-first and substitute your build's names.
21
+ The canonical SKILL.md's Agent Adapter table maps each capability to a concrete tool per agent. Those rows were filled from each agent's current tool surface: OpenCode (`edit`/`write`, `todowrite`, `webfetch`, `task`), Claude Code (`Edit`/`Write`/`MultiEdit`, `TodoWrite`, `WebFetch`/`WebSearch`, `Agent`/`Task`), OpenAI Codex (`apply_patch`, `update_plan`, `web`, plus native fresh-context subagent dispatch), and the GitHub coding agent (`edit`, built-in task list, `web`, plus native fresh-context subagent dispatch). **ZCode** is mapped to the Codex-native tool surface (`apply_patch`/`update_plan`/`web`, plus native fresh-context subagent dispatch) because it is a Codex-family CLI that shares the project-level `.agents/skills/` discovery tree with Codex; if your ZCode build exposes different tool names, treat the table as capability-first and substitute your build's names.
22
22
 
23
23
  ## User-level installs can SHADOW the project copy
24
24
 
@@ -60,4 +60,6 @@ diff <(grep 'version:' ~/.codex/skills/issue-tracer/SKILL.md 2>/dev/null || echo
60
60
 
61
61
  The safest default is to keep no user-level `issue-tracer` copy at all and let each project ship its own canonical, so version drift cannot occur. If you do keep a user-level copy, reconcile it whenever the project canonical's `metadata.version` changes.
62
62
 
63
- GitHub coding agents load the repository's checked-in `AGENTS.md` and `.opencode/skills/issue-tracer/SKILL.md` directly, with no user-level home directory, so shadowing does not apply to that surface.
63
+ Maintainer rule: bump `metadata.version` (canonical SKILL.md plus both adapter shims, in lockstep) in the same changeset as any canonical content edit — the stamp is the only reconciliation signal user-level copies have, and an unbumped edit silently defeats it.
64
+
65
+ GitHub coding agents load the repository's checked-in `AGENTS.md` and `.opencode/skills/issue-tracer/SKILL.md` directly, with no user-level home directory, so shadowing does not apply to that surface; their sessions can spawn fresh-context subagents, so the independent critic/review gates run as the preferred path there too.
@@ -123,6 +123,35 @@ Do not act on review-discovered findings from a prior `swarm-pr-review` run
123
123
  unless the user has explicitly approved the transition into `swarm-pr-feedback`.
124
124
  The handoff artifact is triage input, not standing authorization to change code.
125
125
 
126
+ ## Runtime Capability Profiles
127
+
128
+ This skill runs on any agent harness. Detect the active profile from the
129
+ actual tool list before triage — the same three profiles defined in
130
+ `../swarm-pr-review/SKILL.md` (Runtime Capability Profiles):
131
+
132
+ - **Profile A — mechanical PR-feedback controller.** The plugin's tools are
133
+ present in this session: `dispatch_lanes_async`, `collect_lane_results`,
134
+ `retrieve_lane_output`, `prepare_pr_feedback_scope`,
135
+ `run_pr_feedback_stage_a`, `complete_pr_workflow`. The controller's
136
+ fail-closed accounting (immutable inventory, ordered gate lanes, content
137
+ digests, arming, bound push) is authoritative; bypassing it — direct
138
+ subagent calls, blocking dispatch, prose verdicts — is BLOCKED while it is
139
+ active.
140
+ - **Profile B — native parallel subagents, no controller.** Run the same
141
+ intake → verify → fix → gate → publish discipline using your harness's
142
+ subagent tool for verification lanes and gate roles; you maintain the
143
+ ledger, the ownership partition, and the digest accounting yourself in
144
+ session/task workspace files (never under `.swarm/`, which belongs to the
145
+ plugin runtime).
146
+ - **Profile C — single context, no subagents.** Same discipline as strictly
147
+ separated sequential passes that re-derive rather than restate earlier
148
+ reasoning, plus explicit disclosure in the closure ledger that gate
149
+ independence was procedural.
150
+
151
+ Controller-tool absence is NOT a blocker; Profiles B and C are first-class
152
+ execution paths. BLOCKED is reserved for bypassing an active controller and
153
+ for verification or coverage gaps that stay unclosable after bounded retries.
154
+
126
155
  ## Pre-flight: Check Out the PR Branch Locally
127
156
 
128
157
  Before verifying any claim or making any fix, ensure the PR branch is the working
@@ -141,9 +170,11 @@ tree:
141
170
  Abort your rebase, take the remote state, then add minor improvements on top.
142
171
  - Verify the working tree is clean first (`git status --porcelain`). If tracked
143
172
  changes exist, call `prepare_pr_workflow_checkout` with every explicit dirty
144
- tracked path. It creates an auditable, path-scoped stash and returns its
173
+ tracked path (Profile A). It creates an auditable, path-scoped stash and returns its
145
174
  recovery command. Do not issue `git stash` through shell. The controller never
146
175
  stashes untracked files; move or remove those manually, or abort the checkout.
176
+ Without the controller, surface dirty tracked state to the user or abort the
177
+ checkout — do not blind-stash.
147
178
  - **Check out the head branch locally before dispatching feedback lanes.** Feedback verification reads the working-tree
148
179
  filesystem (`Read`/`Glob`/`Grep`), and fixes must land on the PR branch — without a
149
180
  checkout you would verify and patch the base branch's code instead. Record the
@@ -174,6 +205,9 @@ preview and call `retrieve_lane_output` before using it to classify, resolve,
174
205
  disprove, or group feedback items. If the result is `output_degraded`,
175
206
  `transcript_incomplete`, or truncated without a usable ref, keep the affected
176
207
  ledger items as `NEEDS_MORE_EVIDENCE` or re-dispatch a narrower read-only lane.
208
+ (Profile A. On Profiles B/C, read each verification subagent's or pass's full
209
+ report directly — a truncated or summary-only report is a preview, not
210
+ verification evidence, and keeps its items open the same way.)
177
211
 
178
212
  ## Pre-flight: Dirty Worktree Handling
179
213
 
@@ -253,7 +287,8 @@ If a source is unavailable, retry with alternative access paths. If unavailable
253
287
 
254
288
  ### Async advisory verification lanes
255
289
 
256
- After the complete feedback ledger exists and before editing, use
290
+ After the complete feedback ledger exists and before editing, run independent
291
+ read-only verification lanes. Under Profile A, use
257
292
  `dispatch_lanes_async` with `mode: "swarm-pr-feedback:verification"`, the
258
293
  complete immutable `feedback_inventory` ID list, the exact current
259
294
  `pr_head_sha`, and each lane's exact
@@ -298,12 +333,21 @@ COVERAGE GATE:
298
333
  retry failed lanes (max 2) as another
299
334
  `swarm-pr-feedback:verification` async batch with the same immutable inventory,
300
335
  exact `pr_head_sha`, agent type, prompt, scope, and isolation, or stop and
301
- surface the lane failure to the user as BLOCKED. Blocking and direct-Task
302
- fallbacks are rejected because they cannot satisfy the durable ownership and
303
- head-provenance gate.
336
+ surface the lane failure to the user as BLOCKED. Under Profile A, blocking and
337
+ direct-Task fallbacks are rejected because they cannot satisfy the durable
338
+ ownership and head-provenance gate.
304
339
  Do not proceed with "blocking verification and record that async advisory lanes
305
340
  were unavailable" — record-and-continue is not coverage closure.
306
341
 
342
+ Under Profile B, partition the same immutable inventory across fresh read-only
343
+ verification subagents — every `FB-###` item owned by exactly one lane and the
344
+ union of lanes covering the entire ledger — with each prompt stating its owned
345
+ IDs and the exact `pr_head_sha`, and each lane returning one
346
+ `[FEEDBACK-VERIFIED]` row per owned item. Under Profile C, verify the ledger
347
+ in sequential category passes with the same one-row-per-item contract. On
348
+ every profile, no item may be classified until its verification lane or pass
349
+ has settled, and unclosable verification gaps are surfaced as BLOCKED.
350
+
307
351
  ### CI matrix cascade check (do this before fixing)
308
352
 
309
353
  When the PR's `unit` job is a matrix across multiple OSes and downstream jobs
@@ -506,9 +550,9 @@ pre-checks; Stage B = `reviewer` + `test_engineer` per-task gates (consistent
506
550
  with `execute`, `plan`, `specify`, `brainstorm`, `docs/swarm-briefing.md`, and
507
551
  `docs/council/README.md`).
508
552
 
509
- **Mechanical controller contract.** Prose acknowledgements, direct `Task` calls,
553
+ **Mechanical controller contract (Profile A).** Prose acknowledgements, direct `Task` calls,
510
554
  blocking dispatch, reused conversations, and free-form `APPROVE`/`PASS` text do
511
- not satisfy these gates. The durable controller requires this exact sequence on
555
+ not satisfy these gates while the controller is active. The durable controller requires this exact sequence on
512
556
  one content digest:
513
557
 
514
558
  Controller authority follows the parent/child session ancestry. Coder and
@@ -564,6 +608,23 @@ immutable intake head, so zero commits, multiple commits, merge commits,
564
608
  amend/non-descendant histories,
565
609
  `--allow-empty`, and partially committed reviewed content fail closed. There is no speed, efficiency, token, or time exception.
566
610
 
611
+ **Without the controller (Profiles B/C).** The same gates run in the same
612
+ order with the same one-row-per-feedback-ID verdict contracts; what changes is
613
+ the executor. Stage A: run the repository's discovered build, typecheck, and
614
+ lint/format obligations, exact `git diff --check`, and one targeted
615
+ reproduction/regression command yourself, recording each command and its
616
+ output as a receipt in the ledger; track the content digest manually (for
617
+ example `git rev-parse HEAD` plus a working-tree diff hash) so stale receipts
618
+ are detectable, and re-run the whole set after any content change. Stage B:
619
+ one fresh reviewer subagent, then one fresh test-engineer-role subagent
620
+ (Profile B), or two strictly separated re-derivation passes (Profile C).
621
+ Closeout: a separate fresh reviewer, then a separate fresh critic, per the
622
+ swarm closeout contract. Emit the same `[STAGE-B-REVIEW]`, `[STAGE-B-TEST]`,
623
+ `[CLOSEOUT-REVIEW]`, and `[CLOSEOUT-CRITIC]` rows, record the verdicts in the
624
+ session task-gates artifact, and disclose Profile C's procedural independence
625
+ in the closure ledger. Any edit after a gate verdict invalidates that verdict
626
+ and every later one; restart at Stage A.
627
+
567
628
  If a gate failure is suspected pre-existing, prove it on the base branch or
568
629
  label it `UNVERIFIED`. Do not call the branch green while required checks are
569
630
  non-green.
@@ -688,7 +749,8 @@ pre-checks and must not be folded into Stage A.
688
749
  ## Publishing And Communication
689
750
 
690
751
  After every ordered local gate passes on one unchanged content digest, create
691
- the reviewed commit with one standalone `git commit` command. Then call
752
+ the reviewed commit with one standalone `git commit` command. Under Profile A,
753
+ then call
692
754
  `complete_pr_workflow` once with `mode: "PR_FEEDBACK"` and the immutable intake
693
755
  `pr_head_sha`. A `ready-to-publish` result arms publication but deliberately
694
756
  keeps the durable gate active and binds that post-commit HEAD to the current
@@ -713,6 +775,12 @@ branch; a locally forged or fetched tracking ref is never publication proof.
713
775
  The gate clears only after both observations agree, before any PR
714
776
  comment/body/thread write.
715
777
 
778
+ Under Profiles B/C, the same publication invariants apply procedurally: one
779
+ reviewed commit on the PR branch, a single non-force push of exactly that
780
+ commit to the PR head branch through the repository's normal workflow, then
781
+ read-only verification that the actual remote head equals the pushed commit
782
+ before any PR comment/body/thread write.
783
+
716
784
  Commits and pushes follow the repository's commit/PR workflow (for example
717
785
  `file:.swarm/bundled-skills/commit-pr/SKILL.md` when that bundled workflow is
718
786
  available) — do not push ad-hoc.
@@ -735,18 +803,23 @@ head, and record the exact evidence used.
735
803
 
736
804
  ## Final Output
737
805
 
738
- Before emitting the user-facing final response, call `complete_pr_workflow` a
806
+ Under Profile A, before emitting the user-facing final response, call
807
+ `complete_pr_workflow` a
739
808
  second time with the same mode and immutable verification `pr_head_sha`. The
740
809
  tool clears the durable session gate only when the content digest still equals
741
810
  the independently approved digest, the exact approved commit remains current,
742
811
  its bound upstream remote-tracking ref points to that exact commit, every
743
812
  feedback ID has exact-provenance evidence, and no PR-workflow lanes remain
744
- open. While the gate remains active, the runtime replaces architect
745
- final-response text with a mechanical blocked notice and normally re-wakes an
813
+ open. While the gate remains active, the runtime prepends a workflow-active
814
+ banner to architect text (the model's text is preserved below it) and normally re-wakes an
746
815
  idle parent session. A user interruption pauses automatic wakes until a later
747
816
  explicit user turn settles; the durable gate remains available to continue or
748
817
  abort.
749
818
 
819
+ Under Profiles B/C, no mechanical gate exists: emit the final response only
820
+ after the closure ledger accounts for every original item and the pushed
821
+ remote head has been verified read-only.
822
+
750
823
  Report:
751
824
 
752
825
  - intake sources checked and unavailable sources,
@@ -759,7 +832,7 @@ Report:
759
832
 
760
833
  End with a complete ledger mapping every original item to its outcome.
761
834
 
762
- ## Aborting an unrecoverable feedback workflow (pre-armed only)
835
+ ## Aborting an unrecoverable feedback workflow (Profile A, pre-armed only)
763
836
 
764
837
  If the verification bind is genuinely unreachable (the PR head cannot be
765
838
  fetched or checked out, or a compound `git fetch … && git checkout …` keeps
@@ -772,4 +845,5 @@ arming you MUST complete via `complete_pr_workflow` (or push the bound
772
845
  commit first), because aborting an armed gate would drop the immutable-
773
846
  commit binding and leave a half-published commit. The user can also run
774
847
  `/swarm abort-pr-workflow` once the wake budget suspends. Abort is a
775
- recovery tool, not a gate-skip shortcut.
848
+ recovery tool, not a gate-skip shortcut. On Profiles B/C there is no durable
849
+ gate to abort: report the blocker to the user and stop.