@toolproof-core/genesis 1.0.47

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 (112) hide show
  1. package/dist/src/utils/constantsAndMappings.d.ts +20 -0
  2. package/dist/src/utils/constantsAndMappings.js +155 -0
  3. package/dist/src/utils/coreProjection.d.ts +16 -0
  4. package/dist/src/utils/coreProjection.js +29 -0
  5. package/dist/src/utils/resourceTypes.d.ts +12 -0
  6. package/dist/src/utils/resourceTypes.js +17 -0
  7. package/dist/src/utils/resources.d.ts +5 -0
  8. package/dist/src/utils/resources.js +17 -0
  9. package/dist/src/utils/schemaDependencies.d.ts +13 -0
  10. package/dist/src/utils/schemaDependencies.js +94 -0
  11. package/dist/src/utils/schemaObjectNormalization.d.ts +1 -0
  12. package/dist/src/utils/schemaObjectNormalization.js +66 -0
  13. package/dist/src/utils/schemaRefNormalization.d.ts +2 -0
  14. package/dist/src/utils/schemaRefNormalization.js +76 -0
  15. package/dist/src/utils/schemaShims.d.ts +2 -0
  16. package/dist/src/utils/schemaShims.js +13 -0
  17. package/dist/src/utils/standaloneSchemas.d.ts +16 -0
  18. package/dist/src/utils/standaloneSchemas.js +101 -0
  19. package/dist/src/utils/standaloneTypes.d.ts +8 -0
  20. package/dist/src/utils/standaloneTypes.js +22 -0
  21. package/dist/src/utils/standaloneZodSchemas.d.ts +8 -0
  22. package/dist/src/utils/standaloneZodSchemas.js +53 -0
  23. package/dist/src/utils/typeGeneration.d.ts +1 -0
  24. package/dist/src/utils/typeGeneration.js +25 -0
  25. package/dist/src/utils/typeGenerationPostProcess.d.ts +2 -0
  26. package/dist/src/utils/typeGenerationPostProcess.js +166 -0
  27. package/dist/src/utils/typeGenerationPreflight.d.ts +2 -0
  28. package/dist/src/utils/typeGenerationPreflight.js +93 -0
  29. package/dist/src/utils/zodCodegen.d.ts +10 -0
  30. package/dist/src/utils/zodCodegen.js +521 -0
  31. package/generated-src/derived/constants.ts +130 -0
  32. package/generated-src/derived/mappings.ts +12 -0
  33. package/generated-src/metadata/Core.json +1919 -0
  34. package/generated-src/metadata/dependencyMap.json +283 -0
  35. package/generated-src/metadata/terminals.json +17 -0
  36. package/generated-src/resourceTypes/resourceTypes.json +375 -0
  37. package/generated-src/resourceTypes/resourceTypes.ts +2 -0
  38. package/generated-src/resources/resourceTypes.json +456 -0
  39. package/generated-src/resources/resourceTypes.ts +2 -0
  40. package/generated-src/schemas/schemas.json +1670 -0
  41. package/generated-src/schemas/schemas.ts +2 -0
  42. package/generated-src/schemas/standalone/Boolean.json +5 -0
  43. package/generated-src/schemas/standalone/Boolean.ts +2 -0
  44. package/generated-src/schemas/standalone/Error.json +78 -0
  45. package/generated-src/schemas/standalone/Error.ts +2 -0
  46. package/generated-src/schemas/standalone/Goal.json +53 -0
  47. package/generated-src/schemas/standalone/Goal.ts +2 -0
  48. package/generated-src/schemas/standalone/Natural.json +6 -0
  49. package/generated-src/schemas/standalone/Natural.ts +2 -0
  50. package/generated-src/schemas/standalone/Resource.json +170 -0
  51. package/generated-src/schemas/standalone/Resource.ts +2 -0
  52. package/generated-src/schemas/standalone/ResourceType.json +131 -0
  53. package/generated-src/schemas/standalone/ResourceType.ts +2 -0
  54. package/generated-src/schemas/standalone/Strategy.json +641 -0
  55. package/generated-src/schemas/standalone/Strategy.ts +2 -0
  56. package/generated-src/schemas/standalone/StrategyTrace.json +820 -0
  57. package/generated-src/schemas/standalone/StrategyTrace.ts +2 -0
  58. package/generated-src/schemas/standalone/Tool.json +508 -0
  59. package/generated-src/schemas/standalone/Tool.ts +2 -0
  60. package/generated-src/schemas/zod/Boolean.ts +6 -0
  61. package/generated-src/schemas/zod/Error.ts +11 -0
  62. package/generated-src/schemas/zod/Goal.ts +8 -0
  63. package/generated-src/schemas/zod/Natural.ts +6 -0
  64. package/generated-src/schemas/zod/Resource.ts +21 -0
  65. package/generated-src/schemas/zod/ResourceType.ts +14 -0
  66. package/generated-src/schemas/zod/Strategy.ts +68 -0
  67. package/generated-src/schemas/zod/StrategyTrace.ts +75 -0
  68. package/generated-src/schemas/zod/Tool.ts +29 -0
  69. package/generated-src/schemas/zod/index.ts +10 -0
  70. package/generated-src/types/standalone/BooleanResource.d.ts +3 -0
  71. package/generated-src/types/standalone/BooleanResource.js +1 -0
  72. package/generated-src/types/standalone/ErrorResource.d.ts +3 -0
  73. package/generated-src/types/standalone/ErrorResource.js +1 -0
  74. package/generated-src/types/standalone/GoalResource.d.ts +3 -0
  75. package/generated-src/types/standalone/GoalResource.js +1 -0
  76. package/generated-src/types/standalone/NaturalResource.d.ts +3 -0
  77. package/generated-src/types/standalone/NaturalResource.js +1 -0
  78. package/generated-src/types/standalone/ResourceResource.d.ts +3 -0
  79. package/generated-src/types/standalone/ResourceResource.js +1 -0
  80. package/generated-src/types/standalone/ResourceTypeResource.d.ts +3 -0
  81. package/generated-src/types/standalone/ResourceTypeResource.js +1 -0
  82. package/generated-src/types/standalone/StrategyResource.d.ts +3 -0
  83. package/generated-src/types/standalone/StrategyResource.js +1 -0
  84. package/generated-src/types/standalone/StrategyTraceResource.d.ts +3 -0
  85. package/generated-src/types/standalone/StrategyTraceResource.js +1 -0
  86. package/generated-src/types/standalone/ToolResource.d.ts +3 -0
  87. package/generated-src/types/standalone/ToolResource.js +1 -0
  88. package/generated-src/types/types.d.ts +701 -0
  89. package/generated-src/types/types.js +1 -0
  90. package/package.json +52 -0
  91. package/src/genesis/resourceTypeShells.json +47 -0
  92. package/src/genesis/resources/booleans.json +24 -0
  93. package/src/genesis/resources/implementations/foo.ts +182 -0
  94. package/src/genesis/resources/naturals.json +112 -0
  95. package/src/genesis/resources/tools.json +840 -0
  96. package/src/genesis/schemas.json +1670 -0
  97. package/src/index.ts +27 -0
  98. package/src/utils/constantsAndMappings.ts +195 -0
  99. package/src/utils/coreProjection.ts +53 -0
  100. package/src/utils/resourceTypes.ts +39 -0
  101. package/src/utils/resources.ts +26 -0
  102. package/src/utils/schemaDependencies.ts +115 -0
  103. package/src/utils/schemaObjectNormalization.ts +71 -0
  104. package/src/utils/schemaRefNormalization.ts +83 -0
  105. package/src/utils/schemaShims.ts +17 -0
  106. package/src/utils/standaloneSchemas.ts +114 -0
  107. package/src/utils/standaloneTypes.ts +28 -0
  108. package/src/utils/standaloneZodSchemas.ts +72 -0
  109. package/src/utils/typeGeneration.ts +31 -0
  110. package/src/utils/typeGenerationPostProcess.ts +246 -0
  111. package/src/utils/typeGenerationPreflight.ts +119 -0
  112. package/src/utils/zodCodegen.ts +549 -0
@@ -0,0 +1,1670 @@
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][a-zA-Z0-9]*$",
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
+ "DocumentationSpec": {
46
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
47
+ "type": "object",
48
+ "allOf": [
49
+ {
50
+ "$ref": "#/$defs/NameFacet"
51
+ },
52
+ {
53
+ "type": "object",
54
+ "properties": {
55
+ "symbol": {
56
+ "type": "string"
57
+ }
58
+ }
59
+ },
60
+ {
61
+ "$ref": "#/$defs/DescriptionFacet"
62
+ }
63
+ ]
64
+ },
65
+ "JsonSchemaObject": {
66
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
67
+ "type": "object",
68
+ "required": [
69
+ "$schema"
70
+ ],
71
+ "properties": {
72
+ "$schema": {
73
+ "const": "https://json-schema.org/draft/2020-12/schema"
74
+ }
75
+ },
76
+ "additionalProperties": true
77
+ },
78
+ "TypeRef": {
79
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
80
+ "$comment": "A type reference is either resource-backed (resourceTypeHandle, strategy-legal) or schema-backed (roleSchema, internal/Core-only). The roleSchema branch holds an object whose $ref names the type parameter (e.g. '#OperandType'), matching an entry in the template's GenericAssignmentByRoleName.mapKeys. Exactly one branch must be present.",
81
+ "oneOf": [
82
+ {
83
+ "type": "object",
84
+ "required": [
85
+ "resourceTypeHandle"
86
+ ],
87
+ "properties": {
88
+ "resourceTypeHandle": {
89
+ "$ref": "#/$defs/ResourceTypeHandle"
90
+ }
91
+ },
92
+ "additionalProperties": false
93
+ },
94
+ {
95
+ "type": "object",
96
+ "required": [
97
+ "roleSchema"
98
+ ],
99
+ "properties": {
100
+ "roleSchema": {
101
+ "type": "object",
102
+ "required": [
103
+ "$ref"
104
+ ],
105
+ "$comment": "A reference to a named type parameter. The $ref value must be '#' followed by a RoleName, matching a key in the template's GenericAssignmentByRoleName.mapKeys.",
106
+ "properties": {
107
+ "$ref": {
108
+ "type": "string",
109
+ "pattern": "^#[A-Z][a-zA-Z0-9]*$"
110
+ }
111
+ },
112
+ "additionalProperties": false
113
+ }
114
+ },
115
+ "additionalProperties": false
116
+ }
117
+ ]
118
+ },
119
+ "Embedding": {
120
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
121
+ "type": "object",
122
+ "required": [
123
+ "embeddingToolHandle",
124
+ "targetResourcePointer",
125
+ "data"
126
+ ],
127
+ "properties": {
128
+ "embeddingToolHandle": {
129
+ "$ref": "#/$defs/ToolHandle"
130
+ },
131
+ "targetResourcePointer": {
132
+ "$ref": "#/$defs/ResourcePointer"
133
+ },
134
+ "data": {
135
+ "type": "array",
136
+ "items": {
137
+ "type": "number"
138
+ }
139
+ }
140
+ },
141
+ "unevaluatedProperties": false
142
+ },
143
+ "ResourceTypeHandle": {
144
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
145
+ "type": "string",
146
+ "pattern": "^TYPE-.+$"
147
+ },
148
+ "ResourceType": {
149
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
150
+ "type": "object",
151
+ "required": [
152
+ "handle"
153
+ ],
154
+ "properties": {
155
+ "handle": {
156
+ "$ref": "#/$defs/ResourceTypeHandle"
157
+ },
158
+ "valueSchema": {
159
+ "$ref": "#/$defs/JsonSchemaObject"
160
+ },
161
+ "parserToolHandle": {
162
+ "$ref": "#/$defs/ToolHandle"
163
+ },
164
+ "embeddingModelTools": {
165
+ "type": "array",
166
+ "items": {
167
+ "$ref": "#/$defs/ToolHandle"
168
+ },
169
+ "minItems": 1,
170
+ "$comment": "A ResourceType may specify a set of embeddingModelTools that convert the raw data (or one of its alternative representations) into vector embeddings. The build process enforces that the entries are members of a set of predefined embeddingModelTools."
171
+ }
172
+ },
173
+ "allOf": [
174
+ {
175
+ "$ref": "#/$defs/DocumentationSpec"
176
+ },
177
+ {
178
+ "$comment": "A ResourceType must specify either a valueSchema or a parserToolHandle, or both. If only a valueSchema is specified, the author assumes no burden of implementing a parser for the ResourceType. They can rely on the valueSchema for validation. If only a parserToolHandle is specified, the author assumes the burden of implementing a parser that can validate instances of the ResourceType. If both are specified, the author assumes the burden of implementing an augmented parser that also serves as a generator between the raw data and an instance of the valueSchema.",
179
+ "anyOf": [
180
+ {
181
+ "required": [
182
+ "valueSchema"
183
+ ]
184
+ },
185
+ {
186
+ "required": [
187
+ "parserToolHandle"
188
+ ]
189
+ }
190
+ ]
191
+ }
192
+ ],
193
+ "unevaluatedProperties": false
194
+ },
195
+ "RoleName": {
196
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
197
+ "$ref": "#/$defs/Name"
198
+ },
199
+ "ContainerKind": {
200
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
201
+ "type": "string",
202
+ "enum": [
203
+ "scalar",
204
+ "array",
205
+ "map"
206
+ ]
207
+ },
208
+ "RoleValue": {
209
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
210
+ "$comment": "Pairs a type reference (typeRef) with a container shape. typeRef is either resource-backed (resourceTypeHandle) or schema-backed (roleSchema).",
211
+ "type": "object",
212
+ "required": [
213
+ "typeRef",
214
+ "containerKind"
215
+ ],
216
+ "properties": {
217
+ "typeRef": {
218
+ "$ref": "#/$defs/TypeRef"
219
+ },
220
+ "refinementSchema": {
221
+ "$comment": "Allows Tool authors to specify additional constraints on the role value beyond those expressible in the type system.",
222
+ "$ref": "#/$defs/JsonSchemaObject"
223
+ },
224
+ "containerKind": {
225
+ "$ref": "#/$defs/ContainerKind"
226
+ },
227
+ "containerSchema": {
228
+ "$ref": "#/$defs/JsonSchemaObject"
229
+ },
230
+ "mapKeys": {
231
+ "$ref": "#/$defs/RoleNameArray"
232
+ }
233
+ },
234
+ "allOf": [
235
+ {
236
+ "$comment": "If containerKind is scalar, containerSchema is forbidden. Otherwise, it is optional.",
237
+ "if": {
238
+ "properties": {
239
+ "containerKind": {
240
+ "const": "scalar"
241
+ }
242
+ }
243
+ },
244
+ "then": {
245
+ "not": {
246
+ "required": [
247
+ "containerSchema"
248
+ ]
249
+ }
250
+ }
251
+ },
252
+ {
253
+ "$comment": "If containerKind is array and containerSchema is provided, it must describe a homogeneous array (type=array with items; tuple-only schemas are disallowed).",
254
+ "if": {
255
+ "required": [
256
+ "containerSchema"
257
+ ],
258
+ "properties": {
259
+ "containerKind": {
260
+ "const": "array"
261
+ }
262
+ }
263
+ },
264
+ "then": {
265
+ "properties": {
266
+ "containerSchema": {
267
+ "type": "object",
268
+ "required": [
269
+ "type",
270
+ "items"
271
+ ],
272
+ "properties": {
273
+ "type": {
274
+ "const": "array"
275
+ },
276
+ "items": {
277
+ "type": "object"
278
+ }
279
+ },
280
+ "not": {
281
+ "required": [
282
+ "prefixItems"
283
+ ]
284
+ }
285
+ }
286
+ }
287
+ }
288
+ },
289
+ {
290
+ "$comment": "If containerKind is map and containerSchema is provided, it must describe a homogeneous map (type=object with additionalProperties; key-specific schemas are disallowed).",
291
+ "if": {
292
+ "required": [
293
+ "containerSchema"
294
+ ],
295
+ "properties": {
296
+ "containerKind": {
297
+ "const": "map"
298
+ }
299
+ }
300
+ },
301
+ "then": {
302
+ "properties": {
303
+ "containerSchema": {
304
+ "type": "object",
305
+ "required": [
306
+ "type",
307
+ "additionalProperties"
308
+ ],
309
+ "properties": {
310
+ "type": {
311
+ "const": "object"
312
+ },
313
+ "additionalProperties": {
314
+ "type": "object"
315
+ }
316
+ },
317
+ "not": {
318
+ "anyOf": [
319
+ {
320
+ "required": [
321
+ "properties"
322
+ ]
323
+ },
324
+ {
325
+ "required": [
326
+ "patternProperties"
327
+ ]
328
+ }
329
+ ]
330
+ }
331
+ }
332
+ }
333
+ }
334
+ },
335
+ {
336
+ "$comment": "If containerKind is map, mapKeys is optional (omit for open/dynamic keys, supply for statically-known fixed keys). On non-map containers, mapKeys is forbidden.",
337
+ "if": {
338
+ "properties": {
339
+ "containerKind": {
340
+ "const": "map"
341
+ }
342
+ }
343
+ },
344
+ "then": {},
345
+ "else": {
346
+ "not": {
347
+ "required": [
348
+ "mapKeys"
349
+ ]
350
+ }
351
+ }
352
+ }
353
+ ],
354
+ "unevaluatedProperties": false
355
+ },
356
+ "RoleValueByName": {
357
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
358
+ "type": "object",
359
+ "propertyNames": {
360
+ "$ref": "#/$defs/RoleName"
361
+ },
362
+ "additionalProperties": {
363
+ "$ref": "#/$defs/RoleValue"
364
+ }
365
+ },
366
+ "RoleNameArray": {
367
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
368
+ "type": "array",
369
+ "items": {
370
+ "$ref": "#/$defs/RoleName"
371
+ }
372
+ },
373
+ "RoleSpec": {
374
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
375
+ "type": "object",
376
+ "required": [
377
+ "inputRoleValueByName",
378
+ "outputRoleValueByName"
379
+ ],
380
+ "properties": {
381
+ "inputRoleValueByName": {
382
+ "$ref": "#/$defs/RoleValueByName"
383
+ },
384
+ "outputRoleValueByName": {
385
+ "$ref": "#/$defs/RoleValueByName"
386
+ },
387
+ "refinementSchema": {
388
+ "$comment": "Allows Tool authors to specify additional constraints on the role assignment beyond those expressible in the type system.",
389
+ "$ref": "#/$defs/JsonSchemaObject"
390
+ }
391
+ },
392
+ "unevaluatedProperties": false
393
+ },
394
+ "RoleSpecFacet": {
395
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
396
+ "type": "object",
397
+ "required": [
398
+ "roleSpec"
399
+ ],
400
+ "properties": {
401
+ "roleSpec": {
402
+ "$ref": "#/$defs/RoleSpec"
403
+ }
404
+ }
405
+ },
406
+ "ToolHandle": {
407
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
408
+ "type": "string",
409
+ "pattern": "^TOOL-.+$"
410
+ },
411
+ "ToolKind": {
412
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
413
+ "type": "string",
414
+ "enum": [
415
+ "runtime",
416
+ "buildtime"
417
+ ]
418
+ },
419
+ "Tool": {
420
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
421
+ "type": "object",
422
+ "required": [
423
+ "handle",
424
+ "isTemplate"
425
+ ],
426
+ "properties": {
427
+ "handle": {
428
+ "$ref": "#/$defs/ToolHandle"
429
+ },
430
+ "isTemplate": {
431
+ "type": "boolean"
432
+ },
433
+ "templateToolHandle": {
434
+ "$ref": "#/$defs/ToolHandle"
435
+ },
436
+ "instantiationRoleSpec": {
437
+ "$ref": "#/$defs/RoleSpec"
438
+ }
439
+ },
440
+ "$comment": "Template Tools own dispatch contract: Core scans all instantiation Tools grouped by templateToolHandle, derives a specializationKey from each tool's generic role assignment (canonical order of genericRoleName -> resourceTypeHandle pairs), and asserts injectivity (no two instantiation Tools share the same key for the same template). At invocation time Core injects the specializationKey -> instantiationToolHandle lookup as the second input, then resolves the first input against it to return one instantiation Tool. Cross-resource compatibility between an instantiation Tool's roleSpec and the template's instantiationRoleSpec is deferred to the validation package.",
441
+ "semanticValidation": "Deferred: verify injectivity of specializationKey map per template; verify instantiation Tool roleSpec matches template instantiationRoleSpec; verify every supplied generic assignment key-set exactly equals roleSpec.inputRoleValueByName.GenericAssignmentByRoleName.mapKeys; verify every supplied generic assignment matches a registered specializationKey.",
442
+ "allOf": [
443
+ {
444
+ "$ref": "#/$defs/DocumentationSpec"
445
+ },
446
+ {
447
+ "if": {
448
+ "required": [
449
+ "isTemplate"
450
+ ],
451
+ "properties": {
452
+ "isTemplate": {
453
+ "const": true
454
+ }
455
+ }
456
+ },
457
+ "then": {
458
+ "required": [
459
+ "instantiationRoleSpec"
460
+ ]
461
+ },
462
+ "else": {
463
+ "not": {
464
+ "required": [
465
+ "instantiationRoleSpec"
466
+ ]
467
+ }
468
+ }
469
+ },
470
+ {
471
+ "$comment": "Template Tools must declare named roles: two map inputs (GenericAssignmentByRoleName and InstantiationToolHandleBySpecializationKey) and one scalar TYPE-Tool output (InstantiationTool). Runtime semantic validation enforces that invocation input keys for GenericAssignmentByRoleName exactly match this role's declared mapKeys.",
472
+ "if": {
473
+ "required": [
474
+ "isTemplate"
475
+ ],
476
+ "properties": {
477
+ "isTemplate": {
478
+ "const": true
479
+ }
480
+ }
481
+ },
482
+ "then": {
483
+ "properties": {
484
+ "roleSpec": {
485
+ "properties": {
486
+ "inputRoleValueByName": {
487
+ "required": [
488
+ "GenericAssignmentByRoleName",
489
+ "InstantiationToolHandleBySpecializationKey"
490
+ ],
491
+ "properties": {
492
+ "GenericAssignmentByRoleName": {
493
+ "required": [
494
+ "containerKind",
495
+ "typeRef",
496
+ "mapKeys"
497
+ ],
498
+ "properties": {
499
+ "containerKind": {
500
+ "const": "map"
501
+ },
502
+ "typeRef": {
503
+ "required": [
504
+ "resourceTypeHandle"
505
+ ],
506
+ "properties": {
507
+ "resourceTypeHandle": {
508
+ "const": "TYPE-ResourceType"
509
+ }
510
+ }
511
+ },
512
+ "mapKeys": {
513
+ "type": "array",
514
+ "items": {
515
+ "$ref": "#/$defs/RoleName"
516
+ },
517
+ "minItems": 1,
518
+ "uniqueItems": true
519
+ }
520
+ }
521
+ },
522
+ "InstantiationToolHandleBySpecializationKey": {
523
+ "required": [
524
+ "containerKind",
525
+ "typeRef"
526
+ ],
527
+ "properties": {
528
+ "containerKind": {
529
+ "const": "map"
530
+ },
531
+ "typeRef": {
532
+ "required": [
533
+ "resourceTypeHandle"
534
+ ],
535
+ "properties": {
536
+ "resourceTypeHandle": {
537
+ "const": "TYPE-Tool"
538
+ }
539
+ }
540
+ }
541
+ },
542
+ "not": {
543
+ "required": [
544
+ "mapKeys"
545
+ ]
546
+ }
547
+ }
548
+ },
549
+ "additionalProperties": false
550
+ },
551
+ "outputRoleValueByName": {
552
+ "required": [
553
+ "InstantiationTool"
554
+ ],
555
+ "properties": {
556
+ "InstantiationTool": {
557
+ "required": [
558
+ "containerKind",
559
+ "typeRef"
560
+ ],
561
+ "properties": {
562
+ "containerKind": {
563
+ "const": "scalar"
564
+ },
565
+ "typeRef": {
566
+ "required": [
567
+ "resourceTypeHandle"
568
+ ],
569
+ "properties": {
570
+ "resourceTypeHandle": {
571
+ "const": "TYPE-Tool"
572
+ }
573
+ }
574
+ }
575
+ }
576
+ }
577
+ },
578
+ "additionalProperties": false
579
+ }
580
+ }
581
+ }
582
+ }
583
+ }
584
+ },
585
+ {
586
+ "$ref": "#/$defs/RoleSpecFacet"
587
+ }
588
+ ],
589
+ "unevaluatedProperties": false
590
+ },
591
+ "RoleBindingSpec": {
592
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
593
+ "type": "object",
594
+ "required": [
595
+ "inputBindings",
596
+ "outputBindings"
597
+ ],
598
+ "properties": {
599
+ "inputBindings": {
600
+ "$ref": "#/$defs/RoleNameArray"
601
+ },
602
+ "outputBindings": {
603
+ "$ref": "#/$defs/RoleNameArray"
604
+ }
605
+ },
606
+ "unevaluatedProperties": false
607
+ },
608
+ "RoleBindingSpecFacet": {
609
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
610
+ "type": "object",
611
+ "required": [
612
+ "roleBindingSpec"
613
+ ],
614
+ "properties": {
615
+ "roleBindingSpec": {
616
+ "$ref": "#/$defs/RoleBindingSpec"
617
+ }
618
+ }
619
+ },
620
+ "StepKind": {
621
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
622
+ "type": "string",
623
+ "enum": [
624
+ "tool",
625
+ "branch",
626
+ "while",
627
+ "for"
628
+ ]
629
+ },
630
+ "StepKindFacet": {
631
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
632
+ "type": "object",
633
+ "required": [
634
+ "stepKind"
635
+ ],
636
+ "properties": {
637
+ "stepKind": {
638
+ "$ref": "#/$defs/StepKind"
639
+ }
640
+ }
641
+ },
642
+ "ToolStep": {
643
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
644
+ "type": "object",
645
+ "required": [
646
+ "stepKind",
647
+ "toolHandle"
648
+ ],
649
+ "properties": {
650
+ "stepKind": {
651
+ "const": "tool"
652
+ },
653
+ "toolHandle": {
654
+ "$ref": "#/$defs/ToolHandle"
655
+ }
656
+ },
657
+ "allOf": [
658
+ {
659
+ "$ref": "#/$defs/StepKindFacet"
660
+ },
661
+ {
662
+ "$comment": "This will be overlaid dynamically to specify roleBindingSpec corresponding to the roleSpec of the underlying tool.",
663
+ "$ref": "#/$defs/RoleBindingSpecFacet"
664
+ }
665
+ ]
666
+ },
667
+ "Case": {
668
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
669
+ "type": "object",
670
+ "required": [
671
+ "when",
672
+ "what"
673
+ ],
674
+ "properties": {
675
+ "when": {
676
+ "$ref": "#/$defs/ToolStep"
677
+ },
678
+ "what": {
679
+ "$ref": "#/$defs/ToolStep"
680
+ }
681
+ },
682
+ "unevaluatedProperties": false
683
+ },
684
+ "BranchStep": {
685
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
686
+ "type": "object",
687
+ "required": [
688
+ "stepKind",
689
+ "cases"
690
+ ],
691
+ "properties": {
692
+ "stepKind": {
693
+ "const": "branch"
694
+ },
695
+ "cases": {
696
+ "type": "array",
697
+ "items": {
698
+ "$ref": "#/$defs/Case"
699
+ },
700
+ "minItems": 1,
701
+ "uniqueItems": true
702
+ }
703
+ },
704
+ "allOf": [
705
+ {
706
+ "$ref": "#/$defs/StepKindFacet"
707
+ }
708
+ ]
709
+ },
710
+ "WhileStep": {
711
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
712
+ "type": "object",
713
+ "required": [
714
+ "stepKind",
715
+ "case"
716
+ ],
717
+ "properties": {
718
+ "stepKind": {
719
+ "const": "while"
720
+ },
721
+ "case": {
722
+ "$ref": "#/$defs/Case"
723
+ }
724
+ },
725
+ "allOf": [
726
+ {
727
+ "$ref": "#/$defs/StepKindFacet"
728
+ }
729
+ ]
730
+ },
731
+ "ForStep": {
732
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
733
+ "type": "object",
734
+ "required": [
735
+ "stepKind",
736
+ "case"
737
+ ],
738
+ "properties": {
739
+ "stepKind": {
740
+ "const": "for"
741
+ },
742
+ "case": {
743
+ "$ref": "#/$defs/Case"
744
+ }
745
+ },
746
+ "allOf": [
747
+ {
748
+ "$ref": "#/$defs/StepKindFacet"
749
+ }
750
+ ]
751
+ },
752
+ "Step": {
753
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
754
+ "type": "object",
755
+ "oneOf": [
756
+ {
757
+ "$ref": "#/$defs/ToolStep"
758
+ },
759
+ {
760
+ "$ref": "#/$defs/BranchStep"
761
+ },
762
+ {
763
+ "$ref": "#/$defs/WhileStep"
764
+ },
765
+ {
766
+ "$ref": "#/$defs/ForStep"
767
+ }
768
+ ],
769
+ "unevaluatedProperties": false
770
+ },
771
+ "OutputAddress": {
772
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
773
+ "type": "object",
774
+ "required": [
775
+ "roleName",
776
+ "toolStepPath"
777
+ ],
778
+ "properties": {
779
+ "roleName": {
780
+ "$ref": "#/$defs/RoleName"
781
+ },
782
+ "toolStepPath": {
783
+ "$ref": "#/$defs/ToolStepPath"
784
+ }
785
+ },
786
+ "unevaluatedProperties": false
787
+ },
788
+ "ProvenanceKind": {
789
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
790
+ "type": "string",
791
+ "enum": [
792
+ "genesis",
793
+ "strategy"
794
+ ]
795
+ },
796
+ "GenesisProvenance": {
797
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
798
+ "type": "object",
799
+ "required": [
800
+ "provenanceKind"
801
+ ],
802
+ "properties": {
803
+ "provenanceKind": {
804
+ "const": "genesis"
805
+ }
806
+ },
807
+ "unevaluatedProperties": false
808
+ },
809
+ "StrategyProvenance": {
810
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
811
+ "type": "object",
812
+ "required": [
813
+ "provenanceKind",
814
+ "strategyTraceHandle",
815
+ "outputAddress"
816
+ ],
817
+ "properties": {
818
+ "provenanceKind": {
819
+ "const": "strategy"
820
+ },
821
+ "strategyTraceHandle": {
822
+ "$ref": "#/$defs/StrategyTraceHandle"
823
+ },
824
+ "outputAddress": {
825
+ "$ref": "#/$defs/OutputAddress"
826
+ }
827
+ },
828
+ "unevaluatedProperties": false
829
+ },
830
+ "DeferredStrategyProvenance": {
831
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
832
+ "$comment": "Build-time strategy provenance without strategyTraceHandle. strategyTraceHandle is only known at runtime.",
833
+ "type": "object",
834
+ "required": [
835
+ "provenanceKind",
836
+ "outputAddress"
837
+ ],
838
+ "properties": {
839
+ "provenanceKind": {
840
+ "const": "strategy"
841
+ },
842
+ "outputAddress": {
843
+ "$ref": "#/$defs/OutputAddress"
844
+ }
845
+ },
846
+ "unevaluatedProperties": false
847
+ },
848
+ "Provenance": {
849
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
850
+ "oneOf": [
851
+ {
852
+ "$ref": "#/$defs/GenesisProvenance"
853
+ },
854
+ {
855
+ "$ref": "#/$defs/StrategyProvenance"
856
+ }
857
+ ]
858
+ },
859
+ "ProvenanceFacet": {
860
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
861
+ "type": "object",
862
+ "required": [
863
+ "provenance"
864
+ ],
865
+ "properties": {
866
+ "provenance": {
867
+ "$ref": "#/$defs/Provenance"
868
+ }
869
+ }
870
+ },
871
+ "ResourceId": {
872
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
873
+ "type": "string",
874
+ "pattern": "^RESOURCE-.+$"
875
+ },
876
+ "ResourcePointer": {
877
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
878
+ "type": "object",
879
+ "required": [
880
+ "id",
881
+ "resourceTypeHandle",
882
+ "version"
883
+ ],
884
+ "properties": {
885
+ "id": {
886
+ "$ref": "#/$defs/ResourceId"
887
+ },
888
+ "resourceTypeHandle": {
889
+ "$ref": "#/$defs/ResourceTypeHandle"
890
+ },
891
+ "version": {
892
+ "const": 1
893
+ }
894
+ },
895
+ "allOf": [
896
+ {
897
+ "$ref": "#/$defs/ProvenanceFacet"
898
+ }
899
+ ],
900
+ "unevaluatedProperties": false
901
+ },
902
+ "BaseResource": {
903
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
904
+ "type": "object",
905
+ "required": [
906
+ "value"
907
+ ],
908
+ "properties": {
909
+ "value": true
910
+ },
911
+ "$comment": "This will be overlaid dynamically to match the data structure of the underlying ResourceType's valueSchema.",
912
+ "allOf": [
913
+ {
914
+ "$ref": "#/$defs/ResourcePointer"
915
+ }
916
+ ]
917
+ },
918
+ "Resource": {
919
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
920
+ "type": "object",
921
+ "$ref": "#/$defs/BaseResource",
922
+ "unevaluatedProperties": false
923
+ },
924
+ "StrategyStateInputKind": {
925
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
926
+ "type": "string",
927
+ "enum": [
928
+ "inputResource",
929
+ "externalInputPotential",
930
+ "internalInputPotential"
931
+ ]
932
+ },
933
+ "InputResource": {
934
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
935
+ "type": "object",
936
+ "required": [
937
+ "strategyStateInputKind"
938
+ ],
939
+ "properties": {
940
+ "strategyStateInputKind": {
941
+ "const": "inputResource"
942
+ }
943
+ },
944
+ "allOf": [
945
+ {
946
+ "$ref": "#/$defs/BaseResource"
947
+ }
948
+ ],
949
+ "unevaluatedProperties": false
950
+ },
951
+ "ExternalInputPotential": {
952
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
953
+ "type": "object",
954
+ "required": [
955
+ "strategyStateInputKind",
956
+ "id",
957
+ "resourceTypeHandle"
958
+ ],
959
+ "properties": {
960
+ "strategyStateInputKind": {
961
+ "const": "externalInputPotential"
962
+ },
963
+ "id": {
964
+ "$ref": "#/$defs/ResourceId"
965
+ },
966
+ "resourceTypeHandle": {
967
+ "$ref": "#/$defs/ResourceTypeHandle"
968
+ }
969
+ },
970
+ "unevaluatedProperties": false
971
+ },
972
+ "InternalInputPotential": {
973
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
974
+ "type": "object",
975
+ "required": [
976
+ "strategyStateInputKind",
977
+ "id",
978
+ "resourceTypeHandle",
979
+ "provenance"
980
+ ],
981
+ "properties": {
982
+ "strategyStateInputKind": {
983
+ "const": "internalInputPotential"
984
+ },
985
+ "id": {
986
+ "$ref": "#/$defs/ResourceId"
987
+ },
988
+ "resourceTypeHandle": {
989
+ "$ref": "#/$defs/ResourceTypeHandle"
990
+ },
991
+ "provenance": {
992
+ "$ref": "#/$defs/DeferredStrategyProvenance"
993
+ }
994
+ },
995
+ "unevaluatedProperties": false
996
+ },
997
+ "InputPotential": {
998
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
999
+ "oneOf": [
1000
+ {
1001
+ "$ref": "#/$defs/ExternalInputPotential"
1002
+ },
1003
+ {
1004
+ "$ref": "#/$defs/InternalInputPotential"
1005
+ }
1006
+ ]
1007
+ },
1008
+ "StrategyStateInputEntry": {
1009
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
1010
+ "oneOf": [
1011
+ {
1012
+ "$ref": "#/$defs/InputPotential"
1013
+ },
1014
+ {
1015
+ "$ref": "#/$defs/InputResource"
1016
+ }
1017
+ ]
1018
+ },
1019
+ "StrategyStateInputEntryByRoleName": {
1020
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
1021
+ "type": "object",
1022
+ "propertyNames": {
1023
+ "$ref": "#/$defs/RoleName"
1024
+ },
1025
+ "additionalProperties": {
1026
+ "$ref": "#/$defs/StrategyStateInputEntry"
1027
+ }
1028
+ },
1029
+ "StepArray": {
1030
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
1031
+ "type": "array",
1032
+ "items": {
1033
+ "$ref": "#/$defs/Step"
1034
+ },
1035
+ "uniqueItems": true
1036
+ },
1037
+ "StepArrayArray": {
1038
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
1039
+ "type": "array",
1040
+ "items": {
1041
+ "$ref": "#/$defs/StepArray"
1042
+ }
1043
+ },
1044
+ "StepsFacet": {
1045
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
1046
+ "type": "object",
1047
+ "required": [
1048
+ "steps"
1049
+ ],
1050
+ "properties": {
1051
+ "steps": {
1052
+ "$ref": "#/$defs/StepArray"
1053
+ }
1054
+ }
1055
+ },
1056
+ "ToolStepPathSlot": {
1057
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
1058
+ "type": "string",
1059
+ "enum": [
1060
+ "self",
1061
+ "case.when",
1062
+ "case.what",
1063
+ "cases.when",
1064
+ "cases.what"
1065
+ ]
1066
+ },
1067
+ "ToolStepPathSlotFacet": {
1068
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
1069
+ "type": "object",
1070
+ "required": [
1071
+ "toolStepPathSlot"
1072
+ ],
1073
+ "properties": {
1074
+ "toolStepPathSlot": {
1075
+ "$ref": "#/$defs/ToolStepPathSlot"
1076
+ }
1077
+ }
1078
+ },
1079
+ "BaseToolStepPathSpec": {
1080
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
1081
+ "type": "object",
1082
+ "required": [
1083
+ "stepIndex",
1084
+ "toolStepPathSlot"
1085
+ ],
1086
+ "properties": {
1087
+ "stepIndex": {
1088
+ "$ref": "#/$defs/Natural"
1089
+ },
1090
+ "toolStepPathSlot": {
1091
+ "$ref": "#/$defs/ToolStepPathSlot"
1092
+ },
1093
+ "caseIndex": {
1094
+ "$ref": "#/$defs/Natural"
1095
+ }
1096
+ },
1097
+ "allOf": [
1098
+ {
1099
+ "if": {
1100
+ "properties": {
1101
+ "toolStepPathSlot": {
1102
+ "enum": [
1103
+ "cases.when",
1104
+ "cases.what"
1105
+ ]
1106
+ }
1107
+ }
1108
+ },
1109
+ "then": {
1110
+ "required": [
1111
+ "caseIndex"
1112
+ ]
1113
+ }
1114
+ },
1115
+ {
1116
+ "if": {
1117
+ "properties": {
1118
+ "toolStepPathSlot": {
1119
+ "enum": [
1120
+ "self",
1121
+ "case.when",
1122
+ "case.what"
1123
+ ]
1124
+ }
1125
+ }
1126
+ },
1127
+ "then": {
1128
+ "not": {
1129
+ "required": [
1130
+ "caseIndex"
1131
+ ]
1132
+ }
1133
+ }
1134
+ }
1135
+ ]
1136
+ },
1137
+ "UnthreadedToolStepPathSpec": {
1138
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
1139
+ "allOf": [
1140
+ {
1141
+ "$ref": "#/$defs/BaseToolStepPathSpec"
1142
+ }
1143
+ ],
1144
+ "unevaluatedProperties": false
1145
+ },
1146
+ "ThreadedToolStepPathSpec": {
1147
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
1148
+ "allOf": [
1149
+ {
1150
+ "$ref": "#/$defs/BaseToolStepPathSpec"
1151
+ },
1152
+ {
1153
+ "type": "object",
1154
+ "required": [
1155
+ "threadIndex"
1156
+ ],
1157
+ "properties": {
1158
+ "threadIndex": {
1159
+ "$ref": "#/$defs/Natural"
1160
+ }
1161
+ }
1162
+ }
1163
+ ],
1164
+ "unevaluatedProperties": false
1165
+ },
1166
+ "ToolStepPath": {
1167
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
1168
+ "oneOf": [
1169
+ {
1170
+ "$ref": "#/$defs/UnthreadedToolStepPath"
1171
+ },
1172
+ {
1173
+ "$ref": "#/$defs/ThreadedToolStepPath"
1174
+ }
1175
+ ]
1176
+ },
1177
+ "UnthreadedToolStepPath": {
1178
+ "type": "string",
1179
+ "pattern": "^/steps/[0-9]+/(self|case/when|case/what|cases/[0-9]+/when|cases/[0-9]+/what)$"
1180
+ },
1181
+ "ThreadedToolStepPath": {
1182
+ "type": "string",
1183
+ "pattern": "^/threads/[0-9]+/steps/[0-9]+/(self|case/when|case/what|cases/[0-9]+/when|cases/[0-9]+/what)$"
1184
+ },
1185
+ "UnthreadedStrategyState": {
1186
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
1187
+ "type": "object",
1188
+ "propertyNames": {
1189
+ "$ref": "#/$defs/UnthreadedToolStepPath"
1190
+ },
1191
+ "additionalProperties": {
1192
+ "$ref": "#/$defs/StrategyStateInputEntryByRoleName"
1193
+ }
1194
+ },
1195
+ "ThreadedStrategyState": {
1196
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
1197
+ "type": "object",
1198
+ "propertyNames": {
1199
+ "$ref": "#/$defs/ThreadedToolStepPath"
1200
+ },
1201
+ "additionalProperties": {
1202
+ "$ref": "#/$defs/StrategyStateInputEntryByRoleName"
1203
+ }
1204
+ },
1205
+ "UnthreadedStrategyStateFacet": {
1206
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
1207
+ "type": "object",
1208
+ "required": [
1209
+ "strategyState"
1210
+ ],
1211
+ "properties": {
1212
+ "strategyState": {
1213
+ "$ref": "#/$defs/UnthreadedStrategyState"
1214
+ }
1215
+ }
1216
+ },
1217
+ "ThreadedStrategyStateFacet": {
1218
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
1219
+ "type": "object",
1220
+ "required": [
1221
+ "strategyState"
1222
+ ],
1223
+ "properties": {
1224
+ "strategyState": {
1225
+ "$ref": "#/$defs/ThreadedStrategyState"
1226
+ }
1227
+ }
1228
+ },
1229
+ "StrategyKind": {
1230
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
1231
+ "type": "string",
1232
+ "enum": [
1233
+ "unthreaded",
1234
+ "threaded"
1235
+ ]
1236
+ },
1237
+ "StrategyHandle": {
1238
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
1239
+ "type": "string",
1240
+ "pattern": "^STRATEGY-.+$"
1241
+ },
1242
+ "BaseStrategy": {
1243
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
1244
+ "type": "object",
1245
+ "required": [
1246
+ "handle",
1247
+ "strategyKind"
1248
+ ],
1249
+ "properties": {
1250
+ "handle": {
1251
+ "$ref": "#/$defs/StrategyHandle"
1252
+ },
1253
+ "strategyKind": {
1254
+ "$ref": "#/$defs/StrategyKind"
1255
+ }
1256
+ }
1257
+ },
1258
+ "UnthreadedStrategy": {
1259
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
1260
+ "type": "object",
1261
+ "allOf": [
1262
+ {
1263
+ "$ref": "#/$defs/BaseStrategy"
1264
+ },
1265
+ {
1266
+ "type": "object",
1267
+ "properties": {
1268
+ "strategyKind": {
1269
+ "const": "unthreaded"
1270
+ }
1271
+ }
1272
+ },
1273
+ {
1274
+ "$ref": "#/$defs/StepsFacet"
1275
+ },
1276
+ {
1277
+ "$ref": "#/$defs/UnthreadedStrategyStateFacet"
1278
+ }
1279
+ ],
1280
+ "unevaluatedProperties": false
1281
+ },
1282
+ "ThreadedStrategy": {
1283
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
1284
+ "type": "object",
1285
+ "allOf": [
1286
+ {
1287
+ "$ref": "#/$defs/BaseStrategy"
1288
+ },
1289
+ {
1290
+ "type": "object",
1291
+ "properties": {
1292
+ "strategyKind": {
1293
+ "const": "threaded"
1294
+ }
1295
+ }
1296
+ },
1297
+ {
1298
+ "$ref": "#/$defs/StepsByThreadIndexFacet"
1299
+ },
1300
+ {
1301
+ "$ref": "#/$defs/ThreadedStrategyStateFacet"
1302
+ }
1303
+ ],
1304
+ "unevaluatedProperties": false
1305
+ },
1306
+ "Strategy": {
1307
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
1308
+ "oneOf": [
1309
+ {
1310
+ "$ref": "#/$defs/UnthreadedStrategy"
1311
+ },
1312
+ {
1313
+ "$ref": "#/$defs/ThreadedStrategy"
1314
+ }
1315
+ ]
1316
+ },
1317
+ "StepsByThreadIndexFacet": {
1318
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
1319
+ "type": "object",
1320
+ "required": [
1321
+ "stepsByThreadIndex"
1322
+ ],
1323
+ "properties": {
1324
+ "stepsByThreadIndex": {
1325
+ "$ref": "#/$defs/StepArrayArray"
1326
+ }
1327
+ }
1328
+ },
1329
+ "TracePointCounterSnapshot": {
1330
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
1331
+ "type": "object",
1332
+ "properties": {
1333
+ "stepCounterAfter": {
1334
+ "$ref": "#/$defs/Natural"
1335
+ },
1336
+ "iterationCounterAfter": {
1337
+ "$ref": "#/$defs/Natural"
1338
+ }
1339
+ }
1340
+ },
1341
+ "TracePointDelta": {
1342
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
1343
+ "type": "object",
1344
+ "properties": {
1345
+ "stepsMutation": {
1346
+ "type": "object",
1347
+ "required": [
1348
+ "insertAt",
1349
+ "insertedSteps"
1350
+ ],
1351
+ "properties": {
1352
+ "insertAt": {
1353
+ "$ref": "#/$defs/Natural"
1354
+ },
1355
+ "insertedSteps": {
1356
+ "$ref": "#/$defs/StepArray"
1357
+ }
1358
+ }
1359
+ },
1360
+ "strategyStateDelta": {
1361
+ "$ref": "#/$defs/ThreadedStrategyState"
1362
+ },
1363
+ "interruptData": {
1364
+ "$comment": "Kept permissive; the engine may evolve interrupt payloads.",
1365
+ "type": [
1366
+ "object",
1367
+ "null"
1368
+ ]
1369
+ }
1370
+ }
1371
+ },
1372
+ "TracePointKind": {
1373
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
1374
+ "type": "string",
1375
+ "enum": [
1376
+ "graph_start",
1377
+ "tick",
1378
+ "interrupt",
1379
+ "graph_end"
1380
+ ]
1381
+ },
1382
+ "BaseTracePoint": {
1383
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
1384
+ "type": "object",
1385
+ "required": [
1386
+ "tracePointKind",
1387
+ "strategyHandle",
1388
+ "threadIndex",
1389
+ "tracePointIndex"
1390
+ ],
1391
+ "properties": {
1392
+ "tracePointKind": {
1393
+ "$ref": "#/$defs/TracePointKind"
1394
+ },
1395
+ "strategyHandle": {
1396
+ "$ref": "#/$defs/StrategyHandle"
1397
+ },
1398
+ "threadIndex": {
1399
+ "$ref": "#/$defs/Natural"
1400
+ },
1401
+ "tracePointIndex": {
1402
+ "$ref": "#/$defs/Natural"
1403
+ }
1404
+ }
1405
+ },
1406
+ "ThreadedStrategyFacet": {
1407
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
1408
+ "type": "object",
1409
+ "required": [
1410
+ "threadedStrategy"
1411
+ ],
1412
+ "properties": {
1413
+ "threadedStrategy": {
1414
+ "$ref": "#/$defs/ThreadedStrategy"
1415
+ }
1416
+ }
1417
+ },
1418
+ "GraphStartTracePoint": {
1419
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
1420
+ "allOf": [
1421
+ {
1422
+ "$ref": "#/$defs/BaseTracePoint"
1423
+ },
1424
+ {
1425
+ "type": "object",
1426
+ "properties": {
1427
+ "tracePointKind": {
1428
+ "const": "graph_start"
1429
+ }
1430
+ }
1431
+ },
1432
+ {
1433
+ "$ref": "#/$defs/ThreadedStrategyFacet"
1434
+ }
1435
+ ]
1436
+ },
1437
+ "TickTracePoint": {
1438
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
1439
+ "allOf": [
1440
+ {
1441
+ "$ref": "#/$defs/BaseTracePoint"
1442
+ },
1443
+ {
1444
+ "type": "object",
1445
+ "required": [
1446
+ "counterSnapshot",
1447
+ "toolStepPath",
1448
+ "delta"
1449
+ ],
1450
+ "properties": {
1451
+ "tracePointKind": {
1452
+ "const": "tick"
1453
+ },
1454
+ "counterSnapshot": {
1455
+ "$ref": "#/$defs/TracePointCounterSnapshot"
1456
+ },
1457
+ "toolStepPath": {
1458
+ "$ref": "#/$defs/ThreadedToolStepPath"
1459
+ },
1460
+ "delta": {
1461
+ "$ref": "#/$defs/TracePointDelta"
1462
+ }
1463
+ }
1464
+ }
1465
+ ]
1466
+ },
1467
+ "InterruptTracePoint": {
1468
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
1469
+ "allOf": [
1470
+ {
1471
+ "$ref": "#/$defs/BaseTracePoint"
1472
+ },
1473
+ {
1474
+ "type": "object",
1475
+ "required": [
1476
+ "counterSnapshot",
1477
+ "toolStepPath",
1478
+ "delta"
1479
+ ],
1480
+ "properties": {
1481
+ "tracePointKind": {
1482
+ "const": "interrupt"
1483
+ },
1484
+ "counterSnapshot": {
1485
+ "$ref": "#/$defs/TracePointCounterSnapshot"
1486
+ },
1487
+ "toolStepPath": {
1488
+ "$ref": "#/$defs/ThreadedToolStepPath"
1489
+ },
1490
+ "delta": {
1491
+ "allOf": [
1492
+ {
1493
+ "$ref": "#/$defs/TracePointDelta"
1494
+ },
1495
+ {
1496
+ "type": "object",
1497
+ "required": [
1498
+ "interruptData"
1499
+ ],
1500
+ "properties": {
1501
+ "interruptData": {
1502
+ "$comment": "Interrupt events must include a non-null interrupt payload.",
1503
+ "type": "object"
1504
+ }
1505
+ }
1506
+ }
1507
+ ]
1508
+ }
1509
+ }
1510
+ }
1511
+ ]
1512
+ },
1513
+ "GraphEndTracePoint": {
1514
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
1515
+ "allOf": [
1516
+ {
1517
+ "$ref": "#/$defs/BaseTracePoint"
1518
+ },
1519
+ {
1520
+ "type": "object",
1521
+ "properties": {
1522
+ "tracePointKind": {
1523
+ "const": "graph_end"
1524
+ }
1525
+ }
1526
+ }
1527
+ ]
1528
+ },
1529
+ "TracePoint": {
1530
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
1531
+ "type": "object",
1532
+ "oneOf": [
1533
+ {
1534
+ "$ref": "#/$defs/GraphStartTracePoint"
1535
+ },
1536
+ {
1537
+ "$ref": "#/$defs/TickTracePoint"
1538
+ },
1539
+ {
1540
+ "$ref": "#/$defs/InterruptTracePoint"
1541
+ },
1542
+ {
1543
+ "$ref": "#/$defs/GraphEndTracePoint"
1544
+ }
1545
+ ]
1546
+ },
1547
+ "StrategyTraceHandle": {
1548
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
1549
+ "type": "string",
1550
+ "pattern": "^STRATEGY_TRACE-.+$"
1551
+ },
1552
+ "StrategyTrace": {
1553
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
1554
+ "type": "object",
1555
+ "required": [
1556
+ "handle",
1557
+ "strategyHandle",
1558
+ "tracePoints"
1559
+ ],
1560
+ "properties": {
1561
+ "handle": {
1562
+ "$ref": "#/$defs/StrategyTraceHandle"
1563
+ },
1564
+ "strategyHandle": {
1565
+ "$comment": "Could be derived from the first event but useful for indexing.",
1566
+ "$ref": "#/$defs/StrategyHandle"
1567
+ },
1568
+ "tracePoints": {
1569
+ "type": "array",
1570
+ "items": {
1571
+ "$ref": "#/$defs/TracePoint"
1572
+ }
1573
+ }
1574
+ },
1575
+ "unevaluatedProperties": false
1576
+ },
1577
+ "GoalHandle": {
1578
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
1579
+ "type": "string",
1580
+ "pattern": "^GOAL-.+$"
1581
+ },
1582
+ "Goal": {
1583
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
1584
+ "type": "object",
1585
+ "required": [
1586
+ "handle",
1587
+ "target"
1588
+ ],
1589
+ "properties": {
1590
+ "handle": {
1591
+ "$ref": "#/$defs/GoalHandle"
1592
+ },
1593
+ "target": {
1594
+ "type": "integer",
1595
+ "minimum": 0
1596
+ },
1597
+ "disallowedTools": {
1598
+ "type": "array",
1599
+ "items": {
1600
+ "$ref": "#/$defs/ToolHandle"
1601
+ }
1602
+ },
1603
+ "disallowedSequences": {
1604
+ "type": "array",
1605
+ "items": {
1606
+ "type": "array",
1607
+ "items": {
1608
+ "$ref": "#/$defs/ToolHandle"
1609
+ }
1610
+ }
1611
+ },
1612
+ "minSteps": {
1613
+ "type": "integer",
1614
+ "minimum": 1
1615
+ },
1616
+ "maxSteps": {
1617
+ "type": "integer",
1618
+ "minimum": 1
1619
+ }
1620
+ },
1621
+ "unevaluatedProperties": false
1622
+ },
1623
+ "Error": {
1624
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
1625
+ "type": "object",
1626
+ "allOf": [
1627
+ {
1628
+ "$ref": "#/$defs/DocumentationSpec"
1629
+ },
1630
+ {
1631
+ "properties": {
1632
+ "details": {
1633
+ "type": "object"
1634
+ }
1635
+ }
1636
+ }
1637
+ ],
1638
+ "unevaluatedProperties": false
1639
+ },
1640
+ "Natural": {
1641
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
1642
+ "type": "integer",
1643
+ "minimum": 0
1644
+ },
1645
+ "Boolean": {
1646
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
1647
+ "type": "boolean"
1648
+ },
1649
+ "TimestampedResource": {
1650
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
1651
+ "type": "object",
1652
+ "required": [
1653
+ "timestamp"
1654
+ ],
1655
+ "properties": {
1656
+ "timestamp": {
1657
+ "type": "string",
1658
+ "format": "date-time",
1659
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$"
1660
+ }
1661
+ },
1662
+ "allOf": [
1663
+ {
1664
+ "$ref": "#/$defs/Resource"
1665
+ }
1666
+ ],
1667
+ "unevaluatedProperties": false
1668
+ }
1669
+ }
1670
+ }