@toolproof-core/schema 1.0.2 → 1.0.4

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 (90) hide show
  1. package/dist/generated/normalized/Genesis.d.ts +2 -0
  2. package/dist/generated/normalized/Genesis.js +2 -0
  3. package/dist/generated/normalized/Genesis.json +2008 -0
  4. package/dist/generated/resources/Genesis.d.ts +2 -0
  5. package/dist/generated/resources/Genesis.js +2 -0
  6. package/dist/generated/resources/Genesis.json +2907 -0
  7. package/dist/generated/schemas/Genesis.d.ts +2 -0
  8. package/dist/generated/schemas/Genesis.js +2 -0
  9. package/dist/generated/schemas/Genesis.json +1466 -0
  10. package/dist/generated/schemas/standalone/Goal.d.ts +2 -0
  11. package/dist/generated/schemas/standalone/Goal.js +2 -0
  12. package/dist/generated/schemas/standalone/Goal.json +86 -0
  13. package/dist/generated/schemas/standalone/Job.d.ts +2 -0
  14. package/dist/generated/schemas/standalone/Job.js +2 -0
  15. package/dist/generated/schemas/standalone/Job.json +236 -0
  16. package/dist/generated/schemas/standalone/RawStrategy.d.ts +2 -0
  17. package/dist/generated/schemas/standalone/RawStrategy.js +2 -0
  18. package/dist/generated/schemas/standalone/RawStrategy.json +650 -0
  19. package/dist/generated/schemas/standalone/ResourceType.d.ts +2 -0
  20. package/dist/generated/schemas/standalone/ResourceType.js +2 -0
  21. package/dist/generated/schemas/standalone/ResourceType.json +140 -0
  22. package/dist/generated/schemas/standalone/RunnableStrategy.d.ts +2 -0
  23. package/dist/generated/schemas/standalone/RunnableStrategy.js +2 -0
  24. package/dist/generated/schemas/standalone/RunnableStrategy.json +720 -0
  25. package/dist/generated/schemas/standalone/StrategyRun.d.ts +2 -0
  26. package/dist/generated/schemas/standalone/StrategyRun.js +2 -0
  27. package/dist/generated/schemas/standalone/StrategyRun.json +1002 -0
  28. package/dist/generated/{types → typesTS}/standalone/Resource_Genesis.d.ts +1 -1
  29. package/{src/generated/types → dist/generated/typesTS}/standalone/Resource_Job.d.ts +1 -1
  30. package/{src/generated/types → dist/generated/typesTS}/standalone/Resource_RawStrategy.d.ts +1 -1
  31. package/{src/generated/types → dist/generated/typesTS}/standalone/Resource_ResourceType.d.ts +1 -1
  32. package/dist/generated/{types → typesTS}/standalone/Resource_RunnableStrategy.d.ts +1 -1
  33. package/dist/generated/typesTS/typesTS.d.ts +745 -0
  34. package/dist/index.d.ts +10 -0
  35. package/dist/index.js +5 -0
  36. package/dist/scripts/_lib/config.d.ts +10 -10
  37. package/dist/scripts/_lib/config.js +23 -23
  38. package/dist/scripts/extractSchemasFromResourceTypeShells.js +109 -103
  39. package/dist/scripts/generateDependencies.js +15 -14
  40. package/dist/scripts/generateSchemaShims.js +76 -84
  41. package/dist/scripts/generateStandaloneSchema.js +47 -37
  42. package/dist/scripts/generateStandaloneTypeTS.js +108 -0
  43. package/dist/scripts/generateTypesTS.js +430 -0
  44. package/dist/scripts/normalizeAnchorsToPointers.js +37 -30
  45. package/dist/scripts/wrapResourceTypesWithResourceShells.js +14 -16
  46. package/package.json +11 -12
  47. package/src/Genesis.json +2007 -1999
  48. package/src/generated/{dependencyMap.json → dependencies/dependencyMap.json} +7 -6
  49. package/src/generated/normalized/Genesis.json +17 -9
  50. package/src/generated/resources/Genesis.json +19 -11
  51. package/src/generated/schemas/Genesis.json +15 -7
  52. package/src/generated/schemas/standalone/RawStrategy.json +15 -7
  53. package/src/generated/schemas/standalone/RunnableStrategy.json +15 -7
  54. package/src/generated/schemas/standalone/StrategyRun.json +15 -7
  55. package/src/generated/{types → typesTS}/standalone/Resource_Genesis.d.ts +1 -1
  56. package/{dist/generated/types → src/generated/typesTS}/standalone/Resource_Job.d.ts +1 -1
  57. package/{dist/generated/types → src/generated/typesTS}/standalone/Resource_RawStrategy.d.ts +1 -1
  58. package/{dist/generated/types → src/generated/typesTS}/standalone/Resource_ResourceType.d.ts +1 -1
  59. package/src/generated/{types → typesTS}/standalone/Resource_RunnableStrategy.d.ts +1 -1
  60. package/src/generated/typesTS/typesTS.d.ts +745 -0
  61. package/src/index.ts +67 -1
  62. package/src/scripts/_lib/config.ts +205 -205
  63. package/src/scripts/extractSchemasFromResourceTypeShells.ts +261 -218
  64. package/src/scripts/generateDependencies.ts +121 -120
  65. package/src/scripts/generateSchemaShims.ts +127 -135
  66. package/src/scripts/generateStandaloneSchema.ts +185 -175
  67. package/src/scripts/generateStandaloneTypeTS.ts +127 -0
  68. package/src/scripts/generateTypesTS.ts +532 -0
  69. package/src/scripts/normalizeAnchorsToPointers.ts +115 -123
  70. package/src/scripts/wrapResourceTypesWithResourceShells.ts +82 -84
  71. package/dist/generated/types/types.d.ts +0 -1723
  72. package/dist/scripts/generateStandaloneType.js +0 -102
  73. package/dist/scripts/generateTypes.js +0 -550
  74. package/src/generated/types/types.d.ts +0 -1723
  75. package/src/scripts/generateStandaloneType.ts +0 -119
  76. package/src/scripts/generateTypes.ts +0 -615
  77. /package/dist/generated/{types → typesTS}/standalone/Resource_Genesis.js +0 -0
  78. /package/dist/generated/{types → typesTS}/standalone/Resource_Job.js +0 -0
  79. /package/dist/generated/{types → typesTS}/standalone/Resource_RawStrategy.js +0 -0
  80. /package/dist/generated/{types → typesTS}/standalone/Resource_ResourceType.js +0 -0
  81. /package/dist/generated/{types → typesTS}/standalone/Resource_RunnableStrategy.js +0 -0
  82. /package/dist/generated/{types/types.js → typesTS/typesTS.js} +0 -0
  83. /package/dist/scripts/{generateStandaloneType.d.ts → generateStandaloneTypeTS.d.ts} +0 -0
  84. /package/dist/scripts/{generateTypes.d.ts → generateTypesTS.d.ts} +0 -0
  85. /package/src/generated/{types → typesTS}/standalone/Resource_Genesis.js +0 -0
  86. /package/src/generated/{types → typesTS}/standalone/Resource_Job.js +0 -0
  87. /package/src/generated/{types → typesTS}/standalone/Resource_RawStrategy.js +0 -0
  88. /package/src/generated/{types → typesTS}/standalone/Resource_ResourceType.js +0 -0
  89. /package/src/generated/{types → typesTS}/standalone/Resource_RunnableStrategy.js +0 -0
  90. /package/src/generated/{types/types.js → typesTS/typesTS.js} +0 -0
@@ -0,0 +1,1466 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$comment": "This file defines all schemas used internally by ToolProof.",
4
+ "$anchor": "Genesis",
5
+ "$id": "https://schemas.toolproof.com/v2/Genesis.json",
6
+ "$defs": {
7
+ "Name": {
8
+ "$anchor": "Name",
9
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
10
+ "type": "string",
11
+ "minLength": 1,
12
+ "pattern": "^(?:[A-Z][^0-9]*|[a-z]+/[a-z.+&-]+)$",
13
+ "$comment": "Validation is intercepted by an AI Agent that verifies the name against Toolproof's naming conventions.",
14
+ "semanticValidation": "Ajv custom keyword to verify name."
15
+ },
16
+ "NameFacet": {
17
+ "$anchor": "NameFacet",
18
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
19
+ "type": "object",
20
+ "required": [
21
+ "name"
22
+ ],
23
+ "properties": {
24
+ "name": {
25
+ "$ref": "#/$defs/Name"
26
+ }
27
+ }
28
+ },
29
+ "Description": {
30
+ "$anchor": "Description",
31
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
32
+ "type": "string",
33
+ "minLength": 1,
34
+ "$comment": "Validation is intercepted by an AI Agent that verifies the description against Toolproof's documentation standards.",
35
+ "semanticValidation": "Ajv custom keyword to verify description."
36
+ },
37
+ "DescriptionFacet": {
38
+ "$anchor": "DescriptionFacet",
39
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
40
+ "type": "object",
41
+ "required": [
42
+ "description"
43
+ ],
44
+ "properties": {
45
+ "description": {
46
+ "$ref": "#/$defs/Description"
47
+ }
48
+ }
49
+ },
50
+ "DocumentationFacet": {
51
+ "$anchor": "DocumentationFacet",
52
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
53
+ "type": "object",
54
+ "allOf": [
55
+ {
56
+ "$ref": "#/$defs/NameFacet"
57
+ },
58
+ {
59
+ "$ref": "#/$defs/DescriptionFacet"
60
+ }
61
+ ]
62
+ },
63
+ "ResourceTypeImplementationKind": {
64
+ "$anchor": "ResourceTypeImplementationKind",
65
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
66
+ "type": "string",
67
+ "enum": [
68
+ "internal-without-identity",
69
+ "internal-with-identity",
70
+ "external"
71
+ ]
72
+ },
73
+ "ResourceTypeImplementationKindFacet": {
74
+ "$anchor": "ResourceTypeImplementationKindFacet",
75
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
76
+ "type": "object",
77
+ "required": [
78
+ "resourceTypeImplementationKind"
79
+ ],
80
+ "properties": {
81
+ "resourceTypeImplementationKind": {
82
+ "$ref": "#/$defs/ResourceTypeImplementationKind"
83
+ }
84
+ }
85
+ },
86
+ "Uri": {
87
+ "$anchor": "Uri",
88
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
89
+ "type": "string",
90
+ "format": "uri"
91
+ },
92
+ "ResourceTypeIdentity": {
93
+ "$anchor": "ResourceTypeIdentity",
94
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
95
+ "type": "string",
96
+ "pattern": "^TYPE-.+$"
97
+ },
98
+ "ResourceType": {
99
+ "$anchor": "ResourceType",
100
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
101
+ "type": "object",
102
+ "required": [
103
+ "identity",
104
+ "nucleusSchema"
105
+ ],
106
+ "properties": {
107
+ "identity": {
108
+ "$ref": "#/$defs/ResourceTypeIdentity"
109
+ },
110
+ "nucleusSchema": true,
111
+ "embeddingUriMap": {
112
+ "type": "object",
113
+ "propertyNames": {
114
+ "type": "string",
115
+ "pattern": "^EMBEDDING-.+$"
116
+ },
117
+ "additionalProperties": {
118
+ "$ref": "#/$defs/Uri"
119
+ },
120
+ "minProperties": 1,
121
+ "$comment": "A ResourceType may specify a set of embedding models that convert the raw data (or one of its alternative representations) into vector embeddings. The build process enforces that the keys of this map are members of a set of predefined embedding models."
122
+ },
123
+ "generatorUriMap": {
124
+ "type": "object",
125
+ "propertyNames": {
126
+ "type": "string",
127
+ "pattern": "^GENERATOR-.+$"
128
+ },
129
+ "additionalProperties": {
130
+ "$ref": "#/$defs/Uri"
131
+ },
132
+ "minProperties": 1,
133
+ "$comment": "A ResourceType may specify a set of generators that generate different representations of its instances from the raw file. A ToolProof Resource is always backed by a raw file. This is also true for the Resources (of type ResourceType) defined in this file! The build process enforces that the keys of this map are members of a set of predefined generators. GENERATOR-Json is an identifier for a generator that generates JSON data from the raw file. If the raw file is a JSON file, GENERATOR-Json is an implicit identity operation (i.e. an operation that does nothing) and must not be present in the map. A ResourceType may also specify other generators, such as GENERATOR-LeanTerm, which generates an instance (or 'term' in Lean jargon) of a corresponding Lean type from the raw file. ResourceTypes that specify GENERATOR-LeanTerm must also specify a corresponding GENERATOR-LeanType. While the term-version runs when data instances enter the ecosystem, the type-version runs when the ResourceType itself enters the ecosystem."
134
+ }
135
+ },
136
+ "allOf": [
137
+ {
138
+ "$ref": "#/$defs/DocumentationFacet"
139
+ },
140
+ {
141
+ "$ref": "#/$defs/ResourceTypeImplementationKindFacet"
142
+ }
143
+ ]
144
+ },
145
+ "ResourceRoleIdentity": {
146
+ "$anchor": "ResourceRoleIdentity",
147
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
148
+ "type": "string",
149
+ "pattern": "^ROLE-.+$"
150
+ },
151
+ "ResourceRoleValue": {
152
+ "$anchor": "ResourceRoleValue",
153
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
154
+ "type": "object",
155
+ "allOf": [
156
+ {
157
+ "$comment": "A ResourceRole does not have a self-contained identity, as it is always defined in the context of a RoleMap. ResourceRoleValue uses the Value suffix to mean 'the value stored in this map' (RoleMap.additionalProperties).",
158
+ "required": [
159
+ "resourceTypeHandle"
160
+ ],
161
+ "properties": {
162
+ "resourceTypeHandle": {
163
+ "$ref": "#/$defs/ResourceTypeIdentity"
164
+ }
165
+ }
166
+ },
167
+ {
168
+ "$ref": "#/$defs/DocumentationFacet"
169
+ }
170
+ ]
171
+ },
172
+ "RoleMap": {
173
+ "$anchor": "RoleMap",
174
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
175
+ "type": "object",
176
+ "propertyNames": {
177
+ "$ref": "#/$defs/ResourceRoleIdentity"
178
+ },
179
+ "additionalProperties": {
180
+ "$ref": "#/$defs/ResourceRoleValue"
181
+ }
182
+ },
183
+ "Error": {
184
+ "$anchor": "Error",
185
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
186
+ "type": "object",
187
+ "allOf": [
188
+ {
189
+ "$ref": "#/$defs/DocumentationFacet"
190
+ },
191
+ {
192
+ "properties": {
193
+ "details": {
194
+ "type": "object"
195
+ }
196
+ }
197
+ }
198
+ ],
199
+ "unevaluatedProperties": false
200
+ },
201
+ "Roles": {
202
+ "$anchor": "Roles",
203
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
204
+ "type": "object",
205
+ "required": [
206
+ "inputMap",
207
+ "outputMap"
208
+ ],
209
+ "properties": {
210
+ "inputMap": {
211
+ "$ref": "#/$defs/RoleMap"
212
+ },
213
+ "outputMap": {
214
+ "allOf": [
215
+ {
216
+ "$ref": "#/$defs/RoleMap"
217
+ },
218
+ {
219
+ "required": [
220
+ "ROLE-ErrorOutput"
221
+ ],
222
+ "properties": {
223
+ "ROLE-ErrorOutput": {
224
+ "type": "object",
225
+ "allOf": [
226
+ {
227
+ "$ref": "#/$defs/ResourceRoleValue"
228
+ },
229
+ {
230
+ "required": [
231
+ "resourceTypeHandle",
232
+ "name",
233
+ "description"
234
+ ],
235
+ "properties": {
236
+ "resourceTypeHandle": {
237
+ "const": "TYPE-Error"
238
+ },
239
+ "name": {
240
+ "const": "ErrorOutput"
241
+ },
242
+ "description": {
243
+ "const": "Represents error outputs from job runs."
244
+ }
245
+ }
246
+ }
247
+ ]
248
+ }
249
+ }
250
+ }
251
+ ]
252
+ }
253
+ },
254
+ "unevaluatedProperties": false
255
+ },
256
+ "RolesFacet": {
257
+ "$anchor": "RolesFacet",
258
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
259
+ "type": "object",
260
+ "required": [
261
+ "roles"
262
+ ],
263
+ "properties": {
264
+ "roles": {
265
+ "$ref": "#/$defs/Roles"
266
+ }
267
+ }
268
+ },
269
+ "Domain": {
270
+ "$anchor": "Domain",
271
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
272
+ "type": "string",
273
+ "enum": [
274
+ "internal",
275
+ "numerical",
276
+ "biological",
277
+ "logical",
278
+ "augmental"
279
+ ]
280
+ },
281
+ "DomainFacet": {
282
+ "$anchor": "DomainFacet",
283
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
284
+ "type": "object",
285
+ "required": [
286
+ "domain"
287
+ ],
288
+ "properties": {
289
+ "domain": {
290
+ "$ref": "#/$defs/Domain"
291
+ }
292
+ }
293
+ },
294
+ "JobIdentity": {
295
+ "$anchor": "JobIdentity",
296
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
297
+ "type": "string",
298
+ "pattern": "^JOB-.+$"
299
+ },
300
+ "Job": {
301
+ "$anchor": "Job",
302
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
303
+ "type": "object",
304
+ "required": [
305
+ "identity",
306
+ "implementationUri"
307
+ ],
308
+ "properties": {
309
+ "identity": {
310
+ "$ref": "#/$defs/JobIdentity"
311
+ },
312
+ "implementationUri": {
313
+ "$ref": "#/$defs/Uri"
314
+ }
315
+ },
316
+ "allOf": [
317
+ {
318
+ "$ref": "#/$defs/DocumentationFacet"
319
+ },
320
+ {
321
+ "$ref": "#/$defs/DomainFacet"
322
+ },
323
+ {
324
+ "$ref": "#/$defs/RolesFacet"
325
+ }
326
+ ],
327
+ "unevaluatedProperties": false
328
+ },
329
+ "RoleBindingArray": {
330
+ "$anchor": "RoleBindingArray",
331
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
332
+ "type": "array",
333
+ "items": {
334
+ "$ref": "#/$defs/ResourceRoleIdentity"
335
+ }
336
+ },
337
+ "RoleBindings": {
338
+ "$anchor": "RoleBindings",
339
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
340
+ "type": "object",
341
+ "required": [
342
+ "inputBindings",
343
+ "outputBindings"
344
+ ],
345
+ "properties": {
346
+ "inputBindings": {
347
+ "$ref": "#/$defs/RoleBindingArray"
348
+ },
349
+ "outputBindings": {
350
+ "$ref": "#/$defs/RoleBindingArray"
351
+ }
352
+ }
353
+ },
354
+ "RoleBindingsFacet": {
355
+ "$anchor": "RoleBindingsFacet",
356
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
357
+ "type": "object",
358
+ "required": [
359
+ "roleBindings"
360
+ ],
361
+ "properties": {
362
+ "roleBindings": {
363
+ "$ref": "#/$defs/RoleBindings"
364
+ }
365
+ }
366
+ },
367
+ "StepKind": {
368
+ "$anchor": "StepKind",
369
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
370
+ "type": "string",
371
+ "enum": [
372
+ "job",
373
+ "branch",
374
+ "while",
375
+ "for"
376
+ ]
377
+ },
378
+ "StepKindFacet": {
379
+ "$anchor": "StepKindFacet",
380
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
381
+ "type": "object",
382
+ "required": [
383
+ "stepKind"
384
+ ],
385
+ "properties": {
386
+ "stepKind": {
387
+ "$ref": "#/$defs/StepKind"
388
+ }
389
+ }
390
+ },
391
+ "JobStepIdentity": {
392
+ "$anchor": "JobStepIdentity",
393
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
394
+ "type": "string",
395
+ "pattern": "^JOB_STEP-.+$"
396
+ },
397
+ "JobStep": {
398
+ "$anchor": "JobStep",
399
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
400
+ "type": "object",
401
+ "required": [
402
+ "identity",
403
+ "stepKind",
404
+ "jobHandle"
405
+ ],
406
+ "properties": {
407
+ "identity": {
408
+ "$ref": "#/$defs/JobStepIdentity"
409
+ },
410
+ "stepKind": {
411
+ "const": "job"
412
+ },
413
+ "jobHandle": {
414
+ "$ref": "#/$defs/JobIdentity"
415
+ }
416
+ },
417
+ "allOf": [
418
+ {
419
+ "$ref": "#/$defs/StepKindFacet"
420
+ },
421
+ {
422
+ "$comment": "This will be overlayed dynamically to specify roleBindings corresponding to the roles of the underlying job.",
423
+ "$ref": "#/$defs/RoleBindingsFacet"
424
+ }
425
+ ]
426
+ },
427
+ "Conditional": {
428
+ "$anchor": "Conditional",
429
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
430
+ "type": "object",
431
+ "required": [
432
+ "when",
433
+ "what"
434
+ ],
435
+ "properties": {
436
+ "when": {
437
+ "$ref": "#/$defs/JobStep"
438
+ },
439
+ "what": {
440
+ "$ref": "#/$defs/JobStep"
441
+ }
442
+ },
443
+ "unevaluatedProperties": false
444
+ },
445
+ "BranchStepIdentity": {
446
+ "$anchor": "BranchStepIdentity",
447
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
448
+ "type": "string",
449
+ "pattern": "^BRANCH_STEP-.+$"
450
+ },
451
+ "BranchStep": {
452
+ "$anchor": "BranchStep",
453
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
454
+ "type": "object",
455
+ "required": [
456
+ "identity",
457
+ "stepKind",
458
+ "cases"
459
+ ],
460
+ "properties": {
461
+ "identity": {
462
+ "$ref": "#/$defs/BranchStepIdentity"
463
+ },
464
+ "stepKind": {
465
+ "const": "branch"
466
+ },
467
+ "cases": {
468
+ "type": "array",
469
+ "items": {
470
+ "$ref": "#/$defs/Conditional"
471
+ },
472
+ "minItems": 1,
473
+ "uniqueItems": true
474
+ }
475
+ },
476
+ "allOf": [
477
+ {
478
+ "$ref": "#/$defs/StepKindFacet"
479
+ }
480
+ ]
481
+ },
482
+ "WhileStepIdentity": {
483
+ "$anchor": "WhileStepIdentity",
484
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
485
+ "type": "string",
486
+ "pattern": "^WHILE_STEP-.+$"
487
+ },
488
+ "WhileStep": {
489
+ "$anchor": "WhileStep",
490
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
491
+ "type": "object",
492
+ "required": [
493
+ "identity",
494
+ "stepKind",
495
+ "case"
496
+ ],
497
+ "properties": {
498
+ "identity": {
499
+ "$ref": "#/$defs/WhileStepIdentity"
500
+ },
501
+ "stepKind": {
502
+ "const": "while"
503
+ },
504
+ "case": {
505
+ "$ref": "#/$defs/Conditional"
506
+ }
507
+ },
508
+ "allOf": [
509
+ {
510
+ "$ref": "#/$defs/StepKindFacet"
511
+ }
512
+ ]
513
+ },
514
+ "ForStepIdentity": {
515
+ "$anchor": "ForStepIdentity",
516
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
517
+ "type": "string",
518
+ "pattern": "^FOR_STEP-.+$"
519
+ },
520
+ "ForStep": {
521
+ "$anchor": "ForStep",
522
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
523
+ "type": "object",
524
+ "required": [
525
+ "identity",
526
+ "stepKind",
527
+ "case"
528
+ ],
529
+ "properties": {
530
+ "identity": {
531
+ "$ref": "#/$defs/ForStepIdentity"
532
+ },
533
+ "stepKind": {
534
+ "const": "for"
535
+ },
536
+ "case": {
537
+ "$ref": "#/$defs/Conditional"
538
+ }
539
+ },
540
+ "allOf": [
541
+ {
542
+ "$ref": "#/$defs/StepKindFacet"
543
+ }
544
+ ]
545
+ },
546
+ "StepIdentity": {
547
+ "$anchor": "StepIdentity",
548
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
549
+ "type": "object",
550
+ "oneOf": [
551
+ {
552
+ "$ref": "#/$defs/JobStepIdentity"
553
+ },
554
+ {
555
+ "$ref": "#/$defs/BranchStepIdentity"
556
+ },
557
+ {
558
+ "$ref": "#/$defs/WhileStepIdentity"
559
+ },
560
+ {
561
+ "$ref": "#/$defs/ForStepIdentity"
562
+ }
563
+ ]
564
+ },
565
+ "Step": {
566
+ "$anchor": "Step",
567
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
568
+ "type": "object",
569
+ "oneOf": [
570
+ {
571
+ "$ref": "#/$defs/JobStep"
572
+ },
573
+ {
574
+ "$ref": "#/$defs/BranchStep"
575
+ },
576
+ {
577
+ "$ref": "#/$defs/WhileStep"
578
+ },
579
+ {
580
+ "$ref": "#/$defs/ForStep"
581
+ }
582
+ ],
583
+ "unevaluatedProperties": false
584
+ },
585
+ "CreationContext": {
586
+ "$anchor": "CreationContext",
587
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
588
+ "type": "object",
589
+ "required": [
590
+ "resourceRoleHandle",
591
+ "jobStepHandle"
592
+ ],
593
+ "properties": {
594
+ "resourceRoleHandle": {
595
+ "$ref": "#/$defs/ResourceRoleIdentity"
596
+ },
597
+ "jobStepHandle": {
598
+ "$ref": "#/$defs/JobStepIdentity"
599
+ }
600
+ }
601
+ },
602
+ "CreationContextFacet": {
603
+ "$anchor": "CreationContextFacet",
604
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
605
+ "type": "object",
606
+ "required": [
607
+ "creationContext"
608
+ ],
609
+ "properties": {
610
+ "creationContext": {
611
+ "$ref": "#/$defs/CreationContext"
612
+ }
613
+ }
614
+ },
615
+ "ResourceIdentity": {
616
+ "$anchor": "ResourceIdentity",
617
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
618
+ "type": "string",
619
+ "pattern": "^RESOURCE-.+$"
620
+ },
621
+ "ResourceShellBase": {
622
+ "$anchor": "ResourceShellBase",
623
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
624
+ "type": "object",
625
+ "required": [
626
+ "identity",
627
+ "resourceTypeHandle",
628
+ "resourceKind"
629
+ ],
630
+ "properties": {
631
+ "identity": {
632
+ "$ref": "#/$defs/ResourceIdentity"
633
+ },
634
+ "resourceTypeHandle": {
635
+ "$ref": "#/$defs/ResourceTypeIdentity"
636
+ },
637
+ "resourceKind": {
638
+ "$ref": "#/$defs/ResourceKind"
639
+ }
640
+ }
641
+ },
642
+ "ResourceKind": {
643
+ "$anchor": "ResourceKind",
644
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
645
+ "type": "string",
646
+ "enum": [
647
+ "missing",
648
+ "input-potential",
649
+ "output-potential",
650
+ "materialized"
651
+ ]
652
+ },
653
+ "ResourceKindFacet": {
654
+ "$anchor": "ResourceKindFacet",
655
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
656
+ "type": "object",
657
+ "required": [
658
+ "resourceKind"
659
+ ],
660
+ "properties": {
661
+ "resourceKind": {
662
+ "$ref": "#/$defs/ResourceKind"
663
+ }
664
+ }
665
+ },
666
+ "ShellMissing": {
667
+ "$anchor": "ShellMissing",
668
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
669
+ "type": "object",
670
+ "properties": {
671
+ "resourceKind": {
672
+ "const": "missing"
673
+ }
674
+ },
675
+ "allOf": [
676
+ {
677
+ "$ref": "#/$defs/ResourceShellBase"
678
+ },
679
+ {
680
+ "$ref": "#/$defs/ResourceKindFacet"
681
+ }
682
+ ],
683
+ "unevaluatedProperties": false
684
+ },
685
+ "ShellInputPotential": {
686
+ "$anchor": "ShellInputPotential",
687
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
688
+ "type": "object",
689
+ "properties": {
690
+ "resourceKind": {
691
+ "const": "input-potential"
692
+ }
693
+ },
694
+ "allOf": [
695
+ {
696
+ "$ref": "#/$defs/ResourceShellBase"
697
+ },
698
+ {
699
+ "$ref": "#/$defs/CreationContextFacet"
700
+ },
701
+ {
702
+ "$ref": "#/$defs/ResourceKindFacet"
703
+ }
704
+ ],
705
+ "unevaluatedProperties": false
706
+ },
707
+ "ShellOutputPotential": {
708
+ "$anchor": "ShellOutputPotential",
709
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
710
+ "type": "object",
711
+ "properties": {
712
+ "resourceKind": {
713
+ "const": "output-potential"
714
+ }
715
+ },
716
+ "allOf": [
717
+ {
718
+ "$ref": "#/$defs/ResourceShellBase"
719
+ },
720
+ {
721
+ "$ref": "#/$defs/CreationContextFacet"
722
+ },
723
+ {
724
+ "$ref": "#/$defs/ResourceKindFacet"
725
+ }
726
+ ],
727
+ "unevaluatedProperties": false
728
+ },
729
+ "Timestamp": {
730
+ "$anchor": "Timestamp",
731
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
732
+ "type": "string",
733
+ "format": "date-time"
734
+ },
735
+ "TimestampFacet": {
736
+ "$anchor": "TimestampFacet",
737
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
738
+ "type": "object",
739
+ "required": [
740
+ "timestamp"
741
+ ],
742
+ "properties": {
743
+ "timestamp": {
744
+ "$ref": "#/$defs/Timestamp"
745
+ }
746
+ }
747
+ },
748
+ "Path": {
749
+ "$anchor": "Path",
750
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
751
+ "type": "string",
752
+ "format": "uri-reference"
753
+ },
754
+ "PathFacet": {
755
+ "$anchor": "PathFacet",
756
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
757
+ "type": "object",
758
+ "required": [
759
+ "path"
760
+ ],
761
+ "properties": {
762
+ "path": {
763
+ "$ref": "#/$defs/Path"
764
+ }
765
+ }
766
+ },
767
+ "ShellMaterializedBase": {
768
+ "$anchor": "ShellMaterializedBase",
769
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
770
+ "type": "object",
771
+ "required": [
772
+ "version"
773
+ ],
774
+ "properties": {
775
+ "version": {
776
+ "const": 1
777
+ },
778
+ "resourceKind": {
779
+ "const": "materialized"
780
+ }
781
+ },
782
+ "allOf": [
783
+ {
784
+ "$ref": "#/$defs/ResourceShellBase"
785
+ },
786
+ {
787
+ "$ref": "#/$defs/CreationContextFacet"
788
+ },
789
+ {
790
+ "$ref": "#/$defs/ResourceKindFacet"
791
+ },
792
+ {
793
+ "$ref": "#/$defs/TimestampFacet"
794
+ },
795
+ {
796
+ "$ref": "#/$defs/PathFacet"
797
+ }
798
+ ]
799
+ },
800
+ "ShellMaterialized": {
801
+ "$anchor": "ShellMaterialized",
802
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
803
+ "type": "object",
804
+ "$ref": "#/$defs/ShellMaterializedBase",
805
+ "unevaluatedProperties": false
806
+ },
807
+ "ResourceMissing": {
808
+ "$anchor": "ResourceMissing",
809
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
810
+ "type": "object",
811
+ "$ref": "#/$defs/ShellMissing",
812
+ "unevaluatedProperties": false
813
+ },
814
+ "ResourceInputPotential": {
815
+ "$anchor": "ResourceInputPotential",
816
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
817
+ "type": "object",
818
+ "$ref": "#/$defs/ShellInputPotential",
819
+ "unevaluatedProperties": false
820
+ },
821
+ "ResourceOutputPotential": {
822
+ "$anchor": "ResourceOutputPotential",
823
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
824
+ "type": "object",
825
+ "$ref": "#/$defs/ShellOutputPotential",
826
+ "unevaluatedProperties": false
827
+ },
828
+ "JsonData": {
829
+ "$anchor": "JsonData",
830
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
831
+ "oneOf": [
832
+ {
833
+ "type": "null"
834
+ },
835
+ {
836
+ "type": "boolean"
837
+ },
838
+ {
839
+ "type": "number"
840
+ },
841
+ {
842
+ "type": "string"
843
+ },
844
+ {
845
+ "type": "array",
846
+ "items": {
847
+ "$ref": "#/$defs/JsonData"
848
+ }
849
+ },
850
+ {
851
+ "type": "object",
852
+ "additionalProperties": {
853
+ "$ref": "#/$defs/JsonData"
854
+ }
855
+ }
856
+ ]
857
+ },
858
+ "Nucleus": {
859
+ "$anchor": "Nucleus",
860
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
861
+ "type": "object",
862
+ "additionalProperties": {
863
+ "$ref": "#/$defs/JsonData"
864
+ }
865
+ },
866
+ "NucleusFacet": {
867
+ "$anchor": "NucleusFacet",
868
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
869
+ "type": "object",
870
+ "required": [
871
+ "nucleus"
872
+ ],
873
+ "properties": {
874
+ "nucleus": {
875
+ "$ref": "#/$defs/Nucleus"
876
+ }
877
+ }
878
+ },
879
+ "ResourceMaterialized": {
880
+ "$anchor": "ResourceMaterialized",
881
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
882
+ "type": "object",
883
+ "allOf": [
884
+ {
885
+ "$ref": "#/$defs/ShellMaterializedBase"
886
+ },
887
+ {
888
+ "$comment": "This will be overlayed dynamically to match the data structure of the underlying ResourceType's nucleusSchema.",
889
+ "$ref": "#/$defs/NucleusFacet"
890
+ }
891
+ ],
892
+ "unevaluatedProperties": false
893
+ },
894
+ "Resource": {
895
+ "$anchor": "Resource",
896
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
897
+ "type": "object",
898
+ "oneOf": [
899
+ {
900
+ "$ref": "#/$defs/ResourceMissing"
901
+ },
902
+ {
903
+ "$ref": "#/$defs/ResourceInputPotential"
904
+ },
905
+ {
906
+ "$ref": "#/$defs/ResourceOutputPotential"
907
+ },
908
+ {
909
+ "$ref": "#/$defs/ResourceMaterialized"
910
+ }
911
+ ],
912
+ "unevaluatedProperties": false
913
+ },
914
+ "JobStepSocket": {
915
+ "$anchor": "JobStepSocket",
916
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
917
+ "type": "object",
918
+ "propertyNames": {
919
+ "$ref": "#/$defs/ResourceRoleIdentity"
920
+ },
921
+ "additionalProperties": {
922
+ "$ref": "#/$defs/Resource"
923
+ }
924
+ },
925
+ "StrategyState": {
926
+ "$anchor": "StrategyState",
927
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
928
+ "type": "object",
929
+ "propertyNames": {
930
+ "$ref": "#/$defs/JobStepIdentity"
931
+ },
932
+ "additionalProperties": {
933
+ "$ref": "#/$defs/JobStepSocket"
934
+ }
935
+ },
936
+ "StrategyStateFacet": {
937
+ "$anchor": "StrategyStateFacet",
938
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
939
+ "type": "object",
940
+ "required": [
941
+ "strategyState"
942
+ ],
943
+ "properties": {
944
+ "strategyState": {
945
+ "$ref": "#/$defs/StrategyState"
946
+ }
947
+ }
948
+ },
949
+ "StepArray": {
950
+ "$anchor": "StepArray",
951
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
952
+ "type": "array",
953
+ "items": {
954
+ "$ref": "#/$defs/Step"
955
+ },
956
+ "uniqueItems": true
957
+ },
958
+ "StepsFacet": {
959
+ "$anchor": "StepsFacet",
960
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
961
+ "type": "object",
962
+ "required": [
963
+ "steps"
964
+ ],
965
+ "properties": {
966
+ "steps": {
967
+ "$ref": "#/$defs/StepArray"
968
+ }
969
+ }
970
+ },
971
+ "RawStrategy": {
972
+ "$anchor": "RawStrategy",
973
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
974
+ "type": "object",
975
+ "allOf": [
976
+ {
977
+ "$ref": "#/$defs/StepsFacet"
978
+ },
979
+ {
980
+ "$ref": "#/$defs/StrategyStateFacet"
981
+ }
982
+ ],
983
+ "unevaluatedProperties": false
984
+ },
985
+ "RunnableStrategyIdentity": {
986
+ "$anchor": "RunnableStrategyIdentity",
987
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
988
+ "type": "string",
989
+ "pattern": "^RUNNABLE_STRATEGY-.+$"
990
+ },
991
+ "RunnableStrategyStatus": {
992
+ "$anchor": "RunnableStrategyStatus",
993
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
994
+ "type": "string",
995
+ "enum": [
996
+ "pending",
997
+ "running",
998
+ "completed",
999
+ "failed",
1000
+ "cancelled"
1001
+ ]
1002
+ },
1003
+ "RunnableStrategyContext": {
1004
+ "$anchor": "RunnableStrategyContext",
1005
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
1006
+ "type": "object",
1007
+ "required": [
1008
+ "status"
1009
+ ],
1010
+ "properties": {
1011
+ "status": {
1012
+ "$ref": "#/$defs/RunnableStrategyStatus"
1013
+ },
1014
+ "startedAt": {
1015
+ "$ref": "#/$defs/Timestamp"
1016
+ },
1017
+ "completedAt": {
1018
+ "$ref": "#/$defs/Timestamp"
1019
+ }
1020
+ },
1021
+ "unevaluatedProperties": false
1022
+ },
1023
+ "StrategyThreadIdentity": {
1024
+ "$anchor": "StrategyThreadIdentity",
1025
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
1026
+ "type": "string",
1027
+ "pattern": "^STRATEGY_THREAD-.+$"
1028
+ },
1029
+ "StrategyThreadMap": {
1030
+ "$anchor": "StrategyThreadMap",
1031
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
1032
+ "type": "object",
1033
+ "propertyNames": {
1034
+ "$ref": "#/$defs/StrategyThreadIdentity"
1035
+ },
1036
+ "additionalProperties": {
1037
+ "$ref": "#/$defs/StepArray"
1038
+ },
1039
+ "$comment": "Each thread contains an array of steps, allowing for sequential execution within a thread while supporting parallel execution across multiple threads."
1040
+ },
1041
+ "StrategyThreadMapFacet": {
1042
+ "$anchor": "StrategyThreadMapFacet",
1043
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
1044
+ "type": "object",
1045
+ "required": [
1046
+ "strategyThreadMap"
1047
+ ],
1048
+ "properties": {
1049
+ "strategyThreadMap": {
1050
+ "$ref": "#/$defs/StrategyThreadMap"
1051
+ }
1052
+ }
1053
+ },
1054
+ "RunnableStrategy": {
1055
+ "$anchor": "RunnableStrategy",
1056
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
1057
+ "type": "object",
1058
+ "required": [
1059
+ "identity",
1060
+ "runnableStrategyContext"
1061
+ ],
1062
+ "properties": {
1063
+ "identity": {
1064
+ "$ref": "#/$defs/RunnableStrategyIdentity"
1065
+ },
1066
+ "runnableStrategyContext": {
1067
+ "$ref": "#/$defs/RunnableStrategyContext"
1068
+ }
1069
+ },
1070
+ "allOf": [
1071
+ {
1072
+ "$comment": "The Engine runs jobs specified by steps in strategyThreadMap. The Engine also injects repeted steps when encountering loops.",
1073
+ "$ref": "#/$defs/StrategyThreadMapFacet"
1074
+ },
1075
+ {
1076
+ "$comment": "The Engine updates strategyState with materialized Resources upon job completions and runtime-provided input events. It also inserts input-potential and output-potential Resources upon step injections.",
1077
+ "$ref": "#/$defs/StrategyStateFacet"
1078
+ }
1079
+ ],
1080
+ "unevaluatedProperties": false
1081
+ },
1082
+ "StrategyStateDelta": {
1083
+ "$anchor": "StrategyStateDelta",
1084
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
1085
+ "type": "object",
1086
+ "required": [
1087
+ "strategyStateUpdate"
1088
+ ],
1089
+ "properties": {
1090
+ "strategyStateUpdate": {
1091
+ "$ref": "#/$defs/StrategyState"
1092
+ }
1093
+ }
1094
+ },
1095
+ "RunnableStrategyUpdate": {
1096
+ "$anchor": "RunnableStrategyUpdate",
1097
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
1098
+ "type": "object",
1099
+ "required": [
1100
+ "runnableStrategyHandle"
1101
+ ],
1102
+ "properties": {
1103
+ "runnableStrategyHandle": {
1104
+ "$ref": "#/$defs/RunnableStrategyIdentity"
1105
+ },
1106
+ "runnableStrategy": {
1107
+ "$comment": "Optional embedded snapshot; runnableStrategyHandle remains the canonical pointer.",
1108
+ "$ref": "#/$defs/RunnableStrategy"
1109
+ }
1110
+ },
1111
+ "allOf": [
1112
+ {
1113
+ "$ref": "#/$defs/StrategyStateDelta"
1114
+ }
1115
+ ],
1116
+ "unevaluatedProperties": false
1117
+ },
1118
+ "RunEventCounters": {
1119
+ "$anchor": "RunEventCounters",
1120
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
1121
+ "type": "object",
1122
+ "properties": {
1123
+ "stepCounterAfter": {
1124
+ "type": "integer"
1125
+ },
1126
+ "iterationCounterAfter": {
1127
+ "type": "integer"
1128
+ }
1129
+ }
1130
+ },
1131
+ "RunEventStepMetadata": {
1132
+ "$anchor": "RunEventStepMetadata",
1133
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
1134
+ "type": "object",
1135
+ "required": [
1136
+ "stepHandle",
1137
+ "stepKind",
1138
+ "threadStepIndex"
1139
+ ],
1140
+ "properties": {
1141
+ "stepHandle": {
1142
+ "$ref": "#/$defs/StepIdentity"
1143
+ },
1144
+ "stepKind": {
1145
+ "$ref": "#/$defs/StepKind"
1146
+ },
1147
+ "threadStepIndex": {
1148
+ "type": "integer"
1149
+ }
1150
+ }
1151
+ },
1152
+ "RunEventUpdates": {
1153
+ "$anchor": "RunEventUpdates",
1154
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
1155
+ "type": "object",
1156
+ "properties": {
1157
+ "stepsMutation": {
1158
+ "type": "object",
1159
+ "required": [
1160
+ "insertAt",
1161
+ "inserted"
1162
+ ],
1163
+ "properties": {
1164
+ "insertAt": {
1165
+ "type": "integer"
1166
+ },
1167
+ "inserted": {
1168
+ "$ref": "#/$defs/StepArray"
1169
+ }
1170
+ }
1171
+ },
1172
+ "interruptData": {
1173
+ "$comment": "Kept permissive; the engine may evolve interrupt payloads.",
1174
+ "type": [
1175
+ "object",
1176
+ "null"
1177
+ ]
1178
+ }
1179
+ },
1180
+ "allOf": [
1181
+ {
1182
+ "$ref": "#/$defs/StrategyStateDelta"
1183
+ }
1184
+ ]
1185
+ },
1186
+ "RunEventKind": {
1187
+ "$anchor": "RunEventKind",
1188
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
1189
+ "type": "string",
1190
+ "enum": [
1191
+ "graph_start",
1192
+ "tick",
1193
+ "interrupt",
1194
+ "graph_end"
1195
+ ]
1196
+ },
1197
+ "RunEventBase": {
1198
+ "$anchor": "RunEventBase",
1199
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
1200
+ "type": "object",
1201
+ "required": [
1202
+ "runEventKind",
1203
+ "runnableStrategyHandle",
1204
+ "strategyThreadHandle",
1205
+ "createdAt",
1206
+ "nodeName",
1207
+ "eventSeq"
1208
+ ],
1209
+ "properties": {
1210
+ "runEventKind": {
1211
+ "$ref": "#/$defs/RunEventKind"
1212
+ },
1213
+ "runnableStrategyHandle": {
1214
+ "$ref": "#/$defs/RunnableStrategyIdentity"
1215
+ },
1216
+ "strategyThreadHandle": {
1217
+ "$ref": "#/$defs/StrategyThreadIdentity"
1218
+ },
1219
+ "createdAt": {
1220
+ "$ref": "#/$defs/Timestamp"
1221
+ },
1222
+ "nodeName": {
1223
+ "type": "string"
1224
+ },
1225
+ "eventSeq": {
1226
+ "type": "integer"
1227
+ },
1228
+ "counters": {
1229
+ "$ref": "#/$defs/RunEventCounters"
1230
+ },
1231
+ "stepMetadata": {
1232
+ "$ref": "#/$defs/RunEventStepMetadata"
1233
+ },
1234
+ "updates": {
1235
+ "$ref": "#/$defs/RunEventUpdates"
1236
+ }
1237
+ }
1238
+ },
1239
+ "GraphStartRunEvent": {
1240
+ "$anchor": "GraphStartRunEvent",
1241
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
1242
+ "allOf": [
1243
+ {
1244
+ "$ref": "#/$defs/RunEventBase"
1245
+ },
1246
+ {
1247
+ "type": "object",
1248
+ "required": [
1249
+ "runnableStrategySeed"
1250
+ ],
1251
+ "properties": {
1252
+ "runEventKind": {
1253
+ "const": "graph_start"
1254
+ },
1255
+ "runnableStrategySeed": {
1256
+ "$ref": "#/$defs/RunnableStrategy"
1257
+ }
1258
+ }
1259
+ }
1260
+ ]
1261
+ },
1262
+ "TickRunEvent": {
1263
+ "$anchor": "TickRunEvent",
1264
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
1265
+ "allOf": [
1266
+ {
1267
+ "$ref": "#/$defs/RunEventBase"
1268
+ },
1269
+ {
1270
+ "type": "object",
1271
+ "properties": {
1272
+ "runEventKind": {
1273
+ "const": "tick"
1274
+ }
1275
+ }
1276
+ }
1277
+ ]
1278
+ },
1279
+ "InterruptRunEvent": {
1280
+ "$anchor": "InterruptRunEvent",
1281
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
1282
+ "allOf": [
1283
+ {
1284
+ "$ref": "#/$defs/RunEventBase"
1285
+ },
1286
+ {
1287
+ "type": "object",
1288
+ "properties": {
1289
+ "runEventKind": {
1290
+ "const": "interrupt"
1291
+ }
1292
+ }
1293
+ }
1294
+ ]
1295
+ },
1296
+ "GraphEndRunEvent": {
1297
+ "$anchor": "GraphEndRunEvent",
1298
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
1299
+ "allOf": [
1300
+ {
1301
+ "$ref": "#/$defs/RunEventBase"
1302
+ },
1303
+ {
1304
+ "type": "object",
1305
+ "properties": {
1306
+ "runEventKind": {
1307
+ "const": "graph_end"
1308
+ }
1309
+ }
1310
+ }
1311
+ ]
1312
+ },
1313
+ "RunEvent": {
1314
+ "$anchor": "RunEvent",
1315
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
1316
+ "type": "object",
1317
+ "oneOf": [
1318
+ {
1319
+ "$ref": "#/$defs/GraphStartRunEvent"
1320
+ },
1321
+ {
1322
+ "$ref": "#/$defs/TickRunEvent"
1323
+ },
1324
+ {
1325
+ "$ref": "#/$defs/InterruptRunEvent"
1326
+ },
1327
+ {
1328
+ "$ref": "#/$defs/GraphEndRunEvent"
1329
+ }
1330
+ ]
1331
+ },
1332
+ "StrategyRunIdentity": {
1333
+ "$anchor": "StrategyRunIdentity",
1334
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
1335
+ "type": "string",
1336
+ "pattern": "^STRATEGY_RUN-.+$"
1337
+ },
1338
+ "StrategyRun": {
1339
+ "$anchor": "StrategyRun",
1340
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
1341
+ "type": "object",
1342
+ "required": [
1343
+ "identity",
1344
+ "runnableStrategyHandle",
1345
+ "recordedAt",
1346
+ "runEvents"
1347
+ ],
1348
+ "properties": {
1349
+ "identity": {
1350
+ "$ref": "#/$defs/StrategyRunIdentity"
1351
+ },
1352
+ "runnableStrategyHandle": {
1353
+ "$comment": "Could be derived from the first event but useful for indexing.",
1354
+ "$ref": "#/$defs/RunnableStrategyIdentity"
1355
+ },
1356
+ "recordedAt": {
1357
+ "$ref": "#/$defs/Timestamp"
1358
+ },
1359
+ "runEvents": {
1360
+ "type": "array",
1361
+ "items": {
1362
+ "$ref": "#/$defs/RunEvent"
1363
+ }
1364
+ }
1365
+ },
1366
+ "unevaluatedProperties": false
1367
+ },
1368
+ "GoalIdentity": {
1369
+ "$anchor": "GoalIdentity",
1370
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
1371
+ "type": "string",
1372
+ "pattern": "^GOAL-.+$"
1373
+ },
1374
+ "Goal": {
1375
+ "$anchor": "Goal",
1376
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
1377
+ "type": "object",
1378
+ "required": [
1379
+ "identity",
1380
+ "target"
1381
+ ],
1382
+ "properties": {
1383
+ "identity": {
1384
+ "$ref": "#/$defs/GoalIdentity"
1385
+ },
1386
+ "target": {
1387
+ "type": "integer",
1388
+ "minimum": 0
1389
+ },
1390
+ "disallowedJobs": {
1391
+ "type": "array",
1392
+ "items": {
1393
+ "$ref": "#/$defs/JobIdentity"
1394
+ }
1395
+ },
1396
+ "disallowedSequences": {
1397
+ "type": "array",
1398
+ "items": {
1399
+ "type": "array",
1400
+ "items": {
1401
+ "$ref": "#/$defs/JobIdentity"
1402
+ }
1403
+ }
1404
+ },
1405
+ "minSteps": {
1406
+ "type": "integer",
1407
+ "minimum": 1
1408
+ },
1409
+ "maxSteps": {
1410
+ "type": "integer",
1411
+ "minimum": 1
1412
+ }
1413
+ },
1414
+ "allOf": [
1415
+ {
1416
+ "$ref": "#/$defs/DomainFacet"
1417
+ }
1418
+ ],
1419
+ "unevaluatedProperties": false
1420
+ },
1421
+ "Natural": {
1422
+ "$anchor": "Natural",
1423
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
1424
+ "type": "object",
1425
+ "required": [
1426
+ "identity"
1427
+ ],
1428
+ "properties": {
1429
+ "identity": {
1430
+ "$ref": "#/$defs/NaturalIdentity"
1431
+ }
1432
+ },
1433
+ "$defs": {
1434
+ "NaturalIdentity": {
1435
+ "type": "integer"
1436
+ }
1437
+ },
1438
+ "additionalProperties": false
1439
+ },
1440
+ "Boolean": {
1441
+ "$anchor": "Boolean",
1442
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
1443
+ "type": "object",
1444
+ "required": [
1445
+ "identity"
1446
+ ],
1447
+ "properties": {
1448
+ "identity": {
1449
+ "$ref": "#/$defs/BooleanIdentity"
1450
+ }
1451
+ },
1452
+ "$defs": {
1453
+ "BooleanIdentity": {
1454
+ "type": "boolean"
1455
+ }
1456
+ },
1457
+ "additionalProperties": false
1458
+ },
1459
+ "NaturalIdentity": {
1460
+ "type": "integer"
1461
+ },
1462
+ "BooleanIdentity": {
1463
+ "type": "boolean"
1464
+ }
1465
+ }
1466
+ }