@opensoftware/contracts 1.8.0 → 1.10.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.
- package/dist/generated/types.d.ts +71 -5
- package/factory-definition/factory-definition.schema.json +20 -0
- package/openapi/openapi.json +112 -5
- package/package.json +2 -2
- package/typespec/factory-definition.tsp +15 -0
- package/typespec/foreman-api.tsp +5 -0
- package/typespec/foreman.tsp +18 -1
- package/typespec/intake.tsp +10 -1
|
@@ -40,7 +40,8 @@ export type paths = {
|
|
|
40
40
|
path?: never;
|
|
41
41
|
cookie?: never;
|
|
42
42
|
};
|
|
43
|
-
|
|
43
|
+
/** @description The runs of the server, running runs first, then the runs that ended, the one that ended last first; with `state`, only the runs in that state (ADR 0071). */
|
|
44
|
+
get: operations["ForemanApi_listRuns"];
|
|
44
45
|
put?: never;
|
|
45
46
|
/** @description Start a run of the factory's workflow for a work item. The same work item again answers the run it started. */
|
|
46
47
|
post: operations["ForemanApi_startRun"];
|
|
@@ -252,6 +253,8 @@ export type components = {
|
|
|
252
253
|
description?: string;
|
|
253
254
|
/** @description Adapters per port with a version range, pinned in `factory.lock` by `factory plan`. */
|
|
254
255
|
providers?: components["schemas"]["Providers"];
|
|
256
|
+
/** @description The inference gateway of the adapter under `providers.inference` (ADR 0070). */
|
|
257
|
+
inference?: components["schemas"]["Inference"];
|
|
255
258
|
/** @description Agents by name. */
|
|
256
259
|
agents: {
|
|
257
260
|
[key: string]: components["schemas"]["Agent"];
|
|
@@ -430,6 +433,13 @@ export type components = {
|
|
|
430
433
|
Hostname: string;
|
|
431
434
|
/** @description An identifier chosen by the producer. ULIDs are recommended; consumers treat it as opaque. */
|
|
432
435
|
Identifier: string;
|
|
436
|
+
/** @description The inference gateway: the adapter's config and the most a run may spend (ADR 0070). */
|
|
437
|
+
Inference: {
|
|
438
|
+
/** @description Path to the inference adapter's config, for example a LiteLLM proxy config. */
|
|
439
|
+
config: string;
|
|
440
|
+
/** @description The most a run may spend on model calls, in USD. */
|
|
441
|
+
budget?: number;
|
|
442
|
+
};
|
|
433
443
|
/** @description forge adapters: a label was added to an issue. */
|
|
434
444
|
IssueLabeled: {
|
|
435
445
|
/** @constant */
|
|
@@ -675,6 +685,10 @@ export type components = {
|
|
|
675
685
|
/** Format: uri */
|
|
676
686
|
evidenceBundle?: string;
|
|
677
687
|
};
|
|
688
|
+
/** @description foreman: the runs of the server, running runs first, then the runs that ended, the one that ended last first, as `GET /v1/runs` answers them (ADR 0071). */
|
|
689
|
+
RunList: {
|
|
690
|
+
runs: components["schemas"]["RunView"][];
|
|
691
|
+
};
|
|
678
692
|
/**
|
|
679
693
|
* @description How a run ended.
|
|
680
694
|
* @enum {string}
|
|
@@ -707,7 +721,10 @@ export type components = {
|
|
|
707
721
|
"osf.harness.name": components["schemas"]["Name"];
|
|
708
722
|
"osf.harness.version"?: string;
|
|
709
723
|
};
|
|
710
|
-
/**
|
|
724
|
+
/**
|
|
725
|
+
* @description foreman: a signal to a run: "steer" with a message for the running stage's agent, "cancel", "take-over" of the running
|
|
726
|
+
* stage by a person, or "hand-back" of that stage (ADR 0070).
|
|
727
|
+
*/
|
|
711
728
|
RunSignal: {
|
|
712
729
|
type: components["schemas"]["RunSignalType"];
|
|
713
730
|
/** @description The steering message. Required with "steer". */
|
|
@@ -717,7 +734,7 @@ export type components = {
|
|
|
717
734
|
* @description foreman: what a person tells a run.
|
|
718
735
|
* @enum {string}
|
|
719
736
|
*/
|
|
720
|
-
RunSignalType: "steer" | "cancel";
|
|
737
|
+
RunSignalType: "steer" | "cancel" | "take-over" | "hand-back";
|
|
721
738
|
/** @description Attributes of the root span of the run. GenAI names where a convention exists. */
|
|
722
739
|
RunSpan: {
|
|
723
740
|
/** @constant */
|
|
@@ -807,6 +824,8 @@ export type components = {
|
|
|
807
824
|
* @description The last pull request link that an agent of the run wrote (ADR 0069).
|
|
808
825
|
*/
|
|
809
826
|
pullRequest?: string;
|
|
827
|
+
/** @description The run's folder on the foreman's machine, where a person who took over a stage goes on (ADR 0070). */
|
|
828
|
+
folder?: string;
|
|
810
829
|
/** Format: date-time */
|
|
811
830
|
startedAt: string;
|
|
812
831
|
/** Format: date-time */
|
|
@@ -973,6 +992,11 @@ export type components = {
|
|
|
973
992
|
gateId?: string;
|
|
974
993
|
/** @description The checks the stage waits for, once the foreman read them (ADR 0069). */
|
|
975
994
|
checks?: components["schemas"]["CheckView"][];
|
|
995
|
+
/**
|
|
996
|
+
* Format: date-time
|
|
997
|
+
* @description When a person took the stage over from its agent (ADR 0070).
|
|
998
|
+
*/
|
|
999
|
+
takenOverAt?: string;
|
|
976
1000
|
/** @description Why the stage ended without success, when the foreman knows. */
|
|
977
1001
|
reason?: string;
|
|
978
1002
|
/** Format: date-time */
|
|
@@ -1006,10 +1030,10 @@ export type components = {
|
|
|
1006
1030
|
links?: components["schemas"]["Link"][];
|
|
1007
1031
|
};
|
|
1008
1032
|
/**
|
|
1009
|
-
* @description Where a work item stands.
|
|
1033
|
+
* @description Where a work item stands: received, then as its run in the foreman goes (ADR 0071).
|
|
1010
1034
|
* @enum {string}
|
|
1011
1035
|
*/
|
|
1012
|
-
WorkItemStatus: "received";
|
|
1036
|
+
WorkItemStatus: "received" | "running" | "complete" | "failed" | "cancelled";
|
|
1013
1037
|
/** @enum {string} */
|
|
1014
1038
|
WorkItemType: "idea" | "bug" | "task" | "automation";
|
|
1015
1039
|
/** @description intake: a work item as the HTTP API shows it (ADR 0063). */
|
|
@@ -1017,6 +1041,8 @@ export type components = {
|
|
|
1017
1041
|
/** @description Its ID is "wi_" and 20 hex digits of the SHA-256 of its dedupe key. */
|
|
1018
1042
|
workItem: components["schemas"]["WorkItem"];
|
|
1019
1043
|
status: components["schemas"]["WorkItemStatus"];
|
|
1044
|
+
/** @description The foreman's run of the work item, once it started (ADR 0071). */
|
|
1045
|
+
runId?: string;
|
|
1020
1046
|
/** Format: date-time */
|
|
1021
1047
|
receivedAt: string;
|
|
1022
1048
|
/** @description Every submission that asked for the work item, oldest first; one per origin. */
|
|
@@ -1164,6 +1190,46 @@ export interface operations {
|
|
|
1164
1190
|
};
|
|
1165
1191
|
};
|
|
1166
1192
|
};
|
|
1193
|
+
ForemanApi_listRuns: {
|
|
1194
|
+
parameters: {
|
|
1195
|
+
query?: {
|
|
1196
|
+
state?: components["schemas"]["RunState"];
|
|
1197
|
+
};
|
|
1198
|
+
header?: never;
|
|
1199
|
+
path?: never;
|
|
1200
|
+
cookie?: never;
|
|
1201
|
+
};
|
|
1202
|
+
requestBody?: never;
|
|
1203
|
+
responses: {
|
|
1204
|
+
/** @description The request has succeeded. */
|
|
1205
|
+
200: {
|
|
1206
|
+
headers: {
|
|
1207
|
+
[name: string]: unknown;
|
|
1208
|
+
};
|
|
1209
|
+
content: {
|
|
1210
|
+
"application/json": components["schemas"]["RunList"];
|
|
1211
|
+
};
|
|
1212
|
+
};
|
|
1213
|
+
/** @description The server could not understand the request due to invalid syntax. */
|
|
1214
|
+
400: {
|
|
1215
|
+
headers: {
|
|
1216
|
+
[name: string]: unknown;
|
|
1217
|
+
};
|
|
1218
|
+
content: {
|
|
1219
|
+
"application/problem+json": components["schemas"]["ApiProblem"];
|
|
1220
|
+
};
|
|
1221
|
+
};
|
|
1222
|
+
/** @description Access is unauthorized. */
|
|
1223
|
+
401: {
|
|
1224
|
+
headers: {
|
|
1225
|
+
[name: string]: unknown;
|
|
1226
|
+
};
|
|
1227
|
+
content: {
|
|
1228
|
+
"application/problem+json": components["schemas"]["ApiProblem"];
|
|
1229
|
+
};
|
|
1230
|
+
};
|
|
1231
|
+
};
|
|
1232
|
+
};
|
|
1167
1233
|
ForemanApi_startRun: {
|
|
1168
1234
|
parameters: {
|
|
1169
1235
|
query?: never;
|
|
@@ -112,6 +112,26 @@
|
|
|
112
112
|
"description": "Adapters per port with a version range, pinned in `factory.lock` by `factory plan`.",
|
|
113
113
|
"additionalProperties": false
|
|
114
114
|
},
|
|
115
|
+
"inference": {
|
|
116
|
+
"type": "object",
|
|
117
|
+
"properties": {
|
|
118
|
+
"config": {
|
|
119
|
+
"type": "string",
|
|
120
|
+
"minLength": 1,
|
|
121
|
+
"description": "Path to the inference adapter's config, for example a LiteLLM proxy config."
|
|
122
|
+
},
|
|
123
|
+
"budget": {
|
|
124
|
+
"type": "number",
|
|
125
|
+
"minimum": 0,
|
|
126
|
+
"description": "The most a run may spend on model calls, in USD."
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
"required": [
|
|
130
|
+
"config"
|
|
131
|
+
],
|
|
132
|
+
"description": "The inference gateway of the adapter under `providers.inference` (ADR 0070).",
|
|
133
|
+
"additionalProperties": false
|
|
134
|
+
},
|
|
115
135
|
"agents": {
|
|
116
136
|
"type": "object",
|
|
117
137
|
"properties": {},
|
package/openapi/openapi.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"openapi": "3.1.0",
|
|
3
3
|
"info": {
|
|
4
4
|
"title": "Open Software Factory contracts",
|
|
5
|
-
"version": "1.
|
|
5
|
+
"version": "1.10.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",
|
|
@@ -174,6 +174,53 @@
|
|
|
174
174
|
}
|
|
175
175
|
}
|
|
176
176
|
}
|
|
177
|
+
},
|
|
178
|
+
"get": {
|
|
179
|
+
"operationId": "ForemanApi_listRuns",
|
|
180
|
+
"description": "The runs of the server, running runs first, then the runs that ended, the one that ended last first; with `state`, only the runs in that state (ADR 0071).",
|
|
181
|
+
"parameters": [
|
|
182
|
+
{
|
|
183
|
+
"name": "state",
|
|
184
|
+
"in": "query",
|
|
185
|
+
"required": false,
|
|
186
|
+
"schema": {
|
|
187
|
+
"$ref": "#/components/schemas/RunState"
|
|
188
|
+
},
|
|
189
|
+
"explode": false
|
|
190
|
+
}
|
|
191
|
+
],
|
|
192
|
+
"responses": {
|
|
193
|
+
"200": {
|
|
194
|
+
"description": "The request has succeeded.",
|
|
195
|
+
"content": {
|
|
196
|
+
"application/json": {
|
|
197
|
+
"schema": {
|
|
198
|
+
"$ref": "#/components/schemas/RunList"
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
},
|
|
203
|
+
"400": {
|
|
204
|
+
"description": "The server could not understand the request due to invalid syntax.",
|
|
205
|
+
"content": {
|
|
206
|
+
"application/problem+json": {
|
|
207
|
+
"schema": {
|
|
208
|
+
"$ref": "#/components/schemas/ApiProblem"
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
},
|
|
213
|
+
"401": {
|
|
214
|
+
"description": "Access is unauthorized.",
|
|
215
|
+
"content": {
|
|
216
|
+
"application/problem+json": {
|
|
217
|
+
"schema": {
|
|
218
|
+
"$ref": "#/components/schemas/ApiProblem"
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
}
|
|
177
224
|
}
|
|
178
225
|
},
|
|
179
226
|
"/v1/runs/{runId}": {
|
|
@@ -838,6 +885,10 @@
|
|
|
838
885
|
"$ref": "#/components/schemas/Providers",
|
|
839
886
|
"description": "Adapters per port with a version range, pinned in `factory.lock` by `factory plan`."
|
|
840
887
|
},
|
|
888
|
+
"inference": {
|
|
889
|
+
"$ref": "#/components/schemas/Inference",
|
|
890
|
+
"description": "The inference gateway of the adapter under `providers.inference` (ADR 0070)."
|
|
891
|
+
},
|
|
841
892
|
"agents": {
|
|
842
893
|
"type": "object",
|
|
843
894
|
"properties": {},
|
|
@@ -1332,6 +1383,26 @@
|
|
|
1332
1383
|
"maxLength": 128,
|
|
1333
1384
|
"description": "An identifier chosen by the producer. ULIDs are recommended; consumers treat it as opaque."
|
|
1334
1385
|
},
|
|
1386
|
+
"Inference": {
|
|
1387
|
+
"type": "object",
|
|
1388
|
+
"properties": {
|
|
1389
|
+
"config": {
|
|
1390
|
+
"type": "string",
|
|
1391
|
+
"minLength": 1,
|
|
1392
|
+
"description": "Path to the inference adapter's config, for example a LiteLLM proxy config."
|
|
1393
|
+
},
|
|
1394
|
+
"budget": {
|
|
1395
|
+
"type": "number",
|
|
1396
|
+
"minimum": 0,
|
|
1397
|
+
"description": "The most a run may spend on model calls, in USD."
|
|
1398
|
+
}
|
|
1399
|
+
},
|
|
1400
|
+
"required": [
|
|
1401
|
+
"config"
|
|
1402
|
+
],
|
|
1403
|
+
"description": "The inference gateway: the adapter's config and the most a run may spend (ADR 0070).",
|
|
1404
|
+
"additionalProperties": false
|
|
1405
|
+
},
|
|
1335
1406
|
"IssueLabeled": {
|
|
1336
1407
|
"type": "object",
|
|
1337
1408
|
"properties": {
|
|
@@ -1976,6 +2047,21 @@
|
|
|
1976
2047
|
"source"
|
|
1977
2048
|
]
|
|
1978
2049
|
},
|
|
2050
|
+
"RunList": {
|
|
2051
|
+
"type": "object",
|
|
2052
|
+
"properties": {
|
|
2053
|
+
"runs": {
|
|
2054
|
+
"type": "array",
|
|
2055
|
+
"items": {
|
|
2056
|
+
"$ref": "#/components/schemas/RunView"
|
|
2057
|
+
}
|
|
2058
|
+
}
|
|
2059
|
+
},
|
|
2060
|
+
"required": [
|
|
2061
|
+
"runs"
|
|
2062
|
+
],
|
|
2063
|
+
"description": "foreman: the runs of the server, running runs first, then the runs that ended, the one that ended last first, as `GET /v1/runs` answers them (ADR 0071)."
|
|
2064
|
+
},
|
|
1979
2065
|
"RunOutcome": {
|
|
1980
2066
|
"type": "string",
|
|
1981
2067
|
"enum": [
|
|
@@ -2069,13 +2155,15 @@
|
|
|
2069
2155
|
"required": [
|
|
2070
2156
|
"type"
|
|
2071
2157
|
],
|
|
2072
|
-
"description": "foreman: a signal to a run: \"steer\" with a message for the running stage's agent, or \"
|
|
2158
|
+
"description": "foreman: a signal to a run: \"steer\" with a message for the running stage's agent, \"cancel\", \"take-over\" of the running\nstage by a person, or \"hand-back\" of that stage (ADR 0070)."
|
|
2073
2159
|
},
|
|
2074
2160
|
"RunSignalType": {
|
|
2075
2161
|
"type": "string",
|
|
2076
2162
|
"enum": [
|
|
2077
2163
|
"steer",
|
|
2078
|
-
"cancel"
|
|
2164
|
+
"cancel",
|
|
2165
|
+
"take-over",
|
|
2166
|
+
"hand-back"
|
|
2079
2167
|
],
|
|
2080
2168
|
"description": "foreman: what a person tells a run."
|
|
2081
2169
|
},
|
|
@@ -2306,6 +2394,11 @@
|
|
|
2306
2394
|
"format": "uri",
|
|
2307
2395
|
"description": "The last pull request link that an agent of the run wrote (ADR 0069)."
|
|
2308
2396
|
},
|
|
2397
|
+
"folder": {
|
|
2398
|
+
"type": "string",
|
|
2399
|
+
"minLength": 1,
|
|
2400
|
+
"description": "The run's folder on the foreman's machine, where a person who took over a stage goes on (ADR 0070)."
|
|
2401
|
+
},
|
|
2309
2402
|
"startedAt": {
|
|
2310
2403
|
"type": "string",
|
|
2311
2404
|
"format": "date-time"
|
|
@@ -2751,6 +2844,11 @@
|
|
|
2751
2844
|
},
|
|
2752
2845
|
"description": "The checks the stage waits for, once the foreman read them (ADR 0069)."
|
|
2753
2846
|
},
|
|
2847
|
+
"takenOverAt": {
|
|
2848
|
+
"type": "string",
|
|
2849
|
+
"format": "date-time",
|
|
2850
|
+
"description": "When a person took the stage over from its agent (ADR 0070)."
|
|
2851
|
+
},
|
|
2754
2852
|
"reason": {
|
|
2755
2853
|
"type": "string",
|
|
2756
2854
|
"minLength": 1,
|
|
@@ -2848,9 +2946,13 @@
|
|
|
2848
2946
|
"WorkItemStatus": {
|
|
2849
2947
|
"type": "string",
|
|
2850
2948
|
"enum": [
|
|
2851
|
-
"received"
|
|
2949
|
+
"received",
|
|
2950
|
+
"running",
|
|
2951
|
+
"complete",
|
|
2952
|
+
"failed",
|
|
2953
|
+
"cancelled"
|
|
2852
2954
|
],
|
|
2853
|
-
"description": "Where a work item stands."
|
|
2955
|
+
"description": "Where a work item stands: received, then as its run in the foreman goes (ADR 0071)."
|
|
2854
2956
|
},
|
|
2855
2957
|
"WorkItemType": {
|
|
2856
2958
|
"type": "string",
|
|
@@ -2871,6 +2973,11 @@
|
|
|
2871
2973
|
"status": {
|
|
2872
2974
|
"$ref": "#/components/schemas/WorkItemStatus"
|
|
2873
2975
|
},
|
|
2976
|
+
"runId": {
|
|
2977
|
+
"type": "string",
|
|
2978
|
+
"minLength": 1,
|
|
2979
|
+
"description": "The foreman's run of the work item, once it started (ADR 0071)."
|
|
2980
|
+
},
|
|
2874
2981
|
"receivedAt": {
|
|
2875
2982
|
"type": "string",
|
|
2876
2983
|
"format": "date-time"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opensoftware/contracts",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.10.0",
|
|
4
4
|
"description": "The shared formats of the open software factory: JSON Schemas, TypeScript types and the osf-contracts CLI.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"@typespec/openapi": "1.17.0",
|
|
45
45
|
"@typespec/openapi3": "1.17.0",
|
|
46
46
|
"openapi-typescript": "7.13.0",
|
|
47
|
-
"@opensoftware/testkit": "0.
|
|
47
|
+
"@opensoftware/testkit": "0.24.0"
|
|
48
48
|
},
|
|
49
49
|
"scripts": {
|
|
50
50
|
"build": "node scripts/build.ts",
|
|
@@ -29,6 +29,9 @@ model FactoryDefinition {
|
|
|
29
29
|
/** Adapters per port with a version range, pinned in `factory.lock` by `factory plan`. */
|
|
30
30
|
providers?: Providers;
|
|
31
31
|
|
|
32
|
+
/** The inference gateway of the adapter under `providers.inference` (ADR 0070). */
|
|
33
|
+
inference?: Inference;
|
|
34
|
+
|
|
32
35
|
/** Agents by name. */
|
|
33
36
|
@minProperties(1)
|
|
34
37
|
agents: Record<Agent>;
|
|
@@ -64,6 +67,18 @@ model Providers {
|
|
|
64
67
|
policy?: Record<VersionRange>;
|
|
65
68
|
}
|
|
66
69
|
|
|
70
|
+
/** The inference gateway: the adapter's config and the most a run may spend (ADR 0070). */
|
|
71
|
+
@extension("additionalProperties", Json<false>)
|
|
72
|
+
model Inference {
|
|
73
|
+
/** Path to the inference adapter's config, for example a LiteLLM proxy config. */
|
|
74
|
+
@minLength(1)
|
|
75
|
+
config: string;
|
|
76
|
+
|
|
77
|
+
/** The most a run may spend on model calls, in USD. */
|
|
78
|
+
@minValue(0)
|
|
79
|
+
budget?: float64;
|
|
80
|
+
}
|
|
81
|
+
|
|
67
82
|
/** A reference to a secret, resolved at the egress proxy, never in the sandbox: "ref:<provider>/<name>". */
|
|
68
83
|
@pattern("^ref:[a-z][a-z0-9-]*/[A-Za-z0-9_./-]+$")
|
|
69
84
|
scalar SecretReference extends string;
|
package/typespec/foreman-api.tsp
CHANGED
|
@@ -25,6 +25,11 @@ namespace ForemanApi {
|
|
|
25
25
|
| GatekeeperApi.Failure<400>
|
|
26
26
|
| GatekeeperApi.Failure<401>;
|
|
27
27
|
|
|
28
|
+
/** The runs of the server, running runs first, then the runs that ended, the one that ended last first; with `state`, only the runs in that state (ADR 0071). */
|
|
29
|
+
@route("/v1/runs")
|
|
30
|
+
@get
|
|
31
|
+
op listRuns(@query state?: RunState): RunList | GatekeeperApi.Failure<400> | GatekeeperApi.Failure<401>;
|
|
32
|
+
|
|
28
33
|
/** A run: its state and the state of each stage. */
|
|
29
34
|
@route("/v1/runs/{runId}")
|
|
30
35
|
@get
|
package/typespec/foreman.tsp
CHANGED
|
@@ -60,6 +60,9 @@ model StageView {
|
|
|
60
60
|
/** The checks the stage waits for, once the foreman read them (ADR 0069). */
|
|
61
61
|
checks?: CheckView[];
|
|
62
62
|
|
|
63
|
+
/** When a person took the stage over from its agent (ADR 0070). */
|
|
64
|
+
takenOverAt?: utcDateTime;
|
|
65
|
+
|
|
63
66
|
/** Why the stage ended without success, when the foreman knows. */
|
|
64
67
|
@minLength(1)
|
|
65
68
|
reason?: string;
|
|
@@ -87,6 +90,10 @@ model RunView {
|
|
|
87
90
|
/** The last pull request link that an agent of the run wrote (ADR 0069). */
|
|
88
91
|
pullRequest?: url;
|
|
89
92
|
|
|
93
|
+
/** The run's folder on the foreman's machine, where a person who took over a stage goes on (ADR 0070). */
|
|
94
|
+
@minLength(1)
|
|
95
|
+
folder?: string;
|
|
96
|
+
|
|
90
97
|
startedAt: utcDateTime;
|
|
91
98
|
endedAt?: utcDateTime;
|
|
92
99
|
|
|
@@ -94,13 +101,23 @@ model RunView {
|
|
|
94
101
|
stages: StageView[];
|
|
95
102
|
}
|
|
96
103
|
|
|
104
|
+
/** foreman: the runs of the server, running runs first, then the runs that ended, the one that ended last first, as `GET /v1/runs` answers them (ADR 0071). */
|
|
105
|
+
model RunList {
|
|
106
|
+
runs: RunView[];
|
|
107
|
+
}
|
|
108
|
+
|
|
97
109
|
/** foreman: what a person tells a run. */
|
|
98
110
|
enum RunSignalType {
|
|
99
111
|
steer,
|
|
100
112
|
cancel,
|
|
113
|
+
`take-over`,
|
|
114
|
+
`hand-back`,
|
|
101
115
|
}
|
|
102
116
|
|
|
103
|
-
/**
|
|
117
|
+
/**
|
|
118
|
+
* foreman: a signal to a run: "steer" with a message for the running stage's agent, "cancel", "take-over" of the running
|
|
119
|
+
* stage by a person, or "hand-back" of that stage (ADR 0070).
|
|
120
|
+
*/
|
|
104
121
|
model RunSignal {
|
|
105
122
|
type: RunSignalType;
|
|
106
123
|
|
package/typespec/intake.tsp
CHANGED
|
@@ -27,9 +27,13 @@ model WorkSubmission {
|
|
|
27
27
|
links?: Link[];
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
/** Where a work item stands. */
|
|
30
|
+
/** Where a work item stands: received, then as its run in the foreman goes (ADR 0071). */
|
|
31
31
|
enum WorkItemStatus {
|
|
32
32
|
received,
|
|
33
|
+
running,
|
|
34
|
+
complete,
|
|
35
|
+
failed,
|
|
36
|
+
cancelled,
|
|
33
37
|
}
|
|
34
38
|
|
|
35
39
|
/** intake: one submission that asked for a work item. */
|
|
@@ -45,6 +49,11 @@ model WorkItemView {
|
|
|
45
49
|
workItem: WorkItem;
|
|
46
50
|
|
|
47
51
|
status: WorkItemStatus;
|
|
52
|
+
|
|
53
|
+
/** The foreman's run of the work item, once it started (ADR 0071). */
|
|
54
|
+
@minLength(1)
|
|
55
|
+
runId?: string;
|
|
56
|
+
|
|
48
57
|
receivedAt: utcDateTime;
|
|
49
58
|
|
|
50
59
|
/** Every submission that asked for the work item, oldest first; one per origin. */
|