opencode-swarm 7.135.1 → 7.135.3
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/critic-gate/SKILL.md +10 -0
- package/.opencode/skills/swarm-pr-feedback/SKILL.md +24 -21
- package/.opencode/skills/swarm-pr-review/SKILL.md +55 -42
- package/dist/agents/explorer.d.ts +1 -1
- package/dist/agents/index.d.ts +12 -0
- package/dist/background/candidate-contract.d.ts +113 -0
- package/dist/background/candidate-parser.d.ts +8 -29
- package/dist/background/pr-review-trigger-contract.d.ts +197 -0
- package/dist/background/workspace-snapshot.d.ts +26 -0
- package/dist/cli/{config-doctor-6398t3a6.js → config-doctor-4nznqeca.js} +3 -2
- package/dist/cli/{core-9876t6cs.js → core-4z1s2ak1.js} +3 -2
- package/dist/cli/{curation-policy-f7qz4tez.js → curation-policy-81m14519.js} +5 -5
- package/dist/cli/{curator-drift-9q6f85bm.js → curator-drift-jpap6hv4.js} +2 -2
- package/dist/cli/{curator-fjhyezyx.js → curator-e0z5gcww.js} +28 -27
- package/dist/cli/curator-llm-factory-fem13y9n.js +57 -0
- package/dist/cli/{dispatch-gxbeb2ps.js → dispatch-b1fge4xk.js} +2 -2
- package/dist/cli/{evidence-summary-service-0cczdmjv.js → evidence-summary-service-w006jnpg.js} +6 -6
- package/dist/cli/{explorer-jp0nen03.js → explorer-15gqzxh8.js} +1 -1
- package/dist/cli/{gate-evidence-8zrwdj69.js → gate-evidence-aenyz6vt.js} +4 -4
- package/dist/cli/guardrail-explain-wgaj23hd.js +58 -0
- package/dist/cli/{guardrail-log-bd45kw0x.js → guardrail-log-04p1z1vt.js} +5 -4
- package/dist/cli/{hive-promoter-f2yh22m1.js → hive-promoter-k345z42k.js} +28 -27
- package/dist/cli/{index-wdkkf3xg.js → index-168phrs7.js} +12 -10
- package/dist/cli/{index-xhpmagdm.js → index-30pg2rs3.js} +2 -2
- package/dist/cli/{index-bjrkg4tc.js → index-36v55ryg.js} +2 -2
- package/dist/cli/index-3jcyn8g6.js +1219 -0
- package/dist/cli/{index-7an2qn0s.js → index-45t7w06b.js} +2 -2
- package/dist/cli/{index-2ghkk9ve.js → index-4qzeef9h.js} +1 -1
- package/dist/cli/{index-4pdrmemy.js → index-5436jxnw.js} +2 -2
- package/dist/cli/{index-5vp9gka3.js → index-a01r818w.js} +5 -3
- package/dist/cli/{index-nbnqf4fj.js → index-bcmrg4t4.js} +1 -1
- package/dist/cli/{index-fwkqq9mq.js → index-c9ddxv4k.js} +57 -8
- package/dist/cli/{index-ens0gt38.js → index-cggqh2dz.js} +7 -7
- package/dist/cli/{index-vxv732ex.js → index-dg1njnms.js} +7 -4
- package/dist/cli/{index-aky90eqz.js → index-dwargd10.js} +11596 -10043
- package/dist/cli/{index-yhba8swx.js → index-dzyjb33e.js} +1 -1
- package/dist/cli/{index-xg9repnx.js → index-ey29aap6.js} +1 -1
- package/dist/cli/{index-5wx8wdxg.js → index-f52jt0am.js} +5 -5
- package/dist/cli/{index-2nqsr1dx.js → index-gxxxmajn.js} +4 -4
- package/dist/cli/{index-jtshf1pd.js → index-kb7qy7an.js} +4 -2
- package/dist/cli/{index-b7p0mp2q.js → index-mrtms113.js} +4 -4
- package/dist/cli/{index-dzaarxhg.js → index-p5kr35wh.js} +8 -1210
- package/dist/cli/{index-j89zmcpx.js → index-p9ngg568.js} +6 -6
- package/dist/cli/{index-g1drmgxe.js → index-rv7s2k9y.js} +3 -3
- package/dist/cli/{index-z085b4ka.js → index-tcn457d5.js} +1 -1
- package/dist/cli/{index-fpkb3mw1.js → index-vg3yx648.js} +1 -1
- package/dist/cli/{index-13xxjfhn.js → index-vm4xw9z3.js} +1 -1
- package/dist/cli/{index-jxchddjk.js → index-wygxzvtf.js} +6 -4
- package/dist/cli/{index-b4z7s917.js → index-x20cgr2q.js} +1 -1
- package/dist/cli/{index-qe3v54nb.js → index-y111zefa.js} +64 -23
- package/dist/cli/{index-w80r3axq.js → index-y47crdg9.js} +34 -32
- package/dist/cli/{index-3nasn371.js → index-y6a7gjtj.js} +126 -42
- package/dist/cli/{index-247b1c1m.js → index-yf30m841.js} +3 -3
- package/dist/cli/index.js +31 -29
- package/dist/cli/{knowledge-escalator-4tp3yy7e.js → knowledge-escalator-42ecv7m3.js} +6 -6
- package/dist/cli/{knowledge-events-7854gb3p.js → knowledge-events-zhna7v3g.js} +4 -4
- package/dist/cli/{knowledge-link-etrfntkd.js → knowledge-link-mm1w967j.js} +3 -3
- package/dist/cli/{knowledge-store-cxnr6v01.js → knowledge-store-56jcfc5k.js} +4 -4
- package/dist/cli/{knowledge-validator-3n5t55qy.js → knowledge-validator-8zk0pnb6.js} +7 -7
- package/dist/cli/{pending-delegations-4z3tkkct.js → pending-delegations-qajsxct0.js} +4 -4
- package/dist/cli/{pr-subscriptions-29j794kd.js → pr-subscriptions-qhr41epq.js} +4 -4
- package/dist/cli/{scan-cursor-0cexjh3b.js → scan-cursor-h3ndxd41.js} +5 -5
- package/dist/cli/{schema-rs5a7ywx.js → schema-r6wmd7zp.js} +2 -1
- package/dist/cli/{scope-persistence-1vsnkmm4.js → scope-persistence-h2fpgxww.js} +3 -3
- package/dist/cli/{skill-generator-n0h9n0zd.js → skill-generator-12cftsx4.js} +8 -8
- package/dist/cli/{workspace-snapshot-9h5za0s6.js → workspace-snapshot-jmyamqnv.js} +6 -1
- package/dist/cli/{worktree-collision-ownership-dtwr0xj4.js → worktree-collision-ownership-13btcj9g.js} +5 -5
- package/dist/commands/approve-plan-critic.d.ts +21 -0
- package/dist/commands/registry.d.ts +9 -1
- package/dist/config/cache-paths.d.ts +48 -0
- package/dist/config/constants.d.ts +18 -0
- package/dist/config/host-path.d.ts +95 -0
- package/dist/config/lane-context.d.ts +117 -0
- package/dist/config/lane-permissions.d.ts +277 -0
- package/dist/config/schema.d.ts +10 -0
- package/dist/config/swarm-branch.d.ts +130 -0
- package/dist/hooks/delegation-gate.d.ts +42 -1
- package/dist/hooks/pr-workflow-gate.d.ts +30 -4
- package/dist/hooks/repo-graph-builder.d.ts +18 -0
- package/dist/hooks/skill-propagation-gate.d.ts +10 -0
- package/dist/index.js +459 -443
- package/dist/memory/schema.d.ts +4 -4
- package/dist/tools/approve-plan-critic.d.ts +5 -0
- package/dist/tools/convene-council.d.ts +3 -3
- package/dist/tools/dispatch-lanes.d.ts +65 -7
- package/dist/tools/index.d.ts +1 -0
- package/dist/tools/manifest.d.ts +1 -0
- package/dist/tools/repo-graph/builder.d.ts +20 -2
- package/dist/tools/repo-graph/incremental.d.ts +18 -1
- package/dist/tools/repo-graph/ontology.d.ts +8 -0
- package/dist/tools/repo-graph/types.d.ts +62 -1
- package/dist/tools/repo-graph.d.ts +1 -1
- package/dist/tools/submit-phase-council-verdicts.d.ts +3 -3
- package/dist/tools/tool-metadata.d.ts +4 -0
- package/dist/tools/write-final-council-evidence.d.ts +3 -3
- package/dist/tools/write-pr-review-trigger-eval.d.ts +34 -63
- package/package.json +1 -1
- package/dist/cli/curator-llm-factory-wr3zmy2c.js +0 -56
- package/dist/cli/guardrail-explain-g1s89b3e.js +0 -57
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
validateSwarmPath
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-4qzeef9h.js";
|
|
5
5
|
import {
|
|
6
6
|
withEvidenceLock
|
|
7
7
|
} from "./index-09b9zncg.js";
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
} from "./index-bpmtbmy9.js";
|
|
12
12
|
import {
|
|
13
13
|
bunWrite
|
|
14
|
-
} from "./index-
|
|
14
|
+
} from "./index-y111zefa.js";
|
|
15
15
|
import {
|
|
16
16
|
init_logger,
|
|
17
17
|
warn
|
|
@@ -12,14 +12,14 @@ import {
|
|
|
12
12
|
detectPosixWrites,
|
|
13
13
|
detectWindowsWrites,
|
|
14
14
|
resolveWriteTargets
|
|
15
|
-
} from "./index-
|
|
15
|
+
} from "./index-dwargd10.js";
|
|
16
16
|
import {
|
|
17
17
|
checkFileAuthority,
|
|
18
18
|
classifyFile,
|
|
19
19
|
isInDeclaredScope,
|
|
20
20
|
redactPath,
|
|
21
21
|
redactShellCommand
|
|
22
|
-
} from "./index-
|
|
22
|
+
} from "./index-kb7qy7an.js";
|
|
23
23
|
|
|
24
24
|
// src/services/guardrail-explain-service.ts
|
|
25
25
|
import path from "path";
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
|
-
ALL_AGENT_NAMES,
|
|
4
3
|
FALLBACK_MODELS_MAX,
|
|
5
4
|
GATE_CONFIG_KNOWN_SECTION_KEYS,
|
|
6
5
|
GateConfigSchema,
|
|
7
6
|
PluginConfigSchema,
|
|
8
|
-
init_constants,
|
|
9
7
|
init_schema,
|
|
10
8
|
stripKnownSwarmPrefix
|
|
11
|
-
} from "./index-
|
|
9
|
+
} from "./index-p5kr35wh.js";
|
|
10
|
+
import {
|
|
11
|
+
ALL_AGENT_NAMES,
|
|
12
|
+
init_constants
|
|
13
|
+
} from "./index-3jcyn8g6.js";
|
|
12
14
|
import {
|
|
13
15
|
log
|
|
14
16
|
} from "./index-zgwm4ryv.js";
|
|
@@ -3,9 +3,13 @@ import {
|
|
|
3
3
|
advisoryWarn,
|
|
4
4
|
init_warning_buffer
|
|
5
5
|
} from "./index-4rhhvd1a.js";
|
|
6
|
+
import {
|
|
7
|
+
SWARM_WORKTREE_DIR_NAME,
|
|
8
|
+
init_constants
|
|
9
|
+
} from "./index-3jcyn8g6.js";
|
|
6
10
|
import {
|
|
7
11
|
bunSpawn
|
|
8
|
-
} from "./index-
|
|
12
|
+
} from "./index-y111zefa.js";
|
|
9
13
|
import {
|
|
10
14
|
log
|
|
11
15
|
} from "./index-zgwm4ryv.js";
|
|
@@ -14,11 +18,54 @@ import {
|
|
|
14
18
|
} from "./index-a76rekgs.js";
|
|
15
19
|
|
|
16
20
|
// src/worktree/core.ts
|
|
17
|
-
|
|
21
|
+
init_constants();
|
|
18
22
|
import * as fs from "fs";
|
|
19
23
|
import * as fsPromises from "fs/promises";
|
|
20
24
|
import * as os from "os";
|
|
21
25
|
import * as path from "path";
|
|
26
|
+
|
|
27
|
+
// src/config/swarm-branch.ts
|
|
28
|
+
init_constants();
|
|
29
|
+
var SWARM_WORKTREE_BRANCH_PREFIXES = ["swarm/", "swarm-lane/"];
|
|
30
|
+
var SESSION_ID_PATTERN = /^ses_[A-Za-z0-9]+$/;
|
|
31
|
+
function isPlainSegment(segment) {
|
|
32
|
+
return typeof segment === "string" && segment.length > 0 && segment !== "." && segment !== "..";
|
|
33
|
+
}
|
|
34
|
+
function buildSwarmBranchName(sessionId, id, purpose, legacyLane) {
|
|
35
|
+
const [standardPrefix, legacyLanePrefix] = SWARM_WORKTREE_BRANCH_PREFIXES;
|
|
36
|
+
return legacyLane ? `${legacyLanePrefix}${sessionId}/${id}` : `${standardPrefix}${purpose}/${sessionId}/${id}`;
|
|
37
|
+
}
|
|
38
|
+
function matchSwarmLaneBranch(branch) {
|
|
39
|
+
if (typeof branch !== "string" || branch === "")
|
|
40
|
+
return;
|
|
41
|
+
const segments = branch.split("/");
|
|
42
|
+
if (segments[0] === "swarm-lane") {
|
|
43
|
+
if (segments.length !== 3)
|
|
44
|
+
return;
|
|
45
|
+
const [, sessionId, id] = segments;
|
|
46
|
+
if (!SESSION_ID_PATTERN.test(sessionId ?? ""))
|
|
47
|
+
return;
|
|
48
|
+
if (!isPlainSegment(id))
|
|
49
|
+
return;
|
|
50
|
+
return { purpose: "lane", sessionId, id, style: "legacy-lane" };
|
|
51
|
+
}
|
|
52
|
+
if (segments[0] === "swarm") {
|
|
53
|
+
if (segments.length !== 4)
|
|
54
|
+
return;
|
|
55
|
+
const [, purpose, sessionId, id] = segments;
|
|
56
|
+
if (!isPlainSegment(purpose))
|
|
57
|
+
return;
|
|
58
|
+
if (!SESSION_ID_PATTERN.test(sessionId ?? ""))
|
|
59
|
+
return;
|
|
60
|
+
if (!isPlainSegment(id))
|
|
61
|
+
return;
|
|
62
|
+
return { purpose, sessionId, id, style: "purpose" };
|
|
63
|
+
}
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// src/worktree/core.ts
|
|
68
|
+
init_warning_buffer();
|
|
22
69
|
var _internals = {
|
|
23
70
|
bunSpawn,
|
|
24
71
|
platform: process.platform,
|
|
@@ -39,7 +86,7 @@ var _internals = {
|
|
|
39
86
|
symlinkSync: fs.symlinkSync
|
|
40
87
|
},
|
|
41
88
|
writeScopeToDisk: async (directory, taskId, files) => {
|
|
42
|
-
const { writeScopeToDisk: realWrite } = await import("./scope-persistence-
|
|
89
|
+
const { writeScopeToDisk: realWrite } = await import("./scope-persistence-h2fpgxww.js");
|
|
43
90
|
return realWrite(directory, taskId, files);
|
|
44
91
|
},
|
|
45
92
|
writeLaneProfileToDisk: async (_worktreePath, _laneIndex, _envOverrides) => {
|
|
@@ -162,13 +209,10 @@ function shortenWorktreePath(_directory, sessionId, laneId) {
|
|
|
162
209
|
return path.join(tmp, "swwt", sessionId, laneId);
|
|
163
210
|
}
|
|
164
211
|
function makeWorktreeBranchName(sessionId, id, options) {
|
|
165
|
-
|
|
166
|
-
return `swarm-lane/${sessionId}/${id}`;
|
|
167
|
-
}
|
|
168
|
-
return `swarm/${options.purpose}/${sessionId}/${id}`;
|
|
212
|
+
return buildSwarmBranchName(sessionId, id, options.purpose, options.branchStyle === "legacy-lane" && options.purpose === "lane");
|
|
169
213
|
}
|
|
170
214
|
function resolveWorktreeBaseDir(directory, worktreeDir) {
|
|
171
|
-
return worktreeDir ? path.resolve(directory, worktreeDir) : path.resolve(path.dirname(directory),
|
|
215
|
+
return worktreeDir ? path.resolve(directory, worktreeDir) : path.resolve(path.dirname(directory), SWARM_WORKTREE_DIR_NAME);
|
|
172
216
|
}
|
|
173
217
|
function isPathUnderSwarmWorktreeBase(targetPath, directory, worktreeDirOverrides = []) {
|
|
174
218
|
const caseInsensitive = process.platform === "win32";
|
|
@@ -199,6 +243,11 @@ function isPathUnderSwarmWorktreeBase(targetPath, directory, worktreeDirOverride
|
|
|
199
243
|
}
|
|
200
244
|
async function provisionWorktree(directory, id, sessionId, options) {
|
|
201
245
|
const branchName = makeWorktreeBranchName(sessionId, id, options);
|
|
246
|
+
if (!matchSwarmLaneBranch(branchName)) {
|
|
247
|
+
return {
|
|
248
|
+
error: `Refusing to provision worktree: branch "${branchName}" does not match the swarm lane grammar, so lane permission scoping could not recognise it and the lane would hang on the first external-directory prompt. This is almost always an invalid sessionId ("${sessionId}"); it must look like "ses_" followed by letters/digits, and the execution-unit id ("${id}") must be a single path segment.`
|
|
249
|
+
};
|
|
250
|
+
}
|
|
202
251
|
let worktreePath = path.resolve(resolveWorktreeBaseDir(directory, options.worktreeDir), sessionId, id);
|
|
203
252
|
const budgetResult = await checkPathBudget(worktreePath, directory);
|
|
204
253
|
if (budgetResult.ok === false) {
|
|
@@ -7,10 +7,10 @@ import {
|
|
|
7
7
|
readTaskEvidence,
|
|
8
8
|
readTaskEvidenceRaw,
|
|
9
9
|
sanitizeTaskId
|
|
10
|
-
} from "./index-
|
|
10
|
+
} from "./index-mrtms113.js";
|
|
11
11
|
import {
|
|
12
12
|
atomicWriteFile
|
|
13
|
-
} from "./index-
|
|
13
|
+
} from "./index-ey29aap6.js";
|
|
14
14
|
import {
|
|
15
15
|
EVIDENCE_MAX_JSON_BYTES,
|
|
16
16
|
EvidenceBundleSchema,
|
|
@@ -48,26 +48,26 @@ import {
|
|
|
48
48
|
import {
|
|
49
49
|
readSwarmFileAsync,
|
|
50
50
|
validateSwarmPath
|
|
51
|
-
} from "./index-
|
|
51
|
+
} from "./index-4qzeef9h.js";
|
|
52
52
|
import {
|
|
53
53
|
readCachedParsedFile
|
|
54
54
|
} from "./index-fsrp8wp3.js";
|
|
55
55
|
import {
|
|
56
56
|
withEvidenceLock
|
|
57
57
|
} from "./index-09b9zncg.js";
|
|
58
|
-
import {
|
|
59
|
-
emit
|
|
60
|
-
} from "./index-7a2hm51h.js";
|
|
61
58
|
import {
|
|
62
59
|
ZodError,
|
|
63
60
|
exports_external,
|
|
64
61
|
init_zod
|
|
65
62
|
} from "./index-bpmtbmy9.js";
|
|
63
|
+
import {
|
|
64
|
+
emit
|
|
65
|
+
} from "./index-7a2hm51h.js";
|
|
66
66
|
import {
|
|
67
67
|
bunHash,
|
|
68
68
|
bunWrite,
|
|
69
69
|
mergeEnvForChild
|
|
70
|
-
} from "./index-
|
|
70
|
+
} from "./index-y111zefa.js";
|
|
71
71
|
import {
|
|
72
72
|
criticalWarn,
|
|
73
73
|
error,
|
|
@@ -145,11 +145,14 @@ Field rules:
|
|
|
145
145
|
Emit a header row first, then one unprefixed data row per finding. Use pipe (|) to
|
|
146
146
|
separate fields; escape literal pipe characters inside field values as \\|.
|
|
147
147
|
|
|
148
|
-
If a standard explorer finds zero issues, emit the
|
|
149
|
-
|
|
148
|
+
If either a standard explorer or a micro-lane finds zero issues, emit the
|
|
149
|
+
header followed by exactly the matching family form:
|
|
150
|
+
[CLEAN] | lane | coverage_scope | evidence
|
|
150
151
|
[CLEAN] | micro_lane | coverage_scope | evidence
|
|
151
|
-
|
|
152
|
-
|
|
152
|
+
Replace lane or micro_lane with the exact controller-assigned value and fill
|
|
153
|
+
the remaining fields with the checks completed and concrete negative evidence.
|
|
154
|
+
Header-only output is unattested. Do NOT fall back to the default
|
|
155
|
+
PROJECT/STRUCTURE format.
|
|
153
156
|
|
|
154
157
|
For micro-lane dispatches, use the micro-lane variant:
|
|
155
158
|
[CANDIDATE] | candidate_id | micro_lane | severity | category | file:line | claim | invariant_violated | evidence_summary | confidence
|