@openpond/evals 0.6.0 → 0.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.
Files changed (87) hide show
  1. package/LEARNING.md +106 -0
  2. package/README.md +2 -0
  3. package/dist/graders.js +26 -5
  4. package/dist/index.js +3 -0
  5. package/dist/javascript-verifier-contract.js +7 -0
  6. package/dist/javascript-verifier-node.js +56 -0
  7. package/dist/javascript-verifier-worker-source.js +1 -0
  8. package/dist/javascript-verifier-worker.js +6 -0
  9. package/dist/javascript-verifier.js +64 -0
  10. package/dist/learning/admission.js +209 -0
  11. package/dist/learning/assets.js +37 -0
  12. package/dist/learning/contracts.js +267 -0
  13. package/dist/learning/errors.js +12 -0
  14. package/dist/learning/grade-worker.js +99 -0
  15. package/dist/learning/index.js +9 -0
  16. package/dist/learning/operations.js +33 -0
  17. package/dist/learning/repository.js +48 -0
  18. package/dist/learning/service.js +367 -0
  19. package/dist/learning/transport.js +25 -0
  20. package/dist/rewards.js +230 -0
  21. package/dist/task-schema.js +142 -0
  22. package/dist/tasksets.js +3 -0
  23. package/dist/telemetry-catalog.js +1 -1
  24. package/dist/types/builtin-benchmarks/harness-refiner.d.ts +7 -0
  25. package/dist/types/builtin-benchmarks/harness-refiner.d.ts.map +1 -1
  26. package/dist/types/conformance.d.ts +14 -0
  27. package/dist/types/conformance.d.ts.map +1 -1
  28. package/dist/types/execution-contracts.d.ts +14 -0
  29. package/dist/types/execution-contracts.d.ts.map +1 -1
  30. package/dist/types/graders.d.ts.map +1 -1
  31. package/dist/types/index.d.ts +3 -0
  32. package/dist/types/index.d.ts.map +1 -1
  33. package/dist/types/javascript-verifier-contract.d.ts +9 -0
  34. package/dist/types/javascript-verifier-contract.d.ts.map +1 -0
  35. package/dist/types/javascript-verifier-node.d.ts +5 -0
  36. package/dist/types/javascript-verifier-node.d.ts.map +1 -0
  37. package/dist/types/javascript-verifier-worker-source.d.ts +2 -0
  38. package/dist/types/javascript-verifier-worker.d.ts +2 -0
  39. package/dist/types/javascript-verifier-worker.d.ts.map +1 -0
  40. package/dist/types/javascript-verifier.d.ts +15 -0
  41. package/dist/types/javascript-verifier.d.ts.map +1 -0
  42. package/dist/types/learning/admission.d.ts +335 -0
  43. package/dist/types/learning/admission.d.ts.map +1 -0
  44. package/dist/types/learning/assets.d.ts +49 -0
  45. package/dist/types/learning/assets.d.ts.map +1 -0
  46. package/dist/types/learning/contracts.d.ts +2149 -0
  47. package/dist/types/learning/contracts.d.ts.map +1 -0
  48. package/dist/types/learning/errors.d.ts +8 -0
  49. package/dist/types/learning/errors.d.ts.map +1 -0
  50. package/dist/types/learning/grade-worker.d.ts +31 -0
  51. package/dist/types/learning/grade-worker.d.ts.map +1 -0
  52. package/dist/types/learning/index.d.ts +10 -0
  53. package/dist/types/learning/index.d.ts.map +1 -0
  54. package/dist/types/learning/operations.d.ts +2061 -0
  55. package/dist/types/learning/operations.d.ts.map +1 -0
  56. package/dist/types/learning/repository.d.ts +1143 -0
  57. package/dist/types/learning/repository.d.ts.map +1 -0
  58. package/dist/types/learning/service.d.ts +22 -0
  59. package/dist/types/learning/service.d.ts.map +1 -0
  60. package/dist/types/learning/transport.d.ts +2139 -0
  61. package/dist/types/learning/transport.d.ts.map +1 -0
  62. package/dist/types/preferences.d.ts +3 -3
  63. package/dist/types/review-conformance.d.ts +5 -5
  64. package/dist/types/rewards.d.ts +611 -0
  65. package/dist/types/rewards.d.ts.map +1 -0
  66. package/dist/types/task-schema.d.ts +18 -0
  67. package/dist/types/task-schema.d.ts.map +1 -0
  68. package/dist/types/tasksets.d.ts +28 -0
  69. package/dist/types/tasksets.d.ts.map +1 -1
  70. package/package.json +30 -3
  71. package/schemas/learning/v1/asset.schema.json +89 -0
  72. package/schemas/learning/v1/batch.schema.json +132 -0
  73. package/schemas/learning/v1/binding.schema.json +207 -0
  74. package/schemas/learning/v1/command-request.schema.json +2414 -0
  75. package/schemas/learning/v1/decision.schema.json +440 -0
  76. package/schemas/learning/v1/definition.schema.json +397 -0
  77. package/schemas/learning/v1/evidence.schema.json +317 -0
  78. package/schemas/learning/v1/example-submission.schema.json +253 -0
  79. package/schemas/learning/v1/feedback-submission.schema.json +114 -0
  80. package/schemas/learning/v1/feedback.schema.json +233 -0
  81. package/schemas/learning/v1/grade.schema.json +412 -0
  82. package/schemas/learning/v1/iteration.schema.json +236 -0
  83. package/schemas/learning/v1/package.schema.json +776 -0
  84. package/schemas/learning/v1/policy.schema.json +373 -0
  85. package/schemas/learning/v1/read-request.schema.json +101 -0
  86. package/schemas/learning/v1/reward.schema.json +302 -0
  87. package/schemas/learning/v1/source.schema.json +198 -0
@@ -0,0 +1,373 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "object",
4
+ "properties": {
5
+ "schemaVersion": {
6
+ "type": "string",
7
+ "const": "openpond.learningPolicy.v1"
8
+ },
9
+ "id": {
10
+ "$ref": "#/$defs/__schema0"
11
+ },
12
+ "revision": {
13
+ "type": "integer",
14
+ "exclusiveMinimum": 0,
15
+ "maximum": 9007199254740991
16
+ },
17
+ "modelProjectId": {
18
+ "$ref": "#/$defs/__schema0"
19
+ },
20
+ "executionOwner": {
21
+ "type": "string",
22
+ "enum": [
23
+ "local",
24
+ "hosted"
25
+ ]
26
+ },
27
+ "enabled": {
28
+ "type": "boolean"
29
+ },
30
+ "sources": {
31
+ "minItems": 1,
32
+ "maxItems": 100,
33
+ "type": "array",
34
+ "items": {
35
+ "$ref": "#/$defs/__schema1"
36
+ }
37
+ },
38
+ "taskDefinition": {
39
+ "$ref": "#/$defs/__schema1"
40
+ },
41
+ "rewardBinding": {
42
+ "$ref": "#/$defs/__schema1"
43
+ },
44
+ "admission": {
45
+ "type": "object",
46
+ "properties": {
47
+ "mode": {
48
+ "type": "string",
49
+ "enum": [
50
+ "human",
51
+ "qualified_automatic"
52
+ ]
53
+ },
54
+ "qualification": {
55
+ "anyOf": [
56
+ {
57
+ "$ref": "#/$defs/__schema3"
58
+ },
59
+ {
60
+ "type": "null"
61
+ }
62
+ ]
63
+ },
64
+ "minimumApprovedExamples": {
65
+ "type": "integer",
66
+ "exclusiveMinimum": 0,
67
+ "maximum": 100000
68
+ }
69
+ },
70
+ "required": [
71
+ "mode",
72
+ "qualification",
73
+ "minimumApprovedExamples"
74
+ ],
75
+ "additionalProperties": false
76
+ },
77
+ "trigger": {
78
+ "oneOf": [
79
+ {
80
+ "type": "object",
81
+ "properties": {
82
+ "kind": {
83
+ "type": "string",
84
+ "const": "manual"
85
+ }
86
+ },
87
+ "required": [
88
+ "kind"
89
+ ],
90
+ "additionalProperties": false
91
+ },
92
+ {
93
+ "type": "object",
94
+ "properties": {
95
+ "kind": {
96
+ "type": "string",
97
+ "const": "approved_count"
98
+ }
99
+ },
100
+ "required": [
101
+ "kind"
102
+ ],
103
+ "additionalProperties": false
104
+ },
105
+ {
106
+ "type": "object",
107
+ "properties": {
108
+ "kind": {
109
+ "type": "string",
110
+ "const": "schedule"
111
+ },
112
+ "intervalSeconds": {
113
+ "type": "integer",
114
+ "minimum": 60,
115
+ "maximum": 31536000
116
+ }
117
+ },
118
+ "required": [
119
+ "kind",
120
+ "intervalSeconds"
121
+ ],
122
+ "additionalProperties": false
123
+ },
124
+ {
125
+ "type": "object",
126
+ "properties": {
127
+ "kind": {
128
+ "type": "string",
129
+ "const": "upstream_accepted"
130
+ },
131
+ "modelProjectId": {
132
+ "$ref": "#/$defs/__schema0"
133
+ }
134
+ },
135
+ "required": [
136
+ "kind",
137
+ "modelProjectId"
138
+ ],
139
+ "additionalProperties": false
140
+ }
141
+ ]
142
+ },
143
+ "trainingParent": {
144
+ "$ref": "#/$defs/__schema3"
145
+ },
146
+ "teacher": {
147
+ "anyOf": [
148
+ {
149
+ "$ref": "#/$defs/__schema3"
150
+ },
151
+ {
152
+ "type": "null"
153
+ }
154
+ ]
155
+ },
156
+ "training": {
157
+ "type": "object",
158
+ "properties": {
159
+ "method": {
160
+ "type": "string",
161
+ "enum": [
162
+ "sft",
163
+ "dpo",
164
+ "grpo",
165
+ "ppo",
166
+ "sdft",
167
+ "opd",
168
+ "opsd",
169
+ "sdpo"
170
+ ]
171
+ },
172
+ "recipe": {
173
+ "$ref": "#/$defs/__schema3"
174
+ },
175
+ "retentionEvaluation": {
176
+ "$ref": "#/$defs/__schema3"
177
+ },
178
+ "replayBatches": {
179
+ "maxItems": 100,
180
+ "type": "array",
181
+ "items": {
182
+ "$ref": "#/$defs/__schema3"
183
+ }
184
+ }
185
+ },
186
+ "required": [
187
+ "method",
188
+ "recipe",
189
+ "retentionEvaluation",
190
+ "replayBatches"
191
+ ],
192
+ "additionalProperties": false
193
+ },
194
+ "limits": {
195
+ "type": "object",
196
+ "properties": {
197
+ "maxIterationSpendUsd": {
198
+ "type": "number",
199
+ "exclusiveMinimum": 0,
200
+ "maximum": 100000
201
+ },
202
+ "maxDailySpendUsd": {
203
+ "type": "number",
204
+ "exclusiveMinimum": 0,
205
+ "maximum": 1000000
206
+ },
207
+ "cooldownSeconds": {
208
+ "type": "integer",
209
+ "minimum": 0,
210
+ "maximum": 31536000
211
+ },
212
+ "maxRetries": {
213
+ "type": "integer",
214
+ "minimum": 0,
215
+ "maximum": 10
216
+ },
217
+ "maxBatchExamples": {
218
+ "type": "integer",
219
+ "exclusiveMinimum": 0,
220
+ "maximum": 10000
221
+ },
222
+ "maxBacklogExamples": {
223
+ "type": "integer",
224
+ "exclusiveMinimum": 0,
225
+ "maximum": 1000000
226
+ }
227
+ },
228
+ "required": [
229
+ "maxIterationSpendUsd",
230
+ "maxDailySpendUsd",
231
+ "cooldownSeconds",
232
+ "maxRetries",
233
+ "maxBatchExamples",
234
+ "maxBacklogExamples"
235
+ ],
236
+ "additionalProperties": false
237
+ },
238
+ "automation": {
239
+ "type": "object",
240
+ "properties": {
241
+ "collect": {
242
+ "type": "boolean"
243
+ },
244
+ "train": {
245
+ "type": "boolean"
246
+ },
247
+ "accept": {
248
+ "type": "boolean"
249
+ },
250
+ "serve": {
251
+ "type": "boolean"
252
+ }
253
+ },
254
+ "required": [
255
+ "collect",
256
+ "train",
257
+ "accept",
258
+ "serve"
259
+ ],
260
+ "additionalProperties": false
261
+ },
262
+ "acceptance": {
263
+ "type": "object",
264
+ "properties": {
265
+ "minimumScore": {
266
+ "type": "number",
267
+ "minimum": 0,
268
+ "maximum": 1
269
+ },
270
+ "maximumRetentionRegression": {
271
+ "type": "number",
272
+ "minimum": 0,
273
+ "maximum": 1
274
+ },
275
+ "requireImprovement": {
276
+ "type": "boolean"
277
+ },
278
+ "rollbackVersion": {
279
+ "anyOf": [
280
+ {
281
+ "$ref": "#/$defs/__schema3"
282
+ },
283
+ {
284
+ "type": "null"
285
+ }
286
+ ]
287
+ }
288
+ },
289
+ "required": [
290
+ "minimumScore",
291
+ "maximumRetentionRegression",
292
+ "requireImprovement",
293
+ "rollbackVersion"
294
+ ],
295
+ "additionalProperties": false
296
+ },
297
+ "contentHash": {
298
+ "$ref": "#/$defs/__schema2"
299
+ }
300
+ },
301
+ "required": [
302
+ "schemaVersion",
303
+ "id",
304
+ "revision",
305
+ "modelProjectId",
306
+ "executionOwner",
307
+ "enabled",
308
+ "sources",
309
+ "taskDefinition",
310
+ "rewardBinding",
311
+ "admission",
312
+ "trigger",
313
+ "trainingParent",
314
+ "teacher",
315
+ "training",
316
+ "limits",
317
+ "automation",
318
+ "acceptance",
319
+ "contentHash"
320
+ ],
321
+ "additionalProperties": false,
322
+ "$defs": {
323
+ "__schema0": {
324
+ "type": "string",
325
+ "minLength": 1,
326
+ "maxLength": 240
327
+ },
328
+ "__schema1": {
329
+ "type": "object",
330
+ "properties": {
331
+ "id": {
332
+ "$ref": "#/$defs/__schema0"
333
+ },
334
+ "contentHash": {
335
+ "$ref": "#/$defs/__schema2"
336
+ },
337
+ "revision": {
338
+ "type": "integer",
339
+ "exclusiveMinimum": 0,
340
+ "maximum": 9007199254740991
341
+ }
342
+ },
343
+ "required": [
344
+ "id",
345
+ "contentHash",
346
+ "revision"
347
+ ],
348
+ "additionalProperties": false
349
+ },
350
+ "__schema2": {
351
+ "type": "string",
352
+ "pattern": "^[a-f0-9]{64}$"
353
+ },
354
+ "__schema3": {
355
+ "type": "object",
356
+ "properties": {
357
+ "id": {
358
+ "$ref": "#/$defs/__schema0"
359
+ },
360
+ "contentHash": {
361
+ "$ref": "#/$defs/__schema2"
362
+ }
363
+ },
364
+ "required": [
365
+ "id",
366
+ "contentHash"
367
+ ],
368
+ "additionalProperties": false
369
+ }
370
+ },
371
+ "$id": "urn:openpond:learning:v1:policy",
372
+ "$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."
373
+ }
@@ -0,0 +1,101 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "oneOf": [
4
+ {
5
+ "type": "object",
6
+ "properties": {
7
+ "action": {
8
+ "type": "string",
9
+ "const": "get"
10
+ },
11
+ "scope": {
12
+ "$ref": "#/$defs/__schema0"
13
+ },
14
+ "kind": {
15
+ "$ref": "#/$defs/__schema1"
16
+ },
17
+ "id": {
18
+ "$ref": "#/$defs/__schema0"
19
+ },
20
+ "revision": {
21
+ "type": "integer",
22
+ "exclusiveMinimum": 0,
23
+ "maximum": 9007199254740991
24
+ }
25
+ },
26
+ "required": [
27
+ "action",
28
+ "scope",
29
+ "kind",
30
+ "id"
31
+ ],
32
+ "additionalProperties": false
33
+ },
34
+ {
35
+ "type": "object",
36
+ "properties": {
37
+ "action": {
38
+ "type": "string",
39
+ "const": "list"
40
+ },
41
+ "scope": {
42
+ "$ref": "#/$defs/__schema0"
43
+ },
44
+ "kind": {
45
+ "$ref": "#/$defs/__schema1"
46
+ },
47
+ "parentId": {
48
+ "$ref": "#/$defs/__schema0"
49
+ },
50
+ "status": {
51
+ "type": "string",
52
+ "minLength": 1,
53
+ "maxLength": 200
54
+ },
55
+ "afterId": {
56
+ "$ref": "#/$defs/__schema0"
57
+ },
58
+ "limit": {
59
+ "default": 50,
60
+ "type": "integer",
61
+ "minimum": 1,
62
+ "maximum": 100
63
+ }
64
+ },
65
+ "required": [
66
+ "action",
67
+ "scope",
68
+ "kind",
69
+ "limit"
70
+ ],
71
+ "additionalProperties": false
72
+ }
73
+ ],
74
+ "$defs": {
75
+ "__schema0": {
76
+ "type": "string",
77
+ "minLength": 1,
78
+ "maxLength": 240
79
+ },
80
+ "__schema1": {
81
+ "type": "string",
82
+ "enum": [
83
+ "asset",
84
+ "definition",
85
+ "reward",
86
+ "binding",
87
+ "source",
88
+ "evidence",
89
+ "feedback",
90
+ "decision",
91
+ "batch",
92
+ "policy",
93
+ "iteration",
94
+ "grade",
95
+ "package"
96
+ ]
97
+ }
98
+ },
99
+ "$id": "urn:openpond:learning:v1:read-request",
100
+ "$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."
101
+ }