@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,272 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://github.com/enwithai/product-check/schemas/fix-packet.schema.json",
4
+ "title": "Product Check fix packet",
5
+ "description": "Agent-ready proposal for one verified finding: surfaces, evidence, root cause, change, tests (commands only when declared, never invented), negative cases, acceptance, owner, scope guard and rollback.",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "required": [
9
+ "schema_version",
10
+ "kind",
11
+ "methodology_version",
12
+ "fix_id",
13
+ "finding_ids",
14
+ "source_finding_ids",
15
+ "title",
16
+ "status",
17
+ "risk_class",
18
+ "severity",
19
+ "affected_surfaces",
20
+ "user_impact",
21
+ "evidence_refs",
22
+ "root_cause",
23
+ "constraints",
24
+ "proposed_change",
25
+ "tests_required",
26
+ "negative_cases",
27
+ "dependencies",
28
+ "acceptance_conditions",
29
+ "owner",
30
+ "rollback_plan",
31
+ "scope_guard",
32
+ "traceability",
33
+ "implementation",
34
+ "generated_from"
35
+ ],
36
+ "properties": {
37
+ "schema_version": {
38
+ "$ref": "assurance-common.schema.json#/$defs/schema_version"
39
+ },
40
+ "kind": {
41
+ "const": "fix-packet"
42
+ },
43
+ "methodology_version": {
44
+ "$ref": "assurance-common.schema.json#/$defs/methodology_version"
45
+ },
46
+ "fix_id": {
47
+ "type": "string",
48
+ "pattern": "^FP-F-\\d{3,}$"
49
+ },
50
+ "finding_ids": {
51
+ "type": "array",
52
+ "items": {
53
+ "type": "string"
54
+ },
55
+ "minItems": 1
56
+ },
57
+ "source_finding_ids": {
58
+ "type": "array",
59
+ "items": {
60
+ "type": "string"
61
+ }
62
+ },
63
+ "title": {
64
+ "type": "string"
65
+ },
66
+ "status": {
67
+ "$ref": "assurance-common.schema.json#/$defs/fix_status"
68
+ },
69
+ "risk_class": {
70
+ "$ref": "assurance-common.schema.json#/$defs/risk_level"
71
+ },
72
+ "severity": {
73
+ "$ref": "common.schema.json#/$defs/severity"
74
+ },
75
+ "affected_surfaces": {
76
+ "type": "array",
77
+ "items": {
78
+ "type": "object",
79
+ "additionalProperties": false,
80
+ "required": ["path", "line", "runtime"],
81
+ "properties": {
82
+ "path": {
83
+ "type": ["string", "null"]
84
+ },
85
+ "line": {
86
+ "type": ["integer", "null"]
87
+ },
88
+ "runtime": {
89
+ "type": ["string", "null"]
90
+ }
91
+ }
92
+ },
93
+ "minItems": 1
94
+ },
95
+ "user_impact": {
96
+ "type": "string"
97
+ },
98
+ "evidence_refs": {
99
+ "type": "array",
100
+ "items": {
101
+ "type": "string"
102
+ }
103
+ },
104
+ "root_cause": {
105
+ "type": "object",
106
+ "additionalProperties": false,
107
+ "required": ["hypothesis", "certainty", "confidence"],
108
+ "properties": {
109
+ "hypothesis": {
110
+ "type": "string"
111
+ },
112
+ "certainty": {
113
+ "$ref": "common.schema.json#/$defs/epistemic"
114
+ },
115
+ "confidence": {
116
+ "$ref": "common.schema.json#/$defs/confidence"
117
+ }
118
+ }
119
+ },
120
+ "constraints": {
121
+ "type": "array",
122
+ "items": {
123
+ "type": "string"
124
+ }
125
+ },
126
+ "proposed_change": {
127
+ "type": "string"
128
+ },
129
+ "tests_required": {
130
+ "type": "array",
131
+ "items": {
132
+ "type": "object",
133
+ "additionalProperties": false,
134
+ "required": ["id", "kind", "description", "argv"],
135
+ "properties": {
136
+ "id": {
137
+ "type": "string"
138
+ },
139
+ "kind": {
140
+ "enum": ["reproduction", "regression", "negative"]
141
+ },
142
+ "description": {
143
+ "type": "string"
144
+ },
145
+ "argv": {
146
+ "oneOf": [
147
+ {
148
+ "type": "null"
149
+ },
150
+ {
151
+ "type": "array",
152
+ "items": {
153
+ "type": "string"
154
+ },
155
+ "minItems": 1
156
+ }
157
+ ]
158
+ }
159
+ }
160
+ },
161
+ "minItems": 1
162
+ },
163
+ "negative_cases": {
164
+ "type": "array",
165
+ "items": {
166
+ "type": "string"
167
+ }
168
+ },
169
+ "dependencies": {
170
+ "type": "array",
171
+ "items": {
172
+ "type": "string"
173
+ }
174
+ },
175
+ "acceptance_conditions": {
176
+ "type": "array",
177
+ "items": {
178
+ "type": "string"
179
+ },
180
+ "minItems": 1
181
+ },
182
+ "owner": {
183
+ "type": "object",
184
+ "additionalProperties": false,
185
+ "required": ["id", "accountable_human_required"],
186
+ "properties": {
187
+ "id": {
188
+ "type": ["string", "null"]
189
+ },
190
+ "accountable_human_required": {
191
+ "const": true
192
+ }
193
+ }
194
+ },
195
+ "rollback_plan": {
196
+ "type": "string",
197
+ "minLength": 1
198
+ },
199
+ "scope_guard": {
200
+ "type": "object",
201
+ "additionalProperties": false,
202
+ "required": ["allowed_paths", "note"],
203
+ "properties": {
204
+ "allowed_paths": {
205
+ "type": "array",
206
+ "items": {
207
+ "type": "string"
208
+ }
209
+ },
210
+ "note": {
211
+ "type": "string"
212
+ }
213
+ }
214
+ },
215
+ "traceability": {
216
+ "type": "object",
217
+ "additionalProperties": false,
218
+ "required": ["control_or_rule", "spec_requirement_ids", "locations"],
219
+ "properties": {
220
+ "control_or_rule": {
221
+ "type": "string"
222
+ },
223
+ "spec_requirement_ids": {
224
+ "type": "array",
225
+ "items": {
226
+ "type": "string"
227
+ }
228
+ },
229
+ "locations": {
230
+ "type": "array",
231
+ "items": {
232
+ "type": "string"
233
+ }
234
+ }
235
+ }
236
+ },
237
+ "implementation": {
238
+ "type": "object",
239
+ "additionalProperties": false,
240
+ "required": ["change_sha", "implemented_by"],
241
+ "properties": {
242
+ "change_sha": {
243
+ "type": ["string", "null"],
244
+ "pattern": "^[0-9a-f]{40}([0-9a-f]{24})?$"
245
+ },
246
+ "implemented_by": {
247
+ "oneOf": [
248
+ {
249
+ "type": "null"
250
+ },
251
+ {
252
+ "$ref": "assurance-common.schema.json#/$defs/actor"
253
+ }
254
+ ]
255
+ }
256
+ }
257
+ },
258
+ "generated_from": {
259
+ "type": "object",
260
+ "additionalProperties": false,
261
+ "required": ["results_run_id", "review_id"],
262
+ "properties": {
263
+ "results_run_id": {
264
+ "type": ["string", "null"]
265
+ },
266
+ "review_id": {
267
+ "type": ["string", "null"]
268
+ }
269
+ }
270
+ }
271
+ }
272
+ }
@@ -0,0 +1,308 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://github.com/enwithai/product-check/schemas/release-gate.schema.json",
4
+ "title": "Product Check release gate",
5
+ "description": "Explicit GO / CONDITIONAL_GO / NO_GO / UNKNOWN decision with release conditions, open blockers, accepted-risk expiry, approvals for the head commit, executed checks, disclosed coverage gaps and VC-P0…P7 phase progress.",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "required": [
9
+ "schema_version",
10
+ "kind",
11
+ "methodology_version",
12
+ "gate_id",
13
+ "evaluated_at",
14
+ "target",
15
+ "head_sha",
16
+ "decision",
17
+ "product_verdict",
18
+ "change_gate",
19
+ "conditions",
20
+ "blocking_reasons",
21
+ "open",
22
+ "open_blocking_ids",
23
+ "accepted_risks",
24
+ "approvals",
25
+ "executed_checks",
26
+ "coverage",
27
+ "rollback",
28
+ "phases",
29
+ "inputs"
30
+ ],
31
+ "properties": {
32
+ "schema_version": {
33
+ "$ref": "assurance-common.schema.json#/$defs/schema_version"
34
+ },
35
+ "kind": {
36
+ "const": "release-gate"
37
+ },
38
+ "methodology_version": {
39
+ "$ref": "assurance-common.schema.json#/$defs/methodology_version"
40
+ },
41
+ "gate_id": {
42
+ "type": "string",
43
+ "pattern": "^RG-[0-9A-F]{10}$"
44
+ },
45
+ "evaluated_at": {
46
+ "type": "string",
47
+ "format": "date-time"
48
+ },
49
+ "target": {
50
+ "type": "object",
51
+ "additionalProperties": false,
52
+ "required": ["name", "repository"],
53
+ "properties": {
54
+ "name": {
55
+ "type": "string"
56
+ },
57
+ "repository": {
58
+ "type": ["string", "null"]
59
+ }
60
+ }
61
+ },
62
+ "head_sha": {
63
+ "type": ["string", "null"],
64
+ "pattern": "^[0-9a-f]{40}([0-9a-f]{24})?$"
65
+ },
66
+ "decision": {
67
+ "$ref": "assurance-common.schema.json#/$defs/release_decision"
68
+ },
69
+ "product_verdict": {
70
+ "$ref": "common.schema.json#/$defs/verdict"
71
+ },
72
+ "change_gate": {
73
+ "oneOf": [
74
+ {
75
+ "type": "null"
76
+ },
77
+ {
78
+ "$ref": "assurance-common.schema.json#/$defs/gate_status"
79
+ }
80
+ ]
81
+ },
82
+ "conditions": {
83
+ "type": "array",
84
+ "items": {
85
+ "type": "object",
86
+ "additionalProperties": false,
87
+ "required": ["id", "title", "status", "detail", "refs"],
88
+ "properties": {
89
+ "id": {
90
+ "type": "string",
91
+ "pattern": "^RC-\\d+$"
92
+ },
93
+ "title": {
94
+ "type": "string"
95
+ },
96
+ "status": {
97
+ "enum": ["PASS", "FAIL", "NOT_EVALUATED"]
98
+ },
99
+ "detail": {
100
+ "type": "string"
101
+ },
102
+ "refs": {
103
+ "type": "array",
104
+ "items": {
105
+ "type": "string"
106
+ }
107
+ }
108
+ }
109
+ },
110
+ "minItems": 1
111
+ },
112
+ "blocking_reasons": {
113
+ "type": "array",
114
+ "items": {
115
+ "type": "string"
116
+ },
117
+ "minItems": 1
118
+ },
119
+ "open": {
120
+ "type": "object",
121
+ "additionalProperties": false,
122
+ "required": ["P0", "P1", "P2", "P3"],
123
+ "properties": {
124
+ "P0": {
125
+ "type": "integer",
126
+ "minimum": 0
127
+ },
128
+ "P1": {
129
+ "type": "integer",
130
+ "minimum": 0
131
+ },
132
+ "P2": {
133
+ "type": "integer",
134
+ "minimum": 0
135
+ },
136
+ "P3": {
137
+ "type": "integer",
138
+ "minimum": 0
139
+ }
140
+ }
141
+ },
142
+ "open_blocking_ids": {
143
+ "type": "array",
144
+ "items": {
145
+ "type": "string"
146
+ }
147
+ },
148
+ "accepted_risks": {
149
+ "type": "array",
150
+ "items": {
151
+ "type": "object",
152
+ "additionalProperties": false,
153
+ "required": ["acceptance_id", "finding_id", "expires", "status"],
154
+ "properties": {
155
+ "acceptance_id": {
156
+ "type": "string"
157
+ },
158
+ "finding_id": {
159
+ "type": "string"
160
+ },
161
+ "expires": {
162
+ "type": "string",
163
+ "format": "date"
164
+ },
165
+ "status": {
166
+ "enum": ["ACTIVE", "REVIEW_DUE", "EXPIRED"]
167
+ }
168
+ }
169
+ }
170
+ },
171
+ "approvals": {
172
+ "type": "object",
173
+ "additionalProperties": false,
174
+ "required": ["required", "valid", "stale"],
175
+ "properties": {
176
+ "required": {
177
+ "type": "integer",
178
+ "minimum": 0
179
+ },
180
+ "valid": {
181
+ "type": "integer",
182
+ "minimum": 0
183
+ },
184
+ "stale": {
185
+ "type": "integer",
186
+ "minimum": 0
187
+ }
188
+ }
189
+ },
190
+ "executed_checks": {
191
+ "type": "object",
192
+ "additionalProperties": false,
193
+ "required": ["count", "passed", "failed", "not_run"],
194
+ "properties": {
195
+ "count": {
196
+ "type": "integer",
197
+ "minimum": 0
198
+ },
199
+ "passed": {
200
+ "type": "integer",
201
+ "minimum": 0
202
+ },
203
+ "failed": {
204
+ "type": "integer",
205
+ "minimum": 0
206
+ },
207
+ "not_run": {
208
+ "type": "integer",
209
+ "minimum": 0
210
+ }
211
+ }
212
+ },
213
+ "coverage": {
214
+ "type": "object",
215
+ "additionalProperties": false,
216
+ "required": ["customer", "technology", "trust", "overall", "gaps"],
217
+ "properties": {
218
+ "customer": {
219
+ "type": "number",
220
+ "minimum": 0,
221
+ "maximum": 1
222
+ },
223
+ "technology": {
224
+ "type": "number",
225
+ "minimum": 0,
226
+ "maximum": 1
227
+ },
228
+ "trust": {
229
+ "type": "number",
230
+ "minimum": 0,
231
+ "maximum": 1
232
+ },
233
+ "overall": {
234
+ "type": "number",
235
+ "minimum": 0,
236
+ "maximum": 1
237
+ },
238
+ "gaps": {
239
+ "type": "array",
240
+ "items": {
241
+ "type": "string"
242
+ }
243
+ }
244
+ }
245
+ },
246
+ "rollback": {
247
+ "type": "object",
248
+ "additionalProperties": false,
249
+ "required": ["declared", "ref"],
250
+ "properties": {
251
+ "declared": {
252
+ "type": "boolean"
253
+ },
254
+ "ref": {
255
+ "type": ["string", "null"]
256
+ }
257
+ }
258
+ },
259
+ "phases": {
260
+ "type": "array",
261
+ "items": {
262
+ "type": "object",
263
+ "additionalProperties": false,
264
+ "required": ["phase", "name", "status", "evidence"],
265
+ "properties": {
266
+ "phase": {
267
+ "$ref": "assurance-common.schema.json#/$defs/phase"
268
+ },
269
+ "name": {
270
+ "type": "string"
271
+ },
272
+ "status": {
273
+ "enum": ["COMPLETED", "PARTIAL", "NOT_STARTED", "NOT_SUPPORTED"]
274
+ },
275
+ "evidence": {
276
+ "type": "array",
277
+ "items": {
278
+ "type": "string"
279
+ }
280
+ }
281
+ }
282
+ },
283
+ "minItems": 8,
284
+ "maxItems": 8
285
+ },
286
+ "inputs": {
287
+ "type": "object",
288
+ "additionalProperties": false,
289
+ "required": ["results_sha256", "register_digest", "review_id", "proof_run_id"],
290
+ "properties": {
291
+ "results_sha256": {
292
+ "type": "string",
293
+ "pattern": "^[0-9a-f]{64}$"
294
+ },
295
+ "register_digest": {
296
+ "type": ["string", "null"],
297
+ "pattern": "^[0-9a-f]{64}$"
298
+ },
299
+ "review_id": {
300
+ "type": ["string", "null"]
301
+ },
302
+ "proof_run_id": {
303
+ "type": ["string", "null"]
304
+ }
305
+ }
306
+ }
307
+ }
308
+ }
@@ -0,0 +1,49 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://github.com/enwithai/product-check/schemas/reviewer-findings.schema.json",
4
+ "title": "External reviewer findings (input)",
5
+ "description": "Claims from an external reviewer (for example an AI code reviewer). They are proposals: Product Check verifies each against the code and never treats one as a human approval or a proven defect.",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "required": ["kind", "reviewer", "type", "findings"],
9
+ "properties": {
10
+ "kind": {
11
+ "const": "reviewer-findings"
12
+ },
13
+ "reviewer": {
14
+ "type": "string",
15
+ "minLength": 1
16
+ },
17
+ "type": {
18
+ "enum": ["ai", "human", "imported"]
19
+ },
20
+ "findings": {
21
+ "type": "array",
22
+ "items": {
23
+ "type": "object",
24
+ "additionalProperties": false,
25
+ "required": ["path", "line", "title", "severity", "body"],
26
+ "properties": {
27
+ "path": {
28
+ "type": "string",
29
+ "minLength": 1
30
+ },
31
+ "line": {
32
+ "type": ["integer", "null"],
33
+ "minimum": 1
34
+ },
35
+ "title": {
36
+ "type": "string",
37
+ "minLength": 1
38
+ },
39
+ "severity": {
40
+ "$ref": "common.schema.json#/$defs/severity"
41
+ },
42
+ "body": {
43
+ "type": "string"
44
+ }
45
+ }
46
+ }
47
+ }
48
+ }
49
+ }