@opensoftware/contracts 1.7.0 → 1.9.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 -1
- package/dist/generated/types.d.ts +47 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.js.map +1 -1
- package/factory-definition/factory-definition.schema.json +29 -0
- package/openapi/openapi.json +94 -3
- package/package.json +2 -2
- package/typespec/factory-definition.tsp +25 -0
- package/typespec/foreman.tsp +39 -1
package/README.md
CHANGED
|
@@ -53,7 +53,7 @@ first is gatekeeper's: `POST /v1/gates` and `GET /v1/gates/{gateId}` with the mo
|
|
|
53
53
|
`ApiProblem` (RFC 9457). The second is intake's (ADR 0063): `POST /v1/work-items` and
|
|
54
54
|
`GET /v1/work-items/{workItemId}` with the models `WorkSubmission`, `WorkItemView` and `WorkRequest`. The third is the
|
|
55
55
|
foreman's (ADR 0067): `POST /v1/runs`, `GET /v1/runs/{runId}` and `POST /v1/runs/{runId}/signals` with the models
|
|
56
|
-
`RunView`, `StageView` and `RunSignal`. `pnpm build` compiles the operations with the TypeSpec OpenAPI 3 emitter and copies their
|
|
56
|
+
`RunView`, `StageView`, `CheckView` (ADR 0069) and `RunSignal`. `pnpm build` compiles the operations with the TypeSpec OpenAPI 3 emitter and copies their
|
|
57
57
|
paths next to the named models; an operation that uses a type that is no model fails the build. The package exports
|
|
58
58
|
the type `paths`, which types a client such as openapi-fetch.
|
|
59
59
|
|
|
@@ -193,6 +193,18 @@ export type components = {
|
|
|
193
193
|
};
|
|
194
194
|
/** @description A path inside the bundle: relative, forward slashes, no "..". */
|
|
195
195
|
BundlePath: string;
|
|
196
|
+
/** @description The name of a check on the forge: a commit status context. */
|
|
197
|
+
CheckName: string;
|
|
198
|
+
/**
|
|
199
|
+
* @description foreman: the state of a check on the forge (forge port).
|
|
200
|
+
* @enum {string}
|
|
201
|
+
*/
|
|
202
|
+
CheckState: "pending" | "success" | "failure" | "error";
|
|
203
|
+
/** @description foreman: a check that a stage waits for, as the foreman last read it on the run's pull request (ADR 0069). */
|
|
204
|
+
CheckView: {
|
|
205
|
+
name: components["schemas"]["CheckName"];
|
|
206
|
+
state: components["schemas"]["CheckState"];
|
|
207
|
+
};
|
|
196
208
|
/** @description A Git commit hash, abbreviated (7+) or full. The factory version is the commit of the factory definition. */
|
|
197
209
|
CommitHash: string;
|
|
198
210
|
/**
|
|
@@ -240,6 +252,8 @@ export type components = {
|
|
|
240
252
|
description?: string;
|
|
241
253
|
/** @description Adapters per port with a version range, pinned in `factory.lock` by `factory plan`. */
|
|
242
254
|
providers?: components["schemas"]["Providers"];
|
|
255
|
+
/** @description The inference gateway of the adapter under `providers.inference` (ADR 0070). */
|
|
256
|
+
inference?: components["schemas"]["Inference"];
|
|
243
257
|
/** @description Agents by name. */
|
|
244
258
|
agents: {
|
|
245
259
|
[key: string]: components["schemas"]["Agent"];
|
|
@@ -418,6 +432,13 @@ export type components = {
|
|
|
418
432
|
Hostname: string;
|
|
419
433
|
/** @description An identifier chosen by the producer. ULIDs are recommended; consumers treat it as opaque. */
|
|
420
434
|
Identifier: string;
|
|
435
|
+
/** @description The inference gateway: the adapter's config and the most a run may spend (ADR 0070). */
|
|
436
|
+
Inference: {
|
|
437
|
+
/** @description Path to the inference adapter's config, for example a LiteLLM proxy config. */
|
|
438
|
+
config: string;
|
|
439
|
+
/** @description The most a run may spend on model calls, in USD. */
|
|
440
|
+
budget?: number;
|
|
441
|
+
};
|
|
421
442
|
/** @description forge adapters: a label was added to an issue. */
|
|
422
443
|
IssueLabeled: {
|
|
423
444
|
/** @constant */
|
|
@@ -695,7 +716,10 @@ export type components = {
|
|
|
695
716
|
"osf.harness.name": components["schemas"]["Name"];
|
|
696
717
|
"osf.harness.version"?: string;
|
|
697
718
|
};
|
|
698
|
-
/**
|
|
719
|
+
/**
|
|
720
|
+
* @description foreman: a signal to a run: "steer" with a message for the running stage's agent, "cancel", "take-over" of the running
|
|
721
|
+
* stage by a person, or "hand-back" of that stage (ADR 0070).
|
|
722
|
+
*/
|
|
699
723
|
RunSignal: {
|
|
700
724
|
type: components["schemas"]["RunSignalType"];
|
|
701
725
|
/** @description The steering message. Required with "steer". */
|
|
@@ -705,7 +729,7 @@ export type components = {
|
|
|
705
729
|
* @description foreman: what a person tells a run.
|
|
706
730
|
* @enum {string}
|
|
707
731
|
*/
|
|
708
|
-
RunSignalType: "steer" | "cancel";
|
|
732
|
+
RunSignalType: "steer" | "cancel" | "take-over" | "hand-back";
|
|
709
733
|
/** @description Attributes of the root span of the run. GenAI names where a convention exists. */
|
|
710
734
|
RunSpan: {
|
|
711
735
|
/** @constant */
|
|
@@ -790,6 +814,13 @@ export type components = {
|
|
|
790
814
|
/** @description The commit of the factory definition the run started with. */
|
|
791
815
|
factoryVersion: components["schemas"]["CommitHash"];
|
|
792
816
|
state: components["schemas"]["RunState"];
|
|
817
|
+
/**
|
|
818
|
+
* Format: uri
|
|
819
|
+
* @description The last pull request link that an agent of the run wrote (ADR 0069).
|
|
820
|
+
*/
|
|
821
|
+
pullRequest?: string;
|
|
822
|
+
/** @description The run's folder on the foreman's machine, where a person who took over a stage goes on (ADR 0070). */
|
|
823
|
+
folder?: string;
|
|
793
824
|
/** Format: date-time */
|
|
794
825
|
startedAt: string;
|
|
795
826
|
/** Format: date-time */
|
|
@@ -931,6 +962,11 @@ export type components = {
|
|
|
931
962
|
agent?: components["schemas"]["Name"];
|
|
932
963
|
/** @description The stage waits for a decision before it starts. */
|
|
933
964
|
gate?: components["schemas"]["Gate"];
|
|
965
|
+
/**
|
|
966
|
+
* @description Checks that must succeed on the run's pull request before the stage starts, by their names on the forge, for
|
|
967
|
+
* example "verify" (ADR 0069).
|
|
968
|
+
*/
|
|
969
|
+
checks?: components["schemas"]["CheckName"][];
|
|
934
970
|
/** @description Whether the stage must produce an evidence bundle. */
|
|
935
971
|
evidence?: components["schemas"]["EvidenceRequirement"];
|
|
936
972
|
};
|
|
@@ -949,6 +985,15 @@ export type components = {
|
|
|
949
985
|
sessionId?: string;
|
|
950
986
|
/** @description The gate that decides whether the stage starts, once it was requested. */
|
|
951
987
|
gateId?: string;
|
|
988
|
+
/** @description The checks the stage waits for, once the foreman read them (ADR 0069). */
|
|
989
|
+
checks?: components["schemas"]["CheckView"][];
|
|
990
|
+
/**
|
|
991
|
+
* Format: date-time
|
|
992
|
+
* @description When a person took the stage over from its agent (ADR 0070).
|
|
993
|
+
*/
|
|
994
|
+
takenOverAt?: string;
|
|
995
|
+
/** @description Why the stage ended without success, when the foreman knows. */
|
|
996
|
+
reason?: string;
|
|
952
997
|
/** Format: date-time */
|
|
953
998
|
startedAt?: string;
|
|
954
999
|
/** Format: date-time */
|
package/dist/index.d.ts
CHANGED
|
@@ -29,6 +29,7 @@ export type WorkItemView = Schemas["WorkItemView"];
|
|
|
29
29
|
export type WorkRequest = Schemas["WorkRequest"];
|
|
30
30
|
export type RunView = Schemas["RunView"];
|
|
31
31
|
export type StageView = Schemas["StageView"];
|
|
32
|
+
export type CheckView = Schemas["CheckView"];
|
|
32
33
|
export type RunSignal = Schemas["RunSignal"];
|
|
33
34
|
export type SandboxSpec = Schemas["SandboxSpec"];
|
|
34
35
|
/** One reason a document does not match its format. `path` is a JSON Pointer into the document. */
|
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,eAA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CAAC;IACpH,QAAQ,KAAK,CAAC,OAAO,EAAE,CAAC;QACtB,KAAK,sBAAsB;YACzB,OAAO,EAAE,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC,EAAE,OAAO,EAAE,eAAe,EAAE,CAAC;QAC5F,KAAK,uBAAuB;YAC1B,OAAO,EAAE,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,mBAAmB,CAAC,CAAC,EAAE,OAAO,EAAE,eAAe,EAAE,CAAC;QAC7F,KAAK,UAAU;YACb,OAAO,EAAE,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC,EAAE,OAAO,EAAE,wBAAwB,EAAE,CAAC;QAClG,KAAK,OAAO,CAAC;QACb,KAAK,OAAO;YACV,OAAO,EAAE,IAAI,EAAE,KAAK,CAAC,YAAY,IAAI,GAAG,EAAE,OAAO,EAAE,6CAA6C,EAAE,CAAC;QACrG;YACE,OAAO,EAAE,IAAI,EAAE,KAAK,CAAC,YAAY,IAAI,GAAG,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,OAAO,EAAE,CAAC;IACxF,CAAC;AACH,CAAC"}
|
|
@@ -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": {},
|
|
@@ -247,6 +267,15 @@
|
|
|
247
267
|
"additionalProperties": false,
|
|
248
268
|
"description": "The stage waits for a decision before it starts."
|
|
249
269
|
},
|
|
270
|
+
"checks": {
|
|
271
|
+
"type": "array",
|
|
272
|
+
"items": {
|
|
273
|
+
"type": "string",
|
|
274
|
+
"minLength": 1,
|
|
275
|
+
"description": "The name of a check on the forge: a commit status context."
|
|
276
|
+
},
|
|
277
|
+
"description": "Checks that must succeed on the run's pull request before the stage starts, by their names on the forge, for\nexample \"verify\" (ADR 0069)."
|
|
278
|
+
},
|
|
250
279
|
"evidence": {
|
|
251
280
|
"type": "string",
|
|
252
281
|
"enum": [
|
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.9.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",
|
|
@@ -696,6 +696,37 @@
|
|
|
696
696
|
"pattern": "^(?!/)(?!.*(^|/)\\.\\.(/|$))[^\\\\]+$",
|
|
697
697
|
"description": "A path inside the bundle: relative, forward slashes, no \"..\"."
|
|
698
698
|
},
|
|
699
|
+
"CheckName": {
|
|
700
|
+
"type": "string",
|
|
701
|
+
"minLength": 1,
|
|
702
|
+
"description": "The name of a check on the forge: a commit status context."
|
|
703
|
+
},
|
|
704
|
+
"CheckState": {
|
|
705
|
+
"type": "string",
|
|
706
|
+
"enum": [
|
|
707
|
+
"pending",
|
|
708
|
+
"success",
|
|
709
|
+
"failure",
|
|
710
|
+
"error"
|
|
711
|
+
],
|
|
712
|
+
"description": "foreman: the state of a check on the forge (forge port)."
|
|
713
|
+
},
|
|
714
|
+
"CheckView": {
|
|
715
|
+
"type": "object",
|
|
716
|
+
"properties": {
|
|
717
|
+
"name": {
|
|
718
|
+
"$ref": "#/components/schemas/CheckName"
|
|
719
|
+
},
|
|
720
|
+
"state": {
|
|
721
|
+
"$ref": "#/components/schemas/CheckState"
|
|
722
|
+
}
|
|
723
|
+
},
|
|
724
|
+
"required": [
|
|
725
|
+
"name",
|
|
726
|
+
"state"
|
|
727
|
+
],
|
|
728
|
+
"description": "foreman: a check that a stage waits for, as the foreman last read it on the run's pull request (ADR 0069)."
|
|
729
|
+
},
|
|
699
730
|
"CommitHash": {
|
|
700
731
|
"type": "string",
|
|
701
732
|
"pattern": "^[0-9a-f]{7,40}$",
|
|
@@ -807,6 +838,10 @@
|
|
|
807
838
|
"$ref": "#/components/schemas/Providers",
|
|
808
839
|
"description": "Adapters per port with a version range, pinned in `factory.lock` by `factory plan`."
|
|
809
840
|
},
|
|
841
|
+
"inference": {
|
|
842
|
+
"$ref": "#/components/schemas/Inference",
|
|
843
|
+
"description": "The inference gateway of the adapter under `providers.inference` (ADR 0070)."
|
|
844
|
+
},
|
|
810
845
|
"agents": {
|
|
811
846
|
"type": "object",
|
|
812
847
|
"properties": {},
|
|
@@ -1301,6 +1336,26 @@
|
|
|
1301
1336
|
"maxLength": 128,
|
|
1302
1337
|
"description": "An identifier chosen by the producer. ULIDs are recommended; consumers treat it as opaque."
|
|
1303
1338
|
},
|
|
1339
|
+
"Inference": {
|
|
1340
|
+
"type": "object",
|
|
1341
|
+
"properties": {
|
|
1342
|
+
"config": {
|
|
1343
|
+
"type": "string",
|
|
1344
|
+
"minLength": 1,
|
|
1345
|
+
"description": "Path to the inference adapter's config, for example a LiteLLM proxy config."
|
|
1346
|
+
},
|
|
1347
|
+
"budget": {
|
|
1348
|
+
"type": "number",
|
|
1349
|
+
"minimum": 0,
|
|
1350
|
+
"description": "The most a run may spend on model calls, in USD."
|
|
1351
|
+
}
|
|
1352
|
+
},
|
|
1353
|
+
"required": [
|
|
1354
|
+
"config"
|
|
1355
|
+
],
|
|
1356
|
+
"description": "The inference gateway: the adapter's config and the most a run may spend (ADR 0070).",
|
|
1357
|
+
"additionalProperties": false
|
|
1358
|
+
},
|
|
1304
1359
|
"IssueLabeled": {
|
|
1305
1360
|
"type": "object",
|
|
1306
1361
|
"properties": {
|
|
@@ -2038,13 +2093,15 @@
|
|
|
2038
2093
|
"required": [
|
|
2039
2094
|
"type"
|
|
2040
2095
|
],
|
|
2041
|
-
"description": "foreman: a signal to a run: \"steer\" with a message for the running stage's agent, or \"
|
|
2096
|
+
"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)."
|
|
2042
2097
|
},
|
|
2043
2098
|
"RunSignalType": {
|
|
2044
2099
|
"type": "string",
|
|
2045
2100
|
"enum": [
|
|
2046
2101
|
"steer",
|
|
2047
|
-
"cancel"
|
|
2102
|
+
"cancel",
|
|
2103
|
+
"take-over",
|
|
2104
|
+
"hand-back"
|
|
2048
2105
|
],
|
|
2049
2106
|
"description": "foreman: what a person tells a run."
|
|
2050
2107
|
},
|
|
@@ -2270,6 +2327,16 @@
|
|
|
2270
2327
|
"state": {
|
|
2271
2328
|
"$ref": "#/components/schemas/RunState"
|
|
2272
2329
|
},
|
|
2330
|
+
"pullRequest": {
|
|
2331
|
+
"type": "string",
|
|
2332
|
+
"format": "uri",
|
|
2333
|
+
"description": "The last pull request link that an agent of the run wrote (ADR 0069)."
|
|
2334
|
+
},
|
|
2335
|
+
"folder": {
|
|
2336
|
+
"type": "string",
|
|
2337
|
+
"minLength": 1,
|
|
2338
|
+
"description": "The run's folder on the foreman's machine, where a person who took over a stage goes on (ADR 0070)."
|
|
2339
|
+
},
|
|
2273
2340
|
"startedAt": {
|
|
2274
2341
|
"type": "string",
|
|
2275
2342
|
"format": "date-time"
|
|
@@ -2656,6 +2723,13 @@
|
|
|
2656
2723
|
"$ref": "#/components/schemas/Gate",
|
|
2657
2724
|
"description": "The stage waits for a decision before it starts."
|
|
2658
2725
|
},
|
|
2726
|
+
"checks": {
|
|
2727
|
+
"type": "array",
|
|
2728
|
+
"items": {
|
|
2729
|
+
"$ref": "#/components/schemas/CheckName"
|
|
2730
|
+
},
|
|
2731
|
+
"description": "Checks that must succeed on the run's pull request before the stage starts, by their names on the forge, for\nexample \"verify\" (ADR 0069)."
|
|
2732
|
+
},
|
|
2659
2733
|
"evidence": {
|
|
2660
2734
|
"$ref": "#/components/schemas/EvidenceRequirement",
|
|
2661
2735
|
"description": "Whether the stage must produce an evidence bundle."
|
|
@@ -2701,6 +2775,23 @@
|
|
|
2701
2775
|
"pattern": "^g[0-9a-f]{16}$",
|
|
2702
2776
|
"description": "The gate that decides whether the stage starts, once it was requested."
|
|
2703
2777
|
},
|
|
2778
|
+
"checks": {
|
|
2779
|
+
"type": "array",
|
|
2780
|
+
"items": {
|
|
2781
|
+
"$ref": "#/components/schemas/CheckView"
|
|
2782
|
+
},
|
|
2783
|
+
"description": "The checks the stage waits for, once the foreman read them (ADR 0069)."
|
|
2784
|
+
},
|
|
2785
|
+
"takenOverAt": {
|
|
2786
|
+
"type": "string",
|
|
2787
|
+
"format": "date-time",
|
|
2788
|
+
"description": "When a person took the stage over from its agent (ADR 0070)."
|
|
2789
|
+
},
|
|
2790
|
+
"reason": {
|
|
2791
|
+
"type": "string",
|
|
2792
|
+
"minLength": 1,
|
|
2793
|
+
"description": "Why the stage ended without success, when the foreman knows."
|
|
2794
|
+
},
|
|
2704
2795
|
"startedAt": {
|
|
2705
2796
|
"type": "string",
|
|
2706
2797
|
"format": "date-time"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opensoftware/contracts",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.9.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;
|
|
@@ -126,10 +141,20 @@ model Stage {
|
|
|
126
141
|
/** The stage waits for a decision before it starts. */
|
|
127
142
|
gate?: Gate;
|
|
128
143
|
|
|
144
|
+
/**
|
|
145
|
+
* Checks that must succeed on the run's pull request before the stage starts, by their names on the forge, for
|
|
146
|
+
* example "verify" (ADR 0069).
|
|
147
|
+
*/
|
|
148
|
+
checks?: CheckName[];
|
|
149
|
+
|
|
129
150
|
/** Whether the stage must produce an evidence bundle. */
|
|
130
151
|
evidence?: EvidenceRequirement;
|
|
131
152
|
}
|
|
132
153
|
|
|
154
|
+
/** The name of a check on the forge: a commit status context. */
|
|
155
|
+
@minLength(1)
|
|
156
|
+
scalar CheckName extends string;
|
|
157
|
+
|
|
133
158
|
enum EvidenceRequirement {
|
|
134
159
|
required,
|
|
135
160
|
optional,
|
package/typespec/foreman.tsp
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import "@typespec/json-schema";
|
|
2
2
|
import "./common.tsp";
|
|
3
3
|
import "./work-item.tsp";
|
|
4
|
+
import "./factory-definition.tsp";
|
|
4
5
|
|
|
5
6
|
using TypeSpec.JsonSchema;
|
|
6
7
|
|
|
@@ -26,6 +27,20 @@ enum StageState {
|
|
|
26
27
|
cancelled,
|
|
27
28
|
}
|
|
28
29
|
|
|
30
|
+
/** foreman: the state of a check on the forge (forge port). */
|
|
31
|
+
enum CheckState {
|
|
32
|
+
pending,
|
|
33
|
+
success,
|
|
34
|
+
failure,
|
|
35
|
+
error,
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/** foreman: a check that a stage waits for, as the foreman last read it on the run's pull request (ADR 0069). */
|
|
39
|
+
model CheckView {
|
|
40
|
+
name: CheckName;
|
|
41
|
+
state: CheckState;
|
|
42
|
+
}
|
|
43
|
+
|
|
29
44
|
/** foreman: one stage of a run (ADR 0067). */
|
|
30
45
|
model StageView {
|
|
31
46
|
stage: Name;
|
|
@@ -42,6 +57,16 @@ model StageView {
|
|
|
42
57
|
@pattern("^g[0-9a-f]{16}$")
|
|
43
58
|
gateId?: string;
|
|
44
59
|
|
|
60
|
+
/** The checks the stage waits for, once the foreman read them (ADR 0069). */
|
|
61
|
+
checks?: CheckView[];
|
|
62
|
+
|
|
63
|
+
/** When a person took the stage over from its agent (ADR 0070). */
|
|
64
|
+
takenOverAt?: utcDateTime;
|
|
65
|
+
|
|
66
|
+
/** Why the stage ended without success, when the foreman knows. */
|
|
67
|
+
@minLength(1)
|
|
68
|
+
reason?: string;
|
|
69
|
+
|
|
45
70
|
startedAt?: utcDateTime;
|
|
46
71
|
endedAt?: utcDateTime;
|
|
47
72
|
}
|
|
@@ -61,6 +86,14 @@ model RunView {
|
|
|
61
86
|
factoryVersion: CommitHash;
|
|
62
87
|
|
|
63
88
|
state: RunState;
|
|
89
|
+
|
|
90
|
+
/** The last pull request link that an agent of the run wrote (ADR 0069). */
|
|
91
|
+
pullRequest?: url;
|
|
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
|
+
|
|
64
97
|
startedAt: utcDateTime;
|
|
65
98
|
endedAt?: utcDateTime;
|
|
66
99
|
|
|
@@ -72,9 +105,14 @@ model RunView {
|
|
|
72
105
|
enum RunSignalType {
|
|
73
106
|
steer,
|
|
74
107
|
cancel,
|
|
108
|
+
`take-over`,
|
|
109
|
+
`hand-back`,
|
|
75
110
|
}
|
|
76
111
|
|
|
77
|
-
/**
|
|
112
|
+
/**
|
|
113
|
+
* foreman: a signal to a run: "steer" with a message for the running stage's agent, "cancel", "take-over" of the running
|
|
114
|
+
* stage by a person, or "hand-back" of that stage (ADR 0070).
|
|
115
|
+
*/
|
|
78
116
|
model RunSignal {
|
|
79
117
|
type: RunSignalType;
|
|
80
118
|
|