@enwithai/product-check 0.2.0 → 0.3.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 (63) hide show
  1. package/ATTRIBUTION.md +4 -4
  2. package/CHANGELOG.md +28 -0
  3. package/README.md +29 -16
  4. package/SECURITY.md +5 -1
  5. package/dashboard/assurance.css +71 -0
  6. package/dashboard/assurance.js +21 -0
  7. package/dist/assurance/adapters.d.ts +32 -0
  8. package/dist/assurance/adapters.js +76 -0
  9. package/dist/assurance/approvals.d.ts +34 -0
  10. package/dist/assurance/approvals.js +133 -0
  11. package/dist/assurance/cli.d.ts +13 -0
  12. package/dist/assurance/cli.js +863 -0
  13. package/dist/assurance/dashboard.d.ts +18 -0
  14. package/dist/assurance/dashboard.js +267 -0
  15. package/dist/assurance/diff.d.ts +20 -0
  16. package/dist/assurance/diff.js +99 -0
  17. package/dist/assurance/evidence-log.d.ts +20 -0
  18. package/dist/assurance/evidence-log.js +100 -0
  19. package/dist/assurance/fix-packets.d.ts +12 -0
  20. package/dist/assurance/fix-packets.js +178 -0
  21. package/dist/assurance/gate.d.ts +37 -0
  22. package/dist/assurance/gate.js +324 -0
  23. package/dist/assurance/lanes.d.ts +61 -0
  24. package/dist/assurance/lanes.js +380 -0
  25. package/dist/assurance/policy.d.ts +10 -0
  26. package/dist/assurance/policy.js +85 -0
  27. package/dist/assurance/proof.d.ts +35 -0
  28. package/dist/assurance/proof.js +146 -0
  29. package/dist/assurance/register.d.ts +41 -0
  30. package/dist/assurance/register.js +480 -0
  31. package/dist/assurance/render-md.d.ts +17 -0
  32. package/dist/assurance/render-md.js +212 -0
  33. package/dist/assurance/repo-state.d.ts +15 -0
  34. package/dist/assurance/repo-state.js +79 -0
  35. package/dist/assurance/review.d.ts +52 -0
  36. package/dist/assurance/review.js +408 -0
  37. package/dist/assurance/risk.d.ts +21 -0
  38. package/dist/assurance/risk.js +184 -0
  39. package/dist/assurance/types.d.ts +573 -0
  40. package/dist/assurance/types.js +6 -0
  41. package/dist/assurance/util.d.ts +24 -0
  42. package/dist/assurance/util.js +89 -0
  43. package/dist/assurance/verification.d.ts +30 -0
  44. package/dist/assurance/verification.js +212 -0
  45. package/dist/assurance/verify.d.ts +26 -0
  46. package/dist/assurance/verify.js +304 -0
  47. package/dist/cli/run.js +8 -1
  48. package/dist/exec/process.d.ts +27 -0
  49. package/dist/exec/process.js +175 -0
  50. package/dist/reporting/markdown.d.ts +1 -0
  51. package/dist/reporting/markdown.js +1 -1
  52. package/dist/schema/registry.js +9 -0
  53. package/package.json +1 -1
  54. package/schemas/approval.schema.json +98 -0
  55. package/schemas/assurance-common.schema.json +291 -0
  56. package/schemas/assurance-policy.schema.json +185 -0
  57. package/schemas/change-review.schema.json +711 -0
  58. package/schemas/closure-register.schema.json +499 -0
  59. package/schemas/evidence-record.schema.json +94 -0
  60. package/schemas/fix-packet.schema.json +272 -0
  61. package/schemas/release-gate.schema.json +308 -0
  62. package/schemas/reviewer-findings.schema.json +49 -0
  63. package/schemas/verification-run.schema.json +199 -0
@@ -0,0 +1,711 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://github.com/enwithai/product-check/schemas/change-review.schema.json",
4
+ "title": "Product Check change review",
5
+ "description": "Layered review of one change (PR_DIFF or PRE_PR_LOCAL): risk, lanes, independently verified findings, approvals, convergence cycle and the change gate. A change PASS never implies product readiness.",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "required": [
9
+ "schema_version",
10
+ "kind",
11
+ "methodology_version",
12
+ "review_id",
13
+ "mode",
14
+ "change_ref",
15
+ "created_at",
16
+ "target",
17
+ "base_sha",
18
+ "head_sha",
19
+ "author",
20
+ "diff",
21
+ "risk",
22
+ "approvals_required",
23
+ "approvals",
24
+ "lanes",
25
+ "findings",
26
+ "disproven",
27
+ "checks",
28
+ "baseline",
29
+ "cycle",
30
+ "gate",
31
+ "product_vs_change",
32
+ "limitations",
33
+ "evidence_ids",
34
+ "provenance"
35
+ ],
36
+ "properties": {
37
+ "schema_version": {
38
+ "$ref": "assurance-common.schema.json#/$defs/schema_version"
39
+ },
40
+ "kind": {
41
+ "const": "change-review"
42
+ },
43
+ "methodology_version": {
44
+ "$ref": "assurance-common.schema.json#/$defs/methodology_version"
45
+ },
46
+ "review_id": {
47
+ "type": "string",
48
+ "pattern": "^CR-[0-9A-F]{10}$"
49
+ },
50
+ "mode": {
51
+ "enum": ["PR_DIFF", "PRE_PR_LOCAL"]
52
+ },
53
+ "change_ref": {
54
+ "type": "string",
55
+ "minLength": 1
56
+ },
57
+ "created_at": {
58
+ "type": "string",
59
+ "format": "date-time"
60
+ },
61
+ "target": {
62
+ "type": "object",
63
+ "additionalProperties": false,
64
+ "required": ["name", "repository"],
65
+ "properties": {
66
+ "name": {
67
+ "type": "string"
68
+ },
69
+ "repository": {
70
+ "type": "string"
71
+ }
72
+ }
73
+ },
74
+ "base_sha": {
75
+ "type": ["string", "null"],
76
+ "pattern": "^[0-9a-f]{40}([0-9a-f]{24})?$"
77
+ },
78
+ "head_sha": {
79
+ "type": ["string", "null"],
80
+ "pattern": "^[0-9a-f]{40}([0-9a-f]{24})?$"
81
+ },
82
+ "author": {
83
+ "type": "object",
84
+ "additionalProperties": false,
85
+ "required": ["id", "source", "trusted"],
86
+ "properties": {
87
+ "id": {
88
+ "type": ["string", "null"]
89
+ },
90
+ "source": {
91
+ "enum": ["flag", "git", "unknown"]
92
+ },
93
+ "trusted": {
94
+ "type": "boolean"
95
+ }
96
+ }
97
+ },
98
+ "diff": {
99
+ "type": "object",
100
+ "additionalProperties": false,
101
+ "required": ["source", "digest", "files", "truncated"],
102
+ "properties": {
103
+ "source": {
104
+ "enum": ["git", "file"]
105
+ },
106
+ "digest": {
107
+ "type": "string",
108
+ "pattern": "^[0-9a-f]{64}$"
109
+ },
110
+ "files": {
111
+ "type": "array",
112
+ "items": {
113
+ "type": "object",
114
+ "additionalProperties": false,
115
+ "required": [
116
+ "path",
117
+ "previous_path",
118
+ "status",
119
+ "additions",
120
+ "deletions",
121
+ "surfaces",
122
+ "protected"
123
+ ],
124
+ "properties": {
125
+ "path": {
126
+ "type": "string"
127
+ },
128
+ "previous_path": {
129
+ "type": ["string", "null"]
130
+ },
131
+ "status": {
132
+ "enum": ["added", "modified", "deleted", "renamed", "binary"]
133
+ },
134
+ "additions": {
135
+ "type": "integer",
136
+ "minimum": 0
137
+ },
138
+ "deletions": {
139
+ "type": "integer",
140
+ "minimum": 0
141
+ },
142
+ "surfaces": {
143
+ "type": "array",
144
+ "items": {
145
+ "type": "string"
146
+ }
147
+ },
148
+ "protected": {
149
+ "type": "boolean"
150
+ }
151
+ }
152
+ }
153
+ },
154
+ "truncated": {
155
+ "type": "boolean"
156
+ }
157
+ }
158
+ },
159
+ "risk": {
160
+ "type": "object",
161
+ "additionalProperties": false,
162
+ "required": ["level", "effective_level", "surfaces", "reasons", "protected_paths", "impact_check"],
163
+ "properties": {
164
+ "level": {
165
+ "$ref": "assurance-common.schema.json#/$defs/risk_level"
166
+ },
167
+ "effective_level": {
168
+ "enum": ["LOW", "MEDIUM", "HIGH"]
169
+ },
170
+ "surfaces": {
171
+ "type": "array",
172
+ "items": {
173
+ "type": "string"
174
+ }
175
+ },
176
+ "reasons": {
177
+ "type": "array",
178
+ "items": {
179
+ "type": "string"
180
+ }
181
+ },
182
+ "protected_paths": {
183
+ "type": "array",
184
+ "items": {
185
+ "type": "string"
186
+ }
187
+ },
188
+ "impact_check": {
189
+ "oneOf": [
190
+ {
191
+ "type": "null"
192
+ },
193
+ {
194
+ "type": "object",
195
+ "additionalProperties": false,
196
+ "required": ["schema_version", "high", "affected_modules", "commit"],
197
+ "properties": {
198
+ "schema_version": {
199
+ "type": "string"
200
+ },
201
+ "high": {
202
+ "type": "integer",
203
+ "minimum": 0
204
+ },
205
+ "affected_modules": {
206
+ "type": "integer",
207
+ "minimum": 0
208
+ },
209
+ "commit": {
210
+ "type": ["string", "null"]
211
+ }
212
+ }
213
+ }
214
+ ]
215
+ }
216
+ }
217
+ },
218
+ "approvals_required": {
219
+ "type": "object",
220
+ "additionalProperties": false,
221
+ "required": ["humans", "domain_owners", "waiver"],
222
+ "properties": {
223
+ "humans": {
224
+ "type": "integer",
225
+ "minimum": 0
226
+ },
227
+ "domain_owners": {
228
+ "type": "array",
229
+ "items": {
230
+ "type": "string"
231
+ }
232
+ },
233
+ "waiver": {
234
+ "type": "object",
235
+ "additionalProperties": false,
236
+ "required": ["eligible", "applied", "reason"],
237
+ "properties": {
238
+ "eligible": {
239
+ "type": "boolean"
240
+ },
241
+ "applied": {
242
+ "type": "boolean"
243
+ },
244
+ "reason": {
245
+ "type": "string"
246
+ }
247
+ }
248
+ }
249
+ }
250
+ },
251
+ "approvals": {
252
+ "type": "array",
253
+ "items": {
254
+ "$ref": "assurance-common.schema.json#/$defs/approval_evaluation"
255
+ }
256
+ },
257
+ "lanes": {
258
+ "type": "array",
259
+ "items": {
260
+ "type": "object",
261
+ "additionalProperties": false,
262
+ "required": ["lane", "reviewer", "status", "findings", "notes"],
263
+ "properties": {
264
+ "lane": {
265
+ "$ref": "assurance-common.schema.json#/$defs/lane"
266
+ },
267
+ "reviewer": {
268
+ "type": "string"
269
+ },
270
+ "status": {
271
+ "$ref": "common.schema.json#/$defs/validation_status"
272
+ },
273
+ "findings": {
274
+ "type": "integer",
275
+ "minimum": 0
276
+ },
277
+ "notes": {
278
+ "type": "array",
279
+ "items": {
280
+ "type": "string"
281
+ }
282
+ }
283
+ }
284
+ }
285
+ },
286
+ "findings": {
287
+ "type": "array",
288
+ "items": {
289
+ "type": "object",
290
+ "additionalProperties": false,
291
+ "required": [
292
+ "id",
293
+ "rule_id",
294
+ "lane",
295
+ "reviewer",
296
+ "title",
297
+ "severity",
298
+ "pillars",
299
+ "location",
300
+ "expected",
301
+ "actual",
302
+ "steps_or_command",
303
+ "evidence_ids",
304
+ "confidence",
305
+ "epistemic",
306
+ "impact",
307
+ "affected_scope",
308
+ "baseline_sha",
309
+ "head_sha",
310
+ "uncertainty",
311
+ "verification",
312
+ "dedupe_key",
313
+ "occurrences",
314
+ "repeat_of_review",
315
+ "blocking"
316
+ ],
317
+ "properties": {
318
+ "id": {
319
+ "type": "string",
320
+ "pattern": "^RF-[0-9A-F]{10}$"
321
+ },
322
+ "rule_id": {
323
+ "type": "string"
324
+ },
325
+ "lane": {
326
+ "$ref": "assurance-common.schema.json#/$defs/lane"
327
+ },
328
+ "reviewer": {
329
+ "type": "object",
330
+ "additionalProperties": false,
331
+ "required": ["id", "type", "version"],
332
+ "properties": {
333
+ "id": {
334
+ "type": "string"
335
+ },
336
+ "type": {
337
+ "enum": ["deterministic", "ai", "human", "imported"]
338
+ },
339
+ "version": {
340
+ "type": "string"
341
+ }
342
+ }
343
+ },
344
+ "title": {
345
+ "type": "string"
346
+ },
347
+ "severity": {
348
+ "$ref": "common.schema.json#/$defs/severity"
349
+ },
350
+ "pillars": {
351
+ "type": "array",
352
+ "items": {
353
+ "$ref": "common.schema.json#/$defs/pillar"
354
+ }
355
+ },
356
+ "location": {
357
+ "type": "object",
358
+ "additionalProperties": false,
359
+ "required": ["path", "line", "runtime"],
360
+ "properties": {
361
+ "path": {
362
+ "type": "string"
363
+ },
364
+ "line": {
365
+ "type": ["integer", "null"]
366
+ },
367
+ "runtime": {
368
+ "type": ["string", "null"]
369
+ }
370
+ }
371
+ },
372
+ "expected": {
373
+ "type": "string"
374
+ },
375
+ "actual": {
376
+ "type": "string"
377
+ },
378
+ "steps_or_command": {
379
+ "type": "array",
380
+ "items": {
381
+ "type": "string"
382
+ }
383
+ },
384
+ "evidence_ids": {
385
+ "type": "array",
386
+ "items": {
387
+ "type": "string"
388
+ }
389
+ },
390
+ "confidence": {
391
+ "$ref": "common.schema.json#/$defs/confidence"
392
+ },
393
+ "epistemic": {
394
+ "$ref": "common.schema.json#/$defs/epistemic"
395
+ },
396
+ "impact": {
397
+ "type": "string"
398
+ },
399
+ "affected_scope": {
400
+ "type": "string"
401
+ },
402
+ "baseline_sha": {
403
+ "type": ["string", "null"],
404
+ "pattern": "^[0-9a-f]{40}([0-9a-f]{24})?$"
405
+ },
406
+ "head_sha": {
407
+ "type": ["string", "null"],
408
+ "pattern": "^[0-9a-f]{40}([0-9a-f]{24})?$"
409
+ },
410
+ "uncertainty": {
411
+ "type": ["string", "null"]
412
+ },
413
+ "verification": {
414
+ "$ref": "assurance-common.schema.json#/$defs/verification"
415
+ },
416
+ "dedupe_key": {
417
+ "type": "string",
418
+ "pattern": "^[0-9a-f]{20}$"
419
+ },
420
+ "occurrences": {
421
+ "type": "integer",
422
+ "minimum": 1
423
+ },
424
+ "repeat_of_review": {
425
+ "type": ["string", "null"]
426
+ },
427
+ "blocking": {
428
+ "type": "boolean"
429
+ }
430
+ }
431
+ }
432
+ },
433
+ "disproven": {
434
+ "type": "array",
435
+ "items": {
436
+ "type": "object",
437
+ "additionalProperties": false,
438
+ "required": [
439
+ "id",
440
+ "rule_id",
441
+ "lane",
442
+ "reviewer",
443
+ "title",
444
+ "severity",
445
+ "pillars",
446
+ "location",
447
+ "expected",
448
+ "actual",
449
+ "steps_or_command",
450
+ "evidence_ids",
451
+ "confidence",
452
+ "epistemic",
453
+ "impact",
454
+ "affected_scope",
455
+ "baseline_sha",
456
+ "head_sha",
457
+ "uncertainty",
458
+ "verification",
459
+ "dedupe_key",
460
+ "occurrences",
461
+ "repeat_of_review",
462
+ "blocking"
463
+ ],
464
+ "properties": {
465
+ "id": {
466
+ "type": "string",
467
+ "pattern": "^RF-[0-9A-F]{10}$"
468
+ },
469
+ "rule_id": {
470
+ "type": "string"
471
+ },
472
+ "lane": {
473
+ "$ref": "assurance-common.schema.json#/$defs/lane"
474
+ },
475
+ "reviewer": {
476
+ "type": "object",
477
+ "additionalProperties": false,
478
+ "required": ["id", "type", "version"],
479
+ "properties": {
480
+ "id": {
481
+ "type": "string"
482
+ },
483
+ "type": {
484
+ "enum": ["deterministic", "ai", "human", "imported"]
485
+ },
486
+ "version": {
487
+ "type": "string"
488
+ }
489
+ }
490
+ },
491
+ "title": {
492
+ "type": "string"
493
+ },
494
+ "severity": {
495
+ "$ref": "common.schema.json#/$defs/severity"
496
+ },
497
+ "pillars": {
498
+ "type": "array",
499
+ "items": {
500
+ "$ref": "common.schema.json#/$defs/pillar"
501
+ }
502
+ },
503
+ "location": {
504
+ "type": "object",
505
+ "additionalProperties": false,
506
+ "required": ["path", "line", "runtime"],
507
+ "properties": {
508
+ "path": {
509
+ "type": "string"
510
+ },
511
+ "line": {
512
+ "type": ["integer", "null"]
513
+ },
514
+ "runtime": {
515
+ "type": ["string", "null"]
516
+ }
517
+ }
518
+ },
519
+ "expected": {
520
+ "type": "string"
521
+ },
522
+ "actual": {
523
+ "type": "string"
524
+ },
525
+ "steps_or_command": {
526
+ "type": "array",
527
+ "items": {
528
+ "type": "string"
529
+ }
530
+ },
531
+ "evidence_ids": {
532
+ "type": "array",
533
+ "items": {
534
+ "type": "string"
535
+ }
536
+ },
537
+ "confidence": {
538
+ "$ref": "common.schema.json#/$defs/confidence"
539
+ },
540
+ "epistemic": {
541
+ "$ref": "common.schema.json#/$defs/epistemic"
542
+ },
543
+ "impact": {
544
+ "type": "string"
545
+ },
546
+ "affected_scope": {
547
+ "type": "string"
548
+ },
549
+ "baseline_sha": {
550
+ "type": ["string", "null"],
551
+ "pattern": "^[0-9a-f]{40}([0-9a-f]{24})?$"
552
+ },
553
+ "head_sha": {
554
+ "type": ["string", "null"],
555
+ "pattern": "^[0-9a-f]{40}([0-9a-f]{24})?$"
556
+ },
557
+ "uncertainty": {
558
+ "type": ["string", "null"]
559
+ },
560
+ "verification": {
561
+ "$ref": "assurance-common.schema.json#/$defs/verification"
562
+ },
563
+ "dedupe_key": {
564
+ "type": "string",
565
+ "pattern": "^[0-9a-f]{20}$"
566
+ },
567
+ "occurrences": {
568
+ "type": "integer",
569
+ "minimum": 1
570
+ },
571
+ "repeat_of_review": {
572
+ "type": ["string", "null"]
573
+ },
574
+ "blocking": {
575
+ "type": "boolean"
576
+ }
577
+ }
578
+ }
579
+ },
580
+ "checks": {
581
+ "type": "object",
582
+ "additionalProperties": false,
583
+ "required": ["proof_run_id", "status", "detail"],
584
+ "properties": {
585
+ "proof_run_id": {
586
+ "type": ["string", "null"]
587
+ },
588
+ "status": {
589
+ "$ref": "common.schema.json#/$defs/validation_status"
590
+ },
591
+ "detail": {
592
+ "type": "string"
593
+ }
594
+ }
595
+ },
596
+ "baseline": {
597
+ "oneOf": [
598
+ {
599
+ "type": "null"
600
+ },
601
+ {
602
+ "type": "object",
603
+ "additionalProperties": false,
604
+ "required": ["run_id", "verdict", "results_sha256"],
605
+ "properties": {
606
+ "run_id": {
607
+ "type": "string"
608
+ },
609
+ "verdict": {
610
+ "type": "string"
611
+ },
612
+ "results_sha256": {
613
+ "type": "string",
614
+ "pattern": "^[0-9a-f]{64}$"
615
+ }
616
+ }
617
+ }
618
+ ]
619
+ },
620
+ "cycle": {
621
+ "type": "object",
622
+ "additionalProperties": false,
623
+ "required": ["number", "max", "previous_review_id", "repeated_unchanged", "new_findings", "escalated"],
624
+ "properties": {
625
+ "number": {
626
+ "type": "integer",
627
+ "minimum": 1
628
+ },
629
+ "max": {
630
+ "type": "integer",
631
+ "minimum": 1
632
+ },
633
+ "previous_review_id": {
634
+ "type": ["string", "null"]
635
+ },
636
+ "repeated_unchanged": {
637
+ "type": "array",
638
+ "items": {
639
+ "type": "string"
640
+ }
641
+ },
642
+ "new_findings": {
643
+ "type": "array",
644
+ "items": {
645
+ "type": "string"
646
+ }
647
+ },
648
+ "escalated": {
649
+ "type": "boolean"
650
+ }
651
+ }
652
+ },
653
+ "gate": {
654
+ "type": "object",
655
+ "additionalProperties": false,
656
+ "required": ["status", "reasons", "blocking_finding_ids"],
657
+ "properties": {
658
+ "status": {
659
+ "$ref": "assurance-common.schema.json#/$defs/gate_status"
660
+ },
661
+ "reasons": {
662
+ "type": "array",
663
+ "items": {
664
+ "type": "string"
665
+ }
666
+ },
667
+ "blocking_finding_ids": {
668
+ "type": "array",
669
+ "items": {
670
+ "type": "string"
671
+ }
672
+ }
673
+ }
674
+ },
675
+ "product_vs_change": {
676
+ "type": "string"
677
+ },
678
+ "limitations": {
679
+ "type": "array",
680
+ "items": {
681
+ "type": "string"
682
+ }
683
+ },
684
+ "evidence_ids": {
685
+ "type": "array",
686
+ "items": {
687
+ "type": "string"
688
+ }
689
+ },
690
+ "provenance": {
691
+ "type": "object",
692
+ "additionalProperties": false,
693
+ "required": ["tool", "tool_version", "policy_id", "policy_digest"],
694
+ "properties": {
695
+ "tool": {
696
+ "const": "product-check"
697
+ },
698
+ "tool_version": {
699
+ "type": "string"
700
+ },
701
+ "policy_id": {
702
+ "type": ["string", "null"]
703
+ },
704
+ "policy_digest": {
705
+ "type": ["string", "null"],
706
+ "pattern": "^[0-9a-f]{64}$"
707
+ }
708
+ }
709
+ }
710
+ }
711
+ }