@opensoftware/contracts 1.5.0 → 1.7.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.
@@ -2,7 +2,7 @@
2
2
  "openapi": "3.1.0",
3
3
  "info": {
4
4
  "title": "Open Software Factory contracts",
5
- "version": "1.5.0",
5
+ "version": "1.7.0",
6
6
  "description": "The shared formats as named models, and the HTTP APIs of the modules. Generated by `pnpm build` in contracts/ from typespec/. Do not edit.",
7
7
  "license": {
8
8
  "name": "Apache-2.0",
@@ -116,6 +116,355 @@
116
116
  }
117
117
  }
118
118
  }
119
+ },
120
+ "/v1/runs": {
121
+ "post": {
122
+ "operationId": "ForemanApi_startRun",
123
+ "description": "Start a run of the factory's workflow for a work item. The same work item again answers the run it started.",
124
+ "parameters": [],
125
+ "responses": {
126
+ "200": {
127
+ "description": "The request has succeeded.",
128
+ "content": {
129
+ "application/json": {
130
+ "schema": {
131
+ "$ref": "#/components/schemas/RunView"
132
+ }
133
+ }
134
+ }
135
+ },
136
+ "201": {
137
+ "description": "The request has succeeded and a new resource has been created as a result.",
138
+ "content": {
139
+ "application/json": {
140
+ "schema": {
141
+ "$ref": "#/components/schemas/RunView"
142
+ }
143
+ }
144
+ }
145
+ },
146
+ "400": {
147
+ "description": "The server could not understand the request due to invalid syntax.",
148
+ "content": {
149
+ "application/problem+json": {
150
+ "schema": {
151
+ "$ref": "#/components/schemas/ApiProblem"
152
+ }
153
+ }
154
+ }
155
+ },
156
+ "401": {
157
+ "description": "Access is unauthorized.",
158
+ "content": {
159
+ "application/problem+json": {
160
+ "schema": {
161
+ "$ref": "#/components/schemas/ApiProblem"
162
+ }
163
+ }
164
+ }
165
+ }
166
+ },
167
+ "requestBody": {
168
+ "required": true,
169
+ "content": {
170
+ "application/json": {
171
+ "schema": {
172
+ "$ref": "#/components/schemas/WorkItem"
173
+ }
174
+ }
175
+ }
176
+ }
177
+ }
178
+ },
179
+ "/v1/runs/{runId}": {
180
+ "get": {
181
+ "operationId": "ForemanApi_getRun",
182
+ "description": "A run: its state and the state of each stage.",
183
+ "parameters": [
184
+ {
185
+ "name": "runId",
186
+ "in": "path",
187
+ "required": true,
188
+ "schema": {
189
+ "type": "string"
190
+ }
191
+ }
192
+ ],
193
+ "responses": {
194
+ "200": {
195
+ "description": "The request has succeeded.",
196
+ "content": {
197
+ "application/json": {
198
+ "schema": {
199
+ "$ref": "#/components/schemas/RunView"
200
+ }
201
+ }
202
+ }
203
+ },
204
+ "401": {
205
+ "description": "Access is unauthorized.",
206
+ "content": {
207
+ "application/problem+json": {
208
+ "schema": {
209
+ "$ref": "#/components/schemas/ApiProblem"
210
+ }
211
+ }
212
+ }
213
+ },
214
+ "404": {
215
+ "description": "The server cannot find the requested resource.",
216
+ "content": {
217
+ "application/problem+json": {
218
+ "schema": {
219
+ "$ref": "#/components/schemas/ApiProblem"
220
+ }
221
+ }
222
+ }
223
+ }
224
+ }
225
+ }
226
+ },
227
+ "/v1/runs/{runId}/signals": {
228
+ "post": {
229
+ "operationId": "ForemanApi_signalRun",
230
+ "description": "Steer the running stage's agent, or cancel the run.",
231
+ "parameters": [
232
+ {
233
+ "name": "runId",
234
+ "in": "path",
235
+ "required": true,
236
+ "schema": {
237
+ "type": "string"
238
+ }
239
+ }
240
+ ],
241
+ "responses": {
242
+ "202": {
243
+ "description": "The request has been accepted for processing, but processing has not yet completed.",
244
+ "content": {
245
+ "application/json": {
246
+ "schema": {
247
+ "$ref": "#/components/schemas/RunView"
248
+ }
249
+ }
250
+ }
251
+ },
252
+ "400": {
253
+ "description": "The server could not understand the request due to invalid syntax.",
254
+ "content": {
255
+ "application/problem+json": {
256
+ "schema": {
257
+ "$ref": "#/components/schemas/ApiProblem"
258
+ }
259
+ }
260
+ }
261
+ },
262
+ "401": {
263
+ "description": "Access is unauthorized.",
264
+ "content": {
265
+ "application/problem+json": {
266
+ "schema": {
267
+ "$ref": "#/components/schemas/ApiProblem"
268
+ }
269
+ }
270
+ }
271
+ },
272
+ "404": {
273
+ "description": "The server cannot find the requested resource.",
274
+ "content": {
275
+ "application/problem+json": {
276
+ "schema": {
277
+ "$ref": "#/components/schemas/ApiProblem"
278
+ }
279
+ }
280
+ }
281
+ },
282
+ "409": {
283
+ "description": "The request conflicts with the current state of the server.",
284
+ "content": {
285
+ "application/problem+json": {
286
+ "schema": {
287
+ "$ref": "#/components/schemas/ApiProblem"
288
+ }
289
+ }
290
+ }
291
+ }
292
+ },
293
+ "requestBody": {
294
+ "required": true,
295
+ "content": {
296
+ "application/json": {
297
+ "schema": {
298
+ "$ref": "#/components/schemas/RunSignal"
299
+ }
300
+ }
301
+ }
302
+ }
303
+ }
304
+ },
305
+ "/v1/work-items": {
306
+ "post": {
307
+ "operationId": "IntakeApi_submitWork",
308
+ "description": "Put work into the inbox. A submission with the dedupe key of a work item answers that work item.",
309
+ "parameters": [],
310
+ "responses": {
311
+ "200": {
312
+ "description": "The request has succeeded.",
313
+ "content": {
314
+ "application/json": {
315
+ "schema": {
316
+ "$ref": "#/components/schemas/WorkItemView"
317
+ }
318
+ }
319
+ }
320
+ },
321
+ "201": {
322
+ "description": "The request has succeeded and a new resource has been created as a result.",
323
+ "content": {
324
+ "application/json": {
325
+ "schema": {
326
+ "$ref": "#/components/schemas/WorkItemView"
327
+ }
328
+ }
329
+ }
330
+ },
331
+ "400": {
332
+ "description": "The server could not understand the request due to invalid syntax.",
333
+ "content": {
334
+ "application/problem+json": {
335
+ "schema": {
336
+ "$ref": "#/components/schemas/ApiProblem"
337
+ }
338
+ }
339
+ }
340
+ },
341
+ "401": {
342
+ "description": "Access is unauthorized.",
343
+ "content": {
344
+ "application/problem+json": {
345
+ "schema": {
346
+ "$ref": "#/components/schemas/ApiProblem"
347
+ }
348
+ }
349
+ }
350
+ }
351
+ },
352
+ "requestBody": {
353
+ "required": true,
354
+ "content": {
355
+ "application/json": {
356
+ "schema": {
357
+ "$ref": "#/components/schemas/WorkSubmission"
358
+ }
359
+ }
360
+ }
361
+ }
362
+ },
363
+ "get": {
364
+ "operationId": "IntakeApi_findWorkItem",
365
+ "description": "The work item with this dedupe key, such as an issue's link (ADR 0065).",
366
+ "parameters": [
367
+ {
368
+ "name": "dedupeKey",
369
+ "in": "query",
370
+ "required": true,
371
+ "schema": {
372
+ "type": "string"
373
+ },
374
+ "explode": false
375
+ }
376
+ ],
377
+ "responses": {
378
+ "200": {
379
+ "description": "The request has succeeded.",
380
+ "content": {
381
+ "application/json": {
382
+ "schema": {
383
+ "$ref": "#/components/schemas/WorkItemView"
384
+ }
385
+ }
386
+ }
387
+ },
388
+ "400": {
389
+ "description": "The server could not understand the request due to invalid syntax.",
390
+ "content": {
391
+ "application/problem+json": {
392
+ "schema": {
393
+ "$ref": "#/components/schemas/ApiProblem"
394
+ }
395
+ }
396
+ }
397
+ },
398
+ "401": {
399
+ "description": "Access is unauthorized.",
400
+ "content": {
401
+ "application/problem+json": {
402
+ "schema": {
403
+ "$ref": "#/components/schemas/ApiProblem"
404
+ }
405
+ }
406
+ }
407
+ },
408
+ "404": {
409
+ "description": "The server cannot find the requested resource.",
410
+ "content": {
411
+ "application/problem+json": {
412
+ "schema": {
413
+ "$ref": "#/components/schemas/ApiProblem"
414
+ }
415
+ }
416
+ }
417
+ }
418
+ }
419
+ }
420
+ },
421
+ "/v1/work-items/{workItemId}": {
422
+ "get": {
423
+ "operationId": "IntakeApi_getWorkItem",
424
+ "description": "A work item, its status and every request that asked for it.",
425
+ "parameters": [
426
+ {
427
+ "name": "workItemId",
428
+ "in": "path",
429
+ "required": true,
430
+ "schema": {
431
+ "type": "string"
432
+ }
433
+ }
434
+ ],
435
+ "responses": {
436
+ "200": {
437
+ "description": "The request has succeeded.",
438
+ "content": {
439
+ "application/json": {
440
+ "schema": {
441
+ "$ref": "#/components/schemas/WorkItemView"
442
+ }
443
+ }
444
+ }
445
+ },
446
+ "401": {
447
+ "description": "Access is unauthorized.",
448
+ "content": {
449
+ "application/problem+json": {
450
+ "schema": {
451
+ "$ref": "#/components/schemas/ApiProblem"
452
+ }
453
+ }
454
+ }
455
+ },
456
+ "404": {
457
+ "description": "The server cannot find the requested resource.",
458
+ "content": {
459
+ "application/problem+json": {
460
+ "schema": {
461
+ "$ref": "#/components/schemas/ApiProblem"
462
+ }
463
+ }
464
+ }
465
+ }
466
+ }
467
+ }
119
468
  }
120
469
  },
121
470
  "security": [
@@ -941,12 +1290,119 @@
941
1290
  ],
942
1291
  "description": "gatekeeper: a gate as the HTTP API shows it (ADR 0048)."
943
1292
  },
1293
+ "Hostname": {
1294
+ "type": "string",
1295
+ "pattern": "^[A-Za-z0-9]([A-Za-z0-9-]*[A-Za-z0-9])?(\\.[A-Za-z0-9]([A-Za-z0-9-]*[A-Za-z0-9])?)*$",
1296
+ "description": "A hostname without scheme or port, for example \"api.linear.app\"."
1297
+ },
944
1298
  "Identifier": {
945
1299
  "type": "string",
946
1300
  "minLength": 1,
947
1301
  "maxLength": 128,
948
1302
  "description": "An identifier chosen by the producer. ULIDs are recommended; consumers treat it as opaque."
949
1303
  },
1304
+ "IssueLabeled": {
1305
+ "type": "object",
1306
+ "properties": {
1307
+ "specversion": {
1308
+ "type": "string",
1309
+ "const": "1.0"
1310
+ },
1311
+ "id": {
1312
+ "$ref": "#/components/schemas/Identifier",
1313
+ "description": "Unique per source. A consumer that sees the same source and id twice handles the event once."
1314
+ },
1315
+ "source": {
1316
+ "type": "string",
1317
+ "minLength": 1,
1318
+ "description": "The producing module, for example \"/osf/intake\"."
1319
+ },
1320
+ "type": {
1321
+ "type": "string",
1322
+ "const": "issue.labeled@v1"
1323
+ },
1324
+ "time": {
1325
+ "type": "string",
1326
+ "format": "date-time"
1327
+ },
1328
+ "subject": {
1329
+ "type": "string",
1330
+ "description": "The ID of the thing the event is about: work item, gate, run, score or pull request."
1331
+ },
1332
+ "datacontenttype": {
1333
+ "type": "string",
1334
+ "const": "application/json"
1335
+ },
1336
+ "dataschema": {
1337
+ "type": "string",
1338
+ "format": "uri"
1339
+ },
1340
+ "traceparent": {
1341
+ "type": "string",
1342
+ "description": "W3C trace context (CloudEvents distributed tracing extension)."
1343
+ },
1344
+ "data": {
1345
+ "$ref": "#/components/schemas/IssueLabeledData"
1346
+ }
1347
+ },
1348
+ "required": [
1349
+ "specversion",
1350
+ "id",
1351
+ "source",
1352
+ "type",
1353
+ "time",
1354
+ "data"
1355
+ ],
1356
+ "description": "forge adapters: a label was added to an issue."
1357
+ },
1358
+ "IssueLabeledData": {
1359
+ "type": "object",
1360
+ "properties": {
1361
+ "url": {
1362
+ "type": "string",
1363
+ "format": "uri",
1364
+ "description": "The issue."
1365
+ },
1366
+ "repository": {
1367
+ "type": "string",
1368
+ "format": "uri"
1369
+ },
1370
+ "number": {
1371
+ "type": "integer",
1372
+ "minimum": 1
1373
+ },
1374
+ "title": {
1375
+ "type": "string",
1376
+ "minLength": 1
1377
+ },
1378
+ "body": {
1379
+ "type": "string"
1380
+ },
1381
+ "author": {
1382
+ "$ref": "#/components/schemas/Actor",
1383
+ "description": "The person who opened the issue."
1384
+ },
1385
+ "labels": {
1386
+ "type": "array",
1387
+ "items": {
1388
+ "type": "string"
1389
+ },
1390
+ "description": "Every label of the issue after the change."
1391
+ },
1392
+ "label": {
1393
+ "type": "string",
1394
+ "description": "The label that was added, when the forge names it."
1395
+ }
1396
+ },
1397
+ "required": [
1398
+ "url",
1399
+ "repository",
1400
+ "number",
1401
+ "title",
1402
+ "author",
1403
+ "labels"
1404
+ ]
1405
+ },
950
1406
  "Link": {
951
1407
  "type": "object",
952
1408
  "properties": {
@@ -1551,119 +2007,363 @@
1551
2007
  "$ref": "#/components/schemas/Name",
1552
2008
  "description": "Harness adapter, for example \"claude-code\"."
1553
2009
  },
1554
- "osf.harness.version": {
1555
- "type": "string"
2010
+ "osf.harness.version": {
2011
+ "type": "string"
2012
+ }
2013
+ },
2014
+ "required": [
2015
+ "service.name",
2016
+ "osf.run.id",
2017
+ "osf.work_item.id",
2018
+ "osf.factory.version",
2019
+ "osf.requester.kind",
2020
+ "osf.requester.id",
2021
+ "osf.source",
2022
+ "osf.harness.name"
2023
+ ],
2024
+ "description": "Set at launch through OTEL_RESOURCE_ATTRIBUTES, so it is on every span of the run."
2025
+ },
2026
+ "RunSignal": {
2027
+ "type": "object",
2028
+ "properties": {
2029
+ "type": {
2030
+ "$ref": "#/components/schemas/RunSignalType"
2031
+ },
2032
+ "message": {
2033
+ "type": "string",
2034
+ "minLength": 1,
2035
+ "description": "The steering message. Required with \"steer\"."
2036
+ }
2037
+ },
2038
+ "required": [
2039
+ "type"
2040
+ ],
2041
+ "description": "foreman: a signal to a run: \"steer\" with a message for the running stage's agent, or \"cancel\"."
2042
+ },
2043
+ "RunSignalType": {
2044
+ "type": "string",
2045
+ "enum": [
2046
+ "steer",
2047
+ "cancel"
2048
+ ],
2049
+ "description": "foreman: what a person tells a run."
2050
+ },
2051
+ "RunSpan": {
2052
+ "type": "object",
2053
+ "properties": {
2054
+ "gen_ai.operation.name": {
2055
+ "type": "string",
2056
+ "const": "invoke_agent"
2057
+ },
2058
+ "gen_ai.provider.name": {
2059
+ "type": "string"
2060
+ },
2061
+ "gen_ai.agent.name": {
2062
+ "type": "string"
2063
+ },
2064
+ "gen_ai.conversation.id": {
2065
+ "type": "string",
2066
+ "description": "The harness session ID."
2067
+ },
2068
+ "gen_ai.request.model": {
2069
+ "type": "string"
2070
+ },
2071
+ "gen_ai.response.model": {
2072
+ "type": "string"
2073
+ },
2074
+ "gen_ai.usage.input_tokens": {
2075
+ "type": "integer",
2076
+ "minimum": 0
2077
+ },
2078
+ "gen_ai.usage.output_tokens": {
2079
+ "type": "integer",
2080
+ "minimum": 0
2081
+ },
2082
+ "gen_ai.usage.cache_read.input_tokens": {
2083
+ "type": "integer",
2084
+ "minimum": 0
2085
+ },
2086
+ "gen_ai.usage.cache_write.input_tokens": {
2087
+ "type": "integer",
2088
+ "minimum": 0
2089
+ },
2090
+ "osf.outcome": {
2091
+ "$ref": "#/components/schemas/RunOutcome"
2092
+ },
2093
+ "osf.cost.usd": {
2094
+ "type": "number",
2095
+ "minimum": 0,
2096
+ "description": "Cost of all model calls of the run, from the inference gateway."
2097
+ },
2098
+ "osf.transcript.uri": {
2099
+ "type": "string",
2100
+ "format": "uri",
2101
+ "description": "Full transcript, stored when the run ends."
2102
+ },
2103
+ "osf.artifact.uris": {
2104
+ "type": "array",
2105
+ "items": {
2106
+ "type": "string",
2107
+ "format": "uri"
2108
+ },
2109
+ "description": "Artifacts of the run: reports, screenshots, videos."
2110
+ },
2111
+ "osf.pull_request.urls": {
2112
+ "type": "array",
2113
+ "items": {
2114
+ "type": "string",
2115
+ "format": "uri"
2116
+ }
2117
+ },
2118
+ "osf.issue.urls": {
2119
+ "type": "array",
2120
+ "items": {
2121
+ "type": "string",
2122
+ "format": "uri"
2123
+ }
2124
+ },
2125
+ "osf.evidence_bundle.uri": {
2126
+ "type": "string",
2127
+ "format": "uri"
2128
+ },
2129
+ "osf.agent_trace.uri": {
2130
+ "type": "string",
2131
+ "format": "uri",
2132
+ "description": "Agent Trace record with line attribution of the run's changes."
2133
+ }
2134
+ },
2135
+ "required": [
2136
+ "gen_ai.operation.name",
2137
+ "osf.outcome"
2138
+ ],
2139
+ "description": "Attributes of the root span of the run. GenAI names where a convention exists."
2140
+ },
2141
+ "RunStarted": {
2142
+ "type": "object",
2143
+ "properties": {
2144
+ "specversion": {
2145
+ "type": "string",
2146
+ "const": "1.0"
2147
+ },
2148
+ "id": {
2149
+ "$ref": "#/components/schemas/Identifier",
2150
+ "description": "Unique per source. A consumer that sees the same source and id twice handles the event once."
2151
+ },
2152
+ "source": {
2153
+ "type": "string",
2154
+ "minLength": 1,
2155
+ "description": "The producing module, for example \"/osf/intake\"."
2156
+ },
2157
+ "type": {
2158
+ "type": "string",
2159
+ "const": "run.started@v1"
2160
+ },
2161
+ "time": {
2162
+ "type": "string",
2163
+ "format": "date-time"
2164
+ },
2165
+ "subject": {
2166
+ "type": "string",
2167
+ "description": "The ID of the thing the event is about: work item, gate, run, score or pull request."
2168
+ },
2169
+ "datacontenttype": {
2170
+ "type": "string",
2171
+ "const": "application/json"
2172
+ },
2173
+ "dataschema": {
2174
+ "type": "string",
2175
+ "format": "uri"
2176
+ },
2177
+ "traceparent": {
2178
+ "type": "string",
2179
+ "description": "W3C trace context (CloudEvents distributed tracing extension)."
2180
+ },
2181
+ "data": {
2182
+ "$ref": "#/components/schemas/RunStartedData"
2183
+ }
2184
+ },
2185
+ "required": [
2186
+ "specversion",
2187
+ "id",
2188
+ "source",
2189
+ "type",
2190
+ "time",
2191
+ "data"
2192
+ ],
2193
+ "description": "foreman: a run started (ADR 0067)."
2194
+ },
2195
+ "RunStartedData": {
2196
+ "type": "object",
2197
+ "properties": {
2198
+ "runId": {
2199
+ "$ref": "#/components/schemas/Identifier"
2200
+ },
2201
+ "workItemId": {
2202
+ "$ref": "#/components/schemas/Identifier"
2203
+ },
2204
+ "factory": {
2205
+ "$ref": "#/components/schemas/Name",
2206
+ "description": "The name of the factory."
2207
+ },
2208
+ "factoryVersion": {
2209
+ "$ref": "#/components/schemas/CommitHash"
2210
+ },
2211
+ "stages": {
2212
+ "type": "array",
2213
+ "items": {
2214
+ "$ref": "#/components/schemas/Name"
2215
+ },
2216
+ "description": "The stages of the run's workflow, in order."
2217
+ },
2218
+ "startedAt": {
2219
+ "type": "string",
2220
+ "format": "date-time"
2221
+ },
2222
+ "requester": {
2223
+ "$ref": "#/components/schemas/Actor"
2224
+ },
2225
+ "source": {
2226
+ "$ref": "#/components/schemas/Name"
2227
+ }
2228
+ },
2229
+ "required": [
2230
+ "runId",
2231
+ "workItemId",
2232
+ "factory",
2233
+ "factoryVersion",
2234
+ "stages",
2235
+ "startedAt",
2236
+ "requester",
2237
+ "source"
2238
+ ]
2239
+ },
2240
+ "RunState": {
2241
+ "type": "string",
2242
+ "enum": [
2243
+ "running",
2244
+ "blocked",
2245
+ "complete",
2246
+ "failed",
2247
+ "cancelled"
2248
+ ],
2249
+ "description": "foreman: where a run stands (vision scenario ORCH-008)."
2250
+ },
2251
+ "RunView": {
2252
+ "type": "object",
2253
+ "properties": {
2254
+ "runId": {
2255
+ "type": "string",
2256
+ "pattern": "^run_[0-9a-f]{20}$",
2257
+ "description": "\"run_\" and 20 hex digits of the SHA-256 of the work item's ID."
2258
+ },
2259
+ "workItem": {
2260
+ "$ref": "#/components/schemas/WorkItem"
2261
+ },
2262
+ "factory": {
2263
+ "$ref": "#/components/schemas/Name",
2264
+ "description": "The name of the factory."
2265
+ },
2266
+ "factoryVersion": {
2267
+ "$ref": "#/components/schemas/CommitHash",
2268
+ "description": "The commit of the factory definition the run started with."
2269
+ },
2270
+ "state": {
2271
+ "$ref": "#/components/schemas/RunState"
2272
+ },
2273
+ "startedAt": {
2274
+ "type": "string",
2275
+ "format": "date-time"
2276
+ },
2277
+ "endedAt": {
2278
+ "type": "string",
2279
+ "format": "date-time"
2280
+ },
2281
+ "stages": {
2282
+ "type": "array",
2283
+ "items": {
2284
+ "$ref": "#/components/schemas/StageView"
2285
+ },
2286
+ "description": "The stages of the workflow, in order."
1556
2287
  }
1557
2288
  },
1558
2289
  "required": [
1559
- "service.name",
1560
- "osf.run.id",
1561
- "osf.work_item.id",
1562
- "osf.factory.version",
1563
- "osf.requester.kind",
1564
- "osf.requester.id",
1565
- "osf.source",
1566
- "osf.harness.name"
2290
+ "runId",
2291
+ "workItem",
2292
+ "factory",
2293
+ "factoryVersion",
2294
+ "state",
2295
+ "startedAt",
2296
+ "stages"
1567
2297
  ],
1568
- "description": "Set at launch through OTEL_RESOURCE_ATTRIBUTES, so it is on every span of the run."
2298
+ "description": "foreman: a run of the factory's workflow for one work item, as the HTTP API shows it (ADR 0067)."
1569
2299
  },
1570
- "RunSpan": {
2300
+ "Sandbox": {
1571
2301
  "type": "object",
1572
2302
  "properties": {
1573
- "gen_ai.operation.name": {
1574
- "type": "string",
1575
- "const": "invoke_agent"
1576
- },
1577
- "gen_ai.provider.name": {
1578
- "type": "string"
1579
- },
1580
- "gen_ai.agent.name": {
1581
- "type": "string"
1582
- },
1583
- "gen_ai.conversation.id": {
2303
+ "template": {
1584
2304
  "type": "string",
1585
- "description": "The harness session ID."
1586
- },
1587
- "gen_ai.request.model": {
1588
- "type": "string"
1589
- },
1590
- "gen_ai.response.model": {
1591
- "type": "string"
1592
- },
1593
- "gen_ai.usage.input_tokens": {
1594
- "type": "integer",
1595
- "minimum": 0
1596
- },
1597
- "gen_ai.usage.output_tokens": {
1598
- "type": "integer",
1599
- "minimum": 0
1600
- },
1601
- "gen_ai.usage.cache_read.input_tokens": {
1602
- "type": "integer",
1603
- "minimum": 0
1604
- },
1605
- "gen_ai.usage.cache_write.input_tokens": {
1606
- "type": "integer",
1607
- "minimum": 0
1608
- },
1609
- "osf.outcome": {
1610
- "$ref": "#/components/schemas/RunOutcome"
2305
+ "minLength": 1,
2306
+ "description": "Sandbox template name, for example \"node-24\"."
1611
2307
  },
1612
- "osf.cost.usd": {
2308
+ "cpu": {
1613
2309
  "type": "number",
1614
- "minimum": 0,
1615
- "description": "Cost of all model calls of the run, from the inference gateway."
2310
+ "minimum": 0.001,
2311
+ "description": "CPU cores. The smallest unit is 0.001 (one millicore)."
1616
2312
  },
1617
- "osf.transcript.uri": {
2313
+ "memory": {
1618
2314
  "type": "string",
1619
- "format": "uri",
1620
- "description": "Full transcript, stored when the run ends."
2315
+ "pattern": "^[0-9]+(Ki|Mi|Gi|Ti)?$",
2316
+ "description": "Kubernetes quantity, for example \"8Gi\"."
1621
2317
  },
1622
- "osf.artifact.uris": {
2318
+ "egress": {
1623
2319
  "type": "array",
1624
2320
  "items": {
1625
- "type": "string",
1626
- "format": "uri"
2321
+ "type": "string"
1627
2322
  },
1628
- "description": "Artifacts of the run: reports, screenshots, videos."
2323
+ "description": "Hostnames the sandbox may reach. Everything else is blocked."
2324
+ }
2325
+ },
2326
+ "required": [
2327
+ "template"
2328
+ ],
2329
+ "additionalProperties": false
2330
+ },
2331
+ "SandboxMcpServer": {
2332
+ "type": "object",
2333
+ "properties": {
2334
+ "name": {
2335
+ "$ref": "#/components/schemas/Name",
2336
+ "description": "The name in the egress log, for example \"wiki\"."
1629
2337
  },
1630
- "osf.pull_request.urls": {
1631
- "type": "array",
1632
- "items": {
1633
- "type": "string",
1634
- "format": "uri"
1635
- }
2338
+ "url": {
2339
+ "type": "string",
2340
+ "pattern": "^https?://[^/]+",
2341
+ "description": "The server's endpoint, for example \"https://wiki.example.com/mcp\"."
1636
2342
  },
1637
- "osf.issue.urls": {
2343
+ "tools": {
1638
2344
  "type": "array",
1639
2345
  "items": {
1640
- "type": "string",
1641
- "format": "uri"
1642
- }
1643
- },
1644
- "osf.evidence_bundle.uri": {
1645
- "type": "string",
1646
- "format": "uri"
1647
- },
1648
- "osf.agent_trace.uri": {
1649
- "type": "string",
1650
- "format": "uri",
1651
- "description": "Agent Trace record with line attribution of the run's changes."
2346
+ "type": "string"
2347
+ },
2348
+ "minItems": 1,
2349
+ "description": "The tools the sandbox may call. A call to any other tool is refused."
1652
2350
  }
1653
2351
  },
1654
2352
  "required": [
1655
- "gen_ai.operation.name",
1656
- "osf.outcome"
2353
+ "name",
2354
+ "url",
2355
+ "tools"
1657
2356
  ],
1658
- "description": "Attributes of the root span of the run. GenAI names where a convention exists."
2357
+ "description": "An MCP server that a sandbox may call over Streamable HTTP.",
2358
+ "additionalProperties": false
1659
2359
  },
1660
- "Sandbox": {
2360
+ "SandboxSpec": {
1661
2361
  "type": "object",
1662
2362
  "properties": {
1663
2363
  "template": {
1664
2364
  "type": "string",
1665
2365
  "minLength": 1,
1666
- "description": "Sandbox template name, for example \"node-24\"."
2366
+ "description": "What the sandbox starts from: an image for the docker adapter, a SandboxTemplate for kubernetes, or a snapshot."
1667
2367
  },
1668
2368
  "cpu": {
1669
2369
  "type": "number",
@@ -1678,14 +2378,38 @@
1678
2378
  "egress": {
1679
2379
  "type": "array",
1680
2380
  "items": {
2381
+ "$ref": "#/components/schemas/Hostname"
2382
+ },
2383
+ "description": "Hostnames the sandbox may reach through its egress proxy. Everything else is refused."
2384
+ },
2385
+ "env": {
2386
+ "type": "object",
2387
+ "properties": {},
2388
+ "unevaluatedProperties": {
1681
2389
  "type": "string"
1682
2390
  },
1683
- "description": "Hostnames the sandbox may reach. Everything else is blocked."
2391
+ "description": "Variables of the sandbox's environment that hold no secret."
2392
+ },
2393
+ "secrets": {
2394
+ "type": "object",
2395
+ "properties": {},
2396
+ "unevaluatedProperties": {
2397
+ "$ref": "#/components/schemas/SecretReference"
2398
+ },
2399
+ "description": "Secrets by the name of the variable that holds the placeholder in the sandbox. The egress proxy puts the real\nvalue in on the way out, for the hosts of `egress`."
2400
+ },
2401
+ "mcp": {
2402
+ "type": "array",
2403
+ "items": {
2404
+ "$ref": "#/components/schemas/SandboxMcpServer"
2405
+ },
2406
+ "description": "The MCP servers the sandbox may call. A call to any other MCP server is refused."
1684
2407
  }
1685
2408
  },
1686
2409
  "required": [
1687
2410
  "template"
1688
2411
  ],
2412
+ "description": "The input of a sandbox adapter's `create` (ADR 0054): what one sandbox runs, how much it may use, and what it may\nreach. Realizes SCN-FACTORY-RUNTIME-004, -006 and -007.",
1689
2413
  "additionalProperties": false
1690
2414
  },
1691
2415
  "ScenarioEvidence": {
@@ -1942,6 +2666,57 @@
1942
2666
  ],
1943
2667
  "additionalProperties": false
1944
2668
  },
2669
+ "StageState": {
2670
+ "type": "string",
2671
+ "enum": [
2672
+ "pending",
2673
+ "blocked",
2674
+ "running",
2675
+ "succeeded",
2676
+ "failed",
2677
+ "rejected",
2678
+ "cancelled"
2679
+ ],
2680
+ "description": "foreman: where a stage of a run stands."
2681
+ },
2682
+ "StageView": {
2683
+ "type": "object",
2684
+ "properties": {
2685
+ "stage": {
2686
+ "$ref": "#/components/schemas/Name"
2687
+ },
2688
+ "agent": {
2689
+ "$ref": "#/components/schemas/Name",
2690
+ "description": "The agent that runs the stage."
2691
+ },
2692
+ "state": {
2693
+ "$ref": "#/components/schemas/StageState"
2694
+ },
2695
+ "sessionId": {
2696
+ "type": "string",
2697
+ "description": "The harness session of the stage's agent, once it started."
2698
+ },
2699
+ "gateId": {
2700
+ "type": "string",
2701
+ "pattern": "^g[0-9a-f]{16}$",
2702
+ "description": "The gate that decides whether the stage starts, once it was requested."
2703
+ },
2704
+ "startedAt": {
2705
+ "type": "string",
2706
+ "format": "date-time"
2707
+ },
2708
+ "endedAt": {
2709
+ "type": "string",
2710
+ "format": "date-time"
2711
+ }
2712
+ },
2713
+ "required": [
2714
+ "stage",
2715
+ "agent",
2716
+ "state"
2717
+ ],
2718
+ "description": "foreman: one stage of a run (ADR 0067)."
2719
+ },
1945
2720
  "TraceId": {
1946
2721
  "type": "string",
1947
2722
  "pattern": "^[0-9a-f]{32}$",
@@ -2015,6 +2790,13 @@
2015
2790
  ],
2016
2791
  "description": "One unit of requested work: the `data` of a `work.received@v1` CloudEvent."
2017
2792
  },
2793
+ "WorkItemStatus": {
2794
+ "type": "string",
2795
+ "enum": [
2796
+ "received"
2797
+ ],
2798
+ "description": "Where a work item stands."
2799
+ },
2018
2800
  "WorkItemType": {
2019
2801
  "type": "string",
2020
2802
  "enum": [
@@ -2024,6 +2806,36 @@
2024
2806
  "automation"
2025
2807
  ]
2026
2808
  },
2809
+ "WorkItemView": {
2810
+ "type": "object",
2811
+ "properties": {
2812
+ "workItem": {
2813
+ "$ref": "#/components/schemas/WorkItem",
2814
+ "description": "Its ID is \"wi_\" and 20 hex digits of the SHA-256 of its dedupe key."
2815
+ },
2816
+ "status": {
2817
+ "$ref": "#/components/schemas/WorkItemStatus"
2818
+ },
2819
+ "receivedAt": {
2820
+ "type": "string",
2821
+ "format": "date-time"
2822
+ },
2823
+ "requests": {
2824
+ "type": "array",
2825
+ "items": {
2826
+ "$ref": "#/components/schemas/WorkRequest"
2827
+ },
2828
+ "description": "Every submission that asked for the work item, oldest first; one per origin."
2829
+ }
2830
+ },
2831
+ "required": [
2832
+ "workItem",
2833
+ "status",
2834
+ "receivedAt",
2835
+ "requests"
2836
+ ],
2837
+ "description": "intake: a work item as the HTTP API shows it (ADR 0063)."
2838
+ },
2027
2839
  "WorkReceived": {
2028
2840
  "type": "object",
2029
2841
  "properties": {
@@ -2077,6 +2889,70 @@
2077
2889
  "data"
2078
2890
  ],
2079
2891
  "description": "intake: a work item was accepted."
2892
+ },
2893
+ "WorkRequest": {
2894
+ "type": "object",
2895
+ "properties": {
2896
+ "requester": {
2897
+ "$ref": "#/components/schemas/Actor"
2898
+ },
2899
+ "origin": {
2900
+ "$ref": "#/components/schemas/Origin"
2901
+ },
2902
+ "receivedAt": {
2903
+ "type": "string",
2904
+ "format": "date-time"
2905
+ }
2906
+ },
2907
+ "required": [
2908
+ "requester",
2909
+ "origin",
2910
+ "receivedAt"
2911
+ ],
2912
+ "description": "intake: one submission that asked for a work item."
2913
+ },
2914
+ "WorkSubmission": {
2915
+ "type": "object",
2916
+ "properties": {
2917
+ "type": {
2918
+ "$ref": "#/components/schemas/WorkItemType",
2919
+ "description": "Default: task."
2920
+ },
2921
+ "title": {
2922
+ "type": "string",
2923
+ "minLength": 1,
2924
+ "maxLength": 300
2925
+ },
2926
+ "description": {
2927
+ "type": "string"
2928
+ },
2929
+ "requester": {
2930
+ "$ref": "#/components/schemas/Actor"
2931
+ },
2932
+ "origin": {
2933
+ "$ref": "#/components/schemas/Origin"
2934
+ },
2935
+ "dedupeKey": {
2936
+ "type": "string",
2937
+ "minLength": 1,
2938
+ "description": "Requests with the same key become one work item. Default: the origin's url, else \"<source>:<externalId>\"."
2939
+ },
2940
+ "surface": {
2941
+ "type": "string"
2942
+ },
2943
+ "links": {
2944
+ "type": "array",
2945
+ "items": {
2946
+ "$ref": "#/components/schemas/Link"
2947
+ }
2948
+ }
2949
+ },
2950
+ "required": [
2951
+ "title",
2952
+ "requester",
2953
+ "origin"
2954
+ ],
2955
+ "description": "intake: work to put into the inbox, a work item without its ID (ADR 0063)."
2080
2956
  }
2081
2957
  },
2082
2958
  "securitySchemes": {