@operad-io/dev 0.0.0-stage → 0.0.1
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/LICENSE +21 -0
- package/README.md +795 -2
- package/dev.schema.json +602 -0
- package/flows/chat-worktree.flow.ts +18 -0
- package/flows/dev.flow.ts +7 -0
- package/package.json +29 -4
- package/src/actions.ts +591 -0
- package/src/announce.ts +225 -0
- package/src/chat.ts +234 -0
- package/src/check.ts +80 -0
- package/src/commands.ts +417 -0
- package/src/editor.ts +55 -0
- package/src/flaky.ts +716 -0
- package/src/flow-compiler.ts +858 -0
- package/src/followups.ts +223 -0
- package/src/gate.ts +2897 -0
- package/src/git.ts +138 -0
- package/src/index.ts +226 -0
- package/src/integrate.ts +1201 -0
- package/src/integration-queue.ts +393 -0
- package/src/lock.ts +36 -0
- package/src/mainclone.ts +102 -0
- package/src/marks.ts +126 -0
- package/src/model.ts +1165 -0
- package/src/notcode.ts +266 -0
- package/src/place-order.ts +161 -0
- package/src/place-wait.ts +64 -0
- package/src/places.ts +368 -0
- package/src/prepare.ts +106 -0
- package/src/progress.ts +115 -0
- package/src/project-flows.ts +160 -0
- package/src/project-settings.ts +185 -0
- package/src/refusals.ts +336 -0
- package/src/rerun.ts +378 -0
- package/src/reruns.ts +62 -0
- package/src/retry.ts +212 -0
- package/src/rework.ts +366 -0
- package/src/schedule.ts +1052 -0
- package/src/service.ts +2160 -0
- package/src/settings.ts +1463 -0
- package/src/standing.ts +87 -0
- package/src/stdin.ts +105 -0
- package/src/steps.ts +1775 -0
- package/src/stops.ts +103 -0
- package/src/throughput.ts +347 -0
- package/src/timeouts.ts +60 -0
- package/src/views.ts +1167 -0
- package/src/waits.ts +105 -0
package/dev.schema.json
ADDED
|
@@ -0,0 +1,602 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://operad.io/schemas/dev.schema.json",
|
|
4
|
+
"title": "operad dev repository settings",
|
|
5
|
+
"description": "The settings in <repository>/.operad/dev.json, owned by the dev plugin.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"$defs": {
|
|
8
|
+
"checkCommand": {
|
|
9
|
+
"description": "A check command: a shell line, or an object that also says how to run again only the tests that failed.",
|
|
10
|
+
"oneOf": [
|
|
11
|
+
{ "type": "string", "minLength": 1 },
|
|
12
|
+
{
|
|
13
|
+
"type": "object",
|
|
14
|
+
"properties": {
|
|
15
|
+
"run": {
|
|
16
|
+
"description": "The shell line to run.",
|
|
17
|
+
"type": "string",
|
|
18
|
+
"minLength": 1
|
|
19
|
+
},
|
|
20
|
+
"failed": {
|
|
21
|
+
"description": "When the line exits non-zero, read the failed tests' names from its log and run each alone; the check passes when every rerun passes. Used instead of check.rerun for this line. A timeout is never rerun.",
|
|
22
|
+
"type": "object",
|
|
23
|
+
"properties": {
|
|
24
|
+
"match": {
|
|
25
|
+
"description": "A regular expression with exactly one capture group, matched per line of the log (multiline): the failed test's name.",
|
|
26
|
+
"type": "string",
|
|
27
|
+
"minLength": 1
|
|
28
|
+
},
|
|
29
|
+
"rerun": {
|
|
30
|
+
"description": "The command that runs one failed test. {name} is replaced by the shell-quoted name, {pattern} by the shell-quoted anchored regular expression of it (a ' > ' between describe names becomes a space, as bun test -t matches).",
|
|
31
|
+
"type": "string",
|
|
32
|
+
"minLength": 1
|
|
33
|
+
},
|
|
34
|
+
"max": {
|
|
35
|
+
"description": "The most failed tests that are run again; more than this fails the check without a rerun.",
|
|
36
|
+
"type": "integer",
|
|
37
|
+
"minimum": 1,
|
|
38
|
+
"default": 10
|
|
39
|
+
},
|
|
40
|
+
"stress": {
|
|
41
|
+
"description": "The command that reproduces a flaky test of this line, written into the brief of the task dev proposes for it. {name}, {pattern} and {file} are replaced as in rerun; {file} is the test's file, or nothing when it is not known. Without it the brief has no command.",
|
|
42
|
+
"type": "string",
|
|
43
|
+
"minLength": 1
|
|
44
|
+
},
|
|
45
|
+
"rule": {
|
|
46
|
+
"description": "A path inside the repository to a text file with the repository's rule for flaky tests, quoted in the brief. Without it, or when the file is missing or empty, the brief quotes dev's own sentence.",
|
|
47
|
+
"type": "string",
|
|
48
|
+
"minLength": 1
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
"required": ["match", "rerun"],
|
|
52
|
+
"additionalProperties": false
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
"required": ["run"],
|
|
56
|
+
"additionalProperties": false
|
|
57
|
+
}
|
|
58
|
+
]
|
|
59
|
+
},
|
|
60
|
+
"stage": {
|
|
61
|
+
"description": "One stage of a repository flow. A parameter left out falls back to its dev.json setting.",
|
|
62
|
+
"oneOf": [
|
|
63
|
+
{
|
|
64
|
+
"description": "A worker changes the task branch.",
|
|
65
|
+
"type": "object",
|
|
66
|
+
"properties": {
|
|
67
|
+
"stage": { "const": "work" },
|
|
68
|
+
"use": { "description": "The harness step, such as radian/agent; unset uses the repository's worker.", "type": "string", "minLength": 1 },
|
|
69
|
+
"args": { "description": "Arguments for the harness step; unset uses the worker's own.", "type": "array", "items": { "type": "string" } },
|
|
70
|
+
"pool": { "description": "The pool this stage takes its workers from; unset is default. The name must be in pools.", "type": "string", "minLength": 1 },
|
|
71
|
+
"workerBrief": { "description": "A file, relative to the repository, whose text replaces the repository's workerBrief for this stage. The file must exist.", "type": "string", "minLength": 1 },
|
|
72
|
+
"commit": { "description": "When true, after the worker ends done, dev commits every change left in the worktree with the message '<task id>: <task title>'. Default false: the worker commits itself.", "type": "boolean" },
|
|
73
|
+
"brief": { "description": "Extra instructions appended to the worker's prompt.", "type": "string", "minLength": 1 },
|
|
74
|
+
"beforeAttempt": { "description": "The preparation before the attempt: merge-main (fetch and merge the latest main) or none. Unset leaves the worktree step's merge in force.", "type": "string", "enum": ["merge-main", "none"] }
|
|
75
|
+
},
|
|
76
|
+
"required": ["stage"],
|
|
77
|
+
"additionalProperties": false
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"description": "Commands run in a gate checkout of the task commit.",
|
|
81
|
+
"type": "object",
|
|
82
|
+
"properties": {
|
|
83
|
+
"stage": { "const": "check" },
|
|
84
|
+
"commands": { "description": "The shell lines to run; unset uses gate.commands.", "type": "array", "items": { "$ref": "#/$defs/checkCommand" } },
|
|
85
|
+
"rerun": { "description": "How many times a failed line list runs again; unset uses check.rerun.", "type": "integer", "minimum": 0 }
|
|
86
|
+
},
|
|
87
|
+
"required": ["stage"],
|
|
88
|
+
"additionalProperties": false
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"description": "A reviewer harness reads the diff from the merge base to the verified commit.",
|
|
92
|
+
"type": "object",
|
|
93
|
+
"properties": {
|
|
94
|
+
"stage": { "const": "review" },
|
|
95
|
+
"use": { "description": "The reviewer harness step; unset uses reviewer.use.", "type": "string", "minLength": 1 },
|
|
96
|
+
"args": { "description": "The reviewer's arguments; unset uses reviewer.args.", "type": "array", "items": { "type": "string" } },
|
|
97
|
+
"later": { "description": "The arguments of every review after the first in an attempt.", "type": "array", "items": { "type": "string" } },
|
|
98
|
+
"grading": { "description": "The entry in .operad/review.json; unset names the flow itself.", "type": "string", "minLength": 1 }
|
|
99
|
+
},
|
|
100
|
+
"required": ["stage"],
|
|
101
|
+
"additionalProperties": false
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"description": "The run waits for a person to decide.",
|
|
105
|
+
"type": "object",
|
|
106
|
+
"properties": {
|
|
107
|
+
"stage": { "const": "human" }
|
|
108
|
+
},
|
|
109
|
+
"required": ["stage"],
|
|
110
|
+
"additionalProperties": false
|
|
111
|
+
}
|
|
112
|
+
]
|
|
113
|
+
},
|
|
114
|
+
"flow": {
|
|
115
|
+
"description": "One repository flow: its stages, in order. At least one stage must be check, review or human. A human stage asks a person; when it is last its merge goes to integrate, and when it is not it continues with the next stage.",
|
|
116
|
+
"type": "object",
|
|
117
|
+
"properties": {
|
|
118
|
+
"stages": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/stage" } }
|
|
119
|
+
},
|
|
120
|
+
"required": ["stages"],
|
|
121
|
+
"additionalProperties": false
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
"properties": {
|
|
125
|
+
"$schema": {
|
|
126
|
+
"description": "The schema this file follows.",
|
|
127
|
+
"type": "string"
|
|
128
|
+
},
|
|
129
|
+
"name": {
|
|
130
|
+
"description": "The name this repository is registered under.",
|
|
131
|
+
"type": "string",
|
|
132
|
+
"minLength": 1
|
|
133
|
+
},
|
|
134
|
+
"remote": {
|
|
135
|
+
"description": "The git remote task branches are fetched from and pushed to.",
|
|
136
|
+
"type": "string",
|
|
137
|
+
"minLength": 1,
|
|
138
|
+
"default": "origin"
|
|
139
|
+
},
|
|
140
|
+
"mainBranch": {
|
|
141
|
+
"description": "The branch a task branch starts from and merges before each attempt.",
|
|
142
|
+
"type": "string",
|
|
143
|
+
"minLength": 1,
|
|
144
|
+
"default": "main"
|
|
145
|
+
},
|
|
146
|
+
"worktreeRoot": {
|
|
147
|
+
"description": "The directory task worktrees are kept in, relative to the repository and inside it.",
|
|
148
|
+
"type": "string",
|
|
149
|
+
"minLength": 1,
|
|
150
|
+
"default": ".operad-worktrees"
|
|
151
|
+
},
|
|
152
|
+
"worktrees": {
|
|
153
|
+
"description": "Deprecated: the old name of worktreeRoot, still read so earlier settings keep working.",
|
|
154
|
+
"type": "string",
|
|
155
|
+
"minLength": 1,
|
|
156
|
+
"deprecated": true
|
|
157
|
+
},
|
|
158
|
+
"concurrency": {
|
|
159
|
+
"description": "A cap on running tasks across every pool together. Each pool has its own cap: the sum of the counts of its workers, or the pool's own concurrency when that is smaller. This cap never raises a pool's cap; when the file does not set it, the pools' caps alone decide.",
|
|
160
|
+
"type": "integer",
|
|
161
|
+
"minimum": 1
|
|
162
|
+
},
|
|
163
|
+
"sandbox": {
|
|
164
|
+
"description": "Deprecated and ignored; kept so settings written by an earlier version still validate.",
|
|
165
|
+
"type": "string",
|
|
166
|
+
"minLength": 1,
|
|
167
|
+
"deprecated": true
|
|
168
|
+
},
|
|
169
|
+
"worker": {
|
|
170
|
+
"description": "The old single-worker form: one worker named after its harness, with count equal to concurrency, in the pool default. Not allowed together with workers.",
|
|
171
|
+
"type": "object",
|
|
172
|
+
"properties": {
|
|
173
|
+
"use": {
|
|
174
|
+
"description": "The harness step, such as radian/agent.",
|
|
175
|
+
"type": "string",
|
|
176
|
+
"minLength": 1,
|
|
177
|
+
"default": "radian/agent"
|
|
178
|
+
},
|
|
179
|
+
"args": {
|
|
180
|
+
"description": "Extra arguments the harness step passes to its command.",
|
|
181
|
+
"type": "array",
|
|
182
|
+
"items": {
|
|
183
|
+
"type": "string"
|
|
184
|
+
},
|
|
185
|
+
"default": []
|
|
186
|
+
},
|
|
187
|
+
"wallTimeSecs": {
|
|
188
|
+
"description": "The longest a worker may run, in seconds.",
|
|
189
|
+
"type": "number",
|
|
190
|
+
"exclusiveMinimum": 0
|
|
191
|
+
},
|
|
192
|
+
"stallSecs": {
|
|
193
|
+
"description": "How long a worker may go without a new output line, in seconds.",
|
|
194
|
+
"type": "number",
|
|
195
|
+
"exclusiveMinimum": 0
|
|
196
|
+
}
|
|
197
|
+
},
|
|
198
|
+
"additionalProperties": false,
|
|
199
|
+
"default": {
|
|
200
|
+
"use": "radian/agent",
|
|
201
|
+
"args": []
|
|
202
|
+
}
|
|
203
|
+
},
|
|
204
|
+
"workers": {
|
|
205
|
+
"description": "The repository's workers, by name. At least one. Not allowed together with worker.",
|
|
206
|
+
"type": "object",
|
|
207
|
+
"minProperties": 1,
|
|
208
|
+
"additionalProperties": {
|
|
209
|
+
"type": "object",
|
|
210
|
+
"properties": {
|
|
211
|
+
"use": {
|
|
212
|
+
"description": "The harness step, as plugin/step, such as claude/agent.",
|
|
213
|
+
"type": "string",
|
|
214
|
+
"pattern": "^[^/\\s]+/[^/\\s]+$"
|
|
215
|
+
},
|
|
216
|
+
"args": {
|
|
217
|
+
"description": "Arguments passed to the harness step.",
|
|
218
|
+
"type": "array",
|
|
219
|
+
"items": {
|
|
220
|
+
"type": "string"
|
|
221
|
+
},
|
|
222
|
+
"default": []
|
|
223
|
+
},
|
|
224
|
+
"count": {
|
|
225
|
+
"description": "How many runs of this worker may go at once in this repository.",
|
|
226
|
+
"type": "integer",
|
|
227
|
+
"minimum": 1,
|
|
228
|
+
"default": 1
|
|
229
|
+
},
|
|
230
|
+
"wallTimeSecs": {
|
|
231
|
+
"description": "The longest a run may take, in seconds.",
|
|
232
|
+
"type": "number",
|
|
233
|
+
"exclusiveMinimum": 0
|
|
234
|
+
},
|
|
235
|
+
"stallSecs": {
|
|
236
|
+
"description": "How long a run may print nothing, in seconds.",
|
|
237
|
+
"type": "number",
|
|
238
|
+
"exclusiveMinimum": 0
|
|
239
|
+
},
|
|
240
|
+
"fallback": {
|
|
241
|
+
"description": "Another worker to run once when this worker's model is unavailable.",
|
|
242
|
+
"type": "string",
|
|
243
|
+
"minLength": 1
|
|
244
|
+
}
|
|
245
|
+
},
|
|
246
|
+
"required": [
|
|
247
|
+
"use"
|
|
248
|
+
],
|
|
249
|
+
"additionalProperties": false
|
|
250
|
+
}
|
|
251
|
+
},
|
|
252
|
+
"pools": {
|
|
253
|
+
"description": "Groups of workers by pool name. dev uses the pool default, which must be defined here, unless a work stage names another pool; without pools, default holds every worker in the order written. A pool is a list of worker names, or an object with the list and a concurrency that caps the pool's running tasks below the sum of its workers' counts. Needs workers.",
|
|
254
|
+
"type": "object",
|
|
255
|
+
"minProperties": 1,
|
|
256
|
+
"additionalProperties": {
|
|
257
|
+
"oneOf": [
|
|
258
|
+
{
|
|
259
|
+
"type": "array",
|
|
260
|
+
"minItems": 1,
|
|
261
|
+
"items": { "type": "string" }
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
"type": "object",
|
|
265
|
+
"properties": {
|
|
266
|
+
"workers": { "type": "array", "minItems": 1, "items": { "type": "string" } },
|
|
267
|
+
"concurrency": { "type": "integer", "minimum": 1 }
|
|
268
|
+
},
|
|
269
|
+
"required": ["workers"],
|
|
270
|
+
"additionalProperties": false
|
|
271
|
+
}
|
|
272
|
+
]
|
|
273
|
+
}
|
|
274
|
+
},
|
|
275
|
+
"workerBrief": {
|
|
276
|
+
"description": "The Markdown a worker reads before the task brief; a missing file means the built-in text.",
|
|
277
|
+
"type": "string",
|
|
278
|
+
"minLength": 1,
|
|
279
|
+
"default": ".operad/worker-brief.md"
|
|
280
|
+
},
|
|
281
|
+
"prepare": {
|
|
282
|
+
"description": "Shell lines run in every checkout dev makes (the worker's worktree, the gate checkout for verify and review, the integration checkout) after it is created or moved to a new commit and before any step uses it, for example installing dependencies. They also run, in order, in the repository's main clone after a merge fast-forwarded it. Output goes to the step's log; a failing line fails the step with reason \"prepare failed\"; in the main clone a failing line is reported in the task's Changes and the fast-forward stays.",
|
|
283
|
+
"type": "array",
|
|
284
|
+
"items": { "type": "string", "minLength": 1 },
|
|
285
|
+
"default": []
|
|
286
|
+
},
|
|
287
|
+
"gate": {
|
|
288
|
+
"description": "The commands a task's gate runs on its commit and how long each may take.",
|
|
289
|
+
"type": "object",
|
|
290
|
+
"properties": {
|
|
291
|
+
"commands": {
|
|
292
|
+
"description": "The commands the verify step runs, in order, in a detached checkout of the task commit.",
|
|
293
|
+
"type": "array",
|
|
294
|
+
"items": { "$ref": "#/$defs/checkCommand" },
|
|
295
|
+
"default": []
|
|
296
|
+
},
|
|
297
|
+
"commandTimeoutSecs": {
|
|
298
|
+
"description": "The longest one gate command may run, in seconds.",
|
|
299
|
+
"type": "number",
|
|
300
|
+
"exclusiveMinimum": 0,
|
|
301
|
+
"default": 1800
|
|
302
|
+
},
|
|
303
|
+
"places": {
|
|
304
|
+
"description": "The most checks of this repository that run at once, on top of the home's limit. A check waits, without a time limit, for a place of the home and one of the repository. Unset means the repository has no limit of its own.",
|
|
305
|
+
"type": "integer",
|
|
306
|
+
"minimum": 1
|
|
307
|
+
}
|
|
308
|
+
},
|
|
309
|
+
"additionalProperties": false,
|
|
310
|
+
"default": {
|
|
311
|
+
"commands": [],
|
|
312
|
+
"commandTimeoutSecs": 1800
|
|
313
|
+
}
|
|
314
|
+
},
|
|
315
|
+
"check": {
|
|
316
|
+
"description": "What a failed gate or integration check does before it counts as a failure.",
|
|
317
|
+
"type": "object",
|
|
318
|
+
"properties": {
|
|
319
|
+
"rerun": {
|
|
320
|
+
"description": "How many times a failed check runs again before it is reported as failed; 0 turns it off. A timeout is not rerun.",
|
|
321
|
+
"type": "integer",
|
|
322
|
+
"minimum": 0,
|
|
323
|
+
"default": 1
|
|
324
|
+
},
|
|
325
|
+
"flakyTask": {
|
|
326
|
+
"description": "How many times one test passes only on its rerun, in one repository, before dev proposes a task to fix it; 0 turns the proposal off.",
|
|
327
|
+
"type": "integer",
|
|
328
|
+
"minimum": 0,
|
|
329
|
+
"default": 2
|
|
330
|
+
},
|
|
331
|
+
"flakyPlan": {
|
|
332
|
+
"description": "The id of the plan dev proposes the flaky-test tasks in. When it is not set, or that plan is finished or cancelled, dev makes a plan flaky-tests (title Flaky tests) once and uses it.",
|
|
333
|
+
"type": "string",
|
|
334
|
+
"minLength": 1
|
|
335
|
+
},
|
|
336
|
+
"loadLimit": {
|
|
337
|
+
"description": "The 1-minute load average below which the machine is idle enough to trust a check. A check that timed out, was killed by a signal nobody in the task sent, or failed only by test timeouts waits for the load to fall below this, then runs once more by itself; a second such result waits for a person. When it is not set, the limit is the number of cores.",
|
|
338
|
+
"type": "number",
|
|
339
|
+
"exclusiveMinimum": 0
|
|
340
|
+
},
|
|
341
|
+
"flakyLoadLimit": {
|
|
342
|
+
"description": "The 1-minute load average above which a test that failed and then passed on rerun was seen under load. The check reads the load when its command starts and when it ends; a reading above this limit marks the failure as skipped, so it never opens or updates a flaky-test task, and the check's log and history say so with the load and the core count. When it is not set, the limit is twice the number of cores.",
|
|
343
|
+
"type": "number",
|
|
344
|
+
"exclusiveMinimum": 0
|
|
345
|
+
}
|
|
346
|
+
},
|
|
347
|
+
"additionalProperties": false,
|
|
348
|
+
"default": {
|
|
349
|
+
"rerun": 1,
|
|
350
|
+
"flakyTask": 2
|
|
351
|
+
}
|
|
352
|
+
},
|
|
353
|
+
"work": {
|
|
354
|
+
"description": "How a work step that is running out of time is told to wrap up.",
|
|
355
|
+
"type": "object",
|
|
356
|
+
"properties": {
|
|
357
|
+
"wrapUpAt": {
|
|
358
|
+
"description": "The share of the work step's time limit at which the worker is asked to stop starting new things, commit what it has and write a progress note. The limit is the wall time of the run the harness reports when it starts (the worker's wallTimeSecs, or the harness's own default), counted from when the pool gave the worker its place. When the step runs out of time anyway, what is in the worktree is committed as a work-in-progress commit and the next attempt starts from it and the note.",
|
|
359
|
+
"type": "number",
|
|
360
|
+
"exclusiveMinimum": 0,
|
|
361
|
+
"exclusiveMaximum": 1,
|
|
362
|
+
"default": 0.85
|
|
363
|
+
}
|
|
364
|
+
},
|
|
365
|
+
"additionalProperties": false,
|
|
366
|
+
"default": {
|
|
367
|
+
"wrapUpAt": 0.85
|
|
368
|
+
}
|
|
369
|
+
},
|
|
370
|
+
"reviewer": {
|
|
371
|
+
"description": "The harness step that reviews a task's diff and the limits it runs under.",
|
|
372
|
+
"type": "object",
|
|
373
|
+
"properties": {
|
|
374
|
+
"use": {
|
|
375
|
+
"description": "The harness step, such as radian/agent.",
|
|
376
|
+
"type": "string",
|
|
377
|
+
"minLength": 1,
|
|
378
|
+
"default": "radian/agent"
|
|
379
|
+
},
|
|
380
|
+
"args": {
|
|
381
|
+
"description": "Extra arguments the harness step passes to its command.",
|
|
382
|
+
"type": "array",
|
|
383
|
+
"items": {
|
|
384
|
+
"type": "string"
|
|
385
|
+
},
|
|
386
|
+
"default": []
|
|
387
|
+
},
|
|
388
|
+
"firstArgs": {
|
|
389
|
+
"description": "Arguments used for the first review of an attempt, when they differ from args.",
|
|
390
|
+
"type": "array",
|
|
391
|
+
"items": {
|
|
392
|
+
"type": "string"
|
|
393
|
+
}
|
|
394
|
+
},
|
|
395
|
+
"first": {
|
|
396
|
+
"description": "Settings of the first review of a task. A value set here replaces the reviewer's own for that review; every later review (a rework round or a review of the same commit) uses the reviewer's own values.",
|
|
397
|
+
"type": "object",
|
|
398
|
+
"properties": {
|
|
399
|
+
"use": {
|
|
400
|
+
"description": "The harness step of the first review.",
|
|
401
|
+
"type": "string",
|
|
402
|
+
"minLength": 1
|
|
403
|
+
},
|
|
404
|
+
"args": {
|
|
405
|
+
"description": "Arguments of the first review, such as a model route.",
|
|
406
|
+
"type": "array",
|
|
407
|
+
"items": {
|
|
408
|
+
"type": "string"
|
|
409
|
+
}
|
|
410
|
+
},
|
|
411
|
+
"timeoutSecs": {
|
|
412
|
+
"description": "The longest the first review may run, in seconds.",
|
|
413
|
+
"type": "number",
|
|
414
|
+
"exclusiveMinimum": 0
|
|
415
|
+
},
|
|
416
|
+
"stallSecs": {
|
|
417
|
+
"description": "How long the first review may go without a new output line, in seconds.",
|
|
418
|
+
"type": "number",
|
|
419
|
+
"exclusiveMinimum": 0
|
|
420
|
+
}
|
|
421
|
+
},
|
|
422
|
+
"additionalProperties": false
|
|
423
|
+
},
|
|
424
|
+
"fallback": {
|
|
425
|
+
"description": "A second harness step and arguments used when the primary reviewer is unavailable.",
|
|
426
|
+
"type": "object",
|
|
427
|
+
"properties": {
|
|
428
|
+
"use": {
|
|
429
|
+
"description": "The harness step that reviews when the primary is unavailable.",
|
|
430
|
+
"type": "string",
|
|
431
|
+
"minLength": 1
|
|
432
|
+
},
|
|
433
|
+
"args": {
|
|
434
|
+
"description": "Arguments the fallback harness step passes to its command.",
|
|
435
|
+
"type": "array",
|
|
436
|
+
"items": {
|
|
437
|
+
"type": "string"
|
|
438
|
+
},
|
|
439
|
+
"default": []
|
|
440
|
+
}
|
|
441
|
+
},
|
|
442
|
+
"required": [
|
|
443
|
+
"use"
|
|
444
|
+
],
|
|
445
|
+
"additionalProperties": false
|
|
446
|
+
},
|
|
447
|
+
"timeoutSecs": {
|
|
448
|
+
"description": "The longest a review may run, in seconds.",
|
|
449
|
+
"type": "number",
|
|
450
|
+
"exclusiveMinimum": 0,
|
|
451
|
+
"default": 600
|
|
452
|
+
},
|
|
453
|
+
"stallSecs": {
|
|
454
|
+
"description": "How long a review may go without a new output line, in seconds; unset uses the harness default.",
|
|
455
|
+
"type": "number",
|
|
456
|
+
"exclusiveMinimum": 0
|
|
457
|
+
},
|
|
458
|
+
"fixLevel": {
|
|
459
|
+
"description": "The lowest finding severity that fails the gate.",
|
|
460
|
+
"type": "string",
|
|
461
|
+
"enum": [
|
|
462
|
+
"critical",
|
|
463
|
+
"major",
|
|
464
|
+
"minor"
|
|
465
|
+
],
|
|
466
|
+
"default": "major"
|
|
467
|
+
},
|
|
468
|
+
"followups": {
|
|
469
|
+
"description": "Whether findings that did not fail a review are collected into one follow-up task when a plan has no open task.",
|
|
470
|
+
"type": "boolean",
|
|
471
|
+
"default": true
|
|
472
|
+
},
|
|
473
|
+
"retrySecs": {
|
|
474
|
+
"description": "How long a review waits before it runs again after a model was unavailable.",
|
|
475
|
+
"type": "number",
|
|
476
|
+
"exclusiveMinimum": 0,
|
|
477
|
+
"default": 120
|
|
478
|
+
},
|
|
479
|
+
"maxFileDiffBytes": {
|
|
480
|
+
"description": "The largest diff one file may put in the review prompt; a larger file is left out and listed.",
|
|
481
|
+
"type": "integer",
|
|
482
|
+
"minimum": 1,
|
|
483
|
+
"default": 200000
|
|
484
|
+
},
|
|
485
|
+
"maxDiffBytes": {
|
|
486
|
+
"description": "The largest diff the review prompt may carry (a rename or a deleted file counts as one line); a larger change fails the review before a reviewer starts.",
|
|
487
|
+
"type": "integer",
|
|
488
|
+
"minimum": 1,
|
|
489
|
+
"default": 1000000
|
|
490
|
+
}
|
|
491
|
+
},
|
|
492
|
+
"additionalProperties": false,
|
|
493
|
+
"default": {
|
|
494
|
+
"use": "radian/agent",
|
|
495
|
+
"args": [],
|
|
496
|
+
"timeoutSecs": 600,
|
|
497
|
+
"fixLevel": "major",
|
|
498
|
+
"followups": true,
|
|
499
|
+
"retrySecs": 120,
|
|
500
|
+
"maxFileDiffBytes": 200000,
|
|
501
|
+
"maxDiffBytes": 1000000
|
|
502
|
+
}
|
|
503
|
+
},
|
|
504
|
+
"integration": {
|
|
505
|
+
"description": "How the integrate step builds the candidate and lands it on main.",
|
|
506
|
+
"type": "object",
|
|
507
|
+
"properties": {
|
|
508
|
+
"style": {
|
|
509
|
+
"description": "Merge the verified commit with a merge commit, or squash it into one commit.",
|
|
510
|
+
"type": "string",
|
|
511
|
+
"enum": [
|
|
512
|
+
"merge",
|
|
513
|
+
"squash"
|
|
514
|
+
],
|
|
515
|
+
"default": "merge"
|
|
516
|
+
},
|
|
517
|
+
"keyCommands": {
|
|
518
|
+
"description": "Commands the integrate step runs on the candidate before it pushes; the first failure sends the task back to the worker.",
|
|
519
|
+
"type": "array",
|
|
520
|
+
"items": { "$ref": "#/$defs/checkCommand" },
|
|
521
|
+
"default": []
|
|
522
|
+
},
|
|
523
|
+
"batch": {
|
|
524
|
+
"description": "The most tasks one integration merges onto main together, running keyCommands once and pushing once; each task keeps its own merge commit. Tasks of one repository integrate one at a time, in the order their merges were chosen; with a batch above 1, the tasks queued when a turn starts land together. A merge conflict or a failing key command falls back to one by one. 1 (or unset) means one at a time.",
|
|
525
|
+
"type": "integer",
|
|
526
|
+
"minimum": 1,
|
|
527
|
+
"default": 1
|
|
528
|
+
}
|
|
529
|
+
},
|
|
530
|
+
"additionalProperties": false,
|
|
531
|
+
"default": {
|
|
532
|
+
"style": "merge",
|
|
533
|
+
"keyCommands": [],
|
|
534
|
+
"batch": 1
|
|
535
|
+
}
|
|
536
|
+
},
|
|
537
|
+
"hooks": {
|
|
538
|
+
"description": "Commands the cleanup step runs after a merge, in the repository root, with OPERAD_TASK and OPERAD_WORKTREE set.",
|
|
539
|
+
"type": "object",
|
|
540
|
+
"properties": {
|
|
541
|
+
"afterMerge": {
|
|
542
|
+
"description": "The commands cleanup runs after a merge; a failure is recorded and does not fail the task.",
|
|
543
|
+
"type": "array",
|
|
544
|
+
"items": {
|
|
545
|
+
"type": "string",
|
|
546
|
+
"minLength": 1
|
|
547
|
+
},
|
|
548
|
+
"default": [
|
|
549
|
+
"if [ -e \"$OPERAD_WORKTREE\" ]; then git worktree remove --force \"$OPERAD_WORKTREE\"; fi",
|
|
550
|
+
"if [ -e \"$OPERAD_WORKTREE-gate\" ]; then git worktree remove --force \"$OPERAD_WORKTREE-gate\"; fi",
|
|
551
|
+
"git worktree prune",
|
|
552
|
+
"if git show-ref --verify --quiet \"refs/heads/work/$OPERAD_TASK\"; then git branch -D \"work/$OPERAD_TASK\"; fi",
|
|
553
|
+
"if git ls-remote --exit-code --heads \"$OPERAD_REMOTE\" \"work/$OPERAD_TASK\" >/dev/null; then git push \"$OPERAD_REMOTE\" --delete \"work/$OPERAD_TASK\"; else [ $? -eq 2 ]; fi"
|
|
554
|
+
]
|
|
555
|
+
}
|
|
556
|
+
},
|
|
557
|
+
"additionalProperties": false,
|
|
558
|
+
"default": {
|
|
559
|
+
"afterMerge": [
|
|
560
|
+
"if [ -e \"$OPERAD_WORKTREE\" ]; then git worktree remove --force \"$OPERAD_WORKTREE\"; fi",
|
|
561
|
+
"if [ -e \"$OPERAD_WORKTREE-gate\" ]; then git worktree remove --force \"$OPERAD_WORKTREE-gate\"; fi",
|
|
562
|
+
"git worktree prune",
|
|
563
|
+
"if git show-ref --verify --quiet \"refs/heads/work/$OPERAD_TASK\"; then git branch -D \"work/$OPERAD_TASK\"; fi",
|
|
564
|
+
"if git ls-remote --exit-code --heads \"$OPERAD_REMOTE\" \"work/$OPERAD_TASK\" >/dev/null; then git push \"$OPERAD_REMOTE\" --delete \"work/$OPERAD_TASK\"; else [ $? -eq 2 ]; fi"
|
|
565
|
+
]
|
|
566
|
+
}
|
|
567
|
+
},
|
|
568
|
+
"maxAutoRework": {
|
|
569
|
+
"description": "How many automatic reworks in a row are allowed before the flow waits for a person.",
|
|
570
|
+
"type": "integer",
|
|
571
|
+
"minimum": 0,
|
|
572
|
+
"default": 2
|
|
573
|
+
},
|
|
574
|
+
"autoDefault": {
|
|
575
|
+
"description": "The auto level a new plan starts at: off waits for you to start tasks, run starts them by itself, merge also merges a task whose review passed.",
|
|
576
|
+
"enum": ["off", "run", "merge"],
|
|
577
|
+
"default": "off"
|
|
578
|
+
},
|
|
579
|
+
"retry": {
|
|
580
|
+
"description": "What a task does when its step failed for a reason outside its own work: dev runs the step once more by itself, and only a second failure waits for a person.",
|
|
581
|
+
"type": "object",
|
|
582
|
+
"properties": {
|
|
583
|
+
"environmentWaitMinutes": {
|
|
584
|
+
"description": "How many minutes the retry waits for what was missing (a step that is not loaded, settings that cannot be read) before the task waits for a person.",
|
|
585
|
+
"type": "integer",
|
|
586
|
+
"minimum": 1,
|
|
587
|
+
"default": 60
|
|
588
|
+
}
|
|
589
|
+
},
|
|
590
|
+
"additionalProperties": false,
|
|
591
|
+
"default": {
|
|
592
|
+
"environmentWaitMinutes": 60
|
|
593
|
+
}
|
|
594
|
+
},
|
|
595
|
+
"flows": {
|
|
596
|
+
"description": "The repository's own flows, by name. An absent map runs the built-in default. A flow is an ordered list of stages; dev adds the worktree at the start and integrate and cleanup at the end. A plan or task chooses a flow with --flow, and a flow with no review skips review. A flow whose last stage is not human goes straight to integrate after it passes.",
|
|
597
|
+
"type": "object",
|
|
598
|
+
"additionalProperties": { "$ref": "#/$defs/flow" }
|
|
599
|
+
}
|
|
600
|
+
},
|
|
601
|
+
"additionalProperties": false
|
|
602
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { defineFlow } from "@operad-io/engine";
|
|
2
|
+
|
|
3
|
+
/** Opens the worktree a chat asked for; one step, then the run ends. */
|
|
4
|
+
export default defineFlow({
|
|
5
|
+
name: "dev:chat-worktree",
|
|
6
|
+
entry: "open",
|
|
7
|
+
steps: [
|
|
8
|
+
{
|
|
9
|
+
id: "open",
|
|
10
|
+
kind: "plugin",
|
|
11
|
+
params: { use: "dev/chat_worktree", params: {} },
|
|
12
|
+
replay: "safe",
|
|
13
|
+
next: { done: "done", failed: "failed" },
|
|
14
|
+
},
|
|
15
|
+
{ id: "done", kind: "end", params: { status: "done" }, replay: "safe" },
|
|
16
|
+
{ id: "failed", kind: "end", params: { status: "failed" }, replay: "safe" },
|
|
17
|
+
],
|
|
18
|
+
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { compileDevFlow, DEFAULT_STAGES } from "../src/flow-compiler.ts";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The dev flow a repository with no `flows` runs. It is compiled from the
|
|
5
|
+
* built-in stages, so it keeps the step ids earlier runs and tests use.
|
|
6
|
+
*/
|
|
7
|
+
export default compileDevFlow("dev", DEFAULT_STAGES);
|
package/package.json
CHANGED
|
@@ -1,6 +1,31 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@operad-io/dev",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"exports": {
|
|
6
|
+
".": "./src/index.ts"
|
|
7
|
+
},
|
|
8
|
+
"dependencies": {
|
|
9
|
+
"@operad-io/chat": "0.0.1",
|
|
10
|
+
"@operad-io/engine": "0.0.1",
|
|
11
|
+
"@operad-io/pool": "0.0.1",
|
|
12
|
+
"@operad-io/review-grading": "0.0.1"
|
|
13
|
+
},
|
|
14
|
+
"devDependencies": {
|
|
15
|
+
"@operad-io/shell": "0.0.1"
|
|
16
|
+
},
|
|
17
|
+
"description": "operad: the dev plugin, plans and tasks on a repository (in development)",
|
|
18
|
+
"repository": {
|
|
19
|
+
"type": "git",
|
|
20
|
+
"url": "git+https://github.com/operad-io/operad.git",
|
|
21
|
+
"directory": "packages/dev"
|
|
22
|
+
},
|
|
23
|
+
"license": "MIT",
|
|
24
|
+
"files": [
|
|
25
|
+
"src",
|
|
26
|
+
"flows",
|
|
27
|
+
"dev.schema.json",
|
|
28
|
+
"README.md",
|
|
29
|
+
"LICENSE"
|
|
30
|
+
]
|
|
31
|
+
}
|