create-yss-spec 3.3.6 → 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 (222) hide show
  1. package/README.md +12 -13
  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 +6 -4
  6. package/template/.agents/skills/archify/SKILL.md +1 -1
  7. package/template/.agents/skills/implementation-repo-onboarding/SKILL.md +2 -2
  8. package/template/.agents/skills/yss-application/SKILL.md +1 -1
  9. package/template/.agents/skills/yss-application/references/profiles/existing-domain-driven-maven.md +5 -0
  10. package/template/.agents/skills/yss-application/references/profiles/existing-layered-mvc-maven.md +5 -0
  11. package/template/.agents/skills/yss-implementation-contract-compiler/SKILL.md +2 -2
  12. package/template/.agents/skills/yss-implementation-contract-compiler/references/compiler-contract.yaml +4 -0
  13. package/template/.agents/skills/yss-product-lifecycle/references/orchestration-contract.yaml +6 -1
  14. package/template/.agents/skills/yss-prototype-stage/SKILL.md +10 -1
  15. package/template/.agents/skills/yss-stage-decision/SKILL.md +13 -4
  16. package/template/.agents/skills/yss-stage-decision/references/domain-strategy-contract.md +4 -3
  17. package/template/.agents/skills/yss-stage-decision/references/domain-strategy-v2.schema.json +8 -0
  18. package/template/.agents/skills/yss-stage-decision/references/domain-strategy-v3.schema.json +8 -0
  19. package/template/.agents/skills/yss-stage-decision/references/domain-strategy.schema.json +75 -5
  20. package/template/.agents/skills/yss-stage-decision/references/stage-decision-package-contract.md +4 -4
  21. package/template/.agents/skills/yss-stage-decision/references/stage-decision-package-v2.schema.json +8 -0
  22. package/template/.agents/skills/yss-stage-decision/references/stage-decision-package-v3.schema.json +8 -0
  23. package/template/.agents/skills/yss-stage-decision/references/stage-decision-package.schema.json +59 -9
  24. package/template/.agents/skills/yss-stage-decision/references/validation-rules.md +2 -2
  25. package/template/.agents/skills/yss-stage-decision/scripts/migrate-contract-v3.mjs +143 -0
  26. package/template/.agents/skills/yss-stage-decision/scripts/validate-domain-strategy.mjs +46 -4
  27. package/template/.agents/skills/yss-stage-decision/scripts/validate-stage-decision-package.mjs +48 -4
  28. package/template/.agents/skills/yss-stage-decision/tests/fixtures/valid-stage-decision-package.yaml +42 -13
  29. package/template/.agents/skills/yss-stage-decision/tests/fixtures/valid-supplier-domain.yaml +37 -5
  30. package/template/.agents/skills/yss-stage-decision/tests/run-scenarios.mjs +116 -23
  31. package/template/.agents/skills/yss-technical-design/SKILL.md +2 -0
  32. package/template/.agents/skills/yss-technical-design/references/engineering-design.schema.json +224 -0
  33. package/template/.agents/skills/yss-technical-design/references/technical-design-common.schema.json +6 -0
  34. package/template/.agents/skills/yss-technical-design/references/technical-design.schema.json +288 -10
  35. package/template/.agents/skills/yss-technical-design/scripts/engineering-design.mjs +30 -0
  36. package/template/.agents/skills/yss-technical-design/scripts/generate-schema.mjs +2 -1
  37. package/template/.agents/skills/yss-technical-design/scripts/validate-technical-design.mjs +20 -8
  38. package/template/.agents/skills/yss-technical-design/tests/engineering-scenarios.mjs +12 -0
  39. package/template/.agents/skills/yss-web-controller/SKILL.md +1 -1
  40. package/template/.agents/skills/yss-web-controller/references/profiles/existing-domain-driven-maven.md +5 -0
  41. package/template/.agents/skills/yss-web-controller/references/profiles/existing-layered-mvc-maven.md +5 -0
  42. package/template/.codex/skills/archify/SKILL.md +1 -1
  43. package/template/.codex/skills/implementation-repo-onboarding/SKILL.md +2 -2
  44. package/template/.codex/skills/yss-application/SKILL.md +1 -1
  45. package/template/.codex/skills/yss-application/references/profiles/existing-domain-driven-maven.md +5 -0
  46. package/template/.codex/skills/yss-application/references/profiles/existing-layered-mvc-maven.md +5 -0
  47. package/template/.codex/skills/yss-implementation-contract-compiler/SKILL.md +2 -2
  48. package/template/.codex/skills/yss-implementation-contract-compiler/references/compiler-contract.yaml +4 -0
  49. package/template/.codex/skills/yss-product-lifecycle/references/orchestration-contract.yaml +6 -1
  50. package/template/.codex/skills/yss-prototype-stage/SKILL.md +10 -1
  51. package/template/.codex/skills/yss-stage-decision/SKILL.md +13 -4
  52. package/template/.codex/skills/yss-stage-decision/references/domain-strategy-contract.md +4 -3
  53. package/template/.codex/skills/yss-stage-decision/references/domain-strategy-v2.schema.json +8 -0
  54. package/template/.codex/skills/yss-stage-decision/references/domain-strategy-v3.schema.json +8 -0
  55. package/template/.codex/skills/yss-stage-decision/references/domain-strategy.schema.json +75 -5
  56. package/template/.codex/skills/yss-stage-decision/references/stage-decision-package-contract.md +4 -4
  57. package/template/.codex/skills/yss-stage-decision/references/stage-decision-package-v2.schema.json +8 -0
  58. package/template/.codex/skills/yss-stage-decision/references/stage-decision-package-v3.schema.json +8 -0
  59. package/template/.codex/skills/yss-stage-decision/references/stage-decision-package.schema.json +59 -9
  60. package/template/.codex/skills/yss-stage-decision/references/validation-rules.md +2 -2
  61. package/template/.codex/skills/yss-stage-decision/scripts/migrate-contract-v3.mjs +143 -0
  62. package/template/.codex/skills/yss-stage-decision/scripts/validate-domain-strategy.mjs +46 -4
  63. package/template/.codex/skills/yss-stage-decision/scripts/validate-stage-decision-package.mjs +48 -4
  64. package/template/.codex/skills/yss-stage-decision/tests/fixtures/valid-stage-decision-package.yaml +42 -13
  65. package/template/.codex/skills/yss-stage-decision/tests/fixtures/valid-supplier-domain.yaml +37 -5
  66. package/template/.codex/skills/yss-stage-decision/tests/run-scenarios.mjs +116 -23
  67. package/template/.codex/skills/yss-technical-design/SKILL.md +2 -0
  68. package/template/.codex/skills/yss-technical-design/references/engineering-design.schema.json +224 -0
  69. package/template/.codex/skills/yss-technical-design/references/technical-design-common.schema.json +6 -0
  70. package/template/.codex/skills/yss-technical-design/references/technical-design.schema.json +288 -10
  71. package/template/.codex/skills/yss-technical-design/scripts/engineering-design.mjs +30 -0
  72. package/template/.codex/skills/yss-technical-design/scripts/generate-schema.mjs +2 -1
  73. package/template/.codex/skills/yss-technical-design/scripts/validate-technical-design.mjs +20 -8
  74. package/template/.codex/skills/yss-technical-design/tests/engineering-scenarios.mjs +12 -0
  75. package/template/.codex/skills/yss-web-controller/SKILL.md +1 -1
  76. package/template/.codex/skills/yss-web-controller/references/profiles/existing-domain-driven-maven.md +5 -0
  77. package/template/.codex/skills/yss-web-controller/references/profiles/existing-layered-mvc-maven.md +5 -0
  78. package/template/.cursor/skills/archify/SKILL.md +1 -1
  79. package/template/.cursor/skills/implementation-repo-onboarding/SKILL.md +2 -2
  80. package/template/.cursor/skills/yss-application/SKILL.md +1 -1
  81. package/template/.cursor/skills/yss-application/references/profiles/existing-domain-driven-maven.md +5 -0
  82. package/template/.cursor/skills/yss-application/references/profiles/existing-layered-mvc-maven.md +5 -0
  83. package/template/.cursor/skills/yss-implementation-contract-compiler/SKILL.md +2 -2
  84. package/template/.cursor/skills/yss-implementation-contract-compiler/references/compiler-contract.yaml +4 -0
  85. package/template/.cursor/skills/yss-product-lifecycle/references/orchestration-contract.yaml +6 -1
  86. package/template/.cursor/skills/yss-prototype-stage/SKILL.md +10 -1
  87. package/template/.cursor/skills/yss-stage-decision/SKILL.md +13 -4
  88. package/template/.cursor/skills/yss-stage-decision/references/domain-strategy-contract.md +4 -3
  89. package/template/.cursor/skills/yss-stage-decision/references/domain-strategy-v2.schema.json +8 -0
  90. package/template/.cursor/skills/yss-stage-decision/references/domain-strategy-v3.schema.json +8 -0
  91. package/template/.cursor/skills/yss-stage-decision/references/domain-strategy.schema.json +75 -5
  92. package/template/.cursor/skills/yss-stage-decision/references/stage-decision-package-contract.md +4 -4
  93. package/template/.cursor/skills/yss-stage-decision/references/stage-decision-package-v2.schema.json +8 -0
  94. package/template/.cursor/skills/yss-stage-decision/references/stage-decision-package-v3.schema.json +8 -0
  95. package/template/.cursor/skills/yss-stage-decision/references/stage-decision-package.schema.json +59 -9
  96. package/template/.cursor/skills/yss-stage-decision/references/validation-rules.md +2 -2
  97. package/template/.cursor/skills/yss-stage-decision/scripts/migrate-contract-v3.mjs +143 -0
  98. package/template/.cursor/skills/yss-stage-decision/scripts/validate-domain-strategy.mjs +46 -4
  99. package/template/.cursor/skills/yss-stage-decision/scripts/validate-stage-decision-package.mjs +48 -4
  100. package/template/.cursor/skills/yss-stage-decision/tests/fixtures/valid-stage-decision-package.yaml +42 -13
  101. package/template/.cursor/skills/yss-stage-decision/tests/fixtures/valid-supplier-domain.yaml +37 -5
  102. package/template/.cursor/skills/yss-stage-decision/tests/run-scenarios.mjs +116 -23
  103. package/template/.cursor/skills/yss-technical-design/SKILL.md +2 -0
  104. package/template/.cursor/skills/yss-technical-design/references/engineering-design.schema.json +224 -0
  105. package/template/.cursor/skills/yss-technical-design/references/technical-design-common.schema.json +6 -0
  106. package/template/.cursor/skills/yss-technical-design/references/technical-design.schema.json +288 -10
  107. package/template/.cursor/skills/yss-technical-design/scripts/engineering-design.mjs +30 -0
  108. package/template/.cursor/skills/yss-technical-design/scripts/generate-schema.mjs +2 -1
  109. package/template/.cursor/skills/yss-technical-design/scripts/validate-technical-design.mjs +20 -8
  110. package/template/.cursor/skills/yss-technical-design/tests/engineering-scenarios.mjs +12 -0
  111. package/template/.cursor/skills/yss-web-controller/SKILL.md +1 -1
  112. package/template/.cursor/skills/yss-web-controller/references/profiles/existing-domain-driven-maven.md +5 -0
  113. package/template/.cursor/skills/yss-web-controller/references/profiles/existing-layered-mvc-maven.md +5 -0
  114. package/template/.pi/skills/archify/SKILL.md +1 -1
  115. package/template/.pi/skills/implementation-repo-onboarding/SKILL.md +2 -2
  116. package/template/.pi/skills/yss-application/SKILL.md +1 -1
  117. package/template/.pi/skills/yss-application/references/profiles/existing-domain-driven-maven.md +5 -0
  118. package/template/.pi/skills/yss-application/references/profiles/existing-layered-mvc-maven.md +5 -0
  119. package/template/.pi/skills/yss-implementation-contract-compiler/SKILL.md +2 -2
  120. package/template/.pi/skills/yss-implementation-contract-compiler/references/compiler-contract.yaml +4 -0
  121. package/template/.pi/skills/yss-product-lifecycle/references/orchestration-contract.yaml +6 -1
  122. package/template/.pi/skills/yss-prototype-stage/SKILL.md +10 -1
  123. package/template/.pi/skills/yss-stage-decision/SKILL.md +13 -4
  124. package/template/.pi/skills/yss-stage-decision/references/domain-strategy-contract.md +4 -3
  125. package/template/.pi/skills/yss-stage-decision/references/domain-strategy-v2.schema.json +8 -0
  126. package/template/.pi/skills/yss-stage-decision/references/domain-strategy-v3.schema.json +8 -0
  127. package/template/.pi/skills/yss-stage-decision/references/domain-strategy.schema.json +75 -5
  128. package/template/.pi/skills/yss-stage-decision/references/stage-decision-package-contract.md +4 -4
  129. package/template/.pi/skills/yss-stage-decision/references/stage-decision-package-v2.schema.json +8 -0
  130. package/template/.pi/skills/yss-stage-decision/references/stage-decision-package-v3.schema.json +8 -0
  131. package/template/.pi/skills/yss-stage-decision/references/stage-decision-package.schema.json +59 -9
  132. package/template/.pi/skills/yss-stage-decision/references/validation-rules.md +2 -2
  133. package/template/.pi/skills/yss-stage-decision/scripts/migrate-contract-v3.mjs +143 -0
  134. package/template/.pi/skills/yss-stage-decision/scripts/validate-domain-strategy.mjs +46 -4
  135. package/template/.pi/skills/yss-stage-decision/scripts/validate-stage-decision-package.mjs +48 -4
  136. package/template/.pi/skills/yss-stage-decision/tests/fixtures/valid-stage-decision-package.yaml +42 -13
  137. package/template/.pi/skills/yss-stage-decision/tests/fixtures/valid-supplier-domain.yaml +37 -5
  138. package/template/.pi/skills/yss-stage-decision/tests/run-scenarios.mjs +116 -23
  139. package/template/.pi/skills/yss-technical-design/SKILL.md +2 -0
  140. package/template/.pi/skills/yss-technical-design/references/engineering-design.schema.json +224 -0
  141. package/template/.pi/skills/yss-technical-design/references/technical-design-common.schema.json +6 -0
  142. package/template/.pi/skills/yss-technical-design/references/technical-design.schema.json +288 -10
  143. package/template/.pi/skills/yss-technical-design/scripts/engineering-design.mjs +30 -0
  144. package/template/.pi/skills/yss-technical-design/scripts/generate-schema.mjs +2 -1
  145. package/template/.pi/skills/yss-technical-design/scripts/validate-technical-design.mjs +20 -8
  146. package/template/.pi/skills/yss-technical-design/tests/engineering-scenarios.mjs +12 -0
  147. package/template/.pi/skills/yss-web-controller/SKILL.md +1 -1
  148. package/template/.pi/skills/yss-web-controller/references/profiles/existing-domain-driven-maven.md +5 -0
  149. package/template/.pi/skills/yss-web-controller/references/profiles/existing-layered-mvc-maven.md +5 -0
  150. package/template/README.md +4 -6
  151. package/template/docs/agents/backend-architecture-profiles.md +4 -0
  152. package/template/docs/agents/yss-skill-registry.yaml +13 -0
  153. package/template/docs/design/templates/prototype-confirmation-template.md +2 -2
  154. package/template/docs/design/templates/prototype-review-checklist.md +2 -2
  155. package/template/docs/plan/templates/market-analysis-template.md +3 -3
  156. package/template/docs/plan/templates/user-pain-points-template.md +3 -3
  157. package/template/docs/process/delivery-preflight.md +72 -0
  158. package/template/docs/process/document-writing.md +5 -1
  159. package/template/docs/process/existing-backend-architecture.md +31 -0
  160. package/template/docs/process/existing-ui-baseline.md +40 -0
  161. package/template/docs/process/frontend-backend-delivery.md +21 -5
  162. package/template/docs/process/implementation-repo-integration.md +6 -0
  163. package/template/docs/process/schemas/backend-architecture-identity.schema.json +111 -14
  164. package/template/docs/process/schemas/backend-delivery.schema.json +4 -0
  165. package/template/docs/process/schemas/delivery-preflight-input.schema.json +158 -0
  166. package/template/docs/process/schemas/delivery-preflight-result.schema.json +159 -0
  167. package/template/docs/process/schemas/digital-human-task-package.schema.json +1 -1
  168. package/template/docs/process/schemas/existing-ui-baseline.schema.json +365 -0
  169. package/template/docs/process/schemas/frontend-delivery-acceptance-v1.schema.json +200 -0
  170. package/template/docs/process/schemas/frontend-delivery-acceptance-v3.schema.json +308 -0
  171. package/template/docs/process/schemas/frontend-delivery-acceptance.schema.json +37 -3
  172. package/template/docs/process/schemas/frontend-strategic-preflight-v2.schema.json +114 -0
  173. package/template/docs/process/schemas/frontend-strategic-preflight.schema.json +32 -0
  174. package/template/docs/process/schemas/lifecycle-checkpoint.schema.json +2 -1
  175. package/template/docs/process/schemas/strategic-consumer-feedback.schema.json +40 -0
  176. package/template/docs/process/schemas/strategic-design-handoff-v3.schema.json +743 -0
  177. package/template/docs/process/schemas/strategic-design-handoff-v4.schema.json +712 -0
  178. package/template/docs/process/schemas/strategic-design-handoff-v5.schema.json +932 -0
  179. package/template/docs/process/schemas/strategic-feedback-adjudication.schema.json +42 -0
  180. package/template/docs/process/schemas/strategic-handoff-domain-strategy-v3.schema.json +216 -0
  181. package/template/docs/process/schemas/strategic-handoff-export-v2.schema.json +378 -0
  182. package/template/docs/process/schemas/strategic-handoff-import-receipt.schema.json +39 -0
  183. package/template/docs/process/schemas/strategic-handoff-stage-decision-package-v3.schema.json +148 -0
  184. package/template/docs/process/strategic-handoff-package.md +51 -10
  185. package/template/docs/process/templates/lifecycle-checkpoint-template.yaml +1 -0
  186. package/template/docs/process/templates/stage-checkpoint-template.md +1 -0
  187. 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
  188. package/template/docs/user-guide//347/224/250/346/210/267/346/211/213/345/206/214.md +83 -67
  189. 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
  190. 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
  191. package/template/scripts/backend-delivery +20 -4
  192. package/template/scripts/lib/approval-record.mjs +2 -1
  193. package/template/scripts/lib/approved-execution-context.mjs +106 -0
  194. package/template/scripts/lib/backend-architecture.mjs +12 -0
  195. package/template/scripts/lib/backend-delivery.mjs +21 -5
  196. package/template/scripts/lib/delivery-preflight.mjs +238 -0
  197. package/template/scripts/lib/existing-backend-architecture.mjs +139 -0
  198. package/template/scripts/lib/existing-ui-baseline.mjs +84 -0
  199. package/template/scripts/lib/frontend-delivery-boundary.mjs +20 -4
  200. package/template/scripts/lib/frontend-delivery.mjs +76 -4
  201. package/template/scripts/lib/implementation-contract-compiler.mjs +19 -5
  202. package/template/scripts/lib/json-schema.mjs +19 -4
  203. package/template/scripts/lib/profile-skill-sync.mjs +26 -0
  204. package/template/scripts/lib/strategic-feedback.mjs +33 -0
  205. package/template/scripts/lib/strategic-handoff-consumption.mjs +11 -5
  206. package/template/scripts/lib/strategic-handoff-design-targets.mjs +2 -3
  207. package/template/scripts/lib/strategic-handoff-io.mjs +11 -0
  208. package/template/scripts/lib/strategic-handoff.mjs +143 -34
  209. package/template/scripts/lib/task-package.mjs +11 -3
  210. package/template/scripts/lib/technical-design-boundary.mjs +9 -1
  211. package/template/scripts/lib/ui-baseline.mjs +26 -0
  212. package/template/scripts/lib/user-decision-reuse.mjs +38 -0
  213. package/template/scripts/lib/user-decision.mjs +4 -1
  214. package/template/scripts/preflight-delivery +14 -0
  215. package/template/scripts/strategic-feedback +10 -0
  216. package/template/scripts/strategic-handoff +19 -4
  217. package/template/scripts/sync-profile-skills +4 -5
  218. package/template/scripts/verify-frontend-strategic-preflight +12 -0
  219. package/template/skills-lock.json +18 -18
  220. package/template.manifest.json +1 -0
  221. package/template.snapshot.json +6 -5
  222. 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
@@ -266,6 +266,12 @@
266
266
  "digest": {
267
267
  "type": "string",
268
268
  "pattern": "^sha256:[a-f0-9]{64}$"
269
+ },
270
+ "design_scope": {
271
+ "enum": [
272
+ "architecture-specific",
273
+ "engineering-only"
274
+ ]
269
275
  }
270
276
  },
271
277
  "required": [
@@ -290,15 +296,31 @@
290
296
  "allOf": [
291
297
  {
292
298
  "if": {
293
- "properties": {
294
- "architecture": {
299
+ "allOf": [
300
+ {
301
+ "not": {
302
+ "required": [
303
+ "design_scope"
304
+ ],
305
+ "properties": {
306
+ "design_scope": {
307
+ "const": "engineering-only"
308
+ }
309
+ }
310
+ }
311
+ },
312
+ {
295
313
  "properties": {
296
- "family": {
297
- "const": "domain-driven"
314
+ "architecture": {
315
+ "properties": {
316
+ "family": {
317
+ "const": "domain-driven"
318
+ }
319
+ }
298
320
  }
299
321
  }
300
322
  }
301
- }
323
+ ]
302
324
  },
303
325
  "then": {
304
326
  "properties": {
@@ -427,15 +449,31 @@
427
449
  },
428
450
  {
429
451
  "if": {
430
- "properties": {
431
- "architecture": {
452
+ "allOf": [
453
+ {
454
+ "not": {
455
+ "required": [
456
+ "design_scope"
457
+ ],
458
+ "properties": {
459
+ "design_scope": {
460
+ "const": "engineering-only"
461
+ }
462
+ }
463
+ }
464
+ },
465
+ {
432
466
  "properties": {
433
- "family": {
434
- "const": "layered-mvc"
467
+ "architecture": {
468
+ "properties": {
469
+ "family": {
470
+ "const": "layered-mvc"
471
+ }
472
+ }
435
473
  }
436
474
  }
437
475
  }
438
- }
476
+ ]
439
477
  },
440
478
  "then": {
441
479
  "properties": {
@@ -754,6 +792,246 @@
754
792
  }
755
793
  }
756
794
  }
795
+ },
796
+ {
797
+ "if": {
798
+ "required": [
799
+ "design_scope"
800
+ ],
801
+ "properties": {
802
+ "design_scope": {
803
+ "const": "engineering-only"
804
+ }
805
+ }
806
+ },
807
+ "then": {
808
+ "properties": {
809
+ "design": {
810
+ "type": "object",
811
+ "properties": {
812
+ "scope_reason": {
813
+ "type": "string",
814
+ "minLength": 1
815
+ },
816
+ "impact_assessment": {
817
+ "type": "object",
818
+ "properties": {
819
+ "domain_model": {
820
+ "const": "none"
821
+ },
822
+ "business_state": {
823
+ "const": "none"
824
+ },
825
+ "business_rules": {
826
+ "const": "none"
827
+ },
828
+ "business_persistence": {
829
+ "const": "none"
830
+ },
831
+ "schema_migration": {
832
+ "const": "none"
833
+ },
834
+ "ui_change": {
835
+ "const": "none"
836
+ },
837
+ "architecture_boundary_change": {
838
+ "const": "none"
839
+ }
840
+ },
841
+ "required": [
842
+ "domain_model",
843
+ "business_state",
844
+ "business_rules",
845
+ "business_persistence",
846
+ "schema_migration",
847
+ "ui_change",
848
+ "architecture_boundary_change"
849
+ ],
850
+ "additionalProperties": false
851
+ },
852
+ "component_catalog": {
853
+ "type": "array",
854
+ "minItems": 1,
855
+ "items": {
856
+ "type": "object",
857
+ "properties": {
858
+ "component_id": {
859
+ "type": "string",
860
+ "minLength": 1
861
+ },
862
+ "responsibility": {
863
+ "type": "string",
864
+ "minLength": 1
865
+ },
866
+ "build_unit_ref": {
867
+ "type": "string",
868
+ "minLength": 1
869
+ },
870
+ "write_paths": {
871
+ "type": "array",
872
+ "minItems": 1,
873
+ "items": {
874
+ "type": "string",
875
+ "minLength": 1
876
+ }
877
+ },
878
+ "depends_on": {
879
+ "type": "array",
880
+ "minItems": 0,
881
+ "items": {
882
+ "type": "string",
883
+ "minLength": 1
884
+ }
885
+ }
886
+ },
887
+ "required": [
888
+ "component_id",
889
+ "responsibility",
890
+ "build_unit_ref",
891
+ "write_paths",
892
+ "depends_on"
893
+ ],
894
+ "additionalProperties": false
895
+ }
896
+ },
897
+ "allowed_write_paths": {
898
+ "type": "array",
899
+ "minItems": 1,
900
+ "items": {
901
+ "type": "string",
902
+ "minLength": 1
903
+ }
904
+ },
905
+ "read_dependencies": {
906
+ "type": "array",
907
+ "minItems": 1,
908
+ "items": {
909
+ "type": "object",
910
+ "properties": {
911
+ "ref": {
912
+ "type": "string",
913
+ "minLength": 1
914
+ },
915
+ "digest": {
916
+ "type": "string",
917
+ "pattern": "^sha256:[a-f0-9]{64}$"
918
+ },
919
+ "purpose": {
920
+ "type": "string",
921
+ "minLength": 1
922
+ }
923
+ },
924
+ "required": [
925
+ "ref",
926
+ "digest",
927
+ "purpose"
928
+ ],
929
+ "additionalProperties": false
930
+ }
931
+ },
932
+ "flow": {
933
+ "type": "array",
934
+ "minItems": 1,
935
+ "items": {
936
+ "type": "string",
937
+ "minLength": 1
938
+ }
939
+ },
940
+ "failure_handling": {
941
+ "type": "string",
942
+ "minLength": 1
943
+ },
944
+ "consistency_policy": {
945
+ "type": "object",
946
+ "properties": {
947
+ "read_only": {
948
+ "const": "read-only"
949
+ },
950
+ "transaction_boundary": {
951
+ "type": "string",
952
+ "minLength": 1
953
+ },
954
+ "concurrency": {
955
+ "type": "string",
956
+ "minLength": 1
957
+ },
958
+ "idempotency": {
959
+ "type": "string",
960
+ "minLength": 1
961
+ },
962
+ "cross_database_limit": {
963
+ "type": "string",
964
+ "minLength": 1
965
+ },
966
+ "timeouts": {
967
+ "type": "string",
968
+ "minLength": 1
969
+ },
970
+ "recovery": {
971
+ "type": "string",
972
+ "minLength": 1
973
+ }
974
+ },
975
+ "required": [
976
+ "read_only",
977
+ "transaction_boundary",
978
+ "concurrency",
979
+ "idempotency",
980
+ "cross_database_limit",
981
+ "timeouts",
982
+ "recovery"
983
+ ],
984
+ "additionalProperties": false
985
+ },
986
+ "test_seams": {
987
+ "type": "array",
988
+ "minItems": 1,
989
+ "items": {
990
+ "type": "object",
991
+ "properties": {
992
+ "seam_id": {
993
+ "type": "string",
994
+ "minLength": 1
995
+ },
996
+ "kind": {
997
+ "type": "string",
998
+ "minLength": 1
999
+ },
1000
+ "subject_ref": {
1001
+ "type": "string",
1002
+ "minLength": 1
1003
+ },
1004
+ "assertion": {
1005
+ "type": "string",
1006
+ "minLength": 1
1007
+ }
1008
+ },
1009
+ "required": [
1010
+ "seam_id",
1011
+ "kind",
1012
+ "subject_ref",
1013
+ "assertion"
1014
+ ],
1015
+ "additionalProperties": false
1016
+ }
1017
+ }
1018
+ },
1019
+ "required": [
1020
+ "scope_reason",
1021
+ "impact_assessment",
1022
+ "component_catalog",
1023
+ "allowed_write_paths",
1024
+ "read_dependencies",
1025
+ "flow",
1026
+ "failure_handling",
1027
+ "consistency_policy",
1028
+ "test_seams"
1029
+ ],
1030
+ "additionalProperties": false,
1031
+ "title": "既有工程的受控工程技术设计"
1032
+ }
1033
+ }
1034
+ }
757
1035
  }
758
1036
  ]
759
1037
  }
@@ -0,0 +1,30 @@
1
+ import path from 'node:path';
2
+ import {readFileSync} from 'node:fs';
3
+ import {ensure,read,safe,hash} from '../../../../scripts/lib/strategic-handoff-io.mjs';
4
+ const beneath=(ref,scope)=>ref===scope||ref.startsWith(`${scope}/`);
5
+ export function validateEngineeringDesign(data,{root}) {
6
+ const registration=read(safe(root,data.architecture.decision_ref));
7
+ ensure(registration.architecture_identity?.schema_version===2&&registration.architecture_identity.source_kind==='existing-registration','工程设计分支只承接既有工程身份 v2');
8
+ const binding=registration.architecture_evidence.engineering_baseline;
9
+ ensure(hash(readFileSync(safe(root,binding.ref)))===binding.digest,'工程设计基线摘要漂移');
10
+ const baseline=read(safe(root,binding.ref)),design=data.design;
11
+ ensure(data.inputs.some(x=>x.kind==='engineering'&&x.ref===binding.ref&&x.digest===binding.digest),'工程设计未绑定当前基线输入');
12
+ ensure(data.inputs.some(x=>x.kind==='api'),'工程设计需当前API或经审查的无API依据');
13
+ const ids=new Set(design.component_catalog.map(x=>x.component_id));
14
+ ensure(ids.size===design.component_catalog.length,'工程组件ID重复');
15
+ const paths=new Set();
16
+ for(const component of design.component_catalog){
17
+ const unit=baseline.build_units.find(x=>x.id===component.build_unit_ref);ensure(unit,'工程组件引用未登记的实际构建单元');
18
+ ensure(component.depends_on.every(id=>ids.has(id)),'工程组件依赖悬空');
19
+ for(const ref of component.write_paths){
20
+ ensure(!path.isAbsolute(ref)&&ref.split('/').every(p=>p&&p!=='.'&&p!=='..')&&!ref.includes('\\'),'工程写路径不安全');
21
+ ensure(registration.allowed_write_paths.some(scope=>beneath(ref,scope)),'工程组件写路径超出登记范围');
22
+ ensure(!baseline.boundary_scope.some(scope=>beneath(ref,scope)||beneath(scope,ref)),'工程分支不能改已登记业务架构边界');
23
+ const unitRoot=path.posix.dirname(unit.pom_ref);
24
+ ensure(unitRoot==='.'||beneath(ref,unitRoot),'工程组件写路径与实际构建单元不符');paths.add(ref);
25
+ }
26
+ }
27
+ ensure(design.allowed_write_paths.length===paths.size&&design.allowed_write_paths.every(ref=>paths.has(ref)),'工程设计写范围与组件闭包不一致');
28
+ ensure(data.source_items.length&&data.traceability.every(row=>row.disposition==='implemented'),'工程设计必须逐条承接当前范围,不得全标不适用或延期');
29
+ for(const input of design.read_dependencies)ensure(data.inputs.some(x=>x.ref===input.ref&&x.digest===input.digest),'工程只读依赖未绑定当前输入');
30
+ }
@@ -10,8 +10,9 @@ const branches = [
10
10
  schema.$comment = 'Generated by scripts/generate-schema.mjs from common and specialist schemas. Do not hand-edit.';
11
11
  schema.allOf = branches.map(([family, ref]) => {
12
12
  const branch = load(ref); delete branch.$id; delete branch.$schema;
13
- return { if: { properties: { architecture: { properties: { family: { const: family } } } } }, then: { properties: { design: branch } } };
13
+ return { if: { allOf: [{ not: { required: ['design_scope'], properties: { design_scope: { const: 'engineering-only' } } } }, { properties: { architecture: { properties: { family: { const: family } } } } }] }, then: { properties: { design: branch } } };
14
14
  });
15
+ schema.allOf.push({if:{required:['design_scope'],properties:{design_scope:{const:'engineering-only'}}},then:{properties:{design:load('../references/engineering-design.schema.json')}}});
15
16
  const output = fileURLToPath(new URL('../references/technical-design.schema.json', import.meta.url));
16
17
  const bytes = `${JSON.stringify(schema, null, 2)}\n`;
17
18
  if (process.argv.includes('--check')) {
@@ -1,5 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  import { readFileSync } from 'node:fs';
3
+ import { validateEngineeringDesign } from './engineering-design.mjs';
4
+ import { createApprovedExecutionContext, assertApprovedExecutionContext } from '../../../../scripts/lib/approved-execution-context.mjs';
5
+ import { verifyArchitectureEvidence } from '../../../../scripts/lib/backend-architecture.mjs';
3
6
  import path from 'node:path';
4
7
  import { fileURLToPath, pathToFileURL } from 'node:url';
5
8
  import { parseArgs } from 'node:util';
@@ -39,7 +42,8 @@ function validateMvc(design) {
39
42
  if (!design.integration_catalog.length) ensure(text(design.integration_not_applicable_reason), '无外部集成必须说明原因');
40
43
  }
41
44
 
42
- export function verifyArchitecture(data, root) {
45
+ export function verifyArchitecture(data, root, {execution,sliceRef}={}) {
46
+ if(execution)assertApprovedExecutionContext(execution,{root,technicalDesign:data,sliceId:sliceRef});
43
47
  const binding = data.architecture;
44
48
  const file = safe(root, binding.decision_ref);
45
49
  ensure(hash(readFileSync(file)) === binding.decision_digest, '架构来源摘要漂移');
@@ -57,6 +61,10 @@ export function verifyArchitecture(data, root) {
57
61
  const entry = record.repositories?.find(item => item.project_id === binding.project_id) ?? record;
58
62
  ensure(entry.project_id === binding.project_id && entry.architecture_identity?.architecture_family === binding.family, '技术设计与既有工程登记架构不匹配');
59
63
  ensure(!['stale','blocked'].includes(record.status) && !['stale','blocked'].includes(entry.status), '工程登记已失效');
64
+ if (entry.architecture_identity?.schema_version === 2) {
65
+ ensure(entry.architecture_evidence?.engineering_baseline && entry.architecture_evidence?.manifest, '既有工程登记缺少原始工程证据引用');
66
+ verifyArchitectureEvidence(entry.architecture_identity, { ...entry.architecture_evidence, repository_registration: { ref: binding.decision_ref, digest: binding.decision_digest } }, { root, execution });
67
+ }
60
68
  }
61
69
  }
62
70
 
@@ -87,14 +95,14 @@ function validateLocalTraceability(data, root, sliceRef) {
87
95
  }
88
96
  }
89
97
 
90
- export async function validateTechnicalDesign(data, { root = process.cwd(), sliceRef, legacyDdd = false } = {}) {
98
+ export async function validateTechnicalDesign(data, { root = process.cwd(), sliceRef, legacyDdd = false, readOnly = false, execution } = {}) {
91
99
  if (data?.schema_version === 1) {
92
100
  ensure(legacyDdd, '旧 v1 合同需要显式 --legacy-ddd,仅按 DDD 兼容读取');
93
101
  const errors = validateDdd(data);
94
102
  ensure(!errors.length, errors.join('; '));
95
103
  if (sliceRef) ensure(data.status === 'approved', '切片只能消费 approved 设计');
96
104
  if (data.strategic_handoff || data.strategic_context_import_ref || data.upstream_impact?.source_kind === 'strategic-handoff') {
97
- const result = await verifyConsumption(data, { root, sliceRef });
105
+ const result = await verifyConsumption(data, { root, sliceRef, readOnly });
98
106
  ensure(result.result === 'verified', JSON.stringify(result));
99
107
  }
100
108
  return { result: 'legacy-ddd-read-only', architecture_family: 'domain-driven', status: data.status };
@@ -103,12 +111,13 @@ export async function validateTechnicalDesign(data, { root = process.cwd(), slic
103
111
  ensure(data.digest === technicalDigest(data), '技术设计合同摘要不匹配');
104
112
  ensure(!['stale','blocked','drift','new_impacts'].includes(data.status), '设计状态不可消费');
105
113
  if (sliceRef) ensure(data.status === 'approved', '切片只能消费 approved 设计');
106
- verifyArchitecture(data, root);
114
+ verifyArchitecture(data, root, {execution,sliceRef});
107
115
  ensure(data.inputs.some(item => item.kind === 'context' && item.ref === 'CONTEXT.md') && data.inputs.some(item => item.kind === 'spec'), '共同输入缺少根 CONTEXT.md 或 Spec');
108
116
  for (const input of data.inputs) ensure(hash(readFileSync(safe(root, input.ref))) === input.digest, `输入摘要漂移: ${input.ref}`);
109
117
  for (const ref of data.evidence_refs) safe(root, ref);
110
118
  if (data.status === 'approved') ensure(data.evidence_refs.length > 0, '已批准设计缺少评审证据');
111
- if (data.architecture.family === 'domain-driven') {
119
+ if(data.design_scope==='engineering-only')validateEngineeringDesign(data,{root});
120
+ else if (data.architecture.family === 'domain-driven') {
112
121
  const errors = validateDdd(data.design);
113
122
  ensure(!errors.length, errors.join('; '));
114
123
  ensure(data.design.status === data.status, 'DDD 分支状态与共同合同不一致');
@@ -119,16 +128,19 @@ export async function validateTechnicalDesign(data, { root = process.cwd(), slic
119
128
  for (const seam of seams.values()) ensure(ids.has(seam.subject_ref), `测试 seam 设计对象悬空: ${seam.seam_id}`);
120
129
  validateLocalTraceability(data, root, sliceRef);
121
130
  if (data.strategic_handoff) {
122
- const result = await verifyConsumption(data, { root, sliceRef });
131
+ const result = await verifyConsumption(data, { root, sliceRef, readOnly });
123
132
  ensure(result.result === 'verified', JSON.stringify(result));
124
133
  }
125
134
  return { result: 'ready-for-lifecycle-review', technical_design_id: data.technical_design_id, architecture_family: data.architecture.family, status: data.status, digest: data.digest };
126
135
  }
127
136
 
128
137
  async function main() {
129
- const { values, positionals } = parseArgs({ allowPositionals: true, options: { root: { type: 'string', default: process.cwd() }, slice: { type: 'string' }, 'legacy-ddd': { type: 'boolean', default: false } } });
138
+ const { values, positionals } = parseArgs({ allowPositionals: true, options: { root: { type: 'string', default: process.cwd() }, slice: { type: 'string' }, 'legacy-ddd': { type: 'boolean', default: false }, 'read-only': {type:'boolean',default:false}, 'approved-slice': {type:'string'}, 'approved-slice-digest': {type:'string'}, 'approved-slice-approval': {type:'string'} } });
130
139
  ensure(positionals.length === 1, '用法: validate-technical-design.mjs <合同> --root <项目根> [--slice <ID>] [--legacy-ddd]');
131
- const result = await validateTechnicalDesign(read(path.resolve(positionals[0])), { root: values.root, sliceRef: values.slice, legacyDdd: values['legacy-ddd'] });
140
+ const approvedOptions=['approved-slice','approved-slice-digest','approved-slice-approval'];
141
+ ensure(!approvedOptions.some(key=>values[key])||approvedOptions.every(key=>values[key]),'执行增量必须完整给出持久化 Slice、字节摘要及本地批准引用');
142
+ const execution=values['approved-slice']?createApprovedExecutionContext({ref:values['approved-slice'],digest:values['approved-slice-digest'],approval_ref:values['approved-slice-approval']},{root:values.root}):undefined;
143
+ const result = await validateTechnicalDesign(read(path.resolve(positionals[0])), { root: values.root, sliceRef: values.slice, legacyDdd: values['legacy-ddd'], readOnly:values['read-only'], execution });
132
144
  process.stdout.write(`${JSON.stringify(result, null, 2)}\n`);
133
145
  }
134
146
  if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) main().catch(error => { process.stderr.write(`${JSON.stringify({ result: 'blocked', errors: [error.message] })}\n`); process.exitCode = 1; });
@@ -0,0 +1,12 @@
1
+ import test from 'node:test';import assert from 'node:assert/strict';import fs from 'node:fs';import path from 'node:path';
2
+ import {fixture} from '../../../../scripts/fixtures/existing-backend/fixture.mjs';
3
+ import {validateTechnicalDesign,technicalDigest} from '../scripts/validate-technical-design.mjs';
4
+ import {enforceTechnicalDesign} from '../../../../scripts/lib/technical-design-boundary.mjs';
5
+ function design(f){
6
+ f.write('spec.md','只增加默认关闭的工程诊断;不改业务领域或数据。');f.write('api.json',{openapi:'3.1.0',paths:{'/internal/identity':{get:{operationId:'identity'}}}});
7
+ const binding=ref=>({ref,version:'v1',digest:f.write(ref,fs.readFileSync(path.join(f.root,ref),'utf8')).digest});
8
+ const data={schema_version:2,technical_design_id:'technical-design.engineering',version:'v1',status:'ready-for-human',context_ref:'CONTEXT.md',design_scope:'engineering-only',architecture:{family:f.identity.architecture_family,source_kind:'existing-registration',project_id:f.identity.project_id,decision_ref:f.bindings.repository_registration.ref,decision_digest:f.bindings.repository_registration.digest},inputs:[{kind:'context',...f.write('CONTEXT.md','# 业务上下文\n'),version:'v1'},{kind:'spec',...binding('spec.md')},{kind:'api',...binding('api.json')},{kind:'engineering',...f.bindings.engineering_baseline,version:'v1'}],source_items:[{source_id:'scenario.identity',kind:'scenario',critical:true,source_ref:'spec.md'}],traceability:[{source_id:'scenario.identity',disposition:'implemented',tactical_refs:['component.build'],test_seam_refs:['test-seam.ok','test-seam.fail'],evidence_refs:['spec.md'],dependency_status:'known',dependent_slice_refs:['slice.identity'],scenario_tests:[{outcome:'success',seam_ref:'test-seam.ok'},{outcome:'failure',seam_ref:'test-seam.fail'}]}],design:{scope_reason:'仅工程配置',impact_assessment:Object.fromEntries(['domain_model','business_state','business_rules','business_persistence','schema_migration','ui_change','architecture_boundary_change'].map(k=>[k,'none'])),component_catalog:[{component_id:'component.build',responsibility:'工程诊断资源',build_unit_ref:'app',write_paths:['pom.xml'],depends_on:[]}],allowed_write_paths:['pom.xml'],read_dependencies:[{...f.bindings.engineering_baseline,purpose:'固定构建图'}],flow:['核验固定资源','缺失时失败'],failure_handling:'503',consistency_policy:{read_only:'read-only',transaction_boundary:'no write',concurrency:'bounded',idempotency:'read',cross_database_limit:'no atomic claim',timeouts:'5seconds',recovery:'restore original'},test_seams:[{seam_id:'test-seam.ok',kind:'engineering',subject_ref:'component.build',assertion:'当前资源返回身份'},{seam_id:'test-seam.fail',kind:'engineering',subject_ref:'component.build',assertion:'坏资源拒绝'}]},evidence_refs:['spec.md']};data.digest=technicalDigest(data);return data;
9
+ }
10
+ for(const family of ['domain-driven','layered-mvc'])test(`${family} engineering-only preserves real architecture without invented domain models`,async t=>{const f=fixture(family);t.after(f.cleanup);const data=design(f);await validateTechnicalDesign(data,{root:f.root});assert.equal(data.design.aggregate_catalog,undefined);});
11
+ test('engineering branch rejects domain/catalog/path/unit/write-mode/evidence/seam bypasses',async t=>{const f=fixture();t.after(f.cleanup);for(const fault of ['domain','catalog','path','unit','write','api','seam']){const data=design(f);if(fault==='domain')data.design.impact_assessment.domain_model='changed';if(fault==='catalog')data.design.aggregate_catalog=[];if(fault==='path'){data.design.component_catalog[0].write_paths=['src/main/java/application'];data.design.allowed_write_paths=['src/main/java/application'];}if(fault==='unit')data.design.component_catalog[0].build_unit_ref='missing';if(fault==='write')data.design.consistency_policy.read_only='read-write';if(fault==='api')data.inputs=data.inputs.filter(x=>x.kind!=='api');if(fault==='seam')data.traceability[0].scenario_tests=data.traceability[0].scenario_tests.slice(0,1);data.digest=technicalDigest(data);await assert.rejects(()=>validateTechnicalDesign(data,{root:f.root}),undefined,fault);}});
12
+ test('compiler cannot downgrade domain impact to engineering-only',t=>{const f=fixture();t.after(f.cleanup);const data=design(f);data.status='approved';data.digest=technicalDigest(data);const binding={...f.write('technical.json',data),version:'v1'};assert.throws(()=>enforceTechnicalDesign({technical_design:binding,architecture_identity:f.identity,slice_id:'slice.identity',conditions:['aggregate-impact']},{root:f.root}),/engineering|工程/);});
@@ -7,7 +7,7 @@ description: Use when generating or refactoring YSS Web Adapter Controllers, req
7
7
 
8
8
  ## 架构分流(先执行)
9
9
 
10
- 读取当前合同的 architecture_identity 并与工程基线、仓库登记及 Manifest 核对;再且只读取 `references/profiles/<architecture_profile>.md`。支持的分支为 target-domain-model、layered-mvc-service、mvc-data-analysis-v1;成熟度以注册表为准,不能把 draft 称为受支持。MVC 不执行下文 DDD 专属规则,也不加载其旧分层 guide;组件、安全、批准合同、允许路径及执行证据规则仍共用。
10
+ 读取当前合同的 architecture_identity 并与工程基线、仓库登记及 Manifest 核对;再且只读取 `references/profiles/<architecture_profile>.md`。生成式分支为 target-domain-model、layered-mvc-service、mvc-data-analysis-v1;既有工程分支为 existing-domain-driven-maven、existing-layered-mvc-maven。成熟度以注册表为准,不能把 draft 称为受支持。MVC 不执行下文 DDD 专属规则,也不加载其旧分层 guide;组件、安全、批准合同、允许路径及执行证据规则仍共用。
11
11
 
12
12
  以下 Application / Domain Gateway / Infrastructure / Web module 叙述仅适用于 target-domain-model;MVC 的 service/core/repository/server/client 所有权由所选 Profile 引用定义。
13
13
 
@@ -0,0 +1,5 @@
1
+ # existing-domain-driven-maven
2
+
3
+ 只用于 `source_kind=existing-registration` 且 `architecture_family=domain-driven` 的受支持身份。先核验登记、工程基线、独立观测 manifest 和边界审查的当前摘要,再以工程基线中的实际 build unit、source root、package 与 architecture responsibility 映射确定 Web 落点;不得要求模板模块名、数量或生成器 manifest。
4
+
5
+ Controller 只暴露冻结接口并调用合同指定的 Application 或 engineering-only orchestration seam。若批准合同将只读工程探针放在实际 Web build unit 内且没有 Application 源码写路径,保持该边界,不为满足生成式目录结构新建模块、聚合、Gateway 或业务服务。请求参数、Result 包装、错误脱敏、允许路径和真实 Maven/JAR 验证仍按共用规则执行。实际映射不清、越出登记源码根或改变业务架构时返回 `blocked`。
@@ -0,0 +1,5 @@
1
+ # existing-layered-mvc-maven
2
+
3
+ 只用于 `source_kind=existing-registration` 且 `architecture_family=layered-mvc` 的受支持身份。以登记、工程基线、独立观测 manifest 与边界审查中的实际 build unit、source root、package 和 responsibility 映射确定 Controller/server 落点;模块名和数量可以与模板不同,不补造生成器或脚手架合同。
4
+
5
+ Controller 只调用已登记的 service/use-case seam,保持公开 DTO、私有 DTO、错误脱敏和事务责任的实际映射。批准合同若只允许现有 build unit 内的 engineering-only seam,不得为套用生成式结构新建 client/server/service 模块。映射不清、Controller 直连 Repository、越界路径或业务架构变化均返回 `blocked`。
@@ -16,7 +16,7 @@ Create a self-contained, interactive HTML diagram from a small typed JSON specif
16
16
 
17
17
  When the current repository contains `yss-project.yaml`, these rules override the upstream update and delivery commands below:
18
18
 
19
- - Treat Archify as a conditional specialist. Use it only when the user or the current YSS contract explicitly requires an architecture, workflow, sequence, data-flow, lifecycle, or Mermaid-beautification artifact. A diagram is derived evidence; it never replaces Spec, ADR, OpenAPI, Tactical Design Contract, Slice Implementation Contract, review, or approval evidence.
19
+ - Treat Archify as a conditional specialist. Use it only when the user or the current YSS contract explicitly requires an architecture, workflow, sequence, data-flow, lifecycle, or Mermaid-beautification artifact. A diagram is derived evidence; it never replaces the active profile's architecture contract (such as backend Tactical Design or Frontend Engineering Design), Spec, ADR, OpenAPI, Slice Implementation Contract, review, or approval evidence.
20
20
  - Do not run `scripts/check-update.mjs`. YSS pins the upstream revision in `skills-lock.json`; upgrades happen only through the repository's skill-maintenance workflow.
21
21
  - Validate with the upstream `validate` command, but deliver through the repository-safe wrapper from the repository root:
22
22
 
@@ -16,13 +16,13 @@ description: Use when connecting an existing frontend, backend, fullstack, or ot
16
16
 
17
17
  ## Workflow
18
18
 
19
- 1. 确认当前仓库是 Harness 仓库,读取 `docs/process/implementation-repo-integration.md`。
19
+ 1. 按根 `yss-project.yaml` 确认 `project-instance` 身份并消费根 `CONTEXT.md`,读取 `docs/process/implementation-repo-integration.md`。命中既有 Java/Maven 跨仓交付接入时,先按 `docs/process/delivery-preflight.md` 以已知原始引用准备清单并运行 `scripts/preflight-delivery --input <file> --stage prepare --json`;缺失来源保持缺失,不伪造 scope、批准、生成器或模块事实。预检可在拟初始化目标上列出当前缺项,但不会创建工程或执行输入命令。
20
20
  2. 如果输入是本地路径,只读检查 Git remote、当前分支、目录结构、构建文件和测试脚本。
21
21
  3. 如果输入是远端 URL,优先使用只读 Git 查询。需要完整工作树时:`external-repository` 只能 clone 到临时目录;`git-submodule` 只能通过 `git submodule add` / `git submodule update --init` 在已批准的 `apps/backend/<project>/` 或 `apps/frontend/<project>/` gitlink 挂载点检出,禁止普通 clone 或复制源码进 Harness。
22
22
  4. 识别技术栈、包管理器、CI、测试命令、构建命令、OpenAPI 接入和设计 token 接入。
23
23
  5. 判定实现位置与 `repository_scope`:`external-repository` 记录真实项目根;`harness-apps` 与 `git-submodule` 只能使用 `apps/backend/<project>/` 或 `apps/frontend/<project>/`。`apps/backend/`、`apps/frontend/` 仅为容器,`app/backend/`、`app/frontend/` 及其子路径必须标记为阻断。gitlink(mode `160000`)必须登记为 `git-submodule` 和 `layout_policy: git-submodule-harness-apps`,不得写成 `harness-apps`。必须对照工作树:`git ls-files --stage`、`.gitmodules` 与声明 scope 不一致时阻断;缺少 `git_entry_mode: 160000` 不得把挂载点当普通目录。
24
24
  6. 按 `docs/templates/implementation-repo-registry-template.md` 输出实现仓库登记内容。`git-submodule` 必填 `gitmodules_name`、`gitlink_path`、`git_entry_mode`、`superproject_git_url` 和 `checkout_state`。`harness-apps` / `external-repository` 这些字段填 `不适用`。
25
- 7. 列出 `known_gaps`、人审点、fresh verification 命令和需要回写到 Harness change / Issue / checkpoint 的信息。空 gitlink、detached HEAD、`--force` 覆盖挂载点或缺少递归检出凭据时标记阻断。写入前必须看 `inspectWorkingTreeScope` / `implementationWriteViolation`:只接受对象结果且 `.writable === true` 才可写;字符串、`null` 或 `.writable !== true` 一律不可写。即使已正确登记为 `git-submodule`,空 gitlink 或 detached HEAD 也必须 `.writable === false`,不得当普通目录写文件或脚手架。
25
+ 7. 列出 `known_gaps`、人审点、fresh verification 命令和需要回写到 Harness change / Issue / checkpoint 的信息。命中交付预检时,登记和工程基线补齐后重跑 `prepare`;将结构化诊断的责任来源和恢复入口纳入缺口清单,在初始化或构建前关闭当前阶段阻断。后续阶段证据尚未形成不能被当作本阶段失败;其他技术栈/不涉及该交付协议的接入记录不适用原因,不能冒充后端 v2 正例。空 gitlink、detached HEAD、`--force` 覆盖挂载点或缺少递归检出凭据时标记阻断。写入前必须看 `inspectWorkingTreeScope` / `implementationWriteViolation`:只接受对象结果且 `.writable === true` 才可写;字符串、`null` 或 `.writable !== true` 一律不可写。即使已正确登记为 `git-submodule`,空 gitlink 或 detached HEAD 也必须 `.writable === false`,不得当普通目录写文件或脚手架。
26
26
 
27
27
  ## Baseline Checks
28
28
 
@@ -7,7 +7,7 @@ description: Use when implementing YSS application use cases, transaction bounda
7
7
 
8
8
  ## 架构分流(先执行)
9
9
 
10
- 读取当前合同的 architecture_identity 并与工程基线、仓库登记及 Manifest 核对;再且只读取 `references/profiles/<architecture_profile>.md`。支持的分支为 target-domain-model、layered-mvc-service、mvc-data-analysis-v1;成熟度以注册表为准,不能把 draft 称为受支持。MVC 不执行下文 DDD 专属规则,也不加载其旧分层 guide;组件、安全、批准合同、允许路径及执行证据规则仍共用。
10
+ 读取当前合同的 architecture_identity 并与工程基线、仓库登记及 Manifest 核对;再且只读取 `references/profiles/<architecture_profile>.md`。生成式分支为 target-domain-model、layered-mvc-service、mvc-data-analysis-v1;既有工程分支为 existing-domain-driven-maven、existing-layered-mvc-maven。成熟度以注册表为准,不能把 draft 称为受支持。MVC 不执行下文 DDD 专属规则,也不加载其旧分层 guide;组件、安全、批准合同、允许路径及执行证据规则仍共用。
11
11
 
12
12
  以下 Application / Domain Gateway / Infrastructure / Web module 叙述仅适用于 target-domain-model;MVC 的 service/core/repository/server/client 所有权由所选 Profile 引用定义。
13
13
 
@@ -0,0 +1,5 @@
1
+ # existing-domain-driven-maven
2
+
3
+ 只用于 `source_kind=existing-registration` 且 `architecture_family=domain-driven` 的受支持身份。Application 责任以登记、工程基线、独立观测 manifest 与边界审查的实际 build unit/package 映射为准,不要求生成式 `application` 模块存在。
4
+
5
+ 有批准的 Application 源码写路径时,按实际 use-case seam 组织领域与端口;没有该写路径且技术设计明确为 engineering-only 时,只核验 Web build unit 内的只读 orchestration seam 满足合同,不新建业务 Application、Domain、Gateway 或事务层。任何业务规则、持久化写入、新跨上下文协作或无法解释的责任映射都返回 `new_impacts` 或 `blocked`。
@@ -0,0 +1,5 @@
1
+ # existing-layered-mvc-maven
2
+
3
+ 只用于 `source_kind=existing-registration` 且 `architecture_family=layered-mvc` 的受支持身份。以登记、工程基线、独立观测 manifest 和边界审查中的实际 service/core/use-case build unit、source root 与 package 映射确定 Application 责任;不得要求模板模块名、数量或生成器 manifest。
4
+
5
+ 有批准的 service/core 写路径时在现有公开用例 seam 内实现编排和事务。若 engineering-only 技术设计没有对应写路径,只核验已批准的只读 orchestration seam,不制造 Domain Gateway、业务 service 或持久化层。Controller 直连 Repository、越界路径或责任无法映射时返回 `blocked`。
@@ -20,7 +20,7 @@ description: Use when a YSS vertical slice is entering implementation, spans mul
20
20
  ## 编译循环
21
21
 
22
22
  1. 判断 frontend/backend/API/data/domain/cross-repo 影响,并按 [compiler-contract.yaml](references/compiler-contract.yaml) 把 impact 映射为入口 capability;逐项填写 backend `component_impacts`。
23
- 2. 检查工程存在性和核心/长尾 skill 可用性。
23
+ 2. 按 `docs/process/delivery-preflight.md` 只读检查当前阶段交付前提,再检查工程存在性和核心/长尾 skill 可用性。既有 Java/Maven 工程按 `docs/process/existing-backend-architecture.md` 加载登记、工程基线、独立观测的原始引用与摘要;不伪填生成器或 H2。
24
24
  3. 从 `docs/agents/yss-skill-registry.yaml` 选择一个或多个窄 Recipe,合并 `required_capabilities`;Recipe 不得直接引用 skill。
25
25
  4. 由 capability 解析入口 skill,只递归 `context-required`;`context-conditional` 仅在显式 condition 命中时加载,其他依赖类型只进入原因链,不扩张执行上下文。
26
26
  5. 按“Recipe 声明顺序 → 依赖拓扑 → skill ID”确定性排序,去重 skill 并保留全部原因;冻结 Registry 与编译器合同 SHA-256。
@@ -37,7 +37,7 @@ description: Use when a YSS vertical slice is entering implementation, spans mul
37
37
  - 编译器不得输出 `approved`、`ready-for-agent` 或 `completed`。
38
38
  - Registry、Slice Contract 或编译器合同 schema v1 一律拒绝并给出迁移到 v2 的提示;不自动升级,不提供旧技能名兼容。
39
39
  - `required_capabilities` 与 `required_skills` 必须同时冻结;Registry 或编译器摘要变化后合同立即 `stale`,重新编译后仍须交生命周期重新批准。
40
- - UI 影响缺少正式原型确认、批准且 digest 当前的 Visual Baseline manifest 或当前切片 `case_id` 时,不得路由页面实现。模型必须先读 manifest 与语义引用,再查看对应 PNG;禁止目录 glob 和图片独立猜义。
40
+ - UI 影响按来源分支核验:新设计保持正式原型确认与 Visual Baseline;无 UI 改动才允许 `existing-ui-baseline` v1,并须当前真实基线确认及 `case_id`。任一来源缺少当前批准或摘要绑定时,不得路由页面实现。模型必须先读 manifest 与语义引用,再查看对应 PNG;禁止目录 glob 和图片独立猜义。
41
41
  - Repository/数据模型影响缺少数据架构时,不得路由持久化实现。
42
42
  - 后端技术设计由 `yss-technical-design` 先行组织。消费批准且版本当前的 Technical Design Contract,核对其架构与工程基线一致;DDD 才消费聚合、Gateway 等战术字段并路由 `yss-domain`,MVC 消费用例、分层、规则和事务设计并按 Profile 路由。旧 v1 战术合同只按 DDD 显式兼容读取。无相关影响记录带原因的 `not-applicable`。
43
43
  - API 变化必须回到生命周期 Draft/Review/Freeze;半成品 backend 不得冒充稳定 source of truth。
@@ -3,6 +3,10 @@ backend_architecture:
3
3
  registry_source: docs/agents/yss-skill-registry.yaml
4
4
  identity_schema: docs/process/schemas/backend-architecture-identity.schema.json
5
5
  required_evidence: [engineering_baseline, repository_registration, manifest]
6
+ evidence_loading: original-references-and-raw-sha256
7
+ existing_identity: {schema_version: 2, source_kind: existing-registration, profiles_source: existing_project_profiles}
8
+ generated_identity: preserve-original-generator-and-module-closure
9
+ existing_source_policy: fixed-input-and-approved-bounded-output
6
10
  required_identity_surfaces: [resolution, work_unit, execution_result]
7
11
  family_recipe_selection: explicit-ddd-or-mvc-no-legacy-alias
8
12
  readiness: supported-profile-and-current-identical-evidence
@@ -12,7 +12,12 @@ document_writing:
12
12
  gate_and_status_semantics: unchanged
13
13
 
14
14
  backend_architecture_identity_policy:
15
- source: docs/agents/yss-skill-registry.yaml#architecture_profiles
15
+ source: docs/agents/yss-skill-registry.yaml
16
+ generated_profiles: architecture_profiles
17
+ existing_profiles: existing_project_profiles
18
+ existing_evidence: [repository-registration, engineering-baseline, existing-project-observation]
19
+ evidence_policy: original-ref-digest-and-current-source-verification
20
+ delivery_preflight: scripts/preflight-delivery
16
21
  schema: docs/process/schemas/backend-architecture-identity.schema.json
17
22
  required_surfaces: [engineering-baseline, repository-registration, scaffold-manifest, slice-contract, work-unit, execution-result]
18
23
  agreement: exact-identity-and-digest