archctx 0.6.3 → 0.7.1

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.
@@ -0,0 +1,579 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://archcontext.dev/schemas/runtime/structural-observation-payload.schema.json",
4
+ "title": "StructuralObservationPayloadV1",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": [
8
+ "assessmentDigest",
9
+ "kind",
10
+ "affectedNodeIds",
11
+ "baselineSnapshotDigest",
12
+ "derivedOutcomes",
13
+ "metrics",
14
+ "signalIds",
15
+ "evidence"
16
+ ],
17
+ "properties": {
18
+ "assessmentDigest": {
19
+ "$ref": "#/$defs/sha256"
20
+ },
21
+ "kind": {
22
+ "enum": [
23
+ "cycle",
24
+ "direction-violation",
25
+ "evidence-gap",
26
+ "ownership-ambiguous",
27
+ "undeclared-footprint",
28
+ "unowned-paths"
29
+ ]
30
+ },
31
+ "affectedNodeIds": {
32
+ "type": "array",
33
+ "items": {
34
+ "type": "string"
35
+ }
36
+ },
37
+ "baselineSnapshotDigest": {
38
+ "$ref": "#/$defs/sha256"
39
+ },
40
+ "derivedOutcomes": {
41
+ "type": "array",
42
+ "items": {
43
+ "$ref": "#/$defs/targetOutcome"
44
+ }
45
+ },
46
+ "metrics": {
47
+ "$ref": "#/$defs/observationMetrics"
48
+ },
49
+ "signalIds": {
50
+ "type": "array",
51
+ "uniqueItems": true,
52
+ "items": {
53
+ "type": "string"
54
+ }
55
+ },
56
+ "evidence": {
57
+ "$ref": "#/$defs/observationEvidence"
58
+ }
59
+ },
60
+ "allOf": [
61
+ {
62
+ "if": {
63
+ "properties": {
64
+ "kind": {
65
+ "const": "cycle"
66
+ }
67
+ }
68
+ },
69
+ "then": {
70
+ "properties": {
71
+ "evidence": {
72
+ "properties": {
73
+ "kind": {
74
+ "const": "cycle"
75
+ }
76
+ }
77
+ }
78
+ }
79
+ }
80
+ },
81
+ {
82
+ "if": {
83
+ "properties": {
84
+ "kind": {
85
+ "const": "direction-violation"
86
+ }
87
+ }
88
+ },
89
+ "then": {
90
+ "properties": {
91
+ "evidence": {
92
+ "properties": {
93
+ "kind": {
94
+ "const": "direction-violation"
95
+ }
96
+ }
97
+ }
98
+ }
99
+ }
100
+ },
101
+ {
102
+ "if": {
103
+ "properties": {
104
+ "kind": {
105
+ "const": "evidence-gap"
106
+ }
107
+ }
108
+ },
109
+ "then": {
110
+ "properties": {
111
+ "evidence": {
112
+ "properties": {
113
+ "kind": {
114
+ "const": "evidence-gap"
115
+ }
116
+ }
117
+ }
118
+ }
119
+ }
120
+ },
121
+ {
122
+ "if": {
123
+ "properties": {
124
+ "kind": {
125
+ "const": "ownership-ambiguous"
126
+ }
127
+ }
128
+ },
129
+ "then": {
130
+ "properties": {
131
+ "evidence": {
132
+ "properties": {
133
+ "kind": {
134
+ "const": "ownership-ambiguous"
135
+ }
136
+ }
137
+ }
138
+ }
139
+ }
140
+ },
141
+ {
142
+ "if": {
143
+ "properties": {
144
+ "kind": {
145
+ "const": "undeclared-footprint"
146
+ }
147
+ }
148
+ },
149
+ "then": {
150
+ "properties": {
151
+ "evidence": {
152
+ "properties": {
153
+ "kind": {
154
+ "const": "undeclared-footprint"
155
+ }
156
+ }
157
+ }
158
+ }
159
+ }
160
+ },
161
+ {
162
+ "if": {
163
+ "properties": {
164
+ "kind": {
165
+ "const": "unowned-paths"
166
+ }
167
+ }
168
+ },
169
+ "then": {
170
+ "properties": {
171
+ "evidence": {
172
+ "properties": {
173
+ "kind": {
174
+ "const": "unowned-paths"
175
+ }
176
+ }
177
+ }
178
+ }
179
+ }
180
+ }
181
+ ],
182
+ "$defs": {
183
+ "sha256": {
184
+ "type": "string",
185
+ "pattern": "^sha256:[a-f0-9]{64}$"
186
+ },
187
+ "repoRelativePath": {
188
+ "type": "string",
189
+ "minLength": 1,
190
+ "pattern": "^(?!/)(?!.*\\\\)(?!(?:.*/)?\\.\\.(?:/|$)).+$"
191
+ },
192
+ "evidenceLine": {
193
+ "type": [
194
+ "integer",
195
+ "null"
196
+ ],
197
+ "minimum": 1
198
+ },
199
+ "evidenceSpecifier": {
200
+ "type": "string",
201
+ "minLength": 1,
202
+ "maxLength": 512,
203
+ "pattern": "^[^\\u0000-\\u001f\\u007f]+$"
204
+ },
205
+ "evidenceIdList": {
206
+ "type": "array",
207
+ "maxItems": 32,
208
+ "uniqueItems": true,
209
+ "items": {
210
+ "type": "string"
211
+ }
212
+ },
213
+ "observationMetrics": {
214
+ "type": "object",
215
+ "additionalProperties": {
216
+ "type": [
217
+ "number",
218
+ "null"
219
+ ]
220
+ }
221
+ },
222
+ "evidenceImportEdge": {
223
+ "type": "object",
224
+ "additionalProperties": false,
225
+ "required": [
226
+ "fromPath",
227
+ "fromLine",
228
+ "toPath",
229
+ "specifier",
230
+ "fromNodeId",
231
+ "toNodeId"
232
+ ],
233
+ "properties": {
234
+ "fromPath": {
235
+ "$ref": "#/$defs/repoRelativePath"
236
+ },
237
+ "fromLine": {
238
+ "$ref": "#/$defs/evidenceLine"
239
+ },
240
+ "toPath": {
241
+ "$ref": "#/$defs/repoRelativePath"
242
+ },
243
+ "specifier": {
244
+ "$ref": "#/$defs/evidenceSpecifier"
245
+ },
246
+ "fromNodeId": {
247
+ "type": "string",
248
+ "minLength": 1,
249
+ "pattern": "\\S"
250
+ },
251
+ "toNodeId": {
252
+ "type": "string",
253
+ "minLength": 1,
254
+ "pattern": "\\S"
255
+ }
256
+ }
257
+ },
258
+ "evidenceDirectionViolation": {
259
+ "type": "object",
260
+ "additionalProperties": false,
261
+ "required": [
262
+ "fromPath",
263
+ "fromLine",
264
+ "toPath",
265
+ "specifier",
266
+ "fromNodeId",
267
+ "toNodeId",
268
+ "constraintId"
269
+ ],
270
+ "properties": {
271
+ "fromPath": {
272
+ "$ref": "#/$defs/repoRelativePath"
273
+ },
274
+ "fromLine": {
275
+ "$ref": "#/$defs/evidenceLine"
276
+ },
277
+ "toPath": {
278
+ "$ref": "#/$defs/repoRelativePath"
279
+ },
280
+ "specifier": {
281
+ "$ref": "#/$defs/evidenceSpecifier"
282
+ },
283
+ "fromNodeId": {
284
+ "type": "string",
285
+ "minLength": 1,
286
+ "pattern": "\\S"
287
+ },
288
+ "toNodeId": {
289
+ "type": "string",
290
+ "minLength": 1,
291
+ "pattern": "\\S"
292
+ },
293
+ "constraintId": {
294
+ "type": "string"
295
+ }
296
+ }
297
+ },
298
+ "evidencePath": {
299
+ "type": "object",
300
+ "additionalProperties": false,
301
+ "required": [
302
+ "path",
303
+ "candidateOwnerNodeIds",
304
+ "candidateOwnerCount"
305
+ ],
306
+ "properties": {
307
+ "path": {
308
+ "$ref": "#/$defs/repoRelativePath"
309
+ },
310
+ "candidateOwnerNodeIds": {
311
+ "$ref": "#/$defs/evidenceIdList"
312
+ },
313
+ "candidateOwnerCount": {
314
+ "type": "integer",
315
+ "minimum": 0
316
+ }
317
+ }
318
+ },
319
+ "evidenceUnresolvedImport": {
320
+ "type": "object",
321
+ "additionalProperties": false,
322
+ "required": [
323
+ "fromPath",
324
+ "fromLine",
325
+ "specifier"
326
+ ],
327
+ "properties": {
328
+ "fromPath": {
329
+ "$ref": "#/$defs/repoRelativePath"
330
+ },
331
+ "fromLine": {
332
+ "$ref": "#/$defs/evidenceLine"
333
+ },
334
+ "specifier": {
335
+ "$ref": "#/$defs/evidenceSpecifier"
336
+ }
337
+ }
338
+ },
339
+ "observationEvidence": {
340
+ "oneOf": [
341
+ {
342
+ "type": "object",
343
+ "additionalProperties": false,
344
+ "required": [
345
+ "kind",
346
+ "memberNodeIds",
347
+ "edges",
348
+ "totalCount",
349
+ "truncated"
350
+ ],
351
+ "properties": {
352
+ "kind": {
353
+ "const": "cycle"
354
+ },
355
+ "memberNodeIds": {
356
+ "$ref": "#/$defs/evidenceIdList"
357
+ },
358
+ "edges": {
359
+ "type": "array",
360
+ "maxItems": 20,
361
+ "items": {
362
+ "$ref": "#/$defs/evidenceImportEdge"
363
+ }
364
+ },
365
+ "totalCount": {
366
+ "type": "integer",
367
+ "minimum": 0
368
+ },
369
+ "truncated": {
370
+ "type": "boolean"
371
+ }
372
+ }
373
+ },
374
+ {
375
+ "type": "object",
376
+ "additionalProperties": false,
377
+ "required": [
378
+ "kind",
379
+ "constraintIds",
380
+ "constraintCount",
381
+ "violations",
382
+ "totalCount",
383
+ "truncated"
384
+ ],
385
+ "properties": {
386
+ "kind": {
387
+ "const": "direction-violation"
388
+ },
389
+ "constraintIds": {
390
+ "$ref": "#/$defs/evidenceIdList"
391
+ },
392
+ "constraintCount": {
393
+ "type": "integer",
394
+ "minimum": 0
395
+ },
396
+ "violations": {
397
+ "type": "array",
398
+ "maxItems": 20,
399
+ "items": {
400
+ "$ref": "#/$defs/evidenceDirectionViolation"
401
+ }
402
+ },
403
+ "totalCount": {
404
+ "type": "integer",
405
+ "minimum": 0
406
+ },
407
+ "truncated": {
408
+ "type": "boolean"
409
+ }
410
+ }
411
+ },
412
+ {
413
+ "type": "object",
414
+ "additionalProperties": false,
415
+ "required": [
416
+ "kind",
417
+ "paths",
418
+ "totalCount",
419
+ "truncated"
420
+ ],
421
+ "properties": {
422
+ "kind": {
423
+ "enum": [
424
+ "ownership-ambiguous",
425
+ "undeclared-footprint",
426
+ "unowned-paths"
427
+ ]
428
+ },
429
+ "paths": {
430
+ "type": "array",
431
+ "maxItems": 20,
432
+ "items": {
433
+ "$ref": "#/$defs/evidencePath"
434
+ }
435
+ },
436
+ "totalCount": {
437
+ "type": "integer",
438
+ "minimum": 0
439
+ },
440
+ "truncated": {
441
+ "type": "boolean"
442
+ }
443
+ }
444
+ },
445
+ {
446
+ "type": "object",
447
+ "additionalProperties": false,
448
+ "required": [
449
+ "kind",
450
+ "coverage",
451
+ "reasonCodes",
452
+ "unresolvedImports",
453
+ "totalCount",
454
+ "truncated"
455
+ ],
456
+ "properties": {
457
+ "kind": {
458
+ "const": "evidence-gap"
459
+ },
460
+ "coverage": {
461
+ "enum": [
462
+ "complete",
463
+ "partial",
464
+ "unknown"
465
+ ]
466
+ },
467
+ "reasonCodes": {
468
+ "type": "array",
469
+ "uniqueItems": true,
470
+ "items": {
471
+ "enum": [
472
+ "caller-coverage-unknown",
473
+ "code-facts-import-limit",
474
+ "code-facts-missing",
475
+ "code-facts-truncated",
476
+ "major-change-detected",
477
+ "multi-node-scope",
478
+ "node-footprint-undeclared",
479
+ "ownership-ambiguous",
480
+ "single-node-scope",
481
+ "target-unresolved",
482
+ "unowned-paths"
483
+ ]
484
+ }
485
+ },
486
+ "unresolvedImports": {
487
+ "type": "array",
488
+ "maxItems": 20,
489
+ "items": {
490
+ "$ref": "#/$defs/evidenceUnresolvedImport"
491
+ }
492
+ },
493
+ "totalCount": {
494
+ "type": "integer",
495
+ "minimum": 0
496
+ },
497
+ "truncated": {
498
+ "type": "boolean"
499
+ }
500
+ }
501
+ }
502
+ ]
503
+ },
504
+ "targetOutcome": {
505
+ "type": "object",
506
+ "additionalProperties": false,
507
+ "required": [
508
+ "outcomeId",
509
+ "metric",
510
+ "subjectSelectorId",
511
+ "nodeId",
512
+ "operator",
513
+ "value",
514
+ "required"
515
+ ],
516
+ "properties": {
517
+ "outcomeId": {
518
+ "type": "string"
519
+ },
520
+ "metric": {
521
+ "type": "string",
522
+ "minLength": 1,
523
+ "pattern": "\\S"
524
+ },
525
+ "subjectSelectorId": {
526
+ "type": "string"
527
+ },
528
+ "nodeId": {
529
+ "type": [
530
+ "string",
531
+ "null"
532
+ ]
533
+ },
534
+ "operator": {
535
+ "enum": [
536
+ "absent",
537
+ "equals",
538
+ "greater_than",
539
+ "less_than",
540
+ "present"
541
+ ]
542
+ },
543
+ "value": {
544
+ "type": [
545
+ "number",
546
+ "null"
547
+ ]
548
+ },
549
+ "required": {
550
+ "type": "boolean"
551
+ }
552
+ },
553
+ "if": {
554
+ "properties": {
555
+ "operator": {
556
+ "enum": [
557
+ "absent",
558
+ "present"
559
+ ]
560
+ }
561
+ }
562
+ },
563
+ "then": {
564
+ "properties": {
565
+ "value": {
566
+ "type": "null"
567
+ }
568
+ }
569
+ },
570
+ "else": {
571
+ "properties": {
572
+ "value": {
573
+ "type": "number"
574
+ }
575
+ }
576
+ }
577
+ }
578
+ }
579
+ }