@enwithai/product-check 0.1.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 (102) hide show
  1. package/ATTRIBUTION.md +6 -6
  2. package/CHANGELOG.md +66 -0
  3. package/NOTICE.md +5 -3
  4. package/README.md +34 -19
  5. package/SECURITY.md +5 -1
  6. package/dashboard/assurance.css +71 -0
  7. package/dashboard/assurance.js +21 -0
  8. package/dashboard/dashboard.css +6 -0
  9. package/dist/assurance/adapters.d.ts +32 -0
  10. package/dist/assurance/adapters.js +76 -0
  11. package/dist/assurance/approvals.d.ts +34 -0
  12. package/dist/assurance/approvals.js +133 -0
  13. package/dist/assurance/cli.d.ts +13 -0
  14. package/dist/assurance/cli.js +863 -0
  15. package/dist/assurance/dashboard.d.ts +18 -0
  16. package/dist/assurance/dashboard.js +267 -0
  17. package/dist/assurance/diff.d.ts +20 -0
  18. package/dist/assurance/diff.js +99 -0
  19. package/dist/assurance/evidence-log.d.ts +20 -0
  20. package/dist/assurance/evidence-log.js +100 -0
  21. package/dist/assurance/fix-packets.d.ts +12 -0
  22. package/dist/assurance/fix-packets.js +178 -0
  23. package/dist/assurance/gate.d.ts +37 -0
  24. package/dist/assurance/gate.js +324 -0
  25. package/dist/assurance/lanes.d.ts +61 -0
  26. package/dist/assurance/lanes.js +380 -0
  27. package/dist/assurance/policy.d.ts +10 -0
  28. package/dist/assurance/policy.js +85 -0
  29. package/dist/assurance/proof.d.ts +35 -0
  30. package/dist/assurance/proof.js +146 -0
  31. package/dist/assurance/register.d.ts +41 -0
  32. package/dist/assurance/register.js +480 -0
  33. package/dist/assurance/render-md.d.ts +17 -0
  34. package/dist/assurance/render-md.js +212 -0
  35. package/dist/assurance/repo-state.d.ts +15 -0
  36. package/dist/assurance/repo-state.js +79 -0
  37. package/dist/assurance/review.d.ts +52 -0
  38. package/dist/assurance/review.js +408 -0
  39. package/dist/assurance/risk.d.ts +21 -0
  40. package/dist/assurance/risk.js +184 -0
  41. package/dist/assurance/types.d.ts +573 -0
  42. package/dist/assurance/types.js +6 -0
  43. package/dist/assurance/util.d.ts +24 -0
  44. package/dist/assurance/util.js +89 -0
  45. package/dist/assurance/verification.d.ts +30 -0
  46. package/dist/assurance/verification.js +212 -0
  47. package/dist/assurance/verify.d.ts +26 -0
  48. package/dist/assurance/verify.js +304 -0
  49. package/dist/blueprint/build.d.ts +3 -1
  50. package/dist/blueprint/build.js +41 -5
  51. package/dist/cli/run.js +103 -5
  52. package/dist/contract/contract.d.ts +4 -0
  53. package/dist/contract/contract.js +16 -0
  54. package/dist/dashboard/render.d.ts +5 -0
  55. package/dist/dashboard/render.js +107 -3
  56. package/dist/discovery/pops.d.ts +2 -0
  57. package/dist/discovery/pops.js +7 -5
  58. package/dist/exec/process.d.ts +27 -0
  59. package/dist/exec/process.js +175 -0
  60. package/dist/importers/operational.d.ts +56 -0
  61. package/dist/importers/operational.js +217 -0
  62. package/dist/importers/reports.d.ts +24 -0
  63. package/dist/importers/reports.js +37 -1
  64. package/dist/inspectors/source/surface.d.ts +30 -0
  65. package/dist/inspectors/source/surface.js +529 -0
  66. package/dist/parse/yaml.d.ts +4 -0
  67. package/dist/parse/yaml.js +39 -0
  68. package/dist/reporting/markdown.d.ts +1 -0
  69. package/dist/reporting/markdown.js +18 -1
  70. package/dist/reporting/spec-markdown.d.ts +9 -0
  71. package/dist/reporting/spec-markdown.js +144 -0
  72. package/dist/run.d.ts +2 -0
  73. package/dist/run.js +52 -2
  74. package/dist/schema/registry.js +10 -0
  75. package/dist/scoring/score.js +1 -1
  76. package/dist/spec/build.d.ts +28 -0
  77. package/dist/spec/build.js +278 -0
  78. package/dist/types.d.ts +78 -2
  79. package/dist/types.js +6 -1
  80. package/dist/validation/catalog.d.ts +1 -1
  81. package/dist/validation/catalog.js +125 -2
  82. package/dist/validation/context.d.ts +6 -1
  83. package/dist/validation/import-evaluators.js +37 -3
  84. package/dist/validation/integrity.js +4 -0
  85. package/dist/validation/operational-evaluators.d.ts +3 -0
  86. package/dist/validation/operational-evaluators.js +153 -0
  87. package/dist/validation/source-evaluators.js +1 -1
  88. package/package.json +4 -1
  89. package/schemas/approval.schema.json +98 -0
  90. package/schemas/as-built-spec.schema.json +356 -0
  91. package/schemas/assurance-common.schema.json +291 -0
  92. package/schemas/assurance-policy.schema.json +185 -0
  93. package/schemas/blueprint.schema.json +3 -0
  94. package/schemas/change-review.schema.json +711 -0
  95. package/schemas/closure-register.schema.json +499 -0
  96. package/schemas/evidence-record.schema.json +94 -0
  97. package/schemas/fix-packet.schema.json +272 -0
  98. package/schemas/release-gate.schema.json +308 -0
  99. package/schemas/reviewer-findings.schema.json +49 -0
  100. package/schemas/scan-contract.schema.json +20 -0
  101. package/schemas/scorecard.schema.json +1 -1
  102. package/schemas/verification-run.schema.json +199 -0
@@ -0,0 +1,291 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://github.com/enwithai/product-check/schemas/assurance-common.schema.json",
4
+ "title": "Product Check assurance shared definitions",
5
+ "description": "Enumerations and shapes shared by the CT3 v3.2 review and closure artifacts.",
6
+ "$defs": {
7
+ "schema_version": {
8
+ "const": "0.1.0"
9
+ },
10
+ "methodology_version": {
11
+ "const": "CT3 v3.2"
12
+ },
13
+ "verification_state": {
14
+ "enum": [
15
+ "SUSPECTED",
16
+ "EVIDENCE_COLLECTED",
17
+ "REPRODUCED",
18
+ "CORROBORATED",
19
+ "CONFIRMED",
20
+ "DISPROVEN",
21
+ "NEEDS_HUMAN_TRIAGE"
22
+ ]
23
+ },
24
+ "closure_state": {
25
+ "enum": [
26
+ "OPEN",
27
+ "ACKNOWLEDGED",
28
+ "IN_PROGRESS",
29
+ "FIX_PROPOSED",
30
+ "RETEST_REQUIRED",
31
+ "VERIFIED_FIXED",
32
+ "CLOSED",
33
+ "REJECTED_FALSE_POSITIVE",
34
+ "ACCEPTED_RISK",
35
+ "DEFERRED",
36
+ "REGRESSED"
37
+ ]
38
+ },
39
+ "risk_level": {
40
+ "enum": ["LOW", "MEDIUM", "HIGH", "UNDETERMINED"]
41
+ },
42
+ "gate_status": {
43
+ "enum": ["PASS", "CONDITIONAL", "BLOCK", "NOT_EVALUATED"]
44
+ },
45
+ "release_decision": {
46
+ "enum": ["GO", "CONDITIONAL_GO", "NO_GO", "UNKNOWN"]
47
+ },
48
+ "fix_status": {
49
+ "enum": ["PROPOSED", "IMPLEMENTED_UNVERIFIED", "VERIFIED", "REGRESSED"]
50
+ },
51
+ "lane": {
52
+ "enum": ["spec-outcome", "correctness", "impact", "trust-security", "experience", "operations"]
53
+ },
54
+ "phase": {
55
+ "enum": ["VC-P0", "VC-P1", "VC-P2", "VC-P3", "VC-P4", "VC-P5", "VC-P6", "VC-P7"]
56
+ },
57
+ "actor": {
58
+ "type": "object",
59
+ "additionalProperties": false,
60
+ "required": ["id", "type"],
61
+ "properties": {
62
+ "id": {
63
+ "type": "string",
64
+ "minLength": 1
65
+ },
66
+ "type": {
67
+ "enum": ["human", "agent", "system"]
68
+ }
69
+ }
70
+ },
71
+ "command_spec": {
72
+ "type": "object",
73
+ "additionalProperties": false,
74
+ "required": ["id", "argv", "purpose", "timeout_ms", "cwd", "source"],
75
+ "properties": {
76
+ "id": {
77
+ "type": "string",
78
+ "minLength": 1
79
+ },
80
+ "argv": {
81
+ "type": "array",
82
+ "items": {
83
+ "type": "string"
84
+ },
85
+ "minItems": 1
86
+ },
87
+ "purpose": {
88
+ "enum": ["build", "typecheck", "lint", "test", "smoke", "reproduction", "regression", "other"]
89
+ },
90
+ "timeout_ms": {
91
+ "type": "integer",
92
+ "minimum": 1
93
+ },
94
+ "cwd": {
95
+ "type": "string"
96
+ },
97
+ "source": {
98
+ "enum": ["policy", "fix", "corpus"]
99
+ }
100
+ }
101
+ },
102
+ "environment": {
103
+ "type": "object",
104
+ "additionalProperties": false,
105
+ "required": ["environment_id", "runner", "lockfile_digest"],
106
+ "properties": {
107
+ "environment_id": {
108
+ "type": "string"
109
+ },
110
+ "runner": {
111
+ "type": "object",
112
+ "additionalProperties": false,
113
+ "required": ["platform", "arch", "node_version", "tool_version"],
114
+ "properties": {
115
+ "platform": {
116
+ "type": "string"
117
+ },
118
+ "arch": {
119
+ "type": "string"
120
+ },
121
+ "node_version": {
122
+ "type": "string"
123
+ },
124
+ "tool_version": {
125
+ "type": "string"
126
+ }
127
+ }
128
+ },
129
+ "lockfile_digest": {
130
+ "type": ["string", "null"],
131
+ "pattern": "^[0-9a-f]{64}$"
132
+ }
133
+ }
134
+ },
135
+ "execution": {
136
+ "type": "object",
137
+ "additionalProperties": false,
138
+ "required": [
139
+ "execution_id",
140
+ "command_id",
141
+ "purpose",
142
+ "argv",
143
+ "cwd",
144
+ "status",
145
+ "exit_code",
146
+ "signal",
147
+ "duration_ms",
148
+ "started_at",
149
+ "environment_id",
150
+ "commit_sha",
151
+ "stdout_digest",
152
+ "stderr_digest",
153
+ "output_bytes",
154
+ "output_truncated",
155
+ "excerpt",
156
+ "reason",
157
+ "evidence_id"
158
+ ],
159
+ "properties": {
160
+ "execution_id": {
161
+ "type": "string"
162
+ },
163
+ "command_id": {
164
+ "type": "string"
165
+ },
166
+ "purpose": {
167
+ "enum": ["build", "typecheck", "lint", "test", "smoke", "reproduction", "regression", "other"]
168
+ },
169
+ "argv": {
170
+ "type": "array",
171
+ "items": {
172
+ "type": "string"
173
+ }
174
+ },
175
+ "cwd": {
176
+ "type": "string"
177
+ },
178
+ "status": {
179
+ "$ref": "common.schema.json#/$defs/validation_status"
180
+ },
181
+ "exit_code": {
182
+ "type": ["integer", "null"]
183
+ },
184
+ "signal": {
185
+ "type": ["string", "null"]
186
+ },
187
+ "duration_ms": {
188
+ "type": "integer",
189
+ "minimum": 0
190
+ },
191
+ "started_at": {
192
+ "type": "string",
193
+ "format": "date-time"
194
+ },
195
+ "environment_id": {
196
+ "type": "string"
197
+ },
198
+ "commit_sha": {
199
+ "type": ["string", "null"],
200
+ "pattern": "^[0-9a-f]{40}([0-9a-f]{24})?$"
201
+ },
202
+ "stdout_digest": {
203
+ "type": ["string", "null"],
204
+ "pattern": "^[0-9a-f]{64}$"
205
+ },
206
+ "stderr_digest": {
207
+ "type": ["string", "null"],
208
+ "pattern": "^[0-9a-f]{64}$"
209
+ },
210
+ "output_bytes": {
211
+ "type": "integer",
212
+ "minimum": 0
213
+ },
214
+ "output_truncated": {
215
+ "type": "boolean"
216
+ },
217
+ "excerpt": {
218
+ "type": ["string", "null"],
219
+ "maxLength": 400
220
+ },
221
+ "reason": {
222
+ "type": ["string", "null"]
223
+ },
224
+ "evidence_id": {
225
+ "type": ["string", "null"]
226
+ }
227
+ }
228
+ },
229
+ "check": {
230
+ "type": "object",
231
+ "additionalProperties": false,
232
+ "required": ["check", "result", "detail"],
233
+ "properties": {
234
+ "check": {
235
+ "type": "string"
236
+ },
237
+ "result": {
238
+ "enum": ["pass", "fail", "not-run"]
239
+ },
240
+ "detail": {
241
+ "type": "string"
242
+ }
243
+ }
244
+ },
245
+ "verification": {
246
+ "type": "object",
247
+ "additionalProperties": false,
248
+ "required": ["state", "checks"],
249
+ "properties": {
250
+ "state": {
251
+ "$ref": "assurance-common.schema.json#/$defs/verification_state"
252
+ },
253
+ "checks": {
254
+ "type": "array",
255
+ "items": {
256
+ "$ref": "assurance-common.schema.json#/$defs/check"
257
+ }
258
+ }
259
+ }
260
+ },
261
+ "approval_evaluation": {
262
+ "type": "object",
263
+ "additionalProperties": false,
264
+ "required": ["approval_id", "approver_id", "status", "reason"],
265
+ "properties": {
266
+ "approval_id": {
267
+ "type": "string"
268
+ },
269
+ "approver_id": {
270
+ "type": "string"
271
+ },
272
+ "status": {
273
+ "enum": [
274
+ "VALID",
275
+ "STALE",
276
+ "INVALID_SIGNATURE",
277
+ "UNSIGNED",
278
+ "UNKNOWN_APPROVER",
279
+ "NOT_HUMAN",
280
+ "SELF_APPROVAL",
281
+ "WRONG_SCOPE",
282
+ "REJECTED"
283
+ ]
284
+ },
285
+ "reason": {
286
+ "type": "string"
287
+ }
288
+ }
289
+ }
290
+ }
291
+ }
@@ -0,0 +1,185 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://github.com/enwithai/product-check/schemas/assurance-policy.schema.json",
4
+ "title": "Product Check assurance policy",
5
+ "description": "Operator-owned policy: required checks (argv, no shell), approvers with Ed25519 public keys, risk routing, review convergence, release and execution settings. Never read implicitly from the scanned repository.",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "required": [
9
+ "schema_version",
10
+ "kind",
11
+ "policy_id",
12
+ "required_checks",
13
+ "approvers",
14
+ "risk",
15
+ "review",
16
+ "release",
17
+ "exec"
18
+ ],
19
+ "properties": {
20
+ "schema_version": {
21
+ "$ref": "assurance-common.schema.json#/$defs/schema_version"
22
+ },
23
+ "kind": {
24
+ "const": "assurance-policy"
25
+ },
26
+ "policy_id": {
27
+ "type": "string",
28
+ "minLength": 1
29
+ },
30
+ "required_checks": {
31
+ "type": "array",
32
+ "items": {
33
+ "$ref": "assurance-common.schema.json#/$defs/command_spec"
34
+ }
35
+ },
36
+ "approvers": {
37
+ "type": "array",
38
+ "items": {
39
+ "type": "object",
40
+ "additionalProperties": false,
41
+ "required": ["id", "type", "roles", "public_key"],
42
+ "properties": {
43
+ "id": {
44
+ "type": "string",
45
+ "minLength": 1
46
+ },
47
+ "type": {
48
+ "enum": ["human", "bot"]
49
+ },
50
+ "roles": {
51
+ "type": "array",
52
+ "items": {
53
+ "type": "string"
54
+ }
55
+ },
56
+ "public_key": {
57
+ "type": "string",
58
+ "pattern": "BEGIN PUBLIC KEY"
59
+ }
60
+ }
61
+ }
62
+ },
63
+ "risk": {
64
+ "type": "object",
65
+ "additionalProperties": false,
66
+ "required": [
67
+ "protected_paths",
68
+ "high_risk_paths",
69
+ "low_risk_paths",
70
+ "trusted_authors",
71
+ "allow_low_risk_waiver",
72
+ "approvals"
73
+ ],
74
+ "properties": {
75
+ "protected_paths": {
76
+ "type": "array",
77
+ "items": {
78
+ "type": "object",
79
+ "additionalProperties": false,
80
+ "required": ["pattern", "owners"],
81
+ "properties": {
82
+ "pattern": {
83
+ "type": "string",
84
+ "minLength": 1
85
+ },
86
+ "owners": {
87
+ "type": "array",
88
+ "items": {
89
+ "type": "string"
90
+ }
91
+ }
92
+ }
93
+ }
94
+ },
95
+ "high_risk_paths": {
96
+ "type": "array",
97
+ "items": {
98
+ "type": "string"
99
+ }
100
+ },
101
+ "low_risk_paths": {
102
+ "type": "array",
103
+ "items": {
104
+ "type": "string"
105
+ }
106
+ },
107
+ "trusted_authors": {
108
+ "type": "array",
109
+ "items": {
110
+ "type": "string"
111
+ }
112
+ },
113
+ "allow_low_risk_waiver": {
114
+ "type": "boolean"
115
+ },
116
+ "approvals": {
117
+ "type": "object",
118
+ "additionalProperties": false,
119
+ "required": ["LOW", "MEDIUM", "HIGH"],
120
+ "properties": {
121
+ "LOW": {
122
+ "type": "integer",
123
+ "minimum": 0
124
+ },
125
+ "MEDIUM": {
126
+ "type": "integer",
127
+ "minimum": 1
128
+ },
129
+ "HIGH": {
130
+ "type": "integer",
131
+ "minimum": 1
132
+ }
133
+ }
134
+ }
135
+ }
136
+ },
137
+ "review": {
138
+ "type": "object",
139
+ "additionalProperties": false,
140
+ "required": ["max_cycles", "fail_closed_unverified_p0"],
141
+ "properties": {
142
+ "max_cycles": {
143
+ "type": "integer",
144
+ "minimum": 1,
145
+ "maximum": 20
146
+ },
147
+ "fail_closed_unverified_p0": {
148
+ "type": "boolean"
149
+ }
150
+ }
151
+ },
152
+ "release": {
153
+ "type": "object",
154
+ "additionalProperties": false,
155
+ "required": ["rollback_plan", "staged_rollout"],
156
+ "properties": {
157
+ "rollback_plan": {
158
+ "type": ["string", "null"]
159
+ },
160
+ "staged_rollout": {
161
+ "type": ["string", "null"]
162
+ }
163
+ }
164
+ },
165
+ "exec": {
166
+ "type": "object",
167
+ "additionalProperties": false,
168
+ "required": ["env_allowlist", "max_output_bytes"],
169
+ "properties": {
170
+ "env_allowlist": {
171
+ "type": "array",
172
+ "items": {
173
+ "type": "string",
174
+ "pattern": "^[A-Za-z_][A-Za-z0-9_]*$"
175
+ }
176
+ },
177
+ "max_output_bytes": {
178
+ "type": "integer",
179
+ "minimum": 1024,
180
+ "maximum": 268435456
181
+ }
182
+ }
183
+ }
184
+ }
185
+ }
@@ -62,6 +62,9 @@
62
62
  "items": {
63
63
  "type": "string"
64
64
  }
65
+ },
66
+ "as_built": {
67
+ "$ref": "as-built-spec.schema.json#/$defs/body"
65
68
  }
66
69
  }
67
70
  },