mustflow 1.18.15 → 1.30.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 (303) hide show
  1. package/README.md +16 -6
  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 +97 -136
  10. package/dist/cli/commands/update.js +111 -73
  11. package/dist/cli/commands/verify.js +230 -137
  12. package/dist/cli/i18n/en.js +65 -4
  13. package/dist/cli/i18n/es.js +65 -4
  14. package/dist/cli/i18n/fr.js +65 -4
  15. package/dist/cli/i18n/hi.js +65 -4
  16. package/dist/cli/i18n/ko.js +65 -4
  17. package/dist/cli/i18n/zh.js +65 -4
  18. package/dist/cli/index.js +11 -0
  19. package/dist/cli/lib/command-registry.js +10 -0
  20. package/dist/cli/lib/dashboard-export.js +775 -0
  21. package/dist/cli/lib/local-index.js +22 -6
  22. package/dist/cli/lib/run-plan.js +222 -0
  23. package/dist/cli/lib/templates.js +27 -9
  24. package/dist/cli/lib/update-diff-preview.js +163 -0
  25. package/dist/cli/lib/validation.js +22 -0
  26. package/dist/core/adapter-compatibility.js +235 -0
  27. package/dist/core/change-classification.js +9 -0
  28. package/dist/core/change-verification.js +10 -3
  29. package/dist/core/check-issues.js +4 -0
  30. package/dist/core/command-contract-validation.js +14 -0
  31. package/dist/core/command-cwd.js +18 -6
  32. package/dist/core/command-env.js +91 -0
  33. package/dist/core/contract-lint.js +165 -3
  34. package/dist/core/contract-models.js +172 -0
  35. package/dist/core/dashboard-verification.js +2 -0
  36. package/dist/core/doc-review-triage.js +1 -0
  37. package/dist/core/handoff-record.js +376 -0
  38. package/dist/core/public-json-contracts.js +16 -0
  39. package/dist/core/run-receipt.js +46 -7
  40. package/dist/core/run-write-drift.js +180 -0
  41. package/dist/core/secret-redaction.js +39 -0
  42. package/dist/core/source-anchors.js +3 -5
  43. package/dist/core/verification-decision-graph.js +223 -0
  44. package/package.json +3 -1
  45. package/schemas/README.md +11 -4
  46. package/schemas/adapter-compatibility-report.schema.json +184 -0
  47. package/schemas/change-verification-report.schema.json +133 -1
  48. package/schemas/commands.schema.json +8 -1
  49. package/schemas/contract-lint-report.schema.json +48 -0
  50. package/schemas/explain-report.schema.json +265 -2
  51. package/schemas/handoff-validation-report.schema.json +68 -0
  52. package/schemas/run-receipt.schema.json +74 -1
  53. package/templates/default/common/.mustflow/config/commands.toml +2 -0
  54. package/templates/default/i18n.toml +78 -234
  55. package/templates/default/locales/en/.mustflow/skills/INDEX.md +7 -3
  56. package/templates/default/locales/en/.mustflow/skills/architecture-deepening-review/SKILL.md +154 -0
  57. package/templates/default/locales/en/.mustflow/skills/behavior-preserving-refactor/SKILL.md +8 -3
  58. package/templates/default/locales/en/.mustflow/skills/code-review/SKILL.md +9 -4
  59. package/templates/default/locales/en/.mustflow/skills/date-number-audit/SKILL.md +19 -4
  60. package/templates/default/locales/en/.mustflow/skills/diff-risk-review/SKILL.md +4 -2
  61. package/templates/default/locales/en/.mustflow/skills/external-skill-intake/SKILL.md +141 -0
  62. package/templates/default/locales/en/.mustflow/skills/release-notes-authoring/SKILL.md +143 -0
  63. package/templates/default/locales/en/.mustflow/skills/repro-first-debug/SKILL.md +22 -8
  64. package/templates/default/locales/en/.mustflow/skills/skill-authoring/SKILL.md +3 -3
  65. package/templates/default/locales/en/.mustflow/skills/source-freshness-check/SKILL.md +22 -9
  66. package/templates/default/locales/en/.mustflow/skills/ui-quality-gate/SKILL.md +21 -13
  67. package/templates/default/locales/en/.mustflow/skills/vertical-slice-tdd/SKILL.md +167 -0
  68. package/templates/default/manifest.toml +16 -1
  69. package/templates/default/locales/es/.mustflow/skills/INDEX.md +0 -75
  70. package/templates/default/locales/es/.mustflow/skills/adapter-boundary/SKILL.md +0 -193
  71. package/templates/default/locales/es/.mustflow/skills/artifact-integrity-check/SKILL.md +0 -114
  72. package/templates/default/locales/es/.mustflow/skills/behavior-preserving-refactor/SKILL.md +0 -182
  73. package/templates/default/locales/es/.mustflow/skills/code-review/SKILL.md +0 -115
  74. package/templates/default/locales/es/.mustflow/skills/codebase-orientation/SKILL.md +0 -115
  75. package/templates/default/locales/es/.mustflow/skills/command-pattern/SKILL.md +0 -247
  76. package/templates/default/locales/es/.mustflow/skills/composition-over-inheritance/SKILL.md +0 -176
  77. package/templates/default/locales/es/.mustflow/skills/contract-sync-check/SKILL.md +0 -116
  78. package/templates/default/locales/es/.mustflow/skills/database-change-safety/SKILL.md +0 -155
  79. package/templates/default/locales/es/.mustflow/skills/date-number-audit/SKILL.md +0 -116
  80. package/templates/default/locales/es/.mustflow/skills/dependency-injection/SKILL.md +0 -161
  81. package/templates/default/locales/es/.mustflow/skills/dependency-reality-check/SKILL.md +0 -115
  82. package/templates/default/locales/es/.mustflow/skills/diff-risk-review/SKILL.md +0 -136
  83. package/templates/default/locales/es/.mustflow/skills/docs-prose-review/SKILL.md +0 -119
  84. package/templates/default/locales/es/.mustflow/skills/docs-update/SKILL.md +0 -97
  85. package/templates/default/locales/es/.mustflow/skills/external-prompt-injection-defense/SKILL.md +0 -116
  86. package/templates/default/locales/es/.mustflow/skills/facade-pattern/SKILL.md +0 -210
  87. package/templates/default/locales/es/.mustflow/skills/failure-triage/SKILL.md +0 -97
  88. package/templates/default/locales/es/.mustflow/skills/instruction-conflict-scope-check/SKILL.md +0 -118
  89. package/templates/default/locales/es/.mustflow/skills/line-ending-hygiene/SKILL.md +0 -111
  90. package/templates/default/locales/es/.mustflow/skills/migration-safety-check/SKILL.md +0 -117
  91. package/templates/default/locales/es/.mustflow/skills/multi-agent-work-coordination/SKILL.md +0 -260
  92. package/templates/default/locales/es/.mustflow/skills/null-object-pattern/SKILL.md +0 -196
  93. package/templates/default/locales/es/.mustflow/skills/pattern-scout/SKILL.md +0 -110
  94. package/templates/default/locales/es/.mustflow/skills/performance-budget-check/SKILL.md +0 -121
  95. package/templates/default/locales/es/.mustflow/skills/project-context-authoring/SKILL.md +0 -107
  96. package/templates/default/locales/es/.mustflow/skills/pure-core-imperative-shell/SKILL.md +0 -212
  97. package/templates/default/locales/es/.mustflow/skills/readme-authoring/SKILL.md +0 -115
  98. package/templates/default/locales/es/.mustflow/skills/repo-improvement-loop/SKILL.md +0 -150
  99. package/templates/default/locales/es/.mustflow/skills/repro-first-debug/SKILL.md +0 -112
  100. package/templates/default/locales/es/.mustflow/skills/requirement-regression-guard/SKILL.md +0 -152
  101. package/templates/default/locales/es/.mustflow/skills/result-option/SKILL.md +0 -186
  102. package/templates/default/locales/es/.mustflow/skills/security-privacy-review/SKILL.md +0 -116
  103. package/templates/default/locales/es/.mustflow/skills/security-regression-tests/SKILL.md +0 -131
  104. package/templates/default/locales/es/.mustflow/skills/skill-authoring/SKILL.md +0 -110
  105. package/templates/default/locales/es/.mustflow/skills/source-freshness-check/SKILL.md +0 -111
  106. package/templates/default/locales/es/.mustflow/skills/state-machine-pattern/SKILL.md +0 -214
  107. package/templates/default/locales/es/.mustflow/skills/strategy-pattern/SKILL.md +0 -215
  108. package/templates/default/locales/es/.mustflow/skills/structure-discovery-gate/SKILL.md +0 -159
  109. package/templates/default/locales/es/.mustflow/skills/test-design-guard/SKILL.md +0 -162
  110. package/templates/default/locales/es/.mustflow/skills/test-maintenance/SKILL.md +0 -122
  111. package/templates/default/locales/es/.mustflow/skills/ui-quality-gate/SKILL.md +0 -117
  112. package/templates/default/locales/es/.mustflow/skills/visual-review-artifact/SKILL.md +0 -127
  113. package/templates/default/locales/es/.mustflow/skills/visual-review-artifact/assets/review-template.html +0 -286
  114. package/templates/default/locales/es/.mustflow/skills/visual-review-artifact/resources.toml +0 -7
  115. package/templates/default/locales/es/.mustflow/skills/web-asset-optimization/SKILL.md +0 -108
  116. package/templates/default/locales/fr/.mustflow/skills/INDEX.md +0 -75
  117. package/templates/default/locales/fr/.mustflow/skills/adapter-boundary/SKILL.md +0 -193
  118. package/templates/default/locales/fr/.mustflow/skills/artifact-integrity-check/SKILL.md +0 -114
  119. package/templates/default/locales/fr/.mustflow/skills/behavior-preserving-refactor/SKILL.md +0 -182
  120. package/templates/default/locales/fr/.mustflow/skills/code-review/SKILL.md +0 -115
  121. package/templates/default/locales/fr/.mustflow/skills/codebase-orientation/SKILL.md +0 -115
  122. package/templates/default/locales/fr/.mustflow/skills/command-pattern/SKILL.md +0 -247
  123. package/templates/default/locales/fr/.mustflow/skills/composition-over-inheritance/SKILL.md +0 -176
  124. package/templates/default/locales/fr/.mustflow/skills/contract-sync-check/SKILL.md +0 -116
  125. package/templates/default/locales/fr/.mustflow/skills/database-change-safety/SKILL.md +0 -155
  126. package/templates/default/locales/fr/.mustflow/skills/date-number-audit/SKILL.md +0 -116
  127. package/templates/default/locales/fr/.mustflow/skills/dependency-injection/SKILL.md +0 -161
  128. package/templates/default/locales/fr/.mustflow/skills/dependency-reality-check/SKILL.md +0 -115
  129. package/templates/default/locales/fr/.mustflow/skills/diff-risk-review/SKILL.md +0 -136
  130. package/templates/default/locales/fr/.mustflow/skills/docs-prose-review/SKILL.md +0 -119
  131. package/templates/default/locales/fr/.mustflow/skills/docs-update/SKILL.md +0 -97
  132. package/templates/default/locales/fr/.mustflow/skills/external-prompt-injection-defense/SKILL.md +0 -116
  133. package/templates/default/locales/fr/.mustflow/skills/facade-pattern/SKILL.md +0 -210
  134. package/templates/default/locales/fr/.mustflow/skills/failure-triage/SKILL.md +0 -97
  135. package/templates/default/locales/fr/.mustflow/skills/instruction-conflict-scope-check/SKILL.md +0 -118
  136. package/templates/default/locales/fr/.mustflow/skills/line-ending-hygiene/SKILL.md +0 -111
  137. package/templates/default/locales/fr/.mustflow/skills/migration-safety-check/SKILL.md +0 -117
  138. package/templates/default/locales/fr/.mustflow/skills/multi-agent-work-coordination/SKILL.md +0 -260
  139. package/templates/default/locales/fr/.mustflow/skills/null-object-pattern/SKILL.md +0 -196
  140. package/templates/default/locales/fr/.mustflow/skills/pattern-scout/SKILL.md +0 -110
  141. package/templates/default/locales/fr/.mustflow/skills/performance-budget-check/SKILL.md +0 -121
  142. package/templates/default/locales/fr/.mustflow/skills/project-context-authoring/SKILL.md +0 -107
  143. package/templates/default/locales/fr/.mustflow/skills/pure-core-imperative-shell/SKILL.md +0 -212
  144. package/templates/default/locales/fr/.mustflow/skills/readme-authoring/SKILL.md +0 -115
  145. package/templates/default/locales/fr/.mustflow/skills/repo-improvement-loop/SKILL.md +0 -150
  146. package/templates/default/locales/fr/.mustflow/skills/repro-first-debug/SKILL.md +0 -112
  147. package/templates/default/locales/fr/.mustflow/skills/requirement-regression-guard/SKILL.md +0 -152
  148. package/templates/default/locales/fr/.mustflow/skills/result-option/SKILL.md +0 -186
  149. package/templates/default/locales/fr/.mustflow/skills/security-privacy-review/SKILL.md +0 -116
  150. package/templates/default/locales/fr/.mustflow/skills/security-regression-tests/SKILL.md +0 -131
  151. package/templates/default/locales/fr/.mustflow/skills/skill-authoring/SKILL.md +0 -110
  152. package/templates/default/locales/fr/.mustflow/skills/source-freshness-check/SKILL.md +0 -111
  153. package/templates/default/locales/fr/.mustflow/skills/state-machine-pattern/SKILL.md +0 -214
  154. package/templates/default/locales/fr/.mustflow/skills/strategy-pattern/SKILL.md +0 -215
  155. package/templates/default/locales/fr/.mustflow/skills/structure-discovery-gate/SKILL.md +0 -159
  156. package/templates/default/locales/fr/.mustflow/skills/test-design-guard/SKILL.md +0 -162
  157. package/templates/default/locales/fr/.mustflow/skills/test-maintenance/SKILL.md +0 -122
  158. package/templates/default/locales/fr/.mustflow/skills/ui-quality-gate/SKILL.md +0 -117
  159. package/templates/default/locales/fr/.mustflow/skills/visual-review-artifact/SKILL.md +0 -127
  160. package/templates/default/locales/fr/.mustflow/skills/visual-review-artifact/assets/review-template.html +0 -286
  161. package/templates/default/locales/fr/.mustflow/skills/visual-review-artifact/resources.toml +0 -7
  162. package/templates/default/locales/fr/.mustflow/skills/web-asset-optimization/SKILL.md +0 -108
  163. package/templates/default/locales/hi/.mustflow/skills/INDEX.md +0 -75
  164. package/templates/default/locales/hi/.mustflow/skills/adapter-boundary/SKILL.md +0 -193
  165. package/templates/default/locales/hi/.mustflow/skills/artifact-integrity-check/SKILL.md +0 -114
  166. package/templates/default/locales/hi/.mustflow/skills/behavior-preserving-refactor/SKILL.md +0 -182
  167. package/templates/default/locales/hi/.mustflow/skills/code-review/SKILL.md +0 -115
  168. package/templates/default/locales/hi/.mustflow/skills/codebase-orientation/SKILL.md +0 -115
  169. package/templates/default/locales/hi/.mustflow/skills/command-pattern/SKILL.md +0 -247
  170. package/templates/default/locales/hi/.mustflow/skills/composition-over-inheritance/SKILL.md +0 -176
  171. package/templates/default/locales/hi/.mustflow/skills/contract-sync-check/SKILL.md +0 -116
  172. package/templates/default/locales/hi/.mustflow/skills/database-change-safety/SKILL.md +0 -155
  173. package/templates/default/locales/hi/.mustflow/skills/date-number-audit/SKILL.md +0 -116
  174. package/templates/default/locales/hi/.mustflow/skills/dependency-injection/SKILL.md +0 -161
  175. package/templates/default/locales/hi/.mustflow/skills/dependency-reality-check/SKILL.md +0 -115
  176. package/templates/default/locales/hi/.mustflow/skills/diff-risk-review/SKILL.md +0 -136
  177. package/templates/default/locales/hi/.mustflow/skills/docs-prose-review/SKILL.md +0 -119
  178. package/templates/default/locales/hi/.mustflow/skills/docs-update/SKILL.md +0 -97
  179. package/templates/default/locales/hi/.mustflow/skills/external-prompt-injection-defense/SKILL.md +0 -116
  180. package/templates/default/locales/hi/.mustflow/skills/facade-pattern/SKILL.md +0 -210
  181. package/templates/default/locales/hi/.mustflow/skills/failure-triage/SKILL.md +0 -97
  182. package/templates/default/locales/hi/.mustflow/skills/instruction-conflict-scope-check/SKILL.md +0 -118
  183. package/templates/default/locales/hi/.mustflow/skills/line-ending-hygiene/SKILL.md +0 -111
  184. package/templates/default/locales/hi/.mustflow/skills/migration-safety-check/SKILL.md +0 -117
  185. package/templates/default/locales/hi/.mustflow/skills/multi-agent-work-coordination/SKILL.md +0 -260
  186. package/templates/default/locales/hi/.mustflow/skills/null-object-pattern/SKILL.md +0 -196
  187. package/templates/default/locales/hi/.mustflow/skills/pattern-scout/SKILL.md +0 -110
  188. package/templates/default/locales/hi/.mustflow/skills/performance-budget-check/SKILL.md +0 -121
  189. package/templates/default/locales/hi/.mustflow/skills/project-context-authoring/SKILL.md +0 -107
  190. package/templates/default/locales/hi/.mustflow/skills/pure-core-imperative-shell/SKILL.md +0 -212
  191. package/templates/default/locales/hi/.mustflow/skills/readme-authoring/SKILL.md +0 -115
  192. package/templates/default/locales/hi/.mustflow/skills/repo-improvement-loop/SKILL.md +0 -150
  193. package/templates/default/locales/hi/.mustflow/skills/repro-first-debug/SKILL.md +0 -112
  194. package/templates/default/locales/hi/.mustflow/skills/requirement-regression-guard/SKILL.md +0 -152
  195. package/templates/default/locales/hi/.mustflow/skills/result-option/SKILL.md +0 -186
  196. package/templates/default/locales/hi/.mustflow/skills/security-privacy-review/SKILL.md +0 -116
  197. package/templates/default/locales/hi/.mustflow/skills/security-regression-tests/SKILL.md +0 -131
  198. package/templates/default/locales/hi/.mustflow/skills/skill-authoring/SKILL.md +0 -110
  199. package/templates/default/locales/hi/.mustflow/skills/source-freshness-check/SKILL.md +0 -111
  200. package/templates/default/locales/hi/.mustflow/skills/state-machine-pattern/SKILL.md +0 -214
  201. package/templates/default/locales/hi/.mustflow/skills/strategy-pattern/SKILL.md +0 -215
  202. package/templates/default/locales/hi/.mustflow/skills/structure-discovery-gate/SKILL.md +0 -159
  203. package/templates/default/locales/hi/.mustflow/skills/test-design-guard/SKILL.md +0 -162
  204. package/templates/default/locales/hi/.mustflow/skills/test-maintenance/SKILL.md +0 -122
  205. package/templates/default/locales/hi/.mustflow/skills/ui-quality-gate/SKILL.md +0 -117
  206. package/templates/default/locales/hi/.mustflow/skills/visual-review-artifact/SKILL.md +0 -127
  207. package/templates/default/locales/hi/.mustflow/skills/visual-review-artifact/assets/review-template.html +0 -286
  208. package/templates/default/locales/hi/.mustflow/skills/visual-review-artifact/resources.toml +0 -7
  209. package/templates/default/locales/hi/.mustflow/skills/web-asset-optimization/SKILL.md +0 -108
  210. package/templates/default/locales/ko/.mustflow/skills/INDEX.md +0 -80
  211. package/templates/default/locales/ko/.mustflow/skills/adapter-boundary/SKILL.md +0 -193
  212. package/templates/default/locales/ko/.mustflow/skills/artifact-integrity-check/SKILL.md +0 -114
  213. package/templates/default/locales/ko/.mustflow/skills/behavior-preserving-refactor/SKILL.md +0 -182
  214. package/templates/default/locales/ko/.mustflow/skills/code-review/SKILL.md +0 -118
  215. package/templates/default/locales/ko/.mustflow/skills/codebase-orientation/SKILL.md +0 -115
  216. package/templates/default/locales/ko/.mustflow/skills/command-pattern/SKILL.md +0 -247
  217. package/templates/default/locales/ko/.mustflow/skills/composition-over-inheritance/SKILL.md +0 -176
  218. package/templates/default/locales/ko/.mustflow/skills/contract-sync-check/SKILL.md +0 -116
  219. package/templates/default/locales/ko/.mustflow/skills/database-change-safety/SKILL.md +0 -155
  220. package/templates/default/locales/ko/.mustflow/skills/date-number-audit/SKILL.md +0 -116
  221. package/templates/default/locales/ko/.mustflow/skills/dependency-injection/SKILL.md +0 -161
  222. package/templates/default/locales/ko/.mustflow/skills/dependency-reality-check/SKILL.md +0 -115
  223. package/templates/default/locales/ko/.mustflow/skills/diff-risk-review/SKILL.md +0 -136
  224. package/templates/default/locales/ko/.mustflow/skills/docs-prose-review/SKILL.md +0 -119
  225. package/templates/default/locales/ko/.mustflow/skills/docs-update/SKILL.md +0 -107
  226. package/templates/default/locales/ko/.mustflow/skills/external-prompt-injection-defense/SKILL.md +0 -116
  227. package/templates/default/locales/ko/.mustflow/skills/facade-pattern/SKILL.md +0 -210
  228. package/templates/default/locales/ko/.mustflow/skills/failure-triage/SKILL.md +0 -119
  229. package/templates/default/locales/ko/.mustflow/skills/instruction-conflict-scope-check/SKILL.md +0 -118
  230. package/templates/default/locales/ko/.mustflow/skills/line-ending-hygiene/SKILL.md +0 -111
  231. package/templates/default/locales/ko/.mustflow/skills/migration-safety-check/SKILL.md +0 -117
  232. package/templates/default/locales/ko/.mustflow/skills/multi-agent-work-coordination/SKILL.md +0 -259
  233. package/templates/default/locales/ko/.mustflow/skills/null-object-pattern/SKILL.md +0 -196
  234. package/templates/default/locales/ko/.mustflow/skills/pattern-scout/SKILL.md +0 -110
  235. package/templates/default/locales/ko/.mustflow/skills/performance-budget-check/SKILL.md +0 -121
  236. package/templates/default/locales/ko/.mustflow/skills/project-context-authoring/SKILL.md +0 -107
  237. package/templates/default/locales/ko/.mustflow/skills/pure-core-imperative-shell/SKILL.md +0 -212
  238. package/templates/default/locales/ko/.mustflow/skills/readme-authoring/SKILL.md +0 -115
  239. package/templates/default/locales/ko/.mustflow/skills/repo-improvement-loop/SKILL.md +0 -150
  240. package/templates/default/locales/ko/.mustflow/skills/repro-first-debug/SKILL.md +0 -112
  241. package/templates/default/locales/ko/.mustflow/skills/requirement-regression-guard/SKILL.md +0 -152
  242. package/templates/default/locales/ko/.mustflow/skills/result-option/SKILL.md +0 -186
  243. package/templates/default/locales/ko/.mustflow/skills/security-privacy-review/SKILL.md +0 -116
  244. package/templates/default/locales/ko/.mustflow/skills/security-regression-tests/SKILL.md +0 -131
  245. package/templates/default/locales/ko/.mustflow/skills/skill-authoring/SKILL.md +0 -110
  246. package/templates/default/locales/ko/.mustflow/skills/source-freshness-check/SKILL.md +0 -111
  247. package/templates/default/locales/ko/.mustflow/skills/state-machine-pattern/SKILL.md +0 -214
  248. package/templates/default/locales/ko/.mustflow/skills/strategy-pattern/SKILL.md +0 -215
  249. package/templates/default/locales/ko/.mustflow/skills/structure-discovery-gate/SKILL.md +0 -159
  250. package/templates/default/locales/ko/.mustflow/skills/test-design-guard/SKILL.md +0 -162
  251. package/templates/default/locales/ko/.mustflow/skills/test-maintenance/SKILL.md +0 -130
  252. package/templates/default/locales/ko/.mustflow/skills/ui-quality-gate/SKILL.md +0 -117
  253. package/templates/default/locales/ko/.mustflow/skills/visual-review-artifact/SKILL.md +0 -127
  254. package/templates/default/locales/ko/.mustflow/skills/visual-review-artifact/assets/review-template.html +0 -286
  255. package/templates/default/locales/ko/.mustflow/skills/visual-review-artifact/resources.toml +0 -7
  256. package/templates/default/locales/ko/.mustflow/skills/web-asset-optimization/SKILL.md +0 -108
  257. package/templates/default/locales/zh/.mustflow/skills/INDEX.md +0 -74
  258. package/templates/default/locales/zh/.mustflow/skills/adapter-boundary/SKILL.md +0 -193
  259. package/templates/default/locales/zh/.mustflow/skills/artifact-integrity-check/SKILL.md +0 -114
  260. package/templates/default/locales/zh/.mustflow/skills/behavior-preserving-refactor/SKILL.md +0 -182
  261. package/templates/default/locales/zh/.mustflow/skills/code-review/SKILL.md +0 -115
  262. package/templates/default/locales/zh/.mustflow/skills/codebase-orientation/SKILL.md +0 -115
  263. package/templates/default/locales/zh/.mustflow/skills/command-pattern/SKILL.md +0 -247
  264. package/templates/default/locales/zh/.mustflow/skills/composition-over-inheritance/SKILL.md +0 -176
  265. package/templates/default/locales/zh/.mustflow/skills/contract-sync-check/SKILL.md +0 -116
  266. package/templates/default/locales/zh/.mustflow/skills/database-change-safety/SKILL.md +0 -155
  267. package/templates/default/locales/zh/.mustflow/skills/date-number-audit/SKILL.md +0 -116
  268. package/templates/default/locales/zh/.mustflow/skills/dependency-injection/SKILL.md +0 -161
  269. package/templates/default/locales/zh/.mustflow/skills/dependency-reality-check/SKILL.md +0 -115
  270. package/templates/default/locales/zh/.mustflow/skills/diff-risk-review/SKILL.md +0 -136
  271. package/templates/default/locales/zh/.mustflow/skills/docs-prose-review/SKILL.md +0 -119
  272. package/templates/default/locales/zh/.mustflow/skills/docs-update/SKILL.md +0 -97
  273. package/templates/default/locales/zh/.mustflow/skills/external-prompt-injection-defense/SKILL.md +0 -116
  274. package/templates/default/locales/zh/.mustflow/skills/facade-pattern/SKILL.md +0 -210
  275. package/templates/default/locales/zh/.mustflow/skills/failure-triage/SKILL.md +0 -96
  276. package/templates/default/locales/zh/.mustflow/skills/instruction-conflict-scope-check/SKILL.md +0 -118
  277. package/templates/default/locales/zh/.mustflow/skills/line-ending-hygiene/SKILL.md +0 -111
  278. package/templates/default/locales/zh/.mustflow/skills/migration-safety-check/SKILL.md +0 -117
  279. package/templates/default/locales/zh/.mustflow/skills/multi-agent-work-coordination/SKILL.md +0 -260
  280. package/templates/default/locales/zh/.mustflow/skills/null-object-pattern/SKILL.md +0 -196
  281. package/templates/default/locales/zh/.mustflow/skills/pattern-scout/SKILL.md +0 -110
  282. package/templates/default/locales/zh/.mustflow/skills/performance-budget-check/SKILL.md +0 -121
  283. package/templates/default/locales/zh/.mustflow/skills/project-context-authoring/SKILL.md +0 -107
  284. package/templates/default/locales/zh/.mustflow/skills/pure-core-imperative-shell/SKILL.md +0 -212
  285. package/templates/default/locales/zh/.mustflow/skills/readme-authoring/SKILL.md +0 -115
  286. package/templates/default/locales/zh/.mustflow/skills/repo-improvement-loop/SKILL.md +0 -150
  287. package/templates/default/locales/zh/.mustflow/skills/repro-first-debug/SKILL.md +0 -112
  288. package/templates/default/locales/zh/.mustflow/skills/requirement-regression-guard/SKILL.md +0 -152
  289. package/templates/default/locales/zh/.mustflow/skills/result-option/SKILL.md +0 -186
  290. package/templates/default/locales/zh/.mustflow/skills/security-privacy-review/SKILL.md +0 -116
  291. package/templates/default/locales/zh/.mustflow/skills/security-regression-tests/SKILL.md +0 -131
  292. package/templates/default/locales/zh/.mustflow/skills/skill-authoring/SKILL.md +0 -110
  293. package/templates/default/locales/zh/.mustflow/skills/source-freshness-check/SKILL.md +0 -111
  294. package/templates/default/locales/zh/.mustflow/skills/state-machine-pattern/SKILL.md +0 -214
  295. package/templates/default/locales/zh/.mustflow/skills/strategy-pattern/SKILL.md +0 -215
  296. package/templates/default/locales/zh/.mustflow/skills/structure-discovery-gate/SKILL.md +0 -159
  297. package/templates/default/locales/zh/.mustflow/skills/test-design-guard/SKILL.md +0 -162
  298. package/templates/default/locales/zh/.mustflow/skills/test-maintenance/SKILL.md +0 -122
  299. package/templates/default/locales/zh/.mustflow/skills/ui-quality-gate/SKILL.md +0 -117
  300. package/templates/default/locales/zh/.mustflow/skills/visual-review-artifact/SKILL.md +0 -127
  301. package/templates/default/locales/zh/.mustflow/skills/visual-review-artifact/assets/review-template.html +0 -286
  302. package/templates/default/locales/zh/.mustflow/skills/visual-review-artifact/resources.toml +0 -7
  303. package/templates/default/locales/zh/.mustflow/skills/web-asset-optimization/SKILL.md +0 -108
package/README.md CHANGED
@@ -106,13 +106,16 @@ mustflow installs and validates an agent workflow for user projects.
106
106
  - Installs `AGENTS.md` and `.mustflow/**` workflow files.
107
107
  - Declares runnable command rules in `.mustflow/config/commands.toml`.
108
108
  - Checks installation health and configuration structure with `mf check` and `mf doctor`.
109
+ - Reports host adapter compatibility with `mf adapters status` without generating host-specific files or treating them as command authority.
109
110
  - Classifies changed files, public surfaces, and validation reasons with `mf classify`.
110
- - Prints execution-free verification plans with `mf verify --plan-only --json`, including read-only local-index lock explanations when available.
111
+ - Prints execution-free verification plans with `mf verify --plan-only --json`, including a machine-readable verification decision graph and read-only local-index lock explanations when available.
111
112
  - Runs only allowed one-shot commands within a timeout via `mf run <intent>` or `mf verify` when the selected intent is runnable.
112
113
  - Writes command receipts to `.mustflow/state/runs/latest.json`.
113
114
  - Generates a concise repository navigation map, `REPO_MAP.md`, with `mf map`.
114
- - Indexes and searches mustflow docs, skills, skill routes, command rules, command-effect locks, file fingerprints, and opt-in source anchor metadata with SQLite via `mf index` and `mf search`. The local SQLite file is a rebuildable lookup cache, not a memory store, audit log, command transcript store, or source-content database.
115
+ - Indexes and searches mustflow docs, skills, skill routes, command rules, command-effect locks, file fingerprints, and opt-in source anchor metadata with SQLite via `mf index` and `mf search`. The local SQLite file is a rebuildable lookup cache, not a memory store, audit log, command transcript store, command-authority source, or source-content database.
115
116
  - Tracks agent-created or agent-modified documentation needing prose review with `mf docs review`.
117
+ - Validates restricted work-item or handoff JSON records with `mf handoff validate` without creating backlog files, storing transcripts, or granting command authority.
118
+ - Exports bounded static dashboard reports with `mf dashboard --export-json <path>` or `mf dashboard --export <path>` for pull requests and continuous integration artifacts. The export includes a `harness_report` summary for install state, changed surfaces, verification decisions, latest receipt metadata, document-review status, and remaining risks without raw command-output tails or mutation controls.
116
119
  - Previews and applies bundled template updates safely with `mf update`.
117
120
  - Publishes JSON Schemas for automation-facing reports and command contracts in `schemas/`.
118
121
 
@@ -173,6 +176,8 @@ your-project/
173
176
  │ └─ SKILL.md
174
177
  ├─ external-prompt-injection-defense/
175
178
  │ └─ SKILL.md
179
+ ├─ external-skill-intake/
180
+ │ └─ SKILL.md
176
181
  ├─ failure-triage/
177
182
  │ └─ SKILL.md
178
183
  ├─ instruction-conflict-scope-check/
@@ -207,6 +212,8 @@ your-project/
207
212
  │ └─ SKILL.md
208
213
  ├─ test-maintenance/
209
214
  │ └─ SKILL.md
215
+ ├─ vertical-slice-tdd/
216
+ │ └─ SKILL.md
210
217
  ├─ ui-quality-gate/
211
218
  │ └─ SKILL.md
212
219
  ├─ visual-review-artifact/
@@ -278,6 +285,7 @@ mf run mustflow_update_apply
278
285
  | `mf init --force` | Back up conflicting files, then overwrite them. |
279
286
  | `mf check` | Validate mustflow files, TOML configuration, and skill document shape. |
280
287
  | `mf check --strict` | Run additional safety checks for document identity, authority/lifecycle metadata, skill index/body alignment, skill metadata, command boundaries, version-source discovery, retention policy, output limits, raw logs, and secret-like context. |
288
+ | `mf adapters status` | Inspect existing host-specific instruction and adapter files without generating adapter files or granting command authority. |
281
289
  | `mf classify --changed` | Classify changed paths, public surfaces, and validation reasons without modifying files. |
282
290
  | `mf contract-lint` | Inspect `.mustflow/config/commands.toml` for command-contract errors and warnings without running commands. |
283
291
  | `mf doctor` | Inspect the current mustflow root without writing files. |
@@ -285,17 +293,19 @@ mf run mustflow_update_apply
285
293
  | `mf docs review add <path>` | Add or refresh a document review queue entry. |
286
294
  | `mf docs review comment <path>` | Add multiline review guidance to an existing queue entry. |
287
295
  | `mf docs review approve <path>` | Mark review complete and hide the document from the default queue. |
296
+ | `mf handoff validate <path>` | Validate a restricted work-item or handoff JSON record without writing files. |
288
297
  | `mf context --json` | Print read order, command rules, available capabilities, and recent run summary as JSON. |
289
298
  | `mf map --stdout` | Print the current mustflow root map to stdout. |
290
299
  | `mf map --write` | Create or update `REPO_MAP.md`. |
291
300
  | `mf run <intent>` | Run an allowed one-shot command. |
301
+ | `mf run <intent> --dry-run --json` | Preview whether an intent is runnable and what command metadata would be used, without executing it. |
292
302
  | `mf index` | Build a SQLite index for mustflow docs, skill routes, command rules, command-effect locks, and file fingerprints. Use `--incremental` to reuse a compatible fresh index without rewriting it. |
293
303
  | `mf search <query>` | Search docs, skills, skill routes, command rules, and command-effect locks in the SQLite index. |
294
304
  | `mf status` | Inspect installed state and changed or missing files. |
295
305
  | `mf update --dry-run` | Calculate a template update plan without writing files. |
296
306
  | `mf update --apply` | Apply template updates when nothing is blocked. |
297
307
  | `mf help <topic>` | Show installed mustflow help. |
298
- | `mf dashboard` | Start a local inspection dashboard for status, verification recommendations, release/version-source status, template update readiness, latest run receipt, skill routes, safe preferences, and documentation review. It does not execute commands or apply fixes. |
308
+ | `mf dashboard` | Start a local inspection dashboard for status, verification recommendations, release/version-source status, template update readiness, latest run receipt, skill routes, safe preferences, and documentation review. Use `--export-json <path>` or `--export <path>` for a bounded static report. It does not execute commands or apply fixes. |
299
309
  | `mf version` | Print the installed mustflow package version. |
300
310
  | `mf version --check` | Compare the installed package version with the latest npm release and print an update command if a newer version exists. |
301
311
  | `mf version-sources` | Inspect detected package, template, and declared version sources without modifying files. |
@@ -322,9 +332,9 @@ Runnable work is declared in `.mustflow/config/commands.toml` so agents do not g
322
332
 
323
333
  Development servers, watch modes, browser UIs, interactive commands, and background processes do not run directly.
324
334
 
325
- Use `mf verify --reason <event> --plan-only --json` to inspect matching verification intents and missing runnable coverage without executing commands. When `.mustflow/cache/mustflow.sqlite` is fresh, scheduled entries include read-only `effectGraph` metadata for write locks and lock conflicts.
335
+ Use `mf verify --reason <event> --plan-only --json` to inspect matching verification intents, command eligibility, remaining gaps, and missing runnable coverage without executing commands. Use `mf run <intent> --dry-run --json` to inspect one resolved command intent without spawning a process or writing a run receipt. Plan-only verification includes a `decision_graph` that connects changed surfaces, classification reasons, command candidates, eligibility checks, effects, and gaps. When `.mustflow/cache/mustflow.sqlite` is fresh, scheduled entries also include read-only `effectGraph` metadata for write locks and lock conflicts. These graph rows are marked `explanation_only` and never grant command authority; `.mustflow/config/commands.toml` remains the only runnable command source.
326
336
 
327
- Each command run writes the latest run record to `.mustflow/state/runs/latest.json`. The record includes the intent name, working directory, timeout, exit code, timeout status, and the tail of stdout and stderr.
337
+ Each executed command run writes the latest run record to `.mustflow/state/runs/latest.json`. The record includes the intent name, working directory, timeout, exit code, timeout status, and the tail of stdout and stderr.
328
338
 
329
339
  ## Language and profiles
330
340
 
@@ -377,7 +387,7 @@ Versioned contract specifications live in `docs/spec/`. The documentation site l
377
387
  These are ideas not yet officially supported:
378
388
 
379
389
  - Community skill registry and skill pack installs
380
- - Optional `.mustflow/work-items/`
390
+ - Optional `.mustflow/work-items/` writers and lifecycle commands
381
391
  - `mf orient`, `mf refresh`
382
392
  - Tool-specific adapters
383
393
 
@@ -0,0 +1,90 @@
1
+ import { inspectAdapterCompatibility } from '../../core/adapter-compatibility.js';
2
+ import { printUsageError, renderHelp } from '../lib/cli-output.js';
3
+ import { t } from '../lib/i18n.js';
4
+ import { resolveMustflowRoot } from '../lib/project-root.js';
5
+ export function getAdaptersHelp(lang = 'en') {
6
+ return renderHelp({
7
+ usage: 'mf adapters status [options]',
8
+ summary: t(lang, 'adapters.help.summary'),
9
+ options: [
10
+ { label: '--json', description: t(lang, 'cli.option.json') },
11
+ { label: '-h, --help', description: t(lang, 'cli.option.help') },
12
+ ],
13
+ examples: ['mf adapters status', 'mf adapters status --json'],
14
+ exitCodes: [
15
+ { label: '0', description: t(lang, 'adapters.help.exit.ok') },
16
+ { label: '1', description: t(lang, 'adapters.help.exit.fail') },
17
+ ],
18
+ }, lang);
19
+ }
20
+ function parseAdaptersArgs(args, lang) {
21
+ const [action, ...rest] = args;
22
+ const json = rest.includes('--json');
23
+ const supported = new Set(['--json']);
24
+ const unsupported = rest.find((arg) => arg.startsWith('-') && !supported.has(arg));
25
+ if (!action) {
26
+ return {
27
+ action: 'status',
28
+ json,
29
+ error: t(lang, 'adapters.error.missingAction'),
30
+ };
31
+ }
32
+ if (action !== 'status') {
33
+ return {
34
+ action: 'status',
35
+ json,
36
+ error: t(lang, 'adapters.error.unknownAction', { action }),
37
+ };
38
+ }
39
+ if (unsupported) {
40
+ return { action, json, error: t(lang, 'cli.error.unknownOption', { option: unsupported }) };
41
+ }
42
+ if (rest.some((arg) => !arg.startsWith('-'))) {
43
+ const unexpected = rest.find((arg) => !arg.startsWith('-'));
44
+ return { action, json, error: t(lang, 'cli.error.unexpectedArgument', { argument: unexpected }) };
45
+ }
46
+ return { action, json };
47
+ }
48
+ function renderAdapterReport(report, lang) {
49
+ const lines = [
50
+ t(lang, 'adapters.title'),
51
+ `${t(lang, 'label.mustflowRoot')}: ${report.mustflow_root}`,
52
+ `${t(lang, 'adapters.label.agents')}: ${report.agents_file.present ? t(lang, 'value.yes') : t(lang, 'value.no')}`,
53
+ `${t(lang, 'adapters.label.hostInstructionFiles')}: ${report.summary.host_instruction_files}`,
54
+ `${t(lang, 'adapters.label.adapterSurfaces')}: ${report.summary.adapter_surfaces_present}`,
55
+ `${t(lang, 'adapters.label.compatibilityNotes')}: ${report.summary.compatibility_notes}`,
56
+ `${t(lang, 'adapters.label.requiredChanges')}: ${report.summary.required_changes}`,
57
+ `${t(lang, 'adapters.label.commandAuthority')}: ${report.boundaries.command_authority}`,
58
+ ];
59
+ if (report.required_changes.length > 0) {
60
+ lines.push('', t(lang, 'adapters.label.requiredChanges'));
61
+ for (const finding of report.required_changes) {
62
+ lines.push(`- [${finding.severity}] ${finding.path ?? '-'}: ${finding.message}`);
63
+ }
64
+ }
65
+ if (report.compatibility_notes.length > 0) {
66
+ lines.push('', t(lang, 'adapters.label.compatibilityNotes'));
67
+ for (const finding of report.compatibility_notes) {
68
+ lines.push(`- [${finding.severity}] ${finding.path ?? '-'}: ${finding.message}`);
69
+ }
70
+ }
71
+ return lines.join('\n');
72
+ }
73
+ export function runAdapters(args, reporter, lang = 'en') {
74
+ if (args.includes('--help') || args.includes('-h')) {
75
+ reporter.stdout(getAdaptersHelp(lang));
76
+ return 0;
77
+ }
78
+ const options = parseAdaptersArgs(args, lang);
79
+ if (options.error) {
80
+ printUsageError(reporter, options.error, 'mf adapters --help', getAdaptersHelp(lang), lang);
81
+ return 1;
82
+ }
83
+ const report = inspectAdapterCompatibility(resolveMustflowRoot());
84
+ if (options.json) {
85
+ reporter.stdout(JSON.stringify(report, null, 2));
86
+ return 0;
87
+ }
88
+ reporter.stdout(renderAdapterReport(report, lang));
89
+ return 0;
90
+ }
@@ -40,9 +40,8 @@ function parseClassifyArgs(args) {
40
40
  }
41
41
  return { json, changed, paths };
42
42
  }
43
- function getClassifyOutput(projectRoot, parsed) {
44
- const source = parsed.changed ? 'changed' : 'paths';
45
- const files = parsed.changed ? readGitChangedFiles(projectRoot) : parsed.paths;
43
+ export function createClassifyOutput(projectRoot, source, paths) {
44
+ const files = source === 'changed' ? readGitChangedFiles(projectRoot) : paths;
46
45
  return {
47
46
  schema_version: CLASSIFY_SCHEMA_VERSION,
48
47
  command: 'classify',
@@ -94,7 +93,7 @@ export function runClassify(args, reporter, lang = 'en') {
94
93
  printUsageError(reporter, t(lang, 'classify.error.missingInput'), 'mf classify --help', getClassifyHelp(lang), lang);
95
94
  return 1;
96
95
  }
97
- const output = getClassifyOutput(resolveMustflowRoot(), parsed);
96
+ const output = createClassifyOutput(resolveMustflowRoot(), parsed.changed ? 'changed' : 'paths', parsed.paths);
98
97
  if (parsed.json) {
99
98
  reporter.stdout(JSON.stringify(output, null, 2));
100
99
  return 0;
@@ -1,5 +1,9 @@
1
+ import { existsSync } from 'node:fs';
2
+ import path from 'node:path';
1
3
  import { lintCommandContract } from '../../core/contract-lint.js';
2
- import { readCommandContract } from '../../core/config-loading.js';
4
+ import { readCommandContract, isRecord } from '../../core/config-loading.js';
5
+ import { readTomlFile } from '../../core/toml.js';
6
+ import { releaseVersioningIsEnabled } from '../../core/version-sources.js';
3
7
  import { printUsageError, renderHelp } from '../lib/cli-output.js';
4
8
  import { t } from '../lib/i18n.js';
5
9
  import { resolveMustflowRoot } from '../lib/project-root.js';
@@ -9,22 +13,35 @@ export function getContractLintHelp(lang = 'en') {
9
13
  usage: 'mf contract-lint [options]',
10
14
  summary: t(lang, 'contractLint.help.summary'),
11
15
  options: [
16
+ { label: '--coverage', description: t(lang, 'contractLint.help.option.coverage') },
12
17
  { label: '--json', description: t(lang, 'cli.option.json') },
13
18
  { label: '-h, --help', description: t(lang, 'cli.option.help') },
14
19
  ],
15
- examples: ['mf contract-lint', 'mf contract-lint --json'],
20
+ examples: ['mf contract-lint', 'mf contract-lint --coverage', 'mf contract-lint --coverage --json'],
16
21
  exitCodes: [
17
22
  { label: '0', description: t(lang, 'contractLint.help.exit.ok') },
18
23
  { label: '1', description: t(lang, 'contractLint.help.exit.fail') },
19
24
  ],
20
25
  }, lang);
21
26
  }
22
- function createContractLintOutput(projectRoot) {
27
+ function readPreferences(projectRoot) {
28
+ const preferencesPath = path.join(projectRoot, '.mustflow', 'config', 'preferences.toml');
29
+ if (!existsSync(preferencesPath)) {
30
+ return undefined;
31
+ }
32
+ const preferences = readTomlFile(preferencesPath);
33
+ return isRecord(preferences) ? preferences : undefined;
34
+ }
35
+ function createContractLintOutput(projectRoot, coverage) {
23
36
  return {
24
37
  schema_version: CONTRACT_LINT_SCHEMA_VERSION,
25
38
  command: 'contract-lint',
26
39
  mustflow_root: projectRoot,
27
- report: lintCommandContract(readCommandContract(projectRoot)),
40
+ report: lintCommandContract(readCommandContract(projectRoot), {
41
+ coverage,
42
+ projectRoot,
43
+ releaseVersioningEnabled: releaseVersioningIsEnabled(readPreferences(projectRoot)),
44
+ }),
28
45
  };
29
46
  }
30
47
  function renderContractLintOutput(output, lang) {
@@ -43,6 +60,9 @@ function renderContractLintOutput(output, lang) {
43
60
  t(lang, 'contractLint.label.sourceFiles'),
44
61
  ...output.report.sourceFiles.map((sourceFile) => `- ${sourceFile}`),
45
62
  ];
63
+ if (output.report.coverage) {
64
+ lines.push('', t(lang, 'contractLint.label.coverage'), `${t(lang, 'contractLint.label.classificationReasons')}: ${output.report.coverage.knownClassificationReasons.length}`, `${t(lang, 'contractLint.label.requiredAfterReasons')}: ${output.report.coverage.requiredAfterReasons.length}`, `${t(lang, 'contractLint.label.runnableReasons')}: ${output.report.coverage.runnableReasons.length}`, `${t(lang, 'contractLint.label.coverageFindings')}: ${output.report.coverage.findings.length}`);
65
+ }
46
66
  if (output.report.issues.length > 0) {
47
67
  lines.push('', t(lang, 'contractLint.label.issues'));
48
68
  for (const issue of output.report.issues) {
@@ -57,13 +77,13 @@ export function runContractLint(args, reporter, lang = 'en') {
57
77
  reporter.stdout(getContractLintHelp(lang));
58
78
  return 0;
59
79
  }
60
- const supported = new Set(['--json']);
80
+ const supported = new Set(['--coverage', '--json']);
61
81
  const unsupported = args.filter((arg) => !supported.has(arg));
62
82
  if (unsupported.length > 0) {
63
83
  printUsageError(reporter, t(lang, 'cli.error.unknownOption', { option: unsupported[0] }), 'mf contract-lint --help', getContractLintHelp(lang), lang);
64
84
  return 1;
65
85
  }
66
- const output = createContractLintOutput(resolveMustflowRoot());
86
+ const output = createContractLintOutput(resolveMustflowRoot(), args.includes('--coverage'));
67
87
  if (args.includes('--json')) {
68
88
  reporter.stdout(JSON.stringify(output, null, 2));
69
89
  }
@@ -5,7 +5,9 @@ import path from 'node:path';
5
5
  import { openPathInFileManager, openUrlInBrowser } from '../lib/browser-open.js';
6
6
  import { printUsageError, renderHelp } from '../lib/cli-output.js';
7
7
  import { renderDashboardHtml, } from '../lib/dashboard-html.js';
8
+ import { DashboardExportPathError, writeDashboardExport, } from '../lib/dashboard-export.js';
8
9
  import { DASHBOARD_VERIFICATION_MAX_FILE_MATCHES, createDashboardVerificationSnapshot, } from '../../core/dashboard-verification.js';
10
+ import { redactSecretLikeText } from '../../core/secret-redaction.js';
9
11
  import { parseSkillIndexRoutes } from '../../core/skill-route-alignment.js';
10
12
  import { getAgentContext } from '../lib/agent-context.js';
11
13
  import { readGitChangedFiles } from '../lib/git-changes.js';
@@ -79,9 +81,18 @@ export function getDashboardHelp(lang = 'en') {
79
81
  { label: '--open', description: t(lang, 'dashboard.help.option.open') },
80
82
  { label: '--no-open', description: t(lang, 'dashboard.help.option.noOpen') },
81
83
  { label: '--json', description: t(lang, 'cli.option.json') },
84
+ { label: '--export <path>', description: t(lang, 'dashboard.help.option.export') },
85
+ { label: '--export-json <path>', description: t(lang, 'dashboard.help.option.exportJson') },
82
86
  { label: '-h, --help', description: t(lang, 'cli.option.help') },
83
87
  ],
84
- examples: ['mf dashboard', 'mf dashboard --open', 'mf dashboard --port 4173', 'mf dashboard --json'],
88
+ examples: [
89
+ 'mf dashboard',
90
+ 'mf dashboard --open',
91
+ 'mf dashboard --port 4173',
92
+ 'mf dashboard --json',
93
+ 'mf dashboard --export .mustflow/state/artifacts/dashboard.html',
94
+ 'mf dashboard --export-json .mustflow/state/artifacts/dashboard.json',
95
+ ],
85
96
  exitCodes: [
86
97
  {
87
98
  label: '0',
@@ -99,6 +110,9 @@ function parseDashboardOptions(args, lang) {
99
110
  let port = DEFAULT_DASHBOARD_PORT;
100
111
  let json = false;
101
112
  let openBrowser = false;
113
+ let exportPath;
114
+ let exportFormat;
115
+ let serverOptionUsed = false;
102
116
  for (let index = 0; index < args.length; index += 1) {
103
117
  const arg = args[index];
104
118
  if (!arg) {
@@ -107,14 +121,17 @@ function parseDashboardOptions(args, lang) {
107
121
  if (arg === '--json') {
108
122
  json = true;
109
123
  openBrowser = false;
124
+ serverOptionUsed = true;
110
125
  continue;
111
126
  }
112
127
  if (arg === '--open') {
113
128
  openBrowser = true;
129
+ serverOptionUsed = true;
114
130
  continue;
115
131
  }
116
132
  if (arg === '--no-open') {
117
133
  openBrowser = false;
134
+ serverOptionUsed = true;
118
135
  continue;
119
136
  }
120
137
  if (arg === '--host') {
@@ -123,11 +140,13 @@ function parseDashboardOptions(args, lang) {
123
140
  return { error: t(lang, 'cli.error.missingValue', { option: '--host' }) };
124
141
  }
125
142
  host = value;
143
+ serverOptionUsed = true;
126
144
  index += 1;
127
145
  continue;
128
146
  }
129
147
  if (arg.startsWith('--host=')) {
130
148
  host = arg.slice('--host='.length);
149
+ serverOptionUsed = true;
131
150
  continue;
132
151
  }
133
152
  if (arg === '--port') {
@@ -140,6 +159,7 @@ function parseDashboardOptions(args, lang) {
140
159
  return { error: t(lang, 'dashboard.error.invalidPort', { port: value }) };
141
160
  }
142
161
  port = parsedPort;
162
+ serverOptionUsed = true;
143
163
  index += 1;
144
164
  continue;
145
165
  }
@@ -150,6 +170,42 @@ function parseDashboardOptions(args, lang) {
150
170
  return { error: t(lang, 'dashboard.error.invalidPort', { port: value }) };
151
171
  }
152
172
  port = parsedPort;
173
+ serverOptionUsed = true;
174
+ continue;
175
+ }
176
+ if (arg === '--export' || arg === '--export-json') {
177
+ const value = args[index + 1];
178
+ if (!value || value.startsWith('-')) {
179
+ return { error: t(lang, 'cli.error.missingValue', { option: arg }) };
180
+ }
181
+ if (exportPath) {
182
+ return { error: t(lang, 'dashboard.error.conflictingExportModes') };
183
+ }
184
+ exportPath = value;
185
+ exportFormat = arg === '--export-json' ? 'json' : 'html';
186
+ index += 1;
187
+ continue;
188
+ }
189
+ if (arg.startsWith('--export=')) {
190
+ if (exportPath) {
191
+ return { error: t(lang, 'dashboard.error.conflictingExportModes') };
192
+ }
193
+ exportPath = arg.slice('--export='.length);
194
+ exportFormat = 'html';
195
+ if (!exportPath) {
196
+ return { error: t(lang, 'cli.error.missingValue', { option: '--export' }) };
197
+ }
198
+ continue;
199
+ }
200
+ if (arg.startsWith('--export-json=')) {
201
+ if (exportPath) {
202
+ return { error: t(lang, 'dashboard.error.conflictingExportModes') };
203
+ }
204
+ exportPath = arg.slice('--export-json='.length);
205
+ exportFormat = 'json';
206
+ if (!exportPath) {
207
+ return { error: t(lang, 'cli.error.missingValue', { option: '--export-json' }) };
208
+ }
153
209
  continue;
154
210
  }
155
211
  if (arg.startsWith('-')) {
@@ -157,6 +213,12 @@ function parseDashboardOptions(args, lang) {
157
213
  }
158
214
  return { error: t(lang, 'cli.error.unexpectedArgument', { argument: arg }) };
159
215
  }
216
+ if (exportPath && serverOptionUsed) {
217
+ return { error: t(lang, 'dashboard.error.exportServerOptions') };
218
+ }
219
+ if (exportPath) {
220
+ return { options: { host, port, json: false, openBrowser: false, exportPath, exportFormat: exportFormat ?? 'html' } };
221
+ }
160
222
  if (!LOCAL_DASHBOARD_HOSTS.has(host)) {
161
223
  return { error: t(lang, 'dashboard.error.nonLocalHost', { host }) };
162
224
  }
@@ -282,6 +344,9 @@ function readDashboardCommandContract(projectRoot) {
282
344
  function toDashboardCommandEffectGraphStatus(graph) {
283
345
  return {
284
346
  source: graph.source,
347
+ authority: graph.authority,
348
+ command_authority: graph.commandAuthority,
349
+ grants_command_authority: graph.grantsCommandAuthority,
285
350
  status: graph.status,
286
351
  database_path: graph.databasePath,
287
352
  index_fresh: graph.indexFresh,
@@ -466,12 +531,22 @@ function renderUpdateResponse(projectRoot) {
466
531
  }
467
532
  function readRunOutput(value) {
468
533
  if (!isRecord(value)) {
469
- return { bytes: 0, truncated: false, tail: '' };
534
+ return { bytes: 0, truncated: false, tail: '', redacted: false, redaction_count: 0, redaction_kinds: [] };
470
535
  }
536
+ const rawTail = typeof value.tail === 'string' ? value.tail : '';
537
+ const tailRedaction = redactSecretLikeText(rawTail);
538
+ const storedKinds = Array.isArray(value.redaction_kinds)
539
+ ? value.redaction_kinds.filter((entry) => typeof entry === 'string')
540
+ : [];
541
+ const redactionKinds = [...new Set([...storedKinds, ...tailRedaction.redactionKinds])].sort();
542
+ const storedRedactionCount = typeof value.redaction_count === 'number' ? value.redaction_count : 0;
471
543
  return {
472
544
  bytes: typeof value.bytes === 'number' ? value.bytes : 0,
473
545
  truncated: value.truncated === true,
474
- tail: typeof value.tail === 'string' ? value.tail : '',
546
+ tail: tailRedaction.text,
547
+ redacted: value.redacted === true || tailRedaction.redacted,
548
+ redaction_count: storedRedactionCount + tailRedaction.redactionCount,
549
+ redaction_kinds: redactionKinds,
475
550
  };
476
551
  }
477
552
  function readNumberArray(value) {
@@ -493,6 +568,7 @@ function renderRunHistoryResponse(projectRoot) {
493
568
  const mode = typeof receipt.mode === 'string' ? receipt.mode : '';
494
569
  const argv = Array.isArray(receipt.argv) ? receipt.argv.filter((entry) => typeof entry === 'string') : [];
495
570
  const cmd = typeof receipt.cmd === 'string' && receipt.cmd.length > 0 ? [receipt.cmd] : [];
571
+ const commandLine = (mode === 'shell' ? cmd : argv).map((entry) => redactSecretLikeText(entry).text);
496
572
  return {
497
573
  path: LATEST_RUN_RELATIVE_PATH,
498
574
  exists: true,
@@ -507,7 +583,7 @@ function renderRunHistoryResponse(projectRoot) {
507
583
  lifecycle: typeof receipt.lifecycle === 'string' ? receipt.lifecycle : '',
508
584
  run_policy: typeof receipt.run_policy === 'string' ? receipt.run_policy : '',
509
585
  mode,
510
- command_line: mode === 'shell' ? cmd : argv,
586
+ command_line: commandLine,
511
587
  timeout_seconds: typeof receipt.timeout_seconds === 'number' ? receipt.timeout_seconds : 0,
512
588
  max_output_bytes: typeof receipt.max_output_bytes === 'number' ? receipt.max_output_bytes : 0,
513
589
  success_exit_codes: readNumberArray(receipt.success_exit_codes),
@@ -580,6 +656,29 @@ export async function runDashboard(args, reporter, lang = 'en') {
580
656
  }
581
657
  const options = parsed.options;
582
658
  const projectRoot = resolveMustflowRoot();
659
+ if (options.exportPath) {
660
+ try {
661
+ const result = writeDashboardExport({
662
+ projectRoot,
663
+ outputPath: options.exportPath,
664
+ format: options.exportFormat ?? 'html',
665
+ preferences: readDashboardPreferences(projectRoot),
666
+ status: await renderStatusResponse(projectRoot),
667
+ docsReview: renderDocReviewResponse(projectRoot, new URL('/api/docs/review', 'http://localhost')),
668
+ });
669
+ reporter.stdout(t(lang, 'dashboard.export.wrote', { path: result.relativePath, bytes: result.bytes }));
670
+ return 0;
671
+ }
672
+ catch (error) {
673
+ const message = error instanceof DashboardExportPathError
674
+ ? t(lang, 'dashboard.error.exportPathOutsideRoot', { path: error.targetPath })
675
+ : error instanceof Error
676
+ ? error.message
677
+ : String(error);
678
+ printUsageError(reporter, message, 'mf dashboard --help', getDashboardHelp(lang), lang);
679
+ return 1;
680
+ }
681
+ }
583
682
  const token = randomBytes(18).toString('base64url');
584
683
  const initialSnapshot = readDashboardPreferences(projectRoot);
585
684
  const server = http.createServer(async (request, response) => {