@x12i/memorix-scoper-contracts 1.0.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.
Files changed (62) hide show
  1. package/README.md +9 -0
  2. package/dist/errors.d.ts +24 -0
  3. package/dist/errors.d.ts.map +1 -0
  4. package/dist/errors.js +70 -0
  5. package/dist/errors.js.map +1 -0
  6. package/dist/evidence.d.ts +2 -0
  7. package/dist/evidence.d.ts.map +1 -0
  8. package/dist/evidence.js +2 -0
  9. package/dist/evidence.js.map +1 -0
  10. package/dist/index.d.ts +3 -0
  11. package/dist/index.d.ts.map +1 -0
  12. package/dist/index.js +3 -0
  13. package/dist/index.js.map +1 -0
  14. package/dist/schemas/catalog.d.ts +441 -0
  15. package/dist/schemas/catalog.d.ts.map +1 -0
  16. package/dist/schemas/catalog.js +55 -0
  17. package/dist/schemas/catalog.js.map +1 -0
  18. package/dist/schemas/evidence.d.ts +602 -0
  19. package/dist/schemas/evidence.d.ts.map +1 -0
  20. package/dist/schemas/evidence.js +83 -0
  21. package/dist/schemas/evidence.js.map +1 -0
  22. package/dist/schemas/index.d.ts +6 -0
  23. package/dist/schemas/index.d.ts.map +1 -0
  24. package/dist/schemas/index.js +6 -0
  25. package/dist/schemas/index.js.map +1 -0
  26. package/dist/schemas/nexum-persist.d.ts +47 -0
  27. package/dist/schemas/nexum-persist.d.ts.map +1 -0
  28. package/dist/schemas/nexum-persist.js +27 -0
  29. package/dist/schemas/nexum-persist.js.map +1 -0
  30. package/dist/schemas/profile.d.ts +69 -0
  31. package/dist/schemas/profile.d.ts.map +1 -0
  32. package/dist/schemas/profile.js +15 -0
  33. package/dist/schemas/profile.js.map +1 -0
  34. package/dist/schemas/request.d.ts +296 -0
  35. package/dist/schemas/request.d.ts.map +1 -0
  36. package/dist/schemas/request.js +98 -0
  37. package/dist/schemas/request.js.map +1 -0
  38. package/dist/schemas.d.ts +1077 -0
  39. package/dist/schemas.d.ts.map +1 -0
  40. package/dist/schemas.js +199 -0
  41. package/dist/schemas.js.map +1 -0
  42. package/dist/schemas.test.d.ts +2 -0
  43. package/dist/schemas.test.d.ts.map +1 -0
  44. package/dist/schemas.test.js +29 -0
  45. package/dist/schemas.test.js.map +1 -0
  46. package/package.json +53 -0
  47. package/schemas/CatalogEntry.json +17 -0
  48. package/schemas/CatalogEntry.schema.json +157 -0
  49. package/schemas/EvidenceBundle.json +15 -0
  50. package/schemas/EvidenceBundle.schema.json +469 -0
  51. package/schemas/EvidenceItem.json +15 -0
  52. package/schemas/EvidenceRef.json +9 -0
  53. package/schemas/EvidenceSelection.schema.json +83 -0
  54. package/schemas/RetrievalPlan.json +13 -0
  55. package/schemas/RetrievalPlan.schema.json +73 -0
  56. package/schemas/RetrievalStep.json +14 -0
  57. package/schemas/ScopeRequest.json +28 -0
  58. package/schemas/ScopeRequest.schema.json +108 -0
  59. package/schemas/ScoperBudgets.json +14 -0
  60. package/schemas/ScoperProfile.json +17 -0
  61. package/schemas/TrustedExecutionContext.json +22 -0
  62. package/schemas/TrustedExecutionContext.schema.json +129 -0
@@ -0,0 +1,469 @@
1
+ {
2
+ "$ref": "#/definitions/EvidenceBundle",
3
+ "definitions": {
4
+ "EvidenceBundle": {
5
+ "type": "object",
6
+ "properties": {
7
+ "requestId": {
8
+ "type": "string"
9
+ },
10
+ "status": {
11
+ "type": "string",
12
+ "enum": [
13
+ "complete",
14
+ "partial",
15
+ "unavailable",
16
+ "rejected"
17
+ ]
18
+ },
19
+ "interpretation": {
20
+ "type": "object",
21
+ "properties": {
22
+ "objective": {
23
+ "type": "string"
24
+ },
25
+ "assumptions": {
26
+ "type": "array",
27
+ "items": {
28
+ "type": "string"
29
+ }
30
+ }
31
+ },
32
+ "required": [
33
+ "objective",
34
+ "assumptions"
35
+ ],
36
+ "additionalProperties": false
37
+ },
38
+ "execution": {
39
+ "type": "object",
40
+ "properties": {
41
+ "catalogVersion": {
42
+ "type": "string"
43
+ },
44
+ "profiles": {
45
+ "type": "array",
46
+ "items": {
47
+ "type": "object",
48
+ "properties": {
49
+ "id": {
50
+ "type": "string"
51
+ },
52
+ "version": {
53
+ "type": "string"
54
+ }
55
+ },
56
+ "required": [
57
+ "id",
58
+ "version"
59
+ ],
60
+ "additionalProperties": false
61
+ }
62
+ },
63
+ "surfaces": {
64
+ "type": "array",
65
+ "items": {
66
+ "type": "string",
67
+ "enum": [
68
+ "estate-bag",
69
+ "subject",
70
+ "knowledge-explore"
71
+ ]
72
+ }
73
+ }
74
+ },
75
+ "required": [
76
+ "catalogVersion",
77
+ "profiles",
78
+ "surfaces"
79
+ ],
80
+ "additionalProperties": false
81
+ },
82
+ "evidence": {
83
+ "type": "array",
84
+ "items": {
85
+ "type": "object",
86
+ "properties": {
87
+ "evidenceId": {
88
+ "type": "string",
89
+ "minLength": 1
90
+ },
91
+ "fact": {
92
+ "type": "string",
93
+ "minLength": 1
94
+ },
95
+ "value": {},
96
+ "assertionType": {
97
+ "type": "string",
98
+ "minLength": 1
99
+ },
100
+ "relevance": {
101
+ "type": "string",
102
+ "minLength": 1
103
+ },
104
+ "ref": {
105
+ "anyOf": [
106
+ {
107
+ "type": "object",
108
+ "properties": {
109
+ "surface": {
110
+ "type": "string",
111
+ "const": "subject"
112
+ },
113
+ "objectType": {
114
+ "type": "string",
115
+ "minLength": 1
116
+ },
117
+ "contentType": {
118
+ "type": "string",
119
+ "minLength": 1
120
+ },
121
+ "recordId": {
122
+ "type": "string",
123
+ "minLength": 1
124
+ },
125
+ "revision": {
126
+ "type": "string",
127
+ "minLength": 1
128
+ },
129
+ "contractVersion": {
130
+ "type": "string"
131
+ },
132
+ "field": {
133
+ "type": "string",
134
+ "minLength": 1
135
+ }
136
+ },
137
+ "required": [
138
+ "surface",
139
+ "objectType",
140
+ "contentType",
141
+ "recordId",
142
+ "revision",
143
+ "field"
144
+ ],
145
+ "additionalProperties": false
146
+ },
147
+ {
148
+ "type": "object",
149
+ "properties": {
150
+ "surface": {
151
+ "type": "string",
152
+ "const": "estate-bag"
153
+ },
154
+ "product": {
155
+ "type": "string",
156
+ "minLength": 1
157
+ },
158
+ "variant": {
159
+ "type": "string"
160
+ },
161
+ "recordId": {
162
+ "type": "string",
163
+ "minLength": 1
164
+ },
165
+ "field": {
166
+ "type": "string",
167
+ "minLength": 1
168
+ },
169
+ "snapshotSetId": {
170
+ "type": "string",
171
+ "minLength": 1
172
+ },
173
+ "analysisSnapshotId": {
174
+ "type": "string",
175
+ "minLength": 1
176
+ },
177
+ "liveGenerationId": {
178
+ "type": "string"
179
+ }
180
+ },
181
+ "required": [
182
+ "surface",
183
+ "product",
184
+ "recordId",
185
+ "field",
186
+ "snapshotSetId",
187
+ "analysisSnapshotId"
188
+ ],
189
+ "additionalProperties": false
190
+ },
191
+ {
192
+ "type": "object",
193
+ "properties": {
194
+ "surface": {
195
+ "type": "string",
196
+ "const": "knowledge-explore"
197
+ },
198
+ "entityId": {
199
+ "type": "string"
200
+ },
201
+ "queryId": {
202
+ "type": "string"
203
+ },
204
+ "field": {
205
+ "type": "string",
206
+ "minLength": 1
207
+ },
208
+ "backendGeneration": {
209
+ "type": "string"
210
+ }
211
+ },
212
+ "required": [
213
+ "surface",
214
+ "field"
215
+ ],
216
+ "additionalProperties": false
217
+ }
218
+ ]
219
+ },
220
+ "source": {
221
+ "type": "object",
222
+ "properties": {
223
+ "system": {
224
+ "type": "string",
225
+ "minLength": 1
226
+ },
227
+ "producer": {
228
+ "type": "string"
229
+ },
230
+ "contractVersion": {
231
+ "type": "string"
232
+ }
233
+ },
234
+ "required": [
235
+ "system"
236
+ ],
237
+ "additionalProperties": false
238
+ },
239
+ "observedAt": {
240
+ "anyOf": [
241
+ {
242
+ "type": "string",
243
+ "format": "date-time"
244
+ },
245
+ {
246
+ "type": "null"
247
+ }
248
+ ]
249
+ },
250
+ "publishedAt": {
251
+ "anyOf": [
252
+ {
253
+ "type": "string",
254
+ "format": "date-time"
255
+ },
256
+ {
257
+ "type": "null"
258
+ }
259
+ ]
260
+ },
261
+ "classification": {
262
+ "type": "string",
263
+ "minLength": 1
264
+ }
265
+ },
266
+ "required": [
267
+ "evidenceId",
268
+ "fact",
269
+ "assertionType",
270
+ "relevance",
271
+ "ref",
272
+ "source",
273
+ "classification"
274
+ ],
275
+ "additionalProperties": false
276
+ }
277
+ },
278
+ "coverage": {
279
+ "type": "object",
280
+ "properties": {
281
+ "complete": {
282
+ "type": "boolean"
283
+ },
284
+ "datasetsRead": {
285
+ "type": "array",
286
+ "items": {
287
+ "type": "string"
288
+ }
289
+ },
290
+ "datasetsSkipped": {
291
+ "type": "array",
292
+ "items": {
293
+ "type": "object",
294
+ "properties": {
295
+ "id": {
296
+ "type": "string"
297
+ },
298
+ "reason": {
299
+ "type": "string"
300
+ }
301
+ },
302
+ "required": [
303
+ "id",
304
+ "reason"
305
+ ],
306
+ "additionalProperties": false
307
+ }
308
+ },
309
+ "countChecks": {
310
+ "type": "array",
311
+ "items": {
312
+ "type": "object",
313
+ "properties": {
314
+ "dataset": {
315
+ "type": "string"
316
+ },
317
+ "expected": {
318
+ "type": "number"
319
+ },
320
+ "actual": {
321
+ "type": "number"
322
+ },
323
+ "matched": {
324
+ "type": "boolean"
325
+ }
326
+ },
327
+ "required": [
328
+ "dataset",
329
+ "actual",
330
+ "matched"
331
+ ],
332
+ "additionalProperties": false
333
+ }
334
+ }
335
+ },
336
+ "required": [
337
+ "complete",
338
+ "datasetsRead",
339
+ "datasetsSkipped",
340
+ "countChecks"
341
+ ],
342
+ "additionalProperties": false
343
+ },
344
+ "conflicts": {
345
+ "type": "array",
346
+ "items": {
347
+ "type": "object",
348
+ "properties": {
349
+ "description": {
350
+ "type": "string"
351
+ },
352
+ "evidenceIds": {
353
+ "type": "array",
354
+ "items": {
355
+ "type": "string"
356
+ }
357
+ },
358
+ "resolution": {
359
+ "type": "string",
360
+ "enum": [
361
+ "unresolved",
362
+ "source-precedence",
363
+ "different-context"
364
+ ]
365
+ }
366
+ },
367
+ "required": [
368
+ "description",
369
+ "evidenceIds",
370
+ "resolution"
371
+ ],
372
+ "additionalProperties": false
373
+ }
374
+ },
375
+ "unknowns": {
376
+ "type": "array",
377
+ "items": {
378
+ "type": "object",
379
+ "properties": {
380
+ "question": {
381
+ "type": "string"
382
+ },
383
+ "reason": {
384
+ "type": "string"
385
+ },
386
+ "missingDatasets": {
387
+ "type": "array",
388
+ "items": {
389
+ "type": "string"
390
+ }
391
+ }
392
+ },
393
+ "required": [
394
+ "question",
395
+ "reason"
396
+ ],
397
+ "additionalProperties": false
398
+ }
399
+ },
400
+ "warnings": {
401
+ "type": "array",
402
+ "items": {
403
+ "type": "object",
404
+ "properties": {
405
+ "code": {
406
+ "type": "string"
407
+ },
408
+ "message": {
409
+ "type": "string"
410
+ }
411
+ },
412
+ "required": [
413
+ "code",
414
+ "message"
415
+ ],
416
+ "additionalProperties": false
417
+ }
418
+ },
419
+ "continuation": {
420
+ "anyOf": [
421
+ {
422
+ "type": "object",
423
+ "properties": {
424
+ "kind": {
425
+ "type": "string",
426
+ "enum": [
427
+ "cursor",
428
+ "refinement-required",
429
+ "budget-exhausted"
430
+ ]
431
+ },
432
+ "token": {
433
+ "type": "string"
434
+ },
435
+ "suggestion": {
436
+ "type": "string"
437
+ }
438
+ },
439
+ "required": [
440
+ "kind"
441
+ ],
442
+ "additionalProperties": false
443
+ },
444
+ {
445
+ "type": "null"
446
+ }
447
+ ]
448
+ },
449
+ "traceId": {
450
+ "type": "string"
451
+ }
452
+ },
453
+ "required": [
454
+ "requestId",
455
+ "status",
456
+ "interpretation",
457
+ "execution",
458
+ "evidence",
459
+ "coverage",
460
+ "conflicts",
461
+ "unknowns",
462
+ "warnings",
463
+ "traceId"
464
+ ],
465
+ "additionalProperties": false
466
+ }
467
+ },
468
+ "$schema": "http://json-schema.org/draft-07/schema#"
469
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "title": "EvidenceItem",
4
+ "type": "object",
5
+ "properties": {
6
+ "id": { "type": "string" },
7
+ "ref": { "type": "object" },
8
+ "summary": { "type": "string" },
9
+ "epistemic": { "type": "string" },
10
+ "confidence": { "type": "number" },
11
+ "payload": {},
12
+ "tags": { "type": "array", "items": { "type": "string" } }
13
+ },
14
+ "required": ["id", "ref", "summary", "epistemic"]
15
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "title": "EvidenceRef",
4
+ "oneOf": [
5
+ { "type": "object", "required": ["kind"], "properties": { "kind": { "const": "subject" } } },
6
+ { "type": "object", "required": ["kind"], "properties": { "kind": { "const": "estate-bag" } } },
7
+ { "type": "object", "required": ["kind"], "properties": { "kind": { "const": "knowledge-explore" } } }
8
+ ]
9
+ }
@@ -0,0 +1,83 @@
1
+ {
2
+ "$ref": "#/definitions/EvidenceSelection",
3
+ "definitions": {
4
+ "EvidenceSelection": {
5
+ "type": "object",
6
+ "properties": {
7
+ "selectedEvidenceIds": {
8
+ "type": "array",
9
+ "items": {
10
+ "type": "string"
11
+ }
12
+ },
13
+ "conflicts": {
14
+ "type": "array",
15
+ "items": {
16
+ "type": "object",
17
+ "properties": {
18
+ "description": {
19
+ "type": "string"
20
+ },
21
+ "evidenceIds": {
22
+ "type": "array",
23
+ "items": {
24
+ "type": "string"
25
+ }
26
+ },
27
+ "resolution": {
28
+ "type": "string",
29
+ "enum": [
30
+ "unresolved",
31
+ "source-precedence",
32
+ "different-context"
33
+ ]
34
+ }
35
+ },
36
+ "required": [
37
+ "description",
38
+ "evidenceIds",
39
+ "resolution"
40
+ ],
41
+ "additionalProperties": false
42
+ }
43
+ },
44
+ "unknowns": {
45
+ "type": "array",
46
+ "items": {
47
+ "type": "object",
48
+ "properties": {
49
+ "question": {
50
+ "type": "string"
51
+ },
52
+ "reason": {
53
+ "type": "string"
54
+ },
55
+ "missingDatasets": {
56
+ "type": "array",
57
+ "items": {
58
+ "type": "string"
59
+ }
60
+ }
61
+ },
62
+ "required": [
63
+ "question",
64
+ "reason"
65
+ ],
66
+ "additionalProperties": false
67
+ }
68
+ },
69
+ "notes": {
70
+ "type": "array",
71
+ "items": {
72
+ "type": "string"
73
+ }
74
+ }
75
+ },
76
+ "required": [
77
+ "selectedEvidenceIds"
78
+ ],
79
+ "additionalProperties": false
80
+ }
81
+ },
82
+ "$schema": "http://json-schema.org/draft-07/schema#"
83
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "title": "RetrievalPlan",
4
+ "type": "object",
5
+ "properties": {
6
+ "planId": { "type": "string" },
7
+ "rationale": { "type": "string" },
8
+ "steps": { "type": "array", "minItems": 1 },
9
+ "selections": { "type": "array" },
10
+ "answerDraft": { "type": "string" }
11
+ },
12
+ "required": ["planId", "rationale", "steps"]
13
+ }
@@ -0,0 +1,73 @@
1
+ {
2
+ "$ref": "#/definitions/RetrievalPlan",
3
+ "definitions": {
4
+ "RetrievalPlan": {
5
+ "type": "object",
6
+ "properties": {
7
+ "planId": {
8
+ "type": "string",
9
+ "minLength": 1
10
+ },
11
+ "objective": {
12
+ "type": "string",
13
+ "minLength": 1
14
+ },
15
+ "profiles": {
16
+ "type": "array",
17
+ "items": {
18
+ "type": "string"
19
+ }
20
+ },
21
+ "steps": {
22
+ "type": "array",
23
+ "items": {
24
+ "type": "object",
25
+ "properties": {
26
+ "stepId": {
27
+ "type": "string",
28
+ "minLength": 1
29
+ },
30
+ "operationId": {
31
+ "type": "string",
32
+ "minLength": 1
33
+ },
34
+ "arguments": {
35
+ "type": "object",
36
+ "additionalProperties": {}
37
+ },
38
+ "dependsOn": {
39
+ "type": "array",
40
+ "items": {
41
+ "type": "string"
42
+ }
43
+ },
44
+ "purpose": {
45
+ "type": "string"
46
+ },
47
+ "optional": {
48
+ "type": "boolean"
49
+ }
50
+ },
51
+ "required": [
52
+ "stepId",
53
+ "operationId",
54
+ "arguments",
55
+ "dependsOn",
56
+ "purpose",
57
+ "optional"
58
+ ],
59
+ "additionalProperties": false
60
+ }
61
+ }
62
+ },
63
+ "required": [
64
+ "planId",
65
+ "objective",
66
+ "profiles",
67
+ "steps"
68
+ ],
69
+ "additionalProperties": false
70
+ }
71
+ },
72
+ "$schema": "http://json-schema.org/draft-07/schema#"
73
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "title": "RetrievalStep",
4
+ "type": "object",
5
+ "properties": {
6
+ "id": { "type": "string" },
7
+ "capability": { "type": "string" },
8
+ "catalogEntryId": { "type": "string" },
9
+ "args": { "type": "object" },
10
+ "parallelGroup": { "type": "string" },
11
+ "required": { "type": "boolean" }
12
+ },
13
+ "required": ["id", "capability", "catalogEntryId"]
14
+ }