cohorte 2.10.1 → 3.0.0-dev.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.
Files changed (213) hide show
  1. package/README.md +7 -0
  2. package/assets/manifest.json +193 -0
  3. package/assets/migrations/config/README.md +12 -0
  4. package/assets/migrations/state/0001_init.sql +154 -0
  5. package/assets/prompts/README.md +11 -0
  6. package/assets/prompts/agents/fixer.md +7 -0
  7. package/assets/prompts/agents/implementer.md +12 -0
  8. package/assets/prompts/agents/reviewer.md +8 -0
  9. package/assets/prompts/agents/security-reviewer.md +7 -0
  10. package/assets/prompts/phases/build.md +5 -0
  11. package/assets/prompts/phases/review.md +5 -0
  12. package/assets/prompts/phases/test.md +5 -0
  13. package/assets/prompts/system.md +11 -0
  14. package/assets/schemas/agent-output.schema.json +225 -0
  15. package/assets/schemas/auth-status.schema.json +87 -0
  16. package/assets/schemas/command-result.schema.json +192 -0
  17. package/assets/schemas/commands.schema.json +952 -0
  18. package/assets/schemas/config.schema.json +2259 -0
  19. package/assets/schemas/doctor-report.schema.json +104 -0
  20. package/assets/schemas/events.schema.json +8514 -0
  21. package/assets/schemas/fake-script.schema.json +549 -0
  22. package/assets/schemas/inspect.schema.json +3133 -0
  23. package/assets/schemas/manifest.schema.json +79 -0
  24. package/assets/schemas/ownership.schema.json +52 -0
  25. package/assets/schemas/policy-verdict.schema.json +282 -0
  26. package/assets/schemas/project-model.schema.json +783 -0
  27. package/assets/schemas/project-status.schema.json +217 -0
  28. package/assets/schemas/reconcile-plan.schema.json +154 -0
  29. package/assets/schemas/run-diff.schema.json +177 -0
  30. package/assets/schemas/run-snapshot-manifest.schema.json +2104 -0
  31. package/assets/schemas/run-state.schema.json +1755 -0
  32. package/assets/schemas/runtime-capabilities.schema.json +1545 -0
  33. package/assets/schemas/sandbox-capabilities.schema.json +116 -0
  34. package/assets/schemas/skill.schema.json +87 -0
  35. package/assets/schemas/spec.schema.json +202 -0
  36. package/assets/schemas/tool-catalogue.schema.json +655 -0
  37. package/assets/schemas/trust-record.schema.json +38 -0
  38. package/assets/skills/README.md +9 -0
  39. package/assets/skills/inspect-surface.md +4 -0
  40. package/dist/agent-host.mjs +2187 -0
  41. package/dist/agent-host.mjs.map +1 -0
  42. package/dist/bundle-manifest.json +104 -0
  43. package/dist/chunks/__host-DgGPyco9.mjs +18 -0
  44. package/dist/chunks/__host-DgGPyco9.mjs.map +1 -0
  45. package/dist/chunks/approve-Cv135UqI.mjs +19 -0
  46. package/dist/chunks/approve-Cv135UqI.mjs.map +1 -0
  47. package/dist/chunks/auth-BT5oVp76.mjs +132 -0
  48. package/dist/chunks/auth-BT5oVp76.mjs.map +1 -0
  49. package/dist/chunks/auth-CYOh60KG.mjs +93 -0
  50. package/dist/chunks/auth-CYOh60KG.mjs.map +1 -0
  51. package/dist/chunks/brainstorm-BwKA6yZP.mjs +7 -0
  52. package/dist/chunks/brainstorm-BwKA6yZP.mjs.map +1 -0
  53. package/dist/chunks/cancel-KV_cpsqS.mjs +15 -0
  54. package/dist/chunks/cancel-KV_cpsqS.mjs.map +1 -0
  55. package/dist/chunks/canonical-C8UxeEmB.mjs +57 -0
  56. package/dist/chunks/canonical-C8UxeEmB.mjs.map +1 -0
  57. package/dist/chunks/catalogue-BvwSrM_j.mjs +1549 -0
  58. package/dist/chunks/catalogue-BvwSrM_j.mjs.map +1 -0
  59. package/dist/chunks/compose-Dvxunpto.mjs +7307 -0
  60. package/dist/chunks/compose-Dvxunpto.mjs.map +1 -0
  61. package/dist/chunks/config-DefHA2Lw.mjs +96 -0
  62. package/dist/chunks/config-DefHA2Lw.mjs.map +1 -0
  63. package/dist/chunks/contract-BkMjU1kR.mjs +295 -0
  64. package/dist/chunks/contract-BkMjU1kR.mjs.map +1 -0
  65. package/dist/chunks/contract-bQ9FJl4N.mjs +123 -0
  66. package/dist/chunks/contract-bQ9FJl4N.mjs.map +1 -0
  67. package/dist/chunks/deny-ClTxSvHJ.mjs +15 -0
  68. package/dist/chunks/deny-ClTxSvHJ.mjs.map +1 -0
  69. package/dist/chunks/diff-Qw0II0sj.mjs +101 -0
  70. package/dist/chunks/diff-Qw0II0sj.mjs.map +1 -0
  71. package/dist/chunks/discover-eS01-me1.mjs +21 -0
  72. package/dist/chunks/discover-eS01-me1.mjs.map +1 -0
  73. package/dist/chunks/doctor-B-H2UK5e.mjs +222 -0
  74. package/dist/chunks/doctor-B-H2UK5e.mjs.map +1 -0
  75. package/dist/chunks/fix-D4Tj8RVA.mjs +18 -0
  76. package/dist/chunks/fix-D4Tj8RVA.mjs.map +1 -0
  77. package/dist/chunks/gc-BBXlBF5w.mjs +161 -0
  78. package/dist/chunks/gc-BBXlBF5w.mjs.map +1 -0
  79. package/dist/chunks/init-BUnzIkeE.mjs +63 -0
  80. package/dist/chunks/init-BUnzIkeE.mjs.map +1 -0
  81. package/dist/chunks/inspect-Buby4cQD.mjs +22 -0
  82. package/dist/chunks/inspect-Buby4cQD.mjs.map +1 -0
  83. package/dist/chunks/logs-Giq5sUau.mjs +25 -0
  84. package/dist/chunks/logs-Giq5sUau.mjs.map +1 -0
  85. package/dist/chunks/migrate-DybihKzZ.mjs +33 -0
  86. package/dist/chunks/migrate-DybihKzZ.mjs.map +1 -0
  87. package/dist/chunks/models-Btp6X2YZ.mjs +24 -0
  88. package/dist/chunks/models-Btp6X2YZ.mjs.map +1 -0
  89. package/dist/chunks/pause-BASBfKLO.mjs +16 -0
  90. package/dist/chunks/pause-BASBfKLO.mjs.map +1 -0
  91. package/dist/chunks/policy-DUIgzF3W.mjs +139 -0
  92. package/dist/chunks/policy-DUIgzF3W.mjs.map +1 -0
  93. package/dist/chunks/providers-Dx78imKj.mjs +19 -0
  94. package/dist/chunks/providers-Dx78imKj.mjs.map +1 -0
  95. package/dist/chunks/reconcile-Bhy3IIYo.mjs +50 -0
  96. package/dist/chunks/reconcile-Bhy3IIYo.mjs.map +1 -0
  97. package/dist/chunks/render-DyZr5Lgi.mjs +53 -0
  98. package/dist/chunks/render-DyZr5Lgi.mjs.map +1 -0
  99. package/dist/chunks/resume-GJQRb2Eb.mjs +15 -0
  100. package/dist/chunks/resume-GJQRb2Eb.mjs.map +1 -0
  101. package/dist/chunks/retry-CLrUem1H.mjs +15 -0
  102. package/dist/chunks/retry-CLrUem1H.mjs.map +1 -0
  103. package/dist/chunks/review-BDdjb6kB.mjs +17 -0
  104. package/dist/chunks/review-BDdjb6kB.mjs.map +1 -0
  105. package/dist/chunks/run-CgTWYlcd.mjs +82 -0
  106. package/dist/chunks/run-CgTWYlcd.mjs.map +1 -0
  107. package/dist/chunks/run-tool-C3rAv4XF.mjs +26 -0
  108. package/dist/chunks/run-tool-C3rAv4XF.mjs.map +1 -0
  109. package/dist/chunks/scan-8Gy_B6kI.mjs +122 -0
  110. package/dist/chunks/scan-8Gy_B6kI.mjs.map +1 -0
  111. package/dist/chunks/schema-C9QbUW4H.mjs +578 -0
  112. package/dist/chunks/schema-C9QbUW4H.mjs.map +1 -0
  113. package/dist/chunks/send-BdnJ85Nz.mjs +19 -0
  114. package/dist/chunks/send-BdnJ85Nz.mjs.map +1 -0
  115. package/dist/chunks/ship-DTuLGoaJ.mjs +19 -0
  116. package/dist/chunks/ship-DTuLGoaJ.mjs.map +1 -0
  117. package/dist/chunks/shutdown-BM92Iyv2.mjs +15 -0
  118. package/dist/chunks/shutdown-BM92Iyv2.mjs.map +1 -0
  119. package/dist/chunks/skip-DZG5kpcH.mjs +18 -0
  120. package/dist/chunks/skip-DZG5kpcH.mjs.map +1 -0
  121. package/dist/chunks/spec-Bq0P3jVh.mjs +20 -0
  122. package/dist/chunks/spec-Bq0P3jVh.mjs.map +1 -0
  123. package/dist/chunks/src-CId6kMsY.mjs +1689 -0
  124. package/dist/chunks/src-CId6kMsY.mjs.map +1 -0
  125. package/dist/chunks/src-CfAOde7C.mjs +5403 -0
  126. package/dist/chunks/src-CfAOde7C.mjs.map +1 -0
  127. package/dist/chunks/src-CmFjh4M0.mjs +928 -0
  128. package/dist/chunks/src-CmFjh4M0.mjs.map +1 -0
  129. package/dist/chunks/src-Cu3TxNob.mjs +783 -0
  130. package/dist/chunks/src-Cu3TxNob.mjs.map +1 -0
  131. package/dist/chunks/src-DcU4IXMe.mjs +117 -0
  132. package/dist/chunks/src-DcU4IXMe.mjs.map +1 -0
  133. package/dist/chunks/src-s7YRvk0t.mjs +2116 -0
  134. package/dist/chunks/src-s7YRvk0t.mjs.map +1 -0
  135. package/dist/chunks/status-SMjiOMYy.mjs +29 -0
  136. package/dist/chunks/status-SMjiOMYy.mjs.map +1 -0
  137. package/dist/chunks/tail-BuhT-2PH.mjs +25 -0
  138. package/dist/chunks/tail-BuhT-2PH.mjs.map +1 -0
  139. package/dist/chunks/update-BXIppsbi.mjs +16 -0
  140. package/dist/chunks/update-BXIppsbi.mjs.map +1 -0
  141. package/dist/cli.mjs +175 -0
  142. package/dist/cli.mjs.map +1 -0
  143. package/package.json +17 -32
  144. package/CHANGELOG.md +0 -1461
  145. package/bin/cli.js +0 -817
  146. package/bin/report.js +0 -141
  147. package/core/adapter/render.js +0 -415
  148. package/core/agents/implementer.template.md +0 -142
  149. package/core/agents/profile-reader.md +0 -50
  150. package/core/agents/release.md +0 -58
  151. package/core/agents/review.md +0 -179
  152. package/core/commands/cohorte-align-ds.md +0 -33
  153. package/core/commands/cohorte-audit.md +0 -58
  154. package/core/commands/cohorte-brainstorm.md +0 -70
  155. package/core/commands/cohorte-build.md +0 -219
  156. package/core/commands/cohorte-doctor.md +0 -194
  157. package/core/commands/cohorte-fix.md +0 -80
  158. package/core/commands/cohorte-fleet.md +0 -103
  159. package/core/commands/cohorte-init-pipeline.md +0 -31
  160. package/core/commands/cohorte-intake.md +0 -92
  161. package/core/commands/cohorte-patch.md +0 -118
  162. package/core/commands/cohorte-refactor.md +0 -59
  163. package/core/commands/cohorte-retro.md +0 -85
  164. package/core/commands/cohorte-review.md +0 -270
  165. package/core/commands/cohorte-ship.md +0 -122
  166. package/core/commands/cohorte-spec.md +0 -101
  167. package/core/commands/cohorte-update-pipeline.md +0 -165
  168. package/core/hooks/gate.py +0 -588
  169. package/core/runtimes/claude.json +0 -74
  170. package/core/runtimes/codex.json +0 -85
  171. package/core/runtimes/cursor.json +0 -76
  172. package/core/runtimes/gemini.json +0 -76
  173. package/core/runtimes/opencode.json +0 -73
  174. package/core/templates/agent-handoff.md +0 -34
  175. package/core/templates/brainstorm-return.md +0 -36
  176. package/core/templates/decisions.template.md +0 -42
  177. package/core/templates/design-brief.md +0 -44
  178. package/core/templates/patch.template.md +0 -86
  179. package/core/templates/pr-body.md +0 -25
  180. package/core/templates/review-feedback.md +0 -38
  181. package/core/templates/spec.template.md +0 -87
  182. package/core/templates/steps/init-pipeline/01-detect-stack.md +0 -44
  183. package/core/templates/steps/init-pipeline/02-interview-gaps.md +0 -55
  184. package/core/templates/steps/init-pipeline/03-draft-profile.md +0 -10
  185. package/core/templates/steps/init-pipeline/04-write-render.md +0 -145
  186. package/core/templates/steps/init-pipeline/05-report.md +0 -12
  187. package/core/workflows/audit.js +0 -240
  188. package/core/workflows/loop.js +0 -641
  189. package/core/workflows/refactor.js +0 -276
  190. package/core/workflows/review.js +0 -456
  191. package/install.ps1 +0 -103
  192. package/install.sh +0 -114
  193. package/lib/doctor.js +0 -534
  194. package/lib/runtime.js +0 -139
  195. package/lib/versions.js +0 -149
  196. package/lib/yaml.js +0 -129
  197. package/profile/PIPELINE.template.md +0 -259
  198. package/profile/SCHEMA.md +0 -735
  199. package/profile/cohorte.config.template.yaml +0 -43
  200. package/scripts/assert-gate-hook.mjs +0 -75
  201. package/scripts/kanban-move.sh +0 -313
  202. package/scripts/metrics/collect.mjs +0 -531
  203. package/scripts/metrics/prices.json +0 -42
  204. package/scripts/new-feature.sh.template +0 -98
  205. package/scripts/preflight.sh +0 -124
  206. package/scripts/remove-feature.sh.template +0 -56
  207. package/scripts/test-adapter.mjs +0 -437
  208. package/scripts/test-gate.mjs +0 -443
  209. package/scripts/test-kanban.mjs +0 -304
  210. package/scripts/test-lib.mjs +0 -356
  211. package/scripts/test-metrics.mjs +0 -156
  212. package/scripts/test-workflows.mjs +0 -758
  213. package/scripts/validate-core.mjs +0 -325
@@ -0,0 +1,1755 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://cohorte.dev/schemas/3/run-state.schema.json",
4
+ "title": "Cohorte run snapshot (status <run> --json, inspect snapshot, first stream line)",
5
+ "type": "object",
6
+ "required": [
7
+ "documentVersion",
8
+ "protocolVersion",
9
+ "cohorteVersion",
10
+ "generatedAt",
11
+ "lastSequence",
12
+ "run",
13
+ "phases",
14
+ "approvals",
15
+ "budgets",
16
+ "usage",
17
+ "locks",
18
+ "inDoubtEffects"
19
+ ],
20
+ "properties": {
21
+ "documentVersion": {
22
+ "type": "number",
23
+ "const": 1
24
+ },
25
+ "protocolVersion": {
26
+ "type": "string",
27
+ "const": "1.0"
28
+ },
29
+ "cohorteVersion": {
30
+ "type": "string"
31
+ },
32
+ "generatedAt": {
33
+ "type": "string",
34
+ "format": "date-time",
35
+ "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{3}Z$"
36
+ },
37
+ "lastSequence": {
38
+ "type": "integer",
39
+ "minimum": 0
40
+ },
41
+ "run": {
42
+ "type": "object",
43
+ "required": [
44
+ "runId",
45
+ "profile",
46
+ "title",
47
+ "spec",
48
+ "state",
49
+ "status",
50
+ "since",
51
+ "iteration",
52
+ "host",
53
+ "git",
54
+ "plan",
55
+ "snapshotDigest",
56
+ "startedAt"
57
+ ],
58
+ "properties": {
59
+ "runId": {
60
+ "type": "string",
61
+ "pattern": "^run_[0-9a-f]{32}$"
62
+ },
63
+ "profile": {
64
+ "type": "string",
65
+ "x-cohorte-known": [
66
+ "feature",
67
+ "bugfix",
68
+ "review"
69
+ ]
70
+ },
71
+ "title": {
72
+ "type": "string"
73
+ },
74
+ "spec": {
75
+ "type": "object",
76
+ "required": [
77
+ "id",
78
+ "kind",
79
+ "sha256"
80
+ ],
81
+ "properties": {
82
+ "id": {
83
+ "type": "string",
84
+ "pattern": "^[A-Za-z0-9_][A-Za-z0-9_.-]{0,127}$"
85
+ },
86
+ "kind": {
87
+ "type": "string"
88
+ },
89
+ "sha256": {
90
+ "type": "string",
91
+ "pattern": "^[0-9a-f]{64}$"
92
+ }
93
+ }
94
+ },
95
+ "state": {
96
+ "type": "string",
97
+ "enum": [
98
+ "IDLE",
99
+ "BRAINSTORM",
100
+ "SPEC",
101
+ "PREFLIGHT",
102
+ "BUILD",
103
+ "TEST",
104
+ "REVIEW",
105
+ "FIX",
106
+ "SHIP",
107
+ "PAUSED",
108
+ "WAITING_APPROVAL",
109
+ "AUTH_REQUIRED",
110
+ "QUOTA_EXCEEDED",
111
+ "FAILED",
112
+ "BLOCKED",
113
+ "COMPLETED",
114
+ "CANCELLED"
115
+ ]
116
+ },
117
+ "status": {
118
+ "type": "string",
119
+ "enum": [
120
+ "pending",
121
+ "running",
122
+ "completed",
123
+ "failed",
124
+ "paused",
125
+ "waiting-approval",
126
+ "cancelled",
127
+ "skipped",
128
+ "blocked"
129
+ ]
130
+ },
131
+ "since": {
132
+ "type": "string",
133
+ "format": "date-time",
134
+ "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{3}Z$"
135
+ },
136
+ "resumeTo": {
137
+ "type": "string",
138
+ "enum": [
139
+ "BRAINSTORM",
140
+ "SPEC",
141
+ "PREFLIGHT",
142
+ "BUILD",
143
+ "TEST",
144
+ "REVIEW",
145
+ "FIX",
146
+ "SHIP"
147
+ ]
148
+ },
149
+ "stop": {
150
+ "type": "object",
151
+ "required": [
152
+ "reason",
153
+ "detail",
154
+ "resumable"
155
+ ],
156
+ "properties": {
157
+ "reason": {
158
+ "type": "string",
159
+ "enum": [
160
+ "review-clean",
161
+ "iteration-limit",
162
+ "budget-exhausted",
163
+ "timeout",
164
+ "identical-failure",
165
+ "no-progress",
166
+ "policy-violation",
167
+ "approval-required",
168
+ "unexpected-repo-change",
169
+ "runtime-incompatible",
170
+ "auth-required",
171
+ "quota-exceeded",
172
+ "paused",
173
+ "cancelled",
174
+ "agent-dead",
175
+ "unreviewed",
176
+ "internal-error",
177
+ "check-environment"
178
+ ]
179
+ },
180
+ "detail": {
181
+ "type": "string"
182
+ },
183
+ "resumable": {
184
+ "type": "boolean"
185
+ },
186
+ "resumeRequires": {
187
+ "type": "string",
188
+ "x-cohorte-known": [
189
+ "approval",
190
+ "auth-login",
191
+ "quota-reset",
192
+ "budget-raise",
193
+ "human-ack",
194
+ "repo-repair",
195
+ "reinstall-pinned-version",
196
+ "environment-repair"
197
+ ]
198
+ }
199
+ }
200
+ },
201
+ "lastError": {
202
+ "$ref": "#/$defs/ErrorInfo"
203
+ },
204
+ "iteration": {
205
+ "type": "object",
206
+ "required": [
207
+ "fixRounds",
208
+ "maxFixRounds",
209
+ "reviewRounds"
210
+ ],
211
+ "properties": {
212
+ "fixRounds": {
213
+ "type": "integer",
214
+ "minimum": 0
215
+ },
216
+ "maxFixRounds": {
217
+ "type": "integer",
218
+ "minimum": 0
219
+ },
220
+ "reviewRounds": {
221
+ "type": "integer",
222
+ "minimum": 0
223
+ }
224
+ }
225
+ },
226
+ "host": {
227
+ "type": "object",
228
+ "required": [
229
+ "alive"
230
+ ],
231
+ "properties": {
232
+ "hostId": {
233
+ "type": "string"
234
+ },
235
+ "alive": {
236
+ "type": "boolean"
237
+ },
238
+ "heartbeatAt": {
239
+ "type": "string",
240
+ "format": "date-time",
241
+ "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{3}Z$"
242
+ },
243
+ "pid": {
244
+ "type": "integer",
245
+ "minimum": 0
246
+ }
247
+ }
248
+ },
249
+ "git": {
250
+ "type": "object",
251
+ "required": [
252
+ "base",
253
+ "integrationBranch"
254
+ ],
255
+ "properties": {
256
+ "base": {
257
+ "type": "object",
258
+ "required": [
259
+ "branch",
260
+ "sha"
261
+ ],
262
+ "properties": {
263
+ "branch": {
264
+ "type": "string"
265
+ },
266
+ "sha": {
267
+ "type": "string"
268
+ }
269
+ }
270
+ },
271
+ "integrationBranch": {
272
+ "type": "string"
273
+ },
274
+ "integrationHead": {
275
+ "type": "string"
276
+ },
277
+ "approvedTreeDigest": {
278
+ "type": "string"
279
+ }
280
+ }
281
+ },
282
+ "plan": {
283
+ "type": "object",
284
+ "required": [
285
+ "profile",
286
+ "runtime",
287
+ "trust",
288
+ "models",
289
+ "apiBillingEnabled",
290
+ "meteredProviders",
291
+ "sandbox",
292
+ "sandboxRequire",
293
+ "brainIsolation",
294
+ "budgets",
295
+ "network",
296
+ "promptOverrides",
297
+ "unattended"
298
+ ],
299
+ "properties": {
300
+ "profile": {
301
+ "type": "string",
302
+ "x-cohorte-known": [
303
+ "feature",
304
+ "bugfix",
305
+ "review"
306
+ ]
307
+ },
308
+ "runtime": {
309
+ "type": "object",
310
+ "required": [
311
+ "id",
312
+ "version"
313
+ ],
314
+ "properties": {
315
+ "id": {
316
+ "type": "string"
317
+ },
318
+ "version": {
319
+ "type": "string"
320
+ }
321
+ }
322
+ },
323
+ "trust": {
324
+ "type": "object",
325
+ "required": [
326
+ "policySha256",
327
+ "loosenedKeys",
328
+ "grantedBy"
329
+ ],
330
+ "properties": {
331
+ "policySha256": {
332
+ "type": "string",
333
+ "pattern": "^[0-9a-f]{64}$"
334
+ },
335
+ "loosenedKeys": {
336
+ "type": "array",
337
+ "items": {
338
+ "type": "string"
339
+ }
340
+ },
341
+ "grantedBy": {
342
+ "type": "string",
343
+ "x-cohorte-known": [
344
+ "none-needed",
345
+ "user-config",
346
+ "cli-flag",
347
+ "trust-record"
348
+ ]
349
+ }
350
+ }
351
+ },
352
+ "models": {
353
+ "type": "array",
354
+ "items": {
355
+ "type": "object",
356
+ "required": [
357
+ "role",
358
+ "requested",
359
+ "thinking",
360
+ "authMode",
361
+ "billing",
362
+ "reason"
363
+ ],
364
+ "properties": {
365
+ "role": {
366
+ "type": "string"
367
+ },
368
+ "requested": {
369
+ "type": "object",
370
+ "required": [
371
+ "provider",
372
+ "model"
373
+ ],
374
+ "properties": {
375
+ "provider": {
376
+ "type": "string"
377
+ },
378
+ "model": {
379
+ "type": "string"
380
+ },
381
+ "capability": {
382
+ "anyOf": [
383
+ {
384
+ "type": "string",
385
+ "const": "fast"
386
+ },
387
+ {
388
+ "type": "string",
389
+ "const": "coding"
390
+ },
391
+ {
392
+ "type": "string",
393
+ "const": "reasoning"
394
+ },
395
+ {
396
+ "type": "string",
397
+ "const": "vision"
398
+ },
399
+ {
400
+ "type": "string",
401
+ "const": "cheap"
402
+ }
403
+ ]
404
+ }
405
+ }
406
+ },
407
+ "thinking": {
408
+ "anyOf": [
409
+ {
410
+ "type": "string",
411
+ "const": "off"
412
+ },
413
+ {
414
+ "type": "string",
415
+ "const": "minimal"
416
+ },
417
+ {
418
+ "type": "string",
419
+ "const": "low"
420
+ },
421
+ {
422
+ "type": "string",
423
+ "const": "medium"
424
+ },
425
+ {
426
+ "type": "string",
427
+ "const": "high"
428
+ },
429
+ {
430
+ "type": "string",
431
+ "const": "xhigh"
432
+ }
433
+ ]
434
+ },
435
+ "authMode": {
436
+ "anyOf": [
437
+ {
438
+ "type": "string",
439
+ "const": "subscription"
440
+ },
441
+ {
442
+ "type": "string",
443
+ "const": "api"
444
+ }
445
+ ]
446
+ },
447
+ "billing": {
448
+ "type": "string",
449
+ "enum": [
450
+ "plan-limits",
451
+ "metered"
452
+ ]
453
+ },
454
+ "reason": {
455
+ "type": "string"
456
+ }
457
+ }
458
+ }
459
+ },
460
+ "apiBillingEnabled": {
461
+ "type": "boolean"
462
+ },
463
+ "meteredProviders": {
464
+ "type": "array",
465
+ "items": {
466
+ "type": "string"
467
+ }
468
+ },
469
+ "sandbox": {
470
+ "type": "object",
471
+ "required": [
472
+ "level",
473
+ "backend",
474
+ "filesystem",
475
+ "network"
476
+ ],
477
+ "properties": {
478
+ "level": {
479
+ "type": "string",
480
+ "x-cohorte-known": [
481
+ "L0-process",
482
+ "L1-os"
483
+ ]
484
+ },
485
+ "backend": {
486
+ "type": "string",
487
+ "x-cohorte-known": [
488
+ "none",
489
+ "seatbelt",
490
+ "bubblewrap"
491
+ ]
492
+ },
493
+ "filesystem": {
494
+ "type": "string",
495
+ "x-cohorte-known": [
496
+ "enforced",
497
+ "partial",
498
+ "advisory"
499
+ ]
500
+ },
501
+ "network": {
502
+ "type": "string",
503
+ "x-cohorte-known": [
504
+ "enforced-off",
505
+ "partial",
506
+ "unenforced"
507
+ ]
508
+ }
509
+ }
510
+ },
511
+ "sandboxRequire": {
512
+ "type": "string",
513
+ "enum": [
514
+ "native",
515
+ "best-effort"
516
+ ]
517
+ },
518
+ "brainIsolation": {
519
+ "type": "string",
520
+ "enum": [
521
+ "os",
522
+ "process"
523
+ ]
524
+ },
525
+ "budgets": {
526
+ "type": "object",
527
+ "required": [
528
+ "run",
529
+ "perPhase",
530
+ "perAgent",
531
+ "perProvider",
532
+ "perTool"
533
+ ],
534
+ "properties": {
535
+ "run": {
536
+ "type": "object",
537
+ "properties": {
538
+ "tokens": {
539
+ "type": "integer",
540
+ "minimum": 0
541
+ },
542
+ "modelRequests": {
543
+ "type": "integer",
544
+ "minimum": 0
545
+ },
546
+ "toolCalls": {
547
+ "type": "integer",
548
+ "minimum": 0
549
+ },
550
+ "wallClockMs": {
551
+ "type": "number",
552
+ "minimum": 0
553
+ },
554
+ "retries": {
555
+ "type": "integer",
556
+ "minimum": 0
557
+ },
558
+ "fixRounds": {
559
+ "type": "integer",
560
+ "minimum": 0
561
+ },
562
+ "contextTokens": {
563
+ "type": "integer",
564
+ "minimum": 0
565
+ },
566
+ "concurrentAgents": {
567
+ "type": "integer",
568
+ "minimum": 0
569
+ },
570
+ "estimatedQuotaPercent": {
571
+ "type": "number",
572
+ "minimum": 0
573
+ }
574
+ }
575
+ },
576
+ "perPhase": {
577
+ "type": "object",
578
+ "properties": {
579
+ "tokens": {
580
+ "type": "integer",
581
+ "minimum": 0
582
+ },
583
+ "modelRequests": {
584
+ "type": "integer",
585
+ "minimum": 0
586
+ },
587
+ "toolCalls": {
588
+ "type": "integer",
589
+ "minimum": 0
590
+ },
591
+ "wallClockMs": {
592
+ "type": "number",
593
+ "minimum": 0
594
+ },
595
+ "retries": {
596
+ "type": "integer",
597
+ "minimum": 0
598
+ },
599
+ "fixRounds": {
600
+ "type": "integer",
601
+ "minimum": 0
602
+ },
603
+ "contextTokens": {
604
+ "type": "integer",
605
+ "minimum": 0
606
+ },
607
+ "concurrentAgents": {
608
+ "type": "integer",
609
+ "minimum": 0
610
+ },
611
+ "estimatedQuotaPercent": {
612
+ "type": "number",
613
+ "minimum": 0
614
+ }
615
+ }
616
+ },
617
+ "perAgent": {
618
+ "type": "object",
619
+ "properties": {
620
+ "tokens": {
621
+ "type": "integer",
622
+ "minimum": 0
623
+ },
624
+ "modelRequests": {
625
+ "type": "integer",
626
+ "minimum": 0
627
+ },
628
+ "toolCalls": {
629
+ "type": "integer",
630
+ "minimum": 0
631
+ },
632
+ "wallClockMs": {
633
+ "type": "number",
634
+ "minimum": 0
635
+ },
636
+ "retries": {
637
+ "type": "integer",
638
+ "minimum": 0
639
+ },
640
+ "fixRounds": {
641
+ "type": "integer",
642
+ "minimum": 0
643
+ },
644
+ "contextTokens": {
645
+ "type": "integer",
646
+ "minimum": 0
647
+ },
648
+ "concurrentAgents": {
649
+ "type": "integer",
650
+ "minimum": 0
651
+ },
652
+ "estimatedQuotaPercent": {
653
+ "type": "number",
654
+ "minimum": 0
655
+ }
656
+ }
657
+ },
658
+ "perProvider": {
659
+ "type": "object",
660
+ "patternProperties": {
661
+ "^.*$": {
662
+ "type": "object",
663
+ "properties": {
664
+ "tokens": {
665
+ "type": "integer",
666
+ "minimum": 0
667
+ },
668
+ "modelRequests": {
669
+ "type": "integer",
670
+ "minimum": 0
671
+ },
672
+ "toolCalls": {
673
+ "type": "integer",
674
+ "minimum": 0
675
+ },
676
+ "wallClockMs": {
677
+ "type": "number",
678
+ "minimum": 0
679
+ },
680
+ "retries": {
681
+ "type": "integer",
682
+ "minimum": 0
683
+ },
684
+ "fixRounds": {
685
+ "type": "integer",
686
+ "minimum": 0
687
+ },
688
+ "contextTokens": {
689
+ "type": "integer",
690
+ "minimum": 0
691
+ },
692
+ "concurrentAgents": {
693
+ "type": "integer",
694
+ "minimum": 0
695
+ },
696
+ "estimatedQuotaPercent": {
697
+ "type": "number",
698
+ "minimum": 0
699
+ }
700
+ }
701
+ }
702
+ }
703
+ },
704
+ "perTool": {
705
+ "type": "object",
706
+ "patternProperties": {
707
+ "^.*$": {
708
+ "type": "object",
709
+ "properties": {
710
+ "tokens": {
711
+ "type": "integer",
712
+ "minimum": 0
713
+ },
714
+ "modelRequests": {
715
+ "type": "integer",
716
+ "minimum": 0
717
+ },
718
+ "toolCalls": {
719
+ "type": "integer",
720
+ "minimum": 0
721
+ },
722
+ "wallClockMs": {
723
+ "type": "number",
724
+ "minimum": 0
725
+ },
726
+ "retries": {
727
+ "type": "integer",
728
+ "minimum": 0
729
+ },
730
+ "fixRounds": {
731
+ "type": "integer",
732
+ "minimum": 0
733
+ },
734
+ "contextTokens": {
735
+ "type": "integer",
736
+ "minimum": 0
737
+ },
738
+ "concurrentAgents": {
739
+ "type": "integer",
740
+ "minimum": 0
741
+ },
742
+ "estimatedQuotaPercent": {
743
+ "type": "number",
744
+ "minimum": 0
745
+ }
746
+ }
747
+ }
748
+ }
749
+ }
750
+ }
751
+ },
752
+ "network": {
753
+ "type": "object",
754
+ "required": [
755
+ "provisioning"
756
+ ],
757
+ "properties": {
758
+ "provisioning": {
759
+ "type": "boolean"
760
+ }
761
+ }
762
+ },
763
+ "promptOverrides": {
764
+ "type": "array",
765
+ "items": {
766
+ "type": "string"
767
+ }
768
+ },
769
+ "unattended": {
770
+ "type": "boolean"
771
+ }
772
+ }
773
+ },
774
+ "snapshotDigest": {
775
+ "type": "string",
776
+ "pattern": "^[0-9a-f]{64}$"
777
+ },
778
+ "startedAt": {
779
+ "type": "string",
780
+ "format": "date-time",
781
+ "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{3}Z$"
782
+ },
783
+ "endedAt": {
784
+ "type": "string",
785
+ "format": "date-time",
786
+ "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{3}Z$"
787
+ }
788
+ }
789
+ },
790
+ "phases": {
791
+ "type": "array",
792
+ "items": {
793
+ "type": "object",
794
+ "required": [
795
+ "state",
796
+ "label",
797
+ "status",
798
+ "runs"
799
+ ],
800
+ "properties": {
801
+ "state": {
802
+ "type": "string",
803
+ "enum": [
804
+ "BRAINSTORM",
805
+ "SPEC",
806
+ "PREFLIGHT",
807
+ "BUILD",
808
+ "TEST",
809
+ "REVIEW",
810
+ "FIX",
811
+ "SHIP"
812
+ ]
813
+ },
814
+ "label": {
815
+ "type": "string"
816
+ },
817
+ "status": {
818
+ "type": "string",
819
+ "enum": [
820
+ "pending",
821
+ "running",
822
+ "completed",
823
+ "failed",
824
+ "paused",
825
+ "waiting-approval",
826
+ "cancelled",
827
+ "skipped",
828
+ "blocked"
829
+ ]
830
+ },
831
+ "runs": {
832
+ "type": "array",
833
+ "items": {
834
+ "type": "object",
835
+ "required": [
836
+ "phaseRunId",
837
+ "iteration",
838
+ "status",
839
+ "agents",
840
+ "checks"
841
+ ],
842
+ "properties": {
843
+ "phaseRunId": {
844
+ "type": "string",
845
+ "maxLength": 128,
846
+ "pattern": "^phs_[A-Z][A-Z_]*_[0-9]+$"
847
+ },
848
+ "iteration": {
849
+ "type": "integer",
850
+ "minimum": 0
851
+ },
852
+ "status": {
853
+ "type": "string",
854
+ "enum": [
855
+ "pending",
856
+ "running",
857
+ "completed",
858
+ "failed",
859
+ "paused",
860
+ "waiting-approval",
861
+ "cancelled",
862
+ "skipped",
863
+ "blocked"
864
+ ]
865
+ },
866
+ "startedAt": {
867
+ "type": "string",
868
+ "format": "date-time",
869
+ "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{3}Z$"
870
+ },
871
+ "endedAt": {
872
+ "type": "string",
873
+ "format": "date-time",
874
+ "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{3}Z$"
875
+ },
876
+ "outcome": {
877
+ "type": "string"
878
+ },
879
+ "agents": {
880
+ "type": "array",
881
+ "items": {
882
+ "type": "object",
883
+ "required": [
884
+ "agentId",
885
+ "role",
886
+ "label",
887
+ "status",
888
+ "lifecycle",
889
+ "attempt",
890
+ "incarnation",
891
+ "model",
892
+ "usage"
893
+ ],
894
+ "properties": {
895
+ "agentId": {
896
+ "type": "string",
897
+ "maxLength": 128,
898
+ "pattern": "^agt_[A-Za-z0-9.-]+_[A-Za-z0-9_.-]+$"
899
+ },
900
+ "role": {
901
+ "type": "string"
902
+ },
903
+ "surface": {
904
+ "type": "string",
905
+ "pattern": "^[A-Za-z0-9_][A-Za-z0-9_.-]{0,127}$"
906
+ },
907
+ "label": {
908
+ "type": "string"
909
+ },
910
+ "status": {
911
+ "type": "string",
912
+ "enum": [
913
+ "pending",
914
+ "running",
915
+ "completed",
916
+ "failed",
917
+ "paused",
918
+ "waiting-approval",
919
+ "cancelled",
920
+ "skipped",
921
+ "blocked"
922
+ ]
923
+ },
924
+ "lifecycle": {
925
+ "type": "string",
926
+ "enum": [
927
+ "declared",
928
+ "planned",
929
+ "spawning",
930
+ "running",
931
+ "waiting",
932
+ "paused",
933
+ "completed",
934
+ "failed",
935
+ "retrying",
936
+ "escalated",
937
+ "cancelled"
938
+ ]
939
+ },
940
+ "attempt": {
941
+ "type": "integer",
942
+ "minimum": 0
943
+ },
944
+ "incarnation": {
945
+ "type": "integer",
946
+ "minimum": 0
947
+ },
948
+ "model": {
949
+ "type": "object",
950
+ "required": [
951
+ "requested"
952
+ ],
953
+ "properties": {
954
+ "requested": {
955
+ "type": "object",
956
+ "required": [
957
+ "provider",
958
+ "model"
959
+ ],
960
+ "properties": {
961
+ "provider": {
962
+ "type": "string"
963
+ },
964
+ "model": {
965
+ "type": "string"
966
+ },
967
+ "capability": {
968
+ "anyOf": [
969
+ {
970
+ "type": "string",
971
+ "const": "fast"
972
+ },
973
+ {
974
+ "type": "string",
975
+ "const": "coding"
976
+ },
977
+ {
978
+ "type": "string",
979
+ "const": "reasoning"
980
+ },
981
+ {
982
+ "type": "string",
983
+ "const": "vision"
984
+ },
985
+ {
986
+ "type": "string",
987
+ "const": "cheap"
988
+ }
989
+ ]
990
+ }
991
+ }
992
+ },
993
+ "effective": {
994
+ "type": "object",
995
+ "required": [
996
+ "provider",
997
+ "model"
998
+ ],
999
+ "properties": {
1000
+ "provider": {
1001
+ "type": "string"
1002
+ },
1003
+ "model": {
1004
+ "type": "string"
1005
+ }
1006
+ }
1007
+ }
1008
+ }
1009
+ },
1010
+ "authMode": {
1011
+ "anyOf": [
1012
+ {
1013
+ "type": "string",
1014
+ "const": "subscription"
1015
+ },
1016
+ {
1017
+ "type": "string",
1018
+ "const": "api"
1019
+ }
1020
+ ]
1021
+ },
1022
+ "worktree": {
1023
+ "type": "string"
1024
+ },
1025
+ "usage": {
1026
+ "type": "object",
1027
+ "properties": {
1028
+ "tokens": {
1029
+ "type": "integer",
1030
+ "minimum": 0
1031
+ },
1032
+ "modelRequests": {
1033
+ "type": "integer",
1034
+ "minimum": 0
1035
+ },
1036
+ "toolCalls": {
1037
+ "type": "integer",
1038
+ "minimum": 0
1039
+ },
1040
+ "wallClockMs": {
1041
+ "type": "number",
1042
+ "minimum": 0
1043
+ },
1044
+ "retries": {
1045
+ "type": "integer",
1046
+ "minimum": 0
1047
+ },
1048
+ "fixRounds": {
1049
+ "type": "integer",
1050
+ "minimum": 0
1051
+ },
1052
+ "contextTokens": {
1053
+ "type": "integer",
1054
+ "minimum": 0
1055
+ },
1056
+ "concurrentAgents": {
1057
+ "type": "integer",
1058
+ "minimum": 0
1059
+ },
1060
+ "estimatedQuotaPercent": {
1061
+ "type": "number",
1062
+ "minimum": 0
1063
+ }
1064
+ }
1065
+ },
1066
+ "summary": {
1067
+ "type": "string"
1068
+ },
1069
+ "lastError": {
1070
+ "$ref": "#/$defs/ErrorInfo"
1071
+ },
1072
+ "pendingApproval": {
1073
+ "type": "string",
1074
+ "pattern": "^apr_[0-9a-f]{32}$"
1075
+ },
1076
+ "runtimeRef": {
1077
+ "type": "object",
1078
+ "required": [
1079
+ "runtime",
1080
+ "version",
1081
+ "sessionId",
1082
+ "transcriptRef"
1083
+ ],
1084
+ "properties": {
1085
+ "runtime": {
1086
+ "type": "string"
1087
+ },
1088
+ "version": {
1089
+ "type": "string"
1090
+ },
1091
+ "sessionId": {
1092
+ "type": "string"
1093
+ },
1094
+ "transcriptRef": {
1095
+ "type": "string"
1096
+ }
1097
+ }
1098
+ }
1099
+ }
1100
+ }
1101
+ },
1102
+ "checks": {
1103
+ "type": "array",
1104
+ "items": {
1105
+ "type": "object",
1106
+ "required": [
1107
+ "name",
1108
+ "status",
1109
+ "argv",
1110
+ "durationMs",
1111
+ "treeDigest"
1112
+ ],
1113
+ "properties": {
1114
+ "name": {
1115
+ "type": "string"
1116
+ },
1117
+ "status": {
1118
+ "type": "string",
1119
+ "enum": [
1120
+ "passed",
1121
+ "failed",
1122
+ "errored",
1123
+ "skipped"
1124
+ ]
1125
+ },
1126
+ "argv": {
1127
+ "type": "array",
1128
+ "items": {
1129
+ "type": "string"
1130
+ }
1131
+ },
1132
+ "exitCode": {
1133
+ "type": "integer"
1134
+ },
1135
+ "durationMs": {
1136
+ "type": "number",
1137
+ "minimum": 0
1138
+ },
1139
+ "treeDigest": {
1140
+ "type": "string"
1141
+ },
1142
+ "output": {
1143
+ "type": "object",
1144
+ "required": [
1145
+ "artifactId",
1146
+ "kind",
1147
+ "path",
1148
+ "sha256",
1149
+ "bytes"
1150
+ ],
1151
+ "properties": {
1152
+ "artifactId": {
1153
+ "type": "string",
1154
+ "pattern": "^art_[0-9a-f]{32}$"
1155
+ },
1156
+ "kind": {
1157
+ "type": "string",
1158
+ "x-cohorte-known": [
1159
+ "diff",
1160
+ "file",
1161
+ "log",
1162
+ "report",
1163
+ "agent-output",
1164
+ "transcript",
1165
+ "context",
1166
+ "prompt",
1167
+ "patch"
1168
+ ]
1169
+ },
1170
+ "path": {
1171
+ "type": "string"
1172
+ },
1173
+ "sha256": {
1174
+ "type": "string",
1175
+ "pattern": "^[0-9a-f]{64}$"
1176
+ },
1177
+ "bytes": {
1178
+ "type": "integer",
1179
+ "minimum": 0
1180
+ }
1181
+ }
1182
+ }
1183
+ }
1184
+ }
1185
+ }
1186
+ }
1187
+ }
1188
+ }
1189
+ }
1190
+ }
1191
+ },
1192
+ "approvals": {
1193
+ "type": "object",
1194
+ "required": [
1195
+ "pending",
1196
+ "resolved"
1197
+ ],
1198
+ "properties": {
1199
+ "pending": {
1200
+ "type": "array",
1201
+ "items": {
1202
+ "type": "object",
1203
+ "required": [
1204
+ "approvalId",
1205
+ "kind",
1206
+ "what",
1207
+ "since",
1208
+ "cli"
1209
+ ],
1210
+ "properties": {
1211
+ "approvalId": {
1212
+ "type": "string",
1213
+ "pattern": "^apr_[0-9a-f]{32}$"
1214
+ },
1215
+ "kind": {
1216
+ "type": "string"
1217
+ },
1218
+ "agentId": {
1219
+ "type": "string",
1220
+ "maxLength": 128,
1221
+ "pattern": "^agt_[A-Za-z0-9.-]+_[A-Za-z0-9_.-]+$"
1222
+ },
1223
+ "what": {
1224
+ "type": "string",
1225
+ "maxLength": 512
1226
+ },
1227
+ "since": {
1228
+ "type": "string",
1229
+ "format": "date-time",
1230
+ "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{3}Z$"
1231
+ },
1232
+ "expiresAt": {
1233
+ "type": "string",
1234
+ "format": "date-time",
1235
+ "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{3}Z$"
1236
+ },
1237
+ "cli": {
1238
+ "type": "string"
1239
+ }
1240
+ }
1241
+ }
1242
+ },
1243
+ "resolved": {
1244
+ "type": "integer",
1245
+ "minimum": 0
1246
+ }
1247
+ }
1248
+ },
1249
+ "budgets": {
1250
+ "type": "array",
1251
+ "items": {
1252
+ "type": "object",
1253
+ "required": [
1254
+ "scope",
1255
+ "consumed",
1256
+ "limit"
1257
+ ],
1258
+ "properties": {
1259
+ "scope": {
1260
+ "type": "object",
1261
+ "required": [
1262
+ "level",
1263
+ "id"
1264
+ ],
1265
+ "properties": {
1266
+ "level": {
1267
+ "type": "string"
1268
+ },
1269
+ "id": {
1270
+ "type": "string"
1271
+ }
1272
+ }
1273
+ },
1274
+ "consumed": {
1275
+ "type": "object",
1276
+ "properties": {
1277
+ "tokens": {
1278
+ "type": "integer",
1279
+ "minimum": 0
1280
+ },
1281
+ "modelRequests": {
1282
+ "type": "integer",
1283
+ "minimum": 0
1284
+ },
1285
+ "toolCalls": {
1286
+ "type": "integer",
1287
+ "minimum": 0
1288
+ },
1289
+ "wallClockMs": {
1290
+ "type": "number",
1291
+ "minimum": 0
1292
+ },
1293
+ "retries": {
1294
+ "type": "integer",
1295
+ "minimum": 0
1296
+ },
1297
+ "fixRounds": {
1298
+ "type": "integer",
1299
+ "minimum": 0
1300
+ },
1301
+ "contextTokens": {
1302
+ "type": "integer",
1303
+ "minimum": 0
1304
+ },
1305
+ "concurrentAgents": {
1306
+ "type": "integer",
1307
+ "minimum": 0
1308
+ },
1309
+ "estimatedQuotaPercent": {
1310
+ "type": "number",
1311
+ "minimum": 0
1312
+ }
1313
+ }
1314
+ },
1315
+ "limit": {
1316
+ "type": "object",
1317
+ "properties": {
1318
+ "tokens": {
1319
+ "type": "integer",
1320
+ "minimum": 0
1321
+ },
1322
+ "modelRequests": {
1323
+ "type": "integer",
1324
+ "minimum": 0
1325
+ },
1326
+ "toolCalls": {
1327
+ "type": "integer",
1328
+ "minimum": 0
1329
+ },
1330
+ "wallClockMs": {
1331
+ "type": "number",
1332
+ "minimum": 0
1333
+ },
1334
+ "retries": {
1335
+ "type": "integer",
1336
+ "minimum": 0
1337
+ },
1338
+ "fixRounds": {
1339
+ "type": "integer",
1340
+ "minimum": 0
1341
+ },
1342
+ "contextTokens": {
1343
+ "type": "integer",
1344
+ "minimum": 0
1345
+ },
1346
+ "concurrentAgents": {
1347
+ "type": "integer",
1348
+ "minimum": 0
1349
+ },
1350
+ "estimatedQuotaPercent": {
1351
+ "type": "number",
1352
+ "minimum": 0
1353
+ }
1354
+ }
1355
+ }
1356
+ }
1357
+ }
1358
+ },
1359
+ "usage": {
1360
+ "type": "object",
1361
+ "required": [
1362
+ "tokens",
1363
+ "monetaryCost",
1364
+ "byProvider"
1365
+ ],
1366
+ "properties": {
1367
+ "tokens": {
1368
+ "type": "object",
1369
+ "required": [
1370
+ "input",
1371
+ "output",
1372
+ "cacheRead",
1373
+ "cacheWrite",
1374
+ "total"
1375
+ ],
1376
+ "properties": {
1377
+ "input": {
1378
+ "type": "integer",
1379
+ "minimum": 0
1380
+ },
1381
+ "output": {
1382
+ "type": "integer",
1383
+ "minimum": 0
1384
+ },
1385
+ "cacheRead": {
1386
+ "type": "integer",
1387
+ "minimum": 0
1388
+ },
1389
+ "cacheWrite": {
1390
+ "type": "integer",
1391
+ "minimum": 0
1392
+ },
1393
+ "total": {
1394
+ "type": "integer",
1395
+ "minimum": 0
1396
+ }
1397
+ }
1398
+ },
1399
+ "monetaryCost": {
1400
+ "anyOf": [
1401
+ {
1402
+ "type": "string",
1403
+ "const": "not_applicable"
1404
+ },
1405
+ {
1406
+ "type": "object",
1407
+ "required": [
1408
+ "currency",
1409
+ "amount",
1410
+ "basis",
1411
+ "priceCatalogVersion"
1412
+ ],
1413
+ "properties": {
1414
+ "currency": {
1415
+ "type": "string",
1416
+ "const": "USD"
1417
+ },
1418
+ "amount": {
1419
+ "type": "number",
1420
+ "minimum": 0
1421
+ },
1422
+ "basis": {
1423
+ "anyOf": [
1424
+ {
1425
+ "type": "string",
1426
+ "const": "catalogue"
1427
+ },
1428
+ {
1429
+ "type": "string",
1430
+ "const": "estimate"
1431
+ }
1432
+ ]
1433
+ },
1434
+ "priceCatalogVersion": {
1435
+ "type": "string"
1436
+ }
1437
+ }
1438
+ }
1439
+ ]
1440
+ },
1441
+ "byProvider": {
1442
+ "type": "array",
1443
+ "items": {
1444
+ "type": "object",
1445
+ "required": [
1446
+ "provider",
1447
+ "authMode",
1448
+ "billing",
1449
+ "tokens",
1450
+ "quota"
1451
+ ],
1452
+ "properties": {
1453
+ "provider": {
1454
+ "type": "string"
1455
+ },
1456
+ "authMode": {
1457
+ "anyOf": [
1458
+ {
1459
+ "type": "string",
1460
+ "const": "subscription"
1461
+ },
1462
+ {
1463
+ "type": "string",
1464
+ "const": "api"
1465
+ }
1466
+ ]
1467
+ },
1468
+ "billing": {
1469
+ "type": "string",
1470
+ "enum": [
1471
+ "plan-limits",
1472
+ "metered"
1473
+ ]
1474
+ },
1475
+ "tokens": {
1476
+ "type": "object",
1477
+ "required": [
1478
+ "input",
1479
+ "output",
1480
+ "cacheRead",
1481
+ "cacheWrite",
1482
+ "total"
1483
+ ],
1484
+ "properties": {
1485
+ "input": {
1486
+ "type": "integer",
1487
+ "minimum": 0
1488
+ },
1489
+ "output": {
1490
+ "type": "integer",
1491
+ "minimum": 0
1492
+ },
1493
+ "cacheRead": {
1494
+ "type": "integer",
1495
+ "minimum": 0
1496
+ },
1497
+ "cacheWrite": {
1498
+ "type": "integer",
1499
+ "minimum": 0
1500
+ },
1501
+ "total": {
1502
+ "type": "integer",
1503
+ "minimum": 0
1504
+ }
1505
+ }
1506
+ },
1507
+ "quota": {
1508
+ "anyOf": [
1509
+ {
1510
+ "type": "object",
1511
+ "required": [
1512
+ "known"
1513
+ ],
1514
+ "properties": {
1515
+ "known": {
1516
+ "type": "boolean",
1517
+ "const": false
1518
+ }
1519
+ }
1520
+ },
1521
+ {
1522
+ "type": "object",
1523
+ "required": [
1524
+ "known",
1525
+ "source",
1526
+ "provider",
1527
+ "windows",
1528
+ "observedAt"
1529
+ ],
1530
+ "properties": {
1531
+ "known": {
1532
+ "type": "boolean",
1533
+ "const": true
1534
+ },
1535
+ "source": {
1536
+ "anyOf": [
1537
+ {
1538
+ "type": "string",
1539
+ "const": "response-headers"
1540
+ },
1541
+ {
1542
+ "type": "string",
1543
+ "const": "error"
1544
+ }
1545
+ ]
1546
+ },
1547
+ "provider": {
1548
+ "type": "string"
1549
+ },
1550
+ "windows": {
1551
+ "type": "array",
1552
+ "items": {
1553
+ "type": "object",
1554
+ "required": [
1555
+ "name"
1556
+ ],
1557
+ "properties": {
1558
+ "name": {
1559
+ "type": "string"
1560
+ },
1561
+ "usedPercent": {
1562
+ "type": "number",
1563
+ "minimum": 0
1564
+ },
1565
+ "resetsAt": {
1566
+ "type": "string",
1567
+ "format": "date-time",
1568
+ "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{3}Z$"
1569
+ },
1570
+ "limitLabel": {
1571
+ "type": "string"
1572
+ }
1573
+ }
1574
+ }
1575
+ },
1576
+ "observedAt": {
1577
+ "type": "string",
1578
+ "format": "date-time",
1579
+ "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{3}Z$"
1580
+ }
1581
+ }
1582
+ }
1583
+ ]
1584
+ },
1585
+ "accountLabel": {
1586
+ "type": "string"
1587
+ }
1588
+ }
1589
+ }
1590
+ }
1591
+ }
1592
+ },
1593
+ "locks": {
1594
+ "type": "array",
1595
+ "items": {
1596
+ "type": "object",
1597
+ "required": [
1598
+ "scope",
1599
+ "key",
1600
+ "mode"
1601
+ ],
1602
+ "properties": {
1603
+ "scope": {
1604
+ "type": "string"
1605
+ },
1606
+ "key": {
1607
+ "type": "string"
1608
+ },
1609
+ "mode": {
1610
+ "type": "string"
1611
+ }
1612
+ }
1613
+ }
1614
+ },
1615
+ "inDoubtEffects": {
1616
+ "type": "array",
1617
+ "items": {
1618
+ "type": "string",
1619
+ "pattern": "^eff_[0-9a-f]{32}$"
1620
+ }
1621
+ }
1622
+ },
1623
+ "$defs": {
1624
+ "JsonValue": {
1625
+ "anyOf": [
1626
+ {
1627
+ "type": "null"
1628
+ },
1629
+ {
1630
+ "type": "boolean"
1631
+ },
1632
+ {
1633
+ "type": "number"
1634
+ },
1635
+ {
1636
+ "type": "string"
1637
+ },
1638
+ {
1639
+ "type": "array",
1640
+ "items": {
1641
+ "$ref": "#/$defs/JsonValue"
1642
+ }
1643
+ },
1644
+ {
1645
+ "type": "object",
1646
+ "patternProperties": {
1647
+ "^.*$": {
1648
+ "$ref": "#/$defs/JsonValue"
1649
+ }
1650
+ }
1651
+ }
1652
+ ]
1653
+ },
1654
+ "ErrorInfo": {
1655
+ "type": "object",
1656
+ "required": [
1657
+ "code",
1658
+ "class",
1659
+ "message",
1660
+ "impact",
1661
+ "retryable",
1662
+ "remediation"
1663
+ ],
1664
+ "properties": {
1665
+ "code": {
1666
+ "type": "string",
1667
+ "pattern": "^[a-z]+(?:-[a-z]+)*/[a-z0-9]+(?:-[a-z0-9]+)*$"
1668
+ },
1669
+ "class": {
1670
+ "anyOf": [
1671
+ {
1672
+ "type": "string",
1673
+ "const": "configuration"
1674
+ },
1675
+ {
1676
+ "type": "string",
1677
+ "const": "validation"
1678
+ },
1679
+ {
1680
+ "type": "string",
1681
+ "const": "permission"
1682
+ },
1683
+ {
1684
+ "type": "string",
1685
+ "const": "security"
1686
+ },
1687
+ {
1688
+ "type": "string",
1689
+ "const": "provider-transient"
1690
+ },
1691
+ {
1692
+ "type": "string",
1693
+ "const": "provider-terminal"
1694
+ },
1695
+ {
1696
+ "type": "string",
1697
+ "const": "tool-transient"
1698
+ },
1699
+ {
1700
+ "type": "string",
1701
+ "const": "tool-terminal"
1702
+ },
1703
+ {
1704
+ "type": "string",
1705
+ "const": "conflict"
1706
+ },
1707
+ {
1708
+ "type": "string",
1709
+ "const": "budget"
1710
+ },
1711
+ {
1712
+ "type": "string",
1713
+ "const": "timeout"
1714
+ },
1715
+ {
1716
+ "type": "string",
1717
+ "const": "corruption"
1718
+ },
1719
+ {
1720
+ "type": "string",
1721
+ "const": "human-required"
1722
+ }
1723
+ ]
1724
+ },
1725
+ "message": {
1726
+ "type": "string"
1727
+ },
1728
+ "impact": {
1729
+ "type": "string"
1730
+ },
1731
+ "retryable": {
1732
+ "type": "boolean"
1733
+ },
1734
+ "retryAfterMs": {
1735
+ "type": "number",
1736
+ "minimum": 0
1737
+ },
1738
+ "remediation": {
1739
+ "type": "string"
1740
+ },
1741
+ "cause": {
1742
+ "$ref": "#/$defs/ErrorInfo"
1743
+ },
1744
+ "details": {
1745
+ "type": "object",
1746
+ "patternProperties": {
1747
+ "^.*$": {
1748
+ "$ref": "#/$defs/JsonValue"
1749
+ }
1750
+ }
1751
+ }
1752
+ }
1753
+ }
1754
+ }
1755
+ }