opencode-swarm 7.124.0 → 7.125.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 (70) hide show
  1. package/.opencode/skills/critic-gate/SKILL.md +8 -0
  2. package/.opencode/skills/swarm/SKILL.md +12 -8
  3. package/.opencode/skills/swarm-pr-feedback/SKILL.md +245 -171
  4. package/.opencode/skills/swarm-pr-feedback/references/bot-claim-verification.md +71 -0
  5. package/.opencode/skills/swarm-pr-feedback/references/operational-gotchas.md +49 -0
  6. package/.opencode/skills/swarm-pr-review/SKILL.md +238 -412
  7. package/.opencode/skills/swarm-pr-review/references/parser-dry-run.md +235 -0
  8. package/.opencode/skills/swarm-pr-review/references/prompt-templates.md +103 -0
  9. package/.opencode/skills/writing-tests/SKILL.md +4 -123
  10. package/.opencode/skills/writing-tests/references/mock-and-seam-inventory.md +43 -0
  11. package/README.md +3 -1
  12. package/dist/background/lane-output-store.d.ts +10 -0
  13. package/dist/background/pending-delegations.d.ts +3 -0
  14. package/dist/background/workspace-snapshot.d.ts +59 -0
  15. package/dist/cli/{config-doctor-53mnpeke.js → config-doctor-g3m2q646.js} +2 -2
  16. package/dist/cli/{curation-policy-ny033330.js → curation-policy-vgbx8530.js} +2 -2
  17. package/dist/cli/{curator-llm-factory-e0tjz8qq.js → curator-llm-factory-7pvqy94w.js} +15 -14
  18. package/dist/cli/{curator-nvn1pdq6.js → curator-xk4g1nx2.js} +15 -14
  19. package/dist/cli/{evidence-summary-service-9hq7n9k9.js → evidence-summary-service-v4h2w487.js} +1 -1
  20. package/dist/cli/{guardrail-explain-d3dd57nf.js → guardrail-explain-wfk16bpr.js} +16 -15
  21. package/dist/cli/{guardrail-log-3q2z9axs.js → guardrail-log-5zz9xx6z.js} +3 -3
  22. package/dist/cli/{hive-promoter-9gbpepgm.js → hive-promoter-njwc5rt0.js} +15 -14
  23. package/dist/cli/{pending-delegations-e3bcqj77.js → index-0cz1ws47.js} +4 -18
  24. package/dist/cli/{index-3yyr4ynk.js → index-3k8pg467.js} +1 -1
  25. package/dist/cli/{index-x2mmnrnx.js → index-83rwq7pb.js} +1 -1
  26. package/dist/cli/{index-c6crt5rs.js → index-8yvqkbw7.js} +12 -2
  27. package/dist/cli/{index-z0m4angq.js → index-93cq8t5b.js} +5 -5
  28. package/dist/cli/{index-8pz0ypxz.js → index-cz6fv84h.js} +17 -16
  29. package/dist/cli/{index-mkkx1a4f.js → index-dsf1yv4s.js} +1588 -891
  30. package/dist/cli/{index-4rzzzjtg.js → index-fs02c7tz.js} +277 -16
  31. package/dist/cli/{index-zjedv2bd.js → index-ghteqdy1.js} +2 -2
  32. package/dist/cli/{index-13d2g7k9.js → index-kvrk3h8p.js} +1 -1
  33. package/dist/cli/{index-eeg04r0x.js → index-kws8zn6y.js} +1 -1
  34. package/dist/cli/index-mg54y5gc.js +564 -0
  35. package/dist/cli/{index-qd77aft9.js → index-mhhmecsw.js} +2 -2
  36. package/dist/cli/{index-2x4maxte.js → index-mwdcvh0e.js} +4 -4
  37. package/dist/cli/{index-e19mxn9f.js → index-pbjenws7.js} +1 -1
  38. package/dist/cli/{index-wqwpzhv1.js → index-rpg8qqjs.js} +2 -2
  39. package/dist/cli/{index-tyg0zezw.js → index-tn3shyqj.js} +3 -3
  40. package/dist/cli/{index-htbjqftb.js → index-txragda9.js} +1 -1
  41. package/dist/cli/{index-v5ecczts.js → index-z4sc6yxc.js} +1 -1
  42. package/dist/cli/index.js +15 -14
  43. package/dist/cli/{knowledge-escalator-r1s01m3z.js → knowledge-escalator-jtyykzqc.js} +3 -3
  44. package/dist/cli/{knowledge-events-a9hmxvke.js → knowledge-events-qhr97sy9.js} +1 -1
  45. package/dist/cli/{knowledge-store-jt31br5k.js → knowledge-store-332x3pjv.js} +1 -1
  46. package/dist/cli/{knowledge-validator-9vrwxr3z.js → knowledge-validator-3t8tgzsz.js} +4 -4
  47. package/dist/cli/pending-delegations-7j8xqg5f.js +34 -0
  48. package/dist/cli/{scan-cursor-bkjtsawg.js → scan-cursor-q21c9k9q.js} +2 -2
  49. package/dist/cli/{schema-y3z416z7.js → schema-y2d7j2jk.js} +1 -1
  50. package/dist/cli/{skill-generator-794hyndw.js → skill-generator-3gkxx98d.js} +5 -5
  51. package/dist/cli/workspace-snapshot-c9pxxt9a.js +48 -0
  52. package/dist/commands/close.d.ts +4 -2
  53. package/dist/commands/registry.d.ts +1 -1
  54. package/dist/config/schema.d.ts +4 -0
  55. package/dist/evidence/documents-retention.d.ts +116 -0
  56. package/dist/evidence/manager.d.ts +17 -0
  57. package/dist/hooks/pr-workflow-gate.d.ts +211 -0
  58. package/dist/hooks/pr-workflow-response-gate.d.ts +23 -0
  59. package/dist/hooks/pr-workflow-session-resolver.d.ts +14 -0
  60. package/dist/index.js +563 -523
  61. package/dist/tools/complete-pr-workflow.d.ts +5 -0
  62. package/dist/tools/dispatch-lanes.d.ts +44 -0
  63. package/dist/tools/index.d.ts +2 -0
  64. package/dist/tools/manifest.d.ts +2 -0
  65. package/dist/tools/run-pr-feedback-stage-a.d.ts +69 -0
  66. package/dist/tools/tool-metadata.d.ts +8 -0
  67. package/dist/tools/write-pr-review-trigger-eval.d.ts +56 -46
  68. package/package.json +1 -1
  69. package/dist/cli/index-dqh3zhhc.js +0 -133
  70. package/dist/cli/workspace-snapshot-eyf6gd0d.js +0 -22
@@ -0,0 +1,71 @@
1
+ # Bot Claim Verification
2
+
3
+ ## Bot Review Verification Traps
4
+
5
+ When a bot or pasted review cites a code fact, verify the fact against the
6
+ current branch before editing:
7
+
8
+ - **Import/export claims:** Check the exact import path used by the changed file.
9
+ A symbol may be missing from an internal submodule but correctly exported by the
10
+ public barrel the tests or runtime actually import.
11
+ - **Line numbers:** Treat bot line references as approximate after any follow-up
12
+ push or local edit. Re-locate the symbol or block with `rg` before patching.
13
+ - **Ordering claims:** If the concern is about rule precedence, add or run a
14
+ direct precedence test that would fail under the wrong ordering; comments alone
15
+ are not enough.
16
+ - **Disproved findings:** Do not change unrelated code to satisfy a false claim.
17
+ Keep the finding in the closure ledger with the source or test evidence that
18
+ disproves it.
19
+ - **Cache/state claims:** Test both relevant state orders when the behavior
20
+ depends on cache priming, singleton state, or prior calls.
21
+
22
+ ## Automated Security Finding Verification
23
+
24
+ This is a repository-agnostic verification checklist. Technology names and
25
+ paths in the examples below are illustrative only: apply an example only when
26
+ the reviewed repository actually uses that API, validator, runtime, or file
27
+ layout, and otherwise translate the same origin-to-sink question to the
28
+ repository's language and framework. No example creates a dependency on the
29
+ opencode-swarm tree.
30
+
31
+ Automated security bots can produce CRITICAL or HIGH false positives. Before
32
+ acting on any bot security finding, perform these source-level checks:
33
+
34
+ 1. **`child_process.exec` vs `RegExp.exec`**: SAST rules pattern-match on
35
+ `.exec(` and cannot distinguish `child_process.exec(userInput)` (real
36
+ injection risk) from `/^pattern$/.exec(str)` (safe regex test). Read the
37
+ actual line to determine which `.exec` is called.
38
+
39
+ 2. **Schema validation already present**: Bots may flag "missing type
40
+ validation" without checking the Zod schema. Search for the field name in
41
+ `src/config/schema.ts` — `z.number().int()`, `z.string().min()`, etc. are
42
+ runtime validators that run before the code path the bot reviewed.
43
+
44
+ 3. **`Object.assign` mutation claims**: Bots may claim `Object.assign` mutates
45
+ the source object. Check whether the call is `Object.assign(target, source)`
46
+ (mutates target) vs `Object.assign({}, source)` or a manual copy loop into a
47
+ new `{}` (creates a new object, source is safe). Read the actual assignment.
48
+
49
+ 4. **Path containment for system-generated paths**: Bots may flag "path
50
+ traversal" on file paths. Check whether the path is user-controlled (real
51
+ risk) or system-generated from `provisionWorktree`, `mkdtempSync`, or
52
+ similar (no user input reaches the path). Trace the variable's origin.
53
+
54
+ 5. **Value validation vs key validation**: Bots may suggest validating env var
55
+ *values* for shell injection characters. Check whether the value is passed
56
+ through a sandbox executor that escapes arguments (e.g., `wrapCommand`
57
+ which returns a shell-quoted / `psStringEscape`-escaped string for the
58
+ `bunSpawn` array-form argv to consume). Value validation would break
59
+ legitimate env vars (PATH with `;`, URLs with `$`); escaping is the
60
+ sandbox's job — see `engineering-conventions` § "Sandbox env overrides"
61
+ for the full escape contract.
62
+
63
+ 6. **Deduplication for independent resources**: Bots may suggest deduplicating
64
+ cache redirects or env var entries. Check whether the entries map to
65
+ independent keys (different env var names) — independent keys cannot
66
+ "collide" and deduplication is nonsensical.
67
+
68
+ **Rule:** For any bot finding rated CRITICAL or HIGH, read the actual source
69
+ line AND its surrounding context (parent function, schema definition, type
70
+ annotations) before accepting the finding. If the finding is disproved, record
71
+ it in the closure ledger with the specific source evidence that disproves it.
@@ -0,0 +1,49 @@
1
+ # Operational Reference
2
+
3
+ ## DI seam migration validation (when the repository uses this pattern)
4
+
5
+ `_internals` and `mock.module()` below are JavaScript/TypeScript examples only.
6
+ For another stack, apply the same live-binding question using that language and
7
+ test runner's dependency-injection/mocking semantics.
8
+
9
+ When a test file mutates a DI seam object (e.g., `_internals.foo = mock`),
10
+ verify that the production source reads from the seam at call time. A common
11
+ anti-pattern: the test mutates the seam object, but the production code
12
+ imports the named function (`import { foo } from './module'`) which is bound
13
+ at module load. The seam mutation has no effect on the named reference,
14
+ so the test fails even though the seam object's `foo === mock`.
15
+
16
+ Verification: open the source file and grep for call sites. If you see
17
+ `import { foo } from '...'` followed by `foo(...)` in the production code,
18
+ and the test does `_internals.foo = mock`, the test will fail. The fix is
19
+ to change the production code to call `_internals.foo(...)` (or equivalent
20
+ active-seam pattern) so the seam mutation is read at call time.
21
+
22
+ If only a few call sites exist, fix them in the source. If many call sites
23
+ exist, consider whether the migration should use `mock.module()` instead,
24
+ which replaces the entire module object (including the named export
25
+ reference).
26
+
27
+ ## Conditional runtime/host gotchas
28
+
29
+ Apply each item below only when the named plugin tool, plan model, shell, or
30
+ code-host client is actually present. They are portability examples, not
31
+ requirements imposed on unrelated repositories.
32
+
33
+ - **Plan identity change:** When switching from a review plan to a feedback-closure
34
+ plan, `save_plan` rejects with `PLAN_IDENTITY_MISMATCH`. Pass
35
+ `confirm_identity_change: true` to acknowledge the intentional overwrite.
36
+ - **Stale gate evidence:** After a plan identity change, `check_gate_status` returns
37
+ timestamps from the *prior* plan. Reset task statuses and re-run Stage A gates
38
+ before trusting gate results. Do not accept cached gate verdicts from before the
39
+ identity change.
40
+ - **PowerShell PR comment posting:** Complex markdown bodies containing backticks,
41
+ dollar signs, or nested quotes fail in PowerShell here-strings. Write the body
42
+ to a temp file and use `gh pr comment <number> --body-file <tempfile>` instead
43
+ of inline `--body "..."`.
44
+ - **Same-file batching:** Multiple findings targeting the same file for the same
45
+ review cycle CAN be fixed in one coder task when the fixes are trivially
46
+ independent (e.g., a one-line guard and a typo fix). When findings require
47
+ different fixes on different code paths, use separate coder tasks even if
48
+ targeting the same file. The "ONE task per coder" rule is about distinct
49
+ objectives, not about N edits to one file.