opencode-swarm 7.144.4 → 7.144.6

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 (106) hide show
  1. package/.opencode/skills/swarm-pr-review/references/prompt-templates.md +2 -2
  2. package/dist/background/workspace-snapshot.d.ts +7 -0
  3. package/dist/cli/{capability-probe-f1paszww.js → capability-probe-976tt4ba.js} +6 -2
  4. package/dist/cli/{config-doctor-rw9zrjk6.js → config-doctor-4chz0b95.js} +2 -2
  5. package/dist/cli/{core-zjx9aqaf.js → core-p04nvknr.js} +4 -3
  6. package/dist/cli/{curation-policy-0wbrh11c.js → curation-policy-a511r0qz.js} +4 -4
  7. package/dist/cli/{curator-drift-2jbjv03a.js → curator-drift-ckjm272w.js} +2 -2
  8. package/dist/cli/curator-llm-factory-vc1mrc3r.js +63 -0
  9. package/dist/cli/{curator-g54a7wv0.js → curator-sxeh36gw.js} +33 -32
  10. package/dist/cli/{dispatch-1y1rnv1h.js → dispatch-ndxbsk98.js} +2 -2
  11. package/dist/cli/{evidence-summary-service-fnr5y54e.js → evidence-summary-service-spyxcgsx.js} +13 -12
  12. package/dist/cli/{gate-evidence-2xt1x07r.js → gate-evidence-nz0bwa15.js} +7 -6
  13. package/dist/cli/guardrail-explain-ass47kn8.js +64 -0
  14. package/dist/cli/{guardrail-log-5w4b9zrw.js → guardrail-log-fyzd55fp.js} +4 -4
  15. package/dist/cli/{hive-promoter-x63ehffd.js → hive-promoter-k8gtah3n.js} +33 -32
  16. package/dist/cli/{index-h98t1m88.js → index-01nhedm7.js} +29 -1
  17. package/dist/cli/{index-q4ed1jk7.js → index-42ezdzam.js} +1994 -1333
  18. package/dist/cli/{index-y8j8ehc8.js → index-68mqwvf5.js} +11 -5
  19. package/dist/cli/{index-1csyxv0f.js → index-6z5jtf7d.js} +2 -2
  20. package/dist/cli/{index-2m7mavaz.js → index-7zehmnv1.js} +2 -2
  21. package/dist/cli/index-9e6fdz2h.js +282 -0
  22. package/dist/cli/{index-mazgg5s2.js → index-9s8drsf9.js} +1 -1
  23. package/dist/cli/{index-b6e016tv.js → index-abtrcs16.js} +1 -1
  24. package/dist/cli/{index-8fwhhayc.js → index-b44qqqt2.js} +27 -18
  25. package/dist/cli/{index-yts89pqg.js → index-bac12jpv.js} +4 -4
  26. package/dist/cli/{index-psvxq93b.js → index-ckq719fr.js} +2 -2
  27. package/dist/cli/{index-k3cxyk66.js → index-cwtpqm5f.js} +1 -1
  28. package/dist/cli/{index-d12jd5mn.js → index-dj8cah6s.js} +1 -1
  29. package/dist/cli/{index-pw83zgny.js → index-dvybg11w.js} +3 -3
  30. package/dist/cli/{index-03pv47h2.js → index-ec1kywxg.js} +6 -6
  31. package/dist/cli/{index-74hpm6sh.js → index-f36ybbsv.js} +12 -6
  32. package/dist/cli/{index-az8etqpp.js → index-fgdhf6a5.js} +298 -1179
  33. package/dist/cli/{index-rn0eq85g.js → index-fv0s19g9.js} +1 -1
  34. package/dist/cli/{index-ywn7vtxp.js → index-h1p08s3n.js} +1 -1
  35. package/dist/cli/{index-nckg4gxb.js → index-h5krb653.js} +15 -4
  36. package/dist/cli/{index-bt9aa01f.js → index-hkdgkkhb.js} +1 -1
  37. package/dist/cli/{index-p7cm3gtj.js → index-jqvsh0g3.js} +35 -34
  38. package/dist/cli/{index-x6tp0hfr.js → index-n06653nr.js} +5 -5
  39. package/dist/cli/{index-jabkn643.js → index-n4hwcsbd.js} +2 -2
  40. package/dist/cli/{index-z6v7kwpa.js → index-q6bhmyxb.js} +1 -1
  41. package/dist/cli/{index-cz25e8xp.js → index-sqe3nqh5.js} +166 -34
  42. package/dist/cli/{index-q67jb94n.js → index-sswzhcqb.js} +1 -1
  43. package/dist/cli/{index-8j0va7jp.js → index-tq89td7b.js} +43 -22
  44. package/dist/cli/{index-dty5qgk2.js → index-vdha477y.js} +1 -1
  45. package/dist/cli/{index-zb0xcz9t.js → index-vngs0meh.js} +3 -3
  46. package/dist/cli/{index-fqcjragy.js → index-wknz5c8q.js} +1 -1
  47. package/dist/cli/{index-9qq7c18c.js → index-ytzz6pq1.js} +36 -1
  48. package/dist/cli/{index-4w5qdbk7.js → index-zde2mkmg.js} +6 -6
  49. package/dist/cli/{index-4nt52yr9.js → index-zj6t9zgx.js} +173 -25
  50. package/dist/cli/{index-btmsqv7p.js → index-zxr5r9b7.js} +5 -4
  51. package/dist/cli/index-zy7f84cs.js +1210 -0
  52. package/dist/cli/index.d.ts +11 -1
  53. package/dist/cli/index.js +61 -39
  54. package/dist/cli/{knowledge-escalator-ypg14d5r.js → knowledge-escalator-yaxzz0k5.js} +12 -11
  55. package/dist/cli/{knowledge-events-nkrym4wb.js → knowledge-events-rgcwewpn.js} +10 -9
  56. package/dist/cli/{knowledge-link-e4qgqmpx.js → knowledge-link-4cg4776a.js} +3 -3
  57. package/dist/cli/{knowledge-store-vh3nhtg2.js → knowledge-store-qf8t25sw.js} +4 -4
  58. package/dist/cli/{knowledge-validator-jrxvexv6.js → knowledge-validator-dx6zzcdf.js} +6 -6
  59. package/dist/cli/{pending-delegations-pw79c8ds.js → pending-delegations-9h1jmtw1.js} +3 -3
  60. package/dist/cli/{pr-subscriptions-fk628bhc.js → pr-subscriptions-8pg34pev.js} +3 -3
  61. package/dist/cli/{runner-b02sz2vx.js → runner-cqecp1na.js} +4 -4
  62. package/dist/cli/{scan-cursor-fp7w5jmc.js → scan-cursor-pbcaj8hj.js} +7 -5
  63. package/dist/cli/{schema-rptwqbm4.js → schema-tzcjwe8j.js} +3 -1
  64. package/dist/cli/{scope-persistence-0bkaxawa.js → scope-persistence-mjg4we75.js} +7 -6
  65. package/dist/cli/{skill-generator-nh8b4gjv.js → skill-generator-7jrzbaej.js} +14 -13
  66. package/dist/cli/{workspace-snapshot-w3tg4ne5.js → workspace-snapshot-d89zm6wm.js} +5 -2
  67. package/dist/cli/{worktree-collision-ownership-hqd9ypsz.js → worktree-collision-ownership-vy0kxa98.js} +26 -19
  68. package/dist/cli/{worktree-isolation-canf3rj8.js → worktree-isolation-awpkp0yh.js} +33 -32
  69. package/dist/cli/{worktree-provisioning-owner-g24xd417.js → worktree-provisioning-owner-zzkjycp1.js} +3 -3
  70. package/dist/commands/ci-simulate.d.ts +2 -0
  71. package/dist/config/cache-paths.d.ts +57 -0
  72. package/dist/config/evidence-schema.d.ts +3 -3
  73. package/dist/config/schema.d.ts +9 -0
  74. package/dist/git/branch.d.ts +2 -0
  75. package/dist/git/pr.d.ts +2 -0
  76. package/dist/hooks/delegation-gate/worktree-isolation.d.ts +7 -0
  77. package/dist/hooks/diff-scope.d.ts +7 -0
  78. package/dist/hooks/review-receipt-scope.d.ts +7 -0
  79. package/dist/hooks/reviewer-scope-lifecycle.d.ts +9 -0
  80. package/dist/hooks/semantic-diff-injection.d.ts +8 -0
  81. package/dist/index.js +599 -589
  82. package/dist/mutation/engine.d.ts +11 -0
  83. package/dist/review/diff-source.d.ts +2 -0
  84. package/dist/sandbox/capability-probe.d.ts +22 -0
  85. package/dist/sandbox/executor.d.ts +15 -0
  86. package/dist/sandbox/linux/bubblewrap-executor.d.ts +6 -0
  87. package/dist/sandbox/macos/sandbox-exec-executor.d.ts +41 -0
  88. package/dist/tools/checkpoint.d.ts +11 -0
  89. package/dist/tools/complexity-hotspots.d.ts +15 -0
  90. package/dist/tools/diff-summary.d.ts +12 -0
  91. package/dist/tools/dispatch-lanes.d.ts +8 -0
  92. package/dist/tools/gh-evidence.d.ts +17 -1
  93. package/dist/tools/knowledge-receipt.d.ts +1 -1
  94. package/dist/tools/pkg-audit.d.ts +13 -0
  95. package/dist/tools/prepare-pr-workflow-checkout.d.ts +1 -0
  96. package/dist/utils/bun-compat.d.ts +80 -3
  97. package/dist/utils/git-binary-missing-error.d.ts +80 -2
  98. package/dist/utils/git-executable.d.ts +179 -0
  99. package/dist/utils/gitignore-warning.d.ts +10 -0
  100. package/dist/workflow/coder-settlement.d.ts +18 -0
  101. package/dist/worktree/core.d.ts +8 -0
  102. package/dist/worktree/merge.d.ts +33 -0
  103. package/package.json +3 -2
  104. package/dist/cli/curator-llm-factory-xgb4pxmm.js +0 -62
  105. package/dist/cli/guardrail-explain-6wcgr9tz.js +0 -63
  106. package/dist/cli/index-q1exe2b3.js +0 -256
@@ -20,62 +20,63 @@ import {
20
20
  sanitizeWorktreeTaskId,
21
21
  standardWorktreeByCallID,
22
22
  standardWorktreeSerializationSessions
23
- } from "./index-q4ed1jk7.js";
24
- import"./index-d12jd5mn.js";
25
- import"./index-h98t1m88.js";
26
- import"./index-az8etqpp.js";
23
+ } from "./index-42ezdzam.js";
24
+ import"./index-dj8cah6s.js";
25
+ import"./index-01nhedm7.js";
26
+ import"./index-fgdhf6a5.js";
27
27
  import"./index-134d35c1.js";
28
- import"./index-b6e016tv.js";
29
- import"./index-1csyxv0f.js";
30
- import"./index-fqcjragy.js";
28
+ import"./index-abtrcs16.js";
29
+ import"./index-6z5jtf7d.js";
30
+ import"./index-wknz5c8q.js";
31
31
  import"./index-y8552snf.js";
32
- import"./index-nckg4gxb.js";
32
+ import"./index-h5krb653.js";
33
33
  import"./index-70ha9e09.js";
34
34
  import"./index-c8s9a3zh.js";
35
35
  import"./index-9ss2m4rs.js";
36
- import"./index-74hpm6sh.js";
37
- import"./index-bt9aa01f.js";
38
- import"./index-zb0xcz9t.js";
39
- import"./index-x6tp0hfr.js";
40
- import"./index-yts89pqg.js";
41
- import"./index-dty5qgk2.js";
36
+ import"./index-f36ybbsv.js";
37
+ import"./index-hkdgkkhb.js";
38
+ import"./index-vngs0meh.js";
39
+ import"./index-n06653nr.js";
40
+ import"./index-bac12jpv.js";
41
+ import"./index-vdha477y.js";
42
42
  import"./index-rtry5xyf.js";
43
43
  import"./index-zsrtt42s.js";
44
- import"./index-jabkn643.js";
45
- import"./index-k3cxyk66.js";
46
- import"./index-cz25e8xp.js";
47
- import"./index-8j0va7jp.js";
48
- import"./index-pw83zgny.js";
49
- import"./index-z6v7kwpa.js";
44
+ import"./index-n4hwcsbd.js";
45
+ import"./index-cwtpqm5f.js";
46
+ import"./index-sqe3nqh5.js";
47
+ import"./index-tq89td7b.js";
48
+ import"./index-dvybg11w.js";
49
+ import"./index-q6bhmyxb.js";
50
50
  import"./index-556ja8an.js";
51
51
  import"./index-7sy3aa9m.js";
52
52
  import"./index-wx8zdh4a.js";
53
- import"./index-8fwhhayc.js";
54
- import"./index-q1exe2b3.js";
55
- import"./index-03pv47h2.js";
56
- import"./index-4w5qdbk7.js";
53
+ import"./index-b44qqqt2.js";
54
+ import"./index-zy7f84cs.js";
55
+ import"./index-ec1kywxg.js";
56
+ import"./index-zde2mkmg.js";
57
57
  import {
58
58
  resolveWorktreeIsolationConfig
59
- } from "./index-psvxq93b.js";
59
+ } from "./index-ckq719fr.js";
60
60
  import"./index-gprxjmm7.js";
61
61
  import"./index-n832052r.js";
62
- import"./index-rn0eq85g.js";
62
+ import"./index-fv0s19g9.js";
63
63
  import"./index-z6xqpmqg.js";
64
- import"./index-9qq7c18c.js";
65
- import"./index-y8j8ehc8.js";
66
- import"./index-4rhhvd1a.js";
64
+ import"./index-ytzz6pq1.js";
65
+ import"./index-68mqwvf5.js";
67
66
  import"./index-v3y3qg48.js";
67
+ import"./index-9e6fdz2h.js";
68
+ import"./index-4rhhvd1a.js";
68
69
  import"./index-zjygnfay.js";
69
70
  import"./index-ae75rja9.js";
70
- import"./index-ywn7vtxp.js";
71
- import"./index-mazgg5s2.js";
71
+ import"./index-h1p08s3n.js";
72
+ import"./index-9s8drsf9.js";
72
73
  import"./index-ed5ykebp.js";
73
74
  import"./index-bk5tah7q.js";
74
75
  import"./index-f9vvg5xb.js";
75
76
  import"./index-1jsmmx7y.js";
76
77
  import"./index-7g4c7s5r.js";
77
78
  import"./index-bpmtbmy9.js";
78
- import"./index-4nt52yr9.js";
79
+ import"./index-zj6t9zgx.js";
79
80
  import"./index-zgwm4ryv.js";
80
81
  import"./index-a76rekgs.js";
81
82
  export {
@@ -5,12 +5,12 @@ import {
5
5
  recordWorktreeProvisioningOwner,
6
6
  removeWorktreeProvisioningOwner,
7
7
  scanWorktreeProvisioningOwnersForRecovery
8
- } from "./index-k3cxyk66.js";
9
- import"./index-rn0eq85g.js";
8
+ } from "./index-cwtpqm5f.js";
9
+ import"./index-fv0s19g9.js";
10
10
  import"./index-z6xqpmqg.js";
11
11
  import"./index-zjygnfay.js";
12
12
  import"./index-ed5ykebp.js";
13
- import"./index-4nt52yr9.js";
13
+ import"./index-zj6t9zgx.js";
14
14
  import"./index-zgwm4ryv.js";
15
15
  import"./index-a76rekgs.js";
16
16
  export {
@@ -22,10 +22,12 @@
22
22
  import * as fs from 'node:fs';
23
23
  import { detectDefaultRemoteBranch, getDefaultBaseBranch } from '../git/branch.js';
24
24
  import { runExternalTool } from '../utils/external-tool-runner.js';
25
+ import { resolveGitExecutable } from '../utils/git-executable.js';
25
26
  export declare const _internals: {
26
27
  runExternalTool: typeof runExternalTool;
27
28
  getDefaultBaseBranch: typeof getDefaultBaseBranch;
28
29
  detectDefaultRemoteBranch: typeof detectDefaultRemoteBranch;
30
+ resolveGitExecutable: typeof resolveGitExecutable;
29
31
  platform: string;
30
32
  osTmpdir: () => string;
31
33
  fs: {
@@ -63,3 +63,60 @@ export declare function getPluginCachePaths(): readonly string[];
63
63
  * be cleared during update/install to force a fresh resolution from npm.
64
64
  */
65
65
  export declare function getPluginLockFilePaths(): readonly string[];
66
+ /**
67
+ * Anchored version-pinned cache leaf shape: `opencode-swarm@<semver>`, e.g.
68
+ * `opencode-swarm@7.143.1`, `opencode-swarm@1.2.3-rc.1`,
69
+ * `opencode-swarm@1.2.3+build.5`. Matches full `major.minor.patch` with
70
+ * optional pre-release and build-metadata segments (semver 2.0.0 grammar).
71
+ *
72
+ * Deliberately NOT a `startsWith('opencode-swarm@')` prefix test — that would
73
+ * admit a traversal payload like `opencode-swarm@../../..` as a "valid" leaf.
74
+ * The anchored `^...$` with only `[0-9A-Za-z.-]` permitted in the
75
+ * pre-release/build segments admits no path separator, NUL byte, whitespace,
76
+ * or non-ASCII character. Shared by the delete-time safety check
77
+ * (`isSafeCachePath` in `src/cli/index.ts`, applied AFTER canonicalization)
78
+ * and this module's own discovery function below, so both agree on exactly
79
+ * which leaves are "version-pinned opencode-swarm" without duplicating the
80
+ * pattern (issue #2236 RC3).
81
+ */
82
+ export declare const VERSION_PINNED_LEAF: RegExp;
83
+ /**
84
+ * Enumerate `packages/` parent directories for version-pinned opencode-swarm
85
+ * cache leaves (e.g. `opencode-swarm@7.143.1`) that {@link getPluginCachePaths}
86
+ * cannot discover — that list is fixed to the literal `opencode-swarm@latest`
87
+ * / `opencode-swarm` leaves, so a version-pinned OpenCode host install (issue
88
+ * #2236's reporter had `opencode-swarm@7.143.1`) is invisible to it.
89
+ *
90
+ * PERFORMS FILESYSTEM I/O (`readdirSync`). Callers MUST invoke this at
91
+ * COMMAND TIME only — never at module scope — to preserve AGENTS.md
92
+ * invariant 1 (plugin init must stay side-effect-minimal).
93
+ * {@link getPluginCachePaths} stays pure specifically so it can keep being
94
+ * called at module scope (`src/cli/index.ts:45`); this is the separate,
95
+ * impure counterpart invoked explicitly by `update()` (`src/cli/index.ts`)
96
+ * and the `/swarm diagnose` cache check (`src/services/diagnose-service.ts`).
97
+ *
98
+ * Returns full paths to matched entries. Does NOT apply the delete-time
99
+ * safety allowlist (`isSafeCachePath` in `src/cli/index.ts`) — callers that
100
+ * intend to delete a returned path MUST still run it through that check, and
101
+ * the check MUST run on the realpath-canonicalized string, exactly like every
102
+ * other cache-deletion call site.
103
+ */
104
+ export declare function discoverVersionPinnedCachePaths(): string[];
105
+ /**
106
+ * Resolve a cache path to its actual package root. Some OpenCode cache
107
+ * layouts nest the package under `<cachePath>/node_modules/opencode-swarm`;
108
+ * others ARE the package root directly. Shared by `evictPluginCaches`
109
+ * (`src/cli/index.ts`, to read the pre-deletion version) and the
110
+ * `/swarm diagnose` cache check (`src/services/diagnose-service.ts`) so both
111
+ * agree on where `package.json` lives for a given cache path, per issue
112
+ * #2236 RC3 ("don't duplicate the version-reading logic").
113
+ */
114
+ export declare function resolveCachePackageRoot(cachePath: string): string;
115
+ /**
116
+ * Best-effort read of the installed opencode-swarm version at a cache path.
117
+ * Returns `null` (never throws) if `package.json` is missing, unreadable, or
118
+ * unparsable — this feeds human-readable console/diagnostic reporting, not a
119
+ * safety decision, so a version that can't be determined must degrade
120
+ * gracefully rather than abort the caller's eviction/diagnosis loop.
121
+ */
122
+ export declare function readCachePackageVersion(cachePath: string): string | null;
@@ -220,10 +220,10 @@ export declare const RetrospectiveEvidenceSchema: z.ZodObject<{
220
220
  user_directives: z.ZodDefault<z.ZodArray<z.ZodObject<{
221
221
  directive: z.ZodString;
222
222
  category: z.ZodEnum<{
223
+ other: "other";
223
224
  process: "process";
224
225
  architecture: "architecture";
225
226
  tooling: "tooling";
226
- other: "other";
227
227
  code_style: "code_style";
228
228
  }>;
229
229
  scope: z.ZodEnum<{
@@ -743,10 +743,10 @@ export declare const EvidenceSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
743
743
  user_directives: z.ZodDefault<z.ZodArray<z.ZodObject<{
744
744
  directive: z.ZodString;
745
745
  category: z.ZodEnum<{
746
+ other: "other";
746
747
  process: "process";
747
748
  architecture: "architecture";
748
749
  tooling: "tooling";
749
- other: "other";
750
750
  code_style: "code_style";
751
751
  }>;
752
752
  scope: z.ZodEnum<{
@@ -1233,10 +1233,10 @@ export declare const EvidenceBundleSchema: z.ZodObject<{
1233
1233
  user_directives: z.ZodDefault<z.ZodArray<z.ZodObject<{
1234
1234
  directive: z.ZodString;
1235
1235
  category: z.ZodEnum<{
1236
+ other: "other";
1236
1237
  process: "process";
1237
1238
  architecture: "architecture";
1238
1239
  tooling: "tooling";
1239
- other: "other";
1240
1240
  code_style: "code_style";
1241
1241
  }>;
1242
1242
  scope: z.ZodEnum<{
@@ -462,6 +462,10 @@ export declare const DesignDocsConfigSchema: z.ZodObject<{
462
462
  language: z.ZodOptional<z.ZodString>;
463
463
  }, z.core.$strip>;
464
464
  export type DesignDocsConfig = z.infer<typeof DesignDocsConfigSchema>;
465
+ export declare const GitConfigSchema: z.ZodObject<{
466
+ binary: z.ZodOptional<z.ZodString>;
467
+ }, z.core.$strip>;
468
+ export type GitConfig = z.infer<typeof GitConfigSchema>;
465
469
  export declare const UIReviewConfigSchema: z.ZodObject<{
466
470
  enabled: z.ZodDefault<z.ZodBoolean>;
467
471
  trigger_paths: z.ZodDefault<z.ZodArray<z.ZodString>>;
@@ -550,6 +554,7 @@ export declare const GuardrailsConfigSchema: z.ZodObject<{
550
554
  execution_stall_warn_calls: z.ZodDefault<z.ZodNumber>;
551
555
  execution_stall_stop_calls: z.ZodDefault<z.ZodNumber>;
552
556
  execution_stall_episode_minutes: z.ZodDefault<z.ZodNumber>;
557
+ sandbox_macos_enabled: z.ZodOptional<z.ZodBoolean>;
553
558
  }, z.core.$strip>;
554
559
  export type GuardrailsConfig = z.infer<typeof GuardrailsConfigSchema>;
555
560
  export declare const WatchdogConfigSchema: z.ZodObject<{
@@ -1917,6 +1922,7 @@ export declare const PluginConfigSchema: z.ZodObject<{
1917
1922
  execution_stall_warn_calls: z.ZodDefault<z.ZodNumber>;
1918
1923
  execution_stall_stop_calls: z.ZodDefault<z.ZodNumber>;
1919
1924
  execution_stall_episode_minutes: z.ZodDefault<z.ZodNumber>;
1925
+ sandbox_macos_enabled: z.ZodOptional<z.ZodBoolean>;
1920
1926
  }, z.core.$strip>>;
1921
1927
  watchdog: z.ZodOptional<z.ZodObject<{
1922
1928
  scope_guard: z.ZodDefault<z.ZodBoolean>;
@@ -2046,6 +2052,9 @@ export declare const PluginConfigSchema: z.ZodObject<{
2046
2052
  out_dir: z.ZodDefault<z.ZodString>;
2047
2053
  language: z.ZodOptional<z.ZodString>;
2048
2054
  }, z.core.$strip>>;
2055
+ git: z.ZodOptional<z.ZodObject<{
2056
+ binary: z.ZodOptional<z.ZodString>;
2057
+ }, z.core.$strip>>;
2049
2058
  ui_review: z.ZodOptional<z.ZodObject<{
2050
2059
  enabled: z.ZodDefault<z.ZodBoolean>;
2051
2060
  trigger_paths: z.ZodDefault<z.ZodArray<z.ZodString>>;
@@ -1,4 +1,5 @@
1
1
  import * as child_process from 'node:child_process';
2
+ import { resolveGitExecutable } from '../utils/git-executable.js';
2
3
  export type GitRepositoryStatus = {
3
4
  isRepo: true;
4
5
  } | {
@@ -201,5 +202,6 @@ export declare const _internals: {
201
202
  resetToMainAfterMerge: typeof resetToMainAfterMerge;
202
203
  spawnSync: typeof __spawnSyncSeam.spawnSync;
203
204
  readLaneEnvFileFromDiskSync: typeof readLaneEnvFileFromDiskSync;
205
+ resolveGitExecutable: typeof resolveGitExecutable;
204
206
  };
205
207
  export {};
package/dist/git/pr.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import * as child_process from 'node:child_process';
2
+ import { resolveGhBinary } from '../tools/gh-evidence.js';
2
3
  import { readLaneEnvFileFromDiskSync } from './branch.js';
3
4
  export declare const GIT_TIMEOUT_MS = 30000;
4
5
  /**
@@ -70,6 +71,7 @@ export declare const _internals: {
70
71
  spawnSync: typeof __spawnSyncSeam.spawnSync;
71
72
  readLaneEnvFileFromDiskSync: typeof readLaneEnvFileFromDiskSync;
72
73
  getMergeGroupRun: typeof getMergeGroupRun;
74
+ resolveGhBinary: typeof resolveGhBinary;
73
75
  };
74
76
  /**
75
77
  * Check if gh CLI is available
@@ -11,6 +11,7 @@
11
11
  import type { PluginConfig, WorktreeIsolationConfig } from '../../config';
12
12
  import { tryAcquireLock } from '../../parallel/file-locks';
13
13
  import { bunSpawn } from '../../utils/bun-compat';
14
+ import { resolveGitExecutable } from '../../utils/git-executable.js';
14
15
  import type { WorktreeHandle } from '../../worktree';
15
16
  import { attemptMergeBackFromDirty, cleanupOrphanedBranches, postMergeCleanup, provisionWorktree, pruneStaleWorktreeMetadata, removeWorktree, startupOrphanRecovery } from '../../worktree';
16
17
  import type { DirtyMergeOptions, MergeOperationProvenance } from '../../worktree/merge';
@@ -338,4 +339,10 @@ export declare const _internals: {
338
339
  isLaneOwnedByCurrentSession: typeof isLaneOwnedByCurrentSession;
339
340
  /** FR-001b: bunSpawn — exposed for test injection so collision check can be mocked. */
340
341
  bunSpawn: typeof bunSpawn;
342
+ /**
343
+ * Issue #2236 hardening (F1/F4/F5) — resolves the absolute git executable
344
+ * path instead of spawning the bare `'git'` name. Exposed for test
345
+ * injection following the `src/worktree/core.ts` convention.
346
+ */
347
+ resolveGitExecutable: typeof resolveGitExecutable;
341
348
  };
@@ -5,6 +5,7 @@
5
5
  * Never throws.
6
6
  */
7
7
  import { bunSpawn } from '../utils/bun-compat';
8
+ import { resolveGitExecutable } from '../utils/git-executable.js';
8
9
  /**
9
10
  * Test-only dependency-injection seam — see `gitignore-warning.ts:_internals`
10
11
  * for the rationale (`mock.module` from `bun:test` leaks across files in
@@ -13,6 +14,12 @@ import { bunSpawn } from '../utils/bun-compat';
13
14
  */
14
15
  export declare const _internals: {
15
16
  bunSpawn: typeof bunSpawn;
17
+ /**
18
+ * Test seam for git binary resolution (issue #2236 hardening, lane C1b).
19
+ * This hook is not on the plugin init path, so the synchronous resolver
20
+ * is used (unlike `gitignore-warning.ts`, which must use the async one).
21
+ */
22
+ resolveGitExecutable: typeof resolveGitExecutable;
16
23
  };
17
24
  /**
18
25
  * Validate that git-changed files match the declared scope for a task.
@@ -17,6 +17,7 @@
17
17
  */
18
18
  import * as child_process from 'node:child_process';
19
19
  import * as fs from 'node:fs';
20
+ import { resolveGitExecutable } from '../utils/git-executable.js';
20
21
  export declare const REVIEWER_TASK_SCOPE_DESCRIPTION = "reviewer-task-files-v2";
21
22
  export declare const REVIEWER_TASK_SCOPE_HEADER = "opencode-swarm-reviewer-task-scope-v2";
22
23
  export interface ReviewerTaskScopeDeliveryEntry {
@@ -82,6 +83,12 @@ export declare function resolveReviewerScopeTaskId(directory: string, args: unkn
82
83
  export declare const _internals: {
83
84
  spawn: typeof child_process.spawn;
84
85
  realpath: typeof fs.promises.realpath;
86
+ /**
87
+ * Issue #2236 hardening (F1/F4/F5) — resolves the absolute git executable
88
+ * path instead of spawning the bare `'git'` name. Exposed for test
89
+ * injection following the `src/worktree/core.ts` convention.
90
+ */
91
+ resolveGitExecutable: typeof resolveGitExecutable;
85
92
  };
86
93
  /**
87
94
  * Build the exact reviewer-task manifest for a guardrails-observed file list.
@@ -1,4 +1,5 @@
1
1
  import * as child_process from 'node:child_process';
2
+ import { resolveGitExecutable } from '../utils/git-executable.js';
2
3
  export type ReviewerScopeLifecycleTransition = 'coder_started' | 'coder_ready' | 'coder_no_change' | 'reviewer_claimed';
3
4
  /** Test-only dependency-injection seam for the no-change status probe. */
4
5
  export declare const _internals: {
@@ -6,6 +7,14 @@ export declare const _internals: {
6
7
  backoffMs?: number;
7
8
  /** Test-only deadline override for the bounded retry loop (ms). */
8
9
  retryDeadlineMs?: number;
10
+ /**
11
+ * Issue #2236 hardening (F1/F4/F5) — resolves the absolute git executable
12
+ * path instead of spawning the bare `'git'` name, which resolves against
13
+ * the PATH inside the child's env and can pick up an unintended binary.
14
+ * Exposed for test injection following the convention in
15
+ * `src/hooks/review-receipt-scope.ts`.
16
+ */
17
+ resolveGitExecutable: typeof resolveGitExecutable;
9
18
  };
10
19
  /** Run only after the complete blocking before-chain approved this Task call. */
11
20
  export declare function beginApprovedReviewerScopeLifecycle(input: {
@@ -13,6 +13,7 @@ import { computeASTDiff } from '../diff/ast-diff.js';
13
13
  import { classifyChanges } from '../diff/semantic-classifier.js';
14
14
  import { generateSummary, generateSummaryMarkdown } from '../diff/summary-generator.js';
15
15
  import { getImporters, normalizeGraphPath } from '../tools/repo-graph.js';
16
+ import { resolveGitExecutable } from '../utils/git-executable.js';
16
17
  import { getCachedGraph, type RepoGraphInjectionOptions } from './repo-graph-injection.js';
17
18
  export declare const _internals: {
18
19
  execFile: typeof child_process.execFile;
@@ -25,7 +26,13 @@ export declare const _internals: {
25
26
  getCachedGraph: typeof getCachedGraph;
26
27
  getImporters: typeof getImporters;
27
28
  normalizeGraphPath: typeof normalizeGraphPath;
29
+ resolveGitExecutable: typeof resolveGitExecutable;
30
+ execGit: typeof execGit;
28
31
  };
32
+ declare function execGit(directory: string, args: string[], options?: {
33
+ timeout?: number;
34
+ maxBuffer?: number;
35
+ }): Promise<string>;
29
36
  /**
30
37
  * Build a semantic diff summary block for the given changed files.
31
38
  *
@@ -41,3 +48,4 @@ export declare const _internals: {
41
48
  * Returns null if no changes are detected or on failure.
42
49
  */
43
50
  export declare function buildSemanticDiffBlock(directory: string, changedFiles: string[], maxFiles?: number, repoGraphOptions?: RepoGraphInjectionOptions): Promise<string | null>;
51
+ export {};