@coldtea/pr-lens-schema 0.1.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 (93) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +150 -0
  3. package/dist/apply.d.ts +42 -0
  4. package/dist/apply.d.ts.map +1 -0
  5. package/dist/apply.js +315 -0
  6. package/dist/apply.js.map +1 -0
  7. package/dist/config.d.ts +58 -0
  8. package/dist/config.d.ts.map +1 -0
  9. package/dist/config.js +61 -0
  10. package/dist/config.js.map +1 -0
  11. package/dist/errors.d.ts +24 -0
  12. package/dist/errors.d.ts.map +1 -0
  13. package/dist/errors.js +12 -0
  14. package/dist/errors.js.map +1 -0
  15. package/dist/examples/baseline.d.ts +18 -0
  16. package/dist/examples/baseline.d.ts.map +1 -0
  17. package/dist/examples/baseline.js +433 -0
  18. package/dist/examples/baseline.js.map +1 -0
  19. package/dist/examples/index.d.ts +1194 -0
  20. package/dist/examples/index.d.ts.map +1 -0
  21. package/dist/examples/index.js +20 -0
  22. package/dist/examples/index.js.map +1 -0
  23. package/dist/examples/minimal.d.ts +4 -0
  24. package/dist/examples/minimal.d.ts.map +1 -0
  25. package/dist/examples/minimal.js +25 -0
  26. package/dist/examples/minimal.js.map +1 -0
  27. package/dist/examples/postmark-refactor.d.ts +16 -0
  28. package/dist/examples/postmark-refactor.d.ts.map +1 -0
  29. package/dist/examples/postmark-refactor.js +468 -0
  30. package/dist/examples/postmark-refactor.js.map +1 -0
  31. package/dist/graph.d.ts +568 -0
  32. package/dist/graph.d.ts.map +1 -0
  33. package/dist/graph.js +266 -0
  34. package/dist/graph.js.map +1 -0
  35. package/dist/index.d.ts +12 -0
  36. package/dist/index.d.ts.map +1 -0
  37. package/dist/index.js +12 -0
  38. package/dist/index.js.map +1 -0
  39. package/dist/integrity.d.ts +20 -0
  40. package/dist/integrity.d.ts.map +1 -0
  41. package/dist/integrity.js +167 -0
  42. package/dist/integrity.js.map +1 -0
  43. package/dist/manifest.d.ts +65 -0
  44. package/dist/manifest.d.ts.map +1 -0
  45. package/dist/manifest.js +60 -0
  46. package/dist/manifest.js.map +1 -0
  47. package/dist/patch.d.ts +824 -0
  48. package/dist/patch.d.ts.map +1 -0
  49. package/dist/patch.js +84 -0
  50. package/dist/patch.js.map +1 -0
  51. package/dist/primitives.d.ts +92 -0
  52. package/dist/primitives.d.ts.map +1 -0
  53. package/dist/primitives.js +120 -0
  54. package/dist/primitives.js.map +1 -0
  55. package/dist/utils.d.ts +6 -0
  56. package/dist/utils.d.ts.map +1 -0
  57. package/dist/utils.js +8 -0
  58. package/dist/utils.js.map +1 -0
  59. package/dist/validate.d.ts +18 -0
  60. package/dist/validate.d.ts.map +1 -0
  61. package/dist/validate.js +95 -0
  62. package/dist/validate.js.map +1 -0
  63. package/dist/version.d.ts +21 -0
  64. package/dist/version.d.ts.map +1 -0
  65. package/dist/version.js +24 -0
  66. package/dist/version.js.map +1 -0
  67. package/examples/broadcast-baseline.graph.json +289 -0
  68. package/examples/broadcast-baseline.patch.json +321 -0
  69. package/examples/minimal.graph.json +45 -0
  70. package/examples/postmark-refactor.graph.json +580 -0
  71. package/examples/postmark-refactor.render-manifest.json +67 -0
  72. package/examples/pr-lens.config.json +32 -0
  73. package/json-schema/config.schema.json +153 -0
  74. package/json-schema/graph-doc.schema.json +1032 -0
  75. package/json-schema/patch-doc.schema.json +1383 -0
  76. package/json-schema/render-manifest.schema.json +183 -0
  77. package/package.json +66 -0
  78. package/src/apply.ts +399 -0
  79. package/src/config.ts +69 -0
  80. package/src/errors.ts +34 -0
  81. package/src/examples/baseline.ts +437 -0
  82. package/src/examples/index.ts +25 -0
  83. package/src/examples/minimal.ts +26 -0
  84. package/src/examples/postmark-refactor.ts +480 -0
  85. package/src/graph.ts +331 -0
  86. package/src/index.ts +82 -0
  87. package/src/integrity.ts +216 -0
  88. package/src/manifest.ts +64 -0
  89. package/src/patch.ts +100 -0
  90. package/src/primitives.ts +146 -0
  91. package/src/utils.ts +7 -0
  92. package/src/validate.ts +132 -0
  93. package/src/version.ts +31 -0
@@ -0,0 +1,1032 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://raw.githubusercontent.com/coldteadotai/pr-lens/main/packages/schema/json-schema/graph-doc.schema.json",
4
+ "title": "PR Lens graph document",
5
+ "version": "0.1.0",
6
+ "type": "object",
7
+ "properties": {
8
+ "schemaVersion": {
9
+ "type": "string",
10
+ "pattern": "^0\\.1\\.\\d+$",
11
+ "description": "Contract version the document targets. Current: 0.1.0."
12
+ },
13
+ "kind": {
14
+ "type": "string",
15
+ "const": "graph"
16
+ },
17
+ "id": {
18
+ "description": "Stable id when the document is stored, e.g. a baseline map.",
19
+ "type": "string",
20
+ "minLength": 1,
21
+ "maxLength": 128,
22
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*$"
23
+ },
24
+ "generatedAt": {
25
+ "type": "string",
26
+ "format": "date-time",
27
+ "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
28
+ },
29
+ "title": {
30
+ "type": "string",
31
+ "minLength": 1,
32
+ "maxLength": 120,
33
+ "description": "Short display label."
34
+ },
35
+ "summary": {
36
+ "description": "The one-paragraph answer to 'what does this change do?'",
37
+ "type": "string",
38
+ "minLength": 1,
39
+ "maxLength": 2000
40
+ },
41
+ "lenses": {
42
+ "minItems": 1,
43
+ "maxItems": 8,
44
+ "type": "array",
45
+ "items": {
46
+ "type": "string",
47
+ "enum": [
48
+ "architecture",
49
+ "data-flow"
50
+ ],
51
+ "description": "Rendering lens."
52
+ },
53
+ "description": "Lenses this document carries enough detail to render."
54
+ },
55
+ "provenance": {
56
+ "type": "object",
57
+ "properties": {
58
+ "repo": {
59
+ "type": "object",
60
+ "properties": {
61
+ "owner": {
62
+ "type": "string",
63
+ "minLength": 1,
64
+ "maxLength": 64
65
+ },
66
+ "name": {
67
+ "type": "string",
68
+ "minLength": 1,
69
+ "maxLength": 128
70
+ },
71
+ "host": {
72
+ "default": "github.com",
73
+ "type": "string",
74
+ "minLength": 1,
75
+ "maxLength": 128
76
+ }
77
+ },
78
+ "required": [
79
+ "owner",
80
+ "name"
81
+ ],
82
+ "additionalProperties": false
83
+ },
84
+ "base": {
85
+ "type": "object",
86
+ "properties": {
87
+ "sha": {
88
+ "type": "string",
89
+ "pattern": "^[0-9a-f]{7,40}$",
90
+ "description": "Git commit sha, abbreviated or full."
91
+ },
92
+ "ref": {
93
+ "type": "string",
94
+ "minLength": 1,
95
+ "maxLength": 255
96
+ }
97
+ },
98
+ "required": [
99
+ "sha"
100
+ ],
101
+ "additionalProperties": false
102
+ },
103
+ "head": {
104
+ "type": "object",
105
+ "properties": {
106
+ "sha": {
107
+ "type": "string",
108
+ "pattern": "^[0-9a-f]{7,40}$",
109
+ "description": "Git commit sha, abbreviated or full."
110
+ },
111
+ "ref": {
112
+ "type": "string",
113
+ "minLength": 1,
114
+ "maxLength": 255
115
+ }
116
+ },
117
+ "required": [
118
+ "sha"
119
+ ],
120
+ "additionalProperties": false
121
+ },
122
+ "pullRequest": {
123
+ "type": "object",
124
+ "properties": {
125
+ "number": {
126
+ "type": "integer",
127
+ "minimum": 1,
128
+ "maximum": 9007199254740991
129
+ },
130
+ "title": {
131
+ "type": "string",
132
+ "minLength": 1,
133
+ "maxLength": 512
134
+ },
135
+ "url": {
136
+ "type": "string",
137
+ "format": "uri"
138
+ }
139
+ },
140
+ "required": [
141
+ "number"
142
+ ],
143
+ "additionalProperties": false
144
+ },
145
+ "generator": {
146
+ "type": "object",
147
+ "properties": {
148
+ "name": {
149
+ "type": "string",
150
+ "minLength": 1,
151
+ "maxLength": 64
152
+ },
153
+ "version": {
154
+ "type": "string",
155
+ "minLength": 1,
156
+ "maxLength": 32
157
+ },
158
+ "model": {
159
+ "description": "Extraction model, when one was used.",
160
+ "type": "string",
161
+ "minLength": 1,
162
+ "maxLength": 128
163
+ }
164
+ },
165
+ "required": [
166
+ "name"
167
+ ],
168
+ "additionalProperties": false
169
+ }
170
+ },
171
+ "required": [
172
+ "repo",
173
+ "base",
174
+ "head"
175
+ ],
176
+ "additionalProperties": false,
177
+ "description": "Where the document came from."
178
+ },
179
+ "lanes": {
180
+ "minItems": 1,
181
+ "maxItems": 16,
182
+ "type": "array",
183
+ "items": {
184
+ "type": "object",
185
+ "properties": {
186
+ "id": {
187
+ "type": "string",
188
+ "minLength": 1,
189
+ "maxLength": 128,
190
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*$",
191
+ "description": "Stable identifier, unique within its collection in a document."
192
+ },
193
+ "label": {
194
+ "type": "string",
195
+ "minLength": 1,
196
+ "maxLength": 120,
197
+ "description": "Short display label."
198
+ },
199
+ "subtitle": {
200
+ "description": "Secondary line in the lane header, e.g. the platform.",
201
+ "type": "string",
202
+ "minLength": 1,
203
+ "maxLength": 120
204
+ },
205
+ "order": {
206
+ "description": "Left-to-right placement. Ties fall back to array order.",
207
+ "type": "integer",
208
+ "minimum": 0,
209
+ "maximum": 64
210
+ },
211
+ "delta": {
212
+ "description": "Set only when the lane itself is new or gone.",
213
+ "type": "string",
214
+ "enum": [
215
+ "added",
216
+ "modified",
217
+ "removed",
218
+ "unchanged"
219
+ ]
220
+ },
221
+ "summary": {
222
+ "type": "string",
223
+ "minLength": 1,
224
+ "maxLength": 2000,
225
+ "description": "One or two sentences of plain prose. No markdown headings."
226
+ }
227
+ },
228
+ "required": [
229
+ "id",
230
+ "label"
231
+ ],
232
+ "additionalProperties": false,
233
+ "description": "A grouping band of the diagram. Every node belongs to exactly one lane."
234
+ }
235
+ },
236
+ "nodes": {
237
+ "minItems": 1,
238
+ "maxItems": 256,
239
+ "type": "array",
240
+ "items": {
241
+ "type": "object",
242
+ "properties": {
243
+ "id": {
244
+ "type": "string",
245
+ "minLength": 1,
246
+ "maxLength": 128,
247
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*$",
248
+ "description": "Stable identifier, unique within its collection in a document."
249
+ },
250
+ "label": {
251
+ "type": "string",
252
+ "minLength": 1,
253
+ "maxLength": 120,
254
+ "description": "Short display label."
255
+ },
256
+ "kind": {
257
+ "type": "string",
258
+ "enum": [
259
+ "service",
260
+ "app",
261
+ "module",
262
+ "function",
263
+ "route",
264
+ "job",
265
+ "queue",
266
+ "datastore",
267
+ "cache",
268
+ "external",
269
+ "ui",
270
+ "config",
271
+ "test",
272
+ "package",
273
+ "other"
274
+ ]
275
+ },
276
+ "delta": {
277
+ "type": "string",
278
+ "enum": [
279
+ "added",
280
+ "modified",
281
+ "removed",
282
+ "unchanged"
283
+ ],
284
+ "description": "Change state relative to the base commit."
285
+ },
286
+ "lane": {
287
+ "type": "string",
288
+ "minLength": 1,
289
+ "maxLength": 128,
290
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*$",
291
+ "description": "Id of the lane this node sits in."
292
+ },
293
+ "group": {
294
+ "description": "Optional sub-cluster within the lane, e.g. a package.",
295
+ "type": "string",
296
+ "minLength": 1,
297
+ "maxLength": 128,
298
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*$"
299
+ },
300
+ "subtitle": {
301
+ "description": "Secondary line on the card, e.g. a symbol signature.",
302
+ "type": "string",
303
+ "minLength": 1,
304
+ "maxLength": 120
305
+ },
306
+ "summary": {
307
+ "description": "Body text for this node's drill-down section.",
308
+ "type": "string",
309
+ "minLength": 1,
310
+ "maxLength": 2000
311
+ },
312
+ "files": {
313
+ "default": [],
314
+ "description": "Backing source locations, used to build diff permalinks.",
315
+ "maxItems": 64,
316
+ "type": "array",
317
+ "items": {
318
+ "type": "object",
319
+ "properties": {
320
+ "path": {
321
+ "type": "string",
322
+ "minLength": 1,
323
+ "maxLength": 1024,
324
+ "pattern": "^(?!\\/)(?![A-Za-z]:)(?!.*\\\\)(?!.*(?:^|\\/)\\.\\.(?:\\/|$)).+$",
325
+ "description": "Repository-relative path, POSIX separators."
326
+ },
327
+ "startLine": {
328
+ "description": "1-based first line.",
329
+ "type": "integer",
330
+ "minimum": 1,
331
+ "maximum": 9007199254740991
332
+ },
333
+ "endLine": {
334
+ "description": "1-based last line, inclusive.",
335
+ "type": "integer",
336
+ "minimum": 1,
337
+ "maximum": 9007199254740991
338
+ },
339
+ "revision": {
340
+ "description": "Which side of the diff the lines refer to. Defaults to head.",
341
+ "type": "string",
342
+ "enum": [
343
+ "head",
344
+ "base"
345
+ ]
346
+ }
347
+ },
348
+ "required": [
349
+ "path"
350
+ ],
351
+ "additionalProperties": false,
352
+ "dependentRequired": {
353
+ "endLine": [
354
+ "startLine"
355
+ ]
356
+ },
357
+ "description": "A file (and optional line range) backing an element."
358
+ }
359
+ },
360
+ "badges": {
361
+ "default": [],
362
+ "description": "Extra chips on the card, beyond the delta badge the renderer adds.",
363
+ "maxItems": 6,
364
+ "type": "array",
365
+ "items": {
366
+ "type": "string",
367
+ "minLength": 1,
368
+ "maxLength": 120,
369
+ "description": "Short display label."
370
+ }
371
+ }
372
+ },
373
+ "required": [
374
+ "id",
375
+ "label",
376
+ "kind",
377
+ "delta",
378
+ "lane"
379
+ ],
380
+ "additionalProperties": false,
381
+ "description": "A node in the architecture graph."
382
+ }
383
+ },
384
+ "edges": {
385
+ "default": [],
386
+ "maxItems": 512,
387
+ "type": "array",
388
+ "items": {
389
+ "type": "object",
390
+ "properties": {
391
+ "id": {
392
+ "type": "string",
393
+ "minLength": 1,
394
+ "maxLength": 128,
395
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*$",
396
+ "description": "Stable identifier, unique within its collection in a document."
397
+ },
398
+ "from": {
399
+ "type": "string",
400
+ "minLength": 1,
401
+ "maxLength": 128,
402
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*$",
403
+ "description": "Source node id."
404
+ },
405
+ "to": {
406
+ "type": "string",
407
+ "minLength": 1,
408
+ "maxLength": 128,
409
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*$",
410
+ "description": "Target node id."
411
+ },
412
+ "kind": {
413
+ "type": "string",
414
+ "enum": [
415
+ "call",
416
+ "http",
417
+ "rpc",
418
+ "event",
419
+ "queue",
420
+ "data",
421
+ "dependency",
422
+ "render",
423
+ "other"
424
+ ]
425
+ },
426
+ "delta": {
427
+ "type": "string",
428
+ "enum": [
429
+ "added",
430
+ "modified",
431
+ "removed",
432
+ "unchanged"
433
+ ],
434
+ "description": "Change state relative to the base commit."
435
+ },
436
+ "label": {
437
+ "description": "Text on the edge, e.g. a payload size or protocol.",
438
+ "type": "string",
439
+ "minLength": 1,
440
+ "maxLength": 120
441
+ },
442
+ "emphasis": {
443
+ "default": "normal",
444
+ "type": "string",
445
+ "enum": [
446
+ "normal",
447
+ "hero",
448
+ "muted"
449
+ ]
450
+ },
451
+ "animated": {
452
+ "default": false,
453
+ "description": "Render a travelling pulse along this edge in the architecture lens.",
454
+ "type": "boolean"
455
+ },
456
+ "summary": {
457
+ "type": "string",
458
+ "minLength": 1,
459
+ "maxLength": 2000,
460
+ "description": "One or two sentences of plain prose. No markdown headings."
461
+ },
462
+ "files": {
463
+ "default": [],
464
+ "maxItems": 32,
465
+ "type": "array",
466
+ "items": {
467
+ "type": "object",
468
+ "properties": {
469
+ "path": {
470
+ "type": "string",
471
+ "minLength": 1,
472
+ "maxLength": 1024,
473
+ "pattern": "^(?!\\/)(?![A-Za-z]:)(?!.*\\\\)(?!.*(?:^|\\/)\\.\\.(?:\\/|$)).+$",
474
+ "description": "Repository-relative path, POSIX separators."
475
+ },
476
+ "startLine": {
477
+ "description": "1-based first line.",
478
+ "type": "integer",
479
+ "minimum": 1,
480
+ "maximum": 9007199254740991
481
+ },
482
+ "endLine": {
483
+ "description": "1-based last line, inclusive.",
484
+ "type": "integer",
485
+ "minimum": 1,
486
+ "maximum": 9007199254740991
487
+ },
488
+ "revision": {
489
+ "description": "Which side of the diff the lines refer to. Defaults to head.",
490
+ "type": "string",
491
+ "enum": [
492
+ "head",
493
+ "base"
494
+ ]
495
+ }
496
+ },
497
+ "required": [
498
+ "path"
499
+ ],
500
+ "additionalProperties": false,
501
+ "dependentRequired": {
502
+ "endLine": [
503
+ "startLine"
504
+ ]
505
+ },
506
+ "description": "A file (and optional line range) backing an element."
507
+ }
508
+ }
509
+ },
510
+ "required": [
511
+ "id",
512
+ "from",
513
+ "to",
514
+ "kind",
515
+ "delta"
516
+ ],
517
+ "additionalProperties": false,
518
+ "description": "A directed connection between two nodes."
519
+ }
520
+ },
521
+ "flows": {
522
+ "default": [],
523
+ "maxItems": 16,
524
+ "type": "array",
525
+ "items": {
526
+ "type": "object",
527
+ "properties": {
528
+ "id": {
529
+ "type": "string",
530
+ "minLength": 1,
531
+ "maxLength": 128,
532
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*$",
533
+ "description": "Stable identifier, unique within its collection in a document."
534
+ },
535
+ "title": {
536
+ "type": "string",
537
+ "minLength": 1,
538
+ "maxLength": 120,
539
+ "description": "Short display label."
540
+ },
541
+ "summary": {
542
+ "type": "string",
543
+ "minLength": 1,
544
+ "maxLength": 2000,
545
+ "description": "One or two sentences of plain prose. No markdown headings."
546
+ },
547
+ "delta": {
548
+ "default": "modified",
549
+ "type": "string",
550
+ "enum": [
551
+ "added",
552
+ "modified",
553
+ "removed",
554
+ "unchanged"
555
+ ],
556
+ "description": "Change state relative to the base commit."
557
+ },
558
+ "participants": {
559
+ "minItems": 2,
560
+ "maxItems": 12,
561
+ "type": "array",
562
+ "items": {
563
+ "type": "object",
564
+ "properties": {
565
+ "node": {
566
+ "type": "string",
567
+ "minLength": 1,
568
+ "maxLength": 128,
569
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*$",
570
+ "description": "Id of the graph node this column represents."
571
+ },
572
+ "label": {
573
+ "description": "Shorter name for the column when the node label is long.",
574
+ "type": "string",
575
+ "minLength": 1,
576
+ "maxLength": 120
577
+ }
578
+ },
579
+ "required": [
580
+ "node"
581
+ ],
582
+ "additionalProperties": false,
583
+ "description": "A column in the sequence diagram, ordered by array position."
584
+ }
585
+ },
586
+ "messages": {
587
+ "minItems": 1,
588
+ "maxItems": 64,
589
+ "type": "array",
590
+ "items": {
591
+ "type": "object",
592
+ "properties": {
593
+ "id": {
594
+ "type": "string",
595
+ "minLength": 1,
596
+ "maxLength": 128,
597
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*$",
598
+ "description": "Stable identifier, unique within its collection in a document."
599
+ },
600
+ "from": {
601
+ "type": "string",
602
+ "minLength": 1,
603
+ "maxLength": 128,
604
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*$",
605
+ "description": "Participant node id the message originates from."
606
+ },
607
+ "to": {
608
+ "type": "string",
609
+ "minLength": 1,
610
+ "maxLength": 128,
611
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*$",
612
+ "description": "Participant node id the message arrives at. Equals `from` when kind is self."
613
+ },
614
+ "label": {
615
+ "type": "string",
616
+ "minLength": 1,
617
+ "maxLength": 120,
618
+ "description": "Short display label."
619
+ },
620
+ "kind": {
621
+ "default": "sync",
622
+ "type": "string",
623
+ "enum": [
624
+ "sync",
625
+ "async",
626
+ "return",
627
+ "self"
628
+ ]
629
+ },
630
+ "delta": {
631
+ "type": "string",
632
+ "enum": [
633
+ "added",
634
+ "modified",
635
+ "removed",
636
+ "unchanged"
637
+ ],
638
+ "description": "Change state relative to the base commit."
639
+ },
640
+ "animated": {
641
+ "default": true,
642
+ "description": "Whether the data-flow lens pulses this step.",
643
+ "type": "boolean"
644
+ },
645
+ "repeat": {
646
+ "description": "Times the step occurs per run, e.g. 4 batched requests.",
647
+ "type": "integer",
648
+ "minimum": 1,
649
+ "maximum": 1000000
650
+ },
651
+ "note": {
652
+ "description": "Aside rendered beside the step in the drill-down.",
653
+ "type": "string",
654
+ "minLength": 1,
655
+ "maxLength": 2000
656
+ },
657
+ "files": {
658
+ "default": [],
659
+ "maxItems": 32,
660
+ "type": "array",
661
+ "items": {
662
+ "type": "object",
663
+ "properties": {
664
+ "path": {
665
+ "type": "string",
666
+ "minLength": 1,
667
+ "maxLength": 1024,
668
+ "pattern": "^(?!\\/)(?![A-Za-z]:)(?!.*\\\\)(?!.*(?:^|\\/)\\.\\.(?:\\/|$)).+$",
669
+ "description": "Repository-relative path, POSIX separators."
670
+ },
671
+ "startLine": {
672
+ "description": "1-based first line.",
673
+ "type": "integer",
674
+ "minimum": 1,
675
+ "maximum": 9007199254740991
676
+ },
677
+ "endLine": {
678
+ "description": "1-based last line, inclusive.",
679
+ "type": "integer",
680
+ "minimum": 1,
681
+ "maximum": 9007199254740991
682
+ },
683
+ "revision": {
684
+ "description": "Which side of the diff the lines refer to. Defaults to head.",
685
+ "type": "string",
686
+ "enum": [
687
+ "head",
688
+ "base"
689
+ ]
690
+ }
691
+ },
692
+ "required": [
693
+ "path"
694
+ ],
695
+ "additionalProperties": false,
696
+ "dependentRequired": {
697
+ "endLine": [
698
+ "startLine"
699
+ ]
700
+ },
701
+ "description": "A file (and optional line range) backing an element."
702
+ }
703
+ }
704
+ },
705
+ "required": [
706
+ "id",
707
+ "from",
708
+ "to",
709
+ "label",
710
+ "delta"
711
+ ],
712
+ "additionalProperties": false,
713
+ "description": "One ordered step in a flow."
714
+ },
715
+ "description": "Ordered by array position."
716
+ }
717
+ },
718
+ "required": [
719
+ "id",
720
+ "title",
721
+ "participants",
722
+ "messages"
723
+ ],
724
+ "additionalProperties": false,
725
+ "description": "An ordered message sequence for the data-flow lens."
726
+ }
727
+ },
728
+ "stats": {
729
+ "type": "object",
730
+ "properties": {
731
+ "filesChanged": {
732
+ "type": "integer",
733
+ "minimum": 0,
734
+ "maximum": 9007199254740991
735
+ },
736
+ "additions": {
737
+ "description": "Lines added across the diff.",
738
+ "type": "integer",
739
+ "minimum": 0,
740
+ "maximum": 9007199254740991
741
+ },
742
+ "deletions": {
743
+ "description": "Lines removed across the diff.",
744
+ "type": "integer",
745
+ "minimum": 0,
746
+ "maximum": 9007199254740991
747
+ },
748
+ "chips": {
749
+ "default": [],
750
+ "maxItems": 8,
751
+ "type": "array",
752
+ "items": {
753
+ "type": "object",
754
+ "properties": {
755
+ "label": {
756
+ "type": "string",
757
+ "minLength": 1,
758
+ "maxLength": 120,
759
+ "description": "Short display label."
760
+ },
761
+ "value": {
762
+ "type": "string",
763
+ "minLength": 1,
764
+ "maxLength": 32
765
+ },
766
+ "tone": {
767
+ "default": "neutral",
768
+ "type": "string",
769
+ "enum": [
770
+ "neutral",
771
+ "added",
772
+ "modified",
773
+ "removed",
774
+ "hero"
775
+ ]
776
+ }
777
+ },
778
+ "required": [
779
+ "label",
780
+ "value"
781
+ ],
782
+ "additionalProperties": false,
783
+ "description": "A headline chip above the diagram."
784
+ }
785
+ }
786
+ },
787
+ "additionalProperties": false,
788
+ "description": "Headline numbers for the comment header."
789
+ },
790
+ "views": {
791
+ "default": [],
792
+ "maxItems": 32,
793
+ "type": "array",
794
+ "items": {
795
+ "$ref": "#/$defs/View"
796
+ }
797
+ },
798
+ "layout": {
799
+ "type": "object",
800
+ "properties": {
801
+ "direction": {
802
+ "default": "right",
803
+ "description": "Primary flow direction.",
804
+ "type": "string",
805
+ "enum": [
806
+ "right",
807
+ "down"
808
+ ]
809
+ },
810
+ "laneOrder": {
811
+ "default": [],
812
+ "description": "Explicit left-to-right lane order.",
813
+ "maxItems": 64,
814
+ "type": "array",
815
+ "items": {
816
+ "type": "string",
817
+ "minLength": 1,
818
+ "maxLength": 128,
819
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*$",
820
+ "description": "Stable identifier, unique within its collection in a document."
821
+ }
822
+ },
823
+ "rank": {
824
+ "description": "Preferred layer index per node id.",
825
+ "type": "object",
826
+ "propertyNames": {
827
+ "type": "string",
828
+ "minLength": 1,
829
+ "maxLength": 128,
830
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*$",
831
+ "description": "Stable identifier, unique within its collection in a document."
832
+ },
833
+ "additionalProperties": {
834
+ "type": "integer",
835
+ "minimum": 0,
836
+ "maximum": 256
837
+ }
838
+ }
839
+ },
840
+ "additionalProperties": false,
841
+ "description": "Optional, non-binding placement hints."
842
+ }
843
+ },
844
+ "required": [
845
+ "schemaVersion",
846
+ "kind",
847
+ "title",
848
+ "lenses",
849
+ "provenance",
850
+ "lanes",
851
+ "nodes"
852
+ ],
853
+ "additionalProperties": false,
854
+ "description": "A PR Lens graph document.",
855
+ "$defs": {
856
+ "View": {
857
+ "type": "object",
858
+ "properties": {
859
+ "id": {
860
+ "type": "string",
861
+ "minLength": 1,
862
+ "maxLength": 128,
863
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*$",
864
+ "description": "Stable identifier, unique within its collection in a document."
865
+ },
866
+ "title": {
867
+ "type": "string",
868
+ "minLength": 1,
869
+ "maxLength": 120,
870
+ "description": "Short display label."
871
+ },
872
+ "lens": {
873
+ "type": "string",
874
+ "enum": [
875
+ "architecture",
876
+ "data-flow"
877
+ ],
878
+ "description": "Rendering lens."
879
+ },
880
+ "summary": {
881
+ "type": "string",
882
+ "minLength": 1,
883
+ "maxLength": 2000,
884
+ "description": "One or two sentences of plain prose. No markdown headings."
885
+ },
886
+ "scope": {
887
+ "default": {
888
+ "kind": "all"
889
+ },
890
+ "oneOf": [
891
+ {
892
+ "type": "object",
893
+ "properties": {
894
+ "kind": {
895
+ "type": "string",
896
+ "const": "all"
897
+ }
898
+ },
899
+ "required": [
900
+ "kind"
901
+ ],
902
+ "additionalProperties": false
903
+ },
904
+ {
905
+ "type": "object",
906
+ "properties": {
907
+ "kind": {
908
+ "type": "string",
909
+ "const": "selection"
910
+ },
911
+ "lanes": {
912
+ "default": [],
913
+ "maxItems": 64,
914
+ "type": "array",
915
+ "items": {
916
+ "type": "string",
917
+ "minLength": 1,
918
+ "maxLength": 128,
919
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*$",
920
+ "description": "Stable identifier, unique within its collection in a document."
921
+ }
922
+ },
923
+ "nodes": {
924
+ "default": [],
925
+ "maxItems": 256,
926
+ "type": "array",
927
+ "items": {
928
+ "type": "string",
929
+ "minLength": 1,
930
+ "maxLength": 128,
931
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*$",
932
+ "description": "Stable identifier, unique within its collection in a document."
933
+ }
934
+ },
935
+ "edges": {
936
+ "default": [],
937
+ "maxItems": 512,
938
+ "type": "array",
939
+ "items": {
940
+ "type": "string",
941
+ "minLength": 1,
942
+ "maxLength": 128,
943
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*$",
944
+ "description": "Stable identifier, unique within its collection in a document."
945
+ }
946
+ },
947
+ "flows": {
948
+ "default": [],
949
+ "maxItems": 32,
950
+ "type": "array",
951
+ "items": {
952
+ "type": "string",
953
+ "minLength": 1,
954
+ "maxLength": 128,
955
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*$",
956
+ "description": "Stable identifier, unique within its collection in a document."
957
+ }
958
+ }
959
+ },
960
+ "required": [
961
+ "kind"
962
+ ],
963
+ "additionalProperties": false,
964
+ "anyOf": [
965
+ {
966
+ "properties": {
967
+ "lanes": {
968
+ "minItems": 1
969
+ }
970
+ },
971
+ "required": [
972
+ "lanes"
973
+ ]
974
+ },
975
+ {
976
+ "properties": {
977
+ "nodes": {
978
+ "minItems": 1
979
+ }
980
+ },
981
+ "required": [
982
+ "nodes"
983
+ ]
984
+ },
985
+ {
986
+ "properties": {
987
+ "edges": {
988
+ "minItems": 1
989
+ }
990
+ },
991
+ "required": [
992
+ "edges"
993
+ ]
994
+ },
995
+ {
996
+ "properties": {
997
+ "flows": {
998
+ "minItems": 1
999
+ }
1000
+ },
1001
+ "required": [
1002
+ "flows"
1003
+ ]
1004
+ }
1005
+ ]
1006
+ }
1007
+ ],
1008
+ "description": "What a drill-down section shows."
1009
+ },
1010
+ "defaultOpen": {
1011
+ "default": false,
1012
+ "type": "boolean"
1013
+ },
1014
+ "children": {
1015
+ "default": [],
1016
+ "maxItems": 32,
1017
+ "type": "array",
1018
+ "items": {
1019
+ "$ref": "#/$defs/View"
1020
+ }
1021
+ }
1022
+ },
1023
+ "required": [
1024
+ "id",
1025
+ "title",
1026
+ "lens"
1027
+ ],
1028
+ "additionalProperties": false,
1029
+ "description": "A drill-down section; children nest as further <details> blocks."
1030
+ }
1031
+ }
1032
+ }