create-yss-spec 3.5.2 → 3.5.3

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 (438) hide show
  1. package/package.json +1 -1
  2. package/src/template/asset-runtime.js +3 -1
  3. package/template/.agents/skills/.strategic-design-skills-manifest.json +1 -1
  4. package/template/.agents/skills/codebase-design/SKILL.md +4 -0
  5. package/template/{.codex/skills/improve-codebase-architecture/SKILL.md → .agents/skills/codebase-design/references/architecture-audit.md} +3 -9
  6. package/template/.agents/skills/frontend-commit/SKILL.md +4 -93
  7. package/template/.agents/skills/git-commit-core/SKILL.md +18 -0
  8. package/template/.agents/skills/java-backend-commit/SKILL.md +4 -96
  9. package/template/.agents/skills/llm-wiki/SKILL.md +12 -13
  10. package/template/.agents/skills/llm-wiki/assets/CLAUDE.md.template +7 -1
  11. package/template/.agents/skills/llm-wiki/references/compile.md +21 -114
  12. package/template/.agents/skills/llm-wiki/references/ingest.md +8 -33
  13. package/template/.agents/skills/llm-wiki/references/lint.md +9 -46
  14. package/template/.agents/skills/llm-wiki/references/query.md +9 -18
  15. package/template/.agents/skills/llm-wiki/references/schema.md +56 -29
  16. package/template/.agents/skills/llm-wiki/references/transactions.md +48 -0
  17. package/template/.agents/skills/llm-wiki/references/writing.md +4 -4
  18. package/template/.agents/skills/llm-wiki/scripts/advise.mjs +46 -58
  19. package/template/.agents/skills/llm-wiki/scripts/advise.test.mjs +11 -16
  20. package/template/.agents/skills/llm-wiki/scripts/core.mjs +262 -0
  21. package/template/.agents/skills/llm-wiki/scripts/extract.mjs +35 -18
  22. package/template/.agents/skills/llm-wiki/scripts/extract.test.mjs +5 -8
  23. package/template/.agents/skills/llm-wiki/scripts/feedback.mjs +51 -0
  24. package/template/.agents/skills/llm-wiki/scripts/inventory.mjs +43 -171
  25. package/template/.agents/skills/llm-wiki/scripts/inventory.test.mjs +25 -18
  26. package/template/.agents/skills/llm-wiki/scripts/lint-wikilinks.mjs +69 -92
  27. package/template/.agents/skills/llm-wiki/scripts/lint-wikilinks.test.mjs +25 -37
  28. package/template/.agents/skills/llm-wiki/scripts/migrate.mjs +51 -0
  29. package/template/.agents/skills/llm-wiki/scripts/query.mjs +149 -0
  30. package/template/.agents/skills/llm-wiki/scripts/regressions.test.mjs +101 -0
  31. package/template/.agents/skills/llm-wiki/scripts/sources.mjs +166 -0
  32. package/template/.agents/skills/llm-wiki/scripts/transaction.mjs +384 -0
  33. package/template/.agents/skills/llm-wiki/scripts/v2.test.mjs +354 -0
  34. package/template/.agents/skills/prototype/LOGIC.md +1 -1
  35. package/template/.agents/skills/prototype/SKILL.md +5 -19
  36. package/template/.agents/skills/setup-matt-pocock-skills/SKILL.md +3 -3
  37. package/template/.agents/skills/yss-implementation-contract-compiler/SKILL.md +2 -0
  38. package/template/.agents/skills/yss-implementation-contract-compiler/references/boundaries.md +2 -3
  39. package/template/.agents/skills/yss-implementation-contract-compiler/references/yss-skill-execution-result.md +14 -0
  40. package/template/.agents/skills/yss-product-lifecycle/SKILL.md +8 -8
  41. package/template/.agents/skills/yss-product-lifecycle/references/external-input-questionnaire.md +19 -0
  42. package/template/.agents/skills/yss-product-lifecycle/references/matt-yss-adapter.md +5 -5
  43. package/template/.agents/skills/yss-product-lifecycle/references/orchestration-contract.yaml +20 -4
  44. package/template/.agents/skills/yss-product-lifecycle/references/orchestration.md +2 -2
  45. package/template/.agents/skills/yss-product-lifecycle/references/plan-requirements.md +10 -0
  46. package/template/.agents/skills/yss-product-lifecycle/references/state-model.md +1 -1
  47. package/template/.agents/skills/yss-research/SKILL.md +4 -0
  48. package/template/.codex/skills/codebase-design/SKILL.md +4 -0
  49. package/template/{.pi/skills/improve-codebase-architecture/SKILL.md → .codex/skills/codebase-design/references/architecture-audit.md} +3 -9
  50. package/template/.codex/skills/frontend-commit/SKILL.md +4 -93
  51. package/template/.codex/skills/git-commit-core/SKILL.md +18 -0
  52. package/template/.codex/skills/java-backend-commit/SKILL.md +4 -96
  53. package/template/.codex/skills/llm-wiki/SKILL.md +12 -13
  54. package/template/.codex/skills/llm-wiki/assets/CLAUDE.md.template +7 -1
  55. package/template/.codex/skills/llm-wiki/references/compile.md +21 -114
  56. package/template/.codex/skills/llm-wiki/references/ingest.md +8 -33
  57. package/template/.codex/skills/llm-wiki/references/lint.md +9 -46
  58. package/template/.codex/skills/llm-wiki/references/query.md +9 -18
  59. package/template/.codex/skills/llm-wiki/references/schema.md +56 -29
  60. package/template/.codex/skills/llm-wiki/references/transactions.md +48 -0
  61. package/template/.codex/skills/llm-wiki/references/writing.md +4 -4
  62. package/template/.codex/skills/llm-wiki/scripts/advise.mjs +46 -58
  63. package/template/.codex/skills/llm-wiki/scripts/advise.test.mjs +11 -16
  64. package/template/.codex/skills/llm-wiki/scripts/core.mjs +262 -0
  65. package/template/.codex/skills/llm-wiki/scripts/extract.mjs +35 -18
  66. package/template/.codex/skills/llm-wiki/scripts/extract.test.mjs +5 -8
  67. package/template/.codex/skills/llm-wiki/scripts/feedback.mjs +51 -0
  68. package/template/.codex/skills/llm-wiki/scripts/inventory.mjs +43 -171
  69. package/template/.codex/skills/llm-wiki/scripts/inventory.test.mjs +25 -18
  70. package/template/.codex/skills/llm-wiki/scripts/lint-wikilinks.mjs +69 -92
  71. package/template/.codex/skills/llm-wiki/scripts/lint-wikilinks.test.mjs +25 -37
  72. package/template/.codex/skills/llm-wiki/scripts/migrate.mjs +51 -0
  73. package/template/.codex/skills/llm-wiki/scripts/query.mjs +149 -0
  74. package/template/.codex/skills/llm-wiki/scripts/regressions.test.mjs +101 -0
  75. package/template/.codex/skills/llm-wiki/scripts/sources.mjs +166 -0
  76. package/template/.codex/skills/llm-wiki/scripts/transaction.mjs +384 -0
  77. package/template/.codex/skills/llm-wiki/scripts/v2.test.mjs +354 -0
  78. package/template/.codex/skills/prototype/LOGIC.md +1 -1
  79. package/template/.codex/skills/prototype/SKILL.md +5 -19
  80. package/template/.codex/skills/setup-matt-pocock-skills/SKILL.md +3 -3
  81. package/template/.codex/skills/yss-implementation-contract-compiler/SKILL.md +2 -0
  82. package/template/.codex/skills/yss-implementation-contract-compiler/references/boundaries.md +2 -3
  83. package/template/.codex/skills/yss-implementation-contract-compiler/references/yss-skill-execution-result.md +14 -0
  84. package/template/.codex/skills/yss-product-lifecycle/SKILL.md +8 -8
  85. package/template/.codex/skills/yss-product-lifecycle/references/external-input-questionnaire.md +19 -0
  86. package/template/.codex/skills/yss-product-lifecycle/references/matt-yss-adapter.md +5 -5
  87. package/template/.codex/skills/yss-product-lifecycle/references/orchestration-contract.yaml +20 -4
  88. package/template/.codex/skills/yss-product-lifecycle/references/orchestration.md +2 -2
  89. package/template/.codex/skills/yss-product-lifecycle/references/plan-requirements.md +10 -0
  90. package/template/.codex/skills/yss-product-lifecycle/references/state-model.md +1 -1
  91. package/template/.codex/skills/yss-research/SKILL.md +4 -0
  92. package/template/.cursor/skills/codebase-design/SKILL.md +4 -0
  93. package/template/.cursor/skills/{improve-codebase-architecture/SKILL.md → codebase-design/references/architecture-audit.md} +3 -9
  94. package/template/.cursor/skills/frontend-commit/SKILL.md +4 -93
  95. package/template/.cursor/skills/git-commit-core/SKILL.md +18 -0
  96. package/template/.cursor/skills/java-backend-commit/SKILL.md +4 -96
  97. package/template/.cursor/skills/llm-wiki/SKILL.md +12 -13
  98. package/template/.cursor/skills/llm-wiki/assets/CLAUDE.md.template +7 -1
  99. package/template/.cursor/skills/llm-wiki/references/compile.md +21 -114
  100. package/template/.cursor/skills/llm-wiki/references/ingest.md +8 -33
  101. package/template/.cursor/skills/llm-wiki/references/lint.md +9 -46
  102. package/template/.cursor/skills/llm-wiki/references/query.md +9 -18
  103. package/template/.cursor/skills/llm-wiki/references/schema.md +56 -29
  104. package/template/.cursor/skills/llm-wiki/references/transactions.md +48 -0
  105. package/template/.cursor/skills/llm-wiki/references/writing.md +4 -4
  106. package/template/.cursor/skills/llm-wiki/scripts/advise.mjs +46 -58
  107. package/template/.cursor/skills/llm-wiki/scripts/advise.test.mjs +11 -16
  108. package/template/.cursor/skills/llm-wiki/scripts/core.mjs +262 -0
  109. package/template/.cursor/skills/llm-wiki/scripts/extract.mjs +35 -18
  110. package/template/.cursor/skills/llm-wiki/scripts/extract.test.mjs +5 -8
  111. package/template/.cursor/skills/llm-wiki/scripts/feedback.mjs +51 -0
  112. package/template/.cursor/skills/llm-wiki/scripts/inventory.mjs +43 -171
  113. package/template/.cursor/skills/llm-wiki/scripts/inventory.test.mjs +25 -18
  114. package/template/.cursor/skills/llm-wiki/scripts/lint-wikilinks.mjs +69 -92
  115. package/template/.cursor/skills/llm-wiki/scripts/lint-wikilinks.test.mjs +25 -37
  116. package/template/.cursor/skills/llm-wiki/scripts/migrate.mjs +51 -0
  117. package/template/.cursor/skills/llm-wiki/scripts/query.mjs +149 -0
  118. package/template/.cursor/skills/llm-wiki/scripts/regressions.test.mjs +101 -0
  119. package/template/.cursor/skills/llm-wiki/scripts/sources.mjs +166 -0
  120. package/template/.cursor/skills/llm-wiki/scripts/transaction.mjs +384 -0
  121. package/template/.cursor/skills/llm-wiki/scripts/v2.test.mjs +354 -0
  122. package/template/.cursor/skills/prototype/LOGIC.md +1 -1
  123. package/template/.cursor/skills/prototype/SKILL.md +5 -19
  124. package/template/.cursor/skills/setup-matt-pocock-skills/SKILL.md +3 -3
  125. package/template/.cursor/skills/yss-implementation-contract-compiler/SKILL.md +2 -0
  126. package/template/.cursor/skills/yss-implementation-contract-compiler/references/boundaries.md +2 -3
  127. package/template/.cursor/skills/yss-implementation-contract-compiler/references/yss-skill-execution-result.md +14 -0
  128. package/template/.cursor/skills/yss-product-lifecycle/SKILL.md +8 -8
  129. package/template/.cursor/skills/yss-product-lifecycle/references/external-input-questionnaire.md +19 -0
  130. package/template/.cursor/skills/yss-product-lifecycle/references/matt-yss-adapter.md +5 -5
  131. package/template/.cursor/skills/yss-product-lifecycle/references/orchestration-contract.yaml +20 -4
  132. package/template/.cursor/skills/yss-product-lifecycle/references/orchestration.md +2 -2
  133. package/template/.cursor/skills/yss-product-lifecycle/references/plan-requirements.md +10 -0
  134. package/template/.cursor/skills/yss-product-lifecycle/references/state-model.md +1 -1
  135. package/template/.cursor/skills/yss-research/SKILL.md +4 -0
  136. package/template/.pi/skills/codebase-design/SKILL.md +4 -0
  137. package/template/{.agents/skills/improve-codebase-architecture/SKILL.md → .pi/skills/codebase-design/references/architecture-audit.md} +3 -9
  138. package/template/.pi/skills/frontend-commit/SKILL.md +4 -93
  139. package/template/.pi/skills/git-commit-core/SKILL.md +18 -0
  140. package/template/.pi/skills/java-backend-commit/SKILL.md +4 -96
  141. package/template/.pi/skills/llm-wiki/SKILL.md +12 -13
  142. package/template/.pi/skills/llm-wiki/assets/CLAUDE.md.template +7 -1
  143. package/template/.pi/skills/llm-wiki/references/compile.md +21 -114
  144. package/template/.pi/skills/llm-wiki/references/ingest.md +8 -33
  145. package/template/.pi/skills/llm-wiki/references/lint.md +9 -46
  146. package/template/.pi/skills/llm-wiki/references/query.md +9 -18
  147. package/template/.pi/skills/llm-wiki/references/schema.md +56 -29
  148. package/template/.pi/skills/llm-wiki/references/transactions.md +48 -0
  149. package/template/.pi/skills/llm-wiki/references/writing.md +4 -4
  150. package/template/.pi/skills/llm-wiki/scripts/advise.mjs +46 -58
  151. package/template/.pi/skills/llm-wiki/scripts/advise.test.mjs +11 -16
  152. package/template/.pi/skills/llm-wiki/scripts/core.mjs +262 -0
  153. package/template/.pi/skills/llm-wiki/scripts/extract.mjs +35 -18
  154. package/template/.pi/skills/llm-wiki/scripts/extract.test.mjs +5 -8
  155. package/template/.pi/skills/llm-wiki/scripts/feedback.mjs +51 -0
  156. package/template/.pi/skills/llm-wiki/scripts/inventory.mjs +43 -171
  157. package/template/.pi/skills/llm-wiki/scripts/inventory.test.mjs +25 -18
  158. package/template/.pi/skills/llm-wiki/scripts/lint-wikilinks.mjs +69 -92
  159. package/template/.pi/skills/llm-wiki/scripts/lint-wikilinks.test.mjs +25 -37
  160. package/template/.pi/skills/llm-wiki/scripts/migrate.mjs +51 -0
  161. package/template/.pi/skills/llm-wiki/scripts/query.mjs +149 -0
  162. package/template/.pi/skills/llm-wiki/scripts/regressions.test.mjs +101 -0
  163. package/template/.pi/skills/llm-wiki/scripts/sources.mjs +166 -0
  164. package/template/.pi/skills/llm-wiki/scripts/transaction.mjs +384 -0
  165. package/template/.pi/skills/llm-wiki/scripts/v2.test.mjs +354 -0
  166. package/template/.pi/skills/prototype/LOGIC.md +1 -1
  167. package/template/.pi/skills/prototype/SKILL.md +5 -19
  168. package/template/.pi/skills/setup-matt-pocock-skills/SKILL.md +3 -3
  169. package/template/.pi/skills/yss-implementation-contract-compiler/SKILL.md +2 -0
  170. package/template/.pi/skills/yss-implementation-contract-compiler/references/boundaries.md +2 -3
  171. package/template/.pi/skills/yss-implementation-contract-compiler/references/yss-skill-execution-result.md +14 -0
  172. package/template/.pi/skills/yss-product-lifecycle/SKILL.md +8 -8
  173. package/template/.pi/skills/yss-product-lifecycle/references/external-input-questionnaire.md +19 -0
  174. package/template/.pi/skills/yss-product-lifecycle/references/matt-yss-adapter.md +5 -5
  175. package/template/.pi/skills/yss-product-lifecycle/references/orchestration-contract.yaml +20 -4
  176. package/template/.pi/skills/yss-product-lifecycle/references/orchestration.md +2 -2
  177. package/template/.pi/skills/yss-product-lifecycle/references/plan-requirements.md +10 -0
  178. package/template/.pi/skills/yss-product-lifecycle/references/state-model.md +1 -1
  179. package/template/.pi/skills/yss-research/SKILL.md +4 -0
  180. package/template/.template-spec/agents/README.md +1 -1
  181. package/template/.template-spec/agents/digital-human-roles.yaml +1 -1
  182. package/template/.template-spec/agents/skill-migrations.md +15 -0
  183. package/template/.template-spec/agents/yss-skill-registry.yaml +10 -29
  184. package/template/.template-spec/architecture/README.md +3 -34
  185. package/template/.template-spec/plan/templates/competitive-analysis-template.md +2 -2
  186. package/template/.template-spec/process/contract-reading.md +24 -0
  187. package/template/.template-spec/process/lifecycle-registry-baseline.json +3 -1
  188. package/template/.template-spec/process/lifecycle-registry.yaml +6 -0
  189. package/template/.template-spec/process/research-completion.md +23 -0
  190. package/template/.template-spec/process/schemas/digital-human-task-package.schema.json +202 -12
  191. package/template/.template-spec/process/schemas/frontend-implementation-evidence.schema.json +7 -15
  192. package/template/.template-spec/process/subagent-collaboration.md +8 -0
  193. package/template/.template-spec/process/templates/frontend-implementation-verification-template.yaml +15 -1
  194. package/template/AGENTS.md +1 -1
  195. package/template/CONTEXT.md +5 -1
  196. package/template/README.md +12 -24
  197. package/template/scripts/contract +5 -5
  198. package/template/scripts/lib/contract-views.mjs +57 -2
  199. package/template/scripts/lib/execution-evidence.mjs +51 -0
  200. package/template/scripts/lib/harness-execution-scope.mjs +1 -1
  201. package/template/scripts/lib/implementation-contract-compiler.mjs +2 -0
  202. package/template/scripts/lib/lifecycle-context-query.mjs +15 -3
  203. package/template/scripts/lib/lifecycle-status.mjs +32 -6
  204. package/template/scripts/lib/lifecycle-transition.mjs +19 -1
  205. package/template/scripts/lib/maintenance-research.mjs +63 -0
  206. package/template/scripts/lib/read-only-intake.mjs +132 -0
  207. package/template/scripts/lib/skill-registry.mjs +2 -1
  208. package/template/scripts/lib/skill-supply-chain.mjs +4 -0
  209. package/template/scripts/lib/slice-task-package.mjs +1 -1
  210. package/template/scripts/lib/task-package.mjs +9 -2
  211. package/template/scripts/lifecycle-status +2 -2
  212. package/template/scripts/prepare-read-only-intake +16 -0
  213. package/template/scripts/run-read-only-intake +14 -0
  214. package/template/scripts/verify-digital-human-task-package +2 -2
  215. package/template/scripts/verify-frontend-implementation-evidence +24 -1
  216. package/template/scripts/verify-maintenance-research +13 -0
  217. package/template/skills-lock.json +19 -76
  218. package/template.manifest.json +118 -29
  219. package/template.snapshot.json +5 -6
  220. package/template/.agents/skills/grill-with-docs/SKILL.md +0 -20
  221. package/template/.agents/skills/grill-with-docs/agents/openai.yaml +0 -5
  222. package/template/.agents/skills/improve-codebase-architecture/agents/openai.yaml +0 -5
  223. package/template/.agents/skills/prototype/UI.md +0 -112
  224. package/template/.agents/skills/setup-matt-pocock-skills/domain.md +0 -37
  225. package/template/.agents/skills/to-questionnaire/SKILL.md +0 -55
  226. package/template/.agents/skills/to-questionnaire/agents/openai.yaml +0 -5
  227. package/template/.agents/skills/wait-what/SKILL.md +0 -7
  228. package/template/.agents/skills/wait-what/agents/openai.yaml +0 -5
  229. package/template/.codex/skills/data-analytics/.app.json +0 -84
  230. package/template/.codex/skills/data-analytics/.codex-plugin/plugin.json +0 -66
  231. package/template/.codex/skills/data-analytics/.mcp.json +0 -30
  232. package/template/.codex/skills/data-analytics/AGENTS.md +0 -20
  233. package/template/.codex/skills/data-analytics/DEPENDENCIES.MD +0 -27
  234. package/template/.codex/skills/data-analytics/README.md +0 -60
  235. package/template/.codex/skills/data-analytics/__yss_dotfile__.gitignore +0 -2
  236. package/template/.codex/skills/data-analytics/assets/datascience-artifact-widget.html +0 -16
  237. package/template/.codex/skills/data-analytics/assets/datascience-artifact-widget.html.gz.b64.part001 +0 -1
  238. package/template/.codex/skills/data-analytics/assets/datascience-artifact-widget.html.gz.b64.part002 +0 -1
  239. package/template/.codex/skills/data-analytics/assets/datascience-artifact-widget.html.gz.b64.part003 +0 -1
  240. package/template/.codex/skills/data-analytics/assets/datascience-artifact-widget.html.gz.b64.part004 +0 -1
  241. package/template/.codex/skills/data-analytics/assets/datascience-artifact-widget.html.gz.b64.part005 +0 -1
  242. package/template/.codex/skills/data-analytics/assets/datascience-artifact-widget.html.gz.b64.part006 +0 -1
  243. package/template/.codex/skills/data-analytics/assets/datascience-chart-widget.html +0 -16
  244. package/template/.codex/skills/data-analytics/assets/datascience-chart-widget.html.gz.b64.part001 +0 -1
  245. package/template/.codex/skills/data-analytics/assets/datascience-chart-widget.html.gz.b64.part002 +0 -1
  246. package/template/.codex/skills/data-analytics/assets/datascience-chart-widget.html.gz.b64.part003 +0 -1
  247. package/template/.codex/skills/data-analytics/assets/datascience-chart-widget.html.gz.b64.part004 +0 -1
  248. package/template/.codex/skills/data-analytics/assets/datascience-chart-widget.html.gz.b64.part005 +0 -1
  249. package/template/.codex/skills/data-analytics/assets/datascience-chart-widget.html.gz.b64.part006 +0 -1
  250. package/template/.codex/skills/data-analytics/assets/datascience-chart-widget.html.gz.b64.part007 +0 -1
  251. package/template/.codex/skills/data-analytics/assets/datascience-small.svg +0 -5
  252. package/template/.codex/skills/data-analytics/assets/datascience-table-widget.html +0 -16
  253. package/template/.codex/skills/data-analytics/assets/datascience-table-widget.html.gz.b64.part001 +0 -1
  254. package/template/.codex/skills/data-analytics/assets/datascience-table-widget.html.gz.b64.part002 +0 -1
  255. package/template/.codex/skills/data-analytics/assets/datascience-table-widget.html.gz.b64.part003 +0 -1
  256. package/template/.codex/skills/data-analytics/assets/datascience-table-widget.html.gz.b64.part004 +0 -1
  257. package/template/.codex/skills/data-analytics/assets/datascience.png +0 -0
  258. package/template/.codex/skills/data-analytics/assets/datascience.svg +0 -10
  259. package/template/.codex/skills/data-analytics/mcp/server.cjs +0 -2964
  260. package/template/.codex/skills/data-analytics/package-lock.json +0 -3048
  261. package/template/.codex/skills/data-analytics/package.json +0 -43
  262. package/template/.codex/skills/data-analytics/scripts/normalize-widget-assets.mjs +0 -75
  263. package/template/.codex/skills/data-analytics/skills/analyze-data-quality/SKILL.md +0 -137
  264. package/template/.codex/skills/data-analytics/skills/analyze-data-quality/agents/openai.yaml +0 -6
  265. package/template/.codex/skills/data-analytics/skills/analyze-data-quality/references/quality-checks.md +0 -29
  266. package/template/.codex/skills/data-analytics/skills/build-dashboard/SKILL.md +0 -148
  267. package/template/.codex/skills/data-analytics/skills/build-dashboard/agents/openai.yaml +0 -6
  268. package/template/.codex/skills/data-analytics/skills/build-dashboard/specifications/bi-platform-dashboard.md +0 -18
  269. package/template/.codex/skills/data-analytics/skills/build-dashboard/specifications/html-dashboard.md +0 -24
  270. package/template/.codex/skills/data-analytics/skills/build-dashboard/specifications/mcp-artifact-dashboard.md +0 -71
  271. package/template/.codex/skills/data-analytics/skills/build-dashboard/specifications/streamlit-dashboard.md +0 -85
  272. package/template/.codex/skills/data-analytics/skills/build-report/SKILL.md +0 -207
  273. package/template/.codex/skills/data-analytics/skills/build-report/agents/openai.yaml +0 -6
  274. package/template/.codex/skills/data-analytics/skills/build-report/assets/executive-report-shell.html +0 -70
  275. package/template/.codex/skills/data-analytics/skills/build-report/assets/technical-report-shell.html +0 -66
  276. package/template/.codex/skills/data-analytics/skills/build-report/report-to-google-doc/SKILL.md +0 -108
  277. package/template/.codex/skills/data-analytics/skills/build-report/report-to-google-doc/agents/openai.yaml +0 -6
  278. package/template/.codex/skills/data-analytics/skills/build-report/report-to-google-doc/scripts/report_to_google_doc/__init__.py +0 -1
  279. package/template/.codex/skills/data-analytics/skills/build-report/report-to-google-doc/scripts/report_to_google_doc/cli.py +0 -52
  280. package/template/.codex/skills/data-analytics/skills/build-report/report-to-google-doc/scripts/report_to_google_doc/constants.py +0 -61
  281. package/template/.codex/skills/data-analytics/skills/build-report/report-to-google-doc/scripts/report_to_google_doc/docx_writer.py +0 -362
  282. package/template/.codex/skills/data-analytics/skills/build-report/report-to-google-doc/scripts/report_to_google_doc/html_parser.py +0 -829
  283. package/template/.codex/skills/data-analytics/skills/build-report/report-to-google-doc/scripts/report_to_google_doc/model.py +0 -30
  284. package/template/.codex/skills/data-analytics/skills/build-report/report-to-google-doc/scripts/report_to_google_doc/plan.py +0 -127
  285. package/template/.codex/skills/data-analytics/skills/build-report/report-to-google-doc/scripts/report_to_google_doc/quality.py +0 -374
  286. package/template/.codex/skills/data-analytics/skills/build-report/report-to-google-doc/scripts/report_to_google_doc/rendering.py +0 -613
  287. package/template/.codex/skills/data-analytics/skills/build-report/report-to-google-doc/scripts/report_to_google_doc/table_utils.py +0 -54
  288. package/template/.codex/skills/data-analytics/skills/build-report/report-to-google-doc/scripts/report_to_google_doc/utils.py +0 -16
  289. package/template/.codex/skills/data-analytics/skills/build-report/report-to-google-doc/scripts/report_to_google_doc_plan.py +0 -9
  290. package/template/.codex/skills/data-analytics/skills/build-report/report-to-google-doc/tests/test_delivery_plan.py +0 -45
  291. package/template/.codex/skills/data-analytics/skills/build-report/report-to-google-slides/SKILL.md +0 -77
  292. package/template/.codex/skills/data-analytics/skills/build-report/report-to-google-slides/agents/openai.yaml +0 -6
  293. package/template/.codex/skills/data-analytics/skills/build-report/report-to-google-slides/scripts/report_to_google_slides.py +0 -2379
  294. package/template/.codex/skills/data-analytics/skills/build-report/report-to-pdf/SKILL.md +0 -88
  295. package/template/.codex/skills/data-analytics/skills/build-report/report-to-pdf/agents/openai.yaml +0 -6
  296. package/template/.codex/skills/data-analytics/skills/build-report/specifications/executive-report.md +0 -97
  297. package/template/.codex/skills/data-analytics/skills/build-report/specifications/mcp-app-report.md +0 -59
  298. package/template/.codex/skills/data-analytics/skills/build-report/specifications/technical-report.md +0 -75
  299. package/template/.codex/skills/data-analytics/skills/design-kpis/SKILL.md +0 -103
  300. package/template/.codex/skills/data-analytics/skills/design-kpis/agents/openai.yaml +0 -6
  301. package/template/.codex/skills/data-analytics/skills/gather-business-context/SKILL.md +0 -68
  302. package/template/.codex/skills/data-analytics/skills/gather-business-context/agents/openai.yaml +0 -6
  303. package/template/.codex/skills/data-analytics/skills/index/SKILL.md +0 -251
  304. package/template/.codex/skills/data-analytics/skills/index/agents/openai.yaml +0 -6
  305. package/template/.codex/skills/data-analytics/skills/jupyter-notebooks/SKILL.md +0 -131
  306. package/template/.codex/skills/data-analytics/skills/jupyter-notebooks/agents/openai.yaml +0 -6
  307. package/template/.codex/skills/data-analytics/skills/kpi-reporting/SKILL.md +0 -141
  308. package/template/.codex/skills/data-analytics/skills/kpi-reporting/agents/openai.yaml +0 -6
  309. package/template/.codex/skills/data-analytics/skills/kpi-reporting/references/report-templates.md +0 -32
  310. package/template/.codex/skills/data-analytics/skills/market-sizing/SKILL.md +0 -106
  311. package/template/.codex/skills/data-analytics/skills/market-sizing/agents/openai.yaml +0 -6
  312. package/template/.codex/skills/data-analytics/skills/metric-diagnostics/SKILL.md +0 -130
  313. package/template/.codex/skills/data-analytics/skills/metric-diagnostics/agents/openai.yaml +0 -6
  314. package/template/.codex/skills/data-analytics/skills/product-business-analysis/SKILL.md +0 -141
  315. package/template/.codex/skills/data-analytics/skills/product-business-analysis/agents/openai.yaml +0 -6
  316. package/template/.codex/skills/data-analytics/skills/spreadsheets/SKILL.md +0 -178
  317. package/template/.codex/skills/data-analytics/skills/spreadsheets/agents/openai.yaml +0 -9
  318. package/template/.codex/skills/data-analytics/skills/spreadsheets/assets/file-spreadsheet.png +0 -0
  319. package/template/.codex/skills/data-analytics/skills/spreadsheets/charts.md +0 -31
  320. package/template/.codex/skills/data-analytics/skills/spreadsheets/references/artifact_tool_api.md +0 -466
  321. package/template/.codex/skills/data-analytics/skills/spreadsheets/style_guidelines.md +0 -99
  322. package/template/.codex/skills/data-analytics/skills/user-context/SKILL.md +0 -197
  323. package/template/.codex/skills/data-analytics/skills/user-context/agents/openai.yaml +0 -6
  324. package/template/.codex/skills/data-analytics/skills/user-context/plugin-author-config/automation-config.md +0 -26
  325. package/template/.codex/skills/data-analytics/skills/user-context/plugin-author-config/source-category-config.json +0 -51
  326. package/template/.codex/skills/data-analytics/skills/user-context/plugin-author-config/user-context-config.md +0 -66
  327. package/template/.codex/skills/data-analytics/skills/user-context/references/automation.md +0 -69
  328. package/template/.codex/skills/data-analytics/skills/user-context/references/onboarding-examples.md +0 -204
  329. package/template/.codex/skills/data-analytics/skills/user-context/references/onboarding-state-template.json +0 -87
  330. package/template/.codex/skills/data-analytics/skills/user-context/references/onboarding.md +0 -497
  331. package/template/.codex/skills/data-analytics/skills/user-context/references/semantic-layer/connector-playbook.md +0 -74
  332. package/template/.codex/skills/data-analytics/skills/user-context/references/semantic-layer/setup.md +0 -65
  333. package/template/.codex/skills/data-analytics/skills/user-context/references/semantic-layer/skill-template.md +0 -160
  334. package/template/.codex/skills/data-analytics/skills/user-context/references/semantic-layer/source-intake.md +0 -75
  335. package/template/.codex/skills/data-analytics/skills/user-context/references/semantic-layer/weekly-polling-automation.md +0 -96
  336. package/template/.codex/skills/data-analytics/skills/user-context/references/source-category-runtime.md +0 -263
  337. package/template/.codex/skills/data-analytics/skills/user-context/scripts/data_analytics_preflight.py +0 -1462
  338. package/template/.codex/skills/data-analytics/skills/user-context/scripts/init_user_context_state.py +0 -128
  339. package/template/.codex/skills/data-analytics/skills/user-context/scripts/reset_user_context_state.py +0 -101
  340. package/template/.codex/skills/data-analytics/skills/user-context/scripts/validate_user_context_preflight.py +0 -499
  341. package/template/.codex/skills/data-analytics/skills/user-context/tests/test_state_helpers.py +0 -978
  342. package/template/.codex/skills/data-analytics/skills/validate-data/SKILL.md +0 -126
  343. package/template/.codex/skills/data-analytics/skills/validate-data/agents/openai.yaml +0 -6
  344. package/template/.codex/skills/data-analytics/skills/validate-data/references/validation-methods.md +0 -70
  345. package/template/.codex/skills/data-analytics/skills/visualize-data/SKILL.md +0 -157
  346. package/template/.codex/skills/data-analytics/skills/visualize-data/agents/openai.yaml +0 -6
  347. package/template/.codex/skills/data-analytics/skills/visualize-data/references/seaborn-templates.md +0 -774
  348. package/template/.codex/skills/data-analytics/src/DESIGN.md +0 -222
  349. package/template/.codex/skills/data-analytics/src/analytics-app/App.tsx +0 -3666
  350. package/template/.codex/skills/data-analytics/src/analytics-app/analytics-layout.test.mjs +0 -136
  351. package/template/.codex/skills/data-analytics/src/analytics-app/charting/ChartFrame.tsx +0 -54
  352. package/template/.codex/skills/data-analytics/src/analytics-app/charting/ChartLegend.tsx +0 -96
  353. package/template/.codex/skills/data-analytics/src/analytics-app/charting/ChartRenderer.tsx +0 -1647
  354. package/template/.codex/skills/data-analytics/src/analytics-app/charting/ChartTooltip.tsx +0 -245
  355. package/template/.codex/skills/data-analytics/src/analytics-app/charting/chart-app-helpers.tsx +0 -462
  356. package/template/.codex/skills/data-analytics/src/analytics-app/charting/chart-capabilities.ts +0 -107
  357. package/template/.codex/skills/data-analytics/src/analytics-app/charting/chart-compatibility.ts +0 -164
  358. package/template/.codex/skills/data-analytics/src/analytics-app/charting/chart-contract.ts +0 -192
  359. package/template/.codex/skills/data-analytics/src/analytics-app/charting/chart-theme.ts +0 -203
  360. package/template/.codex/skills/data-analytics/src/analytics-app/charting/chart-tokens.css +0 -619
  361. package/template/.codex/skills/data-analytics/src/analytics-app/charting/chart-transforms.ts +0 -402
  362. package/template/.codex/skills/data-analytics/src/analytics-app/fonts/SystemSansVariableVF.woff2 +0 -0
  363. package/template/.codex/skills/data-analytics/src/analytics-app/imageExport.ts +0 -370
  364. package/template/.codex/skills/data-analytics/src/analytics-app/layout/AnalyticsLayoutCanvas.tsx +0 -536
  365. package/template/.codex/skills/data-analytics/src/analytics-app/layout/RichMarkdown.tsx +0 -681
  366. package/template/.codex/skills/data-analytics/src/analytics-app/layout/analyticsLayoutCore.ts +0 -164
  367. package/template/.codex/skills/data-analytics/src/analytics-app/main.tsx +0 -21
  368. package/template/.codex/skills/data-analytics/src/analytics-app/scripts/chart_contract.py +0 -472
  369. package/template/.codex/skills/data-analytics/src/analytics-app/scripts/check_analytics_app_runtime_links.py +0 -75
  370. package/template/.codex/skills/data-analytics/src/analytics-app/scripts/design_contract.py +0 -142
  371. package/template/.codex/skills/data-analytics/src/analytics-app/scripts/package_utils.py +0 -142
  372. package/template/.codex/skills/data-analytics/src/analytics-app/scripts/tests/test_package_utils.py +0 -377
  373. package/template/.codex/skills/data-analytics/src/analytics-app/styles.css +0 -3468
  374. package/template/.codex/skills/data-analytics/src/analytics-app/tables/DataTable.d.ts +0 -44
  375. package/template/.codex/skills/data-analytics/src/analytics-app/tables/DataTable.jsx +0 -639
  376. package/template/.codex/skills/data-analytics/src/analytics-app/tables/data-table.css +0 -327
  377. package/template/.codex/skills/data-analytics/src/analytics-app/tokens.css +0 -225
  378. package/template/.codex/skills/data-analytics/src/analytics-app/types.ts +0 -204
  379. package/template/.codex/skills/data-analytics/src/analytics-app-core.md +0 -85
  380. package/template/.codex/skills/data-analytics/src/codex-style-contract.md +0 -30
  381. package/template/.codex/skills/data-analytics/src/datascience-artifact-widget.html +0 -12
  382. package/template/.codex/skills/data-analytics/src/datascience-artifact-widget.jsx +0 -1008
  383. package/template/.codex/skills/data-analytics/src/datascience-chart-widget.css +0 -2117
  384. package/template/.codex/skills/data-analytics/src/datascience-chart-widget.html +0 -122
  385. package/template/.codex/skills/data-analytics/src/datascience-chart-widget.js +0 -3588
  386. package/template/.codex/skills/data-analytics/src/datascience-table-widget.css +0 -483
  387. package/template/.codex/skills/data-analytics/src/datascience-table-widget.html +0 -32
  388. package/template/.codex/skills/data-analytics/src/datascience-table-widget.js +0 -333
  389. package/template/.codex/skills/data-analytics/src/mcp-host.js +0 -153
  390. package/template/.codex/skills/data-analytics/src/recharts-config.js +0 -315
  391. package/template/.codex/skills/data-analytics/src/recharts-renderer.jsx +0 -294
  392. package/template/.codex/skills/data-analytics/src/sql-source-view.css +0 -33
  393. package/template/.codex/skills/data-analytics/src/sql-source-view.js +0 -157
  394. package/template/.codex/skills/data-analytics/src/styles/codex-theme.css +0 -121
  395. package/template/.codex/skills/data-analytics/src/table-renderer.jsx +0 -28
  396. package/template/.codex/skills/data-analytics/tests/chart-transforms.test.mjs +0 -87
  397. package/template/.codex/skills/data-analytics/tests/funnel-smoke.html +0 -105
  398. package/template/.codex/skills/data-analytics/tests/inline-widget-compare.html +0 -233
  399. package/template/.codex/skills/data-analytics/tests/mcp-server.test.mjs +0 -1500
  400. package/template/.codex/skills/data-analytics/tests/native-style-contract.test.mjs +0 -219
  401. package/template/.codex/skills/data-analytics/tests/recharts-config.test.mjs +0 -144
  402. package/template/.codex/skills/data-analytics/tests/recharts-renderer.test.mjs +0 -11
  403. package/template/.codex/skills/data-analytics/tests/rich-markdown.test.mjs +0 -54
  404. package/template/.codex/skills/data-analytics/tests/widget-render-harness.html +0 -321
  405. package/template/.codex/skills/data-analytics/tsconfig.json +0 -19
  406. package/template/.codex/skills/data-analytics/vite.config.ts +0 -46
  407. package/template/.codex/skills/grill-with-docs/SKILL.md +0 -20
  408. package/template/.codex/skills/grill-with-docs/agents/openai.yaml +0 -5
  409. package/template/.codex/skills/improve-codebase-architecture/agents/openai.yaml +0 -5
  410. package/template/.codex/skills/prototype/UI.md +0 -112
  411. package/template/.codex/skills/setup-matt-pocock-skills/domain.md +0 -37
  412. package/template/.codex/skills/to-questionnaire/SKILL.md +0 -55
  413. package/template/.codex/skills/to-questionnaire/agents/openai.yaml +0 -5
  414. package/template/.codex/skills/wait-what/SKILL.md +0 -7
  415. package/template/.codex/skills/wait-what/agents/openai.yaml +0 -5
  416. package/template/.cursor/skills/grill-with-docs/SKILL.md +0 -20
  417. package/template/.cursor/skills/grill-with-docs/agents/openai.yaml +0 -5
  418. package/template/.cursor/skills/improve-codebase-architecture/agents/openai.yaml +0 -5
  419. package/template/.cursor/skills/prototype/UI.md +0 -112
  420. package/template/.cursor/skills/setup-matt-pocock-skills/domain.md +0 -37
  421. package/template/.cursor/skills/to-questionnaire/SKILL.md +0 -55
  422. package/template/.cursor/skills/to-questionnaire/agents/openai.yaml +0 -5
  423. package/template/.cursor/skills/wait-what/SKILL.md +0 -7
  424. package/template/.cursor/skills/wait-what/agents/openai.yaml +0 -5
  425. package/template/.pi/skills/grill-with-docs/SKILL.md +0 -20
  426. package/template/.pi/skills/grill-with-docs/agents/openai.yaml +0 -5
  427. package/template/.pi/skills/improve-codebase-architecture/agents/openai.yaml +0 -5
  428. package/template/.pi/skills/prototype/UI.md +0 -112
  429. package/template/.pi/skills/setup-matt-pocock-skills/domain.md +0 -37
  430. package/template/.pi/skills/to-questionnaire/SKILL.md +0 -55
  431. package/template/.pi/skills/to-questionnaire/agents/openai.yaml +0 -5
  432. package/template/.pi/skills/wait-what/SKILL.md +0 -7
  433. package/template/.pi/skills/wait-what/agents/openai.yaml +0 -5
  434. package/template/.template-spec/agents/domain.md +0 -31
  435. /package/template/.agents/skills/{improve-codebase-architecture → codebase-design/references}/HTML-REPORT.md +0 -0
  436. /package/template/.codex/skills/{improve-codebase-architecture → codebase-design/references}/HTML-REPORT.md +0 -0
  437. /package/template/.cursor/skills/{improve-codebase-architecture → codebase-design/references}/HTML-REPORT.md +0 -0
  438. /package/template/.pi/skills/{improve-codebase-architecture → codebase-design/references}/HTML-REPORT.md +0 -0
@@ -31,13 +31,28 @@
31
31
  "type": "object",
32
32
  "additionalProperties": false,
33
33
  "properties": {
34
- "strategic_handoff_consumption": { "type": "object" },
35
- "approved_spec": { "type": "object" },
36
- "context_reconciliation": { "type": "object" },
37
- "technical_design": { "type": "object" },
38
- "data_architecture_decision": { "type": "object" },
39
- "api_contract_decision": { "type": "object" },
40
- "engineering_contract_approval_ref": { "type": "string", "minLength": 1 }
34
+ "strategic_handoff_consumption": {
35
+ "type": "object"
36
+ },
37
+ "approved_spec": {
38
+ "type": "object"
39
+ },
40
+ "context_reconciliation": {
41
+ "type": "object"
42
+ },
43
+ "technical_design": {
44
+ "type": "object"
45
+ },
46
+ "data_architecture_decision": {
47
+ "type": "object"
48
+ },
49
+ "api_contract_decision": {
50
+ "type": "object"
51
+ },
52
+ "engineering_contract_approval_ref": {
53
+ "type": "string",
54
+ "minLength": 1
55
+ }
41
56
  }
42
57
  },
43
58
  "plan_review_ref": {
@@ -57,7 +72,10 @@
57
72
  "minLength": 1
58
73
  },
59
74
  "schema_version": {
60
- "const": 1
75
+ "enum": [
76
+ 1,
77
+ 2
78
+ ]
61
79
  },
62
80
  "frontend_delivery": {
63
81
  "type": "object",
@@ -181,7 +199,8 @@
181
199
  "enum": [
182
200
  "lifecycle-work-unit",
183
201
  "slice-implementation",
184
- "template-maintenance"
202
+ "template-maintenance",
203
+ "read-only-intake"
185
204
  ]
186
205
  },
187
206
  "contract_id": {
@@ -343,7 +362,7 @@
343
362
  },
344
363
  "allowed_write_paths": {
345
364
  "type": "array",
346
- "minItems": 1,
365
+ "minItems": 0,
347
366
  "uniqueItems": true,
348
367
  "items": {
349
368
  "type": "string",
@@ -369,7 +388,7 @@
369
388
  },
370
389
  "expected_evidence_files": {
371
390
  "type": "array",
372
- "minItems": 1,
391
+ "minItems": 0,
373
392
  "uniqueItems": true,
374
393
  "items": {
375
394
  "type": "string",
@@ -378,7 +397,7 @@
378
397
  },
379
398
  "verification_commands": {
380
399
  "type": "array",
381
- "minItems": 1,
400
+ "minItems": 0,
382
401
  "items": {
383
402
  "type": "string",
384
403
  "minLength": 1
@@ -423,6 +442,10 @@
423
442
  "stderr_ref": {
424
443
  "type": "string",
425
444
  "minLength": 1
445
+ },
446
+ "evidence_digest": {
447
+ "type": "string",
448
+ "pattern": "^sha256:[a-f0-9]{64}$"
426
449
  }
427
450
  }
428
451
  }
@@ -599,6 +622,42 @@
599
622
  "checkpoint_ref": {
600
623
  "type": "string",
601
624
  "minLength": 1
625
+ },
626
+ "research_verification": {
627
+ "type": "object",
628
+ "additionalProperties": false,
629
+ "required": [
630
+ "ref",
631
+ "digest"
632
+ ],
633
+ "properties": {
634
+ "ref": {
635
+ "type": "string",
636
+ "minLength": 1
637
+ },
638
+ "digest": {
639
+ "type": "string",
640
+ "pattern": "^sha256:[0-9a-f]{64}$"
641
+ }
642
+ }
643
+ },
644
+ "maintenance_authorization": {
645
+ "type": "object",
646
+ "additionalProperties": false,
647
+ "required": [
648
+ "ref",
649
+ "digest"
650
+ ],
651
+ "properties": {
652
+ "ref": {
653
+ "type": "string",
654
+ "minLength": 1
655
+ },
656
+ "digest": {
657
+ "type": "string",
658
+ "pattern": "^sha256:[0-9a-f]{64}$"
659
+ }
660
+ }
602
661
  }
603
662
  }
604
663
  },
@@ -677,6 +736,16 @@
677
736
  "checkpoint_ref": {
678
737
  "type": "string",
679
738
  "minLength": 1
739
+ },
740
+ "verification_status": {
741
+ "enum": [
742
+ "not-executed",
743
+ "executed"
744
+ ]
745
+ },
746
+ "observation_ref": {
747
+ "type": "string",
748
+ "pattern": "^run:"
680
749
  }
681
750
  },
682
751
  "allOf": [
@@ -765,6 +834,127 @@
765
834
  "review_context"
766
835
  ]
767
836
  }
837
+ },
838
+ {
839
+ "if": {
840
+ "properties": {
841
+ "schema_version": {
842
+ "const": 1
843
+ }
844
+ }
845
+ },
846
+ "then": {
847
+ "properties": {
848
+ "contract": {
849
+ "properties": {
850
+ "kind": {
851
+ "enum": [
852
+ "lifecycle-work-unit",
853
+ "slice-implementation",
854
+ "template-maintenance"
855
+ ]
856
+ }
857
+ }
858
+ },
859
+ "allowed_write_paths": {
860
+ "minItems": 1
861
+ },
862
+ "expected_evidence_files": {
863
+ "minItems": 1
864
+ },
865
+ "verification_commands": {
866
+ "minItems": 1
867
+ }
868
+ }
869
+ },
870
+ "else": {
871
+ "required": [
872
+ "verification_status"
873
+ ],
874
+ "properties": {
875
+ "execution_state": {
876
+ "const": "Explorer"
877
+ },
878
+ "work_unit_id": {
879
+ "enum": [
880
+ "work-unit.entry-triage",
881
+ "work-unit.harness-entry"
882
+ ]
883
+ },
884
+ "allowed_write_paths": {
885
+ "maxItems": 0
886
+ },
887
+ "contract": {
888
+ "properties": {
889
+ "kind": {
890
+ "const": "read-only-intake"
891
+ }
892
+ },
893
+ "not": {
894
+ "anyOf": [
895
+ {
896
+ "required": [
897
+ "maintenance_ref"
898
+ ]
899
+ },
900
+ {
901
+ "required": [
902
+ "slice_contract_ref"
903
+ ]
904
+ },
905
+ {
906
+ "required": [
907
+ "lifecycle_ref"
908
+ ]
909
+ }
910
+ ]
911
+ }
912
+ },
913
+ "result": {
914
+ "properties": {
915
+ "changed_files": {
916
+ "maxItems": 0
917
+ },
918
+ "changed_artifacts": {
919
+ "maxItems": 0
920
+ },
921
+ "next_route": {
922
+ "type": "null"
923
+ }
924
+ }
925
+ },
926
+ "stage_id": {
927
+ "enum": [
928
+ "stage.entry-triage",
929
+ "stage.harness-entry"
930
+ ]
931
+ }
932
+ },
933
+ "not": {
934
+ "anyOf": [
935
+ {
936
+ "required": [
937
+ "checkpoint_ref"
938
+ ]
939
+ },
940
+ {
941
+ "required": [
942
+ "review_context"
943
+ ]
944
+ },
945
+ {
946
+ "required": [
947
+ "review_input"
948
+ ]
949
+ },
950
+ {
951
+ "required": [
952
+ "user_decisions"
953
+ ]
954
+ }
955
+ ]
956
+ }
957
+ }
768
958
  }
769
959
  ]
770
960
  }
@@ -6,6 +6,8 @@
6
6
  "additionalProperties": false,
7
7
  "required": ["schema_version", "kind", "template", "status", "prototype_ref", "spec_ref", "visual_baseline", "route_and_page_inventory", "pnpm_commands"],
8
8
  "properties": {
9
+ "console_evidence": {"$ref": "#/$defs/binding"},
10
+ "implementation_plan": {"$ref": "#/$defs/binding"},
9
11
  "frontend_delivery": {"type":"object","additionalProperties":false,"required":["acceptance_ref","digest"],"properties":{"acceptance_ref":{"type":"string","minLength":1},"digest":{"type":"string","pattern":"^sha256:[0-9a-f]{64}$"}}},
10
12
  "slice_id": {"type":"string","minLength":1},
11
13
  "slice_contract_ref": {"type":"string","minLength":1},
@@ -23,7 +25,7 @@
23
25
  "state_cases": {"type": "array", "minItems": 1, "items": {"type": "string", "minLength": 1}},
24
26
  "pnpm_commands": {"type": "array", "minItems": 1, "items": {"type": "string", "pattern": "^pnpm(?: |$)"}},
25
27
  "case_results": {"type": "array", "minItems": 1, "items": {"$ref": "#/$defs/caseResult"}},
26
- "interaction_results": {"type": "array", "minItems": 1, "items": {"type": "string", "minLength": 1}},
28
+ "interaction_results": {"type": "array", "minItems": 1, "items": {"oneOf": [{"type": "string", "minLength": 1}, {"$ref": "#/$defs/interaction"}]}},
27
29
  "console_warning_check": {"enum": ["pass", "blocked"]},
28
30
  "actual_verification": {"type": "array", "minItems": 1, "items": {"$ref": "#/$defs/verification"}},
29
31
  "uncovered_differences": {"type": "array", "items": {"type": "string", "minLength": 1}},
@@ -35,6 +37,8 @@
35
37
  {"if": {"properties": {"kind": {"const": "verification"}}, "required": ["kind"]}, "then": {"required": ["case_results", "interaction_results", "console_warning_check", "actual_verification", "uncovered_differences", "difference_owner", "independent_review"]}}
36
38
  ],
37
39
  "$defs": {
40
+ "interaction": {"type": "object", "additionalProperties": false, "required": ["case_id", "state", "result", "evidence_ref", "evidence_digest"], "properties": {"case_id": {"$ref": "#/$defs/caseId"}, "state": {"type": "string", "minLength": 1}, "result": {"enum": ["pass", "failed", "blocked"]}, "evidence_ref": {"type": "string", "minLength": 1}, "evidence_digest": {"$ref": "#/$defs/digest"}}},
41
+ "binding": {"type": "object", "additionalProperties": false, "required": ["ref", "digest"], "properties": {"ref": {"type": "string", "minLength": 1}, "digest": {"$ref": "#/$defs/digest"}}},
38
42
  "digest": {"type": "string", "pattern": "^sha256:[a-f0-9]{64}$"},
39
43
  "caseId": {"type": "string", "pattern": "^[a-z0-9][a-z0-9-]*$"},
40
44
  "visualBaseline": {
@@ -52,20 +56,8 @@
52
56
  "required": ["route", "page", "case_ids"],
53
57
  "properties": {"route": {"type": "string", "minLength": 1}, "page": {"type": "string", "minLength": 1}, "case_ids": {"type": "array", "minItems": 1, "uniqueItems": true, "items": {"$ref": "#/$defs/caseId"}}}
54
58
  },
55
- "caseResult": {
56
- "type": "object", "additionalProperties": false,
57
- "required": ["case_id", "baseline_image_ref", "implementation_image_ref", "diff_ref", "mask_ref", "result", "uncovered_difference", "explanation"],
58
- "properties": {
59
- "case_id": {"$ref": "#/$defs/caseId"}, "baseline_image_ref": {"type": "string", "minLength": 1}, "implementation_image_ref": {"type": "string", "minLength": 1},
60
- "diff_ref": {"type": "string", "minLength": 1}, "mask_ref": {"type": "string", "minLength": 1}, "result": {"enum": ["pass", "blocked"]},
61
- "uncovered_difference": {"type": "boolean"}, "explanation": {"type": "string"}
62
- }
63
- },
64
- "verification": {
65
- "type": "object", "additionalProperties": false,
66
- "required": ["command", "exit_code", "executed_at", "evidence_ref"],
67
- "properties": {"command": {"type": "string", "minLength": 1}, "exit_code": {"type": "integer"}, "executed_at": {"type": "string", "minLength": 1}, "evidence_ref": {"type": "string", "minLength": 1}}
68
- },
59
+ "caseResult": {"type": "object", "additionalProperties": false, "required": ["case_id", "baseline_image_ref", "implementation_image_ref", "diff_ref", "mask_ref", "result", "uncovered_difference", "explanation"], "properties": {"case_id": {"$ref": "#/$defs/caseId"}, "baseline_image_ref": {"type": "string", "minLength": 1}, "implementation_image_ref": {"type": "string", "minLength": 1}, "diff_ref": {"type": "string", "minLength": 1}, "mask_ref": {"type": "string", "minLength": 1}, "result": {"enum": ["pass", "blocked"]}, "uncovered_difference": {"type": "boolean"}, "explanation": {"type": "string"}, "implementation_image_digest": {"$ref": "#/$defs/digest"}, "diff_digest": {"$ref": "#/$defs/digest"}}},
60
+ "verification": {"type": "object", "additionalProperties": false, "required": ["command", "exit_code", "executed_at", "evidence_ref"], "properties": {"command": {"type": "string", "minLength": 1}, "exit_code": {"type": "integer"}, "executed_at": {"type": "string", "minLength": 1}, "evidence_ref": {"type": "string", "minLength": 1}, "evidence_digest": {"$ref": "#/$defs/digest"}}},
69
61
  "review": {
70
62
  "type": "object", "additionalProperties": false,
71
63
  "required": ["reviewer", "candidate_digest", "status", "findings_ref"],
@@ -11,3 +11,11 @@ Subagent 和其它运行时实例只接收边界清晰的任务包。主控数
11
11
  ## 汇合
12
12
 
13
13
  返回结果必须符合 `workflow-execution-result-v1`,至少包括 `work_unit`、`workflow_reference`、`result`、`skill`、`changed_files` / `changed_artifacts`、`evidence_refs`、实际验证结果、`deferred_seams`、`drift`、`violation`、`new_impacts`、`stale_candidates`、`blocking_signals` 和 `next_route`。主控必须重新执行 fresh verification,并在集中 checkpoint 中保留阶段因果。会签写入 `docs/.scratch/<feature>/gates/<gate-id>-approval.yaml`(形状见 `.template-spec/templates/approval-record-template.yaml`),不能用聊天表情代替。恢复前校验 `scripts/verify-approval-record`。
14
+
15
+ ## 只读分诊任务包 v2
16
+
17
+ schema v1 及三种正式合同继续执行原规则。v2 仅用于 `read-only-intake`:`Explorer`、注册表已有 `work-unit.entry-triage` 或专职 Profile 的 `work-unit.harness-entry`、`allowed_write_paths: []`,不带 checkpoint、Slice 或正式审查合同。研究完成只回传来源和结论,不更新阶段、Ticket、批准或 `next_route`;写正式资产前由主控重新分析影响并生成正式任务包。旧消费者必须拒绝 v2 并升级,禁止改写为 v1 绕过边界。
18
+
19
+ `prepare-read-only-intake --input <选择.yaml> --output <仓库外/task.json>` 从角色默认值生成任务包;输入沿用任务 ID、角色、运行时、分诊入口、合同 ID/版本/来源、输入、目标、禁止事项、预期输出、下游消费者和汇合字段。`run-read-only-intake --task <task.json> --run-dir <仓库外新目录> [--timeout-ms <毫秒>] -- <命令> <参数>` 保存观测与日志;不传命令时明确未执行验证。复核使用 `verify-digital-human-task-package <run-dir/task-result.json> --run-dir <绝对目录>`。
20
+
21
+ 运行证据使用 `run:` 相对引用,禁止绝对路径、`..` 与符号链接逃逸。命令、退出码、时间、stdout/stderr 与摘要必须一致;源码引用不能冒充运行日志。派发器观察 Git 跟踪、未跟踪及忽略文件的新增、删除、修改及已初始化子仓,结果中的空变更声明不能覆盖实际差异。未初始化子仓阻断观测。此工具是合同与结果审计,不是 OS 沙箱:执行期间改后恢复及可信派发器证据被恶意同步伪造不在终态观测能力内;运行目录应由派发器持有,不扩大 Agent 仓库写权限,运行时仍须采用只读权限。恢复后重新观察,不能直接复用旧完成状态。
@@ -19,12 +19,25 @@ case_results:
19
19
  - case_id: primary-desktop
20
20
  baseline_image_ref: docs/.scratch/example/handoff/visual-baseline-v1/images/primary-desktop.png
21
21
  implementation_image_ref: docs/.scratch/example/verification/images/primary-desktop.png
22
+ implementation_image_digest: sha256:0000000000000000000000000000000000000000000000000000000000000000
23
+ diff_digest: sha256:0000000000000000000000000000000000000000000000000000000000000000
22
24
  diff_ref: docs/.scratch/example/verification/diffs/primary-desktop.png
23
25
  mask_ref: not-applicable
24
26
  result: blocked
25
27
  uncovered_difference: false
26
28
  explanation: <difference-or-not-applicable>
27
- interaction_results: [loading, empty, error, permission, selected, key-interaction]
29
+ implementation_plan:
30
+ ref: docs/.scratch/example/verification/frontend-plan.yaml
31
+ digest: sha256:0000000000000000000000000000000000000000000000000000000000000000
32
+ interaction_results:
33
+ - case_id: primary-desktop
34
+ state: key-interaction
35
+ result: blocked
36
+ evidence_ref: docs/.scratch/example/verification/interaction.json
37
+ evidence_digest: sha256:0000000000000000000000000000000000000000000000000000000000000000
38
+ console_evidence:
39
+ ref: docs/.scratch/example/verification/console.json
40
+ digest: sha256:0000000000000000000000000000000000000000000000000000000000000000
28
41
  console_warning_check: blocked
29
42
  pnpm_commands: [pnpm lint, pnpm type-check, pnpm test]
30
43
  actual_verification:
@@ -32,6 +45,7 @@ actual_verification:
32
45
  exit_code: 0
33
46
  executed_at: <iso-8601>
34
47
  evidence_ref: docs/.scratch/example/verification/pnpm-test.txt
48
+ evidence_digest: sha256:0000000000000000000000000000000000000000000000000000000000000000
35
49
  uncovered_differences: []
36
50
  difference_owner: null
37
51
  independent_review:
@@ -36,7 +36,7 @@
36
36
 
37
37
  - 先按 `.template-spec/process/harness-process-tailoring.md` 判定影响面和最近可信阶段,再由 `yss-product-lifecycle` 执行 `.template-spec/process/lifecycle-registry.yaml`;阅读导航见 `.template-spec/process/lifecycle-artifact-map.md`。
38
38
  - 命中门禁必须完成;仅未命中时记录带原因的 `not-applicable`,不得生成空文档或混淆门禁、产物、工作单元、证据。安全 / 权限写入普通 Spec、契约、架构、验收和 seam,按实际影响触发门禁。
39
- - 新功能和较大变更先进入 Plan;`grill-with-docs`、`to-spec`、`to-tickets`、`implement` 仅为用户显式兼容入口。API 变更先形成 OpenAPI 3.1 Draft,审查后 Freeze,再实现。
39
+ - 新功能和较大变更先进入 Plan;`to-spec`、`to-tickets`、`implement` 仅为用户显式兼容入口。API 变更先形成 OpenAPI 3.1 Draft,审查后 Freeze,再实现。
40
40
  - Spec Delta 只记冻结基线的高风险行为差异。OpenAPI Freeze 或无 API 影响记录后拆窄垂直切片,禁止仅按技术层横拆。
41
41
  - `seam-deferred` 必须记录风险、责任人、后续 Ticket、验证计划和目标版本或发布日期。
42
42
 
@@ -9,6 +9,10 @@ context_schema_version: 1
9
9
 
10
10
  只有在计划、分诊、调试或架构讨论中明确沉淀出稳定语言时,才新增术语。
11
11
 
12
+ ## 消费规则
13
+
14
+ 探索仓库、起草 Spec / Ticket、架构设计和实现前读取根目录唯一的 CONTEXT.md,并按当前影响面读取 docs/adr/。合同缺失时先恢复,不能临时另建词汇表。Spec、Ticket 标题、测试、架构说明和总结使用已确认的中文术语;与冻结术语或 ADR 冲突时先明确冲突。稳定术语由 domain-modeling 维护,临时猜测留在决策前沿。生命周期引用保存结构化 snapshot 与双摘要,不使用 Markdown 伪锚点。
15
+
12
16
  ## 流程术语
13
17
 
14
18
  模板源与生命周期协作概念放在本节。`英文标识` 填 `—`,不回溯补译。
@@ -62,7 +66,7 @@ context_schema_version: 1
62
66
  | Fresh Verification | 完成前重新执行的验证证据,包括测试命令、契约校验、关键路径检查或人工审查结论。 | — | 不等同于“之前跑过”或实现者自述。 |
63
67
  | `implementation-ready` | 模板维护实现和命中影响面的快速核验已经完成,但尚未冻结正式审查候选。 | — | 是模板维护默认出口;不等同于 `ready-for-agent`、已审查或可发布。 |
64
68
  | `review-ready` | 模板维护显式选择独立审查时的就绪状态;旧候选协议要求 candidate 核验、首次完整验证和摘要冻结。 | — | Reviewer 必须消费同一候选摘要;候选字节变化后旧审查失效。 |
65
- | `release-ready` | 模板维护已完成维护者自检和发布前完整 Fresh Verification;显式选择独立审查时还须闭合该审查。 | — | 仍不替代 `gate.release-ready` 所需的生物人发布裁决。 |
69
+ | `release-ready` | 模板维护已完成维护者自检和发布前完整 Fresh Verification;显式选择独立审查时还须闭合该审查。 | — | 交付验收使用 `gate.delivery-accepted`;实际合并、发布仍须单独取得生物人授权。 |
66
70
  | 实现验证命令 | 前端测试 / 构建优先 `pnpm`,后端校验 / 测试 / 编译优先 `./mvnw`。 | — | 不要默认 `npm`、`yarn` 或裸 `mvn`;仓库确实缺少 pnpm 或 Maven Wrapper 时记受控例外。 |
67
71
  | 脚手架架构选择 | 新建后端工程在工程基线中对 `domain-driven` 与 `layered-mvc` 的结构化选择;Agent 提供证据化推荐,用户确认后由生命周期批准并供脚手架合同消费。 | — | 不是新门禁,也不是生成器内的交互参数;缺失、未确认或摘要漂移时阻断生成。 |
68
72
  | 测试质量基线 | 项目实例明确采纳的覆盖率阈值、关键流程清单和受控例外。 | — | 模板推荐值本身不构成可执行门禁;未定义关键流程时,不得声称其 E2E 覆盖率达到 100%。 |
@@ -9,27 +9,15 @@
9
9
  ## 项目结构
10
10
 
11
11
  ```text
12
- ├── .agents/ ← 跨 Agent 共享 skills 的权威内容
13
- ├── .codex/ ← Codex skills 投影与平台专属 skills
14
- ├── .cursor/ ← Cursor skills 投影
15
- ├── .pi/ ← Pi skills 投影与平台专属 skills
16
- ├── AGENTS.md ← AI 指令
17
- ├── CONTEXT.md ← 领域词汇表
18
- ├── yss-project.yaml ← 仓库身份清单
19
- ├── docs/
20
- │ ├── api/ ← OpenAPI 3.1 契约
21
- │ ├── adr/ ← 架构决策记录
22
- │ ├── requirements/ ← Spec / 用户故事 / 需求草案 / 垂直切片
23
- │ ├── plan/ ← 战略规划与 Spec 上游输入
24
- │ ├── design/ ← 产品设计、原型、交互说明和状态矩阵
25
- │ ├── architecture/ ← 架构设计与审查模板
26
- │ ├── releases/ ← 发布说明
27
- │ ├── implementation/ ← 实施方案、上线记录和回滚方案
28
- │ ├── testing/ ← 测试策略和验证记录
29
- │ ├── agents/ ← Agent 协作规范、Ticket/Triage/领域文档约定
30
- │ ├── templates/ ← 通用文档模板
31
- │ └── process/ ← 生命周期、裁剪、Scrum 和技能治理说明
32
- └── scripts/ ← 模板轻量校验脚本
12
+ ├── .agents/skills/ ← 共享技能权威内容
13
+ ├── .codex/、.cursor/、.pi/ ← 技能投影与平台专属能力
14
+ ├── AGENTS.md ← Agent 入口规则
15
+ ├── CONTEXT.md ← 唯一业务词汇表
16
+ ├── yss-project.yaml ← 仓库身份
17
+ ├── .template-spec/ ← 可复用流程、门禁、契约与文档模板
18
+ ├── .template-source/ ← 模板维护、分发工具和历史证据(不进入实例)
19
+ ├── docs/ ← 项目实例按需创建的 Plan、Spec、设计、Ticket 与交付证据
20
+ └── scripts/ ← 合同与流程验证工具
33
21
  ```
34
22
 
35
23
  项目需要生成度量、外部实现仓库记录或其他临时产物时再按需创建对应目录。前后端实现仓库接入规则见 `.template-spec/process/implementation-repo-integration.md`。
@@ -37,9 +25,9 @@
37
25
  ## Quickstart
38
26
 
39
27
  1. 先读取 `yss-project.yaml`,按 `repository_mode` 选择模板维护或产品研发生命周期。
40
- 2. 必读入口为 `AGENTS.md` 与 `CONTEXT.md`;流程事实分别以生命周期映射和裁剪指南为准。
28
+ 2. 必读入口为 `AGENTS.md` 与 `CONTEXT.md`;流程事实以生命周期注册表和裁剪指南为准。
41
29
  3. `template-source` 修改后先按 `maintenance-intensity.yaml` 判定 L1 / L2 / L3,默认用 `scripts/verify-template-fast` 达到 `implementation-ready`;L3 日常采用维护者自检,正式发布前执行完整门禁;只有共享 skill 变更才运行 `scripts/sync-skills` 和 `scripts/update-skill-lock`。
42
- 4. `project-instance` 默认从 `yss-product-lifecycle` 的 `route` 模式开始,再由原生 `work-unit.*` 推进 Plan、Spec、产品设计、工程契约和 Ticket 正式化;`grill-with-docs`、`to-spec`、`to-tickets`、`implement` 仅作为用户显式调用的兼容入口。
30
+ 4. `project-instance` 默认从 `yss-product-lifecycle` 的 `route` 模式开始,再由原生 `work-unit.*` 推进 Plan、Spec、产品设计、工程契约和 Ticket 正式化;`to-spec`、`to-tickets`、`implement` 仅作为用户显式调用的兼容入口。
43
31
  5. 实现仓库接入、YSS 路由、独立审查、fresh verification 和 Git checkpoint 以 `AGENTS.md` 的硬门禁为准。
44
32
 
45
33
 
@@ -94,7 +82,7 @@ scripts/verify-template-fast
94
82
  - 示例 OpenAPI YAML 是否可解析。
95
83
  - Git diff 是否存在空白错误。
96
84
 
97
- 显式准备审查候选时执行 `scripts/verify-template-candidate`;首次正式冻结前和最终发布前执行不可裁剪的 `scripts/verify-template`。
85
+ PR 执行 `scripts/verify-template-candidate`;main 与正式发布前执行不可裁剪的 `scripts/verify-template`。独立审查和候选冻结仅在显式采用旧兼容协议时执行。
98
86
 
99
87
  ## 关键文档
100
88
 
@@ -1,13 +1,13 @@
1
1
  #!/usr/bin/env node
2
2
  import path from 'node:path';
3
- import {viewContract,diffContract} from './lib/contract-views.mjs';
3
+ import {viewContract,diffContract,prepareContractReview} from './lib/contract-views.mjs';
4
4
  try{
5
5
  const args=process.argv.slice(2),mode=args.shift(),options={},positional=[];
6
- for(let i=0;i<args.length;i++){const arg=args[i];if(arg==='--json')options.json=true;else if(arg.startsWith('--')){const key=arg.slice(2);if(!['kind','profile','unit','root','before-root'].includes(key)||!args[i+1]||args[i+1].startsWith('--'))throw Error(`未知或缺值参数 ${arg}`);options[key]=args[++i];}else positional.push(arg);}
7
- const config={kind:options.kind,root:path.resolve(options.root||process.cwd()),profile:options.profile||'review',unit_id:options.unit,beforeRoot:options['before-root']?path.resolve(options['before-root']):undefined};
6
+ for(let i=0;i<args.length;i++){const arg=args[i];if(arg==='--json')options.json=true;else if(arg.startsWith('--')){const key=arg.slice(2);if(!['kind','profile','unit','root','before-root','decision','task-layout'].includes(key)||!args[i+1]||args[i+1].startsWith('--'))throw Error(`未知或缺值参数 ${arg}`);options[key]=args[++i];}else positional.push(arg);}
7
+ const config={kind:options.kind,root:path.resolve(options.root||process.cwd()),profile:options.profile||'review',unit_id:options.unit,task_layout:options['task-layout']||'legacy',beforeRoot:options['before-root']?path.resolve(options['before-root']):undefined,decision_ref:options.decision};
8
8
  if(!options.kind)throw Error('必须用 --kind 明确资产类型');
9
- if(!['view','diff'].includes(mode)||positional.length!==(mode==='view'?1:2))throw Error('用法: contract view <资产> --kind <类型> [--profile review|task|full] [--unit <ID>] [--json] | diff <旧资产> <新资产> --kind <类型>');
10
- const result=mode==='view'?viewContract(positional[0],config):diffContract(positional[0],positional[1],config);
9
+ if(!['view','diff','prepare-review'].includes(mode)||positional.length!==(mode==='view'?1:2))throw Error('用法: contract view <资产> --kind <类型> [--profile review|task|full] [--unit <ID>] [--json] | diff|prepare-review <旧资产> <新资产> --kind <类型> [--decision <原决定>]');
10
+ const result=mode==='view'?viewContract(positional[0],config):mode==='prepare-review'?prepareContractReview(positional[0],positional[1],config):diffContract(positional[0],positional[1],config);
11
11
  process.stdout.write(options.json||!result.markdown?JSON.stringify(result,null,2)+'\n':result.markdown);
12
12
  if(result.blockers?.length)process.exitCode=1;
13
13
  }catch(error){process.stderr.write(error.message+'\n');process.exitCode=1;}
@@ -59,19 +59,25 @@ function markdown(view){
59
59
  return lines.join('\n\n')+'\n';
60
60
  }
61
61
  export function viewContract(ref,options={}){return withValidationPhase({root:options.root,purpose:'contract-view',slice_id:ref,work_unit_id:options.unit_id,readOnly:true},()=>view(ref,options));}
62
- function view(ref,{root=process.cwd(),kind,profile='review',unit_id}={}){
62
+ function view(ref,{root=process.cwd(),kind,profile='review',unit_id,task_layout='legacy'}={}){
63
63
  validateKind(kind);if(!['review','task','full'].includes(profile))throw new TypeError(`未知阅读档位 ${profile}`);
64
+ if(!['legacy','focused'].includes(task_layout))throw new TypeError(`未知 task layout ${task_layout}`);
64
65
  let binding,content,checks=['可读取'],blockers=[],sourceChecks=[];
65
66
  if(kind==='slice'){
66
67
  const loaded=readSliceContract(ref,{root,diagnostic:true});binding=loaded.binding;blockers.push(...declaredBlockers(loaded.raw));
67
68
  const legacy=renderSliceContractView(ref,{root,unit_id:profile==='task'?unit_id:undefined});
68
69
  checks.push('Slice 结构及绑定来源');
69
- if(legacy.diagnostic_only){content={诊断:legacy.blockers};blockers=legacy.blockers.map(b=>b.reason);}
70
+ if(legacy.diagnostic_only){content={诊断:legacy.blockers,未校验的原合同:loaded.raw};blockers=legacy.blockers.map(b=>b.reason);}
70
71
  else if(profile==='full')content={权威合同:loaded.raw,完整视图:legacy};
71
72
  else if(profile==='review'){
72
73
  content={...legacy.summary,验收:legacy.acceptance,实施范围:{工程:loaded.raw.scope?.project_roots||legacy.constraints.project_roots,允许写入:loaded.raw.scope?.allowed_write_paths||legacy.constraints.allowed_write_paths},关键约束:loaded.raw.scope?.forbidden_patterns||legacy.constraints.forbidden_patterns,停止条件:'来源或批准过期、越界、缺证据、验证失败、drift / violation / new_impacts 时停止并回交。'};
73
74
  for(const key of ['risks','risk_acceptance','blockers','pending_decisions','constraints'])if(loaded.raw[key])content[key]=loaded.raw[key];
74
75
  for(const [label,pattern]of [['风险',/风险/],['关键取舍',/取舍/],['待决定事项',/待|决定/],['变化',/变化|变更/]])if(!Object.keys(content).some(k=>pattern.test(k)))content[label]='来源未说明,审阅时核实。';
76
+ const reviewKnown=new Set(['schema_version','contract_id','contract_version','slice_id','status','basis','scope','common','lifecycle_refs','applicability','resolution','acceptance','verification','work_units','extensions','ticket_policy']);
77
+ content.未分类约束=Object.fromEntries(Object.entries(loaded.raw).filter(([key])=>!reviewKnown.has(key)));
78
+ // Normalization preserves raw v2 common / v3 scope, including nested unknown constraints.
79
+ content.全局约束=legacy.constraints;
80
+ content.专项约束=loaded.raw.extensions;content.适用性=loaded.raw.applicability;
75
81
  const extensions=loaded.raw.extensions||{};
76
82
  for(const [name,extension]of Object.entries(extensions))for(const [key,value]of Object.entries(extension))if(/risk|constraint|decision|block|exception|unknown/.test(key))content[`${name}.${key}`]=value;
77
83
  }else{
@@ -80,6 +86,13 @@ function view(ref,{root=process.cwd(),kind,profile='review',unit_id}={}){
80
86
  content={当前任务:units[0].work_unit||units[0],全局约束:legacy.constraints,专项约束:legacy.extensions,编译约束:loaded.raw.resolution,适用性:loaded.raw.applicability,验收:legacy.acceptance,上游引用:Object.fromEntries(Object.entries(loaded.sources).map(([k,v])=>[k,{ref:v.ref,version:v.version}])),停止条件:'来源或批准过期、越界、缺证据、验证失败、drift / violation / new_impacts 时停止并回交。'};
81
87
  const known=new Set(['schema_version','contract_id','contract_version','slice_id','status','basis','scope','applicability','resolution','acceptance','verification','work_units','extensions','ticket_policy']);
82
88
  content.其他约束=Object.fromEntries(Object.entries(loaded.raw).filter(([k])=>!known.has(k)));
89
+ if(task_layout==='focused' && loaded.raw.schema_version===3){
90
+ const task=units[0].work_unit||units[0];
91
+ const ids=new Set([...(task.acceptance_refs||[]),...(task.verification||[]).flatMap(v=>v.acceptance_refs||[])]);
92
+ content={当前任务:task,验收:Object.fromEntries(Object.entries(legacy.acceptance).filter(([id])=>ids.has(id))),全局约束:{...legacy.constraints,verification_commands:task.verification_commands,expected_evidence_files:task.expected_evidence},专项约束:legacy.extensions,编译约束:loaded.raw.resolution,适用性:loaded.raw.applicability,上游引用:content.上游引用,其他约束:content.其他约束,停止条件:content.停止条件,
93
+ 恢复动作:['读取主 tracker 或当前任务包,核对实际运行结果;运行状态未知时不重复派发','复验当前来源、批准和适用门禁;失效时回交,不能沿用旧完成结论'],
94
+ 完整验收引用:{ref,digest:binding.digest,profile:'full',omitted_acceptance_ids:Object.keys(legacy.acceptance).filter(id=>!ids.has(id))}};
95
+ }
83
96
  }
84
97
  }else{
85
98
  const {bytes,raw}=load(ref,root);binding={ref,id:raw.contract_id||raw.technical_design_id||raw.decision_id||raw.request?.request_id||raw.handoff_id||raw.baseline_id||raw.spec_id||raw.plan_id||raw.id||null,version:raw.contract_version||raw.decision_version||raw.handoff_version||raw.version||null,digest:hash(bytes)};
@@ -107,3 +120,45 @@ export function diffContract(beforeRef,afterRef,{root=process.cwd(),beforeRoot=r
107
120
  walk(before.raw,after.raw,'');const source_checks=[...references(before.raw,beforeRoot).map(x=>({...x,side:'before'})),...references(after.raw,root).map(x=>({...x,side:'after'}))];
108
121
  return{read_only:true,approval_reusable:false,execution_allowed:false,before:{ref:beforeRef,digest:hash(before.bytes)},after:{ref:afterRef,digest:hash(after.bytes)},bytes_changed:!before.bytes.equals(after.bytes),changes,source_checks,decision_impact:'必须按当前差异和授权延续协议核验;无法读取旧来源时影响未知。'};
109
122
  }
123
+
124
+ /** Mechanical review material only; original decisions and semantic review remain authoritative. */
125
+ export function prepareContractReview(beforeRef, afterRef, options = {}) {
126
+ const root = options.root || process.cwd();
127
+ return withValidationPhase({root,purpose:'prepare-contract-review',readOnly:true}, () => {
128
+ validateKind(options.kind);
129
+ const gaps = [];
130
+ const gap = (code, source_ref, reason, recovery) => gaps.push({code,source_ref,reason,recovery});
131
+ const readView = (ref, side, sourceRoot) => {
132
+ try {
133
+ const value = viewContract(ref,{...options,root:sourceRoot,profile:'full'});
134
+ for(const blocker of value.blockers)gap('SOURCE_INVALID',ref,blocker,'恢复当前权威来源并重新校验');
135
+ return value;
136
+ } catch(error) { gap('SOURCE_UNREADABLE',ref,`${side}: ${error.message}`,'提供可读取的原始资产;不推断历史内容');return null; }
137
+ };
138
+ const before = readView(beforeRef,'before',options.beforeRoot||root), after = readView(afterRef,'after',root);
139
+ if(before?.binding.id && after?.binding.id && before.binding.id!==after.binding.id)gap('IDENTITY_CONFLICT',afterRef,'前后资产 ID 不一致','选择同一资产的前后版本');
140
+ if(before?.binding.version && before.binding.version===after?.binding.version && before.binding.digest!==after.binding.digest)gap('VERSION_CONFLICT',afterRef,'相同版本包含不同字节','形成新候选版本并重新核验');
141
+ let diff = null;
142
+ if(before&&after)try{diff=diffContract(beforeRef,afterRef,options);}catch(error){gap('DIFF_UNAVAILABLE',afterRef,error.message,'先修复来源绑定与版本冲突');}
143
+ let originalDecision = null;
144
+ if(options.decision_ref) {
145
+ try {
146
+ const loaded=load(options.decision_ref,root);
147
+ schema(loaded.raw,'.template-spec/process/schemas/user-decision.schema.json');
148
+ originalDecision={ref:options.decision_ref,digest:hash(loaded.bytes),record:loaded.raw};
149
+ for(const row of references(loaded.raw,root))if(!row.current)gap('DECISION_SOURCE_STALE',row.ref,row.error||'原决定来源摘要不匹配','恢复原决定快照;不得重绑旧回复');
150
+ }catch(error){gap('DECISION_UNAVAILABLE',options.decision_ref,error.message,'提供有效的原始决定;本材料不能替代用户回复');}
151
+ }
152
+ if(!options.decision_ref)gaps.push({code:'DECISION_NOT_PROVIDED',source_ref:null,reason:'未提供原决定,不能判断批准延续',recovery:'需要沿用批准时提供原决定及原始回复来源',blocking:false});
153
+ return {
154
+ schema_version:1,kind:'contract-review-preparation',read_only:true,execution_allowed:false,
155
+ approval_reusable:false,approval_validity:'not-checked',semantic_equivalence:'requires-independent-review',
156
+ before:before?.binding||null,after:after?.binding||null,original_decision:originalDecision,
157
+ decision_status:options.decision_ref?(originalDecision?'requires-validation':'missing-or-invalid'):'not-provided',
158
+ source_views:{before:before?.content||null,after:after?.content||null},diff,gaps,
159
+ review_required:['business_scope','acceptance','contract_commitments','authorization','risk_acceptance','quality','external_commitments'],
160
+ next_action:gaps.some(x=>x.blocking!==false)?'repair-source-gaps':'independent-semantic-review',
161
+ blockers:gaps.filter(x=>x.blocking!==false).map(item=>item.reason)
162
+ };
163
+ });
164
+ }