@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.
- package/dist/src/implementations/tools.d.ts +100 -0
- package/dist/src/implementations/tools.js +135 -0
- package/dist/src/index.d.ts +9 -8
- package/dist/src/index.js +4 -3
- package/dist/src/utils/resourceTypes.d.ts +2 -1
- package/dist/src/utils/resourceTypes.js +22 -6
- package/dist/src/utils/schemaRefNormalization.js +3 -3
- package/dist/src/utils/standaloneTypes.js +2 -2
- package/dist/src/utils/timestampedResources.d.ts +16 -0
- package/dist/src/utils/timestampedResources.js +17 -0
- package/dist/src/utils/typeGenerationPostProcess.js +2 -2
- package/dist/src/utils/zodCodegen.js +3 -3
- package/generated-src/declarations/booleans.json +4 -0
- package/generated-src/declarations/booleans.ts +2 -0
- package/generated-src/declarations/naturals.json +13 -0
- package/generated-src/declarations/naturals.ts +2 -0
- package/generated-src/{resourceTypes → declarations}/resourceTypes.json +176 -39
- package/generated-src/declarations/resourceTypes.ts +2 -0
- package/generated-src/declarations/tools.json +705 -0
- package/generated-src/declarations/tools.ts +2 -0
- package/generated-src/implementations/tools.ts +214 -0
- package/generated-src/{derived → lookups}/constants.ts +4 -5
- package/generated-src/metadata/Core.json +51 -114
- package/generated-src/metadata/dependencyMap.json +16 -2
- package/generated-src/metadata/terminals.json +3 -4
- package/generated-src/schemas/schemas.json +198 -29
- package/generated-src/schemas/standalone/Resource.json +4 -8
- package/generated-src/schemas/standalone/ResourceType.json +21 -5
- package/generated-src/schemas/standalone/Strategy.json +4 -8
- package/generated-src/schemas/standalone/StrategyTrace.json +4 -8
- package/generated-src/schemas/standalone/Suite.json +646 -0
- package/generated-src/schemas/standalone/Suite.ts +2 -0
- package/generated-src/schemas/standalone/Tool.json +48 -23
- package/generated-src/schemas/zod/Resource.ts +2 -2
- package/generated-src/schemas/zod/ResourceType.ts +1 -1
- package/generated-src/schemas/zod/Strategy.ts +3 -3
- package/generated-src/schemas/zod/StrategyTrace.ts +3 -3
- package/generated-src/schemas/zod/Suite.ts +44 -0
- package/generated-src/schemas/zod/Tool.ts +7 -2
- package/generated-src/schemas/zod/index.ts +1 -0
- package/{src/genesis/resources → generated-src/timestampedResources}/booleans.json +19 -23
- package/generated-src/timestampedResources/booleans.ts +2 -0
- package/{src/genesis/resources → generated-src/timestampedResources}/naturals.json +100 -111
- package/generated-src/timestampedResources/naturals.ts +2 -0
- package/generated-src/{resources → timestampedResources}/resourceTypes.json +202 -66
- package/generated-src/timestampedResources/resourceTypes.ts +2 -0
- package/{src/genesis/resources → generated-src/timestampedResources}/tools.json +824 -839
- package/generated-src/timestampedResources/tools.ts +2 -0
- package/generated-src/types/standalone/BooleanResource.d.ts +2 -2
- package/generated-src/types/standalone/ErrorResource.d.ts +2 -2
- package/generated-src/types/standalone/GoalResource.d.ts +2 -2
- package/generated-src/types/standalone/NaturalResource.d.ts +2 -2
- package/generated-src/types/standalone/ResourceResource.d.ts +2 -2
- package/generated-src/types/standalone/ResourceTypeResource.d.ts +2 -2
- package/generated-src/types/standalone/StrategyResource.d.ts +2 -2
- package/generated-src/types/standalone/StrategyTraceResource.d.ts +2 -2
- package/generated-src/types/standalone/SuiteResource.d.ts +3 -0
- package/generated-src/types/standalone/SuiteResource.js +1 -0
- package/generated-src/types/standalone/ToolResource.d.ts +2 -2
- package/generated-src/types/types.d.ts +57 -14
- package/package.json +18 -13
- package/src/declarations/booleans.json +4 -0
- package/src/declarations/naturals.json +13 -0
- package/src/{genesis → declarations/resourceTypes}/resourceTypeShells.json +52 -46
- package/src/{genesis → declarations/resourceTypes}/schemas.json +1838 -1669
- package/src/declarations/tools.json +705 -0
- package/src/implementations/tools.ts +214 -0
- package/src/index.ts +131 -27
- package/src/utils/constantsAndMappings.ts +194 -194
- package/src/utils/coreProjection.ts +52 -52
- package/src/utils/resourceTypes.ts +70 -38
- package/src/utils/schemaDependencies.ts +114 -114
- package/src/utils/schemaObjectNormalization.ts +70 -70
- package/src/utils/schemaRefNormalization.ts +82 -82
- package/src/utils/schemaShims.ts +16 -16
- package/src/utils/standaloneSchemas.ts +113 -113
- package/src/utils/standaloneTypes.ts +27 -27
- package/src/utils/standaloneZodSchemas.ts +71 -71
- package/src/utils/timestampedResources.ts +42 -0
- package/src/utils/typeGeneration.ts +30 -30
- package/src/utils/typeGenerationPostProcess.ts +245 -245
- package/src/utils/typeGenerationPreflight.ts +118 -118
- package/src/utils/zodCodegen.ts +548 -548
- package/toolproof.json +19 -0
- package/dist/src/genesis/resources/implementations/foo.d.ts +0 -1
- package/dist/src/genesis/resources/implementations/foo.js +0 -184
- package/dist/src/utils/resources.d.ts +0 -5
- package/dist/src/utils/resources.js +0 -17
- package/generated-src/resourceTypes/resourceTypes.ts +0 -2
- package/generated-src/resources/resourceTypes.ts +0 -2
- package/src/genesis/resources/implementations/foo.ts +0 -183
- package/src/utils/resources.ts +0 -26
- /package/generated-src/{derived → lookups}/mappings.ts +0 -0
|
@@ -75,9 +75,9 @@
|
|
|
75
75
|
},
|
|
76
76
|
"additionalProperties": true
|
|
77
77
|
},
|
|
78
|
-
"
|
|
78
|
+
"AtomicTypeRef": {
|
|
79
79
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
80
|
-
"$comment": "
|
|
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
81
|
"oneOf": [
|
|
82
82
|
{
|
|
83
83
|
"type": "object",
|
|
@@ -116,6 +116,31 @@
|
|
|
116
116
|
}
|
|
117
117
|
]
|
|
118
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": "#/$defs/AtomicTypeRef"
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
"type": "object",
|
|
127
|
+
"required": [
|
|
128
|
+
"oneOfTypeRefs"
|
|
129
|
+
],
|
|
130
|
+
"properties": {
|
|
131
|
+
"oneOfTypeRefs": {
|
|
132
|
+
"type": "array",
|
|
133
|
+
"items": {
|
|
134
|
+
"$ref": "#/$defs/AtomicTypeRef"
|
|
135
|
+
},
|
|
136
|
+
"minItems": 2,
|
|
137
|
+
"uniqueItems": true
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
"additionalProperties": false
|
|
141
|
+
}
|
|
142
|
+
]
|
|
143
|
+
},
|
|
119
144
|
"Embedding": {
|
|
120
145
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
121
146
|
"type": "object",
|
|
@@ -151,16 +176,20 @@
|
|
|
151
176
|
"required": [
|
|
152
177
|
"handle"
|
|
153
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.",
|
|
154
180
|
"properties": {
|
|
155
181
|
"handle": {
|
|
156
182
|
"$ref": "#/$defs/ResourceTypeHandle"
|
|
157
183
|
},
|
|
158
|
-
"
|
|
184
|
+
"projectionSchema": {
|
|
159
185
|
"$ref": "#/$defs/JsonSchemaObject"
|
|
160
186
|
},
|
|
161
|
-
"
|
|
187
|
+
"ingestorToolHandle": {
|
|
162
188
|
"$ref": "#/$defs/ToolHandle"
|
|
163
189
|
},
|
|
190
|
+
"ingestorToolInputSchema": {
|
|
191
|
+
"$ref": "#/$defs/JsonSchemaObject"
|
|
192
|
+
},
|
|
164
193
|
"embeddingModelTools": {
|
|
165
194
|
"type": "array",
|
|
166
195
|
"items": {
|
|
@@ -175,19 +204,31 @@
|
|
|
175
204
|
"$ref": "#/$defs/DocumentationSpec"
|
|
176
205
|
},
|
|
177
206
|
{
|
|
178
|
-
"$comment": "A ResourceType
|
|
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.",
|
|
179
208
|
"anyOf": [
|
|
180
209
|
{
|
|
181
210
|
"required": [
|
|
182
|
-
"
|
|
211
|
+
"projectionSchema"
|
|
183
212
|
]
|
|
184
213
|
},
|
|
185
214
|
{
|
|
186
215
|
"required": [
|
|
187
|
-
"
|
|
216
|
+
"ingestorToolHandle"
|
|
188
217
|
]
|
|
189
218
|
}
|
|
190
219
|
]
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
"if": {
|
|
223
|
+
"required": [
|
|
224
|
+
"ingestorToolInputSchema"
|
|
225
|
+
]
|
|
226
|
+
},
|
|
227
|
+
"then": {
|
|
228
|
+
"required": [
|
|
229
|
+
"ingestorToolHandle"
|
|
230
|
+
]
|
|
231
|
+
}
|
|
191
232
|
}
|
|
192
233
|
],
|
|
193
234
|
"unevaluatedProperties": false
|
|
@@ -207,7 +248,7 @@
|
|
|
207
248
|
},
|
|
208
249
|
"RoleValue": {
|
|
209
250
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
210
|
-
"$comment": "Pairs a type reference (typeRef) with a container shape. typeRef
|
|
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.",
|
|
211
252
|
"type": "object",
|
|
212
253
|
"required": [
|
|
213
254
|
"typeRef",
|
|
@@ -408,14 +449,6 @@
|
|
|
408
449
|
"type": "string",
|
|
409
450
|
"pattern": "^TOOL-.+$"
|
|
410
451
|
},
|
|
411
|
-
"ToolKind": {
|
|
412
|
-
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
413
|
-
"type": "string",
|
|
414
|
-
"enum": [
|
|
415
|
-
"runtime",
|
|
416
|
-
"buildtime"
|
|
417
|
-
]
|
|
418
|
-
},
|
|
419
452
|
"Tool": {
|
|
420
453
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
421
454
|
"type": "object",
|
|
@@ -427,17 +460,17 @@
|
|
|
427
460
|
"handle": {
|
|
428
461
|
"$ref": "#/$defs/ToolHandle"
|
|
429
462
|
},
|
|
430
|
-
"isTemplate": {
|
|
431
|
-
"type": "boolean"
|
|
432
|
-
},
|
|
433
463
|
"templateToolHandle": {
|
|
434
464
|
"$ref": "#/$defs/ToolHandle"
|
|
435
465
|
},
|
|
466
|
+
"isTemplate": {
|
|
467
|
+
"type": "boolean"
|
|
468
|
+
},
|
|
436
469
|
"instantiationRoleSpec": {
|
|
437
470
|
"$ref": "#/$defs/RoleSpec"
|
|
438
471
|
}
|
|
439
472
|
},
|
|
440
|
-
"$comment": "Template Tools own dispatch contract: Core scans all instantiation Tools grouped by templateToolHandle, derives a specializationKey from each tool's generic
|
|
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.",
|
|
441
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.",
|
|
442
475
|
"allOf": [
|
|
443
476
|
{
|
|
@@ -468,7 +501,7 @@
|
|
|
468
501
|
}
|
|
469
502
|
},
|
|
470
503
|
{
|
|
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
|
|
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.",
|
|
472
505
|
"if": {
|
|
473
506
|
"required": [
|
|
474
507
|
"isTemplate"
|
|
@@ -878,8 +911,7 @@
|
|
|
878
911
|
"type": "object",
|
|
879
912
|
"required": [
|
|
880
913
|
"id",
|
|
881
|
-
"resourceTypeHandle"
|
|
882
|
-
"version"
|
|
914
|
+
"resourceTypeHandle"
|
|
883
915
|
],
|
|
884
916
|
"properties": {
|
|
885
917
|
"id": {
|
|
@@ -887,9 +919,6 @@
|
|
|
887
919
|
},
|
|
888
920
|
"resourceTypeHandle": {
|
|
889
921
|
"$ref": "#/$defs/ResourceTypeHandle"
|
|
890
|
-
},
|
|
891
|
-
"version": {
|
|
892
|
-
"const": 1
|
|
893
922
|
}
|
|
894
923
|
},
|
|
895
924
|
"allOf": [
|
|
@@ -903,12 +932,12 @@
|
|
|
903
932
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
904
933
|
"type": "object",
|
|
905
934
|
"required": [
|
|
906
|
-
"
|
|
935
|
+
"projection"
|
|
907
936
|
],
|
|
908
937
|
"properties": {
|
|
909
|
-
"
|
|
938
|
+
"projection": true
|
|
910
939
|
},
|
|
911
|
-
"$comment": "This will be overlaid dynamically to match the data structure of the underlying ResourceType's
|
|
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.",
|
|
912
941
|
"allOf": [
|
|
913
942
|
{
|
|
914
943
|
"$ref": "#/$defs/ResourcePointer"
|
|
@@ -1665,6 +1694,146 @@
|
|
|
1665
1694
|
}
|
|
1666
1695
|
],
|
|
1667
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": "#/$defs/Name"
|
|
1736
|
+
},
|
|
1737
|
+
"version": {
|
|
1738
|
+
"type": "string",
|
|
1739
|
+
"minLength": 1
|
|
1740
|
+
},
|
|
1741
|
+
"description": {
|
|
1742
|
+
"$ref": "#/$defs/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": "#/$defs/ResourceType"
|
|
1757
|
+
},
|
|
1758
|
+
"uniqueItems": true
|
|
1759
|
+
},
|
|
1760
|
+
"tools": {
|
|
1761
|
+
"type": "array",
|
|
1762
|
+
"items": {
|
|
1763
|
+
"$ref": "#/$defs/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": "#/$defs/Name"
|
|
1788
|
+
},
|
|
1789
|
+
{
|
|
1790
|
+
"$ref": "#/$defs/JsonScalarLink"
|
|
1791
|
+
}
|
|
1792
|
+
]
|
|
1793
|
+
},
|
|
1794
|
+
"version": {
|
|
1795
|
+
"oneOf": [
|
|
1796
|
+
{
|
|
1797
|
+
"type": "string",
|
|
1798
|
+
"minLength": 1
|
|
1799
|
+
},
|
|
1800
|
+
{
|
|
1801
|
+
"$ref": "#/$defs/JsonScalarLink"
|
|
1802
|
+
}
|
|
1803
|
+
]
|
|
1804
|
+
},
|
|
1805
|
+
"description": {
|
|
1806
|
+
"oneOf": [
|
|
1807
|
+
{
|
|
1808
|
+
"$ref": "#/$defs/Description"
|
|
1809
|
+
},
|
|
1810
|
+
{
|
|
1811
|
+
"$ref": "#/$defs/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
|
|
1668
1837
|
}
|
|
1669
1838
|
}
|
|
1670
1839
|
}
|
|
@@ -8,12 +8,12 @@
|
|
|
8
8
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
9
9
|
"type": "object",
|
|
10
10
|
"required": [
|
|
11
|
-
"
|
|
11
|
+
"projection"
|
|
12
12
|
],
|
|
13
13
|
"properties": {
|
|
14
|
-
"
|
|
14
|
+
"projection": true
|
|
15
15
|
},
|
|
16
|
-
"$comment": "This will be overlaid dynamically to match the data structure of the underlying ResourceType's
|
|
16
|
+
"$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.",
|
|
17
17
|
"allOf": [
|
|
18
18
|
{
|
|
19
19
|
"$ref": "#/$defs/ResourcePointer"
|
|
@@ -25,8 +25,7 @@
|
|
|
25
25
|
"type": "object",
|
|
26
26
|
"required": [
|
|
27
27
|
"id",
|
|
28
|
-
"resourceTypeHandle"
|
|
29
|
-
"version"
|
|
28
|
+
"resourceTypeHandle"
|
|
30
29
|
],
|
|
31
30
|
"properties": {
|
|
32
31
|
"id": {
|
|
@@ -34,9 +33,6 @@
|
|
|
34
33
|
},
|
|
35
34
|
"resourceTypeHandle": {
|
|
36
35
|
"$ref": "#/$defs/ResourceTypeHandle"
|
|
37
|
-
},
|
|
38
|
-
"version": {
|
|
39
|
-
"const": 1
|
|
40
36
|
}
|
|
41
37
|
},
|
|
42
38
|
"allOf": [
|
|
@@ -4,16 +4,20 @@
|
|
|
4
4
|
"required": [
|
|
5
5
|
"handle"
|
|
6
6
|
],
|
|
7
|
+
"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.",
|
|
7
8
|
"properties": {
|
|
8
9
|
"handle": {
|
|
9
10
|
"$ref": "#/$defs/ResourceTypeHandle"
|
|
10
11
|
},
|
|
11
|
-
"
|
|
12
|
+
"projectionSchema": {
|
|
12
13
|
"$ref": "#/$defs/JsonSchemaObject"
|
|
13
14
|
},
|
|
14
|
-
"
|
|
15
|
+
"ingestorToolHandle": {
|
|
15
16
|
"$ref": "#/$defs/ToolHandle"
|
|
16
17
|
},
|
|
18
|
+
"ingestorToolInputSchema": {
|
|
19
|
+
"$ref": "#/$defs/JsonSchemaObject"
|
|
20
|
+
},
|
|
17
21
|
"embeddingModelTools": {
|
|
18
22
|
"type": "array",
|
|
19
23
|
"items": {
|
|
@@ -28,19 +32,31 @@
|
|
|
28
32
|
"$ref": "#/$defs/DocumentationSpec"
|
|
29
33
|
},
|
|
30
34
|
{
|
|
31
|
-
"$comment": "A ResourceType
|
|
35
|
+
"$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.",
|
|
32
36
|
"anyOf": [
|
|
33
37
|
{
|
|
34
38
|
"required": [
|
|
35
|
-
"
|
|
39
|
+
"projectionSchema"
|
|
36
40
|
]
|
|
37
41
|
},
|
|
38
42
|
{
|
|
39
43
|
"required": [
|
|
40
|
-
"
|
|
44
|
+
"ingestorToolHandle"
|
|
41
45
|
]
|
|
42
46
|
}
|
|
43
47
|
]
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"if": {
|
|
51
|
+
"required": [
|
|
52
|
+
"ingestorToolInputSchema"
|
|
53
|
+
]
|
|
54
|
+
},
|
|
55
|
+
"then": {
|
|
56
|
+
"required": [
|
|
57
|
+
"ingestorToolHandle"
|
|
58
|
+
]
|
|
59
|
+
}
|
|
44
60
|
}
|
|
45
61
|
],
|
|
46
62
|
"unevaluatedProperties": false,
|
|
@@ -474,12 +474,12 @@
|
|
|
474
474
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
475
475
|
"type": "object",
|
|
476
476
|
"required": [
|
|
477
|
-
"
|
|
477
|
+
"projection"
|
|
478
478
|
],
|
|
479
479
|
"properties": {
|
|
480
|
-
"
|
|
480
|
+
"projection": true
|
|
481
481
|
},
|
|
482
|
-
"$comment": "This will be overlaid dynamically to match the data structure of the underlying ResourceType's
|
|
482
|
+
"$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.",
|
|
483
483
|
"allOf": [
|
|
484
484
|
{
|
|
485
485
|
"$ref": "#/$defs/ResourcePointer"
|
|
@@ -526,8 +526,7 @@
|
|
|
526
526
|
"type": "object",
|
|
527
527
|
"required": [
|
|
528
528
|
"id",
|
|
529
|
-
"resourceTypeHandle"
|
|
530
|
-
"version"
|
|
529
|
+
"resourceTypeHandle"
|
|
531
530
|
],
|
|
532
531
|
"properties": {
|
|
533
532
|
"id": {
|
|
@@ -535,9 +534,6 @@
|
|
|
535
534
|
},
|
|
536
535
|
"resourceTypeHandle": {
|
|
537
536
|
"$ref": "#/$defs/ResourceTypeHandle"
|
|
538
|
-
},
|
|
539
|
-
"version": {
|
|
540
|
-
"const": 1
|
|
541
537
|
}
|
|
542
538
|
},
|
|
543
539
|
"allOf": [
|
|
@@ -654,12 +654,12 @@
|
|
|
654
654
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
655
655
|
"type": "object",
|
|
656
656
|
"required": [
|
|
657
|
-
"
|
|
657
|
+
"projection"
|
|
658
658
|
],
|
|
659
659
|
"properties": {
|
|
660
|
-
"
|
|
660
|
+
"projection": true
|
|
661
661
|
},
|
|
662
|
-
"$comment": "This will be overlaid dynamically to match the data structure of the underlying ResourceType's
|
|
662
|
+
"$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.",
|
|
663
663
|
"allOf": [
|
|
664
664
|
{
|
|
665
665
|
"$ref": "#/$defs/ResourcePointer"
|
|
@@ -706,8 +706,7 @@
|
|
|
706
706
|
"type": "object",
|
|
707
707
|
"required": [
|
|
708
708
|
"id",
|
|
709
|
-
"resourceTypeHandle"
|
|
710
|
-
"version"
|
|
709
|
+
"resourceTypeHandle"
|
|
711
710
|
],
|
|
712
711
|
"properties": {
|
|
713
712
|
"id": {
|
|
@@ -715,9 +714,6 @@
|
|
|
715
714
|
},
|
|
716
715
|
"resourceTypeHandle": {
|
|
717
716
|
"$ref": "#/$defs/ResourceTypeHandle"
|
|
718
|
-
},
|
|
719
|
-
"version": {
|
|
720
|
-
"const": 1
|
|
721
717
|
}
|
|
722
718
|
},
|
|
723
719
|
"allOf": [
|