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,7 +1,49 @@
|
|
|
1
|
-
import { COMMAND_LIFECYCLES, COMMAND_RUN_POLICIES, LONG_RUNNING_LIFECYCLES, isRecord, readPositiveInteger, readString, } from './config-loading.js';
|
|
1
|
+
import { COMMAND_LIFECYCLES, COMMAND_RUN_POLICIES, LONG_RUNNING_LIFECYCLES, isRecord, readPositiveInteger, readString, readStringArray, } from './config-loading.js';
|
|
2
2
|
import { evaluateCommandIntentEligibility } from './command-intent-eligibility.js';
|
|
3
3
|
import { commandIntentHasBlockedShellBackgroundPattern, commandIntentHasCommandSource, commandIntentNameIsSafe, } from './command-contract-rules.js';
|
|
4
|
-
|
|
4
|
+
import { commandEffectsConflict, normalizeCommandEffects } from './command-effects.js';
|
|
5
|
+
import { listChangeClassificationValidationReasons } from './change-classification.js';
|
|
6
|
+
const CONTRACT_LINT_SOURCE_FILES = [
|
|
7
|
+
'.mustflow/config/commands.toml',
|
|
8
|
+
'.mustflow/docs/agent-workflow.md',
|
|
9
|
+
'AGENTS.md',
|
|
10
|
+
'src/core/change-classification.ts',
|
|
11
|
+
];
|
|
12
|
+
export const DOCUMENTED_VERIFICATION_REASONS = [
|
|
13
|
+
'before_publish',
|
|
14
|
+
'before_final_report',
|
|
15
|
+
'before_task',
|
|
16
|
+
'behavior_change',
|
|
17
|
+
'behavior_removed',
|
|
18
|
+
'build_config_change',
|
|
19
|
+
'clean_mustflow_update_plan',
|
|
20
|
+
'commit_message_suggestion',
|
|
21
|
+
'coverage_request',
|
|
22
|
+
'cross_cutting_code_change',
|
|
23
|
+
'directory_change',
|
|
24
|
+
'formatting_change',
|
|
25
|
+
'image_asset_change',
|
|
26
|
+
'line_ending_warning',
|
|
27
|
+
'low_risk_code_change',
|
|
28
|
+
'snapshot_change',
|
|
29
|
+
'structure_change',
|
|
30
|
+
'style_change',
|
|
31
|
+
'template_update_apply',
|
|
32
|
+
'template_update_check',
|
|
33
|
+
'test_policy_change',
|
|
34
|
+
'user_approved_snapshot_update',
|
|
35
|
+
'user_requested_line_ending_normalization',
|
|
36
|
+
'web_asset_change',
|
|
37
|
+
];
|
|
38
|
+
const RELEASE_SENSITIVE_REASONS = new Set([
|
|
39
|
+
'package_metadata_change',
|
|
40
|
+
'packaging_change',
|
|
41
|
+
'release_risk',
|
|
42
|
+
'template_version_change',
|
|
43
|
+
]);
|
|
44
|
+
function uniqueSorted(values) {
|
|
45
|
+
return [...new Set(values)].sort((left, right) => left.localeCompare(right));
|
|
46
|
+
}
|
|
5
47
|
function readBoolean(intent, key) {
|
|
6
48
|
const value = intent[key];
|
|
7
49
|
return typeof value === 'boolean' ? value : null;
|
|
@@ -17,6 +59,17 @@ function writesAreValid(intent) {
|
|
|
17
59
|
function pushIssue(issues, severity, code, intent, message) {
|
|
18
60
|
issues.push({ severity, code, intent, message });
|
|
19
61
|
}
|
|
62
|
+
function pushCoverageFinding(issues, findings, severity, code, reason, intent, intents, message) {
|
|
63
|
+
findings.push({
|
|
64
|
+
severity,
|
|
65
|
+
code,
|
|
66
|
+
reason,
|
|
67
|
+
intent,
|
|
68
|
+
intents: [...intents].sort((left, right) => left.localeCompare(right)),
|
|
69
|
+
message,
|
|
70
|
+
});
|
|
71
|
+
pushIssue(issues, severity, code, intent, message);
|
|
72
|
+
}
|
|
20
73
|
function configuredIntentIsRunnable(intent) {
|
|
21
74
|
return evaluateCommandIntentEligibility('summary', intent).ok;
|
|
22
75
|
}
|
|
@@ -79,18 +132,126 @@ function lintIntent(name, value, issues) {
|
|
|
79
132
|
}
|
|
80
133
|
return value;
|
|
81
134
|
}
|
|
135
|
+
function collectRequiredAfterReasons(contract) {
|
|
136
|
+
const reasonToIntents = new Map();
|
|
137
|
+
for (const [name, intent] of Object.entries(contract.intents)) {
|
|
138
|
+
if (!isRecord(intent)) {
|
|
139
|
+
continue;
|
|
140
|
+
}
|
|
141
|
+
for (const reason of readStringArray(intent, 'required_after') ?? []) {
|
|
142
|
+
reasonToIntents.set(reason, [
|
|
143
|
+
...(reasonToIntents.get(reason) ?? []),
|
|
144
|
+
{
|
|
145
|
+
name,
|
|
146
|
+
intent,
|
|
147
|
+
runnable: evaluateCommandIntentEligibility(name, intent).ok,
|
|
148
|
+
},
|
|
149
|
+
]);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
return reasonToIntents;
|
|
153
|
+
}
|
|
154
|
+
function hasExplicitEffectMetadata(intent) {
|
|
155
|
+
return Array.isArray(intent.effects) && intent.effects.some((effect) => isRecord(effect));
|
|
156
|
+
}
|
|
157
|
+
function intentLooksReleaseFocused(name, intent) {
|
|
158
|
+
const text = `${name} ${readString(intent, 'description') ?? ''}`.toLowerCase();
|
|
159
|
+
return /(?:^|[_\W])(?:release|package|pack|packaging|publish)(?:$|[_\W])/u.test(text);
|
|
160
|
+
}
|
|
161
|
+
function addConflictingWriteCoverageWarnings(contract, projectRoot, reason, candidates, issues, findings) {
|
|
162
|
+
if (!projectRoot) {
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
const runnableCandidates = candidates.filter((candidate) => candidate.runnable);
|
|
166
|
+
for (let leftIndex = 0; leftIndex < runnableCandidates.length; leftIndex += 1) {
|
|
167
|
+
const left = runnableCandidates[leftIndex];
|
|
168
|
+
const leftHasExplicitEffects = hasExplicitEffectMetadata(left.intent);
|
|
169
|
+
let leftEffects;
|
|
170
|
+
try {
|
|
171
|
+
leftEffects = normalizeCommandEffects(projectRoot, contract, left.name);
|
|
172
|
+
}
|
|
173
|
+
catch {
|
|
174
|
+
continue;
|
|
175
|
+
}
|
|
176
|
+
for (let rightIndex = leftIndex + 1; rightIndex < runnableCandidates.length; rightIndex += 1) {
|
|
177
|
+
const right = runnableCandidates[rightIndex];
|
|
178
|
+
const rightHasExplicitEffects = hasExplicitEffectMetadata(right.intent);
|
|
179
|
+
if (leftHasExplicitEffects && rightHasExplicitEffects) {
|
|
180
|
+
continue;
|
|
181
|
+
}
|
|
182
|
+
let rightEffects;
|
|
183
|
+
try {
|
|
184
|
+
rightEffects = normalizeCommandEffects(projectRoot, contract, right.name);
|
|
185
|
+
}
|
|
186
|
+
catch {
|
|
187
|
+
continue;
|
|
188
|
+
}
|
|
189
|
+
const conflicts = leftEffects.some((leftEffect) => rightEffects.some((rightEffect) => commandEffectsConflict(leftEffect, rightEffect)));
|
|
190
|
+
if (!conflicts) {
|
|
191
|
+
continue;
|
|
192
|
+
}
|
|
193
|
+
pushCoverageFinding(issues, findings, 'warning', 'coverage_conflicting_writes_without_effects', reason, null, [left.name, right.name], `Reason "${reason}" selects runnable intents ${left.name} and ${right.name} that share write effects without explicit effects or resource locks.`);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
function lintCoverage(contract, options, issues) {
|
|
198
|
+
const findings = [];
|
|
199
|
+
const knownClassificationReasons = listChangeClassificationValidationReasons();
|
|
200
|
+
const documentedVerificationReasons = [...DOCUMENTED_VERIFICATION_REASONS];
|
|
201
|
+
const knownReasons = new Set([...knownClassificationReasons, ...documentedVerificationReasons]);
|
|
202
|
+
const reasonToIntents = collectRequiredAfterReasons(contract);
|
|
203
|
+
const requiredAfterReasons = uniqueSorted(reasonToIntents.keys());
|
|
204
|
+
const runnableReasons = uniqueSorted([...reasonToIntents.entries()]
|
|
205
|
+
.filter(([, candidates]) => candidates.some((candidate) => candidate.runnable))
|
|
206
|
+
.map(([reason]) => reason));
|
|
207
|
+
for (const reason of knownClassificationReasons) {
|
|
208
|
+
const candidates = reasonToIntents.get(reason) ?? [];
|
|
209
|
+
if (candidates.length === 0) {
|
|
210
|
+
pushCoverageFinding(issues, findings, 'warning', 'coverage_uncovered_classification_reason', reason, null, [], `Classification reason "${reason}" has no matching required_after entry in commands.toml.`);
|
|
211
|
+
continue;
|
|
212
|
+
}
|
|
213
|
+
if (!candidates.some((candidate) => candidate.runnable)) {
|
|
214
|
+
pushCoverageFinding(issues, findings, 'warning', 'coverage_reason_not_runnable', reason, null, candidates.map((candidate) => candidate.name), `Reason "${reason}" is covered only by non-runnable intents: ${candidates
|
|
215
|
+
.map((candidate) => candidate.name)
|
|
216
|
+
.sort((left, right) => left.localeCompare(right))
|
|
217
|
+
.join(', ')}.`);
|
|
218
|
+
}
|
|
219
|
+
addConflictingWriteCoverageWarnings(contract, options.projectRoot, reason, candidates, issues, findings);
|
|
220
|
+
}
|
|
221
|
+
for (const [reason, candidates] of reasonToIntents) {
|
|
222
|
+
if (knownReasons.has(reason)) {
|
|
223
|
+
continue;
|
|
224
|
+
}
|
|
225
|
+
pushCoverageFinding(issues, findings, 'warning', 'coverage_unknown_required_after', reason, null, candidates.map((candidate) => candidate.name), `required_after reason "${reason}" is not emitted by change classification or listed as a documented verification reason.`);
|
|
226
|
+
}
|
|
227
|
+
if (options.releaseVersioningEnabled === true) {
|
|
228
|
+
const hasReleaseVerificationPath = [...reasonToIntents.entries()].some(([reason, candidates]) => RELEASE_SENSITIVE_REASONS.has(reason) &&
|
|
229
|
+
candidates.some((candidate) => candidate.runnable && intentLooksReleaseFocused(candidate.name, candidate.intent)));
|
|
230
|
+
if (!hasReleaseVerificationPath) {
|
|
231
|
+
pushCoverageFinding(issues, findings, 'warning', 'coverage_release_path_missing', null, null, [], 'Release versioning is enabled, but release-sensitive reasons have no runnable release or package verification intent.');
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
return {
|
|
235
|
+
knownClassificationReasons,
|
|
236
|
+
documentedVerificationReasons,
|
|
237
|
+
requiredAfterReasons,
|
|
238
|
+
runnableReasons,
|
|
239
|
+
findings,
|
|
240
|
+
};
|
|
241
|
+
}
|
|
82
242
|
function getStatus(errors, warnings) {
|
|
83
243
|
if (errors > 0) {
|
|
84
244
|
return 'failed';
|
|
85
245
|
}
|
|
86
246
|
return warnings > 0 ? 'warning' : 'passed';
|
|
87
247
|
}
|
|
88
|
-
export function lintCommandContract(contract) {
|
|
248
|
+
export function lintCommandContract(contract, options = {}) {
|
|
89
249
|
const issues = [];
|
|
90
250
|
const intentEntries = Object.entries(contract.intents);
|
|
91
251
|
const intentTables = intentEntries
|
|
92
252
|
.map(([name, value]) => lintIntent(name, value, issues))
|
|
93
253
|
.filter((intent) => intent !== null);
|
|
254
|
+
const coverage = options.coverage === true ? lintCoverage(contract, options, issues) : undefined;
|
|
94
255
|
const errors = issues.filter((issue) => issue.severity === 'error').length;
|
|
95
256
|
const warnings = issues.length - errors;
|
|
96
257
|
return {
|
|
@@ -106,5 +267,6 @@ export function lintCommandContract(contract) {
|
|
|
106
267
|
},
|
|
107
268
|
issues,
|
|
108
269
|
sourceFiles: CONTRACT_LINT_SOURCE_FILES,
|
|
270
|
+
coverage,
|
|
109
271
|
};
|
|
110
272
|
}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
import { PUBLIC_SURFACE_UPDATE_POLICIES } from './change-classification.js';
|
|
3
|
+
import { isRecord } from './config-loading.js';
|
|
1
4
|
export const CONTRACT_MODEL_DEFINITIONS = [
|
|
2
5
|
{
|
|
3
6
|
id: 'changes',
|
|
@@ -51,3 +54,172 @@ export function getNonInstalledContractConfigPaths() {
|
|
|
51
54
|
.filter((model) => !model.installByDefault)
|
|
52
55
|
.map((model) => model.filePath);
|
|
53
56
|
}
|
|
57
|
+
const PATH_CLASSIFICATION_MODEL_IDS = new Set(['changes', 'surfaces']);
|
|
58
|
+
const ALLOWED_TOP_LEVEL_FIELDS = new Set(['schema_version', 'rules']);
|
|
59
|
+
const ALLOWED_RULE_FIELDS = new Set([
|
|
60
|
+
'id',
|
|
61
|
+
'description',
|
|
62
|
+
'match',
|
|
63
|
+
'change_kinds',
|
|
64
|
+
'surface_kind',
|
|
65
|
+
'category',
|
|
66
|
+
'is_public_surface',
|
|
67
|
+
'validation_reasons',
|
|
68
|
+
'affected_contracts',
|
|
69
|
+
'update_policy',
|
|
70
|
+
'drift_checks',
|
|
71
|
+
]);
|
|
72
|
+
const ALLOWED_MATCH_FIELDS = new Set(['kind', 'path']);
|
|
73
|
+
const ALLOWED_MATCH_KINDS = new Set(['exact', 'prefix', 'glob']);
|
|
74
|
+
const ALLOWED_UPDATE_POLICIES = new Set(PUBLIC_SURFACE_UPDATE_POLICIES);
|
|
75
|
+
const FORBIDDEN_PATH_CLASSIFICATION_AUTHORITY_FIELDS = new Set([
|
|
76
|
+
'argv',
|
|
77
|
+
'cmd',
|
|
78
|
+
'run_policy',
|
|
79
|
+
'lifecycle',
|
|
80
|
+
'stdin',
|
|
81
|
+
'timeout_seconds',
|
|
82
|
+
'writes',
|
|
83
|
+
'network',
|
|
84
|
+
'destructive',
|
|
85
|
+
'required_after',
|
|
86
|
+
'skip_validation',
|
|
87
|
+
'status',
|
|
88
|
+
'intents',
|
|
89
|
+
'command_intents',
|
|
90
|
+
'commands',
|
|
91
|
+
'command',
|
|
92
|
+
'run',
|
|
93
|
+
'execute',
|
|
94
|
+
'action',
|
|
95
|
+
'actions',
|
|
96
|
+
'agent_action',
|
|
97
|
+
'agent_actions',
|
|
98
|
+
]);
|
|
99
|
+
function pushIssue(issues, code, pathLabel, message) {
|
|
100
|
+
issues.push({ code, path: pathLabel, message });
|
|
101
|
+
}
|
|
102
|
+
function isSafeRelativePath(value) {
|
|
103
|
+
if (typeof value !== 'string' || value.trim().length === 0) {
|
|
104
|
+
return false;
|
|
105
|
+
}
|
|
106
|
+
const normalized = value.replaceAll('\\', '/');
|
|
107
|
+
const segments = normalized.split('/').filter(Boolean);
|
|
108
|
+
if (path.posix.isAbsolute(normalized) || path.win32.isAbsolute(value)) {
|
|
109
|
+
return false;
|
|
110
|
+
}
|
|
111
|
+
return segments.length > 0 && segments.every((segment) => segment !== '.' && segment !== '..');
|
|
112
|
+
}
|
|
113
|
+
function validateStringArrayField(table, key, pathLabel, issues) {
|
|
114
|
+
if (!Object.hasOwn(table, key)) {
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
const value = table[key];
|
|
118
|
+
if (!Array.isArray(value) || value.some((entry) => typeof entry !== 'string' || entry.trim().length === 0)) {
|
|
119
|
+
pushIssue(issues, 'invalid_string_array', `${pathLabel}.${key}`, `${pathLabel}.${key} must be a string array`);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
function validateForbiddenAuthorityFields(value, pathLabel, issues) {
|
|
123
|
+
if (Array.isArray(value)) {
|
|
124
|
+
value.forEach((entry, index) => validateForbiddenAuthorityFields(entry, `${pathLabel}[${index}]`, issues));
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
if (!isRecord(value)) {
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
for (const [key, nestedValue] of Object.entries(value)) {
|
|
131
|
+
const fieldPath = pathLabel ? `${pathLabel}.${key}` : key;
|
|
132
|
+
if (FORBIDDEN_PATH_CLASSIFICATION_AUTHORITY_FIELDS.has(key)) {
|
|
133
|
+
pushIssue(issues, 'command_authority_field', fieldPath, `${fieldPath} cannot define command authority; use .mustflow/config/commands.toml`);
|
|
134
|
+
}
|
|
135
|
+
validateForbiddenAuthorityFields(nestedValue, fieldPath, issues);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
function validateMatchTable(match, pathLabel, issues) {
|
|
139
|
+
if (!isRecord(match)) {
|
|
140
|
+
pushIssue(issues, 'invalid_match', pathLabel, `${pathLabel} must be a TOML table`);
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
for (const key of Object.keys(match)) {
|
|
144
|
+
if (!ALLOWED_MATCH_FIELDS.has(key)) {
|
|
145
|
+
pushIssue(issues, 'unknown_rule_field', `${pathLabel}.${key}`, `${pathLabel}.${key} is not allowed`);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
if (!ALLOWED_MATCH_KINDS.has(String(match.kind))) {
|
|
149
|
+
pushIssue(issues, 'invalid_match_kind', `${pathLabel}.kind`, `${pathLabel}.kind must be "exact", "prefix", or "glob"; regular expressions are deferred`);
|
|
150
|
+
}
|
|
151
|
+
if (!isSafeRelativePath(match.path)) {
|
|
152
|
+
pushIssue(issues, 'invalid_match_path', `${pathLabel}.path`, `${pathLabel}.path must be a non-empty relative path inside the current root`);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
function validatePathClassificationRule(rule, index, issues) {
|
|
156
|
+
const pathLabel = `rules[${index}]`;
|
|
157
|
+
if (!isRecord(rule)) {
|
|
158
|
+
pushIssue(issues, 'rule_not_table', pathLabel, `${pathLabel} must be a TOML table`);
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
for (const key of Object.keys(rule)) {
|
|
162
|
+
if (!ALLOWED_RULE_FIELDS.has(key)) {
|
|
163
|
+
pushIssue(issues, 'unknown_rule_field', `${pathLabel}.${key}`, `${pathLabel}.${key} is not allowed`);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
if (typeof rule.id !== 'string' || rule.id.trim().length === 0) {
|
|
167
|
+
pushIssue(issues, 'invalid_rule_id', `${pathLabel}.id`, `${pathLabel}.id must be a non-empty string`);
|
|
168
|
+
}
|
|
169
|
+
validateMatchTable(rule.match, `${pathLabel}.match`, issues);
|
|
170
|
+
validateStringArrayField(rule, 'change_kinds', pathLabel, issues);
|
|
171
|
+
validateStringArrayField(rule, 'validation_reasons', pathLabel, issues);
|
|
172
|
+
validateStringArrayField(rule, 'affected_contracts', pathLabel, issues);
|
|
173
|
+
validateStringArrayField(rule, 'drift_checks', pathLabel, issues);
|
|
174
|
+
if (Object.hasOwn(rule, 'is_public_surface') && typeof rule.is_public_surface !== 'boolean') {
|
|
175
|
+
pushIssue(issues, 'invalid_boolean', `${pathLabel}.is_public_surface`, `${pathLabel}.is_public_surface must be a boolean`);
|
|
176
|
+
}
|
|
177
|
+
if (Object.hasOwn(rule, 'update_policy') && !ALLOWED_UPDATE_POLICIES.has(String(rule.update_policy))) {
|
|
178
|
+
pushIssue(issues, 'invalid_update_policy', `${pathLabel}.update_policy`, `${pathLabel}.update_policy must be "update", "update_or_mark_stale", or "not_applicable"`);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
function validatePathClassificationModelConfig(value) {
|
|
182
|
+
const issues = [];
|
|
183
|
+
if (!isRecord(value)) {
|
|
184
|
+
pushIssue(issues, 'root_not_table', '', 'must contain a TOML table');
|
|
185
|
+
return issues;
|
|
186
|
+
}
|
|
187
|
+
validateForbiddenAuthorityFields(value, '', issues);
|
|
188
|
+
for (const key of Object.keys(value)) {
|
|
189
|
+
if (!ALLOWED_TOP_LEVEL_FIELDS.has(key)) {
|
|
190
|
+
pushIssue(issues, 'unknown_top_level_field', key, `${key} is not allowed at the top level`);
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
if (Object.hasOwn(value, 'schema_version') && typeof value.schema_version !== 'string') {
|
|
194
|
+
pushIssue(issues, 'invalid_schema_version', 'schema_version', 'schema_version must be a string');
|
|
195
|
+
}
|
|
196
|
+
if (!Object.hasOwn(value, 'rules')) {
|
|
197
|
+
pushIssue(issues, 'missing_rules', 'rules', 'must define [[rules]]');
|
|
198
|
+
return issues;
|
|
199
|
+
}
|
|
200
|
+
const rules = value.rules;
|
|
201
|
+
if (!Array.isArray(rules) || rules.length === 0) {
|
|
202
|
+
pushIssue(issues, 'rules_not_array', 'rules', 'rules must be a non-empty array of TOML tables');
|
|
203
|
+
return issues;
|
|
204
|
+
}
|
|
205
|
+
rules.forEach((rule, index) => validatePathClassificationRule(rule, index, issues));
|
|
206
|
+
return issues;
|
|
207
|
+
}
|
|
208
|
+
export function validateCandidateContractModelConfig(model, value) {
|
|
209
|
+
if (model.status === 'deferred') {
|
|
210
|
+
return [
|
|
211
|
+
{
|
|
212
|
+
code: 'deferred_model_present',
|
|
213
|
+
path: model.filePath,
|
|
214
|
+
message: `${model.filePath} is deferred; use narrow candidate contract files instead`,
|
|
215
|
+
},
|
|
216
|
+
];
|
|
217
|
+
}
|
|
218
|
+
if (!PATH_CLASSIFICATION_MODEL_IDS.has(model.id)) {
|
|
219
|
+
return [];
|
|
220
|
+
}
|
|
221
|
+
return validatePathClassificationModelConfig(value).map((issue) => ({
|
|
222
|
+
...issue,
|
|
223
|
+
message: issue.path ? `${model.filePath} ${issue.message}` : `${model.filePath} ${issue.message}`,
|
|
224
|
+
}));
|
|
225
|
+
}
|
|
@@ -72,6 +72,7 @@ function createEmptyDashboardVerificationSnapshot(changedFiles) {
|
|
|
72
72
|
entries: [],
|
|
73
73
|
notes: [],
|
|
74
74
|
},
|
|
75
|
+
decision_graph: null,
|
|
75
76
|
};
|
|
76
77
|
}
|
|
77
78
|
export function createDashboardVerificationSnapshot(projectRoot, rawCommandContract, commandIntents, changedFiles, manifestChangedFiles, manifestMissingFiles) {
|
|
@@ -128,5 +129,6 @@ export function createDashboardVerificationSnapshot(projectRoot, rawCommandContr
|
|
|
128
129
|
})),
|
|
129
130
|
notes: verificationReport.schedule.notes,
|
|
130
131
|
},
|
|
132
|
+
decision_graph: verificationReport.decision_graph,
|
|
131
133
|
};
|
|
132
134
|
}
|
|
@@ -8,6 +8,7 @@ const P0_EXACT_PATHS = new Set([
|
|
|
8
8
|
const AUTHORITY_OR_SECURITY_SKILLS = new Set([
|
|
9
9
|
'contract-sync-check',
|
|
10
10
|
'external-prompt-injection-defense',
|
|
11
|
+
'external-skill-intake',
|
|
11
12
|
'instruction-conflict-scope-check',
|
|
12
13
|
'migration-safety-check',
|
|
13
14
|
'multi-agent-work-coordination',
|