@operad-io/dev 0.0.0-stage → 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.
Files changed (48) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +12 -2
  3. package/dev.schema.json +631 -0
  4. package/flows/chat-worktree.flow.ts +18 -0
  5. package/flows/dev.flow.ts +7 -0
  6. package/package.json +29 -4
  7. package/src/actions.ts +591 -0
  8. package/src/announce.ts +225 -0
  9. package/src/chat.ts +234 -0
  10. package/src/check.ts +80 -0
  11. package/src/commands.ts +417 -0
  12. package/src/editor.ts +55 -0
  13. package/src/flaky.ts +716 -0
  14. package/src/flow-compiler.ts +858 -0
  15. package/src/followups.ts +223 -0
  16. package/src/gate.ts +2950 -0
  17. package/src/git.ts +138 -0
  18. package/src/index.ts +227 -0
  19. package/src/integrate.ts +1213 -0
  20. package/src/integration-queue.ts +393 -0
  21. package/src/lock.ts +36 -0
  22. package/src/mainclone.ts +102 -0
  23. package/src/marks.ts +126 -0
  24. package/src/model.ts +1171 -0
  25. package/src/notcode.ts +305 -0
  26. package/src/place-order.ts +161 -0
  27. package/src/place-wait.ts +64 -0
  28. package/src/places.ts +368 -0
  29. package/src/prepare.ts +106 -0
  30. package/src/progress.ts +115 -0
  31. package/src/project-flows.ts +160 -0
  32. package/src/project-settings.ts +192 -0
  33. package/src/refusals.ts +336 -0
  34. package/src/rerun.ts +390 -0
  35. package/src/reruns.ts +62 -0
  36. package/src/retry.ts +212 -0
  37. package/src/rework.ts +366 -0
  38. package/src/schedule.ts +1052 -0
  39. package/src/service.ts +2160 -0
  40. package/src/settings.ts +1495 -0
  41. package/src/standing.ts +87 -0
  42. package/src/stdin.ts +105 -0
  43. package/src/steps.ts +1775 -0
  44. package/src/stops.ts +103 -0
  45. package/src/throughput.ts +347 -0
  46. package/src/timeouts.ts +60 -0
  47. package/src/views.ts +1167 -0
  48. package/src/waits.ts +105 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Yinghai Zhao
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,13 @@
1
- # Temporary Holding Version
1
+ # @operad-io/dev
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ **The dev plugin: plans and tasks on a repository.** Turns a request into planned work and follows each task through work, checks, review and merge, with you at the merge.
4
+
5
+ This package is part of [operad](https://github.com/operad-io/operad). Most people install only [`@operad-io/cli`](https://www.npmjs.com/package/@operad-io/cli).
6
+
7
+ ## Documentation
8
+
9
+ - User guide: [docs/user/dev.md](https://github.com/operad-io/operad/blob/main/docs/user/dev.md)
10
+ - Website: <https://operad.io>
11
+ - Developer reference: `REFERENCE.md` in this directory
12
+
13
+ MIT licensed.
@@ -0,0 +1,631 @@
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
+ "stallSecs": {
304
+ "description": "How long a gate command, or an integration key command, may write nothing before dev stops its process group, in seconds. A stalled command fails the check with reason \"stall\" and goes to the worker; it is not rerun and is not a \"not the code\" wait. Unset turns the limit off.",
305
+ "type": "number",
306
+ "exclusiveMinimum": 0
307
+ },
308
+ "places": {
309
+ "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.",
310
+ "type": "integer",
311
+ "minimum": 1
312
+ }
313
+ },
314
+ "additionalProperties": false,
315
+ "default": {
316
+ "commands": [],
317
+ "commandTimeoutSecs": 1800
318
+ }
319
+ },
320
+ "check": {
321
+ "description": "What a failed gate or integration check does before it counts as a failure.",
322
+ "type": "object",
323
+ "properties": {
324
+ "rerun": {
325
+ "description": "How many times a failed check runs again before it is reported as failed; 0 turns it off. A timeout is not rerun.",
326
+ "type": "integer",
327
+ "minimum": 0,
328
+ "default": 1
329
+ },
330
+ "flakyTask": {
331
+ "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.",
332
+ "type": "integer",
333
+ "minimum": 0,
334
+ "default": 2
335
+ },
336
+ "flakyPlan": {
337
+ "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.",
338
+ "type": "string",
339
+ "minLength": 1
340
+ },
341
+ "loadLimit": {
342
+ "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.",
343
+ "type": "number",
344
+ "exclusiveMinimum": 0
345
+ },
346
+ "flakyLoadLimit": {
347
+ "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.",
348
+ "type": "number",
349
+ "exclusiveMinimum": 0
350
+ }
351
+ },
352
+ "additionalProperties": false,
353
+ "default": {
354
+ "rerun": 1,
355
+ "flakyTask": 2
356
+ }
357
+ },
358
+ "work": {
359
+ "description": "How a work step that is running out of time is told to wrap up.",
360
+ "type": "object",
361
+ "properties": {
362
+ "wrapUpAt": {
363
+ "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.",
364
+ "type": "number",
365
+ "exclusiveMinimum": 0,
366
+ "exclusiveMaximum": 1,
367
+ "default": 0.85
368
+ }
369
+ },
370
+ "additionalProperties": false,
371
+ "default": {
372
+ "wrapUpAt": 0.85
373
+ }
374
+ },
375
+ "reviewer": {
376
+ "description": "The harness step that reviews a task's diff and the limits it runs under.",
377
+ "type": "object",
378
+ "properties": {
379
+ "use": {
380
+ "description": "The harness step, such as radian/agent.",
381
+ "type": "string",
382
+ "minLength": 1,
383
+ "default": "radian/agent"
384
+ },
385
+ "args": {
386
+ "description": "Extra arguments the harness step passes to its command.",
387
+ "type": "array",
388
+ "items": {
389
+ "type": "string"
390
+ },
391
+ "default": []
392
+ },
393
+ "firstArgs": {
394
+ "description": "Arguments used for the first review of an attempt, when they differ from args.",
395
+ "type": "array",
396
+ "items": {
397
+ "type": "string"
398
+ }
399
+ },
400
+ "first": {
401
+ "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.",
402
+ "type": "object",
403
+ "properties": {
404
+ "use": {
405
+ "description": "The harness step of the first review.",
406
+ "type": "string",
407
+ "minLength": 1
408
+ },
409
+ "args": {
410
+ "description": "Arguments of the first review, such as a model route.",
411
+ "type": "array",
412
+ "items": {
413
+ "type": "string"
414
+ }
415
+ },
416
+ "timeoutSecs": {
417
+ "description": "The longest the first review may run, in seconds.",
418
+ "type": "number",
419
+ "exclusiveMinimum": 0
420
+ },
421
+ "stallSecs": {
422
+ "description": "How long the first review may go without a new output line, in seconds.",
423
+ "type": "number",
424
+ "exclusiveMinimum": 0
425
+ }
426
+ },
427
+ "additionalProperties": false
428
+ },
429
+ "fallback": {
430
+ "description": "A second harness step and arguments used when the primary reviewer is unavailable or does not write the report, or a list of them tried in order until one writes the report.",
431
+ "oneOf": [
432
+ {
433
+ "type": "object",
434
+ "properties": {
435
+ "use": {
436
+ "description": "The harness step that reviews when the primary is unavailable.",
437
+ "type": "string",
438
+ "minLength": 1
439
+ },
440
+ "args": {
441
+ "description": "Arguments the fallback harness step passes to its command.",
442
+ "type": "array",
443
+ "items": {
444
+ "type": "string"
445
+ },
446
+ "default": []
447
+ }
448
+ },
449
+ "required": ["use"],
450
+ "additionalProperties": false
451
+ },
452
+ {
453
+ "type": "array",
454
+ "minItems": 1,
455
+ "items": {
456
+ "type": "object",
457
+ "properties": {
458
+ "use": {
459
+ "type": "string",
460
+ "minLength": 1
461
+ },
462
+ "args": {
463
+ "type": "array",
464
+ "items": {
465
+ "type": "string"
466
+ },
467
+ "default": []
468
+ }
469
+ },
470
+ "required": ["use"],
471
+ "additionalProperties": false
472
+ }
473
+ }
474
+ ]
475
+ },
476
+ "timeoutSecs": {
477
+ "description": "The longest a review may run, in seconds.",
478
+ "type": "number",
479
+ "exclusiveMinimum": 0,
480
+ "default": 600
481
+ },
482
+ "stallSecs": {
483
+ "description": "How long a review may go without a new output line, in seconds; unset uses the harness default.",
484
+ "type": "number",
485
+ "exclusiveMinimum": 0
486
+ },
487
+ "fixLevel": {
488
+ "description": "The lowest finding severity that fails the gate.",
489
+ "type": "string",
490
+ "enum": [
491
+ "critical",
492
+ "major",
493
+ "minor"
494
+ ],
495
+ "default": "major"
496
+ },
497
+ "followups": {
498
+ "description": "Whether findings that did not fail a review are collected into one follow-up task when a plan has no open task.",
499
+ "type": "boolean",
500
+ "default": true
501
+ },
502
+ "retrySecs": {
503
+ "description": "How long a review waits before it runs again after a model was unavailable.",
504
+ "type": "number",
505
+ "exclusiveMinimum": 0,
506
+ "default": 120
507
+ },
508
+ "maxFileDiffBytes": {
509
+ "description": "The largest diff one file may put in the review prompt; a larger file is left out and listed.",
510
+ "type": "integer",
511
+ "minimum": 1,
512
+ "default": 200000
513
+ },
514
+ "maxDiffBytes": {
515
+ "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.",
516
+ "type": "integer",
517
+ "minimum": 1,
518
+ "default": 1000000
519
+ }
520
+ },
521
+ "additionalProperties": false,
522
+ "default": {
523
+ "use": "radian/agent",
524
+ "args": [],
525
+ "timeoutSecs": 600,
526
+ "fixLevel": "major",
527
+ "followups": true,
528
+ "retrySecs": 120,
529
+ "maxFileDiffBytes": 200000,
530
+ "maxDiffBytes": 1000000
531
+ }
532
+ },
533
+ "integration": {
534
+ "description": "How the integrate step builds the candidate and lands it on main.",
535
+ "type": "object",
536
+ "properties": {
537
+ "style": {
538
+ "description": "Merge the verified commit with a merge commit, or squash it into one commit.",
539
+ "type": "string",
540
+ "enum": [
541
+ "merge",
542
+ "squash"
543
+ ],
544
+ "default": "merge"
545
+ },
546
+ "keyCommands": {
547
+ "description": "Commands the integrate step runs on the candidate before it pushes; the first failure sends the task back to the worker.",
548
+ "type": "array",
549
+ "items": { "$ref": "#/$defs/checkCommand" },
550
+ "default": []
551
+ },
552
+ "batch": {
553
+ "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.",
554
+ "type": "integer",
555
+ "minimum": 1,
556
+ "default": 1
557
+ }
558
+ },
559
+ "additionalProperties": false,
560
+ "default": {
561
+ "style": "merge",
562
+ "keyCommands": [],
563
+ "batch": 1
564
+ }
565
+ },
566
+ "hooks": {
567
+ "description": "Commands the cleanup step runs after a merge, in the repository root, with OPERAD_TASK and OPERAD_WORKTREE set.",
568
+ "type": "object",
569
+ "properties": {
570
+ "afterMerge": {
571
+ "description": "The commands cleanup runs after a merge; a failure is recorded and does not fail the task.",
572
+ "type": "array",
573
+ "items": {
574
+ "type": "string",
575
+ "minLength": 1
576
+ },
577
+ "default": [
578
+ "if [ -e \"$OPERAD_WORKTREE\" ]; then git worktree remove --force \"$OPERAD_WORKTREE\"; fi",
579
+ "if [ -e \"$OPERAD_WORKTREE-gate\" ]; then git worktree remove --force \"$OPERAD_WORKTREE-gate\"; fi",
580
+ "git worktree prune",
581
+ "if git show-ref --verify --quiet \"refs/heads/work/$OPERAD_TASK\"; then git branch -D \"work/$OPERAD_TASK\"; fi",
582
+ "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"
583
+ ]
584
+ }
585
+ },
586
+ "additionalProperties": false,
587
+ "default": {
588
+ "afterMerge": [
589
+ "if [ -e \"$OPERAD_WORKTREE\" ]; then git worktree remove --force \"$OPERAD_WORKTREE\"; fi",
590
+ "if [ -e \"$OPERAD_WORKTREE-gate\" ]; then git worktree remove --force \"$OPERAD_WORKTREE-gate\"; fi",
591
+ "git worktree prune",
592
+ "if git show-ref --verify --quiet \"refs/heads/work/$OPERAD_TASK\"; then git branch -D \"work/$OPERAD_TASK\"; fi",
593
+ "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"
594
+ ]
595
+ }
596
+ },
597
+ "maxAutoRework": {
598
+ "description": "How many automatic reworks in a row are allowed before the flow waits for a person.",
599
+ "type": "integer",
600
+ "minimum": 0,
601
+ "default": 2
602
+ },
603
+ "autoDefault": {
604
+ "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.",
605
+ "enum": ["off", "run", "merge"],
606
+ "default": "off"
607
+ },
608
+ "retry": {
609
+ "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.",
610
+ "type": "object",
611
+ "properties": {
612
+ "environmentWaitMinutes": {
613
+ "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.",
614
+ "type": "integer",
615
+ "minimum": 1,
616
+ "default": 60
617
+ }
618
+ },
619
+ "additionalProperties": false,
620
+ "default": {
621
+ "environmentWaitMinutes": 60
622
+ }
623
+ },
624
+ "flows": {
625
+ "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.",
626
+ "type": "object",
627
+ "additionalProperties": { "$ref": "#/$defs/flow" }
628
+ }
629
+ },
630
+ "additionalProperties": false
631
+ }