opencode-swarm 7.196.0 → 7.197.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 (126) hide show
  1. package/.opencode/skills/brainstorm/SKILL.md +2 -1
  2. package/.opencode/skills/ci-failure-batching/SKILL.md +2 -1
  3. package/.opencode/skills/ci-fix-monitor/SKILL.md +2 -1
  4. package/.opencode/skills/clarify/SKILL.md +2 -1
  5. package/.opencode/skills/clarify-spec/SKILL.md +2 -1
  6. package/.opencode/skills/codebase-review-swarm/SKILL.md +1 -1
  7. package/.opencode/skills/commit-pr/SKILL.md +3 -2
  8. package/.opencode/skills/consult/SKILL.md +2 -1
  9. package/.opencode/skills/council/SKILL.md +2 -1
  10. package/.opencode/skills/critic-gate/SKILL.md +2 -1
  11. package/.opencode/skills/deep-dive/SKILL.md +2 -1
  12. package/.opencode/skills/deep-research/SKILL.md +2 -1
  13. package/.opencode/skills/design-docs/SKILL.md +2 -1
  14. package/.opencode/skills/discover/SKILL.md +2 -1
  15. package/.opencode/skills/durable-session-state/SKILL.md +2 -1
  16. package/.opencode/skills/engineering-conventions/SKILL.md +2 -1
  17. package/.opencode/skills/execute/SKILL.md +2 -1
  18. package/.opencode/skills/fork-pr-operations/SKILL.md +2 -1
  19. package/.opencode/skills/gate-attribution/SKILL.md +2 -1
  20. package/.opencode/skills/issue-ingest/SKILL.md +2 -1
  21. package/.opencode/skills/issue-tracer/SKILL.md +1 -1
  22. package/.opencode/skills/loop/SKILL.md +2 -1
  23. package/.opencode/skills/merge-queue-readiness/SKILL.md +2 -1
  24. package/.opencode/skills/orchestrating-subagents/SKILL.md +2 -1
  25. package/.opencode/skills/parallel-work-check/SKILL.md +17 -16
  26. package/.opencode/skills/phase-wrap/SKILL.md +2 -1
  27. package/.opencode/skills/pre-phase-briefing/SKILL.md +2 -1
  28. package/.opencode/skills/running-tests/SKILL.md +2 -1
  29. package/.opencode/skills/skill-edit-validation/SKILL.md +2 -1
  30. package/.opencode/skills/specify/SKILL.md +2 -1
  31. package/.opencode/skills/swarm/SKILL.md +2 -1
  32. package/.opencode/skills/swarm-ci-monitor/SKILL.md +3 -2
  33. package/.opencode/skills/swarm-implement/SKILL.md +2 -1
  34. package/.opencode/skills/swarm-plan/SKILL.md +2 -1
  35. package/.opencode/skills/swarm-pr-feedback/SKILL.md +9 -162
  36. package/.opencode/skills/swarm-pr-feedback/references/gate-evidence-scope.md +20 -0
  37. package/.opencode/skills/swarm-pr-feedback/references/intake-surfaces.md +107 -0
  38. package/.opencode/skills/swarm-pr-feedback/references/preflight-checkout.md +67 -0
  39. package/.opencode/skills/swarm-pr-review/SKILL.md +12 -344
  40. package/.opencode/skills/swarm-pr-review/references/council-mode.md +38 -0
  41. package/.opencode/skills/swarm-pr-review/references/explorer-output-format.md +54 -0
  42. package/.opencode/skills/swarm-pr-review/references/findings-persistence-detail.md +15 -0
  43. package/.opencode/skills/swarm-pr-review/references/parser-candidate-extraction.md +75 -0
  44. package/.opencode/skills/swarm-pr-review/references/phase0a-intake.md +61 -0
  45. package/.opencode/skills/swarm-pr-review/references/scope-detection.md +103 -0
  46. package/.opencode/skills/swarm-pr-review/references/writeback-phases.md +68 -0
  47. package/.opencode/skills/swarm-pr-subscribe/SKILL.md +3 -2
  48. package/.opencode/skills/swarm-resume/SKILL.md +2 -1
  49. package/.opencode/skills/test-file-split/SKILL.md +2 -1
  50. package/.opencode/skills/worktree-retry-cleanup/SKILL.md +2 -1
  51. package/.opencode/skills/writing-tests/SKILL.md +7 -437
  52. package/.opencode/skills/writing-tests/references/cross-platform-patterns.md +237 -0
  53. package/.opencode/skills/writing-tests/references/mock-tiers.md +207 -0
  54. package/binaries/win32-arm64/swarm-sandbox-runner.exe +0 -0
  55. package/binaries/win32-x64/swarm-sandbox-runner.exe +0 -0
  56. package/dist/cli/{auto-checkpoint-f00tk7sc.js → auto-checkpoint-s05sxmg6.js} +4 -4
  57. package/dist/cli/{checkpoint-acztxqga.js → checkpoint-kzyy9b7y.js} +8 -8
  58. package/dist/cli/{coder-settlement-0ka4n1xf.js → coder-settlement-d1qqfgdm.js} +3 -3
  59. package/dist/cli/{config-doctor-qv7wc6fa.js → config-doctor-yrven0ya.js} +7 -7
  60. package/dist/cli/{core-dmn3arr1.js → core-qpmksfae.js} +1 -1
  61. package/dist/cli/{curator-drift-sxzs48ew.js → curator-drift-2h6nf0mw.js} +5 -5
  62. package/dist/cli/{curator-llm-factory-cvrt4bf9.js → curator-llm-factory-kt3jhgs9.js} +25 -25
  63. package/dist/cli/{curator-891pc8b7.js → curator-mqnqst1g.js} +25 -25
  64. package/dist/cli/{doctor-knowledge-receipt-phase-id-mvbj576e.js → doctor-knowledge-receipt-phase-id-d8arz38j.js} +4 -4
  65. package/dist/cli/{evidence-summary-service-x9nxvmn5.js → evidence-summary-service-gjs4zssz.js} +9 -9
  66. package/dist/cli/{gate-evidence-dxd20wrc.js → gate-evidence-9n5r17hq.js} +2 -2
  67. package/dist/cli/{guardrail-explain-fga9bnvt.js → guardrail-explain-g4wcr664.js} +26 -26
  68. package/dist/cli/{guardrail-log-y84b9m8n.js → guardrail-log-0hy23f7d.js} +3 -3
  69. package/dist/cli/{guardrail-reset-xpcsxyt0.js → guardrail-reset-9z5rmp3f.js} +25 -25
  70. package/dist/cli/{hive-promoter-w1vchgfr.js → hive-promoter-w8f840ah.js} +25 -25
  71. package/dist/cli/{index-7gqmqhzj.js → index-1cks27mv.js} +6 -6
  72. package/dist/cli/{index-tjc68trf.js → index-1gnrtz76.js} +5 -5
  73. package/dist/cli/{index-nqxbqb50.js → index-20m9q2z9.js} +1 -1
  74. package/dist/cli/{index-41p9zzpe.js → index-29xr45xr.js} +153 -52
  75. package/dist/cli/{index-psqfkgav.js → index-3qqnz0jg.js} +3 -3
  76. package/dist/cli/{index-3drq02r1.js → index-401a12w5.js} +1 -1
  77. package/dist/cli/{index-3hpjqa6y.js → index-5p0jhn2s.js} +1 -1
  78. package/dist/cli/{index-hjma52c8.js → index-67w61x1b.js} +3 -3
  79. package/dist/cli/{index-w3mav870.js → index-8ahnfc03.js} +2 -2
  80. package/dist/cli/{index-t5med3ga.js → index-8zwmfh9d.js} +1 -1
  81. package/dist/cli/{index-vsa05smc.js → index-9px1knpj.js} +1 -1
  82. package/dist/cli/{index-174j0g38.js → index-9sqcmzc2.js} +2 -2
  83. package/dist/cli/{index-nrqyc8pr.js → index-agvmmvdt.js} +25 -25
  84. package/dist/cli/{index-wscg5ryb.js → index-avbvxmw2.js} +1 -1
  85. package/dist/cli/{index-ppnpkww2.js → index-bpnpvhja.js} +1 -1
  86. package/dist/cli/{index-knxq5byr.js → index-dgvf1jey.js} +1 -1
  87. package/dist/cli/{index-mt5t492g.js → index-eabxecjf.js} +2 -2
  88. package/dist/cli/{index-tzasccpd.js → index-fzx1wfxn.js} +1 -1
  89. package/dist/cli/{index-4cazf4kb.js → index-g1r94prs.js} +27 -27
  90. package/dist/cli/{index-8bsnnnj2.js → index-g749xs7c.js} +2 -2
  91. package/dist/cli/{index-bjaef5zn.js → index-jvpvghyh.js} +326 -222
  92. package/dist/cli/{index-2grr37ry.js → index-jvzfw0n5.js} +1 -1
  93. package/dist/cli/{index-391ydd25.js → index-mbdkr2sh.js} +1 -1
  94. package/dist/cli/{index-te61qv0q.js → index-ng6me2hh.js} +2 -2
  95. package/dist/cli/{index-7zkgdefv.js → index-njfkqr77.js} +3 -3
  96. package/dist/cli/{index-ryjp0wmq.js → index-t3tzk566.js} +1 -1
  97. package/dist/cli/{index-svbh91pz.js → index-v8jhmn8x.js} +1 -1
  98. package/dist/cli/{index-jnjvghgp.js → index-xb3h5tvj.js} +4 -4
  99. package/dist/cli/{index-31b55cq9.js → index-xf6tdsyr.js} +3 -3
  100. package/dist/cli/{index-sgt1d7ez.js → index-ysbmrmzk.js} +1 -1
  101. package/dist/cli/index.js +26 -26
  102. package/dist/cli/{knowledge-escalator-2dy96d0j.js → knowledge-escalator-42cvn0ec.js} +7 -7
  103. package/dist/cli/{knowledge-events-70kb745b.js → knowledge-events-v0xavjkd.js} +5 -5
  104. package/dist/cli/{knowledge-store-hvq03g0j.js → knowledge-store-s01cread.js} +1 -1
  105. package/dist/cli/{knowledge-validator-eaatcnkr.js → knowledge-validator-kvtcqpke.js} +2 -2
  106. package/dist/cli/{mcp-bj3awdfy.js → mcp-ff73w9z7.js} +1 -1
  107. package/dist/cli/{model-preflight-skhq4xtr.js → model-preflight-0k8bd388.js} +25 -25
  108. package/dist/cli/{pending-delegations-yamzv468.js → pending-delegations-bmj7djk1.js} +2 -2
  109. package/dist/cli/{pr-subscriptions-hkzd0nr4.js → pr-subscriptions-9dbrw7ky.js} +1 -1
  110. package/dist/cli/{pr-workflow-gate-2gmznmj4.js → pr-workflow-gate-wg003fkd.js} +25 -25
  111. package/dist/cli/{scan-cursor-arezehhk.js → scan-cursor-d93q0q3s.js} +2 -2
  112. package/dist/cli/{schema-emx6r32d.js → schema-0ny9ef6s.js} +1 -1
  113. package/dist/cli/{scope-persistence-tvr8w7ea.js → scope-persistence-ekcfq34x.js} +5 -5
  114. package/dist/cli/{server-ez03wdw9.js → server-rpx7pkg1.js} +25 -25
  115. package/dist/cli/{skill-generator-w0jy1mpc.js → skill-generator-h1w7s5dh.js} +8 -8
  116. package/dist/cli/{snapshot-coordination-init-2x56ds8a.js → snapshot-coordination-init-f6ecsn9c.js} +25 -25
  117. package/dist/cli/{speckit-checkoff-c2e5wezr.js → speckit-checkoff-kf0zkpdw.js} +3 -3
  118. package/dist/cli/{worktree-collision-ownership-1bgcea0v.js → worktree-collision-ownership-p7zmj4ag.js} +2 -2
  119. package/dist/cli/{worktree-isolation-9xp4dz41.js → worktree-isolation-nz90xvw5.js} +25 -25
  120. package/dist/config/skill-contract-digest.d.ts +6 -0
  121. package/dist/hooks/skill-scoring.d.ts +1 -1
  122. package/dist/hooks/skill-usage-log.d.ts +2 -0
  123. package/dist/index.js +23 -21
  124. package/dist/services/skill-evaluator.d.ts +2 -0
  125. package/dist/services/skill-generator.d.ts +13 -0
  126. package/package.json +1 -1
@@ -1,6 +1,5 @@
1
1
  ---
2
2
  name: swarm-pr-feedback
3
- audience: swarm-plugin
4
3
  description: >
5
4
  Ingest and resolve known pull request feedback with skeptical source verification.
6
5
  Use when addressing pasted PR feedback, GitHub review comments or threads,
@@ -12,7 +11,9 @@ description: >
12
11
  (structural pre-checks) and Stage B (reviewer + test_engineer) gates and the
13
12
  reviewer + critic closeout gate are MANDATORY for any change made as part of
14
13
  this process.
15
- swarm-contract-digest: aca3f05b0677
14
+ metadata:
15
+ audience: swarm-plugin
16
+ swarm-contract-digest: "a7fade5b1c40"
16
17
  ---
17
18
 
18
19
  # Swarm PR Feedback
@@ -156,36 +157,11 @@ Controller-tool absence is NOT a blocker; Profiles B and C are first-class
156
157
  execution paths. BLOCKED is reserved for bypassing an active controller and
157
158
  for verification or coverage gaps that stay unclosable after bounded retries.
158
159
 
159
- ## Pre-flight: Check Out the PR Branch Locally
160
-
161
- Before verifying any claim or making any fix, ensure the PR branch is the working
162
- tree:
163
-
164
- - If `head_ref` is a remote branch that is not checked out locally, fetch it
165
- (`git fetch origin <head_ref>`).
166
- - **Check for parallel work first.** Before checkout, use the repository or
167
- runtime's parallel-work check. When the bundled
168
- `parallel-work-check` skill exists, it is one conditional implementation to
169
- detect concurrent pushes from other agents (for example the repo's
170
- auto-review bot following up, a maintainer pushing fixes, or parallel swarm
171
- work). If remote has new commits: read `git log local..remote`, evaluate whether the parallel work
172
- supersedes your planned fixes, and prefer the parallel work if it's more
173
- comprehensive (more tests, better edge coverage, clearer error handling).
174
- Abort your rebase, take the remote state, then add minor improvements on top.
160
+ Detailed reference material moved to `.opencode/skills/swarm-pr-feedback/references/preflight-checkout.md` (issue #2907 progressive-disclosure budget).
161
+
175
162
  - Verify the working tree is clean first (`git status --porcelain`). If any
176
163
  tracked or untracked changes exist, call `prepare_pr_workflow_checkout`
177
- before binding (Profile A). Omit `paths` to auto-discover and atomically
178
164
  preserve every dirty path, including untracked files; pass explicit `paths`
179
- only for an exact bounded tracked-file set. It creates an auditable stash
180
- receipt containing the original branch/HEAD and a structured
181
- `operation: "restore"` recovery instruction. Do not issue `git stash`
182
- through shell.
183
- Without the controller, surface dirty state to the user or abort the checkout
184
- — do not blind-stash.
185
- - Treat `recovery-required` and `indeterminate` controller results as terminal
186
- for the current attempt: report the typed `required_action`, abort/clear any
187
- already-active gate, and stop. Only `stashable` permits one preparation call;
188
- retry only when the controller explicitly returns `retryable: true`.
189
165
  - **Check out the head branch locally before dispatching feedback lanes.** Feedback verification reads the working-tree
190
166
  filesystem (`Read`/`Glob`/`Grep`), and fixes must land on the PR branch — without a
191
167
  checkout you would verify and patch the base branch's code instead. Record the
@@ -193,8 +169,6 @@ tree:
193
169
  - Pass the exact `merge_base...head_ref` commit range in every read-only verification or
194
170
  explorer/advisory-lane delegation so lane agents can inspect specific revisions
195
171
  with `git show` when needed.
196
- - If no PR reference was provided (a pasted-feedback session on the current branch),
197
- confirm the current branch is the intended PR branch before editing.
198
172
  - A detached checkout at the authoritative full PR head is a valid pre-bind
199
173
  intake state. On the first Profile-A bind, the controller attaches it only
200
174
  when Git reports exactly one safe candidate: an existing local branch at
@@ -203,15 +177,6 @@ tree:
203
177
  candidates, multiple candidates, a linked-worktree-owned local branch, or an
204
178
  existing mismatched upstream fails closed without publishing the bind. Retry
205
179
  is idempotent if switching succeeded but state persistence failed.
206
- - The existing constrained tracked-branch and safe `gh pr checkout` pre-bind
207
- forms remain supported on every profile after proving the exact SHA and a
208
- unique intended remote ref. Never use force, submodule-recursive, or detached
209
- `gh pr checkout` variants.
210
- - Immediately after the first bind and before feedback verification dispatch,
211
- prove that `git rev-parse HEAD` equals the authoritative full `pr_head_sha`,
212
- `git status --porcelain` is empty, and the current branch tracks the intended
213
- PR head remote/branch. A detached exact-head checkout is intake-only; the
214
- bind must attach it before feedback dispatch or publication.
215
180
 
216
181
  When a verification lane result includes `output_ref`, treat `output` as a
217
182
  preview and call `retrieve_lane_output` before using it to classify, resolve,
@@ -298,111 +263,12 @@ Build a complete feedback ledger before editing. Include every available source:
298
263
 
299
264
  If a source is unavailable, retry with alternative access paths. If unavailable after retry, the source is a coverage gap that must be reported to the user — do not silently "record that limitation" and proceed as if the source doesn't matter.
300
265
 
301
- ### Async advisory verification lanes
302
-
303
- After the complete feedback ledger exists and before editing, run independent
304
- read-only verification lanes. Under Profile A, use
305
- `dispatch_lanes_async` with `mode: "swarm-pr-feedback:verification"`, the
306
- complete immutable `feedback_inventory` ID list, the exact current
307
- `pr_head_sha`, and each lane's exact
308
- `feedback_item_ids` ownership list for independent read-only verification lanes:
309
- comment classification, CI/log root-cause inspection, test impact mapping,
310
- release/docs claim checks, and stale-branch/conflict analysis. Partition the
311
- ledger so each `FB-###` item is owned by exactly one verification lane and the
312
- union of lanes covers the entire ledger — no feedback item may be left
313
- unassigned to a lane; state each lane's owned IDs both structurally and in its
314
- prompt. The runtime rejects missing, duplicate, overlapping, or unknown item
315
- ownership and blocks mutation until the verification batch settles. Scale
316
- the lane count to the ledger size: a 1–3 item round may use a single combined
317
- lane, while a large multi-round intake may warrant one lane per category above.
266
+ Detailed reference material moved to `.opencode/skills/swarm-pr-feedback/references/intake-surfaces.md` (issue #2907 progressive-disclosure budget).
267
+
318
268
  Cap each `dispatch_lanes_async` batch at 8 lanes (`MAX_LANES`); if the ledger
319
269
  needs more than 8 verification lanes, dispatch in sequential batches and settle
320
270
  each batch's COVERAGE GATE before the next — do not over-spawn lanes for a
321
- trivial round. Record each returned `batch_id`, then continue only ledger-safe
322
- architect work: normalize feedback IDs, gather deterministic PR metadata, prepare
323
- reproduction commands, and plan likely fix groups. Do not edit, close items, or
324
- mark feedback resolved from running lanes.
325
-
326
- Every verification lane must end with one parseable row for each owned item:
327
-
328
- ```text
329
- [FEEDBACK-VERIFIED] | FB-### | CONFIRMED/PARTIAL/DISPROVED/PRE_EXISTING/NEEDS_MORE_EVIDENCE/NEEDS_USER_DECISION | evidence
330
- ```
331
-
332
- Non-empty prose without this marker contract is not a settled verification
333
- artifact and cannot unlock mutation.
334
-
335
- Before the Verification step can mark any item `CONFIRMED`, `PARTIAL`,
336
- `DISPROVED`, `PRE_EXISTING`, `NEEDS_MORE_EVIDENCE`, or `NEEDS_USER_DECISION`,
337
- every open verification batch must be fully settled. Poll with
338
- `collect_lane_results` (wait omitted or `false`) to process settled lanes
339
- incrementally — clustering confirmed items and pre-reading files for settled
340
- findings while ledger-safe work remains — then issue a final
341
- `collect_lane_results` with `wait: true` per batch once independent work is
342
- exhausted, to confirm every lane is settled.
343
- Missing, stale, cancelled, or failed lanes are coverage gaps that must be closed
344
- before marking any item CONFIRMED/PARTIAL/DISPROVED/PRE_EXISTING. Apply the
345
- COVERAGE GATE:
346
- retry failed lanes (max 2) as another
347
- `swarm-pr-feedback:verification` async batch with the same immutable inventory,
348
- exact `pr_head_sha`, agent type, prompt, scope, and isolation, or stop and
349
- surface the lane failure to the user as BLOCKED. Under Profile A, blocking and
350
- direct-Task fallbacks are rejected because they cannot satisfy the durable
351
- ownership and head-provenance gate.
352
- Do not proceed with "blocking verification and record that async advisory lanes
353
- were unavailable" — record-and-continue is not coverage closure.
354
-
355
- Under Profile B, partition the same immutable inventory across fresh read-only
356
- verification subagents — every `FB-###` item owned by exactly one lane and the
357
- union of lanes covering the entire ledger — with each prompt stating its owned
358
- IDs and the exact `pr_head_sha`, and each lane returning one
359
- `[FEEDBACK-VERIFIED]` row per owned item. Under Profile C, verify the ledger
360
- in sequential category passes with the same one-row-per-item contract. On
361
- every profile, no item may be classified until its verification lane or pass
362
- has settled, and unclosable verification gaps are surfaced as BLOCKED.
363
-
364
- ### CI matrix cascade check (do this before fixing)
365
-
366
- When the PR's `unit` job is a matrix across multiple OSes and downstream jobs
367
- (`integration`, `smoke`) have `needs: unit`, an OS leg failure blocks the
368
- entire pipeline. Before triaging, check:
369
-
370
- 1. Are `integration` or `smoke` jobs in `skipped` or `cancelled` state rather
371
- than `failed`? That signals a unit matrix cascade — the unit job failed
372
- on one OS leg, blocking the downstream jobs from running on the current
373
- HEAD.
374
- 2. If a unit OS leg is the blocker, classify the failure:
375
- - **Code issue** — the test itself fails. Reproduce locally; if the
376
- test passes locally, the runner is the problem.
377
- - **Runner performance** — the test step exceeds the configured timeout.
378
- Run all files in the step locally with per-file timing; if cumulative
379
- local runtime is <10 min and the runner can't complete in 60+ min, the
380
- issue is runner performance. Bump the CI timeout as a stopgap and file
381
- a follow-up issue for parallelization. Do not loop bumping the timeout
382
- past 90 min without filing the follow-up.
383
- 3. Surface cascade failures to the user explicitly. The downstream jobs'
384
- results don't exist; the code's coverage of the current HEAD cannot be
385
- confirmed by CI alone.
386
-
387
- ### PR body claim verification
388
-
389
- The `.swarm/evidence/` paths below apply only when the reviewed repository uses
390
- this plugin's council evidence contract. For any other repository, locate the
391
- authoritative CI attestation, code-host review record, or repository-declared
392
- evidence store; the universal rule is that an approval claim needs a real,
393
- retrievable provenance artifact.
394
-
395
- PR body text like "PHASE 2 council APPROVED (5/5, round 2)" or "Final council
396
- APPROVED" must be backed by an evidence file under `.swarm/evidence/` — phase
397
- councils write `.swarm/evidence/{phaseNumber}/phase-council.json`; the final
398
- council writes the flat `.swarm/evidence/final-council.json`. Bot-generated PR
399
- bodies commonly auto-fill these claims without real review. Before accepting
400
- such a claim as part of triage:
401
-
402
- 1. Check whether the corresponding evidence file exists with `verdict:APPROVED`.
403
- 2. If the claim is unsupported, mark the closure ledger item as
404
- `NEEDS_MORE_EVIDENCE` rather than `CONFIRMED`. Do not silently drop the
405
- claim — it indicates the PR body was generated without a real review.
271
+ trivial round.
406
272
 
407
273
  ## Feedback Ledger
408
274
 
@@ -752,26 +618,7 @@ digest change, still wipes every recorded gate batch and un-arms publication
752
618
  exactly as before — a controller cannot narrow what it declares in order to
753
619
  dodge re-verification.
754
620
 
755
- ### Why gate evidence is not item-scoped
756
-
757
- Stage A, Stage B, and closeout evidence invalidate as whole gate batches, not
758
- per feedback item, and that is a deliberate design decision, not unfinished
759
- work:
760
-
761
- - **No trustworthy item-to-file mapping exists to key invalidation on.** The
762
- file scope a caller declares for a feedback item is caller-asserted and
763
- only path-sanitized — it is never intersected with the actual changed-file
764
- set, and it carries no persisted binding back to feedback item IDs. Keying
765
- invalidation on that declaration would let a controller dodge
766
- re-verification by under-declaring scope, turning a fail-closed guarantee
767
- into a fail-open one (AGENTS.md invariant 9) — the same failure class that
768
- already ruled out keying digest invalidation on `git diff --raw` blob OIDs.
769
- - **The four gate phases are holistic by contract.** Each recorded batch must
770
- own every inventory item exactly once and in declared order. Retaining
771
- evidence for a subset of items per gate would re-partition that
772
- independent-review contract itself, and would need its own
773
- collusion/independence analysis before it could be trusted — it is not a
774
- drop-in extension of the revision-level retention above.
621
+ Detailed reference material moved to `.opencode/skills/swarm-pr-feedback/references/gate-evidence-scope.md` (issue #2907 progressive-disclosure budget).
775
622
 
776
623
  ### Stage B — reviewer + test_engineer (mandatory after Stage A passes)
777
624
 
@@ -0,0 +1,20 @@
1
+ # Why gate evidence is not item-scoped
2
+
3
+ Stage A, Stage B, and closeout evidence invalidate as whole gate batches, not
4
+ per feedback item, and that is a deliberate design decision, not unfinished
5
+ work:
6
+
7
+ - **No trustworthy item-to-file mapping exists to key invalidation on.** The
8
+ file scope a caller declares for a feedback item is caller-asserted and
9
+ only path-sanitized — it is never intersected with the actual changed-file
10
+ set, and it carries no persisted binding back to feedback item IDs. Keying
11
+ invalidation on that declaration would let a controller dodge
12
+ re-verification by under-declaring scope, turning a fail-closed guarantee
13
+ into a fail-open one (AGENTS.md invariant 9) — the same failure class that
14
+ already ruled out keying digest invalidation on `git diff --raw` blob OIDs.
15
+ - **The four gate phases are holistic by contract.** Each recorded batch must
16
+ own every inventory item exactly once and in declared order. Retaining
17
+ evidence for a subset of items per gate would re-partition that
18
+ independent-review contract itself, and would need its own
19
+ collusion/independence analysis before it could be trusted — it is not a
20
+ drop-in extension of the revision-level retention above.
@@ -0,0 +1,107 @@
1
+ # Intake Surfaces detail (async advisory lanes, CI matrix cascade, PR body claim verification)
2
+
3
+ ### Async advisory verification lanes
4
+
5
+ After the complete feedback ledger exists and before editing, run independent
6
+ read-only verification lanes. Under Profile A, use
7
+ `dispatch_lanes_async` with `mode: "swarm-pr-feedback:verification"`, the
8
+ complete immutable `feedback_inventory` ID list, the exact current
9
+ `pr_head_sha`, and each lane's exact
10
+ `feedback_item_ids` ownership list for independent read-only verification lanes:
11
+ comment classification, CI/log root-cause inspection, test impact mapping,
12
+ release/docs claim checks, and stale-branch/conflict analysis. Partition the
13
+ ledger so each `FB-###` item is owned by exactly one verification lane and the
14
+ union of lanes covers the entire ledger — no feedback item may be left
15
+ unassigned to a lane; state each lane's owned IDs both structurally and in its
16
+ prompt. The runtime rejects missing, duplicate, overlapping, or unknown item
17
+ ownership and blocks mutation until the verification batch settles. Scale
18
+ the lane count to the ledger size: a 1–3 item round may use a single combined
19
+ lane, while a large multi-round intake may warrant one lane per category above.
20
+ Cap each `dispatch_lanes_async` batch at 8 lanes (`MAX_LANES`); if the ledger
21
+ needs more than 8 verification lanes, dispatch in sequential batches and settle
22
+ each batch's COVERAGE GATE before the next — do not over-spawn lanes for a
23
+ trivial round. Record each returned `batch_id`, then continue only ledger-safe
24
+ architect work: normalize feedback IDs, gather deterministic PR metadata, prepare
25
+ reproduction commands, and plan likely fix groups. Do not edit, close items, or
26
+ mark feedback resolved from running lanes.
27
+
28
+ Every verification lane must end with one parseable row for each owned item:
29
+
30
+ ```text
31
+ [FEEDBACK-VERIFIED] | FB-### | CONFIRMED/PARTIAL/DISPROVED/PRE_EXISTING/NEEDS_MORE_EVIDENCE/NEEDS_USER_DECISION | evidence
32
+ ```
33
+
34
+ Non-empty prose without this marker contract is not a settled verification
35
+ artifact and cannot unlock mutation.
36
+
37
+ Before the Verification step can mark any item `CONFIRMED`, `PARTIAL`,
38
+ `DISPROVED`, `PRE_EXISTING`, `NEEDS_MORE_EVIDENCE`, or `NEEDS_USER_DECISION`,
39
+ every open verification batch must be fully settled. Poll with
40
+ `collect_lane_results` (wait omitted or `false`) to process settled lanes
41
+ incrementally — clustering confirmed items and pre-reading files for settled
42
+ findings while ledger-safe work remains — then issue a final
43
+ `collect_lane_results` with `wait: true` per batch once independent work is
44
+ exhausted, to confirm every lane is settled.
45
+ Missing, stale, cancelled, or failed lanes are coverage gaps that must be closed
46
+ before marking any item CONFIRMED/PARTIAL/DISPROVED/PRE_EXISTING. Apply the
47
+ COVERAGE GATE:
48
+ retry failed lanes (max 2) as another
49
+ `swarm-pr-feedback:verification` async batch with the same immutable inventory,
50
+ exact `pr_head_sha`, agent type, prompt, scope, and isolation, or stop and
51
+ surface the lane failure to the user as BLOCKED. Under Profile A, blocking and
52
+ direct-Task fallbacks are rejected because they cannot satisfy the durable
53
+ ownership and head-provenance gate.
54
+ Do not proceed with "blocking verification and record that async advisory lanes
55
+ were unavailable" — record-and-continue is not coverage closure.
56
+
57
+ Under Profile B, partition the same immutable inventory across fresh read-only
58
+ verification subagents — every `FB-###` item owned by exactly one lane and the
59
+ union of lanes covering the entire ledger — with each prompt stating its owned
60
+ IDs and the exact `pr_head_sha`, and each lane returning one
61
+ `[FEEDBACK-VERIFIED]` row per owned item. Under Profile C, verify the ledger
62
+ in sequential category passes with the same one-row-per-item contract. On
63
+ every profile, no item may be classified until its verification lane or pass
64
+ has settled, and unclosable verification gaps are surfaced as BLOCKED.
65
+
66
+ ### CI matrix cascade check (do this before fixing)
67
+
68
+ When the PR's `unit` job is a matrix across multiple OSes and downstream jobs
69
+ (`integration`, `smoke`) have `needs: unit`, an OS leg failure blocks the
70
+ entire pipeline. Before triaging, check:
71
+
72
+ 1. Are `integration` or `smoke` jobs in `skipped` or `cancelled` state rather
73
+ than `failed`? That signals a unit matrix cascade — the unit job failed
74
+ on one OS leg, blocking the downstream jobs from running on the current
75
+ HEAD.
76
+ 2. If a unit OS leg is the blocker, classify the failure:
77
+ - **Code issue** — the test itself fails. Reproduce locally; if the
78
+ test passes locally, the runner is the problem.
79
+ - **Runner performance** — the test step exceeds the configured timeout.
80
+ Run all files in the step locally with per-file timing; if cumulative
81
+ local runtime is <10 min and the runner can't complete in 60+ min, the
82
+ issue is runner performance. Bump the CI timeout as a stopgap and file
83
+ a follow-up issue for parallelization. Do not loop bumping the timeout
84
+ past 90 min without filing the follow-up.
85
+ 3. Surface cascade failures to the user explicitly. The downstream jobs'
86
+ results don't exist; the code's coverage of the current HEAD cannot be
87
+ confirmed by CI alone.
88
+
89
+ ### PR body claim verification
90
+
91
+ The `.swarm/evidence/` paths below apply only when the reviewed repository uses
92
+ this plugin's council evidence contract. For any other repository, locate the
93
+ authoritative CI attestation, code-host review record, or repository-declared
94
+ evidence store; the universal rule is that an approval claim needs a real,
95
+ retrievable provenance artifact.
96
+
97
+ PR body text like "PHASE 2 council APPROVED (5/5, round 2)" or "Final council
98
+ APPROVED" must be backed by an evidence file under `.swarm/evidence/` — phase
99
+ councils write `.swarm/evidence/{phaseNumber}/phase-council.json`; the final
100
+ council writes the flat `.swarm/evidence/final-council.json`. Bot-generated PR
101
+ bodies commonly auto-fill these claims without real review. Before accepting
102
+ such a claim as part of triage:
103
+
104
+ 1. Check whether the corresponding evidence file exists with `verdict:APPROVED`.
105
+ 2. If the claim is unsupported, mark the closure ledger item as
106
+ `NEEDS_MORE_EVIDENCE` rather than `CONFIRMED`. Do not silently drop the
107
+ claim — it indicates the PR body was generated without a real review.
@@ -0,0 +1,67 @@
1
+ # Pre-flight PR branch checkout
2
+
3
+ ## Pre-flight: Check Out the PR Branch Locally
4
+
5
+ Before verifying any claim or making any fix, ensure the PR branch is the working
6
+ tree:
7
+
8
+ - If `head_ref` is a remote branch that is not checked out locally, fetch it
9
+ (`git fetch origin <head_ref>`).
10
+ - **Check for parallel work first.** Before checkout, use the repository or
11
+ runtime's parallel-work check. When the bundled
12
+ `parallel-work-check` skill exists, it is one conditional implementation to
13
+ detect concurrent pushes from other agents (for example the repo's
14
+ auto-review bot following up, a maintainer pushing fixes, or parallel swarm
15
+ work). If remote has new commits: read `git log local..remote`, evaluate whether the parallel work
16
+ supersedes your planned fixes, and prefer the parallel work if it's more
17
+ comprehensive (more tests, better edge coverage, clearer error handling).
18
+ Abort your rebase, take the remote state, then add minor improvements on top.
19
+ - Verify the working tree is clean first (`git status --porcelain`). If any
20
+ tracked or untracked changes exist, call `prepare_pr_workflow_checkout`
21
+ before binding (Profile A). Omit `paths` to auto-discover and atomically
22
+ preserve every dirty path, including untracked files; pass explicit `paths`
23
+ only for an exact bounded tracked-file set. It creates an auditable stash
24
+ receipt containing the original branch/HEAD and a structured
25
+ `operation: "restore"` recovery instruction. Do not issue `git stash`
26
+ through shell.
27
+ Without the controller, surface dirty state to the user or abort the checkout
28
+ — do not blind-stash.
29
+ - Treat `recovery-required` and `indeterminate` controller results as terminal
30
+ for the current attempt: report the typed `required_action`, abort/clear any
31
+ already-active gate, and stop. Only `stashable` permits one preparation call;
32
+ retry only when the controller explicitly returns `retryable: true`.
33
+ - **Check out the head branch locally before dispatching feedback lanes.** Feedback verification reads the working-tree
34
+ filesystem (`Read`/`Glob`/`Grep`), and fixes must land on the PR branch — without a
35
+ checkout you would verify and patch the base branch's code instead. Record the
36
+ exact `merge_base...head_ref` range for diff-scoped inspection.
37
+ - Pass the exact `merge_base...head_ref` commit range in every read-only verification or
38
+ explorer/advisory-lane delegation so lane agents can inspect specific revisions
39
+ with `git show` when needed.
40
+ - If no PR reference was provided (a pasted-feedback session on the current branch),
41
+ confirm the current branch is the intended PR branch before editing.
42
+ - A detached checkout at the authoritative full PR head is a valid pre-bind
43
+ intake state. On the first Profile-A bind, the controller attaches it only
44
+ when Git reports exactly one safe candidate: an existing local branch at
45
+ that SHA whose upstream is an exact remote ref at the same SHA, or one exact
46
+ remote-tracking ref. It never guesses a remote/name boundary. Zero
47
+ candidates, multiple candidates, a linked-worktree-owned local branch, or an
48
+ existing mismatched upstream fails closed without publishing the bind. Retry
49
+ is idempotent if switching succeeded but state persistence failed.
50
+ - The existing constrained tracked-branch and safe `gh pr checkout` pre-bind
51
+ forms remain supported on every profile after proving the exact SHA and a
52
+ unique intended remote ref. Never use force, submodule-recursive, or detached
53
+ `gh pr checkout` variants.
54
+ - Immediately after the first bind and before feedback verification dispatch,
55
+ prove that `git rev-parse HEAD` equals the authoritative full `pr_head_sha`,
56
+ `git status --porcelain` is empty, and the current branch tracks the intended
57
+ PR head remote/branch. A detached exact-head checkout is intake-only; the
58
+ bind must attach it before feedback dispatch or publication.
59
+
60
+ When a verification lane result includes `output_ref`, treat `output` as a
61
+ preview and call `retrieve_lane_output` before using it to classify, resolve,
62
+ disprove, or group feedback items. If the result is `output_degraded`,
63
+ `transcript_incomplete`, or truncated without a usable ref, keep the affected
64
+ ledger items as `NEEDS_MORE_EVIDENCE` or re-dispatch a narrower read-only lane.
65
+ (Profile A. On Profiles B/C, read each verification subagent's or pass's full
66
+ report directly — a truncated or summary-only report is a preview, not
67
+ verification evidence, and keeps its items open the same way.)