@kindgi/api 0.1.4-rc.0 → 0.1.4-rc.2

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 (262) hide show
  1. package/dist/agent-binding.d.ts +20 -2
  2. package/dist/agent-binding.d.ts.map +1 -1
  3. package/dist/agent-pins.d.ts.map +1 -1
  4. package/dist/agent-pins.js +4 -1
  5. package/dist/agent-pins.js.map +1 -1
  6. package/dist/app.d.ts +8 -0
  7. package/dist/app.d.ts.map +1 -1
  8. package/dist/app.js +30 -5
  9. package/dist/app.js.map +1 -1
  10. package/dist/deploy-versions.d.ts +10 -5
  11. package/dist/deploy-versions.d.ts.map +1 -1
  12. package/dist/deploy-versions.js +4 -10
  13. package/dist/deploy-versions.js.map +1 -1
  14. package/dist/derive-agent-version.d.ts +9 -1
  15. package/dist/derive-agent-version.d.ts.map +1 -1
  16. package/dist/derive-agent-version.js +11 -1
  17. package/dist/derive-agent-version.js.map +1 -1
  18. package/dist/errors.d.ts.map +1 -1
  19. package/dist/errors.js +26 -0
  20. package/dist/errors.js.map +1 -1
  21. package/dist/eval-case-binding.d.ts +10 -0
  22. package/dist/eval-case-binding.d.ts.map +1 -1
  23. package/dist/eval-run-binding.d.ts +21 -3
  24. package/dist/eval-run-binding.d.ts.map +1 -1
  25. package/dist/eval-run-binding.js.map +1 -1
  26. package/dist/eval-run-dispatcher.d.ts +3 -0
  27. package/dist/eval-run-dispatcher.d.ts.map +1 -1
  28. package/dist/eval-run-dispatcher.js.map +1 -1
  29. package/dist/flow-binding.d.ts +8 -0
  30. package/dist/flow-binding.d.ts.map +1 -1
  31. package/dist/flow-pins.d.ts +20 -7
  32. package/dist/flow-pins.d.ts.map +1 -1
  33. package/dist/flow-pins.js +36 -11
  34. package/dist/flow-pins.js.map +1 -1
  35. package/dist/gate-policy-binding.d.ts +164 -0
  36. package/dist/gate-policy-binding.d.ts.map +1 -0
  37. package/dist/gate-policy-binding.js +12 -0
  38. package/dist/gate-policy-binding.js.map +1 -0
  39. package/dist/gate.d.ts +56 -0
  40. package/dist/gate.d.ts.map +1 -0
  41. package/dist/gate.js +359 -0
  42. package/dist/gate.js.map +1 -0
  43. package/dist/guardrail-binding.d.ts +8 -0
  44. package/dist/guardrail-binding.d.ts.map +1 -1
  45. package/dist/handler-binding.d.ts +17 -2
  46. package/dist/handler-binding.d.ts.map +1 -1
  47. package/dist/index.d.ts +11 -4
  48. package/dist/index.d.ts.map +1 -1
  49. package/dist/index.js +3 -1
  50. package/dist/index.js.map +1 -1
  51. package/dist/judged-dispatcher.d.ts +20 -1
  52. package/dist/judged-dispatcher.d.ts.map +1 -1
  53. package/dist/judged-dispatcher.js +57 -7
  54. package/dist/judged-dispatcher.js.map +1 -1
  55. package/dist/judgment-binding.d.ts +38 -0
  56. package/dist/judgment-binding.d.ts.map +1 -1
  57. package/dist/judgment-binding.js +19 -0
  58. package/dist/judgment-binding.js.map +1 -1
  59. package/dist/live-version-binding.d.ts +206 -0
  60. package/dist/live-version-binding.d.ts.map +1 -0
  61. package/dist/live-version-binding.js +4 -0
  62. package/dist/live-version-binding.js.map +1 -0
  63. package/dist/middleware/authorize.d.ts.map +1 -1
  64. package/dist/middleware/authorize.js +13 -2
  65. package/dist/middleware/authorize.js.map +1 -1
  66. package/dist/middleware/project-ref.d.ts +25 -0
  67. package/dist/middleware/project-ref.d.ts.map +1 -0
  68. package/dist/middleware/project-ref.js +72 -0
  69. package/dist/middleware/project-ref.js.map +1 -0
  70. package/dist/openapi/generate.d.ts.map +1 -1
  71. package/dist/openapi/generate.js +4 -0
  72. package/dist/openapi/generate.js.map +1 -1
  73. package/dist/openapi/operations.d.ts +6 -0
  74. package/dist/openapi/operations.d.ts.map +1 -1
  75. package/dist/openapi/operations.js +524 -27
  76. package/dist/openapi/operations.js.map +1 -1
  77. package/dist/openapi/schemas.d.ts +43 -0
  78. package/dist/openapi/schemas.d.ts.map +1 -1
  79. package/dist/openapi/schemas.js +1050 -7
  80. package/dist/openapi/schemas.js.map +1 -1
  81. package/dist/publish-refused.d.ts +18 -0
  82. package/dist/publish-refused.d.ts.map +1 -0
  83. package/dist/publish-refused.js +22 -0
  84. package/dist/publish-refused.js.map +1 -0
  85. package/dist/registry-read-only.d.ts +32 -0
  86. package/dist/registry-read-only.d.ts.map +1 -0
  87. package/dist/registry-read-only.js +22 -0
  88. package/dist/registry-read-only.js.map +1 -0
  89. package/dist/retention-binding.d.ts +29 -0
  90. package/dist/retention-binding.d.ts.map +1 -1
  91. package/dist/routes/agent-releases.d.ts +40 -0
  92. package/dist/routes/agent-releases.d.ts.map +1 -0
  93. package/dist/routes/agent-releases.js +462 -0
  94. package/dist/routes/agent-releases.js.map +1 -0
  95. package/dist/routes/agents.d.ts +7 -1
  96. package/dist/routes/agents.d.ts.map +1 -1
  97. package/dist/routes/agents.js +38 -4
  98. package/dist/routes/agents.js.map +1 -1
  99. package/dist/routes/approvals.d.ts.map +1 -1
  100. package/dist/routes/approvals.js +27 -9
  101. package/dist/routes/approvals.js.map +1 -1
  102. package/dist/routes/audit.d.ts.map +1 -1
  103. package/dist/routes/audit.js +7 -0
  104. package/dist/routes/audit.js.map +1 -1
  105. package/dist/routes/auth.js +1 -1
  106. package/dist/routes/auth.js.map +1 -1
  107. package/dist/routes/blocks.d.ts.map +1 -1
  108. package/dist/routes/blocks.js +37 -12
  109. package/dist/routes/blocks.js.map +1 -1
  110. package/dist/routes/conversations.d.ts +0 -7
  111. package/dist/routes/conversations.d.ts.map +1 -1
  112. package/dist/routes/conversations.js +19 -3
  113. package/dist/routes/conversations.js.map +1 -1
  114. package/dist/routes/deployments.d.ts +6 -0
  115. package/dist/routes/deployments.d.ts.map +1 -1
  116. package/dist/routes/deployments.js +49 -5
  117. package/dist/routes/deployments.js.map +1 -1
  118. package/dist/routes/env.d.ts.map +1 -1
  119. package/dist/routes/env.js +1 -0
  120. package/dist/routes/env.js.map +1 -1
  121. package/dist/routes/eval-comparison.d.ts +4 -2
  122. package/dist/routes/eval-comparison.d.ts.map +1 -1
  123. package/dist/routes/eval-comparison.js +59 -10
  124. package/dist/routes/eval-comparison.js.map +1 -1
  125. package/dist/routes/eval-runs.d.ts +7 -1
  126. package/dist/routes/eval-runs.d.ts.map +1 -1
  127. package/dist/routes/eval-runs.js +34 -3
  128. package/dist/routes/eval-runs.js.map +1 -1
  129. package/dist/routes/eval-versions.d.ts +25 -0
  130. package/dist/routes/eval-versions.d.ts.map +1 -0
  131. package/dist/routes/eval-versions.js +66 -0
  132. package/dist/routes/eval-versions.js.map +1 -0
  133. package/dist/routes/flows.d.ts +14 -7
  134. package/dist/routes/flows.d.ts.map +1 -1
  135. package/dist/routes/flows.js +14 -8
  136. package/dist/routes/flows.js.map +1 -1
  137. package/dist/routes/gate-policies.d.ts +19 -0
  138. package/dist/routes/gate-policies.d.ts.map +1 -0
  139. package/dist/routes/gate-policies.js +191 -0
  140. package/dist/routes/gate-policies.js.map +1 -0
  141. package/dist/routes/gate-policy-spec.d.ts +17 -0
  142. package/dist/routes/gate-policy-spec.d.ts.map +1 -0
  143. package/dist/routes/gate-policy-spec.js +192 -0
  144. package/dist/routes/gate-policy-spec.js.map +1 -0
  145. package/dist/routes/gate-policy-wire.d.ts +3 -0
  146. package/dist/routes/gate-policy-wire.d.ts.map +1 -0
  147. package/dist/routes/gate-policy-wire.js +18 -0
  148. package/dist/routes/gate-policy-wire.js.map +1 -0
  149. package/dist/routes/guardrails.d.ts.map +1 -1
  150. package/dist/routes/guardrails.js +4 -0
  151. package/dist/routes/guardrails.js.map +1 -1
  152. package/dist/routes/hierarchy-errors.d.ts +21 -0
  153. package/dist/routes/hierarchy-errors.d.ts.map +1 -1
  154. package/dist/routes/hierarchy-errors.js +21 -0
  155. package/dist/routes/hierarchy-errors.js.map +1 -1
  156. package/dist/routes/judged-suites.js +7 -0
  157. package/dist/routes/judged-suites.js.map +1 -1
  158. package/dist/routes/judgments.d.ts +4 -1
  159. package/dist/routes/judgments.d.ts.map +1 -1
  160. package/dist/routes/judgments.js +92 -19
  161. package/dist/routes/judgments.js.map +1 -1
  162. package/dist/routes/live-scope-wire.d.ts +32 -0
  163. package/dist/routes/live-scope-wire.d.ts.map +1 -0
  164. package/dist/routes/live-scope-wire.js +71 -0
  165. package/dist/routes/live-scope-wire.js.map +1 -0
  166. package/dist/routes/policies.d.ts +6 -3
  167. package/dist/routes/policies.d.ts.map +1 -1
  168. package/dist/routes/policies.js +55 -3
  169. package/dist/routes/policies.js.map +1 -1
  170. package/dist/routes/projects.d.ts.map +1 -1
  171. package/dist/routes/projects.js +59 -9
  172. package/dist/routes/projects.js.map +1 -1
  173. package/dist/routes/retention.d.ts.map +1 -1
  174. package/dist/routes/retention.js +18 -2
  175. package/dist/routes/retention.js.map +1 -1
  176. package/dist/routes/reviewers.d.ts +8 -1
  177. package/dist/routes/reviewers.d.ts.map +1 -1
  178. package/dist/routes/reviewers.js +20 -3
  179. package/dist/routes/reviewers.js.map +1 -1
  180. package/dist/routes/runs.d.ts.map +1 -1
  181. package/dist/routes/runs.js +23 -13
  182. package/dist/routes/runs.js.map +1 -1
  183. package/dist/routes/secrets.d.ts.map +1 -1
  184. package/dist/routes/secrets.js +2 -0
  185. package/dist/routes/secrets.js.map +1 -1
  186. package/dist/routes/segments.d.ts +17 -0
  187. package/dist/routes/segments.d.ts.map +1 -0
  188. package/dist/routes/segments.js +68 -0
  189. package/dist/routes/segments.js.map +1 -0
  190. package/dist/routes/teams.d.ts.map +1 -1
  191. package/dist/routes/teams.js +53 -8
  192. package/dist/routes/teams.js.map +1 -1
  193. package/dist/routes/tools.d.ts.map +1 -1
  194. package/dist/routes/tools.js +4 -0
  195. package/dist/routes/tools.js.map +1 -1
  196. package/dist/routes/uuid-param.d.ts +11 -0
  197. package/dist/routes/uuid-param.d.ts.map +1 -0
  198. package/dist/routes/uuid-param.js +19 -0
  199. package/dist/routes/uuid-param.js.map +1 -0
  200. package/dist/tool-binding.d.ts +8 -0
  201. package/dist/tool-binding.d.ts.map +1 -1
  202. package/openapi.json +6484 -2402
  203. package/package.json +21 -21
  204. package/src/agent-binding.ts +21 -2
  205. package/src/agent-pins.ts +3 -1
  206. package/src/app.ts +47 -4
  207. package/src/deploy-versions.ts +12 -15
  208. package/src/derive-agent-version.ts +12 -1
  209. package/src/errors.ts +26 -0
  210. package/src/eval-case-binding.ts +7 -0
  211. package/src/eval-run-binding.ts +31 -3
  212. package/src/eval-run-dispatcher.ts +3 -0
  213. package/src/flow-binding.ts +9 -0
  214. package/src/flow-pins.ts +49 -9
  215. package/src/gate-policy-binding.ts +171 -0
  216. package/src/gate.ts +467 -0
  217. package/src/guardrail-binding.ts +9 -0
  218. package/src/handler-binding.ts +17 -2
  219. package/src/index.ts +47 -1
  220. package/src/judged-dispatcher.ts +100 -9
  221. package/src/judgment-binding.ts +62 -0
  222. package/src/live-version-binding.ts +237 -0
  223. package/src/middleware/authorize.ts +18 -2
  224. package/src/middleware/project-ref.ts +88 -0
  225. package/src/openapi/generate.ts +5 -0
  226. package/src/openapi/operations.ts +664 -27
  227. package/src/openapi/schemas.ts +1175 -33
  228. package/src/publish-refused.ts +31 -0
  229. package/src/registry-read-only.ts +43 -0
  230. package/src/retention-binding.ts +30 -0
  231. package/src/routes/agent-releases.ts +581 -0
  232. package/src/routes/agents.ts +53 -3
  233. package/src/routes/approvals.ts +36 -8
  234. package/src/routes/audit.ts +10 -0
  235. package/src/routes/auth.ts +1 -1
  236. package/src/routes/blocks.ts +39 -14
  237. package/src/routes/conversations.ts +31 -3
  238. package/src/routes/deployments.ts +75 -5
  239. package/src/routes/env.ts +1 -0
  240. package/src/routes/eval-comparison.ts +59 -11
  241. package/src/routes/eval-runs.ts +46 -3
  242. package/src/routes/eval-versions.ts +110 -0
  243. package/src/routes/flows.ts +34 -11
  244. package/src/routes/gate-policies.ts +226 -0
  245. package/src/routes/gate-policy-spec.ts +229 -0
  246. package/src/routes/gate-policy-wire.ts +20 -0
  247. package/src/routes/guardrails.ts +7 -0
  248. package/src/routes/hierarchy-errors.ts +23 -0
  249. package/src/routes/judged-suites.ts +5 -0
  250. package/src/routes/judgments.ts +107 -23
  251. package/src/routes/live-scope-wire.ts +90 -0
  252. package/src/routes/policies.ts +61 -3
  253. package/src/routes/projects.ts +72 -9
  254. package/src/routes/retention.ts +21 -2
  255. package/src/routes/reviewers.ts +23 -4
  256. package/src/routes/runs.ts +34 -20
  257. package/src/routes/secrets.ts +2 -0
  258. package/src/routes/segments.ts +75 -0
  259. package/src/routes/teams.ts +66 -8
  260. package/src/routes/tools.ts +7 -0
  261. package/src/routes/uuid-param.ts +28 -0
  262. package/src/tool-binding.ts +9 -0
@@ -62,12 +62,18 @@
62
62
  * per-route parsers in `routes/*.ts` validate ad hoc.
63
63
  */
64
64
  import { EVIDENCE_KINDS } from '@kindgi/compliance';
65
- import { MAX_TOOL_ERROR_RETRIES, POLICY_KINDS, TOOL_ERROR_KINDS } from '@kindgi/policy-contract';
65
+ import { MAX_TOOL_ERROR_RETRIES, POLICY_KINDS, RETENTION_DOMAINS, TOOL_ERROR_KINDS, } from '@kindgi/policy-contract';
66
+ import { ERROR_CODE_TO_STATUS } from '../errors.js';
66
67
  // ---------------- shared shapes ----------------
67
68
  export const WireErrorSchema = {
68
69
  type: 'object',
69
70
  additionalProperties: false,
70
71
  required: ['error'],
72
+ // Every code the API answers with, and its HTTP status. Not a closed
73
+ // list for clients (a newer server may add codes); the clients' tests
74
+ // read it to check that each 4xx code maps to a typed error, not to a
75
+ // server error. Generators and validators ignore `x-` keys.
76
+ 'x-error-codes': ERROR_CODE_TO_STATUS,
71
77
  properties: {
72
78
  error: {
73
79
  type: 'object',
@@ -128,6 +134,387 @@ export const RunAgentSchema = {
128
134
  id: { type: 'string', description: 'The agent id.' },
129
135
  version: { type: 'string', description: 'The agent version that ran (semver).' },
130
136
  conversationId: { type: 'string', format: 'uuid' },
137
+ via: {
138
+ type: 'string',
139
+ enum: ['explicit', 'flow-pin', 'conversation', 'live', 'latest'],
140
+ description: "Why this version ran: named by the caller (`explicit`); held by the flow version a flow's agent step runs in (`flow-pin`: the node's `config.version`, else the version the flow version pinned when it was published); the conversation's own (`conversation`); the version live for the run's scope (`live`); or the latest, nothing being live (`latest`). Absent on runs from before Kindgi 0.1.4.",
141
+ },
142
+ liveScope: {
143
+ $ref: '#/components/schemas/LiveScope',
144
+ description: 'The pin that chose the version, when `via` is `live`.',
145
+ },
146
+ },
147
+ };
148
+ export const ScopeSegmentSchema = {
149
+ type: 'object',
150
+ additionalProperties: false,
151
+ required: ['key', 'value'],
152
+ properties: {
153
+ key: {
154
+ type: 'string',
155
+ pattern: '^[a-z][a-z0-9_-]{0,63}$',
156
+ description: 'Lowercase, like an identifier: `company`, `contact-role`.',
157
+ },
158
+ value: { type: 'string', minLength: 1, maxLength: 256 },
159
+ },
160
+ };
161
+ const liveScopeVariant = (kind, description, properties) => ({
162
+ type: 'object',
163
+ additionalProperties: false,
164
+ required: ['kind', ...Object.keys(properties)],
165
+ description,
166
+ properties: { kind: { type: 'string', enum: [kind] }, ...properties },
167
+ });
168
+ export const LiveScopeTenantSchema = liveScopeVariant('tenant', "The agent's default for the whole tenant.", {});
169
+ export const LiveScopeOrgSchema = liveScopeVariant('org', "An org's projects.", {
170
+ orgId: { type: 'string', format: 'uuid' },
171
+ });
172
+ export const LiveScopeProjectSchema = liveScopeVariant('project', 'One project.', {
173
+ projectId: { type: 'string', format: 'uuid' },
174
+ });
175
+ export const LiveScopeSegmentSchema = liveScopeVariant('segment', 'A segment path within a project: it covers every run whose path starts with it.', {
176
+ projectId: { type: 'string', format: 'uuid' },
177
+ path: {
178
+ type: 'array',
179
+ minItems: 1,
180
+ maxItems: 8,
181
+ items: { $ref: '#/components/schemas/ScopeSegment' },
182
+ },
183
+ });
184
+ export const LiveScopeSchema = {
185
+ description: 'Where a live version is pinned, from least to most specific: tenant, org, project, segment path. A run takes the most specific pin that covers it.',
186
+ oneOf: [
187
+ { $ref: '#/components/schemas/LiveScopeTenant' },
188
+ { $ref: '#/components/schemas/LiveScopeOrg' },
189
+ { $ref: '#/components/schemas/LiveScopeProject' },
190
+ { $ref: '#/components/schemas/LiveScopeSegment' },
191
+ ],
192
+ discriminator: { propertyName: 'kind' },
193
+ };
194
+ export const LiveVersionResolutionSchema = {
195
+ type: 'object',
196
+ additionalProperties: false,
197
+ required: ['agentId', 'version', 'via'],
198
+ properties: {
199
+ agentId: { type: 'string' },
200
+ version: { type: 'string', description: 'The version a run would use (semver).' },
201
+ via: {
202
+ type: 'string',
203
+ enum: ['live', 'latest'],
204
+ description: 'A live pin chose it, or nothing is live on the way up and it is the latest.',
205
+ },
206
+ liveScope: { $ref: '#/components/schemas/LiveScope' },
207
+ },
208
+ };
209
+ export const LivePinSchema = {
210
+ type: 'object',
211
+ additionalProperties: false,
212
+ required: ['agentId', 'scope', 'version', 'promotionId', 'setAt'],
213
+ properties: {
214
+ agentId: { type: 'string' },
215
+ scope: { $ref: '#/components/schemas/LiveScope' },
216
+ version: { type: 'string' },
217
+ promotionId: { type: 'string', format: 'uuid', description: 'The promotion that set it.' },
218
+ setAt: { type: 'string', format: 'date-time' },
219
+ },
220
+ };
221
+ export const LivePinListSchema = {
222
+ type: 'object',
223
+ additionalProperties: false,
224
+ required: ['data'],
225
+ properties: { data: { type: 'array', items: { $ref: '#/components/schemas/LivePin' } } },
226
+ };
227
+ export const PromotionSchema = {
228
+ type: 'object',
229
+ additionalProperties: false,
230
+ required: [
231
+ 'id',
232
+ 'agentId',
233
+ 'scope',
234
+ 'action',
235
+ 'fromVersion',
236
+ 'toVersion',
237
+ 'requestedBy',
238
+ 'createdAt',
239
+ ],
240
+ description: "One change of a scope's live version, kept for good: what was live before, what is after, who asked and why.",
241
+ properties: {
242
+ id: { type: 'string', format: 'uuid' },
243
+ agentId: { type: 'string' },
244
+ scope: { $ref: '#/components/schemas/LiveScope' },
245
+ action: { type: 'string', enum: ['promote', 'rollback', 'unpin'] },
246
+ fromVersion: {
247
+ type: ['string', 'null'],
248
+ description: "The scope's own pin before; null when it had none.",
249
+ },
250
+ toVersion: {
251
+ type: ['string', 'null'],
252
+ description: "The scope's own pin after; null after an unpin.",
253
+ },
254
+ requestedBy: {
255
+ type: 'object',
256
+ additionalProperties: false,
257
+ required: ['kind', 'id'],
258
+ properties: {
259
+ kind: { type: 'string', enum: ['user', 'service'] },
260
+ id: { type: 'string' },
261
+ },
262
+ },
263
+ reason: { type: 'string' },
264
+ evalRunId: { type: 'string', description: 'The comparison the change was judged on.' },
265
+ createdAt: { type: 'string', format: 'date-time' },
266
+ status: {
267
+ type: 'string',
268
+ enum: ['promoted', 'pending-approval', 'refused', 'superseded', 'rejected', 'expired'],
269
+ description: "A `promote` row's state: it changes once, from `pending-approval` to its final state. Absent on rollback and unpin rows, and on promotions made before gates (`promoted`).",
270
+ },
271
+ policy: {
272
+ oneOf: [{ $ref: '#/components/schemas/GatePolicyRef' }, { type: 'null' }],
273
+ description: 'The gate policy that applied; null when none did. Absent before gates.',
274
+ },
275
+ checks: { type: 'array', items: { $ref: '#/components/schemas/GateCheck' } },
276
+ approvalId: {
277
+ type: 'string',
278
+ description: 'The approval a `pending-approval` promotion waits on (kept once decided).',
279
+ },
280
+ resolvedAt: {
281
+ type: 'string',
282
+ format: 'date-time',
283
+ description: 'When a `pending-approval` promotion reached its final state.',
284
+ },
285
+ },
286
+ };
287
+ export const PromotionPageSchema = {
288
+ type: 'object',
289
+ additionalProperties: false,
290
+ required: ['data', 'hasMore'],
291
+ properties: {
292
+ data: { type: 'array', items: { $ref: '#/components/schemas/Promotion' } },
293
+ hasMore: { type: 'boolean' },
294
+ nextCursor: { type: 'string' },
295
+ },
296
+ };
297
+ // ---------------- the promotion gate (evals step 4b) ----------------
298
+ export const GateCheckSchema = {
299
+ type: 'object',
300
+ additionalProperties: false,
301
+ required: ['name', 'passed', 'message'],
302
+ description: "One of a gate's checks, as the promotion records it.",
303
+ properties: {
304
+ name: {
305
+ type: 'string',
306
+ description: 'Stable: `comparison.required`, `comparison.status`, `comparison.freshness`, `comparison.suite`, `sameContents`, `baselineIsLive`, `scopeCovered`, `evidence.<metric>.minCases|minWeight|baselineMinCases|baselineMinWeight`, `metric.<metric>.k|minCandidate|maxDrop`, `replay.maxDiverged|maxErrors|maxRefusedWrites|maxStopped`, `classWeights.restrictedOnly`.',
307
+ },
308
+ passed: { type: 'boolean' },
309
+ message: {
310
+ type: 'string',
311
+ description: 'A plain sentence: what was found against what the policy asks.',
312
+ },
313
+ value: { type: ['number', 'string'] },
314
+ threshold: { type: ['number', 'string'] },
315
+ },
316
+ };
317
+ export const GatePolicyRefSchema = {
318
+ type: 'object',
319
+ additionalProperties: false,
320
+ required: ['id', 'version'],
321
+ properties: { id: { type: 'string' }, version: { type: 'string' } },
322
+ };
323
+ export const GateApprovalSchema = {
324
+ type: 'object',
325
+ additionalProperties: false,
326
+ required: ['role', 'count', 'separateApprover'],
327
+ description: 'The approval a passing promotion waits for.',
328
+ properties: {
329
+ role: { type: 'string', enum: ['standard', 'senior', 'admin'] },
330
+ count: { type: 'integer', minimum: 1 },
331
+ separateApprover: {
332
+ type: 'boolean',
333
+ description: 'Whoever asked for the promotion may not approve it.',
334
+ },
335
+ },
336
+ };
337
+ const GateMetricSpecSchema = {
338
+ type: 'object',
339
+ additionalProperties: false,
340
+ required: ['name'],
341
+ properties: {
342
+ name: { type: 'string', enum: ['weightedYesShare', 'judgedCoverage', 'weightedPrecisionAtK'] },
343
+ k: {
344
+ type: 'integer',
345
+ minimum: 1,
346
+ maximum: 100,
347
+ description: "`weightedPrecisionAtK` only: the summary's `k` must be this.",
348
+ },
349
+ minCandidate: { type: 'number', minimum: 0, maximum: 1 },
350
+ maxDrop: {
351
+ type: 'number',
352
+ minimum: 0,
353
+ maximum: 1,
354
+ description: 'How far the candidate may fall below the baseline (the live version).',
355
+ },
356
+ },
357
+ };
358
+ export const GatePolicySpecSchema = {
359
+ type: 'object',
360
+ additionalProperties: false,
361
+ description: 'What a promotion must show. Every part is optional; an empty spec checks nothing. A promotion must name a comparison (`evalRunId`) exactly when the spec has `comparison`, `evidence`, `metrics`, `replay` or `onlyRestrictedClasses`. Unknown keys are refused.',
362
+ properties: {
363
+ comparison: {
364
+ type: 'object',
365
+ additionalProperties: false,
366
+ properties: {
367
+ maxAgeHours: { type: 'number', exclusiveMinimum: 0 },
368
+ suite: {
369
+ type: 'object',
370
+ additionalProperties: false,
371
+ required: ['id'],
372
+ properties: { id: { type: 'string' }, version: { type: 'string' } },
373
+ },
374
+ },
375
+ },
376
+ evidence: {
377
+ type: 'object',
378
+ additionalProperties: false,
379
+ description: "The judged evidence behind each gated metric; for a metric with `maxDrop`, the baseline's too.",
380
+ properties: {
381
+ minCases: { type: 'integer', minimum: 0 },
382
+ minWeight: { type: 'number', minimum: 0 },
383
+ },
384
+ },
385
+ metrics: { type: 'array', items: GateMetricSpecSchema },
386
+ replay: {
387
+ type: 'object',
388
+ additionalProperties: false,
389
+ description: 'Each knob left out of the block is 0. No block: no replay checks.',
390
+ properties: {
391
+ maxDiverged: { type: 'integer', minimum: 0 },
392
+ maxErrors: { type: 'integer', minimum: 0 },
393
+ maxRefusedWrites: { type: 'integer', minimum: 0 },
394
+ maxStopped: { type: 'integer', minimum: 0 },
395
+ },
396
+ },
397
+ approvals: {
398
+ type: 'object',
399
+ additionalProperties: false,
400
+ description: 'A passing promotion waits for a reviewer.',
401
+ properties: {
402
+ role: {
403
+ type: 'string',
404
+ enum: ['standard', 'senior', 'admin'],
405
+ description: 'Default `senior`.',
406
+ },
407
+ separateApprover: { type: 'boolean', description: 'Default `true`.' },
408
+ },
409
+ },
410
+ onlyRestrictedClasses: {
411
+ type: 'boolean',
412
+ description: "Only restricted judge classes count: the comparison must be weighted `restricted-only`, so a class anyone may assert can't move the gate.",
413
+ },
414
+ },
415
+ };
416
+ export const GatePolicySchema = {
417
+ type: 'object',
418
+ additionalProperties: false,
419
+ required: ['id', 'version', 'agentId', 'scope', 'spec', 'createdAt'],
420
+ properties: {
421
+ id: { type: 'string' },
422
+ version: { type: 'string' },
423
+ agentId: { type: 'string' },
424
+ scope: { $ref: '#/components/schemas/LiveScope' },
425
+ spec: { $ref: '#/components/schemas/GatePolicySpec' },
426
+ description: { type: 'string' },
427
+ createdAt: { type: 'string', format: 'date-time' },
428
+ unregisteredAt: { type: 'string', format: 'date-time' },
429
+ },
430
+ };
431
+ export const GatePolicyPageSchema = {
432
+ type: 'object',
433
+ additionalProperties: false,
434
+ required: ['data', 'hasMore'],
435
+ properties: {
436
+ data: { type: 'array', items: { $ref: '#/components/schemas/GatePolicy' } },
437
+ hasMore: { type: 'boolean' },
438
+ nextCursor: { type: 'string' },
439
+ },
440
+ };
441
+ export const PublishGatePolicyBodySchema = {
442
+ type: 'object',
443
+ additionalProperties: false,
444
+ required: ['id', 'version', 'agentId', 'scope', 'spec'],
445
+ properties: {
446
+ id: {
447
+ type: 'string',
448
+ pattern: '^[a-z0-9][a-z0-9._-]{0,127}$',
449
+ description: 'Yours to choose, e.g. `acme.drafting-prod`.',
450
+ },
451
+ version: { type: 'string', pattern: '^\\d+\\.\\d+\\.\\d+$' },
452
+ agentId: { type: 'string' },
453
+ scope: { $ref: '#/components/schemas/LiveScope' },
454
+ spec: { $ref: '#/components/schemas/GatePolicySpec' },
455
+ description: { type: 'string' },
456
+ },
457
+ };
458
+ export const GatePolicyResolutionSchema = {
459
+ type: 'object',
460
+ additionalProperties: false,
461
+ required: ['policy'],
462
+ properties: {
463
+ policy: {
464
+ oneOf: [{ $ref: '#/components/schemas/GatePolicy' }, { type: 'null' }],
465
+ description: 'The policy that gates a promotion for the scope; null when none does.',
466
+ },
467
+ },
468
+ };
469
+ export const PromotionCheckSchema = {
470
+ type: 'object',
471
+ additionalProperties: false,
472
+ required: ['outcome', 'policy', 'checks'],
473
+ description: 'What the gate would say about a promotion. Nothing is recorded.',
474
+ properties: {
475
+ outcome: { type: 'string', enum: ['would-promote', 'needs-approval', 'gate-failed'] },
476
+ policy: {
477
+ oneOf: [{ $ref: '#/components/schemas/GatePolicyRef' }, { type: 'null' }],
478
+ description: 'The policy that applies; null when none does.',
479
+ },
480
+ checks: { type: 'array', items: { $ref: '#/components/schemas/GateCheck' } },
481
+ approval: { $ref: '#/components/schemas/GateApproval' },
482
+ },
483
+ };
484
+ export const PromoteBodySchema = {
485
+ type: 'object',
486
+ additionalProperties: false,
487
+ required: ['version', 'scope'],
488
+ properties: {
489
+ version: {
490
+ type: 'string',
491
+ description: 'The agent version to make live (registered, active).',
492
+ },
493
+ scope: { $ref: '#/components/schemas/LiveScope' },
494
+ reason: { type: 'string', maxLength: 2000 },
495
+ evalRunId: { type: 'string', description: 'The comparison this promotion was judged on.' },
496
+ },
497
+ };
498
+ export const RollbackBodySchema = {
499
+ type: 'object',
500
+ additionalProperties: false,
501
+ required: ['scope'],
502
+ properties: {
503
+ scope: { $ref: '#/components/schemas/LiveScope' },
504
+ toVersion: {
505
+ type: 'string',
506
+ description: "An earlier version to go back to; omit → the scope's previous live version.",
507
+ },
508
+ reason: { type: 'string', maxLength: 2000 },
509
+ },
510
+ };
511
+ export const UnpinBodySchema = {
512
+ type: 'object',
513
+ additionalProperties: false,
514
+ required: ['scope'],
515
+ properties: {
516
+ scope: { $ref: '#/components/schemas/LiveScope' },
517
+ reason: { type: 'string', maxLength: 2000 },
131
518
  },
132
519
  };
133
520
  export const RunSchema = {
@@ -177,6 +564,12 @@ export const RunSchema = {
177
564
  type: 'string',
178
565
  description: 'Set on a replay run: the eval run that started it.',
179
566
  },
567
+ versions: { $ref: '#/components/schemas/FlowVersionOverrides' },
568
+ segments: {
569
+ type: 'array',
570
+ items: { $ref: '#/components/schemas/ScopeSegment' },
571
+ description: "The segment path the run was started with (coarse to fine), which picks live agent versions. A child run has its parent's. Absent when there was none.",
572
+ },
180
573
  publicAccessToken: {
181
574
  type: 'string',
182
575
  description: 'Only in the response to `POST /v1/runs`, when the deployment issues public run tokens: a read-only token for this run (and its descendants) to hand to a browser, for `GET /v1/runs/{runId}/progress` and its stream.',
@@ -227,12 +620,21 @@ export const StartRunBodySchema = {
227
620
  required: ['agent', 'input'],
228
621
  properties: {
229
622
  agent: { type: 'string', description: 'AgentId.' },
230
- agentVersion: { type: 'string', description: 'Semver; omit → latest.' },
623
+ agentVersion: {
624
+ type: 'string',
625
+ description: "Semver. Omit → the conversation's own version for a follow-up turn, else the version live for the run's scope, else the latest.",
626
+ },
231
627
  projectId: {
232
628
  type: 'string',
233
629
  format: 'uuid',
234
630
  description: "Project to run under; omit → the tenant's Default project.",
235
631
  },
632
+ segments: {
633
+ type: 'array',
634
+ maxItems: 8,
635
+ items: { $ref: '#/components/schemas/ScopeSegment' },
636
+ description: "The run's segment path below its project, coarse to fine (an app-defined finer scope, e.g. company then role). A version live on a prefix of it serves the run.",
637
+ },
236
638
  input: {
237
639
  description: 'Opaque payload forwarded to the agent binding.',
238
640
  },
@@ -251,6 +653,12 @@ export const StartRunBodySchema = {
251
653
  format: 'uuid',
252
654
  description: "Project to run under; omit → the tenant's Default project.",
253
655
  },
656
+ segments: {
657
+ type: 'array',
658
+ maxItems: 8,
659
+ items: { $ref: '#/components/schemas/ScopeSegment' },
660
+ description: "The run's segment path below its project, coarse to fine (an app-defined finer scope, e.g. company then role). A version live on a prefix of it serves the run.",
661
+ },
254
662
  input: {
255
663
  description: 'Opaque payload forwarded to the flow runtime.',
256
664
  },
@@ -718,6 +1126,27 @@ export const CompleteApprovalResultSchema = {
718
1126
  type: 'boolean',
719
1127
  description: 'True when the approval had a `waitTokenId` + terminal accept/reject and the run waitpoint was completed as part of this call.',
720
1128
  },
1129
+ resume: {
1130
+ description: "How the run went on, when this call resumed it (the runtime resumes inline): `ok`, or `failed` with the run's error, e.g. `tool-version-unresolvable` when a tool version the turn started with is gone. The decision stands either way.",
1131
+ oneOf: [
1132
+ {
1133
+ type: 'object',
1134
+ additionalProperties: false,
1135
+ required: ['kind'],
1136
+ properties: { kind: { type: 'string', const: 'ok' } },
1137
+ },
1138
+ {
1139
+ type: 'object',
1140
+ additionalProperties: false,
1141
+ required: ['kind', 'code', 'message'],
1142
+ properties: {
1143
+ kind: { type: 'string', const: 'failed' },
1144
+ code: { type: 'string' },
1145
+ message: { type: 'string' },
1146
+ },
1147
+ },
1148
+ ],
1149
+ },
721
1150
  },
722
1151
  };
723
1152
  // ---------------- agents ----------------
@@ -1157,6 +1586,18 @@ export const FlowPinsSchema = {
1157
1586
  },
1158
1587
  },
1159
1588
  };
1589
+ export const FlowVersionOverridesSchema = {
1590
+ description: "Agents and tools a flow runs at other exact versions than the flow version's pins (\"this flow, with `acme.scorer` at 0.4.0\"), without publishing a new flow version: a comparison's flow candidate (`versions` on the start body and the run's `comparison`), and the flow runs that replay it (a run's `versions`). Each id must be an agent or tool the flow uses.",
1591
+ type: 'object',
1592
+ additionalProperties: false,
1593
+ properties: {
1594
+ tools: { ...PinMapSchema, description: 'Tool id → exact version.' },
1595
+ agents: {
1596
+ ...PinMapSchema,
1597
+ description: 'Agent id → exact version, for agent nodes with or without a version of their own.',
1598
+ },
1599
+ },
1600
+ };
1160
1601
  export const PublishFlowBodySchema = {
1161
1602
  description: 'Full flow definition. Validated server-side via `@kindgi/flow.loadFlow` — validation failures return `400 validation-failed` with the issue list under `details.issues`.',
1162
1603
  type: 'object',
@@ -1885,6 +2326,32 @@ export const JudgeClassScopeSchema = {
1885
2326
  },
1886
2327
  ],
1887
2328
  };
2329
+ export const JudgeClassAssertableBySchema = {
2330
+ type: 'object',
2331
+ additionalProperties: false,
2332
+ minProperties: 1,
2333
+ description: 'Who may assert the class: every part that is set must hold. A class with one is restricted: a judgment recorded while it is carries `restricted`, and a comparison weighted `restricted-only` counts only those.',
2334
+ properties: {
2335
+ minReviewerRole: {
2336
+ type: 'string',
2337
+ enum: ['standard', 'senior', 'admin'],
2338
+ description: "The caller's reviewer role is at least this (its token's, or the roster's).",
2339
+ },
2340
+ principalKinds: {
2341
+ type: 'array',
2342
+ minItems: 1,
2343
+ items: { type: 'string', enum: ['user', 'service'] },
2344
+ description: 'Users, service tokens, or both.',
2345
+ },
2346
+ principalIds: {
2347
+ type: 'array',
2348
+ minItems: 1,
2349
+ maxItems: 100,
2350
+ items: { type: 'string', minLength: 1 },
2351
+ description: 'Only these principals: user ids, or service token ids.',
2352
+ },
2353
+ },
2354
+ };
1888
2355
  export const JudgeClassSchema = {
1889
2356
  type: 'object',
1890
2357
  additionalProperties: false,
@@ -1903,6 +2370,7 @@ export const JudgeClassSchema = {
1903
2370
  description: 'How much a judgment of this class counts, relative to the others.',
1904
2371
  },
1905
2372
  description: { type: 'string' },
2373
+ assertableBy: { $ref: '#/components/schemas/JudgeClassAssertableBy' },
1906
2374
  createdAt: { type: 'string', format: 'date-time' },
1907
2375
  updatedAt: { type: 'string', format: 'date-time' },
1908
2376
  unregisteredAt: {
@@ -1931,6 +2399,7 @@ export const CreateJudgeClassBodySchema = {
1931
2399
  name: { type: 'string', minLength: 1, maxLength: 100 },
1932
2400
  weight: { type: 'number', minimum: 0 },
1933
2401
  description: { type: 'string' },
2402
+ assertableBy: { $ref: '#/components/schemas/JudgeClassAssertableBy' },
1934
2403
  },
1935
2404
  };
1936
2405
  export const UpdateJudgeClassBodySchema = {
@@ -1940,6 +2409,10 @@ export const UpdateJudgeClassBodySchema = {
1940
2409
  properties: {
1941
2410
  weight: { type: 'number', minimum: 0 },
1942
2411
  description: { type: 'string' },
2412
+ assertableBy: {
2413
+ oneOf: [{ $ref: '#/components/schemas/JudgeClassAssertableBy' }, { type: 'null' }],
2414
+ description: 'Who may assert the class; `null` lifts the restriction.',
2415
+ },
1943
2416
  },
1944
2417
  };
1945
2418
  export const UnregisterJudgeClassResultSchema = {
@@ -2020,6 +2493,11 @@ export const JudgmentSchema = {
2020
2493
  type: 'string',
2021
2494
  description: 'The judge class the judgment is recorded under. Absent when unclassified (counts with weight 1).',
2022
2495
  },
2496
+ restricted: {
2497
+ type: 'boolean',
2498
+ enum: [true],
2499
+ description: "Present (true) when the judge class was restricted (`assertableBy`) when the judgment was recorded, so the judge was checked against it. A restriction added or lifted later doesn't change it.",
2500
+ },
2023
2501
  assertedBy: { $ref: '#/components/schemas/JudgmentAssertedBy' },
2024
2502
  participantId: {
2025
2503
  type: 'string',
@@ -2196,6 +2674,13 @@ export const JudgedItemSummarySchema = {
2196
2674
  description: 'The weight behind "yes" (an unclassified judgment counts 1).',
2197
2675
  },
2198
2676
  totalWeight: { type: 'number', description: 'The weight behind all judgments of the item.' },
2677
+ restricted: {
2678
+ type: 'object',
2679
+ additionalProperties: false,
2680
+ required: ['yesWeight', 'totalWeight'],
2681
+ description: 'The same weights, counting only judgments recorded while their class was restricted (`Judgment.restricted`), for a comparison weighted `restricted-only`. Absent from a test set built before restrictions.',
2682
+ properties: { yesWeight: { type: 'number' }, totalWeight: { type: 'number' } },
2683
+ },
2199
2684
  reasons: {
2200
2685
  type: 'array',
2201
2686
  description: 'The reasons given, newest first.',
@@ -3944,7 +4429,7 @@ export const PolicySchema = {
3944
4429
  spec: {
3945
4430
  type: 'object',
3946
4431
  additionalProperties: true,
3947
- description: "Kind-specific policy body. For `access-control`, matches `@kindgi/specs/policy.schema.json` (rules + defaults). For `model-routing`, matches `TenantPolicy` from `@kindgi/capabilities` (providers.allow / providers.deny / models.allow / models.deny / regionAllow / maxCostPerCallUsd / maxTokensPerCall). For `tool-errors`, `ToolErrorsSpec` (maxRetries / retryOn). For `hitl`, `HitlSpec` from `@kindgi/policy-contract` (maxTimeoutMs / minReviewerRole / tools — per tool id a mode or `{ mode, requiredRole }`); it only tightens an agent's approvals. `tool-errors` and `hitl` specs are validated on publish. For other kinds, the shape is defined by the runtime consumer.",
4432
+ description: "Kind-specific policy body. For `access-control`, matches `@kindgi/specs/policy.schema.json` (rules + defaults). For `model-routing`, matches `TenantPolicy` from `@kindgi/capabilities` (providers.allow / providers.deny / models.allow / models.deny / regionAllow / maxCostPerCallUsd / maxTokensPerCall). For `tool-errors`, `ToolErrorsSpec` (maxRetries / retryOn). For `hitl`, `HitlSpec` from `@kindgi/policy-contract` (maxTimeoutMs / minReviewerRole / tools — per tool id a mode or `{ mode, requiredRole }`); it only tightens an agent's approvals. For `retention`, `{ v: 1, doc: RetentionSpec }` from `@kindgi/policy-contract` (domain / graceSeconds / mode, which must be `purge`); a tenant has one retention policy per domain, plus one for `*`. `tool-errors`, `hitl` and `retention` specs are validated on publish. For other kinds, the shape is defined by the runtime consumer.",
3948
4433
  },
3949
4434
  },
3950
4435
  };
@@ -4040,6 +4525,167 @@ export const ReinstatePolicyVersionResultSchema = {
4040
4525
  wasTombstoned: { type: 'boolean' },
4041
4526
  },
4042
4527
  };
4528
+ // ---------------- retention (admin plane) ----------------
4529
+ /** A tombstoning domain a retention policy can cover; `*` is the tenant-wide default. */
4530
+ export const RetentionDomainSchema = {
4531
+ type: 'string',
4532
+ enum: [...RETENTION_DOMAINS],
4533
+ };
4534
+ /**
4535
+ * A domain more than one retention policy covers. Publishing refuses a
4536
+ * second policy for a domain, so only policies stored before that rule
4537
+ * can do this.
4538
+ */
4539
+ export const RetentionPolicyConflictSchema = {
4540
+ type: 'object',
4541
+ additionalProperties: false,
4542
+ required: ['domain', 'policyIds', 'appliedPolicyId'],
4543
+ properties: {
4544
+ domain: { $ref: '#/components/schemas/RetentionDomain' },
4545
+ policyIds: {
4546
+ type: 'array',
4547
+ items: { type: 'string' },
4548
+ minItems: 2,
4549
+ description: 'Every policy id that covers the domain, sorted.',
4550
+ },
4551
+ appliedPolicyId: {
4552
+ type: 'string',
4553
+ description: 'The one that applies: the policy whose latest version is highest, and on equal versions the lower policy id. Unregister the others.',
4554
+ },
4555
+ },
4556
+ };
4557
+ export const RetentionScheduledItemSchema = {
4558
+ type: 'object',
4559
+ additionalProperties: false,
4560
+ required: [
4561
+ 'domain',
4562
+ 'id',
4563
+ 'unregisteredAt',
4564
+ 'purgeAt',
4565
+ 'pastGrace',
4566
+ 'policyId',
4567
+ 'policyVersion',
4568
+ 'graceSeconds',
4569
+ ],
4570
+ properties: {
4571
+ domain: { $ref: '#/components/schemas/RetentionDomain' },
4572
+ id: { type: 'string', description: "The tombstoned row's id in its domain." },
4573
+ unregisteredAt: { type: 'string', format: 'date-time' },
4574
+ purgeAt: {
4575
+ type: 'string',
4576
+ format: 'date-time',
4577
+ description: "`unregisteredAt` plus the policy's grace: when a sweep purges the row.",
4578
+ },
4579
+ pastGrace: {
4580
+ type: 'boolean',
4581
+ description: 'Whether a sweep would purge the row now.',
4582
+ },
4583
+ policyId: { type: 'string', description: 'The retention policy that applies.' },
4584
+ policyVersion: { type: 'string' },
4585
+ graceSeconds: {
4586
+ type: 'integer',
4587
+ description: "The policy's grace, in seconds (`-1`: a hold, never purged).",
4588
+ },
4589
+ },
4590
+ };
4591
+ export const RetentionScheduledPageSchema = {
4592
+ type: 'object',
4593
+ additionalProperties: false,
4594
+ required: ['data', 'domainsMissingAdapter', 'unpolicedDomains'],
4595
+ properties: {
4596
+ data: {
4597
+ type: 'array',
4598
+ items: { $ref: '#/components/schemas/RetentionScheduledItem' },
4599
+ },
4600
+ hasMore: {
4601
+ type: 'boolean',
4602
+ description: 'Some domain has more scheduled rows than this page returned (`limit` is per domain). Always sent from 0.1.4; a runtime before it sends none.',
4603
+ },
4604
+ nextCursor: {
4605
+ type: 'string',
4606
+ description: 'The `cursor` for the next page. Absent when `hasMore: false`, or when the runtime cannot continue a page.',
4607
+ },
4608
+ domainsMissingAdapter: {
4609
+ type: 'array',
4610
+ items: { $ref: '#/components/schemas/RetentionDomain' },
4611
+ description: "Domains a retention policy covers that this deployment can't purge (no adapter is wired).",
4612
+ },
4613
+ unpolicedDomains: {
4614
+ type: 'array',
4615
+ items: { $ref: '#/components/schemas/RetentionDomain' },
4616
+ description: 'Domains no retention policy covers: their tombstones are kept.',
4617
+ },
4618
+ conflicts: {
4619
+ type: 'array',
4620
+ items: { $ref: '#/components/schemas/RetentionPolicyConflict' },
4621
+ description: 'Domains more than one retention policy covers. Absent or empty: none.',
4622
+ },
4623
+ },
4624
+ };
4625
+ export const RetentionSweepBodySchema = {
4626
+ type: 'object',
4627
+ additionalProperties: false,
4628
+ properties: {
4629
+ domain: {
4630
+ $ref: '#/components/schemas/RetentionDomain',
4631
+ description: 'Sweep only this domain. Absent: every domain.',
4632
+ },
4633
+ maxPerDomain: {
4634
+ type: 'integer',
4635
+ minimum: 1,
4636
+ maximum: 10000,
4637
+ description: 'The most rows one call purges per domain (default 500); the rest are `remaining`.',
4638
+ },
4639
+ },
4640
+ };
4641
+ export const RetentionSweepDomainBodySchema = {
4642
+ type: 'object',
4643
+ additionalProperties: false,
4644
+ properties: {
4645
+ maxPerDomain: {
4646
+ type: 'integer',
4647
+ minimum: 1,
4648
+ maximum: 10000,
4649
+ description: 'The most rows this call purges (default 500); the rest are `remaining`.',
4650
+ },
4651
+ },
4652
+ };
4653
+ export const RetentionSweepResultSchema = {
4654
+ type: 'object',
4655
+ additionalProperties: false,
4656
+ required: ['perDomain', 'totalPurged'],
4657
+ properties: {
4658
+ perDomain: {
4659
+ type: 'array',
4660
+ items: {
4661
+ type: 'object',
4662
+ additionalProperties: false,
4663
+ required: ['domain', 'purged', 'remaining'],
4664
+ properties: {
4665
+ domain: { $ref: '#/components/schemas/RetentionDomain' },
4666
+ purged: { type: 'integer', minimum: 0 },
4667
+ remaining: {
4668
+ type: 'integer',
4669
+ minimum: 0,
4670
+ description: 'Rows past grace this call left (the `maxPerDomain` cap); sweep again.',
4671
+ },
4672
+ policyId: { type: 'string', description: 'The retention policy that applied.' },
4673
+ missingAdapter: {
4674
+ type: 'boolean',
4675
+ const: true,
4676
+ description: "Present when this deployment can't purge the domain (no adapter).",
4677
+ },
4678
+ },
4679
+ },
4680
+ },
4681
+ totalPurged: { type: 'integer', minimum: 0 },
4682
+ conflicts: {
4683
+ type: 'array',
4684
+ items: { $ref: '#/components/schemas/RetentionPolicyConflict' },
4685
+ description: 'Domains more than one retention policy covers. Absent or empty: none.',
4686
+ },
4687
+ },
4688
+ };
4043
4689
  // ---------------- eval suites (admin plane) ----------------
4044
4690
  /**
4045
4691
  * Closed set of eval kinds the framework knows about. Extended
@@ -4285,7 +4931,7 @@ export const EvalRunFlowRefSchema = {
4285
4931
  },
4286
4932
  };
4287
4933
  export const EvalBaselineSchema = {
4288
- description: "What a comparison compares the candidate against: `'recorded'` (each case's recorded output, what was judged), a version (`{ agentId, version }`, replayed under the same rules), or the version live in a scope (`{ live: { projectId?, segments? } }`). Only `'recorded'` runs today; the others are refused when the run starts.",
4934
+ description: "What a comparison compares the candidate against: `'recorded'` (each case's recorded output, what was judged), a version (`{ agentId, version }`, replayed under the same rules), or the version live in a scope (`{ live: { projectId?, segments? } }`, `segments` a path in the project, coarse to fine). Only `'recorded'` runs today; the others are refused when the run starts.",
4289
4935
  oneOf: [
4290
4936
  { type: 'string', enum: ['recorded'] },
4291
4937
  {
@@ -4304,7 +4950,12 @@ export const EvalBaselineSchema = {
4304
4950
  additionalProperties: false,
4305
4951
  properties: {
4306
4952
  projectId: { type: 'string' },
4307
- segments: { type: 'object', additionalProperties: { type: 'string' } },
4953
+ segments: {
4954
+ type: 'array',
4955
+ items: { $ref: '#/components/schemas/ScopeSegment' },
4956
+ maxItems: 8,
4957
+ description: 'A segment path in `projectId`, coarse to fine, as live versions resolve it. Needs `projectId`.',
4958
+ },
4308
4959
  },
4309
4960
  },
4310
4961
  },
@@ -4325,6 +4976,339 @@ export const EvalComparisonSchema = {
4325
4976
  },
4326
4977
  repetitions: { type: 'integer', minimum: 1, maximum: 10 },
4327
4978
  k: { type: 'integer', minimum: 1, maximum: 100 },
4979
+ versions: { $ref: '#/components/schemas/FlowVersionOverrides' },
4980
+ classWeights: {
4981
+ type: 'string',
4982
+ enum: ['as-recorded', 'restricted-only'],
4983
+ description: "Which judgments count: each at its class's weight (`as-recorded`, the default), or only those recorded while their class was restricted (`Judgment.restricted`), the others weighing 0 (`restricted-only`).",
4984
+ },
4985
+ },
4986
+ };
4987
+ // ---------------- comparison results (a `judged` eval run's `result`) ----------------
4988
+ const nullableNumber = { type: ['number', 'null'] };
4989
+ export const ComparisonMetricSchema = {
4990
+ description: "One metric, the recorded runs beside the candidate. `null` where a side had no judged evidence; `n` / `weight` are the candidate's evidence (cases with judged items, and the judgment weight behind them), `baselineN` / `baselineWeight` the recorded side's.",
4991
+ type: 'object',
4992
+ additionalProperties: false,
4993
+ required: [
4994
+ 'baseline',
4995
+ 'candidate',
4996
+ 'delta',
4997
+ 'n',
4998
+ 'weight',
4999
+ 'baselineN',
5000
+ 'baselineWeight',
5001
+ 'direction',
5002
+ ],
5003
+ properties: {
5004
+ baseline: nullableNumber,
5005
+ candidate: nullableNumber,
5006
+ delta: nullableNumber,
5007
+ n: { type: 'integer', minimum: 0 },
5008
+ weight: { type: 'number', minimum: 0 },
5009
+ baselineN: { type: 'integer', minimum: 0 },
5010
+ baselineWeight: { type: 'number', minimum: 0 },
5011
+ direction: { type: 'string', enum: ['higher'] },
5012
+ k: {
5013
+ type: 'integer',
5014
+ minimum: 1,
5015
+ description: '`weightedPrecisionAtK`: the ranked items it looked at.',
5016
+ },
5017
+ spread: {
5018
+ type: 'number',
5019
+ description: "With more than one repetition: the candidate's max − min across them.",
5020
+ },
5021
+ },
5022
+ };
5023
+ export const ComparisonCandidateSchema = {
5024
+ description: 'What ran on the cases: an agent version, or a flow version (with any versions it swapped in).',
5025
+ oneOf: [
5026
+ {
5027
+ type: 'object',
5028
+ additionalProperties: false,
5029
+ required: ['kind', 'agentId', 'version'],
5030
+ properties: {
5031
+ kind: { type: 'string', enum: ['agent'] },
5032
+ agentId: { type: 'string' },
5033
+ version: { type: 'string' },
5034
+ pinsDigest: {
5035
+ type: 'string',
5036
+ description: "The version's pinsDigest: what it ran, as a promotion gate checks. Absent for a version published before pins, and from a comparison recorded before it.",
5037
+ },
5038
+ },
5039
+ },
5040
+ {
5041
+ type: 'object',
5042
+ additionalProperties: false,
5043
+ required: ['kind', 'flowId', 'version'],
5044
+ properties: {
5045
+ kind: { type: 'string', enum: ['flow'] },
5046
+ flowId: { type: 'string' },
5047
+ version: { type: 'string' },
5048
+ versions: { $ref: '#/components/schemas/FlowVersionOverrides' },
5049
+ },
5050
+ },
5051
+ ],
5052
+ };
5053
+ export const JudgedComparisonSummarySchema = {
5054
+ description: 'What a comparison concluded: the candidate beside the recorded runs, the case counts, and the metrics. What a promotion gate reads.',
5055
+ type: 'object',
5056
+ additionalProperties: false,
5057
+ required: [
5058
+ 'evalRunId',
5059
+ 'status',
5060
+ 'completedAt',
5061
+ 'suite',
5062
+ 'candidate',
5063
+ 'baseline',
5064
+ 'scope',
5065
+ 'cases',
5066
+ 'diverged',
5067
+ 'refusedWrites',
5068
+ 'errors',
5069
+ 'stopped',
5070
+ 'reads',
5071
+ 'sampling',
5072
+ 'repetitions',
5073
+ 'metrics',
5074
+ ],
5075
+ properties: {
5076
+ evalRunId: { type: 'string' },
5077
+ status: { type: 'string', enum: ['completed', 'partial', 'failed'] },
5078
+ completedAt: { type: 'string', format: 'date-time' },
5079
+ suite: {
5080
+ type: 'object',
5081
+ additionalProperties: false,
5082
+ required: ['id', 'version'],
5083
+ properties: { id: { type: 'string' }, version: { type: 'string' } },
5084
+ },
5085
+ candidate: { $ref: '#/components/schemas/ComparisonCandidate' },
5086
+ baseline: {
5087
+ description: "What the candidate was compared with: `recorded` (the test set's recorded runs, with the versions that served them), or another version.",
5088
+ oneOf: [
5089
+ {
5090
+ type: 'object',
5091
+ additionalProperties: false,
5092
+ required: ['kind', 'versions'],
5093
+ properties: {
5094
+ kind: { type: 'string', enum: ['recorded'] },
5095
+ versions: {
5096
+ type: 'array',
5097
+ items: {
5098
+ type: 'object',
5099
+ additionalProperties: false,
5100
+ required: ['version', 'cases'],
5101
+ properties: {
5102
+ agentId: { type: 'string' },
5103
+ flowId: { type: 'string' },
5104
+ version: { type: 'string' },
5105
+ cases: { type: 'integer', minimum: 0 },
5106
+ },
5107
+ },
5108
+ },
5109
+ },
5110
+ },
5111
+ {
5112
+ type: 'object',
5113
+ additionalProperties: false,
5114
+ required: ['kind', 'agentId', 'version', 'via'],
5115
+ properties: {
5116
+ kind: { type: 'string', enum: ['version'] },
5117
+ agentId: { type: 'string' },
5118
+ version: { type: 'string' },
5119
+ via: { type: 'string', enum: ['explicit', 'live'] },
5120
+ liveScope: { type: 'object', additionalProperties: true },
5121
+ },
5122
+ },
5123
+ ],
5124
+ },
5125
+ scope: {
5126
+ type: 'object',
5127
+ additionalProperties: false,
5128
+ description: "Where the test set's judgments came from.",
5129
+ properties: { projectId: { type: 'string' } },
5130
+ },
5131
+ cases: { type: 'integer', minimum: 0 },
5132
+ diverged: {
5133
+ type: 'integer',
5134
+ minimum: 0,
5135
+ description: "Cases where a read with no recording ran live under `reads: 'recorded'`.",
5136
+ },
5137
+ refusedWrites: {
5138
+ type: 'integer',
5139
+ minimum: 0,
5140
+ description: 'Tool calls refused across the cases (what the candidate would have done).',
5141
+ },
5142
+ errors: { type: 'integer', minimum: 0, description: 'Cases none of whose repetitions ran.' },
5143
+ stopped: {
5144
+ type: 'integer',
5145
+ minimum: 0,
5146
+ description: "Flow cases that stopped at a write the replay refused: no output to score, so they're left out of the metrics.",
5147
+ },
5148
+ reads: { type: 'string', enum: ['recorded', 'live'] },
5149
+ classWeights: {
5150
+ type: 'string',
5151
+ enum: ['as-recorded', 'restricted-only'],
5152
+ description: 'Which judgments counted. Absent from a comparison recorded before restricted classes: `as-recorded`.',
5153
+ },
5154
+ sampling: {
5155
+ type: 'object',
5156
+ additionalProperties: false,
5157
+ required: ['models'],
5158
+ properties: {
5159
+ models: {
5160
+ type: 'array',
5161
+ description: "The models that answered the candidate's replays, and how many replays each.",
5162
+ items: {
5163
+ type: 'object',
5164
+ additionalProperties: false,
5165
+ required: ['providerId', 'model', 'runs'],
5166
+ properties: {
5167
+ providerId: { type: 'string' },
5168
+ model: { type: 'string' },
5169
+ runs: { type: 'integer', minimum: 0 },
5170
+ },
5171
+ },
5172
+ },
5173
+ },
5174
+ },
5175
+ repetitions: { type: 'integer', minimum: 1 },
5176
+ metrics: {
5177
+ type: 'object',
5178
+ additionalProperties: false,
5179
+ required: ['weightedYesShare', 'judgedCoverage', 'weightedPrecisionAtK'],
5180
+ properties: {
5181
+ weightedYesShare: { $ref: '#/components/schemas/ComparisonMetric' },
5182
+ judgedCoverage: { $ref: '#/components/schemas/ComparisonMetric' },
5183
+ weightedPrecisionAtK: { $ref: '#/components/schemas/ComparisonMetric' },
5184
+ },
5185
+ },
5186
+ },
5187
+ };
5188
+ const outputScore = {
5189
+ type: 'object',
5190
+ additionalProperties: false,
5191
+ required: ['yesWeight', 'totalWeight', 'items', 'judgedItems', 'topK'],
5192
+ description: "An output's score: Σ yesWeight and Σ totalWeight over its judged items, and over those among the first `k` ranked items.",
5193
+ properties: {
5194
+ yesWeight: { type: 'number' },
5195
+ totalWeight: { type: 'number' },
5196
+ items: { type: 'integer', minimum: 0 },
5197
+ judgedItems: { type: 'integer', minimum: 0 },
5198
+ topK: {
5199
+ type: 'object',
5200
+ additionalProperties: false,
5201
+ required: ['yesWeight', 'totalWeight'],
5202
+ properties: { yesWeight: { type: 'number' }, totalWeight: { type: 'number' } },
5203
+ },
5204
+ },
5205
+ };
5206
+ export const ComparisonCaseResultSchema = {
5207
+ description: "One case of a comparison: its replay runs, the scores, the items kept, dropped and new, the tool calls, and why it didn't run when it didn't.",
5208
+ type: 'object',
5209
+ additionalProperties: false,
5210
+ required: [
5211
+ 'caseId',
5212
+ 'runIds',
5213
+ 'baseline',
5214
+ 'candidate',
5215
+ 'diverged',
5216
+ 'refusedWrites',
5217
+ 'noContext',
5218
+ 'approvalSkipped',
5219
+ ],
5220
+ properties: {
5221
+ caseId: { type: 'string' },
5222
+ runIds: {
5223
+ type: 'array',
5224
+ items: { type: 'string' },
5225
+ description: "The candidate's replay runs, one per repetition.",
5226
+ },
5227
+ baseline: outputScore,
5228
+ candidate: { type: 'array', items: outputScore, description: 'One per repetition that ran.' },
5229
+ changes: {
5230
+ type: 'object',
5231
+ additionalProperties: false,
5232
+ required: ['kept', 'dropped', 'new'],
5233
+ description: "The first repetition's items against the judged ones.",
5234
+ properties: {
5235
+ kept: {
5236
+ type: 'array',
5237
+ items: {
5238
+ type: 'object',
5239
+ additionalProperties: false,
5240
+ required: ['key'],
5241
+ properties: {
5242
+ key: { type: 'string' },
5243
+ rankBefore: { type: 'integer' },
5244
+ rank: { type: 'integer' },
5245
+ },
5246
+ },
5247
+ },
5248
+ dropped: {
5249
+ type: 'array',
5250
+ items: {
5251
+ type: 'object',
5252
+ additionalProperties: false,
5253
+ required: ['key'],
5254
+ properties: { key: { type: 'string' }, rankBefore: { type: 'integer' } },
5255
+ },
5256
+ },
5257
+ new: {
5258
+ type: 'array',
5259
+ items: {
5260
+ type: 'object',
5261
+ additionalProperties: false,
5262
+ required: ['key', 'pointer'],
5263
+ properties: {
5264
+ key: { type: 'string' },
5265
+ pointer: { type: 'string' },
5266
+ rank: { type: 'integer' },
5267
+ },
5268
+ },
5269
+ },
5270
+ },
5271
+ },
5272
+ tools: {
5273
+ type: 'array',
5274
+ description: "The first repetition's tool calls, and what happened to each.",
5275
+ items: {
5276
+ type: 'object',
5277
+ additionalProperties: false,
5278
+ required: ['step', 'callId', 'toolId', 'toolVersion', 'arguments', 'source'],
5279
+ properties: {
5280
+ step: { type: 'integer', minimum: 0 },
5281
+ callId: { type: 'string' },
5282
+ toolId: { type: 'string' },
5283
+ toolVersion: { type: 'string' },
5284
+ arguments: {},
5285
+ source: { type: 'string', enum: ['live', 'recorded', 'refused'] },
5286
+ reason: { type: 'string' },
5287
+ },
5288
+ },
5289
+ },
5290
+ diverged: { type: 'boolean' },
5291
+ refusedWrites: { type: 'integer', minimum: 0 },
5292
+ noContext: { type: 'boolean' },
5293
+ approvalSkipped: { type: 'boolean' },
5294
+ error: { type: 'string' },
5295
+ stopped: {
5296
+ type: 'object',
5297
+ additionalProperties: false,
5298
+ required: ['toolId', 'arguments'],
5299
+ description: 'Set when the replay stopped at a refused write: what it would have done.',
5300
+ properties: { toolId: { type: 'string' }, arguments: {}, reason: { type: 'string' } },
5301
+ },
5302
+ },
5303
+ };
5304
+ export const JudgedComparisonResultSchema = {
5305
+ description: "A comparison's `result` (a `judged` eval run's): the summary and each case. `EvalRun.result` stays an open object, since each kind has its own; the clients read it as this (TS `comparisonOf(run)`, Python `comparison_of(run)`).",
5306
+ type: 'object',
5307
+ additionalProperties: false,
5308
+ required: ['summary', 'perCase'],
5309
+ properties: {
5310
+ summary: { $ref: '#/components/schemas/JudgedComparisonSummary' },
5311
+ perCase: { type: 'array', items: { $ref: '#/components/schemas/ComparisonCaseResult' } },
4328
5312
  },
4329
5313
  };
4330
5314
  export const EvalRunSchema = {
@@ -4355,7 +5339,7 @@ export const EvalRunSchema = {
4355
5339
  result: {
4356
5340
  type: 'object',
4357
5341
  additionalProperties: true,
4358
- description: 'Kind-specific opaque JSON. For `accuracy`, contains `{ passCount, totalCount, meanScore, perCase[] }`. For `judged` (a comparison), `{ summary, perCase[] }`: the summary has the baseline (the versions behind the recorded runs) and the candidate (`{ kind: "agent", agentId, version }` or `{ kind: "flow", flowId, version }`), the case counts (`cases`, `diverged`, `refusedWrites`, `errors`, and `stopped`: flow cases that stopped at a write the replay refused, left out of the metrics), the models that answered, and `metrics` (`weightedYesShare`, `judgedCoverage`, `weightedPrecisionAtK`, each `{ baseline, candidate, delta, n, weight, baselineN, baselineWeight, direction, k?, spread? }`); each case has its replay runs, the scores, the items kept, dropped and new, the tool calls with what happened to each, and `stopped` (what it would have done) when it stopped. Other kinds define their own shapes as their dispatchers ship.',
5342
+ description: 'Kind-specific opaque JSON. For `accuracy`, contains `{ passCount, totalCount, meanScore, perCase[] }`. For `judged` (a comparison), `{ summary, perCase[] }`: the summary has the baseline (the versions behind the recorded runs) and the candidate (`{ kind: "agent", agentId, version }` or `{ kind: "flow", flowId, version, versions? }`), the case counts (`cases`, `diverged`, `refusedWrites`, `errors`, and `stopped`: flow cases that stopped at a write the replay refused, left out of the metrics), the models that answered, and `metrics` (`weightedYesShare`, `judgedCoverage`, `weightedPrecisionAtK`, each `{ baseline, candidate, delta, n, weight, baselineN, baselineWeight, direction, k?, spread? }`); each case has its replay runs, the scores, the items kept, dropped and new, the tool calls with what happened to each, and `stopped` (what it would have done) when it stopped. Other kinds define their own shapes as their dispatchers ship.',
4359
5343
  },
4360
5344
  error: { type: 'string' },
4361
5345
  correlationId: { type: 'string' },
@@ -4386,8 +5370,14 @@ export const StartEvalRunBodySchema = {
4386
5370
  reads: { type: 'string', enum: ['recorded', 'live'] },
4387
5371
  repetitions: { type: 'integer', minimum: 1, maximum: 10 },
4388
5372
  k: { type: 'integer', minimum: 1, maximum: 100 },
5373
+ versions: { $ref: '#/components/schemas/FlowVersionOverrides' },
5374
+ classWeights: {
5375
+ type: 'string',
5376
+ enum: ['as-recorded', 'restricted-only'],
5377
+ description: "Which judgments count: each at its class's weight (`as-recorded`, the default), or only those recorded while their class was restricted (`Judgment.restricted`), the others weighing 0 (`restricted-only`).",
5378
+ },
4389
5379
  },
4390
- description: "Exactly one of `agentRef` or `flowRef` MUST be supplied. `dryRun: true` returns a plan preview without invoking the subject. For a `judged` suite (a test set), the run is a comparison: `agentRef` or `flowRef` with its `version` is the candidate, replayed on each case without doing anything the past run didn't (a flow stops at a write the replay refuses); `baseline` (default `'recorded'`), `reads` (default `recorded`), `repetitions` (default 1) and `k` (default 10) set how.",
5380
+ description: "Exactly one of `agentRef` or `flowRef` MUST be supplied. `dryRun: true` returns a plan preview without invoking the subject. For a `judged` suite (a test set), the run is a comparison: `agentRef` or `flowRef` with its `version` is the candidate, replayed on each case without doing anything the past run didn't (a flow stops at a write the replay refuses); `baseline` (default `'recorded'`), `reads` (default `recorded`), `repetitions` (default 1) and `k` (default 10) set how. With `flowRef`, `versions` runs the flow with some of its agents or tools at other versions; an id the flow doesn't use, or a version that isn't published, is refused (`400 validation-failed`, each under `details.issues`).",
4391
5381
  };
4392
5382
  export const StartEvalRunResultSchema = {
4393
5383
  type: 'object',
@@ -4466,6 +5456,10 @@ export const IdentityProviderCollectionPageSchema = {
4466
5456
  required: ['data'],
4467
5457
  properties: {
4468
5458
  data: { type: 'array', items: { $ref: '#/components/schemas/IdentityProviderConfig' } },
5459
+ hasMore: {
5460
+ type: 'boolean',
5461
+ description: 'Always `false`: the list comes whole. Absent from older servers.',
5462
+ },
4469
5463
  },
4470
5464
  };
4471
5465
  export const RegisterIdentityProviderResultSchema = {
@@ -5721,6 +6715,10 @@ export const EnvCollectionPageSchema = {
5721
6715
  required: ['data'],
5722
6716
  properties: {
5723
6717
  data: { type: 'array', items: { $ref: '#/components/schemas/EnvRecord' } },
6718
+ hasMore: {
6719
+ type: 'boolean',
6720
+ description: "Whether there's another page. Absent from older servers: there is one when `nextCursor` is set.",
6721
+ },
5724
6722
  nextCursor: { type: 'string' },
5725
6723
  },
5726
6724
  };
@@ -5755,6 +6753,10 @@ export const SecretCollectionPageSchema = {
5755
6753
  required: ['data'],
5756
6754
  properties: {
5757
6755
  data: { type: 'array', items: { $ref: '#/components/schemas/SecretRecord' } },
6756
+ hasMore: {
6757
+ type: 'boolean',
6758
+ description: "Whether there's another page. Absent from older servers: there is one when `nextCursor` is set.",
6759
+ },
5758
6760
  nextCursor: { type: 'string' },
5759
6761
  },
5760
6762
  };
@@ -5764,6 +6766,10 @@ export const SecretVersionCollectionPageSchema = {
5764
6766
  required: ['data'],
5765
6767
  properties: {
5766
6768
  data: { type: 'array', items: { $ref: '#/components/schemas/SecretVersionRecord' } },
6769
+ hasMore: {
6770
+ type: 'boolean',
6771
+ description: "Whether there's another page. Absent from older servers: there is one when `nextCursor` is set.",
6772
+ },
5767
6773
  nextCursor: { type: 'string' },
5768
6774
  },
5769
6775
  };
@@ -6463,6 +7469,29 @@ export const COMPONENT_SCHEMAS = [
6463
7469
  ['HealthResult', HealthResultSchema],
6464
7470
  ['RunStatus', RunStatusSchema],
6465
7471
  ['RunAgent', RunAgentSchema],
7472
+ ['ScopeSegment', ScopeSegmentSchema],
7473
+ ['LiveScopeTenant', LiveScopeTenantSchema],
7474
+ ['LiveScopeOrg', LiveScopeOrgSchema],
7475
+ ['LiveScopeProject', LiveScopeProjectSchema],
7476
+ ['LiveScopeSegment', LiveScopeSegmentSchema],
7477
+ ['LiveScope', LiveScopeSchema],
7478
+ ['LiveVersionResolution', LiveVersionResolutionSchema],
7479
+ ['LivePin', LivePinSchema],
7480
+ ['LivePinList', LivePinListSchema],
7481
+ ['Promotion', PromotionSchema],
7482
+ ['PromotionPage', PromotionPageSchema],
7483
+ ['GateCheck', GateCheckSchema],
7484
+ ['GatePolicyRef', GatePolicyRefSchema],
7485
+ ['GateApproval', GateApprovalSchema],
7486
+ ['GatePolicySpec', GatePolicySpecSchema],
7487
+ ['GatePolicy', GatePolicySchema],
7488
+ ['GatePolicyPage', GatePolicyPageSchema],
7489
+ ['PublishGatePolicyBody', PublishGatePolicyBodySchema],
7490
+ ['GatePolicyResolution', GatePolicyResolutionSchema],
7491
+ ['PromotionCheck', PromotionCheckSchema],
7492
+ ['PromoteBody', PromoteBodySchema],
7493
+ ['RollbackBody', RollbackBodySchema],
7494
+ ['UnpinBody', UnpinBodySchema],
6466
7495
  ['Run', RunSchema],
6467
7496
  ['StartRunOptions', StartRunOptionsSchema],
6468
7497
  ['StartRunBody', StartRunBodySchema],
@@ -6521,6 +7550,7 @@ export const COMPONENT_SCHEMAS = [
6521
7550
  ['CreateJudgmentBody', CreateJudgmentBodySchema],
6522
7551
  ['UnregisterJudgmentResult', UnregisterJudgmentResultSchema],
6523
7552
  ['JudgedItemSummary', JudgedItemSummarySchema],
7553
+ ['JudgeClassAssertableBy', JudgeClassAssertableBySchema],
6524
7554
  ['JudgedEvalCase', JudgedEvalCaseSchema],
6525
7555
  ['JudgedEvalCaseCollectionPage', JudgedEvalCaseCollectionPageSchema],
6526
7556
  ['BuildJudgedSuiteBody', BuildJudgedSuiteBodySchema],
@@ -6542,6 +7572,7 @@ export const COMPONENT_SCHEMAS = [
6542
7572
  ['DeriveAgentVersionBody', DeriveAgentVersionBodySchema],
6543
7573
  ['AgentPinSwaps', AgentPinSwapsSchema],
6544
7574
  ['FlowPins', FlowPinsSchema],
7575
+ ['FlowVersionOverrides', FlowVersionOverridesSchema],
6545
7576
  ['PublishAgentBody', PublishAgentBodySchema],
6546
7577
  ['PublishAgentResult', PublishAgentResultSchema],
6547
7578
  ['UnregisterAgentResult', UnregisterAgentResultSchema],
@@ -6684,6 +7715,13 @@ export const COMPONENT_SCHEMAS = [
6684
7715
  ['PublishPolicyResult', PublishPolicyResultSchema],
6685
7716
  ['UnregisterPolicyResult', UnregisterPolicyResultSchema],
6686
7717
  ['ReinstatePolicyVersionResult', ReinstatePolicyVersionResultSchema],
7718
+ ['RetentionDomain', RetentionDomainSchema],
7719
+ ['RetentionPolicyConflict', RetentionPolicyConflictSchema],
7720
+ ['RetentionScheduledItem', RetentionScheduledItemSchema],
7721
+ ['RetentionScheduledPage', RetentionScheduledPageSchema],
7722
+ ['RetentionSweepBody', RetentionSweepBodySchema],
7723
+ ['RetentionSweepDomainBody', RetentionSweepDomainBodySchema],
7724
+ ['RetentionSweepResult', RetentionSweepResultSchema],
6687
7725
  ['EvalKind', EvalKindSchema],
6688
7726
  ['EvalSuite', EvalSuiteSchema],
6689
7727
  ['EvalSuiteCollectionPage', EvalSuiteCollectionPageSchema],
@@ -6705,6 +7743,11 @@ export const COMPONENT_SCHEMAS = [
6705
7743
  ['EvalRunFlowRef', EvalRunFlowRefSchema],
6706
7744
  ['EvalBaseline', EvalBaselineSchema],
6707
7745
  ['EvalComparison', EvalComparisonSchema],
7746
+ ['ComparisonMetric', ComparisonMetricSchema],
7747
+ ['ComparisonCandidate', ComparisonCandidateSchema],
7748
+ ['JudgedComparisonSummary', JudgedComparisonSummarySchema],
7749
+ ['ComparisonCaseResult', ComparisonCaseResultSchema],
7750
+ ['JudgedComparisonResult', JudgedComparisonResultSchema],
6708
7751
  ['EvalRun', EvalRunSchema],
6709
7752
  ['EvalRunCollectionPage', EvalRunCollectionPageSchema],
6710
7753
  ['StartEvalRunBody', StartEvalRunBodySchema],