create-yss-spec 3.4.10 → 3.5.2

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 (642) hide show
  1. package/README.md +8 -4
  2. package/package.json +1 -1
  3. package/src/api/_sync-service.js +141 -23
  4. package/src/cli/args.js +3 -0
  5. package/src/cli/help.js +14 -2
  6. package/src/cli/index.js +3 -0
  7. package/src/cli/prompts.js +5 -1
  8. package/src/cli/router.js +2 -0
  9. package/src/commands/attach.js +21 -5
  10. package/src/commands/diff.js +1 -0
  11. package/src/commands/doctor.js +1 -0
  12. package/src/commands/init.js +4 -1
  13. package/src/commands/skills.js +253 -0
  14. package/src/commands/sync.js +4 -0
  15. package/src/family-identity.js +2 -2
  16. package/src/template/asset-runtime.js +228 -0
  17. package/src/template/attach-planner.js +1 -1
  18. package/src/template/distribution-runtime.js +165 -0
  19. package/src/template/instance-runtime.js +76 -29
  20. package/src/template/layout-migration.js +160 -0
  21. package/src/template/migration-runtime.js +2 -2
  22. package/src/template/ownership-policy.js +17 -1
  23. package/src/template/prune-planner.js +6 -1
  24. package/src/template/sync-planner.js +4 -1
  25. package/src/template/verification-runtime.js +56 -1
  26. package/src/validation/metadata.js +24 -1
  27. package/template/.agents/rules/yss-ai-skills.md +1 -1
  28. package/template/.agents/skills/.strategic-design-skills-manifest.json +7 -8
  29. package/template/.agents/skills/.yss-skills-manifest.json +2 -2
  30. package/template/.agents/skills/alibaba-java-code-style/SKILL.md +1 -1
  31. package/template/.agents/skills/code-review/SKILL.md +6 -6
  32. package/template/.agents/skills/code-review/references/yss-review-standards.md +1 -1
  33. package/template/.agents/skills/cross-repo-implementation-routing/SKILL.md +2 -2
  34. package/template/.agents/skills/i-have-adhd/SKILL.md +1 -1
  35. package/template/.agents/skills/i-have-adhd/references/yss-adaptation.md +1 -1
  36. package/template/.agents/skills/i-have-adhd/tests/verify-integration.mjs +2 -2
  37. package/template/.agents/skills/implementation-repo-onboarding/SKILL.md +2 -2
  38. package/template/.agents/skills/llm-wiki/references/discover.md +3 -3
  39. package/template/.agents/skills/prototype-review/SKILL.md +4 -4
  40. package/template/.agents/skills/setup-matt-pocock-skills/SKILL.md +10 -10
  41. package/template/.agents/skills/triage/SKILL.md +1 -1
  42. package/template/.agents/skills/yss-application/references/profiles/layered-mvc-service.md +1 -1
  43. package/template/.agents/skills/yss-application/references/profiles/mvc-data-analysis-v1.md +1 -1
  44. package/template/.agents/skills/yss-backend-spec-review/SKILL.md +1 -1
  45. package/template/.agents/skills/yss-backend-spec-review/references/check-inputs.md +1 -1
  46. package/template/.agents/skills/yss-cache/SKILL.md +6 -5
  47. package/template/.agents/skills/yss-cache/references/annotations.md +3 -1
  48. package/template/.agents/skills/yss-cache/references/architecture.md +4 -2
  49. package/template/.agents/skills/yss-cache/references/configuration.md +6 -3
  50. package/template/.agents/skills/yss-cache/references/jetcache.md +21 -0
  51. package/template/.agents/skills/yss-cache/references/redis-fallback.md +5 -3
  52. package/template/.agents/skills/yss-cache/references/verification.md +10 -4
  53. package/template/.agents/skills/yss-cache/scripts/verify-cache-component.sh +26 -20
  54. package/template/.agents/skills/yss-ddd-scaffold-generator/SKILL.md +2 -2
  55. package/template/.agents/skills/yss-ddd-scaffold-generator/scripts/generate_scaffold.mjs +1 -1
  56. package/template/.agents/skills/yss-design-system/SKILL.md +10 -10
  57. package/template/.agents/skills/yss-design-system/references/design-qa-theme.md +3 -3
  58. package/template/.agents/skills/yss-design-system/references/design-system.md +3 -3
  59. package/template/.agents/skills/yss-distributed-id/SKILL.md +14 -58
  60. package/template/.agents/skills/yss-distributed-id/agents/openai.yaml +2 -2
  61. package/template/.agents/skills/yss-distributed-id/references/README.md +11 -47
  62. package/template/.agents/skills/yss-exception/SKILL.md +1 -1
  63. package/template/.agents/skills/yss-frontend-scaffold-generator/SKILL.md +2 -2
  64. package/template/.agents/skills/yss-frontend-scaffold-generator/scripts/generate_scaffold.mjs +1 -1
  65. package/template/.agents/skills/yss-frontend-scaffold-generator/scripts/refresh_baseline.mjs +2 -2
  66. package/template/.agents/skills/yss-implementation-contract-compiler/SKILL.md +9 -9
  67. package/template/.agents/skills/yss-implementation-contract-compiler/references/boundaries.md +1 -1
  68. package/template/.agents/skills/yss-implementation-contract-compiler/references/compiler-contract.yaml +9 -9
  69. package/template/.agents/skills/yss-implementation-contract-compiler/references/slice-implementation-contract-v2.md +3 -3
  70. package/template/.agents/skills/yss-implementation-contract-compiler/references/slice-implementation-contract.md +1 -1
  71. package/template/.agents/skills/yss-implementation-contract-compiler/references/strategic-handoff-routing.md +1 -1
  72. package/template/.agents/skills/yss-layered-mvc-scaffold-generator/SKILL.md +2 -2
  73. package/template/.agents/skills/yss-layered-mvc-scaffold-generator/scripts/data-analysis-profile.mjs +5 -5
  74. package/template/.agents/skills/yss-layered-mvc-scaffold-generator/scripts/generate_scaffold.mjs +2 -2
  75. package/template/.agents/skills/yss-layered-mvc-scaffold-generator/scripts/scaffold-generator.test.mjs +42 -0
  76. package/template/.agents/skills/yss-mybatis/SKILL.md +14 -2
  77. package/template/.agents/skills/yss-openapi-draft-review/SKILL.md +2 -2
  78. package/template/.agents/skills/yss-openapi-governance/SKILL.md +7 -7
  79. package/template/.agents/skills/yss-product-lifecycle/SKILL.md +11 -11
  80. package/template/.agents/skills/yss-product-lifecycle/references/matt-yss-adapter.md +5 -5
  81. package/template/.agents/skills/yss-product-lifecycle/references/orchestration-contract.yaml +70 -47
  82. package/template/.agents/skills/yss-product-lifecycle/references/orchestration.md +22 -14
  83. package/template/.agents/skills/yss-product-lifecycle/references/request-triage.md +2 -0
  84. package/template/.agents/skills/yss-product-lifecycle/references/state-model.md +11 -11
  85. package/template/.agents/skills/yss-product-lifecycle/references/user-decisions.md +2 -2
  86. package/template/.agents/skills/yss-prototype-stage/SKILL.md +9 -9
  87. package/template/.agents/skills/yss-prototype-stage/references/existing-ui-entry.md +1 -1
  88. package/template/.agents/skills/yss-prototype-stage/scripts/build-antd-prototype.mjs +1 -1
  89. package/template/.agents/skills/yss-prototype-stage/scripts/offline-html.mjs +3 -3
  90. package/template/.agents/skills/yss-prototype-stage/tests/browser-smoke.mjs +2 -2
  91. package/template/.agents/skills/yss-prototype-stage/tests/run-scenarios.mjs +4 -4
  92. package/template/.agents/skills/yss-prototype-stage/tests/workbench-smoke.mjs +1 -1
  93. package/template/.agents/skills/yss-repository/SKILL.md +3 -2
  94. package/template/.agents/skills/yss-repository/references/profiles/layered-mvc-service.md +1 -1
  95. package/template/.agents/skills/yss-repository/references/profiles/mvc-data-analysis-v1.md +1 -1
  96. package/template/.agents/skills/yss-repository/tests/profile-routing.test.mjs +2 -2
  97. package/template/.agents/skills/yss-research/SKILL.md +2 -2
  98. package/template/.agents/skills/yss-skill-source-index-refresh/references/backend-component-platform-compatibility.md +1 -1
  99. package/template/.agents/skills/yss-stage-decision/SKILL.md +5 -5
  100. package/template/.agents/skills/yss-stage-decision/references/domain-strategy-contract.md +1 -1
  101. package/template/.agents/skills/yss-stage-decision/references/strategic-handoff-routing.md +1 -1
  102. package/template/.agents/skills/yss-tactical-design/SKILL.md +2 -2
  103. package/template/.agents/skills/yss-tactical-design/references/strategic-handoff-routing.md +1 -1
  104. package/template/.agents/skills/yss-tactical-design/references/tactical-design-contract.md +1 -1
  105. package/template/.agents/skills/yss-technical-design/SKILL.md +6 -6
  106. package/template/.agents/skills/yss-technical-design/references/technical-design-contract.md +1 -1
  107. package/template/.agents/skills/yss-ui/SKILL.md +1 -1
  108. package/template/.agents/skills/yss-up-springboot3/SKILL.md +1 -1
  109. package/template/.agents/skills/yss-web-controller/SKILL.md +1 -1
  110. package/template/.agents/skills/yss-web-controller/references/profiles/layered-mvc-service.md +1 -1
  111. package/template/.codex/skills/alibaba-java-code-style/SKILL.md +1 -1
  112. package/template/.codex/skills/code-review/SKILL.md +6 -6
  113. package/template/.codex/skills/code-review/references/yss-review-standards.md +1 -1
  114. package/template/.codex/skills/cross-repo-implementation-routing/SKILL.md +2 -2
  115. package/template/.codex/skills/i-have-adhd/SKILL.md +1 -1
  116. package/template/.codex/skills/i-have-adhd/references/yss-adaptation.md +1 -1
  117. package/template/.codex/skills/i-have-adhd/tests/verify-integration.mjs +2 -2
  118. package/template/.codex/skills/implementation-repo-onboarding/SKILL.md +2 -2
  119. package/template/.codex/skills/llm-wiki/references/discover.md +3 -3
  120. package/template/.codex/skills/prototype-review/SKILL.md +4 -4
  121. package/template/.codex/skills/setup-matt-pocock-skills/SKILL.md +10 -10
  122. package/template/.codex/skills/triage/SKILL.md +1 -1
  123. package/template/.codex/skills/yss-application/references/profiles/layered-mvc-service.md +1 -1
  124. package/template/.codex/skills/yss-application/references/profiles/mvc-data-analysis-v1.md +1 -1
  125. package/template/.codex/skills/yss-backend-spec-review/SKILL.md +1 -1
  126. package/template/.codex/skills/yss-backend-spec-review/references/check-inputs.md +1 -1
  127. package/template/.codex/skills/yss-cache/SKILL.md +6 -5
  128. package/template/.codex/skills/yss-cache/references/annotations.md +3 -1
  129. package/template/.codex/skills/yss-cache/references/architecture.md +4 -2
  130. package/template/.codex/skills/yss-cache/references/configuration.md +6 -3
  131. package/template/.codex/skills/yss-cache/references/jetcache.md +21 -0
  132. package/template/.codex/skills/yss-cache/references/redis-fallback.md +5 -3
  133. package/template/.codex/skills/yss-cache/references/verification.md +10 -4
  134. package/template/.codex/skills/yss-cache/scripts/verify-cache-component.sh +26 -20
  135. package/template/.codex/skills/yss-ddd-scaffold-generator/SKILL.md +2 -2
  136. package/template/.codex/skills/yss-ddd-scaffold-generator/scripts/generate_scaffold.mjs +1 -1
  137. package/template/.codex/skills/yss-design-system/SKILL.md +10 -10
  138. package/template/.codex/skills/yss-design-system/references/design-qa-theme.md +3 -3
  139. package/template/.codex/skills/yss-design-system/references/design-system.md +3 -3
  140. package/template/.codex/skills/yss-distributed-id/SKILL.md +14 -58
  141. package/template/.codex/skills/yss-distributed-id/agents/openai.yaml +2 -2
  142. package/template/.codex/skills/yss-distributed-id/references/README.md +11 -47
  143. package/template/.codex/skills/yss-exception/SKILL.md +1 -1
  144. package/template/.codex/skills/yss-frontend-scaffold-generator/SKILL.md +2 -2
  145. package/template/.codex/skills/yss-frontend-scaffold-generator/scripts/generate_scaffold.mjs +1 -1
  146. package/template/.codex/skills/yss-frontend-scaffold-generator/scripts/refresh_baseline.mjs +2 -2
  147. package/template/.codex/skills/yss-implementation-contract-compiler/SKILL.md +9 -9
  148. package/template/.codex/skills/yss-implementation-contract-compiler/references/boundaries.md +1 -1
  149. package/template/.codex/skills/yss-implementation-contract-compiler/references/compiler-contract.yaml +9 -9
  150. package/template/.codex/skills/yss-implementation-contract-compiler/references/slice-implementation-contract-v2.md +3 -3
  151. package/template/.codex/skills/yss-implementation-contract-compiler/references/slice-implementation-contract.md +1 -1
  152. package/template/.codex/skills/yss-implementation-contract-compiler/references/strategic-handoff-routing.md +1 -1
  153. package/template/.codex/skills/yss-layered-mvc-scaffold-generator/SKILL.md +2 -2
  154. package/template/.codex/skills/yss-layered-mvc-scaffold-generator/scripts/data-analysis-profile.mjs +5 -5
  155. package/template/.codex/skills/yss-layered-mvc-scaffold-generator/scripts/generate_scaffold.mjs +2 -2
  156. package/template/.codex/skills/yss-layered-mvc-scaffold-generator/scripts/scaffold-generator.test.mjs +42 -0
  157. package/template/.codex/skills/yss-mybatis/SKILL.md +14 -2
  158. package/template/.codex/skills/yss-openapi-draft-review/SKILL.md +2 -2
  159. package/template/.codex/skills/yss-openapi-governance/SKILL.md +7 -7
  160. package/template/.codex/skills/yss-product-lifecycle/SKILL.md +11 -11
  161. package/template/.codex/skills/yss-product-lifecycle/references/matt-yss-adapter.md +5 -5
  162. package/template/.codex/skills/yss-product-lifecycle/references/orchestration-contract.yaml +70 -47
  163. package/template/.codex/skills/yss-product-lifecycle/references/orchestration.md +22 -14
  164. package/template/.codex/skills/yss-product-lifecycle/references/request-triage.md +2 -0
  165. package/template/.codex/skills/yss-product-lifecycle/references/state-model.md +11 -11
  166. package/template/.codex/skills/yss-product-lifecycle/references/user-decisions.md +2 -2
  167. package/template/.codex/skills/yss-prototype-stage/SKILL.md +9 -9
  168. package/template/.codex/skills/yss-prototype-stage/references/existing-ui-entry.md +1 -1
  169. package/template/.codex/skills/yss-prototype-stage/scripts/build-antd-prototype.mjs +1 -1
  170. package/template/.codex/skills/yss-prototype-stage/scripts/offline-html.mjs +3 -3
  171. package/template/.codex/skills/yss-prototype-stage/tests/browser-smoke.mjs +2 -2
  172. package/template/.codex/skills/yss-prototype-stage/tests/run-scenarios.mjs +4 -4
  173. package/template/.codex/skills/yss-prototype-stage/tests/workbench-smoke.mjs +1 -1
  174. package/template/.codex/skills/yss-repository/SKILL.md +3 -2
  175. package/template/.codex/skills/yss-repository/references/profiles/layered-mvc-service.md +1 -1
  176. package/template/.codex/skills/yss-repository/references/profiles/mvc-data-analysis-v1.md +1 -1
  177. package/template/.codex/skills/yss-repository/tests/profile-routing.test.mjs +2 -2
  178. package/template/.codex/skills/yss-research/SKILL.md +2 -2
  179. package/template/.codex/skills/yss-skill-source-index-refresh/references/backend-component-platform-compatibility.md +1 -1
  180. package/template/.codex/skills/yss-stage-decision/SKILL.md +5 -5
  181. package/template/.codex/skills/yss-stage-decision/references/domain-strategy-contract.md +1 -1
  182. package/template/.codex/skills/yss-stage-decision/references/strategic-handoff-routing.md +1 -1
  183. package/template/.codex/skills/yss-tactical-design/SKILL.md +2 -2
  184. package/template/.codex/skills/yss-tactical-design/references/strategic-handoff-routing.md +1 -1
  185. package/template/.codex/skills/yss-tactical-design/references/tactical-design-contract.md +1 -1
  186. package/template/.codex/skills/yss-technical-design/SKILL.md +6 -6
  187. package/template/.codex/skills/yss-technical-design/references/technical-design-contract.md +1 -1
  188. package/template/.codex/skills/yss-ui/SKILL.md +1 -1
  189. package/template/.codex/skills/yss-up-springboot3/SKILL.md +1 -1
  190. package/template/.codex/skills/yss-web-controller/SKILL.md +1 -1
  191. package/template/.codex/skills/yss-web-controller/references/profiles/layered-mvc-service.md +1 -1
  192. package/template/.cursor/skills/alibaba-java-code-style/SKILL.md +1 -1
  193. package/template/.cursor/skills/code-review/SKILL.md +6 -6
  194. package/template/.cursor/skills/code-review/references/yss-review-standards.md +1 -1
  195. package/template/.cursor/skills/cross-repo-implementation-routing/SKILL.md +2 -2
  196. package/template/.cursor/skills/i-have-adhd/SKILL.md +1 -1
  197. package/template/.cursor/skills/i-have-adhd/references/yss-adaptation.md +1 -1
  198. package/template/.cursor/skills/i-have-adhd/tests/verify-integration.mjs +2 -2
  199. package/template/.cursor/skills/implementation-repo-onboarding/SKILL.md +2 -2
  200. package/template/.cursor/skills/llm-wiki/references/discover.md +3 -3
  201. package/template/.cursor/skills/prototype-review/SKILL.md +4 -4
  202. package/template/.cursor/skills/setup-matt-pocock-skills/SKILL.md +10 -10
  203. package/template/.cursor/skills/triage/SKILL.md +1 -1
  204. package/template/.cursor/skills/yss-application/references/profiles/layered-mvc-service.md +1 -1
  205. package/template/.cursor/skills/yss-application/references/profiles/mvc-data-analysis-v1.md +1 -1
  206. package/template/.cursor/skills/yss-backend-spec-review/SKILL.md +1 -1
  207. package/template/.cursor/skills/yss-backend-spec-review/references/check-inputs.md +1 -1
  208. package/template/.cursor/skills/yss-cache/SKILL.md +6 -5
  209. package/template/.cursor/skills/yss-cache/references/annotations.md +3 -1
  210. package/template/.cursor/skills/yss-cache/references/architecture.md +4 -2
  211. package/template/.cursor/skills/yss-cache/references/configuration.md +6 -3
  212. package/template/.cursor/skills/yss-cache/references/jetcache.md +21 -0
  213. package/template/.cursor/skills/yss-cache/references/redis-fallback.md +5 -3
  214. package/template/.cursor/skills/yss-cache/references/verification.md +10 -4
  215. package/template/.cursor/skills/yss-cache/scripts/verify-cache-component.sh +26 -20
  216. package/template/.cursor/skills/yss-ddd-scaffold-generator/SKILL.md +2 -2
  217. package/template/.cursor/skills/yss-ddd-scaffold-generator/scripts/generate_scaffold.mjs +1 -1
  218. package/template/.cursor/skills/yss-design-system/SKILL.md +10 -10
  219. package/template/.cursor/skills/yss-design-system/references/design-qa-theme.md +3 -3
  220. package/template/.cursor/skills/yss-design-system/references/design-system.md +3 -3
  221. package/template/.cursor/skills/yss-distributed-id/SKILL.md +14 -58
  222. package/template/.cursor/skills/yss-distributed-id/agents/openai.yaml +2 -2
  223. package/template/.cursor/skills/yss-distributed-id/references/README.md +11 -47
  224. package/template/.cursor/skills/yss-exception/SKILL.md +1 -1
  225. package/template/.cursor/skills/yss-frontend-scaffold-generator/SKILL.md +2 -2
  226. package/template/.cursor/skills/yss-frontend-scaffold-generator/scripts/generate_scaffold.mjs +1 -1
  227. package/template/.cursor/skills/yss-frontend-scaffold-generator/scripts/refresh_baseline.mjs +2 -2
  228. package/template/.cursor/skills/yss-implementation-contract-compiler/SKILL.md +9 -9
  229. package/template/.cursor/skills/yss-implementation-contract-compiler/references/boundaries.md +1 -1
  230. package/template/.cursor/skills/yss-implementation-contract-compiler/references/compiler-contract.yaml +9 -9
  231. package/template/.cursor/skills/yss-implementation-contract-compiler/references/slice-implementation-contract-v2.md +3 -3
  232. package/template/.cursor/skills/yss-implementation-contract-compiler/references/slice-implementation-contract.md +1 -1
  233. package/template/.cursor/skills/yss-implementation-contract-compiler/references/strategic-handoff-routing.md +1 -1
  234. package/template/.cursor/skills/yss-layered-mvc-scaffold-generator/SKILL.md +2 -2
  235. package/template/.cursor/skills/yss-layered-mvc-scaffold-generator/scripts/data-analysis-profile.mjs +5 -5
  236. package/template/.cursor/skills/yss-layered-mvc-scaffold-generator/scripts/generate_scaffold.mjs +2 -2
  237. package/template/.cursor/skills/yss-layered-mvc-scaffold-generator/scripts/scaffold-generator.test.mjs +42 -0
  238. package/template/.cursor/skills/yss-mybatis/SKILL.md +14 -2
  239. package/template/.cursor/skills/yss-openapi-draft-review/SKILL.md +2 -2
  240. package/template/.cursor/skills/yss-openapi-governance/SKILL.md +7 -7
  241. package/template/.cursor/skills/yss-product-lifecycle/SKILL.md +11 -11
  242. package/template/.cursor/skills/yss-product-lifecycle/references/matt-yss-adapter.md +5 -5
  243. package/template/.cursor/skills/yss-product-lifecycle/references/orchestration-contract.yaml +70 -47
  244. package/template/.cursor/skills/yss-product-lifecycle/references/orchestration.md +22 -14
  245. package/template/.cursor/skills/yss-product-lifecycle/references/request-triage.md +2 -0
  246. package/template/.cursor/skills/yss-product-lifecycle/references/state-model.md +11 -11
  247. package/template/.cursor/skills/yss-product-lifecycle/references/user-decisions.md +2 -2
  248. package/template/.cursor/skills/yss-prototype-stage/SKILL.md +9 -9
  249. package/template/.cursor/skills/yss-prototype-stage/references/existing-ui-entry.md +1 -1
  250. package/template/.cursor/skills/yss-prototype-stage/scripts/build-antd-prototype.mjs +1 -1
  251. package/template/.cursor/skills/yss-prototype-stage/scripts/offline-html.mjs +3 -3
  252. package/template/.cursor/skills/yss-prototype-stage/tests/browser-smoke.mjs +2 -2
  253. package/template/.cursor/skills/yss-prototype-stage/tests/run-scenarios.mjs +4 -4
  254. package/template/.cursor/skills/yss-prototype-stage/tests/workbench-smoke.mjs +1 -1
  255. package/template/.cursor/skills/yss-repository/SKILL.md +3 -2
  256. package/template/.cursor/skills/yss-repository/references/profiles/layered-mvc-service.md +1 -1
  257. package/template/.cursor/skills/yss-repository/references/profiles/mvc-data-analysis-v1.md +1 -1
  258. package/template/.cursor/skills/yss-repository/tests/profile-routing.test.mjs +2 -2
  259. package/template/.cursor/skills/yss-research/SKILL.md +2 -2
  260. package/template/.cursor/skills/yss-skill-source-index-refresh/references/backend-component-platform-compatibility.md +1 -1
  261. package/template/.cursor/skills/yss-stage-decision/SKILL.md +5 -5
  262. package/template/.cursor/skills/yss-stage-decision/references/domain-strategy-contract.md +1 -1
  263. package/template/.cursor/skills/yss-stage-decision/references/strategic-handoff-routing.md +1 -1
  264. package/template/.cursor/skills/yss-tactical-design/SKILL.md +2 -2
  265. package/template/.cursor/skills/yss-tactical-design/references/strategic-handoff-routing.md +1 -1
  266. package/template/.cursor/skills/yss-tactical-design/references/tactical-design-contract.md +1 -1
  267. package/template/.cursor/skills/yss-technical-design/SKILL.md +6 -6
  268. package/template/.cursor/skills/yss-technical-design/references/technical-design-contract.md +1 -1
  269. package/template/.cursor/skills/yss-ui/SKILL.md +1 -1
  270. package/template/.cursor/skills/yss-up-springboot3/SKILL.md +1 -1
  271. package/template/.cursor/skills/yss-web-controller/SKILL.md +1 -1
  272. package/template/.cursor/skills/yss-web-controller/references/profiles/layered-mvc-service.md +1 -1
  273. package/template/.cursorrules +1 -1
  274. package/template/.pi/skills/alibaba-java-code-style/SKILL.md +1 -1
  275. package/template/.pi/skills/code-review/SKILL.md +6 -6
  276. package/template/.pi/skills/code-review/references/yss-review-standards.md +1 -1
  277. package/template/.pi/skills/cross-repo-implementation-routing/SKILL.md +2 -2
  278. package/template/.pi/skills/i-have-adhd/SKILL.md +1 -1
  279. package/template/.pi/skills/i-have-adhd/references/yss-adaptation.md +1 -1
  280. package/template/.pi/skills/i-have-adhd/tests/verify-integration.mjs +2 -2
  281. package/template/.pi/skills/implementation-repo-onboarding/SKILL.md +2 -2
  282. package/template/.pi/skills/llm-wiki/references/discover.md +3 -3
  283. package/template/.pi/skills/prototype-review/SKILL.md +4 -4
  284. package/template/.pi/skills/setup-matt-pocock-skills/SKILL.md +10 -10
  285. package/template/.pi/skills/triage/SKILL.md +1 -1
  286. package/template/.pi/skills/yss-application/references/profiles/layered-mvc-service.md +1 -1
  287. package/template/.pi/skills/yss-application/references/profiles/mvc-data-analysis-v1.md +1 -1
  288. package/template/.pi/skills/yss-backend-spec-review/SKILL.md +1 -1
  289. package/template/.pi/skills/yss-backend-spec-review/references/check-inputs.md +1 -1
  290. package/template/.pi/skills/yss-cache/SKILL.md +6 -5
  291. package/template/.pi/skills/yss-cache/references/annotations.md +3 -1
  292. package/template/.pi/skills/yss-cache/references/architecture.md +4 -2
  293. package/template/.pi/skills/yss-cache/references/configuration.md +6 -3
  294. package/template/.pi/skills/yss-cache/references/jetcache.md +21 -0
  295. package/template/.pi/skills/yss-cache/references/redis-fallback.md +5 -3
  296. package/template/.pi/skills/yss-cache/references/verification.md +10 -4
  297. package/template/.pi/skills/yss-cache/scripts/verify-cache-component.sh +26 -20
  298. package/template/.pi/skills/yss-ddd-scaffold-generator/SKILL.md +2 -2
  299. package/template/.pi/skills/yss-ddd-scaffold-generator/scripts/generate_scaffold.mjs +1 -1
  300. package/template/.pi/skills/yss-design-system/SKILL.md +10 -10
  301. package/template/.pi/skills/yss-design-system/references/design-qa-theme.md +3 -3
  302. package/template/.pi/skills/yss-design-system/references/design-system.md +3 -3
  303. package/template/.pi/skills/yss-distributed-id/SKILL.md +14 -58
  304. package/template/.pi/skills/yss-distributed-id/agents/openai.yaml +2 -2
  305. package/template/.pi/skills/yss-distributed-id/references/README.md +11 -47
  306. package/template/.pi/skills/yss-exception/SKILL.md +1 -1
  307. package/template/.pi/skills/yss-frontend-scaffold-generator/SKILL.md +2 -2
  308. package/template/.pi/skills/yss-frontend-scaffold-generator/scripts/generate_scaffold.mjs +1 -1
  309. package/template/.pi/skills/yss-frontend-scaffold-generator/scripts/refresh_baseline.mjs +2 -2
  310. package/template/.pi/skills/yss-implementation-contract-compiler/SKILL.md +9 -9
  311. package/template/.pi/skills/yss-implementation-contract-compiler/references/boundaries.md +1 -1
  312. package/template/.pi/skills/yss-implementation-contract-compiler/references/compiler-contract.yaml +9 -9
  313. package/template/.pi/skills/yss-implementation-contract-compiler/references/slice-implementation-contract-v2.md +3 -3
  314. package/template/.pi/skills/yss-implementation-contract-compiler/references/slice-implementation-contract.md +1 -1
  315. package/template/.pi/skills/yss-implementation-contract-compiler/references/strategic-handoff-routing.md +1 -1
  316. package/template/.pi/skills/yss-layered-mvc-scaffold-generator/SKILL.md +2 -2
  317. package/template/.pi/skills/yss-layered-mvc-scaffold-generator/scripts/data-analysis-profile.mjs +5 -5
  318. package/template/.pi/skills/yss-layered-mvc-scaffold-generator/scripts/generate_scaffold.mjs +2 -2
  319. package/template/.pi/skills/yss-layered-mvc-scaffold-generator/scripts/scaffold-generator.test.mjs +42 -0
  320. package/template/.pi/skills/yss-mybatis/SKILL.md +14 -2
  321. package/template/.pi/skills/yss-openapi-draft-review/SKILL.md +2 -2
  322. package/template/.pi/skills/yss-openapi-governance/SKILL.md +7 -7
  323. package/template/.pi/skills/yss-product-lifecycle/SKILL.md +11 -11
  324. package/template/.pi/skills/yss-product-lifecycle/references/matt-yss-adapter.md +5 -5
  325. package/template/.pi/skills/yss-product-lifecycle/references/orchestration-contract.yaml +70 -47
  326. package/template/.pi/skills/yss-product-lifecycle/references/orchestration.md +22 -14
  327. package/template/.pi/skills/yss-product-lifecycle/references/request-triage.md +2 -0
  328. package/template/.pi/skills/yss-product-lifecycle/references/state-model.md +11 -11
  329. package/template/.pi/skills/yss-product-lifecycle/references/user-decisions.md +2 -2
  330. package/template/.pi/skills/yss-prototype-stage/SKILL.md +9 -9
  331. package/template/.pi/skills/yss-prototype-stage/references/existing-ui-entry.md +1 -1
  332. package/template/.pi/skills/yss-prototype-stage/scripts/build-antd-prototype.mjs +1 -1
  333. package/template/.pi/skills/yss-prototype-stage/scripts/offline-html.mjs +3 -3
  334. package/template/.pi/skills/yss-prototype-stage/tests/browser-smoke.mjs +2 -2
  335. package/template/.pi/skills/yss-prototype-stage/tests/run-scenarios.mjs +4 -4
  336. package/template/.pi/skills/yss-prototype-stage/tests/workbench-smoke.mjs +1 -1
  337. package/template/.pi/skills/yss-repository/SKILL.md +3 -2
  338. package/template/.pi/skills/yss-repository/references/profiles/layered-mvc-service.md +1 -1
  339. package/template/.pi/skills/yss-repository/references/profiles/mvc-data-analysis-v1.md +1 -1
  340. package/template/.pi/skills/yss-repository/tests/profile-routing.test.mjs +2 -2
  341. package/template/.pi/skills/yss-research/SKILL.md +2 -2
  342. package/template/.pi/skills/yss-skill-source-index-refresh/references/backend-component-platform-compatibility.md +1 -1
  343. package/template/.pi/skills/yss-stage-decision/SKILL.md +5 -5
  344. package/template/.pi/skills/yss-stage-decision/references/domain-strategy-contract.md +1 -1
  345. package/template/.pi/skills/yss-stage-decision/references/strategic-handoff-routing.md +1 -1
  346. package/template/.pi/skills/yss-tactical-design/SKILL.md +2 -2
  347. package/template/.pi/skills/yss-tactical-design/references/strategic-handoff-routing.md +1 -1
  348. package/template/.pi/skills/yss-tactical-design/references/tactical-design-contract.md +1 -1
  349. package/template/.pi/skills/yss-technical-design/SKILL.md +6 -6
  350. package/template/.pi/skills/yss-technical-design/references/technical-design-contract.md +1 -1
  351. package/template/.pi/skills/yss-ui/SKILL.md +1 -1
  352. package/template/.pi/skills/yss-up-springboot3/SKILL.md +1 -1
  353. package/template/.pi/skills/yss-web-controller/SKILL.md +1 -1
  354. package/template/.pi/skills/yss-web-controller/references/profiles/layered-mvc-service.md +1 -1
  355. package/template/{docs → .template-spec}/adr/README.md +1 -1
  356. package/template/{docs → .template-spec}/agents/README.md +1 -1
  357. package/template/{docs → .template-spec}/agents/backend-architecture-profiles.md +2 -2
  358. package/template/{docs → .template-spec}/agents/digital-human-roles.md +6 -6
  359. package/template/{docs → .template-spec}/agents/digital-human-roles.yaml +5 -5
  360. package/template/{docs → .template-spec}/agents/gitlab-workflow-skills.md +2 -2
  361. package/template/{docs → .template-spec}/agents/issue-tracker.md +1 -1
  362. package/template/{docs → .template-spec}/agents/skill-migrations.md +6 -2
  363. package/template/{docs → .template-spec}/agents/triage-labels.md +1 -1
  364. package/template/{docs → .template-spec}/agents/yss-skill-registry.yaml +9 -8
  365. package/template/{docs → .template-spec}/architecture/README.md +3 -3
  366. package/template/{docs → .template-spec}/architecture/templates/tech-design-template.md +3 -1
  367. package/template/{docs → .template-spec}/design/README.md +12 -12
  368. package/template/{docs → .template-spec}/design/design.md +20 -20
  369. package/template/{docs/design/templates/interaction-spec-template.md → .template-spec/design/templates/examples/model-publishing-interaction.example.md} +6 -4
  370. package/template/{docs/design/templates/state-matrix-template.md → .template-spec/design/templates/examples/model-publishing-state-matrix.example.md} +3 -1
  371. package/template/.template-spec/design/templates/interaction-spec-template.md +61 -0
  372. package/template/{docs → .template-spec}/design/templates/product-overview-design-template.md +11 -11
  373. package/template/{docs → .template-spec}/design/templates/prototype-evidence-template.yaml +4 -4
  374. package/template/{docs → .template-spec}/design/templates/prototype-review-checklist.md +1 -1
  375. package/template/.template-spec/design/templates/state-matrix-template.md +29 -0
  376. package/template/.template-spec/design/tokens/.design-md-projection.json +13 -0
  377. package/template/{docs → .template-spec}/engineering/backend-platforms.md +1 -1
  378. package/template/{docs → .template-spec}/plan/entry-review.md +8 -4
  379. package/template/{docs → .template-spec}/plan/templates/plan-template.md +1 -1
  380. package/template/{docs → .template-spec}/process/contract-reading.md +1 -1
  381. package/template/{docs → .template-spec}/process/lifecycle-artifact-map.md +5 -5
  382. package/template/.template-spec/process/lifecycle-registry-baseline.json +253 -0
  383. package/template/{docs → .template-spec}/process/lifecycle-registry.yaml +19 -12
  384. package/template/{docs → .template-spec}/process/plan-migration.md +1 -1
  385. package/template/{docs → .template-spec}/process/schemas/digital-human-task-package.schema.json +14 -1
  386. package/template/{docs → .template-spec}/process/schemas/lifecycle-checkpoint.schema.json +15 -0
  387. package/template/{docs → .template-spec}/process/schemas/lifecycle-registry.schema.json +1 -1
  388. package/template/{docs → .template-spec}/process/schemas/strategic-design-handoff-v3.schema.json +1 -1
  389. package/template/{docs → .template-spec}/process/schemas/strategic-design-handoff-v4.schema.json +1 -1
  390. package/template/{docs → .template-spec}/process/schemas/strategic-design-handoff-v5.schema.json +1 -1
  391. package/template/{docs → .template-spec}/process/schemas/strategic-design-handoff.schema.json +1 -1
  392. package/template/{docs → .template-spec}/process/stage-tracking.md +1 -1
  393. package/template/{docs → .template-spec}/process/subagent-collaboration.md +2 -2
  394. package/template/{docs → .template-spec}/templates/build-architecture-checklist-template.md +2 -2
  395. package/template/{docs → .template-spec}/templates/digital-human-runtime-profile-template.md +2 -2
  396. package/template/{docs → .template-spec}/templates/grok-bot-profile-template.md +1 -1
  397. package/template/{docs → .template-spec}/templates/local-parent-ticket-template.md +1 -1
  398. package/template/.template-spec/templates/release-note-template.md +29 -0
  399. package/template/.template-spec/templates/retro-report-template.md +24 -0
  400. package/template/{docs → .template-spec}/templates/subagent-task-package-template.md +3 -3
  401. package/template/.template-spec/templates/verification-record-template.md +64 -0
  402. package/template/{docs → .template-spec}/templates/vertical-slice-ticket-template.md +5 -10
  403. package/template/{docs → .template-spec}/user-guide//347/224/250/346/210/267/346/211/213/345/206/214.md +1 -1
  404. package/template/{docs → .template-spec}/user-guide//347/224/250/346/210/267/346/211/213/345/206/214/347/264/242/345/274/225.md +4 -4
  405. package/template/AGENTS.md +12 -12
  406. package/template/CONTEXT.md +3 -3
  407. package/template/README.md +22 -25
  408. package/template/scripts/backend-delivery +1 -1
  409. package/template/scripts/design-md +2 -0
  410. package/template/scripts/lib/api-contract-decision.mjs +1 -1
  411. package/template/scripts/lib/approved-execution-context.mjs +5 -5
  412. package/template/scripts/lib/backend-delivery.mjs +4 -4
  413. package/template/scripts/lib/backend-platform.mjs +1 -1
  414. package/template/scripts/lib/backend-review.mjs +1 -1
  415. package/template/scripts/lib/backend-scaffold-prerequisites.mjs +1 -1
  416. package/template/scripts/lib/backend-standards-coverage.mjs +2 -2
  417. package/template/scripts/lib/context-reconciliation.mjs +1 -1
  418. package/template/scripts/lib/contract-views.mjs +9 -9
  419. package/template/scripts/lib/delivery-preflight.mjs +6 -6
  420. package/template/scripts/lib/design-md.mjs +230 -0
  421. package/template/scripts/lib/digital-human-roles.mjs +2 -2
  422. package/template/scripts/lib/existing-backend-architecture.mjs +1 -1
  423. package/template/scripts/lib/existing-ui-baseline.mjs +1 -1
  424. package/template/scripts/lib/frontend-delivery.mjs +2 -2
  425. package/template/scripts/lib/governance-layout.mjs +74 -0
  426. package/template/scripts/lib/harness-execution-scope.mjs +2 -2
  427. package/template/scripts/lib/lifecycle-context-query.mjs +11 -3
  428. package/template/scripts/lib/lifecycle-registry.mjs +46 -7
  429. package/template/scripts/lib/lifecycle-status.mjs +111 -0
  430. package/template/scripts/lib/lifecycle-transition.mjs +71 -10
  431. package/template/scripts/lib/openapi-draft-validation.mjs +1 -1
  432. package/template/scripts/lib/plan-spec-entry-view.mjs +48 -0
  433. package/template/scripts/lib/plan-spec-entry.mjs +3 -3
  434. package/template/scripts/lib/skill-registry.mjs +16 -9
  435. package/template/scripts/lib/skill-supply-chain.mjs +34 -15
  436. package/template/scripts/lib/slice-contract-preparation.mjs +3 -3
  437. package/template/scripts/lib/slice-contract.mjs +1 -1
  438. package/template/scripts/lib/slice-repositories.mjs +1 -1
  439. package/template/scripts/lib/slice-task-package.mjs +3 -3
  440. package/template/scripts/lib/stage-tracking-migration.mjs +2 -2
  441. package/template/scripts/lib/stage-tracking.mjs +5 -5
  442. package/template/scripts/lib/strategic-feedback.mjs +2 -2
  443. package/template/scripts/lib/strategic-handoff-routing.mjs +2 -2
  444. package/template/scripts/lib/strategic-handoff.mjs +15 -15
  445. package/template/scripts/lib/task-package-schema.mjs +2 -2
  446. package/template/scripts/lib/task-package.mjs +1 -1
  447. package/template/scripts/lib/technical-design-boundary.mjs +1 -1
  448. package/template/scripts/lib/user-decision.mjs +2 -1
  449. package/template/scripts/lifecycle-status +14 -0
  450. package/template/scripts/plan-spec-entry +21 -0
  451. package/template/scripts/strategic-consumer-entry +1 -1
  452. package/template/scripts/strategic-handoff +1 -1
  453. package/template/scripts/verify-frontend-implementation-evidence +1 -1
  454. package/template/scripts/verify-governance-layout +15 -0
  455. package/template/scripts/verify-lifecycle-checkpoint +1 -1
  456. package/template/scripts/verify-project-instance +13 -10
  457. package/template/scripts/verify-scaffold-architecture-decisions +1 -1
  458. package/template/scripts/verify-strategic-context-import +3 -3
  459. package/template/skills-lock.json +80 -95
  460. package/template.manifest.json +30 -15
  461. package/template.snapshot.json +5 -5
  462. package/template/.agents/skills/grill-me/SKILL.md +0 -7
  463. package/template/.agents/skills/grill-me/agents/openai.yaml +0 -5
  464. package/template/.agents/skills/yss-distributed-id/assets/AutoIdInterceptor.java +0 -246
  465. package/template/.agents/skills/yss-distributed-id/assets/EnableDistributedId.java +0 -25
  466. package/template/.agents/skills/yss-distributed-id/assets/LeafConf.java +0 -36
  467. package/template/.codex/skills/grill-me/SKILL.md +0 -7
  468. package/template/.codex/skills/grill-me/agents/openai.yaml +0 -5
  469. package/template/.codex/skills/yss-distributed-id/assets/AutoIdInterceptor.java +0 -246
  470. package/template/.codex/skills/yss-distributed-id/assets/EnableDistributedId.java +0 -25
  471. package/template/.codex/skills/yss-distributed-id/assets/LeafConf.java +0 -36
  472. package/template/.cursor/skills/grill-me/SKILL.md +0 -7
  473. package/template/.cursor/skills/grill-me/agents/openai.yaml +0 -5
  474. package/template/.cursor/skills/yss-distributed-id/assets/AutoIdInterceptor.java +0 -246
  475. package/template/.cursor/skills/yss-distributed-id/assets/EnableDistributedId.java +0 -25
  476. package/template/.cursor/skills/yss-distributed-id/assets/LeafConf.java +0 -36
  477. package/template/.pi/skills/grill-me/SKILL.md +0 -7
  478. package/template/.pi/skills/grill-me/agents/openai.yaml +0 -5
  479. package/template/.pi/skills/yss-distributed-id/assets/AutoIdInterceptor.java +0 -246
  480. package/template/.pi/skills/yss-distributed-id/assets/EnableDistributedId.java +0 -25
  481. package/template/.pi/skills/yss-distributed-id/assets/LeafConf.java +0 -36
  482. package/template/docs/agents/archify-integration.md +0 -19
  483. package/template/docs/agents/yss-plugin-dependency-contract.md +0 -45
  484. package/template/docs/api/.gitkeep +0 -0
  485. package/template/docs/api/specs/.gitkeep +0 -0
  486. package/template/docs/architecture/.gitkeep +0 -0
  487. package/template/docs/design/design-system-sync.yaml +0 -13
  488. package/template/docs/design/facts/antdv-next/1.5.2/cli-help.txt +0 -38
  489. package/template/docs/design/facts/antdv-next/1.5.2/component-list.json +0 -434
  490. package/template/docs/design/facts/antdv-next/1.5.2/components/Alert/demo-basic.json +0 -7
  491. package/template/docs/design/facts/antdv-next/1.5.2/components/Alert/info.json +0 -246
  492. package/template/docs/design/facts/antdv-next/1.5.2/components/Alert/semantic.json +0 -40
  493. package/template/docs/design/facts/antdv-next/1.5.2/components/Alert/token.json +0 -32
  494. package/template/docs/design/facts/antdv-next/1.5.2/components/Button/demo-basic.json +0 -7
  495. package/template/docs/design/facts/antdv-next/1.5.2/components/Button/info.json +0 -190
  496. package/template/docs/design/facts/antdv-next/1.5.2/components/Button/semantic.json +0 -20
  497. package/template/docs/design/facts/antdv-next/1.5.2/components/Button/token.json +0 -256
  498. package/template/docs/design/facts/antdv-next/1.5.2/components/Input/demo-basic.json +0 -7
  499. package/template/docs/design/facts/antdv-next/1.5.2/components/Input/info.json +0 -460
  500. package/template/docs/design/facts/antdv-next/1.5.2/components/Input/semantic.json +0 -70
  501. package/template/docs/design/facts/antdv-next/1.5.2/components/Input/token.json +0 -123
  502. package/template/docs/design/facts/antdv-next/1.5.2/components/Modal/demo-basic.json +0 -7
  503. package/template/docs/design/facts/antdv-next/1.5.2/components/Modal/info.json +0 -646
  504. package/template/docs/design/facts/antdv-next/1.5.2/components/Modal/semantic.json +0 -50
  505. package/template/docs/design/facts/antdv-next/1.5.2/components/Modal/token.json +0 -130
  506. package/template/docs/design/facts/antdv-next/1.5.2/components/Select/demo-basic.json +0 -7
  507. package/template/docs/design/facts/antdv-next/1.5.2/components/Select/info.json +0 -640
  508. package/template/docs/design/facts/antdv-next/1.5.2/components/Select/semantic.json +0 -70
  509. package/template/docs/design/facts/antdv-next/1.5.2/components/Select/token.json +0 -172
  510. package/template/docs/design/facts/antdv-next/1.5.2/components/Table/demo-basic.json +0 -7
  511. package/template/docs/design/facts/antdv-next/1.5.2/components/Table/info.json +0 -1010
  512. package/template/docs/design/facts/antdv-next/1.5.2/components/Table/semantic.json +0 -70
  513. package/template/docs/design/facts/antdv-next/1.5.2/components/Table/token.json +0 -263
  514. package/template/docs/design/facts/antdv-next/1.5.2/components/Tag/demo-basic.json +0 -7
  515. package/template/docs/design/facts/antdv-next/1.5.2/components/Tag/info.json +0 -321
  516. package/template/docs/design/facts/antdv-next/1.5.2/components/Tag/semantic.json +0 -25
  517. package/template/docs/design/facts/antdv-next/1.5.2/components/Tag/token.json +0 -25
  518. package/template/docs/design/facts/antdv-next/1.5.2/design-md.json +0 -3
  519. package/template/docs/design/facts/antdv-next/1.5.2/manifest.json +0 -215
  520. package/template/docs/design/facts/antdv-next/1.5.2/resolution-probe.json +0 -5
  521. package/template/docs/design/preview-dark.html +0 -178
  522. package/template/docs/design/preview.css +0 -730
  523. package/template/docs/design/preview.html +0 -178
  524. package/template/docs/design/preview.js +0 -71
  525. package/template/docs/design/prototypes/.gitkeep +0 -1
  526. package/template/docs/design/tokens/.design-md-projection.json +0 -13
  527. package/template/docs/implementation/.gitkeep +0 -1
  528. package/template/docs/plan/IDEATION.md +0 -96
  529. package/template/docs/process/MATT-POCOCK-ENGINEERING-SKILLS.md +0 -13
  530. package/template/docs/process/PDCA-SCRUM.md +0 -10
  531. package/template/docs/process/github-workflows.md +0 -52
  532. package/template/docs/process/harness-executive-blueprint.md +0 -10
  533. package/template/docs/releases/.gitkeep +0 -1
  534. package/template/docs/requirements/README.md +0 -85
  535. package/template/docs/requirements/tickets/.gitkeep +0 -1
  536. package/template/docs/templates/agent-brief-template.md +0 -46
  537. package/template/docs/templates/architecture-proposal-template.md +0 -18
  538. package/template/docs/templates/implementation-plan-template.md +0 -16
  539. package/template/docs/templates/implementation-routing-template.md +0 -350
  540. package/template/docs/templates/release-note-template.md +0 -14
  541. package/template/docs/templates/requirement-freeze-template.md +0 -63
  542. package/template/docs/templates/retro-report-template.md +0 -16
  543. package/template/docs/templates/risk-register-template.md +0 -11
  544. package/template/docs/templates/user-story-template.md +0 -20
  545. package/template/docs/templates/verification-record-template.md +0 -53
  546. package/template/docs/testing/README.md +0 -110
  547. /package/template/{docs → .template-spec}/agents/domain.md +0 -0
  548. /package/template/{docs → .template-spec}/api/templates/openapi-draft-review-checklist.md +0 -0
  549. /package/template/{docs → .template-spec}/api/templates/openapi-draft-validation-record-template.yaml +0 -0
  550. /package/template/{docs → .template-spec}/api/templates/openapi-freeze-record-template.md +0 -0
  551. /package/template/{docs → .template-spec}/api/templates/openapi-json-export-record-template.md +0 -0
  552. /package/template/{docs → .template-spec}/architecture/templates/architecture-deepening-template.md +0 -0
  553. /package/template/{docs → .template-spec}/architecture/templates/architecture-review-checklist.md +0 -0
  554. /package/template/{docs → .template-spec}/architecture/templates/business-architecture-template.md +0 -0
  555. /package/template/{docs → .template-spec}/architecture/templates/data-architecture-template.md +0 -0
  556. /package/template/{docs → .template-spec}/architecture/templates/engineering-baseline-review-template.md +0 -0
  557. /package/template/{docs → .template-spec}/architecture/templates/functional-architecture-template.md +0 -0
  558. /package/template/{docs → .template-spec}/architecture/templates/system-overview-design-template.md +0 -0
  559. /package/template/{docs → .template-spec}/design/diagrams/README.md +0 -0
  560. /package/template/{docs → .template-spec}/design/schemas/visual-baseline.schema.json +0 -0
  561. /package/template/{docs → .template-spec}/design/templates/prototype-confirmation-template.md +0 -0
  562. /package/template/{docs → .template-spec}/design/templates/visual-baseline-template.yaml +0 -0
  563. /package/template/{docs → .template-spec}/design/tokens/theme.json +0 -0
  564. /package/template/{docs → .template-spec}/design/tokens/tokens.compact.json +0 -0
  565. /package/template/{docs → .template-spec}/design/tokens/tokens.dark.json +0 -0
  566. /package/template/{docs → .template-spec}/design/tokens/tokens.default.json +0 -0
  567. /package/template/{docs → .template-spec}/design/tokens/variables.css +0 -0
  568. /package/template/{docs → .template-spec}/design/tokens/variables.dark.css +0 -0
  569. /package/template/{docs → .template-spec}/engineering/backend-platforms.json +0 -0
  570. /package/template/{docs → .template-spec}/plan/README.md +0 -0
  571. /package/template/{docs → .template-spec}/plan/templates/competitive-analysis-template.md +0 -0
  572. /package/template/{docs → .template-spec}/plan/templates/competitive-matrix-template.md +0 -0
  573. /package/template/{docs → .template-spec}/plan/templates/market-analysis-template.md +0 -0
  574. /package/template/{docs → .template-spec}/plan/templates/user-pain-points-template.md +0 -0
  575. /package/template/{docs → .template-spec}/process/delivery-preflight.md +0 -0
  576. /package/template/{docs → .template-spec}/process/document-writing.md +0 -0
  577. /package/template/{docs → .template-spec}/process/existing-backend-architecture.md +0 -0
  578. /package/template/{docs → .template-spec}/process/existing-ui-baseline.md +0 -0
  579. /package/template/{docs → .template-spec}/process/frontend-backend-delivery.md +0 -0
  580. /package/template/{docs → .template-spec}/process/harness-process-tailoring.md +0 -0
  581. /package/template/{docs → .template-spec}/process/implementation-repo-integration.md +0 -0
  582. /package/template/{docs/process/lifecycle-registry-baseline.json → .template-spec/process/lifecycle-registry-baseline-v1.json} +0 -0
  583. /package/template/{docs → .template-spec}/process/schemas/api-contract-decision-v2.schema.json +0 -0
  584. /package/template/{docs → .template-spec}/process/schemas/api-contract-decision.schema.json +0 -0
  585. /package/template/{docs → .template-spec}/process/schemas/backend-architecture-identity.schema.json +0 -0
  586. /package/template/{docs → .template-spec}/process/schemas/backend-delivery-verification.schema.json +0 -0
  587. /package/template/{docs → .template-spec}/process/schemas/backend-delivery.schema.json +0 -0
  588. /package/template/{docs → .template-spec}/process/schemas/context-reconciliation.schema.json +0 -0
  589. /package/template/{docs → .template-spec}/process/schemas/data-architecture-decision.schema.json +0 -0
  590. /package/template/{docs → .template-spec}/process/schemas/delivery-preflight-input.schema.json +0 -0
  591. /package/template/{docs → .template-spec}/process/schemas/delivery-preflight-result.schema.json +0 -0
  592. /package/template/{docs → .template-spec}/process/schemas/existing-ui-baseline.schema.json +0 -0
  593. /package/template/{docs → .template-spec}/process/schemas/frontend-delivery-acceptance-v1.schema.json +0 -0
  594. /package/template/{docs → .template-spec}/process/schemas/frontend-delivery-acceptance-v3.schema.json +0 -0
  595. /package/template/{docs → .template-spec}/process/schemas/frontend-delivery-acceptance.schema.json +0 -0
  596. /package/template/{docs → .template-spec}/process/schemas/frontend-implementation-evidence.schema.json +0 -0
  597. /package/template/{docs → .template-spec}/process/schemas/frontend-strategic-preflight-v2.schema.json +0 -0
  598. /package/template/{docs → .template-spec}/process/schemas/frontend-strategic-preflight.schema.json +0 -0
  599. /package/template/{docs → .template-spec}/process/schemas/implementation-repository-preparation-result.schema.json +0 -0
  600. /package/template/{docs → .template-spec}/process/schemas/openapi-draft-validation-record.schema.json +0 -0
  601. /package/template/{docs → .template-spec}/process/schemas/project-scaffold-contract.schema.json +0 -0
  602. /package/template/{docs → .template-spec}/process/schemas/review-bundle.schema.json +0 -0
  603. /package/template/{docs → .template-spec}/process/schemas/scaffold-architecture-decisions.schema.json +0 -0
  604. /package/template/{docs → .template-spec}/process/schemas/slice-implementation-contract-v3.schema.json +0 -0
  605. /package/template/{docs → .template-spec}/process/schemas/stage-tracking.schema.json +0 -0
  606. /package/template/{docs → .template-spec}/process/schemas/strategic-consumer-feedback.schema.json +0 -0
  607. /package/template/{docs → .template-spec}/process/schemas/strategic-feedback-adjudication.schema.json +0 -0
  608. /package/template/{docs → .template-spec}/process/schemas/strategic-handoff-delivery-verification.schema.json +0 -0
  609. /package/template/{docs → .template-spec}/process/schemas/strategic-handoff-delivery.schema.json +0 -0
  610. /package/template/{docs → .template-spec}/process/schemas/strategic-handoff-domain-strategy-v3.schema.json +0 -0
  611. /package/template/{docs → .template-spec}/process/schemas/strategic-handoff-domain-strategy.schema.json +0 -0
  612. /package/template/{docs → .template-spec}/process/schemas/strategic-handoff-export-v2.schema.json +0 -0
  613. /package/template/{docs → .template-spec}/process/schemas/strategic-handoff-export.schema.json +0 -0
  614. /package/template/{docs → .template-spec}/process/schemas/strategic-handoff-import-receipt-v3.schema.json +0 -0
  615. /package/template/{docs → .template-spec}/process/schemas/strategic-handoff-import-receipt.schema.json +0 -0
  616. /package/template/{docs → .template-spec}/process/schemas/strategic-handoff-package.schema.json +0 -0
  617. /package/template/{docs → .template-spec}/process/schemas/strategic-handoff-stage-decision-package-v3.schema.json +0 -0
  618. /package/template/{docs → .template-spec}/process/schemas/strategic-handoff-stage-decision-package.schema.json +0 -0
  619. /package/template/{docs → .template-spec}/process/schemas/subagent-task-package.schema.json +0 -0
  620. /package/template/{docs → .template-spec}/process/schemas/user-decision.schema.json +0 -0
  621. /package/template/{docs → .template-spec}/process/strategic-handoff-package.md +0 -0
  622. /package/template/{docs → .template-spec}/process/templates/context-reconciliation-template.yaml +0 -0
  623. /package/template/{docs → .template-spec}/process/templates/frontend-implementation-plan-template.yaml +0 -0
  624. /package/template/{docs → .template-spec}/process/templates/frontend-implementation-verification-template.yaml +0 -0
  625. /package/template/{docs → .template-spec}/process/templates/lifecycle-checkpoint-template.yaml +0 -0
  626. /package/template/{docs → .template-spec}/process/templates/scaffold-architecture-decisions-template.yaml +0 -0
  627. /package/template/{docs → .template-spec}/process/templates/stage-checkpoint-template.md +0 -0
  628. /package/template/{docs → .template-spec}/process/templates/user-decision-template.yaml +0 -0
  629. /package/template/{docs → .template-spec}/templates/adr-template.md +0 -0
  630. /package/template/{docs → .template-spec}/templates/approval-record-template.yaml +0 -0
  631. /package/template/{docs → .template-spec}/templates/cross-repo-slice-template.md +0 -0
  632. /package/template/{docs → .template-spec}/templates/examples/lifecycle-writing-examples.md +0 -0
  633. /package/template/{docs → .template-spec}/templates/implementation-repo-registry-template.md +0 -0
  634. /package/template/{docs → .template-spec}/templates/openapi-spec-template.yaml +0 -0
  635. /package/template/{docs → .template-spec}/templates/review-bundle-template.yaml +0 -0
  636. /package/template/{docs → .template-spec}/templates/review-report-template.md +0 -0
  637. /package/template/{docs → .template-spec}/templates/spec-delta-template.md +0 -0
  638. /package/template/{docs → .template-spec}/templates/spec-template.md +0 -0
  639. /package/template/{docs → .template-spec}/user-guide/yss-ui-mcp.md +0 -0
  640. /package/template/{docs → .template-spec}/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" +0 -0
  641. /package/template/{docs → .template-spec}/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" +0 -0
  642. /package/template/{docs → .template-spec}/user-guide//351/230/266/346/256/265/346/216/245/345/205/245/344/270/216/344/272/247/347/211/251/345/244/215/347/224/250/344/275/277/347/224/250/346/211/213/345/206/214.md" +0 -0
@@ -7,7 +7,7 @@ import { openBundle } from './strategic-handoff.mjs';
7
7
  import { verifyConsumption } from './strategic-handoff-consumption.mjs';
8
8
  import { read, safe, ensure, hash, schema, project, ROOT } from './strategic-handoff-io.mjs';
9
9
 
10
- const ACCEPTANCE_SCHEMAS=new Map([[1,'docs/process/schemas/frontend-delivery-acceptance-v1.schema.json'],[2,'docs/process/schemas/frontend-delivery-acceptance.schema.json'],[3,'docs/process/schemas/frontend-delivery-acceptance-v3.schema.json']]);
10
+ const ACCEPTANCE_SCHEMAS=new Map([[1,'.template-spec/process/schemas/frontend-delivery-acceptance-v1.schema.json'],[2,'.template-spec/process/schemas/frontend-delivery-acceptance.schema.json'],[3,'.template-spec/process/schemas/frontend-delivery-acceptance-v3.schema.json']]);
11
11
 
12
12
  function acceptanceSchema(version) {
13
13
  ensure(ACCEPTANCE_SCHEMAS.has(version),`Frontend Delivery Acceptance 未知 schema_version: ${String(version)};支持版本: 1, 2, 3;既有 UI 接收请使用 3`);
@@ -18,7 +18,7 @@ export async function verifyFrontendStrategicPreflight({root=process.cwd(),prefl
18
18
  project(root);
19
19
  const file=safe(root,preflightRef),preflight=read(file);
20
20
  ensure([1,2].includes(preflight.schema_version),'Frontend Strategic Preflight 未知 schema_version');
21
- schema(preflight,preflight.schema_version===2?'docs/process/schemas/frontend-strategic-preflight-v2.schema.json':'docs/process/schemas/frontend-strategic-preflight.schema.json');
21
+ schema(preflight,preflight.schema_version===2?'.template-spec/process/schemas/frontend-strategic-preflight-v2.schema.json':'.template-spec/process/schemas/frontend-strategic-preflight.schema.json');
22
22
  const preflightDigest=hash(readFileSync(file));
23
23
  if(expectedDigest)ensure(expectedDigest===preflightDigest,'前端战略预检摘要已变化,需重编译合同');
24
24
  ensure(preflight.status==='verified','前端战略预检尚未 verified');
@@ -0,0 +1,74 @@
1
+ import { existsSync, lstatSync, readdirSync } from "node:fs";
2
+ import path from "node:path";
3
+ import { spawnSync } from "node:child_process";
4
+
5
+ const requiredShared = [
6
+ ".template-spec/agents/yss-skill-registry.yaml",
7
+ ".template-spec/agents/digital-human-roles.yaml",
8
+ ".template-spec/agents/issue-tracker.md",
9
+ ".template-spec/process/lifecycle-registry.yaml",
10
+ ".template-spec/process/lifecycle-artifact-map.md",
11
+ ];
12
+ const oldStaticDirs = [
13
+ "docs/agents", "docs/process", "docs/templates", "docs/user-guide",
14
+ "docs/plan/templates", "docs/api/templates", "docs/architecture/templates",
15
+ "docs/design/templates", "docs/design/tokens", "docs/design/schemas",
16
+ "docs/design/diagrams", "docs/discovery/templates",
17
+ ];
18
+ const oldStaticFiles = new Set([
19
+ "docs/adr/README.md", "docs/architecture/README.md",
20
+ "docs/plan/README.md", "docs/plan/entry-review.md",
21
+ "docs/discovery/README.md", "docs/discovery/IDEATION.md",
22
+ "docs/design/README.md", "docs/design/design.md",
23
+ "docs/design/design-system-sync.yaml", "docs/design/preview.html",
24
+ "docs/design/preview-dark.html", "docs/design/preview.css",
25
+ "docs/design/preview.js", "docs/engineering/backend-platforms.json",
26
+ "docs/engineering/backend-platforms.md",
27
+ ]);
28
+
29
+ function staticPath(ref) {
30
+ return oldStaticFiles.has(ref) || oldStaticDirs.some((directory) => ref.startsWith(`${directory}/`));
31
+ }
32
+
33
+ function filesBelow(root, relativePath) {
34
+ const full = path.join(root, relativePath);
35
+ if (!existsSync(full)) return [];
36
+ const entry = lstatSync(full);
37
+ if (!entry.isDirectory()) return [relativePath];
38
+ return readdirSync(full).filter((name) => name !== ".DS_Store")
39
+ .flatMap((name) => filesBelow(root, `${relativePath}/${name}`));
40
+ }
41
+
42
+ export function verifyGovernanceLayout(root, mode) {
43
+ if (!["template-source", "project-instance"].includes(mode)) {
44
+ throw new TypeError(`不支持的仓库身份: ${mode}`);
45
+ }
46
+ for (const ref of requiredShared) {
47
+ if (!existsSync(path.join(root, ref))) throw new TypeError(`缺少共享治理资产: ${ref}`);
48
+ }
49
+ let oldFiles;
50
+ if (mode === "template-source") {
51
+ const result = spawnSync("git", ["ls-files", "-z", "--", "docs"], { cwd: root, encoding: "utf8" });
52
+ if (result.status !== 0) throw new TypeError(result.stderr || "无法读取模板源受控文件清单");
53
+ oldFiles = result.stdout.split("\0").filter(Boolean).filter(staticPath);
54
+ for (const ref of [
55
+ ".template-source/process/maintenance-intensity.yaml",
56
+ ".template-source/process/template-verification-profiles.yaml",
57
+ ".template-source/agents/skills-maintenance.md",
58
+ ]) {
59
+ if (!existsSync(path.join(root, ref))) throw new TypeError(`缺少模板维护资产: ${ref}`);
60
+ }
61
+ } else {
62
+ oldFiles = [...new Set([
63
+ ...oldStaticDirs.flatMap((ref) => filesBelow(root, ref)),
64
+ ...[...oldStaticFiles].filter((ref) => existsSync(path.join(root, ref))),
65
+ ])];
66
+ if (existsSync(path.join(root, ".template-source"))) {
67
+ throw new TypeError("项目实例不得包含 .template-source");
68
+ }
69
+ }
70
+ if (oldFiles.length) {
71
+ throw new TypeError(`旧治理文件仍位于 docs/,需显式迁移: ${oldFiles.sort().join(", ")}`);
72
+ }
73
+ return { mode, shared: requiredShared.length, legacy: 0 };
74
+ }
@@ -6,9 +6,9 @@ import { ROOT, read, safe, ensure } from './strategic-handoff-io.mjs';
6
6
  export function loadDeliveryProfile(root=ROOT) {
7
7
  const metadata=['backend','frontend'].filter(side=>existsSync(path.join(root,`.yss-harness-${side}.json`)));
8
8
  ensure(metadata.length<=1,'专职 Harness metadata 身份冲突');
9
- const profilePath=path.join(root,'docs/process/harness-profile.yaml');
9
+ const profilePath=path.join(root,'.template-spec/process/harness-profile.yaml');
10
10
  ensure(!metadata.length||existsSync(profilePath),'专职 Harness 缺少 profile,不得绕过执行门禁');
11
- const profile=existsSync(profilePath)?read(safe(root,'docs/process/harness-profile.yaml')):null;
11
+ const profile=existsSync(profilePath)?read(safe(root,'.template-spec/process/harness-profile.yaml')):null;
12
12
  if(metadata.length) {
13
13
  const expected=`harness.${metadata[0]}-delivery`;
14
14
  const record=read(safe(root,`.yss-harness-${metadata[0]}.json`));
@@ -6,9 +6,9 @@ import { parseDocument } from "../vendor/yaml.mjs";
6
6
  import { ROOT, loadRegistry, semanticDigest, validateRegistry } from "./lifecycle-registry.mjs";
7
7
  import { loadSkillRegistry } from "./skill-registry.mjs";
8
8
 
9
- const LIFECYCLE_REGISTRY_REF = "docs/process/lifecycle-registry.yaml";
9
+ const LIFECYCLE_REGISTRY_REF = ".template-spec/process/lifecycle-registry.yaml";
10
10
  const ORCHESTRATION_CONTRACT_REF = ".agents/skills/yss-product-lifecycle/references/orchestration-contract.yaml";
11
- const SKILL_REGISTRY_REF = "docs/agents/yss-skill-registry.yaml";
11
+ const SKILL_REGISTRY_REF = ".template-spec/agents/yss-skill-registry.yaml";
12
12
 
13
13
  function read(relativePath) {
14
14
  return readFileSync(path.join(ROOT, relativePath), "utf8");
@@ -88,6 +88,12 @@ export function queryLifecycleContext({ mode, stageId, workUnitId, include = []
88
88
  }
89
89
 
90
90
  const route = workUnitId ? orchestration.work_unit_routes?.[workUnitId] ?? null : null;
91
+ if (workUnit?.scope === "project-instance" && workUnit.id !== "work-unit.entry-triage" && !route) {
92
+ throw new TypeError(`项目工作单元缺少执行路由: ${workUnit.id}`);
93
+ }
94
+ if (workUnit?.scope === "project-instance" && workUnit.id !== "work-unit.entry-triage" && !Object.hasOwn(orchestration.transition_graph?.routes ?? {}, workUnit.id)) {
95
+ throw new TypeError(`项目工作单元缺少流转路由: ${workUnit.id}`);
96
+ }
91
97
  const gates = lifecycle.gates.filter((gate) => gate.stage === stageId || (loadPlan && gate.stage === 'stage.plan'));
92
98
  const checks = lifecycle.checks.filter(check => check.stage === stageId || gates.some(gate => gate.requires_checks?.includes(check.id)));
93
99
  const artifacts = lifecycle.artifacts.filter((artifact) => artifact.stage === stageId || (loadPlan && artifact.stage === 'stage.plan'));
@@ -125,7 +131,9 @@ export function queryLifecycleContext({ mode, stageId, workUnitId, include = []
125
131
  },
126
132
  lifecycle: {
127
133
  artifacts,
128
- evidence: lifecycle.evidence.filter((item) => evidenceIds.has(item.id)),
134
+ evidence: lifecycle.evidence.filter((item) => evidenceIds.has(item.id)).map(({ public_description, ...item }) => ({
135
+ ...item, description: public_description ?? item.description
136
+ })),
129
137
  gates,
130
138
  checks,
131
139
  stage,
@@ -6,8 +6,8 @@ import { fileURLToPath } from "node:url";
6
6
  import { parseDocument } from "../vendor/yaml.mjs";
7
7
 
8
8
  export const ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "../..");
9
- export const DEFAULT_REGISTRY = path.join(ROOT, "docs/process/lifecycle-registry.yaml");
10
- export const DEFAULT_BASELINE = path.join(ROOT, "docs/process/lifecycle-registry-baseline.json");
9
+ export const DEFAULT_REGISTRY = path.join(ROOT, ".template-spec/process/lifecycle-registry.yaml");
10
+ export const DEFAULT_BASELINE = path.join(ROOT, ".template-spec/process/lifecycle-registry-baseline.json");
11
11
  const ID_PATTERN = /^(stage|gate|check|artifact|work-unit|evidence)\.[a-z0-9][a-z0-9-]*$/;
12
12
  const COLLECTIONS = ["stages", "gates", "checks", "artifacts", "work_units", "evidence"];
13
13
 
@@ -63,6 +63,12 @@ export function semanticDigest(registry) {
63
63
  return createHash("sha256").update(JSON.stringify(semanticProjection(registry))).digest("hex");
64
64
  }
65
65
 
66
+ export function semanticHashesById(registry) {
67
+ return Object.fromEntries(semanticProjection(registry).map(({ record }) => [
68
+ record.id, createHash("sha256").update(JSON.stringify(record)).digest("hex")
69
+ ]));
70
+ }
71
+
66
72
  function validateBaseline(registry, ids, baselinePath) {
67
73
  let baseline;
68
74
  try {
@@ -72,7 +78,7 @@ function validateBaseline(registry, ids, baselinePath) {
72
78
  if (error instanceof SyntaxError) fail(`无法解析生命周期已发布基线: ${error.message}`);
73
79
  throw error;
74
80
  }
75
- if (baseline.schema_version !== 1 || baseline.registry_id !== registry.registry_id) {
81
+ if (![1, 2].includes(baseline.schema_version) || baseline.registry_id !== registry.registry_id) {
76
82
  fail("生命周期已发布基线版本或 registry_id 不匹配");
77
83
  }
78
84
  const publishedIds = baseline.published_ids;
@@ -91,7 +97,26 @@ function validateBaseline(registry, ids, baselinePath) {
91
97
  if (JSON.stringify(activeIds) !== JSON.stringify(expected)) {
92
98
  fail("生命周期活跃 ID 与已发布基线不一致;新增、移除或弃用必须先更新发布基线");
93
99
  }
94
- if (baseline.semantic_sha256 !== semanticDigest(registry)) fail("生命周期稳定 ID 的语义快照已变化;不得复用已发布 ID");
100
+ if (baseline.schema_version === 1) {
101
+ if (baseline.semantic_sha256 !== semanticDigest(registry)) fail("生命周期稳定 ID 的语义快照已变化;不得复用已发布 ID");
102
+ return;
103
+ }
104
+ const archivedPath = path.resolve(ROOT, baseline.historical_baseline ?? "");
105
+ if (baseline.historical_baseline !== ".template-spec/process/lifecycle-registry-baseline-v1.json") fail("生命周期历史基线路径无效");
106
+ const archivedBytes = readFileSync(archivedPath);
107
+ if (createHash("sha256").update(archivedBytes).digest("hex") !== baseline.historical_sha256) fail("生命周期历史基线摘要不匹配");
108
+ const archived = JSON.parse(archivedBytes.toString("utf8"));
109
+ if (archived.schema_version !== 1 || archived.registry_id !== registry.registry_id || !archived.published_ids.every((id) => publishedIds.includes(id))) fail("生命周期历史基线与当前发布 ID 不兼容");
110
+ const migrations = baseline.migrations;
111
+ if (!migrations || typeof migrations !== "object" || Array.isArray(migrations)) fail("生命周期迁移映射无效");
112
+ for (const [oldId, newId] of Object.entries(migrations)) {
113
+ if (!archived.published_ids.includes(oldId) || !deprecated.includes(oldId) || !activeIds.includes(newId) || oldId.split(".")[0] !== newId.split(".")[0]) fail(`生命周期迁移映射无效: ${oldId} -> ${newId}`);
114
+ }
115
+ const hashes = semanticHashesById(registry);
116
+ if (!baseline.semantic_sha256_by_id || JSON.stringify(Object.keys(baseline.semantic_sha256_by_id).sort()) !== JSON.stringify(activeIds)) fail("生命周期逐 ID 语义基线与活跃 ID 不一致");
117
+ for (const [id, digest] of Object.entries(hashes)) {
118
+ if (baseline.semantic_sha256_by_id[id] !== digest) fail(`生命周期稳定 ID 的语义快照已变化: ${id}`);
119
+ }
95
120
  }
96
121
 
97
122
  export function validateRegistry(registry, { baseline = DEFAULT_BASELINE } = {}) {
@@ -108,7 +133,7 @@ export function validateRegistry(registry, { baseline = DEFAULT_BASELINE } = {})
108
133
  }
109
134
  if (policy.published_ids_immutable !== true) fail("published_ids_immutable 必须为 true");
110
135
  if (policy.pattern !== "^(stage|gate|check|artifact|work-unit|evidence)\\.[a-z0-9][a-z0-9-]*$") fail("id_policy.pattern 不符合固定命名空间");
111
- if (policy.baseline !== "docs/process/lifecycle-registry-baseline.json") fail("id_policy.baseline 必须指向发布基线");
136
+ if (policy.baseline !== ".template-spec/process/lifecycle-registry-baseline.json") fail("id_policy.baseline 必须指向发布基线");
112
137
  if (!Array.isArray(policy.deprecated_ids)) fail("deprecated_ids 必须是数组");
113
138
  const ids = new Map();
114
139
  for (const collection of COLLECTIONS) {
@@ -159,6 +184,20 @@ export function validateRegistry(registry, { baseline = DEFAULT_BASELINE } = {})
159
184
  for (const artifact of registry.artifacts) {
160
185
  requireReference(ids, artifact.stage, `${artifact.id}.stage`);
161
186
  if (ids.get(artifact.stage) !== "stages") fail(`${artifact.id}.stage 必须引用 stage.*`);
187
+ for (const reference of artifact.trigger.match(/\b(?:stage|gate|check|artifact|work-unit|evidence)\.[a-z0-9][a-z0-9-]*\b/g) ?? []) {
188
+ requireReference(ids, reference, `${artifact.id}.trigger`);
189
+ }
190
+ }
191
+ // Human-readable rules are execution instructions too. A retired control ID
192
+ // must never survive in an active trigger or completion sentence.
193
+ for (const collection of COLLECTIONS) for (const record of registry[collection]) {
194
+ for (const [field, value] of Object.entries(record)) {
195
+ if (field === "id" || typeof value !== "string") continue;
196
+ for (const reference of value.match(/\b(?:gate|check)\.[a-z0-9][a-z0-9-]*\b/g) ?? []) {
197
+ requireReference(ids, reference, `${record.id}.${field}`);
198
+ if (ids.get(reference) !== `${reference.split(".")[0]}s`) fail(`${record.id}.${field} 引用类型不匹配: ${reference}`);
199
+ }
200
+ }
162
201
  }
163
202
  if (baseline) validateBaseline(registry, ids, baseline);
164
203
  return registry;
@@ -168,7 +207,7 @@ export function renderLifecycleStructure(registry) {
168
207
  const display = (record, field) => record[`public_${field}`] ?? record[field];
169
208
  const lines = [
170
209
  "<!-- lifecycle-registry:structure:start -->",
171
- `> 此结构区由 \`docs/process/lifecycle-registry.yaml\` 生成。当前为 \`${registry.status}\` 模式:正式门禁、内部检查和派生文档共同消费此事实源。`, "",
210
+ `> 此结构区由 \`.template-spec/process/lifecycle-registry.yaml\` 生成。当前为 \`${registry.status}\` 模式:正式门禁、内部检查和派生文档共同消费此事实源。`, "",
172
211
  "## 1. 主阶段", "", "| 稳定 ID | 阶段 | 目标 | 退出标准 |", "|---|---|---|---|"
173
212
  ];
174
213
  for (const stage of registry.stages) lines.push(`| \`${stage.id}\` | ${display(stage, "name")} | ${display(stage, "goal")} | ${display(stage, "exit_criteria")} |`);
@@ -186,7 +225,7 @@ export function renderLifecycleStructure(registry) {
186
225
 
187
226
  export function renderWorkUnits(registry) {
188
227
  const display = (record, field) => record[`public_${field}`] ?? record[field];
189
- const lines = ["<!-- lifecycle-registry:work-units:start -->", "> 此表由 `docs/process/lifecycle-registry.yaml` 生成;工作单元按 `scope` 区分模板维护与项目实例流程。", "", "| 稳定 ID | 范围 | 工作单元 | 输入 | 输出 | 完成条件 |", "|---|---|---|---|---|---|"];
228
+ const lines = ["<!-- lifecycle-registry:work-units:start -->", "> 此表由 `.template-spec/process/lifecycle-registry.yaml` 生成;工作单元按 `scope` 区分模板维护与项目实例流程。", "", "| 稳定 ID | 范围 | 工作单元 | 输入 | 输出 | 完成条件 |", "|---|---|---|---|---|---|"];
190
229
  for (const unit of registry.work_units) lines.push(`| \`${unit.id}\` | ${unit.scope} | ${display(unit, "name")} | ${display(unit, "input")} | ${display(unit, "output")} | ${display(unit, "completion")} |`);
191
230
  lines.push("<!-- lifecycle-registry:work-units:end -->");
192
231
  return `${lines.join("\n")}\n`;
@@ -0,0 +1,111 @@
1
+ import { createHash } from 'node:crypto';
2
+ import { readFileSync } from 'node:fs';
3
+ import path from 'node:path';
4
+ import { parseDocument } from '../vendor/yaml.mjs';
5
+ import { safeTrackingPath, trackingDrift } from './stage-tracking.mjs';
6
+
7
+ const sha = bytes => `sha256:${createHash('sha256').update(bytes).digest('hex')}`;
8
+ function parse(bytes) {
9
+ const document = parseDocument(String(bytes), { uniqueKeys: true, maxAliasCount: 0 });
10
+ if (document.errors.length) throw new TypeError(document.errors[0].message);
11
+ return document.toJS({ maxAliasCount: 0 });
12
+ }
13
+ function source(root, ref) {
14
+ const bytes = readFileSync(safeTrackingPath(root, ref));
15
+ return { value: parse(bytes), digest: sha(bytes) };
16
+ }
17
+
18
+ /** Read-only projection; checkpoint, registry and orchestration remain authoritative. */
19
+ export function lifecycleStatus({ root, checkpointRef }) {
20
+ if (!root || !checkpointRef) throw new TypeError('root and checkpoint are required');
21
+ root = path.resolve(root);
22
+ const identity = source(root, 'yss-project.yaml').value;
23
+ if (identity.schema_version !== 1 || identity.repository_mode !== 'project-instance') throw new TypeError('生命周期状态仅适用于 project-instance');
24
+ const registryRef = '.template-spec/process/lifecycle-registry.yaml';
25
+ const contractRef = '.agents/skills/yss-product-lifecycle/references/orchestration-contract.yaml';
26
+ const checkpoint = source(root, checkpointRef), registry = source(root, registryRef), contract = source(root, contractRef);
27
+ const value = checkpoint.value;
28
+ if (value.schema_version !== 1 || value.repository_mode !== 'project-instance') throw new TypeError('checkpoint 身份或版本无效');
29
+ const items = value.stage_tracking?.items ?? [];
30
+ if (!Array.isArray(items)) throw new TypeError('阶段追踪 items 必须为数组');
31
+ const activeItems = items.filter(item => item.work_unit === value.next_work_unit && item.progress !== 'cancelled');
32
+ const owner = value.pause?.owner_or_authority ?? activeItems.find(item => item.progress !== 'completed')?.owner ?? '未登记';
33
+ const diagnostics = [], verification_scope = [];
34
+ const check = (id, status, refs, reason) => verification_scope.push({ id, status, refs, reason });
35
+ const issue = (code, message, source_ref, recovery, severity = 'error') => diagnostics.push({ code, message, source_ref, owner, recovery, severity });
36
+ if (!Object.hasOwn(value, 'blockers')) {
37
+ issue('registered-blockers-missing', 'checkpoint 缺少 blockers;不能据此判定无已登记阻塞', checkpointRef, '核对原始状态并补齐真实阻塞记录后重验');
38
+ } else if (!Array.isArray(value.blockers)) {
39
+ issue('registered-blockers-invalid', 'checkpoint.blockers 必须为数组;当前登记不可核验', checkpointRef, '修复阻塞记录类型,保留原有阻塞内容后重验');
40
+ } else {
41
+ for (const item of value.blockers) {
42
+ issue('registered-blocker', typeof item === 'string' ? item : JSON.stringify(item), checkpointRef, '按原阻塞证据处理并复验');
43
+ }
44
+ }
45
+ check('registered-blockers', diagnostics.length ? 'failed' : 'passed', [checkpointRef], '仅读取已登记阻塞,不代表完整就绪');
46
+ const stage = registry.value.stages?.find(item => item.id === value.stage);
47
+ const workUnit = registry.value.work_units?.find(item => item.id === value.next_work_unit);
48
+ if (!stage) issue('unknown-stage', `未知阶段: ${value.stage}`, registryRef, '按注册表核对当前阶段');
49
+ if (value.next_work_unit && !workUnit) issue('unknown-work-unit', `未知下一工作单元: ${value.next_work_unit}`, registryRef, '按注册表核对下一工作单元');
50
+ if (workUnit && workUnit.id !== 'work-unit.entry-triage' && !contract.value.work_unit_routes?.[workUnit.id]) issue('missing-route', `缺少执行路由: ${workUnit.id}`, contractRef, '修复当前合同路由后重验');
51
+ check('stage-and-route', diagnostics.some(x => ['unknown-stage', 'unknown-work-unit', 'missing-route'].includes(x.code)) ? 'failed' : 'passed', [registryRef, contractRef], '仅检查身份与路由存在,不计算完整 frontier');
52
+ if (value.context_reconciliation?.status === 'blocked') issue('context-blocked', 'Context reconciliation blocked', checkpointRef, '修复词汇对账并执行适用校验');
53
+ check('context-reconciliation', value.context_reconciliation?.status === 'blocked' ? 'failed' : 'not-checked', [value.context_reconciliation?.ref].filter(Boolean), '读取登记状态;当前对账内容和摘要仍须由原验证器核验');
54
+ for (const [id, gate] of Object.entries(value.gates ?? {})) {
55
+ if (['blocked', 'stale'].includes(gate?.status)) issue('gate-blocked', `${id}: ${gate.status}`, checkpointRef, '核对受影响依据和当前批准');
56
+ }
57
+ check('registered-gates', diagnostics.some(x => x.code === 'gate-blocked') ? 'failed' : 'passed', [checkpointRef], '仅检查登记的 blocked/stale 标志');
58
+ const evidenceRefs = [value.context_reconciliation?.ref, ...Object.values(value.artifacts ?? {}).filter(item => item?.status === 'approved').map(item => item.ref)].filter(Boolean);
59
+ for (const ref of evidenceRefs) {
60
+ try { readFileSync(safeTrackingPath(root, ref)); }
61
+ catch { issue('evidence-unreadable', `证据不可读: ${ref}`, ref, '恢复正确来源或重新取得证据,不伪造历史批准'); }
62
+ }
63
+ check('evidence-readable', diagnostics.some(x => x.code === 'evidence-unreadable') ? 'failed' : 'passed', evidenceRefs, '仅检查已引用证据可读,不证明证据完整或当前有效');
64
+ check('artifact-digests', 'not-checked', evidenceRefs, '未核验批准资产原字节摘要;恢复时运行资产所有者的适用预检');
65
+ check('approval-validity', 'not-checked', [checkpointRef], '未核验真实决定、延续、外部审批及完整执行授权');
66
+ if (value.stage_tracking?.items) {
67
+ try {
68
+ const drift = trackingDrift(root, value.stage_tracking);
69
+ for (const id of drift) issue('tracking-drift', `阶段工作项来源漂移: ${id}`, checkpointRef, '按依赖重验受影响项,保留未受影响记录');
70
+ check('stage-tracking', drift.length ? 'failed' : 'passed', [checkpointRef], '只核对已登记工作项来源及完成证据摘要;结构与流转仍须原预检');
71
+ } catch (error) {
72
+ issue('tracking-unverifiable', `阶段追踪不可核验: ${error.message}`, checkpointRef, '修复追踪输入后重新检查');
73
+ check('stage-tracking', 'failed', [checkpointRef], error.message);
74
+ }
75
+ } else {
76
+ check('stage-tracking', 'not-checked', [checkpointRef], '未登记追踪;按实例既有兼容或显式迁移入口处理,不自动补建');
77
+ }
78
+ if (value.status === 'blocked' && !diagnostics.some(x => x.severity === 'error')) issue('reason-missing', 'checkpoint 已标 blocked,原因未登记', checkpointRef, '补齐真实阻塞原因');
79
+ const blockers = [...new Set(diagnostics.filter(x => x.severity === 'error').map(x => x.message))];
80
+ const next_step = {
81
+ action_type: 'verify', work_unit: value.next_work_unit ?? null, cwd: root,
82
+ command: null, input_refs: [checkpointRef],
83
+ prerequisites: ['核验当前来源、Context、适用门禁与决定或延续', '核对当前范围、任务结果和允许写路径;输入变化时重验'],
84
+ };
85
+ let next_action;
86
+ if (blockers.length) {
87
+ next_step.action_type = 'repair';
88
+ next_action = `处理当前阻塞:${blockers[0]}`;
89
+ } else if (value.status === 'paused-human-gate') {
90
+ next_step.action_type = 'wait';
91
+ next_action = '核对当前会签责任方、资产与决定范围;满足已登记恢复条件后复验';
92
+ } else if (activeItems.some(item => item.progress === 'running')) {
93
+ next_step.action_type = 'inspect';
94
+ next_action = '核对运行中任务身份与实际结果;状态未知时不得重复派发';
95
+ } else if (activeItems.length && activeItems.every(item => item.progress === 'completed')) {
96
+ next_step.action_type = 'inspect';
97
+ next_action = '核验已有完成证据并重算下一工作单元,不直接重做';
98
+ } else {
99
+ next_action = value.next_work_unit ? `先核验当前输入及适用门禁,再由主控恢复 ${value.next_work_unit}` : '复核当前阶段验收与下一动作';
100
+ // Commands are argv arrays. They are recommendations, never executed by this view.
101
+ const script = value.next_work_unit === 'work-unit.spec-synthesis' ? 'scripts/verify-plan-spec-entry' : 'scripts/verify-lifecycle-checkpoint';
102
+ try { readFileSync(safeTrackingPath(root, script)); next_step.command = ['node', script, checkpointRef]; }
103
+ catch { issue('precheck-unavailable', `预检入口不可读: ${script}`, script, '补齐当前实例工具后执行预检', 'warning'); }
104
+ }
105
+ return {
106
+ schema_version: 1, read_only: true, stage: value.stage, checkpoint_status: value.status,
107
+ work_unit: value.next_work_unit ?? null, owner, blockers, next_action,
108
+ execution_authorization: 'not-evaluated', verification_scope, diagnostics, next_step,
109
+ source_digests: { checkpoint: { ref: checkpointRef, digest: checkpoint.digest }, registry: { ref: registryRef, digest: registry.digest }, orchestration: { ref: contractRef, digest: contract.digest } },
110
+ };
111
+ }
@@ -12,11 +12,13 @@ import path from "node:path";
12
12
  import { validateApiContractDecision } from "./api-contract-decision.mjs";
13
13
  import { loadApprovalRecord, validateApprovalRecord } from "./approval-record.mjs";
14
14
  import { validateBackendReview } from "./backend-review.mjs";
15
+ import { validateJsonSchema } from "./json-schema.mjs";
15
16
  import { ROOT } from "./lifecycle-registry.mjs";
16
17
 
17
18
  const IMPLEMENTATION_WORK_UNIT = "work-unit.slice-implementation";
18
19
  const TICKET_DECOMPOSITION_WORK_UNIT = "work-unit.ticket-decomposition";
19
20
  const REPOSITORY_PREPARATION_WORK_UNIT = "work-unit.implementation-repository-preparation";
21
+ const SERVICE_INITIALIZATION_WORK_UNIT = "work-unit.service-project-initialization";
20
22
 
21
23
  function deepFreeze(value) {
22
24
  if (!value || typeof value !== "object" || Object.isFrozen(value)) return value;
@@ -27,21 +29,22 @@ function deepFreeze(value) {
27
29
 
28
30
  const NEXT_ROUTES = deepFreeze({
29
31
  "work-unit.entry-triage": ["work-unit.plan-opportunity", "work-unit.plan-requirements"],
30
- "work-unit.ssot-update": ["work-unit.skill-projection-sync", "work-unit.intensity-aware-verification"],
31
- "work-unit.skill-projection-sync": ["work-unit.template-snapshot-build", "work-unit.intensity-aware-verification"],
32
- "work-unit.template-snapshot-build": ["work-unit.attach-sync-integration", "work-unit.intensity-aware-verification"],
33
- "work-unit.attach-sync-integration": ["work-unit.intensity-aware-verification"],
34
- "work-unit.intensity-aware-verification": ["work-unit.intensity-aware-review"],
35
- "work-unit.intensity-aware-review": ["work-unit.release-and-rollback"],
32
+ "work-unit.ssot-update": ["work-unit.skill-projection-sync", "work-unit.intensity-aware-verification-v2"],
33
+ "work-unit.skill-projection-sync": ["work-unit.template-snapshot-build", "work-unit.intensity-aware-verification-v2"],
34
+ "work-unit.template-snapshot-build": ["work-unit.attach-sync-integration", "work-unit.intensity-aware-verification-v2"],
35
+ "work-unit.attach-sync-integration": ["work-unit.intensity-aware-verification-v2"],
36
+ "work-unit.intensity-aware-verification-v2": ["work-unit.intensity-aware-review-v2"],
37
+ "work-unit.intensity-aware-review-v2": ["work-unit.release-and-rollback"],
36
38
  "work-unit.release-and-rollback": [],
37
39
  "work-unit.plan-opportunity": ["work-unit.plan-requirements", "work-unit.domain-strategy-design", "work-unit.stage-decision", "work-unit.spec-synthesis"],
38
40
  "work-unit.plan-requirements": ["work-unit.domain-strategy-design", "work-unit.stage-decision", "work-unit.spec-synthesis"],
39
41
  "work-unit.domain-strategy-design": ["work-unit.stage-decision", "work-unit.spec-synthesis"],
40
42
  "work-unit.stage-decision": ["work-unit.spec-synthesis"],
41
- "work-unit.spec-synthesis": ["work-unit.prototype-design", "work-unit.technical-analysis"],
42
- "work-unit.prototype-design": ["work-unit.technical-analysis"],
43
+ "work-unit.spec-synthesis": ["work-unit.prototype-design-v2", "work-unit.technical-analysis"],
44
+ "work-unit.prototype-design-v2": ["work-unit.technical-analysis"],
43
45
  "work-unit.technical-analysis": [REPOSITORY_PREPARATION_WORK_UNIT],
44
- [REPOSITORY_PREPARATION_WORK_UNIT]: [TICKET_DECOMPOSITION_WORK_UNIT],
46
+ [REPOSITORY_PREPARATION_WORK_UNIT]: [SERVICE_INITIALIZATION_WORK_UNIT, TICKET_DECOMPOSITION_WORK_UNIT],
47
+ [SERVICE_INITIALIZATION_WORK_UNIT]: [REPOSITORY_PREPARATION_WORK_UNIT],
45
48
  [TICKET_DECOMPOSITION_WORK_UNIT]: [IMPLEMENTATION_WORK_UNIT],
46
49
  [IMPLEMENTATION_WORK_UNIT]: ["work-unit.frontend-implementation-verification", "work-unit.code-review"],
47
50
  "work-unit.frontend-implementation-verification": ["work-unit.code-review"],
@@ -83,6 +86,8 @@ const BLOCKING_SIGNALS = Object.freeze({
83
86
  backendDesignPrerequisitesMissing: "backend-design-prerequisites-missing",
84
87
  legacyScaffoldReconciliationRequired: "legacy-scaffold-reconciliation-required",
85
88
  prematureImplementationDetected: "premature-implementation-detected",
89
+ serviceInitializationInvalid: "service-project-initialization-invalid",
90
+ serviceInitializationIncomplete: "service-project-initialization-incomplete",
86
91
  });
87
92
 
88
93
  const allowedResult = (evidenceRefs = []) => ({
@@ -121,6 +126,52 @@ function readDecompositionResult(ref, read) {
121
126
  }
122
127
  }
123
128
 
129
+ /** The service branch reuses the approved v4 scaffold contract and its real verification. */
130
+ export function validateServiceProjectInitialization(state, { root = ROOT, exists = existsSync, read = (ref) => readFileSync(ref, "utf8"), completed = false } = {}) {
131
+ const request = state?.service_project_initialization;
132
+ const resolved = ref => path.isAbsolute(ref) ? ref : path.resolve(root, ref);
133
+ const present = ref => hasText(ref) && exists(resolved(ref));
134
+ const contents = ref => read(resolved(ref));
135
+ const document = ref => readDecompositionResult(resolved(ref), contents);
136
+ const blocked = (detail, incomplete = false) => blockedResult(
137
+ [incomplete ? BLOCKING_SIGNALS.serviceInitializationIncomplete : BLOCKING_SIGNALS.serviceInitializationInvalid], [detail]);
138
+ if (!request || !hasText(request.project_id) || !hasText(request.contract_ref) || !hasText(request.contract_digest) || !hasText(request.project_root)) return blocked("project_id, contract_ref, contract_digest and project_root required");
139
+ const contractFile = resolved(request.contract_ref);
140
+ if (!present(contractFile)) return blocked("approved v4 scaffold contract must be readable");
141
+ let contractBytes;
142
+ try { contractBytes = contents(contractFile); } catch { return blocked("approved v4 scaffold contract must be readable"); }
143
+ const contract = document(contractFile);
144
+ if (!contract || request.contract_digest !== `sha256:${createHash("sha256").update(contractBytes).digest("hex")}`) return blocked("current scaffold contract digest mismatch");
145
+ try { validateJsonSchema(contract, path.join(ROOT, ".template-spec/process/schemas/project-scaffold-contract.schema.json")); }
146
+ catch (error) { return blocked(`scaffold contract schema: ${error.message}`); }
147
+ if (contract.schema_version !== 4 || contract.status !== "approved" || contract.current_version !== true || !hasText(contract.persisted_ref) || contract.architecture_profile !== "mvc-data-analysis-v1" || contract.scaffold_kind !== "backend-mvc-data-analysis" || contract.generator_skill !== "yss-layered-mvc-scaffold-generator" || contract.init_git !== true || contract.project_name !== request.project_id || path.resolve(contract.target_output_dir, contract.project_name) !== path.resolve(request.project_root)) return blocked("current approved mvc-data-analysis-v1 initialization contract required");
148
+ const contractRoot = path.dirname(contractFile);
149
+ const contractExists = ref => exists(path.isAbsolute(ref) ? ref : path.resolve(contractRoot, ref));
150
+ if (!backendDesignPrerequisitesReady(contract.design_prerequisites, contractExists, contractRoot, request.project_id)) return blocked("current technical, data, API and engineering approval bindings required");
151
+ const handoff = path.resolve(path.dirname(contractFile), contract.context_handoff_ref ?? "");
152
+ if (!handoff.startsWith(`${path.dirname(contractFile)}${path.sep}`) || !present(handoff)) return blocked("CONTEXT handoff must be inside the contract directory");
153
+ let handoffBytes;
154
+ try { handoffBytes = contents(handoff); } catch { return blocked("CONTEXT handoff must be readable"); }
155
+ const handoffDigest = `sha256:${createHash("sha256").update(handoffBytes).digest("hex")}`;
156
+ if (contract.context_handoff_digest !== handoffDigest || request.context_handoff_digest !== handoffDigest) return blocked("CONTEXT handoff digest mismatch");
157
+ if (!completed) {
158
+ if (present(request.project_root)) return blocked("service project already exists; initialization is not repeatable");
159
+ return allowedResult([request.contract_ref, contract.context_handoff_ref]);
160
+ }
161
+ for (const field of ["manifest_ref", "verification_ref", "result_ref"]) if (!present(request[field])) return blocked(`${field} must be readable`, true);
162
+ const manifest = document(request.manifest_ref);
163
+ const verification = document(request.verification_ref);
164
+ const result = document(request.result_ref);
165
+ if (result?.result_schema !== "workflow-execution-result-v1" || result.work_unit !== SERVICE_INITIALIZATION_WORK_UNIT || result.result !== "completed" || ![request.manifest_ref, request.verification_ref].every(ref => result.evidence_refs?.includes(ref))) return blocked("completed Workflow Execution Result with manifest and verification evidence required", true);
166
+ if (manifest?.schema_version !== 4 || manifest.kind !== "service-project-initialization" || manifest.architecture_profile !== "mvc-data-analysis-v1" || manifest.project_name !== request.project_id || manifest.contract_digest !== request.contract_digest || manifest.completion_level !== "empty-scaffold-verified") return blocked("current v4 service Manifest required", true);
167
+ const phases = ["validate", "test", "package"];
168
+ if (verification?.status !== "passed" || verification.completion_level !== "empty-scaffold-verified" || path.resolve(verification.project_root ?? "") !== path.resolve(request.project_root) || !Array.isArray(verification.commands) || phases.some(phase => !verification.commands.some(item => item.phase === phase && item.exit_code === 0 && item.command?.startsWith(`./mvnw ${phase}`) && present(item.stdout_ref) && present(item.stderr_ref)))) return blocked("real Maven Wrapper validate/test/package evidence required", true);
169
+ const childContext = path.join(request.project_root, "CONTEXT.md");
170
+ const initialization = document(path.join(request.project_root, ".template-spec/process/service-initialization.json"));
171
+ if (!present(childContext) || !present(path.join(request.project_root, ".git")) || !present(path.join(path.dirname(request.project_root), "skillUtils/skills-lock.json")) || contents(childContext) !== handoffBytes || initialization?.contract_id !== contract.contract_id || initialization.context_handoff_digest !== handoffDigest) return blocked("child project identity, CONTEXT and skillUtils must match the contract", true);
172
+ return allowedResult([request.result_ref, request.manifest_ref, request.verification_ref]);
173
+ }
174
+
124
175
  function artifactBindingReady(binding, exists) {
125
176
  return hasText(binding?.ref) && /^v[1-9][0-9]*$/.test(binding?.version ?? "") && /^sha256:[a-f0-9]{64}$/.test(binding?.digest ?? "") && isReadable(binding.ref, exists);
126
177
  }
@@ -271,7 +322,7 @@ export function validateNextRoute(currentWorkUnit, nextRoute, decisionState, opt
271
322
  }
272
323
  const routes = NEXT_ROUTES[currentWorkUnit] && scopedNextRoutes(currentWorkUnit, NEXT_ROUTES[currentWorkUnit], options);
273
324
  if (!routes) return blockedResult([BLOCKING_SIGNALS.invalidRoute], ["known_current_work_unit"]);
274
- if (nextRoute === REPOSITORY_PREPARATION_WORK_UNIT && currentWorkUnit !== "work-unit.technical-analysis") {
325
+ if (nextRoute === REPOSITORY_PREPARATION_WORK_UNIT && !["work-unit.technical-analysis", SERVICE_INITIALIZATION_WORK_UNIT].includes(currentWorkUnit)) {
275
326
  return blockedResult([BLOCKING_SIGNALS.technicalAnalysisRequired], ["work-unit.technical-analysis predecessor"]);
276
327
  }
277
328
  if (nextRoute === null && routes.length === 0) {
@@ -285,6 +336,12 @@ export function validateNextRoute(currentWorkUnit, nextRoute, decisionState, opt
285
336
  }
286
337
  return blockedResult(signals, ["allowed_next_route"]);
287
338
  }
339
+ if (nextRoute === SERVICE_INITIALIZATION_WORK_UNIT) {
340
+ return validateServiceProjectInitialization(decisionState, { ...options, completed: false });
341
+ }
342
+ if (currentWorkUnit === SERVICE_INITIALIZATION_WORK_UNIT && nextRoute === REPOSITORY_PREPARATION_WORK_UNIT) {
343
+ return validateServiceProjectInitialization(decisionState, { ...options, completed: true });
344
+ }
288
345
  if (nextRoute === REPOSITORY_PREPARATION_WORK_UNIT) {
289
346
  const analysis = validateTechnicalAnalysisCompletion(decisionState, options);
290
347
  if (analysis.result === "blocked") return analysis;
@@ -294,6 +351,10 @@ export function validateNextRoute(currentWorkUnit, nextRoute, decisionState, opt
294
351
  if (entry.result === 'blocked' || nextRoute === 'work-unit.spec-synthesis') return entry;
295
352
  }
296
353
  if (nextRoute === TICKET_DECOMPOSITION_WORK_UNIT) {
354
+ if (decisionState?.service_project_initialization) {
355
+ const service = validateServiceProjectInitialization(decisionState, { ...options, completed: true });
356
+ if (service.result === "blocked") return service;
357
+ }
297
358
  const readiness = validateImplementationRepositoriesReady(decisionState, options);
298
359
  if (readiness.result === "blocked") return readiness;
299
360
  }
@@ -83,7 +83,7 @@ function verifyOperations(document, resolveReference) {
83
83
  }
84
84
  }
85
85
 
86
- export function validateOpenApiDraftValidationRecord(recordFile, { root = TEMPLATE_ROOT, allowTemplate = false, schemaPath = path.join(TEMPLATE_ROOT, "docs/process/schemas/openapi-draft-validation-record.schema.json") } = {}) {
86
+ export function validateOpenApiDraftValidationRecord(recordFile, { root = TEMPLATE_ROOT, allowTemplate = false, schemaPath = path.join(TEMPLATE_ROOT, ".template-spec/process/schemas/openapi-draft-validation-record.schema.json") } = {}) {
87
87
  const projectRoot = path.resolve(root);
88
88
  const recordDocument = parseDocument(readFileSync(recordFile, "utf8"), { uniqueKeys: true, maxAliasCount: 0 });
89
89
  ensure(!recordDocument.errors.length, `validation record YAML 无效: ${recordDocument.errors[0]?.message}`);
@@ -0,0 +1,48 @@
1
+ import { createHash } from 'node:crypto';
2
+ import { readFileSync } from 'node:fs';
3
+ import path from 'node:path';
4
+ import { parseDocument } from '../vendor/yaml.mjs';
5
+ import { safeTrackingPath } from './stage-tracking.mjs';
6
+
7
+ const digest = bytes => `sha256:${createHash('sha256').update(bytes).digest('hex')}`;
8
+ const read = (root, ref) => readFileSync(safeTrackingPath(root, ref));
9
+ const parse = bytes => {
10
+ const document = parseDocument(String(bytes), { uniqueKeys: true, maxAliasCount: 0 });
11
+ if (document.errors.length) throw new TypeError(document.errors[0].message);
12
+ return document.toJS({ maxAliasCount: 0 });
13
+ };
14
+
15
+ /** Draft data only: no checks, impacts, approvals or user decisions are inferred. */
16
+ export function preparePlanSpecEntry({ root, featureId, planRef, contextRef }) {
17
+ if (![root, featureId, planRef, contextRef].every(value => typeof value === 'string' && value.trim())) throw new TypeError('root, feature, plan and context-reconciliation are required');
18
+ const identity = parse(read(root, 'yss-project.yaml'));
19
+ if (identity.schema_version !== 1 || identity.repository_mode !== 'project-instance') throw new TypeError('Plan 入口仅适用于 project-instance');
20
+ const registryRef = '.template-spec/process/lifecycle-registry.yaml';
21
+ const registry = parse(read(root, registryRef));
22
+ const policy = registry.stages?.find(stage => stage.id === 'stage.plan')?.spec_entry;
23
+ if (!policy?.required_checks?.length) throw new TypeError('Plan 入口检查合同缺失');
24
+ const refs = [...new Set([planRef, 'CONTEXT.md', registryRef, contextRef])];
25
+ const basis = refs.map(ref => ({ ref, digest: digest(read(root, ref)) }));
26
+ const review_candidate = {
27
+ schema_version: 1, kind: 'plan-entry-review', gate_id: 'gate.plan-approved', feature_id: featureId,
28
+ plan_ref: planRef, context_reconciliation_ref: contextRef, basis,
29
+ checks: Object.fromEntries(policy.required_checks.map(id => [id, { status: 'pending', evidence_refs: [] }])),
30
+ open_items: [],
31
+ impacts: Object.fromEntries(Object.values(policy.check_impacts ?? {}).map(impact => [impact, null])),
32
+ internal_checks: Object.fromEntries(Object.keys(policy.check_impacts ?? {}).map(id => [id, { status: 'pending', evidence_refs: [] }])),
33
+ };
34
+ return { schema_version: 1, status: 'draft', review_candidate, missing_requirements: ['补齐检查证据与影响判断', '展示当前审阅包并提供真实用户决定,或按用户决定协议核验绑定当前范围的 plan_continuation_ref;未知或实质变化须重新决定'], approval_created: false };
35
+ }
36
+
37
+ export function diffPlanSpecEntry({ root, reviewRef }) {
38
+ if (!root || !reviewRef) throw new TypeError('root and review are required');
39
+ const review = parse(read(root, reviewRef));
40
+ if (review.kind !== 'plan-entry-review' || review.schema_version !== 1 || !Array.isArray(review.basis)) throw new TypeError('不是 Plan 入口审阅包');
41
+ const changed_refs = [], missing_refs = [];
42
+ for (const item of review.basis) {
43
+ if (!item?.ref || !item?.digest) throw new TypeError('basis 缺少 ref 或 digest');
44
+ try { if (digest(read(root, item.ref)) !== item.digest) changed_refs.push(item.ref); }
45
+ catch { missing_refs.push(item.ref); }
46
+ }
47
+ return { schema_version: 1, review_ref: reviewRef, status: changed_refs.length || missing_refs.length ? 'stale' : 'current', changed_refs, missing_refs, approval_created: false };
48
+ }
@@ -7,7 +7,7 @@ const fail = message => { throw new TypeError(`plan-spec-entry-blocked: ${messag
7
7
  const text = value => typeof value === 'string' && value.trim().length > 0;
8
8
 
9
9
  export function planEntryPolicy(options = {}) {
10
- const registry = decisionIO(options).document('docs/process/lifecycle-registry.yaml');
10
+ const registry = decisionIO(options).document('.template-spec/process/lifecycle-registry.yaml');
11
11
  const policy = registry.stages.find(stage => stage.id === 'stage.plan')?.spec_entry;
12
12
  if (!policy?.required_checks?.length || !policy?.gate_impacts) fail('缺少 Plan 入口策略');
13
13
  const gateIds = registry.gates.filter(gate => gate.stage === 'stage.plan').map(gate => gate.id).sort();
@@ -33,7 +33,7 @@ export function assertPlanSpecEntry(state, options = {}) {
33
33
  const evidence = refs => {
34
34
  if (!Array.isArray(refs) || !refs.length || refs.some(ref => !basis.has(ref))) fail('检查项缺少当前依据');
35
35
  };
36
- for (const ref of [review.plan_ref, 'CONTEXT.md', 'docs/process/lifecycle-registry.yaml', review.context_reconciliation_ref]) {
36
+ for (const ref of [review.plan_ref, 'CONTEXT.md', '.template-spec/process/lifecycle-registry.yaml', review.context_reconciliation_ref]) {
37
37
  if (!basis.has(ref)) fail(`必需依据未绑定: ${ref}`);
38
38
  }
39
39
  if (Object.keys(review.checks || {}).length !== policy.required_checks.length) fail('检查项缺失或存在未知项');
@@ -62,7 +62,7 @@ export function assertPlanSpecEntry(state, options = {}) {
62
62
  } else if (gate.status !== 'not-applicable' || !text(gate.reason)) fail(`未命中门禁须有原因和依据: ${gateId}`);
63
63
  }
64
64
  // 门禁依赖不能通过将上游标成 N/A 来跳过。
65
- const registry = io.document('docs/process/lifecycle-registry.yaml');
65
+ const registry = io.document('.template-spec/process/lifecycle-registry.yaml');
66
66
  for (const gate of registry.checks.filter(gate => gate.stage === 'stage.plan')) {
67
67
  if (review.internal_checks[gate.id]?.status === 'approved') {
68
68
  for (const dependency of gate.requires_checks || []) if (review.internal_checks[dependency]?.status !== 'approved') fail(`门禁依赖未批准: ${dependency}`);