create-yss-spec 3.4.9 → 3.5.0

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 (287) hide show
  1. package/README.md +2 -2
  2. package/package.json +1 -1
  3. package/src/api/_sync-service.js +111 -18
  4. package/src/cli/args.js +1 -0
  5. package/src/cli/help.js +10 -1
  6. package/src/cli/index.js +3 -0
  7. package/src/cli/prompts.js +5 -1
  8. package/src/cli/router.js +2 -0
  9. package/src/commands/attach.js +12 -2
  10. package/src/commands/init.js +2 -0
  11. package/src/commands/skills.js +253 -0
  12. package/src/commands/sync.js +3 -0
  13. package/src/family-identity.js +1 -1
  14. package/src/template/asset-runtime.js +220 -0
  15. package/src/template/attach-planner.js +5 -0
  16. package/src/template/distribution-runtime.js +165 -0
  17. package/src/template/instance-runtime.js +76 -29
  18. package/src/template/ownership-policy.js +17 -1
  19. package/src/template/prune-planner.js +6 -1
  20. package/src/template/sync-planner.js +8 -0
  21. package/src/template/verification-runtime.js +56 -1
  22. package/src/validation/metadata.js +24 -1
  23. package/template/.agents/skills/.strategic-design-skills-manifest.json +1 -1
  24. package/template/.agents/skills/yss-cache/SKILL.md +6 -5
  25. package/template/.agents/skills/yss-cache/references/annotations.md +3 -1
  26. package/template/.agents/skills/yss-cache/references/architecture.md +4 -2
  27. package/template/.agents/skills/yss-cache/references/configuration.md +6 -3
  28. package/template/.agents/skills/yss-cache/references/jetcache.md +21 -0
  29. package/template/.agents/skills/yss-cache/references/redis-fallback.md +5 -3
  30. package/template/.agents/skills/yss-cache/references/verification.md +10 -4
  31. package/template/.agents/skills/yss-cache/scripts/verify-cache-component.sh +26 -20
  32. package/template/.agents/skills/yss-distributed-id/SKILL.md +14 -58
  33. package/template/.agents/skills/yss-distributed-id/agents/openai.yaml +2 -2
  34. package/template/.agents/skills/yss-distributed-id/references/README.md +11 -47
  35. package/template/.agents/skills/yss-implementation-contract-compiler/SKILL.md +2 -0
  36. package/template/.agents/skills/yss-mybatis/SKILL.md +14 -2
  37. package/template/.agents/skills/yss-openapi-draft-review/SKILL.md +2 -0
  38. package/template/.agents/skills/yss-openapi-governance/SKILL.md +4 -0
  39. package/template/.agents/skills/yss-product-lifecycle/SKILL.md +11 -5
  40. package/template/.agents/skills/yss-product-lifecycle/references/orchestration-contract.yaml +68 -5
  41. package/template/.agents/skills/yss-product-lifecycle/references/orchestration.md +2 -2
  42. package/template/.agents/skills/yss-product-lifecycle/references/state-model.md +8 -8
  43. package/template/.agents/skills/yss-prototype-stage/SKILL.md +4 -2
  44. package/template/.agents/skills/yss-prototype-stage/scripts/visual-baseline-contract.mjs +2 -2
  45. package/template/.agents/skills/yss-repository/SKILL.md +1 -0
  46. package/template/.agents/skills/yss-stage-decision/SKILL.md +2 -0
  47. package/template/.agents/skills/yss-tactical-design/SKILL.md +2 -0
  48. package/template/.agents/skills/yss-technical-design/SKILL.md +2 -0
  49. package/template/.agents/skills/yss-technical-design/scripts/engineering-design.mjs +1 -1
  50. package/template/.agents/skills/yss-technical-design/scripts/validate-technical-design.mjs +11 -8
  51. package/template/.codex/skills/yss-cache/SKILL.md +6 -5
  52. package/template/.codex/skills/yss-cache/references/annotations.md +3 -1
  53. package/template/.codex/skills/yss-cache/references/architecture.md +4 -2
  54. package/template/.codex/skills/yss-cache/references/configuration.md +6 -3
  55. package/template/.codex/skills/yss-cache/references/jetcache.md +21 -0
  56. package/template/.codex/skills/yss-cache/references/redis-fallback.md +5 -3
  57. package/template/.codex/skills/yss-cache/references/verification.md +10 -4
  58. package/template/.codex/skills/yss-cache/scripts/verify-cache-component.sh +26 -20
  59. package/template/.codex/skills/yss-distributed-id/SKILL.md +14 -58
  60. package/template/.codex/skills/yss-distributed-id/agents/openai.yaml +2 -2
  61. package/template/.codex/skills/yss-distributed-id/references/README.md +11 -47
  62. package/template/.codex/skills/yss-implementation-contract-compiler/SKILL.md +2 -0
  63. package/template/.codex/skills/yss-mybatis/SKILL.md +14 -2
  64. package/template/.codex/skills/yss-openapi-draft-review/SKILL.md +2 -0
  65. package/template/.codex/skills/yss-openapi-governance/SKILL.md +4 -0
  66. package/template/.codex/skills/yss-product-lifecycle/SKILL.md +11 -5
  67. package/template/.codex/skills/yss-product-lifecycle/references/orchestration-contract.yaml +68 -5
  68. package/template/.codex/skills/yss-product-lifecycle/references/orchestration.md +2 -2
  69. package/template/.codex/skills/yss-product-lifecycle/references/state-model.md +8 -8
  70. package/template/.codex/skills/yss-prototype-stage/SKILL.md +4 -2
  71. package/template/.codex/skills/yss-prototype-stage/scripts/visual-baseline-contract.mjs +2 -2
  72. package/template/.codex/skills/yss-repository/SKILL.md +1 -0
  73. package/template/.codex/skills/yss-stage-decision/SKILL.md +2 -0
  74. package/template/.codex/skills/yss-tactical-design/SKILL.md +2 -0
  75. package/template/.codex/skills/yss-technical-design/SKILL.md +2 -0
  76. package/template/.codex/skills/yss-technical-design/scripts/engineering-design.mjs +1 -1
  77. package/template/.codex/skills/yss-technical-design/scripts/validate-technical-design.mjs +11 -8
  78. package/template/.cursor/skills/yss-cache/SKILL.md +6 -5
  79. package/template/.cursor/skills/yss-cache/references/annotations.md +3 -1
  80. package/template/.cursor/skills/yss-cache/references/architecture.md +4 -2
  81. package/template/.cursor/skills/yss-cache/references/configuration.md +6 -3
  82. package/template/.cursor/skills/yss-cache/references/jetcache.md +21 -0
  83. package/template/.cursor/skills/yss-cache/references/redis-fallback.md +5 -3
  84. package/template/.cursor/skills/yss-cache/references/verification.md +10 -4
  85. package/template/.cursor/skills/yss-cache/scripts/verify-cache-component.sh +26 -20
  86. package/template/.cursor/skills/yss-distributed-id/SKILL.md +14 -58
  87. package/template/.cursor/skills/yss-distributed-id/agents/openai.yaml +2 -2
  88. package/template/.cursor/skills/yss-distributed-id/references/README.md +11 -47
  89. package/template/.cursor/skills/yss-implementation-contract-compiler/SKILL.md +2 -0
  90. package/template/.cursor/skills/yss-mybatis/SKILL.md +14 -2
  91. package/template/.cursor/skills/yss-openapi-draft-review/SKILL.md +2 -0
  92. package/template/.cursor/skills/yss-openapi-governance/SKILL.md +4 -0
  93. package/template/.cursor/skills/yss-product-lifecycle/SKILL.md +11 -5
  94. package/template/.cursor/skills/yss-product-lifecycle/references/orchestration-contract.yaml +68 -5
  95. package/template/.cursor/skills/yss-product-lifecycle/references/orchestration.md +2 -2
  96. package/template/.cursor/skills/yss-product-lifecycle/references/state-model.md +8 -8
  97. package/template/.cursor/skills/yss-prototype-stage/SKILL.md +4 -2
  98. package/template/.cursor/skills/yss-prototype-stage/scripts/visual-baseline-contract.mjs +2 -2
  99. package/template/.cursor/skills/yss-repository/SKILL.md +1 -0
  100. package/template/.cursor/skills/yss-stage-decision/SKILL.md +2 -0
  101. package/template/.cursor/skills/yss-tactical-design/SKILL.md +2 -0
  102. package/template/.cursor/skills/yss-technical-design/SKILL.md +2 -0
  103. package/template/.cursor/skills/yss-technical-design/scripts/engineering-design.mjs +1 -1
  104. package/template/.cursor/skills/yss-technical-design/scripts/validate-technical-design.mjs +11 -8
  105. package/template/.pi/skills/yss-cache/SKILL.md +6 -5
  106. package/template/.pi/skills/yss-cache/references/annotations.md +3 -1
  107. package/template/.pi/skills/yss-cache/references/architecture.md +4 -2
  108. package/template/.pi/skills/yss-cache/references/configuration.md +6 -3
  109. package/template/.pi/skills/yss-cache/references/jetcache.md +21 -0
  110. package/template/.pi/skills/yss-cache/references/redis-fallback.md +5 -3
  111. package/template/.pi/skills/yss-cache/references/verification.md +10 -4
  112. package/template/.pi/skills/yss-cache/scripts/verify-cache-component.sh +26 -20
  113. package/template/.pi/skills/yss-distributed-id/SKILL.md +14 -58
  114. package/template/.pi/skills/yss-distributed-id/agents/openai.yaml +2 -2
  115. package/template/.pi/skills/yss-distributed-id/references/README.md +11 -47
  116. package/template/.pi/skills/yss-implementation-contract-compiler/SKILL.md +2 -0
  117. package/template/.pi/skills/yss-mybatis/SKILL.md +14 -2
  118. package/template/.pi/skills/yss-openapi-draft-review/SKILL.md +2 -0
  119. package/template/.pi/skills/yss-openapi-governance/SKILL.md +4 -0
  120. package/template/.pi/skills/yss-product-lifecycle/SKILL.md +11 -5
  121. package/template/.pi/skills/yss-product-lifecycle/references/orchestration-contract.yaml +68 -5
  122. package/template/.pi/skills/yss-product-lifecycle/references/orchestration.md +2 -2
  123. package/template/.pi/skills/yss-product-lifecycle/references/state-model.md +8 -8
  124. package/template/.pi/skills/yss-prototype-stage/SKILL.md +4 -2
  125. package/template/.pi/skills/yss-prototype-stage/scripts/visual-baseline-contract.mjs +2 -2
  126. package/template/.pi/skills/yss-repository/SKILL.md +1 -0
  127. package/template/.pi/skills/yss-stage-decision/SKILL.md +2 -0
  128. package/template/.pi/skills/yss-tactical-design/SKILL.md +2 -0
  129. package/template/.pi/skills/yss-technical-design/SKILL.md +2 -0
  130. package/template/.pi/skills/yss-technical-design/scripts/engineering-design.mjs +1 -1
  131. package/template/.pi/skills/yss-technical-design/scripts/validate-technical-design.mjs +11 -8
  132. package/template/AGENTS.md +2 -0
  133. package/template/CONTEXT.md +2 -1
  134. package/template/README.md +3 -5
  135. package/template/docs/agents/issue-tracker.md +7 -0
  136. package/template/docs/agents/skill-migrations.md +4 -0
  137. package/template/docs/agents/yss-skill-registry.yaml +7 -6
  138. package/template/docs/design/README.md +0 -1
  139. package/template/docs/design/design.md +2 -2
  140. package/template/docs/design/templates/interaction-spec-template.md +1 -1
  141. package/template/docs/engineering/evidence/aliyun-artifact-resolution.json +446 -0
  142. package/template/docs/process/contract-reading.md +46 -0
  143. package/template/docs/process/lifecycle-artifact-map.md +2 -2
  144. package/template/docs/process/lifecycle-registry-baseline.json +2 -1
  145. package/template/docs/process/lifecycle-registry.yaml +10 -4
  146. package/template/docs/process/schemas/api-contract-decision-v2.schema.json +198 -0
  147. package/template/docs/process/schemas/digital-human-task-package.schema.json +8 -0
  148. package/template/docs/process/schemas/lifecycle-checkpoint.schema.json +259 -0
  149. package/template/docs/process/schemas/stage-tracking.schema.json +259 -0
  150. package/template/docs/process/stage-tracking.md +62 -0
  151. package/template/docs/process/strategic-handoff-package.md +8 -0
  152. package/template/docs/user-guide//347/224/250/346/210/267/346/211/213/345/206/214.md +2 -0
  153. package/template/docs/user-guide//347/224/250/346/210/267/346/211/213/345/206/214/347/264/242/345/274/225.md +1 -0
  154. package/template/docs/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 +243 -0
  155. package/template/scripts/api-contract-decision +16 -0
  156. package/template/scripts/complete-backend-delivery +17 -0
  157. package/template/scripts/contract +13 -0
  158. package/template/scripts/design-md +2 -0
  159. package/template/scripts/dispatch-slice-task +13 -0
  160. package/template/scripts/lib/api-contract-decision.mjs +45 -4
  161. package/template/scripts/lib/approval-record.mjs +1 -1
  162. package/template/scripts/lib/approved-execution-context.mjs +35 -7
  163. package/template/scripts/lib/backend-architecture.mjs +2 -2
  164. package/template/scripts/lib/backend-delivery-terminal.mjs +51 -0
  165. package/template/scripts/lib/backend-platform-provenance.mjs +1 -1
  166. package/template/scripts/lib/backend-platform.mjs +1 -1
  167. package/template/scripts/lib/backend-scaffold-prerequisites.mjs +1 -1
  168. package/template/scripts/lib/context-contract.mjs +1 -1
  169. package/template/scripts/lib/context-reconciliation.mjs +1 -1
  170. package/template/scripts/lib/contract-source.mjs +22 -0
  171. package/template/scripts/lib/contract-views.mjs +109 -0
  172. package/template/scripts/lib/delivery-preflight.mjs +3 -2
  173. package/template/scripts/lib/design-md.mjs +230 -0
  174. package/template/scripts/lib/digital-human-roles.mjs +1 -1
  175. package/template/scripts/lib/existing-backend-architecture.mjs +4 -3
  176. package/template/scripts/lib/existing-ui-baseline.mjs +4 -2
  177. package/template/scripts/lib/frontend-delivery-boundary.mjs +1 -1
  178. package/template/scripts/lib/frontend-delivery.mjs +1 -1
  179. package/template/scripts/lib/harness-execution-scope.mjs +15 -1
  180. package/template/scripts/lib/implementation-contract-compiler.mjs +4 -4
  181. package/template/scripts/lib/json-schema.mjs +19 -4
  182. package/template/scripts/lib/lifecycle-context-query.mjs +5 -1
  183. package/template/scripts/lib/lifecycle-controls.mjs +1 -1
  184. package/template/scripts/lib/lifecycle-execution-scope.mjs +92 -0
  185. package/template/scripts/lib/lifecycle-registry.mjs +2 -1
  186. package/template/scripts/lib/lifecycle-transition.mjs +21 -3
  187. package/template/scripts/lib/openapi-draft-validation.mjs +2 -1
  188. package/template/scripts/lib/skill-registry.mjs +10 -3
  189. package/template/scripts/lib/skill-supply-chain.mjs +33 -14
  190. package/template/scripts/lib/slice-contract-preparation.mjs +16 -14
  191. package/template/scripts/lib/slice-contract-views.mjs +1 -1
  192. package/template/scripts/lib/slice-contract.mjs +18 -3
  193. package/template/scripts/lib/slice-execution-preflight.mjs +7 -3
  194. package/template/scripts/lib/slice-repositories.mjs +1 -1
  195. package/template/scripts/lib/slice-task-package.mjs +3 -2
  196. package/template/scripts/lib/stage-tracking-migration.mjs +176 -0
  197. package/template/scripts/lib/stage-tracking.mjs +184 -0
  198. package/template/scripts/lib/strategic-handoff-consumption.mjs +5 -4
  199. package/template/scripts/lib/strategic-handoff-io.mjs +5 -2
  200. package/template/scripts/lib/strategic-handoff-routing.mjs +31 -0
  201. package/template/scripts/lib/strategic-handoff.mjs +4 -2
  202. package/template/scripts/lib/task-package.mjs +2 -0
  203. package/template/scripts/lib/technical-design-boundary.mjs +4 -2
  204. package/template/scripts/lib/ui-baseline.mjs +1 -1
  205. package/template/scripts/lib/user-decision.mjs +1 -1
  206. package/template/scripts/lib/validation-phase.mjs +72 -0
  207. package/template/scripts/stage-tracking +25 -0
  208. package/template/scripts/strategic-consumer-entry +47 -0
  209. package/template/scripts/verify-context-reconciliation +4 -3
  210. package/template/scripts/verify-lifecycle-checkpoint +10 -0
  211. package/template/scripts/verify-project-instance +11 -10
  212. package/template/skills-lock.json +17 -32
  213. package/template.manifest.json +18 -3
  214. package/template.snapshot.json +5 -5
  215. package/template/.agents/skills/grill-me/SKILL.md +0 -7
  216. package/template/.agents/skills/grill-me/agents/openai.yaml +0 -5
  217. package/template/.agents/skills/yss-distributed-id/assets/AutoIdInterceptor.java +0 -246
  218. package/template/.agents/skills/yss-distributed-id/assets/EnableDistributedId.java +0 -25
  219. package/template/.agents/skills/yss-distributed-id/assets/LeafConf.java +0 -36
  220. package/template/.codex/skills/grill-me/SKILL.md +0 -7
  221. package/template/.codex/skills/grill-me/agents/openai.yaml +0 -5
  222. package/template/.codex/skills/yss-distributed-id/assets/AutoIdInterceptor.java +0 -246
  223. package/template/.codex/skills/yss-distributed-id/assets/EnableDistributedId.java +0 -25
  224. package/template/.codex/skills/yss-distributed-id/assets/LeafConf.java +0 -36
  225. package/template/.cursor/skills/grill-me/SKILL.md +0 -7
  226. package/template/.cursor/skills/grill-me/agents/openai.yaml +0 -5
  227. package/template/.cursor/skills/yss-distributed-id/assets/AutoIdInterceptor.java +0 -246
  228. package/template/.cursor/skills/yss-distributed-id/assets/EnableDistributedId.java +0 -25
  229. package/template/.cursor/skills/yss-distributed-id/assets/LeafConf.java +0 -36
  230. package/template/.pi/skills/grill-me/SKILL.md +0 -7
  231. package/template/.pi/skills/grill-me/agents/openai.yaml +0 -5
  232. package/template/.pi/skills/yss-distributed-id/assets/AutoIdInterceptor.java +0 -246
  233. package/template/.pi/skills/yss-distributed-id/assets/EnableDistributedId.java +0 -25
  234. package/template/.pi/skills/yss-distributed-id/assets/LeafConf.java +0 -36
  235. package/template/docs/agents/yss-plugin-dependency-contract.md +0 -45
  236. package/template/docs/api/.gitkeep +0 -0
  237. package/template/docs/api/specs/.gitkeep +0 -0
  238. package/template/docs/architecture/.gitkeep +0 -0
  239. package/template/docs/design/facts/antdv-next/1.5.2/cli-help.txt +0 -38
  240. package/template/docs/design/facts/antdv-next/1.5.2/component-list.json +0 -434
  241. package/template/docs/design/facts/antdv-next/1.5.2/components/Alert/demo-basic.json +0 -7
  242. package/template/docs/design/facts/antdv-next/1.5.2/components/Alert/info.json +0 -246
  243. package/template/docs/design/facts/antdv-next/1.5.2/components/Alert/semantic.json +0 -40
  244. package/template/docs/design/facts/antdv-next/1.5.2/components/Alert/token.json +0 -32
  245. package/template/docs/design/facts/antdv-next/1.5.2/components/Button/demo-basic.json +0 -7
  246. package/template/docs/design/facts/antdv-next/1.5.2/components/Button/info.json +0 -190
  247. package/template/docs/design/facts/antdv-next/1.5.2/components/Button/semantic.json +0 -20
  248. package/template/docs/design/facts/antdv-next/1.5.2/components/Button/token.json +0 -256
  249. package/template/docs/design/facts/antdv-next/1.5.2/components/Input/demo-basic.json +0 -7
  250. package/template/docs/design/facts/antdv-next/1.5.2/components/Input/info.json +0 -460
  251. package/template/docs/design/facts/antdv-next/1.5.2/components/Input/semantic.json +0 -70
  252. package/template/docs/design/facts/antdv-next/1.5.2/components/Input/token.json +0 -123
  253. package/template/docs/design/facts/antdv-next/1.5.2/components/Modal/demo-basic.json +0 -7
  254. package/template/docs/design/facts/antdv-next/1.5.2/components/Modal/info.json +0 -646
  255. package/template/docs/design/facts/antdv-next/1.5.2/components/Modal/semantic.json +0 -50
  256. package/template/docs/design/facts/antdv-next/1.5.2/components/Modal/token.json +0 -130
  257. package/template/docs/design/facts/antdv-next/1.5.2/components/Select/demo-basic.json +0 -7
  258. package/template/docs/design/facts/antdv-next/1.5.2/components/Select/info.json +0 -640
  259. package/template/docs/design/facts/antdv-next/1.5.2/components/Select/semantic.json +0 -70
  260. package/template/docs/design/facts/antdv-next/1.5.2/components/Select/token.json +0 -172
  261. package/template/docs/design/facts/antdv-next/1.5.2/components/Table/demo-basic.json +0 -7
  262. package/template/docs/design/facts/antdv-next/1.5.2/components/Table/info.json +0 -1010
  263. package/template/docs/design/facts/antdv-next/1.5.2/components/Table/semantic.json +0 -70
  264. package/template/docs/design/facts/antdv-next/1.5.2/components/Table/token.json +0 -263
  265. package/template/docs/design/facts/antdv-next/1.5.2/components/Tag/demo-basic.json +0 -7
  266. package/template/docs/design/facts/antdv-next/1.5.2/components/Tag/info.json +0 -321
  267. package/template/docs/design/facts/antdv-next/1.5.2/components/Tag/semantic.json +0 -25
  268. package/template/docs/design/facts/antdv-next/1.5.2/components/Tag/token.json +0 -25
  269. package/template/docs/design/facts/antdv-next/1.5.2/design-md.json +0 -3
  270. package/template/docs/design/facts/antdv-next/1.5.2/manifest.json +0 -215
  271. package/template/docs/design/facts/antdv-next/1.5.2/resolution-probe.json +0 -5
  272. package/template/docs/design/prototypes/.gitkeep +0 -1
  273. package/template/docs/implementation/.gitkeep +0 -1
  274. package/template/docs/plan/IDEATION.md +0 -96
  275. package/template/docs/process/PDCA-SCRUM.md +0 -10
  276. package/template/docs/process/harness-executive-blueprint.md +0 -10
  277. package/template/docs/releases/.gitkeep +0 -1
  278. package/template/docs/requirements/README.md +0 -85
  279. package/template/docs/requirements/tickets/.gitkeep +0 -1
  280. package/template/docs/templates/agent-brief-template.md +0 -46
  281. package/template/docs/templates/architecture-proposal-template.md +0 -18
  282. package/template/docs/templates/implementation-plan-template.md +0 -16
  283. package/template/docs/templates/implementation-routing-template.md +0 -350
  284. package/template/docs/templates/requirement-freeze-template.md +0 -63
  285. package/template/docs/templates/risk-register-template.md +0 -11
  286. package/template/docs/templates/user-story-template.md +0 -20
  287. package/template/docs/testing/README.md +0 -110
@@ -5,6 +5,8 @@ description: "审查 YSS OpenAPI Draft 的需求覆盖、页面动作、响应
5
5
 
6
6
  # YSS OpenAPI Draft Review
7
7
 
8
+ 已有生命周期资产优先用 `scripts/contract view <资产> --kind <类型>` 阅读;执行任务用 `--profile task --unit <ID>`,绑定与校验明细用 `--profile full`。视图不授予执行权限,仍按本 Skill 的原始来源和批准门禁处理。类型、准备和迁移见 `docs/process/contract-reading.md`。
9
+
8
10
  Use this skill after OpenAPI Draft creation and before Engineering Baseline / YSS DDD Review. It is a fail-closed contract review skill for design-time OpenAPI files under `docs/.scratch/<feature>/api/`; it does not bundle JSON or generate Orval clients.
9
11
 
10
12
  ## Required Inputs
@@ -5,6 +5,8 @@ description: "维护、校验、冻结或导出 YSS OpenAPI 3.1 设计合同;
5
5
 
6
6
  # YSS OpenAPI Governance
7
7
 
8
+ 已有生命周期资产优先用 `scripts/contract view <资产> --kind <类型>` 阅读;执行任务用 `--profile task --unit <ID>`,绑定与校验明细用 `--profile full`。视图不授予执行权限,仍按本 Skill 的原始来源和批准门禁处理。类型、准备和迁移见 `docs/process/contract-reading.md`。
9
+
8
10
  本 skill 负责 YSS OpenAPI 的 **YAML-first** 工作流:
9
11
 
10
12
  ```text
@@ -114,3 +116,5 @@ pnpm exec redocly bundle \
114
116
  ## 输出契约
115
117
 
116
118
  执行治理或导出时,按 [输出契约](references/governance-output.md) 记录 YAML 权威、当前校验证据、JSON 派生与交接。不能只给自然语言完成声明;未冻结时不生成可供实现消费的 JSON。
119
+
120
+ API Contract Decision 可用 `scripts/api-contract-decision prepare` 自动生成来源摘要;v1 显式迁移用 `migrate --version <新版本> --output <新路径>`。候选保持 draft,审查、Freeze 绑定和工程契约批准仍由现有生命周期核验。
@@ -1,11 +1,13 @@
1
1
  ---
2
2
  name: yss-product-lifecycle
3
- description: 编排 YSS 产品或模块从机会调研到 Spec、原型、技术契约、垂直切片实现、审查、发布和复盘;当阶段、产物、门禁或 YSS skill 不清晰时使用。
3
+ description: 编排 YSS 研发全生命周期;当阶段、产物、门禁或 Skill 路由不清晰时使用。
4
4
  ---
5
5
 
6
6
  # YSS Product Lifecycle
7
7
 
8
- 生命周期单一主控:识别请求、仓库身份和最近可信阶段,计算可执行 frontier,派发并验收工作单元;业务设计、实现和独立审查交给专项 skill。
8
+ 合同阅读:`scripts/contract view`;见 `docs/process/contract-reading.md`。
9
+
10
+ 主控识别请求、仓库身份和可信阶段,计算 frontier、派发与验收工作单元;专项 Skill 负责设计、实现和独立审查。
9
11
 
10
12
  文档按 `document_writing` 条件调用 `i-have-adhd`,并传递 `docs/process/document-writing.md` 规范。
11
13
 
@@ -21,7 +23,7 @@ description: 编排 YSS 产品或模块从机会调研到 Spec、原型、技术
21
23
  | 数字人角色、运行时和会签策略 | `docs/agents/digital-human-roles.yaml` |
22
24
  | 影响面、裁剪和模板维护强度 | `docs/process/harness-process-tailoring.md`、`docs/process/maintenance-intensity.yaml` |
23
25
 
24
- 使用 `scripts/query-lifecycle-context` 获取确定性 JSON 投影,不要为普通路由整份读取编排合同:
26
+ 用 `scripts/query-lifecycle-context` 查询合同:
25
27
 
26
28
  ```bash
27
29
  scripts/query-lifecycle-context --mode route --stage stage.plan --work-unit work-unit.plan-requirements --include execution_efficiency
@@ -54,6 +56,8 @@ Plan 入口读取 `docs/plan/README.md` 和 `docs/process/plan-migration.md`,
54
56
 
55
57
  聚合批准见 `gate_consolidation`。普通功能默认一个独立审查者,按能力缺口、冲突或外部制度增员;相邻检查组合审查、逐项留证。
56
58
 
59
+ 项目职责与后端终点见 `execution_scopes`;恢复、编译和派发必须复验。保留产品设计门禁,后端交付不等于业务完成或发布。
60
+
57
61
  ### 用户决定
58
62
 
59
63
  按角色表 `user_decision_policy` 和 `references/user-decisions.md` 先展示可审阅资产、范围、风险及后续动作,再取得提问者或其指定生物人的原始回复。数字人、超时和默认项不能代答。已有授权优先用 `continuation_ref` 核验延续;未知/实质变化或强制审批缺失才重新决定。缺陷和缺证据阻断,建议记待办;合同、验证及外部动作授权仍须满足。
@@ -71,7 +75,7 @@ Plan 入口读取 `docs/plan/README.md` 和 `docs/process/plan-migration.md`,
71
75
  5. 先对照用户目标逐项验收,检查遗漏诉求、错误假设与尚未解决的问题,再验收 `Workflow Execution Result`:工作单元、合同、允许写路径、`context_reconciliation`、证据、实际验证、延期 seam、漂移和下一路由必须可核验。实现派发额外绑定当前 Slice Implementation Contract v3;其他阶段不得伪造该合同。
72
76
  6. 在授权边界内继续下一工作单元;遇到人工决定、新授权、证据冲突、专项失败或合并/发布结论时暂停。暂停不得阻断无依赖的独立工作。
73
77
 
74
- 每个 `project-instance` 工作单元在申请批准或流转前,先把稳定术语回写到根目录唯一 `CONTEXT.md`,并生成通过校验的 `context_reconciliation`。候选术语、错误路径、摘要漂移或未决冲突必须阻断。质量标准只由 `engineering-baseline` 定义一次;高风险影响按裁剪合同补充反证和残余风险。
78
+ 每个 `project-instance` 工作单元批准或流转前,回写稳定术语到唯一根 `CONTEXT.md`,并生成通过校验的 `context_reconciliation`。候选术语、错误路径、摘要漂移或未决冲突必须阻断。质量标准只由 `engineering-baseline` 定义一次;高风险影响按裁剪合同补充反证和残余风险。
75
79
 
76
80
  ## 面向业务角色
77
81
 
@@ -85,10 +89,12 @@ Plan → Spec(含正式草稿、恢复与显式 `to-spec`)写入前,按 `d
85
89
 
86
90
  ## 结果与暂停
87
91
 
88
- 普通咨询直接回答,不创建流程产物;复杂请求简述目标与下一步。实际工作单元仍记录完整结果,按适用边界同步,对外仅展示当前决定所需信息。
92
+ 咨询直接回答;工作单元保留完整结果,对外仅展示当前决定所需信息。
89
93
 
90
94
  工作单元结果至少包含:模式、仓库身份、当前阶段和工作单元、影响面、资产与门禁状态、证据、新鲜度、Ticket/垂直切片/合同状态、`ready-for-agent` 结论、阻塞项、本轮动作、下一工作单元、暂停或继续理由、Ticket 同步和 Git checkpoint 判断。
91
95
 
92
96
  暂停会签时追加门禁 ID、`role_id`、`runtime_id`、会签文件路径、推荐答案和恢复动作;恢复前运行适用验证器。只有同一候选快照通过全部适用审查轴与 fresh verification,才能提出合并、发布或完成结论;发布仍须生物人决定。
93
97
 
94
98
  专项合同加载索引见 `references/orchestration.md`。
99
+
100
+ Plan / Spec / Design 追踪按 `docs/process/stage-tracking.md`。
@@ -53,7 +53,7 @@ review_verification:
53
53
 
54
54
  checkpoint_policy:
55
55
  strategy: consolidated
56
- flush_on: [human_pause, handoff, implementation_entry, merge, release]
56
+ flush_on: [stage_exit, human_pause, handoff, implementation_entry, merge, release]
57
57
  flush_immediately_on: [blocked, responsibility_changed, asset_approval]
58
58
  preserve_stage_causality: true
59
59
  required_stage_trace_fields: [stage, upstream_refs, artifact_refs, gate_decisions, downstream_impacts]
@@ -286,7 +286,7 @@ task_package:
286
286
  # may prepare, validate and accept their results, but cannot invoke them or create
287
287
  # their formal artifacts on their behalf.
288
288
  matt_invocation_boundary:
289
- user_invoked_skills: [grill-me, grill-with-docs, handoff, implement, improve-codebase-architecture, setup-matt-pocock-skills, to-questionnaire, to-spec, to-tickets, triage, wait-what, wayfinder]
289
+ user_invoked_skills: [grill-with-docs, handoff, implement, improve-codebase-architecture, setup-matt-pocock-skills, to-questionnaire, to-spec, to-tickets, triage, wait-what, wayfinder]
290
290
  lifecycle_managed_user_entries: [setup-matt-pocock-skills, grill-with-docs, to-spec, to-tickets, implement]
291
291
  model_invoked_skills: [code-review, codebase-design, diagnosing-bugs, domain-modeling, grilling, prototype, resolving-merge-conflicts, tdd, writing-for-agents, yss-research]
292
292
  lifecycle_allowed_model_invoked_skills: [code-review, codebase-design, diagnosing-bugs, domain-modeling, grilling, prototype, tdd, yss-research]
@@ -299,7 +299,7 @@ skill_source_contract:
299
299
  lock_version: 3
300
300
  source_revisions_required: [mattpocock/skills, iloveZzz/yss-ui]
301
301
  adaptation_ref_required_when_effective_diff: true
302
- retired_shared_skills: [yss-antd-design, yss-antdv-next-design, ask-matt, batch-grill-me, dispatching-parallel-agents, loop-me, migrate-to-shoehorn, product-design-prototype, prototype-page-acceptance, scaffold-exercises, setup-pre-commit, setup-ts-deep-modules, teach, writing-beats, writing-fragments, writing-shape, yss-components, yss-dictionary, yss-jdbc, yss-log, yss-microapp-commit, yss-mvc-scaffold-generator, yss-mvc-design, yss-mvc-data-analysis-project-initializer, yss-backend-scaffold-parent, yss-page-module-development, yss-taskflow, yss-backend-scaffold-application, yss-backend-scaffold-domain, yss-backend-scaffold-infrastructure, yss-backend-scaffold-web, yss-backend-scaffold-adapter, yss-application-layer-reference, yss-domain-layer-reference, yss-infrastructure-layer-reference, yss-web-layer-reference]
302
+ retired_shared_skills: [yss-antd-design, yss-antdv-next-design, ask-matt, batch-grill-me, grill-me, dispatching-parallel-agents, loop-me, migrate-to-shoehorn, product-design-prototype, prototype-page-acceptance, scaffold-exercises, setup-pre-commit, setup-ts-deep-modules, teach, writing-beats, writing-fragments, writing-shape, yss-components, yss-dictionary, yss-jdbc, yss-log, yss-microapp-commit, yss-mvc-scaffold-generator, yss-mvc-design, yss-mvc-data-analysis-project-initializer, yss-backend-scaffold-parent, yss-page-module-development, yss-taskflow, yss-backend-scaffold-application, yss-backend-scaffold-domain, yss-backend-scaffold-infrastructure, yss-backend-scaffold-web, yss-backend-scaffold-adapter, yss-application-layer-reference, yss-domain-layer-reference, yss-infrastructure-layer-reference, yss-web-layer-reference]
303
303
 
304
304
  # 生命周期默认走原生工作单元;Matt user-invoked skill 仅保留为兼容入口。
305
305
  lifecycle_native_entries:
@@ -481,6 +481,15 @@ work_unit_routes:
481
481
  skills: [yss-ui, yss-design-system, code-review]
482
482
  applies_when: ui_impact
483
483
  not_applicable_reason: no_ui_impact
484
+ work-unit.backend-delivery:
485
+ native: {source: yss-product-lifecycle, skill: yss-product-lifecycle, invocation_mode: model-invoked}
486
+ primary_skill: yss-product-lifecycle
487
+ supporting_skills: [code-review]
488
+ skills: [yss-product-lifecycle, code-review]
489
+ applies_when: execution_scope_plan_to_backend
490
+ not_applicable_reason: outside_plan_to_backend_execution_scope
491
+ verifier: scripts/complete-backend-delivery
492
+ completion: current-source-and-exported-package-verified
484
493
  work-unit.code-review:
485
494
  native: {source: yss-product-lifecycle, skill: code-review, invocation_mode: model-invoked}
486
495
  primary_skill: code-review
@@ -628,6 +637,11 @@ transition_graph:
628
637
  work-unit.technical-analysis: [work-unit.implementation-repository-preparation]
629
638
  work-unit.implementation-repository-preparation: [work-unit.ticket-decomposition]
630
639
  work-unit.ticket-decomposition: [work-unit.slice-implementation]
640
+ work-unit.slice-implementation: [work-unit.frontend-implementation-verification, work-unit.code-review]
641
+ work-unit.frontend-implementation-verification: [work-unit.code-review]
642
+ work-unit.code-review: [work-unit.release-and-retrospective, work-unit.slice-implementation, work-unit.backend-delivery]
643
+ work-unit.backend-delivery: []
644
+ work-unit.release-and-retrospective: []
631
645
  forbidden_shortcuts:
632
646
  - {from: work-unit.spec-synthesis, to: work-unit.implementation-repository-preparation}
633
647
  - {from: work-unit.prototype-design, to: work-unit.implementation-repository-preparation}
@@ -1030,6 +1044,7 @@ ready_for_agent:
1030
1044
  parent_ticket_as_implementation_ref: forbidden
1031
1045
 
1032
1046
  frontend_implementation_plan:
1047
+ scope_interpretation: product_ui_impact_requires_design_but_only_owned_frontend_implementation_requires_this_plan
1033
1048
  applies_when: [ui_impact]
1034
1049
  required_before: [ready_for_agent]
1035
1050
  required: [prototype_ref, spec_ref, visual_baseline, route_and_page_inventory, baseline_case_ids, desktop_viewport, narrow_viewport, state_cases, pnpm_commands]
@@ -1061,7 +1076,7 @@ impact_propagation:
1061
1076
  targets:
1062
1077
  - {kind: artifact, name: product-design, level: direct, when: ui_impact}
1063
1078
  - {kind: artifact, name: prototype, level: direct, when: ui_impact}
1064
- - {kind: gate, name: requirement-freeze, level: direct, when: ui_impact}
1079
+ - {kind: gate, name: gate.product-design-approved, level: direct, when: ui_impact}
1065
1080
  - {kind: artifact, name: openapi-draft, level: transitive, when: api_impact}
1066
1081
  - {kind: gate, name: openapi-freeze, level: transitive, when: api_impact}
1067
1082
  - {kind: artifact, name: vertical-slice-tickets, level: transitive, when: always}
@@ -1082,7 +1097,8 @@ impact_propagation:
1082
1097
  - {kind: artifact, name: product-design, level: direct, when: ui_impact}
1083
1098
  - {kind: artifact, name: system-architecture, level: direct, when: always}
1084
1099
  - {kind: artifact, name: data-architecture, level: direct, when: data_impact}
1085
- - {kind: gate, name: requirement-freeze, level: direct, when: always}
1100
+ - {kind: gate, name: gate.spec-baseline-approved, level: direct, when: always}
1101
+ - {kind: gate, name: gate.product-design-approved, level: direct, when: ui_impact}
1086
1102
  - {kind: artifact, name: openapi-draft, level: transitive, when: api_impact}
1087
1103
  - {kind: gate, name: design-review, level: transitive, when: always}
1088
1104
  - {kind: gate, name: openapi-freeze, level: transitive, when: api_impact}
@@ -1196,3 +1212,50 @@ gate_consolidation:
1196
1212
  invalidation: affected_dependencies_or_authorization_change_only
1197
1213
  historical_gate_records: read_only_no_automatic_approval_migration
1198
1214
  verifier: scripts/verify-lifecycle-checkpoint
1215
+
1216
+ # 项目 opt-in 只选择此权威策略,不能传入自定义工作单元白名单。
1217
+ execution_scopes:
1218
+ plan-to-backend:
1219
+ activation_ref: .yss-execution-scope.yaml
1220
+ validator: scripts/lib/lifecycle-execution-scope.mjs
1221
+ terminal_work_unit: work-unit.backend-delivery
1222
+ terminal_record: .yss-backend-delivery.json
1223
+ allowed_work_units: [work-unit.entry-triage, work-unit.plan-opportunity, work-unit.plan-requirements, work-unit.domain-strategy-design, work-unit.stage-decision, work-unit.spec-synthesis, work-unit.prototype-design, work-unit.technical-analysis, work-unit.implementation-repository-preparation, work-unit.scaffold-generation, work-unit.ticket-decomposition, work-unit.slice-implementation, work-unit.code-review, work-unit.backend-delivery]
1224
+ route_overrides:
1225
+ work-unit.code-review: [work-unit.slice-implementation, work-unit.backend-delivery]
1226
+ work-unit.slice-implementation: [work-unit.code-review]
1227
+ work-unit.backend-delivery: []
1228
+ product_ui_design: retain-all-triggered-gates
1229
+ implementation_delivery_roles: [backend]
1230
+ implementation_ui_impact: false
1231
+ downstream_frontend_required_when_product_ui_impact: [owner, ticket_ref, verification_plan, target_version]
1232
+ consumer_capabilities: [backend-technical-design]
1233
+ completion_claim: backend-delivery-only
1234
+ business_completion: forbidden
1235
+ release: forbidden
1236
+ resume: revalidate-current-scope-approvals-and-delivery
1237
+
1238
+ # Package wire IDs remain immutable; each target resolves its own executable entry.
1239
+ consumer_entry_routes:
1240
+ yss-full-lifecycle:
1241
+ backend-technical-design:
1242
+ source_work_unit: work-unit.technical-design
1243
+ target_work_unit: work-unit.technical-analysis
1244
+ plan-to-backend:
1245
+ backend-technical-design:
1246
+ source_work_unit: work-unit.technical-design
1247
+ target_work_unit: work-unit.technical-analysis
1248
+ harness.backend-delivery:
1249
+ backend-technical-design:
1250
+ source_work_unit: work-unit.technical-design
1251
+ target_work_unit: work-unit.technical-design
1252
+
1253
+ stage_tracking:
1254
+ contract: docs/process/stage-tracking.md
1255
+ schema: docs/process/schemas/stage-tracking.schema.json
1256
+ verifier: scripts/stage-tracking
1257
+ configuration: tracker.lifecycle_tracking_version
1258
+ machine_state_owner: checkpoint.stage_tracking
1259
+ transition_checkpoint_ref: checkpoint_ref
1260
+ flush_on: [stage_exit, blocked, responsibility_changed, asset_approval]
1261
+ preserves: [ticket-state, gate-approval, profile-scope]
@@ -4,14 +4,14 @@
4
4
 
5
5
  1. 按 `orchestration-contract.yaml.request_triage` 理解请求并选择模式,再识别仓库身份、任务规模和影响面;问题理解与澄清细节见 [请求分诊协议](request-triage.md)。
6
6
  2. `setup readiness`:每个任务只执行一次,核对 tracker、五态标签和领域文档布局,并在本轮缓存结果;仅在 tracker、主远端、真实标签或配置变化时重查。
7
- 3. 加载父 Ticket/checkpoint 与真实资产,计算最近可信阶段。
7
+ 3. 加载父 Ticket/checkpoint 与真实资产,计算最近可信阶段;按 `docs/process/stage-tracking.md` 登记、恢复并核验当前阶段工作项,写入前确保 checkpoint 已持久化,工作单元结果带 checkpoint_ref。
8
8
  4. 评估资产、门禁和 `stale`,选择第一个未阻塞工作单元。进入 `work-unit.slice-implementation` 前,必须先通过 `scripts/lib/lifecycle-transition.mjs` 的 Ticket 正式化、垂直切片绑定和合法 `next_route` 校验;父 Ticket、缺少垂直切片或 `ready-for-human` 的切片一律 `blocked`。
9
9
  5. 执行最小生命周期工作单元:主控先按 `docs/process/schemas/digital-human-task-package.schema.json` 编译并校验任务包,再只实际调用允许的 model-invoked skill;原生工作单元可直接持有正式资产,Matt 兼容 user-invoked skill 仅作为 workflow reference,仍由用户显式启动。将结果归一化为 `Workflow Execution Result`,验收输出并回写状态与证据。任务包的 `contract.kind` 按工作单元选择;只有实现子任务使用 `slice-implementation` 并消费 Slice Implementation Contract,其他阶段不伪造该合同。
10
10
  6. 若仍在授权和自动推进边界内,回到第 3 步;否则暂停。
11
11
 
12
12
  不要仅输出下一个提示词后结束 `orchestrate`/`resume`。不要因进入业务代码阶段而退出主控;应把实现交给专项 skill,并在返回后继续核验。
13
13
 
14
- 连续阶段自动推进时累积 Ticket 同步和 Git 判断证据,在人工暂停、handoff、进入实现、合并或发布边界集中 checkpoint。发生阻塞、责任人变化或资产需要单独批准时立即落 checkpoint,不因合并记录而丢失阶段因果关系。
14
+ 连续阶段自动推进时累积 Ticket 同步和 Git 判断证据,在阶段退出、人工暂停、handoff、进入实现、合并或发布边界集中 checkpoint。发生阻塞、责任人变化或资产需要单独批准时立即落 checkpoint,不因合并记录而丢失阶段因果关系。
15
15
 
16
16
  ## 执行成本
17
17
 
@@ -83,17 +83,17 @@ Git 动作分别保存 `commit_authorized`、`commit_scope`、`commit_authorizat
83
83
  lifecycle:
84
84
  schema_version: 1
85
85
  mode: resume
86
- stage: system-data-architecture-and-contract-review
87
- status: blocked
86
+ stage: stage.spec-architecture
87
+ status: needs-human
88
88
  workflow:
89
89
  matt_flow: main
90
- active_skill: yss-openapi-draft-review
90
+ active_skill: yss-product-lifecycle
91
91
  status: paused
92
92
  artifacts:
93
- spec: {status: approved, ref: docs/.scratch/example/spec.md}
93
+ spec: {status: ready-for-human, ref: docs/.scratch/example/spec.md}
94
94
  openapi: {status: stale, ref: docs/.scratch/example/api/example.yaml, stale_by: [spec]}
95
95
  gates:
96
- openapi_freeze: {status: stale}
96
+ gate.spec-baseline-approved: {status: needs-human}
97
97
  tracker:
98
98
  kind: local-markdown
99
99
  root: docs/.scratch
@@ -101,10 +101,10 @@ tracker:
101
101
  role: ready-for-human
102
102
  pause:
103
103
  reason_code: human-gate
104
- gate_ref: requirement-freeze
104
+ gate_ref: gate.spec-baseline-approved
105
105
  owner_or_authority: product-owner
106
- resume_condition: requirement-freeze-approved
107
- next_work_unit: api-impact-assessment
106
+ resume_condition: gate.spec-baseline-approved approved
107
+ next_work_unit: work-unit.technical-analysis
108
108
  ```
109
109
 
110
110
  ## Schema 兼容与迁移
@@ -5,6 +5,8 @@ description: Use when a YSS feature has product-design impact on a primary flow,
5
5
 
6
6
  # YSS Prototype Stage
7
7
 
8
+ 已有生命周期资产优先用 `scripts/contract view <资产> --kind <类型>` 阅读;执行任务用 `--profile task --unit <ID>`,绑定与校验明细用 `--profile full`。视图不授予执行权限,仍按本 Skill 的原始来源和批准门禁处理。类型、准备和迁移见 `docs/process/contract-reading.md`。
9
+
8
10
  把产品设计影响收敛为跨 Agent 一致的原型交付物、证据和生命周期回流合同。它不替代 `yss-product-lifecycle` 的门禁裁决,也不把原型当作生产前端代码。
9
11
 
10
12
  文档输出时按 `lifecycle-document-output` 条件调用 `i-have-adhd`,读取 `docs/process/document-writing.md`;作用域仅限当前产物,派发时传递条件及引用。
@@ -51,7 +53,7 @@ Design QA 合并 visual、layout、interaction、content、accessibility、cross
51
53
  ## 按需读取
52
54
 
53
55
  - 档位、上游融合与迁移:[prototype-profile-routing.md](references/prototype-profile-routing.md)
54
- - 渲染适配、fact pack 与命令:[product-design-adapter.md](references/product-design-adapter.md)
56
+ - 离线渲染适配与命令:[product-design-adapter.md](references/product-design-adapter.md)
55
57
  - 证据模板:`docs/design/templates/prototype-evidence-template.yaml`
56
58
  - Visual Baseline 模板与 schema:`docs/design/templates/visual-baseline-template.yaml`、`docs/design/schemas/visual-baseline.schema.json`
57
59
 
@@ -59,7 +61,7 @@ Design QA 合并 visual、layout、interaction、content、accessibility、cross
59
61
 
60
62
  - 把 H1/H2 当作低/高保真;把离线 HTML 降为静态截图,或继续要求 Provider、Node starter、预先生成图片。
61
63
  - 低保真未评审就选择技术栈;用主观评分代替确定性触发规则。
62
- - 空填 lockfile/fact pack;把自身生成图当成独立来源,或宣称已验证生产真实组件。
64
+ - 编造组件版本或构建来源;把自身生成图当成独立来源,或宣称已验证生产真实组件。
63
65
  - 重复抄写机器可采集的版本、digest、截图和 console;创建第二份状态机、QA 或 handoff 资产。
64
66
  - 把原型源码直接复制进生产,或在原型阶段调用 `yss-ui`。
65
67
 
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { createHash } from "node:crypto";
3
- import { existsSync } from "node:fs";
4
- import { mkdir, readFile, readdir, writeFile } from "node:fs/promises";
3
+ import { existsSync, readFile, readdir } from "../../../../scripts/lib/validation-phase.mjs";
4
+ import { mkdir, writeFile } from "node:fs/promises";
5
5
  import path from "node:path";
6
6
  import { pathToFileURL } from "node:url";
7
7
  import { parseDocument, stringify } from "../../../../scripts/vendor/yaml.mjs";
@@ -29,6 +29,7 @@ description: 用于按批准的 YSS 架构与持久化合同实现或重构 PO
29
29
  <a id="repository.mapping"></a>
30
30
  <!-- yss-rule {"id":"repository.mapping","when":"persistence","level":"mandatory","evidence":"code-and-verification"} -->
31
31
  - 数据合同必须显式覆盖主键、逻辑删除、审计字段、空值、枚举/值对象映射和敏感字段;动态排序、分组与过滤必须使用批准白名单和参数绑定。
32
+ - 数据合同选择 YSS 分布式主键时,记录已选 `component.distributed-id` 绑定、Segment/Snowflake 策略、实体主键类型与批量插入路径,并消费 `yss-distributed-id` 的当前平台证据;不由 Repository 自行切换算法或创建发号合同。
32
33
  <a id="repository.transaction"></a>
33
34
  <!-- yss-rule {"id":"repository.transaction","when":"persistence","level":"mandatory","evidence":"code-and-verification"} -->
34
35
  - 事务归所选 Profile 的用例边界。Repository/Gateway Adapter 不临时新增业务事务,也不把数据库异常原文或凭据暴露给上层。
@@ -5,6 +5,8 @@ description: 编排 Plan 到 Spec 入口的方案决策与业务边界、协作
5
5
 
6
6
  # YSS Stage Decision
7
7
 
8
+ 已有生命周期资产优先用 `scripts/contract view <资产> --kind <类型>` 阅读;执行任务用 `--profile task --unit <ID>`,绑定与校验明细用 `--profile full`。视图不授予执行权限,仍按本 Skill 的原始来源和批准门禁处理。类型、准备和迁移见 `docs/process/contract-reading.md`。
9
+
8
10
  `yss-stage-decision` 是由生命周期主控调度的上游决策技能,负责把需求、产品、商务输入和业务边界与规则设计结果整理成可审查、可版本化、可被下游消费的方案决策包。它不替代生命周期主控,也不生成产品代码、原型、OpenAPI 或垂直切片 Ticket。
9
11
 
10
12
  文档输出时按 `lifecycle-document-output` 条件调用 `i-have-adhd`,读取 `docs/process/document-writing.md`;作用域仅限当前产物,派发时传递条件及引用。
@@ -5,6 +5,8 @@ description: 在 YSS 技术分析阶段将批准的战略领域输入细化为
5
5
 
6
6
  # yss-tactical-design
7
7
 
8
+ 已有生命周期资产优先用 `scripts/contract view <资产> --kind <类型>` 阅读;执行任务用 `--profile task --unit <ID>`,绑定与校验明细用 `--profile full`。视图不授予执行权限,仍按本 Skill 的原始来源和批准门禁处理。类型、准备和迁移见 `docs/process/contract-reading.md`。
9
+
8
10
  本 skill 负责 DDD 战术设计,不新增生命周期主阶段,也不替代 `yss-stage-decision` 或 `yss-domain`。
9
11
 
10
12
  ## 适用边界
@@ -5,6 +5,8 @@ description: 在 YSS 技术分析中统一承接需求与战略输入,按已
5
5
 
6
6
  # YSS 技术设计
7
7
 
8
+ 已有生命周期资产优先用 `scripts/contract view <资产> --kind <类型>` 阅读;执行任务用 `--profile task --unit <ID>`,绑定与校验明细用 `--profile full`。视图不授予执行权限,仍按本 Skill 的原始来源和批准门禁处理。类型、准备和迁移见 `docs/process/contract-reading.md`。
9
+
8
10
  由 `yss-product-lifecycle` 调度,负责 `work-unit.technical-analysis` 的技术设计,不另起生命周期、不生成生产代码。生命周期维护批准和状态;`yss-implementation-contract-compiler` 消费批准且当前的设计,起草实现合同。
9
11
 
10
12
  文档输出时按 `lifecycle-document-output` 条件调用 `i-have-adhd`,读取 `docs/process/document-writing.md`;作用域仅限当前产物,派发时传递条件及引用。
@@ -1,5 +1,5 @@
1
1
  import path from 'node:path';
2
- import {readFileSync} from 'node:fs';
2
+ import {readFileSync} from '../../../../scripts/lib/validation-phase.mjs';
3
3
  import {ensure,read,safe,hash} from '../../../../scripts/lib/strategic-handoff-io.mjs';
4
4
  const beneath=(ref,scope)=>ref===scope||ref.startsWith(`${scope}/`);
5
5
  export function validateEngineeringDesign(data,{root}) {
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { readFileSync } from 'node:fs';
2
+ import { readFileSync, withValidationPhase, validationDependencies } from '../../../../scripts/lib/validation-phase.mjs';
3
3
  import { validateEngineeringDesign } from './engineering-design.mjs';
4
4
  import { createApprovedExecutionContext, assertApprovedExecutionContext } from '../../../../scripts/lib/approved-execution-context.mjs';
5
5
  import { verifyArchitectureEvidence } from '../../../../scripts/lib/backend-architecture.mjs';
@@ -42,8 +42,8 @@ function validateMvc(design) {
42
42
  if (!design.integration_catalog.length) ensure(text(design.integration_not_applicable_reason), '无外部集成必须说明原因');
43
43
  }
44
44
 
45
- export function verifyArchitecture(data, root, {execution,sliceRef}={}) {
46
- if(execution)assertApprovedExecutionContext(execution,{root,technicalDesign:data,sliceId:sliceRef});
45
+ export function verifyArchitecture(data, root, {execution,sliceRef,readOnly=false}={}) {
46
+ if(execution)assertApprovedExecutionContext(execution,{root,technicalDesign:data,sliceId:sliceRef,readOnly});
47
47
  const binding = data.architecture;
48
48
  const file = safe(root, binding.decision_ref);
49
49
  ensure(hash(readFileSync(file)) === binding.decision_digest, '架构来源摘要漂移');
@@ -63,7 +63,7 @@ export function verifyArchitecture(data, root, {execution,sliceRef}={}) {
63
63
  ensure(!['stale','blocked'].includes(record.status) && !['stale','blocked'].includes(entry.status), '工程登记已失效');
64
64
  if (entry.architecture_identity?.schema_version === 2) {
65
65
  ensure(entry.architecture_evidence?.engineering_baseline && entry.architecture_evidence?.manifest, '既有工程登记缺少原始工程证据引用');
66
- verifyArchitectureEvidence(entry.architecture_identity, { ...entry.architecture_evidence, repository_registration: { ref: binding.decision_ref, digest: binding.decision_digest } }, { root, execution });
66
+ verifyArchitectureEvidence(entry.architecture_identity, { ...entry.architecture_evidence, repository_registration: { ref: binding.decision_ref, digest: binding.decision_digest } }, { root, execution, readOnly });
67
67
  }
68
68
  }
69
69
  }
@@ -111,7 +111,7 @@ export async function validateTechnicalDesign(data, { root = process.cwd(), slic
111
111
  ensure(data.digest === technicalDigest(data), '技术设计合同摘要不匹配');
112
112
  ensure(!['stale','blocked','drift','new_impacts'].includes(data.status), '设计状态不可消费');
113
113
  if (sliceRef) ensure(data.status === 'approved', '切片只能消费 approved 设计');
114
- verifyArchitecture(data, root, {execution,sliceRef});
114
+ verifyArchitecture(data, root, {execution,sliceRef,readOnly});
115
115
  ensure(data.inputs.some(item => item.kind === 'context' && item.ref === 'CONTEXT.md') && data.inputs.some(item => item.kind === 'spec'), '共同输入缺少根 CONTEXT.md 或 Spec');
116
116
  for (const input of data.inputs) ensure(hash(readFileSync(safe(root, input.ref))) === input.digest, `输入摘要漂移: ${input.ref}`);
117
117
  for (const ref of data.evidence_refs) safe(root, ref);
@@ -135,12 +135,15 @@ export async function validateTechnicalDesign(data, { root = process.cwd(), slic
135
135
  }
136
136
 
137
137
  async function main() {
138
- const { values, positionals } = parseArgs({ allowPositionals: true, options: { root: { type: 'string', default: process.cwd() }, slice: { type: 'string' }, 'legacy-ddd': { type: 'boolean', default: false }, 'read-only': {type:'boolean',default:false}, 'work-unit': {type:'string'}, 'approved-slice': {type:'string'}, 'approved-slice-digest': {type:'string'}, 'approved-slice-approval': {type:'string'} } });
138
+ const { values, positionals } = parseArgs({ allowPositionals: true, options: { root: { type: 'string', default: process.cwd() }, slice: { type: 'string' }, 'legacy-ddd': { type: 'boolean', default: false }, 'read-only': {type:'boolean',default:false}, 'validation-dependencies': {type:'boolean',default:false}, 'work-unit': {type:'string'}, 'approved-slice': {type:'string'}, 'approved-slice-digest': {type:'string'}, 'approved-slice-approval': {type:'string'} } });
139
139
  ensure(positionals.length === 1, '用法: validate-technical-design.mjs <合同> --root <项目根> [--slice <ID>] [--legacy-ddd]');
140
140
  const approvedOptions=['approved-slice','approved-slice-digest','approved-slice-approval'];
141
141
  ensure(!approvedOptions.some(key=>values[key])||approvedOptions.every(key=>values[key]),'执行增量必须完整给出持久化 Slice、字节摘要及本地批准引用');
142
- const execution=values['approved-slice']?createApprovedExecutionContext({ref:values['approved-slice'],digest:values['approved-slice-digest'],approval_ref:values['approved-slice-approval']},{root:values.root,work_unit_id:values['work-unit']}):undefined;
142
+ const output=await withValidationPhase({root:values.root,purpose:'technical-design',slice_id:values.slice,work_unit_id:values['work-unit'],readOnly:values['read-only']},async()=>{
143
+ const execution=values['approved-slice']?createApprovedExecutionContext({ref:values['approved-slice'],digest:values['approved-slice-digest'],approval_ref:values['approved-slice-approval']},{root:values.root,work_unit_id:values['work-unit'],readOnly:values['read-only']}):undefined;
143
144
  const result = await validateTechnicalDesign(read(path.resolve(positionals[0])), { root: values.root, sliceRef: values.slice, legacyDdd: values['legacy-ddd'], readOnly:values['read-only'], execution });
144
- process.stdout.write(`${JSON.stringify(result, null, 2)}\n`);
145
+ return values['validation-dependencies']?{...result,validation_dependencies:validationDependencies()}:result;
146
+ });
147
+ process.stdout.write(`${JSON.stringify(output, null, 2)}\n`);
145
148
  }
146
149
  if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) main().catch(error => { process.stderr.write(`${JSON.stringify({ result: 'blocked', errors: [error.message] })}\n`); process.exitCode = 1; });
@@ -10,8 +10,8 @@ description: "接入或排查 YSS QueryCache、UpdateCache、ClearCache、TTL、
10
10
  ## 工作流
11
11
 
12
12
  1. 按 `yss-skill-source-index-refresh/references/source-location.md` 定位真实源码。当前工作区有 `.codegraph/` 时先用 CodeGraph;否则读取 [source-index.md](references/source-index.md) 后用符号或 Maven 模块搜索。
13
- 2. 识别使用模型:Spring Cache 单后端路由、Redis 故障降级,或 JetCache local + remote。不要混用三者的行为假设。
14
- 3. 明确缓存名、key、TTL、更新/删除路径、跨节点一致性和序列化兼容要求。
13
+ 2. 识别使用模型:Spring Cache 单后端路由、Redis 故障处理,或独立的 JetCache local + remote。`fail-fast`/`bypass`/`fallback` 是当前 Boot 3 Redis 契约;Boot 2 以其独立源码索引为准,不要混用两代或三种模型的行为假设。
14
+ 3. 明确缓存名、key、区域 TTL/容量/空值策略、更新/删除路径、跨节点一致性和序列化兼容要求。
15
15
  4. 先检查现有依赖、启动注解、配置和注解用法,再决定修改业务代码、配置还是组件。
16
16
  5. 修改后执行对应 reference 的验证;组件跨模块修改必须从父 reactor 构建,不要依赖本地旧 SNAPSHOT。
17
17
 
@@ -20,13 +20,14 @@ description: "接入或排查 YSS QueryCache、UpdateCache、ClearCache、TTL、
20
20
  - 新增查询缓存时同时覆盖更新、删除和状态变更的失效路径。
21
21
  - key 必须稳定并显式包含租户、机构、账套等隔离维度;不要依赖 DTO 的不稳定序列化结果。
22
22
  - 不要把 Redis fallback 当作正常二级缓存。Caffeine fallback 存在节点间不一致窗口。
23
- - 不要声称纯 Redis 后端会广播本地缓存失效。只有确认 JetCache 配置了 local、remote 和 broadcast channel 后才能作此判断。
23
+ - 不要声称纯 Redis 后端会广播本地缓存失效。JetCache 即使存在 broadcast channel 配置,也须验证实际 local/remote 实例和同步开关后才能作此判断。
24
24
  - 不要在没有双读、版本前缀、灰度清理或迁移窗口时修改 serializer、key prefix 或 cache name。
25
25
  - 不明确一致性要求时,不默认启用本地缓存或 fallback。
26
26
 
27
27
  ## 按场景读取
28
28
 
29
29
  - 模块、后端选择或多级缓存边界:[architecture.md](references/architecture.md)
30
+ - JetCache 包装器、`QuickConfig`、跨 JVM 失效与故障边界:[jetcache.md](references/jetcache.md)
30
31
  - 新增或修改缓存注解、SpEL、空 key、全量清理:[annotations.md](references/annotations.md)
31
32
  - 依赖、启动注解、TTL、Caffeine/Hazelcast、Bean backoff:[configuration.md](references/configuration.md)
32
33
  - Redis 单机、哨兵、集群、认证、SSL、超时、Jedis pool:[redis-topology.md](references/redis-topology.md)
@@ -38,10 +39,10 @@ description: "接入或排查 YSS QueryCache、UpdateCache、ClearCache、TTL、
38
39
  ## 工具
39
40
 
40
41
  - `scripts/inspect-cache-usage.sh <project-root>`:只读扫描消费项目;发现阻断缺陷返回 1,输入或环境错误返回 2。
41
- - `scripts/verify-cache-component.sh [--source-root PATH] [--consumer-root PATH --consumer-module MODULE]`:验证组件、真实 Redis、Java 8 字节码及可选消费模块。
42
+ - `scripts/verify-cache-component.sh --platform-line <boot2-java8|boot3-java17> [--source-root PATH] [--consumer-root PATH --consumer-module MODULE]`:从匹配的平台源码根干净构建,验证组件、可用时的真实 Redis、对应 Java 字节码及可选消费模块。
42
43
  - `scripts/check-skill-freshness.sh <boot2-java8|boot3-java17> [source-root]`:比较所选平台线的技能契约与当前组件源码;发现平台错配或漂移返回 1。
43
44
 
44
- 当组件源码变化后,用 `yss-skill-source-index-refresh` 刷新 [source-index.md](references/source-index.md),再运行 freshness 检查。不要手工修改生成索引。
45
+ 本 Skill 中新增的 `failure-mode`、区域策略和 `empty-key-eviction` 指引针对当前 Boot 3 组件;Boot 2 的精确配置与默认值须查其独立索引及源码。组件源码形成干净、固定的来源后,用 `yss-skill-source-index-refresh` 刷新所选平台的生成索引,再运行 freshness 检查。`source-index.md` 是平台选择页;不要手工修改生成索引或把 dirty 工作树的观察说成已核验事实。
45
46
 
46
47
  ## 平台与源码门禁
47
48
 
@@ -1,5 +1,7 @@
1
1
  # 注解契约
2
2
 
3
+ 以下 `empty-key-eviction` 可配置行为针对当前 Boot 3 / Java 17 组件;Boot 2 的空 key 处理以其独立源码索引和当前源码为准。
4
+
3
5
  ## 映射
4
6
 
5
7
  - `@QueryCache` -> Spring `CacheableOperation`。
@@ -28,7 +30,7 @@ public void delete(String tenantId, Long planId) { ... }
28
30
  ```
29
31
 
30
32
  - 未配置 key 时由 Spring KeyGenerator 生成;无参数方法会得到 `SimpleKey.EMPTY`。
31
- - 当前 YSS 拦截器将 `SimpleKey.EMPTY` 视为全量清理。需要单 key 清理时必须给出稳定 key。
33
+ - 当前 Boot 3 的 `yss.cache.empty-key-eviction=legacy-clear`(默认)把 `SimpleKey.EMPTY` 当作清区;`evict` 时只删该 key。迁移前核对原有无参数清理调用及实际属性,不能把默认行为说成所有配置下的不变量。
32
34
  - 全量清理优先显式写 `allEntries=true`,不要依赖偶然 key 形态。
33
35
  - 集合参数先稳定排序;null、大小写和空白必须归一化。
34
36
 
@@ -1,12 +1,14 @@
1
1
  # 架构与选择
2
2
 
3
+ 以下模型划分适用于接入决策;具体配置、默认值及跨节点行为按所选平台线的当前源码核验。本轮新增的 Redis 故障模式、区域策略和 JetCache 运行证据属于 Boot 3 当前组件。
4
+
3
5
  ## 三种模型
4
6
 
5
7
  | 模型 | 行为 | 一致性边界 |
6
8
  |---|---|---|
7
9
  | Spring Cache 后端路由 | `yss.cache.active-type` 在 Redis、Caffeine、Hazelcast 中选择一个 Provider | 同一时刻是单后端,不是多级缓存 |
8
10
  | Redis fallback | Redis 故障时可临时改用另一个 Provider | 是故障降级;Caffeine 会产生节点间不一致窗口 |
9
- | JetCache | 独立扩展,可配置 local + remote | 只有实际配置 broadcast channel 才能认为本地失效会同步 |
11
+ | JetCache | 独立扩展,可配置 local + remote | broadcast channel 配置本身不证明包装器已启用跨 JVM 本地失效同步 |
10
12
 
11
13
  ## 模块
12
14
 
@@ -22,4 +24,4 @@
22
24
  - 跨节点共享且不接受节点本地旧值:使用纯 Redis。
23
25
  - 读多写少并允许短暂节点差异:可选择 Caffeine。
24
26
  - Redis 故障期间业务可用性高于缓存一致性:评估后启用 fallback。
25
- - 需要 local + remote:先确认 JetCache 的 local、remote、序列化和广播配置,不要只看依赖名称。
27
+ - 需要 local + remote:按 [JetCache 专项参考](jetcache.md) 核对实际创建的 Cache、配置来源及首次创建参数,并用跨 JVM 测试证明同步,不要只看依赖或 `bootstrap.yml`。
@@ -13,20 +13,23 @@
13
13
 
14
14
  ## 公共属性
15
15
 
16
+ 以下示例及 `failure-mode`、区域策略、空值策略说明针对当前 Boot 3 / Java 17 组件。Boot 2 / Java 8 维护须先核对其独立源码索引与匹配源码,不套用这些新属性或默认值。
17
+
16
18
  ```yaml
17
19
  yss:
18
20
  cache:
19
21
  active-type: redis # redis | caffeine | hazelcast
20
22
  default-ttl: 1h
23
+ failure-mode: fail-fast # fail-fast | bypass | fallback;仅 active-type=redis
21
24
  redis:
22
25
  fallback-enabled: false
23
26
  fallback-type: caffeine
24
27
  clear-fallback-on-recovery: true
25
28
  ```
26
29
 
27
- - Redis 动态 cache 和 Caffeine 默认 TTL 使用 `yss.cache.default-ttl`。
28
- - `CacheKeyCode` 中声明的 TTL 覆盖默认 TTL。
29
- - Caffeine 的 `spring.cache.caffeine.spec` 可覆盖默认构建规格,修改前检查项目现有配置。
30
+ - `failure-mode` 默认 fail-fast;旧 `redis.fallback-enabled=true` 仍映射 fallback,同时配置为冲突值会拒绝启动。bypass 仅将 Redis 连接/资源故障的查询视为 miss,显式写入和失效仍报告错误;业务与序列化异常不降级。fallback 仅可选择已安装的 Caffeine,不是默认二级缓存。
31
+ - 区域 `yss.cache.regions[区域名]` 可逐字段设置 `ttl`、`caffeine-maximum-size`、`null-policy`。TTL 以区域值优先;Caffeine 用户显式过期策略、`CacheKeyCode` 与 `default-ttl` 的实际优先级按当前组件源码核对。`null-policy=cache` 必须指定正的区域 TTL;`skip` 不等于删除旧值,`reject` 的契约错误不能吞成 Redis 故障。
32
+ - Caffeine `spring.cache.caffeine.spec`、自定义 Builder/Loader 与区域覆盖的组合可能无法表达;核对当前组件的启动拒绝条件。自定义 CacheManager/Provider 时需证明区域策略真实生效,不能因配置存在就宣称 TTL、容量或空值策略已应用。
30
33
  - Hazelcast 不在 starter 生产依赖中;使用时显式引入模块并配置 `active-type=hazelcast`。
31
34
 
32
35
  ## 自定义 Bean
@@ -0,0 +1,21 @@
1
+ # JetCache 独立接入与验证
2
+
3
+ 本页记录当前 Boot 3 / Java 17 `yss-component-jetcache` 工作树的接入判断;Boot 2 的精确能力以其平台索引和匹配源码为准。JetCache 与 YSS Spring Cache 是两条独立入口,不继承 `yss.cache.active-type`、区域 TTL 或 Redis `failure-mode`。
4
+
5
+ ## 先确认实际入口
6
+
7
+ - 检查运行时上游 `CacheManager`、local/remote builder、应用自己的 JetCache 配置及实际创建的 area/name。依赖 JAR 中有 `bootstrap.yml` 不证明应用加载了它;无有效 local builder 时,LOCAL 请求可能在运行时失败。
8
+ - 组件兼容包装器的两参数 `getCache` 默认 TTL 为 5 分钟,重载接收 `Duration`;它不设置 `syncLocal`、loader 或刷新策略。包装器的类型映射也不证明 LOCAL 实际采用 Caffeine。需要这些能力时核对原生 `QuickConfig` 与上游管理器。
9
+ - 管理器按 area/name 复用已创建缓存。类型、TTL、`syncLocal` 等参数在第一次创建时确定,后续 `getOrCreateCache` 不会重建同名缓存;修改配置须使用新名称或明确的生命周期切换。
10
+
11
+ ## 跨 JVM 本地失效
12
+
13
+ 原生 `QuickConfig` 选择 `BOTH`、设置 `syncLocal(true)`,并为所有参与节点配置兼容的 `jetcache.remote.default.broadcastChannel`、编码及相同 area/name。包装器即使存在广播频道也不会自行开启 `syncLocal`;缺频道时不能据 `syncLocal(true)` 宣称已同步。
14
+
15
+ 验收时启动两个独立 JVM,在两端创建同名缓存,确认广播订阅实际建立后,从一端更新和删除并观察另一端本地值失效;同时用未同步的对照缓存确认失效范围。广播是异步通知,不承诺强一致或断连期间的持久补偿。
16
+
17
+ ## 故障与数据格式
18
+
19
+ - 读取 `CacheResult` 状态来区分未命中和故障;便利 `get`/`getValue` 可能将远端故障折叠为 `null`。REMOTE 与 BOTH 的故障结果也不同,不能套用主线 Redis 的 fail-fast/bypass/fallback。
20
+ - JetCache Java 编码保存 `CacheValueHolder`,与 Spring RedisCache 的 JDK 业务值及 RedisTemplate 的 Jackson 值不同。缓存名称、key 前缀或 serializer 迁移前,核对实际物理 key 和兼容方案,避免混写。
21
+ - 包装器不提供主线缓存的事务后提交协调。刷新须核对原生 loader 与 refresh policy 是否同时配置;本轮未验证多节点刷新去重、断连补偿或生产 SLA。
@@ -1,11 +1,13 @@
1
1
  # Redis 故障降级与恢复
2
2
 
3
+ 以下故障模式和脏 Redis 区域恢复顺序是当前 Boot 3 / Java 17 组件契约。Boot 2 / Java 8 的故障处理和恢复默认值须单独核对其索引及源码。
4
+
3
5
  ## 状态流
4
6
 
5
7
  ```text
6
8
  Redis 健康 -> 命令或健康检查失败 -> 标记不健康 -> 跳过 Redis
7
9
  -> 可选 fallback -> 周期健康检查 -> Redis 可连接
8
- -> 清理脏 Redis cache 与本地 fallback cache -> 恢复 Redis
10
+ -> 清理脏 Redis cache;按配置清理本地 fallback cache -> 恢复 Redis
9
11
  ```
10
12
 
11
13
  - fallback 默认关闭,默认目标是 Caffeine。
@@ -13,11 +15,11 @@ Redis 健康 -> 命令或健康检查失败 -> 标记不健康 -> 跳过 Redis
13
15
  - Redis 命令级连接故障也会立即报告不健康,不必等待下一轮检查。
14
16
  - 只读 fallback 不标记 Redis cache 为脏。
15
17
  - put、putIfAbsent、evict、clear、invalidate 和 valueLoader 产生的回退写入会标记为脏。
16
- - 恢复时先清理降级期间发生写操作的 Redis cache,再清理本地 fallback cache。
18
+ - 恢复时始终先清理降级期间发生写操作的 Redis cache;`clear-fallback-on-recovery=true` 时还清理本地 fallback cache。
17
19
  - Redis 失效失败时继续保持不健康状态并在后续检查重试,不能提前切回旧 Redis 数据。
18
20
 
19
21
  ## 一致性判断
20
22
 
21
23
  - Caffeine fallback 是每节点独立数据,不能保证跨节点读到相同值。
22
- - `clear-fallback-on-recovery=false` 会跳过恢复清理,可能重新暴露 Redis 旧值;除非业务明确接受,不要关闭。
24
+ - `clear-fallback-on-recovery=false` 只跳过本地备用缓存清理,不跳过脏 Redis 区域失效。Redis 失效失败时不切回;关闭本地清理仍须评估后续备用使用时的本地旧值窗口。
23
25
  - 强一致、锁、幂等状态或余额类数据不应依赖缓存 fallback 保证正确性。