@opensoftware/contracts 1.9.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/generated/types.d.ts +60 -3
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/factory-definition/factory-definition.schema.json +12 -0
- package/openapi/openapi.json +90 -3
- package/package.json +2 -2
- package/typespec/factory-definition.tsp +15 -0
- package/typespec/foreman-api.tsp +5 -0
- package/typespec/foreman.tsp +5 -0
- package/typespec/intake.tsp +10 -1
package/README.md
CHANGED
|
@@ -125,3 +125,4 @@ None. The CLI reads no environment variables.
|
|
|
125
125
|
| SCN-CTR-009 | implemented | A tighter form of a "exactly one of" rule fails the compatibility check |
|
|
126
126
|
| SCN-CTR-010 | implemented | runSpans gives each span of a run record with its resource and decoded attributes |
|
|
127
127
|
| SCN-CTR-011 | implemented | runSpans gives no spans for a value that is not a trace export request |
|
|
128
|
+
| SCN-CTR-012 | implemented | A factory definition with an unknown effort is rejected with the allowed levels |
|
|
@@ -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"];
|
|
@@ -142,6 +143,11 @@ export type components = {
|
|
|
142
143
|
harness: components["schemas"]["Name"];
|
|
143
144
|
/** @description A model ID or a routing alias of the inference gateway, for example "routes/triage". */
|
|
144
145
|
model: string;
|
|
146
|
+
/**
|
|
147
|
+
* @description How much the model thinks before it answers. Each harness adapter maps it to its product's own setting (ADR 0078).
|
|
148
|
+
* A smart model works well at `low` or `medium`; a small model at `high` or more.
|
|
149
|
+
*/
|
|
150
|
+
effort: components["schemas"]["Effort"];
|
|
145
151
|
/** @description Path to the Markdown prompt. */
|
|
146
152
|
prompt: string;
|
|
147
153
|
/** @description Repositories the agent operates on, as clone URLs or "<owner>/<name>". */
|
|
@@ -207,6 +213,11 @@ export type components = {
|
|
|
207
213
|
};
|
|
208
214
|
/** @description A Git commit hash, abbreviated (7+) or full. The factory version is the commit of the factory definition. */
|
|
209
215
|
CommitHash: string;
|
|
216
|
+
/**
|
|
217
|
+
* @description The effort level of an agent's model, from the least to the most thinking (ADR 0078).
|
|
218
|
+
* @enum {string}
|
|
219
|
+
*/
|
|
220
|
+
Effort: "low" | "medium" | "high" | "xhigh" | "max";
|
|
210
221
|
/**
|
|
211
222
|
* @description `evidence.json` at the root of an evidence bundle: what was verified, against which scenario IDs, with which
|
|
212
223
|
* artifacts and result (P10).
|
|
@@ -684,6 +695,10 @@ export type components = {
|
|
|
684
695
|
/** Format: uri */
|
|
685
696
|
evidenceBundle?: string;
|
|
686
697
|
};
|
|
698
|
+
/** @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). */
|
|
699
|
+
RunList: {
|
|
700
|
+
runs: components["schemas"]["RunView"][];
|
|
701
|
+
};
|
|
687
702
|
/**
|
|
688
703
|
* @description How a run ended.
|
|
689
704
|
* @enum {string}
|
|
@@ -1025,10 +1040,10 @@ export type components = {
|
|
|
1025
1040
|
links?: components["schemas"]["Link"][];
|
|
1026
1041
|
};
|
|
1027
1042
|
/**
|
|
1028
|
-
* @description Where a work item stands.
|
|
1043
|
+
* @description Where a work item stands: received, then as its run in the foreman goes (ADR 0071).
|
|
1029
1044
|
* @enum {string}
|
|
1030
1045
|
*/
|
|
1031
|
-
WorkItemStatus: "received";
|
|
1046
|
+
WorkItemStatus: "received" | "running" | "complete" | "failed" | "cancelled";
|
|
1032
1047
|
/** @enum {string} */
|
|
1033
1048
|
WorkItemType: "idea" | "bug" | "task" | "automation";
|
|
1034
1049
|
/** @description intake: a work item as the HTTP API shows it (ADR 0063). */
|
|
@@ -1036,6 +1051,8 @@ export type components = {
|
|
|
1036
1051
|
/** @description Its ID is "wi_" and 20 hex digits of the SHA-256 of its dedupe key. */
|
|
1037
1052
|
workItem: components["schemas"]["WorkItem"];
|
|
1038
1053
|
status: components["schemas"]["WorkItemStatus"];
|
|
1054
|
+
/** @description The foreman's run of the work item, once it started (ADR 0071). */
|
|
1055
|
+
runId?: string;
|
|
1039
1056
|
/** Format: date-time */
|
|
1040
1057
|
receivedAt: string;
|
|
1041
1058
|
/** @description Every submission that asked for the work item, oldest first; one per origin. */
|
|
@@ -1183,6 +1200,46 @@ export interface operations {
|
|
|
1183
1200
|
};
|
|
1184
1201
|
};
|
|
1185
1202
|
};
|
|
1203
|
+
ForemanApi_listRuns: {
|
|
1204
|
+
parameters: {
|
|
1205
|
+
query?: {
|
|
1206
|
+
state?: components["schemas"]["RunState"];
|
|
1207
|
+
};
|
|
1208
|
+
header?: never;
|
|
1209
|
+
path?: never;
|
|
1210
|
+
cookie?: never;
|
|
1211
|
+
};
|
|
1212
|
+
requestBody?: never;
|
|
1213
|
+
responses: {
|
|
1214
|
+
/** @description The request has succeeded. */
|
|
1215
|
+
200: {
|
|
1216
|
+
headers: {
|
|
1217
|
+
[name: string]: unknown;
|
|
1218
|
+
};
|
|
1219
|
+
content: {
|
|
1220
|
+
"application/json": components["schemas"]["RunList"];
|
|
1221
|
+
};
|
|
1222
|
+
};
|
|
1223
|
+
/** @description The server could not understand the request due to invalid syntax. */
|
|
1224
|
+
400: {
|
|
1225
|
+
headers: {
|
|
1226
|
+
[name: string]: unknown;
|
|
1227
|
+
};
|
|
1228
|
+
content: {
|
|
1229
|
+
"application/problem+json": components["schemas"]["ApiProblem"];
|
|
1230
|
+
};
|
|
1231
|
+
};
|
|
1232
|
+
/** @description Access is unauthorized. */
|
|
1233
|
+
401: {
|
|
1234
|
+
headers: {
|
|
1235
|
+
[name: string]: unknown;
|
|
1236
|
+
};
|
|
1237
|
+
content: {
|
|
1238
|
+
"application/problem+json": components["schemas"]["ApiProblem"];
|
|
1239
|
+
};
|
|
1240
|
+
};
|
|
1241
|
+
};
|
|
1242
|
+
};
|
|
1186
1243
|
ForemanApi_startRun: {
|
|
1187
1244
|
parameters: {
|
|
1188
1245
|
query?: never;
|
package/dist/index.js
CHANGED
|
@@ -65,6 +65,10 @@ function describe(error) {
|
|
|
65
65
|
return { path: child(String(error.params.unevaluatedProperty)), message: "unknown field" };
|
|
66
66
|
case "required":
|
|
67
67
|
return { path: child(String(error.params.missingProperty)), message: "missing required field" };
|
|
68
|
+
case "enum": {
|
|
69
|
+
const allowed = error.params.allowedValues.map((value) => JSON.stringify(value)).join(", ");
|
|
70
|
+
return { path: error.instancePath || "/", message: `must be one of ${allowed}` };
|
|
71
|
+
}
|
|
68
72
|
case "anyOf":
|
|
69
73
|
case "oneOf":
|
|
70
74
|
return { path: error.instancePath || "/", message: "must match exactly one of the allowed forms" };
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,oHAAoH;AACpH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,OAAO,EAAE,EAA2C,MAAM,kBAAkB,CAAC;AACpF,OAAO,UAAU,MAAM,aAAa,CAAC;AACrC,OAAO,EAAe,WAAW,EAAE,MAAM,cAAc,CAAC;AAGxD,OAAO,EAAE,IAAI,IAAI,eAAe,EAAe,MAAM,eAAe,CAAC;AACrE,OAAO,EAAE,OAAO,EAAe,WAAW,EAAE,MAAM,cAAc,CAAC;AAEjE,OAAO,EAAqC,QAAQ,EAAuB,MAAM,iBAAiB,CAAC;AAqCnG,gGAAgG;A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ference gateway, for example \"routes/triage\"."
|
|
153
153
|
},
|
|
154
|
+
"effort": {
|
|
155
|
+
"type": "string",
|
|
156
|
+
"enum": [
|
|
157
|
+
"low",
|
|
158
|
+
"medium",
|
|
159
|
+
"high",
|
|
160
|
+
"xhigh",
|
|
161
|
+
"max"
|
|
162
|
+
],
|
|
163
|
+
"description": "How much the model thinks before it answers. Each harness adapter maps it to its product's own setting (ADR 0078).\nA smart model works well at `low` or `medium`; a small model at `high` or more."
|
|
164
|
+
},
|
|
154
165
|
"prompt": {
|
|
155
166
|
"type": "string",
|
|
156
167
|
"minLength": 1,
|
|
@@ -221,6 +232,7 @@
|
|
|
221
232
|
"required": [
|
|
222
233
|
"harness",
|
|
223
234
|
"model",
|
|
235
|
+
"effort",
|
|
224
236
|
"prompt"
|
|
225
237
|
],
|
|
226
238
|
"additionalProperties": false
|
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": "
|
|
5
|
+
"version": "2.0.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}": {
|
|
@@ -519,6 +566,10 @@
|
|
|
519
566
|
"minLength": 1,
|
|
520
567
|
"description": "A model ID or a routing alias of the inference gateway, for example \"routes/triage\"."
|
|
521
568
|
},
|
|
569
|
+
"effort": {
|
|
570
|
+
"$ref": "#/components/schemas/Effort",
|
|
571
|
+
"description": "How much the model thinks before it answers. Each harness adapter maps it to its product's own setting (ADR 0078).\nA smart model works well at `low` or `medium`; a small model at `high` or more."
|
|
572
|
+
},
|
|
522
573
|
"prompt": {
|
|
523
574
|
"type": "string",
|
|
524
575
|
"minLength": 1,
|
|
@@ -559,6 +610,7 @@
|
|
|
559
610
|
"required": [
|
|
560
611
|
"harness",
|
|
561
612
|
"model",
|
|
613
|
+
"effort",
|
|
562
614
|
"prompt"
|
|
563
615
|
],
|
|
564
616
|
"additionalProperties": false
|
|
@@ -732,6 +784,17 @@
|
|
|
732
784
|
"pattern": "^[0-9a-f]{7,40}$",
|
|
733
785
|
"description": "A Git commit hash, abbreviated (7+) or full. The factory version is the commit of the factory definition."
|
|
734
786
|
},
|
|
787
|
+
"Effort": {
|
|
788
|
+
"type": "string",
|
|
789
|
+
"enum": [
|
|
790
|
+
"low",
|
|
791
|
+
"medium",
|
|
792
|
+
"high",
|
|
793
|
+
"xhigh",
|
|
794
|
+
"max"
|
|
795
|
+
],
|
|
796
|
+
"description": "The effort level of an agent's model, from the least to the most thinking (ADR 0078)."
|
|
797
|
+
},
|
|
735
798
|
"EvidenceManifest": {
|
|
736
799
|
"type": "object",
|
|
737
800
|
"properties": {
|
|
@@ -2000,6 +2063,21 @@
|
|
|
2000
2063
|
"source"
|
|
2001
2064
|
]
|
|
2002
2065
|
},
|
|
2066
|
+
"RunList": {
|
|
2067
|
+
"type": "object",
|
|
2068
|
+
"properties": {
|
|
2069
|
+
"runs": {
|
|
2070
|
+
"type": "array",
|
|
2071
|
+
"items": {
|
|
2072
|
+
"$ref": "#/components/schemas/RunView"
|
|
2073
|
+
}
|
|
2074
|
+
}
|
|
2075
|
+
},
|
|
2076
|
+
"required": [
|
|
2077
|
+
"runs"
|
|
2078
|
+
],
|
|
2079
|
+
"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)."
|
|
2080
|
+
},
|
|
2003
2081
|
"RunOutcome": {
|
|
2004
2082
|
"type": "string",
|
|
2005
2083
|
"enum": [
|
|
@@ -2884,9 +2962,13 @@
|
|
|
2884
2962
|
"WorkItemStatus": {
|
|
2885
2963
|
"type": "string",
|
|
2886
2964
|
"enum": [
|
|
2887
|
-
"received"
|
|
2965
|
+
"received",
|
|
2966
|
+
"running",
|
|
2967
|
+
"complete",
|
|
2968
|
+
"failed",
|
|
2969
|
+
"cancelled"
|
|
2888
2970
|
],
|
|
2889
|
-
"description": "Where a work item stands."
|
|
2971
|
+
"description": "Where a work item stands: received, then as its run in the foreman goes (ADR 0071)."
|
|
2890
2972
|
},
|
|
2891
2973
|
"WorkItemType": {
|
|
2892
2974
|
"type": "string",
|
|
@@ -2907,6 +2989,11 @@
|
|
|
2907
2989
|
"status": {
|
|
2908
2990
|
"$ref": "#/components/schemas/WorkItemStatus"
|
|
2909
2991
|
},
|
|
2992
|
+
"runId": {
|
|
2993
|
+
"type": "string",
|
|
2994
|
+
"minLength": 1,
|
|
2995
|
+
"description": "The foreman's run of the work item, once it started (ADR 0071)."
|
|
2996
|
+
},
|
|
2910
2997
|
"receivedAt": {
|
|
2911
2998
|
"type": "string",
|
|
2912
2999
|
"format": "date-time"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opensoftware/contracts",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.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.28.0"
|
|
48
48
|
},
|
|
49
49
|
"scripts": {
|
|
50
50
|
"build": "node scripts/build.ts",
|
|
@@ -94,6 +94,12 @@ model Agent {
|
|
|
94
94
|
@minLength(1)
|
|
95
95
|
`model`: string;
|
|
96
96
|
|
|
97
|
+
/**
|
|
98
|
+
* How much the model thinks before it answers. Each harness adapter maps it to its product's own setting (ADR 0078).
|
|
99
|
+
* A smart model works well at `low` or `medium`; a small model at `high` or more.
|
|
100
|
+
*/
|
|
101
|
+
effort: Effort;
|
|
102
|
+
|
|
97
103
|
/** Path to the Markdown prompt. */
|
|
98
104
|
@minLength(1)
|
|
99
105
|
prompt: string;
|
|
@@ -155,6 +161,15 @@ model Stage {
|
|
|
155
161
|
@minLength(1)
|
|
156
162
|
scalar CheckName extends string;
|
|
157
163
|
|
|
164
|
+
/** The effort level of an agent's model, from the least to the most thinking (ADR 0078). */
|
|
165
|
+
enum Effort {
|
|
166
|
+
low,
|
|
167
|
+
medium,
|
|
168
|
+
high,
|
|
169
|
+
xhigh,
|
|
170
|
+
max,
|
|
171
|
+
}
|
|
172
|
+
|
|
158
173
|
enum EvidenceRequirement {
|
|
159
174
|
required,
|
|
160
175
|
optional,
|
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
|
@@ -101,6 +101,11 @@ model RunView {
|
|
|
101
101
|
stages: StageView[];
|
|
102
102
|
}
|
|
103
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
|
+
|
|
104
109
|
/** foreman: what a person tells a run. */
|
|
105
110
|
enum RunSignalType {
|
|
106
111
|
steer,
|
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. */
|