@revisium/orchestrator 0.0.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 (176) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +20 -0
  3. package/bin/revo.js +2 -0
  4. package/control-plane/bootstrap.config.json +931 -0
  5. package/dist/app.module.js +28 -0
  6. package/dist/app.module.js.map +1 -0
  7. package/dist/cli/commands/bootstrap.js +39 -0
  8. package/dist/cli/commands/bootstrap.js.map +1 -0
  9. package/dist/cli/commands/dev.js +143 -0
  10. package/dist/cli/commands/dev.js.map +1 -0
  11. package/dist/cli/commands/inbox.js +288 -0
  12. package/dist/cli/commands/inbox.js.map +1 -0
  13. package/dist/cli/commands/mcp.js +16 -0
  14. package/dist/cli/commands/mcp.js.map +1 -0
  15. package/dist/cli/commands/playbook.js +74 -0
  16. package/dist/cli/commands/playbook.js.map +1 -0
  17. package/dist/cli/commands/poll-workflow-state.js +144 -0
  18. package/dist/cli/commands/poll-workflow-state.js.map +1 -0
  19. package/dist/cli/commands/revisium-context.js +23 -0
  20. package/dist/cli/commands/revisium-context.js.map +1 -0
  21. package/dist/cli/commands/revisium-helpers.js +61 -0
  22. package/dist/cli/commands/revisium-helpers.js.map +1 -0
  23. package/dist/cli/commands/revisium.js +89 -0
  24. package/dist/cli/commands/revisium.js.map +1 -0
  25. package/dist/cli/commands/run.js +426 -0
  26. package/dist/cli/commands/run.js.map +1 -0
  27. package/dist/cli/commands/work.js +149 -0
  28. package/dist/cli/commands/work.js.map +1 -0
  29. package/dist/cli/config.js +2 -0
  30. package/dist/cli/config.js.map +1 -0
  31. package/dist/cli/index.js +32 -0
  32. package/dist/cli/index.js.map +1 -0
  33. package/dist/cli/live-guard.js +49 -0
  34. package/dist/cli/live-guard.js.map +1 -0
  35. package/dist/cli/needs-host.js +78 -0
  36. package/dist/cli/needs-host.js.map +1 -0
  37. package/dist/cli/program.js +37 -0
  38. package/dist/cli/program.js.map +1 -0
  39. package/dist/config.js +102 -0
  40. package/dist/config.js.map +1 -0
  41. package/dist/control-plane/client-transport.js +146 -0
  42. package/dist/control-plane/client-transport.js.map +1 -0
  43. package/dist/control-plane/data-access.js +99 -0
  44. package/dist/control-plane/data-access.js.map +1 -0
  45. package/dist/control-plane/definitions.js +120 -0
  46. package/dist/control-plane/definitions.js.map +1 -0
  47. package/dist/control-plane/errors.js +13 -0
  48. package/dist/control-plane/errors.js.map +1 -0
  49. package/dist/control-plane/inbox.js +261 -0
  50. package/dist/control-plane/inbox.js.map +1 -0
  51. package/dist/control-plane/index.js +6 -0
  52. package/dist/control-plane/index.js.map +1 -0
  53. package/dist/control-plane/json-fields.js +68 -0
  54. package/dist/control-plane/json-fields.js.map +1 -0
  55. package/dist/control-plane/resolve-cwd.js +75 -0
  56. package/dist/control-plane/resolve-cwd.js.map +1 -0
  57. package/dist/control-plane/steps.js +381 -0
  58. package/dist/control-plane/steps.js.map +1 -0
  59. package/dist/control-plane/tables.js +13 -0
  60. package/dist/control-plane/tables.js.map +1 -0
  61. package/dist/control-plane/versioned-meaning.js +53 -0
  62. package/dist/control-plane/versioned-meaning.js.map +1 -0
  63. package/dist/engine/dbos.module.js +18 -0
  64. package/dist/engine/dbos.module.js.map +1 -0
  65. package/dist/engine/dbos.service.js +296 -0
  66. package/dist/engine/dbos.service.js.map +1 -0
  67. package/dist/engine/ensure-postgres.js +80 -0
  68. package/dist/engine/ensure-postgres.js.map +1 -0
  69. package/dist/engine/types.js +2 -0
  70. package/dist/engine/types.js.map +1 -0
  71. package/dist/host/ensure-revisium.js +269 -0
  72. package/dist/host/ensure-revisium.js.map +1 -0
  73. package/dist/host/host.lifecycle.js +75 -0
  74. package/dist/host/host.lifecycle.js.map +1 -0
  75. package/dist/mcp/mcp-capabilities.js +47 -0
  76. package/dist/mcp/mcp-capabilities.js.map +1 -0
  77. package/dist/mcp/mcp-facade.service.js +130 -0
  78. package/dist/mcp/mcp-facade.service.js.map +1 -0
  79. package/dist/mcp/mcp-stdio.service.js +48 -0
  80. package/dist/mcp/mcp-stdio.service.js.map +1 -0
  81. package/dist/mcp/mcp-tools.js +264 -0
  82. package/dist/mcp/mcp-tools.js.map +1 -0
  83. package/dist/mcp/mcp.module.js +21 -0
  84. package/dist/mcp/mcp.module.js.map +1 -0
  85. package/dist/package-info.js +10 -0
  86. package/dist/package-info.js.map +1 -0
  87. package/dist/pipeline/await-human.js +62 -0
  88. package/dist/pipeline/await-human.js.map +1 -0
  89. package/dist/pipeline/develop-task.workflow.js +497 -0
  90. package/dist/pipeline/develop-task.workflow.js.map +1 -0
  91. package/dist/pipeline/pipeline.module.js +34 -0
  92. package/dist/pipeline/pipeline.module.js.map +1 -0
  93. package/dist/playbook/catalog-loader.js +145 -0
  94. package/dist/playbook/catalog-loader.js.map +1 -0
  95. package/dist/playbook/errors.js +14 -0
  96. package/dist/playbook/errors.js.map +1 -0
  97. package/dist/playbook/import-mapper.js +186 -0
  98. package/dist/playbook/import-mapper.js.map +1 -0
  99. package/dist/playbook/manifest.js +60 -0
  100. package/dist/playbook/manifest.js.map +1 -0
  101. package/dist/playbook/playbook-installer.js +51 -0
  102. package/dist/playbook/playbook-installer.js.map +1 -0
  103. package/dist/playbook/prompt-composer.js +34 -0
  104. package/dist/playbook/prompt-composer.js.map +1 -0
  105. package/dist/playbook/source-resolver.js +105 -0
  106. package/dist/playbook/source-resolver.js.map +1 -0
  107. package/dist/poller/pr-readiness-core.js +656 -0
  108. package/dist/poller/pr-readiness-core.js.map +1 -0
  109. package/dist/poller/pr-readiness.js +91 -0
  110. package/dist/poller/pr-readiness.js.map +1 -0
  111. package/dist/revisium/inbox.service.js +67 -0
  112. package/dist/revisium/inbox.service.js.map +1 -0
  113. package/dist/revisium/playbooks.service.js +99 -0
  114. package/dist/revisium/playbooks.service.js.map +1 -0
  115. package/dist/revisium/revisium.module.js +55 -0
  116. package/dist/revisium/revisium.module.js.map +1 -0
  117. package/dist/revisium/roles.service.js +79 -0
  118. package/dist/revisium/roles.service.js.map +1 -0
  119. package/dist/revisium/run.service.js +182 -0
  120. package/dist/revisium/run.service.js.map +1 -0
  121. package/dist/revisium/tokens.js +7 -0
  122. package/dist/revisium/tokens.js.map +1 -0
  123. package/dist/run/append-event.js +112 -0
  124. package/dist/run/append-event.js.map +1 -0
  125. package/dist/run/cancel-run.js +47 -0
  126. package/dist/run/cancel-run.js.map +1 -0
  127. package/dist/run/create-run.js +208 -0
  128. package/dist/run/create-run.js.map +1 -0
  129. package/dist/run/fail-run.js +20 -0
  130. package/dist/run/fail-run.js.map +1 -0
  131. package/dist/run/inspect-run.js +287 -0
  132. package/dist/run/inspect-run.js.map +1 -0
  133. package/dist/run/terminal-run-status.js +45 -0
  134. package/dist/run/terminal-run-status.js.map +1 -0
  135. package/dist/runners/claude-code.service.js +48 -0
  136. package/dist/runners/claude-code.service.js.map +1 -0
  137. package/dist/runners/gh-identity.js +108 -0
  138. package/dist/runners/gh-identity.js.map +1 -0
  139. package/dist/runners/integrator.js +417 -0
  140. package/dist/runners/integrator.js.map +1 -0
  141. package/dist/runners/runner.module.js +40 -0
  142. package/dist/runners/runner.module.js.map +1 -0
  143. package/dist/runners/tokens.js +7 -0
  144. package/dist/runners/tokens.js.map +1 -0
  145. package/dist/task-control-plane/pr-readiness.service.js +33 -0
  146. package/dist/task-control-plane/pr-readiness.service.js.map +1 -0
  147. package/dist/task-control-plane/task-control-plane-api.service.js +440 -0
  148. package/dist/task-control-plane/task-control-plane-api.service.js.map +1 -0
  149. package/dist/task-control-plane/task-control-plane.module.js +23 -0
  150. package/dist/task-control-plane/task-control-plane.module.js.map +1 -0
  151. package/dist/worker/build-context.js +39 -0
  152. package/dist/worker/build-context.js.map +1 -0
  153. package/dist/worker/claude-code-runner.js +135 -0
  154. package/dist/worker/claude-code-runner.js.map +1 -0
  155. package/dist/worker/git-worktree-manager.js +84 -0
  156. package/dist/worker/git-worktree-manager.js.map +1 -0
  157. package/dist/worker/loop.js +122 -0
  158. package/dist/worker/loop.js.map +1 -0
  159. package/dist/worker/process-executor.js +62 -0
  160. package/dist/worker/process-executor.js.map +1 -0
  161. package/dist/worker/result-envelope.js +134 -0
  162. package/dist/worker/result-envelope.js.map +1 -0
  163. package/dist/worker/runner-dispatch.js +20 -0
  164. package/dist/worker/runner-dispatch.js.map +1 -0
  165. package/dist/worker/runner.js +2 -0
  166. package/dist/worker/runner.js.map +1 -0
  167. package/dist/worker/script-runner.js +28 -0
  168. package/dist/worker/script-runner.js.map +1 -0
  169. package/dist/worker/stub-runner.js +59 -0
  170. package/dist/worker/stub-runner.js.map +1 -0
  171. package/dist/worker/worker-id.js +18 -0
  172. package/dist/worker/worker-id.js.map +1 -0
  173. package/dist/worker/worktree-manager.js +7 -0
  174. package/dist/worker/worktree-manager.js.map +1 -0
  175. package/package.json +66 -0
  176. package/revisium.config.json +10 -0
@@ -0,0 +1,931 @@
1
+ {
2
+ "projectName": "control-plane",
3
+ "branchName": "master",
4
+ "endpoints": [
5
+ "REST_API"
6
+ ],
7
+ "tables": [
8
+ {
9
+ "id": "task_runs",
10
+ "schema": {
11
+ "type": "object",
12
+ "additionalProperties": false,
13
+ "properties": {
14
+ "id": {
15
+ "type": "string",
16
+ "default": ""
17
+ },
18
+ "project_id": {
19
+ "type": "string",
20
+ "default": ""
21
+ },
22
+ "title": {
23
+ "type": "string",
24
+ "default": ""
25
+ },
26
+ "description": {
27
+ "type": "string",
28
+ "default": ""
29
+ },
30
+ "status": {
31
+ "type": "string",
32
+ "default": "pending",
33
+ "description": "pending|planning|ready|running|completed|failed|awaiting_approval|paused|cancelled"
34
+ },
35
+ "repos": {
36
+ "type": "array",
37
+ "items": {
38
+ "type": "string",
39
+ "default": ""
40
+ }
41
+ },
42
+ "scope": {
43
+ "type": "string",
44
+ "default": ""
45
+ },
46
+ "priority": {
47
+ "type": "number",
48
+ "default": 0
49
+ },
50
+ "created_by": {
51
+ "type": "string",
52
+ "default": ""
53
+ },
54
+ "created_at": {
55
+ "type": "string",
56
+ "default": ""
57
+ },
58
+ "updated_at": {
59
+ "type": "string",
60
+ "default": ""
61
+ }
62
+ },
63
+ "required": []
64
+ }
65
+ },
66
+ {
67
+ "id": "tasks",
68
+ "schema": {
69
+ "type": "object",
70
+ "additionalProperties": false,
71
+ "properties": {
72
+ "id": {
73
+ "type": "string",
74
+ "default": ""
75
+ },
76
+ "run_id": {
77
+ "type": "string",
78
+ "default": ""
79
+ },
80
+ "repo_ref": {
81
+ "type": "string",
82
+ "default": ""
83
+ },
84
+ "role_hint": {
85
+ "type": "string",
86
+ "default": ""
87
+ },
88
+ "title": {
89
+ "type": "string",
90
+ "default": ""
91
+ },
92
+ "status": {
93
+ "type": "string",
94
+ "default": "pending"
95
+ },
96
+ "depends_on": {
97
+ "type": "array",
98
+ "items": {
99
+ "type": "string",
100
+ "default": ""
101
+ }
102
+ },
103
+ "scope": {
104
+ "type": "string",
105
+ "default": ""
106
+ },
107
+ "priority": {
108
+ "type": "number",
109
+ "default": 0
110
+ },
111
+ "created_at": {
112
+ "type": "string",
113
+ "default": ""
114
+ },
115
+ "updated_at": {
116
+ "type": "string",
117
+ "default": ""
118
+ }
119
+ },
120
+ "required": []
121
+ }
122
+ },
123
+ {
124
+ "id": "steps",
125
+ "schema": {
126
+ "type": "object",
127
+ "additionalProperties": false,
128
+ "properties": {
129
+ "id": {
130
+ "type": "string",
131
+ "default": ""
132
+ },
133
+ "task_id": {
134
+ "type": "string",
135
+ "default": ""
136
+ },
137
+ "run_id": {
138
+ "type": "string",
139
+ "default": ""
140
+ },
141
+ "role": {
142
+ "type": "string",
143
+ "default": ""
144
+ },
145
+ "kind": {
146
+ "type": "string",
147
+ "default": ""
148
+ },
149
+ "status": {
150
+ "type": "string",
151
+ "default": "pending",
152
+ "description": "pending|ready|claimed|running|succeeded|failed|dead|awaiting_approval|skipped"
153
+ },
154
+ "input": {
155
+ "type": "string",
156
+ "default": "",
157
+ "description": "Serialized JSON"
158
+ },
159
+ "output": {
160
+ "type": "string",
161
+ "default": "",
162
+ "description": "Serialized JSON"
163
+ },
164
+ "model_profile": {
165
+ "type": "string",
166
+ "default": ""
167
+ },
168
+ "run_after": {
169
+ "type": "string",
170
+ "default": ""
171
+ },
172
+ "attempt_count": {
173
+ "type": "number",
174
+ "default": 0
175
+ },
176
+ "max_attempts": {
177
+ "type": "number",
178
+ "default": 3
179
+ },
180
+ "priority": {
181
+ "type": "number",
182
+ "default": 0
183
+ },
184
+ "depends_on": {
185
+ "type": "array",
186
+ "items": {
187
+ "type": "string",
188
+ "default": ""
189
+ }
190
+ },
191
+ "lease_owner": {
192
+ "type": "string",
193
+ "default": ""
194
+ },
195
+ "lease_expires_at": {
196
+ "type": "string",
197
+ "default": ""
198
+ },
199
+ "dead_reason": {
200
+ "type": "string",
201
+ "default": ""
202
+ },
203
+ "created_at": {
204
+ "type": "string",
205
+ "default": ""
206
+ },
207
+ "updated_at": {
208
+ "type": "string",
209
+ "default": ""
210
+ }
211
+ },
212
+ "required": []
213
+ }
214
+ },
215
+ {
216
+ "id": "attempts",
217
+ "schema": {
218
+ "type": "object",
219
+ "additionalProperties": false,
220
+ "properties": {
221
+ "id": {
222
+ "type": "string",
223
+ "default": ""
224
+ },
225
+ "step_id": {
226
+ "type": "string",
227
+ "default": ""
228
+ },
229
+ "run_id": {
230
+ "type": "string",
231
+ "default": ""
232
+ },
233
+ "worker_id": {
234
+ "type": "string",
235
+ "default": ""
236
+ },
237
+ "attempt_no": {
238
+ "type": "number",
239
+ "default": 0
240
+ },
241
+ "iteration": {
242
+ "type": "number",
243
+ "default": 0,
244
+ "description": "developer/reviewer rework iteration (0 = first pass)"
245
+ },
246
+ "status": {
247
+ "type": "string",
248
+ "default": ""
249
+ },
250
+ "idempotency_key": {
251
+ "type": "string",
252
+ "default": ""
253
+ },
254
+ "model_profile": {
255
+ "type": "string",
256
+ "default": ""
257
+ },
258
+ "verdict": {
259
+ "type": "string",
260
+ "default": "",
261
+ "description": "extracted reviewer/agent verdict (PASS|MINOR|MAJOR|BLOCKER|…)"
262
+ },
263
+ "input_tokens": {
264
+ "type": "number",
265
+ "default": 0
266
+ },
267
+ "output_tokens": {
268
+ "type": "number",
269
+ "default": 0
270
+ },
271
+ "cost_amount": {
272
+ "type": "number",
273
+ "default": 0
274
+ },
275
+ "currency": {
276
+ "type": "string",
277
+ "default": "USD"
278
+ },
279
+ "duration_ms": {
280
+ "type": "number",
281
+ "default": 0
282
+ },
283
+ "output_summary": {
284
+ "type": "string",
285
+ "default": "",
286
+ "description": "Serialized JSON, secret-redacted, capped"
287
+ },
288
+ "lesson": {
289
+ "type": "string",
290
+ "default": ""
291
+ },
292
+ "error": {
293
+ "type": "string",
294
+ "default": ""
295
+ },
296
+ "started_at": {
297
+ "type": "string",
298
+ "default": ""
299
+ },
300
+ "finished_at": {
301
+ "type": "string",
302
+ "default": ""
303
+ }
304
+ },
305
+ "required": []
306
+ }
307
+ },
308
+ {
309
+ "id": "events",
310
+ "schema": {
311
+ "type": "object",
312
+ "additionalProperties": false,
313
+ "properties": {
314
+ "id": {
315
+ "type": "string",
316
+ "default": ""
317
+ },
318
+ "run_id": {
319
+ "type": "string",
320
+ "default": ""
321
+ },
322
+ "task_id": {
323
+ "type": "string",
324
+ "default": ""
325
+ },
326
+ "step_id": {
327
+ "type": "string",
328
+ "default": ""
329
+ },
330
+ "type": {
331
+ "type": "string",
332
+ "default": ""
333
+ },
334
+ "payload": {
335
+ "type": "string",
336
+ "default": "",
337
+ "description": "Serialized JSON"
338
+ },
339
+ "actor": {
340
+ "type": "string",
341
+ "default": ""
342
+ },
343
+ "created_at": {
344
+ "type": "string",
345
+ "default": ""
346
+ }
347
+ },
348
+ "required": []
349
+ }
350
+ },
351
+ {
352
+ "id": "inbox",
353
+ "schema": {
354
+ "type": "object",
355
+ "additionalProperties": false,
356
+ "properties": {
357
+ "id": {
358
+ "type": "string",
359
+ "default": ""
360
+ },
361
+ "kind": {
362
+ "type": "string",
363
+ "default": "",
364
+ "description": "approval|question|alert"
365
+ },
366
+ "run_id": {
367
+ "type": "string",
368
+ "default": ""
369
+ },
370
+ "task_id": {
371
+ "type": "string",
372
+ "default": ""
373
+ },
374
+ "step_id": {
375
+ "type": "string",
376
+ "default": ""
377
+ },
378
+ "project_id": {
379
+ "type": "string",
380
+ "default": ""
381
+ },
382
+ "title": {
383
+ "type": "string",
384
+ "default": ""
385
+ },
386
+ "context": {
387
+ "type": "string",
388
+ "default": "",
389
+ "description": "Serialized JSON"
390
+ },
391
+ "options": {
392
+ "type": "array",
393
+ "items": {
394
+ "type": "string",
395
+ "default": ""
396
+ }
397
+ },
398
+ "status": {
399
+ "type": "string",
400
+ "default": "pending",
401
+ "description": "pending|resolved"
402
+ },
403
+ "answer": {
404
+ "type": "string",
405
+ "default": "",
406
+ "description": "Serialized JSON"
407
+ },
408
+ "resolved_by": {
409
+ "type": "string",
410
+ "default": ""
411
+ },
412
+ "created_at": {
413
+ "type": "string",
414
+ "default": ""
415
+ },
416
+ "resolved_at": {
417
+ "type": "string",
418
+ "default": ""
419
+ }
420
+ },
421
+ "required": []
422
+ }
423
+ },
424
+ {
425
+ "id": "roles",
426
+ "schema": {
427
+ "type": "object",
428
+ "additionalProperties": false,
429
+ "properties": {
430
+ "id": {
431
+ "type": "string",
432
+ "default": ""
433
+ },
434
+ "name": {
435
+ "type": "string",
436
+ "default": "",
437
+ "description": "architect|developer|reviewer|integrator|ci-poller|pr-watcher"
438
+ },
439
+ "system_prompt": {
440
+ "type": "string",
441
+ "default": ""
442
+ },
443
+ "model_level": {
444
+ "type": "string",
445
+ "default": "standard",
446
+ "description": "cheap|standard|deep"
447
+ },
448
+ "effort": {
449
+ "type": "string",
450
+ "default": ""
451
+ },
452
+ "runner": {
453
+ "type": "string",
454
+ "default": "claude-code",
455
+ "description": "claude-code|codex|script"
456
+ },
457
+ "allowed_tools": {
458
+ "type": "array",
459
+ "items": {
460
+ "type": "string",
461
+ "default": ""
462
+ }
463
+ },
464
+ "scope_rules": {
465
+ "type": "string",
466
+ "default": "",
467
+ "description": "Serialized JSON"
468
+ },
469
+ "playbook_id": {
470
+ "type": "string",
471
+ "default": "",
472
+ "description": "Installed playbook row id that supplied this role"
473
+ },
474
+ "playbook_role_id": {
475
+ "type": "string",
476
+ "default": "",
477
+ "description": "Original role id inside the installed playbook"
478
+ },
479
+ "source_path": {
480
+ "type": "string",
481
+ "default": "",
482
+ "description": "Role source path inside the installed playbook"
483
+ },
484
+ "source_hash": {
485
+ "type": "string",
486
+ "default": "",
487
+ "description": "Hash of the installed prompt source"
488
+ },
489
+ "surface": {
490
+ "type": "string",
491
+ "default": "",
492
+ "description": "Playbook role surface"
493
+ },
494
+ "rights": {
495
+ "type": "string",
496
+ "default": "",
497
+ "description": "Playbook role rights"
498
+ },
499
+ "timeout_ms": {
500
+ "type": "number",
501
+ "default": 0,
502
+ "description": "per-role agent timeout; 0 = use runner default (0008 #5)"
503
+ },
504
+ "permission_mode": {
505
+ "type": "string",
506
+ "default": "",
507
+ "description": "claude --permission-mode; '' = default (0008 #5)"
508
+ },
509
+ "updated_at": {
510
+ "type": "string",
511
+ "default": ""
512
+ }
513
+ },
514
+ "required": []
515
+ }
516
+ },
517
+ {
518
+ "id": "playbooks",
519
+ "schema": {
520
+ "type": "object",
521
+ "additionalProperties": false,
522
+ "properties": {
523
+ "id": {
524
+ "type": "string",
525
+ "default": ""
526
+ },
527
+ "name": {
528
+ "type": "string",
529
+ "default": ""
530
+ },
531
+ "package_name": {
532
+ "type": "string",
533
+ "default": ""
534
+ },
535
+ "source": {
536
+ "type": "string",
537
+ "default": ""
538
+ },
539
+ "version": {
540
+ "type": "string",
541
+ "default": ""
542
+ },
543
+ "schema_version": {
544
+ "type": "number",
545
+ "default": 0
546
+ },
547
+ "manifest_path": {
548
+ "type": "string",
549
+ "default": ""
550
+ },
551
+ "roles_catalog_path": {
552
+ "type": "string",
553
+ "default": ""
554
+ },
555
+ "pipelines_catalog_path": {
556
+ "type": "string",
557
+ "default": ""
558
+ },
559
+ "catalog_hash": {
560
+ "type": "string",
561
+ "default": ""
562
+ },
563
+ "installed_at": {
564
+ "type": "string",
565
+ "default": ""
566
+ },
567
+ "updated_at": {
568
+ "type": "string",
569
+ "default": ""
570
+ }
571
+ },
572
+ "required": []
573
+ }
574
+ },
575
+ {
576
+ "id": "pipelines",
577
+ "schema": {
578
+ "type": "object",
579
+ "additionalProperties": false,
580
+ "properties": {
581
+ "id": {
582
+ "type": "string",
583
+ "default": ""
584
+ },
585
+ "playbook_id": {
586
+ "type": "string",
587
+ "default": ""
588
+ },
589
+ "pipeline_id": {
590
+ "type": "string",
591
+ "default": ""
592
+ },
593
+ "path": {
594
+ "type": "string",
595
+ "default": ""
596
+ },
597
+ "triggers": {
598
+ "type": "array",
599
+ "items": {
600
+ "type": "string",
601
+ "default": ""
602
+ }
603
+ },
604
+ "required_roles": {
605
+ "type": "array",
606
+ "items": {
607
+ "type": "string",
608
+ "default": ""
609
+ }
610
+ },
611
+ "alternative_roles_json": {
612
+ "type": "string",
613
+ "default": "",
614
+ "description": "Serialized JSON"
615
+ },
616
+ "optional_roles": {
617
+ "type": "array",
618
+ "items": {
619
+ "type": "string",
620
+ "default": ""
621
+ }
622
+ },
623
+ "route_gates": {
624
+ "type": "array",
625
+ "items": {
626
+ "type": "string",
627
+ "default": ""
628
+ }
629
+ },
630
+ "platform_invocation": {
631
+ "type": "string",
632
+ "default": ""
633
+ },
634
+ "execution_policy_json": {
635
+ "type": "string",
636
+ "default": "",
637
+ "description": "Serialized JSON"
638
+ },
639
+ "updated_at": {
640
+ "type": "string",
641
+ "default": ""
642
+ }
643
+ },
644
+ "required": []
645
+ }
646
+ },
647
+ {
648
+ "id": "model_profiles",
649
+ "schema": {
650
+ "type": "object",
651
+ "additionalProperties": false,
652
+ "properties": {
653
+ "id": {
654
+ "type": "string",
655
+ "default": ""
656
+ },
657
+ "level": {
658
+ "type": "string",
659
+ "default": "",
660
+ "description": "cheap|standard|deep"
661
+ },
662
+ "provider": {
663
+ "type": "string",
664
+ "default": ""
665
+ },
666
+ "model_id": {
667
+ "type": "string",
668
+ "default": ""
669
+ },
670
+ "params": {
671
+ "type": "string",
672
+ "default": "",
673
+ "description": "Serialized JSON"
674
+ },
675
+ "cost_per_input": {
676
+ "type": "number",
677
+ "default": 0
678
+ },
679
+ "cost_per_output": {
680
+ "type": "number",
681
+ "default": 0
682
+ },
683
+ "updated_at": {
684
+ "type": "string",
685
+ "default": ""
686
+ }
687
+ },
688
+ "required": []
689
+ }
690
+ },
691
+ {
692
+ "id": "routing_policy",
693
+ "schema": {
694
+ "type": "object",
695
+ "additionalProperties": false,
696
+ "properties": {
697
+ "id": {
698
+ "type": "string",
699
+ "default": ""
700
+ },
701
+ "rule": {
702
+ "type": "string",
703
+ "default": "",
704
+ "description": "Serialized JSON"
705
+ },
706
+ "model_level": {
707
+ "type": "string",
708
+ "default": "standard"
709
+ },
710
+ "requires_human": {
711
+ "type": "boolean",
712
+ "default": false
713
+ },
714
+ "updated_at": {
715
+ "type": "string",
716
+ "default": ""
717
+ }
718
+ },
719
+ "required": []
720
+ }
721
+ },
722
+ {
723
+ "id": "cost_ledger",
724
+ "schema": {
725
+ "type": "object",
726
+ "additionalProperties": false,
727
+ "properties": {
728
+ "id": {
729
+ "type": "string",
730
+ "default": ""
731
+ },
732
+ "run_id": {
733
+ "type": "string",
734
+ "default": ""
735
+ },
736
+ "step_id": {
737
+ "type": "string",
738
+ "default": ""
739
+ },
740
+ "attempt_id": {
741
+ "type": "string",
742
+ "default": ""
743
+ },
744
+ "model_profile": {
745
+ "type": "string",
746
+ "default": ""
747
+ },
748
+ "input_tokens": {
749
+ "type": "number",
750
+ "default": 0
751
+ },
752
+ "output_tokens": {
753
+ "type": "number",
754
+ "default": 0
755
+ },
756
+ "cost_amount": {
757
+ "type": "number",
758
+ "default": 0
759
+ },
760
+ "currency": {
761
+ "type": "string",
762
+ "default": "USD"
763
+ },
764
+ "recorded_at": {
765
+ "type": "string",
766
+ "default": ""
767
+ }
768
+ },
769
+ "required": []
770
+ }
771
+ }
772
+ ],
773
+ "rows": [
774
+ {
775
+ "tableId": "roles",
776
+ "rowId": "architect",
777
+ "data": {
778
+ "id": "architect",
779
+ "name": "architect",
780
+ "system_prompt": "You are the Architect agent in an autonomous dev loop. Read the task and provided context, then produce ONE executable, step-by-step plan (numbered steps, each with exact files, a Verify command, and stop conditions) like the repo's docs/plans/*. Ground every step in files you have ACTUALLY opened this session — quote the current line verbatim and re-open or grep the file to confirm a line number before citing it; NEVER cite a remembered or assumed line/content. BEFORE planning, check whether the feature ALREADY EXISTS (grep the codebase for it); if it is already implemented, do NOT invent a plan for a non-problem — set needsHuman true with output saying it already exists, and nextSteps []. Keep the slice small and single-concern; list out-of-scope items as later plans. Do NOT write implementation code, and do NOT change architecture or ADRs on your own initiative. In your result: set output to a short summary, write the plan to docs/plans/ and put its path in artifacts, and set nextSteps to exactly one developer step (role 'developer', kind 'implement', input referencing the plan path). If the task is ambiguous or needs an architectural decision, set needsHuman true and nextSteps [].",
781
+ "model_level": "deep",
782
+ "effort": "high",
783
+ "runner": "claude-code",
784
+ "allowed_tools": ["Read", "Grep", "Glob", "Write"],
785
+ "scope_rules": "{}",
786
+ "timeout_ms": 1200000,
787
+ "permission_mode": "default",
788
+ "updated_at": "2026-06-11T00:00:00.000Z"
789
+ }
790
+ },
791
+ {
792
+ "tableId": "roles",
793
+ "rowId": "developer",
794
+ "data": {
795
+ "id": "developer",
796
+ "name": "developer",
797
+ "system_prompt": "You are the Developer agent in an autonomous dev loop. Implement the plan from the provided context. Make the smallest correct change; write REAL behavior tests (never existence checks); NEVER use eslint-disable or NOSONAR — fix the code. Run the repo's gates (typecheck, lint:ci, test) and only finish when all pass. Do NOT change architecture or ADRs without explicit approval. Do NOT git commit, push, or create PRs — leave your changes UNCOMMITTED in the working tree; committing and opening the PR is the integrator's job (your Bash access is for running gates like npm typecheck/lint/test, NOT for git/gh). Before finishing, re-scan your own diff for the gate-blocking classes (unnecessary casts, unused imports, object stringification, multiple pushes, nested ternary) and apply lint fixes to ALL new code including any test helper you add. When your step kind is 'implement', your change MUST produce a NON-EMPTY diff — run `git status` / `git diff` and CONFIRM files actually changed before finishing; a 'succeeded' with no file change is a FAILURE, not success (gates passing on unchanged code proves nothing). If the work is ALREADY DONE (the feature/fix already exists in the code), do NOT silently succeed — set needsHuman true with output explaining it is already implemented, and nextSteps []. In your result: set output to what you implemented, the validation results, and confirmation the diff is non-empty; set nextSteps to exactly one reviewer step (role 'reviewer', kind 'review'). If blocked, set needsHuman true and nextSteps [].",
798
+ "model_level": "standard",
799
+ "effort": "high",
800
+ "runner": "claude-code",
801
+ "allowed_tools": ["Read", "Edit", "Write", "Bash", "Grep", "Glob"],
802
+ "scope_rules": "{}",
803
+ "timeout_ms": 900000,
804
+ "permission_mode": "default",
805
+ "updated_at": "2026-06-11T00:00:00.000Z"
806
+ }
807
+ },
808
+ {
809
+ "tableId": "roles",
810
+ "rowId": "reviewer",
811
+ "data": {
812
+ "id": "reviewer",
813
+ "name": "reviewer",
814
+ "system_prompt": "You are the Reviewer agent in an autonomous dev loop. Review the change against its plan and the project's invariants — make NO code changes, and do NOT commit/push/create PRs (your Bash access is for running gates only). Read the changed and new files in full (not just the diff), verify each plan step, and run the gates (typecheck, lint:ci, test). Calibrate severity to what the CI/Sonar bots actually block: treat data-completeness under a cap/limit, a verb not persisting every field its semantics require (state-consistency), non-atomic check-then-act idempotency, and the gate-blocking SonarTS lint rules as MAJOR. Any fix you suggest must obey repo rules — never propose eslint-disable. If the step under review was kind 'implement' but produced an EMPTY diff (no files changed), that is a BLOCKER — REQUEST_CHANGES for vacuous success: gates passing on unchanged code is NOT done work. Confirm the change actually exists in the files, not merely that gates pass. In your result: set output to a structured verdict (APPROVE or REQUEST_CHANGES with findings as file:line). If REQUEST_CHANGES, set nextSteps to one developer step carrying the findings; if APPROVE, set nextSteps to one integrator step.",
815
+ "model_level": "standard",
816
+ "effort": "high",
817
+ "runner": "claude-code",
818
+ "allowed_tools": ["Read", "Grep", "Glob", "Bash"],
819
+ "scope_rules": "{}",
820
+ "timeout_ms": 600000,
821
+ "permission_mode": "default",
822
+ "updated_at": "2026-06-11T00:00:00.000Z"
823
+ }
824
+ },
825
+ {
826
+ "tableId": "roles",
827
+ "rowId": "integrator",
828
+ "data": {
829
+ "id": "integrator",
830
+ "name": "integrator",
831
+ "system_prompt": "[DEPRECATED] Integration is now deterministic code in src/runners/integrator.ts; this role is retired from the executed chain and is not dispatched. Kept only so `run create --role integrator` validates against KNOWN_ROLES.",
832
+ "model_level": "standard",
833
+ "effort": "high",
834
+ "runner": "script",
835
+ "allowed_tools": ["Read", "Bash"],
836
+ "scope_rules": "{}",
837
+ "timeout_ms": 0,
838
+ "permission_mode": "default",
839
+ "updated_at": "2026-06-08T00:00:00.000Z"
840
+ }
841
+ },
842
+ {
843
+ "tableId": "roles",
844
+ "rowId": "ci-poller",
845
+ "data": {
846
+ "id": "ci-poller",
847
+ "name": "ci-poller",
848
+ "system_prompt": "",
849
+ "model_level": "cheap",
850
+ "effort": "low",
851
+ "runner": "script",
852
+ "allowed_tools": [],
853
+ "scope_rules": "{}",
854
+ "timeout_ms": 0,
855
+ "permission_mode": "default",
856
+ "updated_at": "2026-06-04T00:00:00.000Z"
857
+ }
858
+ },
859
+ {
860
+ "tableId": "roles",
861
+ "rowId": "pr-watcher",
862
+ "data": {
863
+ "id": "pr-watcher",
864
+ "name": "pr-watcher",
865
+ "system_prompt": "You are the PR-Judge agent in an autonomous dev loop. You receive pre-gathered, structured findings: CI verdict (ci_passed), Sonar issues list (sonar_issues), Sonar security hotspots (sonar_hotspots_to_review), Sonar availability flag (sonar_unavailable), GitHub's authoritative review decision (reviewDecision — one of APPROVED, CHANGES_REQUESTED, REVIEW_REQUIRED, or '' when no review is required), the latest formal review per human reviewer (human_reviews — each entry carries a .state), and review/conversation comments (human_comments, bot_comments) gathered from BOTH the inline review threads AND the top-level PR conversation. Do NOT re-run gh api or re-check CI — the data is already collected. The AUTHORITATIVE human-review gate is reviewDecision: it is blocking when CHANGES_REQUESTED or REVIEW_REQUIRED, and satisfied when APPROVED or ''. Treat individual human_reviews entries as CONTEXT only — use them to understand who said what, NOT as the gate. Your job is to classify the free-text comments: decide which (if any) are blocking findings that require developer action. Zero-tolerance Sonar policy: the PR is NOT ready if sonar_issues is non-empty (ANY severity — BLOCKER through INFO) OR sonar_hotspots_to_review is non-empty. If either is non-empty, the verdict is NEEDS_WORK and you must carry those issues/hotspots (component, line, rule, message) as findings to the developer step. If sonar_unavailable is true, you CANNOT assert the PR is clean — do NOT declare READY; set needsHuman true with an output explaining Sonar could not be reached, and nextSteps []. Otherwise apply the full stopping criterion: READY only if ci_passed is true AND sonar_issues is empty AND sonar_hotspots_to_review is empty AND sonar_unavailable is not true AND reviewDecision is not blocking (neither CHANGES_REQUESTED nor REVIEW_REQUIRED) AND no human comment is a blocking request-for-change. In your result: set output to the merge verdict (READY or NEEDS_WORK). If NEEDS_WORK, set nextSteps to one developer step carrying only the blocking findings. If READY, set nextSteps [].",
866
+ "model_level": "cheap",
867
+ "effort": "low",
868
+ "runner": "claude-code",
869
+ "allowed_tools": ["Read", "Bash"],
870
+ "scope_rules": "{}",
871
+ "timeout_ms": 300000,
872
+ "permission_mode": "default",
873
+ "updated_at": "2026-06-05T00:00:00.000Z"
874
+ }
875
+ },
876
+ {
877
+ "tableId": "model_profiles",
878
+ "rowId": "standard",
879
+ "data": {
880
+ "id": "standard",
881
+ "level": "standard",
882
+ "provider": "anthropic",
883
+ "model_id": "claude-sonnet-4-6",
884
+ "params": "{}",
885
+ "cost_per_input": 3.0,
886
+ "cost_per_output": 15.0,
887
+ "updated_at": "2026-06-03T00:00:00.000Z"
888
+ }
889
+ },
890
+ {
891
+ "tableId": "model_profiles",
892
+ "rowId": "cheap",
893
+ "data": {
894
+ "id": "cheap",
895
+ "level": "cheap",
896
+ "provider": "anthropic",
897
+ "model_id": "claude-haiku-4-5-20251001",
898
+ "params": "{}",
899
+ "cost_per_input": 0.8,
900
+ "cost_per_output": 4.0,
901
+ "updated_at": "2026-06-03T00:00:00.000Z"
902
+ }
903
+ },
904
+ {
905
+ "tableId": "model_profiles",
906
+ "rowId": "deep",
907
+ "data": {
908
+ "id": "deep",
909
+ "level": "deep",
910
+ "provider": "anthropic",
911
+ "model_id": "claude-opus-4-8",
912
+ "params": "{}",
913
+ "cost_per_input": 15.0,
914
+ "cost_per_output": 75.0,
915
+ "updated_at": "2026-06-03T00:00:00.000Z"
916
+ }
917
+ },
918
+ {
919
+ "tableId": "routing_policy",
920
+ "rowId": "pipeline",
921
+ "data": {
922
+ "id": "pipeline",
923
+ "rule": "{\"max_review_iterations\":3,\"max_attempts\":3,\"budget_usd\":0,\"budget_tokens\":0}",
924
+ "model_level": "standard",
925
+ "requires_human": false,
926
+ "updated_at": "2026-06-11T00:00:00.000Z"
927
+ }
928
+ }
929
+ ],
930
+ "commitMessage": "Bootstrap control-plane schema and seed roles/model-profiles + pipeline policy (plan 0001+0007+0008)"
931
+ }