-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathspec-schema.json
More file actions
316 lines (316 loc) · 10.3 KB
/
spec-schema.json
File metadata and controls
316 lines (316 loc) · 10.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "SpecOps Spec Metadata",
"description": "Per-spec metadata file (spec.json) tracking lifecycle status, authorship, and review state",
"type": "object",
"properties": {
"id": {
"type": "string",
"maxLength": 100,
"pattern": "^(?!\\.{1,2}$)[a-zA-Z0-9._-]+$",
"description": "Spec identifier matching the directory name"
},
"type": {
"type": "string",
"enum": ["feature", "bugfix", "refactor"],
"description": "Type of specification"
},
"status": {
"type": "string",
"enum": ["draft", "in-review", "approved", "self-approved", "implementing", "completed"],
"description": "Current lifecycle status"
},
"version": {
"type": "integer",
"minimum": 1,
"description": "Spec version, incremented on each revision round"
},
"created": {
"type": "string",
"maxLength": 30,
"pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(Z|[+-]\\d{2}:\\d{2})$",
"description": "ISO 8601 timestamp when the spec was first created"
},
"updated": {
"type": "string",
"maxLength": 30,
"pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(Z|[+-]\\d{2}:\\d{2})$",
"description": "ISO 8601 timestamp when spec.json was last modified"
},
"author": {
"type": "object",
"description": "Engineer who created the spec (populated from git config)",
"properties": {
"name": {
"type": "string",
"maxLength": 100
}
},
"required": ["name"],
"additionalProperties": false
},
"reviewers": {
"type": "array",
"maxItems": 20,
"description": "List of reviewers and their review status",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string",
"maxLength": 100
},
"status": {
"type": "string",
"enum": ["pending", "approved", "changes-requested"]
},
"reviewedAt": {
"type": "string",
"maxLength": 30,
"pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(Z|[+-]\\d{2}:\\d{2})$",
"description": "ISO 8601 timestamp of the review"
},
"round": {
"type": "integer",
"minimum": 1,
"description": "Which review round this entry belongs to"
},
"selfApproval": {
"type": "boolean",
"description": "True when the reviewer is also the spec author (self-review)"
}
},
"required": ["name", "status"],
"additionalProperties": false
}
},
"specopsCreatedWith": {
"type": "string",
"maxLength": 20,
"pattern": "^[0-9]+\\.[0-9]+\\.[0-9]+$",
"description": "SpecOps version that created this spec. Set once at creation, never updated."
},
"specopsUpdatedWith": {
"type": "string",
"maxLength": 20,
"pattern": "^[0-9]+\\.[0-9]+\\.[0-9]+$",
"description": "SpecOps version that last modified this spec. Updated on every spec.json write."
},
"reviewRounds": {
"type": "integer",
"minimum": 0,
"description": "Current review iteration count"
},
"approvals": {
"type": "integer",
"minimum": 0,
"description": "Count of current-round approvals"
},
"requiredApprovals": {
"type": "integer",
"minimum": 0,
"description": "Number of approvals needed. Set to 0 when review is disabled, otherwise copied from config at creation time."
},
"metrics": {
"type": "object",
"description": "Proxy productivity metrics captured at spec completion (Phase 4)",
"properties": {
"specArtifactTokensEstimate": {
"type": "integer",
"minimum": 0,
"description": "Estimated tokens of spec artifacts (total chars / 4)"
},
"filesChanged": {
"type": "integer",
"minimum": 0,
"description": "Number of files changed during implementation"
},
"linesAdded": {
"type": "integer",
"minimum": 0,
"description": "Lines added during implementation"
},
"linesRemoved": {
"type": "integer",
"minimum": 0,
"description": "Lines removed during implementation"
},
"tasksCompleted": {
"type": "integer",
"minimum": 0,
"description": "Count of tasks with Completed status"
},
"acceptanceCriteriaVerified": {
"type": "integer",
"minimum": 0,
"description": "Count of checked acceptance criteria checkboxes"
},
"specDurationMinutes": {
"type": "integer",
"minimum": 0,
"description": "Elapsed minutes from spec creation to completion"
}
},
"additionalProperties": false
},
"evaluation": {
"type": "object",
"description": "Adversarial evaluation results from spec evaluation (Phase 2 exit gate) and implementation evaluation (Phase 4A)",
"properties": {
"spec": {
"type": "object",
"description": "Spec quality evaluation results",
"properties": {
"iterations": {
"type": "integer",
"minimum": 0,
"description": "Number of spec evaluation iterations completed"
},
"passed": {
"type": "boolean",
"description": "Whether the final spec evaluation passed all dimension thresholds"
},
"scores": {
"type": "object",
"description": "Final scores per dimension (dimension name to integer 1-10)",
"patternProperties": {
"^[a-zA-Z][a-zA-Z ]*$": {
"type": "integer",
"minimum": 1,
"maximum": 10
}
},
"additionalProperties": false
},
"evaluatedAt": {
"type": "string",
"maxLength": 30,
"pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(Z|[+-]\\d{2}:\\d{2})$"
}
},
"additionalProperties": false
},
"implementation": {
"type": "object",
"description": "Implementation quality evaluation results",
"properties": {
"iterations": {
"type": "integer",
"minimum": 0,
"description": "Number of implementation evaluation iterations completed"
},
"passed": {
"type": "boolean",
"description": "Whether the final implementation evaluation passed all dimension thresholds"
},
"scores": {
"type": "object",
"description": "Final scores per dimension (dimension name to integer 1-10)",
"patternProperties": {
"^[a-zA-Z][a-zA-Z ]*$": {
"type": "integer",
"minimum": 1,
"maximum": 10
}
},
"additionalProperties": false
},
"evaluatedAt": {
"type": "string",
"maxLength": 30,
"pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(Z|[+-]\\d{2}:\\d{2})$"
}
},
"additionalProperties": false
}
},
"additionalProperties": false
},
"partOf": {
"type": "string",
"maxLength": 100,
"pattern": "^(?!\\.{1,2}$)[a-zA-Z0-9._-]+$",
"description": "Initiative ID this spec belongs to"
},
"relatedSpecs": {
"type": "array",
"maxItems": 20,
"uniqueItems": true,
"description": "Informational cross-references to related specs",
"items": {
"type": "string",
"maxLength": 100,
"pattern": "^(?!\\.{1,2}$)[a-zA-Z0-9._-]+$"
}
},
"productionLearnings": {
"type": "array",
"maxItems": 50,
"description": "Production learnings discovered post-deployment linked to this spec",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"maxLength": 100,
"pattern": "^L-[a-zA-Z0-9._-]+-[0-9]+$",
"description": "Learning ID (references learnings.json)"
},
"category": {
"type": "string",
"enum": ["performance", "scaling", "security", "reliability", "ux", "design", "other"],
"description": "Category of learning"
},
"severity": {
"type": "string",
"enum": ["critical", "high", "medium", "low"],
"description": "Severity level"
},
"status": {
"type": "string",
"enum": ["discovered", "investigating", "resolved", "deferred"],
"description": "Current resolution status"
}
},
"required": ["id", "category"],
"additionalProperties": false
}
},
"specDependencies": {
"type": "array",
"maxItems": 50,
"description": "Explicit dependencies on other specs with enforcement",
"items": {
"type": "object",
"properties": {
"specId": {
"type": "string",
"maxLength": 100,
"pattern": "^(?!\\.{1,2}$)[a-zA-Z0-9._-]+$",
"description": "ID of the dependency spec"
},
"reason": {
"type": "string",
"minLength": 1,
"maxLength": 500,
"description": "Why this spec depends on the other"
},
"required": {
"type": "boolean",
"description": "If true, Phase 3 is blocked until the dependency is completed"
},
"contractRef": {
"type": "string",
"maxLength": 200,
"pattern": "^(?!/)(?!.*\\.\\.)(?!.*//)[a-zA-Z0-9._/-]+$",
"description": "Relative path to an interface contract or shared artifact (no absolute paths or .. segments)"
}
},
"required": ["specId", "reason"],
"additionalProperties": false
}
}
},
"required": ["id", "type", "status", "version", "created", "updated", "author"],
"additionalProperties": false
}