@dogfood-lab/schemas 1.2.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.
@@ -0,0 +1,226 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://github.com/dogfood-lab/testing-os/packages/schemas/src/json/dogfood-record-submission.schema.json",
4
+ "title": "Dogfood Record Submission",
5
+ "description": "Source-authored payload emitted by a dogfood workflow. Does not contain verifier-owned fields. Sent via repository_dispatch to dogfood-labs for central ingestion.",
6
+ "type": "object",
7
+ "required": [
8
+ "schema_version",
9
+ "run_id",
10
+ "repo",
11
+ "ref",
12
+ "source",
13
+ "timing",
14
+ "scenario_results",
15
+ "overall_verdict"
16
+ ],
17
+ "additionalProperties": false,
18
+ "properties": {
19
+
20
+ "schema_version": {
21
+ "type": "string",
22
+ "pattern": "^\\d+\\.\\d+\\.\\d+$",
23
+ "description": "Semver of the submission schema this payload conforms to."
24
+ },
25
+
26
+ "run_id": {
27
+ "type": "string",
28
+ "minLength": 1,
29
+ "description": "Unique dogfood run identifier. ULID recommended for sortability."
30
+ },
31
+
32
+ "repo": {
33
+ "type": "string",
34
+ "pattern": "^[a-zA-Z0-9_.-]+/[a-zA-Z0-9_.-]+$",
35
+ "description": "Full org/repo name."
36
+ },
37
+
38
+ "ref": {
39
+ "type": "object",
40
+ "required": ["commit_sha"],
41
+ "additionalProperties": false,
42
+ "properties": {
43
+ "branch": { "type": "string" },
44
+ "commit_sha": {
45
+ "type": "string",
46
+ "pattern": "^[0-9a-f]{40}$"
47
+ },
48
+ "version": {
49
+ "type": "string",
50
+ "description": "Release version tag if applicable."
51
+ }
52
+ }
53
+ },
54
+
55
+ "source": {
56
+ "type": "object",
57
+ "required": ["provider", "workflow", "provider_run_id", "run_url"],
58
+ "additionalProperties": false,
59
+ "properties": {
60
+ "provider": {
61
+ "type": "string",
62
+ "enum": ["github"],
63
+ "description": "SCM provider. GitHub-only for now."
64
+ },
65
+ "workflow": {
66
+ "type": "string",
67
+ "description": "Workflow filename that produced this submission."
68
+ },
69
+ "provider_run_id": {
70
+ "type": "string",
71
+ "description": "GitHub Actions run ID (provider-native)."
72
+ },
73
+ "attempt": {
74
+ "type": "integer",
75
+ "minimum": 1,
76
+ "default": 1
77
+ },
78
+ "run_url": {
79
+ "type": "string",
80
+ "format": "uri"
81
+ },
82
+ "actor": {
83
+ "type": "string",
84
+ "description": "GitHub username that triggered the workflow."
85
+ }
86
+ }
87
+ },
88
+
89
+ "timing": {
90
+ "type": "object",
91
+ "required": ["started_at", "finished_at"],
92
+ "additionalProperties": false,
93
+ "properties": {
94
+ "started_at": { "type": "string", "format": "date-time" },
95
+ "finished_at": { "type": "string", "format": "date-time" },
96
+ "duration_ms": { "type": "integer", "minimum": 0 }
97
+ }
98
+ },
99
+
100
+ "ci_checks": {
101
+ "type": "array",
102
+ "description": "Machine-evaluated CI results. Optional — not all dogfood runs include CI.",
103
+ "items": {
104
+ "type": "object",
105
+ "required": ["id", "kind", "status"],
106
+ "additionalProperties": false,
107
+ "properties": {
108
+ "id": { "type": "string" },
109
+ "kind": {
110
+ "type": "string",
111
+ "enum": ["test", "coverage", "lint", "security", "build", "other"]
112
+ },
113
+ "status": {
114
+ "type": "string",
115
+ "enum": ["pass", "fail", "skip"]
116
+ },
117
+ "value": {
118
+ "type": "number",
119
+ "description": "Numeric result (test count, coverage %, etc.)."
120
+ },
121
+ "threshold": {
122
+ "type": "number",
123
+ "description": "Policy threshold if applicable."
124
+ }
125
+ }
126
+ }
127
+ },
128
+
129
+ "scenario_results": {
130
+ "type": "array",
131
+ "minItems": 1,
132
+ "description": "Dogfood evidence. At least one scenario required.",
133
+ "items": {
134
+ "type": "object",
135
+ "required": ["scenario_id", "product_surface", "execution_mode", "verdict", "step_results"],
136
+ "additionalProperties": false,
137
+ "properties": {
138
+ "scenario_id": {
139
+ "type": "string",
140
+ "description": "Stable ID matching a scenario definition in the source repo."
141
+ },
142
+ "scenario_name": { "type": "string" },
143
+ "scenario_version": {
144
+ "type": "string",
145
+ "pattern": "^\\d+\\.\\d+\\.\\d+$"
146
+ },
147
+ "product_surface": {
148
+ "type": "string",
149
+ "enum": ["cli", "desktop", "web", "api", "mcp-server", "npm-package", "plugin", "library"]
150
+ },
151
+ "execution_mode": {
152
+ "type": "string",
153
+ "enum": ["bot", "human", "mixed"]
154
+ },
155
+ "attested_by": {
156
+ "type": "string",
157
+ "description": "Human attester ID. Verifier enforces presence when execution_mode is human or mixed."
158
+ },
159
+ "verdict": {
160
+ "type": "string",
161
+ "enum": ["pass", "fail", "blocked", "partial"]
162
+ },
163
+ "blocking_reason": {
164
+ "type": "string",
165
+ "description": "Required when verdict is blocked. Verifier enforces."
166
+ },
167
+ "step_results": {
168
+ "type": "array",
169
+ "minItems": 1,
170
+ "description": "Per-step execution results. Bridges scenario steps to record evidence.",
171
+ "items": {
172
+ "type": "object",
173
+ "required": ["step_id", "status"],
174
+ "additionalProperties": false,
175
+ "properties": {
176
+ "step_id": {
177
+ "type": "string",
178
+ "pattern": "^[a-z0-9][a-z0-9-]*$",
179
+ "description": "Must match a step.id from the scenario definition."
180
+ },
181
+ "status": {
182
+ "type": "string",
183
+ "enum": ["pass", "fail", "blocked", "skip", "partial"]
184
+ },
185
+ "notes": { "type": "string" }
186
+ }
187
+ }
188
+ },
189
+ "evidence": {
190
+ "type": "array",
191
+ "items": {
192
+ "type": "object",
193
+ "required": ["kind", "url"],
194
+ "additionalProperties": false,
195
+ "properties": {
196
+ "kind": {
197
+ "type": "string",
198
+ "enum": ["log", "screenshot", "recording", "transcript", "artifact", "other"]
199
+ },
200
+ "url": { "type": "string", "format": "uri" },
201
+ "description": { "type": "string" },
202
+ "expires_at": {
203
+ "type": "string",
204
+ "format": "date-time",
205
+ "description": "When this evidence URL will become unavailable."
206
+ }
207
+ }
208
+ }
209
+ },
210
+ "notes": { "type": "string" }
211
+ }
212
+ }
213
+ },
214
+
215
+ "overall_verdict": {
216
+ "type": "string",
217
+ "enum": ["pass", "fail", "blocked", "partial"],
218
+ "description": "Source-proposed verdict. Verifier may confirm or downgrade, never upgrade."
219
+ },
220
+
221
+ "notes": {
222
+ "type": "string",
223
+ "description": "Freeform summary from the source."
224
+ }
225
+ }
226
+ }
@@ -0,0 +1,303 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://github.com/dogfood-lab/testing-os/packages/schemas/src/json/dogfood-record.schema.json",
4
+ "title": "Dogfood Record (Persisted)",
5
+ "description": "Canonical persisted record written by the central verifier. Includes all source-authored fields plus verifier-owned fields. Stored in records/ (accepted) or records/_rejected/ (rejected). Never authored by source repos.",
6
+ "type": "object",
7
+ "required": [
8
+ "schema_version",
9
+ "policy_version",
10
+ "run_id",
11
+ "repo",
12
+ "ref",
13
+ "source",
14
+ "timing",
15
+ "scenario_results",
16
+ "overall_verdict",
17
+ "verification"
18
+ ],
19
+ "additionalProperties": false,
20
+ "properties": {
21
+
22
+ "schema_version": {
23
+ "type": "string",
24
+ "pattern": "^\\d+\\.\\d+\\.\\d+$",
25
+ "description": "Semver of the persisted record schema."
26
+ },
27
+
28
+ "policy_version": {
29
+ "type": "string",
30
+ "pattern": "^\\d+\\.\\d+\\.\\d+$",
31
+ "description": "Semver of the policy this record was evaluated against. Set by verifier."
32
+ },
33
+
34
+ "run_id": {
35
+ "type": "string",
36
+ "minLength": 1,
37
+ "description": "Unique dogfood run identifier. Carried from submission."
38
+ },
39
+
40
+ "repo": {
41
+ "type": "string",
42
+ "pattern": "^[a-zA-Z0-9_.-]+/[a-zA-Z0-9_.-]+$",
43
+ "description": "Full org/repo name."
44
+ },
45
+
46
+ "ref": {
47
+ "type": "object",
48
+ "required": ["commit_sha"],
49
+ "additionalProperties": false,
50
+ "properties": {
51
+ "branch": { "type": "string" },
52
+ "commit_sha": {
53
+ "type": "string",
54
+ "pattern": "^[0-9a-f]{40}$"
55
+ },
56
+ "version": {
57
+ "type": "string",
58
+ "description": "Release version tag if applicable."
59
+ }
60
+ }
61
+ },
62
+
63
+ "source": {
64
+ "type": "object",
65
+ "required": ["provider", "workflow", "provider_run_id", "run_url"],
66
+ "additionalProperties": false,
67
+ "properties": {
68
+ "provider": {
69
+ "type": "string",
70
+ "enum": ["github"],
71
+ "description": "SCM provider. GitHub-only for now."
72
+ },
73
+ "workflow": {
74
+ "type": "string",
75
+ "description": "Workflow filename that produced the submission."
76
+ },
77
+ "provider_run_id": {
78
+ "type": "string",
79
+ "description": "GitHub Actions run ID (provider-native)."
80
+ },
81
+ "attempt": {
82
+ "type": "integer",
83
+ "minimum": 1,
84
+ "default": 1
85
+ },
86
+ "run_url": {
87
+ "type": "string",
88
+ "format": "uri"
89
+ },
90
+ "actor": {
91
+ "type": "string",
92
+ "description": "GitHub username that triggered the workflow."
93
+ }
94
+ }
95
+ },
96
+
97
+ "timing": {
98
+ "type": "object",
99
+ "required": ["started_at", "finished_at"],
100
+ "additionalProperties": false,
101
+ "properties": {
102
+ "started_at": { "type": "string", "format": "date-time" },
103
+ "finished_at": { "type": "string", "format": "date-time" },
104
+ "duration_ms": { "type": "integer", "minimum": 0 }
105
+ }
106
+ },
107
+
108
+ "ci_checks": {
109
+ "type": "array",
110
+ "description": "Machine-evaluated CI results. Optional — not all dogfood runs include CI.",
111
+ "items": {
112
+ "type": "object",
113
+ "required": ["id", "kind", "status"],
114
+ "additionalProperties": false,
115
+ "properties": {
116
+ "id": { "type": "string" },
117
+ "kind": {
118
+ "type": "string",
119
+ "enum": ["test", "coverage", "lint", "security", "build", "other"]
120
+ },
121
+ "status": {
122
+ "type": "string",
123
+ "enum": ["pass", "fail", "skip"]
124
+ },
125
+ "value": {
126
+ "type": "number",
127
+ "description": "Numeric result (test count, coverage %, etc.)."
128
+ },
129
+ "threshold": {
130
+ "type": "number",
131
+ "description": "Policy threshold if applicable."
132
+ }
133
+ }
134
+ }
135
+ },
136
+
137
+ "scenario_results": {
138
+ "type": "array",
139
+ "minItems": 1,
140
+ "description": "Dogfood evidence. At least one scenario required.",
141
+ "items": {
142
+ "type": "object",
143
+ "required": ["scenario_id", "product_surface", "execution_mode", "verdict", "step_results"],
144
+ "additionalProperties": false,
145
+ "properties": {
146
+ "scenario_id": {
147
+ "type": "string",
148
+ "description": "Stable ID matching a scenario definition in the source repo."
149
+ },
150
+ "scenario_name": { "type": "string" },
151
+ "scenario_version": {
152
+ "type": "string",
153
+ "pattern": "^\\d+\\.\\d+\\.\\d+$"
154
+ },
155
+ "product_surface": {
156
+ "type": "string",
157
+ "enum": ["cli", "desktop", "web", "api", "mcp-server", "npm-package", "plugin", "library"]
158
+ },
159
+ "execution_mode": {
160
+ "type": "string",
161
+ "enum": ["bot", "human", "mixed"]
162
+ },
163
+ "attested_by": {
164
+ "type": "string",
165
+ "description": "Human attester ID. Verifier enforces presence when execution_mode is human or mixed."
166
+ },
167
+ "verdict": {
168
+ "type": "string",
169
+ "enum": ["pass", "fail", "blocked", "partial"]
170
+ },
171
+ "blocking_reason": {
172
+ "type": "string",
173
+ "description": "Required when verdict is blocked. Verifier enforces."
174
+ },
175
+ "step_results": {
176
+ "type": "array",
177
+ "minItems": 1,
178
+ "description": "Per-step execution results. Bridges scenario steps to record evidence.",
179
+ "items": {
180
+ "type": "object",
181
+ "required": ["step_id", "status"],
182
+ "additionalProperties": false,
183
+ "properties": {
184
+ "step_id": {
185
+ "type": "string",
186
+ "pattern": "^[a-z0-9][a-z0-9-]*$",
187
+ "description": "Must match a step.id from the scenario definition."
188
+ },
189
+ "status": {
190
+ "type": "string",
191
+ "enum": ["pass", "fail", "blocked", "skip", "partial"]
192
+ },
193
+ "notes": { "type": "string" }
194
+ }
195
+ }
196
+ },
197
+ "evidence": {
198
+ "type": "array",
199
+ "items": {
200
+ "type": "object",
201
+ "required": ["kind", "url"],
202
+ "additionalProperties": false,
203
+ "properties": {
204
+ "kind": {
205
+ "type": "string",
206
+ "enum": ["log", "screenshot", "recording", "transcript", "artifact", "other"]
207
+ },
208
+ "url": { "type": "string", "format": "uri" },
209
+ "description": { "type": "string" },
210
+ "expires_at": {
211
+ "type": "string",
212
+ "format": "date-time",
213
+ "description": "When this evidence URL will become unavailable."
214
+ }
215
+ }
216
+ }
217
+ },
218
+ "notes": { "type": "string" }
219
+ }
220
+ }
221
+ },
222
+
223
+ "overall_verdict": {
224
+ "type": "object",
225
+ "required": ["proposed", "verified"],
226
+ "additionalProperties": false,
227
+ "description": "Source proposes, verifier confirms or downgrades. Verifier never upgrades.",
228
+ "properties": {
229
+ "proposed": {
230
+ "type": "string",
231
+ "enum": ["pass", "fail", "blocked", "partial"],
232
+ "description": "Verdict as proposed by the source repo."
233
+ },
234
+ "verified": {
235
+ "type": "string",
236
+ "enum": ["pass", "fail", "blocked", "partial"],
237
+ "description": "Final verdict after central verification."
238
+ },
239
+ "downgraded": {
240
+ "type": "boolean",
241
+ "default": false,
242
+ "description": "True if verifier downgraded the proposed verdict."
243
+ },
244
+ "downgrade_reasons": {
245
+ "type": "array",
246
+ "items": { "type": "string" },
247
+ "description": "Machine-readable reasons if verifier downgraded."
248
+ }
249
+ }
250
+ },
251
+
252
+ "verification": {
253
+ "type": "object",
254
+ "required": ["status", "verified_at", "provenance_confirmed", "schema_valid", "policy_valid"],
255
+ "description": "Set by the central verifier. Never authored by source.",
256
+ "additionalProperties": false,
257
+ "properties": {
258
+ "status": {
259
+ "type": "string",
260
+ "enum": ["accepted", "rejected"],
261
+ "description": "Final verification outcome. No pending state in persisted records."
262
+ },
263
+ "verified_at": {
264
+ "type": "string",
265
+ "format": "date-time"
266
+ },
267
+ "provenance_confirmed": {
268
+ "type": "boolean",
269
+ "description": "True if GitHub API confirmed the source run exists and matches claims."
270
+ },
271
+ "schema_valid": {
272
+ "type": "boolean",
273
+ "description": "True if submission passed JSON Schema validation."
274
+ },
275
+ "policy_valid": {
276
+ "type": "boolean",
277
+ "description": "True if record satisfies all applicable policy rules."
278
+ },
279
+ "rejection_reasons": {
280
+ "type": "array",
281
+ "items": { "type": "string" },
282
+ "description": "Machine-readable reasons for rejection. Empty if accepted."
283
+ },
284
+ "provenance_remediation": {
285
+ "type": "object",
286
+ "properties": {
287
+ "status": { "type": "string", "enum": ["stub_verified"] },
288
+ "note": { "type": "string", "maxLength": 500 },
289
+ "remediated_at": { "type": "string", "format": "date-time" },
290
+ "original_provenance_confirmed": { "type": ["boolean", "null"] }
291
+ },
292
+ "required": ["status", "remediated_at"],
293
+ "additionalProperties": false
294
+ }
295
+ }
296
+ },
297
+
298
+ "notes": {
299
+ "type": "string",
300
+ "description": "Freeform summary from the source."
301
+ }
302
+ }
303
+ }