opencode-swarm 7.113.0 → 7.113.2
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/engineering-conventions/SKILL.md +5 -0
- package/.opencode/skills/gate-attribution/SKILL.md +2 -0
- package/dist/background/pending-delegations.d.ts +8 -0
- package/dist/background/workspace-snapshot.d.ts +7 -0
- package/dist/cli/{curator-pdcpw4x6.js → curator-9s04amtf.js} +5 -4
- package/dist/cli/{curator-llm-factory-3t0ehhfe.js → curator-llm-factory-dwvk7rh0.js} +5 -4
- package/dist/cli/{evidence-summary-service-j6fnsfeq.js → evidence-summary-service-w1er1ea2.js} +2 -2
- package/dist/cli/{gate-evidence-mk0ss1re.js → gate-evidence-9hdwj6tt.js} +1 -1
- package/dist/cli/{guardrail-explain-xsfdc49z.js → guardrail-explain-2k271yh4.js} +6 -5
- package/dist/cli/{hive-promoter-4htgk6zb.js → hive-promoter-0y4pnft4.js} +5 -4
- package/dist/cli/{index-bsvwnzh7.js → index-54dgk0bv.js} +33 -36
- package/dist/cli/{index-d0w40jm3.js → index-afgh75zg.js} +1 -1
- package/dist/cli/{workspace-snapshot-w58jr2ga.js → index-dqh3zhhc.js} +53 -10
- package/dist/cli/{index-h88ktb5r.js → index-h389ed8y.js} +8 -2
- package/dist/cli/{index-v96kmbkw.js → index-n7rd2rkj.js} +1 -1
- package/dist/cli/{index-6gdxwfsh.js → index-w51xz4dr.js} +6 -5
- package/dist/cli/{index-pm992z24.js → index-x5g7et24.js} +10 -7
- package/dist/cli/index.js +5 -4
- package/dist/cli/{pending-delegations-gc3a2hfx.js → pending-delegations-t047f4a7.js} +7 -0
- package/dist/cli/{skill-generator-0my4jrx6.js → skill-generator-nnwn4sq0.js} +1 -1
- package/dist/cli/workspace-snapshot-eyf6gd0d.js +22 -0
- package/dist/config/project-init.d.ts +1 -1
- package/dist/config/skill-mirrors.d.ts +3 -1
- package/dist/gate-evidence-classification.d.ts +5 -0
- package/dist/gate-evidence.d.ts +14 -3
- package/dist/index.js +276 -276
- package/dist/memory/schema.d.ts +4 -4
- package/dist/sast/rules/index.d.ts +0 -9
- package/dist/tools/phase-complete.d.ts +8 -0
- package/dist/tools/sast-scan.d.ts +2 -0
- package/dist/utils/gitignore-warning.d.ts +8 -4
- package/package.json +1 -1
|
@@ -71,7 +71,8 @@ var TaskEvidenceSchema = exports_external.object({
|
|
|
71
71
|
taskId: exports_external.string(),
|
|
72
72
|
required_gates: exports_external.array(exports_external.string()).default([]),
|
|
73
73
|
gates: exports_external.record(exports_external.string(), GateEvidenceSchema),
|
|
74
|
-
turbo: exports_external.boolean().optional()
|
|
74
|
+
turbo: exports_external.boolean().optional(),
|
|
75
|
+
test_engineer_exempt: exports_external.boolean().optional()
|
|
75
76
|
});
|
|
76
77
|
var DEFAULT_REQUIRED_GATES = ["reviewer", "test_engineer"];
|
|
77
78
|
function isValidTaskId(taskId) {
|
|
@@ -80,10 +81,10 @@ function isValidTaskId(taskId) {
|
|
|
80
81
|
function assertValidTaskId(taskId) {
|
|
81
82
|
assertStrictTaskId(taskId);
|
|
82
83
|
}
|
|
83
|
-
function deriveRequiredGates(agentType) {
|
|
84
|
+
function deriveRequiredGates(agentType, context = {}) {
|
|
84
85
|
switch (agentType) {
|
|
85
86
|
case "coder":
|
|
86
|
-
return ["reviewer", "test_engineer"];
|
|
87
|
+
return context.testEngineerExempt === true ? ["reviewer"] : ["reviewer", "test_engineer"];
|
|
87
88
|
case "docs":
|
|
88
89
|
return ["docs"];
|
|
89
90
|
case "designer":
|
|
@@ -110,8 +111,8 @@ function deriveRequiredGates(agentType) {
|
|
|
110
111
|
return ["reviewer", "test_engineer"];
|
|
111
112
|
}
|
|
112
113
|
}
|
|
113
|
-
function expandRequiredGates(existingGates, newAgentType) {
|
|
114
|
-
const newGates = deriveRequiredGates(newAgentType);
|
|
114
|
+
function expandRequiredGates(existingGates, newAgentType, context = {}) {
|
|
115
|
+
const newGates = deriveRequiredGates(newAgentType, context);
|
|
115
116
|
const combined = [...new Set([...existingGates ?? [], ...newGates])];
|
|
116
117
|
return combined.sort();
|
|
117
118
|
}
|
|
@@ -166,6 +167,7 @@ async function recordGateEvidence(directory, taskId, gate, sessionId, turbo) {
|
|
|
166
167
|
taskId,
|
|
167
168
|
required_gates: requiredGates,
|
|
168
169
|
turbo: turbo === true ? true : existing?.turbo,
|
|
170
|
+
test_engineer_exempt: existing?.test_engineer_exempt,
|
|
169
171
|
gates: {
|
|
170
172
|
...existing?.gates ?? {},
|
|
171
173
|
[gate]: {
|
|
@@ -179,7 +181,7 @@ async function recordGateEvidence(directory, taskId, gate, sessionId, turbo) {
|
|
|
179
181
|
});
|
|
180
182
|
telemetry.gatePassed(sessionId, gate, taskId);
|
|
181
183
|
}
|
|
182
|
-
async function recordAgentDispatch(directory, taskId, agentType, turbo) {
|
|
184
|
+
async function recordAgentDispatch(directory, taskId, agentType, turbo, context = {}) {
|
|
183
185
|
assertValidTaskId(taskId);
|
|
184
186
|
await withTaskEvidenceLock(directory, taskId, agentType, async () => {
|
|
185
187
|
const resolvedEvidenceDir = getEvidenceDir(directory);
|
|
@@ -191,11 +193,12 @@ async function recordAgentDispatch(directory, taskId, agentType, turbo) {
|
|
|
191
193
|
telemetry.gateParseError(taskId, error);
|
|
192
194
|
throw error;
|
|
193
195
|
}
|
|
194
|
-
const requiredGates = existing ? expandRequiredGates(existing.required_gates, agentType) : deriveRequiredGates(agentType);
|
|
196
|
+
const requiredGates = existing ? expandRequiredGates(existing.required_gates, agentType, context) : deriveRequiredGates(agentType, context);
|
|
195
197
|
const updated = {
|
|
196
198
|
taskId,
|
|
197
199
|
required_gates: requiredGates,
|
|
198
200
|
turbo: turbo === true ? true : existing?.turbo,
|
|
201
|
+
test_engineer_exempt: agentType === "coder" ? context.testEngineerExempt === true && !requiredGates.includes("test_engineer") : existing?.test_engineer_exempt,
|
|
199
202
|
gates: existing?.gates ?? {}
|
|
200
203
|
};
|
|
201
204
|
await atomicWriteFile(evidencePath, JSON.stringify(updated, null, 2));
|
package/dist/cli/index.js
CHANGED
|
@@ -7,18 +7,18 @@ import {
|
|
|
7
7
|
getPluginLockFilePaths,
|
|
8
8
|
package_default,
|
|
9
9
|
resolveCommand
|
|
10
|
-
} from "./index-
|
|
10
|
+
} from "./index-54dgk0bv.js";
|
|
11
11
|
import"./index-8f256d7t.js";
|
|
12
12
|
import"./index-c8s9a3zh.js";
|
|
13
13
|
import"./index-0gf6de8b.js";
|
|
14
14
|
import {
|
|
15
15
|
DEFAULT_AGENT_CONFIGS
|
|
16
16
|
} from "./index-1ey3dxq7.js";
|
|
17
|
-
import"./index-
|
|
17
|
+
import"./index-afgh75zg.js";
|
|
18
18
|
import"./index-scww5b77.js";
|
|
19
19
|
import"./index-9fxs0rm1.js";
|
|
20
20
|
import"./index-q1jaeynn.js";
|
|
21
|
-
import"./index-
|
|
21
|
+
import"./index-h389ed8y.js";
|
|
22
22
|
import"./index-30ejh1tx.js";
|
|
23
23
|
import"./index-t6wfwdm1.js";
|
|
24
24
|
import"./index-hpp2r0sd.js";
|
|
@@ -35,7 +35,8 @@ import"./index-jtqkh8jf.js";
|
|
|
35
35
|
import"./index-5e4e2hvv.js";
|
|
36
36
|
import"./index-p0arc26j.js";
|
|
37
37
|
import"./index-zgwm4ryv.js";
|
|
38
|
-
import"./index-
|
|
38
|
+
import"./index-dqh3zhhc.js";
|
|
39
|
+
import"./index-x5g7et24.js";
|
|
39
40
|
import"./index-0dab9w37.js";
|
|
40
41
|
import"./index-293f68mj.js";
|
|
41
42
|
import"./index-5mkc2f9z.js";
|
|
@@ -45,9 +45,14 @@ var WorkspaceSchema = exports_external.object({
|
|
|
45
45
|
directory: exports_external.string(),
|
|
46
46
|
gitHead: exports_external.string().nullable(),
|
|
47
47
|
dirtyHash: exports_external.string().nullable(),
|
|
48
|
+
changedFiles: exports_external.array(exports_external.string()).nullable().optional(),
|
|
48
49
|
prHeadSha: exports_external.string().nullable(),
|
|
49
50
|
scope: exports_external.string().nullable()
|
|
50
51
|
}).strict();
|
|
52
|
+
var TaskChangeContextSchema = exports_external.object({
|
|
53
|
+
declaredFiles: exports_external.array(exports_external.string()).nullable(),
|
|
54
|
+
baseline: WorkspaceSchema
|
|
55
|
+
}).strict();
|
|
51
56
|
var PromptSchema = exports_external.object({
|
|
52
57
|
text: exports_external.string(),
|
|
53
58
|
chars: exports_external.number(),
|
|
@@ -82,6 +87,7 @@ var RecordSchema = exports_external.object({
|
|
|
82
87
|
mode: exports_external.string().optional(),
|
|
83
88
|
promptHash: exports_external.string().optional(),
|
|
84
89
|
workspace: WorkspaceSchema.optional(),
|
|
90
|
+
taskChangeContext: TaskChangeContextSchema.optional(),
|
|
85
91
|
prompt: PromptSchema.optional(),
|
|
86
92
|
generation: exports_external.number().optional(),
|
|
87
93
|
result: ResultSchema.optional(),
|
|
@@ -157,6 +163,7 @@ async function recordPendingDelegation(directory, input, options = {}) {
|
|
|
157
163
|
...input.mode ? { mode: input.mode } : {},
|
|
158
164
|
...input.promptHash ? { promptHash: input.promptHash } : {},
|
|
159
165
|
...input.workspace ? { workspace: input.workspace } : {},
|
|
166
|
+
...input.taskChangeContext ? { taskChangeContext: input.taskChangeContext } : {},
|
|
160
167
|
...input.prompt ? { prompt: input.prompt } : {},
|
|
161
168
|
...input.generation !== undefined ? { generation: input.generation } : {}
|
|
162
169
|
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import {
|
|
3
|
+
_internals,
|
|
4
|
+
captureWorkspaceSnapshot,
|
|
5
|
+
changedFilesSinceSnapshot,
|
|
6
|
+
compareWorkspaceSnapshot,
|
|
7
|
+
compareWorkspaceSnapshots,
|
|
8
|
+
digest,
|
|
9
|
+
parsePorcelainPaths,
|
|
10
|
+
workspaceSnapshotMatches
|
|
11
|
+
} from "./index-dqh3zhhc.js";
|
|
12
|
+
import"./index-a76rekgs.js";
|
|
13
|
+
export {
|
|
14
|
+
workspaceSnapshotMatches,
|
|
15
|
+
parsePorcelainPaths,
|
|
16
|
+
digest,
|
|
17
|
+
compareWorkspaceSnapshots,
|
|
18
|
+
compareWorkspaceSnapshot,
|
|
19
|
+
changedFilesSinceSnapshot,
|
|
20
|
+
captureWorkspaceSnapshot,
|
|
21
|
+
_internals
|
|
22
|
+
};
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* Non-fatal: any fs error (permissions, disk full, etc.) is swallowed so the
|
|
7
7
|
* plugin continues with its default or global config.
|
|
8
8
|
*/
|
|
9
|
-
export declare function writeProjectConfigIfNew(directory: string,
|
|
9
|
+
export declare function writeProjectConfigIfNew(directory: string, _quiet?: boolean): void;
|
|
10
10
|
/**
|
|
11
11
|
* Writes .swarm/config.example.json on first plugin init for a given project.
|
|
12
12
|
* Creates .swarm/ if it does not yet exist. Non-fatal: all errors are silently
|
|
@@ -68,7 +68,8 @@ export declare const OPENCODE_ONLY_ARCHITECT_MODE_SKILLS: Array<{
|
|
|
68
68
|
* `kind`:
|
|
69
69
|
* - `identical`: `.opencode` and `.claude` SKILL.md must be byte-identical.
|
|
70
70
|
* `canonical` records which side wins when they drift (fix direction only;
|
|
71
|
-
* detection is symmetric).
|
|
71
|
+
* detection is symmetric). `extraIdenticalPaths` narrowly extends the same
|
|
72
|
+
* byte-identity contract to additional runtime mirrors when present.
|
|
72
73
|
* - `divergent`: both must exist; content intentionally differs per runtime.
|
|
73
74
|
* - `opencode-only`: `.opencode` exists; no `.claude` mirror expected.
|
|
74
75
|
*/
|
|
@@ -76,6 +77,7 @@ export declare const ADDITIONAL_SKILL_MIRROR_CONTRACTS: Array<{
|
|
|
76
77
|
slug: string;
|
|
77
78
|
kind: 'identical' | 'divergent' | 'opencode-only';
|
|
78
79
|
canonical?: '.claude' | '.opencode';
|
|
80
|
+
extraIdenticalPaths?: string[];
|
|
79
81
|
reason: string;
|
|
80
82
|
}>;
|
|
81
83
|
/**
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare function isExactMarkdownPath(value: unknown): boolean;
|
|
2
|
+
/** Cheap pre-classification used to avoid Git snapshots for ineligible tasks. */
|
|
3
|
+
export declare function isMarkdownOnlyDeclaredScope(value: unknown): value is string[];
|
|
4
|
+
/** Require independent non-empty declared and observed exact-.md proof. */
|
|
5
|
+
export declare function isMarkdownOnlyTaskChange(declaredFiles: unknown, observedFiles: unknown): boolean;
|
package/dist/gate-evidence.d.ts
CHANGED
|
@@ -9,6 +9,11 @@
|
|
|
9
9
|
* Evidence files survive session restarts (unlike in-memory state).
|
|
10
10
|
* Agents never write these files directly — only the hook does.
|
|
11
11
|
* Gates are append-only: required_gates can only grow, never shrink.
|
|
12
|
+
*
|
|
13
|
+
* Threat boundary: this store provides atomic, path-contained durability and
|
|
14
|
+
* auditability for cooperative same-user agents. It is not tamper-proof
|
|
15
|
+
* authorization against a process with arbitrary same-user workspace access;
|
|
16
|
+
* that requires a protected trust root outside the project workspace.
|
|
12
17
|
*/
|
|
13
18
|
export interface GateEvidence {
|
|
14
19
|
sessionId: string;
|
|
@@ -20,8 +25,14 @@ export interface TaskEvidence {
|
|
|
20
25
|
required_gates: string[];
|
|
21
26
|
gates: Record<string, GateEvidence>;
|
|
22
27
|
turbo?: boolean;
|
|
28
|
+
/** Durable proof that the coder dispatch was classified as exact Markdown-only. */
|
|
29
|
+
test_engineer_exempt?: boolean;
|
|
23
30
|
}
|
|
24
31
|
export declare const DEFAULT_REQUIRED_GATES: string[];
|
|
32
|
+
export interface GateDerivationContext {
|
|
33
|
+
/** Trusted pre/post workspace classification; false/absent fails closed. */
|
|
34
|
+
testEngineerExempt?: boolean;
|
|
35
|
+
}
|
|
25
36
|
/**
|
|
26
37
|
* Canonical task-id validation helper.
|
|
27
38
|
* Delegates to the shared strict validator (#452 item 2).
|
|
@@ -32,12 +43,12 @@ export declare function isValidTaskId(taskId: string): boolean;
|
|
|
32
43
|
* Maps the first-dispatched agent type to the initial required_gates array.
|
|
33
44
|
* Unknown agent types fall back to the safe default ["reviewer", "test_engineer"].
|
|
34
45
|
*/
|
|
35
|
-
export declare function deriveRequiredGates(agentType: string): string[];
|
|
46
|
+
export declare function deriveRequiredGates(agentType: string, context?: GateDerivationContext): string[];
|
|
36
47
|
/**
|
|
37
48
|
* Returns the union of existingGates and deriveRequiredGates(newAgentType).
|
|
38
49
|
* Sorted, deduplicated. Gates can only grow, never shrink.
|
|
39
50
|
*/
|
|
40
|
-
export declare function expandRequiredGates(existingGates: string[], newAgentType: string): string[];
|
|
51
|
+
export declare function expandRequiredGates(existingGates: string[], newAgentType: string, context?: GateDerivationContext): string[];
|
|
41
52
|
/**
|
|
42
53
|
* Creates or updates .swarm/evidence/{taskId}.json with a gate pass entry.
|
|
43
54
|
* If file doesn't exist: creates with required_gates from deriveRequiredGates(gate).
|
|
@@ -50,7 +61,7 @@ export declare function recordGateEvidence(directory: string, taskId: string, ga
|
|
|
50
61
|
* Used when non-gate agents are dispatched (coder, explorer, sme, etc.).
|
|
51
62
|
* Creates evidence file if it doesn't exist yet.
|
|
52
63
|
*/
|
|
53
|
-
export declare function recordAgentDispatch(directory: string, taskId: string, agentType: string, turbo?: boolean): Promise<void>;
|
|
64
|
+
export declare function recordAgentDispatch(directory: string, taskId: string, agentType: string, turbo?: boolean, context?: GateDerivationContext): Promise<void>;
|
|
54
65
|
/**
|
|
55
66
|
* Returns the TaskEvidence for a task, or null if file missing or parse error.
|
|
56
67
|
* Never throws.
|