@aikdna/kdna-core 0.17.0 → 0.19.0
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/CHANGELOG.md +227 -64
- package/README.md +114 -77
- package/package.json +8 -2
- package/schema/agent-host-capabilities.schema.json +62 -0
- package/schema/agent-host-receipt.schema.json +371 -0
- package/schema/agent-host-request.schema.json +223 -0
- package/schema/{bundle-profile-v1.schema.json → bundle-profile.schema.json} +9 -5
- package/schema/checksums.schema.json +42 -3
- package/schema/consumption-plan.schema.json +428 -0
- package/schema/digest-evidence.schema.json +212 -0
- package/schema/{kdna-envelope-external-grant-v1.schema.json → external-grant-envelope.schema.json} +17 -4
- package/schema/{kdna-key-grant-v1.schema.json → external-key-grant.schema.json} +39 -7
- package/schema/judgment-trace.schema.json +1251 -0
- package/schema/load-plan.schema.json +7 -5
- package/schema/manifest.schema.json +70 -10
- package/schema/{payload-profile-v1.schema.json → payload-profile.schema.json} +30 -6
- package/schema/runtime-capsule.schema.json +116 -0
- package/src/asset-reader.js +106 -120
- package/src/{v1 → container}/index.js +566 -209
- package/src/container/index.mjs +20 -0
- package/src/container-dispatcher.js +10 -7
- package/src/crypto-profile.js +37 -107
- package/src/external-key-grant.js +41 -15
- package/src/index.js +11 -4
- package/src/index.mjs +143 -24
- package/src/loader-compatibility.js +59 -0
- package/src/loader.js +1 -1
- package/src/public-api.js +59 -163
- package/src/remote-runtime.d.ts +13 -0
- package/src/remote-runtime.js +27 -0
- package/src/remote-runtime.mjs +3 -0
- package/src/runtime-api.js +9 -10
- package/src/runtime-capsule.js +529 -0
- package/src/runtime-contract.js +1882 -0
- package/src/types.d.ts +1127 -136
- package/src/workpack-pure.js +1 -1
- package/src/lint-pure.js +0 -430
- package/src/v1/index.mjs +0 -20
|
@@ -0,0 +1,371 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://github.com/aikdna/kdna/specs/agent-host-receipt.schema.json",
|
|
4
|
+
"title": "KDNA Agent Host Receipt",
|
|
5
|
+
"description": "Correlated Host response envelope. A matched runtime receipt proves only that the Host boundary accepted the exact Runtime Capsule value; it does not prove semantic consumption or conformance.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"required": ["protocol", "protocol_version", "request_id", "runtime_receipt", "outcome"],
|
|
8
|
+
"additionalProperties": false,
|
|
9
|
+
"properties": {
|
|
10
|
+
"protocol": {
|
|
11
|
+
"const": "kdna.agent-host"
|
|
12
|
+
},
|
|
13
|
+
"request_id": {
|
|
14
|
+
"type": "string",
|
|
15
|
+
"pattern": "^host_[0-9a-f]{24}$"
|
|
16
|
+
},
|
|
17
|
+
"runtime_receipt": {
|
|
18
|
+
"$ref": "#/$defs/runtimeReceipt"
|
|
19
|
+
},
|
|
20
|
+
"outcome": {
|
|
21
|
+
"oneOf": [
|
|
22
|
+
{
|
|
23
|
+
"$ref": "#/$defs/outcome"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"type": "null"
|
|
27
|
+
}
|
|
28
|
+
]
|
|
29
|
+
},
|
|
30
|
+
"protocol_version": {
|
|
31
|
+
"const": "0.1.0"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"allOf": [
|
|
35
|
+
{
|
|
36
|
+
"if": {
|
|
37
|
+
"properties": {
|
|
38
|
+
"runtime_receipt": {
|
|
39
|
+
"properties": {
|
|
40
|
+
"provider_execution_status": {
|
|
41
|
+
"const": "completed"
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
"required": ["provider_execution_status"]
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
"required": ["runtime_receipt"]
|
|
48
|
+
},
|
|
49
|
+
"then": {
|
|
50
|
+
"properties": {
|
|
51
|
+
"outcome": {
|
|
52
|
+
"$ref": "#/$defs/outcome"
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
"else": {
|
|
57
|
+
"properties": {
|
|
58
|
+
"outcome": {
|
|
59
|
+
"type": "null"
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
],
|
|
65
|
+
"$defs": {
|
|
66
|
+
"sha256": {
|
|
67
|
+
"type": "string",
|
|
68
|
+
"pattern": "^sha256:[0-9a-f]{64}$"
|
|
69
|
+
},
|
|
70
|
+
"runtimeReceipt": {
|
|
71
|
+
"type": "object",
|
|
72
|
+
"required": [
|
|
73
|
+
"type",
|
|
74
|
+
"contract_version",
|
|
75
|
+
"capsule_version",
|
|
76
|
+
"capsule_digest_profile",
|
|
77
|
+
"capsule_digest_profile_version",
|
|
78
|
+
"sender_capsule_delivery_digest",
|
|
79
|
+
"host_recomputed_capsule_delivery_digest",
|
|
80
|
+
"echoed_capsule_delivery_digest",
|
|
81
|
+
"capsule_delivery_comparison",
|
|
82
|
+
"capsule_schema_validation",
|
|
83
|
+
"asset_id_correlation",
|
|
84
|
+
"provider_execution_status",
|
|
85
|
+
"usage",
|
|
86
|
+
"semantic_consumption",
|
|
87
|
+
"model_identity"
|
|
88
|
+
],
|
|
89
|
+
"additionalProperties": false,
|
|
90
|
+
"properties": {
|
|
91
|
+
"type": {
|
|
92
|
+
"const": "kdna.agent-host.runtime-receipt"
|
|
93
|
+
},
|
|
94
|
+
"capsule_version": {
|
|
95
|
+
"const": "0.1.0"
|
|
96
|
+
},
|
|
97
|
+
"capsule_digest_profile": {
|
|
98
|
+
"const": "kdna.canonicalization.runtime-capsule-jcs"
|
|
99
|
+
},
|
|
100
|
+
"sender_capsule_delivery_digest": {
|
|
101
|
+
"$ref": "#/$defs/sha256"
|
|
102
|
+
},
|
|
103
|
+
"host_recomputed_capsule_delivery_digest": {
|
|
104
|
+
"$ref": "#/$defs/sha256"
|
|
105
|
+
},
|
|
106
|
+
"echoed_capsule_delivery_digest": {
|
|
107
|
+
"$ref": "#/$defs/sha256"
|
|
108
|
+
},
|
|
109
|
+
"capsule_delivery_comparison": {
|
|
110
|
+
"enum": ["matched", "mismatched"]
|
|
111
|
+
},
|
|
112
|
+
"capsule_schema_validation": {
|
|
113
|
+
"const": "passed"
|
|
114
|
+
},
|
|
115
|
+
"asset_id_correlation": {
|
|
116
|
+
"const": "matched"
|
|
117
|
+
},
|
|
118
|
+
"provider_execution_status": {
|
|
119
|
+
"enum": ["completed", "not_started", "failed", "cancelled", "timed_out"]
|
|
120
|
+
},
|
|
121
|
+
"usage": {
|
|
122
|
+
"$ref": "#/$defs/observedUsage"
|
|
123
|
+
},
|
|
124
|
+
"semantic_consumption": {
|
|
125
|
+
"$ref": "#/$defs/semanticConsumption"
|
|
126
|
+
},
|
|
127
|
+
"model_identity": {
|
|
128
|
+
"$ref": "#/$defs/modelIdentity"
|
|
129
|
+
},
|
|
130
|
+
"contract_version": {
|
|
131
|
+
"const": "0.1.0"
|
|
132
|
+
},
|
|
133
|
+
"capsule_digest_profile_version": {
|
|
134
|
+
"const": "0.1.0"
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
"allOf": [
|
|
138
|
+
{
|
|
139
|
+
"if": {
|
|
140
|
+
"properties": {
|
|
141
|
+
"capsule_delivery_comparison": {
|
|
142
|
+
"const": "matched"
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
"required": ["capsule_delivery_comparison"]
|
|
146
|
+
},
|
|
147
|
+
"then": {
|
|
148
|
+
"properties": {
|
|
149
|
+
"provider_execution_status": {
|
|
150
|
+
"enum": ["completed", "failed", "cancelled", "timed_out"]
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
"else": {
|
|
155
|
+
"properties": {
|
|
156
|
+
"provider_execution_status": {
|
|
157
|
+
"const": "not_started"
|
|
158
|
+
},
|
|
159
|
+
"usage": {
|
|
160
|
+
"properties": {
|
|
161
|
+
"tokens_used": {
|
|
162
|
+
"type": "null"
|
|
163
|
+
},
|
|
164
|
+
"model_calls": {
|
|
165
|
+
"type": "null"
|
|
166
|
+
},
|
|
167
|
+
"basis": {
|
|
168
|
+
"const": "not_observed"
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
},
|
|
172
|
+
"model_identity": {
|
|
173
|
+
"properties": {
|
|
174
|
+
"value": {
|
|
175
|
+
"type": "null"
|
|
176
|
+
},
|
|
177
|
+
"basis": {
|
|
178
|
+
"const": "not_observed"
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
]
|
|
186
|
+
},
|
|
187
|
+
"semanticConsumption": {
|
|
188
|
+
"type": "object",
|
|
189
|
+
"required": ["state", "basis"],
|
|
190
|
+
"additionalProperties": false,
|
|
191
|
+
"properties": {
|
|
192
|
+
"state": {
|
|
193
|
+
"const": "not_observed"
|
|
194
|
+
},
|
|
195
|
+
"basis": {
|
|
196
|
+
"type": "null"
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
},
|
|
200
|
+
"observedUsage": {
|
|
201
|
+
"type": "object",
|
|
202
|
+
"required": ["elapsed_ms", "elapsed_basis", "tokens_used", "model_calls", "basis"],
|
|
203
|
+
"additionalProperties": false,
|
|
204
|
+
"properties": {
|
|
205
|
+
"elapsed_ms": {
|
|
206
|
+
"type": "integer",
|
|
207
|
+
"minimum": 0
|
|
208
|
+
},
|
|
209
|
+
"elapsed_basis": {
|
|
210
|
+
"const": "host_monotonic"
|
|
211
|
+
},
|
|
212
|
+
"tokens_used": {
|
|
213
|
+
"oneOf": [
|
|
214
|
+
{
|
|
215
|
+
"type": "integer",
|
|
216
|
+
"minimum": 0
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
"type": "null"
|
|
220
|
+
}
|
|
221
|
+
]
|
|
222
|
+
},
|
|
223
|
+
"model_calls": {
|
|
224
|
+
"oneOf": [
|
|
225
|
+
{
|
|
226
|
+
"type": "integer",
|
|
227
|
+
"minimum": 0
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
"type": "null"
|
|
231
|
+
}
|
|
232
|
+
]
|
|
233
|
+
},
|
|
234
|
+
"basis": {
|
|
235
|
+
"enum": ["host_reported", "not_observed"]
|
|
236
|
+
}
|
|
237
|
+
},
|
|
238
|
+
"allOf": [
|
|
239
|
+
{
|
|
240
|
+
"if": {
|
|
241
|
+
"properties": {
|
|
242
|
+
"basis": {
|
|
243
|
+
"const": "host_reported"
|
|
244
|
+
}
|
|
245
|
+
},
|
|
246
|
+
"required": ["basis"]
|
|
247
|
+
},
|
|
248
|
+
"then": {
|
|
249
|
+
"properties": {
|
|
250
|
+
"tokens_used": {
|
|
251
|
+
"type": "integer",
|
|
252
|
+
"minimum": 0
|
|
253
|
+
},
|
|
254
|
+
"model_calls": {
|
|
255
|
+
"type": "integer",
|
|
256
|
+
"minimum": 0
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
},
|
|
260
|
+
"else": {
|
|
261
|
+
"properties": {
|
|
262
|
+
"tokens_used": {
|
|
263
|
+
"type": "null"
|
|
264
|
+
},
|
|
265
|
+
"model_calls": {
|
|
266
|
+
"type": "null"
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
]
|
|
272
|
+
},
|
|
273
|
+
"modelIdentity": {
|
|
274
|
+
"type": "object",
|
|
275
|
+
"required": ["value", "basis"],
|
|
276
|
+
"additionalProperties": false,
|
|
277
|
+
"properties": {
|
|
278
|
+
"value": {
|
|
279
|
+
"type": ["string", "null"],
|
|
280
|
+
"minLength": 1
|
|
281
|
+
},
|
|
282
|
+
"basis": {
|
|
283
|
+
"enum": ["host_reported", "not_observed"]
|
|
284
|
+
}
|
|
285
|
+
},
|
|
286
|
+
"allOf": [
|
|
287
|
+
{
|
|
288
|
+
"if": {
|
|
289
|
+
"properties": {
|
|
290
|
+
"basis": {
|
|
291
|
+
"const": "host_reported"
|
|
292
|
+
}
|
|
293
|
+
},
|
|
294
|
+
"required": ["basis"]
|
|
295
|
+
},
|
|
296
|
+
"then": {
|
|
297
|
+
"properties": {
|
|
298
|
+
"value": {
|
|
299
|
+
"type": "string",
|
|
300
|
+
"minLength": 1
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
},
|
|
304
|
+
"else": {
|
|
305
|
+
"properties": {
|
|
306
|
+
"value": {
|
|
307
|
+
"type": "null"
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
]
|
|
313
|
+
},
|
|
314
|
+
"outcome": {
|
|
315
|
+
"type": "object",
|
|
316
|
+
"required": ["judgment", "usage"],
|
|
317
|
+
"additionalProperties": false,
|
|
318
|
+
"properties": {
|
|
319
|
+
"judgment": {
|
|
320
|
+
"$ref": "#/$defs/judgment"
|
|
321
|
+
},
|
|
322
|
+
"usage": {
|
|
323
|
+
"oneOf": [
|
|
324
|
+
{
|
|
325
|
+
"$ref": "#/$defs/usage"
|
|
326
|
+
},
|
|
327
|
+
{
|
|
328
|
+
"type": "null"
|
|
329
|
+
}
|
|
330
|
+
]
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
},
|
|
334
|
+
"judgment": {
|
|
335
|
+
"type": "object",
|
|
336
|
+
"required": ["answer", "reasoning", "confidence"],
|
|
337
|
+
"additionalProperties": false,
|
|
338
|
+
"properties": {
|
|
339
|
+
"answer": {
|
|
340
|
+
"type": "string",
|
|
341
|
+
"minLength": 1
|
|
342
|
+
},
|
|
343
|
+
"reasoning": {
|
|
344
|
+
"type": "array",
|
|
345
|
+
"items": {
|
|
346
|
+
"type": "string"
|
|
347
|
+
}
|
|
348
|
+
},
|
|
349
|
+
"confidence": {
|
|
350
|
+
"type": ["string", "null"],
|
|
351
|
+
"minLength": 1
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
},
|
|
355
|
+
"usage": {
|
|
356
|
+
"type": "object",
|
|
357
|
+
"required": ["tokens_used", "model_calls"],
|
|
358
|
+
"additionalProperties": false,
|
|
359
|
+
"properties": {
|
|
360
|
+
"tokens_used": {
|
|
361
|
+
"type": "integer",
|
|
362
|
+
"minimum": 0
|
|
363
|
+
},
|
|
364
|
+
"model_calls": {
|
|
365
|
+
"type": "integer",
|
|
366
|
+
"minimum": 0
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
}
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://github.com/aikdna/kdna/specs/agent-host-request.schema.json",
|
|
4
|
+
"title": "KDNA Agent Host Request",
|
|
5
|
+
"description": "Agent Host request carrying one exact Runtime Capsule, plan correlation, detached delivery digest P, projection/result contracts, and enforceable limits.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"required": [
|
|
8
|
+
"protocol",
|
|
9
|
+
"protocol_version",
|
|
10
|
+
"request_id",
|
|
11
|
+
"plan_ref",
|
|
12
|
+
"runtime_contract",
|
|
13
|
+
"projection_contract",
|
|
14
|
+
"result_contract",
|
|
15
|
+
"budget",
|
|
16
|
+
"constraints",
|
|
17
|
+
"phase",
|
|
18
|
+
"task",
|
|
19
|
+
"authority",
|
|
20
|
+
"asset",
|
|
21
|
+
"capsule"
|
|
22
|
+
],
|
|
23
|
+
"additionalProperties": false,
|
|
24
|
+
"properties": {
|
|
25
|
+
"protocol": {
|
|
26
|
+
"const": "kdna.agent-host"
|
|
27
|
+
},
|
|
28
|
+
"request_id": {
|
|
29
|
+
"type": "string",
|
|
30
|
+
"pattern": "^host_[0-9a-f]{24}$"
|
|
31
|
+
},
|
|
32
|
+
"plan_ref": {
|
|
33
|
+
"$ref": "#/$defs/planRef"
|
|
34
|
+
},
|
|
35
|
+
"runtime_contract": {
|
|
36
|
+
"$ref": "#/$defs/runtimeContract"
|
|
37
|
+
},
|
|
38
|
+
"projection_contract": {
|
|
39
|
+
"$ref": "#/$defs/projectionContract"
|
|
40
|
+
},
|
|
41
|
+
"result_contract": {
|
|
42
|
+
"$ref": "#/$defs/resultContract"
|
|
43
|
+
},
|
|
44
|
+
"budget": {
|
|
45
|
+
"$ref": "#/$defs/budget"
|
|
46
|
+
},
|
|
47
|
+
"constraints": {
|
|
48
|
+
"$ref": "#/$defs/constraints"
|
|
49
|
+
},
|
|
50
|
+
"phase": {
|
|
51
|
+
"const": "single_judgment"
|
|
52
|
+
},
|
|
53
|
+
"task": {
|
|
54
|
+
"$ref": "#/$defs/task"
|
|
55
|
+
},
|
|
56
|
+
"authority": {
|
|
57
|
+
"$ref": "#/$defs/authority"
|
|
58
|
+
},
|
|
59
|
+
"asset": {
|
|
60
|
+
"$ref": "#/$defs/asset"
|
|
61
|
+
},
|
|
62
|
+
"capsule": {
|
|
63
|
+
"$ref": "https://github.com/aikdna/kdna/specs/runtime-capsule.schema.json"
|
|
64
|
+
},
|
|
65
|
+
"protocol_version": {
|
|
66
|
+
"const": "0.1.0"
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
"$defs": {
|
|
70
|
+
"sha256": {
|
|
71
|
+
"type": "string",
|
|
72
|
+
"pattern": "^sha256:[0-9a-f]{64}$"
|
|
73
|
+
},
|
|
74
|
+
"assetId": {
|
|
75
|
+
"type": "string",
|
|
76
|
+
"pattern": "^[a-zA-Z][a-zA-Z0-9_-]*(:[a-zA-Z0-9_.-]+)+$"
|
|
77
|
+
},
|
|
78
|
+
"semver": {
|
|
79
|
+
"type": "string",
|
|
80
|
+
"pattern": "^[0-9]+\\.[0-9]+\\.[0-9]+([+-].+)?$"
|
|
81
|
+
},
|
|
82
|
+
"planRef": {
|
|
83
|
+
"type": "object",
|
|
84
|
+
"required": ["plan_id", "plan_digest_profile", "plan_digest_profile_version", "plan_digest"],
|
|
85
|
+
"additionalProperties": false,
|
|
86
|
+
"properties": {
|
|
87
|
+
"plan_id": {
|
|
88
|
+
"type": "string",
|
|
89
|
+
"pattern": "^plan_[0-9a-f]{16}$"
|
|
90
|
+
},
|
|
91
|
+
"plan_digest_profile": {
|
|
92
|
+
"const": "kdna.canonicalization.consumption-plan-jcs"
|
|
93
|
+
},
|
|
94
|
+
"plan_digest": {
|
|
95
|
+
"$ref": "#/$defs/sha256"
|
|
96
|
+
},
|
|
97
|
+
"plan_digest_profile_version": {
|
|
98
|
+
"const": "0.1.0"
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
"runtimeContract": {
|
|
103
|
+
"type": "object",
|
|
104
|
+
"required": [
|
|
105
|
+
"capsule_version",
|
|
106
|
+
"capsule_digest_profile",
|
|
107
|
+
"capsule_digest_profile_version",
|
|
108
|
+
"capsule_delivery_digest"
|
|
109
|
+
],
|
|
110
|
+
"additionalProperties": false,
|
|
111
|
+
"properties": {
|
|
112
|
+
"capsule_version": {
|
|
113
|
+
"const": "0.1.0"
|
|
114
|
+
},
|
|
115
|
+
"capsule_digest_profile": {
|
|
116
|
+
"const": "kdna.canonicalization.runtime-capsule-jcs"
|
|
117
|
+
},
|
|
118
|
+
"capsule_delivery_digest": {
|
|
119
|
+
"$ref": "#/$defs/sha256"
|
|
120
|
+
},
|
|
121
|
+
"capsule_digest_profile_version": {
|
|
122
|
+
"const": "0.1.0"
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
"projectionContract": {
|
|
127
|
+
"type": "object",
|
|
128
|
+
"required": [
|
|
129
|
+
"profile",
|
|
130
|
+
"required_digest_profile",
|
|
131
|
+
"required_digest_profile_version",
|
|
132
|
+
"require_packaged_asset"
|
|
133
|
+
],
|
|
134
|
+
"additionalProperties": false,
|
|
135
|
+
"properties": {
|
|
136
|
+
"profile": {
|
|
137
|
+
"enum": ["index", "compact", "scenario", "full"]
|
|
138
|
+
},
|
|
139
|
+
"required_digest_profile": {
|
|
140
|
+
"const": "kdna.digest-evidence"
|
|
141
|
+
},
|
|
142
|
+
"require_packaged_asset": {
|
|
143
|
+
"const": true
|
|
144
|
+
},
|
|
145
|
+
"required_digest_profile_version": {
|
|
146
|
+
"const": "0.1.0"
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
},
|
|
150
|
+
"resultContract": {
|
|
151
|
+
"type": "object",
|
|
152
|
+
"required": ["shape"],
|
|
153
|
+
"additionalProperties": false,
|
|
154
|
+
"properties": {
|
|
155
|
+
"shape": {
|
|
156
|
+
"const": "structured_judgment"
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
},
|
|
160
|
+
"budget": {
|
|
161
|
+
"$ref": "https://github.com/aikdna/kdna/specs/consumption-plan.schema.json#/$defs/budget"
|
|
162
|
+
},
|
|
163
|
+
"constraints": {
|
|
164
|
+
"$ref": "https://github.com/aikdna/kdna/specs/consumption-plan.schema.json#/$defs/constraints"
|
|
165
|
+
},
|
|
166
|
+
"task": {
|
|
167
|
+
"$ref": "https://github.com/aikdna/kdna/specs/consumption-plan.schema.json#/$defs/task"
|
|
168
|
+
},
|
|
169
|
+
"authority": {
|
|
170
|
+
"type": "object",
|
|
171
|
+
"required": ["asset_id", "role", "final_decision"],
|
|
172
|
+
"additionalProperties": false,
|
|
173
|
+
"properties": {
|
|
174
|
+
"asset_id": {
|
|
175
|
+
"$ref": "#/$defs/assetId"
|
|
176
|
+
},
|
|
177
|
+
"role": {
|
|
178
|
+
"const": "primary"
|
|
179
|
+
},
|
|
180
|
+
"final_decision": {
|
|
181
|
+
"const": true
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
},
|
|
185
|
+
"asset": {
|
|
186
|
+
"type": "object",
|
|
187
|
+
"required": [
|
|
188
|
+
"asset_id",
|
|
189
|
+
"asset_uid",
|
|
190
|
+
"version",
|
|
191
|
+
"judgment_version",
|
|
192
|
+
"access",
|
|
193
|
+
"role",
|
|
194
|
+
"expected_digests"
|
|
195
|
+
],
|
|
196
|
+
"additionalProperties": false,
|
|
197
|
+
"properties": {
|
|
198
|
+
"asset_id": {
|
|
199
|
+
"$ref": "#/$defs/assetId"
|
|
200
|
+
},
|
|
201
|
+
"asset_uid": {
|
|
202
|
+
"type": "string",
|
|
203
|
+
"format": "uri"
|
|
204
|
+
},
|
|
205
|
+
"version": {
|
|
206
|
+
"$ref": "#/$defs/semver"
|
|
207
|
+
},
|
|
208
|
+
"judgment_version": {
|
|
209
|
+
"$ref": "#/$defs/semver"
|
|
210
|
+
},
|
|
211
|
+
"access": {
|
|
212
|
+
"enum": ["public", "licensed", "remote"]
|
|
213
|
+
},
|
|
214
|
+
"role": {
|
|
215
|
+
"const": "primary"
|
|
216
|
+
},
|
|
217
|
+
"expected_digests": {
|
|
218
|
+
"$ref": "https://github.com/aikdna/kdna/specs/consumption-plan.schema.json#/$defs/expectedDigests"
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
}
|
|
@@ -1,16 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
-
"$id": "https://github.com/aikdna/kdna/schema/bundle-profile
|
|
4
|
-
"title": "Bundle Profile
|
|
3
|
+
"$id": "https://github.com/aikdna/kdna/schema/bundle-profile.schema.json",
|
|
4
|
+
"title": "KDNA Bundle Payload Profile",
|
|
5
5
|
"description": "Schema for the payload entry of a KDNA bundle container.",
|
|
6
6
|
"type": "object",
|
|
7
|
-
"required": ["profile", "components"],
|
|
7
|
+
"required": ["profile", "profile_version", "components"],
|
|
8
8
|
"additionalProperties": true,
|
|
9
9
|
"properties": {
|
|
10
10
|
"profile": {
|
|
11
11
|
"type": "string",
|
|
12
|
-
"const": "bundle
|
|
13
|
-
"description": "Profile identifier. Must be the literal string 'bundle
|
|
12
|
+
"const": "kdna.payload.bundle",
|
|
13
|
+
"description": "Profile identifier. Must be the literal string 'kdna.payload.bundle'."
|
|
14
|
+
},
|
|
15
|
+
"profile_version": {
|
|
16
|
+
"const": "0.1.0",
|
|
17
|
+
"description": "Compatibility coordinate for the bundle payload profile."
|
|
14
18
|
},
|
|
15
19
|
"components": {
|
|
16
20
|
"type": "array",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
3
|
"$id": "https://github.com/aikdna/kdna/schema/checksums.schema.json",
|
|
4
|
-
"title": "KDNA Checksums
|
|
4
|
+
"title": "KDNA Checksums",
|
|
5
5
|
"description": "Per-entry digests for a .kdna container. Stored as checksums.json at the container root.",
|
|
6
6
|
"type": "object",
|
|
7
7
|
"required": ["algorithm"],
|
|
@@ -16,7 +16,46 @@
|
|
|
16
16
|
"pattern": "^[a-f0-9]{64}$"
|
|
17
17
|
}
|
|
18
18
|
},
|
|
19
|
+
"allOf": [
|
|
20
|
+
{
|
|
21
|
+
"if": {
|
|
22
|
+
"anyOf": [
|
|
23
|
+
{ "required": ["digest_profile"] },
|
|
24
|
+
{ "required": ["covered_entries"] }
|
|
25
|
+
]
|
|
26
|
+
},
|
|
27
|
+
"then": {
|
|
28
|
+
"required": [
|
|
29
|
+
"digest_profile",
|
|
30
|
+
"digest_profile_version",
|
|
31
|
+
"covered_entries",
|
|
32
|
+
"manifest_digest",
|
|
33
|
+
"payload_digest",
|
|
34
|
+
"entry_set_digest"
|
|
35
|
+
]
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
],
|
|
19
39
|
"properties": {
|
|
40
|
+
"digest_profile": {
|
|
41
|
+
"const": "kdna.digest-basis.runtime-entry-set",
|
|
42
|
+
"description": "Algorithm and coverage profile for entry_set_digest."
|
|
43
|
+
},
|
|
44
|
+
"digest_profile_version": {
|
|
45
|
+
"const": "0.1.0",
|
|
46
|
+
"description": "Compatibility coordinate for the entry-set digest basis."
|
|
47
|
+
},
|
|
48
|
+
"covered_entries": {
|
|
49
|
+
"type": "array",
|
|
50
|
+
"description": "Ordered entries covered by kdna.digest-basis.runtime-entry-set.",
|
|
51
|
+
"prefixItems": [
|
|
52
|
+
{ "const": "kdna.json" },
|
|
53
|
+
{ "const": "payload.kdnab" }
|
|
54
|
+
],
|
|
55
|
+
"items": false,
|
|
56
|
+
"minItems": 2,
|
|
57
|
+
"maxItems": 2
|
|
58
|
+
},
|
|
20
59
|
"algorithm": {
|
|
21
60
|
"type": "string",
|
|
22
61
|
"description": "Hash algorithm. Phase 1 uses sha256.",
|
|
@@ -30,8 +69,8 @@
|
|
|
30
69
|
"description": "Digest of the payload.kdnab entry.",
|
|
31
70
|
"$ref": "#/$defs/sha256Digest"
|
|
32
71
|
},
|
|
33
|
-
"
|
|
34
|
-
"description": "Digest of the
|
|
72
|
+
"entry_set_digest": {
|
|
73
|
+
"description": "Digest of the protected runtime entry set, combined deterministically from kdna.json and payload.kdnab entry digests.",
|
|
35
74
|
"$ref": "#/$defs/sha256Digest"
|
|
36
75
|
},
|
|
37
76
|
"entries": {
|