create-yss-spec 3.3.4 → 3.3.7

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 (171) hide show
  1. package/README.md +2 -2
  2. package/package.json +1 -1
  3. package/src/template/instance-runtime.js +8 -2
  4. package/src/validation/snapshot.js +7 -0
  5. package/template/.agents/skills/.strategic-design-skills-manifest.json +7 -5
  6. package/template/.agents/skills/archify/SKILL.md +1 -1
  7. package/template/.agents/skills/code-review/SKILL.md +6 -0
  8. package/template/.agents/skills/i-have-adhd/LICENSE +21 -0
  9. package/template/.agents/skills/i-have-adhd/SKILL.md +26 -0
  10. package/template/.agents/skills/i-have-adhd/agents/openai.yaml +6 -0
  11. package/template/.agents/skills/i-have-adhd/references/yss-adaptation.md +21 -0
  12. package/template/.agents/skills/i-have-adhd/tests/verify-integration.mjs +63 -0
  13. package/template/.agents/skills/prototype-review/SKILL.md +2 -0
  14. package/template/.agents/skills/yss-implementation-contract-compiler/SKILL.md +6 -0
  15. package/template/.agents/skills/yss-implementation-contract-compiler/references/boundaries.md +10 -0
  16. package/template/.agents/skills/yss-openapi-governance/SKILL.md +6 -0
  17. package/template/.agents/skills/yss-product-lifecycle/SKILL.md +3 -1
  18. package/template/.agents/skills/yss-product-lifecycle/references/orchestration-contract.yaml +12 -0
  19. package/template/.agents/skills/yss-prototype-stage/SKILL.md +6 -0
  20. package/template/.agents/skills/yss-research/SKILL.md +6 -0
  21. package/template/.agents/skills/yss-stage-decision/SKILL.md +19 -4
  22. package/template/.agents/skills/yss-stage-decision/references/domain-strategy-contract.md +4 -3
  23. package/template/.agents/skills/yss-stage-decision/references/domain-strategy-v2.schema.json +8 -0
  24. package/template/.agents/skills/yss-stage-decision/references/domain-strategy-v3.schema.json +8 -0
  25. package/template/.agents/skills/yss-stage-decision/references/domain-strategy.schema.json +75 -5
  26. package/template/.agents/skills/yss-stage-decision/references/stage-decision-package-contract.md +4 -4
  27. package/template/.agents/skills/yss-stage-decision/references/stage-decision-package-v2.schema.json +8 -0
  28. package/template/.agents/skills/yss-stage-decision/references/stage-decision-package-v3.schema.json +8 -0
  29. package/template/.agents/skills/yss-stage-decision/references/stage-decision-package.schema.json +59 -9
  30. package/template/.agents/skills/yss-stage-decision/references/validation-rules.md +2 -2
  31. package/template/.agents/skills/yss-stage-decision/scripts/migrate-contract-v3.mjs +143 -0
  32. package/template/.agents/skills/yss-stage-decision/scripts/validate-domain-strategy.mjs +46 -4
  33. package/template/.agents/skills/yss-stage-decision/scripts/validate-stage-decision-package.mjs +48 -4
  34. package/template/.agents/skills/yss-stage-decision/tests/fixtures/valid-stage-decision-package.yaml +42 -13
  35. package/template/.agents/skills/yss-stage-decision/tests/fixtures/valid-supplier-domain.yaml +37 -5
  36. package/template/.agents/skills/yss-stage-decision/tests/run-scenarios.mjs +116 -23
  37. package/template/.agents/skills/yss-technical-design/SKILL.md +6 -0
  38. package/template/.codex/skills/archify/SKILL.md +1 -1
  39. package/template/.codex/skills/code-review/SKILL.md +6 -0
  40. package/template/.codex/skills/i-have-adhd/LICENSE +21 -0
  41. package/template/.codex/skills/i-have-adhd/SKILL.md +26 -0
  42. package/template/.codex/skills/i-have-adhd/agents/openai.yaml +6 -0
  43. package/template/.codex/skills/i-have-adhd/references/yss-adaptation.md +21 -0
  44. package/template/.codex/skills/i-have-adhd/tests/verify-integration.mjs +63 -0
  45. package/template/.codex/skills/prototype-review/SKILL.md +2 -0
  46. package/template/.codex/skills/yss-implementation-contract-compiler/SKILL.md +6 -0
  47. package/template/.codex/skills/yss-implementation-contract-compiler/references/boundaries.md +10 -0
  48. package/template/.codex/skills/yss-openapi-governance/SKILL.md +6 -0
  49. package/template/.codex/skills/yss-product-lifecycle/SKILL.md +3 -1
  50. package/template/.codex/skills/yss-product-lifecycle/references/orchestration-contract.yaml +12 -0
  51. package/template/.codex/skills/yss-prototype-stage/SKILL.md +6 -0
  52. package/template/.codex/skills/yss-research/SKILL.md +6 -0
  53. package/template/.codex/skills/yss-stage-decision/SKILL.md +19 -4
  54. package/template/.codex/skills/yss-stage-decision/references/domain-strategy-contract.md +4 -3
  55. package/template/.codex/skills/yss-stage-decision/references/domain-strategy-v2.schema.json +8 -0
  56. package/template/.codex/skills/yss-stage-decision/references/domain-strategy-v3.schema.json +8 -0
  57. package/template/.codex/skills/yss-stage-decision/references/domain-strategy.schema.json +75 -5
  58. package/template/.codex/skills/yss-stage-decision/references/stage-decision-package-contract.md +4 -4
  59. package/template/.codex/skills/yss-stage-decision/references/stage-decision-package-v2.schema.json +8 -0
  60. package/template/.codex/skills/yss-stage-decision/references/stage-decision-package-v3.schema.json +8 -0
  61. package/template/.codex/skills/yss-stage-decision/references/stage-decision-package.schema.json +59 -9
  62. package/template/.codex/skills/yss-stage-decision/references/validation-rules.md +2 -2
  63. package/template/.codex/skills/yss-stage-decision/scripts/migrate-contract-v3.mjs +143 -0
  64. package/template/.codex/skills/yss-stage-decision/scripts/validate-domain-strategy.mjs +46 -4
  65. package/template/.codex/skills/yss-stage-decision/scripts/validate-stage-decision-package.mjs +48 -4
  66. package/template/.codex/skills/yss-stage-decision/tests/fixtures/valid-stage-decision-package.yaml +42 -13
  67. package/template/.codex/skills/yss-stage-decision/tests/fixtures/valid-supplier-domain.yaml +37 -5
  68. package/template/.codex/skills/yss-stage-decision/tests/run-scenarios.mjs +116 -23
  69. package/template/.codex/skills/yss-technical-design/SKILL.md +6 -0
  70. package/template/.cursor/skills/archify/SKILL.md +1 -1
  71. package/template/.cursor/skills/code-review/SKILL.md +6 -0
  72. package/template/.cursor/skills/i-have-adhd/LICENSE +21 -0
  73. package/template/.cursor/skills/i-have-adhd/SKILL.md +26 -0
  74. package/template/.cursor/skills/i-have-adhd/agents/openai.yaml +6 -0
  75. package/template/.cursor/skills/i-have-adhd/references/yss-adaptation.md +21 -0
  76. package/template/.cursor/skills/i-have-adhd/tests/verify-integration.mjs +63 -0
  77. package/template/.cursor/skills/prototype-review/SKILL.md +2 -0
  78. package/template/.cursor/skills/yss-implementation-contract-compiler/SKILL.md +6 -0
  79. package/template/.cursor/skills/yss-implementation-contract-compiler/references/boundaries.md +10 -0
  80. package/template/.cursor/skills/yss-openapi-governance/SKILL.md +6 -0
  81. package/template/.cursor/skills/yss-product-lifecycle/SKILL.md +3 -1
  82. package/template/.cursor/skills/yss-product-lifecycle/references/orchestration-contract.yaml +12 -0
  83. package/template/.cursor/skills/yss-prototype-stage/SKILL.md +6 -0
  84. package/template/.cursor/skills/yss-research/SKILL.md +6 -0
  85. package/template/.cursor/skills/yss-stage-decision/SKILL.md +19 -4
  86. package/template/.cursor/skills/yss-stage-decision/references/domain-strategy-contract.md +4 -3
  87. package/template/.cursor/skills/yss-stage-decision/references/domain-strategy-v2.schema.json +8 -0
  88. package/template/.cursor/skills/yss-stage-decision/references/domain-strategy-v3.schema.json +8 -0
  89. package/template/.cursor/skills/yss-stage-decision/references/domain-strategy.schema.json +75 -5
  90. package/template/.cursor/skills/yss-stage-decision/references/stage-decision-package-contract.md +4 -4
  91. package/template/.cursor/skills/yss-stage-decision/references/stage-decision-package-v2.schema.json +8 -0
  92. package/template/.cursor/skills/yss-stage-decision/references/stage-decision-package-v3.schema.json +8 -0
  93. package/template/.cursor/skills/yss-stage-decision/references/stage-decision-package.schema.json +59 -9
  94. package/template/.cursor/skills/yss-stage-decision/references/validation-rules.md +2 -2
  95. package/template/.cursor/skills/yss-stage-decision/scripts/migrate-contract-v3.mjs +143 -0
  96. package/template/.cursor/skills/yss-stage-decision/scripts/validate-domain-strategy.mjs +46 -4
  97. package/template/.cursor/skills/yss-stage-decision/scripts/validate-stage-decision-package.mjs +48 -4
  98. package/template/.cursor/skills/yss-stage-decision/tests/fixtures/valid-stage-decision-package.yaml +42 -13
  99. package/template/.cursor/skills/yss-stage-decision/tests/fixtures/valid-supplier-domain.yaml +37 -5
  100. package/template/.cursor/skills/yss-stage-decision/tests/run-scenarios.mjs +116 -23
  101. package/template/.cursor/skills/yss-technical-design/SKILL.md +6 -0
  102. package/template/.pi/skills/archify/SKILL.md +1 -1
  103. package/template/.pi/skills/code-review/SKILL.md +6 -0
  104. package/template/.pi/skills/i-have-adhd/LICENSE +21 -0
  105. package/template/.pi/skills/i-have-adhd/SKILL.md +26 -0
  106. package/template/.pi/skills/i-have-adhd/agents/openai.yaml +6 -0
  107. package/template/.pi/skills/i-have-adhd/references/yss-adaptation.md +21 -0
  108. package/template/.pi/skills/i-have-adhd/tests/verify-integration.mjs +63 -0
  109. package/template/.pi/skills/prototype-review/SKILL.md +2 -0
  110. package/template/.pi/skills/yss-implementation-contract-compiler/SKILL.md +6 -0
  111. package/template/.pi/skills/yss-implementation-contract-compiler/references/boundaries.md +10 -0
  112. package/template/.pi/skills/yss-openapi-governance/SKILL.md +6 -0
  113. package/template/.pi/skills/yss-product-lifecycle/SKILL.md +3 -1
  114. package/template/.pi/skills/yss-product-lifecycle/references/orchestration-contract.yaml +12 -0
  115. package/template/.pi/skills/yss-prototype-stage/SKILL.md +6 -0
  116. package/template/.pi/skills/yss-research/SKILL.md +6 -0
  117. package/template/.pi/skills/yss-stage-decision/SKILL.md +19 -4
  118. package/template/.pi/skills/yss-stage-decision/references/domain-strategy-contract.md +4 -3
  119. package/template/.pi/skills/yss-stage-decision/references/domain-strategy-v2.schema.json +8 -0
  120. package/template/.pi/skills/yss-stage-decision/references/domain-strategy-v3.schema.json +8 -0
  121. package/template/.pi/skills/yss-stage-decision/references/domain-strategy.schema.json +75 -5
  122. package/template/.pi/skills/yss-stage-decision/references/stage-decision-package-contract.md +4 -4
  123. package/template/.pi/skills/yss-stage-decision/references/stage-decision-package-v2.schema.json +8 -0
  124. package/template/.pi/skills/yss-stage-decision/references/stage-decision-package-v3.schema.json +8 -0
  125. package/template/.pi/skills/yss-stage-decision/references/stage-decision-package.schema.json +59 -9
  126. package/template/.pi/skills/yss-stage-decision/references/validation-rules.md +2 -2
  127. package/template/.pi/skills/yss-stage-decision/scripts/migrate-contract-v3.mjs +143 -0
  128. package/template/.pi/skills/yss-stage-decision/scripts/validate-domain-strategy.mjs +46 -4
  129. package/template/.pi/skills/yss-stage-decision/scripts/validate-stage-decision-package.mjs +48 -4
  130. package/template/.pi/skills/yss-stage-decision/tests/fixtures/valid-stage-decision-package.yaml +42 -13
  131. package/template/.pi/skills/yss-stage-decision/tests/fixtures/valid-supplier-domain.yaml +37 -5
  132. package/template/.pi/skills/yss-stage-decision/tests/run-scenarios.mjs +116 -23
  133. package/template/.pi/skills/yss-technical-design/SKILL.md +6 -0
  134. package/template/docs/agents/yss-skill-registry.yaml +22 -0
  135. package/template/docs/plan/templates/plan-template.md +8 -4
  136. package/template/docs/process/document-writing.md +77 -0
  137. package/template/docs/process/frontend-backend-delivery.md +7 -4
  138. package/template/docs/process/schemas/backend-delivery.schema.json +4 -0
  139. package/template/docs/process/schemas/frontend-delivery-acceptance-v1.schema.json +200 -0
  140. package/template/docs/process/schemas/frontend-delivery-acceptance.schema.json +37 -3
  141. package/template/docs/process/schemas/frontend-strategic-preflight.schema.json +32 -0
  142. package/template/docs/process/schemas/lifecycle-checkpoint.schema.json +2 -1
  143. package/template/docs/process/schemas/strategic-consumer-feedback.schema.json +40 -0
  144. package/template/docs/process/schemas/strategic-design-handoff-v3.schema.json +743 -0
  145. package/template/docs/process/schemas/strategic-design-handoff-v4.schema.json +712 -0
  146. package/template/docs/process/schemas/strategic-feedback-adjudication.schema.json +42 -0
  147. package/template/docs/process/schemas/strategic-handoff-domain-strategy-v3.schema.json +216 -0
  148. package/template/docs/process/schemas/strategic-handoff-import-receipt.schema.json +39 -0
  149. package/template/docs/process/schemas/strategic-handoff-stage-decision-package-v3.schema.json +148 -0
  150. package/template/docs/process/strategic-handoff-package.md +37 -4
  151. package/template/docs/process/templates/lifecycle-checkpoint-template.yaml +1 -0
  152. package/template/docs/process/templates/stage-checkpoint-template.md +1 -0
  153. package/template/docs/templates/examples/lifecycle-writing-examples.md +138 -0
  154. package/template/docs/templates/spec-template.md +16 -3
  155. package/template/docs/templates/vertical-slice-ticket-template.md +8 -4
  156. package/template/scripts/lib/approval-record.mjs +2 -1
  157. package/template/scripts/lib/backend-delivery.mjs +15 -3
  158. package/template/scripts/lib/frontend-delivery-boundary.mjs +20 -4
  159. package/template/scripts/lib/frontend-delivery.mjs +66 -2
  160. package/template/scripts/lib/profile-skill-sync.mjs +336 -0
  161. package/template/scripts/lib/strategic-feedback.mjs +33 -0
  162. package/template/scripts/lib/strategic-handoff-consumption.mjs +5 -0
  163. package/template/scripts/lib/strategic-handoff-io.mjs +1 -0
  164. package/template/scripts/lib/strategic-handoff.mjs +101 -10
  165. package/template/scripts/lib/user-decision-reuse.mjs +38 -0
  166. package/template/scripts/strategic-feedback +10 -0
  167. package/template/scripts/sync-profile-skills +43 -0
  168. package/template/scripts/verify-frontend-strategic-preflight +12 -0
  169. package/template/skills-lock.json +38 -20
  170. package/template.manifest.json +1 -0
  171. package/template.snapshot.json +6 -5
@@ -0,0 +1,712 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://yss.local/schemas/strategic-design-handoff-v4.json",
4
+ "title": "YSS 业务方案交接包",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": [
8
+ "schema_version",
9
+ "handoff_id",
10
+ "handoff_version",
11
+ "status",
12
+ "source",
13
+ "source_context_snapshot",
14
+ "context_delta",
15
+ "consumer_routes",
16
+ "problem_and_business_outcomes",
17
+ "bounded_context_and_subdomain_map",
18
+ "context_map_and_translation_responsibility",
19
+ "ubiquitous_language_and_concept_candidates",
20
+ "scenarios_and_business_invariants",
21
+ "tactical_design_questions",
22
+ "deferred_decisions_and_ownership",
23
+ "evidence_and_version_digests",
24
+ "acceptance"
25
+ ],
26
+ "properties": {
27
+ "schema_version": {
28
+ "const": 4
29
+ },
30
+ "handoff_id": {
31
+ "type": "string",
32
+ "pattern": "^strategic-design-handoff\\.[a-z0-9][a-z0-9-]*$"
33
+ },
34
+ "handoff_version": {
35
+ "type": "string",
36
+ "pattern": "^v[0-9]+$"
37
+ },
38
+ "status": {
39
+ "enum": [
40
+ "draft",
41
+ "ready-for-human",
42
+ "approved",
43
+ "stale",
44
+ "blocked"
45
+ ]
46
+ },
47
+ "source": {
48
+ "type": "object",
49
+ "additionalProperties": false,
50
+ "required": [
51
+ "domain_strategy_ref",
52
+ "stage_decision_package_ref",
53
+ "spec_ref",
54
+ "prototype_ref",
55
+ "visual_baseline_ref",
56
+ "business_ticket_set_ref"
57
+ ],
58
+ "properties": {
59
+ "domain_strategy_ref": {
60
+ "$ref": "#/$defs/versionedRef"
61
+ },
62
+ "stage_decision_package_ref": {
63
+ "$ref": "#/$defs/versionedRef"
64
+ },
65
+ "spec_ref": {
66
+ "$ref": "#/$defs/versionedRef"
67
+ },
68
+ "prototype_ref": {
69
+ "$ref": "#/$defs/versionedRef"
70
+ },
71
+ "visual_baseline_ref": {
72
+ "$ref": "#/$defs/visualBaselineRef"
73
+ },
74
+ "business_ticket_set_ref": {
75
+ "$ref": "#/$defs/versionedRef"
76
+ }
77
+ }
78
+ },
79
+ "source_context_snapshot": {
80
+ "$ref": "#/$defs/contextSnapshot"
81
+ },
82
+ "context_delta": {
83
+ "type": "object",
84
+ "additionalProperties": false,
85
+ "required": [
86
+ "added",
87
+ "updated",
88
+ "deprecated"
89
+ ],
90
+ "properties": {
91
+ "added": {
92
+ "$ref": "#/$defs/contextTerms"
93
+ },
94
+ "updated": {
95
+ "$ref": "#/$defs/contextTerms"
96
+ },
97
+ "deprecated": {
98
+ "$ref": "#/$defs/contextTerms"
99
+ }
100
+ }
101
+ },
102
+ "consumer_routes": {
103
+ "type": "array",
104
+ "minItems": 3,
105
+ "maxItems": 3,
106
+ "items": {
107
+ "$ref": "#/$defs/consumerRoute"
108
+ }
109
+ },
110
+ "problem_and_business_outcomes": {
111
+ "$ref": "#/$defs/nonEmptyStrings"
112
+ },
113
+ "bounded_context_and_subdomain_map": {
114
+ "$ref": "#/$defs/nonEmptyStrings"
115
+ },
116
+ "context_map_and_translation_responsibility": {
117
+ "$ref": "#/$defs/nonEmptyStrings"
118
+ },
119
+ "ubiquitous_language_and_concept_candidates": {
120
+ "$ref": "#/$defs/nonEmptyStrings"
121
+ },
122
+ "scenarios_and_business_invariants": {
123
+ "$ref": "#/$defs/nonEmptyStrings"
124
+ },
125
+ "tactical_design_questions": {
126
+ "$ref": "#/$defs/nonEmptyStrings"
127
+ },
128
+ "deferred_decisions_and_ownership": {
129
+ "type": "array",
130
+ "items": {
131
+ "$ref": "#/$defs/deferred"
132
+ }
133
+ },
134
+ "evidence_and_version_digests": {
135
+ "$ref": "#/$defs/nonEmptyStrings"
136
+ },
137
+ "acceptance": {
138
+ "$ref": "#/$defs/nonEmptyStrings"
139
+ },
140
+ "package_export": {
141
+ "type": "object",
142
+ "additionalProperties": false,
143
+ "required": [
144
+ "schema_version",
145
+ "approvals",
146
+ "additional_files",
147
+ "reference_map",
148
+ "prototype"
149
+ ],
150
+ "properties": {
151
+ "schema_version": {
152
+ "const": 1
153
+ },
154
+ "approvals": {
155
+ "type": "object",
156
+ "additionalProperties": false,
157
+ "required": [
158
+ "domain_strategy_ref",
159
+ "stage_decision_package_ref",
160
+ "spec_ref",
161
+ "prototype_ref",
162
+ "visual_baseline_ref",
163
+ "business_ticket_set_ref",
164
+ "handoff"
165
+ ],
166
+ "properties": {
167
+ "domain_strategy_ref": {
168
+ "type": "object",
169
+ "additionalProperties": false,
170
+ "required": [
171
+ "record_ref",
172
+ "gate_id",
173
+ "digest_kind"
174
+ ],
175
+ "properties": {
176
+ "record_ref": {
177
+ "type": "string",
178
+ "minLength": 1
179
+ },
180
+ "gate_id": {
181
+ "type": "string",
182
+ "minLength": 1
183
+ },
184
+ "digest_kind": {
185
+ "enum": [
186
+ "canonical-json",
187
+ "sha256-bytes",
188
+ "visual-baseline"
189
+ ]
190
+ }
191
+ }
192
+ },
193
+ "stage_decision_package_ref": {
194
+ "type": "object",
195
+ "additionalProperties": false,
196
+ "required": [
197
+ "record_ref",
198
+ "gate_id",
199
+ "digest_kind"
200
+ ],
201
+ "properties": {
202
+ "record_ref": {
203
+ "type": "string",
204
+ "minLength": 1
205
+ },
206
+ "gate_id": {
207
+ "type": "string",
208
+ "minLength": 1
209
+ },
210
+ "digest_kind": {
211
+ "enum": [
212
+ "canonical-json",
213
+ "sha256-bytes",
214
+ "visual-baseline"
215
+ ]
216
+ }
217
+ }
218
+ },
219
+ "spec_ref": {
220
+ "type": "object",
221
+ "additionalProperties": false,
222
+ "required": [
223
+ "record_ref",
224
+ "gate_id",
225
+ "digest_kind"
226
+ ],
227
+ "properties": {
228
+ "record_ref": {
229
+ "type": "string",
230
+ "minLength": 1
231
+ },
232
+ "gate_id": {
233
+ "type": "string",
234
+ "minLength": 1
235
+ },
236
+ "digest_kind": {
237
+ "enum": [
238
+ "canonical-json",
239
+ "sha256-bytes",
240
+ "visual-baseline"
241
+ ]
242
+ }
243
+ }
244
+ },
245
+ "prototype_ref": {
246
+ "type": "object",
247
+ "additionalProperties": false,
248
+ "required": [
249
+ "record_ref",
250
+ "gate_id",
251
+ "digest_kind"
252
+ ],
253
+ "properties": {
254
+ "record_ref": {
255
+ "type": "string",
256
+ "minLength": 1
257
+ },
258
+ "gate_id": {
259
+ "type": "string",
260
+ "minLength": 1
261
+ },
262
+ "digest_kind": {
263
+ "enum": [
264
+ "canonical-json",
265
+ "sha256-bytes",
266
+ "visual-baseline"
267
+ ]
268
+ }
269
+ }
270
+ },
271
+ "visual_baseline_ref": {
272
+ "type": "object",
273
+ "additionalProperties": false,
274
+ "required": [
275
+ "record_ref",
276
+ "gate_id",
277
+ "digest_kind"
278
+ ],
279
+ "properties": {
280
+ "record_ref": {
281
+ "type": "string",
282
+ "minLength": 1
283
+ },
284
+ "gate_id": {
285
+ "type": "string",
286
+ "minLength": 1
287
+ },
288
+ "digest_kind": {
289
+ "enum": [
290
+ "canonical-json",
291
+ "sha256-bytes",
292
+ "visual-baseline"
293
+ ]
294
+ }
295
+ }
296
+ },
297
+ "business_ticket_set_ref": {
298
+ "type": "object",
299
+ "additionalProperties": false,
300
+ "required": [
301
+ "record_ref",
302
+ "gate_id",
303
+ "digest_kind"
304
+ ],
305
+ "properties": {
306
+ "record_ref": {
307
+ "type": "string",
308
+ "minLength": 1
309
+ },
310
+ "gate_id": {
311
+ "type": "string",
312
+ "minLength": 1
313
+ },
314
+ "digest_kind": {
315
+ "enum": [
316
+ "canonical-json",
317
+ "sha256-bytes",
318
+ "visual-baseline"
319
+ ]
320
+ }
321
+ }
322
+ },
323
+ "handoff": {
324
+ "type": "object",
325
+ "additionalProperties": false,
326
+ "required": [
327
+ "record_ref",
328
+ "gate_id",
329
+ "digest_kind"
330
+ ],
331
+ "properties": {
332
+ "record_ref": {
333
+ "type": "string",
334
+ "minLength": 1
335
+ },
336
+ "gate_id": {
337
+ "type": "string",
338
+ "minLength": 1
339
+ },
340
+ "digest_kind": {
341
+ "enum": [
342
+ "canonical-json",
343
+ "sha256-bytes",
344
+ "visual-baseline"
345
+ ]
346
+ }
347
+ }
348
+ }
349
+ }
350
+ },
351
+ "additional_files": {
352
+ "type": "array",
353
+ "items": {
354
+ "type": "string",
355
+ "minLength": 1
356
+ },
357
+ "minItems": 0
358
+ },
359
+ "reference_map": {
360
+ "type": "object",
361
+ "additionalProperties": {
362
+ "type": "string",
363
+ "minLength": 1
364
+ }
365
+ },
366
+ "prototype": {
367
+ "type": "object",
368
+ "additionalProperties": false,
369
+ "required": [
370
+ "profile",
371
+ "preview_root",
372
+ "entry_ref",
373
+ "verification_ref",
374
+ "verification_digest"
375
+ ],
376
+ "properties": {
377
+ "profile": {
378
+ "enum": [
379
+ "H1",
380
+ "H2"
381
+ ]
382
+ },
383
+ "preview_root": {
384
+ "type": "string",
385
+ "minLength": 1
386
+ },
387
+ "entry_ref": {
388
+ "type": "string",
389
+ "minLength": 1
390
+ },
391
+ "verification_ref": {
392
+ "type": "string",
393
+ "minLength": 1
394
+ },
395
+ "source_root": {
396
+ "type": "string",
397
+ "minLength": 1
398
+ },
399
+ "lock_ref": {
400
+ "type": "string",
401
+ "minLength": 1
402
+ },
403
+ "verification_digest": {
404
+ "type": "string",
405
+ "pattern": "^sha256:[a-f0-9]{64}$"
406
+ },
407
+ "source_digest": {
408
+ "type": "string",
409
+ "pattern": "^sha256:[a-f0-9]{64}$"
410
+ }
411
+ },
412
+ "allOf": [
413
+ {
414
+ "if": {
415
+ "properties": {
416
+ "profile": {
417
+ "const": "H2"
418
+ }
419
+ }
420
+ },
421
+ "then": {
422
+ "required": [
423
+ "source_root",
424
+ "lock_ref",
425
+ "source_digest"
426
+ ]
427
+ }
428
+ }
429
+ ]
430
+ }
431
+ }
432
+ }
433
+ },
434
+ "$defs": {
435
+ "termRefs": {
436
+ "type": "array",
437
+ "uniqueItems": true,
438
+ "items": {
439
+ "type": "string",
440
+ "pattern": "^(Global|[A-Z][A-Za-z0-9]+)/[A-Z][A-Za-z0-9]+$"
441
+ }
442
+ },
443
+ "contextTerms": {
444
+ "type": "array",
445
+ "items": {
446
+ "type": "object",
447
+ "additionalProperties": false,
448
+ "required": [
449
+ "term_ref",
450
+ "term",
451
+ "meaning",
452
+ "english_identifier",
453
+ "context_id",
454
+ "forbidden_aliases"
455
+ ],
456
+ "properties": {
457
+ "term_ref": {
458
+ "type": "string",
459
+ "pattern": "^(Global|[A-Z][A-Za-z0-9]+)/[A-Z][A-Za-z0-9]+$"
460
+ },
461
+ "term": {
462
+ "type": "string",
463
+ "minLength": 1
464
+ },
465
+ "meaning": {
466
+ "type": "string",
467
+ "minLength": 1
468
+ },
469
+ "english_identifier": {
470
+ "type": "string",
471
+ "pattern": "^[A-Z][A-Za-z0-9]+$"
472
+ },
473
+ "context_id": {
474
+ "type": "string",
475
+ "pattern": "^(Global|[A-Z][A-Za-z0-9]+)$"
476
+ },
477
+ "forbidden_aliases": {
478
+ "type": "array",
479
+ "uniqueItems": true,
480
+ "items": {
481
+ "type": "string",
482
+ "minLength": 1
483
+ }
484
+ }
485
+ }
486
+ }
487
+ },
488
+ "contextSnapshot": {
489
+ "type": "object",
490
+ "additionalProperties": false,
491
+ "required": [
492
+ "context_ref",
493
+ "context_schema_version",
494
+ "document_digest",
495
+ "referenced_terms_digest",
496
+ "term_refs"
497
+ ],
498
+ "properties": {
499
+ "context_ref": {
500
+ "const": "CONTEXT.md"
501
+ },
502
+ "context_schema_version": {
503
+ "const": 1
504
+ },
505
+ "document_digest": {
506
+ "type": "string",
507
+ "pattern": "^sha256:[a-f0-9]{64}$"
508
+ },
509
+ "referenced_terms_digest": {
510
+ "type": "string",
511
+ "pattern": "^sha256:[a-f0-9]{64}$"
512
+ },
513
+ "term_refs": {
514
+ "$ref": "#/$defs/termRefs"
515
+ }
516
+ }
517
+ },
518
+ "nonEmptyStrings": {
519
+ "type": "array",
520
+ "minItems": 1,
521
+ "items": {
522
+ "type": "string",
523
+ "minLength": 1
524
+ }
525
+ },
526
+ "versionedRef": {
527
+ "type": "object",
528
+ "additionalProperties": false,
529
+ "required": [
530
+ "id",
531
+ "version",
532
+ "digest",
533
+ "status",
534
+ "persisted_ref"
535
+ ],
536
+ "properties": {
537
+ "id": {
538
+ "type": "string",
539
+ "minLength": 1
540
+ },
541
+ "version": {
542
+ "type": "string",
543
+ "pattern": "^v[0-9]+$"
544
+ },
545
+ "digest": {
546
+ "type": "string",
547
+ "minLength": 1
548
+ },
549
+ "status": {
550
+ "const": "approved"
551
+ },
552
+ "persisted_ref": {
553
+ "type": "string",
554
+ "minLength": 1
555
+ }
556
+ }
557
+ },
558
+ "visualBaselineRef": {
559
+ "type": "object",
560
+ "additionalProperties": false,
561
+ "required": [
562
+ "baseline_id",
563
+ "version",
564
+ "digest",
565
+ "status",
566
+ "persisted_ref",
567
+ "manifest_ref",
568
+ "case_ids"
569
+ ],
570
+ "properties": {
571
+ "baseline_id": {
572
+ "type": "string",
573
+ "pattern": "^visual-baseline\\.[a-z0-9][a-z0-9-]*$"
574
+ },
575
+ "version": {
576
+ "type": "string",
577
+ "pattern": "^v[1-9][0-9]*$"
578
+ },
579
+ "digest": {
580
+ "type": "string",
581
+ "pattern": "^sha256:[a-f0-9]{64}$"
582
+ },
583
+ "status": {
584
+ "const": "approved"
585
+ },
586
+ "persisted_ref": {
587
+ "type": "string",
588
+ "minLength": 1
589
+ },
590
+ "manifest_ref": {
591
+ "const": "visual-baseline.yaml"
592
+ },
593
+ "case_ids": {
594
+ "type": "array",
595
+ "minItems": 2,
596
+ "uniqueItems": true,
597
+ "items": {
598
+ "type": "string",
599
+ "pattern": "^[a-z0-9][a-z0-9-]*$"
600
+ }
601
+ }
602
+ }
603
+ },
604
+ "consumerRoute": {
605
+ "type": "object",
606
+ "additionalProperties": false,
607
+ "required": [
608
+ "route_id",
609
+ "capability",
610
+ "activation",
611
+ "impact_refs",
612
+ "entry_work_unit",
613
+ "expected_outputs",
614
+ "dependencies",
615
+ "context_reconciliation"
616
+ ],
617
+ "properties": {
618
+ "route_id": {
619
+ "type": "string",
620
+ "pattern": "^route\\.[a-z0-9][a-z0-9-]*$"
621
+ },
622
+ "capability": {
623
+ "enum": [
624
+ "backend-technical-design",
625
+ "frontend-engineering-design",
626
+ "delivery-coordination"
627
+ ]
628
+ },
629
+ "activation": {
630
+ "enum": [
631
+ "required",
632
+ "optional",
633
+ "not-applicable"
634
+ ]
635
+ },
636
+ "impact_refs": {
637
+ "type": "array",
638
+ "minItems": 1,
639
+ "uniqueItems": true,
640
+ "items": {
641
+ "type": "string",
642
+ "pattern": "^impact_assessment\\.(ui|api|data|backend|frontend|cross_repo|high_risk)$"
643
+ }
644
+ },
645
+ "entry_work_unit": {
646
+ "enum": [
647
+ "work-unit.technical-design",
648
+ "work-unit.frontend-engineering-design",
649
+ "work-unit.delivery-coordination"
650
+ ]
651
+ },
652
+ "expected_outputs": {
653
+ "$ref": "#/$defs/nonEmptyStrings"
654
+ },
655
+ "dependencies": {
656
+ "type": "array",
657
+ "uniqueItems": true,
658
+ "items": {
659
+ "type": "string",
660
+ "pattern": "^route\\.[a-z0-9][a-z0-9-]*$"
661
+ }
662
+ },
663
+ "context_reconciliation": {
664
+ "type": "object",
665
+ "additionalProperties": false,
666
+ "required": ["required", "target_context_ref", "schema_ref"],
667
+ "properties": {
668
+ "required": {"const": true},
669
+ "target_context_ref": {"const": "CONTEXT.md"},
670
+ "schema_ref": {"const": "docs/process/schemas/context-reconciliation.schema.json"}
671
+ }
672
+ },
673
+ "reason": {"type": "string", "minLength": 1},
674
+ "evidence_refs": {"$ref": "#/$defs/nonEmptyStrings"}
675
+ },
676
+ "allOf": [
677
+ {
678
+ "if": {"properties": {"activation": {"enum": ["optional", "not-applicable"]}}, "required": ["activation"]},
679
+ "then": {"required": ["reason", "evidence_refs"]}
680
+ }
681
+ ]
682
+ },
683
+ "deferred": {
684
+ "type": "object",
685
+ "additionalProperties": false,
686
+ "required": [
687
+ "decision",
688
+ "owner",
689
+ "next_action",
690
+ "target_version"
691
+ ],
692
+ "properties": {
693
+ "decision": {
694
+ "type": "string",
695
+ "minLength": 1
696
+ },
697
+ "owner": {
698
+ "type": "string",
699
+ "minLength": 1
700
+ },
701
+ "next_action": {
702
+ "type": "string",
703
+ "minLength": 1
704
+ },
705
+ "target_version": {
706
+ "type": "string",
707
+ "minLength": 1
708
+ }
709
+ }
710
+ }
711
+ }
712
+ }