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.
- package/.opencode/skills/swarm-pr-review/references/prompt-templates.md +2 -2
- package/dist/background/workspace-snapshot.d.ts +7 -0
- package/dist/cli/{capability-probe-f1paszww.js → capability-probe-976tt4ba.js} +6 -2
- package/dist/cli/{config-doctor-rw9zrjk6.js → config-doctor-4chz0b95.js} +2 -2
- package/dist/cli/{core-zjx9aqaf.js → core-p04nvknr.js} +4 -3
- package/dist/cli/{curation-policy-0wbrh11c.js → curation-policy-a511r0qz.js} +4 -4
- package/dist/cli/{curator-drift-2jbjv03a.js → curator-drift-ckjm272w.js} +2 -2
- package/dist/cli/curator-llm-factory-vc1mrc3r.js +63 -0
- package/dist/cli/{curator-g54a7wv0.js → curator-sxeh36gw.js} +33 -32
- package/dist/cli/{dispatch-1y1rnv1h.js → dispatch-ndxbsk98.js} +2 -2
- package/dist/cli/{evidence-summary-service-fnr5y54e.js → evidence-summary-service-spyxcgsx.js} +13 -12
- package/dist/cli/{gate-evidence-2xt1x07r.js → gate-evidence-nz0bwa15.js} +7 -6
- package/dist/cli/guardrail-explain-ass47kn8.js +64 -0
- package/dist/cli/{guardrail-log-5w4b9zrw.js → guardrail-log-fyzd55fp.js} +4 -4
- package/dist/cli/{hive-promoter-x63ehffd.js → hive-promoter-k8gtah3n.js} +33 -32
- package/dist/cli/{index-h98t1m88.js → index-01nhedm7.js} +29 -1
- package/dist/cli/{index-q4ed1jk7.js → index-42ezdzam.js} +1994 -1333
- package/dist/cli/{index-y8j8ehc8.js → index-68mqwvf5.js} +11 -5
- package/dist/cli/{index-1csyxv0f.js → index-6z5jtf7d.js} +2 -2
- package/dist/cli/{index-2m7mavaz.js → index-7zehmnv1.js} +2 -2
- package/dist/cli/index-9e6fdz2h.js +282 -0
- package/dist/cli/{index-mazgg5s2.js → index-9s8drsf9.js} +1 -1
- package/dist/cli/{index-b6e016tv.js → index-abtrcs16.js} +1 -1
- package/dist/cli/{index-8fwhhayc.js → index-b44qqqt2.js} +27 -18
- package/dist/cli/{index-yts89pqg.js → index-bac12jpv.js} +4 -4
- package/dist/cli/{index-psvxq93b.js → index-ckq719fr.js} +2 -2
- package/dist/cli/{index-k3cxyk66.js → index-cwtpqm5f.js} +1 -1
- package/dist/cli/{index-d12jd5mn.js → index-dj8cah6s.js} +1 -1
- package/dist/cli/{index-pw83zgny.js → index-dvybg11w.js} +3 -3
- package/dist/cli/{index-03pv47h2.js → index-ec1kywxg.js} +6 -6
- package/dist/cli/{index-74hpm6sh.js → index-f36ybbsv.js} +12 -6
- package/dist/cli/{index-az8etqpp.js → index-fgdhf6a5.js} +298 -1179
- package/dist/cli/{index-rn0eq85g.js → index-fv0s19g9.js} +1 -1
- package/dist/cli/{index-ywn7vtxp.js → index-h1p08s3n.js} +1 -1
- package/dist/cli/{index-nckg4gxb.js → index-h5krb653.js} +15 -4
- package/dist/cli/{index-bt9aa01f.js → index-hkdgkkhb.js} +1 -1
- package/dist/cli/{index-p7cm3gtj.js → index-jqvsh0g3.js} +35 -34
- package/dist/cli/{index-x6tp0hfr.js → index-n06653nr.js} +5 -5
- package/dist/cli/{index-jabkn643.js → index-n4hwcsbd.js} +2 -2
- package/dist/cli/{index-z6v7kwpa.js → index-q6bhmyxb.js} +1 -1
- package/dist/cli/{index-cz25e8xp.js → index-sqe3nqh5.js} +166 -34
- package/dist/cli/{index-q67jb94n.js → index-sswzhcqb.js} +1 -1
- package/dist/cli/{index-8j0va7jp.js → index-tq89td7b.js} +43 -22
- package/dist/cli/{index-dty5qgk2.js → index-vdha477y.js} +1 -1
- package/dist/cli/{index-zb0xcz9t.js → index-vngs0meh.js} +3 -3
- package/dist/cli/{index-fqcjragy.js → index-wknz5c8q.js} +1 -1
- package/dist/cli/{index-9qq7c18c.js → index-ytzz6pq1.js} +36 -1
- package/dist/cli/{index-4w5qdbk7.js → index-zde2mkmg.js} +6 -6
- package/dist/cli/{index-4nt52yr9.js → index-zj6t9zgx.js} +173 -25
- package/dist/cli/{index-btmsqv7p.js → index-zxr5r9b7.js} +5 -4
- package/dist/cli/index-zy7f84cs.js +1210 -0
- package/dist/cli/index.d.ts +11 -1
- package/dist/cli/index.js +61 -39
- package/dist/cli/{knowledge-escalator-ypg14d5r.js → knowledge-escalator-yaxzz0k5.js} +12 -11
- package/dist/cli/{knowledge-events-nkrym4wb.js → knowledge-events-rgcwewpn.js} +10 -9
- package/dist/cli/{knowledge-link-e4qgqmpx.js → knowledge-link-4cg4776a.js} +3 -3
- package/dist/cli/{knowledge-store-vh3nhtg2.js → knowledge-store-qf8t25sw.js} +4 -4
- package/dist/cli/{knowledge-validator-jrxvexv6.js → knowledge-validator-dx6zzcdf.js} +6 -6
- package/dist/cli/{pending-delegations-pw79c8ds.js → pending-delegations-9h1jmtw1.js} +3 -3
- package/dist/cli/{pr-subscriptions-fk628bhc.js → pr-subscriptions-8pg34pev.js} +3 -3
- package/dist/cli/{runner-b02sz2vx.js → runner-cqecp1na.js} +4 -4
- package/dist/cli/{scan-cursor-fp7w5jmc.js → scan-cursor-pbcaj8hj.js} +7 -5
- package/dist/cli/{schema-rptwqbm4.js → schema-tzcjwe8j.js} +3 -1
- package/dist/cli/{scope-persistence-0bkaxawa.js → scope-persistence-mjg4we75.js} +7 -6
- package/dist/cli/{skill-generator-nh8b4gjv.js → skill-generator-7jrzbaej.js} +14 -13
- package/dist/cli/{workspace-snapshot-w3tg4ne5.js → workspace-snapshot-d89zm6wm.js} +5 -2
- package/dist/cli/{worktree-collision-ownership-hqd9ypsz.js → worktree-collision-ownership-vy0kxa98.js} +26 -19
- package/dist/cli/{worktree-isolation-canf3rj8.js → worktree-isolation-awpkp0yh.js} +33 -32
- package/dist/cli/{worktree-provisioning-owner-g24xd417.js → worktree-provisioning-owner-zzkjycp1.js} +3 -3
- package/dist/commands/ci-simulate.d.ts +2 -0
- package/dist/config/cache-paths.d.ts +57 -0
- package/dist/config/evidence-schema.d.ts +3 -3
- package/dist/config/schema.d.ts +9 -0
- package/dist/git/branch.d.ts +2 -0
- package/dist/git/pr.d.ts +2 -0
- package/dist/hooks/delegation-gate/worktree-isolation.d.ts +7 -0
- package/dist/hooks/diff-scope.d.ts +7 -0
- package/dist/hooks/review-receipt-scope.d.ts +7 -0
- package/dist/hooks/reviewer-scope-lifecycle.d.ts +9 -0
- package/dist/hooks/semantic-diff-injection.d.ts +8 -0
- package/dist/index.js +599 -589
- package/dist/mutation/engine.d.ts +11 -0
- package/dist/review/diff-source.d.ts +2 -0
- package/dist/sandbox/capability-probe.d.ts +22 -0
- package/dist/sandbox/executor.d.ts +15 -0
- package/dist/sandbox/linux/bubblewrap-executor.d.ts +6 -0
- package/dist/sandbox/macos/sandbox-exec-executor.d.ts +41 -0
- package/dist/tools/checkpoint.d.ts +11 -0
- package/dist/tools/complexity-hotspots.d.ts +15 -0
- package/dist/tools/diff-summary.d.ts +12 -0
- package/dist/tools/dispatch-lanes.d.ts +8 -0
- package/dist/tools/gh-evidence.d.ts +17 -1
- package/dist/tools/knowledge-receipt.d.ts +1 -1
- package/dist/tools/pkg-audit.d.ts +13 -0
- package/dist/tools/prepare-pr-workflow-checkout.d.ts +1 -0
- package/dist/utils/bun-compat.d.ts +80 -3
- package/dist/utils/git-binary-missing-error.d.ts +80 -2
- package/dist/utils/git-executable.d.ts +179 -0
- package/dist/utils/gitignore-warning.d.ts +10 -0
- package/dist/workflow/coder-settlement.d.ts +18 -0
- package/dist/worktree/core.d.ts +8 -0
- package/dist/worktree/merge.d.ts +33 -0
- package/package.json +3 -2
- package/dist/cli/curator-llm-factory-xgb4pxmm.js +0 -62
- package/dist/cli/guardrail-explain-6wcgr9tz.js +0 -63
- package/dist/cli/index-q1exe2b3.js +0 -256
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Single source of truth for "what absolute path do we invoke for git."
|
|
3
|
+
*
|
|
4
|
+
* Issue #2236 hardening (F1/F4/F5) — this module is NOT the fix for #2236
|
|
5
|
+
* (that was a stale worktree `cwd`, fixed elsewhere). It closes a real
|
|
6
|
+
* latent defect class the issue also asked for: `gitExec()`-style call
|
|
7
|
+
* sites spawn the slash-less name `git` while passing an explicit `env`
|
|
8
|
+
* object, and on POSIX there is no absolute-path candidate that would make
|
|
9
|
+
* PATH resolution unnecessary. See
|
|
10
|
+
* `.agents/issue-traces/2236-gitexec-enoent-posix-spawn/07-approved-plan.md`
|
|
11
|
+
* sections F1, F4, F5.
|
|
12
|
+
*
|
|
13
|
+
* Candidate order (built as ONE list and probed in a single pass — do NOT
|
|
14
|
+
* rely on a first-match-only PATH scan to order anything; on a darwin host
|
|
15
|
+
* with `PATH=/usr/bin:/bin` that would return the xcode-select
|
|
16
|
+
* `/usr/bin/git` shim before the homebrew candidates that exist precisely
|
|
17
|
+
* to avoid it):
|
|
18
|
+
*
|
|
19
|
+
* 1. explicit override — `OPENCODE_SWARM_GIT_BINARY` env var, else the
|
|
20
|
+
* value registered via `setGitBinaryOverride` (the USER-LEVEL config
|
|
21
|
+
* `git.binary`; a project/repo-supplied value is refused before it ever
|
|
22
|
+
* reaches this module — see `enforceGitBinaryProvenance` in
|
|
23
|
+
* `src/config/loader.ts`);
|
|
24
|
+
* 2. platform absolute candidates (darwin/linux/win32 — see
|
|
25
|
+
* `platformCandidates`);
|
|
26
|
+
* 3. ALL PATH matches for `git` (every PATH entry is scanned, not just
|
|
27
|
+
* the first hit);
|
|
28
|
+
* 4. bare `'git'` LAST, as an unprobed terminal fallback so a host that
|
|
29
|
+
* works today via plain PATH resolution does not regress.
|
|
30
|
+
*
|
|
31
|
+
* Each non-bare candidate is validated once with `git --version` (bounded
|
|
32
|
+
* timeout, explicit cwd) before being accepted — this rejects a macOS
|
|
33
|
+
* `/usr/bin/git` xcode-select shim that exists on disk but fails with
|
|
34
|
+
* `xcrun: error: invalid active developer path`, and it compensates for
|
|
35
|
+
* `isExecutableFile`'s missing `X_OK` check
|
|
36
|
+
* (`src/utils/external-tool-runner.ts`). Exit 0 alone does NOT accept a
|
|
37
|
+
* candidate: the output must match git's own `git version <n>.<n>` format
|
|
38
|
+
* (`GIT_VERSION_PATTERN`), so a non-git program that merely exits 0 is not
|
|
39
|
+
* mistaken for git BY ACCIDENT. That format check is not an anti-tampering
|
|
40
|
+
* control — see `GIT_VERSION_PATTERN` below for what it can and cannot do;
|
|
41
|
+
* the control over which binaries may be NAMED at all is
|
|
42
|
+
* `enforceGitBinaryProvenance` in `src/config/loader.ts`.
|
|
43
|
+
*
|
|
44
|
+
* Bounded probing (AGENTS.md invariant 1 — plugin init is fast and
|
|
45
|
+
* side-effect-minimal): per-probe timeout 250ms, total first-resolution
|
|
46
|
+
* budget 1000ms.
|
|
47
|
+
*
|
|
48
|
+
* This resolver NEVER throws. Both non-accepting outcomes — "the budget was
|
|
49
|
+
* exhausted before every candidate had been tried" and "every candidate we
|
|
50
|
+
* could enumerate was probed and rejected" — return the bare name `'git'`
|
|
51
|
+
* (candidate 4 above), unprobed.
|
|
52
|
+
*
|
|
53
|
+
* An earlier revision threw `GitBinaryMissingError` on the all-rejected
|
|
54
|
+
* outcome, justified by "a bare `'git'` spawn would hit the exact same PATH
|
|
55
|
+
* entries and fail identically." That justification is refuted by this
|
|
56
|
+
* issue's own root-cause analysis: a slash-less spawn does NOT resolve
|
|
57
|
+
* against the PATH this module enumerates. `pathCandidates()` reads
|
|
58
|
+
* `_internals.env().PATH`, whereas the runtime resolves a bare name against
|
|
59
|
+
* libuv's `_PATH_DEFPATH` (`/usr/bin:/bin`) when the child env carries no
|
|
60
|
+
* PATH, and under Bun against a snapshot taken at PROCESS START rather than
|
|
61
|
+
* the live `process.env` (oven-sh/bun#29237). The two sets genuinely differ,
|
|
62
|
+
* so throwing reintroduced issue #2236's own defect class — reporting git as
|
|
63
|
+
* unavailable on a host where git works — precisely in the degraded-PATH
|
|
64
|
+
* state #2236 nominates as the reporter's candidate trigger. Measured:
|
|
65
|
+
* platform `linux` with `PATH=/usr/bin:/bin` threw after ZERO probes (all
|
|
66
|
+
* three POSIX candidates stat-reject in microseconds, so the budget never
|
|
67
|
+
* trips) and stayed cached for 60s.
|
|
68
|
+
*
|
|
69
|
+
* The actionable diagnostic is not lost by falling through — it moves one
|
|
70
|
+
* layer up, to the caller that actually observes a failed spawn:
|
|
71
|
+
* `gitExec()` (`src/git/branch.ts`) renders `describeGitResolution()` into
|
|
72
|
+
* the `GitBinaryMissingError` it throws when the spawn itself fails.
|
|
73
|
+
*
|
|
74
|
+
* Caching: a successful resolution is memoized for the process lifetime. A
|
|
75
|
+
* bare-fallback outcome is memoized with a 60s TTL, then re-probed. Without
|
|
76
|
+
* any negative cache a git-less host would pay the full probe budget on
|
|
77
|
+
* every call; a permanent negative cache would mean a host that installs
|
|
78
|
+
* git mid-session stays broken until restart.
|
|
79
|
+
*/
|
|
80
|
+
import { spawnSync } from 'node:child_process';
|
|
81
|
+
/** Env var escape hatch — a blocked user can set this without editing files. */
|
|
82
|
+
export declare const GIT_BINARY_ENV_VAR = "OPENCODE_SWARM_GIT_BINARY";
|
|
83
|
+
export type GitResolutionCandidateSource = 'override' | 'platform' | 'path';
|
|
84
|
+
export interface GitResolutionAttempt {
|
|
85
|
+
source: GitResolutionCandidateSource;
|
|
86
|
+
candidate: string;
|
|
87
|
+
accepted: boolean;
|
|
88
|
+
/** Rejection reason; absent when `accepted` is true. */
|
|
89
|
+
reason?: string;
|
|
90
|
+
}
|
|
91
|
+
export interface GitResolutionDescription {
|
|
92
|
+
/**
|
|
93
|
+
* Whether the most recent probe cycle produced a VALIDATED ABSOLUTE PATH.
|
|
94
|
+
*
|
|
95
|
+
* This is deliberately narrower than "resolution returned something
|
|
96
|
+
* usable": `resolveGitExecutable()` returns the unprobed bare `'git'` on
|
|
97
|
+
* the fallback path, and `resolved` stays `false` there because nothing was
|
|
98
|
+
* validated. Consumers rendering a diagnostic want exactly that
|
|
99
|
+
* distinction — `resolvedPath` is likewise `undefined` on the fallback.
|
|
100
|
+
*/
|
|
101
|
+
resolved: boolean;
|
|
102
|
+
resolvedPath?: string;
|
|
103
|
+
attempts: GitResolutionAttempt[];
|
|
104
|
+
overrideValue?: string;
|
|
105
|
+
overrideSource?: 'env' | 'config';
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Resolve the git executable to invoke. Lazy and memoized on first call —
|
|
109
|
+
* nothing is probed at module load. Synchronous; bounded by
|
|
110
|
+
* `TOTAL_BUDGET_MS`. Prefer `resolveGitExecutableAsync()` on any path that
|
|
111
|
+
* runs before plugin init resolves (AGENTS.md invariant 1).
|
|
112
|
+
*/
|
|
113
|
+
export declare function resolveGitExecutable(): string;
|
|
114
|
+
/**
|
|
115
|
+
* Async counterpart. Shares one in-flight resolution across concurrent
|
|
116
|
+
* callers (the `semgrepAvailabilityProbe` precedent in
|
|
117
|
+
* `src/sast/semgrep.ts`) and yields to the event loop between candidate
|
|
118
|
+
* probes so a slow probe budget never blocks the event loop for the full
|
|
119
|
+
* 1000ms in one tick.
|
|
120
|
+
*/
|
|
121
|
+
export declare function resolveGitExecutableAsync(): Promise<string>;
|
|
122
|
+
/**
|
|
123
|
+
* Exported for tests and called by `setGitBinaryOverride` on change.
|
|
124
|
+
*
|
|
125
|
+
* Bumping `cacheGeneration` is load-bearing, not bookkeeping: clearing
|
|
126
|
+
* `inFlightAsync` detaches an in-flight async probe but cannot cancel it, so
|
|
127
|
+
* without the bump that abandoned probe still commits its pre-reset result
|
|
128
|
+
* over the state this reset just established.
|
|
129
|
+
*/
|
|
130
|
+
export declare function resetGitExecutableCache(): void;
|
|
131
|
+
/**
|
|
132
|
+
* TEST-ONLY seam (issue #2236 FR-006 ratchet fix) — NOT a production API, do
|
|
133
|
+
* not call from `src/`. Pre-seeds the resolver cache with an explicit
|
|
134
|
+
* "success" entry so `resolveGitExecutable()` / `resolveGitExecutableAsync()`
|
|
135
|
+
* return `value` immediately with zero probe spawns. Used exclusively by
|
|
136
|
+
* `tests/preload/executable-resolver-pin.ts` so pre-existing test files that
|
|
137
|
+
* assert `cmd[0] === 'git'` (or mock `node:child_process` to assert exact
|
|
138
|
+
* spawnSync call counts/args) do not need a per-file resolver stub. A test
|
|
139
|
+
* that needs the REAL probing behavior calls `resetGitExecutableCache()`
|
|
140
|
+
* first — that clears this seed exactly like any other cache entry, since it
|
|
141
|
+
* is stored in the same `cache` variable.
|
|
142
|
+
*/
|
|
143
|
+
export declare function __seedGitExecutableForTests(value: string): void;
|
|
144
|
+
/**
|
|
145
|
+
* Registers the config-sourced override (`git.binary`). The environment
|
|
146
|
+
* variable `OPENCODE_SWARM_GIT_BINARY` always takes precedence when set —
|
|
147
|
+
* this only registers the config fallback. Resets the cache ONLY when the
|
|
148
|
+
* value actually changes, so a repeat/multi-swarm init does not discard an
|
|
149
|
+
* already-memoized good resolution.
|
|
150
|
+
*
|
|
151
|
+
* SECURITY: callers must pass only a USER-LEVEL value. `git.binary` selects
|
|
152
|
+
* an executable this process spawns, so a value read from a repository's
|
|
153
|
+
* `.opencode/opencode-swarm.json` would be attacker-controlled code
|
|
154
|
+
* selection (CWE-427). The config loader strips a project-supplied value
|
|
155
|
+
* before the merged config is built (`enforceGitBinaryProvenance` in
|
|
156
|
+
* `src/config/loader.ts`), which is why the sole production caller
|
|
157
|
+
* (`src/index.ts`) can pass `config.git?.binary` directly.
|
|
158
|
+
*/
|
|
159
|
+
export declare function setGitBinaryOverride(value?: string): void;
|
|
160
|
+
/**
|
|
161
|
+
* Diagnostic surface: which candidates were tried in the most recent probe
|
|
162
|
+
* cycle and why each was rejected. Safe to call before any resolution has
|
|
163
|
+
* happened (returns an empty attempts list) — it never triggers a probe
|
|
164
|
+
* itself.
|
|
165
|
+
*/
|
|
166
|
+
export declare function describeGitResolution(): GitResolutionDescription;
|
|
167
|
+
/**
|
|
168
|
+
* DI seam for testability (repo convention — see `src/sast/semgrep.ts`).
|
|
169
|
+
* `platform`/`env` let tests drive every platform branch regardless of the
|
|
170
|
+
* host OS running the test. `now`/`yieldToEventLoop` make the TTL, budget,
|
|
171
|
+
* and async-yield behavior deterministically testable without real sleeps.
|
|
172
|
+
*/
|
|
173
|
+
export declare const _internals: {
|
|
174
|
+
spawnSync: typeof spawnSync;
|
|
175
|
+
platform: () => NodeJS.Platform;
|
|
176
|
+
env: () => NodeJS.ProcessEnv;
|
|
177
|
+
now: () => number;
|
|
178
|
+
yieldToEventLoop: () => Promise<void>;
|
|
179
|
+
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { bunSpawn } from './bun-compat';
|
|
2
|
+
import { resolveGitExecutableAsync } from './git-executable.js';
|
|
2
3
|
/**
|
|
3
4
|
* Test-only dependency-injection seam. Production code calls
|
|
4
5
|
* `_internals.bunSpawn(...)` so tests can replace the function on this object
|
|
@@ -9,6 +10,15 @@ import { bunSpawn } from './bun-compat';
|
|
|
9
10
|
*/
|
|
10
11
|
export declare const _internals: {
|
|
11
12
|
bunSpawn: typeof bunSpawn;
|
|
13
|
+
/**
|
|
14
|
+
* Test seam for async git binary resolution (issue #2236 hardening, lane
|
|
15
|
+
* C1b) — see `src/utils/git-executable.ts`. `ensureSwarmGitExcluded` runs
|
|
16
|
+
* on the plugin init path (AGENTS.md invariant 1), so it MUST use the
|
|
17
|
+
* async resolver, never the synchronous one — a synchronous probe loop
|
|
18
|
+
* here would be exactly the kind of unbounded-feeling init-path work the
|
|
19
|
+
* invariant forbids.
|
|
20
|
+
*/
|
|
21
|
+
resolveGitExecutableAsync: typeof resolveGitExecutableAsync;
|
|
12
22
|
};
|
|
13
23
|
/**
|
|
14
24
|
* Module-level flag so the warning fires at most once per process.
|
|
@@ -61,6 +61,15 @@ export declare function recordCoderMergeProvenance(options: {
|
|
|
61
61
|
provenance: MergeOperationProvenance;
|
|
62
62
|
observedFiles: string[];
|
|
63
63
|
}): Promise<void>;
|
|
64
|
+
/**
|
|
65
|
+
* Does the lane branch still exist in the primary repository?
|
|
66
|
+
*
|
|
67
|
+
* Throws rather than guessing when git cannot answer: an INDETERMINATE result
|
|
68
|
+
* must never be read as "gone". The #2236 self-heal decides whether to mark a
|
|
69
|
+
* settlement terminal on this answer, and marking terminal while the branch
|
|
70
|
+
* survives strands the coder's commits on an orphan branch.
|
|
71
|
+
*/
|
|
72
|
+
declare function probeBranchExists(directory: string, branchName: string): boolean;
|
|
64
73
|
export declare function completeCoderSettlementCleanup(directory: string, taskId: string, transitionId: string): Promise<void>;
|
|
65
74
|
export declare function recoverCoderSettlement(directory: string, taskId: string): Promise<CoderSettlementResult | null>;
|
|
66
75
|
export declare function releaseCoderDispatchOwnership(directory: string, taskId: string, transitionId: string): void;
|
|
@@ -139,5 +148,14 @@ export declare function recoverStaleCoderSettlements(directory: string, options?
|
|
|
139
148
|
}>;
|
|
140
149
|
export declare const _internals: {
|
|
141
150
|
liveDispatches: Set<string>;
|
|
151
|
+
/**
|
|
152
|
+
* Test seam for the lane-branch existence probe. Production reads it here,
|
|
153
|
+
* so the #2236 fail-closed invariants — never mark a WAL terminal while the
|
|
154
|
+
* branch exists, and never mark it terminal on an INDETERMINATE answer —
|
|
155
|
+
* are drivable without a second git fixture whose `.git` is unusable (which
|
|
156
|
+
* would break every other git call and never reach the guard).
|
|
157
|
+
*/
|
|
158
|
+
branchExists: typeof probeBranchExists;
|
|
142
159
|
recoverCoderSettlement: typeof recoverCoderSettlement;
|
|
143
160
|
};
|
|
161
|
+
export {};
|
package/dist/worktree/core.d.ts
CHANGED
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
import * as fs from 'node:fs';
|
|
12
12
|
import * as fsPromises from 'node:fs/promises';
|
|
13
13
|
import { bunSpawn } from '../utils/bun-compat';
|
|
14
|
+
import { resolveGitExecutable } from '../utils/git-executable.js';
|
|
14
15
|
import type { WorktreeHandle, WorktreeOptions, WorktreeProvisionResult } from './types';
|
|
15
16
|
/**
|
|
16
17
|
* Test-only dependency-injection seam. Production code calls
|
|
@@ -58,6 +59,13 @@ export declare const _internals: {
|
|
|
58
59
|
removeLaneProfileFromDisk: (worktreePath: string, laneIndex: number) => Promise<void>;
|
|
59
60
|
/** Test seam for removeWorktree — allows tests to intercept worktree removal calls. */
|
|
60
61
|
removeWorktree: typeof removeWorktree;
|
|
62
|
+
/**
|
|
63
|
+
* Test seam for the git binary resolution (issue #2236 hardening, lane
|
|
64
|
+
* C1b) — see `src/utils/git-executable.ts`. Allows tests to stub a
|
|
65
|
+
* deterministic value instead of exercising the real filesystem-probing
|
|
66
|
+
* resolver against a mocked `bunSpawn`.
|
|
67
|
+
*/
|
|
68
|
+
resolveGitExecutable: typeof resolveGitExecutable;
|
|
61
69
|
};
|
|
62
70
|
/**
|
|
63
71
|
* FR-201 SC-124: Writes the lane runtime profile as `.swarm/lanes/{laneIndex}.env`.
|
package/dist/worktree/merge.d.ts
CHANGED
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
* @module merge-back
|
|
11
11
|
*/
|
|
12
12
|
import { bunSpawn } from '../utils/bun-compat';
|
|
13
|
+
import { resolveGitExecutable } from '../utils/git-executable.js';
|
|
13
14
|
import type { MergeStrategy } from './types';
|
|
14
15
|
/**
|
|
15
16
|
* Test-only dependency-injection seam. Production code calls
|
|
@@ -31,7 +32,39 @@ export declare const _internals: {
|
|
|
31
32
|
startupOrphanRecovery: typeof startupOrphanRecovery;
|
|
32
33
|
/** FR-001b: exposes extractSessionId for lane ownership validation. */
|
|
33
34
|
extractSessionId: typeof extractSessionId;
|
|
35
|
+
/**
|
|
36
|
+
* Issue #2236 hardening (F1/F4/F5) — resolves the absolute git executable
|
|
37
|
+
* path instead of spawning the bare `'git'` name. Exposed for test
|
|
38
|
+
* injection following the `src/worktree/core.ts` convention.
|
|
39
|
+
*/
|
|
40
|
+
resolveGitExecutable: typeof resolveGitExecutable;
|
|
34
41
|
};
|
|
42
|
+
/**
|
|
43
|
+
* Why a git child process never started (issue #2236).
|
|
44
|
+
*
|
|
45
|
+
* `cwd-missing` is the reported bug: a lane worktree path read from durable
|
|
46
|
+
* WAL state whose directory has already been torn down. `cwd-unreadable` is
|
|
47
|
+
* the deliberate third state — "cannot tell" must never be treated as "gone",
|
|
48
|
+
* because the recovery path decides whether to discard a branch on it.
|
|
49
|
+
*/
|
|
50
|
+
export type GitSpawnFailureKind = 'cwd-missing' | 'cwd-unreadable' | 'spawn-failed';
|
|
51
|
+
export interface GitSpawnFailure {
|
|
52
|
+
kind: GitSpawnFailureKind;
|
|
53
|
+
cwd: string;
|
|
54
|
+
message: string;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Stage reported when the lane worktree directory is gone AND the lane branch
|
|
58
|
+
* no longer exists — nothing is recoverable. The coder-settlement recovery
|
|
59
|
+
* path keys its self-heal on this stage, then re-verifies branch absence
|
|
60
|
+
* itself before touching the WAL.
|
|
61
|
+
*/
|
|
62
|
+
export declare const SOURCE_WORKTREE_GONE_STAGE = "source-worktree-gone";
|
|
63
|
+
/**
|
|
64
|
+
* Stage reported when the lane worktree directory is gone but branch existence
|
|
65
|
+
* could not be determined. Fails closed: callers must never self-heal on it.
|
|
66
|
+
*/
|
|
67
|
+
export declare const SOURCE_WORKTREE_UNCERTAIN_STAGE = "source-worktree-uncertain";
|
|
35
68
|
export interface MergeSuccess {
|
|
36
69
|
merged: true;
|
|
37
70
|
strategy: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-swarm",
|
|
3
|
-
"version": "7.144.
|
|
3
|
+
"version": "7.144.6",
|
|
4
4
|
"description": "Architect-centric agentic swarm plugin for OpenCode - hub-and-spoke orchestration with SME consultation, code generation, and QA review",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -109,7 +109,8 @@
|
|
|
109
109
|
"repro:1873": "bun build scripts/repro-1873-entry.ts --outdir dist-build-test/repro-1873 --target node --format esm && node scripts/repro-1873.mjs",
|
|
110
110
|
"check:events": "bun run scripts/check-event-contract.ts",
|
|
111
111
|
"check:test-file-cap": "bun run scripts/check-test-file-cap.ts",
|
|
112
|
-
"check:gate-portability": "bun run scripts/check-gate-portability.ts"
|
|
112
|
+
"check:gate-portability": "bun run scripts/check-gate-portability.ts",
|
|
113
|
+
"check:bare-spawn": "bun run scripts/check-bare-executable-spawn.ts"
|
|
113
114
|
},
|
|
114
115
|
"dependencies": {
|
|
115
116
|
"@opencode-ai/plugin": "^1.18.3",
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import {
|
|
3
|
-
createCuratorLLMDelegate
|
|
4
|
-
} from "./index-q4ed1jk7.js";
|
|
5
|
-
import"./index-d12jd5mn.js";
|
|
6
|
-
import"./index-h98t1m88.js";
|
|
7
|
-
import"./index-az8etqpp.js";
|
|
8
|
-
import"./index-134d35c1.js";
|
|
9
|
-
import"./index-b6e016tv.js";
|
|
10
|
-
import"./index-1csyxv0f.js";
|
|
11
|
-
import"./index-fqcjragy.js";
|
|
12
|
-
import"./index-y8552snf.js";
|
|
13
|
-
import"./index-nckg4gxb.js";
|
|
14
|
-
import"./index-70ha9e09.js";
|
|
15
|
-
import"./index-c8s9a3zh.js";
|
|
16
|
-
import"./index-9ss2m4rs.js";
|
|
17
|
-
import"./index-74hpm6sh.js";
|
|
18
|
-
import"./index-bt9aa01f.js";
|
|
19
|
-
import"./index-zb0xcz9t.js";
|
|
20
|
-
import"./index-x6tp0hfr.js";
|
|
21
|
-
import"./index-yts89pqg.js";
|
|
22
|
-
import"./index-dty5qgk2.js";
|
|
23
|
-
import"./index-rtry5xyf.js";
|
|
24
|
-
import"./index-zsrtt42s.js";
|
|
25
|
-
import"./index-jabkn643.js";
|
|
26
|
-
import"./index-k3cxyk66.js";
|
|
27
|
-
import"./index-cz25e8xp.js";
|
|
28
|
-
import"./index-8j0va7jp.js";
|
|
29
|
-
import"./index-pw83zgny.js";
|
|
30
|
-
import"./index-z6v7kwpa.js";
|
|
31
|
-
import"./index-556ja8an.js";
|
|
32
|
-
import"./index-7sy3aa9m.js";
|
|
33
|
-
import"./index-wx8zdh4a.js";
|
|
34
|
-
import"./index-8fwhhayc.js";
|
|
35
|
-
import"./index-q1exe2b3.js";
|
|
36
|
-
import"./index-03pv47h2.js";
|
|
37
|
-
import"./index-4w5qdbk7.js";
|
|
38
|
-
import"./index-psvxq93b.js";
|
|
39
|
-
import"./index-gprxjmm7.js";
|
|
40
|
-
import"./index-n832052r.js";
|
|
41
|
-
import"./index-rn0eq85g.js";
|
|
42
|
-
import"./index-z6xqpmqg.js";
|
|
43
|
-
import"./index-9qq7c18c.js";
|
|
44
|
-
import"./index-y8j8ehc8.js";
|
|
45
|
-
import"./index-4rhhvd1a.js";
|
|
46
|
-
import"./index-v3y3qg48.js";
|
|
47
|
-
import"./index-zjygnfay.js";
|
|
48
|
-
import"./index-ae75rja9.js";
|
|
49
|
-
import"./index-ywn7vtxp.js";
|
|
50
|
-
import"./index-mazgg5s2.js";
|
|
51
|
-
import"./index-ed5ykebp.js";
|
|
52
|
-
import"./index-bk5tah7q.js";
|
|
53
|
-
import"./index-f9vvg5xb.js";
|
|
54
|
-
import"./index-1jsmmx7y.js";
|
|
55
|
-
import"./index-7g4c7s5r.js";
|
|
56
|
-
import"./index-bpmtbmy9.js";
|
|
57
|
-
import"./index-4nt52yr9.js";
|
|
58
|
-
import"./index-zgwm4ryv.js";
|
|
59
|
-
import"./index-a76rekgs.js";
|
|
60
|
-
export {
|
|
61
|
-
createCuratorLLMDelegate
|
|
62
|
-
};
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import {
|
|
3
|
-
handleGuardrailExplain
|
|
4
|
-
} from "./index-2m7mavaz.js";
|
|
5
|
-
import"./index-q4ed1jk7.js";
|
|
6
|
-
import"./index-d12jd5mn.js";
|
|
7
|
-
import"./index-h98t1m88.js";
|
|
8
|
-
import"./index-az8etqpp.js";
|
|
9
|
-
import"./index-134d35c1.js";
|
|
10
|
-
import"./index-b6e016tv.js";
|
|
11
|
-
import"./index-1csyxv0f.js";
|
|
12
|
-
import"./index-fqcjragy.js";
|
|
13
|
-
import"./index-y8552snf.js";
|
|
14
|
-
import"./index-nckg4gxb.js";
|
|
15
|
-
import"./index-70ha9e09.js";
|
|
16
|
-
import"./index-c8s9a3zh.js";
|
|
17
|
-
import"./index-9ss2m4rs.js";
|
|
18
|
-
import"./index-74hpm6sh.js";
|
|
19
|
-
import"./index-bt9aa01f.js";
|
|
20
|
-
import"./index-zb0xcz9t.js";
|
|
21
|
-
import"./index-x6tp0hfr.js";
|
|
22
|
-
import"./index-yts89pqg.js";
|
|
23
|
-
import"./index-dty5qgk2.js";
|
|
24
|
-
import"./index-rtry5xyf.js";
|
|
25
|
-
import"./index-zsrtt42s.js";
|
|
26
|
-
import"./index-jabkn643.js";
|
|
27
|
-
import"./index-k3cxyk66.js";
|
|
28
|
-
import"./index-cz25e8xp.js";
|
|
29
|
-
import"./index-8j0va7jp.js";
|
|
30
|
-
import"./index-pw83zgny.js";
|
|
31
|
-
import"./index-z6v7kwpa.js";
|
|
32
|
-
import"./index-556ja8an.js";
|
|
33
|
-
import"./index-7sy3aa9m.js";
|
|
34
|
-
import"./index-wx8zdh4a.js";
|
|
35
|
-
import"./index-8fwhhayc.js";
|
|
36
|
-
import"./index-q1exe2b3.js";
|
|
37
|
-
import"./index-03pv47h2.js";
|
|
38
|
-
import"./index-4w5qdbk7.js";
|
|
39
|
-
import"./index-psvxq93b.js";
|
|
40
|
-
import"./index-gprxjmm7.js";
|
|
41
|
-
import"./index-n832052r.js";
|
|
42
|
-
import"./index-rn0eq85g.js";
|
|
43
|
-
import"./index-z6xqpmqg.js";
|
|
44
|
-
import"./index-9qq7c18c.js";
|
|
45
|
-
import"./index-y8j8ehc8.js";
|
|
46
|
-
import"./index-4rhhvd1a.js";
|
|
47
|
-
import"./index-v3y3qg48.js";
|
|
48
|
-
import"./index-zjygnfay.js";
|
|
49
|
-
import"./index-ae75rja9.js";
|
|
50
|
-
import"./index-ywn7vtxp.js";
|
|
51
|
-
import"./index-mazgg5s2.js";
|
|
52
|
-
import"./index-ed5ykebp.js";
|
|
53
|
-
import"./index-bk5tah7q.js";
|
|
54
|
-
import"./index-f9vvg5xb.js";
|
|
55
|
-
import"./index-1jsmmx7y.js";
|
|
56
|
-
import"./index-7g4c7s5r.js";
|
|
57
|
-
import"./index-bpmtbmy9.js";
|
|
58
|
-
import"./index-4nt52yr9.js";
|
|
59
|
-
import"./index-zgwm4ryv.js";
|
|
60
|
-
import"./index-a76rekgs.js";
|
|
61
|
-
export {
|
|
62
|
-
handleGuardrailExplain
|
|
63
|
-
};
|