-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplan-edit.schema.json
More file actions
294 lines (294 loc) · 9.48 KB
/
Copy pathplan-edit.schema.json
File metadata and controls
294 lines (294 loc) · 9.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
{
"$id": "https://github.com/codeabovelab/codeboost/schema/versions/1/plan-edit.schema.json",
"title": "codeboost plan edit",
"description": "The plan assistant's answer on the Plans screen: a reply to the person, plus zero or more suggested edits to one plan revision. Nothing changes until the person clicks Apply on an edit. Version 1. Strict-mode compatible: every object lists all its properties as required; unused values are null. See docs/plan-format.md. The item, file, and check definitions are exact copies of those in plan.schema.json, so this file works on its own; codeboost's tests check that the copies match. There is no $schema line on purpose: Claude Code's --json-schema rejects the draft 2020-12 URL. Validate with a draft 2020-12 validator.",
"type": "object",
"additionalProperties": false,
"required": [
"schema_version",
"base_revision",
"reply",
"edits"
],
"properties": {
"schema_version": {
"type": "integer",
"enum": [
1
]
},
"base_revision": {
"description": "The revision of the plan captured by the server-side request context. Apply must verify that stable plan identity and this revision atomically; matching revision/item IDs on a different plan never authorizes mutation.",
"type": "integer",
"minimum": 1
},
"reply": {
"description": "The answer to the person, in plain words. Empty string only when there is nothing to say beyond the edits.",
"type": "string",
"maxLength": 4000
},
"edits": {
"description": "Suggested edits. Each one is shown as a card with Apply and Dismiss. Empty when the person only asked a question.",
"type": "array",
"maxItems": 10,
"items": {
"$ref": "#/$defs/edit"
}
}
},
"$defs": {
"edit": {
"type": "object",
"additionalProperties": false,
"required": [
"op",
"item",
"summary",
"reason",
"field",
"value",
"file",
"check",
"check_index",
"depends_on",
"new_item"
],
"properties": {
"op": {
"description": "add_item: new_item. remove_item: item. set_field: item, field, value. add_file or update_file: item, file. remove_file: item, value (the path). add_check: item, check. remove_check: item, check_index. set_depends: item, depends_on.",
"type": "string",
"enum": [
"add_item",
"remove_item",
"set_field",
"add_file",
"update_file",
"remove_file",
"add_check",
"remove_check",
"set_depends"
]
},
"item": {
"description": "The ID of the item to change. For add_item, the new item's ID.",
"type": "string",
"pattern": "^P[1-9][0-9]{0,2}$"
},
"summary": {
"description": "The card title, for example \"Add src/retry/config.go to P2's declared files\".",
"type": "string",
"minLength": 1,
"maxLength": 160
},
"reason": {
"description": "Why, in one sentence.",
"type": "string",
"minLength": 1,
"maxLength": 400
},
"field": {
"description": "For set_field: which field. Otherwise null.",
"type": [
"string",
"null"
],
"enum": [
"title",
"intent",
null
]
},
"value": {
"description": "For set_field: the new text. For remove_file: the path. Otherwise null.",
"type": [
"string",
"null"
],
"maxLength": 1200
},
"file": {
"description": "For add_file: the new file entry. For update_file: replacement for the existing entry with exactly the same path; path is immutable and a missing match is an error. Path changes require a newly imported complete plan revision (or separately valid add/remove edits). Otherwise null.",
"anyOf": [
{
"$ref": "#/$defs/file"
},
{
"type": "null"
}
]
},
"check": {
"description": "For add_check: the new acceptance entry. Otherwise null.",
"anyOf": [
{
"$ref": "#/$defs/check"
},
{
"type": "null"
}
]
},
"check_index": {
"description": "For remove_check: the 0-based position of the acceptance entry. Otherwise null.",
"type": [
"integer",
"null"
],
"minimum": 0
},
"depends_on": {
"description": "For set_depends: the full new list. Otherwise null.",
"anyOf": [
{
"type": "array",
"maxItems": 29,
"items": {
"type": "string",
"pattern": "^P[1-9][0-9]{0,2}$"
}
},
{
"type": "null"
}
]
},
"new_item": {
"description": "For add_item: the whole new item. Otherwise null.",
"anyOf": [
{
"$ref": "#/$defs/item"
},
{
"type": "null"
}
]
}
}
},
"item": {
"type": "object",
"additionalProperties": false,
"required": [
"id",
"title",
"intent",
"files",
"acceptance",
"depends_on"
],
"properties": {
"id": {
"description": "P followed by a number: P1, P2, and so on. Unique in the plan.",
"type": "string",
"pattern": "^P[1-9][0-9]{0,2}$"
},
"title": {
"description": "A short title, like a good commit subject.",
"type": "string",
"minLength": 1,
"maxLength": 120
},
"intent": {
"description": "Why this item exists, in one or two sentences. The review agent checks the code against it.",
"type": "string",
"minLength": 1,
"maxLength": 600
},
"files": {
"description": "The declared files: every file this item will add, change, rename, or delete, with what changes in each. The agent may edit only these.",
"type": "array",
"minItems": 1,
"maxItems": 40,
"items": {
"$ref": "#/$defs/file"
}
},
"acceptance": {
"description": "How to check the item. At least one entry. Prefer a cmd that codeboost can run.",
"type": "array",
"minItems": 1,
"maxItems": 10,
"items": {
"$ref": "#/$defs/check"
}
},
"depends_on": {
"description": "IDs of items that must be done first. Only earlier items. Empty when none.",
"type": "array",
"maxItems": 29,
"items": {
"type": "string",
"pattern": "^P[1-9][0-9]{0,2}$"
}
}
}
},
"file": {
"type": "object",
"additionalProperties": false,
"required": [
"path",
"kind",
"renamed_from",
"change"
],
"properties": {
"path": {
"description": "Path from the repo root, with forward slashes. For a rename, the new path.",
"type": "string",
"minLength": 1,
"maxLength": 300,
"pattern": "^[^/\\\\][^\\\\]*$"
},
"kind": {
"description": "edit: change an existing file. add: create a new file. delete: remove a file. rename: move a file, optionally changing it.",
"type": "string",
"enum": [
"edit",
"add",
"delete",
"rename"
]
},
"renamed_from": {
"description": "The old path when kind is rename; otherwise null.",
"type": [
"string",
"null"
],
"maxLength": 300
},
"change": {
"description": "What changes in this file, in plain words. Name functions and behavior, not line numbers.",
"type": "string",
"minLength": 1,
"maxLength": 1200
}
}
},
"check": {
"type": "object",
"additionalProperties": false,
"required": [
"type",
"text"
],
"properties": {
"type": {
"description": "cmd: one program and its literal arguments, for example go test ./... -run TestRetry. codeboost splits it into arguments and runs it in the container without a shell, using the strict quoting/tokenization grammar in docs/plan-format.md; shell syntax outside quoted literal arguments and all expansions are forbidden; the complete parsed argv must exactly match an entry on the repo's approved command list, including every flag and argument. Prefix matching and appended arguments are not allowed. An unlisted argv cannot execute until the person explicitly approves that exact allowlist entry. It passes when it exits 0. check: a statement the review agent judges against the code.",
"type": "string",
"enum": [
"cmd",
"check"
]
},
"text": {
"description": "The command, or the statement to check.",
"type": "string",
"minLength": 1,
"maxLength": 400
}
}
}
}
}