@openpond/evals 0.10.0 → 0.10.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/CONTRACT.md +6 -0
  2. package/LEARNING.md +70 -0
  3. package/dist/javascript-isolate-process.js +2 -2
  4. package/dist/learning/batch-service.js +44 -0
  5. package/dist/learning/contracts.js +1 -1
  6. package/dist/learning/index.js +3 -0
  7. package/dist/learning/iteration-dispatch-commands.js +31 -0
  8. package/dist/learning/iteration-dispatch-contracts.js +73 -0
  9. package/dist/learning/iteration-dispatch-worker.js +178 -0
  10. package/dist/learning/iteration-eligibility.js +76 -0
  11. package/dist/learning/iteration-reservation-cancellation.js +31 -0
  12. package/dist/learning/iteration-reservation-contracts.js +57 -0
  13. package/dist/learning/iteration-reservation-service.js +106 -0
  14. package/dist/learning/operations.js +6 -1
  15. package/dist/learning/repository.js +4 -0
  16. package/dist/learning/service.js +19 -43
  17. package/dist/metrics-node.js +20 -6
  18. package/dist/types/javascript-isolate-process.d.ts +3 -1
  19. package/dist/types/javascript-isolate-process.d.ts.map +1 -1
  20. package/dist/types/learning/batch-service.d.ts +8 -0
  21. package/dist/types/learning/batch-service.d.ts.map +1 -0
  22. package/dist/types/learning/contracts.d.ts +6 -0
  23. package/dist/types/learning/contracts.d.ts.map +1 -1
  24. package/dist/types/learning/index.d.ts +3 -0
  25. package/dist/types/learning/index.d.ts.map +1 -1
  26. package/dist/types/learning/iteration-dispatch-commands.d.ts +8 -0
  27. package/dist/types/learning/iteration-dispatch-commands.d.ts.map +1 -0
  28. package/dist/types/learning/iteration-dispatch-contracts.d.ts +93 -0
  29. package/dist/types/learning/iteration-dispatch-contracts.d.ts.map +1 -0
  30. package/dist/types/learning/iteration-dispatch-worker.d.ts +35 -0
  31. package/dist/types/learning/iteration-dispatch-worker.d.ts.map +1 -0
  32. package/dist/types/learning/iteration-eligibility.d.ts +18 -0
  33. package/dist/types/learning/iteration-eligibility.d.ts.map +1 -0
  34. package/dist/types/learning/iteration-reservation-cancellation.d.ts +8 -0
  35. package/dist/types/learning/iteration-reservation-cancellation.d.ts.map +1 -0
  36. package/dist/types/learning/iteration-reservation-contracts.d.ts +90 -0
  37. package/dist/types/learning/iteration-reservation-contracts.d.ts.map +1 -0
  38. package/dist/types/learning/iteration-reservation-service.d.ts +9 -0
  39. package/dist/types/learning/iteration-reservation-service.d.ts.map +1 -0
  40. package/dist/types/learning/operations.d.ts +64 -0
  41. package/dist/types/learning/operations.d.ts.map +1 -1
  42. package/dist/types/learning/repository.d.ts +121 -0
  43. package/dist/types/learning/repository.d.ts.map +1 -1
  44. package/dist/types/learning/service.d.ts.map +1 -1
  45. package/dist/types/learning/transport.d.ts +151 -0
  46. package/dist/types/learning/transport.d.ts.map +1 -1
  47. package/dist/types/metrics-node.d.ts +4 -0
  48. package/dist/types/metrics-node.d.ts.map +1 -1
  49. package/package.json +1 -1
  50. package/schemas/learning/v1/chain.schema.json +72 -0
  51. package/schemas/learning/v1/command-request.schema.json +374 -233
  52. package/schemas/learning/v1/consumption.schema.json +77 -0
  53. package/schemas/learning/v1/dispatch.schema.json +338 -0
  54. package/schemas/learning/v1/iteration.schema.json +3 -1
  55. package/schemas/learning/v1/read-request.schema.json +4 -0
  56. package/schemas/learning/v1/reservation.schema.json +201 -0
@@ -0,0 +1,77 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "object",
4
+ "properties": {
5
+ "schemaVersion": {
6
+ "type": "string",
7
+ "const": "openpond.learningConsumption.v1"
8
+ },
9
+ "id": {
10
+ "$ref": "#/$defs/__schema0"
11
+ },
12
+ "revision": {
13
+ "type": "number",
14
+ "const": 1
15
+ },
16
+ "chainId": {
17
+ "$ref": "#/$defs/__schema0"
18
+ },
19
+ "iterationId": {
20
+ "$ref": "#/$defs/__schema0"
21
+ },
22
+ "evidence": {
23
+ "$ref": "#/$defs/__schema1"
24
+ },
25
+ "decision": {
26
+ "$ref": "#/$defs/__schema1"
27
+ },
28
+ "reservedAt": {
29
+ "type": "string",
30
+ "format": "date-time",
31
+ "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
32
+ }
33
+ },
34
+ "required": [
35
+ "schemaVersion",
36
+ "id",
37
+ "revision",
38
+ "chainId",
39
+ "iterationId",
40
+ "evidence",
41
+ "decision",
42
+ "reservedAt"
43
+ ],
44
+ "additionalProperties": false,
45
+ "$defs": {
46
+ "__schema0": {
47
+ "type": "string",
48
+ "minLength": 1,
49
+ "maxLength": 240
50
+ },
51
+ "__schema1": {
52
+ "type": "object",
53
+ "properties": {
54
+ "id": {
55
+ "$ref": "#/$defs/__schema0"
56
+ },
57
+ "contentHash": {
58
+ "type": "string",
59
+ "pattern": "^[a-f0-9]{64}$"
60
+ },
61
+ "revision": {
62
+ "type": "integer",
63
+ "exclusiveMinimum": 0,
64
+ "maximum": 9007199254740991
65
+ }
66
+ },
67
+ "required": [
68
+ "id",
69
+ "contentHash",
70
+ "revision"
71
+ ],
72
+ "additionalProperties": false
73
+ }
74
+ },
75
+ "$id": "urn:openpond:learning:v1:consumption",
76
+ "$comment": "Generated from @openpond/evals. Cross-resource identity, authorization, idempotency, admission, grading and split constraints are enforced by the shared domain service in addition to this structural schema."
77
+ }
@@ -0,0 +1,338 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "object",
4
+ "properties": {
5
+ "schemaVersion": {
6
+ "$ref": "#/$defs/__schema0"
7
+ },
8
+ "id": {
9
+ "$ref": "#/$defs/__schema1"
10
+ },
11
+ "revision": {
12
+ "$ref": "#/$defs/__schema2"
13
+ },
14
+ "iterationId": {
15
+ "$ref": "#/$defs/__schema1"
16
+ },
17
+ "chainId": {
18
+ "$ref": "#/$defs/__schema1"
19
+ },
20
+ "policy": {
21
+ "$ref": "#/$defs/__schema3"
22
+ },
23
+ "batch": {
24
+ "$ref": "#/$defs/__schema3"
25
+ },
26
+ "state": {
27
+ "$ref": "#/$defs/__schema5"
28
+ },
29
+ "submission": {
30
+ "$ref": "#/$defs/__schema6"
31
+ },
32
+ "submissionHash": {
33
+ "$ref": "#/$defs/__schema8"
34
+ },
35
+ "submissionStartedAt": {
36
+ "$ref": "#/$defs/__schema9"
37
+ },
38
+ "execution": {
39
+ "$ref": "#/$defs/__schema11"
40
+ },
41
+ "terminalReceipt": {
42
+ "$ref": "#/$defs/__schema13"
43
+ },
44
+ "cancelRequestedAt": {
45
+ "$ref": "#/$defs/__schema14"
46
+ },
47
+ "leaseOwner": {
48
+ "$ref": "#/$defs/__schema15"
49
+ },
50
+ "leaseGeneration": {
51
+ "$ref": "#/$defs/__schema16"
52
+ },
53
+ "leaseExpiresAt": {
54
+ "$ref": "#/$defs/__schema17"
55
+ },
56
+ "consecutiveFailures": {
57
+ "$ref": "#/$defs/__schema18"
58
+ },
59
+ "nextAttemptAt": {
60
+ "$ref": "#/$defs/__schema19"
61
+ },
62
+ "lastError": {
63
+ "$ref": "#/$defs/__schema20"
64
+ },
65
+ "createdAt": {
66
+ "$ref": "#/$defs/__schema10"
67
+ },
68
+ "updatedAt": {
69
+ "$ref": "#/$defs/__schema10"
70
+ }
71
+ },
72
+ "required": [
73
+ "schemaVersion",
74
+ "id",
75
+ "revision",
76
+ "iterationId",
77
+ "chainId",
78
+ "policy",
79
+ "batch",
80
+ "state",
81
+ "submission",
82
+ "submissionHash",
83
+ "submissionStartedAt",
84
+ "execution",
85
+ "terminalReceipt",
86
+ "cancelRequestedAt",
87
+ "leaseOwner",
88
+ "leaseGeneration",
89
+ "leaseExpiresAt",
90
+ "consecutiveFailures",
91
+ "nextAttemptAt",
92
+ "lastError",
93
+ "createdAt",
94
+ "updatedAt"
95
+ ],
96
+ "additionalProperties": false,
97
+ "$defs": {
98
+ "__schema0": {
99
+ "type": "string",
100
+ "const": "openpond.learningIterationDispatch.v1"
101
+ },
102
+ "__schema1": {
103
+ "type": "string",
104
+ "minLength": 1,
105
+ "maxLength": 240
106
+ },
107
+ "__schema2": {
108
+ "type": "integer",
109
+ "exclusiveMinimum": 0,
110
+ "maximum": 9007199254740991
111
+ },
112
+ "__schema3": {
113
+ "type": "object",
114
+ "properties": {
115
+ "id": {
116
+ "$ref": "#/$defs/__schema1"
117
+ },
118
+ "contentHash": {
119
+ "$ref": "#/$defs/__schema4"
120
+ },
121
+ "revision": {
122
+ "type": "integer",
123
+ "exclusiveMinimum": 0,
124
+ "maximum": 9007199254740991
125
+ }
126
+ },
127
+ "required": [
128
+ "id",
129
+ "contentHash",
130
+ "revision"
131
+ ],
132
+ "additionalProperties": false
133
+ },
134
+ "__schema4": {
135
+ "type": "string",
136
+ "pattern": "^[a-f0-9]{64}$"
137
+ },
138
+ "__schema5": {
139
+ "type": "string",
140
+ "enum": [
141
+ "preparing",
142
+ "prepared",
143
+ "submitted",
144
+ "settled",
145
+ "blocked"
146
+ ]
147
+ },
148
+ "__schema6": {
149
+ "anyOf": [
150
+ {
151
+ "type": "object",
152
+ "properties": {
153
+ "provider": {
154
+ "$ref": "#/$defs/__schema1"
155
+ },
156
+ "protocol": {
157
+ "$ref": "#/$defs/__schema1"
158
+ },
159
+ "payload": {
160
+ "type": "object",
161
+ "propertyNames": {
162
+ "type": "string"
163
+ },
164
+ "additionalProperties": {
165
+ "$ref": "#/$defs/__schema7"
166
+ }
167
+ }
168
+ },
169
+ "required": [
170
+ "provider",
171
+ "protocol",
172
+ "payload"
173
+ ],
174
+ "additionalProperties": false
175
+ },
176
+ {
177
+ "type": "null"
178
+ }
179
+ ]
180
+ },
181
+ "__schema7": {
182
+ "anyOf": [
183
+ {
184
+ "type": "string"
185
+ },
186
+ {
187
+ "type": "number"
188
+ },
189
+ {
190
+ "type": "boolean"
191
+ },
192
+ {
193
+ "type": "null"
194
+ },
195
+ {
196
+ "type": "array",
197
+ "items": {
198
+ "$ref": "#/$defs/__schema7"
199
+ }
200
+ },
201
+ {
202
+ "type": "object",
203
+ "propertyNames": {
204
+ "type": "string"
205
+ },
206
+ "additionalProperties": {
207
+ "$ref": "#/$defs/__schema7"
208
+ }
209
+ }
210
+ ]
211
+ },
212
+ "__schema8": {
213
+ "anyOf": [
214
+ {
215
+ "type": "string",
216
+ "pattern": "^[a-f0-9]{64}$"
217
+ },
218
+ {
219
+ "type": "null"
220
+ }
221
+ ]
222
+ },
223
+ "__schema9": {
224
+ "anyOf": [
225
+ {
226
+ "$ref": "#/$defs/__schema10"
227
+ },
228
+ {
229
+ "type": "null"
230
+ }
231
+ ]
232
+ },
233
+ "__schema10": {
234
+ "type": "string",
235
+ "format": "date-time",
236
+ "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
237
+ },
238
+ "__schema11": {
239
+ "anyOf": [
240
+ {
241
+ "$ref": "#/$defs/__schema12"
242
+ },
243
+ {
244
+ "type": "null"
245
+ }
246
+ ]
247
+ },
248
+ "__schema12": {
249
+ "type": "object",
250
+ "properties": {
251
+ "id": {
252
+ "$ref": "#/$defs/__schema1"
253
+ },
254
+ "contentHash": {
255
+ "$ref": "#/$defs/__schema4"
256
+ }
257
+ },
258
+ "required": [
259
+ "id",
260
+ "contentHash"
261
+ ],
262
+ "additionalProperties": false
263
+ },
264
+ "__schema13": {
265
+ "anyOf": [
266
+ {
267
+ "$ref": "#/$defs/__schema12"
268
+ },
269
+ {
270
+ "type": "null"
271
+ }
272
+ ]
273
+ },
274
+ "__schema14": {
275
+ "anyOf": [
276
+ {
277
+ "$ref": "#/$defs/__schema10"
278
+ },
279
+ {
280
+ "type": "null"
281
+ }
282
+ ]
283
+ },
284
+ "__schema15": {
285
+ "anyOf": [
286
+ {
287
+ "$ref": "#/$defs/__schema1"
288
+ },
289
+ {
290
+ "type": "null"
291
+ }
292
+ ]
293
+ },
294
+ "__schema16": {
295
+ "type": "integer",
296
+ "minimum": 0,
297
+ "maximum": 9007199254740991
298
+ },
299
+ "__schema17": {
300
+ "anyOf": [
301
+ {
302
+ "$ref": "#/$defs/__schema10"
303
+ },
304
+ {
305
+ "type": "null"
306
+ }
307
+ ]
308
+ },
309
+ "__schema18": {
310
+ "type": "integer",
311
+ "minimum": 0,
312
+ "maximum": 9007199254740991
313
+ },
314
+ "__schema19": {
315
+ "anyOf": [
316
+ {
317
+ "$ref": "#/$defs/__schema10"
318
+ },
319
+ {
320
+ "type": "null"
321
+ }
322
+ ]
323
+ },
324
+ "__schema20": {
325
+ "anyOf": [
326
+ {
327
+ "type": "string",
328
+ "maxLength": 20000
329
+ },
330
+ {
331
+ "type": "null"
332
+ }
333
+ ]
334
+ }
335
+ },
336
+ "$id": "urn:openpond:learning:v1:dispatch",
337
+ "$comment": "Generated from @openpond/evals. Cross-resource identity, authorization, idempotency, admission, grading and split constraints are enforced by the shared domain service in addition to this structural schema."
338
+ }
@@ -23,6 +23,7 @@
23
23
  "waiting_for_data",
24
24
  "waiting_for_review",
25
25
  "ready",
26
+ "dispatching",
26
27
  "training",
27
28
  "evaluating",
28
29
  "candidate_ready",
@@ -31,7 +32,8 @@
31
32
  "paused",
32
33
  "failed",
33
34
  "cancelling",
34
- "cancelled"
35
+ "cancelled",
36
+ "completed_without_candidate"
35
37
  ]
36
38
  },
37
39
  "triggerIdentity": {
@@ -133,6 +133,10 @@
133
133
  "decision",
134
134
  "batch",
135
135
  "policy",
136
+ "chain",
137
+ "consumption",
138
+ "reservation",
139
+ "dispatch",
136
140
  "iteration",
137
141
  "grade",
138
142
  "package"
@@ -0,0 +1,201 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "object",
4
+ "properties": {
5
+ "schemaVersion": {
6
+ "type": "string",
7
+ "const": "openpond.learningIterationReservation.v1"
8
+ },
9
+ "id": {
10
+ "$ref": "#/$defs/__schema0"
11
+ },
12
+ "revision": {
13
+ "type": "integer",
14
+ "exclusiveMinimum": 0,
15
+ "maximum": 9007199254740991
16
+ },
17
+ "chainId": {
18
+ "$ref": "#/$defs/__schema0"
19
+ },
20
+ "iterationId": {
21
+ "$ref": "#/$defs/__schema0"
22
+ },
23
+ "policy": {
24
+ "type": "object",
25
+ "properties": {
26
+ "id": {
27
+ "$ref": "#/$defs/__schema0"
28
+ },
29
+ "contentHash": {
30
+ "$ref": "#/$defs/__schema1"
31
+ },
32
+ "revision": {
33
+ "type": "integer",
34
+ "exclusiveMinimum": 0,
35
+ "maximum": 9007199254740991
36
+ }
37
+ },
38
+ "required": [
39
+ "id",
40
+ "contentHash",
41
+ "revision"
42
+ ],
43
+ "additionalProperties": false
44
+ },
45
+ "trigger": {
46
+ "oneOf": [
47
+ {
48
+ "type": "object",
49
+ "properties": {
50
+ "kind": {
51
+ "type": "string",
52
+ "const": "manual"
53
+ },
54
+ "identity": {
55
+ "$ref": "#/$defs/__schema0"
56
+ }
57
+ },
58
+ "required": [
59
+ "kind",
60
+ "identity"
61
+ ],
62
+ "additionalProperties": false
63
+ },
64
+ {
65
+ "type": "object",
66
+ "properties": {
67
+ "kind": {
68
+ "type": "string",
69
+ "const": "schedule"
70
+ },
71
+ "scheduledAt": {
72
+ "$ref": "#/$defs/__schema2"
73
+ }
74
+ },
75
+ "required": [
76
+ "kind",
77
+ "scheduledAt"
78
+ ],
79
+ "additionalProperties": false
80
+ }
81
+ ]
82
+ },
83
+ "requestHash": {
84
+ "$ref": "#/$defs/__schema1"
85
+ },
86
+ "outcome": {
87
+ "type": "string",
88
+ "enum": [
89
+ "reserved",
90
+ "waiting_for_data",
91
+ "waiting_for_review"
92
+ ]
93
+ },
94
+ "counts": {
95
+ "type": "object",
96
+ "properties": {
97
+ "eligible": {
98
+ "type": "integer",
99
+ "minimum": 0,
100
+ "maximum": 9007199254740991
101
+ },
102
+ "awaitingReview": {
103
+ "type": "integer",
104
+ "minimum": 0,
105
+ "maximum": 9007199254740991
106
+ },
107
+ "excluded": {
108
+ "type": "integer",
109
+ "minimum": 0,
110
+ "maximum": 9007199254740991
111
+ },
112
+ "consumed": {
113
+ "type": "integer",
114
+ "minimum": 0,
115
+ "maximum": 9007199254740991
116
+ }
117
+ },
118
+ "required": [
119
+ "eligible",
120
+ "awaitingReview",
121
+ "excluded",
122
+ "consumed"
123
+ ],
124
+ "additionalProperties": false
125
+ },
126
+ "budget": {
127
+ "type": "object",
128
+ "properties": {
129
+ "maximumSpendUsd": {
130
+ "type": "number",
131
+ "minimum": 0
132
+ },
133
+ "reservedSpendUsd": {
134
+ "type": "number",
135
+ "minimum": 0
136
+ },
137
+ "settledSpendUsd": {
138
+ "type": "number",
139
+ "minimum": 0
140
+ },
141
+ "settledAt": {
142
+ "anyOf": [
143
+ {
144
+ "$ref": "#/$defs/__schema2"
145
+ },
146
+ {
147
+ "type": "null"
148
+ }
149
+ ]
150
+ }
151
+ },
152
+ "required": [
153
+ "maximumSpendUsd",
154
+ "reservedSpendUsd",
155
+ "settledSpendUsd",
156
+ "settledAt"
157
+ ],
158
+ "additionalProperties": false
159
+ },
160
+ "createdAt": {
161
+ "$ref": "#/$defs/__schema2"
162
+ },
163
+ "updatedAt": {
164
+ "$ref": "#/$defs/__schema2"
165
+ }
166
+ },
167
+ "required": [
168
+ "schemaVersion",
169
+ "id",
170
+ "revision",
171
+ "chainId",
172
+ "iterationId",
173
+ "policy",
174
+ "trigger",
175
+ "requestHash",
176
+ "outcome",
177
+ "counts",
178
+ "budget",
179
+ "createdAt",
180
+ "updatedAt"
181
+ ],
182
+ "additionalProperties": false,
183
+ "$defs": {
184
+ "__schema0": {
185
+ "type": "string",
186
+ "minLength": 1,
187
+ "maxLength": 240
188
+ },
189
+ "__schema1": {
190
+ "type": "string",
191
+ "pattern": "^[a-f0-9]{64}$"
192
+ },
193
+ "__schema2": {
194
+ "type": "string",
195
+ "format": "date-time",
196
+ "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
197
+ }
198
+ },
199
+ "$id": "urn:openpond:learning:v1:reservation",
200
+ "$comment": "Generated from @openpond/evals. Cross-resource identity, authorization, idempotency, admission, grading and split constraints are enforced by the shared domain service in addition to this structural schema."
201
+ }