create-yss-spec 3.5.0 → 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 (513) hide show
  1. package/README.md +6 -2
  2. package/package.json +1 -1
  3. package/src/api/_sync-service.js +31 -6
  4. package/src/cli/args.js +2 -0
  5. package/src/cli/help.js +4 -1
  6. package/src/commands/attach.js +9 -3
  7. package/src/commands/diff.js +1 -0
  8. package/src/commands/doctor.js +1 -0
  9. package/src/commands/init.js +2 -1
  10. package/src/commands/sync.js +1 -0
  11. package/src/family-identity.js +1 -1
  12. package/src/template/asset-runtime.js +57 -49
  13. package/src/template/attach-planner.js +1 -1
  14. package/src/template/distribution-runtime.js +9 -9
  15. package/src/template/instance-runtime.js +9 -9
  16. package/src/template/layout-migration.js +160 -0
  17. package/src/template/migration-runtime.js +2 -2
  18. package/src/template/sync-planner.js +1 -1
  19. package/template/.agents/rules/yss-ai-skills.md +1 -1
  20. package/template/.agents/skills/.strategic-design-skills-manifest.json +7 -8
  21. package/template/.agents/skills/.yss-skills-manifest.json +2 -2
  22. package/template/.agents/skills/alibaba-java-code-style/SKILL.md +1 -1
  23. package/template/.agents/skills/code-review/SKILL.md +6 -6
  24. package/template/.agents/skills/code-review/references/yss-review-standards.md +1 -1
  25. package/template/.agents/skills/cross-repo-implementation-routing/SKILL.md +2 -2
  26. package/template/.agents/skills/i-have-adhd/SKILL.md +1 -1
  27. package/template/.agents/skills/i-have-adhd/references/yss-adaptation.md +1 -1
  28. package/template/.agents/skills/i-have-adhd/tests/verify-integration.mjs +2 -2
  29. package/template/.agents/skills/implementation-repo-onboarding/SKILL.md +2 -2
  30. package/template/.agents/skills/llm-wiki/references/discover.md +3 -3
  31. package/template/.agents/skills/prototype-review/SKILL.md +4 -4
  32. package/template/.agents/skills/setup-matt-pocock-skills/SKILL.md +10 -10
  33. package/template/.agents/skills/triage/SKILL.md +1 -1
  34. package/template/.agents/skills/yss-application/references/profiles/layered-mvc-service.md +1 -1
  35. package/template/.agents/skills/yss-application/references/profiles/mvc-data-analysis-v1.md +1 -1
  36. package/template/.agents/skills/yss-backend-spec-review/SKILL.md +1 -1
  37. package/template/.agents/skills/yss-backend-spec-review/references/check-inputs.md +1 -1
  38. package/template/.agents/skills/yss-ddd-scaffold-generator/SKILL.md +2 -2
  39. package/template/.agents/skills/yss-ddd-scaffold-generator/scripts/generate_scaffold.mjs +1 -1
  40. package/template/.agents/skills/yss-design-system/SKILL.md +10 -10
  41. package/template/.agents/skills/yss-design-system/references/design-qa-theme.md +3 -3
  42. package/template/.agents/skills/yss-design-system/references/design-system.md +3 -3
  43. package/template/.agents/skills/yss-exception/SKILL.md +1 -1
  44. package/template/.agents/skills/yss-frontend-scaffold-generator/SKILL.md +2 -2
  45. package/template/.agents/skills/yss-frontend-scaffold-generator/scripts/generate_scaffold.mjs +1 -1
  46. package/template/.agents/skills/yss-frontend-scaffold-generator/scripts/refresh_baseline.mjs +2 -2
  47. package/template/.agents/skills/yss-implementation-contract-compiler/SKILL.md +9 -9
  48. package/template/.agents/skills/yss-implementation-contract-compiler/references/boundaries.md +1 -1
  49. package/template/.agents/skills/yss-implementation-contract-compiler/references/compiler-contract.yaml +9 -9
  50. package/template/.agents/skills/yss-implementation-contract-compiler/references/slice-implementation-contract-v2.md +3 -3
  51. package/template/.agents/skills/yss-implementation-contract-compiler/references/slice-implementation-contract.md +1 -1
  52. package/template/.agents/skills/yss-implementation-contract-compiler/references/strategic-handoff-routing.md +1 -1
  53. package/template/.agents/skills/yss-layered-mvc-scaffold-generator/SKILL.md +2 -2
  54. package/template/.agents/skills/yss-layered-mvc-scaffold-generator/scripts/data-analysis-profile.mjs +5 -5
  55. package/template/.agents/skills/yss-layered-mvc-scaffold-generator/scripts/generate_scaffold.mjs +2 -2
  56. package/template/.agents/skills/yss-layered-mvc-scaffold-generator/scripts/scaffold-generator.test.mjs +42 -0
  57. package/template/.agents/skills/yss-openapi-draft-review/SKILL.md +2 -2
  58. package/template/.agents/skills/yss-openapi-governance/SKILL.md +7 -7
  59. package/template/.agents/skills/yss-product-lifecycle/SKILL.md +11 -11
  60. package/template/.agents/skills/yss-product-lifecycle/references/matt-yss-adapter.md +5 -5
  61. package/template/.agents/skills/yss-product-lifecycle/references/orchestration-contract.yaml +65 -43
  62. package/template/.agents/skills/yss-product-lifecycle/references/orchestration.md +22 -14
  63. package/template/.agents/skills/yss-product-lifecycle/references/request-triage.md +2 -0
  64. package/template/.agents/skills/yss-product-lifecycle/references/state-model.md +3 -3
  65. package/template/.agents/skills/yss-product-lifecycle/references/user-decisions.md +2 -2
  66. package/template/.agents/skills/yss-prototype-stage/SKILL.md +7 -7
  67. package/template/.agents/skills/yss-prototype-stage/references/existing-ui-entry.md +1 -1
  68. package/template/.agents/skills/yss-prototype-stage/scripts/build-antd-prototype.mjs +1 -1
  69. package/template/.agents/skills/yss-prototype-stage/scripts/offline-html.mjs +3 -3
  70. package/template/.agents/skills/yss-prototype-stage/tests/browser-smoke.mjs +2 -2
  71. package/template/.agents/skills/yss-prototype-stage/tests/run-scenarios.mjs +4 -4
  72. package/template/.agents/skills/yss-prototype-stage/tests/workbench-smoke.mjs +1 -1
  73. package/template/.agents/skills/yss-repository/SKILL.md +2 -2
  74. package/template/.agents/skills/yss-repository/references/profiles/layered-mvc-service.md +1 -1
  75. package/template/.agents/skills/yss-repository/references/profiles/mvc-data-analysis-v1.md +1 -1
  76. package/template/.agents/skills/yss-repository/tests/profile-routing.test.mjs +2 -2
  77. package/template/.agents/skills/yss-research/SKILL.md +2 -2
  78. package/template/.agents/skills/yss-skill-source-index-refresh/references/backend-component-platform-compatibility.md +1 -1
  79. package/template/.agents/skills/yss-stage-decision/SKILL.md +5 -5
  80. package/template/.agents/skills/yss-stage-decision/references/domain-strategy-contract.md +1 -1
  81. package/template/.agents/skills/yss-stage-decision/references/strategic-handoff-routing.md +1 -1
  82. package/template/.agents/skills/yss-tactical-design/SKILL.md +2 -2
  83. package/template/.agents/skills/yss-tactical-design/references/strategic-handoff-routing.md +1 -1
  84. package/template/.agents/skills/yss-tactical-design/references/tactical-design-contract.md +1 -1
  85. package/template/.agents/skills/yss-technical-design/SKILL.md +6 -6
  86. package/template/.agents/skills/yss-technical-design/references/technical-design-contract.md +1 -1
  87. package/template/.agents/skills/yss-ui/SKILL.md +1 -1
  88. package/template/.agents/skills/yss-up-springboot3/SKILL.md +1 -1
  89. package/template/.agents/skills/yss-web-controller/SKILL.md +1 -1
  90. package/template/.agents/skills/yss-web-controller/references/profiles/layered-mvc-service.md +1 -1
  91. package/template/.codex/skills/alibaba-java-code-style/SKILL.md +1 -1
  92. package/template/.codex/skills/code-review/SKILL.md +6 -6
  93. package/template/.codex/skills/code-review/references/yss-review-standards.md +1 -1
  94. package/template/.codex/skills/cross-repo-implementation-routing/SKILL.md +2 -2
  95. package/template/.codex/skills/i-have-adhd/SKILL.md +1 -1
  96. package/template/.codex/skills/i-have-adhd/references/yss-adaptation.md +1 -1
  97. package/template/.codex/skills/i-have-adhd/tests/verify-integration.mjs +2 -2
  98. package/template/.codex/skills/implementation-repo-onboarding/SKILL.md +2 -2
  99. package/template/.codex/skills/llm-wiki/references/discover.md +3 -3
  100. package/template/.codex/skills/prototype-review/SKILL.md +4 -4
  101. package/template/.codex/skills/setup-matt-pocock-skills/SKILL.md +10 -10
  102. package/template/.codex/skills/triage/SKILL.md +1 -1
  103. package/template/.codex/skills/yss-application/references/profiles/layered-mvc-service.md +1 -1
  104. package/template/.codex/skills/yss-application/references/profiles/mvc-data-analysis-v1.md +1 -1
  105. package/template/.codex/skills/yss-backend-spec-review/SKILL.md +1 -1
  106. package/template/.codex/skills/yss-backend-spec-review/references/check-inputs.md +1 -1
  107. package/template/.codex/skills/yss-ddd-scaffold-generator/SKILL.md +2 -2
  108. package/template/.codex/skills/yss-ddd-scaffold-generator/scripts/generate_scaffold.mjs +1 -1
  109. package/template/.codex/skills/yss-design-system/SKILL.md +10 -10
  110. package/template/.codex/skills/yss-design-system/references/design-qa-theme.md +3 -3
  111. package/template/.codex/skills/yss-design-system/references/design-system.md +3 -3
  112. package/template/.codex/skills/yss-exception/SKILL.md +1 -1
  113. package/template/.codex/skills/yss-frontend-scaffold-generator/SKILL.md +2 -2
  114. package/template/.codex/skills/yss-frontend-scaffold-generator/scripts/generate_scaffold.mjs +1 -1
  115. package/template/.codex/skills/yss-frontend-scaffold-generator/scripts/refresh_baseline.mjs +2 -2
  116. package/template/.codex/skills/yss-implementation-contract-compiler/SKILL.md +9 -9
  117. package/template/.codex/skills/yss-implementation-contract-compiler/references/boundaries.md +1 -1
  118. package/template/.codex/skills/yss-implementation-contract-compiler/references/compiler-contract.yaml +9 -9
  119. package/template/.codex/skills/yss-implementation-contract-compiler/references/slice-implementation-contract-v2.md +3 -3
  120. package/template/.codex/skills/yss-implementation-contract-compiler/references/slice-implementation-contract.md +1 -1
  121. package/template/.codex/skills/yss-implementation-contract-compiler/references/strategic-handoff-routing.md +1 -1
  122. package/template/.codex/skills/yss-layered-mvc-scaffold-generator/SKILL.md +2 -2
  123. package/template/.codex/skills/yss-layered-mvc-scaffold-generator/scripts/data-analysis-profile.mjs +5 -5
  124. package/template/.codex/skills/yss-layered-mvc-scaffold-generator/scripts/generate_scaffold.mjs +2 -2
  125. package/template/.codex/skills/yss-layered-mvc-scaffold-generator/scripts/scaffold-generator.test.mjs +42 -0
  126. package/template/.codex/skills/yss-openapi-draft-review/SKILL.md +2 -2
  127. package/template/.codex/skills/yss-openapi-governance/SKILL.md +7 -7
  128. package/template/.codex/skills/yss-product-lifecycle/SKILL.md +11 -11
  129. package/template/.codex/skills/yss-product-lifecycle/references/matt-yss-adapter.md +5 -5
  130. package/template/.codex/skills/yss-product-lifecycle/references/orchestration-contract.yaml +65 -43
  131. package/template/.codex/skills/yss-product-lifecycle/references/orchestration.md +22 -14
  132. package/template/.codex/skills/yss-product-lifecycle/references/request-triage.md +2 -0
  133. package/template/.codex/skills/yss-product-lifecycle/references/state-model.md +3 -3
  134. package/template/.codex/skills/yss-product-lifecycle/references/user-decisions.md +2 -2
  135. package/template/.codex/skills/yss-prototype-stage/SKILL.md +7 -7
  136. package/template/.codex/skills/yss-prototype-stage/references/existing-ui-entry.md +1 -1
  137. package/template/.codex/skills/yss-prototype-stage/scripts/build-antd-prototype.mjs +1 -1
  138. package/template/.codex/skills/yss-prototype-stage/scripts/offline-html.mjs +3 -3
  139. package/template/.codex/skills/yss-prototype-stage/tests/browser-smoke.mjs +2 -2
  140. package/template/.codex/skills/yss-prototype-stage/tests/run-scenarios.mjs +4 -4
  141. package/template/.codex/skills/yss-prototype-stage/tests/workbench-smoke.mjs +1 -1
  142. package/template/.codex/skills/yss-repository/SKILL.md +2 -2
  143. package/template/.codex/skills/yss-repository/references/profiles/layered-mvc-service.md +1 -1
  144. package/template/.codex/skills/yss-repository/references/profiles/mvc-data-analysis-v1.md +1 -1
  145. package/template/.codex/skills/yss-repository/tests/profile-routing.test.mjs +2 -2
  146. package/template/.codex/skills/yss-research/SKILL.md +2 -2
  147. package/template/.codex/skills/yss-skill-source-index-refresh/references/backend-component-platform-compatibility.md +1 -1
  148. package/template/.codex/skills/yss-stage-decision/SKILL.md +5 -5
  149. package/template/.codex/skills/yss-stage-decision/references/domain-strategy-contract.md +1 -1
  150. package/template/.codex/skills/yss-stage-decision/references/strategic-handoff-routing.md +1 -1
  151. package/template/.codex/skills/yss-tactical-design/SKILL.md +2 -2
  152. package/template/.codex/skills/yss-tactical-design/references/strategic-handoff-routing.md +1 -1
  153. package/template/.codex/skills/yss-tactical-design/references/tactical-design-contract.md +1 -1
  154. package/template/.codex/skills/yss-technical-design/SKILL.md +6 -6
  155. package/template/.codex/skills/yss-technical-design/references/technical-design-contract.md +1 -1
  156. package/template/.codex/skills/yss-ui/SKILL.md +1 -1
  157. package/template/.codex/skills/yss-up-springboot3/SKILL.md +1 -1
  158. package/template/.codex/skills/yss-web-controller/SKILL.md +1 -1
  159. package/template/.codex/skills/yss-web-controller/references/profiles/layered-mvc-service.md +1 -1
  160. package/template/.cursor/skills/alibaba-java-code-style/SKILL.md +1 -1
  161. package/template/.cursor/skills/code-review/SKILL.md +6 -6
  162. package/template/.cursor/skills/code-review/references/yss-review-standards.md +1 -1
  163. package/template/.cursor/skills/cross-repo-implementation-routing/SKILL.md +2 -2
  164. package/template/.cursor/skills/i-have-adhd/SKILL.md +1 -1
  165. package/template/.cursor/skills/i-have-adhd/references/yss-adaptation.md +1 -1
  166. package/template/.cursor/skills/i-have-adhd/tests/verify-integration.mjs +2 -2
  167. package/template/.cursor/skills/implementation-repo-onboarding/SKILL.md +2 -2
  168. package/template/.cursor/skills/llm-wiki/references/discover.md +3 -3
  169. package/template/.cursor/skills/prototype-review/SKILL.md +4 -4
  170. package/template/.cursor/skills/setup-matt-pocock-skills/SKILL.md +10 -10
  171. package/template/.cursor/skills/triage/SKILL.md +1 -1
  172. package/template/.cursor/skills/yss-application/references/profiles/layered-mvc-service.md +1 -1
  173. package/template/.cursor/skills/yss-application/references/profiles/mvc-data-analysis-v1.md +1 -1
  174. package/template/.cursor/skills/yss-backend-spec-review/SKILL.md +1 -1
  175. package/template/.cursor/skills/yss-backend-spec-review/references/check-inputs.md +1 -1
  176. package/template/.cursor/skills/yss-ddd-scaffold-generator/SKILL.md +2 -2
  177. package/template/.cursor/skills/yss-ddd-scaffold-generator/scripts/generate_scaffold.mjs +1 -1
  178. package/template/.cursor/skills/yss-design-system/SKILL.md +10 -10
  179. package/template/.cursor/skills/yss-design-system/references/design-qa-theme.md +3 -3
  180. package/template/.cursor/skills/yss-design-system/references/design-system.md +3 -3
  181. package/template/.cursor/skills/yss-exception/SKILL.md +1 -1
  182. package/template/.cursor/skills/yss-frontend-scaffold-generator/SKILL.md +2 -2
  183. package/template/.cursor/skills/yss-frontend-scaffold-generator/scripts/generate_scaffold.mjs +1 -1
  184. package/template/.cursor/skills/yss-frontend-scaffold-generator/scripts/refresh_baseline.mjs +2 -2
  185. package/template/.cursor/skills/yss-implementation-contract-compiler/SKILL.md +9 -9
  186. package/template/.cursor/skills/yss-implementation-contract-compiler/references/boundaries.md +1 -1
  187. package/template/.cursor/skills/yss-implementation-contract-compiler/references/compiler-contract.yaml +9 -9
  188. package/template/.cursor/skills/yss-implementation-contract-compiler/references/slice-implementation-contract-v2.md +3 -3
  189. package/template/.cursor/skills/yss-implementation-contract-compiler/references/slice-implementation-contract.md +1 -1
  190. package/template/.cursor/skills/yss-implementation-contract-compiler/references/strategic-handoff-routing.md +1 -1
  191. package/template/.cursor/skills/yss-layered-mvc-scaffold-generator/SKILL.md +2 -2
  192. package/template/.cursor/skills/yss-layered-mvc-scaffold-generator/scripts/data-analysis-profile.mjs +5 -5
  193. package/template/.cursor/skills/yss-layered-mvc-scaffold-generator/scripts/generate_scaffold.mjs +2 -2
  194. package/template/.cursor/skills/yss-layered-mvc-scaffold-generator/scripts/scaffold-generator.test.mjs +42 -0
  195. package/template/.cursor/skills/yss-openapi-draft-review/SKILL.md +2 -2
  196. package/template/.cursor/skills/yss-openapi-governance/SKILL.md +7 -7
  197. package/template/.cursor/skills/yss-product-lifecycle/SKILL.md +11 -11
  198. package/template/.cursor/skills/yss-product-lifecycle/references/matt-yss-adapter.md +5 -5
  199. package/template/.cursor/skills/yss-product-lifecycle/references/orchestration-contract.yaml +65 -43
  200. package/template/.cursor/skills/yss-product-lifecycle/references/orchestration.md +22 -14
  201. package/template/.cursor/skills/yss-product-lifecycle/references/request-triage.md +2 -0
  202. package/template/.cursor/skills/yss-product-lifecycle/references/state-model.md +3 -3
  203. package/template/.cursor/skills/yss-product-lifecycle/references/user-decisions.md +2 -2
  204. package/template/.cursor/skills/yss-prototype-stage/SKILL.md +7 -7
  205. package/template/.cursor/skills/yss-prototype-stage/references/existing-ui-entry.md +1 -1
  206. package/template/.cursor/skills/yss-prototype-stage/scripts/build-antd-prototype.mjs +1 -1
  207. package/template/.cursor/skills/yss-prototype-stage/scripts/offline-html.mjs +3 -3
  208. package/template/.cursor/skills/yss-prototype-stage/tests/browser-smoke.mjs +2 -2
  209. package/template/.cursor/skills/yss-prototype-stage/tests/run-scenarios.mjs +4 -4
  210. package/template/.cursor/skills/yss-prototype-stage/tests/workbench-smoke.mjs +1 -1
  211. package/template/.cursor/skills/yss-repository/SKILL.md +2 -2
  212. package/template/.cursor/skills/yss-repository/references/profiles/layered-mvc-service.md +1 -1
  213. package/template/.cursor/skills/yss-repository/references/profiles/mvc-data-analysis-v1.md +1 -1
  214. package/template/.cursor/skills/yss-repository/tests/profile-routing.test.mjs +2 -2
  215. package/template/.cursor/skills/yss-research/SKILL.md +2 -2
  216. package/template/.cursor/skills/yss-skill-source-index-refresh/references/backend-component-platform-compatibility.md +1 -1
  217. package/template/.cursor/skills/yss-stage-decision/SKILL.md +5 -5
  218. package/template/.cursor/skills/yss-stage-decision/references/domain-strategy-contract.md +1 -1
  219. package/template/.cursor/skills/yss-stage-decision/references/strategic-handoff-routing.md +1 -1
  220. package/template/.cursor/skills/yss-tactical-design/SKILL.md +2 -2
  221. package/template/.cursor/skills/yss-tactical-design/references/strategic-handoff-routing.md +1 -1
  222. package/template/.cursor/skills/yss-tactical-design/references/tactical-design-contract.md +1 -1
  223. package/template/.cursor/skills/yss-technical-design/SKILL.md +6 -6
  224. package/template/.cursor/skills/yss-technical-design/references/technical-design-contract.md +1 -1
  225. package/template/.cursor/skills/yss-ui/SKILL.md +1 -1
  226. package/template/.cursor/skills/yss-up-springboot3/SKILL.md +1 -1
  227. package/template/.cursor/skills/yss-web-controller/SKILL.md +1 -1
  228. package/template/.cursor/skills/yss-web-controller/references/profiles/layered-mvc-service.md +1 -1
  229. package/template/.cursorrules +1 -1
  230. package/template/.pi/skills/alibaba-java-code-style/SKILL.md +1 -1
  231. package/template/.pi/skills/code-review/SKILL.md +6 -6
  232. package/template/.pi/skills/code-review/references/yss-review-standards.md +1 -1
  233. package/template/.pi/skills/cross-repo-implementation-routing/SKILL.md +2 -2
  234. package/template/.pi/skills/i-have-adhd/SKILL.md +1 -1
  235. package/template/.pi/skills/i-have-adhd/references/yss-adaptation.md +1 -1
  236. package/template/.pi/skills/i-have-adhd/tests/verify-integration.mjs +2 -2
  237. package/template/.pi/skills/implementation-repo-onboarding/SKILL.md +2 -2
  238. package/template/.pi/skills/llm-wiki/references/discover.md +3 -3
  239. package/template/.pi/skills/prototype-review/SKILL.md +4 -4
  240. package/template/.pi/skills/setup-matt-pocock-skills/SKILL.md +10 -10
  241. package/template/.pi/skills/triage/SKILL.md +1 -1
  242. package/template/.pi/skills/yss-application/references/profiles/layered-mvc-service.md +1 -1
  243. package/template/.pi/skills/yss-application/references/profiles/mvc-data-analysis-v1.md +1 -1
  244. package/template/.pi/skills/yss-backend-spec-review/SKILL.md +1 -1
  245. package/template/.pi/skills/yss-backend-spec-review/references/check-inputs.md +1 -1
  246. package/template/.pi/skills/yss-ddd-scaffold-generator/SKILL.md +2 -2
  247. package/template/.pi/skills/yss-ddd-scaffold-generator/scripts/generate_scaffold.mjs +1 -1
  248. package/template/.pi/skills/yss-design-system/SKILL.md +10 -10
  249. package/template/.pi/skills/yss-design-system/references/design-qa-theme.md +3 -3
  250. package/template/.pi/skills/yss-design-system/references/design-system.md +3 -3
  251. package/template/.pi/skills/yss-exception/SKILL.md +1 -1
  252. package/template/.pi/skills/yss-frontend-scaffold-generator/SKILL.md +2 -2
  253. package/template/.pi/skills/yss-frontend-scaffold-generator/scripts/generate_scaffold.mjs +1 -1
  254. package/template/.pi/skills/yss-frontend-scaffold-generator/scripts/refresh_baseline.mjs +2 -2
  255. package/template/.pi/skills/yss-implementation-contract-compiler/SKILL.md +9 -9
  256. package/template/.pi/skills/yss-implementation-contract-compiler/references/boundaries.md +1 -1
  257. package/template/.pi/skills/yss-implementation-contract-compiler/references/compiler-contract.yaml +9 -9
  258. package/template/.pi/skills/yss-implementation-contract-compiler/references/slice-implementation-contract-v2.md +3 -3
  259. package/template/.pi/skills/yss-implementation-contract-compiler/references/slice-implementation-contract.md +1 -1
  260. package/template/.pi/skills/yss-implementation-contract-compiler/references/strategic-handoff-routing.md +1 -1
  261. package/template/.pi/skills/yss-layered-mvc-scaffold-generator/SKILL.md +2 -2
  262. package/template/.pi/skills/yss-layered-mvc-scaffold-generator/scripts/data-analysis-profile.mjs +5 -5
  263. package/template/.pi/skills/yss-layered-mvc-scaffold-generator/scripts/generate_scaffold.mjs +2 -2
  264. package/template/.pi/skills/yss-layered-mvc-scaffold-generator/scripts/scaffold-generator.test.mjs +42 -0
  265. package/template/.pi/skills/yss-openapi-draft-review/SKILL.md +2 -2
  266. package/template/.pi/skills/yss-openapi-governance/SKILL.md +7 -7
  267. package/template/.pi/skills/yss-product-lifecycle/SKILL.md +11 -11
  268. package/template/.pi/skills/yss-product-lifecycle/references/matt-yss-adapter.md +5 -5
  269. package/template/.pi/skills/yss-product-lifecycle/references/orchestration-contract.yaml +65 -43
  270. package/template/.pi/skills/yss-product-lifecycle/references/orchestration.md +22 -14
  271. package/template/.pi/skills/yss-product-lifecycle/references/request-triage.md +2 -0
  272. package/template/.pi/skills/yss-product-lifecycle/references/state-model.md +3 -3
  273. package/template/.pi/skills/yss-product-lifecycle/references/user-decisions.md +2 -2
  274. package/template/.pi/skills/yss-prototype-stage/SKILL.md +7 -7
  275. package/template/.pi/skills/yss-prototype-stage/references/existing-ui-entry.md +1 -1
  276. package/template/.pi/skills/yss-prototype-stage/scripts/build-antd-prototype.mjs +1 -1
  277. package/template/.pi/skills/yss-prototype-stage/scripts/offline-html.mjs +3 -3
  278. package/template/.pi/skills/yss-prototype-stage/tests/browser-smoke.mjs +2 -2
  279. package/template/.pi/skills/yss-prototype-stage/tests/run-scenarios.mjs +4 -4
  280. package/template/.pi/skills/yss-prototype-stage/tests/workbench-smoke.mjs +1 -1
  281. package/template/.pi/skills/yss-repository/SKILL.md +2 -2
  282. package/template/.pi/skills/yss-repository/references/profiles/layered-mvc-service.md +1 -1
  283. package/template/.pi/skills/yss-repository/references/profiles/mvc-data-analysis-v1.md +1 -1
  284. package/template/.pi/skills/yss-repository/tests/profile-routing.test.mjs +2 -2
  285. package/template/.pi/skills/yss-research/SKILL.md +2 -2
  286. package/template/.pi/skills/yss-skill-source-index-refresh/references/backend-component-platform-compatibility.md +1 -1
  287. package/template/.pi/skills/yss-stage-decision/SKILL.md +5 -5
  288. package/template/.pi/skills/yss-stage-decision/references/domain-strategy-contract.md +1 -1
  289. package/template/.pi/skills/yss-stage-decision/references/strategic-handoff-routing.md +1 -1
  290. package/template/.pi/skills/yss-tactical-design/SKILL.md +2 -2
  291. package/template/.pi/skills/yss-tactical-design/references/strategic-handoff-routing.md +1 -1
  292. package/template/.pi/skills/yss-tactical-design/references/tactical-design-contract.md +1 -1
  293. package/template/.pi/skills/yss-technical-design/SKILL.md +6 -6
  294. package/template/.pi/skills/yss-technical-design/references/technical-design-contract.md +1 -1
  295. package/template/.pi/skills/yss-ui/SKILL.md +1 -1
  296. package/template/.pi/skills/yss-up-springboot3/SKILL.md +1 -1
  297. package/template/.pi/skills/yss-web-controller/SKILL.md +1 -1
  298. package/template/.pi/skills/yss-web-controller/references/profiles/layered-mvc-service.md +1 -1
  299. package/template/{docs → .template-spec}/adr/README.md +1 -1
  300. package/template/{docs → .template-spec}/agents/README.md +1 -1
  301. package/template/{docs → .template-spec}/agents/backend-architecture-profiles.md +2 -2
  302. package/template/{docs → .template-spec}/agents/digital-human-roles.md +6 -6
  303. package/template/{docs → .template-spec}/agents/digital-human-roles.yaml +5 -5
  304. package/template/{docs → .template-spec}/agents/gitlab-workflow-skills.md +2 -2
  305. package/template/{docs → .template-spec}/agents/issue-tracker.md +1 -1
  306. package/template/{docs → .template-spec}/agents/skill-migrations.md +2 -2
  307. package/template/{docs → .template-spec}/agents/triage-labels.md +1 -1
  308. package/template/{docs → .template-spec}/agents/yss-skill-registry.yaml +2 -2
  309. package/template/{docs → .template-spec}/architecture/README.md +3 -3
  310. package/template/{docs → .template-spec}/architecture/templates/tech-design-template.md +3 -1
  311. package/template/{docs → .template-spec}/design/README.md +12 -11
  312. package/template/{docs → .template-spec}/design/design.md +19 -19
  313. package/template/{docs/design/templates/interaction-spec-template.md → .template-spec/design/templates/examples/model-publishing-interaction.example.md} +5 -3
  314. package/template/{docs/design/templates/state-matrix-template.md → .template-spec/design/templates/examples/model-publishing-state-matrix.example.md} +3 -1
  315. package/template/.template-spec/design/templates/interaction-spec-template.md +61 -0
  316. package/template/{docs → .template-spec}/design/templates/product-overview-design-template.md +11 -11
  317. package/template/{docs → .template-spec}/design/templates/prototype-evidence-template.yaml +4 -4
  318. package/template/{docs → .template-spec}/design/templates/prototype-review-checklist.md +1 -1
  319. package/template/.template-spec/design/templates/state-matrix-template.md +29 -0
  320. package/template/.template-spec/design/tokens/.design-md-projection.json +13 -0
  321. package/template/{docs → .template-spec}/engineering/backend-platforms.md +1 -1
  322. package/template/{docs → .template-spec}/plan/entry-review.md +8 -4
  323. package/template/{docs → .template-spec}/plan/templates/plan-template.md +1 -1
  324. package/template/{docs → .template-spec}/process/contract-reading.md +1 -1
  325. package/template/{docs → .template-spec}/process/lifecycle-artifact-map.md +5 -5
  326. package/template/.template-spec/process/lifecycle-registry-baseline.json +253 -0
  327. package/template/{docs → .template-spec}/process/lifecycle-registry.yaml +19 -12
  328. package/template/{docs → .template-spec}/process/plan-migration.md +1 -1
  329. package/template/{docs → .template-spec}/process/schemas/digital-human-task-package.schema.json +14 -1
  330. package/template/{docs → .template-spec}/process/schemas/lifecycle-checkpoint.schema.json +15 -0
  331. package/template/{docs → .template-spec}/process/schemas/lifecycle-registry.schema.json +1 -1
  332. package/template/{docs → .template-spec}/process/schemas/strategic-design-handoff-v3.schema.json +1 -1
  333. package/template/{docs → .template-spec}/process/schemas/strategic-design-handoff-v4.schema.json +1 -1
  334. package/template/{docs → .template-spec}/process/schemas/strategic-design-handoff-v5.schema.json +1 -1
  335. package/template/{docs → .template-spec}/process/schemas/strategic-design-handoff.schema.json +1 -1
  336. package/template/{docs → .template-spec}/process/stage-tracking.md +1 -1
  337. package/template/{docs → .template-spec}/process/subagent-collaboration.md +2 -2
  338. package/template/{docs → .template-spec}/templates/build-architecture-checklist-template.md +2 -2
  339. package/template/{docs → .template-spec}/templates/digital-human-runtime-profile-template.md +2 -2
  340. package/template/{docs → .template-spec}/templates/grok-bot-profile-template.md +1 -1
  341. package/template/{docs → .template-spec}/templates/local-parent-ticket-template.md +1 -1
  342. package/template/.template-spec/templates/release-note-template.md +29 -0
  343. package/template/.template-spec/templates/retro-report-template.md +24 -0
  344. package/template/{docs → .template-spec}/templates/subagent-task-package-template.md +3 -3
  345. package/template/.template-spec/templates/verification-record-template.md +64 -0
  346. package/template/{docs → .template-spec}/templates/vertical-slice-ticket-template.md +5 -10
  347. package/template/{docs → .template-spec}/user-guide//347/224/250/346/210/267/346/211/213/345/206/214.md +1 -1
  348. 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
  349. package/template/AGENTS.md +12 -12
  350. package/template/CONTEXT.md +3 -3
  351. package/template/README.md +21 -21
  352. package/template/scripts/backend-delivery +1 -1
  353. package/template/scripts/lib/api-contract-decision.mjs +1 -1
  354. package/template/scripts/lib/approved-execution-context.mjs +5 -5
  355. package/template/scripts/lib/backend-delivery.mjs +4 -4
  356. package/template/scripts/lib/backend-platform.mjs +1 -1
  357. package/template/scripts/lib/backend-review.mjs +1 -1
  358. package/template/scripts/lib/backend-scaffold-prerequisites.mjs +1 -1
  359. package/template/scripts/lib/backend-standards-coverage.mjs +2 -2
  360. package/template/scripts/lib/context-reconciliation.mjs +1 -1
  361. package/template/scripts/lib/contract-views.mjs +9 -9
  362. package/template/scripts/lib/delivery-preflight.mjs +6 -6
  363. package/template/scripts/lib/design-md.mjs +2 -2
  364. package/template/scripts/lib/digital-human-roles.mjs +2 -2
  365. package/template/scripts/lib/existing-backend-architecture.mjs +1 -1
  366. package/template/scripts/lib/existing-ui-baseline.mjs +1 -1
  367. package/template/scripts/lib/frontend-delivery.mjs +2 -2
  368. package/template/scripts/lib/governance-layout.mjs +74 -0
  369. package/template/scripts/lib/harness-execution-scope.mjs +2 -2
  370. package/template/scripts/lib/lifecycle-context-query.mjs +11 -3
  371. package/template/scripts/lib/lifecycle-registry.mjs +46 -7
  372. package/template/scripts/lib/lifecycle-status.mjs +111 -0
  373. package/template/scripts/lib/lifecycle-transition.mjs +71 -10
  374. package/template/scripts/lib/openapi-draft-validation.mjs +1 -1
  375. package/template/scripts/lib/plan-spec-entry-view.mjs +48 -0
  376. package/template/scripts/lib/plan-spec-entry.mjs +3 -3
  377. package/template/scripts/lib/skill-registry.mjs +8 -8
  378. package/template/scripts/lib/skill-supply-chain.mjs +1 -1
  379. package/template/scripts/lib/slice-contract-preparation.mjs +3 -3
  380. package/template/scripts/lib/slice-contract.mjs +1 -1
  381. package/template/scripts/lib/slice-repositories.mjs +1 -1
  382. package/template/scripts/lib/slice-task-package.mjs +3 -3
  383. package/template/scripts/lib/stage-tracking-migration.mjs +2 -2
  384. package/template/scripts/lib/stage-tracking.mjs +5 -5
  385. package/template/scripts/lib/strategic-feedback.mjs +2 -2
  386. package/template/scripts/lib/strategic-handoff-routing.mjs +2 -2
  387. package/template/scripts/lib/strategic-handoff.mjs +15 -15
  388. package/template/scripts/lib/task-package-schema.mjs +2 -2
  389. package/template/scripts/lib/task-package.mjs +1 -1
  390. package/template/scripts/lib/technical-design-boundary.mjs +1 -1
  391. package/template/scripts/lib/user-decision.mjs +2 -1
  392. package/template/scripts/lifecycle-status +14 -0
  393. package/template/scripts/plan-spec-entry +21 -0
  394. package/template/scripts/strategic-consumer-entry +1 -1
  395. package/template/scripts/strategic-handoff +1 -1
  396. package/template/scripts/verify-frontend-implementation-evidence +1 -1
  397. package/template/scripts/verify-governance-layout +15 -0
  398. package/template/scripts/verify-lifecycle-checkpoint +1 -1
  399. package/template/scripts/verify-project-instance +2 -0
  400. package/template/scripts/verify-scaffold-architecture-decisions +1 -1
  401. package/template/scripts/verify-strategic-context-import +3 -3
  402. package/template/skills-lock.json +77 -77
  403. package/template.manifest.json +19 -19
  404. package/template.snapshot.json +5 -5
  405. package/template/docs/agents/archify-integration.md +0 -19
  406. package/template/docs/design/design-system-sync.yaml +0 -13
  407. package/template/docs/design/preview-dark.html +0 -178
  408. package/template/docs/design/preview.css +0 -730
  409. package/template/docs/design/preview.html +0 -178
  410. package/template/docs/design/preview.js +0 -71
  411. package/template/docs/design/tokens/.design-md-projection.json +0 -13
  412. package/template/docs/engineering/evidence/aliyun-artifact-resolution.json +0 -446
  413. package/template/docs/process/MATT-POCOCK-ENGINEERING-SKILLS.md +0 -13
  414. package/template/docs/process/github-workflows.md +0 -52
  415. package/template/docs/templates/release-note-template.md +0 -14
  416. package/template/docs/templates/retro-report-template.md +0 -16
  417. package/template/docs/templates/verification-record-template.md +0 -53
  418. /package/template/{docs → .template-spec}/agents/domain.md +0 -0
  419. /package/template/{docs → .template-spec}/api/templates/openapi-draft-review-checklist.md +0 -0
  420. /package/template/{docs → .template-spec}/api/templates/openapi-draft-validation-record-template.yaml +0 -0
  421. /package/template/{docs → .template-spec}/api/templates/openapi-freeze-record-template.md +0 -0
  422. /package/template/{docs → .template-spec}/api/templates/openapi-json-export-record-template.md +0 -0
  423. /package/template/{docs → .template-spec}/architecture/templates/architecture-deepening-template.md +0 -0
  424. /package/template/{docs → .template-spec}/architecture/templates/architecture-review-checklist.md +0 -0
  425. /package/template/{docs → .template-spec}/architecture/templates/business-architecture-template.md +0 -0
  426. /package/template/{docs → .template-spec}/architecture/templates/data-architecture-template.md +0 -0
  427. /package/template/{docs → .template-spec}/architecture/templates/engineering-baseline-review-template.md +0 -0
  428. /package/template/{docs → .template-spec}/architecture/templates/functional-architecture-template.md +0 -0
  429. /package/template/{docs → .template-spec}/architecture/templates/system-overview-design-template.md +0 -0
  430. /package/template/{docs → .template-spec}/design/diagrams/README.md +0 -0
  431. /package/template/{docs → .template-spec}/design/schemas/visual-baseline.schema.json +0 -0
  432. /package/template/{docs → .template-spec}/design/templates/prototype-confirmation-template.md +0 -0
  433. /package/template/{docs → .template-spec}/design/templates/visual-baseline-template.yaml +0 -0
  434. /package/template/{docs → .template-spec}/design/tokens/theme.json +0 -0
  435. /package/template/{docs → .template-spec}/design/tokens/tokens.compact.json +0 -0
  436. /package/template/{docs → .template-spec}/design/tokens/tokens.dark.json +0 -0
  437. /package/template/{docs → .template-spec}/design/tokens/tokens.default.json +0 -0
  438. /package/template/{docs → .template-spec}/design/tokens/variables.css +0 -0
  439. /package/template/{docs → .template-spec}/design/tokens/variables.dark.css +0 -0
  440. /package/template/{docs → .template-spec}/engineering/backend-platforms.json +0 -0
  441. /package/template/{docs → .template-spec}/plan/README.md +0 -0
  442. /package/template/{docs → .template-spec}/plan/templates/competitive-analysis-template.md +0 -0
  443. /package/template/{docs → .template-spec}/plan/templates/competitive-matrix-template.md +0 -0
  444. /package/template/{docs → .template-spec}/plan/templates/market-analysis-template.md +0 -0
  445. /package/template/{docs → .template-spec}/plan/templates/user-pain-points-template.md +0 -0
  446. /package/template/{docs → .template-spec}/process/delivery-preflight.md +0 -0
  447. /package/template/{docs → .template-spec}/process/document-writing.md +0 -0
  448. /package/template/{docs → .template-spec}/process/existing-backend-architecture.md +0 -0
  449. /package/template/{docs → .template-spec}/process/existing-ui-baseline.md +0 -0
  450. /package/template/{docs → .template-spec}/process/frontend-backend-delivery.md +0 -0
  451. /package/template/{docs → .template-spec}/process/harness-process-tailoring.md +0 -0
  452. /package/template/{docs → .template-spec}/process/implementation-repo-integration.md +0 -0
  453. /package/template/{docs/process/lifecycle-registry-baseline.json → .template-spec/process/lifecycle-registry-baseline-v1.json} +0 -0
  454. /package/template/{docs → .template-spec}/process/schemas/api-contract-decision-v2.schema.json +0 -0
  455. /package/template/{docs → .template-spec}/process/schemas/api-contract-decision.schema.json +0 -0
  456. /package/template/{docs → .template-spec}/process/schemas/backend-architecture-identity.schema.json +0 -0
  457. /package/template/{docs → .template-spec}/process/schemas/backend-delivery-verification.schema.json +0 -0
  458. /package/template/{docs → .template-spec}/process/schemas/backend-delivery.schema.json +0 -0
  459. /package/template/{docs → .template-spec}/process/schemas/context-reconciliation.schema.json +0 -0
  460. /package/template/{docs → .template-spec}/process/schemas/data-architecture-decision.schema.json +0 -0
  461. /package/template/{docs → .template-spec}/process/schemas/delivery-preflight-input.schema.json +0 -0
  462. /package/template/{docs → .template-spec}/process/schemas/delivery-preflight-result.schema.json +0 -0
  463. /package/template/{docs → .template-spec}/process/schemas/existing-ui-baseline.schema.json +0 -0
  464. /package/template/{docs → .template-spec}/process/schemas/frontend-delivery-acceptance-v1.schema.json +0 -0
  465. /package/template/{docs → .template-spec}/process/schemas/frontend-delivery-acceptance-v3.schema.json +0 -0
  466. /package/template/{docs → .template-spec}/process/schemas/frontend-delivery-acceptance.schema.json +0 -0
  467. /package/template/{docs → .template-spec}/process/schemas/frontend-implementation-evidence.schema.json +0 -0
  468. /package/template/{docs → .template-spec}/process/schemas/frontend-strategic-preflight-v2.schema.json +0 -0
  469. /package/template/{docs → .template-spec}/process/schemas/frontend-strategic-preflight.schema.json +0 -0
  470. /package/template/{docs → .template-spec}/process/schemas/implementation-repository-preparation-result.schema.json +0 -0
  471. /package/template/{docs → .template-spec}/process/schemas/openapi-draft-validation-record.schema.json +0 -0
  472. /package/template/{docs → .template-spec}/process/schemas/project-scaffold-contract.schema.json +0 -0
  473. /package/template/{docs → .template-spec}/process/schemas/review-bundle.schema.json +0 -0
  474. /package/template/{docs → .template-spec}/process/schemas/scaffold-architecture-decisions.schema.json +0 -0
  475. /package/template/{docs → .template-spec}/process/schemas/slice-implementation-contract-v3.schema.json +0 -0
  476. /package/template/{docs → .template-spec}/process/schemas/stage-tracking.schema.json +0 -0
  477. /package/template/{docs → .template-spec}/process/schemas/strategic-consumer-feedback.schema.json +0 -0
  478. /package/template/{docs → .template-spec}/process/schemas/strategic-feedback-adjudication.schema.json +0 -0
  479. /package/template/{docs → .template-spec}/process/schemas/strategic-handoff-delivery-verification.schema.json +0 -0
  480. /package/template/{docs → .template-spec}/process/schemas/strategic-handoff-delivery.schema.json +0 -0
  481. /package/template/{docs → .template-spec}/process/schemas/strategic-handoff-domain-strategy-v3.schema.json +0 -0
  482. /package/template/{docs → .template-spec}/process/schemas/strategic-handoff-domain-strategy.schema.json +0 -0
  483. /package/template/{docs → .template-spec}/process/schemas/strategic-handoff-export-v2.schema.json +0 -0
  484. /package/template/{docs → .template-spec}/process/schemas/strategic-handoff-export.schema.json +0 -0
  485. /package/template/{docs → .template-spec}/process/schemas/strategic-handoff-import-receipt-v3.schema.json +0 -0
  486. /package/template/{docs → .template-spec}/process/schemas/strategic-handoff-import-receipt.schema.json +0 -0
  487. /package/template/{docs → .template-spec}/process/schemas/strategic-handoff-package.schema.json +0 -0
  488. /package/template/{docs → .template-spec}/process/schemas/strategic-handoff-stage-decision-package-v3.schema.json +0 -0
  489. /package/template/{docs → .template-spec}/process/schemas/strategic-handoff-stage-decision-package.schema.json +0 -0
  490. /package/template/{docs → .template-spec}/process/schemas/subagent-task-package.schema.json +0 -0
  491. /package/template/{docs → .template-spec}/process/schemas/user-decision.schema.json +0 -0
  492. /package/template/{docs → .template-spec}/process/strategic-handoff-package.md +0 -0
  493. /package/template/{docs → .template-spec}/process/templates/context-reconciliation-template.yaml +0 -0
  494. /package/template/{docs → .template-spec}/process/templates/frontend-implementation-plan-template.yaml +0 -0
  495. /package/template/{docs → .template-spec}/process/templates/frontend-implementation-verification-template.yaml +0 -0
  496. /package/template/{docs → .template-spec}/process/templates/lifecycle-checkpoint-template.yaml +0 -0
  497. /package/template/{docs → .template-spec}/process/templates/scaffold-architecture-decisions-template.yaml +0 -0
  498. /package/template/{docs → .template-spec}/process/templates/stage-checkpoint-template.md +0 -0
  499. /package/template/{docs → .template-spec}/process/templates/user-decision-template.yaml +0 -0
  500. /package/template/{docs → .template-spec}/templates/adr-template.md +0 -0
  501. /package/template/{docs → .template-spec}/templates/approval-record-template.yaml +0 -0
  502. /package/template/{docs → .template-spec}/templates/cross-repo-slice-template.md +0 -0
  503. /package/template/{docs → .template-spec}/templates/examples/lifecycle-writing-examples.md +0 -0
  504. /package/template/{docs → .template-spec}/templates/implementation-repo-registry-template.md +0 -0
  505. /package/template/{docs → .template-spec}/templates/openapi-spec-template.yaml +0 -0
  506. /package/template/{docs → .template-spec}/templates/review-bundle-template.yaml +0 -0
  507. /package/template/{docs → .template-spec}/templates/review-report-template.md +0 -0
  508. /package/template/{docs → .template-spec}/templates/spec-delta-template.md +0 -0
  509. /package/template/{docs → .template-spec}/templates/spec-template.md +0 -0
  510. /package/template/{docs → .template-spec}/user-guide/yss-ui-mcp.md +0 -0
  511. /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
  512. /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
  513. /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
@@ -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}`);
@@ -3,7 +3,7 @@ import path from "node:path";
3
3
  import { parseDocument } from "../vendor/yaml.mjs";
4
4
  import { nestedSkillPaths, OBSOLETE, PROJECTION_ROOTS, ROOT, unregisteredNestedSkillPaths } from "./skill-supply-chain.mjs";
5
5
 
6
- export const DEFAULT_REGISTRY = path.join(ROOT, "docs/agents/yss-skill-registry.yaml");
6
+ export const DEFAULT_REGISTRY = path.join(ROOT, ".template-spec/agents/yss-skill-registry.yaml");
7
7
  const LOCK_PATH = path.join(ROOT, "skills-lock.json");
8
8
  const COMPILER_CONTRACT = path.join(ROOT, ".agents/skills/yss-implementation-contract-compiler/references/compiler-contract.yaml");
9
9
  const LIFECYCLE_CONTRACT = [
@@ -11,7 +11,7 @@ const LIFECYCLE_CONTRACT = [
11
11
  path.join(ROOT, ".agents/skills/harness-orchestrator/references/orchestration-contract.yaml"),
12
12
  ].find((candidate) => existsSync(candidate))
13
13
  ?? path.join(ROOT, ".agents/skills/yss-product-lifecycle/references/orchestration-contract.yaml");
14
- const BACKEND_PLATFORMS = path.join(ROOT, "docs/engineering/backend-platforms.json");
14
+ const BACKEND_PLATFORMS = path.join(ROOT, ".template-spec/engineering/backend-platforms.json");
15
15
  const LAYERS = new Set(["core", "specialist", "compatibility", "maintainer-only"]);
16
16
  const MATURITIES = new Set(["draft", "verified", "supported", "deprecated"]);
17
17
  const INVOCATION_MODES = new Set(["user", "model", "both"]);
@@ -73,7 +73,7 @@ export function resolveSkillForNewUse(registry, requestedId) {
73
73
  : `${requestedId} 已硬退役;按迁移 tombstone 重新路由`,
74
74
  {
75
75
  skill: requestedId,
76
- migration_ref: "docs/agents/skill-migrations.md",
76
+ migration_ref: ".template-spec/agents/skill-migrations.md",
77
77
  ...(replacementSkill ? { replacement_skill: replacementSkill } : {})
78
78
  }
79
79
  );
@@ -379,7 +379,7 @@ export function validateSkillRegistry(registry, { lock, compilerContract, lifecy
379
379
  requireStringSet(registry.retirement_contract.stages, ["deprecated", "retired"], "retirement_contract.stages");
380
380
  if (registry.retirement_contract.deprecated_new_use !== "forbidden") fail("retirement_contract.deprecated_new_use 必须为 forbidden");
381
381
  requireStringSet(registry.retirement_contract.cleanup_statuses, [...CLEANUP_STATUSES], "retirement_contract.cleanup_statuses");
382
- if (registry.retirement_contract.hard_retirement_tombstone !== "docs/agents/skill-migrations.md") fail("retirement_contract.hard_retirement_tombstone 必须指向技能迁移说明");
382
+ if (registry.retirement_contract.hard_retirement_tombstone !== ".template-spec/agents/skill-migrations.md") fail("retirement_contract.hard_retirement_tombstone 必须指向技能迁移说明");
383
383
  if (registry.retirement_contract.retired_id_source !== "scripts/lib/skill-supply-chain.mjs#OBSOLETE") fail("retirement_contract.retired_id_source 必须指向统一 OBSOLETE 集");
384
384
  requireObject(registry.retirement_contract.failure_codes, "retirement_contract.failure_codes");
385
385
  if (registry.retirement_contract.failure_codes.deprecated !== SKILL_LIFECYCLE_FAILURE_CODES.deprecated || registry.retirement_contract.failure_codes.retired !== SKILL_LIFECYCLE_FAILURE_CODES.retired) {
@@ -469,7 +469,7 @@ export function validateSkillRegistry(registry, { lock, compilerContract, lifecy
469
469
  fail("capability_contract.deterministic_order 必须固定为 recipe-declaration、dependency-topology、skill-id");
470
470
  }
471
471
  requireObject(capabilityContract.platform_component_binding, "capability_contract.platform_component_binding");
472
- if (capabilityContract.platform_component_binding.marker !== "provider" || capabilityContract.platform_component_binding.required_kind !== "yss-component" || capabilityContract.platform_component_binding.catalog_source !== "docs/engineering/backend-platforms.json") {
472
+ if (capabilityContract.platform_component_binding.marker !== "provider" || capabilityContract.platform_component_binding.required_kind !== "yss-component" || capabilityContract.platform_component_binding.catalog_source !== ".template-spec/engineering/backend-platforms.json") {
473
473
  fail("capability_contract.platform_component_binding 必须绑定中央后端平台目录");
474
474
  }
475
475
  requireStringSet(capabilityContract.provider_kinds, [...PROVIDER_KINDS], "capability_contract.provider_kinds");
@@ -615,8 +615,8 @@ export function validateSkillRegistry(registry, { lock, compilerContract, lifecy
615
615
  if (deprecatedCompilerRefs.length) fail(`实现合同编译器合同仍引用 deprecated skill: ${deprecatedCompilerRefs.join(", ")}`);
616
616
  if (compilerContract.schema_version !== 2) fail("compiler-contract.yaml schema_version 必须为 2;v1 已停止支持");
617
617
  if (compilerContract.compiled_by !== "yss-implementation-contract-compiler") fail("compiler-contract.yaml compiled_by 无效");
618
- if (compilerContract.capability_source !== "docs/agents/yss-skill-registry.yaml") fail("compiler-contract.yaml capability_source 必须指向技能注册表");
619
- if (compilerContract.recipe_source !== "docs/agents/yss-skill-registry.yaml") fail("compiler-contract.yaml recipe_source 必须指向技能注册表");
618
+ if (compilerContract.capability_source !== ".template-spec/agents/yss-skill-registry.yaml") fail("compiler-contract.yaml capability_source 必须指向技能注册表");
619
+ if (compilerContract.recipe_source !== ".template-spec/agents/yss-skill-registry.yaml") fail("compiler-contract.yaml recipe_source 必须指向技能注册表");
620
620
  requireObject(compilerContract.impact_to_capabilities, "compiler-contract.impact_to_capabilities");
621
621
  for (const [impact, mapped] of Object.entries(compilerContract.impact_to_capabilities)) {
622
622
  requireStringArray(mapped, `compiler-contract.impact_to_capabilities.${impact}`, { nonEmpty: true });
@@ -669,7 +669,7 @@ export function validateSkillRegistry(registry, { lock, compilerContract, lifecy
669
669
  fail(`${routeId}.frontend_route 主入口引用了未登记技能`);
670
670
  }
671
671
  }
672
- if (routeId === "work-unit.prototype-design") {
672
+ if (routeId === "work-unit.prototype-design-v2") {
673
673
  if (!route.skills.includes("prototype-review") || !route.supporting_skills.includes("prototype-review")) {
674
674
  fail("原型工作单元必须包含独立 prototype-review supporting skill");
675
675
  }
@@ -261,7 +261,7 @@ function metadata(name, skillPath, directory, previous, canonical = false, sourc
261
261
  result.upstreamHash = treeHash(upstreamDirectory);
262
262
  } else if (old.upstreamHash ?? old.computedHash) result.upstreamHash = old.upstreamHash ?? old.computedHash;
263
263
  if (result.upstreamHash && result.effectiveHash !== result.upstreamHash) {
264
- const adaptationRef = old.adaptationRef ?? (result.source === "mattpocock/skills" ? "docs/process/MATT-POCOCK-ENGINEERING-SKILLS.md" : null);
264
+ const adaptationRef = old.adaptationRef ?? (result.source === "mattpocock/skills" ? ".template-source/process/MATT-POCOCK-ENGINEERING-SKILLS.md" : null);
265
265
  if (adaptationRef) result.adaptationRef = adaptationRef;
266
266
  }
267
267
  return result;
@@ -31,7 +31,7 @@ function markdownAcceptance(text) {
31
31
  }
32
32
  function lifecycleSources(checkpoint,report) {
33
33
  const result={};
34
- for(const [artifact,key]of Object.entries({'artifact.spec':'spec','artifact.engineering-baseline':'engineering_baseline','artifact.architecture-review':'architecture_review','artifact.technical-design':'technical_design','artifact.data-architecture':'data_architecture','artifact.state-matrix':'state_matrix','artifact.prototype-deliverable':'prototype_deliverable','artifact.prototype-review':'prototype_review','artifact.prototype-confirmation':'prototype_confirmation','artifact.openapi-freeze-record':'openapi_freeze'})) {
34
+ for(const [artifact,key]of Object.entries({'artifact.spec':'spec','artifact.engineering-baseline':'engineering_baseline','artifact.architecture-review':'architecture_review','artifact.technical-design':'technical_design','artifact.data-architecture':'data_architecture','artifact.state-matrix':'state_matrix','artifact.prototype-deliverable':'prototype_deliverable','artifact.prototype-review-v2':'prototype_review','artifact.prototype-confirmation-v2':'prototype_confirmation','artifact.openapi-freeze-record':'openapi_freeze'})) {
35
35
  const value=checkpoint.artifacts?.[artifact];if(value===undefined)continue;
36
36
  if(typeof value==='string')result[key]={ref:value};
37
37
  else if(object(value)&&typeof value.ref==='string')result[key]=Object.fromEntries(['ref','version','digest','approval_ref'].filter(k=>value[k]!==undefined).map(k=>[k,value[k]]));
@@ -72,7 +72,7 @@ function prepare({root=process.cwd(),ticket_ref,checkpoint_ref,sources={},refine
72
72
  const selected=mergeFacts(lifecycleSources(saved,report),mergeFacts(input.sources || {},sources,'sources',report),'sources',report);
73
73
  if(selected.ticket && (typeof selected.ticket==='string'?selected.ticket:selected.ticket.ref)!==ticket_ref)throw new TypeError('Ticket 来源冲突');
74
74
  selected.ticket=selected.ticket || {ref:ticket_ref};
75
- if(input.scope?.risk_level){selected.lifecycle_registry??={ref:'docs/process/lifecycle-registry.yaml'};selected.process_tailoring??={ref:'docs/process/harness-process-tailoring.md'};}
75
+ if(input.scope?.risk_level){selected.lifecycle_registry??={ref:'.template-spec/process/lifecycle-registry.yaml'};selected.process_tailoring??={ref:'.template-spec/process/harness-process-tailoring.md'};}
76
76
  if(!selected.context&&fs.existsSync(safe(root,'CONTEXT.md',{missing:true})))selected.context={ref:'CONTEXT.md'};
77
77
  const basis={},seen=new Map();
78
78
  for(const [key,value] of Object.entries(selected)) {
@@ -136,7 +136,7 @@ function prepare({root=process.cwd(),ticket_ref,checkpoint_ref,sources={},refine
136
136
  for(const reason of compiled.readiness_blockers||[])report.blockers.push({reason});
137
137
  normalizeSliceContract(contract,{root});
138
138
  report.checks.push({check:'structure-sources-scope-acceptance',result:'pass'});
139
- report.provenance.push({target:'resolution',source_ref:'docs/agents/yss-skill-registry.yaml',digest:compiled.registry_digest,rule:'existing-capability-compiler'});
139
+ report.provenance.push({target:'resolution',source_ref:'.template-spec/agents/yss-skill-registry.yaml',digest:compiled.registry_digest,rule:'existing-capability-compiler'});
140
140
  for(const field of ['scope','acceptance','verification','work_units','applicability','extensions'])if(contract[field]) {
141
141
  const origins=[];
142
142
  if(saved.slice_implementation?.[field]!==undefined)origins.push({kind:'checkpoint',ref:checkpoint_ref});
@@ -113,7 +113,7 @@ export function normalizeSliceContract(document, options = {}) {
113
113
  }
114
114
  return structuredClone(raw);
115
115
  }
116
- schema(raw,'docs/process/schemas/slice-implementation-contract-v3.schema.json');
116
+ schema(raw,'.template-spec/process/schemas/slice-implementation-contract-v3.schema.json');
117
117
  const sources=readSliceSources(raw,options), refs=Object.fromEntries(Object.entries(sources).map(([key,item])=>[key,item.ref]));
118
118
  requireKeys(refs,['spec','ticket','engineering_baseline','implementation_repository','build_architecture_checklist'],'依据');
119
119
  const ticketHeader = sources.ticket.text.match(/^---\r?\n([\s\S]*?)\r?\n---/);
@@ -10,7 +10,7 @@ export function sliceRepositories(contract,sources,{root=process.cwd()}={}) {
10
10
  check(lifecycle.SLICE_REPOSITORY_PREPARATION_PROTOCOL===1&&typeof lifecycle.validateImplementationRepositoriesReady==='function','接收端不支持当前来源的多项目准备协议,不能套用本地默认规则');
11
11
  check(sources.repository_preparation,'缺少多项目准备结果');
12
12
  const preparation=parseSliceYaml(sources.repository_preparation.text);
13
- schema(preparation,'docs/process/schemas/implementation-repository-preparation-result.schema.json');
13
+ schema(preparation,'.template-spec/process/schemas/implementation-repository-preparation-result.schema.json');
14
14
  const ready=lifecycle.validateImplementationRepositoriesReady({implementation_repository_preparation:preparation,delivery_impacts:Object.fromEntries(['backend','frontend'].map(role=>[role,preparation.projects.some(p=>p.delivery_role===role&&p.status!=='not-applicable')]))},{root,exists:ref=>fs.existsSync(path.resolve(root,ref)),read:ref=>fs.readFileSync(path.resolve(root,ref),'utf8')});
15
15
  check(ready.result!=='blocked',`多项目准备未就绪: ${ready.missing_requirements.join('; ')}`);
16
16
  check(new Set(Object.keys(bindings).map(p=>path.resolve(p))).size===Object.keys(bindings).length,'工程根存在路径别名,不能重复登记');
@@ -10,13 +10,13 @@ const fail=message=>{throw new TypeError(message);};
10
10
  const equalArrays=(a,b)=>Array.isArray(a)&&a.length===b.length&&a.every((x,i)=>x===b[i]);
11
11
  function generateTaskPackageDefaults(roleId,overrides,{rolesDoc}={}) {
12
12
  const defaults=taskPackageDefaults(roleId,rolesDoc||loadDigitalHumanRoles());
13
- return {schema_version:1,role_id:roleId,skill_source:{registry_ref:'docs/agents/digital-human-roles.yaml',defaults_ref:`taskPackageDefaults(${roleId})`,core_skills:defaults.core_skills,forbidden_skills:defaults.forbidden_skills},...overrides};
13
+ return {schema_version:1,role_id:roleId,skill_source:{registry_ref:'.template-spec/agents/digital-human-roles.yaml',defaults_ref:`taskPackageDefaults(${roleId})`,core_skills:defaults.core_skills,forbidden_skills:defaults.forbidden_skills},...overrides};
14
14
  }
15
15
 
16
16
  /** Compile dispatch from the approved YAML. Only runtime identity and task ID come from the caller. */
17
17
  export function compileSliceTaskPackage(binding,options={}) {return withValidationPhase({root:options.root||ROOT,purpose:'slice-dispatch',slice_id:binding.ref,work_unit_id:options.work_unit_id,readOnly:false,signal:options.signal},()=>compile(binding,options));}
18
18
  function compile(binding,{root=ROOT,work_unit_id,task_id,actor_id,runtime_id,execution_state='Worker',rolesDoc,user_decisions}={}) {
19
- const actualRoles=parseSliceYaml(readFileSync(safe(root,'docs/agents/digital-human-roles.yaml')));
19
+ const actualRoles=parseSliceYaml(readFileSync(safe(root,'.template-spec/agents/digital-human-roles.yaml')));
20
20
  if(rolesDoc&&digest(rolesDoc)!==digest(actualRoles))fail('调用方不能替换接收端角色能力');
21
21
  rolesDoc=actualRoles;
22
22
  if(!actualRoles.runtimes.some(runtime=>runtime.id===runtime_id))fail('接收端不支持该 runtime_id');
@@ -46,7 +46,7 @@ export function assertSliceV3TaskPackage(value,slice,{root=ROOT}={}) {
46
46
  enforceHarnessTaskScope(value,{root});
47
47
  const contract=value.contract;
48
48
  const current=normalizeSliceContract(slice,{root});
49
- const roles=parseSliceYaml(readFileSync(safe(root,'docs/agents/digital-human-roles.yaml'))),defaults=taskPackageDefaults(value.role_id,roles);
49
+ const roles=parseSliceYaml(readFileSync(safe(root,'.template-spec/agents/digital-human-roles.yaml'))),defaults=taskPackageDefaults(value.role_id,roles);
50
50
  if(!roles.runtimes.some(runtime=>runtime.id===value.runtime_id)||!defaults.stages.includes(value.stage_id))fail('接收端角色或运行时不支持当前任务');
51
51
  if(!equalArrays(value.skill_source.core_skills,defaults.core_skills)||!equalArrays(value.skill_source.forbidden_skills,defaults.forbidden_skills))fail('任务角色能力与接收端不一致');
52
52
  const unit=current.work_units.find(item=>item.id===value.work_unit_id);
@@ -46,12 +46,12 @@ export function planTracking(root, { checkpoint_ref, items = [], refresh = false
46
46
  watch(ref);
47
47
  if (!observed[ref] || sha256(after) !== observed[ref].digest) changes.push({ ref, before: observed[ref], after, after_digest: sha256(after) });
48
48
  }
49
- for (const ref of ['yss-project.yaml', 'CONTEXT.md', TRACKER_REF, 'docs/process/lifecycle-registry.yaml', 'docs/process/schemas/stage-tracking.schema.json', 'docs/process/harness-profile.yaml', checkpoint_ref]) watch(ref);
49
+ for (const ref of ['yss-project.yaml', 'CONTEXT.md', TRACKER_REF, '.template-spec/process/lifecycle-registry.yaml', '.template-spec/process/schemas/stage-tracking.schema.json', '.template-spec/process/harness-profile.yaml', checkpoint_ref]) watch(ref);
50
50
  const exists = observed[checkpoint_ref] !== null;
51
51
  let checkpoint;
52
52
  if (exists) checkpoint = parseYaml(readTracking(root, checkpoint_ref));
53
53
  else {
54
- const template = 'docs/process/templates/lifecycle-checkpoint-template.yaml'; watch(template);
54
+ const template = '.template-spec/process/templates/lifecycle-checkpoint-template.yaml'; watch(template);
55
55
  checkpoint = parseYaml(readTracking(root, template));
56
56
  checkpoint.feature_id = feature;
57
57
  checkpoint.mode = 'orchestrate'; checkpoint.status = 'running';
@@ -4,14 +4,14 @@ import { createHash } from 'node:crypto';
4
4
  import { parseDocument } from '../vendor/yaml.mjs';
5
5
  import { validateJsonSchema } from './json-schema.mjs';
6
6
 
7
- export const TRACKER_REF = 'docs/agents/issue-tracker.md';
7
+ export const TRACKER_REF = '.template-spec/agents/issue-tracker.md';
8
8
  export const STAGE_WORK_UNITS = Object.freeze({
9
9
  'work-unit.plan-opportunity': 'stage.plan',
10
10
  'work-unit.plan-requirements': 'stage.plan',
11
11
  'work-unit.domain-strategy-design': 'stage.plan',
12
12
  'work-unit.stage-decision': 'stage.plan',
13
13
  'work-unit.spec-synthesis': 'stage.spec-architecture',
14
- 'work-unit.prototype-design': 'stage.product-design',
14
+ 'work-unit.prototype-design-v2': 'stage.product-design',
15
15
  });
16
16
  export const sha256 = bytes => `sha256:${createHash('sha256').update(bytes).digest('hex')}`;
17
17
  export function parseYaml(bytes) {
@@ -43,7 +43,7 @@ export function trackerConfig(root) {
43
43
  return config;
44
44
  }
45
45
  export function trackingProfile(root) {
46
- const ref = 'docs/process/harness-profile.yaml';
46
+ const ref = '.template-spec/process/harness-profile.yaml';
47
47
  return existsSync(safeTrackingPath(root, ref)) ? parseYaml(readTracking(root, ref)) : null;
48
48
  }
49
49
  export const isDesign = root => trackingProfile(root)?.profile_id === 'harness.business-ddd-strategy-handoff';
@@ -81,7 +81,7 @@ export function assertStageTracking(checkpoint, { root, checkpointRef, currentWo
81
81
  if (identity.repository_mode === 'project-instance' && config.lifecycle_tracking_version === 1 && relevant) throw new Error('stage-tracking-required');
82
82
  return { status: 'not-applicable', stale_item_ids: [] };
83
83
  }
84
- validateJsonSchema(tracking, path.join(root, 'docs/process/schemas/stage-tracking.schema.json'));
84
+ validateJsonSchema(tracking, path.join(root, '.template-spec/process/schemas/stage-tracking.schema.json'));
85
85
  const feature = checkpoint.feature_id;
86
86
  if (feature !== tracking.feature_id || typeof feature !== 'string' || !feature.trim()) throw new Error('tracking-feature-mismatch');
87
87
  const location = /^(docs\/\.scratch\/[a-z0-9][a-z0-9-]*\/)[^/]+\.(yaml|json)$/.exec(tracking.checkpoint_ref);
@@ -94,7 +94,7 @@ export function assertStageTracking(checkpoint, { root, checkpointRef, currentWo
94
94
  } else if (tracking.entry.kind !== 'parent-ticket' || tracking.entry.ref !== `${base}parent-ticket.md`) throw new Error('tracking-parent-required');
95
95
  const entry = readTracking(root, tracking.entry.ref);
96
96
  if (tracking.entry.kind === 'parent-ticket' && !entry.includes(tracking.checkpoint_ref)) throw new Error('tracking-parent-checkpoint-link-required');
97
- const registry = parseYaml(readTracking(root, 'docs/process/lifecycle-registry.yaml'));
97
+ const registry = parseYaml(readTracking(root, '.template-spec/process/lifecycle-registry.yaml'));
98
98
  const stages = new Set(registry.stages.map(x => x.id));
99
99
  const units = new Set(registry.work_units.map(x => x.id));
100
100
  if (!stages.has(tracking.entry_stage)) throw new Error('tracking-entry-stage-invalid');
@@ -4,7 +4,7 @@ import { read, safe, ensure, hash, schema, project } from './strategic-handoff-i
4
4
 
5
5
  export async function verifyConsumerFeedback({root=process.cwd(),feedbackRef}={}) {
6
6
  project(root);const file=safe(root,feedbackRef),feedback=read(file);
7
- schema(feedback,'docs/process/schemas/strategic-consumer-feedback.schema.json');
7
+ schema(feedback,'.template-spec/process/schemas/strategic-consumer-feedback.schema.json');
8
8
  const receipt=read(safe(root,feedback.import_receipt_ref));
9
9
  ensure([2,3].includes(receipt.schema_version),'Consumer Feedback v1 只接受 route-aware Import Receipt v2/v3');
10
10
  const base=`docs/handoffs/${receipt.bundle_id}/${receipt.version}`;
@@ -22,7 +22,7 @@ export async function verifyConsumerFeedback({root=process.cwd(),feedbackRef}={}
22
22
 
23
23
  export async function verifyFeedbackAdjudication({root=process.cwd(),adjudicationRef}={}) {
24
24
  project(root);const file=safe(root,adjudicationRef),adjudication=read(file);
25
- schema(adjudication,'docs/process/schemas/strategic-feedback-adjudication.schema.json');
25
+ schema(adjudication,'.template-spec/process/schemas/strategic-feedback-adjudication.schema.json');
26
26
  const feedbackFile=safe(root,adjudication.feedback.ref);ensure(hash(readFileSync(feedbackFile))===adjudication.feedback.digest,'Feedback Adjudication 绑定的 feedback digest 已失效');
27
27
  const verified=await verifyConsumerFeedback({root,feedbackRef:adjudication.feedback.ref});
28
28
  for(const ref of adjudication.evidence_refs)ensure(readFileSync(safe(root,ref)).length>0,`Feedback Adjudication evidence 为空: ${ref}`);
@@ -5,13 +5,13 @@ import { read, safe, ensure } from './strategic-handoff-io.mjs';
5
5
  // Wire work-unit IDs belong to the immutable source package. Only target routing is adapted.
6
6
  export function consumerEntry(root, capability, sourceWorkUnit) {
7
7
  const scope = existsSync(path.join(root, '.yss-execution-scope.yaml')) ? read(safe(root, '.yss-execution-scope.yaml')) : null;
8
- const profile = existsSync(path.join(root, 'docs/process/harness-profile.yaml')) ? read(safe(root, 'docs/process/harness-profile.yaml')) : null;
8
+ const profile = existsSync(path.join(root, '.template-spec/process/harness-profile.yaml')) ? read(safe(root, '.template-spec/process/harness-profile.yaml')) : null;
9
9
  const contractRef = scope || !profile ? '.agents/skills/yss-product-lifecycle/references/orchestration-contract.yaml' : '.agents/skills/harness-orchestrator/references/orchestration-contract.yaml';
10
10
  const contract = read(safe(root, contractRef));
11
11
  const target = scope?.scope_id || profile?.profile_id || 'yss-full-lifecycle';
12
12
  const policy = contract.consumer_entry_routes?.[target]?.[capability];
13
13
  ensure(policy && policy.source_work_unit === sourceWorkUnit, `consumer-entry-unmapped: ${target}/${capability}/${sourceWorkUnit}`);
14
- const registry = read(safe(root, 'docs/process/lifecycle-registry.yaml'));
14
+ const registry = read(safe(root, '.template-spec/process/lifecycle-registry.yaml'));
15
15
  ensure(registry.work_units.some(unit => unit.id === policy.target_work_unit), 'consumer-entry-unknown-target');
16
16
  if (scope) {
17
17
  ensure(scope.schema_version === 1, 'consumer-entry-invalid-scope');
@@ -14,11 +14,11 @@ const MAX_BYTES = 512 * 1024 * 1024;
14
14
  const own = (a,b) => JSON.stringify(canonical(a)) === JSON.stringify(canonical(b));
15
15
  const nonempty = x => typeof x === 'string' && x.trim();
16
16
  const bytesDigest = (bytes, kind) => kind === 'canonical-json' ? digest(parse(bytes)) : kind === 'sha256-bytes' ? hash(bytes) : (() => { throw new TypeError(`未知摘要算法: ${kind}`); })();
17
- const HANDOFF_SCHEMAS = new Map([[3,'docs/process/schemas/strategic-design-handoff-v3.schema.json'],[4,'docs/process/schemas/strategic-design-handoff-v4.schema.json'],[5,'docs/process/schemas/strategic-design-handoff-v5.schema.json']]);
17
+ const HANDOFF_SCHEMAS = new Map([[3,'.template-spec/process/schemas/strategic-design-handoff-v3.schema.json'],[4,'.template-spec/process/schemas/strategic-design-handoff-v4.schema.json'],[5,'.template-spec/process/schemas/strategic-design-handoff-v5.schema.json']]);
18
18
  const SOURCE_SCHEMAS = new Map([
19
- [3,['docs/process/schemas/strategic-handoff-domain-strategy.schema.json','docs/process/schemas/strategic-handoff-stage-decision-package.schema.json']],
20
- [4,['docs/process/schemas/strategic-handoff-domain-strategy-v3.schema.json','docs/process/schemas/strategic-handoff-stage-decision-package-v3.schema.json']],
21
- [5,['docs/process/schemas/strategic-handoff-domain-strategy-v3.schema.json','docs/process/schemas/strategic-handoff-stage-decision-package-v3.schema.json']],
19
+ [3,['.template-spec/process/schemas/strategic-handoff-domain-strategy.schema.json','.template-spec/process/schemas/strategic-handoff-stage-decision-package.schema.json']],
20
+ [4,['.template-spec/process/schemas/strategic-handoff-domain-strategy-v3.schema.json','.template-spec/process/schemas/strategic-handoff-stage-decision-package-v3.schema.json']],
21
+ [5,['.template-spec/process/schemas/strategic-handoff-domain-strategy-v3.schema.json','.template-spec/process/schemas/strategic-handoff-stage-decision-package-v3.schema.json']],
22
22
  ]);
23
23
  const CAPABILITIES=['backend-technical-design','frontend-engineering-design','delivery-coordination'];
24
24
 
@@ -167,7 +167,7 @@ export async function inspectSource(root, handoffRef) {
167
167
  schema(handoff,versionSchema(handoff?.schema_version,HANDOFF_SCHEMAS,'Strategic Handoff'));
168
168
  ensure(handoff.status==='approved', '交接包尚未批准');
169
169
  const config=handoff.package_export;
170
- schema(config,handoff.schema_version===5?'docs/process/schemas/strategic-handoff-export-v2.schema.json':'docs/process/schemas/strategic-handoff-export.schema.json');
170
+ schema(config,handoff.schema_version===5?'.template-spec/process/schemas/strategic-handoff-export-v2.schema.json':'.template-spec/process/schemas/strategic-handoff-export.schema.json');
171
171
  if(handoff.schema_version===5)ensure(config.ui_baseline_kind===uiBaselineKind(handoff),'交接与导出 UI 基线类型不一致');
172
172
  const source=parseContextSource(readFileSync(safe(root,'CONTEXT.md'),'utf8'));
173
173
  snapshot(handoff.source_context_snapshot,source); checkDelta(handoff,source);
@@ -184,7 +184,7 @@ export async function inspectSource(root, handoffRef) {
184
184
  validateConsumerRoutes(handoff,stage);
185
185
  if(uiBaselineKind(handoff)==='existing-ui-baseline')ensure(stage.impact_assessment?.ui===false,'existing-ui-baseline 不支持 UI 影响,返回产品设计');
186
186
  const indexes=extractTraceability(strategy);
187
- const sourceRoles=read(safe(root,'docs/agents/digital-human-roles.yaml'));
187
+ const sourceRoles=read(safe(root,'.template-spec/agents/digital-human-roles.yaml'));
188
188
  const roles=sourceApprovalPolicy(sourceRoles);
189
189
  for (const [artifact, version, gateId] of [[strategy,strategy.domain_version,'check.domain-strategy-approved'],[stage,stage.package_version,'check.stage-decision-package-approved']]) {
190
190
  if(artifact.approval) { const record=sourceApprovalRecord(read(safe(root,artifact.approval.approval_ref)),gateId);await sourceApproval(record,roles,root);ensure(artifact.approval.current_version===version,'资产内置批准版本过期'); }
@@ -237,7 +237,7 @@ export async function inspectSource(root, handoffRef) {
237
237
  }
238
238
 
239
239
  function collect(root, handoffRef, handoff, config) {
240
- const collected=new Map(), queue=[handoffRef,'CONTEXT.md','docs/agents/digital-human-roles.yaml',...Object.values(handoff.source).map(x=>x.persisted_ref),...Object.values(config.approvals).map(x=>x.record_ref),...handoff.evidence_and_version_digests,...config.additional_files];
240
+ const collected=new Map(), queue=[handoffRef,'CONTEXT.md','.template-spec/agents/digital-human-roles.yaml',...Object.values(handoff.source).map(x=>x.persisted_ref),...Object.values(config.approvals).map(x=>x.record_ref),...handoff.evidence_and_version_digests,...config.additional_files];
241
241
  if(config.prototype)queue.push(config.prototype.preview_root,config.prototype.verification_ref);
242
242
  if(config.prototype?.profile==='H2')queue.push(config.prototype.source_root,config.prototype.lock_ref);
243
243
  const symbolic=config.reference_map || {};
@@ -273,7 +273,7 @@ export async function openBundle(input, action, {readOnly=false}={}) {
273
273
  let root=path.resolve(input);
274
274
  if(lstatSync(root).isFile()){ ensure(!readOnly,'readonly-extraction-required: 只读验证需要已展开目录');root=path.join(temp,'unpacked');mkdirSync(root);archive('unpack',path.resolve(input),root); }
275
275
  const manifest=read(safe(root,'manifest.json'));
276
- schema(manifest,'docs/process/schemas/strategic-handoff-package.schema.json');
276
+ schema(manifest,'.template-spec/process/schemas/strategic-handoff-package.schema.json');
277
277
  const {bundle_digest,...body}=manifest;ensure(bundle_digest===digest(body),'包清单摘要不一致');
278
278
  const paths=manifest.files.map(x=>x.path);
279
279
  ensure(new Set(paths.map(x=>x.toLowerCase())).size===paths.length,'包文件路径重复');
@@ -352,8 +352,8 @@ export async function openDelivery(input, action) {
352
352
  ensure(isDeliveryDirectory(root),'交付目录缺少 delivery-record.json');
353
353
  ensure(!lstatSync(root).isSymbolicLink(),'交付目录不能是 symlink');
354
354
  const recordBytes=readFileSync(safe(root,'delivery-record.json'));
355
- const record=parse(recordBytes);schema(record,'docs/process/schemas/strategic-handoff-delivery.schema.json');
356
- const verification=read(safe(root,record.verification_ref));schema(verification,'docs/process/schemas/strategic-handoff-delivery-verification.schema.json');
355
+ const record=parse(recordBytes);schema(record,'.template-spec/process/schemas/strategic-handoff-delivery.schema.json');
356
+ const verification=read(safe(root,record.verification_ref));schema(verification,'.template-spec/process/schemas/strategic-handoff-delivery-verification.schema.json');
357
357
  const packageRoot=safe(root,record.package_ref);
358
358
  ensure(lstatSync(packageRoot).isDirectory()&&!lstatSync(packageRoot).isSymbolicLink(),'package_ref 必须指向普通目录');
359
359
  if(record.zip){const archiveRef=safe(root,record.zip.ref);ensure(lstatSync(archiveRef).isFile()&&hash(readFileSync(archiveRef))===record.zip.sha256,'ZIP 摘要不一致');}
@@ -389,11 +389,11 @@ export async function finalizeDelivery({sourceRoot,handoffRef,zip=false,previous
389
389
  const handoffEntry=await openBundle(path.join(stage,'package'),bundle=>bundle.manifest.files.find(file=>file.original_ref===handoffRef));
390
390
  ensure(handoffEntry,'交付包缺少 Handoff 源文件');
391
391
  const verification={schema_version:1,kind:'strategic-delivery-verification-v1',result:'verified',command:`scripts/strategic-handoff verify --bundle docs/deliveries/strategic/${current.handoff.handoff_id}/${current.handoff.handoff_version}`,exit_code:0,executed_at:new Date().toISOString(),package_ref:'package',manifest_ref:'package/manifest.json',bundle_digest:exported.bundle_digest};
392
- schema(verification,'docs/process/schemas/strategic-handoff-delivery-verification.schema.json');write(stage,'verification.json',json(verification));
392
+ schema(verification,'.template-spec/process/schemas/strategic-handoff-delivery-verification.schema.json');write(stage,'verification.json',json(verification));
393
393
  const sourceAssets=Object.entries(current.handoff.source).sort(([a],[b])=>a.localeCompare(b)).map(([sourceKey,value])=>({source_key:sourceKey,id:value.id||value.baseline_id,version:value.version,ref:value.persisted_ref,digest:value.digest}));
394
394
  const previousDelivery=await openBundle(path.join(stage,'package'),bundle=>bundle.manifest.previous_bundle?{handoff_id:bundle.manifest.previous_bundle.bundle_id,version:bundle.manifest.previous_bundle.version,bundle_digest:bundle.manifest.previous_bundle.digest}:null);
395
395
  const record={schema_version:1,kind:'strategic-handoff-delivery-v1',status:'packaged',handoff:{id:current.handoff.handoff_id,version:current.handoff.handoff_version,ref:handoffRef,sha256:handoffEntry.sha256,schema_version:5},source_assets:sourceAssets,package_ref:'package',manifest_ref:'package/manifest.json',bundle_digest:exported.bundle_digest,verification_ref:'verification.json',consumer_routes:current.handoff.consumer_routes.map(({route_id,capability,activation})=>({route_id,capability,activation})),...(zip?{zip:{ref:'package.zip',sha256:exported.zip_sha256}}:{}),previous_delivery:previousDelivery};
396
- schema(record,'docs/process/schemas/strategic-handoff-delivery.schema.json');write(stage,'delivery-record.json',json(record));
396
+ schema(record,'.template-spec/process/schemas/strategic-handoff-delivery.schema.json');write(stage,'delivery-record.json',json(record));
397
397
  await openDelivery(stage,()=>null);
398
398
  if(existsSync(delivery)){
399
399
  const existing=await openDelivery(delivery,value=>value.record);
@@ -432,7 +432,7 @@ export async function importBundle({bundle,targetRoot}) {
432
432
  write(stage,'tactical-traceability-draft.json',json({schema_version:1,import_receipt_ref:`${rel}/import-receipt.json`,bundle_digest:b.manifest.bundle_digest,rows}));
433
433
  write(stage,'upstream-change-impact.json',json({schema_version:1,previous_bundle:b.manifest.previous_bundle,changed_source_ids:[...b.changes.updated,...b.changes.removed],added_source_ids:b.changes.added,status:'requires-lifecycle-reconciliation',policy:'mark-dependent-tactical-and-slice-contracts-stale; unknown-dependency-blocks-all'}));
434
434
  }else{
435
- const profileRef=path.join(target,'docs/process/harness-profile.yaml');
435
+ const profileRef=path.join(target,'.template-spec/process/harness-profile.yaml');
436
436
  const profile=existsSync(profileRef)?read(profileRef):null;
437
437
  const capabilities=scopedConsumerCapabilities(target,profile?.handoff?.consumer_capabilities||CAPABILITIES);
438
438
  ensure(Array.isArray(capabilities)&&capabilities.length&&capabilities.every(capability=>CAPABILITIES.includes(capability)),'目标 profile 未声明受支持的消费者能力');
@@ -449,7 +449,7 @@ export async function importBundle({bundle,targetRoot}) {
449
449
  const fromDelivery=Boolean(b.recordBytes);
450
450
  if(fromDelivery)write(stage,'source-delivery-record.json',b.recordBytes);
451
451
  receipt={schema_version:fromDelivery?3:2,bundle_id:b.manifest.bundle_id,version:b.manifest.version,bundle_digest:b.manifest.bundle_digest,package_ref:`${rel}/package`,...(fromDelivery?{source_delivery_record_ref:`${rel}/source-delivery-record.json`,source_delivery_record_sha256:hash(b.recordBytes),ready_for_agent:false}:{}),target_context_digest:context.document_digest,target_profile_id:profile?.profile_id||'yss-full-lifecycle',selected_consumer_capabilities:capabilities,routes:routeRecords,status:'pending-context-reconciliation'};
452
- schema(receipt,fromDelivery?'docs/process/schemas/strategic-handoff-import-receipt-v3.schema.json':'docs/process/schemas/strategic-handoff-import-receipt.schema.json');
452
+ schema(receipt,fromDelivery?'.template-spec/process/schemas/strategic-handoff-import-receipt-v3.schema.json':'.template-spec/process/schemas/strategic-handoff-import-receipt.schema.json');
453
453
  write(stage,'import-receipt.json',json(receipt));
454
454
  write(stage,'context-reconciliation-draft.json',json({schema_version:2,status:'draft',import_receipt_ref:`${rel}/import-receipt.json`,target_context_digest:context.document_digest,route_ids:selected.map(route=>route.route_id),terms}));
455
455
  write(stage,'upstream-change-impact.json',json({schema_version:2,previous_bundle:b.manifest.previous_bundle,routes:selected.map(route=>({route_id:route.route_id,capability:route.capability,activation:route.activation,changed_source_ids:[...b.changes.updated,...b.changes.removed],added_source_ids:b.changes.added,status:'requires-lifecycle-reconciliation'})),policy:'mark-only-known-dependent-contracts-stale; unknown-dependency-or-design-basis-change-blocks-all'}));
@@ -459,7 +459,7 @@ export async function importBundle({bundle,targetRoot}) {
459
459
  if(capabilities.includes('backend-technical-design')&&backendRoute.activation!=='not-applicable')write(stage,'backend-technical-traceability-draft.json',json({schema_version:2,route_id:backendRoute.route_id,import_receipt_ref:`${rel}/import-receipt.json`,bundle_digest:b.manifest.bundle_digest,rows}));
460
460
  if(capabilities.includes('frontend-engineering-design')&&frontendRoute.activation!=='not-applicable'){
461
461
  const preflight={schema_version:b.handoff.schema_version===5?2:1,status:'draft',route_id:frontendRoute.route_id,capability:frontendRoute.capability,import_receipt_ref:`${rel}/import-receipt.json`,bundle_digest:b.manifest.bundle_digest,context_reconciliation_ref:'',...(b.handoff.schema_version===5?{ui_baseline_kind:uiBaselineKind(b.handoff),ui_baseline_ref:`${rel}/package/payload/files/${uiBaselineRef(b.handoff).persisted_ref}/${uiBaselineRef(b.handoff).manifest_ref}`}:{visual_baseline_ref:`${rel}/package/payload/files/${uiBaselineRef(b.handoff).persisted_ref}/${uiBaselineRef(b.handoff).manifest_ref}`}),source_rule_refs:rows.map(row=>row.source_id),backend_dependency:{mode:backendRoute.activation==='not-applicable'?'not-applicable':'required',route_id:backendRoute.route_id,...(backendRoute.activation==='not-applicable'?{reason:backendRoute.reason,impact_refs:backendRoute.impact_refs,evidence_refs:backendRoute.evidence_refs}:{})},ready_for_agent:false};
462
- schema(preflight,b.handoff.schema_version===5?'docs/process/schemas/frontend-strategic-preflight-v2.schema.json':'docs/process/schemas/frontend-strategic-preflight.schema.json');
462
+ schema(preflight,b.handoff.schema_version===5?'.template-spec/process/schemas/frontend-strategic-preflight-v2.schema.json':'.template-spec/process/schemas/frontend-strategic-preflight.schema.json');
463
463
  write(stage,'frontend-strategic-preflight-draft.json',json(preflight));write(stage,'frontend-traceability-draft.json',json({schema_version:1,route_id:frontendRoute.route_id,import_receipt_ref:`${rel}/import-receipt.json`,bundle_digest:b.manifest.bundle_digest,rows:rows.map(({tactical_refs,test_seam_refs,...row})=>({...row,frontend_case_refs:[]}))}));
464
464
  }
465
465
  if(capabilities.includes('delivery-coordination')&&coordinationRoute.activation!=='not-applicable')write(stage,'consumer-status-index-draft.json',json({schema_version:1,status:'draft',import_receipt_ref:`${rel}/import-receipt.json`,routes:b.handoff.consumer_routes.map(route=>({route_id:route.route_id,capability:route.capability,activation:route.activation,consumer_status:route.activation==='not-applicable'?'not-applicable':'pending',receipt_refs:[],acceptance_refs:[],feedback_refs:[]}))}));
@@ -2,8 +2,8 @@ import path from "node:path";
2
2
  import { ROOT } from "./lifecycle-registry.mjs";
3
3
  import { validateJsonSchema } from "./json-schema.mjs";
4
4
 
5
- export const TASK_PACKAGE_SCHEMA = path.join(ROOT, "docs/process/schemas/digital-human-task-package.schema.json");
6
- export const LEGACY_TASK_PACKAGE_SCHEMA = path.join(ROOT, "docs/process/schemas/subagent-task-package.schema.json");
5
+ export const TASK_PACKAGE_SCHEMA = path.join(ROOT, ".template-spec/process/schemas/digital-human-task-package.schema.json");
6
+ export const LEGACY_TASK_PACKAGE_SCHEMA = path.join(ROOT, ".template-spec/process/schemas/subagent-task-package.schema.json");
7
7
 
8
8
  export function validateTaskPackageSchema(value, schemaPath = TASK_PACKAGE_SCHEMA) {
9
9
  const effectiveSchema = path.resolve(schemaPath) === path.resolve(LEGACY_TASK_PACKAGE_SCHEMA) ? TASK_PACKAGE_SCHEMA : schemaPath;
@@ -16,7 +16,7 @@ import { enforceFrontendDelivery } from "./frontend-delivery-boundary.mjs";
16
16
  import { LEGACY_TASK_PACKAGE_SCHEMA, TASK_PACKAGE_SCHEMA, validateTaskPackageSchema } from "./task-package-schema.mjs";
17
17
 
18
18
  export { LEGACY_TASK_PACKAGE_SCHEMA, TASK_PACKAGE_SCHEMA, validateTaskPackageSchema };
19
- export const TASK_PACKAGE_REGISTRY_REF = "docs/agents/digital-human-roles.yaml";
19
+ export const TASK_PACKAGE_REGISTRY_REF = ".template-spec/agents/digital-human-roles.yaml";
20
20
  export const CONTRACT_KINDS = new Set(["lifecycle-work-unit", "slice-implementation", "template-maintenance"]);
21
21
  export const EXECUTION_STATES = new Set(["Explorer", "Drafter", "Worker", "Reviewer", "Verifier"]);
22
22
  export const WORKFLOW_STATUSES = new Set(["not-started", "active", "paused", "resolved", "failed"]);
@@ -30,5 +30,5 @@ export function enforceTechnicalDesign(state = {}, { root = ROOT, execution, rea
30
30
  if(inValidationPhase())args.push('--validation-dependencies');
31
31
  const verified = spawnSync(process.execPath, args, { cwd: root, encoding: 'utf8', timeout: 60000, maxBuffer: 2 * 1024 * 1024 });
32
32
  ensure(verified.status === 0, `技术设计不可消费: ${verified.error?.message || verified.stderr}`);
33
- if(inValidationPhase()){let output;try{output=JSON.parse(verified.stdout);}catch{throw new TypeError('VALIDATION_RECEIPT_INVALID: 技术设计子进程未返回依赖');}const dependencies=output.validation_dependencies;const required=[file,...(execution?[path.resolve(root,approvedExecutionBinding(execution).ref),path.resolve(root,approvedExecutionBinding(execution).approval_ref),path.resolve(root,'docs/agents/digital-human-roles.yaml')]:[])];ensure(required.every(ref=>dependencies?.files?.some(row=>row.file===ref)),'VALIDATION_RECEIPT_INVALID: 技术设计依赖报告缺少必要原始资产');acceptValidationDependencies(dependencies);}
33
+ if(inValidationPhase()){let output;try{output=JSON.parse(verified.stdout);}catch{throw new TypeError('VALIDATION_RECEIPT_INVALID: 技术设计子进程未返回依赖');}const dependencies=output.validation_dependencies;const required=[file,...(execution?[path.resolve(root,approvedExecutionBinding(execution).ref),path.resolve(root,approvedExecutionBinding(execution).approval_ref),path.resolve(root,'.template-spec/agents/digital-human-roles.yaml')]:[])];ensure(required.every(ref=>dependencies?.files?.some(row=>row.file===ref)),'VALIDATION_RECEIPT_INVALID: 技术设计依赖报告缺少必要原始资产');acceptValidationDependencies(dependencies);}
34
34
  }
@@ -81,7 +81,7 @@ function checkAsset(asset, io) {
81
81
  export function validateUserDecision(record, options = {}) {
82
82
  const io = decisionIO(options);
83
83
  const policy = (options.rolesDoc || loadDigitalHumanRoles()).user_decision_policy;
84
- validateJsonSchema(record, path.join(ROOT, "docs/process/schemas/user-decision.schema.json"), { label: "用户决定记录" });
84
+ validateJsonSchema(record, path.join(ROOT, ".template-spec/process/schemas/user-decision.schema.json"), { label: "用户决定记录" });
85
85
  const { request, responses } = record;
86
86
  const originalRequest = messageFromSource(request.requester_source, io, policy);
87
87
  if (originalRequest.actor_kind !== "biological-human" || originalRequest.principal_ref !== request.requester_ref) decisionError("user-decision-responder-mismatch", "提问者来源不匹配");
@@ -164,6 +164,7 @@ export function verifyUserDecisionFile(ref, options = {}) {
164
164
 
165
165
  export function assertUserDecisionRequirement(requirement, options = {}) {
166
166
  if (!requirement) decisionError("user-decision-response-required", "缺少当前决定及其范围");
167
+ if (requirement.user_decision_ref && requirement.continuation_ref) decisionError("user-decision-proof-conflict", "当前决定与批准延续是两种证明路径,不得同时提供");
167
168
  if (requirement.continuation_ref) return assertDecisionContinuation(requirement, options.rolesDoc || loadDigitalHumanRoles(), options);
168
169
  return verifyUserDecisionFile(requirement.user_decision_ref, { ...options, expected: [requirement] });
169
170
  }
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env node
2
+ import { parseArgs } from 'node:util';
3
+ import path from 'node:path';
4
+ import { lifecycleStatus } from './lib/lifecycle-status.mjs';
5
+
6
+ try {
7
+ const { values } = parseArgs({ strict: true, options: { root: { type: 'string' }, checkpoint: { type: 'string' } } });
8
+ const result = lifecycleStatus({ root: path.resolve(values.root ?? '.'), checkpointRef: values.checkpoint });
9
+ process.stdout.write(`${JSON.stringify(result, null, 2)}\n`);
10
+ if (result.blockers.length) process.exitCode = 1;
11
+ } catch (error) {
12
+ process.stdout.write(`${JSON.stringify({ schema_version: 1, read_only: true, blockers: [error.message], owner: '未登记', next_action: `核查状态输入:${error.message}`, execution_authorization: 'not-evaluated', verification_scope: [{ id: 'status-input', status: 'failed', refs: [], reason: error.message }], diagnostics: [{ code: 'status-input-invalid', severity: 'error', message: error.message, source_ref: null, owner: '未登记', recovery: '修复输入后重新读取状态' }], next_step: { action_type: 'repair', command: null, input_refs: [], prerequisites: ['提供有效项目根和 checkpoint 引用'] } }, null, 2)}\n`);
13
+ process.exitCode = 1;
14
+ }
@@ -0,0 +1,21 @@
1
+ #!/usr/bin/env node
2
+ import { parseArgs } from 'node:util';
3
+ import path from 'node:path';
4
+ import { preparePlanSpecEntry, diffPlanSpecEntry } from './lib/plan-spec-entry-view.mjs';
5
+
6
+ try {
7
+ const [operation, ...args] = process.argv.slice(2);
8
+ const { values } = parseArgs({ args, strict: true, options: {
9
+ root: { type: 'string' }, feature: { type: 'string' }, plan: { type: 'string' },
10
+ 'context-reconciliation': { type: 'string' }, review: { type: 'string' },
11
+ } });
12
+ const root = path.resolve(values.root ?? '.');
13
+ let result;
14
+ if (operation === 'prepare') result = preparePlanSpecEntry({ root, featureId: values.feature, planRef: values.plan, contextRef: values['context-reconciliation'] });
15
+ else if (operation === 'diff') result = diffPlanSpecEntry({ root, reviewRef: values.review });
16
+ else throw new TypeError('用法: scripts/plan-spec-entry prepare --root <项目> --feature <id> --plan <ref> --context-reconciliation <ref> | diff --root <项目> --review <ref>');
17
+ process.stdout.write(`${JSON.stringify(result, null, 2)}\n`);
18
+ } catch (error) {
19
+ process.stdout.write(`${JSON.stringify({ schema_version: 1, status: 'blocked', blocking_signals: ['plan-spec-entry-input-unavailable'], missing_requirements: [error.message], approval_created: false }, null, 2)}\n`);
20
+ process.exitCode = 1;
21
+ }
@@ -27,7 +27,7 @@ try {
27
27
  }
28
28
  const receipt = read(safe(root, receiptRef));
29
29
  ensure([2, 3].includes(receipt.schema_version), 'design-entry-receipt-version');
30
- schema(receipt, receipt.schema_version === 3 ? 'docs/process/schemas/strategic-handoff-import-receipt-v3.schema.json' : 'docs/process/schemas/strategic-handoff-import-receipt.schema.json');
30
+ schema(receipt, receipt.schema_version === 3 ? '.template-spec/process/schemas/strategic-handoff-import-receipt-v3.schema.json' : '.template-spec/process/schemas/strategic-handoff-import-receipt.schema.json');
31
31
  const base = `docs/handoffs/${receipt.bundle_id}/${receipt.version}`;
32
32
  ensure(receiptRef === `${base}/import-receipt.json` && receipt.package_ref === `${base}/package`, 'design-entry-receipt-path');
33
33
  const entry = await openBundle(safe(root, receipt.package_ref), inspect);
@@ -8,7 +8,7 @@ import { read, safe, ensure } from './lib/strategic-handoff-io.mjs';
8
8
  async function preflightExport(values) {
9
9
  const root=path.resolve(values['source-root']),handoff=read(safe(root,values.handoff));
10
10
  const required=handoff.schema_version===5&&handoff.ui_baseline_kind==='existing-ui-baseline';
11
- ensure(!required||values['preflight-input'],'preflight-required: 既有 UI 战略导出必须提供 --preflight-input <file>;先按 docs/process/delivery-preflight.md 准备源资产清单并执行 export 阶段只读预检');
11
+ ensure(!required||values['preflight-input'],'preflight-required: 既有 UI 战略导出必须提供 --preflight-input <file>;先按 .template-spec/process/delivery-preflight.md 准备源资产清单并执行 export 阶段只读预检');
12
12
  if(!values['preflight-input'])return;
13
13
  const {preflightDelivery}=await import('./lib/delivery-preflight.mjs');
14
14
  const input=read(path.resolve(values['preflight-input']));
@@ -9,7 +9,7 @@ import { validateVisualBaseline } from "../.agents/skills/yss-prototype-stage/sc
9
9
  import { enforceFrontendDelivery } from "./lib/frontend-delivery-boundary.mjs";
10
10
 
11
11
  const repoRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
12
- const schemaPath = path.join(repoRoot, "docs/process/schemas/frontend-implementation-evidence.schema.json");
12
+ const schemaPath = path.join(repoRoot, ".template-spec/process/schemas/frontend-implementation-evidence.schema.json");
13
13
  const validator = String.raw`
14
14
  import json
15
15
  import sys