cohorte 3.0.0-dev.7 → 3.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 (229) hide show
  1. package/CHANGELOG.md +1532 -0
  2. package/README.md +106 -185
  3. package/bin/cli.js +212 -0
  4. package/bin/report.js +141 -0
  5. package/core/agents/cohorte-profile-reader.md +50 -0
  6. package/core/agents/cohorte-release.md +58 -0
  7. package/core/agents/cohorte-review.md +174 -0
  8. package/core/agents/implementer.template.md +146 -0
  9. package/core/commands/cohorte-align-ds.md +33 -0
  10. package/core/commands/cohorte-audit.md +67 -0
  11. package/core/commands/cohorte-brainstorm.md +73 -0
  12. package/core/commands/cohorte-build.md +241 -0
  13. package/core/commands/cohorte-doctor.md +133 -0
  14. package/core/commands/cohorte-fix.md +80 -0
  15. package/core/commands/cohorte-fleet.md +111 -0
  16. package/core/commands/cohorte-init-pipeline.md +30 -0
  17. package/core/commands/cohorte-intake.md +92 -0
  18. package/core/commands/cohorte-patch.md +118 -0
  19. package/core/commands/cohorte-refactor.md +57 -0
  20. package/core/commands/cohorte-retro.md +85 -0
  21. package/core/commands/cohorte-review.md +224 -0
  22. package/core/commands/cohorte-ship.md +155 -0
  23. package/core/commands/cohorte-spec.md +105 -0
  24. package/core/commands/cohorte-update-pipeline.md +115 -0
  25. package/core/hooks/gate.py +2931 -0
  26. package/core/templates/agent-handoff.md +34 -0
  27. package/core/templates/brainstorm-return.md +42 -0
  28. package/core/templates/decisions.template.md +42 -0
  29. package/core/templates/design-brief.md +37 -0
  30. package/core/templates/patch.template.md +86 -0
  31. package/core/templates/pr-body.md +25 -0
  32. package/core/templates/review-feedback.md +46 -0
  33. package/core/templates/spec.template.md +88 -0
  34. package/core/templates/steps/init-pipeline/01-detect-stack.md +44 -0
  35. package/core/templates/steps/init-pipeline/02-interview-gaps.md +55 -0
  36. package/core/templates/steps/init-pipeline/03-draft-profile.md +9 -0
  37. package/core/templates/steps/init-pipeline/04-write-render.md +91 -0
  38. package/core/templates/steps/init-pipeline/05-report.md +11 -0
  39. package/core/templates/steps/review-pr/01-pr-mode.md +54 -0
  40. package/core/workflows/audit.js +306 -0
  41. package/core/workflows/loop.js +687 -0
  42. package/core/workflows/refactor.js +291 -0
  43. package/core/workflows/review.js +491 -0
  44. package/install.ps1 +72 -0
  45. package/install.sh +69 -0
  46. package/lib/doctor.js +472 -0
  47. package/lib/install.js +377 -0
  48. package/lib/project.js +322 -0
  49. package/lib/render.js +121 -0
  50. package/lib/versions.js +145 -0
  51. package/lib/yaml.js +174 -0
  52. package/package.json +36 -17
  53. package/profile/PIPELINE.template.md +250 -0
  54. package/profile/SCHEMA.md +749 -0
  55. package/profile/cohorte.config.template.yaml +43 -0
  56. package/scripts/feature-diff.sh +118 -0
  57. package/scripts/kanban-move.sh +307 -0
  58. package/scripts/metrics/collect.mjs +542 -0
  59. package/scripts/metrics/prices.json +42 -0
  60. package/scripts/new-feature.sh.template +122 -0
  61. package/scripts/preflight.sh +114 -0
  62. package/scripts/remove-feature.sh.template +56 -0
  63. package/assets/manifest.json +0 -203
  64. package/assets/migrations/config/README.md +0 -12
  65. package/assets/migrations/state/0001_init.sql +0 -154
  66. package/assets/prompts/README.md +0 -11
  67. package/assets/prompts/agents/brainstormer.md +0 -3
  68. package/assets/prompts/agents/fixer.md +0 -7
  69. package/assets/prompts/agents/implementer.md +0 -12
  70. package/assets/prompts/agents/reviewer.md +0 -8
  71. package/assets/prompts/agents/security-reviewer.md +0 -7
  72. package/assets/prompts/agents/spec-author.md +0 -3
  73. package/assets/prompts/phases/build.md +0 -5
  74. package/assets/prompts/phases/review.md +0 -5
  75. package/assets/prompts/phases/test.md +0 -5
  76. package/assets/prompts/system.md +0 -11
  77. package/assets/schemas/agent-output.schema.json +0 -225
  78. package/assets/schemas/auth-status.schema.json +0 -87
  79. package/assets/schemas/command-result.schema.json +0 -192
  80. package/assets/schemas/commands.schema.json +0 -959
  81. package/assets/schemas/config.schema.json +0 -2281
  82. package/assets/schemas/doctor-report.schema.json +0 -104
  83. package/assets/schemas/events.schema.json +0 -8514
  84. package/assets/schemas/fake-script.schema.json +0 -549
  85. package/assets/schemas/inspect.schema.json +0 -3133
  86. package/assets/schemas/manifest.schema.json +0 -79
  87. package/assets/schemas/ownership.schema.json +0 -52
  88. package/assets/schemas/policy-verdict.schema.json +0 -282
  89. package/assets/schemas/project-model.schema.json +0 -783
  90. package/assets/schemas/project-status.schema.json +0 -217
  91. package/assets/schemas/reconcile-plan.schema.json +0 -154
  92. package/assets/schemas/run-diff.schema.json +0 -177
  93. package/assets/schemas/run-snapshot-manifest.schema.json +0 -2104
  94. package/assets/schemas/run-state.schema.json +0 -1755
  95. package/assets/schemas/runtime-capabilities.schema.json +0 -1545
  96. package/assets/schemas/sandbox-capabilities.schema.json +0 -116
  97. package/assets/schemas/skill.schema.json +0 -87
  98. package/assets/schemas/spec.schema.json +0 -202
  99. package/assets/schemas/tool-catalogue.schema.json +0 -655
  100. package/assets/schemas/trust-record.schema.json +0 -38
  101. package/assets/skills/README.md +0 -9
  102. package/assets/skills/inspect-surface.md +0 -4
  103. package/dist/agent-host.mjs +0 -2187
  104. package/dist/agent-host.mjs.map +0 -1
  105. package/dist/bundle-manifest.json +0 -128
  106. package/dist/chunks/__host-DgGPyco9.mjs +0 -18
  107. package/dist/chunks/__host-DgGPyco9.mjs.map +0 -1
  108. package/dist/chunks/align-ds-r_X_1aQ_.mjs +0 -93
  109. package/dist/chunks/align-ds-r_X_1aQ_.mjs.map +0 -1
  110. package/dist/chunks/approve-Cv135UqI.mjs +0 -19
  111. package/dist/chunks/approve-Cv135UqI.mjs.map +0 -1
  112. package/dist/chunks/audit-B4ZWQ_DI.mjs +0 -179
  113. package/dist/chunks/audit-B4ZWQ_DI.mjs.map +0 -1
  114. package/dist/chunks/auth-BT5oVp76.mjs +0 -132
  115. package/dist/chunks/auth-BT5oVp76.mjs.map +0 -1
  116. package/dist/chunks/auth-Dnlksuo5.mjs +0 -141
  117. package/dist/chunks/auth-Dnlksuo5.mjs.map +0 -1
  118. package/dist/chunks/brainstorm-DasVwI1D.mjs +0 -123
  119. package/dist/chunks/brainstorm-DasVwI1D.mjs.map +0 -1
  120. package/dist/chunks/build-crOld8gE.mjs +0 -19
  121. package/dist/chunks/build-crOld8gE.mjs.map +0 -1
  122. package/dist/chunks/cancel-KV_cpsqS.mjs +0 -15
  123. package/dist/chunks/cancel-KV_cpsqS.mjs.map +0 -1
  124. package/dist/chunks/canonical-C8UxeEmB.mjs +0 -57
  125. package/dist/chunks/canonical-C8UxeEmB.mjs.map +0 -1
  126. package/dist/chunks/catalogue-IaCJdfB8.mjs +0 -1549
  127. package/dist/chunks/catalogue-IaCJdfB8.mjs.map +0 -1
  128. package/dist/chunks/compose-DRKjQcn0.mjs +0 -7333
  129. package/dist/chunks/compose-DRKjQcn0.mjs.map +0 -1
  130. package/dist/chunks/config-Cqu5XQoP.mjs +0 -96
  131. package/dist/chunks/config-Cqu5XQoP.mjs.map +0 -1
  132. package/dist/chunks/contract-DjssDPpS.mjs +0 -335
  133. package/dist/chunks/contract-DjssDPpS.mjs.map +0 -1
  134. package/dist/chunks/contract-bQ9FJl4N.mjs +0 -123
  135. package/dist/chunks/contract-bQ9FJl4N.mjs.map +0 -1
  136. package/dist/chunks/deny-ClTxSvHJ.mjs +0 -15
  137. package/dist/chunks/deny-ClTxSvHJ.mjs.map +0 -1
  138. package/dist/chunks/diff-Qw0II0sj.mjs +0 -101
  139. package/dist/chunks/diff-Qw0II0sj.mjs.map +0 -1
  140. package/dist/chunks/discover-BZPolSZG.mjs +0 -21
  141. package/dist/chunks/discover-BZPolSZG.mjs.map +0 -1
  142. package/dist/chunks/doctor-DcDFPvQM.mjs +0 -222
  143. package/dist/chunks/doctor-DcDFPvQM.mjs.map +0 -1
  144. package/dist/chunks/fix-B_oGzGVn.mjs +0 -82
  145. package/dist/chunks/fix-B_oGzGVn.mjs.map +0 -1
  146. package/dist/chunks/fleet-yWHQY2ya.mjs +0 -297
  147. package/dist/chunks/fleet-yWHQY2ya.mjs.map +0 -1
  148. package/dist/chunks/gc-BBXlBF5w.mjs +0 -161
  149. package/dist/chunks/gc-BBXlBF5w.mjs.map +0 -1
  150. package/dist/chunks/init--FxxkrcT.mjs +0 -63
  151. package/dist/chunks/init--FxxkrcT.mjs.map +0 -1
  152. package/dist/chunks/inspect-Buby4cQD.mjs +0 -22
  153. package/dist/chunks/inspect-Buby4cQD.mjs.map +0 -1
  154. package/dist/chunks/intake-Dd1KVXnO.mjs +0 -12
  155. package/dist/chunks/intake-Dd1KVXnO.mjs.map +0 -1
  156. package/dist/chunks/logs-Giq5sUau.mjs +0 -25
  157. package/dist/chunks/logs-Giq5sUau.mjs.map +0 -1
  158. package/dist/chunks/loop-BWsUpyus.mjs +0 -212
  159. package/dist/chunks/loop-BWsUpyus.mjs.map +0 -1
  160. package/dist/chunks/migrate-DuYCAbE3.mjs +0 -33
  161. package/dist/chunks/migrate-DuYCAbE3.mjs.map +0 -1
  162. package/dist/chunks/models-Btp6X2YZ.mjs +0 -24
  163. package/dist/chunks/models-Btp6X2YZ.mjs.map +0 -1
  164. package/dist/chunks/obsidian-BHLkXx_H.mjs +0 -235
  165. package/dist/chunks/obsidian-BHLkXx_H.mjs.map +0 -1
  166. package/dist/chunks/patch-sAgVqjpx.mjs +0 -50
  167. package/dist/chunks/patch-sAgVqjpx.mjs.map +0 -1
  168. package/dist/chunks/pause-BASBfKLO.mjs +0 -16
  169. package/dist/chunks/pause-BASBfKLO.mjs.map +0 -1
  170. package/dist/chunks/policy-Du7WVBFX.mjs +0 -139
  171. package/dist/chunks/policy-Du7WVBFX.mjs.map +0 -1
  172. package/dist/chunks/providers-Dx78imKj.mjs +0 -19
  173. package/dist/chunks/providers-Dx78imKj.mjs.map +0 -1
  174. package/dist/chunks/reconcile-BHn66X3C.mjs +0 -50
  175. package/dist/chunks/reconcile-BHn66X3C.mjs.map +0 -1
  176. package/dist/chunks/refactor-CoNoqLZr.mjs +0 -153
  177. package/dist/chunks/refactor-CoNoqLZr.mjs.map +0 -1
  178. package/dist/chunks/render-DyZr5Lgi.mjs +0 -53
  179. package/dist/chunks/render-DyZr5Lgi.mjs.map +0 -1
  180. package/dist/chunks/resume-GJQRb2Eb.mjs +0 -15
  181. package/dist/chunks/resume-GJQRb2Eb.mjs.map +0 -1
  182. package/dist/chunks/retro-Dr-2RTNN.mjs +0 -78
  183. package/dist/chunks/retro-Dr-2RTNN.mjs.map +0 -1
  184. package/dist/chunks/retry-CLrUem1H.mjs +0 -15
  185. package/dist/chunks/retry-CLrUem1H.mjs.map +0 -1
  186. package/dist/chunks/review-ZsBqp3vZ.mjs +0 -35
  187. package/dist/chunks/review-ZsBqp3vZ.mjs.map +0 -1
  188. package/dist/chunks/run-NGAxdsIX.mjs +0 -105
  189. package/dist/chunks/run-NGAxdsIX.mjs.map +0 -1
  190. package/dist/chunks/run-tool-C3rAv4XF.mjs +0 -26
  191. package/dist/chunks/run-tool-C3rAv4XF.mjs.map +0 -1
  192. package/dist/chunks/scan-C5uDr7Yq.mjs +0 -167
  193. package/dist/chunks/scan-C5uDr7Yq.mjs.map +0 -1
  194. package/dist/chunks/schema-Bq9qtgsd.mjs +0 -583
  195. package/dist/chunks/schema-Bq9qtgsd.mjs.map +0 -1
  196. package/dist/chunks/send-BdnJ85Nz.mjs +0 -19
  197. package/dist/chunks/send-BdnJ85Nz.mjs.map +0 -1
  198. package/dist/chunks/ship-BizfUe62.mjs +0 -140
  199. package/dist/chunks/ship-BizfUe62.mjs.map +0 -1
  200. package/dist/chunks/shutdown-BM92Iyv2.mjs +0 -15
  201. package/dist/chunks/shutdown-BM92Iyv2.mjs.map +0 -1
  202. package/dist/chunks/skip-DZG5kpcH.mjs +0 -18
  203. package/dist/chunks/skip-DZG5kpcH.mjs.map +0 -1
  204. package/dist/chunks/spec-C2h3U64g.mjs +0 -65
  205. package/dist/chunks/spec-C2h3U64g.mjs.map +0 -1
  206. package/dist/chunks/spec-path-tptqR7W8.mjs +0 -10
  207. package/dist/chunks/spec-path-tptqR7W8.mjs.map +0 -1
  208. package/dist/chunks/src-Bfr1yzsn.mjs +0 -1689
  209. package/dist/chunks/src-Bfr1yzsn.mjs.map +0 -1
  210. package/dist/chunks/src-CPW2_Ons.mjs +0 -5487
  211. package/dist/chunks/src-CPW2_Ons.mjs.map +0 -1
  212. package/dist/chunks/src-Cu3TxNob.mjs +0 -783
  213. package/dist/chunks/src-Cu3TxNob.mjs.map +0 -1
  214. package/dist/chunks/src-DNsLSxgm.mjs +0 -928
  215. package/dist/chunks/src-DNsLSxgm.mjs.map +0 -1
  216. package/dist/chunks/src-DbS9gkJy.mjs +0 -117
  217. package/dist/chunks/src-DbS9gkJy.mjs.map +0 -1
  218. package/dist/chunks/src-yi5whv3n.mjs +0 -2118
  219. package/dist/chunks/src-yi5whv3n.mjs.map +0 -1
  220. package/dist/chunks/status-SMjiOMYy.mjs +0 -29
  221. package/dist/chunks/status-SMjiOMYy.mjs.map +0 -1
  222. package/dist/chunks/tail-BuhT-2PH.mjs +0 -25
  223. package/dist/chunks/tail-BuhT-2PH.mjs.map +0 -1
  224. package/dist/chunks/update-BXIppsbi.mjs +0 -16
  225. package/dist/chunks/update-BXIppsbi.mjs.map +0 -1
  226. package/dist/chunks/update-pipeline-Du-Gu1Pl.mjs +0 -56
  227. package/dist/chunks/update-pipeline-Du-Gu1Pl.mjs.map +0 -1
  228. package/dist/cli.mjs +0 -186
  229. package/dist/cli.mjs.map +0 -1
@@ -1,1755 +0,0 @@
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
- }