@ikieaneh/opencode-kit 0.6.0 → 0.6.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/.claude-plugin/plugin.json +1 -1
- package/.opencode/plugins/opencode-kit.js +104 -65
- package/docs/examples/QUICKSTART.md +1 -1
- package/package.json +5 -1
- package/src/adr.sh +36 -40
- package/src/cli.js +47 -5
- package/src/diff.sh +19 -5
- package/src/doctor.sh +37 -1
- package/src/init.sh +15 -2
- package/src/postflight.py +211 -0
- package/src/postflight.sh +46 -153
- package/src/telemetry.sh +33 -17
- package/src/update.sh +17 -10
- package/templates/contract.schema.json +357 -0
|
@@ -0,0 +1,357 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$id": "https://opencode.kit/schemas/contract.schema.json",
|
|
4
|
+
"title": "OpenCode Orchestration Contract Schema",
|
|
5
|
+
"description": "Validates the orchestration contract envelope used by OpenCode Kit agents for multi-agent coordination and state persistence.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
|
|
8
|
+
"properties": {
|
|
9
|
+
"$schema": {
|
|
10
|
+
"type": "string",
|
|
11
|
+
"const": "http://json-schema.org/draft-07/schema#",
|
|
12
|
+
"description": "JSON Schema dialect identifier"
|
|
13
|
+
},
|
|
14
|
+
|
|
15
|
+
"state": {
|
|
16
|
+
"type": "string",
|
|
17
|
+
"enum": ["INIT", "PLAN", "PLAN_SCORED", "EXECUTE", "EXECUTE_SCORED", "REVIEW", "REVIEW_SCORED", "COMPLETE", "BLOCKED"],
|
|
18
|
+
"description": "Current lifecycle state of the contract"
|
|
19
|
+
},
|
|
20
|
+
|
|
21
|
+
"contract_version": {
|
|
22
|
+
"type": "string",
|
|
23
|
+
"description": "Semantic version of the contract schema"
|
|
24
|
+
},
|
|
25
|
+
|
|
26
|
+
"session": {
|
|
27
|
+
"type": "object",
|
|
28
|
+
"properties": {
|
|
29
|
+
"task_id": { "type": "string" },
|
|
30
|
+
"branch": { "type": "string" },
|
|
31
|
+
"created_at": { "type": "string" }
|
|
32
|
+
},
|
|
33
|
+
"additionalProperties": true,
|
|
34
|
+
"description": "Session metadata for traceability and resumption"
|
|
35
|
+
},
|
|
36
|
+
|
|
37
|
+
"scope": {
|
|
38
|
+
"type": "object",
|
|
39
|
+
"properties": {
|
|
40
|
+
"included": { "type": "array", "items": { "type": "string" } },
|
|
41
|
+
"excluded": { "type": "array", "items": { "type": "string" } },
|
|
42
|
+
"boundary": { "type": "string" },
|
|
43
|
+
"parallel_eligible": { "type": "boolean" },
|
|
44
|
+
"max_parallel_agents": { "type": "integer", "minimum": 1 }
|
|
45
|
+
},
|
|
46
|
+
"additionalProperties": true,
|
|
47
|
+
"description": "Work boundaries and parallelism controls"
|
|
48
|
+
},
|
|
49
|
+
|
|
50
|
+
"requirements": {
|
|
51
|
+
"type": "object",
|
|
52
|
+
"properties": {
|
|
53
|
+
"goal": {
|
|
54
|
+
"type": "string",
|
|
55
|
+
"minLength": 1,
|
|
56
|
+
"description": "Primary objective of the task"
|
|
57
|
+
},
|
|
58
|
+
"scope": {
|
|
59
|
+
"type": "object",
|
|
60
|
+
"properties": {
|
|
61
|
+
"included": {
|
|
62
|
+
"type": "array",
|
|
63
|
+
"items": { "type": "string" },
|
|
64
|
+
"description": "In-scope files, directories, or concerns"
|
|
65
|
+
},
|
|
66
|
+
"excluded": {
|
|
67
|
+
"type": "array",
|
|
68
|
+
"items": { "type": "string" },
|
|
69
|
+
"description": "Explicitly out-of-scope items"
|
|
70
|
+
},
|
|
71
|
+
"parallel_eligible": {
|
|
72
|
+
"type": "boolean",
|
|
73
|
+
"description": "Whether this goal supports parallel agent dispatch"
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
"success_criteria": {
|
|
78
|
+
"type": "array",
|
|
79
|
+
"items": { "type": "string" },
|
|
80
|
+
"description": "Measurable outcomes that define completion"
|
|
81
|
+
},
|
|
82
|
+
"acceptance_criteria": {
|
|
83
|
+
"type": "array",
|
|
84
|
+
"items": { "type": "string" }
|
|
85
|
+
},
|
|
86
|
+
"constraints": {
|
|
87
|
+
"type": "object",
|
|
88
|
+
"additionalProperties": true,
|
|
89
|
+
"description": "Constraints and guardrails (may be object or array)"
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
"required": ["goal"],
|
|
93
|
+
"additionalProperties": true,
|
|
94
|
+
"description": "Task requirements, scope, and definition of done"
|
|
95
|
+
},
|
|
96
|
+
|
|
97
|
+
"decisions": {
|
|
98
|
+
"type": "object",
|
|
99
|
+
"properties": {
|
|
100
|
+
"approved_architecture": {
|
|
101
|
+
"anyOf": [
|
|
102
|
+
{ "type": "string" },
|
|
103
|
+
{ "type": "object" }
|
|
104
|
+
],
|
|
105
|
+
"description": "Approved architecture decision or reference"
|
|
106
|
+
},
|
|
107
|
+
"coding_standard": {
|
|
108
|
+
"type": "array",
|
|
109
|
+
"items": { "type": "string" }
|
|
110
|
+
},
|
|
111
|
+
"rejected_approaches": {
|
|
112
|
+
"type": "array",
|
|
113
|
+
"items": { "type": "string" }
|
|
114
|
+
},
|
|
115
|
+
"adr_log": {
|
|
116
|
+
"type": "array",
|
|
117
|
+
"items": {
|
|
118
|
+
"type": "object",
|
|
119
|
+
"properties": {
|
|
120
|
+
"id": { "type": "string" },
|
|
121
|
+
"title": { "type": "string" },
|
|
122
|
+
"status": { "type": "string" },
|
|
123
|
+
"date": { "type": "string" }
|
|
124
|
+
},
|
|
125
|
+
"additionalProperties": true
|
|
126
|
+
},
|
|
127
|
+
"description": "Architecture Decision Record log"
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
"additionalProperties": true,
|
|
131
|
+
"description": "Architectural decisions and rejected alternatives"
|
|
132
|
+
},
|
|
133
|
+
|
|
134
|
+
"governance": {
|
|
135
|
+
"type": "object",
|
|
136
|
+
"properties": {
|
|
137
|
+
"active_agent": { "type": "string" },
|
|
138
|
+
"mode": { "type": "string" },
|
|
139
|
+
"applicable_skills": { "type": "array", "items": { "type": "string" } },
|
|
140
|
+
"current_guidance": {
|
|
141
|
+
"type": "string",
|
|
142
|
+
"description": "Active execution guidance for the current agent"
|
|
143
|
+
},
|
|
144
|
+
"rules_references": {
|
|
145
|
+
"type": "array",
|
|
146
|
+
"items": {
|
|
147
|
+
"type": "object",
|
|
148
|
+
"properties": {
|
|
149
|
+
"source": { "type": "string" },
|
|
150
|
+
"sections": {
|
|
151
|
+
"type": "array",
|
|
152
|
+
"items": { "type": "string" }
|
|
153
|
+
}
|
|
154
|
+
},
|
|
155
|
+
"required": ["source", "sections"]
|
|
156
|
+
},
|
|
157
|
+
"description": "References to rule documents governing execution"
|
|
158
|
+
},
|
|
159
|
+
"extension_skills": {
|
|
160
|
+
"type": "array",
|
|
161
|
+
"items": { "type": "string" },
|
|
162
|
+
"description": "Loaded extension skills for this session"
|
|
163
|
+
},
|
|
164
|
+
"permissions": {
|
|
165
|
+
"type": "object",
|
|
166
|
+
"properties": {
|
|
167
|
+
"do": { "type": "array", "items": { "type": "string" } },
|
|
168
|
+
"dont": { "type": "array", "items": { "type": "string" } }
|
|
169
|
+
},
|
|
170
|
+
"additionalProperties": true
|
|
171
|
+
},
|
|
172
|
+
"previous_blockers": {
|
|
173
|
+
"type": "array",
|
|
174
|
+
"items": { "type": "string" }
|
|
175
|
+
},
|
|
176
|
+
"decisions_log": {
|
|
177
|
+
"type": "array",
|
|
178
|
+
"items": {
|
|
179
|
+
"type": "object",
|
|
180
|
+
"properties": {
|
|
181
|
+
"agent": { "type": "string" },
|
|
182
|
+
"decision": { "type": "string" },
|
|
183
|
+
"timestamp": { "type": "string" }
|
|
184
|
+
},
|
|
185
|
+
"additionalProperties": true
|
|
186
|
+
},
|
|
187
|
+
"description": "Historical log of decisions made during execution"
|
|
188
|
+
}
|
|
189
|
+
},
|
|
190
|
+
"additionalProperties": true,
|
|
191
|
+
"description": "Governance and rule enforcement context"
|
|
192
|
+
},
|
|
193
|
+
|
|
194
|
+
"validation": {
|
|
195
|
+
"type": "object",
|
|
196
|
+
"properties": {
|
|
197
|
+
"block_on": {
|
|
198
|
+
"type": "object",
|
|
199
|
+
"properties": {
|
|
200
|
+
"max_test_failures": { "type": "integer", "minimum": 0 },
|
|
201
|
+
"max_score_drop": { "type": "integer", "minimum": 0, "maximum": 100 },
|
|
202
|
+
"max_compile_errors": { "type": "integer", "minimum": 0 }
|
|
203
|
+
},
|
|
204
|
+
"additionalProperties": true
|
|
205
|
+
},
|
|
206
|
+
"rule_overrides": {
|
|
207
|
+
"type": "object",
|
|
208
|
+
"additionalProperties": true
|
|
209
|
+
}
|
|
210
|
+
},
|
|
211
|
+
"additionalProperties": true,
|
|
212
|
+
"description": "Validation thresholds that trigger BLOCKED state"
|
|
213
|
+
},
|
|
214
|
+
|
|
215
|
+
"score": {
|
|
216
|
+
"type": "object",
|
|
217
|
+
"properties": {
|
|
218
|
+
"rules": {
|
|
219
|
+
"type": "object",
|
|
220
|
+
"properties": {
|
|
221
|
+
"pass": { "type": "integer", "minimum": 0 },
|
|
222
|
+
"fail": { "type": "integer", "minimum": 0 },
|
|
223
|
+
"deduction": { "type": "number" },
|
|
224
|
+
"subtotal": { "type": "number" }
|
|
225
|
+
},
|
|
226
|
+
"description": "Rule-based scoring breakdown"
|
|
227
|
+
},
|
|
228
|
+
"judge": {
|
|
229
|
+
"anyOf": [
|
|
230
|
+
{
|
|
231
|
+
"type": "object",
|
|
232
|
+
"properties": {
|
|
233
|
+
"score": { "type": "integer", "minimum": 0, "maximum": 100 },
|
|
234
|
+
"rationale": { "type": "string" },
|
|
235
|
+
"missing_items": { "type": "array", "items": { "type": "string" } }
|
|
236
|
+
},
|
|
237
|
+
"additionalProperties": true
|
|
238
|
+
},
|
|
239
|
+
{ "type": "null" }
|
|
240
|
+
],
|
|
241
|
+
"description": "LLM judge evaluation (nullable)"
|
|
242
|
+
},
|
|
243
|
+
"combined": {
|
|
244
|
+
"type": "number",
|
|
245
|
+
"minimum": 0,
|
|
246
|
+
"maximum": 100,
|
|
247
|
+
"description": "Combined score (0-100)"
|
|
248
|
+
},
|
|
249
|
+
"verdict": {
|
|
250
|
+
"type": "string",
|
|
251
|
+
"enum": ["INIT", "PASS", "RETRY", "BLOCKED"],
|
|
252
|
+
"description": "Overall scoring verdict"
|
|
253
|
+
}
|
|
254
|
+
},
|
|
255
|
+
"additionalProperties": true,
|
|
256
|
+
"description": "Scoring and evaluation results"
|
|
257
|
+
},
|
|
258
|
+
|
|
259
|
+
"retry": {
|
|
260
|
+
"type": "object",
|
|
261
|
+
"properties": {
|
|
262
|
+
"attempt": {
|
|
263
|
+
"type": "integer",
|
|
264
|
+
"minimum": 0,
|
|
265
|
+
"description": "Current retry attempt number"
|
|
266
|
+
},
|
|
267
|
+
"max_attempts": {
|
|
268
|
+
"type": "integer",
|
|
269
|
+
"minimum": 1,
|
|
270
|
+
"description": "Maximum allowed retry attempts"
|
|
271
|
+
},
|
|
272
|
+
"current_phase": {
|
|
273
|
+
"anyOf": [
|
|
274
|
+
{ "type": "string" },
|
|
275
|
+
{ "type": "null" }
|
|
276
|
+
],
|
|
277
|
+
"description": "Phase being retried"
|
|
278
|
+
},
|
|
279
|
+
"score_threshold": {
|
|
280
|
+
"type": "integer",
|
|
281
|
+
"minimum": 0,
|
|
282
|
+
"maximum": 100
|
|
283
|
+
},
|
|
284
|
+
"escalation_threshold": {
|
|
285
|
+
"type": "integer",
|
|
286
|
+
"minimum": 0,
|
|
287
|
+
"maximum": 100
|
|
288
|
+
},
|
|
289
|
+
"issues": {
|
|
290
|
+
"type": "array",
|
|
291
|
+
"items": { "type": "string" },
|
|
292
|
+
"description": "List of issues that triggered retry"
|
|
293
|
+
}
|
|
294
|
+
},
|
|
295
|
+
"additionalProperties": true,
|
|
296
|
+
"description": "Retry policy and issue tracking"
|
|
297
|
+
},
|
|
298
|
+
|
|
299
|
+
"outputs": {
|
|
300
|
+
"type": "object",
|
|
301
|
+
"properties": {
|
|
302
|
+
"plan": { "type": ["object", "null"] },
|
|
303
|
+
"architecture": { "type": ["object", "null"] },
|
|
304
|
+
"code_changes": {
|
|
305
|
+
"type": "array",
|
|
306
|
+
"items": {
|
|
307
|
+
"type": "object",
|
|
308
|
+
"properties": {
|
|
309
|
+
"file": { "type": "string" },
|
|
310
|
+
"change_type": { "type": "string", "enum": ["create", "modify", "delete"] },
|
|
311
|
+
"summary": { "type": "string" }
|
|
312
|
+
},
|
|
313
|
+
"additionalProperties": true
|
|
314
|
+
}
|
|
315
|
+
},
|
|
316
|
+
"test_results": { "type": ["object", "null"] },
|
|
317
|
+
"agent_reports": {
|
|
318
|
+
"type": "array",
|
|
319
|
+
"items": { "type": "object" }
|
|
320
|
+
},
|
|
321
|
+
"score_summary": { "type": ["object", "null"] }
|
|
322
|
+
},
|
|
323
|
+
"additionalProperties": true,
|
|
324
|
+
"description": "Artifacts produced during execution"
|
|
325
|
+
},
|
|
326
|
+
|
|
327
|
+
"metrics": {
|
|
328
|
+
"type": "object",
|
|
329
|
+
"properties": {
|
|
330
|
+
"cost_tokens": { "type": "integer", "minimum": 0 },
|
|
331
|
+
"elapsed_ms": { "type": "integer", "minimum": 0 },
|
|
332
|
+
"agents_used": { "type": "array", "items": { "type": "string" } },
|
|
333
|
+
"phases_completed": { "type": "array", "items": { "type": "string" } }
|
|
334
|
+
},
|
|
335
|
+
"additionalProperties": true,
|
|
336
|
+
"description": "Execution performance metrics"
|
|
337
|
+
},
|
|
338
|
+
|
|
339
|
+
"lessons_learned": {
|
|
340
|
+
"type": "array",
|
|
341
|
+
"items": {
|
|
342
|
+
"type": "object",
|
|
343
|
+
"properties": {
|
|
344
|
+
"category": { "type": "string" },
|
|
345
|
+
"insight": { "type": "string" },
|
|
346
|
+
"recommendation": { "type": "string" }
|
|
347
|
+
},
|
|
348
|
+
"additionalProperties": true
|
|
349
|
+
},
|
|
350
|
+
"description": "Cross-session learning artifacts"
|
|
351
|
+
}
|
|
352
|
+
},
|
|
353
|
+
|
|
354
|
+
"additionalProperties": true,
|
|
355
|
+
|
|
356
|
+
"description": "Top-level fields are all optional to support contract evolution. Use property-specific required constraints for nested mandatory fields."
|
|
357
|
+
}
|