create-yss-spec 3.5.6 → 3.5.9

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 (578) hide show
  1. package/bin/create-yss-spec.js +3 -1
  2. package/cli-core.lock.json +10 -6
  3. package/package.json +4 -1
  4. package/src/api/_sync-service.js +3 -1
  5. package/src/command-runner.mjs +44 -9
  6. package/src/commands/doctor.js +40 -0
  7. package/src/commands/skills.js +7 -2
  8. package/src/content-identity.js +111 -0
  9. package/src/runtime-store.mjs +650 -0
  10. package/src/template/asset-runtime.js +124 -22
  11. package/src/template/instance-runtime.js +23 -7
  12. package/src/validation/metadata.js +8 -0
  13. package/template/.agents/skills/.strategic-design-skills-manifest.json +3 -3
  14. package/template/.agents/skills/alibaba-java-code-style/SKILL.md +30 -36
  15. package/template/.agents/skills/archify/SKILL.md +2 -2
  16. package/template/.agents/skills/archify/scripts/yss-safe-deliver.mjs +10 -6
  17. package/template/.agents/skills/archify/test/yss-safe-deliver.test.mjs +9 -2
  18. package/template/.agents/skills/code-review/SKILL.md +19 -11
  19. package/template/.agents/skills/code-review/references/candidate-capture.md +1 -1
  20. package/template/.agents/skills/code-review/references/legacy-convergence.md +3 -1
  21. package/template/.agents/skills/code-review/references/review-axis-checklists.md +2 -0
  22. package/template/.agents/skills/code-review/references/yss-review-standards.md +4 -2
  23. package/template/.agents/skills/competitive-intelligence/SKILL.md +32 -74
  24. package/template/.agents/skills/file-export-download/SKILL.md +4 -73
  25. package/template/.agents/skills/file-export-download/references/binary-contract-example.md +26 -0
  26. package/template/.agents/skills/file-export-download/references/download-call-example.md +45 -0
  27. package/template/.agents/skills/formily-foundation/SKILL.md +6 -105
  28. package/template/.agents/skills/formily-foundation/references/async-save-example.md +57 -0
  29. package/template/.agents/skills/formily-foundation/references/query-layout.md +50 -0
  30. package/template/.agents/skills/formily-linkage-effects/SKILL.md +3 -116
  31. package/template/.agents/skills/formily-linkage-effects/references/linkage-example.md +116 -0
  32. package/template/.agents/skills/formily-mode-slot-detail/SKILL.md +3 -81
  33. package/template/.agents/skills/formily-mode-slot-detail/references/mode-slot-example.md +81 -0
  34. package/template/.agents/skills/formily-step-flow/SKILL.md +3 -143
  35. package/template/.agents/skills/formily-step-flow/references/step-flow-example.md +143 -0
  36. package/template/.agents/skills/handoff/SKILL.md +3 -1
  37. package/template/.agents/skills/i-have-adhd/SKILL.md +2 -2
  38. package/template/.agents/skills/i-have-adhd/references/yss-adaptation.md +2 -2
  39. package/template/.agents/skills/i-have-adhd/tests/verify-integration.mjs +7 -2
  40. package/template/.agents/skills/implement/SKILL.md +2 -2
  41. package/template/.agents/skills/llm-wiki/references/transactions.md +2 -2
  42. package/template/.agents/skills/llm-wiki/scripts/core.mjs +40 -2
  43. package/template/.agents/skills/llm-wiki/scripts/transaction.mjs +30 -27
  44. package/template/.agents/skills/llm-wiki/scripts/v2.test.mjs +38 -2
  45. package/template/.agents/skills/lombok/SKILL.md +2 -0
  46. package/template/.agents/skills/mapstruct/SKILL.md +2 -0
  47. package/template/.agents/skills/tdd/SKILL.md +2 -2
  48. package/template/.agents/skills/theme-token-usage/SKILL.md +6 -5
  49. package/template/.agents/skills/wayfinder/references/chart-map.md +2 -2
  50. package/template/.agents/skills/wayfinder/references/ticket-types.md +1 -1
  51. package/template/.agents/skills/yss-api-integration/SKILL.md +13 -50
  52. package/template/.agents/skills/yss-api-integration/references/orval-list-example.md +38 -0
  53. package/template/.agents/skills/yss-application/SKILL.md +11 -5
  54. package/template/.agents/skills/yss-audit-log/SKILL.md +8 -6
  55. package/template/.agents/skills/yss-audit-log/references/README.md +5 -5
  56. package/template/.agents/skills/yss-cache/SKILL.md +4 -4
  57. package/template/.agents/skills/yss-ddd-scaffold-generator/SKILL.md +7 -8
  58. package/template/.agents/skills/yss-ddd-scaffold-generator/references/USAGE_EXAMPLES.md +13 -6
  59. package/template/.agents/skills/yss-ddd-scaffold-generator/references/command-examples.md +2 -0
  60. package/template/.agents/skills/yss-ddd-scaffold-generator/scripts/scaffold-generator.test.mjs +28 -1
  61. package/template/.agents/skills/yss-design-system/SKILL.md +2 -2
  62. package/template/.agents/skills/yss-distributed-id/SKILL.md +4 -4
  63. package/template/.agents/skills/yss-dto/SKILL.md +9 -9
  64. package/template/.agents/skills/yss-dto/references/README.md +4 -4
  65. package/template/.agents/skills/yss-dto/references/wire-validation-checklist.md +4 -4
  66. package/template/.agents/skills/yss-excel-mvc/SKILL.md +4 -4
  67. package/template/.agents/skills/yss-exception/SKILL.md +42 -48
  68. package/template/.agents/skills/yss-formily-schema-generator/SKILL.md +26 -170
  69. package/template/.agents/skills/yss-formily-schema-generator/references/workflow.md +49 -193
  70. package/template/.agents/skills/yss-frontend-scaffold-generator/SKILL.md +14 -10
  71. package/template/.agents/skills/yss-implementation-contract-compiler/SKILL.md +4 -6
  72. package/template/.agents/skills/yss-implementation-contract-compiler/references/yss-skill-execution-result.md +15 -1
  73. package/template/.agents/skills/yss-layered-mvc-scaffold-generator/SKILL.md +1 -1
  74. package/template/.agents/skills/yss-mybatis/SKILL.md +4 -4
  75. package/template/.agents/skills/yss-openapi-draft-review/SKILL.md +6 -4
  76. package/template/.agents/skills/yss-openapi-draft-review/references/review-output.md +2 -0
  77. package/template/.agents/skills/yss-openapi-draft-review/references/semantic-review.md +3 -3
  78. package/template/.agents/skills/yss-openapi-governance/SKILL.md +5 -7
  79. package/template/.agents/skills/yss-openapi-governance/references/governance-output.md +2 -0
  80. package/template/.agents/skills/yss-openapi-governance/references/governance-workflow.md +3 -3
  81. package/template/.agents/skills/yss-product-lifecycle/SKILL.md +32 -26
  82. package/template/.agents/skills/yss-product-lifecycle/references/artifact-dependencies.md +1 -1
  83. package/template/.agents/skills/yss-product-lifecycle/references/matt-yss-adapter.md +28 -6
  84. package/template/.agents/skills/yss-product-lifecycle/references/orchestration-contract.yaml +143 -4
  85. package/template/.agents/skills/yss-product-lifecycle/references/orchestration.md +38 -13
  86. package/template/.agents/skills/yss-product-lifecycle/references/plan-requirements.md +7 -6
  87. package/template/.agents/skills/yss-product-lifecycle/references/state-model.md +3 -1
  88. package/template/.agents/skills/yss-product-lifecycle/references/user-decisions.md +3 -3
  89. package/template/.agents/skills/yss-prototype-stage/SKILL.md +1 -5
  90. package/template/.agents/skills/yss-prototype-stage/scripts/verify-prototype-design.mjs +1 -0
  91. package/template/.agents/skills/yss-repository/SKILL.md +2 -2
  92. package/template/.agents/skills/yss-research/SKILL.md +39 -48
  93. package/template/.agents/skills/yss-research/assets/competitive-evidence-template.yaml +146 -0
  94. package/template/.agents/skills/yss-research/references/competitive-analysis.md +76 -0
  95. package/template/.agents/skills/yss-research/references/competitive-analysis.schema.json +324 -0
  96. package/template/.agents/skills/yss-research/references/evidence-contract.md +8 -0
  97. package/template/.agents/skills/yss-research/scripts/lib/competitive-analysis.mjs +185 -0
  98. package/template/.agents/skills/yss-research/scripts/render-competitive-outputs.mjs +16 -0
  99. package/template/.agents/skills/yss-research/scripts/validate-research-package.mjs +6 -2
  100. package/template/.agents/skills/yss-research/tests/competitive-scenarios.test.mjs +270 -0
  101. package/template/.agents/skills/yss-resilience4j/SKILL.md +25 -31
  102. package/template/.agents/skills/yss-security-algorithm/SKILL.md +37 -43
  103. package/template/.agents/skills/yss-skill-source-index-refresh/SKILL.md +29 -36
  104. package/template/.agents/skills/yss-skill-source-index-refresh/references/backend-component-platform-compatibility.md +1 -1
  105. package/template/.agents/skills/yss-stage-decision/SKILL.md +2 -5
  106. package/template/.agents/skills/yss-stage-decision/scripts/validate-domain-strategy.mjs +8 -5
  107. package/template/.agents/skills/yss-stage-decision/scripts/validate-stage-decision-package.mjs +8 -5
  108. package/template/.agents/skills/yss-stage-decision/tests/run-scenarios.mjs +83 -13
  109. package/template/.agents/skills/yss-tactical-design/SKILL.md +1 -1
  110. package/template/.agents/skills/yss-tactical-design/references/output-template.md +3 -3
  111. package/template/.agents/skills/yss-tactical-design/references/tactical-design-contract.md +1 -1
  112. package/template/.agents/skills/yss-technical-design/SKILL.md +6 -5
  113. package/template/.agents/skills/yss-ui/SKILL.md +7 -1
  114. package/template/.agents/skills/yss-ui/assets/docs/guide/gitlab-ci-integration.md +2 -2
  115. package/template/.agents/skills/yss-ui/references/checklist.md +38 -96
  116. package/template/.agents/skills/yss-ui/references/component-routing.md +3 -1
  117. package/template/.agents/skills/yss-ui/references/quick-recipes.md +17 -272
  118. package/template/.agents/skills/yss-ui/references/specialized-components.md +3 -3
  119. package/template/.agents/skills/yss-ui-business-page-generation/SKILL.md +1 -1
  120. package/template/.agents/skills/yss-up-springboot3/SKILL.md +19 -21
  121. package/template/.agents/skills/yss-userinfo/SKILL.md +27 -33
  122. package/template/.agents/skills/yss-validation/SKILL.md +26 -32
  123. package/template/.agents/skills/yss-web-controller/SKILL.md +11 -44
  124. package/template/.agents/skills/yss-web-controller/references/crud-generation.md +38 -0
  125. package/template/.agents/skills/ytable-usage/SKILL.md +2 -2
  126. package/template/.agents/skills/ytree-usage/SKILL.md +2 -80
  127. package/template/.agents/skills/ytree-usage/references/tree-and-confirmation-example.md +81 -0
  128. package/template/.codex/skills/alibaba-java-code-style/SKILL.md +30 -36
  129. package/template/.codex/skills/archify/SKILL.md +2 -2
  130. package/template/.codex/skills/archify/scripts/yss-safe-deliver.mjs +10 -6
  131. package/template/.codex/skills/archify/test/yss-safe-deliver.test.mjs +9 -2
  132. package/template/.codex/skills/code-review/SKILL.md +19 -11
  133. package/template/.codex/skills/code-review/references/candidate-capture.md +1 -1
  134. package/template/.codex/skills/code-review/references/legacy-convergence.md +3 -1
  135. package/template/.codex/skills/code-review/references/review-axis-checklists.md +2 -0
  136. package/template/.codex/skills/code-review/references/yss-review-standards.md +4 -2
  137. package/template/.codex/skills/competitive-intelligence/SKILL.md +32 -74
  138. package/template/.codex/skills/file-export-download/SKILL.md +4 -73
  139. package/template/.codex/skills/file-export-download/references/binary-contract-example.md +26 -0
  140. package/template/.codex/skills/file-export-download/references/download-call-example.md +45 -0
  141. package/template/.codex/skills/formily-foundation/SKILL.md +6 -105
  142. package/template/.codex/skills/formily-foundation/references/async-save-example.md +57 -0
  143. package/template/.codex/skills/formily-foundation/references/query-layout.md +50 -0
  144. package/template/.codex/skills/formily-linkage-effects/SKILL.md +3 -116
  145. package/template/.codex/skills/formily-linkage-effects/references/linkage-example.md +116 -0
  146. package/template/.codex/skills/formily-mode-slot-detail/SKILL.md +3 -81
  147. package/template/.codex/skills/formily-mode-slot-detail/references/mode-slot-example.md +81 -0
  148. package/template/.codex/skills/formily-step-flow/SKILL.md +3 -143
  149. package/template/.codex/skills/formily-step-flow/references/step-flow-example.md +143 -0
  150. package/template/.codex/skills/handoff/SKILL.md +3 -1
  151. package/template/.codex/skills/i-have-adhd/SKILL.md +2 -2
  152. package/template/.codex/skills/i-have-adhd/references/yss-adaptation.md +2 -2
  153. package/template/.codex/skills/i-have-adhd/tests/verify-integration.mjs +7 -2
  154. package/template/.codex/skills/implement/SKILL.md +2 -2
  155. package/template/.codex/skills/llm-wiki/references/transactions.md +2 -2
  156. package/template/.codex/skills/llm-wiki/scripts/core.mjs +40 -2
  157. package/template/.codex/skills/llm-wiki/scripts/transaction.mjs +30 -27
  158. package/template/.codex/skills/llm-wiki/scripts/v2.test.mjs +38 -2
  159. package/template/.codex/skills/lombok/SKILL.md +2 -0
  160. package/template/.codex/skills/mapstruct/SKILL.md +2 -0
  161. package/template/.codex/skills/product-design/references/communication-protocol.md +3 -3
  162. package/template/.codex/skills/product-design/references/critical-overrides.md +4 -5
  163. package/template/.codex/skills/product-design/skills/audit/SKILL.md +2 -4
  164. package/template/.codex/skills/product-design/skills/get-context/SKILL.md +6 -8
  165. package/template/.codex/skills/product-design/skills/ideate/SKILL.md +3 -3
  166. package/template/.codex/skills/product-design/skills/image-to-code/SKILL.md +3 -5
  167. package/template/.codex/skills/product-design/skills/index/SKILL.md +1 -1
  168. package/template/.codex/skills/product-design/skills/prototype/SKILL.md +2 -4
  169. package/template/.codex/skills/product-design/skills/research/SKILL.md +4 -6
  170. package/template/.codex/skills/product-design/skills/research/assets/research-brief-template.md +3 -3
  171. package/template/.codex/skills/product-design/skills/share/SKILL.md +2 -4
  172. package/template/.codex/skills/product-design/skills/url-to-code/SKILL.md +2 -4
  173. package/template/.codex/skills/product-design/skills/user-context/SKILL.md +1 -1
  174. package/template/.codex/skills/tdd/SKILL.md +2 -2
  175. package/template/.codex/skills/theme-token-usage/SKILL.md +6 -5
  176. package/template/.codex/skills/wayfinder/references/chart-map.md +2 -2
  177. package/template/.codex/skills/wayfinder/references/ticket-types.md +1 -1
  178. package/template/.codex/skills/yss-api-integration/SKILL.md +13 -50
  179. package/template/.codex/skills/yss-api-integration/references/orval-list-example.md +38 -0
  180. package/template/.codex/skills/yss-application/SKILL.md +11 -5
  181. package/template/.codex/skills/yss-audit-log/SKILL.md +8 -6
  182. package/template/.codex/skills/yss-audit-log/references/README.md +5 -5
  183. package/template/.codex/skills/yss-cache/SKILL.md +4 -4
  184. package/template/.codex/skills/yss-ddd-scaffold-generator/SKILL.md +7 -8
  185. package/template/.codex/skills/yss-ddd-scaffold-generator/references/USAGE_EXAMPLES.md +13 -6
  186. package/template/.codex/skills/yss-ddd-scaffold-generator/references/command-examples.md +2 -0
  187. package/template/.codex/skills/yss-ddd-scaffold-generator/scripts/scaffold-generator.test.mjs +28 -1
  188. package/template/.codex/skills/yss-design-system/SKILL.md +2 -2
  189. package/template/.codex/skills/yss-distributed-id/SKILL.md +4 -4
  190. package/template/.codex/skills/yss-dto/SKILL.md +9 -9
  191. package/template/.codex/skills/yss-dto/references/README.md +4 -4
  192. package/template/.codex/skills/yss-dto/references/wire-validation-checklist.md +4 -4
  193. package/template/.codex/skills/yss-excel-mvc/SKILL.md +4 -4
  194. package/template/.codex/skills/yss-exception/SKILL.md +42 -48
  195. package/template/.codex/skills/yss-formily-schema-generator/SKILL.md +26 -170
  196. package/template/.codex/skills/yss-formily-schema-generator/references/workflow.md +49 -193
  197. package/template/.codex/skills/yss-frontend-scaffold-generator/SKILL.md +14 -10
  198. package/template/.codex/skills/yss-implementation-contract-compiler/SKILL.md +4 -6
  199. package/template/.codex/skills/yss-implementation-contract-compiler/references/yss-skill-execution-result.md +15 -1
  200. package/template/.codex/skills/yss-layered-mvc-scaffold-generator/SKILL.md +1 -1
  201. package/template/.codex/skills/yss-mybatis/SKILL.md +4 -4
  202. package/template/.codex/skills/yss-openapi-draft-review/SKILL.md +6 -4
  203. package/template/.codex/skills/yss-openapi-draft-review/references/review-output.md +2 -0
  204. package/template/.codex/skills/yss-openapi-draft-review/references/semantic-review.md +3 -3
  205. package/template/.codex/skills/yss-openapi-governance/SKILL.md +5 -7
  206. package/template/.codex/skills/yss-openapi-governance/references/governance-output.md +2 -0
  207. package/template/.codex/skills/yss-openapi-governance/references/governance-workflow.md +3 -3
  208. package/template/.codex/skills/yss-product-lifecycle/SKILL.md +32 -26
  209. package/template/.codex/skills/yss-product-lifecycle/references/artifact-dependencies.md +1 -1
  210. package/template/.codex/skills/yss-product-lifecycle/references/matt-yss-adapter.md +28 -6
  211. package/template/.codex/skills/yss-product-lifecycle/references/orchestration-contract.yaml +143 -4
  212. package/template/.codex/skills/yss-product-lifecycle/references/orchestration.md +38 -13
  213. package/template/.codex/skills/yss-product-lifecycle/references/plan-requirements.md +7 -6
  214. package/template/.codex/skills/yss-product-lifecycle/references/state-model.md +3 -1
  215. package/template/.codex/skills/yss-product-lifecycle/references/user-decisions.md +3 -3
  216. package/template/.codex/skills/yss-prototype-stage/SKILL.md +1 -5
  217. package/template/.codex/skills/yss-prototype-stage/scripts/verify-prototype-design.mjs +1 -0
  218. package/template/.codex/skills/yss-repository/SKILL.md +2 -2
  219. package/template/.codex/skills/yss-research/SKILL.md +39 -48
  220. package/template/.codex/skills/yss-research/assets/competitive-evidence-template.yaml +146 -0
  221. package/template/.codex/skills/yss-research/references/competitive-analysis.md +76 -0
  222. package/template/.codex/skills/yss-research/references/competitive-analysis.schema.json +324 -0
  223. package/template/.codex/skills/yss-research/references/evidence-contract.md +8 -0
  224. package/template/.codex/skills/yss-research/scripts/lib/competitive-analysis.mjs +185 -0
  225. package/template/.codex/skills/yss-research/scripts/render-competitive-outputs.mjs +16 -0
  226. package/template/.codex/skills/yss-research/scripts/validate-research-package.mjs +6 -2
  227. package/template/.codex/skills/yss-research/tests/competitive-scenarios.test.mjs +270 -0
  228. package/template/.codex/skills/yss-resilience4j/SKILL.md +25 -31
  229. package/template/.codex/skills/yss-security-algorithm/SKILL.md +37 -43
  230. package/template/.codex/skills/yss-skill-source-index-refresh/SKILL.md +29 -36
  231. package/template/.codex/skills/yss-skill-source-index-refresh/references/backend-component-platform-compatibility.md +1 -1
  232. package/template/.codex/skills/yss-stage-decision/SKILL.md +2 -5
  233. package/template/.codex/skills/yss-stage-decision/scripts/validate-domain-strategy.mjs +8 -5
  234. package/template/.codex/skills/yss-stage-decision/scripts/validate-stage-decision-package.mjs +8 -5
  235. package/template/.codex/skills/yss-stage-decision/tests/run-scenarios.mjs +83 -13
  236. package/template/.codex/skills/yss-tactical-design/SKILL.md +1 -1
  237. package/template/.codex/skills/yss-tactical-design/references/output-template.md +3 -3
  238. package/template/.codex/skills/yss-tactical-design/references/tactical-design-contract.md +1 -1
  239. package/template/.codex/skills/yss-technical-design/SKILL.md +6 -5
  240. package/template/.codex/skills/yss-ui/SKILL.md +7 -1
  241. package/template/.codex/skills/yss-ui/assets/docs/guide/gitlab-ci-integration.md +2 -2
  242. package/template/.codex/skills/yss-ui/references/checklist.md +38 -96
  243. package/template/.codex/skills/yss-ui/references/component-routing.md +3 -1
  244. package/template/.codex/skills/yss-ui/references/quick-recipes.md +17 -272
  245. package/template/.codex/skills/yss-ui/references/specialized-components.md +3 -3
  246. package/template/.codex/skills/yss-ui-business-page-generation/SKILL.md +1 -1
  247. package/template/.codex/skills/yss-up-springboot3/SKILL.md +19 -21
  248. package/template/.codex/skills/yss-userinfo/SKILL.md +27 -33
  249. package/template/.codex/skills/yss-validation/SKILL.md +26 -32
  250. package/template/.codex/skills/yss-web-controller/SKILL.md +11 -44
  251. package/template/.codex/skills/yss-web-controller/references/crud-generation.md +38 -0
  252. package/template/.codex/skills/ytable-usage/SKILL.md +2 -2
  253. package/template/.codex/skills/ytree-usage/SKILL.md +2 -80
  254. package/template/.codex/skills/ytree-usage/references/tree-and-confirmation-example.md +81 -0
  255. package/template/.cursor/skills/alibaba-java-code-style/SKILL.md +30 -36
  256. package/template/.cursor/skills/archify/SKILL.md +2 -2
  257. package/template/.cursor/skills/archify/scripts/yss-safe-deliver.mjs +10 -6
  258. package/template/.cursor/skills/archify/test/yss-safe-deliver.test.mjs +9 -2
  259. package/template/.cursor/skills/code-review/SKILL.md +19 -11
  260. package/template/.cursor/skills/code-review/references/candidate-capture.md +1 -1
  261. package/template/.cursor/skills/code-review/references/legacy-convergence.md +3 -1
  262. package/template/.cursor/skills/code-review/references/review-axis-checklists.md +2 -0
  263. package/template/.cursor/skills/code-review/references/yss-review-standards.md +4 -2
  264. package/template/.cursor/skills/competitive-intelligence/SKILL.md +32 -74
  265. package/template/.cursor/skills/file-export-download/SKILL.md +4 -73
  266. package/template/.cursor/skills/file-export-download/references/binary-contract-example.md +26 -0
  267. package/template/.cursor/skills/file-export-download/references/download-call-example.md +45 -0
  268. package/template/.cursor/skills/formily-foundation/SKILL.md +6 -105
  269. package/template/.cursor/skills/formily-foundation/references/async-save-example.md +57 -0
  270. package/template/.cursor/skills/formily-foundation/references/query-layout.md +50 -0
  271. package/template/.cursor/skills/formily-linkage-effects/SKILL.md +3 -116
  272. package/template/.cursor/skills/formily-linkage-effects/references/linkage-example.md +116 -0
  273. package/template/.cursor/skills/formily-mode-slot-detail/SKILL.md +3 -81
  274. package/template/.cursor/skills/formily-mode-slot-detail/references/mode-slot-example.md +81 -0
  275. package/template/.cursor/skills/formily-step-flow/SKILL.md +3 -143
  276. package/template/.cursor/skills/formily-step-flow/references/step-flow-example.md +143 -0
  277. package/template/.cursor/skills/handoff/SKILL.md +3 -1
  278. package/template/.cursor/skills/i-have-adhd/SKILL.md +2 -2
  279. package/template/.cursor/skills/i-have-adhd/references/yss-adaptation.md +2 -2
  280. package/template/.cursor/skills/i-have-adhd/tests/verify-integration.mjs +7 -2
  281. package/template/.cursor/skills/implement/SKILL.md +2 -2
  282. package/template/.cursor/skills/llm-wiki/references/transactions.md +2 -2
  283. package/template/.cursor/skills/llm-wiki/scripts/core.mjs +40 -2
  284. package/template/.cursor/skills/llm-wiki/scripts/transaction.mjs +30 -27
  285. package/template/.cursor/skills/llm-wiki/scripts/v2.test.mjs +38 -2
  286. package/template/.cursor/skills/lombok/SKILL.md +2 -0
  287. package/template/.cursor/skills/mapstruct/SKILL.md +2 -0
  288. package/template/.cursor/skills/tdd/SKILL.md +2 -2
  289. package/template/.cursor/skills/theme-token-usage/SKILL.md +6 -5
  290. package/template/.cursor/skills/wayfinder/references/chart-map.md +2 -2
  291. package/template/.cursor/skills/wayfinder/references/ticket-types.md +1 -1
  292. package/template/.cursor/skills/yss-api-integration/SKILL.md +13 -50
  293. package/template/.cursor/skills/yss-api-integration/references/orval-list-example.md +38 -0
  294. package/template/.cursor/skills/yss-application/SKILL.md +11 -5
  295. package/template/.cursor/skills/yss-audit-log/SKILL.md +8 -6
  296. package/template/.cursor/skills/yss-audit-log/references/README.md +5 -5
  297. package/template/.cursor/skills/yss-cache/SKILL.md +4 -4
  298. package/template/.cursor/skills/yss-ddd-scaffold-generator/SKILL.md +7 -8
  299. package/template/.cursor/skills/yss-ddd-scaffold-generator/references/USAGE_EXAMPLES.md +13 -6
  300. package/template/.cursor/skills/yss-ddd-scaffold-generator/references/command-examples.md +2 -0
  301. package/template/.cursor/skills/yss-ddd-scaffold-generator/scripts/scaffold-generator.test.mjs +28 -1
  302. package/template/.cursor/skills/yss-design-system/SKILL.md +2 -2
  303. package/template/.cursor/skills/yss-distributed-id/SKILL.md +4 -4
  304. package/template/.cursor/skills/yss-dto/SKILL.md +9 -9
  305. package/template/.cursor/skills/yss-dto/references/README.md +4 -4
  306. package/template/.cursor/skills/yss-dto/references/wire-validation-checklist.md +4 -4
  307. package/template/.cursor/skills/yss-excel-mvc/SKILL.md +4 -4
  308. package/template/.cursor/skills/yss-exception/SKILL.md +42 -48
  309. package/template/.cursor/skills/yss-formily-schema-generator/SKILL.md +26 -170
  310. package/template/.cursor/skills/yss-formily-schema-generator/references/workflow.md +49 -193
  311. package/template/.cursor/skills/yss-frontend-scaffold-generator/SKILL.md +14 -10
  312. package/template/.cursor/skills/yss-implementation-contract-compiler/SKILL.md +4 -6
  313. package/template/.cursor/skills/yss-implementation-contract-compiler/references/yss-skill-execution-result.md +15 -1
  314. package/template/.cursor/skills/yss-layered-mvc-scaffold-generator/SKILL.md +1 -1
  315. package/template/.cursor/skills/yss-mybatis/SKILL.md +4 -4
  316. package/template/.cursor/skills/yss-openapi-draft-review/SKILL.md +6 -4
  317. package/template/.cursor/skills/yss-openapi-draft-review/references/review-output.md +2 -0
  318. package/template/.cursor/skills/yss-openapi-draft-review/references/semantic-review.md +3 -3
  319. package/template/.cursor/skills/yss-openapi-governance/SKILL.md +5 -7
  320. package/template/.cursor/skills/yss-openapi-governance/references/governance-output.md +2 -0
  321. package/template/.cursor/skills/yss-openapi-governance/references/governance-workflow.md +3 -3
  322. package/template/.cursor/skills/yss-product-lifecycle/SKILL.md +32 -26
  323. package/template/.cursor/skills/yss-product-lifecycle/references/artifact-dependencies.md +1 -1
  324. package/template/.cursor/skills/yss-product-lifecycle/references/matt-yss-adapter.md +28 -6
  325. package/template/.cursor/skills/yss-product-lifecycle/references/orchestration-contract.yaml +143 -4
  326. package/template/.cursor/skills/yss-product-lifecycle/references/orchestration.md +38 -13
  327. package/template/.cursor/skills/yss-product-lifecycle/references/plan-requirements.md +7 -6
  328. package/template/.cursor/skills/yss-product-lifecycle/references/state-model.md +3 -1
  329. package/template/.cursor/skills/yss-product-lifecycle/references/user-decisions.md +3 -3
  330. package/template/.cursor/skills/yss-prototype-stage/SKILL.md +1 -5
  331. package/template/.cursor/skills/yss-prototype-stage/scripts/verify-prototype-design.mjs +1 -0
  332. package/template/.cursor/skills/yss-repository/SKILL.md +2 -2
  333. package/template/.cursor/skills/yss-research/SKILL.md +39 -48
  334. package/template/.cursor/skills/yss-research/assets/competitive-evidence-template.yaml +146 -0
  335. package/template/.cursor/skills/yss-research/references/competitive-analysis.md +76 -0
  336. package/template/.cursor/skills/yss-research/references/competitive-analysis.schema.json +324 -0
  337. package/template/.cursor/skills/yss-research/references/evidence-contract.md +8 -0
  338. package/template/.cursor/skills/yss-research/scripts/lib/competitive-analysis.mjs +185 -0
  339. package/template/.cursor/skills/yss-research/scripts/render-competitive-outputs.mjs +16 -0
  340. package/template/.cursor/skills/yss-research/scripts/validate-research-package.mjs +6 -2
  341. package/template/.cursor/skills/yss-research/tests/competitive-scenarios.test.mjs +270 -0
  342. package/template/.cursor/skills/yss-resilience4j/SKILL.md +25 -31
  343. package/template/.cursor/skills/yss-security-algorithm/SKILL.md +37 -43
  344. package/template/.cursor/skills/yss-skill-source-index-refresh/SKILL.md +29 -36
  345. package/template/.cursor/skills/yss-skill-source-index-refresh/references/backend-component-platform-compatibility.md +1 -1
  346. package/template/.cursor/skills/yss-stage-decision/SKILL.md +2 -5
  347. package/template/.cursor/skills/yss-stage-decision/scripts/validate-domain-strategy.mjs +8 -5
  348. package/template/.cursor/skills/yss-stage-decision/scripts/validate-stage-decision-package.mjs +8 -5
  349. package/template/.cursor/skills/yss-stage-decision/tests/run-scenarios.mjs +83 -13
  350. package/template/.cursor/skills/yss-tactical-design/SKILL.md +1 -1
  351. package/template/.cursor/skills/yss-tactical-design/references/output-template.md +3 -3
  352. package/template/.cursor/skills/yss-tactical-design/references/tactical-design-contract.md +1 -1
  353. package/template/.cursor/skills/yss-technical-design/SKILL.md +6 -5
  354. package/template/.cursor/skills/yss-ui/SKILL.md +7 -1
  355. package/template/.cursor/skills/yss-ui/assets/docs/guide/gitlab-ci-integration.md +2 -2
  356. package/template/.cursor/skills/yss-ui/references/checklist.md +38 -96
  357. package/template/.cursor/skills/yss-ui/references/component-routing.md +3 -1
  358. package/template/.cursor/skills/yss-ui/references/quick-recipes.md +17 -272
  359. package/template/.cursor/skills/yss-ui/references/specialized-components.md +3 -3
  360. package/template/.cursor/skills/yss-ui-business-page-generation/SKILL.md +1 -1
  361. package/template/.cursor/skills/yss-up-springboot3/SKILL.md +19 -21
  362. package/template/.cursor/skills/yss-userinfo/SKILL.md +27 -33
  363. package/template/.cursor/skills/yss-validation/SKILL.md +26 -32
  364. package/template/.cursor/skills/yss-web-controller/SKILL.md +11 -44
  365. package/template/.cursor/skills/yss-web-controller/references/crud-generation.md +38 -0
  366. package/template/.cursor/skills/ytable-usage/SKILL.md +2 -2
  367. package/template/.cursor/skills/ytree-usage/SKILL.md +2 -80
  368. package/template/.cursor/skills/ytree-usage/references/tree-and-confirmation-example.md +81 -0
  369. package/template/.pi/skills/alibaba-java-code-style/SKILL.md +30 -36
  370. package/template/.pi/skills/archify/SKILL.md +2 -2
  371. package/template/.pi/skills/archify/scripts/yss-safe-deliver.mjs +10 -6
  372. package/template/.pi/skills/archify/test/yss-safe-deliver.test.mjs +9 -2
  373. package/template/.pi/skills/code-review/SKILL.md +19 -11
  374. package/template/.pi/skills/code-review/references/candidate-capture.md +1 -1
  375. package/template/.pi/skills/code-review/references/legacy-convergence.md +3 -1
  376. package/template/.pi/skills/code-review/references/review-axis-checklists.md +2 -0
  377. package/template/.pi/skills/code-review/references/yss-review-standards.md +4 -2
  378. package/template/.pi/skills/competitive-intelligence/SKILL.md +32 -74
  379. package/template/.pi/skills/file-export-download/SKILL.md +4 -73
  380. package/template/.pi/skills/file-export-download/references/binary-contract-example.md +26 -0
  381. package/template/.pi/skills/file-export-download/references/download-call-example.md +45 -0
  382. package/template/.pi/skills/formily-foundation/SKILL.md +6 -105
  383. package/template/.pi/skills/formily-foundation/references/async-save-example.md +57 -0
  384. package/template/.pi/skills/formily-foundation/references/query-layout.md +50 -0
  385. package/template/.pi/skills/formily-linkage-effects/SKILL.md +3 -116
  386. package/template/.pi/skills/formily-linkage-effects/references/linkage-example.md +116 -0
  387. package/template/.pi/skills/formily-mode-slot-detail/SKILL.md +3 -81
  388. package/template/.pi/skills/formily-mode-slot-detail/references/mode-slot-example.md +81 -0
  389. package/template/.pi/skills/formily-step-flow/SKILL.md +3 -143
  390. package/template/.pi/skills/formily-step-flow/references/step-flow-example.md +143 -0
  391. package/template/.pi/skills/handoff/SKILL.md +3 -1
  392. package/template/.pi/skills/i-have-adhd/SKILL.md +2 -2
  393. package/template/.pi/skills/i-have-adhd/references/yss-adaptation.md +2 -2
  394. package/template/.pi/skills/i-have-adhd/tests/verify-integration.mjs +7 -2
  395. package/template/.pi/skills/implement/SKILL.md +2 -2
  396. package/template/.pi/skills/llm-wiki/references/transactions.md +2 -2
  397. package/template/.pi/skills/llm-wiki/scripts/core.mjs +40 -2
  398. package/template/.pi/skills/llm-wiki/scripts/transaction.mjs +30 -27
  399. package/template/.pi/skills/llm-wiki/scripts/v2.test.mjs +38 -2
  400. package/template/.pi/skills/lombok/SKILL.md +2 -0
  401. package/template/.pi/skills/mapstruct/SKILL.md +2 -0
  402. package/template/.pi/skills/tdd/SKILL.md +2 -2
  403. package/template/.pi/skills/theme-token-usage/SKILL.md +6 -5
  404. package/template/.pi/skills/wayfinder/references/chart-map.md +2 -2
  405. package/template/.pi/skills/wayfinder/references/ticket-types.md +1 -1
  406. package/template/.pi/skills/yss-api-integration/SKILL.md +13 -50
  407. package/template/.pi/skills/yss-api-integration/references/orval-list-example.md +38 -0
  408. package/template/.pi/skills/yss-application/SKILL.md +11 -5
  409. package/template/.pi/skills/yss-audit-log/SKILL.md +8 -6
  410. package/template/.pi/skills/yss-audit-log/references/README.md +5 -5
  411. package/template/.pi/skills/yss-cache/SKILL.md +4 -4
  412. package/template/.pi/skills/yss-ddd-scaffold-generator/SKILL.md +7 -8
  413. package/template/.pi/skills/yss-ddd-scaffold-generator/references/USAGE_EXAMPLES.md +13 -6
  414. package/template/.pi/skills/yss-ddd-scaffold-generator/references/command-examples.md +2 -0
  415. package/template/.pi/skills/yss-ddd-scaffold-generator/scripts/scaffold-generator.test.mjs +28 -1
  416. package/template/.pi/skills/yss-design-system/SKILL.md +2 -2
  417. package/template/.pi/skills/yss-distributed-id/SKILL.md +4 -4
  418. package/template/.pi/skills/yss-dto/SKILL.md +9 -9
  419. package/template/.pi/skills/yss-dto/references/README.md +4 -4
  420. package/template/.pi/skills/yss-dto/references/wire-validation-checklist.md +4 -4
  421. package/template/.pi/skills/yss-excel-mvc/SKILL.md +4 -4
  422. package/template/.pi/skills/yss-exception/SKILL.md +42 -48
  423. package/template/.pi/skills/yss-formily-schema-generator/SKILL.md +26 -170
  424. package/template/.pi/skills/yss-formily-schema-generator/references/workflow.md +49 -193
  425. package/template/.pi/skills/yss-frontend-scaffold-generator/SKILL.md +14 -10
  426. package/template/.pi/skills/yss-implementation-contract-compiler/SKILL.md +4 -6
  427. package/template/.pi/skills/yss-implementation-contract-compiler/references/yss-skill-execution-result.md +15 -1
  428. package/template/.pi/skills/yss-layered-mvc-scaffold-generator/SKILL.md +1 -1
  429. package/template/.pi/skills/yss-mybatis/SKILL.md +4 -4
  430. package/template/.pi/skills/yss-openapi-draft-review/SKILL.md +6 -4
  431. package/template/.pi/skills/yss-openapi-draft-review/references/review-output.md +2 -0
  432. package/template/.pi/skills/yss-openapi-draft-review/references/semantic-review.md +3 -3
  433. package/template/.pi/skills/yss-openapi-governance/SKILL.md +5 -7
  434. package/template/.pi/skills/yss-openapi-governance/references/governance-output.md +2 -0
  435. package/template/.pi/skills/yss-openapi-governance/references/governance-workflow.md +3 -3
  436. package/template/.pi/skills/yss-product-lifecycle/SKILL.md +32 -26
  437. package/template/.pi/skills/yss-product-lifecycle/references/artifact-dependencies.md +1 -1
  438. package/template/.pi/skills/yss-product-lifecycle/references/matt-yss-adapter.md +28 -6
  439. package/template/.pi/skills/yss-product-lifecycle/references/orchestration-contract.yaml +143 -4
  440. package/template/.pi/skills/yss-product-lifecycle/references/orchestration.md +38 -13
  441. package/template/.pi/skills/yss-product-lifecycle/references/plan-requirements.md +7 -6
  442. package/template/.pi/skills/yss-product-lifecycle/references/state-model.md +3 -1
  443. package/template/.pi/skills/yss-product-lifecycle/references/user-decisions.md +3 -3
  444. package/template/.pi/skills/yss-prototype-stage/SKILL.md +1 -5
  445. package/template/.pi/skills/yss-prototype-stage/scripts/verify-prototype-design.mjs +1 -0
  446. package/template/.pi/skills/yss-repository/SKILL.md +2 -2
  447. package/template/.pi/skills/yss-research/SKILL.md +39 -48
  448. package/template/.pi/skills/yss-research/assets/competitive-evidence-template.yaml +146 -0
  449. package/template/.pi/skills/yss-research/references/competitive-analysis.md +76 -0
  450. package/template/.pi/skills/yss-research/references/competitive-analysis.schema.json +324 -0
  451. package/template/.pi/skills/yss-research/references/evidence-contract.md +8 -0
  452. package/template/.pi/skills/yss-research/scripts/lib/competitive-analysis.mjs +185 -0
  453. package/template/.pi/skills/yss-research/scripts/render-competitive-outputs.mjs +16 -0
  454. package/template/.pi/skills/yss-research/scripts/validate-research-package.mjs +6 -2
  455. package/template/.pi/skills/yss-research/tests/competitive-scenarios.test.mjs +270 -0
  456. package/template/.pi/skills/yss-resilience4j/SKILL.md +25 -31
  457. package/template/.pi/skills/yss-security-algorithm/SKILL.md +37 -43
  458. package/template/.pi/skills/yss-skill-source-index-refresh/SKILL.md +29 -36
  459. package/template/.pi/skills/yss-skill-source-index-refresh/references/backend-component-platform-compatibility.md +1 -1
  460. package/template/.pi/skills/yss-stage-decision/SKILL.md +2 -5
  461. package/template/.pi/skills/yss-stage-decision/scripts/validate-domain-strategy.mjs +8 -5
  462. package/template/.pi/skills/yss-stage-decision/scripts/validate-stage-decision-package.mjs +8 -5
  463. package/template/.pi/skills/yss-stage-decision/tests/run-scenarios.mjs +83 -13
  464. package/template/.pi/skills/yss-tactical-design/SKILL.md +1 -1
  465. package/template/.pi/skills/yss-tactical-design/references/output-template.md +3 -3
  466. package/template/.pi/skills/yss-tactical-design/references/tactical-design-contract.md +1 -1
  467. package/template/.pi/skills/yss-technical-design/SKILL.md +6 -5
  468. package/template/.pi/skills/yss-ui/SKILL.md +7 -1
  469. package/template/.pi/skills/yss-ui/assets/docs/guide/gitlab-ci-integration.md +2 -2
  470. package/template/.pi/skills/yss-ui/references/checklist.md +38 -96
  471. package/template/.pi/skills/yss-ui/references/component-routing.md +3 -1
  472. package/template/.pi/skills/yss-ui/references/quick-recipes.md +17 -272
  473. package/template/.pi/skills/yss-ui/references/specialized-components.md +3 -3
  474. package/template/.pi/skills/yss-ui-business-page-generation/SKILL.md +1 -1
  475. package/template/.pi/skills/yss-up-springboot3/SKILL.md +19 -21
  476. package/template/.pi/skills/yss-userinfo/SKILL.md +27 -33
  477. package/template/.pi/skills/yss-validation/SKILL.md +26 -32
  478. package/template/.pi/skills/yss-web-controller/SKILL.md +11 -44
  479. package/template/.pi/skills/yss-web-controller/references/crud-generation.md +38 -0
  480. package/template/.pi/skills/ytable-usage/SKILL.md +2 -2
  481. package/template/.pi/skills/ytree-usage/SKILL.md +2 -80
  482. package/template/.pi/skills/ytree-usage/references/tree-and-confirmation-example.md +81 -0
  483. package/template/.template-spec/agents/backend-architecture-profiles.md +1 -1
  484. package/template/.template-spec/agents/digital-human-roles.md +5 -1
  485. package/template/.template-spec/agents/digital-human-roles.yaml +49 -1
  486. package/template/.template-spec/engineering/backend-platforms.json +1 -1
  487. package/template/.template-spec/plan/entry-review.md +2 -1
  488. package/template/.template-spec/plan/templates/competitive-analysis-template.md +38 -36
  489. package/template/.template-spec/plan/templates/competitive-matrix-template.md +37 -17
  490. package/template/.template-spec/plan/templates/plan-template.md +11 -5
  491. package/template/.template-spec/process/document-writing.md +22 -3
  492. package/template/.template-spec/process/harness-process-tailoring.md +5 -1
  493. package/template/.template-spec/process/implementation-repo-integration.md +26 -8
  494. package/template/.template-spec/process/research-completion.md +2 -0
  495. package/template/.template-spec/process/runtime-storage.md +78 -0
  496. package/template/.template-spec/process/schemas/approval-context.schema.json +67 -0
  497. package/template/.template-spec/process/schemas/approval-record.schema.json +179 -16
  498. package/template/.template-spec/process/schemas/backend-delivery.schema.json +16 -0
  499. package/template/.template-spec/process/schemas/delivery-preflight-input.schema.json +4 -0
  500. package/template/.template-spec/process/schemas/digital-human-task-package.schema.json +236 -1
  501. package/template/.template-spec/process/schemas/implementation-repository-preparation-result.schema.json +335 -52
  502. package/template/.template-spec/process/schemas/lifecycle-checkpoint.schema.json +11 -0
  503. package/template/.template-spec/process/schemas/project-scaffold-contract.schema.json +3 -0
  504. package/template/.template-spec/process/schemas/review-bundle.schema.json +347 -35
  505. package/template/.template-spec/process/schemas/strategic-design-handoff-v3.schema.json +504 -0
  506. package/template/.template-spec/process/schemas/strategic-design-handoff-v4.schema.json +544 -8
  507. package/template/.template-spec/process/schemas/strategic-design-handoff-v5.schema.json +616 -0
  508. package/template/.template-spec/process/schemas/strategic-design-handoff.schema.json +616 -0
  509. package/template/.template-spec/process/schemas/strategic-handoff-domain-strategy-v3.schema.json +712 -109
  510. package/template/.template-spec/process/schemas/strategic-handoff-domain-strategy.schema.json +595 -90
  511. package/template/.template-spec/process/schemas/strategic-handoff-export-v2.schema.json +448 -0
  512. package/template/.template-spec/process/schemas/strategic-handoff-export.schema.json +392 -0
  513. package/template/.template-spec/process/schemas/strategic-handoff-stage-decision-package-v3.schema.json +556 -83
  514. package/template/.template-spec/process/schemas/strategic-handoff-stage-decision-package.schema.json +418 -57
  515. package/template/.template-spec/process/script-execution.md +37 -0
  516. package/template/.template-spec/process/subagent-collaboration.md +7 -1
  517. package/template/.template-spec/templates/approval-record-template.json +7 -3
  518. package/template/.template-spec/templates/approval-record-template.yaml +8 -2
  519. package/template/.template-spec/templates/examples/lifecycle-writing-examples.md +92 -2
  520. package/template/.template-spec/templates/retro-report-template.md +10 -3
  521. package/template/.template-spec/templates/review-bundle-template.yaml +19 -10
  522. package/template/.template-spec/user-guide//347/224/250/346/210/267/346/211/213/345/206/214.md +2 -0
  523. package/template/AGENTS.md +4 -3
  524. package/template/CONTEXT.md +2 -2
  525. package/template/README.md +2 -2
  526. package/template/scripts/advance-maintenance-iteration +51 -0
  527. package/template/scripts/lib/approval-checkpoint-discovery.mjs +26 -0
  528. package/template/scripts/lib/approval-consumption.mjs +35 -0
  529. package/template/scripts/lib/approval-current.mjs +111 -0
  530. package/template/scripts/lib/approval-record-io.mjs +56 -0
  531. package/template/scripts/lib/approval-record.mjs +79 -184
  532. package/template/scripts/lib/approved-execution-context.mjs +8 -6
  533. package/template/scripts/lib/asset-transactions.mjs +5 -1
  534. package/template/scripts/lib/backend-delivery.mjs +1 -1
  535. package/template/scripts/lib/backend-review.mjs +2 -1
  536. package/template/scripts/lib/backend-scaffold-prerequisites.mjs +3 -2
  537. package/template/scripts/lib/business-ticket-lifecycle.mjs +2 -1
  538. package/template/scripts/lib/checkpoint-commit.mjs +50 -0
  539. package/template/scripts/lib/command-runner.mjs +44 -9
  540. package/template/scripts/lib/content-identity.mjs +273 -0
  541. package/template/scripts/lib/delivery-preflight.mjs +2 -1
  542. package/template/scripts/lib/digital-human-roles.mjs +12 -5
  543. package/template/scripts/lib/drift-report.mjs +110 -0
  544. package/template/scripts/lib/existing-backend-architecture.mjs +4 -1
  545. package/template/scripts/lib/lifecycle-context-query.mjs +172 -11
  546. package/template/scripts/lib/lifecycle-controls.mjs +9 -19
  547. package/template/scripts/lib/lifecycle-presentation.mjs +5 -0
  548. package/template/scripts/lib/lifecycle-status.mjs +63 -12
  549. package/template/scripts/lib/lifecycle-transition.mjs +2 -1
  550. package/template/scripts/lib/maintenance-candidate.mjs +24 -30
  551. package/template/scripts/lib/maintenance-research.mjs +52 -8
  552. package/template/scripts/lib/maintenance-storage.mjs +81 -0
  553. package/template/scripts/lib/plan-spec-entry.mjs +2 -1
  554. package/template/scripts/lib/project-governance.mjs +2 -1
  555. package/template/scripts/lib/read-only-intake.mjs +44 -9
  556. package/template/scripts/lib/review-capabilities.mjs +234 -0
  557. package/template/scripts/lib/review-package.mjs +100 -0
  558. package/template/scripts/lib/runtime-store.mjs +650 -0
  559. package/template/scripts/lib/skill-registry.mjs +4 -4
  560. package/template/scripts/lib/strategic-handoff.mjs +22 -9
  561. package/template/scripts/lib/task-package.mjs +47 -16
  562. package/template/scripts/lifecycle-status +26 -1
  563. package/template/scripts/maintenance-path +11 -0
  564. package/template/scripts/prepare-review-package +8 -0
  565. package/template/scripts/project-ci +13 -3
  566. package/template/scripts/query-lifecycle-context +8 -1
  567. package/template/scripts/run-read-only-intake +2 -2
  568. package/template/scripts/runtime-store +40 -0
  569. package/template/scripts/verify-approval-record +21 -13
  570. package/template/scripts/verify-lifecycle-checkpoint +7 -3
  571. package/template/scripts/verify-project-instance +21 -1
  572. package/template/skills-lock.json +64 -63
  573. package/template.snapshot.json +4 -4
  574. package/vendor/cli-core/cli.mjs +2 -0
  575. package/vendor/cli-core/command-runner.mjs +44 -9
  576. package/vendor/cli-core/package.json +1 -1
  577. package/vendor/cli-core/runtime-store.mjs +650 -0
  578. package/vendor/cli-core/scaffold.mjs +4 -2
@@ -1,8 +1,8 @@
1
- # Plan、Spec、Ticket 写作对照
1
+ # Plan、Spec、Ticket、PR / MR 与复盘写作对照
2
2
 
3
3
  性质:虚构的写作示例,非产品资产,不代表业务术语或批准记录。
4
4
 
5
- 本文件配合[中文写作规范](../../process/document-writing.md)。每组先给固定输入,再给两种表达,最后逐项核对。三组独立提供事实,不表示真实项目已经从 Plan 进入 Spec 或取得任何批准。“原写法”由作者构造,不是对模型运行结果或真实文档的抽样。
5
+ 本文件配合[中文写作规范](../../process/document-writing.md)。每组先给固定输入,再给两种表达,最后逐项核对。各组独立提供事实,不表示真实项目已经从 Plan 进入 Spec、执行验证或取得任何批准。“原写法”由作者构造,不是对模型运行结果或真实文档的抽样。
6
6
 
7
7
  ## 1. Plan:让业务问题和取舍可见
8
8
 
@@ -152,3 +152,93 @@
152
152
  | 预登记发现与样本类别 | [样本清单](plan-spec/expectations.json) |
153
153
 
154
154
  附件案例的变化练习:若将 FR-002 的“一次列出全部缺失名称”改成“仅显示一项”,应同时审查 S3 和 AC-001。`diff` 能展示原文字节、FR 和 AC 引用的变化,但不能决定业务含义等价,也不能据此继续使用原批准。读取附件清单失败的行为仍为 Q-001,不能由成功路径的测试例子擅自确定。
155
+
156
+ ## 5. PR / MR:说明最终行为和实际验证范围
157
+
158
+ ### 固定输入
159
+
160
+ 以下命令、退出码、版本和回滚记录均为虚构材料,用于写作练习,不是本仓执行结果。
161
+
162
+ | 示例编号 | 已提供信息 |
163
+ |---|---|
164
+ | M1 | 表单缺少两个必填附件时,当前页面只显示第一个名称;候选改动展示全部缺失名称 |
165
+ | M2 | 最终改动只涉及缺失附件列表的展示和组件测试;依据为示例 Spec v2 / R1、Ticket EX-17 与当前 Slice Implementation Contract v1,不改变提交接口 |
166
+ | M3 | 在示例工程根目录运行 `pnpm test -- attachment-validation`,退出码 0;证据 `example-evidence/component-test.txt` 覆盖两个名称展示和页面输入保留 |
167
+ | M4 | 在同一目录运行 `pnpm typecheck`,退出码 2;证据 `example-evidence/typecheck.txt` 含 TS2322,原因尚未确认 |
168
+ | M5 | `pnpm test:e2e` 未执行,示例环境缺少所需浏览器;实际提交、拒绝和补齐后再次提交的浏览器流程仍未覆盖 |
169
+ | M6 | 变更没有数据迁移;已有恢复记录可将该展示改动恢复到示例候选 `example-before`,但恢复未执行验证。当前仅授权起草描述,没有 Git 写入或远程操作授权 |
170
+
171
+ ### 原写法:将局部通过扩大为完成
172
+
173
+ 本次全面优化附件校验体验,所有测试已通过,可直接合并并发布。后续将创建 PR,必要时回滚即可。
174
+
175
+ ### 改写:四部分保留验证失败和边界
176
+
177
+ 申请人同时缺少两个必填附件时,当前页面只显示第一个名称。候选改动展示全部缺失名称;组件测试已覆盖两个名称展示和页面输入保留。
178
+
179
+ 最终范围是缺失附件列表展示及组件测试,依据为示例 Spec v2 / R1、Ticket EX-17 和当前 Slice Implementation Contract v1,提交接口保持既有行为。
180
+
181
+ 在示例工程根目录执行 `pnpm test -- attachment-validation`,退出码 0,结果见 `example-evidence/component-test.txt`。同目录的 `pnpm typecheck` 退出码 2,日志含 TS2322,原因尚未确认,见 `example-evidence/typecheck.txt`。环境缺少所需浏览器,`pnpm test:e2e` 未执行;实际提交、拒绝和补齐后再次提交的浏览器流程仍待验证。
182
+
183
+ 当前保留类型检查失败和浏览器流程未覆盖两项限制,不能据此声明可合并或可发布。变更没有数据迁移;可按已有恢复记录恢复到 `example-before`,恢复步骤尚未执行验证。本次交付仅为描述草稿,Git 写入和远程创建 PR / MR 仍需原任务范围内的授权。
184
+
185
+ ### 保真核对
186
+
187
+ | 输入 | 改写落点 | 保留语义 |
188
+ |---|---|---|
189
+ | M1 | 首段 | Before 与候选 After 对应具体触发条件 |
190
+ | M2 | 第二段 | 只描述最终范围,合同引用不扩展成合并批准 |
191
+ | M3 | 首段、第三段 | 局部通过只支持其实际覆盖的行为 |
192
+ | M4 | 第三、四段 | 保留失败退出码和未知原因 |
193
+ | M5 | 第三、四段 | 未执行与未覆盖均保留,不并入通过项 |
194
+ | M6 | 第四段 | 保留恢复未验证、数据影响和起草授权边界 |
195
+
196
+ ## 6. 复盘:把失误机制连接到改进与关闭证据
197
+
198
+ ### 固定输入
199
+
200
+ 以下检查、行动编号和证据路径均为虚构材料;它们只演示如何引用既有行动,不建立真实待办或生命周期状态。
201
+
202
+ | 示例编号 | 已提供信息 |
203
+ |---|---|
204
+ | F1 | 日志脱敏检查已经存在,但本次验证入口没有调用它;执行记录中没有该检查,漏检机制已确认 |
205
+ | F2 | 既有行动 EX-A1 的权威记录已登记修复和关闭证据:验证入口已接入检查,原未脱敏反例退出码 1,修正样本退出码 0,入口日志证明实际执行;证据为 `example-evidence/log-check-before.txt`、`log-check-after.txt`、`entry-run.txt` |
206
+ | F3 | 普通 Markdown 文档引用目标缺失在两次候选中重复出现;已检查的现有校验未覆盖该类引用。既有行动 EX-A2 仅登记增加最小目标存在性检查和失败反例的计划,尚未修改或执行 |
207
+ | F4 | 一份用户反馈摘要可能混淆事实和推断,机制与适用范围尚未确认。当前没有可靠机械判定方法;建议人工对照原始反馈逐项核对来源、确定程度和范围,并记录结果,行动尚未分派 |
208
+
209
+ ### 原写法:将建议和文件存在当作闭合
210
+
211
+ 检查体系已完善,相关问题全部闭环。以后所有反馈摘要都禁止使用推断,并增加全量文档扫描以避免遗漏。
212
+
213
+ ### 改写:沿用复盘模板的四个章节
214
+
215
+ #### 做得好的地方
216
+
217
+ 既有日志脱敏检查能检测原未脱敏反例,修正样本可以通过;本次修复后,入口日志也证明检查实际执行。结果引用 EX-A1 的权威行动记录及三份验证证据,收益仅限于这项已验证的接入修复。
218
+
219
+ #### 需要改进的地方
220
+
221
+ 日志脱敏检查原先没有接入本次验证入口,有检查文件未能阻止漏执行。该机制已由执行记录确认。
222
+
223
+ 普通 Markdown 引用目标缺失已在两次候选中重复出现,现有校验未覆盖这一可机械判定的不变量。反馈摘要混淆事实和推断目前只是待验证假设,尚不能据单份材料确定通用机制。
224
+
225
+ #### 改进动作
226
+
227
+ EX-A1 的修复、实际执行与关闭证据继续引用其权威行动记录,本报告不另维护状态。EX-A2 已登记最小目标存在性检查及失败反例的计划;尚未修改或执行,保持待处理。反馈摘要的人工核对行动尚未分派,写“未登记”,不自行指定负责人或关闭时点。
228
+
229
+ #### 沉淀去向
230
+
231
+ EX-A1 已修订既有验证入口;原反例退出码 1、修正样本退出码 0,以及入口实际执行证据共同支持接入修复的关闭条件。
232
+
233
+ EX-A2 拟在既有校验场景中增加只覆盖目标引用类型的最小检查。需要保留缺失目标时失败的反例和修订后的实际执行结果;当前只有计划,不能关闭。
234
+
235
+ 反馈摘要先按建议的人工方法对照原始反馈,逐项记录出处、确定程度和范围,将结果留在关联行动中。机制未确认前不修订通用 Skill 禁令,也不把单次现象扩大为所有反馈的限制。
236
+
237
+ ### 保真核对
238
+
239
+ | 输入 | 改写落点 | 保留语义 |
240
+ |---|---|---|
241
+ | F1 | 需要改进、沉淀去向 | 区分检查存在与接入、执行;优先修复已有检查的接线 |
242
+ | F2 | 做得好的地方、改进动作、沉淀去向 | 关闭引用实际修订、失败反例和执行证据,不另建行动状态 |
243
+ | F3 | 需要改进、改进动作、沉淀去向 | 重复且可机械判定的问题落到最小检查;计划未被写成完成 |
244
+ | F4 | 需要改进、改进动作、沉淀去向 | 假设、人工方法和未分派均保留;单次问题不成为通用禁令 |
@@ -13,12 +13,19 @@ owner: ai
13
13
 
14
14
  ## 需要改进的地方
15
15
 
16
- 记录触发条件、实际影响与证据,区分已确认机制和待验证假设;说明返工或漏检为何未被既有检查发现。
16
+ 记录触发条件、实际影响与证据,区分事实、已确认机制和待验证假设;说明返工或漏检为何未被既有检查发现。检查是否存在、是否接入本次执行路径、是否实际执行分别说明,不把“有检查”写成“本次已检查”。
17
17
 
18
18
  ## 改进动作
19
19
 
20
- 引用既有待办 / 工作项;在其权威记录中登记负责人、解决时点、验证方法、关闭条件与关闭证据。本节说明动作如何解决上述问题,不另外维护一套进度;未分派写未登记。
20
+ 引用既有待办 / 工作项;在其权威记录中登记负责人、解决时点、验证方法、关闭条件与关闭证据。本节说明动作如何解决上述问题,不另外维护一套进度;未分派写未登记。只有计划、建议或尚未执行的验证时保持待处理,不能关闭行动。
21
21
 
22
22
  ## 沉淀去向
23
23
 
24
- 列出需修订的事实源、Skill / 模板 / 校验场景及关联行动。关闭时引用实际修订和验证结果,只有建议或计划时保持待处理。
24
+ 列出需修订的事实源、Skill / 模板 / 校验场景及关联行动,说明每项采取以下哪种处置及理由:
25
+
26
+ - 既有检查未接线或漏执行:优先修复接入与执行路径,引用修订位置及本次实际执行证据。
27
+ - 重复出现、可机械判定的不变量缺少检查:确认既有检查未覆盖后,增加最小检查,以失败反例证明能检测目标情形,并记录修订后的实际验证结果。
28
+ - 无法机械判定:说明人工验证的方法、判断依据和结果记录位置,按关联行动的关闭条件留证。
29
+ - 机制或适用范围尚未确认:登记待验证假设与验证方法,不把单次现象直接写成通用禁令。
30
+
31
+ 关闭时引用实际修订与验证结果;检查已存在、方法已提出或文档已起草本身不构成关闭证据。事实源、Skill、模板和检查只在各自权威位置修订,本节引用其去向。
@@ -1,4 +1,4 @@
1
- schema_version: 1
1
+ schema_version: 2
2
2
  kind: review-bundle
3
3
  bundle_id: review-bundle.plan
4
4
  task_id: replace-with-plan-review-task-id
@@ -7,20 +7,29 @@ review_session_id: replace-with-stable-review-session-id
7
7
  role_id: role.product-manager
8
8
  runtime_id: runtime.generic
9
9
  principal_ref: replace-with-reviewer-instance
10
+ review_task_ref: docs/.scratch/<feature>/reviews/task.json
11
+ review_task_digest: replace-with-current-task-64-char-sha256
12
+ capability_ids: [capability.business-rules]
13
+ basis:
14
+ - ref: replace-with-current-review-evidence
15
+ digest: replace-with-current-evidence-64-char-sha256
10
16
  reviews:
11
- - schema_version: 1
17
+ - schema_version: 2
12
18
  gate_id: check.domain-strategy-approved
13
- decision: approved
19
+ decision: pending
14
20
  actor_kind: digital-human
15
21
  role_id: role.product-manager
16
22
  runtime_id: runtime.generic
17
23
  principal_ref: replace-with-reviewer-instance
18
- drafter_role_id: role.requirements-manager
19
24
  drafter_principal_ref: replace-with-drafter-instance
20
25
  subject_ref: docs/.scratch/<feature>/domain/domain-strategy-v1.yaml
21
- subject_digest: replace-with-64-char-sha256
22
- approval_scope:
23
- - replace-with-feature-id
24
- evidence_refs:
25
- - replace-with-current-review-evidence
26
- notes: 本模板只用于起草。只保留实际命中的 check;同一 bundle 的所有结论必须来自同一复核任务、会话和实例。
26
+ subject_digest: replace-with-current-subject-64-char-sha256
27
+ approval_scope: [replace-with-feature-id]
28
+ basis:
29
+ - ref: replace-with-current-review-evidence
30
+ digest: replace-with-current-evidence-64-char-sha256
31
+ evidence_refs: [replace-with-current-review-evidence]
32
+ review_task_ref: docs/.scratch/<feature>/reviews/task.json
33
+ review_task_digest: replace-with-current-task-64-char-sha256
34
+ capability_ids: [capability.business-rules]
35
+ notes: 由 prepare-review-package 按当前 checkpoint 起草 task、摘要、差异和覆盖。所有逐项结论必须由同一独立任务、会话和实例实际审查;pending 草案不授予批准。
@@ -19,6 +19,8 @@
19
19
 
20
20
  先运行所用包的 `--version` 和 `--help`;源码候选版本、npm 已发布版本和实例记录的模板快照是三个不同事实。
21
21
 
22
+ 执行过程中出现 JS/MJS 或 Python 时,按[脚本执行与依赖说明](../process/script-execution.md)核对其用途、已安装入口和解释器依赖;重复的机械操作应复用已有工具。
23
+
22
24
  | 能力 | `create-yss-spec` | 战略、后端、前端专职 CLI |
23
25
  |---|---|---|
24
26
  | init | 默认命令;写入新目录 | `init`;只接受不存在或空目录 |
@@ -74,9 +74,10 @@
74
74
 
75
75
  - 实现者不做独立审查,Reviewer 不写实现;代码审查统一用 `code-review`。mandatory 不豁免;`violation` 修复后重审,`drift` / `new_impacts` 使合同 `stale` 并回编译器。
76
76
  - “完成 / 可合并 / 可发布”仅基于 Fresh Verification;历史结果、自述无效。
77
- - 会签按角色表 `gate_policy` 并经 `scripts/verify-approval-record --require-approved` 核验;`user_decision_policy` 命中的关键决定必须先展示可审阅资产,再取得提问者或其明确指定负责人的真实回复。无回复保持等待,数字人不能代答;原始来源、范围、复用和失效见生命周期 `references/user-decisions.md`。发布、商务承诺、运行时外部副作用仍须生物人。
78
- - 普通功能默认一个推进负责人和一个独立审查者;候选角色列表不要求逐角色签字。相邻检查可组合审查、逐项留结论。已有范围授权按用户决定协议验证延续,实质变化或未知影响才重新决定;外部强制审批不得裁掉,缺陷和缺证据仍阻断,非阻断建议进入待办。
79
- - 会签暂停、handoff、实现、合并、发布边界同步范围、证据、风险、会签点、Ticket 状态和下一步。Git checkpoint 只含本轮范围;提交 / 推送须用户授权。
77
+ - 会签按角色表 `gate_policy` 并经 `scripts/verify-approval-record --require-approved --checkpoint <current checkpoint>` 核验;当前期望上下文由消费者的 checkpoint / 任务提供,不从会签记录反向填充。`user_decision_policy` 命中的关键决定必须先展示可审阅资产,再取得提问者或其明确指定负责人的真实回复。无回复保持等待,数字人不能代答;原始来源、范围、复用和失效见生命周期 `references/user-decisions.md`。发布、商务承诺、运行时外部副作用仍须生物人。
78
+ - 普通功能默认一个推进负责人和一个独立审查者;候选角色列表不要求逐角色签字。相邻检查可组合审查、逐项留结论。已有范围授权按用户决定协议验证延续,未知影响先调查,确认实质决定变化后才重新决定;外部强制审批不得裁掉,缺陷和缺证据仍阻断,非阻断建议进入待办。
79
+ - 首轮覆盖全部适用审查项;修复后按差异、受影响结论 / 行为及依赖定向复审,并重新绑定当前候选。摘要变化、UI 影响或 `new_impacts` 不触发默认全轴复审;未知影响先调查。能力与补充只读技能从角色表编译,禁止用职称代替能力或独立身份。专业审查等待由主控自主派发并等待,验证失败修复或路由;仅缺真实决定或新授权时展示资产后询问,独立工作继续。
80
+ - 会签暂停、handoff、实现、合并、发布边界同步范围、证据、风险、会签点、Ticket 状态和下一步。Git checkpoint 只含本轮范围;提交 / 推送须用户授权。仅 `template-source` 的 `scripts/advance-maintenance-iteration` 入口可在**本地 `refs/checkpoints/<run-id>` 引用**上自动创建 checkpoint 提交(不推送、不改分支、不建 tag);`project-instance` 不适用;写入 main、推送远端、打 tag、发布仍须用户授权。
80
81
  - 发布或阶段完成时判断复盘;架构 / 验证返工、IMPORTANT / CRITICAL finding、人工确认延期时,落中文复盘并修订事实源。
81
82
 
82
83
  ## 11. Subagent 协同
@@ -106,8 +106,8 @@ context_schema_version: 1
106
106
  | 跨仓库契约变更 | 需要两个或多个独立仓库协同实现、验证和按顺序发布的共享契约变化。 | — | 任一参与仓库未完成契约对齐和集成验证时,不得单独声称整体可发布。 |
107
107
  | 模板源仓库(`template-source`) | 承载 `yss-spec-project-template` 权威模板资产及其演进规则的仓库身份。 | — | 只管理可复用模板,不承载某个具体产品的研发生命周期资产。 |
108
108
  | 模板实例仓库(`project-instance`) | 由模板初始化后生成、承载某个具体产品研发生命周期资产的仓库身份。 | — | 不作为通用流程模板的权威来源。 |
109
- | 模板实例分发面 | 模板源中应随 CLI 快照进入 `project-instance` 的共享生命周期、模板、用户指南和验证资产集合。 | — | 不包含模板源审查、研究、发布路线、源仓库专属 ADR 或源仓库 LLM Wiki 编译树。 |
110
- | 模板源治理区 | 仅供 `template-source` 使用、保存审查证据、研究记录、跨仓契约、发布路线、源仓库治理决策和源仓库 LLM Wiki 编译树的归档区域。 | — | 不随 CLI 分发;不等于产品实例的研发管理资产。`wiki-root` 为 `.template-source/wiki`。 |
109
+ | 模板实例分发面 | 模板源中应随 CLI 快照进入 `project-instance` 的共享生命周期、模板、用户指南和验证资产集合。 | — | 不包含模板源维护记录、源仓库专属治理资产或源仓库 LLM Wiki 编译树。 |
110
+ | 模板源治理区 | 仅供 `template-source` 使用、保存现行跨仓契约、治理配置、维护工具和 LLM Wiki 阅读树的区域;维护日志、审查候选与历史证据保存在仓外运行目录。 | — | 不随 CLI 分发;不等于产品实例的研发管理资产。`wiki-root` 为 `.template-source/wiki`。 |
111
111
  | 仓库身份清单 | 显式声明仓库身份和清单结构版本的机器可读资产。 | — | 不承载项目名称、团队规模、Tracker 或其他易变业务配置。 |
112
112
  | 聚合门禁 | 汇总适用自动检查和独立专业审查后,对当前资产与范围作一次批准或验收;权威定义见生命周期注册表。 | — | 内部检查失败仍阻断;有效批准只在相关依据、范围或授权变化时失效。 |
113
113
  | 授权延续 | 原始用户批准明确覆盖当前边界、资产范围和决定依据时,经独立审查与当前验证继续推进。 | — | 不产生新的用户回复;未知或实质变化、撤回和外部强制审批缺失不能延续。证据格式见用户决定协议。 |
@@ -15,7 +15,7 @@
15
15
  ├── CONTEXT.md ← 唯一业务词汇表
16
16
  ├── yss-project.yaml ← 仓库身份
17
17
  ├── .template-spec/ ← 可复用流程、门禁、契约与文档模板
18
- ├── .template-source/ ← 模板维护、分发工具和历史证据(不进入实例)
18
+ ├── .template-source/ ← 现行模板维护资产与分发工具(不进入实例;运行历史存仓外)
19
19
  ├── docs/ ← 项目实例按需创建的 Plan、Spec、设计、Ticket 与交付证据
20
20
  └── scripts/ ← 合同与流程验证工具
21
21
  ```
@@ -72,7 +72,7 @@ main@6acc160e4e0cd062dbbbd7a1b26ae92855edf07e
72
72
  scripts/verify-template-fast
73
73
  ```
74
74
 
75
- 快速入口按 Git 影响面执行相关检查,未映射路径或核心校验资产变化时 fail-safe 升级。它与 candidate / 发布 profile 共同检查:
75
+ 快速入口按 Git 影响面执行相关检查,未映射路径或核心校验资产变化时 fail-safe 升级为完整验证,来源仍为当前工作树,用于 `implementation-ready`。显式 candidate / 发布入口要求已提交来源。三个入口共同检查:
76
76
 
77
77
  - `yss-project.yaml`、权威流程资产和模板是否完整。
78
78
  - 共享技能投影及 `skills-lock.json` 的完整树哈希是否一致。
@@ -0,0 +1,51 @@
1
+ #!/usr/bin/env node
2
+ import { spawnSync } from "node:child_process";
3
+ import { parseArgs } from "node:util";
4
+ import { ROOT } from "./lib/template-verification.mjs";
5
+ import { captureMaintenanceCandidate } from "./lib/maintenance-candidate.mjs";
6
+ import { commitCheckpoint, validateCheckpointRunId } from "./lib/checkpoint-commit.mjs";
7
+
8
+ // One lean maintenance iteration: validate the run identity, capture the
9
+ // candidate, publish a local checkpoint commit, run the mechanical gate, and
10
+ // report machine-readable results. It never pushes, never moves a branch, and
11
+ // never writes main. Approval stays human.
12
+ const PROFILES = new Set(["fast", "candidate"]);
13
+ try {
14
+ const { values } = parseArgs({ options: {
15
+ "run-id": { type: "string" },
16
+ base: { type: "string", default: "HEAD" },
17
+ output: { type: "string" },
18
+ plan: { type: "boolean", default: false },
19
+ json: { type: "boolean", default: false },
20
+ "skip-verify": { type: "boolean", default: false },
21
+ profile: { type: "string", default: "fast" },
22
+ }, strict: true });
23
+ if (!values["run-id"] || !values.output) throw new TypeError("用法: scripts/advance-maintenance-iteration --run-id <id> --output maintenance:candidates/<id> [--plan] [--json] [--profile fast|candidate]");
24
+ if (!PROFILES.has(values.profile)) throw new TypeError("--profile 必须是 fast 或 candidate: " + values.profile);
25
+ const runId = values["run-id"];
26
+ // Fail fast: an invalid or already-taken run id must not leave a candidate
27
+ // directory behind that blocks the retry.
28
+ validateCheckpointRunId(ROOT, runId);
29
+ const capture = values.plan ? { candidate_digest: null, manifest_ref: null, files: [] } : captureMaintenanceCandidate({ root: ROOT, outputDir: values.output, baseRef: values.base });
30
+ const checkpoint = commitCheckpoint({
31
+ root: ROOT,
32
+ runId,
33
+ baseRef: values.base,
34
+ dryRun: values.plan,
35
+ message: "checkpoint " + runId + "\n\nCandidate-Digest: " + (capture.candidate_digest || "plan") + "\nRun-Id: " + runId + "\n",
36
+ });
37
+ let verification = { profile: values.profile, exit_code: null, skipped: true };
38
+ if (!values.plan && !values["skip-verify"]) {
39
+ const command = values.profile === "candidate" ? ["scripts/verify-template-candidate", "--base", values.base] : ["scripts/verify-template-fast"];
40
+ const result = spawnSync(command[0], command.slice(1), { cwd: ROOT, encoding: "utf8", stdio: "inherit" });
41
+ if (result.error) throw new TypeError("机械验证无法执行: " + result.error.message);
42
+ verification = { profile: values.profile, exit_code: result.status, skipped: false, command: command.join(" ") };
43
+ }
44
+ const result = { run_id: runId, candidate_digest: capture.candidate_digest, manifest_ref: capture.manifest_ref, checkpoint, verification, review_required: true, approval: "human" };
45
+ if (values.json) process.stdout.write(JSON.stringify(result, null, 2) + "\n");
46
+ else process.stdout.write("迭代 " + runId + ":" + (checkpoint.commit ? "checkpoint " + checkpoint.ref + " @ " + checkpoint.commit.slice(0, 12) : "计划模式") + ";机械验证=" + (verification.skipped ? "skipped" : verification.exit_code) + ";审查与批准仍由人确认\n");
47
+ if (!verification.skipped && verification.exit_code !== 0) process.exitCode = 1;
48
+ } catch (error) {
49
+ process.stderr.write("迭代增强失败: " + error.message + "\n");
50
+ process.exitCode = 1;
51
+ }
@@ -0,0 +1,26 @@
1
+ import fs from 'node:fs';
2
+ import path from 'node:path';
3
+ import {approvalIO, approvalError} from './approval-record-io.mjs';
4
+
5
+ /** Finds a declared owner; ambiguity is an error, never a guessed approval context. */
6
+ export function findApprovalCheckpoint(root, approvalRef) {
7
+ const selected = path.resolve(root, approvalRef), matches = [];
8
+ const visit = ref => {
9
+ const full = path.resolve(root, ref);
10
+ if (!fs.existsSync(full)) return;
11
+ const stat = fs.lstatSync(full);
12
+ if (stat.isSymbolicLink()) return;
13
+ if (stat.isDirectory()) { for (const name of fs.readdirSync(full).sort()) visit(`${ref}/${name}`); return; }
14
+ if (!/\.(?:json|ya?ml)$/.test(ref)) return;
15
+ let value;
16
+ try { value = approvalIO({root}).document(ref); } catch { return; }
17
+ if (!value || value.gate_id || !value.gates) return;
18
+ const rows = [...Object.values(value.gates), ...Object.values(value.checks || {})];
19
+ if (rows.some(row => row?.approval_ref && path.resolve(root,row.approval_ref) === selected)) matches.push(ref);
20
+ };
21
+ for (const name of fs.readdirSync(root).sort()) {
22
+ if (name === 'docs' || name === '.yss' || /\.(?:json|ya?ml)$/.test(name)) visit(name);
23
+ }
24
+ if (matches.length !== 1) approvalError('APPROVAL_CONTEXT_REQUIRED', `批准记录需要唯一当前 checkpoint(找到 ${matches.length} 个);请显式提供上下文`);
25
+ return matches[0];
26
+ }
@@ -0,0 +1,35 @@
1
+ import {createHash} from 'node:crypto';
2
+ import {approvalIO, approvalError} from './approval-record-io.mjs';
3
+ import {approvalExpectationFromSubject, approvalExpectationFromState} from './approval-current.mjs';
4
+
5
+ const hex = value => value?.replace(/^sha256:/, '');
6
+ const hash = bytes => createHash('sha256').update(bytes).digest('hex');
7
+
8
+ /** The consumer's current binding chooses the review subject, never the approval record. */
9
+ export function approvalExpectationForBoundAsset(boundary, binding, context = {}) {
10
+ const io = approvalIO(context);
11
+ const assetRef = typeof binding === 'string' ? binding : binding?.ref;
12
+ if (!assetRef) approvalError('APPROVAL_CONTEXT_REQUIRED', '消费方缺少当前资产引用');
13
+ const bytes = io.bytes(assetRef);
14
+ if (typeof binding === 'object' && binding.digest && hex(binding.digest) !== hash(bytes)) approvalError('APPROVAL_CURRENT_INVALID', '消费方当前资产摘要过期');
15
+ let asset;
16
+ try { asset = io.document(assetRef); } catch { asset = null; }
17
+ const current = binding?.approval_context || asset?.approval_context;
18
+ if (!current && !asset) approvalError('APPROVAL_CONTEXT_REQUIRED', '原始资产缺少消费方独立批准上下文');
19
+ // A current structured review package can be consumed directly. Raw assets
20
+ // need an independently selected approval_context in their current binding.
21
+ const expected = current
22
+ ? approvalExpectationFromState(boundary, current, context)
23
+ : approvalExpectationFromSubject(boundary, assetRef, context);
24
+ if (io.resolve(assetRef) !== io.resolve(expected.subject_ref)) {
25
+ const frozen = expected.basis?.find(item => io.resolve(item.ref) === io.resolve(assetRef));
26
+ if (frozen && hex(frozen.digest) !== hash(bytes)) approvalError('APPROVAL_CURRENT_INVALID', '当前资产批准上下文摘要过期');
27
+ if (!frozen) expected.basis = [...(expected.basis || []), {ref:assetRef,digest:hash(bytes)}];
28
+ }
29
+ if (context.scope && JSON.stringify([...context.scope].sort()) !== JSON.stringify([...expected.approval_scope].sort())) approvalError('APPROVAL_CURRENT_INVALID', '当前资产消费范围与审阅包不匹配');
30
+ return {...expected, review_package: context.review_package ?? expected.review_package};
31
+ }
32
+
33
+ export function approvalExpectationForCheckpoint(boundary, state, context = {}) {
34
+ return approvalExpectationFromState(boundary, state, context);
35
+ }
@@ -0,0 +1,111 @@
1
+ import {createHash} from 'node:crypto';
2
+ import path from 'node:path';
3
+ import {withValidationPhase, existsSync, readFileSync} from './validation-phase.mjs';
4
+ import {loadRegistry, ROOT} from './lifecycle-registry.mjs';
5
+ import {loadDigitalHumanRoles, countersignRuleForGate, BIOLOGICAL_ROLE_ID} from './digital-human-roles.mjs';
6
+ import {parseAsset, validateAssetStructure} from './structured-assets.mjs';
7
+ import {approvalIO, approvalError} from './approval-record-io.mjs';
8
+ import {assertApprovalUserDecision} from './user-decision-reuse.mjs';
9
+ import {assertReviewCapabilityBinding, approvalExpectedFromTask} from './review-capabilities.mjs';
10
+
11
+ const hash = value => createHash('sha256').update(value).digest('hex');
12
+ const hex = value => typeof value === 'string' ? value.replace(/^sha256:/, '') : value;
13
+ const text = value => typeof value === 'string' && value.trim();
14
+ const sameScope = (a,b) => Array.isArray(a) && a.length > 0 && Array.isArray(b) && b.length > 0 && new Set(a).size === a.length && new Set(b).size === b.length && JSON.stringify([...a].sort()) === JSON.stringify([...b].sort());
15
+ const fail = detail => approvalError('APPROVAL_CURRENT_INVALID', detail);
16
+ function checkedBasis(basis, io, label) {
17
+ if (!Array.isArray(basis) || !basis.length) fail(`${label} 缺少当前证据摘要`);
18
+ const refs = new Set();
19
+ return basis.map(asset => {
20
+ if (!text(asset?.ref) || refs.has(asset.ref) || !/^[a-f0-9]{64}$/.test(hex(asset.digest))) fail(`${label} 证据引用缺失、重复或摘要非法`);
21
+ refs.add(asset.ref);
22
+ if (hash(io.bytes(asset.ref)) !== hex(asset.digest)) fail(`${label} 证据过期: ${asset.ref}`);
23
+ return {ref:asset.ref,digest:hex(asset.digest)};
24
+ });
25
+ }
26
+ export function assertApprovalSigner(record, {rolesDoc = loadDigitalHumanRoles(), registry = loadRegistry()} = {}) {
27
+ validateAssetStructure(record, 'approval-record');
28
+ if (registry.id_policy?.deprecated_ids?.includes(record.gate_id)) fail(`未知或已退役门禁: ${record.gate_id}`);
29
+ if (!rolesDoc.runtimes?.some(runtime => runtime.id === record.runtime_id)) fail(`未知 runtime_id: ${record.runtime_id}`);
30
+ if (record.actor_kind === 'orchestrator') fail('编排器门禁不使用会签记录关闭');
31
+ let rule = countersignRuleForGate(rolesDoc.gate_policy, record.gate_id);
32
+ const continuationReviewers = rolesDoc.gate_policy.continuation_reviews?.[record.gate_id];
33
+ if (record.continuation_ref && record.actor_kind === 'digital-human' && continuationReviewers) rule = {bucket:'digital_human_review',gate:record.gate_id,countersigners:continuationReviewers};
34
+ if (!rule) fail(`${record.gate_id} 不是会签门禁;evidence_only / orchestrator 门禁不写 approval-record`);
35
+ if (record.decision !== 'approved') fail(`${record.gate_id} 会签 decision 必须为 approved 才能关闭门禁`);
36
+ if (record.biological_veto === true) fail(`${record.gate_id} 已被生物人否决,不能标为 approved`);
37
+ if (rule.bucket === 'biological_human') {
38
+ if (record.actor_kind !== 'biological-human' || record.role_id !== BIOLOGICAL_ROLE_ID) fail(`${record.gate_id} 必须由生物人会签`);
39
+ } else {
40
+ if (record.actor_kind !== 'digital-human') fail(`${record.gate_id} 必须由数字人会签`);
41
+ // v2 professional review is constrained by the issued capability task below.
42
+ if (!(record.schema_version === 2 && rule.capability_ids?.length) && !rule.countersigners?.includes(record.role_id)) fail(`${record.gate_id} 会签角色必须是 ${(rule.countersigners || []).join(' / ')}`);
43
+ if (record.schema_version === 1 && rule.drafter && record.role_id === rule.drafter) fail(`${record.gate_id} 起草者不得会签自己`);
44
+ if (record.schema_version === 1 && rule.drafter && record.countersigner_role_ids?.includes(rule.drafter)) fail(`${record.gate_id} 起草者不得出现在 countersigner_role_ids`);
45
+ if (rule.drafter && record.drafter_role_id && record.drafter_role_id !== rule.drafter) fail(`${record.gate_id} drafter_role_id 必须为 ${rule.drafter}`);
46
+ }
47
+ return rule;
48
+ }
49
+ export function approvalExpectationFromState(boundary, state, context = {}) {
50
+ if (!state || !text(state.subject_ref) || !sameScope(state.approval_scope, state.approval_scope)) approvalError('APPROVAL_CONTEXT_REQUIRED','当前消费边界缺少主体或批准范围');
51
+ const io = approvalIO(context), bytes = io.bytes(state.subject_ref);
52
+ let subject;
53
+ try {subject = parseAsset(bytes,io.resolve(state.subject_ref));} catch {subject = null;}
54
+ return {boundary,subject_ref:state.subject_ref,subject_digest:state.subject_digest || state.basis?.find(asset=>asset.ref===state.subject_ref)?.digest || hash(bytes),approval_scope:[...state.approval_scope],basis:state.basis?.filter(asset => ![state.approval_ref,state.subject_ref].includes(asset.ref)),drafter_principal_ref:state.drafter_principal_ref || subject?.drafter_principal_ref,review_package:context.review_package ?? state.review_package ?? boundary.startsWith('gate.'),review_context:state.review_context};
55
+ }
56
+ export function approvalExpectationFromSubject(boundary, subjectRef, context = {}) {
57
+ const io=approvalIO(context),bytes=io.bytes(subjectRef),subject=parseAsset(bytes,io.resolve(subjectRef)),scope=subject.approval_scope || subject.scope;
58
+ if (!sameScope(scope,scope) || !subject.basis?.length) approvalError('APPROVAL_CONTEXT_REQUIRED','当前主体缺少独立范围及依据;请提供 checkpoint/task 消费上下文');
59
+ return {boundary,subject_ref:subjectRef,subject_digest:hash(bytes),approval_scope:[...scope],basis:subject.basis,drafter_principal_ref:subject.drafter_principal_ref,review_package:context.review_package ?? boundary.startsWith('gate.')};
60
+ }
61
+ /** Validates only a supplied current binding; never derives expected values from the approval record. */
62
+ function validateCurrentApproval(record, expected, context = {}) {
63
+ const authorityRoot=context.root || ROOT,rolesPath=path.resolve(authorityRoot,'.template-spec/agents/digital-human-roles.yaml'),registryPath=path.resolve(authorityRoot,'.template-spec/process/lifecycle-registry.yaml');
64
+ const roles = context.rolesDoc || loadDigitalHumanRoles(existsSync(rolesPath)?rolesPath:undefined), registry = context.registry || loadRegistry(existsSync(registryPath)?registryPath:undefined);
65
+ const rule = assertApprovalSigner(record, {rolesDoc:roles,registry});
66
+ if (!expected || !text(expected.boundary) || !text(expected.subject_ref) || !sameScope(expected.approval_scope,expected.approval_scope) || !expected.basis?.length) approvalError('APPROVAL_CONTEXT_REQUIRED','当前批准须有来自 checkpoint/task/当前主体的边界、范围及依据');
67
+ const io = approvalIO(context);
68
+ if (record.schema_version === 2) {
69
+ const task = io.document(record.review_task_ref);
70
+ const issued = approvalExpectedFromTask(task,{...context,expected:expected.review_context,read:context.read || readFileSync,rolesDoc:roles,registry,boundary:expected.boundary,reviewTaskRef:record.review_task_ref,reviewTaskDigest:record.review_task_digest});
71
+ if ((record.review_task_id && record.review_task_id !== task.task_id) || (record.review_work_unit_id && record.review_work_unit_id !== task.work_unit_id)) fail('组合包身份与正式审查任务不匹配');
72
+ if (record.review_bundle_basis) {
73
+ const basis = checkedBasis(record.review_bundle_basis,io,'组合包');
74
+ if (basis.length !== task.review_context.basis.length || basis.some(asset=>!task.review_context.basis.some(bound=>bound.ref===asset.ref && hex(bound.digest)===asset.digest))) fail('组合包依据与正式审查任务不匹配');
75
+ }
76
+ if (issued.subject_ref !== expected.subject_ref || !sameScope(issued.approval_scope,expected.approval_scope)) fail('当前消费上下文与正式审查任务范围不匹配');
77
+ for (const asset of expected.basis) if (!issued.basis.some(row => row.ref === asset.ref && hex(row.digest) === hex(asset.digest))) fail('当前消费上下文依据不属于正式审查任务');
78
+ if (expected.drafter_principal_ref && expected.drafter_principal_ref !== issued.drafter_principal_ref) fail('正式审查任务作者与消费上下文不匹配');
79
+ expected = {...expected,drafter_principal_ref:issued.drafter_principal_ref,review_context:expected.review_context || issued.review_context};
80
+ }
81
+ if (!text(expected.drafter_principal_ref)) approvalError('APPROVAL_CONTEXT_REQUIRED','当前消费上下文缺少独立起草者来源');
82
+ if (record.gate_id !== expected.boundary || record.subject_ref !== expected.subject_ref) fail('审查对象不匹配');
83
+ if (!sameScope(record.approval_scope,expected.approval_scope)) fail('审查范围不匹配');
84
+ if (!text(record.drafter_principal_ref) || record.drafter_principal_ref === record.principal_ref) fail('缺少独立审查身份或起草者自签');
85
+ if (expected.drafter_principal_ref && expected.drafter_principal_ref !== record.drafter_principal_ref) fail('起草者身份与当前消费上下文不匹配');
86
+ if (expected.implementer_principal_ref && record.principal_ref === expected.implementer_principal_ref) fail('实施者不得审查自己');
87
+ const bytes = io.bytes(expected.subject_ref);
88
+ if (!/^[a-f0-9]{64}$/.test(hex(record.subject_digest)) || hash(bytes) !== hex(record.subject_digest)) fail('审查资产摘要不匹配;批准依据过期');
89
+ if (expected.subject_digest && hash(bytes) !== hex(expected.subject_digest)) fail('当前主体摘要与消费边界冻结摘要不匹配');
90
+ let subject;
91
+ try {subject = io.document(expected.subject_ref);} catch {subject = null;}
92
+ if (expected.subject_id && ![subject?.id,subject?.contract_id].includes(expected.subject_id)) fail('主体 ID 不匹配');
93
+ if (expected.subject_version && ![subject?.version,subject?.contract_version].includes(expected.subject_version)) fail('主体版本不匹配');
94
+ if ((expected.review_package ?? expected.boundary.startsWith('gate.')) && (subject?.gate_id !== expected.boundary || !subject?.basis?.length)) fail('审阅包身份或依据缺失');
95
+ const required = checkedBasis(expected.basis,io,'当前消费上下文');
96
+ const bound = checkedBasis(record.basis || subject?.basis,io,'批准记录');
97
+ for (const asset of required) if (!bound.some(row => row.ref === asset.ref && row.digest === asset.digest)) fail(`批准范围未覆盖证据: ${asset.ref}`);
98
+ if (record.schema_version === 2) {
99
+ if (!expected.review_context) approvalError('APPROVAL_CONTEXT_REQUIRED','v2 批准缺少独立当前审查任务上下文');
100
+ assertReviewCapabilityBinding(record,{...context,read:context.read || readFileSync,rolesDoc:roles,registry,expected:expected.review_context});
101
+ }
102
+ if (roles.user_decision_policy.gates.includes(record.gate_id)) {
103
+ const result = assertApprovalUserDecision(record, roles, {...context,root:io.root});
104
+ if (record.actor_kind === 'biological-human' && result.validated.some(row => row.principal_ref !== record.principal_ref)) fail('user-decision-responder-mismatch: 生物人会签者与原始回复者不一致');
105
+ }
106
+ return {...rule, subject_ref:expected.subject_ref, approval_scope:[...expected.approval_scope], execution_authorization:'not-evaluated'};
107
+ }
108
+
109
+ export function assertCurrentApproval(record,expected,context={}) {
110
+ return withValidationPhase({root:context.root || ROOT,purpose:"approval-current-kernel",readOnly:true},()=>validateCurrentApproval(record,expected,context));
111
+ }
@@ -0,0 +1,56 @@
1
+ import path from 'node:path';
2
+ import {existsSync, readFileSync} from './validation-phase.mjs';
3
+ import {ROOT} from './lifecycle-registry.mjs';
4
+ import {parseAsset, validateAssetStructure} from './structured-assets.mjs';
5
+
6
+ export const approvalError = (code, detail) => { throw Object.assign(new TypeError(`${code}: ${detail}`), {code}); };
7
+ export function approvalIO({root = ROOT, read = ref => readFileSync(ref)} = {}) {
8
+ root = path.resolve(root);
9
+ const resolve = ref => {
10
+ if (typeof ref !== 'string' || !ref.trim()) approvalError('APPROVAL_REFERENCE_REQUIRED', '缺少可读取引用');
11
+ return path.isAbsolute(ref) ? ref : path.resolve(root, ref);
12
+ };
13
+ const bytes = ref => read(resolve(ref));
14
+ const document = ref => parseAsset(bytes(ref), resolve(ref));
15
+ return {root, resolve, bytes, document};
16
+ }
17
+ export function readApprovalDocument(filePath, context = {}) {
18
+ const io = approvalIO(context), value = io.document(filePath);
19
+ validateAssetStructure(value, 'approval-record');
20
+ return value;
21
+ }
22
+ export function reviewBundleRows(bundle) {
23
+ if (![1, 2].includes(bundle?.schema_version) || bundle.kind !== 'review-bundle') approvalError('APPROVAL_BUNDLE_INVALID', '组合审查身份无效');
24
+ if (!Array.isArray(bundle.reviews) || !bundle.reviews.length) approvalError('APPROVAL_BUNDLE_INVALID', '组合审查不能为空');
25
+ if (new Set(bundle.reviews.map(row => row.gate_id)).size !== bundle.reviews.length) approvalError('APPROVAL_BUNDLE_INVALID', '组合审查 gate_id 重复');
26
+ for (const row of bundle.reviews) {
27
+ if (row.schema_version !== bundle.schema_version || row.role_id !== bundle.role_id || row.runtime_id !== bundle.runtime_id || row.principal_ref !== bundle.principal_ref) approvalError('APPROVAL_BUNDLE_INVALID', '组合审查必须来自同一复核角色、运行时和实例');
28
+ if (row.review_session_id != null && row.review_session_id !== bundle.review_session_id) approvalError('APPROVAL_BUNDLE_INVALID', '组合审查 review_session_id 不一致');
29
+ if (bundle.schema_version === 2) {
30
+ for (const field of ['review_task_ref','review_task_digest']) if (row[field] !== bundle[field]) approvalError('APPROVAL_BUNDLE_INVALID', `组合审查 ${field} 不一致`);
31
+ if (JSON.stringify([...(row.capability_ids || [])].sort()) !== JSON.stringify([...(bundle.capability_ids || [])].sort())) approvalError('APPROVAL_BUNDLE_INVALID', '组合审查 capability_ids 不一致');
32
+ if (row.basis?.some(asset=>!bundle.basis?.some(bound=>bound.ref===asset.ref && bound.digest===asset.digest))) approvalError('APPROVAL_BUNDLE_INVALID', '组合审查未覆盖逐项 basis');
33
+ }
34
+ }
35
+ return bundle.reviews;
36
+ }
37
+ export function selectApprovalRecord(record, gateId) {
38
+ if (record.kind !== 'review-bundle') return record;
39
+ const selected = reviewBundleRows(record).filter(row => row.gate_id === gateId);
40
+ if (selected.length !== 1) approvalError('APPROVAL_BUNDLE_INVALID', '组合审查缺少当前检查的明确结论');
41
+ return {...selected[0], review_bundle_id:record.bundle_id, review_task_id:record.task_id, review_work_unit_id:record.work_unit_id, review_session_id:record.review_session_id,...(record.schema_version===2?{review_bundle_basis:record.basis}:{})};
42
+ }
43
+ export function loadApprovalRecord(filePath, gateId, context = {}) {
44
+ return selectApprovalRecord(readApprovalDocument(filePath, context), gateId);
45
+ }
46
+ export function readApprovalHistory(filePath, context = {}) {
47
+ const record = readApprovalDocument(filePath, context);
48
+ if (record.kind === 'review-bundle') reviewBundleRows(record);
49
+ return {record, bucket:'history-only', execution_authorization:'not-evaluated'};
50
+ }
51
+ export function resolveApprovalRef(ref, fromFile = ROOT, {root = ROOT} = {}) {
52
+ if (typeof ref !== 'string' || !ref.trim()) approvalError('APPROVAL_REFERENCE_REQUIRED', 'approval_ref 不能为空');
53
+ if (path.isAbsolute(ref)) return ref;
54
+ const candidate = path.resolve(root, ref);
55
+ return existsSync(candidate) ? candidate : path.resolve(path.dirname(fromFile), ref);
56
+ }