create-yss-spec 3.3.7 → 3.3.8

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 (131) hide show
  1. package/README.md +12 -13
  2. package/package.json +1 -1
  3. package/template/.agents/skills/.strategic-design-skills-manifest.json +2 -2
  4. package/template/.agents/skills/implementation-repo-onboarding/SKILL.md +2 -2
  5. package/template/.agents/skills/yss-application/SKILL.md +1 -1
  6. package/template/.agents/skills/yss-application/references/profiles/existing-domain-driven-maven.md +5 -0
  7. package/template/.agents/skills/yss-application/references/profiles/existing-layered-mvc-maven.md +5 -0
  8. package/template/.agents/skills/yss-implementation-contract-compiler/SKILL.md +2 -2
  9. package/template/.agents/skills/yss-implementation-contract-compiler/references/compiler-contract.yaml +4 -0
  10. package/template/.agents/skills/yss-product-lifecycle/references/orchestration-contract.yaml +6 -1
  11. package/template/.agents/skills/yss-prototype-stage/SKILL.md +10 -1
  12. package/template/.agents/skills/yss-technical-design/SKILL.md +2 -0
  13. package/template/.agents/skills/yss-technical-design/references/engineering-design.schema.json +224 -0
  14. package/template/.agents/skills/yss-technical-design/references/technical-design-common.schema.json +6 -0
  15. package/template/.agents/skills/yss-technical-design/references/technical-design.schema.json +288 -10
  16. package/template/.agents/skills/yss-technical-design/scripts/engineering-design.mjs +30 -0
  17. package/template/.agents/skills/yss-technical-design/scripts/generate-schema.mjs +2 -1
  18. package/template/.agents/skills/yss-technical-design/scripts/validate-technical-design.mjs +20 -8
  19. package/template/.agents/skills/yss-technical-design/tests/engineering-scenarios.mjs +12 -0
  20. package/template/.agents/skills/yss-web-controller/SKILL.md +1 -1
  21. package/template/.agents/skills/yss-web-controller/references/profiles/existing-domain-driven-maven.md +5 -0
  22. package/template/.agents/skills/yss-web-controller/references/profiles/existing-layered-mvc-maven.md +5 -0
  23. package/template/.codex/skills/implementation-repo-onboarding/SKILL.md +2 -2
  24. package/template/.codex/skills/yss-application/SKILL.md +1 -1
  25. package/template/.codex/skills/yss-application/references/profiles/existing-domain-driven-maven.md +5 -0
  26. package/template/.codex/skills/yss-application/references/profiles/existing-layered-mvc-maven.md +5 -0
  27. package/template/.codex/skills/yss-implementation-contract-compiler/SKILL.md +2 -2
  28. package/template/.codex/skills/yss-implementation-contract-compiler/references/compiler-contract.yaml +4 -0
  29. package/template/.codex/skills/yss-product-lifecycle/references/orchestration-contract.yaml +6 -1
  30. package/template/.codex/skills/yss-prototype-stage/SKILL.md +10 -1
  31. package/template/.codex/skills/yss-technical-design/SKILL.md +2 -0
  32. package/template/.codex/skills/yss-technical-design/references/engineering-design.schema.json +224 -0
  33. package/template/.codex/skills/yss-technical-design/references/technical-design-common.schema.json +6 -0
  34. package/template/.codex/skills/yss-technical-design/references/technical-design.schema.json +288 -10
  35. package/template/.codex/skills/yss-technical-design/scripts/engineering-design.mjs +30 -0
  36. package/template/.codex/skills/yss-technical-design/scripts/generate-schema.mjs +2 -1
  37. package/template/.codex/skills/yss-technical-design/scripts/validate-technical-design.mjs +20 -8
  38. package/template/.codex/skills/yss-technical-design/tests/engineering-scenarios.mjs +12 -0
  39. package/template/.codex/skills/yss-web-controller/SKILL.md +1 -1
  40. package/template/.codex/skills/yss-web-controller/references/profiles/existing-domain-driven-maven.md +5 -0
  41. package/template/.codex/skills/yss-web-controller/references/profiles/existing-layered-mvc-maven.md +5 -0
  42. package/template/.cursor/skills/implementation-repo-onboarding/SKILL.md +2 -2
  43. package/template/.cursor/skills/yss-application/SKILL.md +1 -1
  44. package/template/.cursor/skills/yss-application/references/profiles/existing-domain-driven-maven.md +5 -0
  45. package/template/.cursor/skills/yss-application/references/profiles/existing-layered-mvc-maven.md +5 -0
  46. package/template/.cursor/skills/yss-implementation-contract-compiler/SKILL.md +2 -2
  47. package/template/.cursor/skills/yss-implementation-contract-compiler/references/compiler-contract.yaml +4 -0
  48. package/template/.cursor/skills/yss-product-lifecycle/references/orchestration-contract.yaml +6 -1
  49. package/template/.cursor/skills/yss-prototype-stage/SKILL.md +10 -1
  50. package/template/.cursor/skills/yss-technical-design/SKILL.md +2 -0
  51. package/template/.cursor/skills/yss-technical-design/references/engineering-design.schema.json +224 -0
  52. package/template/.cursor/skills/yss-technical-design/references/technical-design-common.schema.json +6 -0
  53. package/template/.cursor/skills/yss-technical-design/references/technical-design.schema.json +288 -10
  54. package/template/.cursor/skills/yss-technical-design/scripts/engineering-design.mjs +30 -0
  55. package/template/.cursor/skills/yss-technical-design/scripts/generate-schema.mjs +2 -1
  56. package/template/.cursor/skills/yss-technical-design/scripts/validate-technical-design.mjs +20 -8
  57. package/template/.cursor/skills/yss-technical-design/tests/engineering-scenarios.mjs +12 -0
  58. package/template/.cursor/skills/yss-web-controller/SKILL.md +1 -1
  59. package/template/.cursor/skills/yss-web-controller/references/profiles/existing-domain-driven-maven.md +5 -0
  60. package/template/.cursor/skills/yss-web-controller/references/profiles/existing-layered-mvc-maven.md +5 -0
  61. package/template/.pi/skills/implementation-repo-onboarding/SKILL.md +2 -2
  62. package/template/.pi/skills/yss-application/SKILL.md +1 -1
  63. package/template/.pi/skills/yss-application/references/profiles/existing-domain-driven-maven.md +5 -0
  64. package/template/.pi/skills/yss-application/references/profiles/existing-layered-mvc-maven.md +5 -0
  65. package/template/.pi/skills/yss-implementation-contract-compiler/SKILL.md +2 -2
  66. package/template/.pi/skills/yss-implementation-contract-compiler/references/compiler-contract.yaml +4 -0
  67. package/template/.pi/skills/yss-product-lifecycle/references/orchestration-contract.yaml +6 -1
  68. package/template/.pi/skills/yss-prototype-stage/SKILL.md +10 -1
  69. package/template/.pi/skills/yss-technical-design/SKILL.md +2 -0
  70. package/template/.pi/skills/yss-technical-design/references/engineering-design.schema.json +224 -0
  71. package/template/.pi/skills/yss-technical-design/references/technical-design-common.schema.json +6 -0
  72. package/template/.pi/skills/yss-technical-design/references/technical-design.schema.json +288 -10
  73. package/template/.pi/skills/yss-technical-design/scripts/engineering-design.mjs +30 -0
  74. package/template/.pi/skills/yss-technical-design/scripts/generate-schema.mjs +2 -1
  75. package/template/.pi/skills/yss-technical-design/scripts/validate-technical-design.mjs +20 -8
  76. package/template/.pi/skills/yss-technical-design/tests/engineering-scenarios.mjs +12 -0
  77. package/template/.pi/skills/yss-web-controller/SKILL.md +1 -1
  78. package/template/.pi/skills/yss-web-controller/references/profiles/existing-domain-driven-maven.md +5 -0
  79. package/template/.pi/skills/yss-web-controller/references/profiles/existing-layered-mvc-maven.md +5 -0
  80. package/template/README.md +4 -6
  81. package/template/docs/agents/backend-architecture-profiles.md +4 -0
  82. package/template/docs/agents/yss-skill-registry.yaml +13 -0
  83. package/template/docs/design/templates/prototype-confirmation-template.md +2 -2
  84. package/template/docs/design/templates/prototype-review-checklist.md +2 -2
  85. package/template/docs/plan/templates/market-analysis-template.md +3 -3
  86. package/template/docs/plan/templates/user-pain-points-template.md +3 -3
  87. package/template/docs/process/delivery-preflight.md +72 -0
  88. package/template/docs/process/document-writing.md +5 -1
  89. package/template/docs/process/existing-backend-architecture.md +31 -0
  90. package/template/docs/process/existing-ui-baseline.md +40 -0
  91. package/template/docs/process/frontend-backend-delivery.md +19 -6
  92. package/template/docs/process/implementation-repo-integration.md +6 -0
  93. package/template/docs/process/schemas/backend-architecture-identity.schema.json +111 -14
  94. package/template/docs/process/schemas/delivery-preflight-input.schema.json +158 -0
  95. package/template/docs/process/schemas/delivery-preflight-result.schema.json +159 -0
  96. package/template/docs/process/schemas/digital-human-task-package.schema.json +1 -1
  97. package/template/docs/process/schemas/existing-ui-baseline.schema.json +365 -0
  98. package/template/docs/process/schemas/frontend-delivery-acceptance-v3.schema.json +308 -0
  99. package/template/docs/process/schemas/frontend-strategic-preflight-v2.schema.json +114 -0
  100. package/template/docs/process/schemas/strategic-design-handoff-v5.schema.json +932 -0
  101. package/template/docs/process/schemas/strategic-handoff-export-v2.schema.json +378 -0
  102. package/template/docs/process/strategic-handoff-package.md +21 -13
  103. package/template/docs/user-guide//346/212/200/346/234/257/350/256/276/350/256/241/347/224/250/346/210/267/346/214/207/345/215/227.md +43 -0
  104. package/template/docs/user-guide//347/224/250/346/210/267/346/211/213/345/206/214.md +83 -67
  105. package/template/docs/user-guide//347/224/250/346/210/267/346/211/213/345/206/214/347/264/242/345/274/225.md +9 -10
  106. package/template/docs/user-guide//350/256/276/345/244/207/345/200/237/347/224/250/350/264/257/347/251/277/346/241/210/344/276/213.md +12 -9
  107. package/template/scripts/backend-delivery +20 -4
  108. package/template/scripts/lib/approved-execution-context.mjs +106 -0
  109. package/template/scripts/lib/backend-architecture.mjs +12 -0
  110. package/template/scripts/lib/backend-delivery.mjs +10 -6
  111. package/template/scripts/lib/delivery-preflight.mjs +238 -0
  112. package/template/scripts/lib/existing-backend-architecture.mjs +139 -0
  113. package/template/scripts/lib/existing-ui-baseline.mjs +84 -0
  114. package/template/scripts/lib/frontend-delivery.mjs +23 -15
  115. package/template/scripts/lib/implementation-contract-compiler.mjs +19 -5
  116. package/template/scripts/lib/json-schema.mjs +19 -4
  117. package/template/scripts/lib/profile-skill-sync.mjs +26 -0
  118. package/template/scripts/lib/strategic-handoff-consumption.mjs +6 -5
  119. package/template/scripts/lib/strategic-handoff-design-targets.mjs +2 -3
  120. package/template/scripts/lib/strategic-handoff-io.mjs +10 -0
  121. package/template/scripts/lib/strategic-handoff.mjs +47 -29
  122. package/template/scripts/lib/task-package.mjs +11 -3
  123. package/template/scripts/lib/technical-design-boundary.mjs +9 -1
  124. package/template/scripts/lib/ui-baseline.mjs +26 -0
  125. package/template/scripts/lib/user-decision.mjs +4 -1
  126. package/template/scripts/preflight-delivery +14 -0
  127. package/template/scripts/strategic-handoff +19 -4
  128. package/template/scripts/sync-profile-skills +4 -5
  129. package/template/skills-lock.json +15 -15
  130. package/template.snapshot.json +3 -3
  131. package/template/docs/user-guide//346/210/230/346/234/257/350/256/276/350/256/241/345/255/220/351/241/271/347/233/256/347/224/250/346/210/267/346/211/213/345/206/214.md +0 -35
@@ -0,0 +1,378 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://yss.dev/schemas/strategic-handoff-export-v2.schema.json",
4
+ "type": "object",
5
+ "additionalProperties": false,
6
+ "required": [
7
+ "schema_version",
8
+ "approvals",
9
+ "additional_files",
10
+ "reference_map",
11
+ "ui_baseline_kind"
12
+ ],
13
+ "properties": {
14
+ "schema_version": {
15
+ "const": 2
16
+ },
17
+ "approvals": {
18
+ "type": "object",
19
+ "additionalProperties": false,
20
+ "required": [
21
+ "domain_strategy_ref",
22
+ "stage_decision_package_ref",
23
+ "spec_ref",
24
+ "business_ticket_set_ref",
25
+ "handoff"
26
+ ],
27
+ "properties": {
28
+ "domain_strategy_ref": {
29
+ "type": "object",
30
+ "additionalProperties": false,
31
+ "required": [
32
+ "record_ref",
33
+ "gate_id",
34
+ "digest_kind"
35
+ ],
36
+ "properties": {
37
+ "record_ref": {
38
+ "type": "string",
39
+ "minLength": 1
40
+ },
41
+ "gate_id": {
42
+ "type": "string",
43
+ "minLength": 1
44
+ },
45
+ "digest_kind": {
46
+ "enum": [
47
+ "canonical-json",
48
+ "sha256-bytes",
49
+ "visual-baseline"
50
+ ]
51
+ }
52
+ }
53
+ },
54
+ "stage_decision_package_ref": {
55
+ "type": "object",
56
+ "additionalProperties": false,
57
+ "required": [
58
+ "record_ref",
59
+ "gate_id",
60
+ "digest_kind"
61
+ ],
62
+ "properties": {
63
+ "record_ref": {
64
+ "type": "string",
65
+ "minLength": 1
66
+ },
67
+ "gate_id": {
68
+ "type": "string",
69
+ "minLength": 1
70
+ },
71
+ "digest_kind": {
72
+ "enum": [
73
+ "canonical-json",
74
+ "sha256-bytes",
75
+ "visual-baseline"
76
+ ]
77
+ }
78
+ }
79
+ },
80
+ "spec_ref": {
81
+ "type": "object",
82
+ "additionalProperties": false,
83
+ "required": [
84
+ "record_ref",
85
+ "gate_id",
86
+ "digest_kind"
87
+ ],
88
+ "properties": {
89
+ "record_ref": {
90
+ "type": "string",
91
+ "minLength": 1
92
+ },
93
+ "gate_id": {
94
+ "type": "string",
95
+ "minLength": 1
96
+ },
97
+ "digest_kind": {
98
+ "enum": [
99
+ "canonical-json",
100
+ "sha256-bytes",
101
+ "visual-baseline"
102
+ ]
103
+ }
104
+ }
105
+ },
106
+ "prototype_ref": {
107
+ "type": "object",
108
+ "additionalProperties": false,
109
+ "required": [
110
+ "record_ref",
111
+ "gate_id",
112
+ "digest_kind"
113
+ ],
114
+ "properties": {
115
+ "record_ref": {
116
+ "type": "string",
117
+ "minLength": 1
118
+ },
119
+ "gate_id": {
120
+ "type": "string",
121
+ "minLength": 1
122
+ },
123
+ "digest_kind": {
124
+ "enum": [
125
+ "canonical-json",
126
+ "sha256-bytes",
127
+ "visual-baseline"
128
+ ]
129
+ }
130
+ }
131
+ },
132
+ "visual_baseline_ref": {
133
+ "type": "object",
134
+ "additionalProperties": false,
135
+ "required": [
136
+ "record_ref",
137
+ "gate_id",
138
+ "digest_kind"
139
+ ],
140
+ "properties": {
141
+ "record_ref": {
142
+ "type": "string",
143
+ "minLength": 1
144
+ },
145
+ "gate_id": {
146
+ "type": "string",
147
+ "minLength": 1
148
+ },
149
+ "digest_kind": {
150
+ "enum": [
151
+ "canonical-json",
152
+ "sha256-bytes",
153
+ "visual-baseline"
154
+ ]
155
+ }
156
+ }
157
+ },
158
+ "business_ticket_set_ref": {
159
+ "type": "object",
160
+ "additionalProperties": false,
161
+ "required": [
162
+ "record_ref",
163
+ "gate_id",
164
+ "digest_kind"
165
+ ],
166
+ "properties": {
167
+ "record_ref": {
168
+ "type": "string",
169
+ "minLength": 1
170
+ },
171
+ "gate_id": {
172
+ "type": "string",
173
+ "minLength": 1
174
+ },
175
+ "digest_kind": {
176
+ "enum": [
177
+ "canonical-json",
178
+ "sha256-bytes",
179
+ "visual-baseline"
180
+ ]
181
+ }
182
+ }
183
+ },
184
+ "handoff": {
185
+ "type": "object",
186
+ "additionalProperties": false,
187
+ "required": [
188
+ "record_ref",
189
+ "gate_id",
190
+ "digest_kind"
191
+ ],
192
+ "properties": {
193
+ "record_ref": {
194
+ "type": "string",
195
+ "minLength": 1
196
+ },
197
+ "gate_id": {
198
+ "type": "string",
199
+ "minLength": 1
200
+ },
201
+ "digest_kind": {
202
+ "enum": [
203
+ "canonical-json",
204
+ "sha256-bytes",
205
+ "visual-baseline"
206
+ ]
207
+ }
208
+ }
209
+ },
210
+ "existing_ui_baseline_ref": {
211
+ "type": "object",
212
+ "additionalProperties": false,
213
+ "required": [
214
+ "record_ref",
215
+ "gate_id",
216
+ "digest_kind"
217
+ ],
218
+ "properties": {
219
+ "record_ref": {
220
+ "type": "string",
221
+ "minLength": 1
222
+ },
223
+ "gate_id": {
224
+ "type": "string",
225
+ "minLength": 1
226
+ },
227
+ "digest_kind": {
228
+ "const": "sha256-bytes"
229
+ }
230
+ }
231
+ }
232
+ }
233
+ },
234
+ "additional_files": {
235
+ "type": "array",
236
+ "items": {
237
+ "type": "string",
238
+ "minLength": 1
239
+ },
240
+ "minItems": 0
241
+ },
242
+ "reference_map": {
243
+ "type": "object",
244
+ "additionalProperties": {
245
+ "type": "string",
246
+ "minLength": 1
247
+ }
248
+ },
249
+ "prototype": {
250
+ "type": "object",
251
+ "additionalProperties": false,
252
+ "required": [
253
+ "profile",
254
+ "preview_root",
255
+ "entry_ref",
256
+ "verification_ref",
257
+ "verification_digest"
258
+ ],
259
+ "properties": {
260
+ "profile": {
261
+ "enum": [
262
+ "H1",
263
+ "H2"
264
+ ]
265
+ },
266
+ "preview_root": {
267
+ "type": "string",
268
+ "minLength": 1
269
+ },
270
+ "entry_ref": {
271
+ "type": "string",
272
+ "minLength": 1
273
+ },
274
+ "verification_ref": {
275
+ "type": "string",
276
+ "minLength": 1
277
+ },
278
+ "source_root": {
279
+ "type": "string",
280
+ "minLength": 1
281
+ },
282
+ "lock_ref": {
283
+ "type": "string",
284
+ "minLength": 1
285
+ },
286
+ "verification_digest": {
287
+ "type": "string",
288
+ "pattern": "^sha256:[a-f0-9]{64}$"
289
+ },
290
+ "source_digest": {
291
+ "type": "string",
292
+ "pattern": "^sha256:[a-f0-9]{64}$"
293
+ }
294
+ },
295
+ "allOf": [
296
+ {
297
+ "if": {
298
+ "properties": {
299
+ "profile": {
300
+ "const": "H2"
301
+ }
302
+ }
303
+ },
304
+ "then": {
305
+ "required": [
306
+ "source_root",
307
+ "lock_ref",
308
+ "source_digest"
309
+ ]
310
+ }
311
+ }
312
+ ]
313
+ },
314
+ "ui_baseline_kind": {
315
+ "enum": [
316
+ "prototype",
317
+ "existing-ui-baseline"
318
+ ]
319
+ }
320
+ },
321
+ "allOf": [
322
+ {
323
+ "if": {
324
+ "properties": {
325
+ "ui_baseline_kind": {
326
+ "const": "prototype"
327
+ }
328
+ }
329
+ },
330
+ "then": {
331
+ "required": [
332
+ "prototype"
333
+ ],
334
+ "properties": {
335
+ "approvals": {
336
+ "required": [
337
+ "prototype_ref",
338
+ "visual_baseline_ref"
339
+ ],
340
+ "not": {
341
+ "required": [
342
+ "existing_ui_baseline_ref"
343
+ ]
344
+ }
345
+ }
346
+ }
347
+ },
348
+ "else": {
349
+ "not": {
350
+ "required": [
351
+ "prototype"
352
+ ]
353
+ },
354
+ "properties": {
355
+ "approvals": {
356
+ "required": [
357
+ "existing_ui_baseline_ref"
358
+ ],
359
+ "not": {
360
+ "anyOf": [
361
+ {
362
+ "required": [
363
+ "prototype_ref"
364
+ ]
365
+ },
366
+ {
367
+ "required": [
368
+ "visual_baseline_ref"
369
+ ]
370
+ }
371
+ ]
372
+ }
373
+ }
374
+ }
375
+ }
376
+ }
377
+ ]
378
+ }
@@ -1,16 +1,16 @@
1
1
  # 战略交接快照包
2
2
 
3
- 本合同用于批准后的战略交付和研发接收,不增加生命周期阶段或门禁。`scripts/strategic-handoff` 是统一入口;Node 22+、Python 3 和现有 `jsonschema` 环境即可运行,不下载依赖、不执行交接包中的代码。包 schema 与导出配置见同目录 `schemas/strategic-handoff-package.schema.json`、`schemas/strategic-handoff-export.schema.json`。源规则仍由战略合同持有,索引与快照不成为第二套事实源。
3
+ 本合同用于批准后的战略交付和研发接收,不增加生命周期阶段或门禁。`scripts/strategic-handoff` 是统一入口;Node 22+、Python 3 和现有 `jsonschema` 环境即可运行,不下载依赖、不执行交接包中的代码。包 schema 与导出配置见同目录 `schemas/strategic-handoff-package.schema.json`、`schemas/strategic-handoff-export.schema.json`(历史 v1)与 `schemas/strategic-handoff-export-v2.schema.json`(Handoff v5)。源规则仍由战略合同持有,索引与快照不成为第二套事实源。
4
4
 
5
5
  ## 源资产准备
6
6
 
7
7
  1. 源仓必须为 `project-instance`。新交付使用 Domain Strategy v3 与 Stage Decision Package v3;规则、场景、决定、假设、约束、成功标准、测试 seam 与 downstream mapping 使用稳定 ID 和证据。v2 仅用于历史 Handoff v3 的只读验证;修改或重发须显式迁移、重新批准。不得用行号、文字 hash 或导出顺序生成业务身份。
8
8
  2. 每个场景明确 `critical`、`rule_refs`、`success_results` 和既有 `failure_results`;兼容字段 `rules` 必须与引用规则正文一致。不变量使用 `rule_ref`,并通过 `scenario_refs` 指向确实覆盖该规则的场景。缺身份或关联先回战略方确认、更新并重新批准,导出器不猜测。
9
- 3. 新交付使用 Handoff v4;历史 Handoff v3 继续按冻结 v3 schema 和单目标语义严格验证,不原地升级。校验器先读取 `schema_version` 再选择固定 schema,未知版本输出支持列表并 fail closed。`package_export` 的 `approvals` 按 `source` 字段及 `handoff` 绑定批准记录,声明 `record_ref`、`gate_id`、`digest_kind`。沿用源角色表的现有门禁;当前综合模板的战略、阶段决策及交接资产统一绑定 `gate.plan-approved`,Spec 对应 Spec 基线批准,原型和视觉基线对应 `gate.product-design-approved`;历史包及其他源 profile 仍按包内明确登记的源批准规则验证,不自动迁移当前门禁状态。
9
+ 3. 新的既有 UI 交接使用 Handoff v5;原型交付可继续使用 Handoff v4 或显式使用 v5 的 prototype 分支。历史 Handoff v3/v4 按各自冻结 schema 和来源语义严格验证,不原地升级。校验器先读取 `schema_version` 再选择固定 schema,未知版本输出支持列表并 fail closed。`package_export` 的 `approvals` 按 `source` 字段及 `handoff` 绑定批准记录,声明 `record_ref`、`gate_id`、`digest_kind`。沿用源角色表的现有门禁;当前综合模板的战略、阶段决策及交接资产统一绑定 `gate.plan-approved`,Spec 对应 Spec 基线批准,原型和视觉基线对应 `gate.product-design-approved`;历史包及其他源 profile 仍按包内明确登记的源批准规则验证,不自动迁移当前门禁状态。
10
10
  4. 批准记录除既有会签字段,还要在 `artifact_bindings` 中逐项绑定 `{id, version, digest}`。战略/阶段建议 `canonical-json`;普通文件使用 `sha256-bytes`;视觉基线使用 `visual-baseline`。正文中的 `approved` 和可读取批准路径不能替代当前字节的批准绑定。源角色表要求用户决定记录时,接收端必须支持并核验该策略;旧工具缺少该能力时阻断并要求升级,不能按旧规则放行。
11
11
  5. `additional_files` 明确补充依赖;`reference_map` 将 `evidence.*` 稳定证据引用解析为仓内路径。源资产、批准记录、证据引用、Markdown 本地链接和显式目录共同形成依赖闭包。HTTP 引用保留为引用,不在导出时下载网页。
12
- 6. `prototype` 指定 `profile`、`preview_root`、`entry_ref`、`verification_ref`、`verification_digest`(验证记录的字节摘要);H2 另须 `source_root`、`lock_ref` 和 `source_digest`(源码目录树摘要,算法同下述预览树)。源码交付目录不含 node_modules / .git;锁文件与源码一同保存。预览目录须资源闭合,可通过本地静态服务离线浏览。源码、锁文件或验证记录变化须更新交接摘要并重新批准。
13
- 7. 离线浏览验证记录必须有 `network_mode: offline`、实际 `command`、`executed_at`、`exit_code: 0`、`case_ids`、`evidence_refs` 和 `preview_digest`。后者为按路径排序的预览文件 `{path: 相对preview_root路径, sha256: 字节摘要}` 数组的 canonical JSON SHA-256。记录须覆盖视觉基线 case;采集时禁用外网,动态资源与交互由实际浏览器验证。验包不执行来源代码;静态闭包检查不能替代浏览器证据。
12
+ 6. 原型分支的 `prototype` 指定 `profile`、`preview_root`、`entry_ref`、`verification_ref`、`verification_digest`(验证记录的字节摘要);H2 另须 `source_root`、`lock_ref` 和 `source_digest`(源码目录树摘要,算法同下述预览树)。源码交付目录不含 node_modules / .git;锁文件与源码一同保存。预览目录须资源闭合,可通过本地静态服务离线浏览。源码、锁文件或验证记录变化须更新交接摘要并重新批准。
13
+ 7. 原型分支的离线浏览验证记录必须有 `network_mode: offline`、实际 `command`、`executed_at`、`exit_code: 0`、`case_ids`、`evidence_refs` 和 `preview_digest`。后者为按路径排序的预览文件 `{path: 相对preview_root路径, sha256: 字节摘要}` 数组的 canonical JSON SHA-256。记录须覆盖视觉基线 case;采集时禁用外网,动态资源与交互由实际浏览器验证。验包不执行来源代码;静态闭包检查不能替代浏览器证据。
14
14
 
15
15
  ## 命令
16
16
 
@@ -23,11 +23,19 @@ scripts/strategic-handoff verify --bundle <目录或ZIP>
23
23
  scripts/strategic-handoff import --bundle <目录或ZIP> --target-root <研发项目根>
24
24
  ```
25
25
 
26
- 目录是逻辑包;ZIP 只负责运输。源资产原始字节进入 payload,清单以 `original_ref → path` 映射原路径到包内路径;原 Handoff 保存在 `handoff.yaml`,源根词汇表保存为 `payload/source-context.snapshot.md`。包中不创建嵌套 `CONTEXT.md`。独立验包时工具在临时目录重建只读验证视图,完成后清理;不把临时源词汇表注册为目标权威。
26
+ 目录是逻辑包;ZIP 只负责运输。源资产原始字节进入 payload,清单以 `original_ref → path` 映射原路径到包内路径;v3/v4 的原 Handoff 保存在 `handoff.yaml`,源根词汇表保存为 `payload/source-context.snapshot.md`。v5 的原文件映射为 `payload/files/<original_ref>`,只有根词汇表使用固定物理别名 `payload/files/source-context.snapshot.md`;该别名不成为第二个根词汇表。包中不创建嵌套 `CONTEXT.md`。常规独立验包时工具在临时目录重建验证视图,完成后清理;不把临时源词汇表注册为目标权威。
27
27
 
28
28
  `manifest.json` 的 `files` 声明所有文件的字节摘要和大小。`bundle_digest` 是删除自身字段后 canonical JSON 的 SHA-256;不把整 ZIP 摘要当逻辑版本摘要。目录与 ZIP 的逻辑摘要相同。源合同的既有语义 digest 另行复核。目录/ZIP 已存在时拒绝覆盖,同身份版本不同内容的导入拒绝;已验过且相同的重复导入返回 `already-imported`。限制为 20,000 文件、512 MiB 展开内容;拒绝 ZIP 路径穿越、重复路径、大小写碰撞和符号链接。
29
29
 
30
- ## Handoff v4 消费者路由
30
+ ## 既有 UI 基线与严格只读核验
31
+
32
+ Handoff v5 必须声明 `ui_baseline_kind: prototype | existing-ui-baseline`,`package_export` v2 使用相同类型。prototype 分支保留上述原型、视觉包、离线浏览和批准规则。existing-ui-baseline 分支只承接无 UI 改动的工程,`source.existing_ui_baseline_ref` 替代原型/视觉引用;不可混填两类来源。完整文件合同见 [既有 UI 基线](existing-ui-baseline.md)。
33
+
34
+ 既有基线以 `existing-ui-baseline.json` 原字节摘要作为当前资产,由 `gate.product-design-approved` 的真实用户决定覆盖;批准主体必须是同一 manifest。固定源码、锁文件、构建输出、动作、截图、API 请求/响应和原始执行记录逐项绑定。历史原型批准不能自动转成基线批准;任何 UI/体验变化返回产品设计。
35
+
36
+ 初始化和构建前运行 `scripts/preflight-delivery --input <输入清单> --stage prepare|build|export|accept --json`;完整阶段语义见 [交付预检](delivery-preflight.md)。`openBundle(...,{readOnly:true})` 对已展开 v5 包以固定别名映射核验,不写临时源目录、不执行来源代码;ZIP 返回 `readonly-extraction-required`,旧布局返回 `readonly-source-layout-required`,均不得视为验证通过。实际导出和接收仍在执行边界重新校验。
37
+
38
+ ## Handoff v4/v5 消费者路由
31
39
 
32
40
  `consumer_routes` 固定表达三种能力,不绑定仓名:`backend-technical-design`、`frontend-engineering-design`、`delivery-coordination`。每条路由记录稳定 `route_id`、`required | optional | not-applicable`、影响引用、入口工作单元、预期输出、依赖和 Context Reconciliation 要求;`optional` / `not-applicable` 必须有原因与证据,不能产生 `ready-for-agent`。
33
41
 
@@ -37,7 +45,7 @@ scripts/strategic-handoff import --bundle <目录或ZIP> --target-root <研发
37
45
 
38
46
  ## 下游接收与逐条追溯
39
47
 
40
- 导入落盘到 `docs/handoffs/<handoff-id>/<version>/`。Handoff v3 继续生成 Import Receipt v1 和原固定文件名;Handoff v4 生成 Import Receipt v2,按目标 profile 的消费者能力登记 route、产物引用和状态,并分别生成后端追踪、Frontend Strategic Preflight / 前端追踪、协调状态索引草案。共同生成 route-aware Context Reconciliation 和 upstream impact 草案。仅写快照与草案,不自动更新根词汇表或批准状态。目标侧确认增量后更新唯一根 `CONTEXT.md` 并完成正式 reconciliation。
48
+ 导入落盘到 `docs/handoffs/<handoff-id>/<version>/`。Handoff v3 继续生成 Import Receipt v1 和原固定文件名;Handoff v4/v5 生成 Import Receipt v2,按目标 profile 的消费者能力登记 route、产物引用和状态,并分别生成后端追踪、Frontend Strategic Preflight / 前端追踪、协调状态索引草案。共同生成 route-aware Context Reconciliation 和 upstream impact 草案。仅写快照与草案,不自动更新根词汇表或批准状态。目标侧确认增量后更新唯一根 `CONTEXT.md` 并完成正式 reconciliation。
41
49
 
42
50
  Technical Design Contract v2(DDD / MVC 共用)的 `strategic_handoff` 绑定 `import_receipt_ref`、`bundle_digest`、`context_reconciliation_ref` 和 `rows`。逐条覆盖全部规则与 `critical: true` 的成功/失败场景;行字段如下:
43
51
 
@@ -53,13 +61,13 @@ scripts/verify-strategic-handoff-consumption --root <研发项目根> --slice <
53
61
  node .agents/skills/yss-technical-design/scripts/validate-technical-design.mjs <技术设计合同> --root <研发项目根>
54
62
  ```
55
63
 
56
- Handoff v4 后端消费必须绑定 `backend-technical-design` 的 `route_id`,先对账,再由 `yss-technical-design` 依据已批准架构调用 `yss-tactical-design` 或 `yss-mvc-design`。Handoff v3 的 `yss-technical-design` / `yss-tactical-design` 单目标组合只读兼容,不修改已冻结包。`tactical_refs` 在 v2 Technical Design 可指向 MVC 或 DDD 分支对象;无战略交接包的 MVC 项目直接消费批准需求,不补造战略 DDD。
64
+ Handoff v4/v5 后端消费必须绑定 `backend-technical-design` 的 `route_id`,先对账,再由 `yss-technical-design` 依据已批准架构调用 `yss-tactical-design` 或 `yss-mvc-design`。Handoff v3 的 `yss-technical-design` / `yss-tactical-design` 单目标组合只读兼容,不修改已冻结包。`tactical_refs` 在 v2 Technical Design 可指向 MVC 或 DDD 分支对象;无战略交接包的 MVC 项目直接消费批准需求,不补造战略 DDD。
57
65
 
58
- 前端先验证 `frontend-strategic-preflight.schema.json`,只允许起草前端工程设计与实现计划,固定返回 `ready_for_agent: false`。最终 Frontend Delivery Acceptance v2 在 Backend/API/Data 有影响时必须绑定真实 Backend Delivery 收据与版本探测;UI-only 时使用与战略路由一致的 `backend-not-applicable`,此时 `operation_ids` 必须为空。无论哪条路径,当前且已批准的 Slice Contract 仍是实现入口。
66
+ 前端先验证与交接版本匹配的 Strategic Preflight:Handoff v4 使用 v1,Handoff v5 使用 v2 的 `ui_baseline_kind/ui_baseline_ref`,只允许起草前端工程设计与实现计划,固定返回 `ready_for_agent: false`。最终 Frontend Delivery Acceptance v2(Handoff v4)或 v3(Handoff v5)在 Backend/API/Data 有影响时必须绑定真实 Backend Delivery 收据与版本探测;UI-only 时使用与战略路由一致的 `backend-not-applicable`,此时 `operation_ids` 必须为空。无论哪条路径,当前且已批准的 Slice Contract 仍是实现入口。
59
67
 
60
68
  ## 消费者反馈闭环
61
69
 
62
- Consumer Feedback v1 与 Feedback Adjudication v1 独立保存在已交付 package 外,分别绑定 bundle ID/version/digest、route、source ID/digest 和 feedback 原始字节 digest。`keep` 允许消费者重新核验后继续;`amend` 保持旧路径 blocked,战略资产升版、重新批准并导出新的 Handoff v4;`defer` 对 blocking 问题继续阻断,非阻断问题只有责任人、风险、验证计划和目标版本齐全时继续。任何范围或风险变化重新应用用户决定失效规则;禁止修改历史 package 或用旧摘要冒充当前裁决。
70
+ Consumer Feedback v1 与 Feedback Adjudication v1 独立保存在已交付 package 外,分别绑定 bundle ID/version/digest、route、source ID/digest 和 feedback 原始字节 digest。`keep` 允许消费者重新核验后继续;`amend` 保持旧路径 blocked,战略资产升版、重新批准并导出新版本 Handoff;`defer` 对 blocking 问题继续阻断,非阻断问题只有责任人、风险、验证计划和目标版本齐全时继续。任何范围或风险变化重新应用用户决定失效规则;禁止修改历史 package 或用旧摘要冒充当前裁决。
63
71
 
64
72
  ```bash
65
73
  scripts/strategic-feedback verify-feedback --root <消费者项目根> <feedback.json>
@@ -68,11 +76,11 @@ scripts/strategic-feedback verify-adjudication --root <消费者项目根> <adju
68
76
 
69
77
  整体验证有未落实项时返回 blocked;按切片验证可放行有证据证明不依赖这些项的切片。输出 `block_all`、`blocked_slice_refs`、`issues`、实际消费包摘要与战术摘要。通过只证明结构化映射完整和引用可核验,业务语义仍需独立评审;不能代替 Slice Contract 批准。
70
78
 
71
- 每版完整快照可独立消费,差异区分 added / updated / removed。更新须提升交接版本,内容变化的源资产也须提升其版本。接收新版本后,消费校验比较最新已导入源对象摘要;规则变化按行依赖阻断,未映射的新规则扩大阻断,战略责任边界、方案决策、Spec/视觉/原型源码等变化未重新绑定时整体阻断。`upstream-change-impact.json` 是生命周期处理 stale 的证据输入,不直接改 Tracker 或覆盖战术合同。
79
+ 每版完整快照可独立消费,差异区分 added / updated / removed。更新须提升交接版本,内容变化的源资产也须提升其版本。接收新版本后,消费校验比较最新已导入源对象摘要;规则变化按行依赖阻断,未映射的新规则扩大阻断,战略责任边界、方案决策、Spec/视觉/原型源码/既有 UI 基线等变化未重新绑定时整体阻断。`upstream-change-impact.json` 是生命周期处理 stale 的证据输入,不直接改 Tracker 或覆盖战术合同。
72
80
 
73
81
  ## 维护与同步
74
82
 
75
- 共享脚本和包 schema 以主模板为维护源,通过 `scripts/sync-strategic-handoff-tools` 同步到设计/研发模板;源战略 schema 的离线验证副本由该脚本从 canonical `yss-stage-decision/references` 派生。三仓技能仍只编辑 `.agents/skills`,再生成各 runtime 投影与锁。CLI 快照使用各自同步工具,工作树快照用于集成验证,不代表已发布 commit。
83
+ 共享脚本和包 schema 以主模板为维护源,通过 `scripts/sync-strategic-handoff-tools` 同步到设计/研发模板;源战略 schema 的离线验证副本由该脚本从 canonical `yss-stage-decision/references` 派生。各仓技能仍只编辑 `.agents/skills`,再生成各 runtime 投影与锁。CLI 快照使用各自同步工具,工作树快照用于集成验证,不代表已发布 commit。共享同步仅从主技能注册表投影 `existing_project_profiles` 验证元数据,保留接收模板自己的 Recipe、capability 与创作技能;源注册表及目标有效字节写入工具锁。后端接收模板使用独立视觉 wire runtime,不安装原型创作技能。超出本 profile 职责的技术设计/编译资产在预检中明确标记不支持,战略交接路线不依赖这些后端资产。
76
84
 
77
85
  ## 当前用户决定与交接复用
78
86
 
@@ -84,6 +92,6 @@ scripts/strategic-feedback verify-adjudication --root <消费者项目根> <adju
84
92
 
85
93
  独立交付范围清单采用 schema v1,`kind: strategic-delivery-scope`,包含 `delivery_ref`、`assets`、`risks`、`conditions`。每项资产包含 `ref`、`version`、原始字节 `digest`、`boundary` 和 `scope`;原决定的 subject 或 basis 必须覆盖该资产,专业边界须一致。风险必须已出现在原决定的 risks 中,授权条件必须已出现在 next_actions 中;无法证明的部分补充确认。
86
94
 
87
- `delivery_ref` 是交接正文去除 `package_export`、`status` 后的独立 JSON/YAML 快照;也必须列入 assets 并由既有真实决定明确覆盖;不强制新增交接回复。所有实际 source 资产及视觉基线 manifest 均须逐项覆盖。业务 Ticket 已被 Spec 的当前行为与验收范围明确覆盖时,可引用该 Spec 决定;数字人交接会签仍使用交接门禁,不改写原回复的专业边界。先固定该快照与业务资产,再确认和会签,最后组装包,避免摘要循环。仅重新组装传输包且业务依据和范围不变时复用有效确认。
95
+ `delivery_ref` 是交接正文去除 `package_export`、`status` 后的独立 JSON/YAML 快照;也必须列入 assets 并由既有真实决定明确覆盖;不强制新增交接回复。所有实际 source 资产及视觉或既有 UI 基线 manifest 均须逐项覆盖。业务 Ticket 已被 Spec 的当前行为与验收范围明确覆盖时,可引用该 Spec 决定;数字人交接会签仍使用交接门禁,不改写原回复的专业边界。先固定该快照与业务资产,再确认和会签,最后组装包,避免摘要循环。仅重新组装传输包且业务依据和范围不变时复用有效确认。
88
96
 
89
97
  导出将范围清单、复用证明、原决定及其来源依赖一起收集。离线 verify 重新检查实际交付与批准覆盖;缺文件、摘要变化、范围遗漏、未知能力均阻断,不回写旧包。
@@ -0,0 +1,43 @@
1
+ # 技术设计用户指南
2
+
3
+ 本指南说明批准战略或 Spec 如何进入后端技术设计。统一入口是 `yss-technical-design`;工程采用 `domain-driven` 时调用 `yss-tactical-design`,采用 `layered-mvc` 时调用 `yss-mvc-design`。架构类型来自当前工程登记或经用户确认的脚手架决定,不能按目录或个人偏好猜测。
4
+
5
+ ## 开始前检查
6
+
7
+ 先核对仓库身份、根 `CONTEXT.md`、批准战略或 Spec、目标实现仓登记、工程基线和适用批准。既有 Java/Maven 工程还要提供当前的 repository registration、engineering baseline 与 observation manifest;三份原始证据、实际 Git/Maven 工程和摘要必须一致。
8
+
9
+ ```text
10
+ 请读取当前批准战略或 Spec、根 CONTEXT.md 和工程登记。
11
+ 核对架构身份与既有工程证据,再用 yss-technical-design 起草当前技术设计。
12
+ domain-driven 使用 yss-tactical-design;layered-mvc 使用 yss-mvc-design。
13
+ 说明状态、事务、并发、幂等、持久化和公开测试 seam,并逐项映射源规则与关键场景。
14
+ 列出冲突、延期、依赖和需要的批准;不要提前实现代码。
15
+ ```
16
+
17
+ 缺失、冲突或过期输入应回交事实所有者。技术设计不得改变业务规则,也不能用“实现方便”覆盖已批准行为。
18
+
19
+ ## 两类架构分别回答什么
20
+
21
+ | 设计问题 | `domain-driven` | `layered-mvc` |
22
+ |---|---|---|
23
+ | 业务不变量由谁保护 | 聚合、Entity、Value Object 或 Domain Service | 用例服务、事务边界和明确校验组件 |
24
+ | 状态如何变化 | 聚合行为和状态机 | Controller/Application/Service 调用下的状态规则 |
25
+ | 一致性如何保证 | 聚合边界、Repository、事件和补偿 | 事务服务、幂等、并发控制和持久化约束 |
26
+ | 外部依赖如何隔离 | Gateway/Repository/Adapter | Controller、Service、Mapper/Repository 和外部适配器 |
27
+ | 怎样证伪 | 领域公开 seam 的正常、拒绝和并发场景 | 用例/API seam 的正常、拒绝和恢复场景 |
28
+
29
+ MVC 不要求先构造聚合、值对象或 DDD Gateway;DDD 也不能把数据库表直接当作领域边界。两者都必须解释用例、规则、事务、并发、失败恢复和可执行验证。
30
+
31
+ ## 从设计进入实现
32
+
33
+ API 有影响时先形成 OpenAPI 3.1 Draft,完成适用审查后 Freeze。随后把技术设计、冻结接口、工程登记、验证命令和回滚点编译进窄 Slice Contract。
34
+
35
+ `yss-implementation-contract-compiler` 只起草合同,不批准合同、不设置 `ready-for-agent`。实现前必须重新确认:
36
+
37
+ 1. 技术设计和工程证据仍与当前源码一致。
38
+ 2. Slice Contract 已由本仓适用门禁批准。
39
+ 3. 允许写路径是批准范围与实现仓登记范围的交集。
40
+ 4. 成功、拒绝、并发、幂等和恢复场景具有公开测试 seam。
41
+ 5. 后端优先使用登记工程根 `./mvnw` 验证。
42
+
43
+ 技术设计评审通过不等于实现、合并或发布就绪。过程示例见[设备借用贯穿案例](设备借用贯穿案例.md),项目选型见[用户手册](用户手册.md)。