mustflow 1.15.97
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/LICENSE +16 -0
- package/README.md +422 -0
- package/dist/cli/commands/check.js +73 -0
- package/dist/cli/commands/classify.js +104 -0
- package/dist/cli/commands/context.js +95 -0
- package/dist/cli/commands/contract-lint.js +74 -0
- package/dist/cli/commands/dashboard.js +654 -0
- package/dist/cli/commands/docs.js +382 -0
- package/dist/cli/commands/doctor.js +232 -0
- package/dist/cli/commands/explain.js +293 -0
- package/dist/cli/commands/help.js +148 -0
- package/dist/cli/commands/impact.js +120 -0
- package/dist/cli/commands/index.js +70 -0
- package/dist/cli/commands/init.js +986 -0
- package/dist/cli/commands/line-endings.js +102 -0
- package/dist/cli/commands/map.js +95 -0
- package/dist/cli/commands/run.js +442 -0
- package/dist/cli/commands/search.js +166 -0
- package/dist/cli/commands/status.js +65 -0
- package/dist/cli/commands/update.js +443 -0
- package/dist/cli/commands/verify.js +448 -0
- package/dist/cli/commands/version-sources.js +79 -0
- package/dist/cli/commands/version.js +57 -0
- package/dist/cli/i18n/en.js +702 -0
- package/dist/cli/i18n/es.js +702 -0
- package/dist/cli/i18n/fr.js +702 -0
- package/dist/cli/i18n/hi.js +702 -0
- package/dist/cli/i18n/ko.js +702 -0
- package/dist/cli/i18n/zh.js +702 -0
- package/dist/cli/index.js +218 -0
- package/dist/cli/lib/agent-context.js +342 -0
- package/dist/cli/lib/browser-open.js +58 -0
- package/dist/cli/lib/cli-output.js +36 -0
- package/dist/cli/lib/command-contract.js +1 -0
- package/dist/cli/lib/command-registry.js +107 -0
- package/dist/cli/lib/dashboard-html.js +1866 -0
- package/dist/cli/lib/dashboard-locale.js +309 -0
- package/dist/cli/lib/dashboard-preferences.js +405 -0
- package/dist/cli/lib/doc-review-ledger.js +226 -0
- package/dist/cli/lib/filesystem.js +125 -0
- package/dist/cli/lib/git-changes.js +13 -0
- package/dist/cli/lib/i18n.js +55 -0
- package/dist/cli/lib/local-index.js +1014 -0
- package/dist/cli/lib/locale-tags.js +4 -0
- package/dist/cli/lib/manifest-lock.js +131 -0
- package/dist/cli/lib/npm-version-check.js +97 -0
- package/dist/cli/lib/package-info.js +13 -0
- package/dist/cli/lib/preferences-options.js +8 -0
- package/dist/cli/lib/project-root.js +23 -0
- package/dist/cli/lib/repo-map.js +635 -0
- package/dist/cli/lib/reporter.js +8 -0
- package/dist/cli/lib/run-receipt.js +1 -0
- package/dist/cli/lib/template-i18n.js +265 -0
- package/dist/cli/lib/templates.js +188 -0
- package/dist/cli/lib/toml.js +1 -0
- package/dist/cli/lib/validation.js +1639 -0
- package/dist/cli/lib/version-sources.js +1 -0
- package/dist/core/authority-resolution.js +155 -0
- package/dist/core/change-classification.js +122 -0
- package/dist/core/change-verification.js +80 -0
- package/dist/core/check-issues.js +67 -0
- package/dist/core/command-classification.js +22 -0
- package/dist/core/command-contract-rules.js +27 -0
- package/dist/core/command-contract-validation.js +197 -0
- package/dist/core/command-cwd.js +12 -0
- package/dist/core/command-effects.js +182 -0
- package/dist/core/command-explanation.js +135 -0
- package/dist/core/command-intent-eligibility.js +76 -0
- package/dist/core/config-loading.js +54 -0
- package/dist/core/contract-lint.js +110 -0
- package/dist/core/contract-models.js +53 -0
- package/dist/core/dashboard-verification.js +132 -0
- package/dist/core/doc-review-triage.js +92 -0
- package/dist/core/line-endings.js +144 -0
- package/dist/core/public-json-contracts.js +112 -0
- package/dist/core/public-surface-explanation.js +49 -0
- package/dist/core/release-version-validation.js +53 -0
- package/dist/core/retention-explanation.js +74 -0
- package/dist/core/retention-policy.js +57 -0
- package/dist/core/run-receipt.js +77 -0
- package/dist/core/skill-route-alignment.js +100 -0
- package/dist/core/skill-route-explanation.js +117 -0
- package/dist/core/source-anchor-explanation.js +33 -0
- package/dist/core/source-anchor-status.js +269 -0
- package/dist/core/source-anchor-symbols.js +181 -0
- package/dist/core/source-anchor-validation.js +158 -0
- package/dist/core/source-anchors.js +194 -0
- package/dist/core/surface-decision-model.js +18 -0
- package/dist/core/toml.js +11 -0
- package/dist/core/verification-plan.js +41 -0
- package/dist/core/verification-scheduler.js +92 -0
- package/dist/core/version-impact.js +54 -0
- package/dist/core/version-sources.js +235 -0
- package/dist/core/version-sync-policy.js +85 -0
- package/examples/README.md +13 -0
- package/examples/docs-only/README.md +72 -0
- package/examples/host-instruction-conflicts/README.md +47 -0
- package/examples/minimal-js/README.md +98 -0
- package/examples/missing-command-contracts/README.md +70 -0
- package/examples/nested-repos/README.md +62 -0
- package/package.json +80 -0
- package/schemas/README.md +32 -0
- package/schemas/change-verification-report.schema.json +319 -0
- package/schemas/classify-report.schema.json +113 -0
- package/schemas/commands.schema.json +116 -0
- package/schemas/context-report.schema.json +341 -0
- package/schemas/contract-lint-report.schema.json +61 -0
- package/schemas/docs-review-list.schema.json +72 -0
- package/schemas/doctor-report.schema.json +175 -0
- package/schemas/explain-report.schema.json +471 -0
- package/schemas/impact-report.schema.json +121 -0
- package/schemas/line-endings-report.schema.json +63 -0
- package/schemas/run-receipt.schema.json +75 -0
- package/schemas/verify-report.schema.json +67 -0
- package/schemas/version-sources-report.schema.json +42 -0
- package/templates/default/common/.mustflow/config/commands.toml +251 -0
- package/templates/default/common/.mustflow/config/mustflow.toml +424 -0
- package/templates/default/common/.mustflow/config/preferences.toml +125 -0
- package/templates/default/common/gitignore.mustflow +9 -0
- package/templates/default/i18n.toml +483 -0
- package/templates/default/locales/en/.mustflow/context/INDEX.md +39 -0
- package/templates/default/locales/en/.mustflow/context/PROJECT.md +66 -0
- package/templates/default/locales/en/.mustflow/docs/agent-workflow.md +345 -0
- package/templates/default/locales/en/.mustflow/skills/INDEX.md +78 -0
- package/templates/default/locales/en/.mustflow/skills/adapter-boundary/SKILL.md +193 -0
- package/templates/default/locales/en/.mustflow/skills/artifact-integrity-check/SKILL.md +121 -0
- package/templates/default/locales/en/.mustflow/skills/behavior-preserving-refactor/SKILL.md +182 -0
- package/templates/default/locales/en/.mustflow/skills/code-review/SKILL.md +115 -0
- package/templates/default/locales/en/.mustflow/skills/codebase-orientation/SKILL.md +115 -0
- package/templates/default/locales/en/.mustflow/skills/command-pattern/SKILL.md +247 -0
- package/templates/default/locales/en/.mustflow/skills/composition-over-inheritance/SKILL.md +176 -0
- package/templates/default/locales/en/.mustflow/skills/contract-sync-check/SKILL.md +116 -0
- package/templates/default/locales/en/.mustflow/skills/date-number-audit/SKILL.md +116 -0
- package/templates/default/locales/en/.mustflow/skills/dependency-injection/SKILL.md +161 -0
- package/templates/default/locales/en/.mustflow/skills/dependency-reality-check/SKILL.md +115 -0
- package/templates/default/locales/en/.mustflow/skills/diff-risk-review/SKILL.md +143 -0
- package/templates/default/locales/en/.mustflow/skills/docs-prose-review/SKILL.md +119 -0
- package/templates/default/locales/en/.mustflow/skills/docs-update/SKILL.md +100 -0
- package/templates/default/locales/en/.mustflow/skills/external-prompt-injection-defense/SKILL.md +124 -0
- package/templates/default/locales/en/.mustflow/skills/facade-pattern/SKILL.md +210 -0
- package/templates/default/locales/en/.mustflow/skills/failure-triage/SKILL.md +97 -0
- package/templates/default/locales/en/.mustflow/skills/instruction-conflict-scope-check/SKILL.md +118 -0
- package/templates/default/locales/en/.mustflow/skills/line-ending-hygiene/SKILL.md +111 -0
- package/templates/default/locales/en/.mustflow/skills/migration-safety-check/SKILL.md +117 -0
- package/templates/default/locales/en/.mustflow/skills/multi-agent-work-coordination/SKILL.md +260 -0
- package/templates/default/locales/en/.mustflow/skills/null-object-pattern/SKILL.md +196 -0
- package/templates/default/locales/en/.mustflow/skills/pattern-scout/SKILL.md +110 -0
- package/templates/default/locales/en/.mustflow/skills/performance-budget-check/SKILL.md +121 -0
- package/templates/default/locales/en/.mustflow/skills/project-context-authoring/SKILL.md +107 -0
- package/templates/default/locales/en/.mustflow/skills/pure-core-imperative-shell/SKILL.md +212 -0
- package/templates/default/locales/en/.mustflow/skills/readme-authoring/SKILL.md +115 -0
- package/templates/default/locales/en/.mustflow/skills/repo-improvement-loop/SKILL.md +150 -0
- package/templates/default/locales/en/.mustflow/skills/repro-first-debug/SKILL.md +112 -0
- package/templates/default/locales/en/.mustflow/skills/requirement-regression-guard/SKILL.md +152 -0
- package/templates/default/locales/en/.mustflow/skills/result-option/SKILL.md +186 -0
- package/templates/default/locales/en/.mustflow/skills/security-privacy-review/SKILL.md +130 -0
- package/templates/default/locales/en/.mustflow/skills/security-regression-tests/SKILL.md +157 -0
- package/templates/default/locales/en/.mustflow/skills/skill-authoring/SKILL.md +110 -0
- package/templates/default/locales/en/.mustflow/skills/source-freshness-check/SKILL.md +111 -0
- package/templates/default/locales/en/.mustflow/skills/state-machine-pattern/SKILL.md +214 -0
- package/templates/default/locales/en/.mustflow/skills/strategy-pattern/SKILL.md +215 -0
- package/templates/default/locales/en/.mustflow/skills/structure-discovery-gate/SKILL.md +159 -0
- package/templates/default/locales/en/.mustflow/skills/test-maintenance/SKILL.md +122 -0
- package/templates/default/locales/en/.mustflow/skills/ui-quality-gate/SKILL.md +119 -0
- package/templates/default/locales/en/.mustflow/skills/visual-review-artifact/SKILL.md +127 -0
- package/templates/default/locales/en/.mustflow/skills/visual-review-artifact/assets/review-template.html +286 -0
- package/templates/default/locales/en/.mustflow/skills/visual-review-artifact/resources.toml +7 -0
- package/templates/default/locales/en/.mustflow/skills/web-asset-optimization/SKILL.md +108 -0
- package/templates/default/locales/en/AGENTS.md +114 -0
- package/templates/default/locales/es/.mustflow/context/INDEX.md +39 -0
- package/templates/default/locales/es/.mustflow/context/PROJECT.md +63 -0
- package/templates/default/locales/es/.mustflow/docs/agent-workflow.md +365 -0
- package/templates/default/locales/es/.mustflow/skills/INDEX.md +78 -0
- package/templates/default/locales/es/.mustflow/skills/adapter-boundary/SKILL.md +193 -0
- package/templates/default/locales/es/.mustflow/skills/artifact-integrity-check/SKILL.md +114 -0
- package/templates/default/locales/es/.mustflow/skills/behavior-preserving-refactor/SKILL.md +182 -0
- package/templates/default/locales/es/.mustflow/skills/code-review/SKILL.md +115 -0
- package/templates/default/locales/es/.mustflow/skills/codebase-orientation/SKILL.md +115 -0
- package/templates/default/locales/es/.mustflow/skills/command-pattern/SKILL.md +247 -0
- package/templates/default/locales/es/.mustflow/skills/composition-over-inheritance/SKILL.md +176 -0
- package/templates/default/locales/es/.mustflow/skills/contract-sync-check/SKILL.md +116 -0
- package/templates/default/locales/es/.mustflow/skills/date-number-audit/SKILL.md +116 -0
- package/templates/default/locales/es/.mustflow/skills/dependency-injection/SKILL.md +161 -0
- package/templates/default/locales/es/.mustflow/skills/dependency-reality-check/SKILL.md +115 -0
- package/templates/default/locales/es/.mustflow/skills/diff-risk-review/SKILL.md +136 -0
- package/templates/default/locales/es/.mustflow/skills/docs-prose-review/SKILL.md +119 -0
- package/templates/default/locales/es/.mustflow/skills/docs-update/SKILL.md +97 -0
- package/templates/default/locales/es/.mustflow/skills/external-prompt-injection-defense/SKILL.md +116 -0
- package/templates/default/locales/es/.mustflow/skills/facade-pattern/SKILL.md +210 -0
- package/templates/default/locales/es/.mustflow/skills/failure-triage/SKILL.md +97 -0
- package/templates/default/locales/es/.mustflow/skills/instruction-conflict-scope-check/SKILL.md +118 -0
- package/templates/default/locales/es/.mustflow/skills/line-ending-hygiene/SKILL.md +111 -0
- package/templates/default/locales/es/.mustflow/skills/migration-safety-check/SKILL.md +117 -0
- package/templates/default/locales/es/.mustflow/skills/multi-agent-work-coordination/SKILL.md +260 -0
- package/templates/default/locales/es/.mustflow/skills/null-object-pattern/SKILL.md +196 -0
- package/templates/default/locales/es/.mustflow/skills/pattern-scout/SKILL.md +110 -0
- package/templates/default/locales/es/.mustflow/skills/performance-budget-check/SKILL.md +121 -0
- package/templates/default/locales/es/.mustflow/skills/project-context-authoring/SKILL.md +107 -0
- package/templates/default/locales/es/.mustflow/skills/pure-core-imperative-shell/SKILL.md +212 -0
- package/templates/default/locales/es/.mustflow/skills/readme-authoring/SKILL.md +115 -0
- package/templates/default/locales/es/.mustflow/skills/repo-improvement-loop/SKILL.md +150 -0
- package/templates/default/locales/es/.mustflow/skills/repro-first-debug/SKILL.md +112 -0
- package/templates/default/locales/es/.mustflow/skills/requirement-regression-guard/SKILL.md +152 -0
- package/templates/default/locales/es/.mustflow/skills/result-option/SKILL.md +186 -0
- package/templates/default/locales/es/.mustflow/skills/security-privacy-review/SKILL.md +116 -0
- package/templates/default/locales/es/.mustflow/skills/security-regression-tests/SKILL.md +131 -0
- package/templates/default/locales/es/.mustflow/skills/skill-authoring/SKILL.md +110 -0
- package/templates/default/locales/es/.mustflow/skills/source-freshness-check/SKILL.md +111 -0
- package/templates/default/locales/es/.mustflow/skills/state-machine-pattern/SKILL.md +214 -0
- package/templates/default/locales/es/.mustflow/skills/strategy-pattern/SKILL.md +215 -0
- package/templates/default/locales/es/.mustflow/skills/structure-discovery-gate/SKILL.md +159 -0
- package/templates/default/locales/es/.mustflow/skills/test-maintenance/SKILL.md +122 -0
- package/templates/default/locales/es/.mustflow/skills/ui-quality-gate/SKILL.md +117 -0
- package/templates/default/locales/es/.mustflow/skills/visual-review-artifact/SKILL.md +127 -0
- package/templates/default/locales/es/.mustflow/skills/visual-review-artifact/assets/review-template.html +286 -0
- package/templates/default/locales/es/.mustflow/skills/visual-review-artifact/resources.toml +7 -0
- package/templates/default/locales/es/.mustflow/skills/web-asset-optimization/SKILL.md +108 -0
- package/templates/default/locales/es/AGENTS.md +83 -0
- package/templates/default/locales/fr/.mustflow/context/INDEX.md +39 -0
- package/templates/default/locales/fr/.mustflow/context/PROJECT.md +63 -0
- package/templates/default/locales/fr/.mustflow/docs/agent-workflow.md +368 -0
- package/templates/default/locales/fr/.mustflow/skills/INDEX.md +78 -0
- package/templates/default/locales/fr/.mustflow/skills/adapter-boundary/SKILL.md +193 -0
- package/templates/default/locales/fr/.mustflow/skills/artifact-integrity-check/SKILL.md +114 -0
- package/templates/default/locales/fr/.mustflow/skills/behavior-preserving-refactor/SKILL.md +182 -0
- package/templates/default/locales/fr/.mustflow/skills/code-review/SKILL.md +115 -0
- package/templates/default/locales/fr/.mustflow/skills/codebase-orientation/SKILL.md +115 -0
- package/templates/default/locales/fr/.mustflow/skills/command-pattern/SKILL.md +247 -0
- package/templates/default/locales/fr/.mustflow/skills/composition-over-inheritance/SKILL.md +176 -0
- package/templates/default/locales/fr/.mustflow/skills/contract-sync-check/SKILL.md +116 -0
- package/templates/default/locales/fr/.mustflow/skills/date-number-audit/SKILL.md +116 -0
- package/templates/default/locales/fr/.mustflow/skills/dependency-injection/SKILL.md +161 -0
- package/templates/default/locales/fr/.mustflow/skills/dependency-reality-check/SKILL.md +115 -0
- package/templates/default/locales/fr/.mustflow/skills/diff-risk-review/SKILL.md +136 -0
- package/templates/default/locales/fr/.mustflow/skills/docs-prose-review/SKILL.md +119 -0
- package/templates/default/locales/fr/.mustflow/skills/docs-update/SKILL.md +97 -0
- package/templates/default/locales/fr/.mustflow/skills/external-prompt-injection-defense/SKILL.md +116 -0
- package/templates/default/locales/fr/.mustflow/skills/facade-pattern/SKILL.md +210 -0
- package/templates/default/locales/fr/.mustflow/skills/failure-triage/SKILL.md +97 -0
- package/templates/default/locales/fr/.mustflow/skills/instruction-conflict-scope-check/SKILL.md +118 -0
- package/templates/default/locales/fr/.mustflow/skills/line-ending-hygiene/SKILL.md +111 -0
- package/templates/default/locales/fr/.mustflow/skills/migration-safety-check/SKILL.md +117 -0
- package/templates/default/locales/fr/.mustflow/skills/multi-agent-work-coordination/SKILL.md +260 -0
- package/templates/default/locales/fr/.mustflow/skills/null-object-pattern/SKILL.md +196 -0
- package/templates/default/locales/fr/.mustflow/skills/pattern-scout/SKILL.md +110 -0
- package/templates/default/locales/fr/.mustflow/skills/performance-budget-check/SKILL.md +121 -0
- package/templates/default/locales/fr/.mustflow/skills/project-context-authoring/SKILL.md +107 -0
- package/templates/default/locales/fr/.mustflow/skills/pure-core-imperative-shell/SKILL.md +212 -0
- package/templates/default/locales/fr/.mustflow/skills/readme-authoring/SKILL.md +115 -0
- package/templates/default/locales/fr/.mustflow/skills/repo-improvement-loop/SKILL.md +150 -0
- package/templates/default/locales/fr/.mustflow/skills/repro-first-debug/SKILL.md +112 -0
- package/templates/default/locales/fr/.mustflow/skills/requirement-regression-guard/SKILL.md +152 -0
- package/templates/default/locales/fr/.mustflow/skills/result-option/SKILL.md +186 -0
- package/templates/default/locales/fr/.mustflow/skills/security-privacy-review/SKILL.md +116 -0
- package/templates/default/locales/fr/.mustflow/skills/security-regression-tests/SKILL.md +131 -0
- package/templates/default/locales/fr/.mustflow/skills/skill-authoring/SKILL.md +110 -0
- package/templates/default/locales/fr/.mustflow/skills/source-freshness-check/SKILL.md +111 -0
- package/templates/default/locales/fr/.mustflow/skills/state-machine-pattern/SKILL.md +214 -0
- package/templates/default/locales/fr/.mustflow/skills/strategy-pattern/SKILL.md +215 -0
- package/templates/default/locales/fr/.mustflow/skills/structure-discovery-gate/SKILL.md +159 -0
- package/templates/default/locales/fr/.mustflow/skills/test-maintenance/SKILL.md +122 -0
- package/templates/default/locales/fr/.mustflow/skills/ui-quality-gate/SKILL.md +117 -0
- package/templates/default/locales/fr/.mustflow/skills/visual-review-artifact/SKILL.md +127 -0
- package/templates/default/locales/fr/.mustflow/skills/visual-review-artifact/assets/review-template.html +286 -0
- package/templates/default/locales/fr/.mustflow/skills/visual-review-artifact/resources.toml +7 -0
- package/templates/default/locales/fr/.mustflow/skills/web-asset-optimization/SKILL.md +108 -0
- package/templates/default/locales/fr/AGENTS.md +84 -0
- package/templates/default/locales/hi/.mustflow/context/INDEX.md +39 -0
- package/templates/default/locales/hi/.mustflow/context/PROJECT.md +65 -0
- package/templates/default/locales/hi/.mustflow/docs/agent-workflow.md +359 -0
- package/templates/default/locales/hi/.mustflow/skills/INDEX.md +78 -0
- package/templates/default/locales/hi/.mustflow/skills/adapter-boundary/SKILL.md +193 -0
- package/templates/default/locales/hi/.mustflow/skills/artifact-integrity-check/SKILL.md +114 -0
- package/templates/default/locales/hi/.mustflow/skills/behavior-preserving-refactor/SKILL.md +182 -0
- package/templates/default/locales/hi/.mustflow/skills/code-review/SKILL.md +115 -0
- package/templates/default/locales/hi/.mustflow/skills/codebase-orientation/SKILL.md +115 -0
- package/templates/default/locales/hi/.mustflow/skills/command-pattern/SKILL.md +247 -0
- package/templates/default/locales/hi/.mustflow/skills/composition-over-inheritance/SKILL.md +176 -0
- package/templates/default/locales/hi/.mustflow/skills/contract-sync-check/SKILL.md +116 -0
- package/templates/default/locales/hi/.mustflow/skills/date-number-audit/SKILL.md +116 -0
- package/templates/default/locales/hi/.mustflow/skills/dependency-injection/SKILL.md +161 -0
- package/templates/default/locales/hi/.mustflow/skills/dependency-reality-check/SKILL.md +115 -0
- package/templates/default/locales/hi/.mustflow/skills/diff-risk-review/SKILL.md +136 -0
- package/templates/default/locales/hi/.mustflow/skills/docs-prose-review/SKILL.md +119 -0
- package/templates/default/locales/hi/.mustflow/skills/docs-update/SKILL.md +97 -0
- package/templates/default/locales/hi/.mustflow/skills/external-prompt-injection-defense/SKILL.md +116 -0
- package/templates/default/locales/hi/.mustflow/skills/facade-pattern/SKILL.md +210 -0
- package/templates/default/locales/hi/.mustflow/skills/failure-triage/SKILL.md +97 -0
- package/templates/default/locales/hi/.mustflow/skills/instruction-conflict-scope-check/SKILL.md +118 -0
- package/templates/default/locales/hi/.mustflow/skills/line-ending-hygiene/SKILL.md +111 -0
- package/templates/default/locales/hi/.mustflow/skills/migration-safety-check/SKILL.md +117 -0
- package/templates/default/locales/hi/.mustflow/skills/multi-agent-work-coordination/SKILL.md +260 -0
- package/templates/default/locales/hi/.mustflow/skills/null-object-pattern/SKILL.md +196 -0
- package/templates/default/locales/hi/.mustflow/skills/pattern-scout/SKILL.md +110 -0
- package/templates/default/locales/hi/.mustflow/skills/performance-budget-check/SKILL.md +121 -0
- package/templates/default/locales/hi/.mustflow/skills/project-context-authoring/SKILL.md +107 -0
- package/templates/default/locales/hi/.mustflow/skills/pure-core-imperative-shell/SKILL.md +212 -0
- package/templates/default/locales/hi/.mustflow/skills/readme-authoring/SKILL.md +115 -0
- package/templates/default/locales/hi/.mustflow/skills/repo-improvement-loop/SKILL.md +150 -0
- package/templates/default/locales/hi/.mustflow/skills/repro-first-debug/SKILL.md +112 -0
- package/templates/default/locales/hi/.mustflow/skills/requirement-regression-guard/SKILL.md +152 -0
- package/templates/default/locales/hi/.mustflow/skills/result-option/SKILL.md +186 -0
- package/templates/default/locales/hi/.mustflow/skills/security-privacy-review/SKILL.md +116 -0
- package/templates/default/locales/hi/.mustflow/skills/security-regression-tests/SKILL.md +131 -0
- package/templates/default/locales/hi/.mustflow/skills/skill-authoring/SKILL.md +110 -0
- package/templates/default/locales/hi/.mustflow/skills/source-freshness-check/SKILL.md +111 -0
- package/templates/default/locales/hi/.mustflow/skills/state-machine-pattern/SKILL.md +214 -0
- package/templates/default/locales/hi/.mustflow/skills/strategy-pattern/SKILL.md +215 -0
- package/templates/default/locales/hi/.mustflow/skills/structure-discovery-gate/SKILL.md +159 -0
- package/templates/default/locales/hi/.mustflow/skills/test-maintenance/SKILL.md +122 -0
- package/templates/default/locales/hi/.mustflow/skills/ui-quality-gate/SKILL.md +117 -0
- package/templates/default/locales/hi/.mustflow/skills/visual-review-artifact/SKILL.md +127 -0
- package/templates/default/locales/hi/.mustflow/skills/visual-review-artifact/assets/review-template.html +286 -0
- package/templates/default/locales/hi/.mustflow/skills/visual-review-artifact/resources.toml +7 -0
- package/templates/default/locales/hi/.mustflow/skills/web-asset-optimization/SKILL.md +108 -0
- package/templates/default/locales/hi/AGENTS.md +83 -0
- package/templates/default/locales/ko/.mustflow/context/INDEX.md +39 -0
- package/templates/default/locales/ko/.mustflow/context/PROJECT.md +66 -0
- package/templates/default/locales/ko/.mustflow/docs/agent-workflow.md +506 -0
- package/templates/default/locales/ko/.mustflow/skills/INDEX.md +78 -0
- package/templates/default/locales/ko/.mustflow/skills/adapter-boundary/SKILL.md +193 -0
- package/templates/default/locales/ko/.mustflow/skills/artifact-integrity-check/SKILL.md +114 -0
- package/templates/default/locales/ko/.mustflow/skills/behavior-preserving-refactor/SKILL.md +182 -0
- package/templates/default/locales/ko/.mustflow/skills/code-review/SKILL.md +118 -0
- package/templates/default/locales/ko/.mustflow/skills/codebase-orientation/SKILL.md +115 -0
- package/templates/default/locales/ko/.mustflow/skills/command-pattern/SKILL.md +247 -0
- package/templates/default/locales/ko/.mustflow/skills/composition-over-inheritance/SKILL.md +176 -0
- package/templates/default/locales/ko/.mustflow/skills/contract-sync-check/SKILL.md +116 -0
- package/templates/default/locales/ko/.mustflow/skills/date-number-audit/SKILL.md +116 -0
- package/templates/default/locales/ko/.mustflow/skills/dependency-injection/SKILL.md +161 -0
- package/templates/default/locales/ko/.mustflow/skills/dependency-reality-check/SKILL.md +115 -0
- package/templates/default/locales/ko/.mustflow/skills/diff-risk-review/SKILL.md +136 -0
- package/templates/default/locales/ko/.mustflow/skills/docs-prose-review/SKILL.md +119 -0
- package/templates/default/locales/ko/.mustflow/skills/docs-update/SKILL.md +107 -0
- package/templates/default/locales/ko/.mustflow/skills/external-prompt-injection-defense/SKILL.md +116 -0
- package/templates/default/locales/ko/.mustflow/skills/facade-pattern/SKILL.md +210 -0
- package/templates/default/locales/ko/.mustflow/skills/failure-triage/SKILL.md +119 -0
- package/templates/default/locales/ko/.mustflow/skills/instruction-conflict-scope-check/SKILL.md +118 -0
- package/templates/default/locales/ko/.mustflow/skills/line-ending-hygiene/SKILL.md +111 -0
- package/templates/default/locales/ko/.mustflow/skills/migration-safety-check/SKILL.md +117 -0
- package/templates/default/locales/ko/.mustflow/skills/multi-agent-work-coordination/SKILL.md +259 -0
- package/templates/default/locales/ko/.mustflow/skills/null-object-pattern/SKILL.md +196 -0
- package/templates/default/locales/ko/.mustflow/skills/pattern-scout/SKILL.md +110 -0
- package/templates/default/locales/ko/.mustflow/skills/performance-budget-check/SKILL.md +121 -0
- package/templates/default/locales/ko/.mustflow/skills/project-context-authoring/SKILL.md +107 -0
- package/templates/default/locales/ko/.mustflow/skills/pure-core-imperative-shell/SKILL.md +212 -0
- package/templates/default/locales/ko/.mustflow/skills/readme-authoring/SKILL.md +115 -0
- package/templates/default/locales/ko/.mustflow/skills/repo-improvement-loop/SKILL.md +150 -0
- package/templates/default/locales/ko/.mustflow/skills/repro-first-debug/SKILL.md +112 -0
- package/templates/default/locales/ko/.mustflow/skills/requirement-regression-guard/SKILL.md +152 -0
- package/templates/default/locales/ko/.mustflow/skills/result-option/SKILL.md +186 -0
- package/templates/default/locales/ko/.mustflow/skills/security-privacy-review/SKILL.md +116 -0
- package/templates/default/locales/ko/.mustflow/skills/security-regression-tests/SKILL.md +131 -0
- package/templates/default/locales/ko/.mustflow/skills/skill-authoring/SKILL.md +110 -0
- package/templates/default/locales/ko/.mustflow/skills/source-freshness-check/SKILL.md +111 -0
- package/templates/default/locales/ko/.mustflow/skills/state-machine-pattern/SKILL.md +214 -0
- package/templates/default/locales/ko/.mustflow/skills/strategy-pattern/SKILL.md +215 -0
- package/templates/default/locales/ko/.mustflow/skills/structure-discovery-gate/SKILL.md +159 -0
- package/templates/default/locales/ko/.mustflow/skills/test-maintenance/SKILL.md +130 -0
- package/templates/default/locales/ko/.mustflow/skills/ui-quality-gate/SKILL.md +117 -0
- package/templates/default/locales/ko/.mustflow/skills/visual-review-artifact/SKILL.md +127 -0
- package/templates/default/locales/ko/.mustflow/skills/visual-review-artifact/assets/review-template.html +286 -0
- package/templates/default/locales/ko/.mustflow/skills/visual-review-artifact/resources.toml +7 -0
- package/templates/default/locales/ko/.mustflow/skills/web-asset-optimization/SKILL.md +108 -0
- package/templates/default/locales/ko/AGENTS.md +85 -0
- package/templates/default/locales/zh/.mustflow/context/INDEX.md +39 -0
- package/templates/default/locales/zh/.mustflow/context/PROJECT.md +64 -0
- package/templates/default/locales/zh/.mustflow/docs/agent-workflow.md +310 -0
- package/templates/default/locales/zh/.mustflow/skills/INDEX.md +78 -0
- package/templates/default/locales/zh/.mustflow/skills/adapter-boundary/SKILL.md +193 -0
- package/templates/default/locales/zh/.mustflow/skills/artifact-integrity-check/SKILL.md +114 -0
- package/templates/default/locales/zh/.mustflow/skills/behavior-preserving-refactor/SKILL.md +182 -0
- package/templates/default/locales/zh/.mustflow/skills/code-review/SKILL.md +115 -0
- package/templates/default/locales/zh/.mustflow/skills/codebase-orientation/SKILL.md +115 -0
- package/templates/default/locales/zh/.mustflow/skills/command-pattern/SKILL.md +247 -0
- package/templates/default/locales/zh/.mustflow/skills/composition-over-inheritance/SKILL.md +176 -0
- package/templates/default/locales/zh/.mustflow/skills/contract-sync-check/SKILL.md +116 -0
- package/templates/default/locales/zh/.mustflow/skills/date-number-audit/SKILL.md +116 -0
- package/templates/default/locales/zh/.mustflow/skills/dependency-injection/SKILL.md +161 -0
- package/templates/default/locales/zh/.mustflow/skills/dependency-reality-check/SKILL.md +115 -0
- package/templates/default/locales/zh/.mustflow/skills/diff-risk-review/SKILL.md +136 -0
- package/templates/default/locales/zh/.mustflow/skills/docs-prose-review/SKILL.md +119 -0
- package/templates/default/locales/zh/.mustflow/skills/docs-update/SKILL.md +97 -0
- package/templates/default/locales/zh/.mustflow/skills/external-prompt-injection-defense/SKILL.md +116 -0
- package/templates/default/locales/zh/.mustflow/skills/facade-pattern/SKILL.md +210 -0
- package/templates/default/locales/zh/.mustflow/skills/failure-triage/SKILL.md +96 -0
- package/templates/default/locales/zh/.mustflow/skills/instruction-conflict-scope-check/SKILL.md +118 -0
- package/templates/default/locales/zh/.mustflow/skills/line-ending-hygiene/SKILL.md +111 -0
- package/templates/default/locales/zh/.mustflow/skills/migration-safety-check/SKILL.md +117 -0
- package/templates/default/locales/zh/.mustflow/skills/multi-agent-work-coordination/SKILL.md +260 -0
- package/templates/default/locales/zh/.mustflow/skills/null-object-pattern/SKILL.md +196 -0
- package/templates/default/locales/zh/.mustflow/skills/pattern-scout/SKILL.md +110 -0
- package/templates/default/locales/zh/.mustflow/skills/performance-budget-check/SKILL.md +121 -0
- package/templates/default/locales/zh/.mustflow/skills/project-context-authoring/SKILL.md +107 -0
- package/templates/default/locales/zh/.mustflow/skills/pure-core-imperative-shell/SKILL.md +212 -0
- package/templates/default/locales/zh/.mustflow/skills/readme-authoring/SKILL.md +115 -0
- package/templates/default/locales/zh/.mustflow/skills/repo-improvement-loop/SKILL.md +150 -0
- package/templates/default/locales/zh/.mustflow/skills/repro-first-debug/SKILL.md +112 -0
- package/templates/default/locales/zh/.mustflow/skills/requirement-regression-guard/SKILL.md +152 -0
- package/templates/default/locales/zh/.mustflow/skills/result-option/SKILL.md +186 -0
- package/templates/default/locales/zh/.mustflow/skills/security-privacy-review/SKILL.md +116 -0
- package/templates/default/locales/zh/.mustflow/skills/security-regression-tests/SKILL.md +131 -0
- package/templates/default/locales/zh/.mustflow/skills/skill-authoring/SKILL.md +110 -0
- package/templates/default/locales/zh/.mustflow/skills/source-freshness-check/SKILL.md +111 -0
- package/templates/default/locales/zh/.mustflow/skills/state-machine-pattern/SKILL.md +214 -0
- package/templates/default/locales/zh/.mustflow/skills/strategy-pattern/SKILL.md +215 -0
- package/templates/default/locales/zh/.mustflow/skills/structure-discovery-gate/SKILL.md +159 -0
- package/templates/default/locales/zh/.mustflow/skills/test-maintenance/SKILL.md +122 -0
- package/templates/default/locales/zh/.mustflow/skills/ui-quality-gate/SKILL.md +117 -0
- package/templates/default/locales/zh/.mustflow/skills/visual-review-artifact/SKILL.md +127 -0
- package/templates/default/locales/zh/.mustflow/skills/visual-review-artifact/assets/review-template.html +286 -0
- package/templates/default/locales/zh/.mustflow/skills/visual-review-artifact/resources.toml +7 -0
- package/templates/default/locales/zh/.mustflow/skills/web-asset-optimization/SKILL.md +108 -0
- package/templates/default/locales/zh/AGENTS.md +86 -0
- package/templates/default/manifest.toml +339 -0
|
@@ -0,0 +1,405 @@
|
|
|
1
|
+
import { existsSync, readFileSync, writeFileSync } from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import { isRecord } from './command-contract.js';
|
|
4
|
+
import { isLocaleTag } from './locale-tags.js';
|
|
5
|
+
import { markManifestLockFileCustomized } from './manifest-lock.js';
|
|
6
|
+
import { COMMIT_MESSAGE_STYLES, TEST_AUTHORING_POLICIES } from './preferences-options.js';
|
|
7
|
+
import { readTomlFile } from './toml.js';
|
|
8
|
+
const PREFERENCES_RELATIVE_PATH = '.mustflow/config/preferences.toml';
|
|
9
|
+
export const DASHBOARD_PREFERENCE_SETTINGS = [
|
|
10
|
+
{
|
|
11
|
+
id: 'git.auto_stage',
|
|
12
|
+
path: ['git', 'auto_stage'],
|
|
13
|
+
label: 'Git auto stage',
|
|
14
|
+
kind: 'boolean',
|
|
15
|
+
fallback: false,
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
id: 'git.auto_commit',
|
|
19
|
+
path: ['git', 'auto_commit'],
|
|
20
|
+
label: 'Git auto commit',
|
|
21
|
+
kind: 'boolean',
|
|
22
|
+
fallback: false,
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
id: 'git.auto_push',
|
|
26
|
+
path: ['git', 'auto_push'],
|
|
27
|
+
label: 'Git auto push',
|
|
28
|
+
kind: 'boolean',
|
|
29
|
+
fallback: false,
|
|
30
|
+
locked: true,
|
|
31
|
+
lockedReason: 'dashboard.locked.git.auto_push',
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
id: 'git.commit_message.style',
|
|
35
|
+
path: ['git', 'commit_message', 'style'],
|
|
36
|
+
label: 'Commit message style',
|
|
37
|
+
kind: 'select',
|
|
38
|
+
fallback: 'conventional',
|
|
39
|
+
options: COMMIT_MESSAGE_STYLES,
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
id: 'git.commit_message.language',
|
|
43
|
+
path: ['git', 'commit_message', 'language'],
|
|
44
|
+
label: 'Commit message language',
|
|
45
|
+
kind: 'select',
|
|
46
|
+
fallback: 'preserve_existing',
|
|
47
|
+
options: ['preserve_existing', 'agent_response', 'docs', 'en', 'ko', 'zh', 'es', 'fr', 'hi'],
|
|
48
|
+
acceptsLocaleTag: true,
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
id: 'git.commit_message.max_suggestions',
|
|
52
|
+
path: ['git', 'commit_message', 'max_suggestions'],
|
|
53
|
+
label: 'Commit message suggestion count',
|
|
54
|
+
kind: 'number',
|
|
55
|
+
fallback: 2,
|
|
56
|
+
min: 1,
|
|
57
|
+
max: 5,
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
id: 'git.commit_message.include_body',
|
|
61
|
+
path: ['git', 'commit_message', 'include_body'],
|
|
62
|
+
label: 'Commit body',
|
|
63
|
+
kind: 'select',
|
|
64
|
+
fallback: 'when_non_trivial',
|
|
65
|
+
options: ['never', 'when_non_trivial', 'always'],
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
id: 'git.commit_message.split_when_multiple_concerns',
|
|
69
|
+
path: ['git', 'commit_message', 'split_when_multiple_concerns'],
|
|
70
|
+
label: 'Suggest split commits',
|
|
71
|
+
kind: 'boolean',
|
|
72
|
+
fallback: true,
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
id: 'git.commit_message.avoid_sensitive_details',
|
|
76
|
+
path: ['git', 'commit_message', 'avoid_sensitive_details'],
|
|
77
|
+
label: 'Avoid sensitive details',
|
|
78
|
+
kind: 'boolean',
|
|
79
|
+
fallback: true,
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
id: 'reporting.commit_suggestion.enabled',
|
|
83
|
+
path: ['reporting', 'commit_suggestion', 'enabled'],
|
|
84
|
+
label: 'Commit message suggestions',
|
|
85
|
+
kind: 'boolean',
|
|
86
|
+
fallback: true,
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
id: 'verification.selection.strategy',
|
|
90
|
+
path: ['verification', 'selection', 'strategy'],
|
|
91
|
+
label: 'Verification strategy',
|
|
92
|
+
kind: 'select',
|
|
93
|
+
fallback: 'risk_based',
|
|
94
|
+
options: ['risk_based', 'targeted', 'full'],
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
id: 'verification.selection.prefer_related_tests',
|
|
98
|
+
path: ['verification', 'selection', 'prefer_related_tests'],
|
|
99
|
+
label: 'Prefer related tests',
|
|
100
|
+
kind: 'boolean',
|
|
101
|
+
fallback: true,
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
id: 'verification.selection.skip_docs_only_full_test',
|
|
105
|
+
path: ['verification', 'selection', 'skip_docs_only_full_test'],
|
|
106
|
+
label: 'Skip full test for docs-only changes',
|
|
107
|
+
kind: 'boolean',
|
|
108
|
+
fallback: true,
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
id: 'verification.selection.skip_low_risk_code_full_test',
|
|
112
|
+
path: ['verification', 'selection', 'skip_low_risk_code_full_test'],
|
|
113
|
+
label: 'Skip full test for low-risk code changes',
|
|
114
|
+
kind: 'boolean',
|
|
115
|
+
fallback: true,
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
id: 'verification.selection.skip_translation_only_full_test',
|
|
119
|
+
path: ['verification', 'selection', 'skip_translation_only_full_test'],
|
|
120
|
+
label: 'Skip full test for translation-only changes',
|
|
121
|
+
kind: 'boolean',
|
|
122
|
+
fallback: true,
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
id: 'verification.selection.skip_copy_only_full_test',
|
|
126
|
+
path: ['verification', 'selection', 'skip_copy_only_full_test'],
|
|
127
|
+
label: 'Skip full test for copy-only changes',
|
|
128
|
+
kind: 'boolean',
|
|
129
|
+
fallback: true,
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
id: 'verification.selection.report_skipped',
|
|
133
|
+
path: ['verification', 'selection', 'report_skipped'],
|
|
134
|
+
label: 'Report skipped verification',
|
|
135
|
+
kind: 'boolean',
|
|
136
|
+
fallback: true,
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
id: 'testing.authoring.new_test_policy',
|
|
140
|
+
path: ['testing', 'authoring', 'new_test_policy'],
|
|
141
|
+
label: 'New test policy',
|
|
142
|
+
kind: 'select',
|
|
143
|
+
fallback: 'evidence_required',
|
|
144
|
+
options: TEST_AUTHORING_POLICIES,
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
id: 'testing.authoring.prefer_existing_tests',
|
|
148
|
+
path: ['testing', 'authoring', 'prefer_existing_tests'],
|
|
149
|
+
label: 'Prefer existing tests',
|
|
150
|
+
kind: 'boolean',
|
|
151
|
+
fallback: true,
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
id: 'testing.authoring.require_new_test_rationale',
|
|
155
|
+
path: ['testing', 'authoring', 'require_new_test_rationale'],
|
|
156
|
+
label: 'Require new test rationale',
|
|
157
|
+
kind: 'boolean',
|
|
158
|
+
fallback: true,
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
id: 'code_style.avoid_drive_by_refactors',
|
|
162
|
+
path: ['code_style', 'avoid_drive_by_refactors'],
|
|
163
|
+
label: 'Avoid drive-by refactors',
|
|
164
|
+
kind: 'boolean',
|
|
165
|
+
fallback: true,
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
id: 'refactoring.hotspots.large_file_candidate_kb',
|
|
169
|
+
path: ['refactoring', 'hotspots', 'large_file_candidate_kb'],
|
|
170
|
+
label: 'Large file candidate threshold',
|
|
171
|
+
kind: 'number',
|
|
172
|
+
fallback: 40,
|
|
173
|
+
min: 1,
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
id: 'refactoring.hotspots.history_days',
|
|
177
|
+
path: ['refactoring', 'hotspots', 'history_days'],
|
|
178
|
+
label: 'Hotspot history window',
|
|
179
|
+
kind: 'number',
|
|
180
|
+
fallback: 90,
|
|
181
|
+
min: 1,
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
id: 'refactoring.hotspots.primary_candidate_limit',
|
|
185
|
+
path: ['refactoring', 'hotspots', 'primary_candidate_limit'],
|
|
186
|
+
label: 'Primary hotspot candidate limit',
|
|
187
|
+
kind: 'number',
|
|
188
|
+
fallback: 50,
|
|
189
|
+
min: 1,
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
id: 'refactoring.hotspots.structure_candidate_limit',
|
|
193
|
+
path: ['refactoring', 'hotspots', 'structure_candidate_limit'],
|
|
194
|
+
label: 'Structure review candidate limit',
|
|
195
|
+
kind: 'number',
|
|
196
|
+
fallback: 10,
|
|
197
|
+
min: 1,
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
id: 'refactoring.hotspots.full_file_candidate_limit',
|
|
201
|
+
path: ['refactoring', 'hotspots', 'full_file_candidate_limit'],
|
|
202
|
+
label: 'Full-file review candidate limit',
|
|
203
|
+
kind: 'number',
|
|
204
|
+
fallback: 3,
|
|
205
|
+
min: 1,
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
id: 'release.versioning.impact_check',
|
|
209
|
+
path: ['release', 'versioning', 'impact_check'],
|
|
210
|
+
label: 'Version impact check',
|
|
211
|
+
kind: 'boolean',
|
|
212
|
+
fallback: true,
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
id: 'release.versioning.suggest_bump',
|
|
216
|
+
path: ['release', 'versioning', 'suggest_bump'],
|
|
217
|
+
label: 'Suggest version bump',
|
|
218
|
+
kind: 'boolean',
|
|
219
|
+
fallback: true,
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
id: 'release.versioning.auto_bump',
|
|
223
|
+
path: ['release', 'versioning', 'auto_bump'],
|
|
224
|
+
label: 'Auto bump versions',
|
|
225
|
+
kind: 'boolean',
|
|
226
|
+
fallback: false,
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
id: 'release.versioning.require_user_confirmation',
|
|
230
|
+
path: ['release', 'versioning', 'require_user_confirmation'],
|
|
231
|
+
label: 'Require version confirmation',
|
|
232
|
+
kind: 'boolean',
|
|
233
|
+
fallback: true,
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
id: 'release.versioning.sync_template_version',
|
|
237
|
+
path: ['release', 'versioning', 'sync_template_version'],
|
|
238
|
+
label: 'Sync template version',
|
|
239
|
+
kind: 'boolean',
|
|
240
|
+
fallback: true,
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
id: 'release.versioning.sync_docs_examples',
|
|
244
|
+
path: ['release', 'versioning', 'sync_docs_examples'],
|
|
245
|
+
label: 'Sync docs examples',
|
|
246
|
+
kind: 'boolean',
|
|
247
|
+
fallback: true,
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
id: 'release.versioning.sync_tests',
|
|
251
|
+
path: ['release', 'versioning', 'sync_tests'],
|
|
252
|
+
label: 'Sync tests',
|
|
253
|
+
kind: 'boolean',
|
|
254
|
+
fallback: true,
|
|
255
|
+
},
|
|
256
|
+
];
|
|
257
|
+
function getPreferencesPath(projectRoot) {
|
|
258
|
+
return path.join(projectRoot, PREFERENCES_RELATIVE_PATH);
|
|
259
|
+
}
|
|
260
|
+
function getNestedValue(table, settingPath) {
|
|
261
|
+
let current = table;
|
|
262
|
+
for (const segment of settingPath) {
|
|
263
|
+
if (!isRecord(current)) {
|
|
264
|
+
return undefined;
|
|
265
|
+
}
|
|
266
|
+
current = current[segment];
|
|
267
|
+
}
|
|
268
|
+
return current;
|
|
269
|
+
}
|
|
270
|
+
function normalizeValue(definition, value) {
|
|
271
|
+
if (definition.kind === 'boolean') {
|
|
272
|
+
return typeof value === 'boolean' ? value : definition.fallback;
|
|
273
|
+
}
|
|
274
|
+
if (definition.kind === 'number') {
|
|
275
|
+
return typeof value === 'number' && Number.isInteger(value) ? value : definition.fallback;
|
|
276
|
+
}
|
|
277
|
+
return typeof value === 'string' && value.trim().length > 0 ? value : definition.fallback;
|
|
278
|
+
}
|
|
279
|
+
export function readDashboardPreferences(projectRoot) {
|
|
280
|
+
const preferencesPath = getPreferencesPath(projectRoot);
|
|
281
|
+
if (!existsSync(preferencesPath)) {
|
|
282
|
+
throw new Error('Missing .mustflow/config/preferences.toml. Run mf init first or switch to a mustflow root.');
|
|
283
|
+
}
|
|
284
|
+
const parsed = readTomlFile(preferencesPath);
|
|
285
|
+
if (!isRecord(parsed)) {
|
|
286
|
+
throw new Error('.mustflow/config/preferences.toml must contain a TOML table.');
|
|
287
|
+
}
|
|
288
|
+
const settings = DASHBOARD_PREFERENCE_SETTINGS.map((definition) => ({
|
|
289
|
+
...definition,
|
|
290
|
+
editable: definition.locked !== true,
|
|
291
|
+
value: normalizeValue(definition, getNestedValue(parsed, definition.path)),
|
|
292
|
+
}));
|
|
293
|
+
return {
|
|
294
|
+
projectRoot,
|
|
295
|
+
preferencesPath,
|
|
296
|
+
settings,
|
|
297
|
+
};
|
|
298
|
+
}
|
|
299
|
+
function serializeTomlScalar(value) {
|
|
300
|
+
if (typeof value === 'string') {
|
|
301
|
+
return JSON.stringify(value);
|
|
302
|
+
}
|
|
303
|
+
return String(value);
|
|
304
|
+
}
|
|
305
|
+
function escapeRegExp(value) {
|
|
306
|
+
return value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
307
|
+
}
|
|
308
|
+
function findSectionRange(lines, sectionPath) {
|
|
309
|
+
const sectionName = sectionPath.join('.');
|
|
310
|
+
const sectionPattern = new RegExp(`^\\s*\\[${escapeRegExp(sectionName)}\\]\\s*$`, 'u');
|
|
311
|
+
const anySectionPattern = /^\s*\[[^\]]+\]\s*$/u;
|
|
312
|
+
const start = lines.findIndex((line) => sectionPattern.test(line));
|
|
313
|
+
if (start < 0) {
|
|
314
|
+
return undefined;
|
|
315
|
+
}
|
|
316
|
+
let end = lines.length;
|
|
317
|
+
for (let index = start + 1; index < lines.length; index += 1) {
|
|
318
|
+
if (anySectionPattern.test(lines[index] ?? '')) {
|
|
319
|
+
end = index;
|
|
320
|
+
break;
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
return [start, end];
|
|
324
|
+
}
|
|
325
|
+
function setTomlScalar(content, settingPath, value) {
|
|
326
|
+
const newline = content.includes('\r\n') ? '\r\n' : '\n';
|
|
327
|
+
const lines = content.split(/\r?\n/u);
|
|
328
|
+
const key = settingPath[settingPath.length - 1];
|
|
329
|
+
const sectionPath = settingPath.slice(0, -1);
|
|
330
|
+
const assignment = `${key} = ${serializeTomlScalar(value)}`;
|
|
331
|
+
if (!key || sectionPath.length === 0) {
|
|
332
|
+
throw new Error(`Unsupported dashboard preference path: ${settingPath.join('.')}`);
|
|
333
|
+
}
|
|
334
|
+
const sectionRange = findSectionRange(lines, sectionPath);
|
|
335
|
+
if (!sectionRange) {
|
|
336
|
+
const prefix = lines.length > 0 && lines[lines.length - 1] === '' ? '' : newline;
|
|
337
|
+
return `${content}${prefix}${newline}[${sectionPath.join('.')}]${newline}${assignment}${newline}`;
|
|
338
|
+
}
|
|
339
|
+
const [start, end] = sectionRange;
|
|
340
|
+
const keyPattern = new RegExp(`^\\s*${escapeRegExp(key)}\\s*=`, 'u');
|
|
341
|
+
for (let index = start + 1; index < end; index += 1) {
|
|
342
|
+
if (keyPattern.test(lines[index] ?? '')) {
|
|
343
|
+
const updated = [...lines];
|
|
344
|
+
updated[index] = assignment;
|
|
345
|
+
return updated.join(newline);
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
const updated = [...lines];
|
|
349
|
+
updated.splice(end, 0, assignment);
|
|
350
|
+
return updated.join(newline);
|
|
351
|
+
}
|
|
352
|
+
function coerceUpdateValue(definition, value) {
|
|
353
|
+
if (definition.locked) {
|
|
354
|
+
throw new Error(`${definition.id} is locked in the dashboard.`);
|
|
355
|
+
}
|
|
356
|
+
if (definition.kind === 'boolean') {
|
|
357
|
+
if (typeof value !== 'boolean') {
|
|
358
|
+
throw new Error(`${definition.id} must be a boolean.`);
|
|
359
|
+
}
|
|
360
|
+
return value;
|
|
361
|
+
}
|
|
362
|
+
if (definition.kind === 'number') {
|
|
363
|
+
if (!Number.isInteger(value)) {
|
|
364
|
+
throw new Error(`${definition.id} must be an integer.`);
|
|
365
|
+
}
|
|
366
|
+
if (definition.min !== undefined && Number(value) < definition.min) {
|
|
367
|
+
throw new Error(`${definition.id} must be at least ${definition.min}.`);
|
|
368
|
+
}
|
|
369
|
+
if (definition.max !== undefined && Number(value) > definition.max) {
|
|
370
|
+
throw new Error(`${definition.id} must be at most ${definition.max}.`);
|
|
371
|
+
}
|
|
372
|
+
return Number(value);
|
|
373
|
+
}
|
|
374
|
+
if (typeof value !== 'string') {
|
|
375
|
+
throw new Error(`${definition.id} must be a string.`);
|
|
376
|
+
}
|
|
377
|
+
const trimmedValue = value.trim();
|
|
378
|
+
if (trimmedValue.length === 0) {
|
|
379
|
+
throw new Error(`${definition.id} must not be empty.`);
|
|
380
|
+
}
|
|
381
|
+
if (definition.options && !definition.options.includes(trimmedValue)) {
|
|
382
|
+
if (definition.acceptsLocaleTag && isLocaleTag(trimmedValue)) {
|
|
383
|
+
return trimmedValue;
|
|
384
|
+
}
|
|
385
|
+
const extra = definition.acceptsLocaleTag ? ', or a valid locale tag' : '';
|
|
386
|
+
throw new Error(`${definition.id} must be one of: ${definition.options.join(', ')}${extra}.`);
|
|
387
|
+
}
|
|
388
|
+
return trimmedValue;
|
|
389
|
+
}
|
|
390
|
+
export function updateDashboardPreferences(projectRoot, updates) {
|
|
391
|
+
const preferencesPath = getPreferencesPath(projectRoot);
|
|
392
|
+
const definitionsById = new Map(DASHBOARD_PREFERENCE_SETTINGS.map((definition) => [definition.id, definition]));
|
|
393
|
+
let content = readFileSync(preferencesPath, 'utf8');
|
|
394
|
+
for (const update of updates) {
|
|
395
|
+
const definition = definitionsById.get(update.id);
|
|
396
|
+
if (!definition) {
|
|
397
|
+
throw new Error(`Unknown dashboard preference: ${update.id}`);
|
|
398
|
+
}
|
|
399
|
+
const value = coerceUpdateValue(definition, update.value);
|
|
400
|
+
content = setTomlScalar(content, definition.path, value);
|
|
401
|
+
}
|
|
402
|
+
writeFileSync(preferencesPath, content);
|
|
403
|
+
markManifestLockFileCustomized(projectRoot, PREFERENCES_RELATIVE_PATH);
|
|
404
|
+
return readDashboardPreferences(projectRoot);
|
|
405
|
+
}
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
import { existsSync } from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import { triageDocReview } from '../../core/doc-review-triage.js';
|
|
4
|
+
import { ensureInside, ensureInsideWithoutSymlinks, readUtf8FileInsideWithoutSymlinks, toPosixPath, writeUtf8FileInsideWithoutSymlinks, } from './filesystem.js';
|
|
5
|
+
import { parseTomlText, stringifyToml } from './toml.js';
|
|
6
|
+
export const DOC_REVIEW_LEDGER_RELATIVE_PATH = '.mustflow/review/docs.toml';
|
|
7
|
+
export const DOC_REVIEW_STATUSES = ['pending', 'in_review', 'changes_made', 'approved', 'needs_human', 'ignored'];
|
|
8
|
+
export const DOC_REVIEW_ACTIVE_STATUSES = ['pending', 'in_review', 'changes_made', 'needs_human'];
|
|
9
|
+
export const REVIEWER_KINDS = ['human', 'llm', 'tool', 'external'];
|
|
10
|
+
function isRecord(value) {
|
|
11
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
12
|
+
}
|
|
13
|
+
function readOptionalString(value) {
|
|
14
|
+
return typeof value === 'string' && value.trim().length > 0 ? value : undefined;
|
|
15
|
+
}
|
|
16
|
+
export function isDocReviewStatus(value) {
|
|
17
|
+
return typeof value === 'string' && DOC_REVIEW_STATUSES.includes(value);
|
|
18
|
+
}
|
|
19
|
+
export function isReviewerKind(value) {
|
|
20
|
+
return typeof value === 'string' && REVIEWER_KINDS.includes(value);
|
|
21
|
+
}
|
|
22
|
+
function parseReviewerKind(value, fallback) {
|
|
23
|
+
if (value === undefined) {
|
|
24
|
+
return fallback;
|
|
25
|
+
}
|
|
26
|
+
if (!isReviewerKind(value)) {
|
|
27
|
+
throw new Error(`reviewer kind must be one of: ${REVIEWER_KINDS.join(', ')}`);
|
|
28
|
+
}
|
|
29
|
+
return value;
|
|
30
|
+
}
|
|
31
|
+
function nowIso(now) {
|
|
32
|
+
return now ?? new Date().toISOString();
|
|
33
|
+
}
|
|
34
|
+
function normalizePath(projectRoot, inputPath) {
|
|
35
|
+
if (inputPath.trim().length === 0) {
|
|
36
|
+
throw new Error('document path must be a non-empty string');
|
|
37
|
+
}
|
|
38
|
+
const absolutePath = path.resolve(projectRoot, inputPath);
|
|
39
|
+
ensureInside(projectRoot, absolutePath);
|
|
40
|
+
return toPosixPath(path.relative(projectRoot, absolutePath));
|
|
41
|
+
}
|
|
42
|
+
function parseDocReviewEntry(value) {
|
|
43
|
+
if (!isRecord(value)) {
|
|
44
|
+
throw new Error('document review entry must be a table');
|
|
45
|
+
}
|
|
46
|
+
const pathValue = readOptionalString(value.path);
|
|
47
|
+
if (!pathValue) {
|
|
48
|
+
throw new Error('document review entry path must be a non-empty string');
|
|
49
|
+
}
|
|
50
|
+
if (!isDocReviewStatus(value.status)) {
|
|
51
|
+
throw new Error(`document review status must be one of: ${DOC_REVIEW_STATUSES.join(', ')}`);
|
|
52
|
+
}
|
|
53
|
+
return {
|
|
54
|
+
path: pathValue,
|
|
55
|
+
status: value.status,
|
|
56
|
+
origin: readOptionalString(value.origin) ?? 'llm_modified',
|
|
57
|
+
reason: readOptionalString(value.reason) ?? 'document requires review',
|
|
58
|
+
first_seen_at: readOptionalString(value.first_seen_at) ?? readOptionalString(value.last_touched_at) ?? nowIso(),
|
|
59
|
+
last_touched_at: readOptionalString(value.last_touched_at) ?? nowIso(),
|
|
60
|
+
last_touched_by_kind: parseReviewerKind(value.last_touched_by_kind),
|
|
61
|
+
last_touched_by_id: readOptionalString(value.last_touched_by_id),
|
|
62
|
+
reviewed_at: readOptionalString(value.reviewed_at),
|
|
63
|
+
reviewer_kind: parseReviewerKind(value.reviewer_kind),
|
|
64
|
+
reviewer_id: readOptionalString(value.reviewer_id),
|
|
65
|
+
reviewer_label: readOptionalString(value.reviewer_label),
|
|
66
|
+
reviewer_provider: readOptionalString(value.reviewer_provider),
|
|
67
|
+
reviewer_model: readOptionalString(value.reviewer_model),
|
|
68
|
+
reviewer_command_intent: readOptionalString(value.reviewer_command_intent),
|
|
69
|
+
review_summary: readOptionalString(value.review_summary),
|
|
70
|
+
review_comment: readOptionalString(value.review_comment),
|
|
71
|
+
commented_at: readOptionalString(value.commented_at),
|
|
72
|
+
commented_by_kind: parseReviewerKind(value.commented_by_kind),
|
|
73
|
+
commented_by_id: readOptionalString(value.commented_by_id),
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
function readLedgerFile(projectRoot) {
|
|
77
|
+
const ledgerPath = path.join(projectRoot, DOC_REVIEW_LEDGER_RELATIVE_PATH);
|
|
78
|
+
const ledgerDirectoryPath = path.dirname(ledgerPath);
|
|
79
|
+
ensureInside(projectRoot, ledgerPath);
|
|
80
|
+
ensureInsideWithoutSymlinks(projectRoot, ledgerDirectoryPath, { allowMissingLeaf: true });
|
|
81
|
+
if (!existsSync(ledgerDirectoryPath)) {
|
|
82
|
+
return { schema_version: '1', documents: [] };
|
|
83
|
+
}
|
|
84
|
+
ensureInsideWithoutSymlinks(projectRoot, ledgerPath, { allowMissingLeaf: true });
|
|
85
|
+
if (!existsSync(ledgerPath)) {
|
|
86
|
+
return { schema_version: '1', documents: [] };
|
|
87
|
+
}
|
|
88
|
+
const parsed = parseTomlText(readUtf8FileInsideWithoutSymlinks(projectRoot, ledgerPath));
|
|
89
|
+
if (!isRecord(parsed)) {
|
|
90
|
+
throw new Error(`${DOC_REVIEW_LEDGER_RELATIVE_PATH} must contain a TOML table`);
|
|
91
|
+
}
|
|
92
|
+
const documents = Array.isArray(parsed.documents) ? parsed.documents.map(parseDocReviewEntry) : [];
|
|
93
|
+
return {
|
|
94
|
+
schema_version: readOptionalString(parsed.schema_version) ?? '1',
|
|
95
|
+
documents,
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
function entryToToml(entry) {
|
|
99
|
+
const table = {
|
|
100
|
+
path: entry.path,
|
|
101
|
+
status: entry.status,
|
|
102
|
+
origin: entry.origin,
|
|
103
|
+
reason: entry.reason,
|
|
104
|
+
first_seen_at: entry.first_seen_at,
|
|
105
|
+
last_touched_at: entry.last_touched_at,
|
|
106
|
+
};
|
|
107
|
+
for (const key of [
|
|
108
|
+
'last_touched_by_kind',
|
|
109
|
+
'last_touched_by_id',
|
|
110
|
+
'reviewed_at',
|
|
111
|
+
'reviewer_kind',
|
|
112
|
+
'reviewer_id',
|
|
113
|
+
'reviewer_label',
|
|
114
|
+
'reviewer_provider',
|
|
115
|
+
'reviewer_model',
|
|
116
|
+
'reviewer_command_intent',
|
|
117
|
+
'review_summary',
|
|
118
|
+
'review_comment',
|
|
119
|
+
'commented_at',
|
|
120
|
+
'commented_by_kind',
|
|
121
|
+
'commented_by_id',
|
|
122
|
+
]) {
|
|
123
|
+
const value = entry[key];
|
|
124
|
+
if (value) {
|
|
125
|
+
table[key] = value;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
return table;
|
|
129
|
+
}
|
|
130
|
+
function writeLedgerFile(projectRoot, ledger) {
|
|
131
|
+
const ledgerPath = path.join(projectRoot, DOC_REVIEW_LEDGER_RELATIVE_PATH);
|
|
132
|
+
writeUtf8FileInsideWithoutSymlinks(projectRoot, ledgerPath, stringifyToml({
|
|
133
|
+
schema_version: ledger.schema_version,
|
|
134
|
+
documents: ledger.documents.map(entryToToml),
|
|
135
|
+
}));
|
|
136
|
+
return ledgerPath;
|
|
137
|
+
}
|
|
138
|
+
export function readDocReviewLedger(projectRoot) {
|
|
139
|
+
return readLedgerFile(projectRoot);
|
|
140
|
+
}
|
|
141
|
+
export function listDocReviewEntries(projectRoot, options = {}) {
|
|
142
|
+
const ledger = readLedgerFile(projectRoot);
|
|
143
|
+
const activeStatuses = new Set(DOC_REVIEW_ACTIVE_STATUSES);
|
|
144
|
+
return ledger.documents.filter((entry) => {
|
|
145
|
+
if (options.status) {
|
|
146
|
+
return entry.status === options.status;
|
|
147
|
+
}
|
|
148
|
+
return options.includeAll === true || activeStatuses.has(entry.status);
|
|
149
|
+
}).map((entry) => ({
|
|
150
|
+
...entry,
|
|
151
|
+
...triageDocReview(entry),
|
|
152
|
+
}));
|
|
153
|
+
}
|
|
154
|
+
export function addDocReviewEntry(projectRoot, input) {
|
|
155
|
+
const ledger = readLedgerFile(projectRoot);
|
|
156
|
+
const reviewPath = normalizePath(projectRoot, input.path);
|
|
157
|
+
const timestamp = nowIso(input.now);
|
|
158
|
+
const existing = ledger.documents.find((entry) => entry.path === reviewPath);
|
|
159
|
+
const nextEntry = {
|
|
160
|
+
...existing,
|
|
161
|
+
path: reviewPath,
|
|
162
|
+
status: 'pending',
|
|
163
|
+
origin: input.origin ?? existing?.origin ?? 'llm_modified',
|
|
164
|
+
reason: input.reason ?? existing?.reason ?? 'LLM-created or LLM-modified documentation requires review',
|
|
165
|
+
first_seen_at: existing?.first_seen_at ?? timestamp,
|
|
166
|
+
last_touched_at: timestamp,
|
|
167
|
+
last_touched_by_kind: input.actorKind ?? existing?.last_touched_by_kind,
|
|
168
|
+
last_touched_by_id: input.actorId ?? existing?.last_touched_by_id,
|
|
169
|
+
review_comment: input.comment ?? existing?.review_comment,
|
|
170
|
+
commented_at: input.comment ? timestamp : existing?.commented_at,
|
|
171
|
+
commented_by_kind: input.comment ? input.actorKind : existing?.commented_by_kind,
|
|
172
|
+
commented_by_id: input.comment ? input.actorId : existing?.commented_by_id,
|
|
173
|
+
};
|
|
174
|
+
const documents = existing
|
|
175
|
+
? ledger.documents.map((entry) => (entry.path === reviewPath ? nextEntry : entry))
|
|
176
|
+
: [...ledger.documents, nextEntry].sort((left, right) => left.path.localeCompare(right.path));
|
|
177
|
+
writeLedgerFile(projectRoot, { ...ledger, documents });
|
|
178
|
+
return nextEntry;
|
|
179
|
+
}
|
|
180
|
+
export function commentDocReviewEntry(projectRoot, input) {
|
|
181
|
+
const ledger = readLedgerFile(projectRoot);
|
|
182
|
+
const reviewPath = normalizePath(projectRoot, input.path);
|
|
183
|
+
const existing = ledger.documents.find((entry) => entry.path === reviewPath);
|
|
184
|
+
if (!existing) {
|
|
185
|
+
throw new Error(`document is not in the review queue: ${reviewPath}`);
|
|
186
|
+
}
|
|
187
|
+
const timestamp = nowIso(input.now);
|
|
188
|
+
const nextEntry = {
|
|
189
|
+
...existing,
|
|
190
|
+
status: 'pending',
|
|
191
|
+
last_touched_at: timestamp,
|
|
192
|
+
last_touched_by_kind: input.actorKind ?? existing.last_touched_by_kind,
|
|
193
|
+
last_touched_by_id: input.actorId ?? existing.last_touched_by_id,
|
|
194
|
+
review_comment: input.comment,
|
|
195
|
+
commented_at: timestamp,
|
|
196
|
+
commented_by_kind: input.actorKind,
|
|
197
|
+
commented_by_id: input.actorId,
|
|
198
|
+
};
|
|
199
|
+
const documents = ledger.documents.map((entry) => (entry.path === reviewPath ? nextEntry : entry));
|
|
200
|
+
writeLedgerFile(projectRoot, { ...ledger, documents });
|
|
201
|
+
return nextEntry;
|
|
202
|
+
}
|
|
203
|
+
export function markDocReviewEntry(projectRoot, input) {
|
|
204
|
+
const ledger = readLedgerFile(projectRoot);
|
|
205
|
+
const reviewPath = normalizePath(projectRoot, input.path);
|
|
206
|
+
const existing = ledger.documents.find((entry) => entry.path === reviewPath);
|
|
207
|
+
if (!existing) {
|
|
208
|
+
throw new Error(`document is not in the review queue: ${reviewPath}`);
|
|
209
|
+
}
|
|
210
|
+
const timestamp = nowIso(input.now);
|
|
211
|
+
const nextEntry = {
|
|
212
|
+
...existing,
|
|
213
|
+
status: input.status,
|
|
214
|
+
reviewed_at: timestamp,
|
|
215
|
+
reviewer_kind: input.reviewerKind,
|
|
216
|
+
reviewer_id: input.reviewerId,
|
|
217
|
+
reviewer_label: input.reviewerLabel,
|
|
218
|
+
reviewer_provider: input.reviewerProvider,
|
|
219
|
+
reviewer_model: input.reviewerModel,
|
|
220
|
+
reviewer_command_intent: input.reviewerCommandIntent,
|
|
221
|
+
review_summary: input.summary,
|
|
222
|
+
};
|
|
223
|
+
const documents = ledger.documents.map((entry) => (entry.path === reviewPath ? nextEntry : entry));
|
|
224
|
+
writeLedgerFile(projectRoot, { ...ledger, documents });
|
|
225
|
+
return nextEntry;
|
|
226
|
+
}
|