opencode-swarm 7.119.0 → 7.121.0
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/dist/cli/{config-doctor-p73yfdz0.js → config-doctor-404c8mf8.js} +3 -3
- package/dist/cli/config-fingerprint-v22xh5a2.js +10 -0
- package/dist/cli/{core-gf1t2jmn.js → core-xnwasfpc.js} +1 -1
- package/dist/cli/curation-policy-re2kaysb.js +25 -0
- package/dist/cli/{curator-5xfkejsq.js → curator-8m0pf9cz.js} +30 -23
- package/dist/cli/{curator-drift-nn71xfz6.js → curator-drift-6b2fjsgr.js} +3 -2
- package/dist/cli/curator-llm-factory-jta9tggm.js +50 -0
- package/dist/cli/{evidence-summary-service-cy3k37je.js → evidence-summary-service-jtx5q3r6.js} +9 -7
- package/dist/cli/{gate-evidence-j2m4cd85.js → gate-evidence-tbpezk28.js} +5 -5
- package/dist/cli/guardrail-explain-nsfm5ksb.js +51 -0
- package/dist/cli/{guardrail-log-qjqgg7pz.js → guardrail-log-dhpp0kmn.js} +4 -4
- package/dist/cli/{hive-promoter-03m8pwg6.js → hive-promoter-8303gnfk.js} +30 -23
- package/dist/cli/index-0e1v02hq.js +343 -0
- package/dist/cli/{index-jbdgpqpj.js → index-0k4r8111.js} +28 -10
- package/dist/cli/index-0mbmfmt0.js +349 -0
- package/dist/cli/{index-5bcrp3bc.js → index-22e127jw.js} +3 -3
- package/dist/cli/{index-pjhfe7c3.js → index-3366gs26.js} +43 -7
- package/dist/cli/{index-7pspktns.js → index-3je67dcz.js} +2 -2
- package/dist/cli/{index-wpgv6hht.js → index-3jvqw5hy.js} +13 -26
- package/dist/cli/{index-05ee8pws.js → index-3ygv9535.js} +32 -25
- package/dist/cli/{index-bfwt3abw.js → index-4rhcth7a.js} +1 -1
- package/dist/cli/{index-n6fa2hhk.js → index-51gg9947.js} +1 -1
- package/dist/cli/index-69ms9ny1.js +261 -0
- package/dist/cli/{index-42cx6g2h.js → index-76kvm9z5.js} +1 -1
- package/dist/cli/{index-r2ysfdet.js → index-78b192v7.js} +7 -7
- package/dist/cli/{index-vwvkpg0d.js → index-816rkp4y.js} +3 -92
- package/dist/cli/index-89s4mhmw.js +6 -0
- package/dist/cli/index-9xpgytj9.js +386 -0
- package/dist/cli/index-ae75rja9.js +26 -0
- package/dist/cli/index-fndvr7fr.js +135 -0
- package/dist/cli/{index-mr3pnc4h.js → index-gmc34yzt.js} +1926 -2005
- package/dist/cli/index-gnp9x6se.js +93 -0
- package/dist/cli/{index-0pfqcjp6.js → index-h07wn84h.js} +1 -1
- package/dist/cli/{index-p45sshb5.js → index-j5xv8zbp.js} +17 -352
- package/dist/cli/{index-g2wrs7jy.js → index-kyvg2cmp.js} +1 -1
- package/dist/cli/{index-5hze8ztj.js → index-nhgw7de8.js} +7 -5
- package/dist/cli/{index-abjjn4yh.js → index-qg11yf8q.js} +4 -4
- package/dist/cli/index-rtry5xyf.js +27 -0
- package/dist/cli/{index-qx5z58a7.js → index-rywkdacj.js} +93 -11
- package/dist/cli/{index-pdk1n8yh.js → index-tftv9xh9.js} +44 -2
- package/dist/cli/{index-11q1t6g0.js → index-vqcgmy4y.js} +1 -1
- package/dist/cli/{index-q4kgsvdd.js → index-wtn8wf7h.js} +1 -1
- package/dist/cli/{index-bcg89pt8.js → index-zvae4m8g.js} +1 -1
- package/dist/cli/index.js +30 -23
- package/dist/cli/{knowledge-escalator-gt1q632m.js → knowledge-escalator-0ejqs8c9.js} +9 -8
- package/dist/cli/{knowledge-events-0bjdtdsb.js → knowledge-events-wx9e37ba.js} +6 -5
- package/dist/cli/knowledge-link-sy85fw3w.js +37 -0
- package/dist/cli/{knowledge-store-fm2300xf.js → knowledge-store-rnajx33a.js} +17 -6
- package/dist/cli/{knowledge-validator-91kx3eqv.js → knowledge-validator-1f4mkzmc.js} +11 -7
- package/dist/cli/{pending-delegations-9cn17983.js → pending-delegations-0z3znsec.js} +5 -5
- package/dist/cli/{pr-subscriptions-8a6jwek2.js → pr-subscriptions-x653151h.js} +4 -4
- package/dist/cli/scan-cursor-qapm0sxj.js +25 -0
- package/dist/cli/{schema-7c484wjz.js → schema-vwxpsk6j.js} +2 -2
- package/dist/cli/{scope-persistence-fm0gzhnk.js → scope-persistence-mfr36yc9.js} +2 -2
- package/dist/cli/{skill-generator-3f8dqjj2.js → skill-generator-tkv7s12g.js} +12 -9
- package/dist/config/schema.d.ts +8 -8
- package/dist/config/skill-mirrors.d.ts +1 -1
- package/dist/hooks/curator-postmortem.d.ts +6 -4
- package/dist/hooks/curator.d.ts +5 -1
- package/dist/hooks/hive-promoter.d.ts +3 -1
- package/dist/hooks/knowledge-store.d.ts +54 -1
- package/dist/hooks/knowledge-types.d.ts +107 -2
- package/dist/hooks/knowledge-validator.d.ts +25 -4
- package/dist/index.js +387 -384
- package/dist/knowledge/curation-policy.d.ts +125 -0
- package/dist/knowledge/family-manifest.d.ts +30 -2
- package/dist/knowledge/family-migration.d.ts +16 -4
- package/dist/knowledge/scan-cursor.d.ts +107 -0
- package/dist/knowledge/worktree-identity.d.ts +39 -0
- package/dist/memory/schema.d.ts +1 -1
- package/dist/services/knowledge-diagnostics.d.ts +29 -0
- package/package.json +1 -1
- package/dist/cli/curator-llm-factory-rwwnmdvk.js +0 -43
- package/dist/cli/guardrail-explain-kacpc2zm.js +0 -44
- /package/dist/cli/{index-vvk2g744.js → index-7g4c7s5r.js} +0 -0
|
@@ -0,0 +1,349 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import {
|
|
3
|
+
exports_external
|
|
4
|
+
} from "./index-293f68mj.js";
|
|
5
|
+
|
|
6
|
+
// src/config/plan-schema.ts
|
|
7
|
+
var ExecutionProfileSchema = exports_external.object({
|
|
8
|
+
parallelization_enabled: exports_external.boolean().default(false),
|
|
9
|
+
max_concurrent_tasks: exports_external.number().int().min(1).max(64).default(10),
|
|
10
|
+
council_parallel: exports_external.boolean().default(true),
|
|
11
|
+
locked: exports_external.boolean().default(false),
|
|
12
|
+
auto_proceed: exports_external.boolean().default(false)
|
|
13
|
+
});
|
|
14
|
+
var TaskStatusSchema = exports_external.enum([
|
|
15
|
+
"pending",
|
|
16
|
+
"in_progress",
|
|
17
|
+
"completed",
|
|
18
|
+
"blocked",
|
|
19
|
+
"closed"
|
|
20
|
+
]);
|
|
21
|
+
var TaskSizeSchema = exports_external.enum(["small", "medium", "large"]);
|
|
22
|
+
var PhaseStatusSchema = exports_external.enum([
|
|
23
|
+
"pending",
|
|
24
|
+
"in_progress",
|
|
25
|
+
"complete",
|
|
26
|
+
"completed",
|
|
27
|
+
"blocked",
|
|
28
|
+
"closed"
|
|
29
|
+
]);
|
|
30
|
+
var MigrationStatusSchema = exports_external.enum([
|
|
31
|
+
"native",
|
|
32
|
+
"migrated",
|
|
33
|
+
"migration_failed"
|
|
34
|
+
]);
|
|
35
|
+
var TaskSchema = exports_external.object({
|
|
36
|
+
id: exports_external.string(),
|
|
37
|
+
phase: exports_external.number().int().min(1),
|
|
38
|
+
status: TaskStatusSchema.default("pending"),
|
|
39
|
+
size: TaskSizeSchema.default("small"),
|
|
40
|
+
description: exports_external.string().min(1),
|
|
41
|
+
depends: exports_external.array(exports_external.string()).default([]),
|
|
42
|
+
acceptance: exports_external.string().optional(),
|
|
43
|
+
files_touched: exports_external.array(exports_external.string()).default([]),
|
|
44
|
+
evidence_path: exports_external.string().optional(),
|
|
45
|
+
blocked_reason: exports_external.string().optional()
|
|
46
|
+
});
|
|
47
|
+
var PhaseSchema = exports_external.object({
|
|
48
|
+
id: exports_external.number().int().min(1),
|
|
49
|
+
name: exports_external.string().min(1),
|
|
50
|
+
status: PhaseStatusSchema.default("pending"),
|
|
51
|
+
tasks: exports_external.array(TaskSchema).default([]),
|
|
52
|
+
type: exports_external.enum(["code", "non-code"]).optional(),
|
|
53
|
+
required_agents: exports_external.array(exports_external.string()).optional()
|
|
54
|
+
});
|
|
55
|
+
var PlanSchema = exports_external.object({
|
|
56
|
+
schema_version: exports_external.literal("1.0.0"),
|
|
57
|
+
title: exports_external.string().min(1),
|
|
58
|
+
swarm: exports_external.string().min(1),
|
|
59
|
+
current_phase: exports_external.number().int().min(1).optional(),
|
|
60
|
+
phases: exports_external.array(PhaseSchema).min(1),
|
|
61
|
+
migration_status: MigrationStatusSchema.optional(),
|
|
62
|
+
specMtime: exports_external.string().optional(),
|
|
63
|
+
specHash: exports_external.string().optional(),
|
|
64
|
+
execution_profile: ExecutionProfileSchema.optional()
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
// src/config/evidence-schema.ts
|
|
68
|
+
var EVIDENCE_MAX_JSON_BYTES = 500 * 1024;
|
|
69
|
+
var EVIDENCE_MAX_PATCH_BYTES = 5 * 1024 * 1024;
|
|
70
|
+
var EVIDENCE_MAX_TASK_BYTES = 20 * 1024 * 1024;
|
|
71
|
+
var EvidenceTypeSchema = exports_external.enum([
|
|
72
|
+
"review",
|
|
73
|
+
"test",
|
|
74
|
+
"diff",
|
|
75
|
+
"approval",
|
|
76
|
+
"note",
|
|
77
|
+
"retrospective",
|
|
78
|
+
"syntax",
|
|
79
|
+
"placeholder",
|
|
80
|
+
"sast",
|
|
81
|
+
"sbom",
|
|
82
|
+
"build",
|
|
83
|
+
"quality_budget",
|
|
84
|
+
"secretscan",
|
|
85
|
+
"mutation-gate",
|
|
86
|
+
"drift-verification",
|
|
87
|
+
"hallucination-verification"
|
|
88
|
+
]);
|
|
89
|
+
var EvidenceVerdictSchema = exports_external.enum([
|
|
90
|
+
"pass",
|
|
91
|
+
"fail",
|
|
92
|
+
"warn",
|
|
93
|
+
"skip",
|
|
94
|
+
"approved",
|
|
95
|
+
"rejected",
|
|
96
|
+
"info"
|
|
97
|
+
]);
|
|
98
|
+
var BaseEvidenceSchema = exports_external.object({
|
|
99
|
+
task_id: exports_external.string().min(1),
|
|
100
|
+
type: EvidenceTypeSchema,
|
|
101
|
+
timestamp: exports_external.string().datetime(),
|
|
102
|
+
agent: exports_external.string().min(1),
|
|
103
|
+
verdict: EvidenceVerdictSchema,
|
|
104
|
+
summary: exports_external.string().min(1),
|
|
105
|
+
metadata: exports_external.record(exports_external.string(), exports_external.unknown()).optional()
|
|
106
|
+
});
|
|
107
|
+
var ReviewEvidenceSchema = BaseEvidenceSchema.extend({
|
|
108
|
+
type: exports_external.literal("review"),
|
|
109
|
+
risk: exports_external.enum(["low", "medium", "high", "critical"]),
|
|
110
|
+
issues: exports_external.array(exports_external.object({
|
|
111
|
+
severity: exports_external.enum(["error", "warning", "info"]),
|
|
112
|
+
message: exports_external.string().min(1),
|
|
113
|
+
file: exports_external.string().optional(),
|
|
114
|
+
line: exports_external.number().int().optional()
|
|
115
|
+
})).default([])
|
|
116
|
+
});
|
|
117
|
+
var TestEvidenceSchema = BaseEvidenceSchema.extend({
|
|
118
|
+
type: exports_external.literal("test"),
|
|
119
|
+
tests_passed: exports_external.number().int().min(0),
|
|
120
|
+
tests_failed: exports_external.number().int().min(0),
|
|
121
|
+
test_file: exports_external.string().optional(),
|
|
122
|
+
failures: exports_external.array(exports_external.object({
|
|
123
|
+
name: exports_external.string().min(1),
|
|
124
|
+
message: exports_external.string().min(1)
|
|
125
|
+
})).default([])
|
|
126
|
+
});
|
|
127
|
+
var DiffEvidenceSchema = BaseEvidenceSchema.extend({
|
|
128
|
+
type: exports_external.literal("diff"),
|
|
129
|
+
files_changed: exports_external.array(exports_external.string()).default([]),
|
|
130
|
+
additions: exports_external.number().int().min(0).default(0),
|
|
131
|
+
deletions: exports_external.number().int().min(0).default(0),
|
|
132
|
+
patch_path: exports_external.string().optional()
|
|
133
|
+
});
|
|
134
|
+
var ApprovalEvidenceSchema = BaseEvidenceSchema.extend({
|
|
135
|
+
type: exports_external.literal("approval")
|
|
136
|
+
});
|
|
137
|
+
var NoteEvidenceSchema = BaseEvidenceSchema.extend({
|
|
138
|
+
type: exports_external.literal("note")
|
|
139
|
+
});
|
|
140
|
+
var RetrospectiveEvidenceSchema = BaseEvidenceSchema.extend({
|
|
141
|
+
type: exports_external.literal("retrospective"),
|
|
142
|
+
phase_number: exports_external.number().int().min(1).max(99),
|
|
143
|
+
total_tool_calls: exports_external.number().int().min(0).max(9999),
|
|
144
|
+
coder_revisions: exports_external.number().int().min(0).max(999),
|
|
145
|
+
reviewer_rejections: exports_external.number().int().min(0).max(999),
|
|
146
|
+
loop_detections: exports_external.number().int().min(0).max(9999).optional(),
|
|
147
|
+
circuit_breaker_trips: exports_external.number().int().min(0).max(9999).optional(),
|
|
148
|
+
test_failures: exports_external.number().int().min(0).max(9999),
|
|
149
|
+
security_findings: exports_external.number().int().min(0).max(999),
|
|
150
|
+
integration_issues: exports_external.number().int().min(0).max(999),
|
|
151
|
+
task_count: exports_external.number().int().min(1).max(9999),
|
|
152
|
+
task_complexity: exports_external.enum(["trivial", "simple", "moderate", "complex"]),
|
|
153
|
+
top_rejection_reasons: exports_external.array(exports_external.string()).default([]),
|
|
154
|
+
lessons_learned: exports_external.array(exports_external.string()).max(5).default([]),
|
|
155
|
+
user_directives: exports_external.array(exports_external.object({
|
|
156
|
+
directive: exports_external.string().min(1),
|
|
157
|
+
category: exports_external.enum([
|
|
158
|
+
"tooling",
|
|
159
|
+
"code_style",
|
|
160
|
+
"architecture",
|
|
161
|
+
"process",
|
|
162
|
+
"other"
|
|
163
|
+
]),
|
|
164
|
+
scope: exports_external.enum(["session", "project", "global"])
|
|
165
|
+
})).default([]),
|
|
166
|
+
approaches_tried: exports_external.array(exports_external.object({
|
|
167
|
+
approach: exports_external.string().min(1),
|
|
168
|
+
result: exports_external.enum(["success", "failure", "partial"]),
|
|
169
|
+
abandoned_reason: exports_external.string().optional()
|
|
170
|
+
})).max(10).default([]),
|
|
171
|
+
error_taxonomy: exports_external.array(exports_external.enum([
|
|
172
|
+
"planning_error",
|
|
173
|
+
"interface_mismatch",
|
|
174
|
+
"logic_error",
|
|
175
|
+
"scope_creep",
|
|
176
|
+
"gate_evasion"
|
|
177
|
+
])).default([])
|
|
178
|
+
});
|
|
179
|
+
var SyntaxEvidenceSchema = BaseEvidenceSchema.extend({
|
|
180
|
+
type: exports_external.literal("syntax"),
|
|
181
|
+
files_checked: exports_external.number().int(),
|
|
182
|
+
files_failed: exports_external.number().int(),
|
|
183
|
+
skipped_count: exports_external.number().int().default(0),
|
|
184
|
+
files: exports_external.array(exports_external.object({
|
|
185
|
+
path: exports_external.string(),
|
|
186
|
+
language: exports_external.string(),
|
|
187
|
+
ok: exports_external.boolean(),
|
|
188
|
+
errors: exports_external.array(exports_external.object({
|
|
189
|
+
line: exports_external.number().int(),
|
|
190
|
+
column: exports_external.number().int(),
|
|
191
|
+
message: exports_external.string()
|
|
192
|
+
})).default([]),
|
|
193
|
+
skipped_reason: exports_external.string().optional()
|
|
194
|
+
})).default([])
|
|
195
|
+
});
|
|
196
|
+
var PlaceholderEvidenceSchema = BaseEvidenceSchema.extend({
|
|
197
|
+
type: exports_external.literal("placeholder"),
|
|
198
|
+
findings: exports_external.array(exports_external.object({
|
|
199
|
+
path: exports_external.string(),
|
|
200
|
+
line: exports_external.number().int(),
|
|
201
|
+
kind: exports_external.enum(["comment", "string", "function_body", "other"]),
|
|
202
|
+
excerpt: exports_external.string(),
|
|
203
|
+
rule_id: exports_external.string()
|
|
204
|
+
})).default([]),
|
|
205
|
+
files_scanned: exports_external.number().int(),
|
|
206
|
+
files_with_findings: exports_external.number().int(),
|
|
207
|
+
findings_count: exports_external.number().int()
|
|
208
|
+
});
|
|
209
|
+
var SastFindingSchema = exports_external.object({
|
|
210
|
+
rule_id: exports_external.string(),
|
|
211
|
+
severity: exports_external.enum(["critical", "high", "medium", "low"]),
|
|
212
|
+
message: exports_external.string(),
|
|
213
|
+
location: exports_external.object({
|
|
214
|
+
file: exports_external.string(),
|
|
215
|
+
line: exports_external.number().int(),
|
|
216
|
+
column: exports_external.number().int().optional()
|
|
217
|
+
}),
|
|
218
|
+
remediation: exports_external.string().optional()
|
|
219
|
+
});
|
|
220
|
+
var SastEvidenceSchema = BaseEvidenceSchema.extend({
|
|
221
|
+
type: exports_external.literal("sast"),
|
|
222
|
+
findings: exports_external.array(SastFindingSchema).default([]),
|
|
223
|
+
engine: exports_external.enum(["tier_a", "tier_a+tier_b"]),
|
|
224
|
+
files_scanned: exports_external.number().int(),
|
|
225
|
+
findings_count: exports_external.number().int(),
|
|
226
|
+
findings_by_severity: exports_external.object({
|
|
227
|
+
critical: exports_external.number().int(),
|
|
228
|
+
high: exports_external.number().int(),
|
|
229
|
+
medium: exports_external.number().int(),
|
|
230
|
+
low: exports_external.number().int()
|
|
231
|
+
}),
|
|
232
|
+
new_findings: exports_external.array(SastFindingSchema).optional(),
|
|
233
|
+
pre_existing_findings: exports_external.array(SastFindingSchema).optional(),
|
|
234
|
+
baseline_used: exports_external.boolean().optional()
|
|
235
|
+
});
|
|
236
|
+
var SbomEvidenceSchema = BaseEvidenceSchema.extend({
|
|
237
|
+
type: exports_external.literal("sbom"),
|
|
238
|
+
components: exports_external.array(exports_external.object({
|
|
239
|
+
name: exports_external.string(),
|
|
240
|
+
version: exports_external.string(),
|
|
241
|
+
type: exports_external.enum(["library", "framework", "application"]),
|
|
242
|
+
purl: exports_external.string().optional(),
|
|
243
|
+
license: exports_external.string().optional()
|
|
244
|
+
})).default([]),
|
|
245
|
+
metadata: exports_external.object({
|
|
246
|
+
timestamp: exports_external.string().datetime(),
|
|
247
|
+
tool: exports_external.string(),
|
|
248
|
+
tool_version: exports_external.string()
|
|
249
|
+
}),
|
|
250
|
+
files: exports_external.array(exports_external.string()),
|
|
251
|
+
components_count: exports_external.number().int(),
|
|
252
|
+
output_path: exports_external.string()
|
|
253
|
+
});
|
|
254
|
+
var BuildEvidenceSchema = BaseEvidenceSchema.extend({
|
|
255
|
+
type: exports_external.literal("build"),
|
|
256
|
+
runs: exports_external.array(exports_external.object({
|
|
257
|
+
kind: exports_external.enum(["build", "typecheck", "test"]),
|
|
258
|
+
command: exports_external.string(),
|
|
259
|
+
cwd: exports_external.string(),
|
|
260
|
+
exit_code: exports_external.number().int(),
|
|
261
|
+
duration_ms: exports_external.number().int(),
|
|
262
|
+
stdout_tail: exports_external.string(),
|
|
263
|
+
stderr_tail: exports_external.string()
|
|
264
|
+
})).default([]),
|
|
265
|
+
files_scanned: exports_external.number().int(),
|
|
266
|
+
runs_count: exports_external.number().int(),
|
|
267
|
+
failed_count: exports_external.number().int(),
|
|
268
|
+
skipped_reason: exports_external.string().optional()
|
|
269
|
+
});
|
|
270
|
+
var QualityBudgetEvidenceSchema = BaseEvidenceSchema.extend({
|
|
271
|
+
type: exports_external.literal("quality_budget"),
|
|
272
|
+
metrics: exports_external.object({
|
|
273
|
+
complexity_delta: exports_external.number(),
|
|
274
|
+
public_api_delta: exports_external.number(),
|
|
275
|
+
duplication_ratio: exports_external.number(),
|
|
276
|
+
test_to_code_ratio: exports_external.number()
|
|
277
|
+
}),
|
|
278
|
+
thresholds: exports_external.object({
|
|
279
|
+
max_complexity_delta: exports_external.number(),
|
|
280
|
+
max_public_api_delta: exports_external.number(),
|
|
281
|
+
max_duplication_ratio: exports_external.number(),
|
|
282
|
+
min_test_to_code_ratio: exports_external.number()
|
|
283
|
+
}),
|
|
284
|
+
violations: exports_external.array(exports_external.object({
|
|
285
|
+
type: exports_external.enum(["complexity", "api", "duplication", "test_ratio"]),
|
|
286
|
+
message: exports_external.string(),
|
|
287
|
+
severity: exports_external.enum(["error", "warning"]),
|
|
288
|
+
files: exports_external.array(exports_external.string())
|
|
289
|
+
})).default([]),
|
|
290
|
+
files_analyzed: exports_external.array(exports_external.string())
|
|
291
|
+
});
|
|
292
|
+
var SecretscanEvidenceSchema = BaseEvidenceSchema.extend({
|
|
293
|
+
type: exports_external.literal("secretscan"),
|
|
294
|
+
findings_count: exports_external.number().int().min(0).default(0),
|
|
295
|
+
scan_directory: exports_external.string().optional(),
|
|
296
|
+
files_scanned: exports_external.number().int().min(0).default(0),
|
|
297
|
+
skipped_files: exports_external.number().int().min(0).default(0)
|
|
298
|
+
});
|
|
299
|
+
var GateEvidenceBaseSchema = exports_external.object({
|
|
300
|
+
task_id: exports_external.string().optional(),
|
|
301
|
+
agent: exports_external.string().optional(),
|
|
302
|
+
timestamp: exports_external.string().datetime(),
|
|
303
|
+
summary: exports_external.string().min(1),
|
|
304
|
+
metadata: exports_external.record(exports_external.string(), exports_external.unknown()).optional()
|
|
305
|
+
});
|
|
306
|
+
var MutationGateEvidenceSchema = GateEvidenceBaseSchema.extend({
|
|
307
|
+
type: exports_external.literal("mutation-gate"),
|
|
308
|
+
verdict: exports_external.enum(["pass", "warn", "fail", "skip"]),
|
|
309
|
+
killRate: exports_external.number().min(0).max(1).optional(),
|
|
310
|
+
adjustedKillRate: exports_external.number().min(0).max(1).optional(),
|
|
311
|
+
survivedMutants: exports_external.string().optional()
|
|
312
|
+
});
|
|
313
|
+
var DriftVerificationEvidenceSchema = GateEvidenceBaseSchema.extend({
|
|
314
|
+
type: exports_external.literal("drift-verification"),
|
|
315
|
+
verdict: exports_external.enum(["approved", "rejected"]),
|
|
316
|
+
requirementCoverage: exports_external.string().optional()
|
|
317
|
+
});
|
|
318
|
+
var HallucinationVerificationEvidenceSchema = GateEvidenceBaseSchema.extend({
|
|
319
|
+
type: exports_external.literal("hallucination-verification"),
|
|
320
|
+
verdict: exports_external.enum(["approved", "rejected"]),
|
|
321
|
+
findings: exports_external.string().optional()
|
|
322
|
+
});
|
|
323
|
+
var EvidenceSchema = exports_external.discriminatedUnion("type", [
|
|
324
|
+
ReviewEvidenceSchema,
|
|
325
|
+
TestEvidenceSchema,
|
|
326
|
+
DiffEvidenceSchema,
|
|
327
|
+
ApprovalEvidenceSchema,
|
|
328
|
+
NoteEvidenceSchema,
|
|
329
|
+
RetrospectiveEvidenceSchema,
|
|
330
|
+
SyntaxEvidenceSchema,
|
|
331
|
+
PlaceholderEvidenceSchema,
|
|
332
|
+
SastEvidenceSchema,
|
|
333
|
+
SbomEvidenceSchema,
|
|
334
|
+
BuildEvidenceSchema,
|
|
335
|
+
QualityBudgetEvidenceSchema,
|
|
336
|
+
SecretscanEvidenceSchema,
|
|
337
|
+
MutationGateEvidenceSchema,
|
|
338
|
+
DriftVerificationEvidenceSchema,
|
|
339
|
+
HallucinationVerificationEvidenceSchema
|
|
340
|
+
]);
|
|
341
|
+
var EvidenceBundleSchema = exports_external.object({
|
|
342
|
+
schema_version: exports_external.literal("1.0.0"),
|
|
343
|
+
task_id: exports_external.string().min(1),
|
|
344
|
+
entries: exports_external.array(EvidenceSchema).default([]),
|
|
345
|
+
created_at: exports_external.string().datetime(),
|
|
346
|
+
updated_at: exports_external.string().datetime()
|
|
347
|
+
});
|
|
348
|
+
|
|
349
|
+
export { ExecutionProfileSchema, TaskStatusSchema, TaskSizeSchema, PhaseStatusSchema, MigrationStatusSchema, TaskSchema, PhaseSchema, PlanSchema, EVIDENCE_MAX_JSON_BYTES, EVIDENCE_MAX_PATCH_BYTES, EVIDENCE_MAX_TASK_BYTES, EvidenceTypeSchema, EvidenceVerdictSchema, BaseEvidenceSchema, ReviewEvidenceSchema, TestEvidenceSchema, DiffEvidenceSchema, ApprovalEvidenceSchema, NoteEvidenceSchema, RetrospectiveEvidenceSchema, EvidenceSchema, EvidenceBundleSchema };
|
|
@@ -5,12 +5,12 @@ import {
|
|
|
5
5
|
import {
|
|
6
6
|
log
|
|
7
7
|
} from "./index-zgwm4ryv.js";
|
|
8
|
+
import {
|
|
9
|
+
withEvidenceLock
|
|
10
|
+
} from "./index-76kvm9z5.js";
|
|
8
11
|
import {
|
|
9
12
|
exports_external
|
|
10
13
|
} from "./index-293f68mj.js";
|
|
11
|
-
import {
|
|
12
|
-
withEvidenceLock
|
|
13
|
-
} from "./index-42cx6g2h.js";
|
|
14
14
|
|
|
15
15
|
// src/background/pr-subscriptions.ts
|
|
16
16
|
import * as fs from "fs";
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
|
+
import {
|
|
3
|
+
authorizeCuration
|
|
4
|
+
} from "./index-69ms9ny1.js";
|
|
2
5
|
import {
|
|
3
6
|
findNearDuplicate,
|
|
4
7
|
inferTags,
|
|
@@ -6,20 +9,20 @@ import {
|
|
|
6
9
|
resolveSwarmKnowledgePath,
|
|
7
10
|
resolveSwarmRejectedPath,
|
|
8
11
|
transactKnowledge
|
|
9
|
-
} from "./index-
|
|
12
|
+
} from "./index-rywkdacj.js";
|
|
10
13
|
import {
|
|
11
14
|
resolveKnowledgeStoreDir
|
|
12
|
-
} from "./index-
|
|
15
|
+
} from "./index-3jvqw5hy.js";
|
|
13
16
|
import {
|
|
14
17
|
init_logger,
|
|
15
18
|
warn
|
|
16
19
|
} from "./index-zgwm4ryv.js";
|
|
17
20
|
import {
|
|
18
21
|
atomicWriteFile
|
|
19
|
-
} from "./index-
|
|
22
|
+
} from "./index-h07wn84h.js";
|
|
20
23
|
import {
|
|
21
24
|
require_proper_lockfile
|
|
22
|
-
} from "./index-
|
|
25
|
+
} from "./index-7g4c7s5r.js";
|
|
23
26
|
import {
|
|
24
27
|
__toESM
|
|
25
28
|
} from "./index-a76rekgs.js";
|
|
@@ -569,7 +572,7 @@ function auditEntryHealth(entry) {
|
|
|
569
572
|
}
|
|
570
573
|
return { healthy: true };
|
|
571
574
|
}
|
|
572
|
-
async function quarantineEntry(directory, entryId, reason, reportedBy) {
|
|
575
|
+
async function quarantineEntry(directory, entryId, reason, reportedBy, curationContext) {
|
|
573
576
|
if (!directory || directory.includes("..")) {
|
|
574
577
|
warn("[knowledge-validator] quarantineEntry: directory traversal attempt blocked");
|
|
575
578
|
return;
|
|
@@ -600,6 +603,17 @@ async function quarantineEntry(directory, entryId, reason, reportedBy) {
|
|
|
600
603
|
if (!entry) {
|
|
601
604
|
return;
|
|
602
605
|
}
|
|
606
|
+
if (curationContext) {
|
|
607
|
+
const refreshedContext = {
|
|
608
|
+
...curationContext.context,
|
|
609
|
+
entry
|
|
610
|
+
};
|
|
611
|
+
const decision = await authorizeCuration(curationContext.input, refreshedContext);
|
|
612
|
+
if (!decision.authorized) {
|
|
613
|
+
warn(`[knowledge-validator] quarantineEntry blocked by cohort-safety policy ` + `(basis: ${decision.basis}): ${decision.detail}`);
|
|
614
|
+
return;
|
|
615
|
+
}
|
|
616
|
+
}
|
|
603
617
|
const remaining = entries.filter((e) => e.id !== entryId);
|
|
604
618
|
const quarantined = {
|
|
605
619
|
...entry,
|
|
@@ -638,7 +652,7 @@ async function quarantineEntry(directory, entryId, reason, reportedBy) {
|
|
|
638
652
|
}
|
|
639
653
|
}
|
|
640
654
|
}
|
|
641
|
-
async function restoreEntry(directory, entryId) {
|
|
655
|
+
async function restoreEntry(directory, entryId, curationContext) {
|
|
642
656
|
if (!directory || directory.includes("..")) {
|
|
643
657
|
warn("[knowledge-validator] restoreEntry: directory traversal attempt blocked");
|
|
644
658
|
return;
|
|
@@ -665,6 +679,17 @@ async function restoreEntry(directory, entryId) {
|
|
|
665
679
|
if (!entryToRestore) {
|
|
666
680
|
return;
|
|
667
681
|
}
|
|
682
|
+
if (curationContext) {
|
|
683
|
+
const refreshedContext = {
|
|
684
|
+
...curationContext.context,
|
|
685
|
+
entry: entryToRestore
|
|
686
|
+
};
|
|
687
|
+
const decision = await authorizeCuration(curationContext.input, refreshedContext);
|
|
688
|
+
if (!decision.authorized) {
|
|
689
|
+
warn(`[knowledge-validator] restoreEntry blocked by cohort-safety policy ` + `(basis: ${decision.basis}): ${decision.detail}`);
|
|
690
|
+
return;
|
|
691
|
+
}
|
|
692
|
+
}
|
|
668
693
|
const remaining = quarantinedEntries.filter((e) => e.id !== entryId);
|
|
669
694
|
const {
|
|
670
695
|
quarantine_reason,
|
|
@@ -702,7 +727,7 @@ async function restoreEntry(directory, entryId) {
|
|
|
702
727
|
}
|
|
703
728
|
}
|
|
704
729
|
}
|
|
705
|
-
async function unarchiveEntry(directory, entryId) {
|
|
730
|
+
async function unarchiveEntry(directory, entryId, curationContext) {
|
|
706
731
|
if (!directory || directory.includes("..")) {
|
|
707
732
|
warn("[knowledge-validator] unarchiveEntry: directory traversal attempt blocked");
|
|
708
733
|
return { restored: false, reason: "not_found" };
|
|
@@ -730,6 +755,17 @@ async function unarchiveEntry(directory, entryId) {
|
|
|
730
755
|
if (target.status !== "archived") {
|
|
731
756
|
return { restored: false, reason: "not_archived" };
|
|
732
757
|
}
|
|
758
|
+
if (curationContext) {
|
|
759
|
+
const refreshedContext = {
|
|
760
|
+
...curationContext.context,
|
|
761
|
+
entry: target
|
|
762
|
+
};
|
|
763
|
+
const decision = await authorizeCuration(curationContext.input, refreshedContext);
|
|
764
|
+
if (!decision.authorized) {
|
|
765
|
+
warn(`[knowledge-validator] unarchiveEntry blocked by cohort-safety policy ` + `(basis: ${decision.basis}): ${decision.detail}`);
|
|
766
|
+
return { restored: false, reason: "blocked_by_policy" };
|
|
767
|
+
}
|
|
768
|
+
}
|
|
733
769
|
const validation = validateLesson(target.lesson, [], {
|
|
734
770
|
category: target.category,
|
|
735
771
|
scope: target.scope,
|
|
@@ -12,14 +12,14 @@ import {
|
|
|
12
12
|
detectPosixWrites,
|
|
13
13
|
detectWindowsWrites,
|
|
14
14
|
resolveWriteTargets
|
|
15
|
-
} from "./index-
|
|
15
|
+
} from "./index-gmc34yzt.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-kyvg2cmp.js";
|
|
23
23
|
|
|
24
24
|
// src/services/guardrail-explain-service.ts
|
|
25
25
|
import path from "path";
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
} from "./index-zgwm4ryv.js";
|
|
6
6
|
import {
|
|
7
7
|
atomicWriteFile
|
|
8
|
-
} from "./index-
|
|
8
|
+
} from "./index-h07wn84h.js";
|
|
9
9
|
|
|
10
10
|
// src/hooks/knowledge-link.ts
|
|
11
11
|
import {
|
|
@@ -233,29 +233,16 @@ function invalidateKnowledgeStoreDirCache(directory) {
|
|
|
233
233
|
function isLinked(directory) {
|
|
234
234
|
return readLinkPointer(directory) !== null;
|
|
235
235
|
}
|
|
236
|
+
var _internals = {
|
|
237
|
+
resolveKnowledgeStoreDir,
|
|
238
|
+
readLinkPointer,
|
|
239
|
+
writeLinkPointer,
|
|
240
|
+
removeLinkPointer,
|
|
241
|
+
getLinkedLocalKnowledgeStatus,
|
|
242
|
+
invalidateKnowledgeStoreDirCache,
|
|
243
|
+
resolveLinkDir,
|
|
244
|
+
resolveLinkBaseDir,
|
|
245
|
+
sanitizeLinkId
|
|
246
|
+
};
|
|
236
247
|
|
|
237
|
-
|
|
238
|
-
import * as os2 from "os";
|
|
239
|
-
import * as path2 from "path";
|
|
240
|
-
function resolveHiveDataDir() {
|
|
241
|
-
const platform = process.platform;
|
|
242
|
-
const home = process.env.HOME || os2.homedir();
|
|
243
|
-
if (platform === "win32") {
|
|
244
|
-
return path2.join(process.env.LOCALAPPDATA || path2.join(home, "AppData", "Local"), "opencode-swarm", "Data");
|
|
245
|
-
}
|
|
246
|
-
if (platform === "darwin") {
|
|
247
|
-
return path2.join(home, "Library", "Application Support", "opencode-swarm");
|
|
248
|
-
}
|
|
249
|
-
return path2.join(process.env.XDG_DATA_HOME || path2.join(home, ".local", "share"), "opencode-swarm");
|
|
250
|
-
}
|
|
251
|
-
function resolveHiveKnowledgePath() {
|
|
252
|
-
return path2.join(resolveHiveDataDir(), "shared-learnings.jsonl");
|
|
253
|
-
}
|
|
254
|
-
function resolveHiveRejectedPath() {
|
|
255
|
-
return path2.join(resolveHiveDataDir(), "shared-learnings-rejected.jsonl");
|
|
256
|
-
}
|
|
257
|
-
function resolveHiveEventsPath() {
|
|
258
|
-
return path2.join(resolveHiveDataDir(), "shared-knowledge-events.jsonl");
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
export { resolveLinkDir, sanitizeLinkId, readLinkPointer, getLinkedLocalKnowledgeStatus, writeLinkPointer, removeLinkPointer, resolveKnowledgeStoreDir, isLinked, resolveHiveDataDir, resolveHiveKnowledgePath, resolveHiveRejectedPath, resolveHiveEventsPath };
|
|
248
|
+
export { LINK_POINTER_FILENAME, resolveLinkBaseDir, resolveLinkDir, sanitizeLinkId, readLinkPointer, getLinkedLocalKnowledgeStatus, writeLinkPointer, removeLinkPointer, resolveKnowledgeStoreDir, invalidateKnowledgeStoreDirCache, isLinked, _internals };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
handleGuardrailExplain
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-3je67dcz.js";
|
|
5
5
|
import {
|
|
6
6
|
handleGuardrailLog
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-zvae4m8g.js";
|
|
8
8
|
import {
|
|
9
9
|
COMMAND_REGISTRY,
|
|
10
10
|
SWARM_COMMAND_TOOL_ALLOWLIST,
|
|
@@ -83,45 +83,52 @@ import {
|
|
|
83
83
|
handleWriteRetroCommand,
|
|
84
84
|
normalizeSwarmCommandInput,
|
|
85
85
|
resolveCommand
|
|
86
|
-
} from "./index-
|
|
86
|
+
} from "./index-gmc34yzt.js";
|
|
87
|
+
import"./index-kyvg2cmp.js";
|
|
88
|
+
import"./index-vqcgmy4y.js";
|
|
89
|
+
import"./index-j5xv8zbp.js";
|
|
90
|
+
import"./index-4905hd2m.js";
|
|
87
91
|
import"./index-nprawcc0.js";
|
|
88
|
-
import"./index-
|
|
92
|
+
import"./index-78b192v7.js";
|
|
93
|
+
import"./index-0k4r8111.js";
|
|
94
|
+
import"./index-0e1v02hq.js";
|
|
95
|
+
import"./index-vxv732ex.js";
|
|
89
96
|
import"./index-c8s9a3zh.js";
|
|
90
|
-
import"./index-
|
|
97
|
+
import"./index-816rkp4y.js";
|
|
98
|
+
import"./index-22e127jw.js";
|
|
99
|
+
import"./index-3366gs26.js";
|
|
100
|
+
import"./index-69ms9ny1.js";
|
|
101
|
+
import"./index-rtry5xyf.js";
|
|
102
|
+
import"./index-rywkdacj.js";
|
|
103
|
+
import"./index-nhgw7de8.js";
|
|
104
|
+
import"./index-ae75rja9.js";
|
|
105
|
+
import"./index-3jvqw5hy.js";
|
|
106
|
+
import"./index-9xpgytj9.js";
|
|
107
|
+
import"./index-0mbmfmt0.js";
|
|
108
|
+
import"./index-gnp9x6se.js";
|
|
91
109
|
import {
|
|
92
110
|
AGENT_TOOL_MAP,
|
|
93
111
|
ORCHESTRATOR_NAME,
|
|
94
112
|
stripKnownSwarmPrefix
|
|
95
|
-
} from "./index-
|
|
96
|
-
import"./index-
|
|
97
|
-
import"./index-vwvkpg0d.js";
|
|
98
|
-
import"./index-4905hd2m.js";
|
|
99
|
-
import"./index-5bcrp3bc.js";
|
|
100
|
-
import"./index-r2ysfdet.js";
|
|
101
|
-
import"./index-pjhfe7c3.js";
|
|
102
|
-
import"./index-jbdgpqpj.js";
|
|
103
|
-
import"./index-5hze8ztj.js";
|
|
104
|
-
import"./index-qx5z58a7.js";
|
|
105
|
-
import"./index-bfwt3abw.js";
|
|
106
|
-
import"./index-wpgv6hht.js";
|
|
107
|
-
import"./index-vxv732ex.js";
|
|
113
|
+
} from "./index-tftv9xh9.js";
|
|
114
|
+
import"./index-4rhcth7a.js";
|
|
108
115
|
import"./index-8fwhhayc.js";
|
|
109
116
|
import"./index-q1exe2b3.js";
|
|
110
|
-
import"./index-
|
|
111
|
-
import"./index-
|
|
117
|
+
import"./index-51gg9947.js";
|
|
118
|
+
import"./index-wtn8wf7h.js";
|
|
112
119
|
import"./index-ye3fndsw.js";
|
|
113
120
|
import"./index-kzj3fp7c.js";
|
|
114
121
|
import"./index-5e4e2hvv.js";
|
|
115
122
|
import"./index-p0arc26j.js";
|
|
116
123
|
import"./index-zgwm4ryv.js";
|
|
117
124
|
import"./index-dqh3zhhc.js";
|
|
118
|
-
import"./index-
|
|
119
|
-
import"./index-
|
|
120
|
-
import"./index-
|
|
121
|
-
import"./index-42cx6g2h.js";
|
|
125
|
+
import"./index-qg11yf8q.js";
|
|
126
|
+
import"./index-h07wn84h.js";
|
|
127
|
+
import"./index-76kvm9z5.js";
|
|
122
128
|
import"./index-fsrp8wp3.js";
|
|
123
129
|
import"./index-q2rrv0cy.js";
|
|
124
|
-
import"./index-
|
|
130
|
+
import"./index-293f68mj.js";
|
|
131
|
+
import"./index-7g4c7s5r.js";
|
|
125
132
|
import"./index-qe3v54nb.js";
|
|
126
133
|
import"./index-a76rekgs.js";
|
|
127
134
|
// src/commands/command-names.ts
|