opencode-swarm 7.136.0 → 7.136.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/swarm-pr-feedback/SKILL.md +41 -1
- package/.opencode/skills/swarm-pr-review/SKILL.md +83 -24
- package/README.md +18 -0
- package/dist/background/candidate-contract.d.ts +13 -0
- package/dist/background/workspace-snapshot.d.ts +54 -0
- package/dist/cli/{config-doctor-q0krbxwv.js → config-doctor-b67nb84b.js} +2 -2
- package/dist/cli/{curation-policy-v6ywe8qd.js → curation-policy-kvzhfaj1.js} +2 -2
- package/dist/cli/{curator-llm-factory-mhwje8rf.js → curator-llm-factory-x7kvry9x.js} +17 -14
- package/dist/cli/{curator-tqedvpy1.js → curator-nrmj8bds.js} +17 -14
- package/dist/cli/{evidence-summary-service-w006jnpg.js → evidence-summary-service-cf8sz2bq.js} +3 -1
- package/dist/cli/{guardrail-explain-m0m74hvr.js → guardrail-explain-5kd44rcj.js} +18 -15
- package/dist/cli/{guardrail-log-5g8x6qc6.js → guardrail-log-aksrzqdx.js} +3 -3
- package/dist/cli/hashing-mjwn6j4y.js +34 -0
- package/dist/cli/{hive-promoter-s804newd.js → hive-promoter-cy21rhnd.js} +17 -14
- package/dist/cli/{index-n8j0cnp1.js → index-0755132s.js} +4 -4
- package/dist/cli/{index-1kjg590p.js → index-1kn24ja0.js} +1 -1
- package/dist/cli/{index-j08trvny.js → index-21115szq.js} +5 -5
- package/dist/cli/{index-2cv1j3rf.js → index-37v2wxqe.js} +1 -1
- package/dist/cli/{index-cfz5750k.js → index-7ayaq27q.js} +5 -1
- package/dist/cli/{index-9bk16zkv.js → index-84nz7bhe.js} +1 -1
- package/dist/cli/{index-bwfzq91q.js → index-ad6j0m7k.js} +12 -6
- package/dist/cli/{index-qh9466j3.js → index-azghvnja.js} +2 -2
- package/dist/cli/{index-cxq1t7j1.js → index-ckybsn6p.js} +19 -16
- package/dist/cli/{index-cggqh2dz.js → index-kwwxevne.js} +53 -996
- package/dist/cli/{index-nw9cn84t.js → index-m5fw4mer.js} +19 -2
- package/dist/cli/{index-2w4tsmva.js → index-rw3f73aq.js} +1 -1
- package/dist/cli/{index-wpqypdge.js → index-s0rbdp61.js} +2 -2
- package/dist/cli/{index-bbejqagj.js → index-s0vahtdm.js} +1 -1
- package/dist/cli/{index-81dkzncr.js → index-sr2cynyw.js} +4535 -2325
- package/dist/cli/index-wjm896ey.js +1100 -0
- package/dist/cli/{index-w58bmwyq.js → index-wnz282j3.js} +2 -2
- package/dist/cli/{index-y6a7gjtj.js → index-wsdnttf4.js} +228 -81
- package/dist/cli/{index-m1hew17b.js → index-y0xaq4f3.js} +39 -4
- package/dist/cli/index-y8552snf.js +264 -0
- package/dist/cli/index-z1tm47nj.js +783 -0
- package/dist/cli/index.js +17 -14
- package/dist/cli/{knowledge-escalator-f1m2xp5x.js → knowledge-escalator-ta3xjrdj.js} +3 -3
- package/dist/cli/{knowledge-events-rksgem6f.js → knowledge-events-dk6banmz.js} +1 -1
- package/dist/cli/{knowledge-store-t6d6fr8b.js → knowledge-store-h3jz10bv.js} +1 -1
- package/dist/cli/{knowledge-validator-5ggzb3j1.js → knowledge-validator-jsz1dxkr.js} +4 -4
- package/dist/cli/runner-2v413r74.js +21 -0
- package/dist/cli/{scan-cursor-18fnwr58.js → scan-cursor-48gwzh9c.js} +2 -2
- package/dist/cli/{schema-jw15d8bt.js → schema-f937b9cs.js} +5 -1
- package/dist/cli/{skill-generator-3n5y902z.js → skill-generator-4p10ktw1.js} +5 -5
- package/dist/cli/{workspace-snapshot-jmyamqnv.js → workspace-snapshot-h5rzw37b.js} +5 -1
- package/dist/commands/registry.d.ts +72 -0
- package/dist/commands/skill-opt.d.ts +41 -0
- package/dist/config/schema.d.ts +47 -0
- package/dist/hooks/guardrails/file-authority.d.ts +11 -2
- package/dist/hooks/pr-workflow-gate.d.ts +261 -4
- package/dist/hooks/pr-workflow-response-gate.d.ts +27 -9
- package/dist/hooks/write-target-resolver.d.ts +19 -0
- package/dist/index.js +355 -320
- package/dist/services/skill-evaluator.d.ts +17 -0
- package/dist/services/skill-optimizer/activation.d.ts +58 -0
- package/dist/services/skill-optimizer/candidates.d.ts +88 -0
- package/dist/services/skill-optimizer/controller.d.ts +146 -0
- package/dist/services/skill-optimizer/deterministic-seed.d.ts +29 -0
- package/dist/services/skill-optimizer/lifecycle.d.ts +70 -0
- package/dist/services/skill-optimizer/promoted-external-staleness.d.ts +98 -0
- package/dist/services/skill-optimizer/retirement.d.ts +54 -0
- package/dist/services/skill-optimizer/skill-eval-tasks.d.ts +47 -0
- package/dist/services/skill-optimizer/smoke.d.ts +46 -0
- package/dist/services/skill-optimizer/store.d.ts +118 -0
- package/dist/tools/write-pr-review-trigger-eval.d.ts +2 -1
- package/dist/utils/stable-stringify.d.ts +46 -0
- package/evaluation-fixtures/skill-eval/scoring/score-skill-eval.cjs +97 -0
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -6,36 +6,39 @@ import {
|
|
|
6
6
|
getPluginConfigDir,
|
|
7
7
|
getPluginLockFilePaths,
|
|
8
8
|
resolveCommand
|
|
9
|
-
} from "./index-
|
|
9
|
+
} from "./index-sr2cynyw.js";
|
|
10
10
|
import"./index-vm4xw9z3.js";
|
|
11
|
-
import"./index-
|
|
12
|
-
import"./index-
|
|
13
|
-
import"./index-
|
|
11
|
+
import"./index-wjm896ey.js";
|
|
12
|
+
import"./index-m5fw4mer.js";
|
|
13
|
+
import"./index-7ayaq27q.js";
|
|
14
|
+
import"./index-kwwxevne.js";
|
|
15
|
+
import"./index-z1tm47nj.js";
|
|
16
|
+
import"./index-y8552snf.js";
|
|
14
17
|
import"./index-4905hd2m.js";
|
|
15
18
|
import"./index-134d35c1.js";
|
|
16
|
-
import"./index-
|
|
17
|
-
import"./index-
|
|
18
|
-
import"./index-
|
|
19
|
+
import"./index-ad6j0m7k.js";
|
|
20
|
+
import"./index-21115szq.js";
|
|
21
|
+
import"./index-1kn24ja0.js";
|
|
19
22
|
import"./index-6mjf4vr1.js";
|
|
20
23
|
import"./index-c8s9a3zh.js";
|
|
21
24
|
import"./index-9ss2m4rs.js";
|
|
22
|
-
import"./index-
|
|
25
|
+
import"./index-wsdnttf4.js";
|
|
23
26
|
import"./index-mrtms113.js";
|
|
24
|
-
import"./index-
|
|
25
|
-
import"./index-
|
|
27
|
+
import"./index-s0rbdp61.js";
|
|
28
|
+
import"./index-rw3f73aq.js";
|
|
26
29
|
import"./index-rtry5xyf.js";
|
|
27
|
-
import"./index-
|
|
28
|
-
import"./index-
|
|
30
|
+
import"./index-0755132s.js";
|
|
31
|
+
import"./index-84nz7bhe.js";
|
|
29
32
|
import"./index-ae75rja9.js";
|
|
30
33
|
import"./index-dzyjb33e.js";
|
|
31
34
|
import"./index-ey29aap6.js";
|
|
32
|
-
import"./index-
|
|
35
|
+
import"./index-s0vahtdm.js";
|
|
33
36
|
import"./index-k5jrywpr.js";
|
|
34
37
|
import"./index-n832052r.js";
|
|
35
38
|
import {
|
|
36
39
|
init_package,
|
|
37
40
|
package_default
|
|
38
|
-
} from "./index-
|
|
41
|
+
} from "./index-y0xaq4f3.js";
|
|
39
42
|
import"./index-bk5tah7q.js";
|
|
40
43
|
import"./index-8fwhhayc.js";
|
|
41
44
|
import"./index-q1exe2b3.js";
|
|
@@ -8,9 +8,9 @@ import {
|
|
|
8
8
|
maybeEscalateOnViolation,
|
|
9
9
|
maybeQuarantineOnContradiction,
|
|
10
10
|
readRecentEscalations
|
|
11
|
-
} from "./index-
|
|
12
|
-
import"./index-
|
|
13
|
-
import"./index-
|
|
11
|
+
} from "./index-21115szq.js";
|
|
12
|
+
import"./index-0755132s.js";
|
|
13
|
+
import"./index-84nz7bhe.js";
|
|
14
14
|
import"./index-ae75rja9.js";
|
|
15
15
|
import"./index-dzyjb33e.js";
|
|
16
16
|
import"./index-ey29aap6.js";
|
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
resolveKnowledgeCounterBaselinePath,
|
|
29
29
|
resolveKnowledgeEventsPath,
|
|
30
30
|
resolveLegacyApplicationLogPath
|
|
31
|
-
} from "./index-
|
|
31
|
+
} from "./index-84nz7bhe.js";
|
|
32
32
|
import"./index-ae75rja9.js";
|
|
33
33
|
import"./index-dzyjb33e.js";
|
|
34
34
|
import"./index-ey29aap6.js";
|
|
@@ -23,11 +23,11 @@ import {
|
|
|
23
23
|
validateLesson,
|
|
24
24
|
validateSkillCandidatePath,
|
|
25
25
|
validateSkillPath
|
|
26
|
-
} from "./index-
|
|
27
|
-
import"./index-
|
|
26
|
+
} from "./index-s0rbdp61.js";
|
|
27
|
+
import"./index-rw3f73aq.js";
|
|
28
28
|
import"./index-rtry5xyf.js";
|
|
29
|
-
import"./index-
|
|
30
|
-
import"./index-
|
|
29
|
+
import"./index-0755132s.js";
|
|
30
|
+
import"./index-84nz7bhe.js";
|
|
31
31
|
import"./index-ae75rja9.js";
|
|
32
32
|
import"./index-dzyjb33e.js";
|
|
33
33
|
import"./index-ey29aap6.js";
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import {
|
|
3
|
+
_internals,
|
|
4
|
+
createModelEvaluationExecutor,
|
|
5
|
+
runEvaluation
|
|
6
|
+
} from "./index-wjm896ey.js";
|
|
7
|
+
import"./index-z1tm47nj.js";
|
|
8
|
+
import"./index-y8552snf.js";
|
|
9
|
+
import"./index-ey29aap6.js";
|
|
10
|
+
import"./index-fsrp8wp3.js";
|
|
11
|
+
import"./index-09b9zncg.js";
|
|
12
|
+
import"./index-7g4c7s5r.js";
|
|
13
|
+
import"./index-bpmtbmy9.js";
|
|
14
|
+
import"./index-7a2hm51h.js";
|
|
15
|
+
import"./index-y111zefa.js";
|
|
16
|
+
import"./index-a76rekgs.js";
|
|
17
|
+
export {
|
|
18
|
+
runEvaluation,
|
|
19
|
+
createModelEvaluationExecutor,
|
|
20
|
+
_internals
|
|
21
|
+
};
|
|
@@ -4,8 +4,8 @@ import {
|
|
|
4
4
|
alreadyCuratedThisGeneration,
|
|
5
5
|
claimNextScanBatch,
|
|
6
6
|
getScanStatus
|
|
7
|
-
} from "./index-
|
|
8
|
-
import"./index-
|
|
7
|
+
} from "./index-1kn24ja0.js";
|
|
8
|
+
import"./index-0755132s.js";
|
|
9
9
|
import"./index-ae75rja9.js";
|
|
10
10
|
import"./index-dzyjb33e.js";
|
|
11
11
|
import"./index-ey29aap6.js";
|
|
@@ -26,6 +26,7 @@ import {
|
|
|
26
26
|
DEFAULT_ARCHITECT_PROFILE,
|
|
27
27
|
DEFAULT_EXTERNAL_SKILLS_CONFIG,
|
|
28
28
|
DEFAULT_SKILLS_CONFIG,
|
|
29
|
+
DEFAULT_SKILL_OPT_CONFIG,
|
|
29
30
|
DecisionDecaySchema,
|
|
30
31
|
DesignDocsConfigSchema,
|
|
31
32
|
DiscoverySourceSchema,
|
|
@@ -71,6 +72,7 @@ import {
|
|
|
71
72
|
SecretscanConfigSchema,
|
|
72
73
|
SelfReviewConfigSchema,
|
|
73
74
|
SkillImproverConfigSchema,
|
|
75
|
+
SkillOptConfigSchema,
|
|
74
76
|
SkillPropagationConfigSchema,
|
|
75
77
|
SkillsConfigSchema,
|
|
76
78
|
SlopDetectorConfigSchema,
|
|
@@ -93,7 +95,7 @@ import {
|
|
|
93
95
|
resolveGeneratedAgentRole,
|
|
94
96
|
resolveGuardrailsConfig,
|
|
95
97
|
stripKnownSwarmPrefix
|
|
96
|
-
} from "./index-
|
|
98
|
+
} from "./index-y0xaq4f3.js";
|
|
97
99
|
import"./index-bk5tah7q.js";
|
|
98
100
|
import"./index-3jcyn8g6.js";
|
|
99
101
|
import"./index-bpmtbmy9.js";
|
|
@@ -123,6 +125,7 @@ export {
|
|
|
123
125
|
SlopDetectorConfigSchema,
|
|
124
126
|
SkillsConfigSchema,
|
|
125
127
|
SkillPropagationConfigSchema,
|
|
128
|
+
SkillOptConfigSchema,
|
|
126
129
|
SkillImproverConfigSchema,
|
|
127
130
|
SelfReviewConfigSchema,
|
|
128
131
|
SecretscanConfigSchema,
|
|
@@ -168,6 +171,7 @@ export {
|
|
|
168
171
|
DiscoverySourceSchema,
|
|
169
172
|
DesignDocsConfigSchema,
|
|
170
173
|
DecisionDecaySchema,
|
|
174
|
+
DEFAULT_SKILL_OPT_CONFIG,
|
|
171
175
|
DEFAULT_SKILLS_CONFIG,
|
|
172
176
|
DEFAULT_EXTERNAL_SKILLS_CONFIG,
|
|
173
177
|
DEFAULT_ARCHITECT_PROFILE,
|
|
@@ -33,12 +33,12 @@ import {
|
|
|
33
33
|
sanitizeSlug,
|
|
34
34
|
selectCandidateEntries,
|
|
35
35
|
writeEvalStub
|
|
36
|
-
} from "./index-
|
|
37
|
-
import"./index-
|
|
38
|
-
import"./index-
|
|
36
|
+
} from "./index-ad6j0m7k.js";
|
|
37
|
+
import"./index-s0rbdp61.js";
|
|
38
|
+
import"./index-rw3f73aq.js";
|
|
39
39
|
import"./index-rtry5xyf.js";
|
|
40
|
-
import"./index-
|
|
41
|
-
import"./index-
|
|
40
|
+
import"./index-0755132s.js";
|
|
41
|
+
import"./index-84nz7bhe.js";
|
|
42
42
|
import"./index-ae75rja9.js";
|
|
43
43
|
import"./index-dzyjb33e.js";
|
|
44
44
|
import"./index-ey29aap6.js";
|
|
@@ -31,11 +31,13 @@ import {
|
|
|
31
31
|
resolvePrReviewDiffStatsAsync,
|
|
32
32
|
resolvePrWorkflowRevisionDigest,
|
|
33
33
|
resolvePrWorkflowRevisionDigestAsync,
|
|
34
|
+
resolvePrWorkflowRevisionDigestDetailed,
|
|
35
|
+
resolvePrWorkflowRevisionDigestDetailedAsync,
|
|
34
36
|
resolveRemoteRefsContainingHead,
|
|
35
37
|
resolveRemoteRefsContainingHeadAsync,
|
|
36
38
|
switchPrFeedbackTrackingCandidateAsync,
|
|
37
39
|
workspaceSnapshotMatches
|
|
38
|
-
} from "./index-
|
|
40
|
+
} from "./index-wsdnttf4.js";
|
|
39
41
|
import"./index-y111zefa.js";
|
|
40
42
|
import"./index-a76rekgs.js";
|
|
41
43
|
export {
|
|
@@ -43,6 +45,8 @@ export {
|
|
|
43
45
|
switchPrFeedbackTrackingCandidateAsync,
|
|
44
46
|
resolveRemoteRefsContainingHeadAsync,
|
|
45
47
|
resolveRemoteRefsContainingHead,
|
|
48
|
+
resolvePrWorkflowRevisionDigestDetailedAsync,
|
|
49
|
+
resolvePrWorkflowRevisionDigestDetailed,
|
|
46
50
|
resolvePrWorkflowRevisionDigestAsync,
|
|
47
51
|
resolvePrWorkflowRevisionDigest,
|
|
48
52
|
resolvePrReviewDiffStatsAsync,
|
|
@@ -258,6 +258,78 @@ export declare const COMMAND_REGISTRY: {
|
|
|
258
258
|
readonly category: "diagnostics";
|
|
259
259
|
readonly toolPolicy: "agent";
|
|
260
260
|
};
|
|
261
|
+
readonly 'skill-opt': {
|
|
262
|
+
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
263
|
+
readonly description: "Governed single-skill optimizer (issue #1822). Proposes, validates, and activates one allowlisted SKILL.md candidate at a time with durable lifecycle, serial control, and manual approval.";
|
|
264
|
+
readonly args: "plan|run|status|diff|approve|reject|rollback|history <slug> [candidateId] [--json] [--confirm] [--expected-content-hash <hash>] [--models <csv>] [--dry-run]";
|
|
265
|
+
readonly details: "Disabled/proposal-only by default. `run` requires skill_opt.enabled=true AND --confirm (consumes a held-out test set). approve/activate/reject/rollback are human-only and require --expected-content-hash to refuse a stale base. Stores append-only lifecycle under .swarm/evolution/skills/<slug>/<candidateId>/.";
|
|
266
|
+
readonly category: "utility";
|
|
267
|
+
readonly toolPolicy: "agent";
|
|
268
|
+
};
|
|
269
|
+
readonly 'skill-opt plan': {
|
|
270
|
+
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
271
|
+
readonly description: "Propose an optimization round (dry-run; no mutation, no validation)";
|
|
272
|
+
readonly subcommandOf: "skill-opt";
|
|
273
|
+
readonly args: "<slug> [--json] [--models <csv>]";
|
|
274
|
+
readonly category: "utility";
|
|
275
|
+
readonly toolPolicy: "agent";
|
|
276
|
+
};
|
|
277
|
+
readonly 'skill-opt run': {
|
|
278
|
+
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
279
|
+
readonly description: "Execute the optimization loop (draft→smoke→validate; held-out set is single-use so at most one validation per run). Requires skill_opt.enabled=true and --confirm.";
|
|
280
|
+
readonly subcommandOf: "skill-opt";
|
|
281
|
+
readonly args: "<slug> --confirm [--json] [--models <csv>]";
|
|
282
|
+
readonly category: "utility";
|
|
283
|
+
readonly toolPolicy: "human-only";
|
|
284
|
+
};
|
|
285
|
+
readonly 'skill-opt status': {
|
|
286
|
+
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
287
|
+
readonly description: "Show the current candidate lifecycle state";
|
|
288
|
+
readonly subcommandOf: "skill-opt";
|
|
289
|
+
readonly args: "<slug> <candidateId> [--json]";
|
|
290
|
+
readonly category: "utility";
|
|
291
|
+
readonly toolPolicy: "agent";
|
|
292
|
+
};
|
|
293
|
+
readonly 'skill-opt diff': {
|
|
294
|
+
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
295
|
+
readonly description: "Show baseline-vs-candidate diff summary for a candidate";
|
|
296
|
+
readonly subcommandOf: "skill-opt";
|
|
297
|
+
readonly args: "<slug> <candidateId> [--json]";
|
|
298
|
+
readonly category: "utility";
|
|
299
|
+
readonly toolPolicy: "agent";
|
|
300
|
+
};
|
|
301
|
+
readonly 'skill-opt approve': {
|
|
302
|
+
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
303
|
+
readonly description: "Activate a pending candidate (human-only; requires --expected-content-hash)";
|
|
304
|
+
readonly subcommandOf: "skill-opt";
|
|
305
|
+
readonly args: "<slug> <candidateId> --expected-content-hash <hash> [--json]";
|
|
306
|
+
readonly category: "utility";
|
|
307
|
+
readonly toolPolicy: "human-only";
|
|
308
|
+
};
|
|
309
|
+
readonly 'skill-opt reject': {
|
|
310
|
+
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
311
|
+
readonly description: "Record a rejection for a candidate (no active-skill mutation)";
|
|
312
|
+
readonly subcommandOf: "skill-opt";
|
|
313
|
+
readonly args: "<slug> <candidateId> [--json]";
|
|
314
|
+
readonly category: "utility";
|
|
315
|
+
readonly toolPolicy: "human-only";
|
|
316
|
+
};
|
|
317
|
+
readonly 'skill-opt rollback': {
|
|
318
|
+
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
319
|
+
readonly description: "Restore the pre-activation snapshot (appends a rolled_back event)";
|
|
320
|
+
readonly subcommandOf: "skill-opt";
|
|
321
|
+
readonly args: "<slug> <candidateId> [--json]";
|
|
322
|
+
readonly category: "utility";
|
|
323
|
+
readonly toolPolicy: "human-only";
|
|
324
|
+
};
|
|
325
|
+
readonly 'skill-opt history': {
|
|
326
|
+
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
327
|
+
readonly description: "Show the append-only lifecycle event log for a candidate";
|
|
328
|
+
readonly subcommandOf: "skill-opt";
|
|
329
|
+
readonly args: "<slug> <candidateId> [--json]";
|
|
330
|
+
readonly category: "utility";
|
|
331
|
+
readonly toolPolicy: "agent";
|
|
332
|
+
};
|
|
261
333
|
readonly review: {
|
|
262
334
|
readonly handler: typeof handleReviewCommand;
|
|
263
335
|
readonly description: "Run the independent review model against a selected Git diff";
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `/swarm skill-opt` command group (issue #1822).
|
|
3
|
+
*
|
|
4
|
+
* Subcommands: plan | run | status | diff | approve | reject | rollback | history
|
|
5
|
+
*
|
|
6
|
+
* - JSON output on `--json` (convention: gate-stats.ts).
|
|
7
|
+
* - Disabled/proposal-only default: `run` requires `config.skill_opt.enabled === true`
|
|
8
|
+
* AND an explicit `--confirm`. `plan`/`status`/`diff`/`history` are always
|
|
9
|
+
* available (read-only / proposal-only).
|
|
10
|
+
* - `approve`/`activate`/`reject`/`rollback` are human-gated
|
|
11
|
+
* (`toolPolicy: 'human-only'` on the registry entries) and require an
|
|
12
|
+
* explicit `--expected-content-hash` (D6) — slash commands do NOT go through
|
|
13
|
+
* scope-guard (which is coder-only), so the hash check is the staleness guard.
|
|
14
|
+
*/
|
|
15
|
+
import { type SkillOptConfig } from '../config/schema.js';
|
|
16
|
+
import type { EvaluationModelDispatcher } from '../evaluation/model-dispatcher.js';
|
|
17
|
+
/** Resolve the skill_opt config from raw plugin config, fail-open to defaults. */
|
|
18
|
+
export declare function resolveSkillOptConfig(input: unknown): SkillOptConfig;
|
|
19
|
+
export interface SkillOptRuntime {
|
|
20
|
+
dispatcher?: EvaluationModelDispatcher;
|
|
21
|
+
parentSessionId?: string;
|
|
22
|
+
config?: SkillOptConfig;
|
|
23
|
+
}
|
|
24
|
+
/** `/swarm skill-opt plan <slug>` — propose a round (dry-run). */
|
|
25
|
+
export declare function handleSkillOptPlan(directory: string, args: string[], runtime?: SkillOptRuntime): Promise<string>;
|
|
26
|
+
/** `/swarm skill-opt run <slug>` — execute a round (requires enabled + --confirm). */
|
|
27
|
+
export declare function handleSkillOptRun(directory: string, args: string[], runtime?: SkillOptRuntime): Promise<string>;
|
|
28
|
+
/** `/swarm skill-opt status <slug> [candidateId]` — current candidate state. */
|
|
29
|
+
export declare function handleSkillOptStatus(directory: string, args: string[]): Promise<string>;
|
|
30
|
+
/** `/swarm skill-opt diff <slug> <candidateId>` — baseline vs candidate diff. */
|
|
31
|
+
export declare function handleSkillOptDiff(directory: string, args: string[]): Promise<string>;
|
|
32
|
+
/** `/swarm skill-opt approve <slug> <candidateId> --expected-content-hash <hash>` — activate. */
|
|
33
|
+
export declare function handleSkillOptApprove(directory: string, args: string[]): Promise<string>;
|
|
34
|
+
/** `/swarm skill-opt reject <slug> <candidateId>` — record rejection (no mutation). */
|
|
35
|
+
export declare function handleSkillOptReject(directory: string, args: string[]): Promise<string>;
|
|
36
|
+
/** `/swarm skill-opt rollback <slug> <candidateId>` — restore snapshot. */
|
|
37
|
+
export declare function handleSkillOptRollback(directory: string, args: string[]): Promise<string>;
|
|
38
|
+
/** `/swarm skill-opt history <slug> <candidateId>` — replay log. */
|
|
39
|
+
export declare function handleSkillOptHistory(directory: string, args: string[]): Promise<string>;
|
|
40
|
+
/** Compute the current content hash of a skill (for the approve hash arg). */
|
|
41
|
+
export declare function computeSkillContentHash(directory: string, skillSlug: string): string;
|
package/dist/config/schema.d.ts
CHANGED
|
@@ -978,6 +978,36 @@ export declare const SkillsConfigSchema: z.ZodObject<{
|
|
|
978
978
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
979
979
|
}, z.core.$strip>;
|
|
980
980
|
export type SkillsConfig = z.infer<typeof SkillsConfigSchema>;
|
|
981
|
+
/**
|
|
982
|
+
* Governed skill optimizer configuration (issue #1822 — SkillOpt 3/7).
|
|
983
|
+
*
|
|
984
|
+
* Disabled by default. When disabled, `/swarm skill-opt run` refuses to
|
|
985
|
+
* execute a round (it still allows `plan`/`status`/`diff`/`history` in
|
|
986
|
+
* proposal-only mode). Enabling does NOT mutate skills autonomously: every
|
|
987
|
+
* activation requires an explicit human `/swarm skill-opt approve` with a
|
|
988
|
+
* current content hash. This config is consulted only inside command handlers
|
|
989
|
+
* (never on the plugin init path — AGENTS.md invariant #1).
|
|
990
|
+
*/
|
|
991
|
+
export declare const SkillOptConfigSchema: z.ZodObject<{
|
|
992
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
993
|
+
max_rounds: z.ZodDefault<z.ZodNumber>;
|
|
994
|
+
max_candidates_per_round: z.ZodDefault<z.ZodNumber>;
|
|
995
|
+
max_validations_per_round: z.ZodDefault<z.ZodNumber>;
|
|
996
|
+
max_round_time_ms: z.ZodDefault<z.ZodNumber>;
|
|
997
|
+
max_tokens_per_round: z.ZodDefault<z.ZodNumber>;
|
|
998
|
+
max_rejections: z.ZodDefault<z.ZodNumber>;
|
|
999
|
+
max_inconclusive_rounds: z.ZodDefault<z.ZodNumber>;
|
|
1000
|
+
max_transient_retries: z.ZodDefault<z.ZodNumber>;
|
|
1001
|
+
convergence_non_improvements: z.ZodDefault<z.ZodNumber>;
|
|
1002
|
+
max_changed_lines: z.ZodDefault<z.ZodNumber>;
|
|
1003
|
+
max_changed_bytes: z.ZodDefault<z.ZodNumber>;
|
|
1004
|
+
max_changed_sections: z.ZodDefault<z.ZodNumber>;
|
|
1005
|
+
deadband: z.ZodDefault<z.ZodNumber>;
|
|
1006
|
+
retirement_min_age_days: z.ZodDefault<z.ZodNumber>;
|
|
1007
|
+
}, z.core.$strict>;
|
|
1008
|
+
export type SkillOptConfig = z.infer<typeof SkillOptConfigSchema>;
|
|
1009
|
+
/** Default governed-skill-optimizer config (fully disabled/safe). */
|
|
1010
|
+
export declare const DEFAULT_SKILL_OPT_CONFIG: SkillOptConfig;
|
|
981
1011
|
export declare const SpecWriterConfigSchema: z.ZodObject<{
|
|
982
1012
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
983
1013
|
model: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
@@ -2691,6 +2721,23 @@ export declare const PluginConfigSchema: z.ZodObject<{
|
|
|
2691
2721
|
skills: z.ZodOptional<z.ZodObject<{
|
|
2692
2722
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
2693
2723
|
}, z.core.$strip>>;
|
|
2724
|
+
skill_opt: z.ZodOptional<z.ZodObject<{
|
|
2725
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
2726
|
+
max_rounds: z.ZodDefault<z.ZodNumber>;
|
|
2727
|
+
max_candidates_per_round: z.ZodDefault<z.ZodNumber>;
|
|
2728
|
+
max_validations_per_round: z.ZodDefault<z.ZodNumber>;
|
|
2729
|
+
max_round_time_ms: z.ZodDefault<z.ZodNumber>;
|
|
2730
|
+
max_tokens_per_round: z.ZodDefault<z.ZodNumber>;
|
|
2731
|
+
max_rejections: z.ZodDefault<z.ZodNumber>;
|
|
2732
|
+
max_inconclusive_rounds: z.ZodDefault<z.ZodNumber>;
|
|
2733
|
+
max_transient_retries: z.ZodDefault<z.ZodNumber>;
|
|
2734
|
+
convergence_non_improvements: z.ZodDefault<z.ZodNumber>;
|
|
2735
|
+
max_changed_lines: z.ZodDefault<z.ZodNumber>;
|
|
2736
|
+
max_changed_bytes: z.ZodDefault<z.ZodNumber>;
|
|
2737
|
+
max_changed_sections: z.ZodDefault<z.ZodNumber>;
|
|
2738
|
+
deadband: z.ZodDefault<z.ZodNumber>;
|
|
2739
|
+
retirement_min_age_days: z.ZodDefault<z.ZodNumber>;
|
|
2740
|
+
}, z.core.$strict>>;
|
|
2694
2741
|
}, z.core.$strip>;
|
|
2695
2742
|
export type PluginConfig = z.infer<typeof PluginConfigSchema>;
|
|
2696
2743
|
export type { AgentName, PipelineAgentName, QAAgentName, } from './constants';
|
|
@@ -12,9 +12,18 @@ import * as path from 'node:path';
|
|
|
12
12
|
import { type AuthorityConfig } from '../../config/schema';
|
|
13
13
|
import { type FileZone } from '../../context/zone-classifier';
|
|
14
14
|
/**
|
|
15
|
-
* Hashes tool arguments for repetition detection
|
|
15
|
+
* Hashes tool arguments for repetition detection.
|
|
16
|
+
*
|
|
17
|
+
* Uses `stableCanonicalStringify` (recursive key-sorting at every depth, no
|
|
18
|
+
* nested-key filtering) so that two args with the same values hash equally
|
|
19
|
+
* regardless of key insertion order — including nested objects. This matters
|
|
20
|
+
* for repetition detection on nested-args tools (e.g. `todowrite` with a
|
|
21
|
+
* `todos` array): the previous `JSON.stringify(args, sortedKeys)` replacer
|
|
22
|
+
* silently dropped nested keys, collapsing distinct todo contents to the same
|
|
23
|
+
* hash.
|
|
24
|
+
*
|
|
16
25
|
* @param args Tool arguments to hash
|
|
17
|
-
* @returns Numeric hash (0 if hashing fails)
|
|
26
|
+
* @returns Numeric hash (0 for non-objects or if hashing fails)
|
|
18
27
|
*/
|
|
19
28
|
export declare function hashArgs(args: unknown): number;
|
|
20
29
|
/** A record of an agent attesting to (resolving/suppressing/deferring) a finding. */
|