@toolproof-core/schema 1.0.11 → 1.0.12

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