archctx-contracts 0.17.1 → 0.18.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.
Files changed (112) hide show
  1. package/fixtures/valid/archctx-capabilities.json +2 -2
  2. package/fixtures/valid/product-version-manifest.json +4 -10
  3. package/package.json +4 -1
  4. package/schemas/repo/refactor-decision.schema.json +307 -37
  5. package/schemas/runtime/archctx-capabilities.schema.json +144 -20
  6. package/schemas/runtime/architecture-debt-delta.schema.json +58 -19
  7. package/schemas/runtime/architecture-debt.schema.json +42 -42
  8. package/schemas/runtime/architecture-event.schema.json +1 -1
  9. package/schemas/runtime/architecture-history.schema.json +354 -0
  10. package/schemas/runtime/capability-dependencies.schema.json +266 -59
  11. package/schemas/runtime/cli-check.schema.json +209 -0
  12. package/schemas/runtime/cli-help.schema.json +28 -0
  13. package/schemas/runtime/dependency-constraint-evaluation.schema.json +67 -68
  14. package/schemas/runtime/docs-anchors.schema.json +262 -67
  15. package/schemas/runtime/doctor-code-facts.schema.json +49 -0
  16. package/schemas/runtime/evidence-binding.schema.json +1 -1
  17. package/schemas/runtime/flow-selector-check.schema.json +179 -46
  18. package/schemas/runtime/hook-debt-checkpoint.schema.json +12 -12
  19. package/schemas/runtime/index-seed.schema.json +56 -0
  20. package/schemas/runtime/path-context.schema.json +120 -0
  21. package/schemas/runtime/product-version-manifest.schema.json +142 -54
  22. package/schemas/runtime/projection-slice.schema.json +34 -34
  23. package/schemas/runtime/recommendation-v3.schema.json +372 -1
  24. package/schemas/runtime/ref-impact-batch-request.schema.json +20 -7
  25. package/schemas/runtime/ref-impact-batch.schema.json +83 -13
  26. package/schemas/runtime/ref-impact.schema.json +68 -61
  27. package/schemas/runtime/refactor-scan-v2.schema.json +1392 -0
  28. package/schemas/runtime/refactor-simulate.schema.json +553 -0
  29. package/schemas/runtime/refactor-verify-v2.schema.json +172 -0
  30. package/schemas/runtime/resolve-path.schema.json +69 -0
  31. package/schemas/runtime/runtime-recommendation-show.schema.json +531 -2
  32. package/schemas/runtime/runtime-refactor-scan.schema.json +498 -2
  33. package/schemas/runtime/runtime-verify.schema.json +274 -56
  34. package/schemas/runtime/state-machine-check.schema.json +357 -89
  35. package/schemas/runtime/structural-observation-payload.schema.json +372 -1
  36. package/schemas/runtime/sync-check.schema.json +77 -0
  37. package/src/architecture-debt.ts +125 -38
  38. package/src/architecture-history.ts +168 -42
  39. package/src/architecture.ts +100 -0
  40. package/src/cli-read.ts +228 -0
  41. package/src/docs-anchors.ts +105 -50
  42. package/src/explorer-occurrence-ports.ts +175 -0
  43. package/src/explorer-query-ports.ts +270 -0
  44. package/src/failure.ts +4 -0
  45. package/src/index-seed.ts +42 -0
  46. package/src/index.ts +5 -0
  47. package/src/ledger-records.ts +262 -0
  48. package/src/ledger.ts +27 -566
  49. package/src/ownership-dependencies.ts +115 -5
  50. package/src/ports.ts +6 -541
  51. package/src/product-version.ts +74 -55
  52. package/src/projection-apply-types.ts +216 -0
  53. package/src/projection-apply-validators.ts +355 -0
  54. package/src/projection-capabilities.ts +181 -0
  55. package/src/projection-constants.ts +317 -0
  56. package/src/projection-manifest-types.ts +298 -0
  57. package/src/projection-manifest.ts +12 -299
  58. package/src/projection-recovery-validators.ts +229 -0
  59. package/src/projection-request-validators.ts +326 -0
  60. package/src/projection-types.ts +365 -0
  61. package/src/projection-validation-helpers.ts +15 -0
  62. package/src/projection.ts +7 -1689
  63. package/src/ref-impact.ts +225 -33
  64. package/src/refactor-constants.ts +213 -0
  65. package/src/refactor-decision-validators.ts +351 -0
  66. package/src/refactor-evidence-types.ts +286 -0
  67. package/src/refactor-observation-validators.ts +359 -0
  68. package/src/refactor-resolution-validators.ts +229 -0
  69. package/src/refactor-snapshot-validators.ts +368 -0
  70. package/src/refactor-types.ts +270 -0
  71. package/src/refactor-v2.ts +554 -0
  72. package/src/refactor-validation-helpers.ts +199 -0
  73. package/src/refactor.ts +7 -1849
  74. package/src/review-guards.ts +3 -23
  75. package/src/runtime-verify.ts +87 -0
  76. package/src/schema-kit.ts +187 -0
  77. package/src/schema-registry.ts +73 -0
  78. package/src/schema.ts +15 -4
  79. package/src/state-machine-schemas.ts +192 -0
  80. package/src/state-machine-types.ts +188 -0
  81. package/src/state-machine.ts +9 -189
  82. package/fixtures/boundary/agent-job-expired.json +0 -33
  83. package/fixtures/invalid/adapter-fidelity-reverse-sync.json +0 -9
  84. package/fixtures/invalid/agent-job-direct-mutation.json +0 -32
  85. package/fixtures/invalid/cloud-egress-envelope-private-field.json +0 -12
  86. package/fixtures/invalid/investigation-report-direct-mutation.json +0 -38
  87. package/fixtures/invalid/investigation-report-missing-proposed-delta.json +0 -19
  88. package/fixtures/invalid/notification-event-code-field.json +0 -11
  89. package/fixtures/valid/adapter-fidelity.json +0 -9
  90. package/fixtures/valid/agent-job.json +0 -33
  91. package/fixtures/valid/architecture-candidate-delta-policy.json +0 -45
  92. package/fixtures/valid/architecture-candidate-delta.json +0 -188
  93. package/fixtures/valid/chatgpt-ga-tool.json +0 -9
  94. package/fixtures/valid/cloud-egress-envelope.json +0 -11
  95. package/fixtures/valid/entitlement.json +0 -12
  96. package/fixtures/valid/investigation-report.json +0 -38
  97. package/fixtures/valid/likec4-mapping.json +0 -14
  98. package/fixtures/valid/notification-event.json +0 -10
  99. package/fixtures/valid/notification-provider.json +0 -12
  100. package/fixtures/valid/structurizr-mapping.json +0 -15
  101. package/schemas/cloud/cloud-egress-envelope.schema.json +0 -19
  102. package/schemas/cloud/entitlement.schema.json +0 -24
  103. package/schemas/integrations/adapter-fidelity.schema.json +0 -21
  104. package/schemas/integrations/chatgpt-ga-tool.schema.json +0 -25
  105. package/schemas/integrations/likec4-mapping.schema.json +0 -32
  106. package/schemas/integrations/structurizr-mapping.schema.json +0 -33
  107. package/schemas/runtime/agent-job.schema.json +0 -63
  108. package/schemas/runtime/architecture-candidate-delta-policy.schema.json +0 -129
  109. package/schemas/runtime/architecture-candidate-delta.schema.json +0 -386
  110. package/schemas/runtime/investigation-report.schema.json +0 -119
  111. package/schemas/runtime/notification-event.schema.json +0 -18
  112. package/schemas/runtime/notification-provider.schema.json +0 -26
@@ -0,0 +1,1392 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://archcontext.dev/schemas/runtime/refactor-scan-v2.schema.json",
4
+ "title": "RefactorScanV2",
5
+ "description": "v2 Stage 5 deterministic refactor radar output for `archctx scan --json` (#643).",
6
+ "additionalProperties": false,
7
+ "type": "object",
8
+ "required": [
9
+ "schemaVersion",
10
+ "scope",
11
+ "headSha",
12
+ "snapshotDigest",
13
+ "coverage",
14
+ "findings",
15
+ "suppressed"
16
+ ],
17
+ "properties": {
18
+ "schemaVersion": {
19
+ "const": "archcontext.refactor-scan/v2"
20
+ },
21
+ "scope": {
22
+ "oneOf": [
23
+ {
24
+ "additionalProperties": false,
25
+ "type": "object",
26
+ "required": [
27
+ "kind"
28
+ ],
29
+ "properties": {
30
+ "kind": {
31
+ "const": "repository"
32
+ }
33
+ }
34
+ },
35
+ {
36
+ "additionalProperties": false,
37
+ "type": "object",
38
+ "required": [
39
+ "kind",
40
+ "nodeId"
41
+ ],
42
+ "properties": {
43
+ "kind": {
44
+ "const": "node"
45
+ },
46
+ "nodeId": {
47
+ "minLength": 1,
48
+ "type": "string"
49
+ }
50
+ }
51
+ },
52
+ {
53
+ "additionalProperties": false,
54
+ "type": "object",
55
+ "required": [
56
+ "kind",
57
+ "paths"
58
+ ],
59
+ "properties": {
60
+ "kind": {
61
+ "const": "paths"
62
+ },
63
+ "paths": {
64
+ "uniqueItems": true,
65
+ "minItems": 1,
66
+ "type": "array",
67
+ "items": {
68
+ "type": "string",
69
+ "minLength": 1,
70
+ "not": {
71
+ "anyOf": [
72
+ {
73
+ "pattern": "^/"
74
+ },
75
+ {
76
+ "pattern": "/$"
77
+ },
78
+ {
79
+ "pattern": "//"
80
+ },
81
+ {
82
+ "pattern": "\\\\"
83
+ },
84
+ {
85
+ "pattern": "^[A-Za-z]:"
86
+ },
87
+ {
88
+ "pattern": "[\\u0000-\\u001f\\u007f]"
89
+ },
90
+ {
91
+ "pattern": "(^|/)\\.\\.?(/|$)"
92
+ }
93
+ ]
94
+ }
95
+ }
96
+ }
97
+ }
98
+ }
99
+ ]
100
+ },
101
+ "headSha": {
102
+ "pattern": "^[a-f0-9]{40}$",
103
+ "type": "string"
104
+ },
105
+ "snapshotDigest": {
106
+ "pattern": "^sha256:[a-f0-9]{64}$",
107
+ "type": "string"
108
+ },
109
+ "importNodeLimit": {
110
+ "minimum": 1,
111
+ "type": "integer"
112
+ },
113
+ "coverage": {
114
+ "additionalProperties": false,
115
+ "type": "object",
116
+ "required": [
117
+ "imports",
118
+ "gitHistory",
119
+ "reasonCodes"
120
+ ],
121
+ "properties": {
122
+ "imports": {
123
+ "type": "string",
124
+ "enum": [
125
+ "complete",
126
+ "partial",
127
+ "unavailable"
128
+ ]
129
+ },
130
+ "gitHistory": {
131
+ "type": "string",
132
+ "enum": [
133
+ "complete",
134
+ "shallow",
135
+ "unavailable"
136
+ ]
137
+ },
138
+ "reasonCodes": {
139
+ "uniqueItems": true,
140
+ "type": "array",
141
+ "items": {
142
+ "minLength": 1,
143
+ "maxLength": 1024,
144
+ "type": "string"
145
+ }
146
+ }
147
+ }
148
+ },
149
+ "findings": {
150
+ "type": "array",
151
+ "items": {
152
+ "additionalProperties": false,
153
+ "type": "object",
154
+ "required": [
155
+ "recommendationId",
156
+ "fingerprint",
157
+ "detector",
158
+ "severity",
159
+ "blocking",
160
+ "capabilityId",
161
+ "affectedNodeIds",
162
+ "affectedPaths",
163
+ "killList",
164
+ "metrics",
165
+ "evidence"
166
+ ],
167
+ "properties": {
168
+ "recommendationId": {
169
+ "pattern": "^recommendation\\.[a-f0-9]{16}$",
170
+ "type": "string"
171
+ },
172
+ "fingerprint": {
173
+ "pattern": "^sha256:[a-f0-9]{64}$",
174
+ "type": "string"
175
+ },
176
+ "detector": {
177
+ "type": "string",
178
+ "enum": [
179
+ "file-cycle",
180
+ "component-cycle",
181
+ "god-file",
182
+ "low-cohesion-god-file",
183
+ "entrypoint-bypass",
184
+ "undeclared-dependency",
185
+ "purity-violation",
186
+ "dead-public-export",
187
+ "unstable-dependency",
188
+ "shotgun-surgery-hotspot",
189
+ "co-change-coupling"
190
+ ]
191
+ },
192
+ "severity": {
193
+ "enum": [
194
+ "notice",
195
+ "warning",
196
+ "error",
197
+ "critical"
198
+ ]
199
+ },
200
+ "blocking": {
201
+ "type": "boolean"
202
+ },
203
+ "capabilityId": {
204
+ "minLength": 1,
205
+ "type": [
206
+ "string",
207
+ "null"
208
+ ]
209
+ },
210
+ "affectedNodeIds": {
211
+ "uniqueItems": true,
212
+ "type": "array",
213
+ "items": {
214
+ "minLength": 1,
215
+ "type": "string"
216
+ }
217
+ },
218
+ "affectedPaths": {
219
+ "uniqueItems": true,
220
+ "type": "array",
221
+ "items": {
222
+ "type": "string",
223
+ "minLength": 1,
224
+ "not": {
225
+ "anyOf": [
226
+ {
227
+ "pattern": "^/"
228
+ },
229
+ {
230
+ "pattern": "/$"
231
+ },
232
+ {
233
+ "pattern": "//"
234
+ },
235
+ {
236
+ "pattern": "\\\\"
237
+ },
238
+ {
239
+ "pattern": "^[A-Za-z]:"
240
+ },
241
+ {
242
+ "pattern": "[\\u0000-\\u001f\\u007f]"
243
+ },
244
+ {
245
+ "pattern": "(^|/)\\.\\.?(/|$)"
246
+ }
247
+ ]
248
+ }
249
+ }
250
+ },
251
+ "killList": {
252
+ "type": "array",
253
+ "items": {
254
+ "oneOf": [
255
+ {
256
+ "additionalProperties": false,
257
+ "type": "object",
258
+ "required": [
259
+ "kind",
260
+ "target",
261
+ "required"
262
+ ],
263
+ "properties": {
264
+ "kind": {
265
+ "const": "path"
266
+ },
267
+ "target": {
268
+ "type": "string",
269
+ "minLength": 1,
270
+ "not": {
271
+ "anyOf": [
272
+ {
273
+ "pattern": "^/"
274
+ },
275
+ {
276
+ "pattern": "/$"
277
+ },
278
+ {
279
+ "pattern": "//"
280
+ },
281
+ {
282
+ "pattern": "\\\\"
283
+ },
284
+ {
285
+ "pattern": "^[A-Za-z]:"
286
+ },
287
+ {
288
+ "pattern": "[\\u0000-\\u001f\\u007f]"
289
+ },
290
+ {
291
+ "pattern": "(^|/)\\.\\.?(/|$)"
292
+ }
293
+ ]
294
+ }
295
+ },
296
+ "required": {
297
+ "type": "boolean"
298
+ }
299
+ }
300
+ },
301
+ {
302
+ "additionalProperties": false,
303
+ "type": "object",
304
+ "required": [
305
+ "kind",
306
+ "target",
307
+ "required"
308
+ ],
309
+ "properties": {
310
+ "kind": {
311
+ "const": "relation"
312
+ },
313
+ "target": {
314
+ "minLength": 1,
315
+ "type": "string"
316
+ },
317
+ "required": {
318
+ "type": "boolean"
319
+ }
320
+ }
321
+ },
322
+ {
323
+ "additionalProperties": false,
324
+ "type": "object",
325
+ "required": [
326
+ "kind",
327
+ "target",
328
+ "required"
329
+ ],
330
+ "properties": {
331
+ "kind": {
332
+ "const": "symbol"
333
+ },
334
+ "target": {
335
+ "pattern": "^(?![A-Za-z]:)(?!\\.\\.?(?:/|#))[^/#\\s\\\\\\u0000-\\u001f\\u007f]+(?:/(?!\\.\\.?(?:/|#))[^/#\\s\\\\\\u0000-\\u001f\\u007f]+)*#[^#\\s\\u0000-\\u001f\\u007f]+$",
336
+ "type": "string"
337
+ },
338
+ "required": {
339
+ "type": "boolean"
340
+ }
341
+ }
342
+ }
343
+ ]
344
+ }
345
+ },
346
+ "metrics": {
347
+ "type": "object",
348
+ "additionalProperties": {
349
+ "anyOf": [
350
+ {
351
+ "type": "number"
352
+ },
353
+ {
354
+ "type": "null"
355
+ },
356
+ {
357
+ "type": "boolean"
358
+ }
359
+ ]
360
+ }
361
+ },
362
+ "evidence": {
363
+ "additionalProperties": false,
364
+ "type": "object",
365
+ "required": [
366
+ "summary"
367
+ ],
368
+ "properties": {
369
+ "summary": {
370
+ "minLength": 1,
371
+ "maxLength": 1024,
372
+ "type": "string"
373
+ },
374
+ "coChangeSupport": {
375
+ "minimum": 0,
376
+ "type": "integer"
377
+ },
378
+ "coChangeCoverageOk": {
379
+ "type": "boolean"
380
+ },
381
+ "thinDirectionEdgeCount": {
382
+ "minimum": 0,
383
+ "type": "integer"
384
+ },
385
+ "sccSize": {
386
+ "minimum": 0,
387
+ "type": "integer"
388
+ },
389
+ "instabilitySource": {
390
+ "minimum": 0,
391
+ "maximum": 1,
392
+ "type": "number"
393
+ },
394
+ "instabilityTarget": {
395
+ "minimum": 0,
396
+ "maximum": 1,
397
+ "type": "number"
398
+ },
399
+ "testCallerCoverage": {
400
+ "minimum": 0,
401
+ "maximum": 1,
402
+ "type": [
403
+ "number",
404
+ "null"
405
+ ]
406
+ },
407
+ "lcomScore": {
408
+ "minimum": 0,
409
+ "type": "number"
410
+ },
411
+ "splitClusterCount": {
412
+ "minimum": 0,
413
+ "type": "integer"
414
+ },
415
+ "observation": {
416
+ "$ref": "#/$defs/observationEvidence"
417
+ }
418
+ }
419
+ }
420
+ }
421
+ }
422
+ },
423
+ "suppressed": {
424
+ "type": "array",
425
+ "items": {
426
+ "additionalProperties": false,
427
+ "type": "object",
428
+ "required": [
429
+ "recommendationId",
430
+ "detector",
431
+ "decisionStatus",
432
+ "reason"
433
+ ],
434
+ "properties": {
435
+ "recommendationId": {
436
+ "pattern": "^recommendation\\.[a-f0-9]{16}$",
437
+ "type": "string"
438
+ },
439
+ "detector": {
440
+ "type": "string",
441
+ "enum": [
442
+ "file-cycle",
443
+ "component-cycle",
444
+ "god-file",
445
+ "low-cohesion-god-file",
446
+ "entrypoint-bypass",
447
+ "undeclared-dependency",
448
+ "purity-violation",
449
+ "dead-public-export",
450
+ "unstable-dependency",
451
+ "shotgun-surgery-hotspot",
452
+ "co-change-coupling"
453
+ ]
454
+ },
455
+ "decisionStatus": {
456
+ "type": "string",
457
+ "enum": [
458
+ "deferred",
459
+ "rejected",
460
+ "waived",
461
+ "resolved"
462
+ ]
463
+ },
464
+ "reason": {
465
+ "minLength": 1,
466
+ "maxLength": 1024,
467
+ "type": "string"
468
+ }
469
+ }
470
+ }
471
+ }
472
+ },
473
+ "$defs": {
474
+ "evidenceImportEdge": {
475
+ "additionalProperties": false,
476
+ "type": "object",
477
+ "required": [
478
+ "fromPath",
479
+ "fromLine",
480
+ "toPath",
481
+ "specifier",
482
+ "fromNodeId",
483
+ "toNodeId"
484
+ ],
485
+ "properties": {
486
+ "fromPath": {
487
+ "type": "string",
488
+ "minLength": 1,
489
+ "not": {
490
+ "anyOf": [
491
+ {
492
+ "pattern": "^/"
493
+ },
494
+ {
495
+ "pattern": "/$"
496
+ },
497
+ {
498
+ "pattern": "//"
499
+ },
500
+ {
501
+ "pattern": "\\\\"
502
+ },
503
+ {
504
+ "pattern": "^[A-Za-z]:"
505
+ },
506
+ {
507
+ "pattern": "[\\u0000-\\u001f\\u007f]"
508
+ },
509
+ {
510
+ "pattern": "(^|/)\\.\\.?(/|$)"
511
+ }
512
+ ]
513
+ }
514
+ },
515
+ "fromLine": {
516
+ "minimum": 1,
517
+ "type": [
518
+ "integer",
519
+ "null"
520
+ ]
521
+ },
522
+ "toPath": {
523
+ "type": "string",
524
+ "minLength": 1,
525
+ "not": {
526
+ "anyOf": [
527
+ {
528
+ "pattern": "^/"
529
+ },
530
+ {
531
+ "pattern": "/$"
532
+ },
533
+ {
534
+ "pattern": "//"
535
+ },
536
+ {
537
+ "pattern": "\\\\"
538
+ },
539
+ {
540
+ "pattern": "^[A-Za-z]:"
541
+ },
542
+ {
543
+ "pattern": "[\\u0000-\\u001f\\u007f]"
544
+ },
545
+ {
546
+ "pattern": "(^|/)\\.\\.?(/|$)"
547
+ }
548
+ ]
549
+ }
550
+ },
551
+ "specifier": {
552
+ "minLength": 1,
553
+ "type": "string"
554
+ },
555
+ "fromNodeId": {
556
+ "minLength": 1,
557
+ "type": "string"
558
+ },
559
+ "toNodeId": {
560
+ "minLength": 1,
561
+ "type": "string"
562
+ }
563
+ }
564
+ },
565
+ "evidencePairDirection": {
566
+ "additionalProperties": false,
567
+ "type": "object",
568
+ "required": [
569
+ "fromNodeId",
570
+ "toNodeId",
571
+ "totalCount",
572
+ "sampledCount"
573
+ ],
574
+ "properties": {
575
+ "fromNodeId": {
576
+ "minLength": 1,
577
+ "type": "string"
578
+ },
579
+ "toNodeId": {
580
+ "minLength": 1,
581
+ "type": "string"
582
+ },
583
+ "totalCount": {
584
+ "minimum": 0,
585
+ "type": "integer"
586
+ },
587
+ "sampledCount": {
588
+ "minimum": 0,
589
+ "type": "integer"
590
+ }
591
+ }
592
+ },
593
+ "evidenceDirectionViolation": {
594
+ "additionalProperties": false,
595
+ "type": "object",
596
+ "required": [
597
+ "constraintId",
598
+ "fromPath",
599
+ "fromLine",
600
+ "toPath",
601
+ "specifier",
602
+ "fromNodeId",
603
+ "toNodeId"
604
+ ],
605
+ "properties": {
606
+ "constraintId": {
607
+ "minLength": 1,
608
+ "type": "string"
609
+ },
610
+ "fromPath": {
611
+ "type": "string",
612
+ "minLength": 1,
613
+ "not": {
614
+ "anyOf": [
615
+ {
616
+ "pattern": "^/"
617
+ },
618
+ {
619
+ "pattern": "/$"
620
+ },
621
+ {
622
+ "pattern": "//"
623
+ },
624
+ {
625
+ "pattern": "\\\\"
626
+ },
627
+ {
628
+ "pattern": "^[A-Za-z]:"
629
+ },
630
+ {
631
+ "pattern": "[\\u0000-\\u001f\\u007f]"
632
+ },
633
+ {
634
+ "pattern": "(^|/)\\.\\.?(/|$)"
635
+ }
636
+ ]
637
+ }
638
+ },
639
+ "fromLine": {
640
+ "minimum": 1,
641
+ "type": [
642
+ "integer",
643
+ "null"
644
+ ]
645
+ },
646
+ "toPath": {
647
+ "type": "string",
648
+ "minLength": 1,
649
+ "not": {
650
+ "anyOf": [
651
+ {
652
+ "pattern": "^/"
653
+ },
654
+ {
655
+ "pattern": "/$"
656
+ },
657
+ {
658
+ "pattern": "//"
659
+ },
660
+ {
661
+ "pattern": "\\\\"
662
+ },
663
+ {
664
+ "pattern": "^[A-Za-z]:"
665
+ },
666
+ {
667
+ "pattern": "[\\u0000-\\u001f\\u007f]"
668
+ },
669
+ {
670
+ "pattern": "(^|/)\\.\\.?(/|$)"
671
+ }
672
+ ]
673
+ }
674
+ },
675
+ "specifier": {
676
+ "minLength": 1,
677
+ "type": "string"
678
+ },
679
+ "fromNodeId": {
680
+ "minLength": 1,
681
+ "type": "string"
682
+ },
683
+ "toNodeId": {
684
+ "minLength": 1,
685
+ "type": "string"
686
+ }
687
+ }
688
+ },
689
+ "evidencePathEntry": {
690
+ "additionalProperties": false,
691
+ "type": "object",
692
+ "required": [
693
+ "path",
694
+ "candidateOwnerNodeIds",
695
+ "candidateOwnerCount"
696
+ ],
697
+ "properties": {
698
+ "path": {
699
+ "type": "string",
700
+ "minLength": 1,
701
+ "not": {
702
+ "anyOf": [
703
+ {
704
+ "pattern": "^/"
705
+ },
706
+ {
707
+ "pattern": "/$"
708
+ },
709
+ {
710
+ "pattern": "//"
711
+ },
712
+ {
713
+ "pattern": "\\\\"
714
+ },
715
+ {
716
+ "pattern": "^[A-Za-z]:"
717
+ },
718
+ {
719
+ "pattern": "[\\u0000-\\u001f\\u007f]"
720
+ },
721
+ {
722
+ "pattern": "(^|/)\\.\\.?(/|$)"
723
+ }
724
+ ]
725
+ }
726
+ },
727
+ "candidateOwnerNodeIds": {
728
+ "uniqueItems": true,
729
+ "type": "array",
730
+ "items": {
731
+ "minLength": 1,
732
+ "type": "string"
733
+ }
734
+ },
735
+ "candidateOwnerCount": {
736
+ "minimum": 0,
737
+ "type": "integer"
738
+ }
739
+ }
740
+ },
741
+ "evidenceUnresolvedImport": {
742
+ "additionalProperties": false,
743
+ "type": "object",
744
+ "required": [
745
+ "fromPath",
746
+ "fromLine",
747
+ "specifier"
748
+ ],
749
+ "properties": {
750
+ "fromPath": {
751
+ "type": "string",
752
+ "minLength": 1,
753
+ "not": {
754
+ "anyOf": [
755
+ {
756
+ "pattern": "^/"
757
+ },
758
+ {
759
+ "pattern": "/$"
760
+ },
761
+ {
762
+ "pattern": "//"
763
+ },
764
+ {
765
+ "pattern": "\\\\"
766
+ },
767
+ {
768
+ "pattern": "^[A-Za-z]:"
769
+ },
770
+ {
771
+ "pattern": "[\\u0000-\\u001f\\u007f]"
772
+ },
773
+ {
774
+ "pattern": "(^|/)\\.\\.?(/|$)"
775
+ }
776
+ ]
777
+ }
778
+ },
779
+ "fromLine": {
780
+ "minimum": 1,
781
+ "type": [
782
+ "integer",
783
+ "null"
784
+ ]
785
+ },
786
+ "specifier": {
787
+ "minLength": 1,
788
+ "type": "string"
789
+ }
790
+ }
791
+ },
792
+ "evidenceLowCohesionCluster": {
793
+ "additionalProperties": false,
794
+ "type": "object",
795
+ "required": [
796
+ "symbols",
797
+ "startLine",
798
+ "endLine",
799
+ "intraClusterEdges",
800
+ "crossClusterEdges"
801
+ ],
802
+ "properties": {
803
+ "symbols": {
804
+ "uniqueItems": true,
805
+ "type": "array",
806
+ "items": {
807
+ "minLength": 1,
808
+ "type": "string"
809
+ }
810
+ },
811
+ "startLine": {
812
+ "minimum": 1,
813
+ "type": "integer"
814
+ },
815
+ "endLine": {
816
+ "minimum": 1,
817
+ "type": "integer"
818
+ },
819
+ "intraClusterEdges": {
820
+ "minimum": 0,
821
+ "type": "integer"
822
+ },
823
+ "crossClusterEdges": {
824
+ "minimum": 0,
825
+ "type": "integer"
826
+ }
827
+ }
828
+ },
829
+ "evidenceLowCohesionFile": {
830
+ "additionalProperties": false,
831
+ "type": "object",
832
+ "required": [
833
+ "path",
834
+ "lineCount",
835
+ "topLevelSymbolCount",
836
+ "clusterCount",
837
+ "clusters"
838
+ ],
839
+ "properties": {
840
+ "path": {
841
+ "type": "string",
842
+ "minLength": 1,
843
+ "not": {
844
+ "anyOf": [
845
+ {
846
+ "pattern": "^/"
847
+ },
848
+ {
849
+ "pattern": "/$"
850
+ },
851
+ {
852
+ "pattern": "//"
853
+ },
854
+ {
855
+ "pattern": "\\\\"
856
+ },
857
+ {
858
+ "pattern": "^[A-Za-z]:"
859
+ },
860
+ {
861
+ "pattern": "[\\u0000-\\u001f\\u007f]"
862
+ },
863
+ {
864
+ "pattern": "(^|/)\\.\\.?(/|$)"
865
+ }
866
+ ]
867
+ }
868
+ },
869
+ "lineCount": {
870
+ "minimum": 0,
871
+ "type": "integer"
872
+ },
873
+ "topLevelSymbolCount": {
874
+ "minimum": 0,
875
+ "type": "integer"
876
+ },
877
+ "clusterCount": {
878
+ "minimum": 0,
879
+ "type": "integer"
880
+ },
881
+ "clusters": {
882
+ "type": "array",
883
+ "items": {
884
+ "$ref": "#/$defs/evidenceLowCohesionCluster"
885
+ }
886
+ }
887
+ }
888
+ },
889
+ "evidenceUnstableTarget": {
890
+ "additionalProperties": false,
891
+ "type": "object",
892
+ "required": [
893
+ "targetNodeId",
894
+ "targetInstability",
895
+ "delta",
896
+ "edgeCount"
897
+ ],
898
+ "properties": {
899
+ "targetNodeId": {
900
+ "minLength": 1,
901
+ "type": "string"
902
+ },
903
+ "targetInstability": {
904
+ "minimum": 0,
905
+ "maximum": 1,
906
+ "type": "number"
907
+ },
908
+ "delta": {
909
+ "minimum": -1,
910
+ "maximum": 1,
911
+ "type": "number"
912
+ },
913
+ "edgeCount": {
914
+ "minimum": 1,
915
+ "type": "integer"
916
+ }
917
+ }
918
+ },
919
+ "evidenceCoChangePair": {
920
+ "additionalProperties": false,
921
+ "type": "object",
922
+ "required": [
923
+ "pathA",
924
+ "pathB",
925
+ "coChangeCount",
926
+ "jaccard"
927
+ ],
928
+ "properties": {
929
+ "pathA": {
930
+ "type": "string",
931
+ "minLength": 1,
932
+ "not": {
933
+ "anyOf": [
934
+ {
935
+ "pattern": "^/"
936
+ },
937
+ {
938
+ "pattern": "/$"
939
+ },
940
+ {
941
+ "pattern": "//"
942
+ },
943
+ {
944
+ "pattern": "\\\\"
945
+ },
946
+ {
947
+ "pattern": "^[A-Za-z]:"
948
+ },
949
+ {
950
+ "pattern": "[\\u0000-\\u001f\\u007f]"
951
+ },
952
+ {
953
+ "pattern": "(^|/)\\.\\.?(/|$)"
954
+ }
955
+ ]
956
+ }
957
+ },
958
+ "pathB": {
959
+ "type": "string",
960
+ "minLength": 1,
961
+ "not": {
962
+ "anyOf": [
963
+ {
964
+ "pattern": "^/"
965
+ },
966
+ {
967
+ "pattern": "/$"
968
+ },
969
+ {
970
+ "pattern": "//"
971
+ },
972
+ {
973
+ "pattern": "\\\\"
974
+ },
975
+ {
976
+ "pattern": "^[A-Za-z]:"
977
+ },
978
+ {
979
+ "pattern": "[\\u0000-\\u001f\\u007f]"
980
+ },
981
+ {
982
+ "pattern": "(^|/)\\.\\.?(/|$)"
983
+ }
984
+ ]
985
+ }
986
+ },
987
+ "coChangeCount": {
988
+ "minimum": 1,
989
+ "type": "integer"
990
+ },
991
+ "jaccard": {
992
+ "minimum": 0,
993
+ "maximum": 1,
994
+ "type": "number"
995
+ }
996
+ }
997
+ },
998
+ "observationEvidence": {
999
+ "oneOf": [
1000
+ {
1001
+ "additionalProperties": false,
1002
+ "type": "object",
1003
+ "required": [
1004
+ "kind",
1005
+ "memberNodeIds",
1006
+ "directions",
1007
+ "edges",
1008
+ "totalCount",
1009
+ "truncated"
1010
+ ],
1011
+ "properties": {
1012
+ "kind": {
1013
+ "const": "cycle"
1014
+ },
1015
+ "memberNodeIds": {
1016
+ "uniqueItems": true,
1017
+ "type": "array",
1018
+ "items": {
1019
+ "minLength": 1,
1020
+ "type": "string"
1021
+ }
1022
+ },
1023
+ "directions": {
1024
+ "type": "array",
1025
+ "items": {
1026
+ "$ref": "#/$defs/evidencePairDirection"
1027
+ }
1028
+ },
1029
+ "edges": {
1030
+ "type": "array",
1031
+ "items": {
1032
+ "$ref": "#/$defs/evidenceImportEdge"
1033
+ }
1034
+ },
1035
+ "totalCount": {
1036
+ "minimum": 0,
1037
+ "type": "integer"
1038
+ },
1039
+ "truncated": {
1040
+ "type": "boolean"
1041
+ }
1042
+ }
1043
+ },
1044
+ {
1045
+ "additionalProperties": false,
1046
+ "type": "object",
1047
+ "required": [
1048
+ "kind",
1049
+ "memberNodeIds",
1050
+ "edges",
1051
+ "totalCount",
1052
+ "truncated"
1053
+ ],
1054
+ "properties": {
1055
+ "kind": {
1056
+ "const": "residual-cycle"
1057
+ },
1058
+ "memberNodeIds": {
1059
+ "uniqueItems": true,
1060
+ "type": "array",
1061
+ "items": {
1062
+ "minLength": 1,
1063
+ "type": "string"
1064
+ }
1065
+ },
1066
+ "edges": {
1067
+ "type": "array",
1068
+ "items": {
1069
+ "$ref": "#/$defs/evidenceImportEdge"
1070
+ }
1071
+ },
1072
+ "totalCount": {
1073
+ "minimum": 0,
1074
+ "type": "integer"
1075
+ },
1076
+ "truncated": {
1077
+ "type": "boolean"
1078
+ }
1079
+ }
1080
+ },
1081
+ {
1082
+ "additionalProperties": false,
1083
+ "type": "object",
1084
+ "required": [
1085
+ "kind",
1086
+ "constraintIds",
1087
+ "constraintCount",
1088
+ "violations",
1089
+ "totalCount",
1090
+ "truncated"
1091
+ ],
1092
+ "properties": {
1093
+ "kind": {
1094
+ "const": "direction-violation"
1095
+ },
1096
+ "constraintIds": {
1097
+ "uniqueItems": true,
1098
+ "type": "array",
1099
+ "items": {
1100
+ "minLength": 1,
1101
+ "type": "string"
1102
+ }
1103
+ },
1104
+ "constraintCount": {
1105
+ "minimum": 0,
1106
+ "type": "integer"
1107
+ },
1108
+ "violations": {
1109
+ "type": "array",
1110
+ "items": {
1111
+ "$ref": "#/$defs/evidenceDirectionViolation"
1112
+ }
1113
+ },
1114
+ "totalCount": {
1115
+ "minimum": 0,
1116
+ "type": "integer"
1117
+ },
1118
+ "truncated": {
1119
+ "type": "boolean"
1120
+ }
1121
+ }
1122
+ },
1123
+ {
1124
+ "additionalProperties": false,
1125
+ "type": "object",
1126
+ "required": [
1127
+ "kind",
1128
+ "paths",
1129
+ "totalCount",
1130
+ "truncated"
1131
+ ],
1132
+ "properties": {
1133
+ "kind": {
1134
+ "type": "string",
1135
+ "enum": [
1136
+ "ownership-ambiguous",
1137
+ "undeclared-footprint",
1138
+ "unowned-paths"
1139
+ ]
1140
+ },
1141
+ "paths": {
1142
+ "type": "array",
1143
+ "items": {
1144
+ "$ref": "#/$defs/evidencePathEntry"
1145
+ }
1146
+ },
1147
+ "totalCount": {
1148
+ "minimum": 0,
1149
+ "type": "integer"
1150
+ },
1151
+ "truncated": {
1152
+ "type": "boolean"
1153
+ }
1154
+ }
1155
+ },
1156
+ {
1157
+ "additionalProperties": false,
1158
+ "type": "object",
1159
+ "required": [
1160
+ "kind",
1161
+ "coverage",
1162
+ "reasonCodes",
1163
+ "unresolvedImports",
1164
+ "totalCount",
1165
+ "truncated"
1166
+ ],
1167
+ "properties": {
1168
+ "kind": {
1169
+ "const": "evidence-gap"
1170
+ },
1171
+ "coverage": {
1172
+ "type": "string",
1173
+ "enum": [
1174
+ "complete",
1175
+ "partial",
1176
+ "unknown"
1177
+ ]
1178
+ },
1179
+ "reasonCodes": {
1180
+ "uniqueItems": true,
1181
+ "type": "array",
1182
+ "items": {
1183
+ "minLength": 1,
1184
+ "maxLength": 1024,
1185
+ "type": "string"
1186
+ }
1187
+ },
1188
+ "unresolvedImports": {
1189
+ "type": "array",
1190
+ "items": {
1191
+ "$ref": "#/$defs/evidenceUnresolvedImport"
1192
+ }
1193
+ },
1194
+ "totalCount": {
1195
+ "minimum": 0,
1196
+ "type": "integer"
1197
+ },
1198
+ "truncated": {
1199
+ "type": "boolean"
1200
+ }
1201
+ }
1202
+ },
1203
+ {
1204
+ "additionalProperties": false,
1205
+ "type": "object",
1206
+ "required": [
1207
+ "kind",
1208
+ "files",
1209
+ "totalCount",
1210
+ "truncated"
1211
+ ],
1212
+ "properties": {
1213
+ "kind": {
1214
+ "const": "low-cohesion-god-file"
1215
+ },
1216
+ "files": {
1217
+ "type": "array",
1218
+ "items": {
1219
+ "$ref": "#/$defs/evidenceLowCohesionFile"
1220
+ }
1221
+ },
1222
+ "totalCount": {
1223
+ "minimum": 0,
1224
+ "type": "integer"
1225
+ },
1226
+ "truncated": {
1227
+ "type": "boolean"
1228
+ }
1229
+ }
1230
+ },
1231
+ {
1232
+ "additionalProperties": false,
1233
+ "type": "object",
1234
+ "required": [
1235
+ "kind",
1236
+ "declaredEntrypointPaths",
1237
+ "edges",
1238
+ "totalCount",
1239
+ "truncated"
1240
+ ],
1241
+ "properties": {
1242
+ "kind": {
1243
+ "const": "entrypoint-bypass"
1244
+ },
1245
+ "declaredEntrypointPaths": {
1246
+ "uniqueItems": true,
1247
+ "type": "array",
1248
+ "items": {
1249
+ "type": "string",
1250
+ "minLength": 1,
1251
+ "not": {
1252
+ "anyOf": [
1253
+ {
1254
+ "pattern": "^/"
1255
+ },
1256
+ {
1257
+ "pattern": "/$"
1258
+ },
1259
+ {
1260
+ "pattern": "//"
1261
+ },
1262
+ {
1263
+ "pattern": "\\\\"
1264
+ },
1265
+ {
1266
+ "pattern": "^[A-Za-z]:"
1267
+ },
1268
+ {
1269
+ "pattern": "[\\u0000-\\u001f\\u007f]"
1270
+ },
1271
+ {
1272
+ "pattern": "(^|/)\\.\\.?(/|$)"
1273
+ }
1274
+ ]
1275
+ }
1276
+ }
1277
+ },
1278
+ "edges": {
1279
+ "type": "array",
1280
+ "items": {
1281
+ "$ref": "#/$defs/evidenceImportEdge"
1282
+ }
1283
+ },
1284
+ "totalCount": {
1285
+ "minimum": 0,
1286
+ "type": "integer"
1287
+ },
1288
+ "truncated": {
1289
+ "type": "boolean"
1290
+ }
1291
+ }
1292
+ },
1293
+ {
1294
+ "additionalProperties": false,
1295
+ "type": "object",
1296
+ "required": [
1297
+ "kind",
1298
+ "sourceFanIn",
1299
+ "sourceInstability",
1300
+ "targets",
1301
+ "totalCount",
1302
+ "truncated"
1303
+ ],
1304
+ "properties": {
1305
+ "kind": {
1306
+ "const": "unstable-dependency"
1307
+ },
1308
+ "sourceFanIn": {
1309
+ "minimum": 0,
1310
+ "type": "integer"
1311
+ },
1312
+ "sourceInstability": {
1313
+ "minimum": 0,
1314
+ "maximum": 1,
1315
+ "type": "number"
1316
+ },
1317
+ "targets": {
1318
+ "type": "array",
1319
+ "items": {
1320
+ "$ref": "#/$defs/evidenceUnstableTarget"
1321
+ }
1322
+ },
1323
+ "totalCount": {
1324
+ "minimum": 0,
1325
+ "type": "integer"
1326
+ },
1327
+ "truncated": {
1328
+ "type": "boolean"
1329
+ }
1330
+ }
1331
+ },
1332
+ {
1333
+ "additionalProperties": false,
1334
+ "type": "object",
1335
+ "required": [
1336
+ "kind",
1337
+ "memberNodeIds",
1338
+ "coverageStatus",
1339
+ "windowLimit",
1340
+ "observedCommitCount",
1341
+ "pairs",
1342
+ "totalCount",
1343
+ "truncated"
1344
+ ],
1345
+ "properties": {
1346
+ "kind": {
1347
+ "const": "co-change-coupling"
1348
+ },
1349
+ "memberNodeIds": {
1350
+ "uniqueItems": true,
1351
+ "type": "array",
1352
+ "items": {
1353
+ "minLength": 1,
1354
+ "type": "string"
1355
+ }
1356
+ },
1357
+ "coverageStatus": {
1358
+ "type": "string",
1359
+ "enum": [
1360
+ "complete",
1361
+ "shallow",
1362
+ "insufficient-history",
1363
+ "unavailable"
1364
+ ]
1365
+ },
1366
+ "windowLimit": {
1367
+ "minimum": 1,
1368
+ "type": "integer"
1369
+ },
1370
+ "observedCommitCount": {
1371
+ "minimum": 0,
1372
+ "type": "integer"
1373
+ },
1374
+ "pairs": {
1375
+ "type": "array",
1376
+ "items": {
1377
+ "$ref": "#/$defs/evidenceCoChangePair"
1378
+ }
1379
+ },
1380
+ "totalCount": {
1381
+ "minimum": 0,
1382
+ "type": "integer"
1383
+ },
1384
+ "truncated": {
1385
+ "type": "boolean"
1386
+ }
1387
+ }
1388
+ }
1389
+ ]
1390
+ }
1391
+ }
1392
+ }