@toolproof-core/genesis 1.0.48 → 1.0.50

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