@toolproof-core/schema 1.0.9 → 1.0.11

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 (67) hide show
  1. package/dist/generated/artifacts/constants.d.ts +121 -0
  2. package/dist/generated/artifacts/constants.js +121 -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 +117 -78
  6. package/dist/generated/resources/Genesis.json +489 -264
  7. package/dist/generated/schemas/Genesis.json +94 -61
  8. package/dist/generated/schemas/standalone/Job.json +9 -8
  9. package/dist/generated/schemas/standalone/RawStrategy.json +86 -110
  10. package/dist/generated/schemas/standalone/ResourceType.json +4 -4
  11. package/dist/generated/schemas/standalone/RunnableStrategy.json +115 -139
  12. package/dist/generated/schemas/standalone/StrategyRun.json +93 -117
  13. package/dist/generated/types/standalone/Resource_Genesis.d.ts +1 -1
  14. package/dist/generated/types/standalone/Resource_Job.d.ts +1 -1
  15. package/dist/generated/types/standalone/Resource_RawStrategy.d.ts +1 -1
  16. package/dist/generated/types/standalone/Resource_ResourceType.d.ts +1 -1
  17. package/dist/generated/types/standalone/Resource_RunnableStrategy.d.ts +1 -1
  18. package/dist/generated/types/types.d.ts +247 -239
  19. package/dist/index.d.ts +6 -3
  20. package/dist/index.js +5 -2
  21. package/dist/scripts/_lib/config.d.ts +3 -5
  22. package/dist/scripts/_lib/config.js +8 -14
  23. package/dist/scripts/generateConstantsAndMappings.d.ts +31 -0
  24. package/dist/scripts/generateConstantsAndMappings.js +243 -0
  25. package/dist/scripts/generateDependencies.js +1 -1
  26. package/dist/scripts/generateStandaloneType.js +2 -1
  27. package/dist/scripts/generateTerminals.js +2 -2
  28. package/dist/scripts/generateTypes.js +183 -5
  29. package/dist/scripts/wrapResourceTypesWithResourceShells.js +7 -3
  30. package/package.json +9 -10
  31. package/src/Genesis.json +1873 -1833
  32. package/src/generated/artifacts/constants.ts +122 -0
  33. package/src/generated/{dependencies → artifacts}/dependencyMap.json +282 -280
  34. package/src/generated/artifacts/mappings.ts +24 -0
  35. package/src/generated/{dependencies → artifacts}/terminals.json +13 -11
  36. package/src/generated/normalized/Genesis.json +1785 -1746
  37. package/src/generated/resources/Genesis.json +2833 -2608
  38. package/src/generated/schemas/Genesis.json +1348 -1315
  39. package/src/generated/schemas/standalone/Job.json +195 -194
  40. package/src/generated/schemas/standalone/RawStrategy.json +86 -110
  41. package/src/generated/schemas/standalone/ResourceType.json +106 -106
  42. package/src/generated/schemas/standalone/RunnableStrategy.json +645 -669
  43. package/src/generated/schemas/standalone/StrategyRun.json +913 -937
  44. package/src/generated/types/standalone/Resource_Genesis.d.ts +3 -3
  45. package/src/generated/types/standalone/Resource_Job.d.ts +3 -3
  46. package/src/generated/types/standalone/Resource_RawStrategy.d.ts +3 -3
  47. package/src/generated/types/standalone/Resource_ResourceType.d.ts +3 -3
  48. package/src/generated/types/standalone/Resource_RunnableStrategy.d.ts +3 -3
  49. package/src/generated/types/types.d.ts +717 -709
  50. package/src/index.ts +77 -70
  51. package/src/scripts/_lib/config.ts +207 -215
  52. package/src/scripts/extractSchemasFromResourceTypeShells.ts +261 -261
  53. package/src/scripts/generateConstantsAndMappings.ts +309 -0
  54. package/src/scripts/generateDependencies.ts +121 -121
  55. package/src/scripts/generateSchemaShims.ts +127 -127
  56. package/src/scripts/generateStandaloneSchema.ts +185 -185
  57. package/src/scripts/generateStandaloneType.ts +129 -127
  58. package/src/scripts/generateTerminals.ts +73 -73
  59. package/src/scripts/generateTypes.ts +733 -531
  60. package/src/scripts/normalizeAnchorsToPointers.ts +141 -141
  61. package/src/scripts/wrapResourceTypesWithResourceShells.ts +86 -82
  62. package/dist/generated/constants/constants.d.ts +0 -60
  63. package/dist/generated/constants/constants.js +0 -60
  64. package/dist/scripts/generateConstants.d.ts +0 -12
  65. package/dist/scripts/generateConstants.js +0 -179
  66. package/src/generated/constants/constants.ts +0 -61
  67. package/src/scripts/generateConstants.ts +0 -217
@@ -1,1316 +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/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
+ "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
+ }
1316
1349
  }