@toolproof-core/schema 1.0.9 → 1.0.10

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