@brawnen/agent-harness-protocol 0.1.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.
@@ -0,0 +1,427 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://harness.local/schemas/harness-config.schema.json",
4
+ "title": "Harness Project Config",
5
+ "description": "项目级 harness.yaml 的结构定义。当前 schema 以 v0.3 为唯一支持版本。",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "required": [
9
+ "version",
10
+ "project_type",
11
+ "default_mode",
12
+ "allowed_paths",
13
+ "protected_paths",
14
+ "default_commands",
15
+ "risk_rules"
16
+ ],
17
+ "$defs": {
18
+ "string_list": {
19
+ "type": "array",
20
+ "items": {
21
+ "type": "string",
22
+ "minLength": 1
23
+ }
24
+ },
25
+ "mode": {
26
+ "type": "string",
27
+ "enum": [
28
+ "delivery",
29
+ "explore",
30
+ "poc"
31
+ ]
32
+ },
33
+ "intent": {
34
+ "type": "string",
35
+ "enum": [
36
+ "bug",
37
+ "feature",
38
+ "explore",
39
+ "refactor",
40
+ "prototype"
41
+ ]
42
+ },
43
+ "default_commands": {
44
+ "type": "object",
45
+ "additionalProperties": false,
46
+ "properties": {
47
+ "delivery": {
48
+ "$ref": "#/$defs/string_list"
49
+ },
50
+ "explore": {
51
+ "$ref": "#/$defs/string_list"
52
+ },
53
+ "poc": {
54
+ "$ref": "#/$defs/string_list"
55
+ }
56
+ }
57
+ },
58
+ "risk_rule_level": {
59
+ "type": "object",
60
+ "additionalProperties": false,
61
+ "properties": {
62
+ "path_matches": {
63
+ "$ref": "#/$defs/string_list"
64
+ },
65
+ "requires_confirmation": {
66
+ "type": "boolean"
67
+ },
68
+ "minimum_evidence": {
69
+ "$ref": "#/$defs/string_list"
70
+ },
71
+ "reason": {
72
+ "type": "string"
73
+ }
74
+ }
75
+ },
76
+ "risk_rules": {
77
+ "type": "object",
78
+ "additionalProperties": false,
79
+ "properties": {
80
+ "high": {
81
+ "$ref": "#/$defs/risk_rule_level"
82
+ },
83
+ "medium": {
84
+ "$ref": "#/$defs/risk_rule_level"
85
+ },
86
+ "low": {
87
+ "$ref": "#/$defs/risk_rule_level"
88
+ }
89
+ }
90
+ },
91
+ "task_templates": {
92
+ "type": "object",
93
+ "additionalProperties": false,
94
+ "properties": {
95
+ "bug": {
96
+ "type": "string",
97
+ "minLength": 1
98
+ },
99
+ "feature": {
100
+ "type": "string",
101
+ "minLength": 1
102
+ },
103
+ "explore": {
104
+ "type": "string",
105
+ "minLength": 1
106
+ },
107
+ "refactor": {
108
+ "type": "string",
109
+ "minLength": 1
110
+ },
111
+ "prototype": {
112
+ "type": "string",
113
+ "minLength": 1
114
+ }
115
+ }
116
+ },
117
+ "skill_selection": {
118
+ "type": "object",
119
+ "additionalProperties": false,
120
+ "properties": {
121
+ "prefer": {
122
+ "$ref": "#/$defs/string_list"
123
+ },
124
+ "force": {
125
+ "$ref": "#/$defs/string_list"
126
+ },
127
+ "deny": {
128
+ "$ref": "#/$defs/string_list"
129
+ }
130
+ }
131
+ },
132
+ "skill_policy_phase": {
133
+ "type": "object",
134
+ "additionalProperties": false,
135
+ "properties": {
136
+ "clarify": {
137
+ "$ref": "#/$defs/skill_selection"
138
+ },
139
+ "plan": {
140
+ "$ref": "#/$defs/skill_selection"
141
+ },
142
+ "execute": {
143
+ "$ref": "#/$defs/skill_selection"
144
+ },
145
+ "verify": {
146
+ "$ref": "#/$defs/skill_selection"
147
+ },
148
+ "report": {
149
+ "$ref": "#/$defs/skill_selection"
150
+ }
151
+ }
152
+ },
153
+ "skill_policy": {
154
+ "type": "object",
155
+ "additionalProperties": false,
156
+ "properties": {
157
+ "bug": {
158
+ "$ref": "#/$defs/skill_policy_phase"
159
+ },
160
+ "feature": {
161
+ "$ref": "#/$defs/skill_policy_phase"
162
+ },
163
+ "explore": {
164
+ "$ref": "#/$defs/skill_policy_phase"
165
+ },
166
+ "refactor": {
167
+ "$ref": "#/$defs/skill_policy_phase"
168
+ },
169
+ "prototype": {
170
+ "$ref": "#/$defs/skill_policy_phase"
171
+ }
172
+ }
173
+ },
174
+ "report_output_policy": {
175
+ "type": "object",
176
+ "additionalProperties": false,
177
+ "properties": {
178
+ "required": {
179
+ "type": "boolean"
180
+ },
181
+ "format": {
182
+ "type": "string",
183
+ "enum": [
184
+ "json",
185
+ "yaml",
186
+ "markdown"
187
+ ]
188
+ },
189
+ "directory": {
190
+ "type": "string",
191
+ "minLength": 1
192
+ },
193
+ "required_sections": {
194
+ "$ref": "#/$defs/string_list"
195
+ }
196
+ }
197
+ },
198
+ "changelog_policy": {
199
+ "type": "object",
200
+ "additionalProperties": false,
201
+ "properties": {
202
+ "mode": {
203
+ "type": "string",
204
+ "enum": [
205
+ "disabled",
206
+ "optional",
207
+ "required",
208
+ "conditional"
209
+ ]
210
+ },
211
+ "file": {
212
+ "type": "string",
213
+ "minLength": 1
214
+ },
215
+ "required_for": {
216
+ "type": "array",
217
+ "items": {
218
+ "$ref": "#/$defs/intent"
219
+ }
220
+ },
221
+ "skip_if": {
222
+ "type": "array",
223
+ "items": {
224
+ "type": "object"
225
+ }
226
+ }
227
+ }
228
+ },
229
+ "artifact_policy": {
230
+ "type": "object",
231
+ "additionalProperties": false,
232
+ "properties": {
233
+ "mode": {
234
+ "type": "string",
235
+ "enum": [
236
+ "disabled",
237
+ "optional",
238
+ "required",
239
+ "conditional"
240
+ ]
241
+ },
242
+ "directory": {
243
+ "type": "string",
244
+ "minLength": 1
245
+ },
246
+ "required_if": {
247
+ "type": "array",
248
+ "items": {
249
+ "oneOf": [
250
+ {
251
+ "type": "string",
252
+ "minLength": 1
253
+ },
254
+ {
255
+ "type": "object"
256
+ }
257
+ ]
258
+ }
259
+ }
260
+ }
261
+ },
262
+ "output_policy": {
263
+ "type": "object",
264
+ "additionalProperties": false,
265
+ "properties": {
266
+ "report": {
267
+ "$ref": "#/$defs/report_output_policy"
268
+ },
269
+ "changelog": {
270
+ "$ref": "#/$defs/changelog_policy"
271
+ },
272
+ "design_note": {
273
+ "$ref": "#/$defs/artifact_policy"
274
+ },
275
+ "adr": {
276
+ "$ref": "#/$defs/artifact_policy"
277
+ }
278
+ },
279
+ "anyOf": [
280
+ {
281
+ "required": [
282
+ "report"
283
+ ]
284
+ }
285
+ ]
286
+ },
287
+ "commit_message_policy": {
288
+ "type": "object",
289
+ "additionalProperties": false,
290
+ "properties": {
291
+ "source": {
292
+ "type": "string",
293
+ "enum": [
294
+ "skill",
295
+ "manual",
296
+ "cli"
297
+ ]
298
+ },
299
+ "convention": {
300
+ "type": "string",
301
+ "enum": [
302
+ "optional",
303
+ "conventional_commits",
304
+ "project_defined"
305
+ ]
306
+ }
307
+ }
308
+ },
309
+ "commit_policy": {
310
+ "type": "object",
311
+ "additionalProperties": false,
312
+ "properties": {
313
+ "mode": {
314
+ "type": "string",
315
+ "enum": [
316
+ "disabled",
317
+ "explicit_only",
318
+ "allow_if_ready"
319
+ ]
320
+ },
321
+ "via": {
322
+ "type": "string",
323
+ "enum": [
324
+ "skill",
325
+ "manual",
326
+ "cli"
327
+ ]
328
+ },
329
+ "require": {
330
+ "$ref": "#/$defs/string_list"
331
+ },
332
+ "message": {
333
+ "$ref": "#/$defs/commit_message_policy"
334
+ }
335
+ }
336
+ },
337
+ "push_policy": {
338
+ "type": "object",
339
+ "additionalProperties": false,
340
+ "properties": {
341
+ "mode": {
342
+ "type": "string",
343
+ "enum": [
344
+ "disabled",
345
+ "explicit_only"
346
+ ]
347
+ },
348
+ "via": {
349
+ "type": "string",
350
+ "enum": [
351
+ "skill",
352
+ "manual"
353
+ ]
354
+ },
355
+ "require": {
356
+ "$ref": "#/$defs/string_list"
357
+ }
358
+ }
359
+ },
360
+ "delivery_policy": {
361
+ "type": "object",
362
+ "additionalProperties": false,
363
+ "properties": {
364
+ "commit": {
365
+ "$ref": "#/$defs/commit_policy"
366
+ },
367
+ "push": {
368
+ "$ref": "#/$defs/push_policy"
369
+ }
370
+ }
371
+ }
372
+ },
373
+ "properties": {
374
+ "version": {
375
+ "type": "string",
376
+ "const": "0.3"
377
+ },
378
+ "project_name": {
379
+ "type": "string",
380
+ "minLength": 1
381
+ },
382
+ "project_type": {
383
+ "type": "string",
384
+ "enum": [
385
+ "frontend",
386
+ "backend",
387
+ "fullstack",
388
+ "library",
389
+ "infra",
390
+ "monorepo",
391
+ "protocol-tooling",
392
+ "other"
393
+ ]
394
+ },
395
+ "languages": {
396
+ "$ref": "#/$defs/string_list"
397
+ },
398
+ "default_mode": {
399
+ "$ref": "#/$defs/mode"
400
+ },
401
+ "allowed_paths": {
402
+ "$ref": "#/$defs/string_list",
403
+ "minItems": 1
404
+ },
405
+ "protected_paths": {
406
+ "$ref": "#/$defs/string_list"
407
+ },
408
+ "default_commands": {
409
+ "$ref": "#/$defs/default_commands"
410
+ },
411
+ "risk_rules": {
412
+ "$ref": "#/$defs/risk_rules"
413
+ },
414
+ "task_templates": {
415
+ "$ref": "#/$defs/task_templates"
416
+ },
417
+ "skill_policy": {
418
+ "$ref": "#/$defs/skill_policy"
419
+ },
420
+ "delivery_policy": {
421
+ "$ref": "#/$defs/delivery_policy"
422
+ },
423
+ "output_policy": {
424
+ "$ref": "#/$defs/output_policy"
425
+ }
426
+ }
427
+ }
@@ -0,0 +1,96 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://harness.local/schemas/intake-result.schema.json",
4
+ "title": "Harness Intake Result",
5
+ "description": "最小 intake CLI 的标准输出对象。",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "required": [
9
+ "schema_version",
10
+ "command",
11
+ "status",
12
+ "task_draft",
13
+ "interaction"
14
+ ],
15
+ "properties": {
16
+ "schema_version": {
17
+ "type": "string",
18
+ "const": "0.3"
19
+ },
20
+ "command": {
21
+ "type": "string",
22
+ "const": "intake"
23
+ },
24
+ "status": {
25
+ "type": "string",
26
+ "enum": [
27
+ "planned",
28
+ "needs_clarification",
29
+ "failed"
30
+ ]
31
+ },
32
+ "task_draft": {
33
+ "$ref": "./task-draft.schema.json"
34
+ },
35
+ "interaction": {
36
+ "type": "object",
37
+ "additionalProperties": false,
38
+ "required": [
39
+ "summary",
40
+ "assumptions",
41
+ "blocking_gap",
42
+ "question",
43
+ "next_action"
44
+ ],
45
+ "properties": {
46
+ "summary": {
47
+ "type": "string",
48
+ "minLength": 1
49
+ },
50
+ "assumptions": {
51
+ "type": "array",
52
+ "items": {
53
+ "type": "string",
54
+ "minLength": 1
55
+ }
56
+ },
57
+ "blocking_gap": {
58
+ "type": [
59
+ "string",
60
+ "null"
61
+ ]
62
+ },
63
+ "question": {
64
+ "type": [
65
+ "string",
66
+ "null"
67
+ ]
68
+ },
69
+ "next_action": {
70
+ "type": "string",
71
+ "enum": [
72
+ "clarify",
73
+ "plan",
74
+ "observe",
75
+ "fail"
76
+ ]
77
+ }
78
+ }
79
+ },
80
+ "metadata": {
81
+ "type": "object",
82
+ "additionalProperties": false,
83
+ "properties": {
84
+ "project": {
85
+ "type": "string"
86
+ },
87
+ "config_path": {
88
+ "type": "string"
89
+ },
90
+ "generated_at": {
91
+ "type": "string"
92
+ }
93
+ }
94
+ }
95
+ }
96
+ }