mustflow 1.18.16 → 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.
- package/README.md +16 -6
- package/dist/cli/commands/adapters.js +90 -0
- package/dist/cli/commands/classify.js +3 -4
- package/dist/cli/commands/contract-lint.js +26 -6
- package/dist/cli/commands/dashboard.js +103 -4
- package/dist/cli/commands/explain-verify.js +213 -0
- package/dist/cli/commands/explain.js +48 -4
- package/dist/cli/commands/handoff.js +136 -0
- package/dist/cli/commands/run.js +97 -136
- package/dist/cli/commands/update.js +91 -61
- package/dist/cli/commands/verify.js +230 -137
- package/dist/cli/i18n/en.js +65 -4
- package/dist/cli/i18n/es.js +65 -4
- package/dist/cli/i18n/fr.js +65 -4
- package/dist/cli/i18n/hi.js +65 -4
- package/dist/cli/i18n/ko.js +65 -4
- package/dist/cli/i18n/zh.js +65 -4
- package/dist/cli/index.js +11 -0
- package/dist/cli/lib/command-registry.js +10 -0
- package/dist/cli/lib/dashboard-export.js +775 -0
- package/dist/cli/lib/local-index.js +22 -6
- package/dist/cli/lib/run-plan.js +222 -0
- package/dist/cli/lib/templates.js +18 -3
- package/dist/cli/lib/update-diff-preview.js +163 -0
- package/dist/cli/lib/validation.js +22 -0
- package/dist/core/adapter-compatibility.js +235 -0
- package/dist/core/change-classification.js +9 -0
- package/dist/core/change-verification.js +10 -3
- package/dist/core/check-issues.js +4 -0
- package/dist/core/command-contract-validation.js +14 -0
- package/dist/core/command-cwd.js +18 -6
- package/dist/core/command-env.js +91 -0
- package/dist/core/contract-lint.js +165 -3
- package/dist/core/contract-models.js +172 -0
- package/dist/core/dashboard-verification.js +2 -0
- package/dist/core/doc-review-triage.js +1 -0
- package/dist/core/handoff-record.js +376 -0
- package/dist/core/public-json-contracts.js +16 -0
- package/dist/core/run-receipt.js +46 -7
- package/dist/core/run-write-drift.js +180 -0
- package/dist/core/secret-redaction.js +39 -0
- package/dist/core/source-anchors.js +3 -5
- package/dist/core/verification-decision-graph.js +223 -0
- package/package.json +3 -1
- package/schemas/README.md +11 -4
- package/schemas/adapter-compatibility-report.schema.json +184 -0
- package/schemas/change-verification-report.schema.json +133 -1
- package/schemas/commands.schema.json +8 -1
- package/schemas/contract-lint-report.schema.json +48 -0
- package/schemas/explain-report.schema.json +265 -2
- package/schemas/handoff-validation-report.schema.json +68 -0
- package/schemas/run-receipt.schema.json +74 -1
- package/templates/default/common/.mustflow/config/commands.toml +2 -0
- package/templates/default/i18n.toml +78 -234
- package/templates/default/locales/en/.mustflow/skills/INDEX.md +7 -3
- package/templates/default/locales/en/.mustflow/skills/architecture-deepening-review/SKILL.md +154 -0
- package/templates/default/locales/en/.mustflow/skills/behavior-preserving-refactor/SKILL.md +8 -3
- package/templates/default/locales/en/.mustflow/skills/code-review/SKILL.md +9 -4
- package/templates/default/locales/en/.mustflow/skills/date-number-audit/SKILL.md +19 -4
- package/templates/default/locales/en/.mustflow/skills/diff-risk-review/SKILL.md +4 -2
- package/templates/default/locales/en/.mustflow/skills/external-skill-intake/SKILL.md +141 -0
- package/templates/default/locales/en/.mustflow/skills/release-notes-authoring/SKILL.md +143 -0
- package/templates/default/locales/en/.mustflow/skills/repro-first-debug/SKILL.md +22 -8
- package/templates/default/locales/en/.mustflow/skills/skill-authoring/SKILL.md +3 -3
- package/templates/default/locales/en/.mustflow/skills/source-freshness-check/SKILL.md +22 -9
- package/templates/default/locales/en/.mustflow/skills/ui-quality-gate/SKILL.md +21 -13
- package/templates/default/locales/en/.mustflow/skills/vertical-slice-tdd/SKILL.md +167 -0
- package/templates/default/manifest.toml +16 -1
- package/templates/default/locales/es/.mustflow/skills/INDEX.md +0 -75
- package/templates/default/locales/es/.mustflow/skills/adapter-boundary/SKILL.md +0 -193
- package/templates/default/locales/es/.mustflow/skills/artifact-integrity-check/SKILL.md +0 -114
- package/templates/default/locales/es/.mustflow/skills/behavior-preserving-refactor/SKILL.md +0 -182
- package/templates/default/locales/es/.mustflow/skills/code-review/SKILL.md +0 -115
- package/templates/default/locales/es/.mustflow/skills/codebase-orientation/SKILL.md +0 -115
- package/templates/default/locales/es/.mustflow/skills/command-pattern/SKILL.md +0 -247
- package/templates/default/locales/es/.mustflow/skills/composition-over-inheritance/SKILL.md +0 -176
- package/templates/default/locales/es/.mustflow/skills/contract-sync-check/SKILL.md +0 -116
- package/templates/default/locales/es/.mustflow/skills/database-change-safety/SKILL.md +0 -155
- package/templates/default/locales/es/.mustflow/skills/date-number-audit/SKILL.md +0 -116
- package/templates/default/locales/es/.mustflow/skills/dependency-injection/SKILL.md +0 -161
- package/templates/default/locales/es/.mustflow/skills/dependency-reality-check/SKILL.md +0 -115
- package/templates/default/locales/es/.mustflow/skills/diff-risk-review/SKILL.md +0 -136
- package/templates/default/locales/es/.mustflow/skills/docs-prose-review/SKILL.md +0 -119
- package/templates/default/locales/es/.mustflow/skills/docs-update/SKILL.md +0 -97
- package/templates/default/locales/es/.mustflow/skills/external-prompt-injection-defense/SKILL.md +0 -116
- package/templates/default/locales/es/.mustflow/skills/facade-pattern/SKILL.md +0 -210
- package/templates/default/locales/es/.mustflow/skills/failure-triage/SKILL.md +0 -97
- package/templates/default/locales/es/.mustflow/skills/instruction-conflict-scope-check/SKILL.md +0 -118
- package/templates/default/locales/es/.mustflow/skills/line-ending-hygiene/SKILL.md +0 -111
- package/templates/default/locales/es/.mustflow/skills/migration-safety-check/SKILL.md +0 -117
- package/templates/default/locales/es/.mustflow/skills/multi-agent-work-coordination/SKILL.md +0 -260
- package/templates/default/locales/es/.mustflow/skills/null-object-pattern/SKILL.md +0 -196
- package/templates/default/locales/es/.mustflow/skills/pattern-scout/SKILL.md +0 -110
- package/templates/default/locales/es/.mustflow/skills/performance-budget-check/SKILL.md +0 -121
- package/templates/default/locales/es/.mustflow/skills/project-context-authoring/SKILL.md +0 -107
- package/templates/default/locales/es/.mustflow/skills/pure-core-imperative-shell/SKILL.md +0 -212
- package/templates/default/locales/es/.mustflow/skills/readme-authoring/SKILL.md +0 -115
- package/templates/default/locales/es/.mustflow/skills/repo-improvement-loop/SKILL.md +0 -150
- package/templates/default/locales/es/.mustflow/skills/repro-first-debug/SKILL.md +0 -112
- package/templates/default/locales/es/.mustflow/skills/requirement-regression-guard/SKILL.md +0 -152
- package/templates/default/locales/es/.mustflow/skills/result-option/SKILL.md +0 -186
- package/templates/default/locales/es/.mustflow/skills/security-privacy-review/SKILL.md +0 -116
- package/templates/default/locales/es/.mustflow/skills/security-regression-tests/SKILL.md +0 -131
- package/templates/default/locales/es/.mustflow/skills/skill-authoring/SKILL.md +0 -110
- package/templates/default/locales/es/.mustflow/skills/source-freshness-check/SKILL.md +0 -111
- package/templates/default/locales/es/.mustflow/skills/state-machine-pattern/SKILL.md +0 -214
- package/templates/default/locales/es/.mustflow/skills/strategy-pattern/SKILL.md +0 -215
- package/templates/default/locales/es/.mustflow/skills/structure-discovery-gate/SKILL.md +0 -159
- package/templates/default/locales/es/.mustflow/skills/test-design-guard/SKILL.md +0 -162
- package/templates/default/locales/es/.mustflow/skills/test-maintenance/SKILL.md +0 -122
- package/templates/default/locales/es/.mustflow/skills/ui-quality-gate/SKILL.md +0 -117
- package/templates/default/locales/es/.mustflow/skills/visual-review-artifact/SKILL.md +0 -127
- package/templates/default/locales/es/.mustflow/skills/visual-review-artifact/assets/review-template.html +0 -286
- package/templates/default/locales/es/.mustflow/skills/visual-review-artifact/resources.toml +0 -7
- package/templates/default/locales/es/.mustflow/skills/web-asset-optimization/SKILL.md +0 -108
- package/templates/default/locales/fr/.mustflow/skills/INDEX.md +0 -75
- package/templates/default/locales/fr/.mustflow/skills/adapter-boundary/SKILL.md +0 -193
- package/templates/default/locales/fr/.mustflow/skills/artifact-integrity-check/SKILL.md +0 -114
- package/templates/default/locales/fr/.mustflow/skills/behavior-preserving-refactor/SKILL.md +0 -182
- package/templates/default/locales/fr/.mustflow/skills/code-review/SKILL.md +0 -115
- package/templates/default/locales/fr/.mustflow/skills/codebase-orientation/SKILL.md +0 -115
- package/templates/default/locales/fr/.mustflow/skills/command-pattern/SKILL.md +0 -247
- package/templates/default/locales/fr/.mustflow/skills/composition-over-inheritance/SKILL.md +0 -176
- package/templates/default/locales/fr/.mustflow/skills/contract-sync-check/SKILL.md +0 -116
- package/templates/default/locales/fr/.mustflow/skills/database-change-safety/SKILL.md +0 -155
- package/templates/default/locales/fr/.mustflow/skills/date-number-audit/SKILL.md +0 -116
- package/templates/default/locales/fr/.mustflow/skills/dependency-injection/SKILL.md +0 -161
- package/templates/default/locales/fr/.mustflow/skills/dependency-reality-check/SKILL.md +0 -115
- package/templates/default/locales/fr/.mustflow/skills/diff-risk-review/SKILL.md +0 -136
- package/templates/default/locales/fr/.mustflow/skills/docs-prose-review/SKILL.md +0 -119
- package/templates/default/locales/fr/.mustflow/skills/docs-update/SKILL.md +0 -97
- package/templates/default/locales/fr/.mustflow/skills/external-prompt-injection-defense/SKILL.md +0 -116
- package/templates/default/locales/fr/.mustflow/skills/facade-pattern/SKILL.md +0 -210
- package/templates/default/locales/fr/.mustflow/skills/failure-triage/SKILL.md +0 -97
- package/templates/default/locales/fr/.mustflow/skills/instruction-conflict-scope-check/SKILL.md +0 -118
- package/templates/default/locales/fr/.mustflow/skills/line-ending-hygiene/SKILL.md +0 -111
- package/templates/default/locales/fr/.mustflow/skills/migration-safety-check/SKILL.md +0 -117
- package/templates/default/locales/fr/.mustflow/skills/multi-agent-work-coordination/SKILL.md +0 -260
- package/templates/default/locales/fr/.mustflow/skills/null-object-pattern/SKILL.md +0 -196
- package/templates/default/locales/fr/.mustflow/skills/pattern-scout/SKILL.md +0 -110
- package/templates/default/locales/fr/.mustflow/skills/performance-budget-check/SKILL.md +0 -121
- package/templates/default/locales/fr/.mustflow/skills/project-context-authoring/SKILL.md +0 -107
- package/templates/default/locales/fr/.mustflow/skills/pure-core-imperative-shell/SKILL.md +0 -212
- package/templates/default/locales/fr/.mustflow/skills/readme-authoring/SKILL.md +0 -115
- package/templates/default/locales/fr/.mustflow/skills/repo-improvement-loop/SKILL.md +0 -150
- package/templates/default/locales/fr/.mustflow/skills/repro-first-debug/SKILL.md +0 -112
- package/templates/default/locales/fr/.mustflow/skills/requirement-regression-guard/SKILL.md +0 -152
- package/templates/default/locales/fr/.mustflow/skills/result-option/SKILL.md +0 -186
- package/templates/default/locales/fr/.mustflow/skills/security-privacy-review/SKILL.md +0 -116
- package/templates/default/locales/fr/.mustflow/skills/security-regression-tests/SKILL.md +0 -131
- package/templates/default/locales/fr/.mustflow/skills/skill-authoring/SKILL.md +0 -110
- package/templates/default/locales/fr/.mustflow/skills/source-freshness-check/SKILL.md +0 -111
- package/templates/default/locales/fr/.mustflow/skills/state-machine-pattern/SKILL.md +0 -214
- package/templates/default/locales/fr/.mustflow/skills/strategy-pattern/SKILL.md +0 -215
- package/templates/default/locales/fr/.mustflow/skills/structure-discovery-gate/SKILL.md +0 -159
- package/templates/default/locales/fr/.mustflow/skills/test-design-guard/SKILL.md +0 -162
- package/templates/default/locales/fr/.mustflow/skills/test-maintenance/SKILL.md +0 -122
- package/templates/default/locales/fr/.mustflow/skills/ui-quality-gate/SKILL.md +0 -117
- package/templates/default/locales/fr/.mustflow/skills/visual-review-artifact/SKILL.md +0 -127
- package/templates/default/locales/fr/.mustflow/skills/visual-review-artifact/assets/review-template.html +0 -286
- package/templates/default/locales/fr/.mustflow/skills/visual-review-artifact/resources.toml +0 -7
- package/templates/default/locales/fr/.mustflow/skills/web-asset-optimization/SKILL.md +0 -108
- package/templates/default/locales/hi/.mustflow/skills/INDEX.md +0 -75
- package/templates/default/locales/hi/.mustflow/skills/adapter-boundary/SKILL.md +0 -193
- package/templates/default/locales/hi/.mustflow/skills/artifact-integrity-check/SKILL.md +0 -114
- package/templates/default/locales/hi/.mustflow/skills/behavior-preserving-refactor/SKILL.md +0 -182
- package/templates/default/locales/hi/.mustflow/skills/code-review/SKILL.md +0 -115
- package/templates/default/locales/hi/.mustflow/skills/codebase-orientation/SKILL.md +0 -115
- package/templates/default/locales/hi/.mustflow/skills/command-pattern/SKILL.md +0 -247
- package/templates/default/locales/hi/.mustflow/skills/composition-over-inheritance/SKILL.md +0 -176
- package/templates/default/locales/hi/.mustflow/skills/contract-sync-check/SKILL.md +0 -116
- package/templates/default/locales/hi/.mustflow/skills/database-change-safety/SKILL.md +0 -155
- package/templates/default/locales/hi/.mustflow/skills/date-number-audit/SKILL.md +0 -116
- package/templates/default/locales/hi/.mustflow/skills/dependency-injection/SKILL.md +0 -161
- package/templates/default/locales/hi/.mustflow/skills/dependency-reality-check/SKILL.md +0 -115
- package/templates/default/locales/hi/.mustflow/skills/diff-risk-review/SKILL.md +0 -136
- package/templates/default/locales/hi/.mustflow/skills/docs-prose-review/SKILL.md +0 -119
- package/templates/default/locales/hi/.mustflow/skills/docs-update/SKILL.md +0 -97
- package/templates/default/locales/hi/.mustflow/skills/external-prompt-injection-defense/SKILL.md +0 -116
- package/templates/default/locales/hi/.mustflow/skills/facade-pattern/SKILL.md +0 -210
- package/templates/default/locales/hi/.mustflow/skills/failure-triage/SKILL.md +0 -97
- package/templates/default/locales/hi/.mustflow/skills/instruction-conflict-scope-check/SKILL.md +0 -118
- package/templates/default/locales/hi/.mustflow/skills/line-ending-hygiene/SKILL.md +0 -111
- package/templates/default/locales/hi/.mustflow/skills/migration-safety-check/SKILL.md +0 -117
- package/templates/default/locales/hi/.mustflow/skills/multi-agent-work-coordination/SKILL.md +0 -260
- package/templates/default/locales/hi/.mustflow/skills/null-object-pattern/SKILL.md +0 -196
- package/templates/default/locales/hi/.mustflow/skills/pattern-scout/SKILL.md +0 -110
- package/templates/default/locales/hi/.mustflow/skills/performance-budget-check/SKILL.md +0 -121
- package/templates/default/locales/hi/.mustflow/skills/project-context-authoring/SKILL.md +0 -107
- package/templates/default/locales/hi/.mustflow/skills/pure-core-imperative-shell/SKILL.md +0 -212
- package/templates/default/locales/hi/.mustflow/skills/readme-authoring/SKILL.md +0 -115
- package/templates/default/locales/hi/.mustflow/skills/repo-improvement-loop/SKILL.md +0 -150
- package/templates/default/locales/hi/.mustflow/skills/repro-first-debug/SKILL.md +0 -112
- package/templates/default/locales/hi/.mustflow/skills/requirement-regression-guard/SKILL.md +0 -152
- package/templates/default/locales/hi/.mustflow/skills/result-option/SKILL.md +0 -186
- package/templates/default/locales/hi/.mustflow/skills/security-privacy-review/SKILL.md +0 -116
- package/templates/default/locales/hi/.mustflow/skills/security-regression-tests/SKILL.md +0 -131
- package/templates/default/locales/hi/.mustflow/skills/skill-authoring/SKILL.md +0 -110
- package/templates/default/locales/hi/.mustflow/skills/source-freshness-check/SKILL.md +0 -111
- package/templates/default/locales/hi/.mustflow/skills/state-machine-pattern/SKILL.md +0 -214
- package/templates/default/locales/hi/.mustflow/skills/strategy-pattern/SKILL.md +0 -215
- package/templates/default/locales/hi/.mustflow/skills/structure-discovery-gate/SKILL.md +0 -159
- package/templates/default/locales/hi/.mustflow/skills/test-design-guard/SKILL.md +0 -162
- package/templates/default/locales/hi/.mustflow/skills/test-maintenance/SKILL.md +0 -122
- package/templates/default/locales/hi/.mustflow/skills/ui-quality-gate/SKILL.md +0 -117
- package/templates/default/locales/hi/.mustflow/skills/visual-review-artifact/SKILL.md +0 -127
- package/templates/default/locales/hi/.mustflow/skills/visual-review-artifact/assets/review-template.html +0 -286
- package/templates/default/locales/hi/.mustflow/skills/visual-review-artifact/resources.toml +0 -7
- package/templates/default/locales/hi/.mustflow/skills/web-asset-optimization/SKILL.md +0 -108
- package/templates/default/locales/ko/.mustflow/skills/INDEX.md +0 -80
- package/templates/default/locales/ko/.mustflow/skills/adapter-boundary/SKILL.md +0 -193
- package/templates/default/locales/ko/.mustflow/skills/artifact-integrity-check/SKILL.md +0 -114
- package/templates/default/locales/ko/.mustflow/skills/behavior-preserving-refactor/SKILL.md +0 -182
- package/templates/default/locales/ko/.mustflow/skills/code-review/SKILL.md +0 -118
- package/templates/default/locales/ko/.mustflow/skills/codebase-orientation/SKILL.md +0 -115
- package/templates/default/locales/ko/.mustflow/skills/command-pattern/SKILL.md +0 -247
- package/templates/default/locales/ko/.mustflow/skills/composition-over-inheritance/SKILL.md +0 -176
- package/templates/default/locales/ko/.mustflow/skills/contract-sync-check/SKILL.md +0 -116
- package/templates/default/locales/ko/.mustflow/skills/database-change-safety/SKILL.md +0 -155
- package/templates/default/locales/ko/.mustflow/skills/date-number-audit/SKILL.md +0 -116
- package/templates/default/locales/ko/.mustflow/skills/dependency-injection/SKILL.md +0 -161
- package/templates/default/locales/ko/.mustflow/skills/dependency-reality-check/SKILL.md +0 -115
- package/templates/default/locales/ko/.mustflow/skills/diff-risk-review/SKILL.md +0 -136
- package/templates/default/locales/ko/.mustflow/skills/docs-prose-review/SKILL.md +0 -119
- package/templates/default/locales/ko/.mustflow/skills/docs-update/SKILL.md +0 -107
- package/templates/default/locales/ko/.mustflow/skills/external-prompt-injection-defense/SKILL.md +0 -116
- package/templates/default/locales/ko/.mustflow/skills/facade-pattern/SKILL.md +0 -210
- package/templates/default/locales/ko/.mustflow/skills/failure-triage/SKILL.md +0 -119
- package/templates/default/locales/ko/.mustflow/skills/instruction-conflict-scope-check/SKILL.md +0 -118
- package/templates/default/locales/ko/.mustflow/skills/line-ending-hygiene/SKILL.md +0 -111
- package/templates/default/locales/ko/.mustflow/skills/migration-safety-check/SKILL.md +0 -117
- package/templates/default/locales/ko/.mustflow/skills/multi-agent-work-coordination/SKILL.md +0 -259
- package/templates/default/locales/ko/.mustflow/skills/null-object-pattern/SKILL.md +0 -196
- package/templates/default/locales/ko/.mustflow/skills/pattern-scout/SKILL.md +0 -110
- package/templates/default/locales/ko/.mustflow/skills/performance-budget-check/SKILL.md +0 -121
- package/templates/default/locales/ko/.mustflow/skills/project-context-authoring/SKILL.md +0 -107
- package/templates/default/locales/ko/.mustflow/skills/pure-core-imperative-shell/SKILL.md +0 -212
- package/templates/default/locales/ko/.mustflow/skills/readme-authoring/SKILL.md +0 -115
- package/templates/default/locales/ko/.mustflow/skills/repo-improvement-loop/SKILL.md +0 -150
- package/templates/default/locales/ko/.mustflow/skills/repro-first-debug/SKILL.md +0 -112
- package/templates/default/locales/ko/.mustflow/skills/requirement-regression-guard/SKILL.md +0 -152
- package/templates/default/locales/ko/.mustflow/skills/result-option/SKILL.md +0 -186
- package/templates/default/locales/ko/.mustflow/skills/security-privacy-review/SKILL.md +0 -116
- package/templates/default/locales/ko/.mustflow/skills/security-regression-tests/SKILL.md +0 -131
- package/templates/default/locales/ko/.mustflow/skills/skill-authoring/SKILL.md +0 -110
- package/templates/default/locales/ko/.mustflow/skills/source-freshness-check/SKILL.md +0 -111
- package/templates/default/locales/ko/.mustflow/skills/state-machine-pattern/SKILL.md +0 -214
- package/templates/default/locales/ko/.mustflow/skills/strategy-pattern/SKILL.md +0 -215
- package/templates/default/locales/ko/.mustflow/skills/structure-discovery-gate/SKILL.md +0 -159
- package/templates/default/locales/ko/.mustflow/skills/test-design-guard/SKILL.md +0 -162
- package/templates/default/locales/ko/.mustflow/skills/test-maintenance/SKILL.md +0 -130
- package/templates/default/locales/ko/.mustflow/skills/ui-quality-gate/SKILL.md +0 -117
- package/templates/default/locales/ko/.mustflow/skills/visual-review-artifact/SKILL.md +0 -127
- package/templates/default/locales/ko/.mustflow/skills/visual-review-artifact/assets/review-template.html +0 -286
- package/templates/default/locales/ko/.mustflow/skills/visual-review-artifact/resources.toml +0 -7
- package/templates/default/locales/ko/.mustflow/skills/web-asset-optimization/SKILL.md +0 -108
- package/templates/default/locales/zh/.mustflow/skills/INDEX.md +0 -74
- package/templates/default/locales/zh/.mustflow/skills/adapter-boundary/SKILL.md +0 -193
- package/templates/default/locales/zh/.mustflow/skills/artifact-integrity-check/SKILL.md +0 -114
- package/templates/default/locales/zh/.mustflow/skills/behavior-preserving-refactor/SKILL.md +0 -182
- package/templates/default/locales/zh/.mustflow/skills/code-review/SKILL.md +0 -115
- package/templates/default/locales/zh/.mustflow/skills/codebase-orientation/SKILL.md +0 -115
- package/templates/default/locales/zh/.mustflow/skills/command-pattern/SKILL.md +0 -247
- package/templates/default/locales/zh/.mustflow/skills/composition-over-inheritance/SKILL.md +0 -176
- package/templates/default/locales/zh/.mustflow/skills/contract-sync-check/SKILL.md +0 -116
- package/templates/default/locales/zh/.mustflow/skills/database-change-safety/SKILL.md +0 -155
- package/templates/default/locales/zh/.mustflow/skills/date-number-audit/SKILL.md +0 -116
- package/templates/default/locales/zh/.mustflow/skills/dependency-injection/SKILL.md +0 -161
- package/templates/default/locales/zh/.mustflow/skills/dependency-reality-check/SKILL.md +0 -115
- package/templates/default/locales/zh/.mustflow/skills/diff-risk-review/SKILL.md +0 -136
- package/templates/default/locales/zh/.mustflow/skills/docs-prose-review/SKILL.md +0 -119
- package/templates/default/locales/zh/.mustflow/skills/docs-update/SKILL.md +0 -97
- package/templates/default/locales/zh/.mustflow/skills/external-prompt-injection-defense/SKILL.md +0 -116
- package/templates/default/locales/zh/.mustflow/skills/facade-pattern/SKILL.md +0 -210
- package/templates/default/locales/zh/.mustflow/skills/failure-triage/SKILL.md +0 -96
- package/templates/default/locales/zh/.mustflow/skills/instruction-conflict-scope-check/SKILL.md +0 -118
- package/templates/default/locales/zh/.mustflow/skills/line-ending-hygiene/SKILL.md +0 -111
- package/templates/default/locales/zh/.mustflow/skills/migration-safety-check/SKILL.md +0 -117
- package/templates/default/locales/zh/.mustflow/skills/multi-agent-work-coordination/SKILL.md +0 -260
- package/templates/default/locales/zh/.mustflow/skills/null-object-pattern/SKILL.md +0 -196
- package/templates/default/locales/zh/.mustflow/skills/pattern-scout/SKILL.md +0 -110
- package/templates/default/locales/zh/.mustflow/skills/performance-budget-check/SKILL.md +0 -121
- package/templates/default/locales/zh/.mustflow/skills/project-context-authoring/SKILL.md +0 -107
- package/templates/default/locales/zh/.mustflow/skills/pure-core-imperative-shell/SKILL.md +0 -212
- package/templates/default/locales/zh/.mustflow/skills/readme-authoring/SKILL.md +0 -115
- package/templates/default/locales/zh/.mustflow/skills/repo-improvement-loop/SKILL.md +0 -150
- package/templates/default/locales/zh/.mustflow/skills/repro-first-debug/SKILL.md +0 -112
- package/templates/default/locales/zh/.mustflow/skills/requirement-regression-guard/SKILL.md +0 -152
- package/templates/default/locales/zh/.mustflow/skills/result-option/SKILL.md +0 -186
- package/templates/default/locales/zh/.mustflow/skills/security-privacy-review/SKILL.md +0 -116
- package/templates/default/locales/zh/.mustflow/skills/security-regression-tests/SKILL.md +0 -131
- package/templates/default/locales/zh/.mustflow/skills/skill-authoring/SKILL.md +0 -110
- package/templates/default/locales/zh/.mustflow/skills/source-freshness-check/SKILL.md +0 -111
- package/templates/default/locales/zh/.mustflow/skills/state-machine-pattern/SKILL.md +0 -214
- package/templates/default/locales/zh/.mustflow/skills/strategy-pattern/SKILL.md +0 -215
- package/templates/default/locales/zh/.mustflow/skills/structure-discovery-gate/SKILL.md +0 -159
- package/templates/default/locales/zh/.mustflow/skills/test-design-guard/SKILL.md +0 -162
- package/templates/default/locales/zh/.mustflow/skills/test-maintenance/SKILL.md +0 -122
- package/templates/default/locales/zh/.mustflow/skills/ui-quality-gate/SKILL.md +0 -117
- package/templates/default/locales/zh/.mustflow/skills/visual-review-artifact/SKILL.md +0 -127
- package/templates/default/locales/zh/.mustflow/skills/visual-review-artifact/assets/review-template.html +0 -286
- package/templates/default/locales/zh/.mustflow/skills/visual-review-artifact/resources.toml +0 -7
- package/templates/default/locales/zh/.mustflow/skills/web-asset-optimization/SKILL.md +0 -108
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { readFileSync } from 'node:fs';
|
|
1
|
+
import { mkdirSync, readFileSync, writeFileSync } from 'node:fs';
|
|
2
2
|
import path from 'node:path';
|
|
3
|
+
import { createClassifyOutput } from './classify.js';
|
|
3
4
|
import { runRun } from './run.js';
|
|
4
5
|
import { createChangeVerificationReport, } from '../../core/change-verification.js';
|
|
5
|
-
import { createVerificationPlan } from '../../core/verification-plan.js';
|
|
6
6
|
import { readCommandContract } from '../../core/config-loading.js';
|
|
7
7
|
import { printUsageError, renderHelp } from '../lib/cli-output.js';
|
|
8
8
|
import { t } from '../lib/i18n.js';
|
|
@@ -31,11 +31,13 @@ function createBufferedOutput() {
|
|
|
31
31
|
}
|
|
32
32
|
export function getVerifyHelp(lang = 'en') {
|
|
33
33
|
return renderHelp({
|
|
34
|
-
usage: 'mf verify --reason <event> [options] | mf verify --from-plan <path> [options]',
|
|
34
|
+
usage: 'mf verify --reason <event> [options] | mf verify --from-plan <path> [options] | mf verify --changed [options]',
|
|
35
35
|
summary: t(lang, 'verify.help.summary'),
|
|
36
36
|
options: [
|
|
37
37
|
{ label: '--reason <event>', description: t(lang, 'verify.help.option.reason') },
|
|
38
38
|
{ label: '--from-plan <path>', description: t(lang, 'verify.help.option.fromPlan') },
|
|
39
|
+
{ label: '--changed', description: t(lang, 'verify.help.option.changed') },
|
|
40
|
+
{ label: '--write-plan <path>', description: t(lang, 'verify.help.option.writePlan') },
|
|
39
41
|
{ label: '--plan-only', description: t(lang, 'verify.help.option.planOnly') },
|
|
40
42
|
{ label: '--json', description: t(lang, 'cli.option.json') },
|
|
41
43
|
{ label: '-h, --help', description: t(lang, 'cli.option.help') },
|
|
@@ -45,6 +47,8 @@ export function getVerifyHelp(lang = 'en') {
|
|
|
45
47
|
'mf verify --reason docs_change --json',
|
|
46
48
|
'mf verify --reason docs_change --plan-only --json',
|
|
47
49
|
'mf verify --from-plan verify-plan.json --json',
|
|
50
|
+
'mf verify --changed --plan-only --json',
|
|
51
|
+
'mf verify --changed --write-plan .mustflow/state/change-plan.json --json',
|
|
48
52
|
'mf verify --reason mustflow_docs_change',
|
|
49
53
|
],
|
|
50
54
|
exitCodes: [
|
|
@@ -56,8 +60,10 @@ export function getVerifyHelp(lang = 'en') {
|
|
|
56
60
|
function parseVerifyArgs(args) {
|
|
57
61
|
let reason;
|
|
58
62
|
let fromPlan;
|
|
63
|
+
let writePlan;
|
|
59
64
|
let json = false;
|
|
60
65
|
let planOnly = false;
|
|
66
|
+
let changed = false;
|
|
61
67
|
for (let index = 0; index < args.length; index += 1) {
|
|
62
68
|
const arg = args[index];
|
|
63
69
|
if (arg === '--json') {
|
|
@@ -68,10 +74,14 @@ function parseVerifyArgs(args) {
|
|
|
68
74
|
planOnly = true;
|
|
69
75
|
continue;
|
|
70
76
|
}
|
|
77
|
+
if (arg === '--changed') {
|
|
78
|
+
changed = true;
|
|
79
|
+
continue;
|
|
80
|
+
}
|
|
71
81
|
if (arg === '--reason') {
|
|
72
82
|
const value = args[index + 1];
|
|
73
83
|
if (!value || value.startsWith('-')) {
|
|
74
|
-
return { json, planOnly, reason, error: 'missing_reason_value' };
|
|
84
|
+
return { json, planOnly, changed, reason, error: 'missing_reason_value' };
|
|
75
85
|
}
|
|
76
86
|
reason = value;
|
|
77
87
|
index += 1;
|
|
@@ -80,16 +90,25 @@ function parseVerifyArgs(args) {
|
|
|
80
90
|
if (arg === '--from-plan') {
|
|
81
91
|
const value = args[index + 1];
|
|
82
92
|
if (!value || value.startsWith('-')) {
|
|
83
|
-
return { json, planOnly, reason, fromPlan, error: 'missing_from_plan_value' };
|
|
93
|
+
return { json, planOnly, changed, reason, fromPlan, error: 'missing_from_plan_value' };
|
|
84
94
|
}
|
|
85
95
|
fromPlan = value;
|
|
86
96
|
index += 1;
|
|
87
97
|
continue;
|
|
88
98
|
}
|
|
99
|
+
if (arg === '--write-plan') {
|
|
100
|
+
const value = args[index + 1];
|
|
101
|
+
if (!value || value.startsWith('-')) {
|
|
102
|
+
return { json, planOnly, changed, reason, fromPlan, writePlan, error: 'missing_write_plan_value' };
|
|
103
|
+
}
|
|
104
|
+
writePlan = value;
|
|
105
|
+
index += 1;
|
|
106
|
+
continue;
|
|
107
|
+
}
|
|
89
108
|
if (arg.startsWith('--reason=')) {
|
|
90
109
|
const value = arg.slice('--reason='.length);
|
|
91
110
|
if (value.length === 0) {
|
|
92
|
-
return { json, planOnly, reason, error: 'missing_reason_value' };
|
|
111
|
+
return { json, planOnly, changed, reason, error: 'missing_reason_value' };
|
|
93
112
|
}
|
|
94
113
|
reason = value;
|
|
95
114
|
continue;
|
|
@@ -97,17 +116,25 @@ function parseVerifyArgs(args) {
|
|
|
97
116
|
if (arg.startsWith('--from-plan=')) {
|
|
98
117
|
const value = arg.slice('--from-plan='.length);
|
|
99
118
|
if (value.length === 0) {
|
|
100
|
-
return { json, planOnly, reason, fromPlan, error: 'missing_from_plan_value' };
|
|
119
|
+
return { json, planOnly, changed, reason, fromPlan, error: 'missing_from_plan_value' };
|
|
101
120
|
}
|
|
102
121
|
fromPlan = value;
|
|
103
122
|
continue;
|
|
104
123
|
}
|
|
124
|
+
if (arg.startsWith('--write-plan=')) {
|
|
125
|
+
const value = arg.slice('--write-plan='.length);
|
|
126
|
+
if (value.length === 0) {
|
|
127
|
+
return { json, planOnly, changed, reason, fromPlan, writePlan, error: 'missing_write_plan_value' };
|
|
128
|
+
}
|
|
129
|
+
writePlan = value;
|
|
130
|
+
continue;
|
|
131
|
+
}
|
|
105
132
|
if (arg.startsWith('-')) {
|
|
106
|
-
return { json, planOnly, reason, error: arg };
|
|
133
|
+
return { json, planOnly, changed, reason, fromPlan, writePlan, error: arg };
|
|
107
134
|
}
|
|
108
|
-
return { json, planOnly, reason, error: `unexpected:${arg}` };
|
|
135
|
+
return { json, planOnly, changed, reason, fromPlan, writePlan, error: `unexpected:${arg}` };
|
|
109
136
|
}
|
|
110
|
-
return { json, planOnly, reason, fromPlan };
|
|
137
|
+
return { json, planOnly, changed, reason, fromPlan, writePlan };
|
|
111
138
|
}
|
|
112
139
|
function uniqueStrings(values) {
|
|
113
140
|
return [...new Set(values.map((value) => value.trim()).filter((value) => value.length > 0))];
|
|
@@ -118,14 +145,116 @@ function readStringArray(value) {
|
|
|
118
145
|
}
|
|
119
146
|
return value.filter((item) => typeof item === 'string');
|
|
120
147
|
}
|
|
121
|
-
function
|
|
122
|
-
return
|
|
148
|
+
function isStringArray(value) {
|
|
149
|
+
return Array.isArray(value) && value.every((item) => typeof item === 'string');
|
|
123
150
|
}
|
|
124
|
-
function
|
|
125
|
-
return
|
|
151
|
+
function isPlainRecord(value) {
|
|
152
|
+
return Boolean(value) && typeof value === 'object' && !Array.isArray(value);
|
|
126
153
|
}
|
|
127
|
-
function
|
|
128
|
-
return value === '
|
|
154
|
+
function isUpdatePolicy(value) {
|
|
155
|
+
return value === 'update' || value === 'update_or_mark_stale' || value === 'not_applicable';
|
|
156
|
+
}
|
|
157
|
+
function isUpdatePolicyArray(value) {
|
|
158
|
+
return Array.isArray(value) && value.every((item) => isUpdatePolicy(item));
|
|
159
|
+
}
|
|
160
|
+
function readPlanRoot(value) {
|
|
161
|
+
if (!isPlainRecord(value)) {
|
|
162
|
+
return null;
|
|
163
|
+
}
|
|
164
|
+
const root = value.mustflow_root;
|
|
165
|
+
return typeof root === 'string' && root.length > 0 ? root : null;
|
|
166
|
+
}
|
|
167
|
+
function readStrictClassificationSummary(value) {
|
|
168
|
+
if (!isPlainRecord(value)) {
|
|
169
|
+
return null;
|
|
170
|
+
}
|
|
171
|
+
if (!Number.isInteger(value.fileCount) ||
|
|
172
|
+
Number(value.fileCount) < 0 ||
|
|
173
|
+
!Number.isInteger(value.publicSurfaceCount) ||
|
|
174
|
+
Number(value.publicSurfaceCount) < 0 ||
|
|
175
|
+
!isStringArray(value.changeKinds) ||
|
|
176
|
+
!isStringArray(value.validationReasons) ||
|
|
177
|
+
!isUpdatePolicyArray(value.updatePolicies) ||
|
|
178
|
+
!isStringArray(value.driftChecks) ||
|
|
179
|
+
!isStringArray(value.affectedContracts)) {
|
|
180
|
+
return null;
|
|
181
|
+
}
|
|
182
|
+
return {
|
|
183
|
+
fileCount: Number(value.fileCount),
|
|
184
|
+
publicSurfaceCount: Number(value.publicSurfaceCount),
|
|
185
|
+
changeKinds: [...value.changeKinds],
|
|
186
|
+
validationReasons: uniqueStrings(value.validationReasons),
|
|
187
|
+
updatePolicies: [...value.updatePolicies],
|
|
188
|
+
driftChecks: [...value.driftChecks],
|
|
189
|
+
affectedContracts: [...value.affectedContracts],
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
function readStrictClassification(value) {
|
|
193
|
+
if (!isPlainRecord(value) || typeof value.path !== 'string' || !isStringArray(value.changeKinds)) {
|
|
194
|
+
return null;
|
|
195
|
+
}
|
|
196
|
+
const surface = value.surface;
|
|
197
|
+
if (!isPlainRecord(surface)) {
|
|
198
|
+
return null;
|
|
199
|
+
}
|
|
200
|
+
if (typeof surface.kind !== 'string' ||
|
|
201
|
+
typeof surface.category !== 'string' ||
|
|
202
|
+
typeof surface.isPublicSurface !== 'boolean' ||
|
|
203
|
+
!isStringArray(surface.validationReasons) ||
|
|
204
|
+
!isStringArray(surface.affectedContracts) ||
|
|
205
|
+
!isUpdatePolicy(surface.updatePolicy) ||
|
|
206
|
+
!isStringArray(surface.driftChecks)) {
|
|
207
|
+
return null;
|
|
208
|
+
}
|
|
209
|
+
return {
|
|
210
|
+
path: value.path,
|
|
211
|
+
changeKinds: [...value.changeKinds],
|
|
212
|
+
surface: {
|
|
213
|
+
kind: surface.kind,
|
|
214
|
+
category: surface.category,
|
|
215
|
+
isPublicSurface: surface.isPublicSurface,
|
|
216
|
+
validationReasons: [...surface.validationReasons],
|
|
217
|
+
affectedContracts: [...surface.affectedContracts],
|
|
218
|
+
updatePolicy: surface.updatePolicy,
|
|
219
|
+
driftChecks: [...surface.driftChecks],
|
|
220
|
+
},
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
function readStrictClassifications(value) {
|
|
224
|
+
if (!Array.isArray(value)) {
|
|
225
|
+
return null;
|
|
226
|
+
}
|
|
227
|
+
const classifications = value.map(readStrictClassification);
|
|
228
|
+
return classifications.every((classification) => classification !== null)
|
|
229
|
+
? classifications
|
|
230
|
+
: null;
|
|
231
|
+
}
|
|
232
|
+
function readStrictClassifyPlan(projectRoot, plan) {
|
|
233
|
+
if (!isPlainRecord(plan)) {
|
|
234
|
+
throw new Error('unsupported_plan_source');
|
|
235
|
+
}
|
|
236
|
+
if (plan.schema_version !== '1' || plan.command !== 'classify') {
|
|
237
|
+
throw new Error('unsupported_plan_source');
|
|
238
|
+
}
|
|
239
|
+
if (readPlanRoot(plan) !== projectRoot) {
|
|
240
|
+
throw new Error('plan_root_mismatch');
|
|
241
|
+
}
|
|
242
|
+
const source = plan.source;
|
|
243
|
+
const files = plan.files;
|
|
244
|
+
const classifications = readStrictClassifications(plan.classifications);
|
|
245
|
+
const summary = readStrictClassificationSummary(plan.summary);
|
|
246
|
+
if ((source !== 'changed' && source !== 'paths') || !isStringArray(files) || !classifications || !summary) {
|
|
247
|
+
throw new Error('invalid_plan_file');
|
|
248
|
+
}
|
|
249
|
+
if (summary.validationReasons.length === 0) {
|
|
250
|
+
throw new Error('missing_plan_reasons');
|
|
251
|
+
}
|
|
252
|
+
return {
|
|
253
|
+
source,
|
|
254
|
+
files: [...files],
|
|
255
|
+
classifications,
|
|
256
|
+
summary,
|
|
257
|
+
};
|
|
129
258
|
}
|
|
130
259
|
function emptyClassificationSummary(validationReasons) {
|
|
131
260
|
return {
|
|
@@ -138,51 +267,6 @@ function emptyClassificationSummary(validationReasons) {
|
|
|
138
267
|
affectedContracts: [],
|
|
139
268
|
};
|
|
140
269
|
}
|
|
141
|
-
function readClassificationSummary(value, fallbackReasons) {
|
|
142
|
-
if (!value || typeof value !== 'object' || Array.isArray(value)) {
|
|
143
|
-
return emptyClassificationSummary(fallbackReasons);
|
|
144
|
-
}
|
|
145
|
-
const record = value;
|
|
146
|
-
const validationReasons = uniqueStrings([...fallbackReasons, ...readStringArray(record.validationReasons)]);
|
|
147
|
-
return {
|
|
148
|
-
fileCount: readNumber(record.fileCount) ?? 0,
|
|
149
|
-
publicSurfaceCount: readNumber(record.publicSurfaceCount) ?? 0,
|
|
150
|
-
changeKinds: readStringArray(record.changeKinds),
|
|
151
|
-
validationReasons,
|
|
152
|
-
updatePolicies: readUpdatePolicies(record.updatePolicies),
|
|
153
|
-
driftChecks: readStringArray(record.driftChecks),
|
|
154
|
-
affectedContracts: readStringArray(record.affectedContracts),
|
|
155
|
-
};
|
|
156
|
-
}
|
|
157
|
-
function readClassifications(value) {
|
|
158
|
-
if (!Array.isArray(value)) {
|
|
159
|
-
return [];
|
|
160
|
-
}
|
|
161
|
-
return value.filter((item) => {
|
|
162
|
-
if (!item || typeof item !== 'object' || Array.isArray(item)) {
|
|
163
|
-
return false;
|
|
164
|
-
}
|
|
165
|
-
const record = item;
|
|
166
|
-
const surface = record.surface;
|
|
167
|
-
const surfaceRecord = surface;
|
|
168
|
-
return (typeof record.path === 'string' &&
|
|
169
|
-
Array.isArray(record.changeKinds) &&
|
|
170
|
-
readStringArray(record.changeKinds).length === record.changeKinds.length &&
|
|
171
|
-
surface !== null &&
|
|
172
|
-
typeof surface === 'object' &&
|
|
173
|
-
!Array.isArray(surface) &&
|
|
174
|
-
typeof surfaceRecord.kind === 'string' &&
|
|
175
|
-
typeof surfaceRecord.category === 'string' &&
|
|
176
|
-
typeof surfaceRecord.isPublicSurface === 'boolean' &&
|
|
177
|
-
Array.isArray(surfaceRecord.validationReasons) &&
|
|
178
|
-
readStringArray(surfaceRecord.validationReasons).length === surfaceRecord.validationReasons.length &&
|
|
179
|
-
Array.isArray(surfaceRecord.affectedContracts) &&
|
|
180
|
-
readStringArray(surfaceRecord.affectedContracts).length === surfaceRecord.affectedContracts.length &&
|
|
181
|
-
readUpdatePolicies([surfaceRecord.updatePolicy]).length === 1 &&
|
|
182
|
-
Array.isArray(surfaceRecord.driftChecks) &&
|
|
183
|
-
readStringArray(surfaceRecord.driftChecks).length === surfaceRecord.driftChecks.length);
|
|
184
|
-
});
|
|
185
|
-
}
|
|
186
270
|
function createSyntheticClassificationReport(reasons, source = 'paths', files = []) {
|
|
187
271
|
return {
|
|
188
272
|
source,
|
|
@@ -191,45 +275,6 @@ function createSyntheticClassificationReport(reasons, source = 'paths', files =
|
|
|
191
275
|
summary: emptyClassificationSummary(reasons),
|
|
192
276
|
};
|
|
193
277
|
}
|
|
194
|
-
function readClassificationReport(plan, fallbackReasons) {
|
|
195
|
-
if (!plan || typeof plan !== 'object' || Array.isArray(plan)) {
|
|
196
|
-
return createSyntheticClassificationReport(fallbackReasons);
|
|
197
|
-
}
|
|
198
|
-
const record = plan;
|
|
199
|
-
const summary = readClassificationSummary(record.classification_summary ?? record.summary, fallbackReasons);
|
|
200
|
-
const files = readStringArray(record.files);
|
|
201
|
-
const classifications = readClassifications(record.classifications);
|
|
202
|
-
return {
|
|
203
|
-
source: readChangeSource(record.source),
|
|
204
|
-
files,
|
|
205
|
-
classifications,
|
|
206
|
-
summary,
|
|
207
|
-
};
|
|
208
|
-
}
|
|
209
|
-
function readPlanReasons(plan) {
|
|
210
|
-
if (!plan || typeof plan !== 'object' || Array.isArray(plan)) {
|
|
211
|
-
return [];
|
|
212
|
-
}
|
|
213
|
-
const record = plan;
|
|
214
|
-
const summary = record.summary;
|
|
215
|
-
const classificationSummary = record.classification_summary;
|
|
216
|
-
const verification = record.verification;
|
|
217
|
-
const reasons = [
|
|
218
|
-
typeof record.reason === 'string' ? record.reason : '',
|
|
219
|
-
...readStringArray(record.reasons),
|
|
220
|
-
...readStringArray(record.validationReasons),
|
|
221
|
-
...(summary && typeof summary === 'object' && !Array.isArray(summary)
|
|
222
|
-
? readStringArray(summary.validationReasons)
|
|
223
|
-
: []),
|
|
224
|
-
...(classificationSummary && typeof classificationSummary === 'object' && !Array.isArray(classificationSummary)
|
|
225
|
-
? readStringArray(classificationSummary.validationReasons)
|
|
226
|
-
: []),
|
|
227
|
-
...(verification && typeof verification === 'object' && !Array.isArray(verification)
|
|
228
|
-
? readStringArray(verification.reasons)
|
|
229
|
-
: []),
|
|
230
|
-
];
|
|
231
|
-
return uniqueStrings(reasons);
|
|
232
|
-
}
|
|
233
278
|
function resolvePlanPath(projectRoot, inputPath) {
|
|
234
279
|
const resolved = path.resolve(projectRoot, inputPath);
|
|
235
280
|
const relative = path.relative(projectRoot, resolved);
|
|
@@ -238,7 +283,7 @@ function resolvePlanPath(projectRoot, inputPath) {
|
|
|
238
283
|
}
|
|
239
284
|
return resolved;
|
|
240
285
|
}
|
|
241
|
-
function readInputFromPlan(projectRoot, inputPath) {
|
|
286
|
+
export function readInputFromPlan(projectRoot, inputPath) {
|
|
242
287
|
let parsed;
|
|
243
288
|
const planPath = resolvePlanPath(projectRoot, inputPath);
|
|
244
289
|
try {
|
|
@@ -247,21 +292,37 @@ function readInputFromPlan(projectRoot, inputPath) {
|
|
|
247
292
|
catch {
|
|
248
293
|
throw new Error('invalid_plan_file');
|
|
249
294
|
}
|
|
250
|
-
const
|
|
251
|
-
if (reasons.length === 0) {
|
|
252
|
-
throw new Error('missing_plan_reasons');
|
|
253
|
-
}
|
|
295
|
+
const classificationReport = readStrictClassifyPlan(projectRoot, parsed);
|
|
254
296
|
return {
|
|
255
|
-
reasons,
|
|
256
|
-
classificationReport
|
|
297
|
+
reasons: classificationReport.summary.validationReasons,
|
|
298
|
+
classificationReport,
|
|
299
|
+
};
|
|
300
|
+
}
|
|
301
|
+
function createInputFromChanged(projectRoot) {
|
|
302
|
+
const plan = createClassifyOutput(projectRoot, 'changed', []);
|
|
303
|
+
return {
|
|
304
|
+
plan,
|
|
305
|
+
input: {
|
|
306
|
+
reasons: plan.summary.validationReasons,
|
|
307
|
+
classificationReport: plan,
|
|
308
|
+
},
|
|
257
309
|
};
|
|
258
310
|
}
|
|
259
|
-
function
|
|
311
|
+
function writeChangedPlan(projectRoot, inputPath, plan) {
|
|
312
|
+
const planPath = resolvePlanPath(projectRoot, inputPath);
|
|
313
|
+
mkdirSync(path.dirname(planPath), { recursive: true });
|
|
314
|
+
writeFileSync(planPath, `${JSON.stringify(plan, null, 2)}\n`, 'utf8');
|
|
315
|
+
}
|
|
316
|
+
export function planErrorMessageKey(code) {
|
|
260
317
|
switch (code) {
|
|
261
318
|
case 'plan_path_outside_root':
|
|
262
319
|
return 'verify.error.plan_path_outside_root';
|
|
263
320
|
case 'missing_plan_reasons':
|
|
264
321
|
return 'verify.error.missing_plan_reasons';
|
|
322
|
+
case 'unsupported_plan_source':
|
|
323
|
+
return 'verify.error.unsupported_plan_source';
|
|
324
|
+
case 'plan_root_mismatch':
|
|
325
|
+
return 'verify.error.plan_root_mismatch';
|
|
265
326
|
default:
|
|
266
327
|
return 'verify.error.invalid_plan_file';
|
|
267
328
|
}
|
|
@@ -277,6 +338,31 @@ function skippedResult(candidate) {
|
|
|
277
338
|
receipt: null,
|
|
278
339
|
};
|
|
279
340
|
}
|
|
341
|
+
function candidateResultKey(candidate) {
|
|
342
|
+
return candidate.intent
|
|
343
|
+
? `intent:${candidate.intent}`
|
|
344
|
+
: `missing:${candidate.reason}:${candidate.skipReason ?? ''}:${candidate.detail ?? ''}`;
|
|
345
|
+
}
|
|
346
|
+
function createSkippedResults(candidates, scheduledIntents) {
|
|
347
|
+
const seen = new Set();
|
|
348
|
+
const results = [];
|
|
349
|
+
for (const candidate of candidates) {
|
|
350
|
+
if (candidate.status === 'runnable' || (candidate.intent && scheduledIntents.has(candidate.intent))) {
|
|
351
|
+
continue;
|
|
352
|
+
}
|
|
353
|
+
const key = candidateResultKey(candidate);
|
|
354
|
+
if (seen.has(key)) {
|
|
355
|
+
continue;
|
|
356
|
+
}
|
|
357
|
+
seen.add(key);
|
|
358
|
+
results.push(skippedResult({
|
|
359
|
+
intent: candidate.intent ?? '',
|
|
360
|
+
reason: candidate.skipReason,
|
|
361
|
+
detail: candidate.detail,
|
|
362
|
+
}));
|
|
363
|
+
}
|
|
364
|
+
return results;
|
|
365
|
+
}
|
|
280
366
|
async function runVerificationIntent(intent, lang) {
|
|
281
367
|
const output = createBufferedOutput();
|
|
282
368
|
const exitCode = await runRun([intent, '--json'], output.reporter, lang);
|
|
@@ -333,34 +419,22 @@ function getVerificationStatus(summary) {
|
|
|
333
419
|
}
|
|
334
420
|
return 'passed';
|
|
335
421
|
}
|
|
336
|
-
async function createVerifyOutput(
|
|
422
|
+
async function createVerifyOutput(input, planSource, projectRoot, lang) {
|
|
337
423
|
const contract = readCommandContract(projectRoot);
|
|
338
|
-
const
|
|
339
|
-
const
|
|
340
|
-
for (const reason of reasons) {
|
|
341
|
-
const plan = createVerificationPlan(contract, reason);
|
|
342
|
-
for (const candidate of plan.candidates) {
|
|
343
|
-
if (!candidate.intent) {
|
|
344
|
-
unmatchedCandidates.push(candidate);
|
|
345
|
-
continue;
|
|
346
|
-
}
|
|
347
|
-
if (!candidatesByIntent.has(candidate.intent)) {
|
|
348
|
-
candidatesByIntent.set(candidate.intent, candidate);
|
|
349
|
-
}
|
|
350
|
-
}
|
|
351
|
-
}
|
|
352
|
-
const candidates = [...candidatesByIntent.values(), ...unmatchedCandidates].sort((left, right) => left.intent.localeCompare(right.intent));
|
|
424
|
+
const report = createChangeVerificationReport(input.classificationReport, contract, projectRoot);
|
|
425
|
+
const scheduledIntents = new Set(report.schedule.entries.map((entry) => entry.intent));
|
|
353
426
|
const results = [];
|
|
354
|
-
for (const
|
|
355
|
-
results.push(
|
|
427
|
+
for (const entry of report.schedule.entries) {
|
|
428
|
+
results.push(await runVerificationIntent(entry.intent, lang));
|
|
356
429
|
}
|
|
430
|
+
results.push(...createSkippedResults(report.candidates, scheduledIntents));
|
|
357
431
|
const summary = summarizeResults(results);
|
|
358
432
|
return {
|
|
359
433
|
schema_version: VERIFY_SCHEMA_VERSION,
|
|
360
434
|
command: 'verify',
|
|
361
435
|
mustflow_root: projectRoot,
|
|
362
|
-
reason: reasons.join(', '),
|
|
363
|
-
reasons,
|
|
436
|
+
reason: input.reasons.join(', '),
|
|
437
|
+
reasons: input.reasons,
|
|
364
438
|
plan_source: planSource,
|
|
365
439
|
status: getVerificationStatus(summary),
|
|
366
440
|
summary,
|
|
@@ -435,33 +509,52 @@ export async function runVerify(args, reporter, lang = 'en') {
|
|
|
435
509
|
? t(lang, 'cli.error.missingValue', { option: '--reason' })
|
|
436
510
|
: parsed.error === 'missing_from_plan_value'
|
|
437
511
|
? t(lang, 'cli.error.missingValue', { option: '--from-plan' })
|
|
438
|
-
: parsed.error
|
|
439
|
-
? t(lang, 'cli.error.
|
|
440
|
-
:
|
|
512
|
+
: parsed.error === 'missing_write_plan_value'
|
|
513
|
+
? t(lang, 'cli.error.missingValue', { option: '--write-plan' })
|
|
514
|
+
: parsed.error.startsWith('unexpected:')
|
|
515
|
+
? t(lang, 'cli.error.unexpectedArgument', { argument: parsed.error.slice('unexpected:'.length) })
|
|
516
|
+
: t(lang, 'cli.error.unknownOption', { option: parsed.error });
|
|
441
517
|
printUsageError(reporter, message, 'mf verify --help', getVerifyHelp(lang), lang);
|
|
442
518
|
return 1;
|
|
443
519
|
}
|
|
444
|
-
|
|
520
|
+
const selectedInputCount = [parsed.reason, parsed.fromPlan, parsed.changed ? 'changed' : undefined].filter(Boolean).length;
|
|
521
|
+
if (selectedInputCount > 1) {
|
|
445
522
|
printUsageError(reporter, t(lang, 'verify.error.conflictingInputs'), 'mf verify --help', getVerifyHelp(lang), lang);
|
|
446
523
|
return 1;
|
|
447
524
|
}
|
|
448
|
-
if (
|
|
525
|
+
if (selectedInputCount === 0) {
|
|
449
526
|
printUsageError(reporter, t(lang, 'verify.error.missingReason'), 'mf verify --help', getVerifyHelp(lang), lang);
|
|
450
527
|
return 1;
|
|
451
528
|
}
|
|
529
|
+
if (parsed.writePlan && !parsed.changed) {
|
|
530
|
+
printUsageError(reporter, t(lang, 'verify.error.writePlanRequiresChanged'), 'mf verify --help', getVerifyHelp(lang), lang);
|
|
531
|
+
return 1;
|
|
532
|
+
}
|
|
452
533
|
if (parsed.planOnly && !parsed.json) {
|
|
453
534
|
printUsageError(reporter, t(lang, 'verify.error.planOnlyJson'), 'mf verify --help', getVerifyHelp(lang), lang);
|
|
454
535
|
return 1;
|
|
455
536
|
}
|
|
456
537
|
const projectRoot = resolveMustflowRoot();
|
|
457
538
|
let input;
|
|
539
|
+
let changedPlan = null;
|
|
458
540
|
try {
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
541
|
+
if (parsed.changed) {
|
|
542
|
+
const changedInput = createInputFromChanged(projectRoot);
|
|
543
|
+
input = changedInput.input;
|
|
544
|
+
changedPlan = changedInput.plan;
|
|
545
|
+
}
|
|
546
|
+
else if (parsed.fromPlan) {
|
|
547
|
+
input = readInputFromPlan(projectRoot, parsed.fromPlan);
|
|
548
|
+
}
|
|
549
|
+
else {
|
|
550
|
+
input = {
|
|
462
551
|
reasons: [parsed.reason],
|
|
463
552
|
classificationReport: createSyntheticClassificationReport([parsed.reason]),
|
|
464
553
|
};
|
|
554
|
+
}
|
|
555
|
+
if (parsed.writePlan && changedPlan) {
|
|
556
|
+
writeChangedPlan(projectRoot, parsed.writePlan, changedPlan);
|
|
557
|
+
}
|
|
465
558
|
}
|
|
466
559
|
catch (error) {
|
|
467
560
|
const code = error instanceof Error ? error.message : 'invalid_plan_file';
|
|
@@ -472,7 +565,7 @@ export async function runVerify(args, reporter, lang = 'en') {
|
|
|
472
565
|
reporter.stdout(JSON.stringify(await createPlanOnlyOutput(input, projectRoot), null, 2));
|
|
473
566
|
return 0;
|
|
474
567
|
}
|
|
475
|
-
const output = await createVerifyOutput(input
|
|
568
|
+
const output = await createVerifyOutput(input, parsed.fromPlan ?? (parsed.changed ? 'changed' : null), projectRoot, lang);
|
|
476
569
|
if (parsed.json) {
|
|
477
570
|
reporter.stdout(JSON.stringify(output, null, 2));
|
|
478
571
|
}
|