@openplanr/protocol 0.4.0 → 0.5.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,518 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://openplanr.dev/schemas/v1.11.0/design-implementation-handoff.schema.json",
4
+ "x-openplanr-contract": {
5
+ "id": "design-implementation-handoff",
6
+ "version": "1.11.0"
7
+ },
8
+ "type": "object",
9
+ "additionalProperties": false,
10
+ "properties": {
11
+ "kind": {
12
+ "const": "openplanr-design-implementation-handoff"
13
+ },
14
+ "schemaVersion": {
15
+ "const": "1.0.0"
16
+ },
17
+ "id": {
18
+ "type": "string",
19
+ "minLength": 1,
20
+ "maxLength": 160,
21
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]*$"
22
+ },
23
+ "version": {
24
+ "type": "integer",
25
+ "minimum": 1
26
+ },
27
+ "status": {
28
+ "enum": [
29
+ "draft",
30
+ "approved",
31
+ "superseded",
32
+ "revoked"
33
+ ]
34
+ },
35
+ "authority": {
36
+ "const": "prepare-plan"
37
+ },
38
+ "title": {
39
+ "type": "string",
40
+ "minLength": 1,
41
+ "maxLength": 240
42
+ },
43
+ "basis": {
44
+ "type": "object",
45
+ "additionalProperties": false,
46
+ "properties": {
47
+ "designId": {
48
+ "type": "string",
49
+ "minLength": 1,
50
+ "maxLength": 160,
51
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]*$"
52
+ },
53
+ "sourceRevision": {
54
+ "type": "string",
55
+ "pattern": "^sha256:[a-f0-9]{64}$"
56
+ },
57
+ "selectedVariant": {
58
+ "type": "string",
59
+ "minLength": 1,
60
+ "maxLength": 160,
61
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]*$"
62
+ },
63
+ "readiness": {
64
+ "type": "object",
65
+ "additionalProperties": false,
66
+ "properties": {
67
+ "status": {
68
+ "enum": [
69
+ "ready",
70
+ "attention",
71
+ "blocked",
72
+ "stale"
73
+ ]
74
+ },
75
+ "digest": {
76
+ "type": "string",
77
+ "pattern": "^sha256:[a-f0-9]{64}$"
78
+ }
79
+ },
80
+ "required": [
81
+ "status",
82
+ "digest"
83
+ ]
84
+ },
85
+ "reviewHandoff": {
86
+ "type": "object",
87
+ "additionalProperties": false,
88
+ "properties": {
89
+ "version": {
90
+ "type": "integer",
91
+ "minimum": 1
92
+ },
93
+ "contentDigest": {
94
+ "type": "string",
95
+ "pattern": "^sha256:[a-f0-9]{64}$"
96
+ }
97
+ },
98
+ "required": [
99
+ "version",
100
+ "contentDigest"
101
+ ]
102
+ }
103
+ },
104
+ "required": [
105
+ "designId",
106
+ "sourceRevision",
107
+ "selectedVariant",
108
+ "readiness",
109
+ "reviewHandoff"
110
+ ]
111
+ },
112
+ "sources": {
113
+ "type": "array",
114
+ "items": {
115
+ "type": "object",
116
+ "additionalProperties": false,
117
+ "properties": {
118
+ "id": {
119
+ "type": "string",
120
+ "minLength": 1,
121
+ "maxLength": 160,
122
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]*$"
123
+ },
124
+ "kind": {
125
+ "enum": [
126
+ "design-revision",
127
+ "selected-direction",
128
+ "design-specification",
129
+ "rendered-verification",
130
+ "review-context",
131
+ "review-feedback",
132
+ "review-metadata",
133
+ "review-handoff",
134
+ "screen",
135
+ "frame",
136
+ "component",
137
+ "state",
138
+ "flow",
139
+ "token",
140
+ "review-decision",
141
+ "element-anchor"
142
+ ]
143
+ },
144
+ "path": {
145
+ "type": "string",
146
+ "minLength": 1,
147
+ "maxLength": 4096
148
+ },
149
+ "revision": {
150
+ "type": "string",
151
+ "pattern": "^sha256:[a-f0-9]{64}$"
152
+ },
153
+ "digest": {
154
+ "type": "string",
155
+ "pattern": "^sha256:[a-f0-9]{64}$"
156
+ },
157
+ "anchor": {
158
+ "oneOf": [
159
+ {
160
+ "type": "object",
161
+ "additionalProperties": false,
162
+ "properties": {
163
+ "section": {
164
+ "type": "string",
165
+ "minLength": 1,
166
+ "maxLength": 160,
167
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]*$"
168
+ }
169
+ },
170
+ "required": [
171
+ "section"
172
+ ]
173
+ },
174
+ {
175
+ "type": "object",
176
+ "additionalProperties": false,
177
+ "properties": {
178
+ "screenId": {
179
+ "type": "string",
180
+ "minLength": 1,
181
+ "maxLength": 160,
182
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]*$"
183
+ }
184
+ },
185
+ "required": [
186
+ "screenId"
187
+ ]
188
+ },
189
+ {
190
+ "type": "object",
191
+ "additionalProperties": false,
192
+ "properties": {
193
+ "screenId": {
194
+ "type": "string",
195
+ "minLength": 1,
196
+ "maxLength": 160,
197
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]*$"
198
+ },
199
+ "elementId": {
200
+ "type": "string",
201
+ "minLength": 1,
202
+ "maxLength": 160,
203
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]*$"
204
+ }
205
+ },
206
+ "required": [
207
+ "screenId",
208
+ "elementId"
209
+ ]
210
+ },
211
+ {
212
+ "type": "object",
213
+ "additionalProperties": false,
214
+ "properties": {
215
+ "reviewId": {
216
+ "type": "string",
217
+ "minLength": 1,
218
+ "maxLength": 160,
219
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]*$"
220
+ },
221
+ "pinId": {
222
+ "type": "string",
223
+ "minLength": 1,
224
+ "maxLength": 160,
225
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]*$"
226
+ }
227
+ },
228
+ "required": [
229
+ "reviewId",
230
+ "pinId"
231
+ ]
232
+ }
233
+ ]
234
+ }
235
+ },
236
+ "required": [
237
+ "id",
238
+ "kind",
239
+ "path"
240
+ ]
241
+ },
242
+ "maxItems": 10000
243
+ },
244
+ "requirements": {
245
+ "type": "array",
246
+ "items": {
247
+ "type": "object",
248
+ "additionalProperties": false,
249
+ "properties": {
250
+ "id": {
251
+ "type": "string",
252
+ "pattern": "^REQ-[0-9]{3,}$"
253
+ },
254
+ "kind": {
255
+ "enum": [
256
+ "behavior",
257
+ "visual-state",
258
+ "responsive",
259
+ "accessibility",
260
+ "content-data-assumption",
261
+ "constraint",
262
+ "verification-intent"
263
+ ]
264
+ },
265
+ "statement": {
266
+ "type": "string",
267
+ "minLength": 1,
268
+ "maxLength": 16384
269
+ },
270
+ "sourceRefs": {
271
+ "type": "array",
272
+ "items": {
273
+ "type": "string",
274
+ "minLength": 1,
275
+ "maxLength": 160,
276
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]*$"
277
+ },
278
+ "maxItems": 256,
279
+ "minItems": 1
280
+ },
281
+ "verification": {
282
+ "type": "array",
283
+ "items": {
284
+ "type": "string",
285
+ "minLength": 1,
286
+ "maxLength": 16384
287
+ },
288
+ "maxItems": 256,
289
+ "minItems": 1
290
+ }
291
+ },
292
+ "required": [
293
+ "id",
294
+ "kind",
295
+ "statement",
296
+ "sourceRefs",
297
+ "verification"
298
+ ]
299
+ },
300
+ "maxItems": 10000,
301
+ "minItems": 1
302
+ },
303
+ "contentDigest": {
304
+ "type": "string",
305
+ "pattern": "^sha256:[a-f0-9]{64}$"
306
+ },
307
+ "markdown": {
308
+ "type": "string",
309
+ "maxLength": 2097152
310
+ },
311
+ "approval": {
312
+ "type": "object",
313
+ "additionalProperties": false,
314
+ "properties": {
315
+ "actorId": {
316
+ "type": "string",
317
+ "minLength": 1,
318
+ "maxLength": 160,
319
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]*$"
320
+ },
321
+ "approvedAt": {
322
+ "type": "string",
323
+ "format": "date-time"
324
+ },
325
+ "contentDigest": {
326
+ "type": "string",
327
+ "pattern": "^sha256:[a-f0-9]{64}$"
328
+ },
329
+ "authority": {
330
+ "const": "prepare-plan"
331
+ }
332
+ },
333
+ "required": [
334
+ "actorId",
335
+ "approvedAt",
336
+ "contentDigest",
337
+ "authority"
338
+ ]
339
+ },
340
+ "supersededBy": {
341
+ "type": "object",
342
+ "additionalProperties": false,
343
+ "properties": {
344
+ "id": {
345
+ "type": "string",
346
+ "minLength": 1,
347
+ "maxLength": 160,
348
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]*$"
349
+ },
350
+ "version": {
351
+ "type": "integer",
352
+ "minimum": 1
353
+ },
354
+ "contentDigest": {
355
+ "type": "string",
356
+ "pattern": "^sha256:[a-f0-9]{64}$"
357
+ }
358
+ },
359
+ "required": [
360
+ "id",
361
+ "version",
362
+ "contentDigest"
363
+ ]
364
+ },
365
+ "revocation": {
366
+ "type": "object",
367
+ "additionalProperties": false,
368
+ "properties": {
369
+ "actorId": {
370
+ "type": "string",
371
+ "minLength": 1,
372
+ "maxLength": 160,
373
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]*$"
374
+ },
375
+ "revokedAt": {
376
+ "type": "string",
377
+ "format": "date-time"
378
+ },
379
+ "reason": {
380
+ "type": "string",
381
+ "minLength": 1,
382
+ "maxLength": 16384
383
+ }
384
+ },
385
+ "required": [
386
+ "actorId",
387
+ "revokedAt",
388
+ "reason"
389
+ ]
390
+ }
391
+ },
392
+ "required": [
393
+ "kind",
394
+ "schemaVersion",
395
+ "id",
396
+ "version",
397
+ "status",
398
+ "authority",
399
+ "title",
400
+ "basis",
401
+ "sources",
402
+ "requirements",
403
+ "contentDigest",
404
+ "markdown"
405
+ ],
406
+ "allOf": [
407
+ {
408
+ "if": {
409
+ "properties": {
410
+ "status": {
411
+ "const": "approved"
412
+ }
413
+ },
414
+ "required": [
415
+ "status"
416
+ ]
417
+ },
418
+ "then": {
419
+ "required": [
420
+ "approval"
421
+ ],
422
+ "not": {
423
+ "anyOf": [
424
+ {
425
+ "required": [
426
+ "supersededBy"
427
+ ]
428
+ },
429
+ {
430
+ "required": [
431
+ "revocation"
432
+ ]
433
+ }
434
+ ]
435
+ }
436
+ }
437
+ },
438
+ {
439
+ "if": {
440
+ "properties": {
441
+ "status": {
442
+ "const": "superseded"
443
+ }
444
+ },
445
+ "required": [
446
+ "status"
447
+ ]
448
+ },
449
+ "then": {
450
+ "required": [
451
+ "approval",
452
+ "supersededBy"
453
+ ],
454
+ "not": {
455
+ "required": [
456
+ "revocation"
457
+ ]
458
+ }
459
+ }
460
+ },
461
+ {
462
+ "if": {
463
+ "properties": {
464
+ "status": {
465
+ "const": "revoked"
466
+ }
467
+ },
468
+ "required": [
469
+ "status"
470
+ ]
471
+ },
472
+ "then": {
473
+ "required": [
474
+ "approval",
475
+ "revocation"
476
+ ],
477
+ "not": {
478
+ "required": [
479
+ "supersededBy"
480
+ ]
481
+ }
482
+ }
483
+ },
484
+ {
485
+ "if": {
486
+ "properties": {
487
+ "status": {
488
+ "const": "draft"
489
+ }
490
+ },
491
+ "required": [
492
+ "status"
493
+ ]
494
+ },
495
+ "then": {
496
+ "not": {
497
+ "anyOf": [
498
+ {
499
+ "required": [
500
+ "approval"
501
+ ]
502
+ },
503
+ {
504
+ "required": [
505
+ "supersededBy"
506
+ ]
507
+ },
508
+ {
509
+ "required": [
510
+ "revocation"
511
+ ]
512
+ }
513
+ ]
514
+ }
515
+ }
516
+ }
517
+ ]
518
+ }
@@ -0,0 +1,106 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://openplanr.dev/schemas/v1.11.0/design-planning-lineage.schema.json",
4
+ "x-openplanr-contract": {
5
+ "id": "design-planning-lineage",
6
+ "version": "1.11.0"
7
+ },
8
+ "type": "object",
9
+ "additionalProperties": false,
10
+ "properties": {
11
+ "kind": {
12
+ "const": "openplanr-design-planning-lineage"
13
+ },
14
+ "schemaVersion": {
15
+ "const": "1.0.0"
16
+ },
17
+ "handoff": {
18
+ "type": "object",
19
+ "additionalProperties": false,
20
+ "properties": {
21
+ "id": {
22
+ "type": "string",
23
+ "minLength": 1,
24
+ "maxLength": 160,
25
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]*$"
26
+ },
27
+ "version": {
28
+ "type": "integer",
29
+ "minimum": 1
30
+ },
31
+ "contentDigest": {
32
+ "type": "string",
33
+ "pattern": "^sha256:[a-f0-9]{64}$"
34
+ }
35
+ },
36
+ "required": [
37
+ "id",
38
+ "version",
39
+ "contentDigest"
40
+ ]
41
+ },
42
+ "specId": {
43
+ "type": "string",
44
+ "pattern": "^SPEC-[0-9]{3,}$"
45
+ },
46
+ "mappings": {
47
+ "type": "array",
48
+ "items": {
49
+ "type": "object",
50
+ "additionalProperties": false,
51
+ "properties": {
52
+ "requirementId": {
53
+ "type": "string",
54
+ "pattern": "^REQ-[0-9]{3,}$"
55
+ },
56
+ "acceptanceRefs": {
57
+ "type": "array",
58
+ "items": {
59
+ "type": "object",
60
+ "additionalProperties": false,
61
+ "properties": {
62
+ "storyId": {
63
+ "type": "string",
64
+ "pattern": "^US-[0-9]{3,}$"
65
+ },
66
+ "acceptanceId": {
67
+ "type": "string",
68
+ "pattern": "^AC-[0-9]{3,}$"
69
+ }
70
+ },
71
+ "required": [
72
+ "storyId",
73
+ "acceptanceId"
74
+ ]
75
+ },
76
+ "maxItems": 256,
77
+ "minItems": 1
78
+ },
79
+ "taskIds": {
80
+ "type": "array",
81
+ "items": {
82
+ "type": "string",
83
+ "pattern": "^T-[0-9]{3,}$"
84
+ },
85
+ "maxItems": 256,
86
+ "minItems": 1
87
+ }
88
+ },
89
+ "required": [
90
+ "requirementId",
91
+ "acceptanceRefs",
92
+ "taskIds"
93
+ ]
94
+ },
95
+ "maxItems": 10000,
96
+ "minItems": 1
97
+ }
98
+ },
99
+ "required": [
100
+ "kind",
101
+ "schemaVersion",
102
+ "handoff",
103
+ "specId",
104
+ "mappings"
105
+ ]
106
+ }
@@ -2,4 +2,5 @@ export declare const PROTOCOL_V15_CONTRACTS: Readonly<Record<string, string>>;
2
2
  export declare const PROTOCOL_V16_CONTRACTS: Readonly<Record<string, string>>;
3
3
  export declare const PROTOCOL_V17_CONTRACTS: Readonly<Record<string, string>>;
4
4
  export declare const PROTOCOL_V18_CONTRACTS: Readonly<Record<string, string>>;
5
- export declare function protocolAssetUrl(kind: string, options?: { protocolVersion?: '1.5.0' | '1.6.0' | '1.7.0' | '1.8.0' }): URL;
5
+ export declare const PROTOCOL_V111_CONTRACTS: Readonly<Record<string, string>>;
6
+ export declare function protocolAssetUrl(kind: string, options?: { protocolVersion?: '1.5.0' | '1.6.0' | '1.7.0' | '1.8.0' | '1.11.0' }): URL;
@@ -3,6 +3,7 @@ import {
3
3
  PROTOCOL_V17_CONTRACT_FILES,
4
4
  PROTOCOL_V18_CONTRACT_FILES,
5
5
  } from './skill-source-contracts.mjs';
6
+ import { DESIGN_HANDOFF_CONTRACT_FILES } from './design-handoff-contracts.mjs';
6
7
 
7
8
  export const PROTOCOL_V15_CONTRACTS = Object.freeze({
8
9
  'command-catalog': 'command-catalog.schema.json',
@@ -22,12 +23,17 @@ export const PROTOCOL_V15_CONTRACTS = Object.freeze({
22
23
  export const PROTOCOL_V16_CONTRACTS = PROTOCOL_V16_CONTRACT_FILES;
23
24
  export const PROTOCOL_V17_CONTRACTS = PROTOCOL_V17_CONTRACT_FILES;
24
25
  export const PROTOCOL_V18_CONTRACTS = PROTOCOL_V18_CONTRACT_FILES;
26
+ export const PROTOCOL_V111_CONTRACTS = Object.freeze({
27
+ 'design-review-metadata-payload': 'design-review-metadata-payload.schema.json',
28
+ ...DESIGN_HANDOFF_CONTRACT_FILES,
29
+ });
25
30
 
26
31
  const PROTOCOL_CONTRACTS_BY_VERSION = Object.freeze({
27
32
  '1.5.0': PROTOCOL_V15_CONTRACTS,
28
33
  '1.6.0': PROTOCOL_V16_CONTRACTS,
29
34
  '1.7.0': PROTOCOL_V17_CONTRACTS,
30
- '1.8.0': PROTOCOL_V18_CONTRACTS
35
+ '1.8.0': PROTOCOL_V18_CONTRACTS,
36
+ '1.11.0': PROTOCOL_V111_CONTRACTS,
31
37
  });
32
38
 
33
39
  /** Resolve a packaged schema asset without a source checkout or Node-only API. */
package/src/contracts.mjs CHANGED
@@ -11,6 +11,7 @@ import {
11
11
  PROTOCOL_V17_CONTRACT_FILES,
12
12
  PROTOCOL_V18_CONTRACT_FILES,
13
13
  } from './skill-source-contracts.mjs';
14
+ import { DESIGN_HANDOFF_CONTRACT_FILES } from './design-handoff-contracts.mjs';
14
15
 
15
16
  const packageRoot = join(dirname(fileURLToPath(import.meta.url)), '..');
16
17
 
@@ -31,6 +32,7 @@ const foundationPaths = {
31
32
  'design-review-context': { '1.10.0': 'schemas/v1.10.0/design-review-context.schema.json' },
32
33
  'design-review-handoff': { '1.10.0': 'schemas/v1.10.0/design-review-handoff.schema.json' },
33
34
  'design-review-metadata-payload': { '1.10.0': 'schemas/v1.10.0/design-review-metadata-payload.schema.json', '1.11.0': 'schemas/v1.11.0/design-review-metadata-payload.schema.json' },
35
+ ...Object.fromEntries(Object.keys(DESIGN_HANDOFF_CONTRACT_FILES).map(name => [name, { '1.11.0': `schemas/v1.11.0/${DESIGN_HANDOFF_CONTRACT_FILES[name]}` }])),
34
36
 
35
37
  spec: { '1.0.0': 'schemas/v1.0.0/spec.schema.json', '1.7.0': v17Schema('spec') },
36
38
  story: { '1.0.0': 'schemas/v1.0.0/story.schema.json', '1.7.0': v17Schema('story') },