@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,499 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://github.com/enwithai/product-check/schemas/closure-register.schema.json",
4
+ "title": "Product Check closure register",
5
+ "description": "Verified-closure state of every finding with hash-chained transitions, fixes, verification runs, signed approvals, risk acceptances and the regression corpus.",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "required": [
9
+ "schema_version",
10
+ "kind",
11
+ "methodology_version",
12
+ "register_id",
13
+ "target",
14
+ "created_at",
15
+ "updated_at",
16
+ "baseline",
17
+ "settings",
18
+ "entries",
19
+ "fixes",
20
+ "verification_runs",
21
+ "approvals",
22
+ "risk_acceptances",
23
+ "regression_corpus",
24
+ "chain"
25
+ ],
26
+ "properties": {
27
+ "schema_version": {
28
+ "$ref": "assurance-common.schema.json#/$defs/schema_version"
29
+ },
30
+ "kind": {
31
+ "const": "closure-register"
32
+ },
33
+ "methodology_version": {
34
+ "$ref": "assurance-common.schema.json#/$defs/methodology_version"
35
+ },
36
+ "register_id": {
37
+ "type": "string"
38
+ },
39
+ "target": {
40
+ "type": "object",
41
+ "additionalProperties": false,
42
+ "required": ["name", "repository"],
43
+ "properties": {
44
+ "name": {
45
+ "type": "string"
46
+ },
47
+ "repository": {
48
+ "type": ["string", "null"]
49
+ }
50
+ }
51
+ },
52
+ "created_at": {
53
+ "type": "string",
54
+ "format": "date-time"
55
+ },
56
+ "updated_at": {
57
+ "type": "string",
58
+ "format": "date-time"
59
+ },
60
+ "baseline": {
61
+ "type": "object",
62
+ "additionalProperties": false,
63
+ "required": ["run_id", "results_sha256", "baseline_sha"],
64
+ "properties": {
65
+ "run_id": {
66
+ "type": "string"
67
+ },
68
+ "results_sha256": {
69
+ "type": "string",
70
+ "pattern": "^[0-9a-f]{64}$"
71
+ },
72
+ "baseline_sha": {
73
+ "type": ["string", "null"],
74
+ "pattern": "^[0-9a-f]{40}([0-9a-f]{24})?$"
75
+ }
76
+ }
77
+ },
78
+ "settings": {
79
+ "type": "object",
80
+ "additionalProperties": false,
81
+ "required": ["max_cycles"],
82
+ "properties": {
83
+ "max_cycles": {
84
+ "type": "integer",
85
+ "minimum": 1
86
+ }
87
+ }
88
+ },
89
+ "entries": {
90
+ "type": "array",
91
+ "items": {
92
+ "type": "object",
93
+ "additionalProperties": false,
94
+ "required": [
95
+ "finding_id",
96
+ "source",
97
+ "source_finding_id",
98
+ "rule_or_control",
99
+ "title",
100
+ "severity",
101
+ "pillar",
102
+ "epistemic",
103
+ "location",
104
+ "dedupe_key",
105
+ "verification",
106
+ "state",
107
+ "opened_in",
108
+ "cycles",
109
+ "escalated",
110
+ "fix_ids",
111
+ "verification_ids",
112
+ "approval_ids",
113
+ "acceptance_id",
114
+ "regressions",
115
+ "closure",
116
+ "transitions"
117
+ ],
118
+ "properties": {
119
+ "finding_id": {
120
+ "type": "string",
121
+ "pattern": "^F-\\d{3,}$"
122
+ },
123
+ "source": {
124
+ "enum": ["baseline-scan", "change-review", "incident"]
125
+ },
126
+ "source_finding_id": {
127
+ "type": "string"
128
+ },
129
+ "rule_or_control": {
130
+ "type": "string"
131
+ },
132
+ "title": {
133
+ "type": "string"
134
+ },
135
+ "severity": {
136
+ "$ref": "common.schema.json#/$defs/severity"
137
+ },
138
+ "pillar": {
139
+ "$ref": "common.schema.json#/$defs/pillar"
140
+ },
141
+ "epistemic": {
142
+ "$ref": "common.schema.json#/$defs/epistemic"
143
+ },
144
+ "location": {
145
+ "type": "string"
146
+ },
147
+ "dedupe_key": {
148
+ "type": "string"
149
+ },
150
+ "verification": {
151
+ "$ref": "assurance-common.schema.json#/$defs/verification"
152
+ },
153
+ "state": {
154
+ "$ref": "assurance-common.schema.json#/$defs/closure_state"
155
+ },
156
+ "opened_in": {
157
+ "type": "string"
158
+ },
159
+ "cycles": {
160
+ "type": "integer",
161
+ "minimum": 0
162
+ },
163
+ "escalated": {
164
+ "type": "boolean"
165
+ },
166
+ "fix_ids": {
167
+ "type": "array",
168
+ "items": {
169
+ "type": "string"
170
+ }
171
+ },
172
+ "verification_ids": {
173
+ "type": "array",
174
+ "items": {
175
+ "type": "string"
176
+ }
177
+ },
178
+ "approval_ids": {
179
+ "type": "array",
180
+ "items": {
181
+ "type": "string"
182
+ }
183
+ },
184
+ "acceptance_id": {
185
+ "type": ["string", "null"]
186
+ },
187
+ "regressions": {
188
+ "type": "array",
189
+ "items": {
190
+ "type": "object",
191
+ "additionalProperties": false,
192
+ "required": ["at", "run_id", "previous_state"],
193
+ "properties": {
194
+ "at": {
195
+ "type": "string",
196
+ "format": "date-time"
197
+ },
198
+ "run_id": {
199
+ "type": "string"
200
+ },
201
+ "previous_state": {
202
+ "$ref": "assurance-common.schema.json#/$defs/closure_state"
203
+ }
204
+ }
205
+ }
206
+ },
207
+ "closure": {
208
+ "oneOf": [
209
+ {
210
+ "type": "null"
211
+ },
212
+ {
213
+ "type": "object",
214
+ "additionalProperties": false,
215
+ "required": ["closure_id", "actor", "at", "verification_id", "approval_ids"],
216
+ "properties": {
217
+ "closure_id": {
218
+ "type": "string",
219
+ "pattern": "^CL-\\d{3,}$"
220
+ },
221
+ "actor": {
222
+ "$ref": "assurance-common.schema.json#/$defs/actor"
223
+ },
224
+ "at": {
225
+ "type": "string",
226
+ "format": "date-time"
227
+ },
228
+ "verification_id": {
229
+ "type": "string"
230
+ },
231
+ "approval_ids": {
232
+ "type": "array",
233
+ "items": {
234
+ "type": "string"
235
+ },
236
+ "minItems": 1
237
+ }
238
+ }
239
+ }
240
+ ]
241
+ },
242
+ "transitions": {
243
+ "type": "array",
244
+ "items": {
245
+ "type": "object",
246
+ "additionalProperties": false,
247
+ "required": ["seq", "from", "to", "at", "actor", "reason", "refs", "prev_digest", "digest"],
248
+ "properties": {
249
+ "seq": {
250
+ "type": "integer",
251
+ "minimum": 1
252
+ },
253
+ "from": {
254
+ "oneOf": [
255
+ {
256
+ "type": "null"
257
+ },
258
+ {
259
+ "$ref": "assurance-common.schema.json#/$defs/closure_state"
260
+ }
261
+ ]
262
+ },
263
+ "to": {
264
+ "$ref": "assurance-common.schema.json#/$defs/closure_state"
265
+ },
266
+ "at": {
267
+ "type": "string",
268
+ "format": "date-time"
269
+ },
270
+ "actor": {
271
+ "$ref": "assurance-common.schema.json#/$defs/actor"
272
+ },
273
+ "reason": {
274
+ "type": "string"
275
+ },
276
+ "refs": {
277
+ "type": "object",
278
+ "additionalProperties": false,
279
+ "required": ["evidence_ids", "verification_id", "approval_ids", "fix_id", "run_id"],
280
+ "properties": {
281
+ "evidence_ids": {
282
+ "type": "array",
283
+ "items": {
284
+ "type": "string"
285
+ }
286
+ },
287
+ "verification_id": {
288
+ "type": ["string", "null"]
289
+ },
290
+ "approval_ids": {
291
+ "type": "array",
292
+ "items": {
293
+ "type": "string"
294
+ }
295
+ },
296
+ "fix_id": {
297
+ "type": ["string", "null"]
298
+ },
299
+ "run_id": {
300
+ "type": ["string", "null"]
301
+ }
302
+ }
303
+ },
304
+ "prev_digest": {
305
+ "type": ["string", "null"],
306
+ "pattern": "^[0-9a-f]{64}$"
307
+ },
308
+ "digest": {
309
+ "type": "string",
310
+ "pattern": "^[0-9a-f]{64}$"
311
+ }
312
+ }
313
+ },
314
+ "minItems": 1
315
+ }
316
+ }
317
+ }
318
+ },
319
+ "fixes": {
320
+ "type": "array",
321
+ "items": {
322
+ "type": "object",
323
+ "additionalProperties": false,
324
+ "required": [
325
+ "fix_id",
326
+ "finding_ids",
327
+ "change_sha",
328
+ "implemented_by",
329
+ "status",
330
+ "reproduction",
331
+ "recorded_at"
332
+ ],
333
+ "properties": {
334
+ "fix_id": {
335
+ "type": "string",
336
+ "pattern": "^FX-\\d{3,}$"
337
+ },
338
+ "finding_ids": {
339
+ "type": "array",
340
+ "items": {
341
+ "type": "string"
342
+ },
343
+ "minItems": 1
344
+ },
345
+ "change_sha": {
346
+ "type": "string",
347
+ "pattern": "^[0-9a-f]{40}([0-9a-f]{24})?$"
348
+ },
349
+ "implemented_by": {
350
+ "$ref": "assurance-common.schema.json#/$defs/actor"
351
+ },
352
+ "status": {
353
+ "$ref": "assurance-common.schema.json#/$defs/fix_status"
354
+ },
355
+ "reproduction": {
356
+ "type": "array",
357
+ "items": {
358
+ "$ref": "assurance-common.schema.json#/$defs/command_spec"
359
+ }
360
+ },
361
+ "recorded_at": {
362
+ "type": "string",
363
+ "format": "date-time"
364
+ }
365
+ }
366
+ }
367
+ },
368
+ "verification_runs": {
369
+ "type": "array",
370
+ "items": {
371
+ "$ref": "verification-run.schema.json"
372
+ }
373
+ },
374
+ "approvals": {
375
+ "type": "array",
376
+ "items": {
377
+ "$ref": "approval.schema.json"
378
+ }
379
+ },
380
+ "risk_acceptances": {
381
+ "type": "array",
382
+ "items": {
383
+ "type": "object",
384
+ "additionalProperties": false,
385
+ "required": [
386
+ "acceptance_id",
387
+ "finding_id",
388
+ "owner",
389
+ "scope",
390
+ "rationale",
391
+ "compensating_controls",
392
+ "review_date",
393
+ "expires",
394
+ "closure_condition",
395
+ "approval_ids",
396
+ "created_at"
397
+ ],
398
+ "properties": {
399
+ "acceptance_id": {
400
+ "type": "string",
401
+ "pattern": "^RA-\\d{3,}$"
402
+ },
403
+ "finding_id": {
404
+ "type": "string"
405
+ },
406
+ "owner": {
407
+ "type": "string",
408
+ "minLength": 1
409
+ },
410
+ "scope": {
411
+ "type": "string",
412
+ "minLength": 1
413
+ },
414
+ "rationale": {
415
+ "type": "string",
416
+ "minLength": 1
417
+ },
418
+ "compensating_controls": {
419
+ "type": "array",
420
+ "items": {
421
+ "type": "string"
422
+ },
423
+ "minItems": 1
424
+ },
425
+ "review_date": {
426
+ "type": "string",
427
+ "format": "date"
428
+ },
429
+ "expires": {
430
+ "type": "string",
431
+ "format": "date"
432
+ },
433
+ "closure_condition": {
434
+ "type": "string",
435
+ "minLength": 1
436
+ },
437
+ "approval_ids": {
438
+ "type": "array",
439
+ "items": {
440
+ "type": "string"
441
+ },
442
+ "minItems": 1
443
+ },
444
+ "created_at": {
445
+ "type": "string",
446
+ "format": "date-time"
447
+ }
448
+ }
449
+ }
450
+ },
451
+ "regression_corpus": {
452
+ "type": "array",
453
+ "items": {
454
+ "type": "object",
455
+ "additionalProperties": false,
456
+ "required": ["case_id", "finding_id", "origin", "description", "command", "added_at", "added_by"],
457
+ "properties": {
458
+ "case_id": {
459
+ "type": "string"
460
+ },
461
+ "finding_id": {
462
+ "type": "string"
463
+ },
464
+ "origin": {
465
+ "enum": ["escaped-incident", "regressed-finding", "verified-fix"]
466
+ },
467
+ "description": {
468
+ "type": "string"
469
+ },
470
+ "command": {
471
+ "$ref": "assurance-common.schema.json#/$defs/command_spec"
472
+ },
473
+ "added_at": {
474
+ "type": "string",
475
+ "format": "date-time"
476
+ },
477
+ "added_by": {
478
+ "$ref": "assurance-common.schema.json#/$defs/actor"
479
+ }
480
+ }
481
+ }
482
+ },
483
+ "chain": {
484
+ "type": "object",
485
+ "additionalProperties": false,
486
+ "required": ["length", "head_digest"],
487
+ "properties": {
488
+ "length": {
489
+ "type": "integer",
490
+ "minimum": 0
491
+ },
492
+ "head_digest": {
493
+ "type": ["string", "null"],
494
+ "pattern": "^[0-9a-f]{64}$"
495
+ }
496
+ }
497
+ }
498
+ }
499
+ }
@@ -0,0 +1,94 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://github.com/enwithai/product-check/schemas/evidence-record.schema.json",
4
+ "title": "Product Check evidence record (review-evidence.jsonl line)",
5
+ "description": "One append-only, hash-chained evidence record. digest = SHA-256 of the canonical JSON of every other field; prev_digest links to the previous line.",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "required": [
9
+ "schema_version",
10
+ "kind",
11
+ "seq",
12
+ "evidence_id",
13
+ "recorded_at",
14
+ "type",
15
+ "subject",
16
+ "commit_sha",
17
+ "environment_id",
18
+ "summary",
19
+ "locator",
20
+ "line",
21
+ "payload_digest",
22
+ "payload",
23
+ "prev_digest",
24
+ "digest"
25
+ ],
26
+ "properties": {
27
+ "schema_version": {
28
+ "$ref": "assurance-common.schema.json#/$defs/schema_version"
29
+ },
30
+ "kind": {
31
+ "const": "evidence-record"
32
+ },
33
+ "seq": {
34
+ "type": "integer",
35
+ "minimum": 1
36
+ },
37
+ "evidence_id": {
38
+ "type": "string",
39
+ "pattern": "^EVR-[0-9A-F]{12}$"
40
+ },
41
+ "recorded_at": {
42
+ "type": "string",
43
+ "format": "date-time"
44
+ },
45
+ "type": {
46
+ "enum": [
47
+ "command-execution",
48
+ "diff-hunk",
49
+ "source-recheck",
50
+ "results-artifact",
51
+ "approval",
52
+ "verification",
53
+ "imported-report",
54
+ "reviewer-claim",
55
+ "transition"
56
+ ]
57
+ },
58
+ "subject": {
59
+ "type": "string"
60
+ },
61
+ "commit_sha": {
62
+ "type": ["string", "null"],
63
+ "pattern": "^[0-9a-f]{40}([0-9a-f]{24})?$"
64
+ },
65
+ "environment_id": {
66
+ "type": ["string", "null"]
67
+ },
68
+ "summary": {
69
+ "type": "string",
70
+ "maxLength": 500
71
+ },
72
+ "locator": {
73
+ "type": ["string", "null"]
74
+ },
75
+ "line": {
76
+ "type": ["integer", "null"]
77
+ },
78
+ "payload_digest": {
79
+ "type": "string",
80
+ "pattern": "^[0-9a-f]{64}$"
81
+ },
82
+ "payload": {
83
+ "type": "object"
84
+ },
85
+ "prev_digest": {
86
+ "type": ["string", "null"],
87
+ "pattern": "^[0-9a-f]{64}$"
88
+ },
89
+ "digest": {
90
+ "type": "string",
91
+ "pattern": "^[0-9a-f]{64}$"
92
+ }
93
+ }
94
+ }