mustflow 1.18.16 → 1.31.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 (314) hide show
  1. package/README.md +28 -8
  2. package/dist/cli/commands/adapters.js +90 -0
  3. package/dist/cli/commands/classify.js +3 -4
  4. package/dist/cli/commands/contract-lint.js +26 -6
  5. package/dist/cli/commands/dashboard.js +103 -4
  6. package/dist/cli/commands/explain-verify.js +213 -0
  7. package/dist/cli/commands/explain.js +48 -4
  8. package/dist/cli/commands/handoff.js +136 -0
  9. package/dist/cli/commands/run.js +302 -168
  10. package/dist/cli/commands/update.js +91 -61
  11. package/dist/cli/commands/upgrade.js +65 -0
  12. package/dist/cli/commands/verify.js +304 -139
  13. package/dist/cli/i18n/en.js +77 -4
  14. package/dist/cli/i18n/es.js +77 -4
  15. package/dist/cli/i18n/fr.js +77 -4
  16. package/dist/cli/i18n/hi.js +77 -4
  17. package/dist/cli/i18n/ko.js +77 -4
  18. package/dist/cli/i18n/zh.js +77 -4
  19. package/dist/cli/index.js +34 -42
  20. package/dist/cli/lib/command-registry.js +15 -0
  21. package/dist/cli/lib/dashboard-export.js +775 -0
  22. package/dist/cli/lib/dashboard-html.js +1 -1
  23. package/dist/cli/lib/local-index.js +33 -14
  24. package/dist/cli/lib/reporter.js +6 -0
  25. package/dist/cli/lib/run-plan.js +239 -0
  26. package/dist/cli/lib/templates.js +18 -3
  27. package/dist/cli/lib/update-diff-preview.js +163 -0
  28. package/dist/cli/lib/validation.js +132 -1
  29. package/dist/core/adapter-compatibility.js +235 -0
  30. package/dist/core/bounded-output.js +38 -0
  31. package/dist/core/change-classification.js +14 -1
  32. package/dist/core/change-verification.js +246 -5
  33. package/dist/core/check-issues.js +10 -0
  34. package/dist/core/command-contract-validation.js +34 -0
  35. package/dist/core/command-cwd.js +18 -6
  36. package/dist/core/command-effects.js +13 -0
  37. package/dist/core/command-env.js +91 -0
  38. package/dist/core/contract-lint.js +260 -4
  39. package/dist/core/contract-models.js +172 -0
  40. package/dist/core/dashboard-verification.js +10 -0
  41. package/dist/core/doc-review-triage.js +1 -0
  42. package/dist/core/handoff-record.js +376 -0
  43. package/dist/core/public-json-contracts.js +23 -0
  44. package/dist/core/run-performance-history.js +307 -0
  45. package/dist/core/run-profile.js +87 -0
  46. package/dist/core/run-receipt.js +217 -11
  47. package/dist/core/run-write-drift.js +196 -0
  48. package/dist/core/secret-redaction.js +39 -0
  49. package/dist/core/skill-route-alignment.js +90 -0
  50. package/dist/core/source-anchors.js +3 -5
  51. package/dist/core/test-selection.js +224 -0
  52. package/dist/core/verification-decision-graph.js +290 -0
  53. package/dist/core/verification-scheduler.js +96 -2
  54. package/package.json +3 -1
  55. package/schemas/README.md +15 -4
  56. package/schemas/adapter-compatibility-report.schema.json +184 -0
  57. package/schemas/change-verification-report.schema.json +286 -4
  58. package/schemas/commands.schema.json +55 -2
  59. package/schemas/contract-lint-report.schema.json +99 -0
  60. package/schemas/dashboard-export.schema.json +273 -0
  61. package/schemas/explain-report.schema.json +267 -2
  62. package/schemas/handoff-validation-report.schema.json +68 -0
  63. package/schemas/run-receipt.schema.json +183 -1
  64. package/templates/default/common/.mustflow/config/commands.toml +3 -1
  65. package/templates/default/i18n.toml +78 -234
  66. package/templates/default/locales/en/.mustflow/skills/INDEX.md +7 -3
  67. package/templates/default/locales/en/.mustflow/skills/architecture-deepening-review/SKILL.md +154 -0
  68. package/templates/default/locales/en/.mustflow/skills/behavior-preserving-refactor/SKILL.md +8 -3
  69. package/templates/default/locales/en/.mustflow/skills/code-review/SKILL.md +9 -4
  70. package/templates/default/locales/en/.mustflow/skills/date-number-audit/SKILL.md +19 -4
  71. package/templates/default/locales/en/.mustflow/skills/diff-risk-review/SKILL.md +4 -2
  72. package/templates/default/locales/en/.mustflow/skills/external-skill-intake/SKILL.md +141 -0
  73. package/templates/default/locales/en/.mustflow/skills/release-notes-authoring/SKILL.md +143 -0
  74. package/templates/default/locales/en/.mustflow/skills/repro-first-debug/SKILL.md +22 -8
  75. package/templates/default/locales/en/.mustflow/skills/skill-authoring/SKILL.md +3 -3
  76. package/templates/default/locales/en/.mustflow/skills/source-freshness-check/SKILL.md +22 -9
  77. package/templates/default/locales/en/.mustflow/skills/ui-quality-gate/SKILL.md +21 -13
  78. package/templates/default/locales/en/.mustflow/skills/vertical-slice-tdd/SKILL.md +167 -0
  79. package/templates/default/manifest.toml +16 -1
  80. package/templates/default/locales/es/.mustflow/skills/INDEX.md +0 -75
  81. package/templates/default/locales/es/.mustflow/skills/adapter-boundary/SKILL.md +0 -193
  82. package/templates/default/locales/es/.mustflow/skills/artifact-integrity-check/SKILL.md +0 -114
  83. package/templates/default/locales/es/.mustflow/skills/behavior-preserving-refactor/SKILL.md +0 -182
  84. package/templates/default/locales/es/.mustflow/skills/code-review/SKILL.md +0 -115
  85. package/templates/default/locales/es/.mustflow/skills/codebase-orientation/SKILL.md +0 -115
  86. package/templates/default/locales/es/.mustflow/skills/command-pattern/SKILL.md +0 -247
  87. package/templates/default/locales/es/.mustflow/skills/composition-over-inheritance/SKILL.md +0 -176
  88. package/templates/default/locales/es/.mustflow/skills/contract-sync-check/SKILL.md +0 -116
  89. package/templates/default/locales/es/.mustflow/skills/database-change-safety/SKILL.md +0 -155
  90. package/templates/default/locales/es/.mustflow/skills/date-number-audit/SKILL.md +0 -116
  91. package/templates/default/locales/es/.mustflow/skills/dependency-injection/SKILL.md +0 -161
  92. package/templates/default/locales/es/.mustflow/skills/dependency-reality-check/SKILL.md +0 -115
  93. package/templates/default/locales/es/.mustflow/skills/diff-risk-review/SKILL.md +0 -136
  94. package/templates/default/locales/es/.mustflow/skills/docs-prose-review/SKILL.md +0 -119
  95. package/templates/default/locales/es/.mustflow/skills/docs-update/SKILL.md +0 -97
  96. package/templates/default/locales/es/.mustflow/skills/external-prompt-injection-defense/SKILL.md +0 -116
  97. package/templates/default/locales/es/.mustflow/skills/facade-pattern/SKILL.md +0 -210
  98. package/templates/default/locales/es/.mustflow/skills/failure-triage/SKILL.md +0 -97
  99. package/templates/default/locales/es/.mustflow/skills/instruction-conflict-scope-check/SKILL.md +0 -118
  100. package/templates/default/locales/es/.mustflow/skills/line-ending-hygiene/SKILL.md +0 -111
  101. package/templates/default/locales/es/.mustflow/skills/migration-safety-check/SKILL.md +0 -117
  102. package/templates/default/locales/es/.mustflow/skills/multi-agent-work-coordination/SKILL.md +0 -260
  103. package/templates/default/locales/es/.mustflow/skills/null-object-pattern/SKILL.md +0 -196
  104. package/templates/default/locales/es/.mustflow/skills/pattern-scout/SKILL.md +0 -110
  105. package/templates/default/locales/es/.mustflow/skills/performance-budget-check/SKILL.md +0 -121
  106. package/templates/default/locales/es/.mustflow/skills/project-context-authoring/SKILL.md +0 -107
  107. package/templates/default/locales/es/.mustflow/skills/pure-core-imperative-shell/SKILL.md +0 -212
  108. package/templates/default/locales/es/.mustflow/skills/readme-authoring/SKILL.md +0 -115
  109. package/templates/default/locales/es/.mustflow/skills/repo-improvement-loop/SKILL.md +0 -150
  110. package/templates/default/locales/es/.mustflow/skills/repro-first-debug/SKILL.md +0 -112
  111. package/templates/default/locales/es/.mustflow/skills/requirement-regression-guard/SKILL.md +0 -152
  112. package/templates/default/locales/es/.mustflow/skills/result-option/SKILL.md +0 -186
  113. package/templates/default/locales/es/.mustflow/skills/security-privacy-review/SKILL.md +0 -116
  114. package/templates/default/locales/es/.mustflow/skills/security-regression-tests/SKILL.md +0 -131
  115. package/templates/default/locales/es/.mustflow/skills/skill-authoring/SKILL.md +0 -110
  116. package/templates/default/locales/es/.mustflow/skills/source-freshness-check/SKILL.md +0 -111
  117. package/templates/default/locales/es/.mustflow/skills/state-machine-pattern/SKILL.md +0 -214
  118. package/templates/default/locales/es/.mustflow/skills/strategy-pattern/SKILL.md +0 -215
  119. package/templates/default/locales/es/.mustflow/skills/structure-discovery-gate/SKILL.md +0 -159
  120. package/templates/default/locales/es/.mustflow/skills/test-design-guard/SKILL.md +0 -162
  121. package/templates/default/locales/es/.mustflow/skills/test-maintenance/SKILL.md +0 -122
  122. package/templates/default/locales/es/.mustflow/skills/ui-quality-gate/SKILL.md +0 -117
  123. package/templates/default/locales/es/.mustflow/skills/visual-review-artifact/SKILL.md +0 -127
  124. package/templates/default/locales/es/.mustflow/skills/visual-review-artifact/assets/review-template.html +0 -286
  125. package/templates/default/locales/es/.mustflow/skills/visual-review-artifact/resources.toml +0 -7
  126. package/templates/default/locales/es/.mustflow/skills/web-asset-optimization/SKILL.md +0 -108
  127. package/templates/default/locales/fr/.mustflow/skills/INDEX.md +0 -75
  128. package/templates/default/locales/fr/.mustflow/skills/adapter-boundary/SKILL.md +0 -193
  129. package/templates/default/locales/fr/.mustflow/skills/artifact-integrity-check/SKILL.md +0 -114
  130. package/templates/default/locales/fr/.mustflow/skills/behavior-preserving-refactor/SKILL.md +0 -182
  131. package/templates/default/locales/fr/.mustflow/skills/code-review/SKILL.md +0 -115
  132. package/templates/default/locales/fr/.mustflow/skills/codebase-orientation/SKILL.md +0 -115
  133. package/templates/default/locales/fr/.mustflow/skills/command-pattern/SKILL.md +0 -247
  134. package/templates/default/locales/fr/.mustflow/skills/composition-over-inheritance/SKILL.md +0 -176
  135. package/templates/default/locales/fr/.mustflow/skills/contract-sync-check/SKILL.md +0 -116
  136. package/templates/default/locales/fr/.mustflow/skills/database-change-safety/SKILL.md +0 -155
  137. package/templates/default/locales/fr/.mustflow/skills/date-number-audit/SKILL.md +0 -116
  138. package/templates/default/locales/fr/.mustflow/skills/dependency-injection/SKILL.md +0 -161
  139. package/templates/default/locales/fr/.mustflow/skills/dependency-reality-check/SKILL.md +0 -115
  140. package/templates/default/locales/fr/.mustflow/skills/diff-risk-review/SKILL.md +0 -136
  141. package/templates/default/locales/fr/.mustflow/skills/docs-prose-review/SKILL.md +0 -119
  142. package/templates/default/locales/fr/.mustflow/skills/docs-update/SKILL.md +0 -97
  143. package/templates/default/locales/fr/.mustflow/skills/external-prompt-injection-defense/SKILL.md +0 -116
  144. package/templates/default/locales/fr/.mustflow/skills/facade-pattern/SKILL.md +0 -210
  145. package/templates/default/locales/fr/.mustflow/skills/failure-triage/SKILL.md +0 -97
  146. package/templates/default/locales/fr/.mustflow/skills/instruction-conflict-scope-check/SKILL.md +0 -118
  147. package/templates/default/locales/fr/.mustflow/skills/line-ending-hygiene/SKILL.md +0 -111
  148. package/templates/default/locales/fr/.mustflow/skills/migration-safety-check/SKILL.md +0 -117
  149. package/templates/default/locales/fr/.mustflow/skills/multi-agent-work-coordination/SKILL.md +0 -260
  150. package/templates/default/locales/fr/.mustflow/skills/null-object-pattern/SKILL.md +0 -196
  151. package/templates/default/locales/fr/.mustflow/skills/pattern-scout/SKILL.md +0 -110
  152. package/templates/default/locales/fr/.mustflow/skills/performance-budget-check/SKILL.md +0 -121
  153. package/templates/default/locales/fr/.mustflow/skills/project-context-authoring/SKILL.md +0 -107
  154. package/templates/default/locales/fr/.mustflow/skills/pure-core-imperative-shell/SKILL.md +0 -212
  155. package/templates/default/locales/fr/.mustflow/skills/readme-authoring/SKILL.md +0 -115
  156. package/templates/default/locales/fr/.mustflow/skills/repo-improvement-loop/SKILL.md +0 -150
  157. package/templates/default/locales/fr/.mustflow/skills/repro-first-debug/SKILL.md +0 -112
  158. package/templates/default/locales/fr/.mustflow/skills/requirement-regression-guard/SKILL.md +0 -152
  159. package/templates/default/locales/fr/.mustflow/skills/result-option/SKILL.md +0 -186
  160. package/templates/default/locales/fr/.mustflow/skills/security-privacy-review/SKILL.md +0 -116
  161. package/templates/default/locales/fr/.mustflow/skills/security-regression-tests/SKILL.md +0 -131
  162. package/templates/default/locales/fr/.mustflow/skills/skill-authoring/SKILL.md +0 -110
  163. package/templates/default/locales/fr/.mustflow/skills/source-freshness-check/SKILL.md +0 -111
  164. package/templates/default/locales/fr/.mustflow/skills/state-machine-pattern/SKILL.md +0 -214
  165. package/templates/default/locales/fr/.mustflow/skills/strategy-pattern/SKILL.md +0 -215
  166. package/templates/default/locales/fr/.mustflow/skills/structure-discovery-gate/SKILL.md +0 -159
  167. package/templates/default/locales/fr/.mustflow/skills/test-design-guard/SKILL.md +0 -162
  168. package/templates/default/locales/fr/.mustflow/skills/test-maintenance/SKILL.md +0 -122
  169. package/templates/default/locales/fr/.mustflow/skills/ui-quality-gate/SKILL.md +0 -117
  170. package/templates/default/locales/fr/.mustflow/skills/visual-review-artifact/SKILL.md +0 -127
  171. package/templates/default/locales/fr/.mustflow/skills/visual-review-artifact/assets/review-template.html +0 -286
  172. package/templates/default/locales/fr/.mustflow/skills/visual-review-artifact/resources.toml +0 -7
  173. package/templates/default/locales/fr/.mustflow/skills/web-asset-optimization/SKILL.md +0 -108
  174. package/templates/default/locales/hi/.mustflow/skills/INDEX.md +0 -75
  175. package/templates/default/locales/hi/.mustflow/skills/adapter-boundary/SKILL.md +0 -193
  176. package/templates/default/locales/hi/.mustflow/skills/artifact-integrity-check/SKILL.md +0 -114
  177. package/templates/default/locales/hi/.mustflow/skills/behavior-preserving-refactor/SKILL.md +0 -182
  178. package/templates/default/locales/hi/.mustflow/skills/code-review/SKILL.md +0 -115
  179. package/templates/default/locales/hi/.mustflow/skills/codebase-orientation/SKILL.md +0 -115
  180. package/templates/default/locales/hi/.mustflow/skills/command-pattern/SKILL.md +0 -247
  181. package/templates/default/locales/hi/.mustflow/skills/composition-over-inheritance/SKILL.md +0 -176
  182. package/templates/default/locales/hi/.mustflow/skills/contract-sync-check/SKILL.md +0 -116
  183. package/templates/default/locales/hi/.mustflow/skills/database-change-safety/SKILL.md +0 -155
  184. package/templates/default/locales/hi/.mustflow/skills/date-number-audit/SKILL.md +0 -116
  185. package/templates/default/locales/hi/.mustflow/skills/dependency-injection/SKILL.md +0 -161
  186. package/templates/default/locales/hi/.mustflow/skills/dependency-reality-check/SKILL.md +0 -115
  187. package/templates/default/locales/hi/.mustflow/skills/diff-risk-review/SKILL.md +0 -136
  188. package/templates/default/locales/hi/.mustflow/skills/docs-prose-review/SKILL.md +0 -119
  189. package/templates/default/locales/hi/.mustflow/skills/docs-update/SKILL.md +0 -97
  190. package/templates/default/locales/hi/.mustflow/skills/external-prompt-injection-defense/SKILL.md +0 -116
  191. package/templates/default/locales/hi/.mustflow/skills/facade-pattern/SKILL.md +0 -210
  192. package/templates/default/locales/hi/.mustflow/skills/failure-triage/SKILL.md +0 -97
  193. package/templates/default/locales/hi/.mustflow/skills/instruction-conflict-scope-check/SKILL.md +0 -118
  194. package/templates/default/locales/hi/.mustflow/skills/line-ending-hygiene/SKILL.md +0 -111
  195. package/templates/default/locales/hi/.mustflow/skills/migration-safety-check/SKILL.md +0 -117
  196. package/templates/default/locales/hi/.mustflow/skills/multi-agent-work-coordination/SKILL.md +0 -260
  197. package/templates/default/locales/hi/.mustflow/skills/null-object-pattern/SKILL.md +0 -196
  198. package/templates/default/locales/hi/.mustflow/skills/pattern-scout/SKILL.md +0 -110
  199. package/templates/default/locales/hi/.mustflow/skills/performance-budget-check/SKILL.md +0 -121
  200. package/templates/default/locales/hi/.mustflow/skills/project-context-authoring/SKILL.md +0 -107
  201. package/templates/default/locales/hi/.mustflow/skills/pure-core-imperative-shell/SKILL.md +0 -212
  202. package/templates/default/locales/hi/.mustflow/skills/readme-authoring/SKILL.md +0 -115
  203. package/templates/default/locales/hi/.mustflow/skills/repo-improvement-loop/SKILL.md +0 -150
  204. package/templates/default/locales/hi/.mustflow/skills/repro-first-debug/SKILL.md +0 -112
  205. package/templates/default/locales/hi/.mustflow/skills/requirement-regression-guard/SKILL.md +0 -152
  206. package/templates/default/locales/hi/.mustflow/skills/result-option/SKILL.md +0 -186
  207. package/templates/default/locales/hi/.mustflow/skills/security-privacy-review/SKILL.md +0 -116
  208. package/templates/default/locales/hi/.mustflow/skills/security-regression-tests/SKILL.md +0 -131
  209. package/templates/default/locales/hi/.mustflow/skills/skill-authoring/SKILL.md +0 -110
  210. package/templates/default/locales/hi/.mustflow/skills/source-freshness-check/SKILL.md +0 -111
  211. package/templates/default/locales/hi/.mustflow/skills/state-machine-pattern/SKILL.md +0 -214
  212. package/templates/default/locales/hi/.mustflow/skills/strategy-pattern/SKILL.md +0 -215
  213. package/templates/default/locales/hi/.mustflow/skills/structure-discovery-gate/SKILL.md +0 -159
  214. package/templates/default/locales/hi/.mustflow/skills/test-design-guard/SKILL.md +0 -162
  215. package/templates/default/locales/hi/.mustflow/skills/test-maintenance/SKILL.md +0 -122
  216. package/templates/default/locales/hi/.mustflow/skills/ui-quality-gate/SKILL.md +0 -117
  217. package/templates/default/locales/hi/.mustflow/skills/visual-review-artifact/SKILL.md +0 -127
  218. package/templates/default/locales/hi/.mustflow/skills/visual-review-artifact/assets/review-template.html +0 -286
  219. package/templates/default/locales/hi/.mustflow/skills/visual-review-artifact/resources.toml +0 -7
  220. package/templates/default/locales/hi/.mustflow/skills/web-asset-optimization/SKILL.md +0 -108
  221. package/templates/default/locales/ko/.mustflow/skills/INDEX.md +0 -80
  222. package/templates/default/locales/ko/.mustflow/skills/adapter-boundary/SKILL.md +0 -193
  223. package/templates/default/locales/ko/.mustflow/skills/artifact-integrity-check/SKILL.md +0 -114
  224. package/templates/default/locales/ko/.mustflow/skills/behavior-preserving-refactor/SKILL.md +0 -182
  225. package/templates/default/locales/ko/.mustflow/skills/code-review/SKILL.md +0 -118
  226. package/templates/default/locales/ko/.mustflow/skills/codebase-orientation/SKILL.md +0 -115
  227. package/templates/default/locales/ko/.mustflow/skills/command-pattern/SKILL.md +0 -247
  228. package/templates/default/locales/ko/.mustflow/skills/composition-over-inheritance/SKILL.md +0 -176
  229. package/templates/default/locales/ko/.mustflow/skills/contract-sync-check/SKILL.md +0 -116
  230. package/templates/default/locales/ko/.mustflow/skills/database-change-safety/SKILL.md +0 -155
  231. package/templates/default/locales/ko/.mustflow/skills/date-number-audit/SKILL.md +0 -116
  232. package/templates/default/locales/ko/.mustflow/skills/dependency-injection/SKILL.md +0 -161
  233. package/templates/default/locales/ko/.mustflow/skills/dependency-reality-check/SKILL.md +0 -115
  234. package/templates/default/locales/ko/.mustflow/skills/diff-risk-review/SKILL.md +0 -136
  235. package/templates/default/locales/ko/.mustflow/skills/docs-prose-review/SKILL.md +0 -119
  236. package/templates/default/locales/ko/.mustflow/skills/docs-update/SKILL.md +0 -107
  237. package/templates/default/locales/ko/.mustflow/skills/external-prompt-injection-defense/SKILL.md +0 -116
  238. package/templates/default/locales/ko/.mustflow/skills/facade-pattern/SKILL.md +0 -210
  239. package/templates/default/locales/ko/.mustflow/skills/failure-triage/SKILL.md +0 -119
  240. package/templates/default/locales/ko/.mustflow/skills/instruction-conflict-scope-check/SKILL.md +0 -118
  241. package/templates/default/locales/ko/.mustflow/skills/line-ending-hygiene/SKILL.md +0 -111
  242. package/templates/default/locales/ko/.mustflow/skills/migration-safety-check/SKILL.md +0 -117
  243. package/templates/default/locales/ko/.mustflow/skills/multi-agent-work-coordination/SKILL.md +0 -259
  244. package/templates/default/locales/ko/.mustflow/skills/null-object-pattern/SKILL.md +0 -196
  245. package/templates/default/locales/ko/.mustflow/skills/pattern-scout/SKILL.md +0 -110
  246. package/templates/default/locales/ko/.mustflow/skills/performance-budget-check/SKILL.md +0 -121
  247. package/templates/default/locales/ko/.mustflow/skills/project-context-authoring/SKILL.md +0 -107
  248. package/templates/default/locales/ko/.mustflow/skills/pure-core-imperative-shell/SKILL.md +0 -212
  249. package/templates/default/locales/ko/.mustflow/skills/readme-authoring/SKILL.md +0 -115
  250. package/templates/default/locales/ko/.mustflow/skills/repo-improvement-loop/SKILL.md +0 -150
  251. package/templates/default/locales/ko/.mustflow/skills/repro-first-debug/SKILL.md +0 -112
  252. package/templates/default/locales/ko/.mustflow/skills/requirement-regression-guard/SKILL.md +0 -152
  253. package/templates/default/locales/ko/.mustflow/skills/result-option/SKILL.md +0 -186
  254. package/templates/default/locales/ko/.mustflow/skills/security-privacy-review/SKILL.md +0 -116
  255. package/templates/default/locales/ko/.mustflow/skills/security-regression-tests/SKILL.md +0 -131
  256. package/templates/default/locales/ko/.mustflow/skills/skill-authoring/SKILL.md +0 -110
  257. package/templates/default/locales/ko/.mustflow/skills/source-freshness-check/SKILL.md +0 -111
  258. package/templates/default/locales/ko/.mustflow/skills/state-machine-pattern/SKILL.md +0 -214
  259. package/templates/default/locales/ko/.mustflow/skills/strategy-pattern/SKILL.md +0 -215
  260. package/templates/default/locales/ko/.mustflow/skills/structure-discovery-gate/SKILL.md +0 -159
  261. package/templates/default/locales/ko/.mustflow/skills/test-design-guard/SKILL.md +0 -162
  262. package/templates/default/locales/ko/.mustflow/skills/test-maintenance/SKILL.md +0 -130
  263. package/templates/default/locales/ko/.mustflow/skills/ui-quality-gate/SKILL.md +0 -117
  264. package/templates/default/locales/ko/.mustflow/skills/visual-review-artifact/SKILL.md +0 -127
  265. package/templates/default/locales/ko/.mustflow/skills/visual-review-artifact/assets/review-template.html +0 -286
  266. package/templates/default/locales/ko/.mustflow/skills/visual-review-artifact/resources.toml +0 -7
  267. package/templates/default/locales/ko/.mustflow/skills/web-asset-optimization/SKILL.md +0 -108
  268. package/templates/default/locales/zh/.mustflow/skills/INDEX.md +0 -74
  269. package/templates/default/locales/zh/.mustflow/skills/adapter-boundary/SKILL.md +0 -193
  270. package/templates/default/locales/zh/.mustflow/skills/artifact-integrity-check/SKILL.md +0 -114
  271. package/templates/default/locales/zh/.mustflow/skills/behavior-preserving-refactor/SKILL.md +0 -182
  272. package/templates/default/locales/zh/.mustflow/skills/code-review/SKILL.md +0 -115
  273. package/templates/default/locales/zh/.mustflow/skills/codebase-orientation/SKILL.md +0 -115
  274. package/templates/default/locales/zh/.mustflow/skills/command-pattern/SKILL.md +0 -247
  275. package/templates/default/locales/zh/.mustflow/skills/composition-over-inheritance/SKILL.md +0 -176
  276. package/templates/default/locales/zh/.mustflow/skills/contract-sync-check/SKILL.md +0 -116
  277. package/templates/default/locales/zh/.mustflow/skills/database-change-safety/SKILL.md +0 -155
  278. package/templates/default/locales/zh/.mustflow/skills/date-number-audit/SKILL.md +0 -116
  279. package/templates/default/locales/zh/.mustflow/skills/dependency-injection/SKILL.md +0 -161
  280. package/templates/default/locales/zh/.mustflow/skills/dependency-reality-check/SKILL.md +0 -115
  281. package/templates/default/locales/zh/.mustflow/skills/diff-risk-review/SKILL.md +0 -136
  282. package/templates/default/locales/zh/.mustflow/skills/docs-prose-review/SKILL.md +0 -119
  283. package/templates/default/locales/zh/.mustflow/skills/docs-update/SKILL.md +0 -97
  284. package/templates/default/locales/zh/.mustflow/skills/external-prompt-injection-defense/SKILL.md +0 -116
  285. package/templates/default/locales/zh/.mustflow/skills/facade-pattern/SKILL.md +0 -210
  286. package/templates/default/locales/zh/.mustflow/skills/failure-triage/SKILL.md +0 -96
  287. package/templates/default/locales/zh/.mustflow/skills/instruction-conflict-scope-check/SKILL.md +0 -118
  288. package/templates/default/locales/zh/.mustflow/skills/line-ending-hygiene/SKILL.md +0 -111
  289. package/templates/default/locales/zh/.mustflow/skills/migration-safety-check/SKILL.md +0 -117
  290. package/templates/default/locales/zh/.mustflow/skills/multi-agent-work-coordination/SKILL.md +0 -260
  291. package/templates/default/locales/zh/.mustflow/skills/null-object-pattern/SKILL.md +0 -196
  292. package/templates/default/locales/zh/.mustflow/skills/pattern-scout/SKILL.md +0 -110
  293. package/templates/default/locales/zh/.mustflow/skills/performance-budget-check/SKILL.md +0 -121
  294. package/templates/default/locales/zh/.mustflow/skills/project-context-authoring/SKILL.md +0 -107
  295. package/templates/default/locales/zh/.mustflow/skills/pure-core-imperative-shell/SKILL.md +0 -212
  296. package/templates/default/locales/zh/.mustflow/skills/readme-authoring/SKILL.md +0 -115
  297. package/templates/default/locales/zh/.mustflow/skills/repo-improvement-loop/SKILL.md +0 -150
  298. package/templates/default/locales/zh/.mustflow/skills/repro-first-debug/SKILL.md +0 -112
  299. package/templates/default/locales/zh/.mustflow/skills/requirement-regression-guard/SKILL.md +0 -152
  300. package/templates/default/locales/zh/.mustflow/skills/result-option/SKILL.md +0 -186
  301. package/templates/default/locales/zh/.mustflow/skills/security-privacy-review/SKILL.md +0 -116
  302. package/templates/default/locales/zh/.mustflow/skills/security-regression-tests/SKILL.md +0 -131
  303. package/templates/default/locales/zh/.mustflow/skills/skill-authoring/SKILL.md +0 -110
  304. package/templates/default/locales/zh/.mustflow/skills/source-freshness-check/SKILL.md +0 -111
  305. package/templates/default/locales/zh/.mustflow/skills/state-machine-pattern/SKILL.md +0 -214
  306. package/templates/default/locales/zh/.mustflow/skills/strategy-pattern/SKILL.md +0 -215
  307. package/templates/default/locales/zh/.mustflow/skills/structure-discovery-gate/SKILL.md +0 -159
  308. package/templates/default/locales/zh/.mustflow/skills/test-design-guard/SKILL.md +0 -162
  309. package/templates/default/locales/zh/.mustflow/skills/test-maintenance/SKILL.md +0 -122
  310. package/templates/default/locales/zh/.mustflow/skills/ui-quality-gate/SKILL.md +0 -117
  311. package/templates/default/locales/zh/.mustflow/skills/visual-review-artifact/SKILL.md +0 -127
  312. package/templates/default/locales/zh/.mustflow/skills/visual-review-artifact/assets/review-template.html +0 -286
  313. package/templates/default/locales/zh/.mustflow/skills/visual-review-artifact/resources.toml +0 -7
  314. package/templates/default/locales/zh/.mustflow/skills/web-asset-optimization/SKILL.md +0 -108
@@ -1,7 +1,60 @@
1
- import { COMMAND_LIFECYCLES, COMMAND_RUN_POLICIES, LONG_RUNNING_LIFECYCLES, isRecord, readPositiveInteger, readString, } from './config-loading.js';
2
- import { evaluateCommandIntentEligibility } from './command-intent-eligibility.js';
1
+ import { existsSync, readFileSync } from 'node:fs';
2
+ import path from 'node:path';
3
+ import { COMMAND_LIFECYCLES, COMMAND_RUN_POLICIES, LONG_RUNNING_LIFECYCLES, isRecord, readPositiveInteger, readString, readStringArray, } from './config-loading.js';
4
+ import { evaluateCommandIntentEligibility, } from './command-intent-eligibility.js';
3
5
  import { commandIntentHasBlockedShellBackgroundPattern, commandIntentHasCommandSource, commandIntentNameIsSafe, } from './command-contract-rules.js';
4
- const CONTRACT_LINT_SOURCE_FILES = ['.mustflow/config/commands.toml', '.mustflow/docs/agent-workflow.md', 'AGENTS.md'];
6
+ import { commandEffectsConflict, normalizeCommandEffects } from './command-effects.js';
7
+ import { listChangeClassificationValidationReasons } from './change-classification.js';
8
+ import { parseSkillIndexRoutes } from './skill-route-alignment.js';
9
+ const CONTRACT_LINT_SOURCE_FILES = [
10
+ '.mustflow/config/commands.toml',
11
+ '.mustflow/docs/agent-workflow.md',
12
+ 'AGENTS.md',
13
+ 'src/core/change-classification.ts',
14
+ ];
15
+ export const DOCUMENTED_VERIFICATION_REASONS = [
16
+ 'before_publish',
17
+ 'before_final_report',
18
+ 'before_task',
19
+ 'behavior_change',
20
+ 'behavior_removed',
21
+ 'build_config_change',
22
+ 'clean_mustflow_update_plan',
23
+ 'commit_message_suggestion',
24
+ 'coverage_request',
25
+ 'cross_cutting_code_change',
26
+ 'directory_change',
27
+ 'formatting_change',
28
+ 'image_asset_change',
29
+ 'line_ending_warning',
30
+ 'low_risk_code_change',
31
+ 'snapshot_change',
32
+ 'structure_change',
33
+ 'style_change',
34
+ 'template_update_apply',
35
+ 'template_update_check',
36
+ 'test_policy_change',
37
+ 'user_approved_snapshot_update',
38
+ 'user_requested_line_ending_normalization',
39
+ 'web_asset_change',
40
+ ];
41
+ const RELEASE_SENSITIVE_REASONS = new Set([
42
+ 'package_metadata_change',
43
+ 'packaging_change',
44
+ 'release_risk',
45
+ 'template_version_change',
46
+ ]);
47
+ const COMMANDS_CONFIG_PATH = '.mustflow/config/commands.toml';
48
+ const SKILL_INDEX_PATH = '.mustflow/skills/INDEX.md';
49
+ const CHANGE_CLASSIFICATION_SOURCE_PATH = 'src/core/change-classification.ts';
50
+ const AGENT_WORKFLOW_PATH = '.mustflow/docs/agent-workflow.md';
51
+ function uniqueSorted(values) {
52
+ return [...new Set(values)].sort((left, right) => left.localeCompare(right));
53
+ }
54
+ function intersectSorted(left, right) {
55
+ const rightSet = new Set(right);
56
+ return uniqueSorted(left.filter((value) => rightSet.has(value)));
57
+ }
5
58
  function readBoolean(intent, key) {
6
59
  const value = intent[key];
7
60
  return typeof value === 'boolean' ? value : null;
@@ -17,6 +70,17 @@ function writesAreValid(intent) {
17
70
  function pushIssue(issues, severity, code, intent, message) {
18
71
  issues.push({ severity, code, intent, message });
19
72
  }
73
+ function pushCoverageFinding(issues, findings, severity, code, reason, intent, intents, message) {
74
+ findings.push({
75
+ severity,
76
+ code,
77
+ reason,
78
+ intent,
79
+ intents: [...intents].sort((left, right) => left.localeCompare(right)),
80
+ message,
81
+ });
82
+ pushIssue(issues, severity, code, intent, message);
83
+ }
20
84
  function configuredIntentIsRunnable(intent) {
21
85
  return evaluateCommandIntentEligibility('summary', intent).ok;
22
86
  }
@@ -79,18 +143,209 @@ function lintIntent(name, value, issues) {
79
143
  }
80
144
  return value;
81
145
  }
146
+ function collectRequiredAfterReasons(contract) {
147
+ const reasonToIntents = new Map();
148
+ for (const [name, intent] of Object.entries(contract.intents)) {
149
+ if (!isRecord(intent)) {
150
+ continue;
151
+ }
152
+ for (const reason of readStringArray(intent, 'required_after') ?? []) {
153
+ reasonToIntents.set(reason, [
154
+ ...(reasonToIntents.get(reason) ?? []),
155
+ {
156
+ name,
157
+ intent,
158
+ runnable: evaluateCommandIntentEligibility(name, intent).ok,
159
+ },
160
+ ]);
161
+ }
162
+ }
163
+ return reasonToIntents;
164
+ }
165
+ function readSkillPathsByIntent(projectRoot) {
166
+ const skillPathsByIntent = new Map();
167
+ if (!projectRoot) {
168
+ return skillPathsByIntent;
169
+ }
170
+ const skillIndexPath = path.join(projectRoot, ...SKILL_INDEX_PATH.split('/'));
171
+ if (!existsSync(skillIndexPath)) {
172
+ return skillPathsByIntent;
173
+ }
174
+ const routes = parseSkillIndexRoutes(readFileSync(skillIndexPath, 'utf8'));
175
+ for (const route of routes) {
176
+ for (const intent of route.commandIntents) {
177
+ skillPathsByIntent.set(intent, [...(skillPathsByIntent.get(intent) ?? []), route.skillPath]);
178
+ }
179
+ }
180
+ return skillPathsByIntent;
181
+ }
182
+ function classifyReasonSource(reason, knownClassificationReasons, documentedVerificationReasons) {
183
+ if (knownClassificationReasons.includes(reason)) {
184
+ return 'classification';
185
+ }
186
+ if (documentedVerificationReasons.includes(reason)) {
187
+ return 'documented';
188
+ }
189
+ return 'required_after';
190
+ }
191
+ function buildRelatedDocs(source, relatedSkills) {
192
+ const docs = [COMMANDS_CONFIG_PATH];
193
+ if (source === 'classification') {
194
+ docs.push(CHANGE_CLASSIFICATION_SOURCE_PATH);
195
+ }
196
+ if (source === 'documented') {
197
+ docs.push(AGENT_WORKFLOW_PATH);
198
+ }
199
+ if (relatedSkills.length > 0) {
200
+ docs.push(SKILL_INDEX_PATH);
201
+ }
202
+ return uniqueSorted(docs);
203
+ }
204
+ function buildCoverageMatrix(reasonToIntents, knownClassificationReasons, documentedVerificationReasons, skillPathsByIntent) {
205
+ const matrixReasons = uniqueSorted([
206
+ ...knownClassificationReasons,
207
+ ...documentedVerificationReasons,
208
+ ...reasonToIntents.keys(),
209
+ ]);
210
+ return matrixReasons.map((reason) => {
211
+ const candidates = [...(reasonToIntents.get(reason) ?? [])].sort((left, right) => left.name.localeCompare(right.name));
212
+ const source = classifyReasonSource(reason, knownClassificationReasons, documentedVerificationReasons);
213
+ const intentNames = candidates.map((candidate) => candidate.name);
214
+ const relatedSkills = uniqueSorted(intentNames.flatMap((intent) => skillPathsByIntent.get(intent) ?? []));
215
+ const gaps = [];
216
+ if (candidates.length === 0) {
217
+ gaps.push('missing_required_after');
218
+ }
219
+ else if (!candidates.some((candidate) => candidate.runnable)) {
220
+ gaps.push('no_runnable_intent');
221
+ }
222
+ if (source === 'required_after') {
223
+ gaps.push('unknown_reason');
224
+ }
225
+ if (intentNames.length > 0 && intersectSorted(intentNames, [...skillPathsByIntent.keys()]).length === 0) {
226
+ gaps.push('no_related_skill_route');
227
+ }
228
+ return {
229
+ reason,
230
+ source,
231
+ intents: candidates.map((candidate) => {
232
+ const eligibility = evaluateCommandIntentEligibility(candidate.name, candidate.intent);
233
+ return {
234
+ intent: candidate.name,
235
+ status: eligibility.code,
236
+ runnable: eligibility.ok,
237
+ detail: eligibility.detail,
238
+ };
239
+ }),
240
+ gaps: uniqueSorted(gaps),
241
+ relatedSkills,
242
+ relatedDocs: buildRelatedDocs(source, relatedSkills),
243
+ };
244
+ });
245
+ }
246
+ function hasExplicitEffectMetadata(intent) {
247
+ return Array.isArray(intent.effects) && intent.effects.some((effect) => isRecord(effect));
248
+ }
249
+ function intentLooksReleaseFocused(name, intent) {
250
+ const text = `${name} ${readString(intent, 'description') ?? ''}`.toLowerCase();
251
+ return /(?:^|[_\W])(?:release|package|pack|packaging|publish)(?:$|[_\W])/u.test(text);
252
+ }
253
+ function addConflictingWriteCoverageWarnings(contract, projectRoot, reason, candidates, issues, findings) {
254
+ if (!projectRoot) {
255
+ return;
256
+ }
257
+ const runnableCandidates = candidates.filter((candidate) => candidate.runnable);
258
+ for (let leftIndex = 0; leftIndex < runnableCandidates.length; leftIndex += 1) {
259
+ const left = runnableCandidates[leftIndex];
260
+ const leftHasExplicitEffects = hasExplicitEffectMetadata(left.intent);
261
+ let leftEffects;
262
+ try {
263
+ leftEffects = normalizeCommandEffects(projectRoot, contract, left.name);
264
+ }
265
+ catch {
266
+ continue;
267
+ }
268
+ for (let rightIndex = leftIndex + 1; rightIndex < runnableCandidates.length; rightIndex += 1) {
269
+ const right = runnableCandidates[rightIndex];
270
+ const rightHasExplicitEffects = hasExplicitEffectMetadata(right.intent);
271
+ if (leftHasExplicitEffects && rightHasExplicitEffects) {
272
+ continue;
273
+ }
274
+ let rightEffects;
275
+ try {
276
+ rightEffects = normalizeCommandEffects(projectRoot, contract, right.name);
277
+ }
278
+ catch {
279
+ continue;
280
+ }
281
+ const conflicts = leftEffects.some((leftEffect) => rightEffects.some((rightEffect) => commandEffectsConflict(leftEffect, rightEffect)));
282
+ if (!conflicts) {
283
+ continue;
284
+ }
285
+ pushCoverageFinding(issues, findings, 'warning', 'coverage_conflicting_writes_without_effects', reason, null, [left.name, right.name], `Reason "${reason}" selects runnable intents ${left.name} and ${right.name} that share write effects without explicit effects or resource locks.`);
286
+ }
287
+ }
288
+ }
289
+ function lintCoverage(contract, options, issues) {
290
+ const findings = [];
291
+ const knownClassificationReasons = listChangeClassificationValidationReasons();
292
+ const documentedVerificationReasons = [...DOCUMENTED_VERIFICATION_REASONS];
293
+ const knownReasons = new Set([...knownClassificationReasons, ...documentedVerificationReasons]);
294
+ const reasonToIntents = collectRequiredAfterReasons(contract);
295
+ const skillPathsByIntent = readSkillPathsByIntent(options.projectRoot);
296
+ const requiredAfterReasons = uniqueSorted(reasonToIntents.keys());
297
+ const runnableReasons = uniqueSorted([...reasonToIntents.entries()]
298
+ .filter(([, candidates]) => candidates.some((candidate) => candidate.runnable))
299
+ .map(([reason]) => reason));
300
+ for (const reason of knownClassificationReasons) {
301
+ const candidates = reasonToIntents.get(reason) ?? [];
302
+ if (candidates.length === 0) {
303
+ pushCoverageFinding(issues, findings, 'warning', 'coverage_uncovered_classification_reason', reason, null, [], `Classification reason "${reason}" has no matching required_after entry in commands.toml.`);
304
+ continue;
305
+ }
306
+ if (!candidates.some((candidate) => candidate.runnable)) {
307
+ pushCoverageFinding(issues, findings, 'warning', 'coverage_reason_not_runnable', reason, null, candidates.map((candidate) => candidate.name), `Reason "${reason}" is covered only by non-runnable intents: ${candidates
308
+ .map((candidate) => candidate.name)
309
+ .sort((left, right) => left.localeCompare(right))
310
+ .join(', ')}.`);
311
+ }
312
+ addConflictingWriteCoverageWarnings(contract, options.projectRoot, reason, candidates, issues, findings);
313
+ }
314
+ for (const [reason, candidates] of reasonToIntents) {
315
+ if (knownReasons.has(reason)) {
316
+ continue;
317
+ }
318
+ pushCoverageFinding(issues, findings, 'warning', 'coverage_unknown_required_after', reason, null, candidates.map((candidate) => candidate.name), `required_after reason "${reason}" is not emitted by change classification or listed as a documented verification reason.`);
319
+ }
320
+ if (options.releaseVersioningEnabled === true) {
321
+ const hasReleaseVerificationPath = [...reasonToIntents.entries()].some(([reason, candidates]) => RELEASE_SENSITIVE_REASONS.has(reason) &&
322
+ candidates.some((candidate) => candidate.runnable && intentLooksReleaseFocused(candidate.name, candidate.intent)));
323
+ if (!hasReleaseVerificationPath) {
324
+ pushCoverageFinding(issues, findings, 'warning', 'coverage_release_path_missing', null, null, [], 'Release versioning is enabled, but release-sensitive reasons have no runnable release or package verification intent.');
325
+ }
326
+ }
327
+ return {
328
+ knownClassificationReasons,
329
+ documentedVerificationReasons,
330
+ requiredAfterReasons,
331
+ runnableReasons,
332
+ matrix: buildCoverageMatrix(reasonToIntents, knownClassificationReasons, documentedVerificationReasons, skillPathsByIntent),
333
+ findings,
334
+ };
335
+ }
82
336
  function getStatus(errors, warnings) {
83
337
  if (errors > 0) {
84
338
  return 'failed';
85
339
  }
86
340
  return warnings > 0 ? 'warning' : 'passed';
87
341
  }
88
- export function lintCommandContract(contract) {
342
+ export function lintCommandContract(contract, options = {}) {
89
343
  const issues = [];
90
344
  const intentEntries = Object.entries(contract.intents);
91
345
  const intentTables = intentEntries
92
346
  .map(([name, value]) => lintIntent(name, value, issues))
93
347
  .filter((intent) => intent !== null);
348
+ const coverage = options.coverage === true ? lintCoverage(contract, options, issues) : undefined;
94
349
  const errors = issues.filter((issue) => issue.severity === 'error').length;
95
350
  const warnings = issues.length - errors;
96
351
  return {
@@ -106,5 +361,6 @@ export function lintCommandContract(contract) {
106
361
  },
107
362
  issues,
108
363
  sourceFiles: CONTRACT_LINT_SOURCE_FILES,
364
+ coverage,
109
365
  };
110
366
  }
@@ -1,3 +1,6 @@
1
+ import path from 'node:path';
2
+ import { PUBLIC_SURFACE_UPDATE_POLICIES } from './change-classification.js';
3
+ import { isRecord } from './config-loading.js';
1
4
  export const CONTRACT_MODEL_DEFINITIONS = [
2
5
  {
3
6
  id: 'changes',
@@ -51,3 +54,172 @@ export function getNonInstalledContractConfigPaths() {
51
54
  .filter((model) => !model.installByDefault)
52
55
  .map((model) => model.filePath);
53
56
  }
57
+ const PATH_CLASSIFICATION_MODEL_IDS = new Set(['changes', 'surfaces']);
58
+ const ALLOWED_TOP_LEVEL_FIELDS = new Set(['schema_version', 'rules']);
59
+ const ALLOWED_RULE_FIELDS = new Set([
60
+ 'id',
61
+ 'description',
62
+ 'match',
63
+ 'change_kinds',
64
+ 'surface_kind',
65
+ 'category',
66
+ 'is_public_surface',
67
+ 'validation_reasons',
68
+ 'affected_contracts',
69
+ 'update_policy',
70
+ 'drift_checks',
71
+ ]);
72
+ const ALLOWED_MATCH_FIELDS = new Set(['kind', 'path']);
73
+ const ALLOWED_MATCH_KINDS = new Set(['exact', 'prefix', 'glob']);
74
+ const ALLOWED_UPDATE_POLICIES = new Set(PUBLIC_SURFACE_UPDATE_POLICIES);
75
+ const FORBIDDEN_PATH_CLASSIFICATION_AUTHORITY_FIELDS = new Set([
76
+ 'argv',
77
+ 'cmd',
78
+ 'run_policy',
79
+ 'lifecycle',
80
+ 'stdin',
81
+ 'timeout_seconds',
82
+ 'writes',
83
+ 'network',
84
+ 'destructive',
85
+ 'required_after',
86
+ 'skip_validation',
87
+ 'status',
88
+ 'intents',
89
+ 'command_intents',
90
+ 'commands',
91
+ 'command',
92
+ 'run',
93
+ 'execute',
94
+ 'action',
95
+ 'actions',
96
+ 'agent_action',
97
+ 'agent_actions',
98
+ ]);
99
+ function pushIssue(issues, code, pathLabel, message) {
100
+ issues.push({ code, path: pathLabel, message });
101
+ }
102
+ function isSafeRelativePath(value) {
103
+ if (typeof value !== 'string' || value.trim().length === 0) {
104
+ return false;
105
+ }
106
+ const normalized = value.replaceAll('\\', '/');
107
+ const segments = normalized.split('/').filter(Boolean);
108
+ if (path.posix.isAbsolute(normalized) || path.win32.isAbsolute(value)) {
109
+ return false;
110
+ }
111
+ return segments.length > 0 && segments.every((segment) => segment !== '.' && segment !== '..');
112
+ }
113
+ function validateStringArrayField(table, key, pathLabel, issues) {
114
+ if (!Object.hasOwn(table, key)) {
115
+ return;
116
+ }
117
+ const value = table[key];
118
+ if (!Array.isArray(value) || value.some((entry) => typeof entry !== 'string' || entry.trim().length === 0)) {
119
+ pushIssue(issues, 'invalid_string_array', `${pathLabel}.${key}`, `${pathLabel}.${key} must be a string array`);
120
+ }
121
+ }
122
+ function validateForbiddenAuthorityFields(value, pathLabel, issues) {
123
+ if (Array.isArray(value)) {
124
+ value.forEach((entry, index) => validateForbiddenAuthorityFields(entry, `${pathLabel}[${index}]`, issues));
125
+ return;
126
+ }
127
+ if (!isRecord(value)) {
128
+ return;
129
+ }
130
+ for (const [key, nestedValue] of Object.entries(value)) {
131
+ const fieldPath = pathLabel ? `${pathLabel}.${key}` : key;
132
+ if (FORBIDDEN_PATH_CLASSIFICATION_AUTHORITY_FIELDS.has(key)) {
133
+ pushIssue(issues, 'command_authority_field', fieldPath, `${fieldPath} cannot define command authority; use .mustflow/config/commands.toml`);
134
+ }
135
+ validateForbiddenAuthorityFields(nestedValue, fieldPath, issues);
136
+ }
137
+ }
138
+ function validateMatchTable(match, pathLabel, issues) {
139
+ if (!isRecord(match)) {
140
+ pushIssue(issues, 'invalid_match', pathLabel, `${pathLabel} must be a TOML table`);
141
+ return;
142
+ }
143
+ for (const key of Object.keys(match)) {
144
+ if (!ALLOWED_MATCH_FIELDS.has(key)) {
145
+ pushIssue(issues, 'unknown_rule_field', `${pathLabel}.${key}`, `${pathLabel}.${key} is not allowed`);
146
+ }
147
+ }
148
+ if (!ALLOWED_MATCH_KINDS.has(String(match.kind))) {
149
+ pushIssue(issues, 'invalid_match_kind', `${pathLabel}.kind`, `${pathLabel}.kind must be "exact", "prefix", or "glob"; regular expressions are deferred`);
150
+ }
151
+ if (!isSafeRelativePath(match.path)) {
152
+ pushIssue(issues, 'invalid_match_path', `${pathLabel}.path`, `${pathLabel}.path must be a non-empty relative path inside the current root`);
153
+ }
154
+ }
155
+ function validatePathClassificationRule(rule, index, issues) {
156
+ const pathLabel = `rules[${index}]`;
157
+ if (!isRecord(rule)) {
158
+ pushIssue(issues, 'rule_not_table', pathLabel, `${pathLabel} must be a TOML table`);
159
+ return;
160
+ }
161
+ for (const key of Object.keys(rule)) {
162
+ if (!ALLOWED_RULE_FIELDS.has(key)) {
163
+ pushIssue(issues, 'unknown_rule_field', `${pathLabel}.${key}`, `${pathLabel}.${key} is not allowed`);
164
+ }
165
+ }
166
+ if (typeof rule.id !== 'string' || rule.id.trim().length === 0) {
167
+ pushIssue(issues, 'invalid_rule_id', `${pathLabel}.id`, `${pathLabel}.id must be a non-empty string`);
168
+ }
169
+ validateMatchTable(rule.match, `${pathLabel}.match`, issues);
170
+ validateStringArrayField(rule, 'change_kinds', pathLabel, issues);
171
+ validateStringArrayField(rule, 'validation_reasons', pathLabel, issues);
172
+ validateStringArrayField(rule, 'affected_contracts', pathLabel, issues);
173
+ validateStringArrayField(rule, 'drift_checks', pathLabel, issues);
174
+ if (Object.hasOwn(rule, 'is_public_surface') && typeof rule.is_public_surface !== 'boolean') {
175
+ pushIssue(issues, 'invalid_boolean', `${pathLabel}.is_public_surface`, `${pathLabel}.is_public_surface must be a boolean`);
176
+ }
177
+ if (Object.hasOwn(rule, 'update_policy') && !ALLOWED_UPDATE_POLICIES.has(String(rule.update_policy))) {
178
+ pushIssue(issues, 'invalid_update_policy', `${pathLabel}.update_policy`, `${pathLabel}.update_policy must be "update", "update_or_mark_stale", or "not_applicable"`);
179
+ }
180
+ }
181
+ function validatePathClassificationModelConfig(value) {
182
+ const issues = [];
183
+ if (!isRecord(value)) {
184
+ pushIssue(issues, 'root_not_table', '', 'must contain a TOML table');
185
+ return issues;
186
+ }
187
+ validateForbiddenAuthorityFields(value, '', issues);
188
+ for (const key of Object.keys(value)) {
189
+ if (!ALLOWED_TOP_LEVEL_FIELDS.has(key)) {
190
+ pushIssue(issues, 'unknown_top_level_field', key, `${key} is not allowed at the top level`);
191
+ }
192
+ }
193
+ if (Object.hasOwn(value, 'schema_version') && typeof value.schema_version !== 'string') {
194
+ pushIssue(issues, 'invalid_schema_version', 'schema_version', 'schema_version must be a string');
195
+ }
196
+ if (!Object.hasOwn(value, 'rules')) {
197
+ pushIssue(issues, 'missing_rules', 'rules', 'must define [[rules]]');
198
+ return issues;
199
+ }
200
+ const rules = value.rules;
201
+ if (!Array.isArray(rules) || rules.length === 0) {
202
+ pushIssue(issues, 'rules_not_array', 'rules', 'rules must be a non-empty array of TOML tables');
203
+ return issues;
204
+ }
205
+ rules.forEach((rule, index) => validatePathClassificationRule(rule, index, issues));
206
+ return issues;
207
+ }
208
+ export function validateCandidateContractModelConfig(model, value) {
209
+ if (model.status === 'deferred') {
210
+ return [
211
+ {
212
+ code: 'deferred_model_present',
213
+ path: model.filePath,
214
+ message: `${model.filePath} is deferred; use narrow candidate contract files instead`,
215
+ },
216
+ ];
217
+ }
218
+ if (!PATH_CLASSIFICATION_MODEL_IDS.has(model.id)) {
219
+ return [];
220
+ }
221
+ return validatePathClassificationModelConfig(value).map((issue) => ({
222
+ ...issue,
223
+ message: issue.path ? `${model.filePath} ${issue.message}` : `${model.filePath} ${issue.message}`,
224
+ }));
225
+ }
@@ -68,10 +68,16 @@ function createEmptyDashboardVerificationSnapshot(changedFiles) {
68
68
  skipped: [],
69
69
  schedule: {
70
70
  runner: 'serial_mf_run_receipts',
71
+ failurePolicy: {
72
+ mode: 'batch_boundary',
73
+ startedBatch: 'wait_for_completion',
74
+ nextBatch: 'stop_on_failure',
75
+ },
71
76
  batches: [],
72
77
  entries: [],
73
78
  notes: [],
74
79
  },
80
+ decision_graph: null,
75
81
  };
76
82
  }
77
83
  export function createDashboardVerificationSnapshot(projectRoot, rawCommandContract, commandIntents, changedFiles, manifestChangedFiles, manifestMissingFiles) {
@@ -103,6 +109,7 @@ export function createDashboardVerificationSnapshot(projectRoot, rawCommandContr
103
109
  skipped,
104
110
  schedule: {
105
111
  runner: verificationReport.schedule.runner,
112
+ failurePolicy: verificationReport.schedule.failurePolicy,
106
113
  batches: verificationReport.schedule.batches.map((batch) => ({
107
114
  index: batch.index,
108
115
  intents: batch.intents,
@@ -112,6 +119,8 @@ export function createDashboardVerificationSnapshot(projectRoot, rawCommandContr
112
119
  entries: verificationReport.schedule.entries.map((entry) => ({
113
120
  intent: entry.intent,
114
121
  command: `mf run ${entry.intent}`,
122
+ parallelEligible: entry.parallelEligible,
123
+ parallelReason: entry.parallelReason,
115
124
  locks: entry.locks,
116
125
  effects: entry.effects.map((effect) => ({
117
126
  access: effect.access,
@@ -128,5 +137,6 @@ export function createDashboardVerificationSnapshot(projectRoot, rawCommandContr
128
137
  })),
129
138
  notes: verificationReport.schedule.notes,
130
139
  },
140
+ decision_graph: verificationReport.decision_graph,
131
141
  };
132
142
  }
@@ -8,6 +8,7 @@ const P0_EXACT_PATHS = new Set([
8
8
  const AUTHORITY_OR_SECURITY_SKILLS = new Set([
9
9
  'contract-sync-check',
10
10
  'external-prompt-injection-defense',
11
+ 'external-skill-intake',
11
12
  'instruction-conflict-scope-check',
12
13
  'migration-safety-check',
13
14
  'multi-agent-work-coordination',